@vialiq/web-components 0.19.0 → 0.21.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.
- package/README.md +250 -0
- package/base/controllers/floating-controller.d.ts +2 -2
- package/base/controllers/floating-controller.d.ts.map +1 -1
- package/base/flatpickr-mixin.d.ts +38 -0
- package/base/flatpickr-mixin.d.ts.map +1 -0
- package/base/validity-mixin.d.ts +2 -0
- package/base/validity-mixin.d.ts.map +1 -1
- package/button/vi-button.d.ts +2 -0
- package/button/vi-button.d.ts.map +1 -1
- package/button/vi-button.js +40 -11
- package/date-picker/i18n.d.ts +19 -0
- package/date-picker/i18n.d.ts.map +1 -0
- package/date-picker/index.d.ts +4 -0
- package/date-picker/index.d.ts.map +1 -0
- package/date-picker/index.js +2 -0
- package/date-picker/iso-week.d.ts +18 -0
- package/date-picker/iso-week.d.ts.map +1 -0
- package/date-picker/locale-registry.d.ts +8 -0
- package/date-picker/locale-registry.d.ts.map +1 -0
- package/date-picker/plugin-registry.d.ts +7 -0
- package/date-picker/plugin-registry.d.ts.map +1 -0
- package/date-picker/plugin-utils.d.ts +10 -0
- package/date-picker/plugin-utils.d.ts.map +1 -0
- package/date-picker/plugins/vi-month-year-plugin.d.ts +17 -0
- package/date-picker/plugins/vi-month-year-plugin.d.ts.map +1 -0
- package/date-picker/plugins/vi-range-plugin.d.ts +12 -0
- package/date-picker/plugins/vi-range-plugin.d.ts.map +1 -0
- package/date-picker/plugins/vi-shadow-dom-plugin.d.ts +18 -0
- package/date-picker/plugins/vi-shadow-dom-plugin.d.ts.map +1 -0
- package/date-picker/types.d.ts +34 -0
- package/date-picker/types.d.ts.map +1 -0
- package/date-picker/vi-date-picker-input.d.ts +34 -0
- package/date-picker/vi-date-picker-input.d.ts.map +1 -0
- package/date-picker/vi-date-picker-input.js +599 -0
- package/date-picker/vi-date-picker.d.ts +95 -0
- package/date-picker/vi-date-picker.d.ts.map +1 -0
- package/date-picker/vi-date-picker.js +2273 -0
- package/index.d.ts +8 -0
- package/index.js +7 -0
- package/keyboard-controller-D3htDhGR.js +322 -0
- package/package.json +23 -4
package/README.md
CHANGED
|
@@ -298,6 +298,130 @@ vi-input {
|
|
|
298
298
|
|
|
299
299
|
---
|
|
300
300
|
|
|
301
|
+
### Select ([vi-select](./src/select/vi-select.ts))
|
|
302
|
+
|
|
303
|
+
> [!NOTE]
|
|
304
|
+
> **Performance Notice:** The `vi-select` component automatically calculates its width to perfectly fit its content by measuring all rendered options. Because it renders all options directly into the DOM without virtualization, it is **not intended for large lists** (e.g., thousands of items). For massive datasets, use a combobox with virtualization and async filtering instead.
|
|
305
|
+
|
|
306
|
+
The [ViSelect](./src/select/vi-select.ts) is a custom listbox component that replaces the native `<select>` element. It supports custom templating, dynamic wrapping, form integration, and floating dropdowns using Floating UI.
|
|
307
|
+
|
|
308
|
+
#### Properties & Attributes
|
|
309
|
+
|
|
310
|
+
| Attribute | Property | Type | Default | Description |
|
|
311
|
+
| :----------------- | :---------------- | :------------------------------ | :---------- | :----------------------------------------------- |
|
|
312
|
+
| `value` | `value` | `string` | `''` | The currently selected option's value. |
|
|
313
|
+
| `placeholder` | `placeholder` | `string` | `'Select...'` | Text shown when no option is selected. |
|
|
314
|
+
| `name` | `name` | `string` | `''` | Form field name. |
|
|
315
|
+
| `disabled` | `disabled` | `boolean` | `false` | Disables the select component entirely. |
|
|
316
|
+
| `required` | `required` | `boolean` | `false` | Makes selecting an option mandatory. |
|
|
317
|
+
| `clearable` | `clearable` | `boolean` | `false` | Shows a clear button ("×") when an option is selected. |
|
|
318
|
+
| `status` | `status` | `'default'\|'valid'\|'invalid'` | `'default'` | Controls validation visual border colors. |
|
|
319
|
+
| `validity-message` | `validityMessage` | `string` | `''` | Custom error message to display in UI. |
|
|
320
|
+
| `wrap-text` | `wrapText` | `boolean` | `false` | Allows text within the dropdown options to wrap instead of truncating. |
|
|
321
|
+
| `match-width` | `matchWidth` | `boolean` | `true` | Forces the listbox dropdown to match the trigger's width. |
|
|
322
|
+
| `placement` | `placement` | `DropdownPlacement` | `'bottom-start'` | Preferred positioning of the listbox dropdown. |
|
|
323
|
+
| `hoist` | `hoist` | `boolean` | `true` | Uses a fixed positioning strategy to escape clipping containers. |
|
|
324
|
+
| `flip-boundary` | `flipBoundary` | `string` | `''` | CSS selector for a boundary element used in collision detection. |
|
|
325
|
+
|
|
326
|
+
#### Slots
|
|
327
|
+
|
|
328
|
+
- **Default Slot**: Used for placing `<vi-select-option>` and `<vi-select-group>` child elements.
|
|
329
|
+
- **`helper` Slot**: Location to insert description text below the select component.
|
|
330
|
+
|
|
331
|
+
#### Child Components (`<vi-select-option>` and `<vi-select-group>`)
|
|
332
|
+
|
|
333
|
+
Options are created using the `<vi-select-option>` tag inside the select.
|
|
334
|
+
- **`value`**: The value to submit when selected.
|
|
335
|
+
- **`label`**: The plain text label used for the trigger and type-ahead filtering.
|
|
336
|
+
- **Default Slot**: You can place any complex HTML template inside the option (e.g., avatars, icons, badges) and it will render inside the listbox!
|
|
337
|
+
|
|
338
|
+
You can group options logically using `<vi-select-group>`:
|
|
339
|
+
- **`label`**: The heading text for the option group.
|
|
340
|
+
|
|
341
|
+
#### CSS Custom Properties
|
|
342
|
+
|
|
343
|
+
- `--vi-select-width`: Controls the width of the select trigger and the dropdown (default: `100%`).
|
|
344
|
+
- `--vi-typeahead-highlight-bg`: Background color of the text match when using keyboard type-ahead (default: `#ebf5ff` / `blue-100`).
|
|
345
|
+
- `--vi-typeahead-highlight-color`: Text color of the type-ahead match (default: `#3676d0` / `primary`).
|
|
346
|
+
|
|
347
|
+
#### Events
|
|
348
|
+
|
|
349
|
+
- `vialiq-change`: Fires when an option is selected. Detail: `{ value: string, label: string }`.
|
|
350
|
+
- `vialiq-clear`: Fires when the clear button is clicked.
|
|
351
|
+
|
|
352
|
+
#### Snippets
|
|
353
|
+
|
|
354
|
+
**Basic Usage:**
|
|
355
|
+
|
|
356
|
+
```html
|
|
357
|
+
<vi-select name="country" placeholder="Select a country...">
|
|
358
|
+
<vi-select-option value="us" label="United States"></vi-select-option>
|
|
359
|
+
<vi-select-option value="uk" label="United Kingdom"></vi-select-option>
|
|
360
|
+
<vi-select-option value="ca" label="Canada"></vi-select-option>
|
|
361
|
+
</vi-select>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Custom Templates & Width:**
|
|
365
|
+
|
|
366
|
+
```html
|
|
367
|
+
<vi-select style="--vi-select-width: 300px;" placeholder="Select a user...">
|
|
368
|
+
<vi-select-option value="user1" label="Jane Doe">
|
|
369
|
+
<div style="display: flex; gap: 8px;">
|
|
370
|
+
<img src="avatar.png" alt="" />
|
|
371
|
+
<span>Jane Doe</span>
|
|
372
|
+
</div>
|
|
373
|
+
</vi-select-option>
|
|
374
|
+
</vi-select>
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Option Groups:**
|
|
378
|
+
|
|
379
|
+
```html
|
|
380
|
+
<vi-select name="fruits" placeholder="Select a fruit...">
|
|
381
|
+
<vi-select-group label="Citrus">
|
|
382
|
+
<vi-select-option value="orange" label="Orange"></vi-select-option>
|
|
383
|
+
<vi-select-option value="lemon" label="Lemon"></vi-select-option>
|
|
384
|
+
</vi-select-group>
|
|
385
|
+
<vi-select-group label="Berries">
|
|
386
|
+
<vi-select-option value="strawberry" label="Strawberry"></vi-select-option>
|
|
387
|
+
<vi-select-option value="blueberry" label="Blueberry"></vi-select-option>
|
|
388
|
+
</vi-select-group>
|
|
389
|
+
</vi-select>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Placement & Fit Width (`match-width="false"`):**
|
|
393
|
+
|
|
394
|
+
By default, the dropdown matches the width of the trigger. To allow the dropdown to grow based on its content width, and change the floating direction:
|
|
395
|
+
|
|
396
|
+
```html
|
|
397
|
+
<vi-select placement="top-start" match-width="false" placeholder="Select a user...">
|
|
398
|
+
<vi-select-option value="user1" label="Jane Doe">
|
|
399
|
+
<div style="display: flex; white-space: nowrap;">
|
|
400
|
+
Jane Doe (jane.doe@example.com - Senior Software Engineer)
|
|
401
|
+
</div>
|
|
402
|
+
</vi-select-option>
|
|
403
|
+
</vi-select>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**Form Integration & Reset:**
|
|
407
|
+
|
|
408
|
+
The `<vi-select>` responds properly to native form resets and submit interactions.
|
|
409
|
+
|
|
410
|
+
```html
|
|
411
|
+
<form>
|
|
412
|
+
<vi-select name="status" value="pending" required>
|
|
413
|
+
<vi-select-option value="pending" label="Pending"></vi-select-option>
|
|
414
|
+
<vi-select-option value="approved" label="Approved"></vi-select-option>
|
|
415
|
+
</vi-select>
|
|
416
|
+
|
|
417
|
+
<!-- This native reset will restore the select back to "pending" -->
|
|
418
|
+
<vi-button type="reset" variant="ghost">Clear Changes</vi-button>
|
|
419
|
+
<vi-button type="submit" variant="primary">Submit</vi-button>
|
|
420
|
+
</form>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
301
425
|
### Checkbox ([vi-checkbox](./src/checkbox/vi-checkbox.ts))
|
|
302
426
|
|
|
303
427
|
The [ViCheckbox](./src/checkbox/vi-checkbox.ts) is a customizable form-associated checkbox control using SVG graphics for checkmarks and supporting the indeterminate (mixed) validation state.
|
|
@@ -604,6 +728,132 @@ The [ViModal](./src/modal/vi-modal.ts) is a focus-trapping dialog that dynamical
|
|
|
604
728
|
|
|
605
729
|
---
|
|
606
730
|
|
|
731
|
+
### Date Picker ([vi-date-picker](./src/date-picker/vi-date-picker.ts))
|
|
732
|
+
|
|
733
|
+
The [ViDatePicker](./src/date-picker/vi-date-picker.ts) is a powerful form-associated calendar control built on top of Flatpickr. It fully handles Shadow DOM retargeting, multiple calendar modes, custom locales, and complex date-range selections.
|
|
734
|
+
|
|
735
|
+
#### Properties & Attributes
|
|
736
|
+
|
|
737
|
+
| Attribute | Property | Type | Default | Description |
|
|
738
|
+
| :----------------- | :---------------- | :------------------------------ | :---------- | :----------------------------------------------- |
|
|
739
|
+
| `mode` | `mode` | `'date'\|'range'\|'month'\|'month-year'\|'year'\|'week'` | `'date'` | Determines the calendar view and selection behavior. |
|
|
740
|
+
| `value` | `value` | `string` | `''` | Controlled input value (must be an ISO 8601 string). |
|
|
741
|
+
| `flat` | `flat` | `boolean` | `false` | Renders the calendar inline instead of within a popup. |
|
|
742
|
+
| `hoist` | `hoist` | `boolean` | `false` | Uses a fixed positioning strategy to escape clipping containers. |
|
|
743
|
+
| `min` | `min` | `string` | `''` | Minimum selectable date (ISO string). |
|
|
744
|
+
| `max` | `max` | `string` | `''` | Maximum selectable date (ISO string). |
|
|
745
|
+
| `locale` | `locale` | `string` | `'en'` | BCP 47 locale tag (e.g., `'de-DE'`, `'fr-FR'`). |
|
|
746
|
+
| `week-numbers` | `weekNumbers` | `boolean` | `false` | Shows ISO week numbers on the left of the calendar. |
|
|
747
|
+
| `disabled` | `disabled` | `boolean` | `false` | Disables interactions. |
|
|
748
|
+
| `required` | `required` | `boolean` | `false` | Marks field validation as mandatory. |
|
|
749
|
+
| `status` | `status` | `'default'\|'valid'\|'invalid'` | `'default'` | Controls validation visual presentation. |
|
|
750
|
+
| `validity-message` | `validityMessage` | `string` | `''` | Validation error message to display in UI. |
|
|
751
|
+
|
|
752
|
+
#### Child Components (\`<vi-date-picker-input>\`)
|
|
753
|
+
|
|
754
|
+
The `<vi-date-picker>` acts as a wrapper container. The actual interactive input fields must be provided as children using `<vi-date-picker-input>`:
|
|
755
|
+
- **`kind`**: `'single' | 'from' | 'to'`. Use `'from'` and `'to'` when `mode="range"`.
|
|
756
|
+
- **`label`**: Optional label string displayed above the input.
|
|
757
|
+
- **`placeholder`**: The placeholder text when no date is selected.
|
|
758
|
+
|
|
759
|
+
#### Events
|
|
760
|
+
|
|
761
|
+
- `vialiq-change`: Fires when a date is selected or changed. Detail: `{ value: string, isoValue: string, formattedValue: string, rawValue: DateComponents, type: string, ... }`.
|
|
762
|
+
|
|
763
|
+
#### CSS Custom Properties
|
|
764
|
+
|
|
765
|
+
Exposes variables for custom theme styling (these cascade down to the hoisted calendar container as well):
|
|
766
|
+
|
|
767
|
+
```css
|
|
768
|
+
vi-date-picker {
|
|
769
|
+
/* Controls the size of the individual day cell grid */
|
|
770
|
+
--vi-date-picker-day-size: 32px;
|
|
771
|
+
|
|
772
|
+
/* Popup calendar base styling */
|
|
773
|
+
--vi-date-picker-calendar-bg: var(--vi-color-layer-01);
|
|
774
|
+
--vi-date-picker-calendar-shadow: var(--vi-shadow-lg);
|
|
775
|
+
|
|
776
|
+
/* Day states (hover, selected, today) */
|
|
777
|
+
--vi-date-picker-day-hover-bg: var(--vi-color-layer-hover-01);
|
|
778
|
+
--vi-date-picker-day-selected-bg: var(--vi-color-primary);
|
|
779
|
+
--vi-date-picker-day-selected-color: var(--vi-color-text-primary-inverse);
|
|
780
|
+
--vi-date-picker-day-today-border: var(--vi-color-primary);
|
|
781
|
+
}
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
#### Snippets
|
|
785
|
+
|
|
786
|
+
**Basic Date Selection:**
|
|
787
|
+
```html
|
|
788
|
+
<vi-date-picker name="birthday">
|
|
789
|
+
<vi-date-picker-input label="Birthday" placeholder="YYYY-MM-DD"></vi-date-picker-input>
|
|
790
|
+
</vi-date-picker>
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
**Range Selection (Start & End Inputs):**
|
|
794
|
+
When using `mode="range"`, provide two input children marked with `kind="from"` and `kind="to"`.
|
|
795
|
+
|
|
796
|
+
```html
|
|
797
|
+
<vi-date-picker mode="range" name="vacation">
|
|
798
|
+
<vi-date-picker-input kind="from" label="Start Date" placeholder="Select Start"></vi-date-picker-input>
|
|
799
|
+
<vi-date-picker-input kind="to" label="End Date" placeholder="Select End"></vi-date-picker-input>
|
|
800
|
+
</vi-date-picker>
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
**Month, Year, and Week Selection:**
|
|
804
|
+
```html
|
|
805
|
+
<!-- Month and Year -->
|
|
806
|
+
<vi-date-picker mode="month-year" name="expiry">
|
|
807
|
+
<vi-date-picker-input label="Card Expiry" placeholder="YYYY-MM"></vi-date-picker-input>
|
|
808
|
+
</vi-date-picker>
|
|
809
|
+
|
|
810
|
+
<!-- ISO Week -->
|
|
811
|
+
<vi-date-picker mode="week" name="sprint">
|
|
812
|
+
<vi-date-picker-input label="Sprint Week" placeholder="YYYY-Www"></vi-date-picker-input>
|
|
813
|
+
</vi-date-picker>
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
**Flat Inline Calendar:**
|
|
817
|
+
```html
|
|
818
|
+
<vi-date-picker flat mode="date" value="2025-01-01">
|
|
819
|
+
<!-- No inputs needed when flat=true, the calendar renders inline -->
|
|
820
|
+
</vi-date-picker>
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
**Hoisted Calendar (For escaping `overflow: hidden` containers):**
|
|
824
|
+
By setting the `hoist` attribute, the date picker popup will use `position: fixed` to ensure it breaks out of any restrictive parent containers.
|
|
825
|
+
|
|
826
|
+
```html
|
|
827
|
+
<div style="overflow: hidden; height: 100px; padding: 20px;">
|
|
828
|
+
<vi-date-picker hoist name="appointment">
|
|
829
|
+
<vi-date-picker-input label="Book Appointment" placeholder="Select a date..."></vi-date-picker-input>
|
|
830
|
+
</vi-date-picker>
|
|
831
|
+
</div>
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
**Programmatic Value Updates:**
|
|
835
|
+
The `value` property can be set directly via JavaScript. The value should always be an **ISO 8601 string**, regardless of the configured locale or display mode.
|
|
836
|
+
|
|
837
|
+
```html
|
|
838
|
+
<vi-date-picker id="start-date" mode="date"></vi-date-picker>
|
|
839
|
+
|
|
840
|
+
<script>
|
|
841
|
+
const picker = document.getElementById('start-date');
|
|
842
|
+
|
|
843
|
+
// Update value programmatically
|
|
844
|
+
picker.value = '2026-10-12';
|
|
845
|
+
|
|
846
|
+
// Format guide by mode:
|
|
847
|
+
// - date: 'YYYY-MM-DD'
|
|
848
|
+
// - month / month-year: 'YYYY-MM'
|
|
849
|
+
// - year: 'YYYY'
|
|
850
|
+
// - week: 'YYYY-Www'
|
|
851
|
+
// - range: 'YYYY-MM-DD to YYYY-MM-DD'
|
|
852
|
+
</script>
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
---
|
|
856
|
+
|
|
607
857
|
## Form Validation & ElementInternals
|
|
608
858
|
|
|
609
859
|
Custom controls inside this library utilize the native browser [ValidityMixin](./src/base/validity-mixin.ts) to integrate with standard `<form>` features like `.elements`, `.checkValidity()`, and `.reportValidity()`.
|
|
@@ -23,8 +23,8 @@ export interface FloatingControllerOptions {
|
|
|
23
23
|
hoist?: () => boolean;
|
|
24
24
|
/** Element or selector string to constrain flipping. */
|
|
25
25
|
boundary?: () => HTMLElement | string | null;
|
|
26
|
-
/** Whether the floating element should be forced to match the reference element's width. */
|
|
27
|
-
matchWidth?: boolean;
|
|
26
|
+
/** Whether the floating element should be forced to match the reference element's width. Pass 'none' to skip width modifications entirely. */
|
|
27
|
+
matchWidth?: boolean | 'none' | (() => boolean | 'none');
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* FloatingController
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-controller.d.ts","sourceRoot":"","sources":["../../../../../libs/web-components/src/base/controllers/floating-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"floating-controller.d.ts","sourceRoot":"","sources":["../../../../../libs/web-components/src/base/controllers/floating-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACjE,OAAO,EAML,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAG1B;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACpC,sEAAsE;IACtE,QAAQ,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,SAAS,CAAC;IAC5B,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C,8IAA8I;IAC9I,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC;CAC1D;AAED;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,kBAAkB;IAKzD,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAC9B,OAAO,CAAC,cAAc,CAAuB;gBAGnC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,yBAAyB;IAK5C,gBAAgB;IAIhB;;;;;OAKG;IACH,KAAK;IAsBL;;;;;OAKG;IACH,IAAI;IAgBJ;;;;;;OAMG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CA0EtC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Instance } from 'flatpickr/dist/types/instance';
|
|
3
|
+
import { Options } from 'flatpickr/dist/types/options';
|
|
4
|
+
import { DatePickerMode, DatePickerPluginInput } from '../date-picker/types.js';
|
|
5
|
+
type Constructor<T = object> = new (...args: any[]) => T;
|
|
6
|
+
/**
|
|
7
|
+
* Type-only declaration of the members FlatpickrMixin adds to a class.
|
|
8
|
+
* `declare class` emits no runtime code — it is a TS-only contract.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FlatpickrMixinInterface {
|
|
11
|
+
/** The live flatpickr instance, or null if not yet initialised. */
|
|
12
|
+
protected _fp: Instance | null;
|
|
13
|
+
/** Consumer-provided additional plugins. */
|
|
14
|
+
plugins: DatePickerPluginInput[];
|
|
15
|
+
/** Returns the hidden <input> element flatpickr should bind to. Override in subclass. */
|
|
16
|
+
protected _getHiddenInput(): HTMLInputElement | null;
|
|
17
|
+
/**
|
|
18
|
+
* Initialises flatpickr. Loads locale, mode plugin, and the flatpickr module
|
|
19
|
+
* in parallel, then mounts it on the hidden input.
|
|
20
|
+
*/
|
|
21
|
+
protected _initFlatpickr(config: Partial<Options>, mode?: DatePickerMode, resolvedLocale?: string): Promise<void>;
|
|
22
|
+
/** Destroys the current flatpickr instance cleanly. */
|
|
23
|
+
protected _destroyFlatpickr(): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* FlatpickrMixin — abstract base mixin that manages a flatpickr lifecycle.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* class MyPicker extends FlatpickrMixin(ViElement) { ... }
|
|
30
|
+
*
|
|
31
|
+
* The subclass must:
|
|
32
|
+
* 1. Call `_initFlatpickr(config, mode, resolvedLocale)` in `firstUpdated()`.
|
|
33
|
+
* 2. Override `_getHiddenInput()` to return the `<input type="hidden">` element
|
|
34
|
+
* flatpickr should attach to.
|
|
35
|
+
*/
|
|
36
|
+
export declare function FlatpickrMixin<T extends Constructor<LitElement>>(Base: T): Constructor<FlatpickrMixinInterface> & T;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=flatpickr-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatpickr-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/flatpickr-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAOjC,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,mEAAmE;IACnE,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE/B,4CAA4C;IAC5C,OAAO,EAAE,qBAAqB,EAAE,CAAC;IAEjC,yFAAyF;IACzF,SAAS,CAAC,eAAe,IAAI,gBAAgB,GAAG,IAAI;IAEpD;;;OAGG;IACH,SAAS,CAAC,cAAc,CACtB,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,IAAI,CAAC,EAAE,cAAc,EACrB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAEhB,uDAAuD;IACvD,SAAS,CAAC,iBAAiB,IAAI,IAAI;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,GAyF9B,WAAW,CAAC,uBAAuB,CAAC,GAC3E,CAAC,CACJ"}
|
package/base/validity-mixin.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export declare class ValidityInterface<V = DefaultValueType> {
|
|
|
52
52
|
* Subclasses MUST override this to provide component-specific validation logic.
|
|
53
53
|
*/
|
|
54
54
|
protected _testValidity(): Partial<ValidityStateFlags>;
|
|
55
|
+
/** Internal validity sync — updates `_internals.setValidity()` without changing visual `status` or dispatching events. */
|
|
56
|
+
_syncValidity(): void;
|
|
55
57
|
/**
|
|
56
58
|
* Returns the element that the browser validation popup should point at.
|
|
57
59
|
* Override in subclasses that wrap a native control (input, textarea, etc.).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/validity-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAItD,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"validity-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/validity-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAItD,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,OAAO,GACP,IAAI,GACJ,QAAQ,GACR,OAAO,CAAC;AAEZ;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB,CAAC,CAAC,GAAG,gBAAgB;IACzD,oFAAoF;IACpF,IAAI,MAAM,IAAI,aAAa,CAAC;IAC5B,IAAI,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE;IAEjC,0EAA0E;IAC1E,IAAI,QAAQ,IAAI,OAAO,CAAC;IACxB,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IAE7B,2EAA2E;IAC3E,IAAI,eAAe,IAAI,MAAM,CAAC;IAC9B,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IAEnC,6EAA6E;IAC7E,IAAI,KAAK,IAAI,CAAC,CAAC;IACf,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE;IAEhB,sDAAsD;IACtD,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAEhD,4FAA4F;IAC5F,aAAa,IAAI,OAAO;IAExB,iGAAiG;IACjG,cAAc,IAAI,OAAO;IAEzB,mDAAmD;IACnD,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAExC,8DAA8D;IAC9D,IAAI,QAAQ,IAAI,aAAa,CAAC;IAE9B,oEAAoE;IACpE,IAAI,iBAAiB,IAAI,MAAM,CAAC;IAEhC;;;OAGG;IACH,IAAI,YAAY,IAAI,OAAO,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAEtD,0HAA0H;IACnH,aAAa,IAAI,IAAI;IAE5B;;;OAGG;IACH,SAAS,CAAC,oBAAoB,IAAI,WAAW,GAAG,SAAS;IAEzD,mFAAmF;IACnF,iBAAiB,IAAI,IAAI;IAEzB,sEAAsE;IACtE,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAE7C,uEAAuE;IACvE,wBAAwB,CACtB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,EACtC,MAAM,EAAE,MAAM,GACb,IAAI;CACR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,CAAC,GAAG,gBAAgB,EACpB,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,EAC3D,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CA+PhD"}
|
package/button/vi-button.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export declare class ViButton extends ViButton_base {
|
|
|
53
53
|
accessor iconOnly: boolean;
|
|
54
54
|
/** Disables the button. */
|
|
55
55
|
accessor disabled: boolean;
|
|
56
|
+
/** The button type — 'button', 'submit', or 'reset'. Forwarded to the inner native button. */
|
|
57
|
+
accessor type: 'button' | 'submit' | 'reset';
|
|
56
58
|
/** Accessible label forwarded to the inner native button. */
|
|
57
59
|
accessor ariaLabel: string | null;
|
|
58
60
|
private accessor _hasIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vi-button.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/button/vi-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG9F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9F;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,KAAK,CAAC;;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,QAAS,SAAQ,aAAyB;IACrD,OAAgB,MAAM,0BAAmC;IAEzD,cAAuB,iBAAiB,IAAI,iBAAiB,GAAG,IAAI,CAEnE;IAED,sBAAsB;IACqB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAa;IAEvF,mDAAmD;IACR,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAQ;IAE5E,sHAAsH;IAC9C,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAW;IAE9H,0EAA0E;IACL,QAAQ,CAAC,SAAS,UAAS;IAEhG,kGAAkG;IAC9B,QAAQ,CAAC,QAAQ,UAAS;IAE9F,2BAA2B;IACiB,QAAQ,CAAC,QAAQ,UAAS;IAEtE,6DAA6D;IAC7D,SAAyD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEhF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAe/C,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"vi-button.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/button/vi-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG9F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9F;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,KAAK,CAAC;;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,QAAS,SAAQ,aAAyB;IACrD,OAAgB,MAAM,0BAAmC;IAEzD,cAAuB,iBAAiB,IAAI,iBAAiB,GAAG,IAAI,CAEnE;IAED,sBAAsB;IACqB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAa;IAEvF,mDAAmD;IACR,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAQ;IAE5E,sHAAsH;IAC9C,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAW;IAE9H,0EAA0E;IACL,QAAQ,CAAC,SAAS,UAAS;IAEhG,kGAAkG;IAC9B,QAAQ,CAAC,QAAQ,UAAS;IAE9F,2BAA2B;IACiB,QAAQ,CAAC,QAAQ,UAAS;IAEtE,8FAA8F;IACnD,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAEnG,6DAA6D;IAC7D,SAAyD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEhF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAe/C,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,OAAO;IAwBN,MAAM,IAAI,cAAc;CAwBlC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/button/vi-button.js
CHANGED
|
@@ -380,7 +380,7 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
|
380
380
|
function _identity(x) {
|
|
381
381
|
return x;
|
|
382
382
|
}
|
|
383
|
-
var _dec, _initClass, _FocusableMixin, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, /** Visual variant. */ _init_variant, /** Size scale — controls padding and font-size. */ _init_size, /** Icon placement: 'start' (before label) or 'end' (after label). CSS order handles it — no DOM changes on toggle. */ _init_iconPlacement, /** When true, stretches the button to fill the width of its container. */ _init_fullWidth, /** When true, styles the button for an icon-only layout (typically square with equal padding). */ _init_iconOnly, /** Disables the button. */ _init_disabled, /** Accessible label forwarded to the inner native button. */ _init_ariaLabel, _init__hasIcon, _initProto;
|
|
383
|
+
var _dec, _initClass, _FocusableMixin, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, /** Visual variant. */ _init_variant, /** Size scale — controls padding and font-size. */ _init_size, /** Icon placement: 'start' (before label) or 'end' (after label). CSS order handles it — no DOM changes on toggle. */ _init_iconPlacement, /** When true, stretches the button to fill the width of its container. */ _init_fullWidth, /** When true, styles the button for an icon-only layout (typically square with equal padding). */ _init_iconOnly, /** Disables the button. */ _init_disabled, /** The button type — 'button', 'submit', or 'reset'. Forwarded to the inner native button. */ _init_type, /** Accessible label forwarded to the inner native button. */ _init_ariaLabel, _init__hasIcon, _initProto;
|
|
384
384
|
let _ViButton;
|
|
385
385
|
_dec = customElement('vi-button'), _dec1 = property({
|
|
386
386
|
type: String,
|
|
@@ -404,8 +404,11 @@ _dec = customElement('vi-button'), _dec1 = property({
|
|
|
404
404
|
type: Boolean,
|
|
405
405
|
reflect: true
|
|
406
406
|
}), _dec7 = property({
|
|
407
|
+
type: String,
|
|
408
|
+
reflect: true
|
|
409
|
+
}), _dec8 = property({
|
|
407
410
|
attribute: 'aria-label'
|
|
408
|
-
}),
|
|
411
|
+
}), _dec9 = state();
|
|
409
412
|
new class extends _identity {
|
|
410
413
|
constructor(){
|
|
411
414
|
super(_ViButton), _initClass();
|
|
@@ -413,7 +416,7 @@ new class extends _identity {
|
|
|
413
416
|
static{
|
|
414
417
|
class ViButton extends (_FocusableMixin = FocusableMixin(ViElement)) {
|
|
415
418
|
static{
|
|
416
|
-
({ e: [_init_variant, _init_size, _init_iconPlacement, _init_fullWidth, _init_iconOnly, _init_disabled, _init_ariaLabel, _init__hasIcon, _initProto], c: [_ViButton, _initClass] } = _apply_decs_2203_r(this, [
|
|
419
|
+
({ e: [_init_variant, _init_size, _init_iconPlacement, _init_fullWidth, _init_iconOnly, _init_disabled, _init_type, _init_ariaLabel, _init__hasIcon, _initProto], c: [_ViButton, _initClass] } = _apply_decs_2203_r(this, [
|
|
417
420
|
[
|
|
418
421
|
_dec1,
|
|
419
422
|
1,
|
|
@@ -447,11 +450,16 @@ new class extends _identity {
|
|
|
447
450
|
[
|
|
448
451
|
_dec7,
|
|
449
452
|
1,
|
|
450
|
-
"
|
|
453
|
+
"type"
|
|
451
454
|
],
|
|
452
455
|
[
|
|
453
456
|
_dec8,
|
|
454
457
|
1,
|
|
458
|
+
"ariaLabel"
|
|
459
|
+
],
|
|
460
|
+
[
|
|
461
|
+
_dec9,
|
|
462
|
+
1,
|
|
455
463
|
"_hasIcon"
|
|
456
464
|
]
|
|
457
465
|
], [
|
|
@@ -504,19 +512,26 @@ new class extends _identity {
|
|
|
504
512
|
set disabled(_v) {
|
|
505
513
|
this.#___private_disabled_6 = _v;
|
|
506
514
|
}
|
|
507
|
-
#
|
|
515
|
+
#___private_type_7 = _init_type(this, 'button');
|
|
516
|
+
get type() {
|
|
517
|
+
return this.#___private_type_7;
|
|
518
|
+
}
|
|
519
|
+
set type(_v) {
|
|
520
|
+
this.#___private_type_7 = _v;
|
|
521
|
+
}
|
|
522
|
+
#___private_ariaLabel_8 = _init_ariaLabel(this, null);
|
|
508
523
|
get ariaLabel() {
|
|
509
|
-
return this.#
|
|
524
|
+
return this.#___private_ariaLabel_8;
|
|
510
525
|
}
|
|
511
526
|
set ariaLabel(_v) {
|
|
512
|
-
this.#
|
|
527
|
+
this.#___private_ariaLabel_8 = _v;
|
|
513
528
|
}
|
|
514
|
-
#
|
|
529
|
+
#___private__hasIcon_9 = _init__hasIcon(this, false);
|
|
515
530
|
get _hasIcon() {
|
|
516
|
-
return this.#
|
|
531
|
+
return this.#___private__hasIcon_9;
|
|
517
532
|
}
|
|
518
533
|
set _hasIcon(_v) {
|
|
519
|
-
this.#
|
|
534
|
+
this.#___private__hasIcon_9 = _v;
|
|
520
535
|
}
|
|
521
536
|
updated(changed) {
|
|
522
537
|
super.updated(changed);
|
|
@@ -542,6 +557,20 @@ new class extends _identity {
|
|
|
542
557
|
if (this.disabled) {
|
|
543
558
|
event.preventDefault();
|
|
544
559
|
event.stopImmediatePropagation();
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
// Shadow DOM isolation: a <button type="reset|submit"> inside a shadow root
|
|
563
|
+
// cannot natively interact with the parent form. We must do it manually.
|
|
564
|
+
if (this.type === 'reset' || this.type === 'submit') {
|
|
565
|
+
const form = event.composedPath().find((n)=>n instanceof HTMLFormElement);
|
|
566
|
+
if (form) {
|
|
567
|
+
if (this.type === 'reset') {
|
|
568
|
+
form.reset();
|
|
569
|
+
} else {
|
|
570
|
+
const submitter = event.currentTarget instanceof HTMLButtonElement ? event.currentTarget : undefined;
|
|
571
|
+
form.requestSubmit(submitter);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
545
574
|
}
|
|
546
575
|
}
|
|
547
576
|
render() {
|
|
@@ -550,7 +579,7 @@ new class extends _identity {
|
|
|
550
579
|
<button
|
|
551
580
|
class="button"
|
|
552
581
|
part="button"
|
|
553
|
-
type
|
|
582
|
+
type=${this.type}
|
|
554
583
|
tabindex="0"
|
|
555
584
|
?disabled=${disabled}
|
|
556
585
|
aria-label=${this.ariaLabel ?? nothing}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SegmentOrder, DatePickerMode } from './types.js';
|
|
2
|
+
/** Resolves the effective BCP 47 locale tag. */
|
|
3
|
+
export declare function resolveLocale(localeAttr: string | null): string;
|
|
4
|
+
/** Reads the browser's IANA time zone from Intl. */
|
|
5
|
+
export declare function resolveTimeZone(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the localized word for "Today" (e.g. "today", "hoy", "aujourd'hui")
|
|
8
|
+
* capitalized properly using native Intl formatting.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getTodayLabel(locale: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Derives the segment order from the locale using the browser's Intl API,
|
|
13
|
+
* or from an explicit format string.
|
|
14
|
+
* Formats a known reference date and reads back the field order from the parts.
|
|
15
|
+
* Reference: 2001-01-02 — day=2, month=1, year=2001
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSegmentOrder(locale: string, format?: string): SegmentOrder;
|
|
18
|
+
export declare function formatDisplay(date: Date, locale: string, mode: DatePickerMode, formatStr?: string): string;
|
|
19
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI/D;AAED,oDAAoD;AACpD,wBAAgB,eAAe,IAAI,MAAM,CAMxC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CA8BjF;AAUD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA0B1G"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ViDatePicker, VIALIQ_CHANGE } from './vi-date-picker.js';
|
|
2
|
+
export { ViDatePickerInput } from './vi-date-picker-input.js';
|
|
3
|
+
export type { DatePickerMode, DatePickerChangeDetail, ViDatePickerPlugin, DatePickerPluginInput, ControlStatus } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the ISO 8601 week number of a given date.
|
|
3
|
+
* ISO week starts on Monday, and the first week of the year is the one
|
|
4
|
+
* that contains the first Thursday of the year (or Jan 4).
|
|
5
|
+
*
|
|
6
|
+
* @param date The Date object to calculate the ISO week for.
|
|
7
|
+
* @returns The ISO 8601 week number (1-53).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getISOWeek(date: Date): number;
|
|
10
|
+
/**
|
|
11
|
+
* Parses an ISO 8601 week string (YYYY-Www) into a Date object.
|
|
12
|
+
* Returns the Monday of that week.
|
|
13
|
+
*
|
|
14
|
+
* @param isoWeekString The string in format YYYY-Www
|
|
15
|
+
* @returns A Date object representing the Monday of the given week, or null if invalid.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseISOWeek(isoWeekString: string): Date | null;
|
|
18
|
+
//# sourceMappingURL=iso-week.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso-week.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/iso-week.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAqB7C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAuB/D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomLocale } from 'flatpickr/dist/types/locale';
|
|
2
|
+
/**
|
|
3
|
+
* Lazily loads a flatpickr locale definition for a given BCP 47 tag.
|
|
4
|
+
* Returns null for English (flatpickr's built-in default) or unsupported locales.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadLocale(bcp47: string): Promise<CustomLocale | null>;
|
|
7
|
+
export declare function __clearLocaleCacheForTest(): void;
|
|
8
|
+
//# sourceMappingURL=locale-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-registry.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/locale-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAiEhE;;;GAGG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA2B5E;AAED,wBAAgB,yBAAyB,SAExC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DatePickerMode, ViDatePickerPlugin } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Lazily loads the required flatpickr plugin for a given picker mode.
|
|
4
|
+
* Returns null if the mode does not require a plugin (e.g. 'date', 'range').
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadModePlugin(mode: DatePickerMode, options?: Record<string, unknown>): Promise<ViDatePickerPlugin | null>;
|
|
7
|
+
//# sourceMappingURL=plugin-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/plugin-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA2BrE;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAMhI"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin } from 'flatpickr/dist/types/options';
|
|
2
|
+
import { DatePickerPluginInput, ViDatePickerPlugin } from './types.js';
|
|
3
|
+
export declare function isViPlugin(p: DatePickerPluginInput): p is ViDatePickerPlugin;
|
|
4
|
+
export declare function resolvePlugin(p: DatePickerPluginInput): Plugin;
|
|
5
|
+
/**
|
|
6
|
+
* Merges the built-in mode plugin with any consumer-provided plugins.
|
|
7
|
+
* Ensures the mode plugin is always first, and deduplicates by ViDatePickerPlugin.id.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mergePlugins(modePlugin: DatePickerPluginInput | null, consumerPlugins?: DatePickerPluginInput[]): Plugin[];
|
|
10
|
+
//# sourceMappingURL=plugin-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-utils.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/date-picker/plugin-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5E,wBAAgB,UAAU,CAAC,CAAC,EAAE,qBAAqB,GAAG,CAAC,IAAI,kBAAkB,CAE5E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,qBAAqB,GAAG,IAAI,EACxC,eAAe,GAAE,qBAAqB,EAAO,GAC5C,MAAM,EAAE,CAwBV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Instance } from 'flatpickr/dist/types/instance';
|
|
2
|
+
export interface ViMonthYearPluginConfig {
|
|
3
|
+
hideDays?: boolean;
|
|
4
|
+
ariaLabels?: {
|
|
5
|
+
prevMonth?: string;
|
|
6
|
+
nextMonth?: string;
|
|
7
|
+
selectMonth?: string;
|
|
8
|
+
selectYear?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function ViMonthYearPlugin(config?: ViMonthYearPluginConfig): (fp: Instance) => {
|
|
12
|
+
onReady: () => void;
|
|
13
|
+
onMonthChange: () => void;
|
|
14
|
+
onYearChange: () => void;
|
|
15
|
+
onDestroy: () => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=vi-month-year-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-month-year-plugin.d.ts","sourceRoot":"","sources":["../../../../../libs/web-components/src/date-picker/plugins/vi-month-year-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,2BAA2B,CAAC;AAEnC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE;QACX,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,uBAA4B,IACnD,IAAI,QAAQ;;;;;EA6M9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'flatpickr/dist/types/options';
|
|
2
|
+
interface Config {
|
|
3
|
+
input?: string | HTMLInputElement;
|
|
4
|
+
position?: 'left' | 'center' | 'right';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper around Flatpickr's rangePlugin that correctly formats dates back to the
|
|
8
|
+
* Shadow DOM input elements and handles Shadow DOM focus events correctly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ViRangePlugin(config: Config): Plugin;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=vi-range-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-range-plugin.d.ts","sourceRoot":"","sources":["../../../../../libs/web-components/src/date-picker/plugins/vi-range-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmDpD"}
|