@vialiq/web-components 0.20.0 → 0.22.0

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 (45) hide show
  1. package/README.md +126 -0
  2. package/base/controllers/floating-controller.d.ts +2 -2
  3. package/base/controllers/floating-controller.d.ts.map +1 -1
  4. package/base/flatpickr-mixin.d.ts +38 -0
  5. package/base/flatpickr-mixin.d.ts.map +1 -0
  6. package/base/validity-mixin.d.ts +2 -0
  7. package/base/validity-mixin.d.ts.map +1 -1
  8. package/date-picker/i18n.d.ts +19 -0
  9. package/date-picker/i18n.d.ts.map +1 -0
  10. package/date-picker/index.d.ts +4 -0
  11. package/date-picker/index.d.ts.map +1 -0
  12. package/date-picker/index.js +2 -0
  13. package/date-picker/iso-week.d.ts +18 -0
  14. package/date-picker/iso-week.d.ts.map +1 -0
  15. package/date-picker/locale-registry.d.ts +8 -0
  16. package/date-picker/locale-registry.d.ts.map +1 -0
  17. package/date-picker/plugin-registry.d.ts +7 -0
  18. package/date-picker/plugin-registry.d.ts.map +1 -0
  19. package/date-picker/plugin-utils.d.ts +10 -0
  20. package/date-picker/plugin-utils.d.ts.map +1 -0
  21. package/date-picker/plugins/vi-month-year-plugin.d.ts +17 -0
  22. package/date-picker/plugins/vi-month-year-plugin.d.ts.map +1 -0
  23. package/date-picker/plugins/vi-range-plugin.d.ts +12 -0
  24. package/date-picker/plugins/vi-range-plugin.d.ts.map +1 -0
  25. package/date-picker/plugins/vi-shadow-dom-plugin.d.ts +18 -0
  26. package/date-picker/plugins/vi-shadow-dom-plugin.d.ts.map +1 -0
  27. package/date-picker/types.d.ts +34 -0
  28. package/date-picker/types.d.ts.map +1 -0
  29. package/date-picker/vi-date-picker-input.d.ts +34 -0
  30. package/date-picker/vi-date-picker-input.d.ts.map +1 -0
  31. package/date-picker/vi-date-picker-input.js +599 -0
  32. package/date-picker/vi-date-picker.d.ts +95 -0
  33. package/date-picker/vi-date-picker.d.ts.map +1 -0
  34. package/date-picker/vi-date-picker.js +2273 -0
  35. package/index.d.ts +7 -0
  36. package/index.js +5 -0
  37. package/input/vi-input.js +1 -1
  38. package/{keyboard-controller-DqpJtUuK.js → keyboard-controller-D3htDhGR.js} +25 -23
  39. package/label/index.d.ts +2 -0
  40. package/label/index.d.ts.map +1 -0
  41. package/label/index.js +1 -0
  42. package/label/vi-label.d.ts +53 -0
  43. package/label/vi-label.d.ts.map +1 -0
  44. package/label/vi-label.js +552 -0
  45. package/package.json +32 -4
@@ -0,0 +1,599 @@
1
+ import { LitElement, nothing, html, unsafeCSS, css } from 'lit';
2
+ import { customElement, property, query } from 'lit/decorators.js';
3
+ import { V as ViElement } from '../vi-element-C6GfDPs3.js';
4
+
5
+ const datePickerInputStyles = "@charset \"UTF-8\";@layer reset,components,utilities;:host{display:block;font-family:var(--vi-font-family-base, var(--vi-font-family-base, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}.input-wrapper{display:flex;flex-direction:column;gap:var(--vi-spacing-xs, var(--vi-spacing-xs, 8px))}.label{font-size:var(--vi-font-size-sm, var(--vi-font-size-sm, 14px));color:var(--vi-text-secondary, var(--vi-text-secondary, #4b5563));font-weight:var(--vi-font-weight-medium, var(--vi-font-weight-medium, 500))}:host([disabled]){cursor:not-allowed;opacity:var(--vi-disabled-opacity, .6)}:host([disabled]) .label,:host([disabled]) .trigger{pointer-events:none}.trigger{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;min-height:var(--vi-input-height, 40px);padding:0 var(--vi-spacing-md, var(--vi-spacing-md, 24px));background:var(--vi-input-bg, var(--vi-layer-01, #ffffff));border:1px solid var(--vi-input-trigger-border-color, var(--vi-border-02, #eeeeee));border-radius:var(--vi-border-radius-md, var(--vi-border-radius-md, 4px));color:var(--vi-text-primary, var(--vi-text-primary, #111827));font-family:inherit;font-size:var(--vi-font-size-base, var(--vi-font-size-base, 16px));text-align:left;cursor:pointer;transition:all .2s ease}.trigger:hover:not(:disabled){background:var(--vi-layer-hover-01, var(--vi-layer-hover-01, #f3f4f6));border-color:var(--vi-border-03, var(--vi-border-03, #e0e0e0))}:host(:focus-within) .trigger{outline:none;border-color:var(--vi-focus, var(--vi-focus, #3676d0));box-shadow:0 0 0 1px var(--vi-focus, var(--vi-focus, #3676d0))}.trigger:disabled{background:var(--vi-layer-disabled, var(--vi-layer-02, #f3f4f6));color:var(--vi-text-disabled, var(--vi-text-disabled, #9e9e9e));cursor:not-allowed;border-color:var(--vi-border-disabled, var(--vi-border-02, #eeeeee))}.display-value{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.placeholder{color:var(--vi-text-placeholder, var(--vi-text-secondary, #4b5563))}.icon{flex-shrink:0;display:flex;align-items:center;color:var(--vi-text-secondary, var(--vi-text-secondary, #4b5563));margin-left:var(--vi-spacing-sm, var(--vi-spacing-sm, 16px))}.trigger:disabled .icon{color:var(--vi-text-disabled, var(--vi-text-disabled, #9e9e9e))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}";
6
+
7
+ function applyDecs2203RFactory() {
8
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
9
+ return function addInitializer(initializer) {
10
+ assertNotFinished(decoratorFinishedRef, "addInitializer");
11
+ assertCallable(initializer, "An initializer");
12
+ initializers.push(initializer);
13
+ };
14
+ }
15
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
16
+ var kindStr;
17
+ switch(kind){
18
+ case 1:
19
+ kindStr = "accessor";
20
+ break;
21
+ case 2:
22
+ kindStr = "method";
23
+ break;
24
+ case 3:
25
+ kindStr = "getter";
26
+ break;
27
+ case 4:
28
+ kindStr = "setter";
29
+ break;
30
+ default:
31
+ kindStr = "field";
32
+ }
33
+ var ctx = {
34
+ kind: kindStr,
35
+ name: isPrivate ? "#" + name : name,
36
+ static: isStatic,
37
+ private: isPrivate,
38
+ metadata: metadata
39
+ };
40
+ var decoratorFinishedRef = {
41
+ v: false
42
+ };
43
+ ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
44
+ var get, set;
45
+ if (kind === 0) {
46
+ if (isPrivate) {
47
+ get = desc.get;
48
+ set = desc.set;
49
+ } else {
50
+ get = function() {
51
+ return this[name];
52
+ };
53
+ set = function(v) {
54
+ this[name] = v;
55
+ };
56
+ }
57
+ } else if (kind === 2) {
58
+ get = function() {
59
+ return desc.value;
60
+ };
61
+ } else {
62
+ if (kind === 1 || kind === 3) {
63
+ get = function() {
64
+ return desc.get.call(this);
65
+ };
66
+ }
67
+ if (kind === 1 || kind === 4) {
68
+ set = function(v) {
69
+ desc.set.call(this, v);
70
+ };
71
+ }
72
+ }
73
+ ctx.access = get && set ? {
74
+ get: get,
75
+ set: set
76
+ } : get ? {
77
+ get: get
78
+ } : {
79
+ set: set
80
+ };
81
+ try {
82
+ return dec(value, ctx);
83
+ } finally{
84
+ decoratorFinishedRef.v = true;
85
+ }
86
+ }
87
+ function assertNotFinished(decoratorFinishedRef, fnName) {
88
+ if (decoratorFinishedRef.v) {
89
+ throw new Error("attempted to call " + fnName + " after decoration was finished");
90
+ }
91
+ }
92
+ function assertCallable(fn, hint) {
93
+ if (typeof fn !== "function") {
94
+ throw new TypeError(hint + " must be a function");
95
+ }
96
+ }
97
+ function assertValidReturnValue(kind, value) {
98
+ var type = typeof value;
99
+ if (kind === 1) {
100
+ if (type !== "object" || value === null) {
101
+ throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
102
+ }
103
+ if (value.get !== undefined) {
104
+ assertCallable(value.get, "accessor.get");
105
+ }
106
+ if (value.set !== undefined) {
107
+ assertCallable(value.set, "accessor.set");
108
+ }
109
+ if (value.init !== undefined) {
110
+ assertCallable(value.init, "accessor.init");
111
+ }
112
+ } else if (type !== "function") {
113
+ var hint;
114
+ if (kind === 0) {
115
+ hint = "field";
116
+ } else if (kind === 10) {
117
+ hint = "class";
118
+ } else {
119
+ hint = "method";
120
+ }
121
+ throw new TypeError(hint + " decorators must return a function or void 0");
122
+ }
123
+ }
124
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
125
+ var decs = decInfo[0];
126
+ var desc, init, value;
127
+ if (isPrivate) {
128
+ if (kind === 0 || kind === 1) {
129
+ desc = {
130
+ get: decInfo[3],
131
+ set: decInfo[4]
132
+ };
133
+ } else if (kind === 3) {
134
+ desc = {
135
+ get: decInfo[3]
136
+ };
137
+ } else if (kind === 4) {
138
+ desc = {
139
+ set: decInfo[3]
140
+ };
141
+ } else {
142
+ desc = {
143
+ value: decInfo[3]
144
+ };
145
+ }
146
+ } else if (kind !== 0) {
147
+ desc = Object.getOwnPropertyDescriptor(base, name);
148
+ }
149
+ if (kind === 1) {
150
+ value = {
151
+ get: desc.get,
152
+ set: desc.set
153
+ };
154
+ } else if (kind === 2) {
155
+ value = desc.value;
156
+ } else if (kind === 3) {
157
+ value = desc.get;
158
+ } else if (kind === 4) {
159
+ value = desc.set;
160
+ }
161
+ var newValue, get, set;
162
+ if (typeof decs === "function") {
163
+ newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
164
+ if (newValue !== void 0) {
165
+ assertValidReturnValue(kind, newValue);
166
+ if (kind === 0) {
167
+ init = newValue;
168
+ } else if (kind === 1) {
169
+ init = newValue.init;
170
+ get = newValue.get || value.get;
171
+ set = newValue.set || value.set;
172
+ value = {
173
+ get: get,
174
+ set: set
175
+ };
176
+ } else {
177
+ value = newValue;
178
+ }
179
+ }
180
+ } else {
181
+ for(var i = decs.length - 1; i >= 0; i--){
182
+ var dec = decs[i];
183
+ newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
184
+ if (newValue !== void 0) {
185
+ assertValidReturnValue(kind, newValue);
186
+ var newInit;
187
+ if (kind === 0) {
188
+ newInit = newValue;
189
+ } else if (kind === 1) {
190
+ newInit = newValue.init;
191
+ get = newValue.get || value.get;
192
+ set = newValue.set || value.set;
193
+ value = {
194
+ get: get,
195
+ set: set
196
+ };
197
+ } else {
198
+ value = newValue;
199
+ }
200
+ if (newInit !== void 0) {
201
+ if (init === void 0) {
202
+ init = newInit;
203
+ } else if (typeof init === "function") {
204
+ init = [
205
+ init,
206
+ newInit
207
+ ];
208
+ } else {
209
+ init.push(newInit);
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+ if (kind === 0 || kind === 1) {
216
+ if (init === void 0) {
217
+ init = function(instance, init) {
218
+ return init;
219
+ };
220
+ } else if (typeof init !== "function") {
221
+ var ownInitializers = init;
222
+ init = function(instance, init) {
223
+ var value = init;
224
+ for(var i = 0; i < ownInitializers.length; i++){
225
+ value = ownInitializers[i].call(instance, value);
226
+ }
227
+ return value;
228
+ };
229
+ } else {
230
+ var originalInitializer = init;
231
+ init = function(instance, init) {
232
+ return originalInitializer.call(instance, init);
233
+ };
234
+ }
235
+ ret.push(init);
236
+ }
237
+ if (kind !== 0) {
238
+ if (kind === 1) {
239
+ desc.get = value.get;
240
+ desc.set = value.set;
241
+ } else if (kind === 2) {
242
+ desc.value = value;
243
+ } else if (kind === 3) {
244
+ desc.get = value;
245
+ } else if (kind === 4) {
246
+ desc.set = value;
247
+ }
248
+ if (isPrivate) {
249
+ if (kind === 1) {
250
+ ret.push(function(instance, args) {
251
+ return value.get.call(instance, args);
252
+ });
253
+ ret.push(function(instance, args) {
254
+ return value.set.call(instance, args);
255
+ });
256
+ } else if (kind === 2) {
257
+ ret.push(value);
258
+ } else {
259
+ ret.push(function(instance, args) {
260
+ return value.call(instance, args);
261
+ });
262
+ }
263
+ } else {
264
+ Object.defineProperty(base, name, desc);
265
+ }
266
+ }
267
+ }
268
+ function applyMemberDecs(Class, decInfos, metadata) {
269
+ var ret = [];
270
+ var protoInitializers;
271
+ var staticInitializers;
272
+ var existingProtoNonFields = new Map();
273
+ var existingStaticNonFields = new Map();
274
+ for(var i = 0; i < decInfos.length; i++){
275
+ var decInfo = decInfos[i];
276
+ if (!Array.isArray(decInfo)) continue;
277
+ var kind = decInfo[1];
278
+ var name = decInfo[2];
279
+ var isPrivate = decInfo.length > 3;
280
+ var isStatic = kind >= 5;
281
+ var base;
282
+ var initializers;
283
+ if (isStatic) {
284
+ base = Class;
285
+ kind = kind - 5;
286
+ staticInitializers = staticInitializers || [];
287
+ initializers = staticInitializers;
288
+ } else {
289
+ base = Class.prototype;
290
+ protoInitializers = protoInitializers || [];
291
+ initializers = protoInitializers;
292
+ }
293
+ if (kind !== 0 && !isPrivate) {
294
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
295
+ var existingKind = existingNonFields.get(name) || 0;
296
+ if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
297
+ throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
298
+ } else if (!existingKind && kind > 2) {
299
+ existingNonFields.set(name, kind);
300
+ } else {
301
+ existingNonFields.set(name, true);
302
+ }
303
+ }
304
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
305
+ }
306
+ pushInitializers(ret, protoInitializers);
307
+ pushInitializers(ret, staticInitializers);
308
+ return ret;
309
+ }
310
+ function pushInitializers(ret, initializers) {
311
+ if (initializers) {
312
+ ret.push(function(instance) {
313
+ for(var i = 0; i < initializers.length; i++){
314
+ initializers[i].call(instance);
315
+ }
316
+ return instance;
317
+ });
318
+ }
319
+ }
320
+ function applyClassDecs(targetClass, classDecs, metadata) {
321
+ if (classDecs.length > 0) {
322
+ var initializers = [];
323
+ var newClass = targetClass;
324
+ var name = targetClass.name;
325
+ for(var i = classDecs.length - 1; i >= 0; i--){
326
+ var decoratorFinishedRef = {
327
+ v: false
328
+ };
329
+ try {
330
+ var nextNewClass = classDecs[i](newClass, {
331
+ kind: "class",
332
+ name: name,
333
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
334
+ metadata
335
+ });
336
+ } finally{
337
+ decoratorFinishedRef.v = true;
338
+ }
339
+ if (nextNewClass !== undefined) {
340
+ assertValidReturnValue(10, nextNewClass);
341
+ newClass = nextNewClass;
342
+ }
343
+ }
344
+ return [
345
+ defineMetadata(newClass, metadata),
346
+ function() {
347
+ for(var i = 0; i < initializers.length; i++){
348
+ initializers[i].call(newClass);
349
+ }
350
+ }
351
+ ];
352
+ }
353
+ }
354
+ function defineMetadata(Class, metadata) {
355
+ return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
356
+ configurable: true,
357
+ enumerable: true,
358
+ value: metadata
359
+ });
360
+ }
361
+ return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
362
+ if (parentClass !== void 0) {
363
+ var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
364
+ }
365
+ var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
366
+ var e = applyMemberDecs(targetClass, memberDecs, metadata);
367
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
368
+ return {
369
+ e: e,
370
+ get c () {
371
+ return applyClassDecs(targetClass, classDecs, metadata);
372
+ }
373
+ };
374
+ };
375
+ }
376
+ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
377
+ return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
378
+ }
379
+ function _identity(x) {
380
+ return x;
381
+ }
382
+ var _dec, _initClass, _ViElement, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _init_kind, _init_label, _init_placeholder, _init_disabled, _init_required, _init_invalid, _init_validityMessage, _init_expanded, // The actual value string (formatted or ISO, depending on how date-picker manages it)
383
+ _init_value, _init__triggerBtn, _initProto;
384
+ let _ViDatePickerInput;
385
+ _dec = customElement('vi-date-picker-input'), _dec1 = property({
386
+ type: String,
387
+ reflect: true
388
+ }), _dec2 = property({
389
+ type: String
390
+ }), _dec3 = property({
391
+ type: String
392
+ }), _dec4 = property({
393
+ type: Boolean,
394
+ reflect: true
395
+ }), _dec5 = property({
396
+ type: Boolean,
397
+ reflect: true
398
+ }), _dec6 = property({
399
+ type: Boolean,
400
+ reflect: true
401
+ }), _dec7 = property({
402
+ type: String
403
+ }), _dec8 = property({
404
+ type: Boolean
405
+ }), _dec9 = property({
406
+ type: String
407
+ }), _dec10 = query('.trigger');
408
+ new class extends _identity {
409
+ constructor(){
410
+ super(_ViDatePickerInput), _initClass();
411
+ }
412
+ static{
413
+ class ViDatePickerInput extends (_ViElement = ViElement) {
414
+ static{
415
+ ({ e: [_init_kind, _init_label, _init_placeholder, _init_disabled, _init_required, _init_invalid, _init_validityMessage, _init_expanded, _init_value, _init__triggerBtn, _initProto], c: [_ViDatePickerInput, _initClass] } = _apply_decs_2203_r(this, [
416
+ [
417
+ _dec1,
418
+ 1,
419
+ "kind"
420
+ ],
421
+ [
422
+ _dec2,
423
+ 1,
424
+ "label"
425
+ ],
426
+ [
427
+ _dec3,
428
+ 1,
429
+ "placeholder"
430
+ ],
431
+ [
432
+ _dec4,
433
+ 1,
434
+ "disabled"
435
+ ],
436
+ [
437
+ _dec5,
438
+ 1,
439
+ "required"
440
+ ],
441
+ [
442
+ _dec6,
443
+ 1,
444
+ "invalid"
445
+ ],
446
+ [
447
+ _dec7,
448
+ 1,
449
+ "validityMessage"
450
+ ],
451
+ [
452
+ _dec8,
453
+ 1,
454
+ "expanded"
455
+ ],
456
+ [
457
+ _dec9,
458
+ 1,
459
+ "value"
460
+ ],
461
+ [
462
+ _dec10,
463
+ 1,
464
+ "_triggerBtn"
465
+ ]
466
+ ], [
467
+ _dec
468
+ ], _ViElement));
469
+ }
470
+ #___private_kind_1 = (_initProto(this), _init_kind(this, 'single'));
471
+ get kind() {
472
+ return this.#___private_kind_1;
473
+ }
474
+ set kind(_v) {
475
+ this.#___private_kind_1 = _v;
476
+ }
477
+ #___private_label_2 = _init_label(this, '');
478
+ get label() {
479
+ return this.#___private_label_2;
480
+ }
481
+ set label(_v) {
482
+ this.#___private_label_2 = _v;
483
+ }
484
+ #___private_placeholder_3 = _init_placeholder(this);
485
+ get placeholder() {
486
+ return this.#___private_placeholder_3;
487
+ }
488
+ set placeholder(_v) {
489
+ this.#___private_placeholder_3 = _v;
490
+ }
491
+ #___private_disabled_4 = _init_disabled(this, false);
492
+ get disabled() {
493
+ return this.#___private_disabled_4;
494
+ }
495
+ set disabled(_v) {
496
+ this.#___private_disabled_4 = _v;
497
+ }
498
+ #___private_required_5 = _init_required(this, false);
499
+ get required() {
500
+ return this.#___private_required_5;
501
+ }
502
+ set required(_v) {
503
+ this.#___private_required_5 = _v;
504
+ }
505
+ #___private_invalid_6 = _init_invalid(this, false);
506
+ get invalid() {
507
+ return this.#___private_invalid_6;
508
+ }
509
+ set invalid(_v) {
510
+ this.#___private_invalid_6 = _v;
511
+ }
512
+ #___private_validityMessage_7 = _init_validityMessage(this, '');
513
+ get validityMessage() {
514
+ return this.#___private_validityMessage_7;
515
+ }
516
+ set validityMessage(_v) {
517
+ this.#___private_validityMessage_7 = _v;
518
+ }
519
+ #___private_expanded_8 = _init_expanded(this, false);
520
+ get expanded() {
521
+ return this.#___private_expanded_8;
522
+ }
523
+ set expanded(_v) {
524
+ this.#___private_expanded_8 = _v;
525
+ }
526
+ #___private_value_9 = _init_value(this, '');
527
+ get value() {
528
+ return this.#___private_value_9;
529
+ }
530
+ set value(_v) {
531
+ this.#___private_value_9 = _v;
532
+ }
533
+ #___private__triggerBtn_10 = _init__triggerBtn(this);
534
+ get _triggerBtn() {
535
+ return this.#___private__triggerBtn_10;
536
+ }
537
+ set _triggerBtn(_v) {
538
+ this.#___private__triggerBtn_10 = _v;
539
+ }
540
+ static shadowRootOptions = {
541
+ ...LitElement.shadowRootOptions,
542
+ delegatesFocus: true
543
+ };
544
+ /**
545
+ * Returns the interactable element for Flatpickr to bind to.
546
+ */ get inputElement() {
547
+ return this._triggerBtn;
548
+ }
549
+ focus(options) {
550
+ if (this._triggerBtn) {
551
+ this._triggerBtn.focus(options);
552
+ } else {
553
+ super.focus(options);
554
+ }
555
+ }
556
+ render() {
557
+ const accessibleName = [
558
+ this.label,
559
+ this.value || this.placeholder
560
+ ].filter(Boolean).join(', ');
561
+ return html`
562
+ <div class="input-wrapper">
563
+ ${this.label ? html`<label class="label" aria-hidden="true">${this.label}</label>` : ''}
564
+ <button
565
+ type="button"
566
+ part="trigger"
567
+ class="trigger"
568
+ ?disabled="${this.disabled}"
569
+ aria-haspopup="dialog"
570
+ aria-expanded="${this.expanded}"
571
+ aria-label="${accessibleName}"
572
+ aria-required="${this.required ? 'true' : 'false'}"
573
+ aria-invalid="${this.invalid ? 'true' : 'false'}"
574
+ aria-errormessage="${this.invalid && this.validityMessage ? 'vi-err-msg' : nothing}"
575
+ >
576
+ <span class="display-value">
577
+ ${this.value ? html`<span class="value-text">${this.value}</span>` : html`<span class="placeholder">${this.placeholder}</span>`}
578
+ </span>
579
+ <span class="icon" aria-hidden="true">
580
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
581
+ <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
582
+ <line x1="16" y1="2" x2="16" y2="6"/>
583
+ <line x1="8" y1="2" x2="8" y2="6"/>
584
+ <line x1="3" y1="10" x2="21" y2="10"/>
585
+ </svg>
586
+ </span>
587
+ </button>
588
+ ${this.invalid && this.validityMessage ? html`<span id="vi-err-msg" class="sr-only">${this.validityMessage}</span>` : ''}
589
+ </div>
590
+ `;
591
+ }
592
+ static styles = css`
593
+ ${unsafeCSS(datePickerInputStyles)}
594
+ `;
595
+ }
596
+ }
597
+ }();
598
+
599
+ export { _ViDatePickerInput as ViDatePickerInput };
@@ -0,0 +1,95 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { ViElement } from '../base/vi-element.js';
3
+ import { DatePickerMode } from './types.js';
4
+ /** Emitted when the user selects a date. Detail: DatePickerChangeDetail. */
5
+ export declare const VIALIQ_CHANGE = "vialiq-change";
6
+ declare const ViDatePicker_base: (new (...args: any[]) => import('../base/flatpickr-mixin.js').FlatpickrMixinInterface) & typeof ViElement & (new (...args: any[]) => import('../base/validity-mixin.js').ValidityInterface<unknown>);
7
+ /**
8
+ * A form-associated date-picker built on flatpickr.
9
+ *
10
+ * @element vi-date-picker
11
+ *
12
+ * @fires {CustomEvent<DatePickerChangeDetail>} vialiq-change - Date selection changed.
13
+ *
14
+ * @attr {string} value - ISO date string (read/write).
15
+ * @attr {string} name - Form field name.
16
+ * @attr {DatePickerMode} mode - 'date' | 'range' | 'month' | 'month-year' | 'week'
17
+ * @attr {boolean} flat - Renders inline (no popup).
18
+ * @attr {string} min - Min date.
19
+ * @attr {string} max - Min date.
20
+ * @attr {string} locale - BCP 47 locale tag.
21
+ * @attr {boolean} disabled - Disables the control.
22
+ * @attr {boolean} required - Required field.
23
+ * @attr {boolean} week-numbers - Show ISO week numbers.
24
+ * @attr {ControlStatus} status - 'default' | 'valid' | 'invalid'
25
+ * @attr {string} validity-message - Validation message shown below input.
26
+ * @attr {string} today-label - Explicit label for the "Today" button.
27
+ */
28
+ export declare class ViDatePicker extends ViDatePicker_base {
29
+ accessor value: string;
30
+ accessor name: string;
31
+ accessor mode: DatePickerMode;
32
+ accessor flat: boolean;
33
+ accessor hoist: boolean;
34
+ accessor min: string;
35
+ accessor max: string;
36
+ accessor locale: string | null;
37
+ accessor disabled: boolean;
38
+ accessor weekNumbers: boolean;
39
+ accessor todayLabel: string | undefined;
40
+ private accessor _resolvedLocale;
41
+ private accessor _displayValue;
42
+ private accessor _fpInput;
43
+ private accessor _floatingMenuContainer?;
44
+ private accessor _inputs;
45
+ /** Light DOM container for flatpickr inline mode to inherit global CSS */
46
+ private _inlineContainer?;
47
+ private _initialValue;
48
+ accessor labelPrevMonth: string | undefined;
49
+ accessor labelNextMonth: string | undefined;
50
+ accessor labelSelectMonth: string | undefined;
51
+ accessor labelSelectYear: string | undefined;
52
+ private _floatingController;
53
+ protected _getModePluginConfig(): {
54
+ ariaLabels: {
55
+ prevMonth: string | undefined;
56
+ nextMonth: string | undefined;
57
+ selectMonth: string | undefined;
58
+ selectYear: string | undefined;
59
+ };
60
+ };
61
+ protected _testValidity(): Partial<ValidityStateFlags>;
62
+ connectedCallback(): void;
63
+ disconnectedCallback(): void;
64
+ formResetCallback(): void;
65
+ firstUpdated(_changedProperties: PropertyValues): Promise<void>;
66
+ private _setupFlatpickr;
67
+ updated(changed: PropertyValues): Promise<void>;
68
+ protected _getHiddenInput(): HTMLInputElement | null;
69
+ focus(options?: FocusOptions): void;
70
+ /** Opens the calendar popup. No-op when flat=true. */
71
+ openCalendar(): void;
72
+ /** Closes the calendar popup. No-op when flat=true. */
73
+ closeCalendar(): void;
74
+ /** Clears the selected date(s). */
75
+ clear(): void;
76
+ private _buildFpConfig;
77
+ private _removeFpAria;
78
+ private _setFpValue;
79
+ private _syncInputValues;
80
+ private _onFlatpickrChange;
81
+ private _emitChange;
82
+ private _buildIsoValue;
83
+ private _setupTodayButton;
84
+ private _handleSlotChange;
85
+ private _handleInputsClick;
86
+ protected render(): import('lit-html').TemplateResult<1>;
87
+ static styles: import('lit').CSSResult;
88
+ }
89
+ declare global {
90
+ interface HTMLElementTagNameMap {
91
+ 'vi-date-picker': ViDatePicker;
92
+ }
93
+ }
94
+ export {};
95
+ //# sourceMappingURL=vi-date-picker.d.ts.map