@vialiq/web-components 0.4.0 → 0.5.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 +575 -2
- package/checkbox/index.d.ts +3 -0
- package/checkbox/index.d.ts.map +1 -0
- package/checkbox/index.js +1 -0
- package/checkbox/vi-checkbox.d.ts +68 -0
- package/checkbox/vi-checkbox.d.ts.map +1 -0
- package/checkbox/vi-checkbox.js +637 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/input/vi-input.d.ts +4 -0
- package/input/vi-input.d.ts.map +1 -1
- package/input/vi-input.js +33 -3
- package/package.json +23 -3
- package/radio/index.d.ts +5 -0
- package/radio/index.d.ts.map +1 -0
- package/radio/index.js +2 -0
- package/radio/vi-radio-group.d.ts +72 -0
- package/radio/vi-radio-group.d.ts.map +1 -0
- package/radio/vi-radio-group.js +761 -0
- package/radio/vi-radio.d.ts +47 -0
- package/radio/vi-radio.d.ts.map +1 -0
- package/radio/vi-radio.js +538 -0
- package/tooltip/index.d.ts +3 -0
- package/tooltip/index.d.ts.map +1 -0
- package/tooltip/index.js +1 -0
- package/tooltip/vi-tooltip.d.ts +84 -0
- package/tooltip/vi-tooltip.d.ts.map +1 -0
- package/tooltip/vi-tooltip.js +908 -0
package/input/vi-input.js
CHANGED
|
@@ -443,9 +443,9 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
|
443
443
|
function _identity(x) {
|
|
444
444
|
return x;
|
|
445
445
|
}
|
|
446
|
-
var _dec, _initClass, _ValidityMixin, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, // ── ValidityMixin contract — must be declared as @property —————————————
|
|
446
|
+
var _dec, _initClass, _ValidityMixin, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, // ── ValidityMixin contract — must be declared as @property —————————————
|
|
447
447
|
_init_status, _init_required, _init_validityMessage, // ── Public API ─────────────────────────────────────────────────────────────
|
|
448
|
-
/** Input type. Controls the keyboard/picker on mobile and browser validation hints. */ _init_type, /** Native input placeholder text. */ _init_placeholder, /** Form field name. Submitted with the form when set. */ _init_name, /** Current value. Synced to ElementInternals for form participation. */ _init_value, /** When true, disables the input and removes it from the tab order. */ _init_disabled, /** Size scale — controls padding and font-size. */ _init_size, /** When true, the value cannot be edited but is still submitted. */ _init_readonly, _initProto;
|
|
448
|
+
/** Input type. Controls the keyboard/picker on mobile and browser validation hints. */ _init_type, /** Native input placeholder text. */ _init_placeholder, /** Form field name. Submitted with the form when set. */ _init_name, /** Current value. Synced to ElementInternals for form participation. */ _init_value, /** When true, disables the input and removes it from the tab order. */ _init_disabled, /** Size scale — controls padding and font-size. */ _init_size, /** When true, the value cannot be edited but is still submitted. */ _init_readonly, /** The accessibility label. */ _init_ariaLabel, /** Reference to an element id containing the label. */ _init_ariaLabelledby, _initProto;
|
|
449
449
|
let _ViInput;
|
|
450
450
|
_dec = customElement('vi-input'), _dec1 = property({
|
|
451
451
|
reflect: true
|
|
@@ -464,6 +464,10 @@ _dec = customElement('vi-input'), _dec1 = property({
|
|
|
464
464
|
}), _dec10 = property({
|
|
465
465
|
type: Boolean,
|
|
466
466
|
reflect: true
|
|
467
|
+
}), _dec11 = property({
|
|
468
|
+
attribute: 'aria-label'
|
|
469
|
+
}), _dec12 = property({
|
|
470
|
+
attribute: 'aria-labelledby'
|
|
467
471
|
});
|
|
468
472
|
new class extends _identity {
|
|
469
473
|
constructor(){
|
|
@@ -472,7 +476,7 @@ new class extends _identity {
|
|
|
472
476
|
static{
|
|
473
477
|
class ViInput extends (_ValidityMixin = ValidityMixin(FocusableMixin(ViElement))) {
|
|
474
478
|
static{
|
|
475
|
-
({ e: [_init_status, _init_required, _init_validityMessage, _init_type, _init_placeholder, _init_name, _init_value, _init_disabled, _init_size, _init_readonly, _initProto], c: [_ViInput, _initClass] } = _apply_decs_2203_r(this, [
|
|
479
|
+
({ e: [_init_status, _init_required, _init_validityMessage, _init_type, _init_placeholder, _init_name, _init_value, _init_disabled, _init_size, _init_readonly, _init_ariaLabel, _init_ariaLabelledby, _initProto], c: [_ViInput, _initClass] } = _apply_decs_2203_r(this, [
|
|
476
480
|
[
|
|
477
481
|
_dec1,
|
|
478
482
|
1,
|
|
@@ -522,6 +526,16 @@ new class extends _identity {
|
|
|
522
526
|
_dec10,
|
|
523
527
|
1,
|
|
524
528
|
"readonly"
|
|
529
|
+
],
|
|
530
|
+
[
|
|
531
|
+
_dec11,
|
|
532
|
+
1,
|
|
533
|
+
"ariaLabel"
|
|
534
|
+
],
|
|
535
|
+
[
|
|
536
|
+
_dec12,
|
|
537
|
+
1,
|
|
538
|
+
"ariaLabelledby"
|
|
525
539
|
]
|
|
526
540
|
], [
|
|
527
541
|
_dec
|
|
@@ -605,6 +619,20 @@ new class extends _identity {
|
|
|
605
619
|
set readonly(_v) {
|
|
606
620
|
this.#___private_readonly_10 = _v;
|
|
607
621
|
}
|
|
622
|
+
#___private_ariaLabel_11 = _init_ariaLabel(this, '');
|
|
623
|
+
get ariaLabel() {
|
|
624
|
+
return this.#___private_ariaLabel_11;
|
|
625
|
+
}
|
|
626
|
+
set ariaLabel(_v) {
|
|
627
|
+
this.#___private_ariaLabel_11 = _v;
|
|
628
|
+
}
|
|
629
|
+
#___private_ariaLabelledby_12 = _init_ariaLabelledby(this, '');
|
|
630
|
+
get ariaLabelledby() {
|
|
631
|
+
return this.#___private_ariaLabelledby_12;
|
|
632
|
+
}
|
|
633
|
+
set ariaLabelledby(_v) {
|
|
634
|
+
this.#___private_ariaLabelledby_12 = _v;
|
|
635
|
+
}
|
|
608
636
|
// ── ValidityMixin hook ─────────────────────────────────────────────────────
|
|
609
637
|
// _testValidity is declared protected in ValidityInterface, but TypeScript's
|
|
610
638
|
// mixin intersection type does not always surface protected members for
|
|
@@ -720,6 +748,8 @@ new class extends _identity {
|
|
|
720
748
|
?required=${required}
|
|
721
749
|
aria-required=${ifNonEmpty(required ? 'true' : '')}
|
|
722
750
|
aria-invalid=${this.status === 'invalid' ? 'true' : 'false'}
|
|
751
|
+
aria-label=${ifNonEmpty(this.ariaLabel)}
|
|
752
|
+
aria-labelledby=${ifNonEmpty(this.ariaLabelledby)}
|
|
723
753
|
aria-describedby=${this.validityMessage ? 'helper-text validation-message' : 'helper-text'}
|
|
724
754
|
aria-errormessage=${ifNonEmpty(this.status === 'invalid' && this.validityMessage ? 'validation-message' : '')}
|
|
725
755
|
placeholder=${ifNonEmpty(placeholder)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vialiq/web-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,11 +47,28 @@
|
|
|
47
47
|
"./radio": {
|
|
48
48
|
"types": "./radio/index.d.ts",
|
|
49
49
|
"default": "./radio/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./checkbox": {
|
|
52
|
+
"types": "./checkbox/index.d.ts",
|
|
53
|
+
"default": "./checkbox/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./checkbox/vi-checkbox": {
|
|
56
|
+
"types": "./checkbox/vi-checkbox.d.ts",
|
|
57
|
+
"default": "./checkbox/vi-checkbox.js"
|
|
58
|
+
},
|
|
59
|
+
"./tooltip": {
|
|
60
|
+
"types": "./tooltip/index.d.ts",
|
|
61
|
+
"default": "./tooltip/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./tooltip/vi-tooltip": {
|
|
64
|
+
"types": "./tooltip/vi-tooltip.d.ts",
|
|
65
|
+
"default": "./tooltip/vi-tooltip.js"
|
|
50
66
|
}
|
|
51
67
|
},
|
|
52
68
|
"peerDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@vialiq/
|
|
69
|
+
"@floating-ui/dom": ">=1.0.0",
|
|
70
|
+
"@vialiq/flux-ui": "^0.4.0",
|
|
71
|
+
"@vialiq/icons": ">=0.0.8 <0.1.0",
|
|
55
72
|
"lit": "^3.0.0"
|
|
56
73
|
},
|
|
57
74
|
"keywords": [
|
|
@@ -69,6 +86,9 @@
|
|
|
69
86
|
"button/",
|
|
70
87
|
"icons/",
|
|
71
88
|
"input/",
|
|
89
|
+
"radio/",
|
|
90
|
+
"checkbox/",
|
|
91
|
+
"tooltip/",
|
|
72
92
|
"README.md"
|
|
73
93
|
]
|
|
74
94
|
}
|
package/radio/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/radio/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { type ControlStatus } from '../base/validity-mixin.js';
|
|
3
|
+
import { ViElement } from '../base/vi-element.js';
|
|
4
|
+
import { type RadioSize } from './vi-radio.js';
|
|
5
|
+
export type RadioGroupOrientation = 'vertical' | 'horizontal';
|
|
6
|
+
declare const ViRadioGroup_base: typeof ViElement & (new (...args: any[]) => import("../base/validity-mixin.js").ValidityInterface);
|
|
7
|
+
/**
|
|
8
|
+
* vi-radio-group
|
|
9
|
+
* Form-associated radio button group container.
|
|
10
|
+
* Manages WAI-ARIA compliant keyboard roving tabindex and selection state.
|
|
11
|
+
*
|
|
12
|
+
* @element vi-radio-group
|
|
13
|
+
*
|
|
14
|
+
* @attr {string} value - Value of the currently selected radio option.
|
|
15
|
+
* @attr {string} name - Shared name for all child radios.
|
|
16
|
+
* @attr {boolean} disabled - Disables the entire radio group (reflected).
|
|
17
|
+
* @attr {boolean} required - Marks the group as requiring a selection (reflected).
|
|
18
|
+
* @attr {ControlStatus} status - Visual status: default | valid | invalid (reflected).
|
|
19
|
+
* @attr {string} validity-message - Error message shown when validation fails.
|
|
20
|
+
* @attr {RadioGroupOrientation} orientation - Layout direction: vertical | horizontal (reflected).
|
|
21
|
+
*
|
|
22
|
+
* @slot - Child vi-radio elements.
|
|
23
|
+
* @slot label - Text displayed above the group.
|
|
24
|
+
* @slot helper - Helper text displayed below the group.
|
|
25
|
+
*
|
|
26
|
+
* @fires {CustomEvent<{value: string}>} vialiq-change - Dispatched when selection changes. Bubbles, composed.
|
|
27
|
+
* @fires {Event} invalid - Fired when validation check fails.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ViRadioGroup extends ViRadioGroup_base {
|
|
30
|
+
static formAssociated: boolean;
|
|
31
|
+
static styles: import("lit").CSSResult;
|
|
32
|
+
protected readonly _internals: ElementInternals;
|
|
33
|
+
accessor status: ControlStatus;
|
|
34
|
+
accessor required: boolean;
|
|
35
|
+
accessor validityMessage: string;
|
|
36
|
+
/** Currently selected radio's value. */
|
|
37
|
+
accessor value: string;
|
|
38
|
+
/** Shared name for all child radios. */
|
|
39
|
+
accessor name: string;
|
|
40
|
+
/** Disables the entire group. */
|
|
41
|
+
accessor disabled: boolean;
|
|
42
|
+
/** Layout direction of the radio group. */
|
|
43
|
+
accessor orientation: RadioGroupOrientation;
|
|
44
|
+
/** Size scale — controls spacing and propagates to child radios. */
|
|
45
|
+
accessor size: RadioSize;
|
|
46
|
+
/** Allows clearing the selected radio button on double click. */
|
|
47
|
+
accessor allowDblclickClear: boolean;
|
|
48
|
+
private _observer?;
|
|
49
|
+
private _initialValue;
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
updated(changed: PropertyValues): void;
|
|
53
|
+
/** Resets the value and validation state when the parent form resets. */
|
|
54
|
+
formResetCallback(): void;
|
|
55
|
+
/** Keeps disabled in sync when a containing fieldset/form is disabled. */
|
|
56
|
+
formDisabledCallback(disabled: boolean): void;
|
|
57
|
+
protected _testValidity(): Partial<ValidityStateFlags>;
|
|
58
|
+
private _getRadios;
|
|
59
|
+
private _updateRadios;
|
|
60
|
+
private _handleRadioChecked;
|
|
61
|
+
private _onKeydown;
|
|
62
|
+
private _onDblclick;
|
|
63
|
+
private get _validationMessage();
|
|
64
|
+
render(): TemplateResult;
|
|
65
|
+
}
|
|
66
|
+
declare global {
|
|
67
|
+
interface HTMLElementTagNameMap {
|
|
68
|
+
'vi-radio-group': ViRadioGroup;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=vi-radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-radio-group.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/radio/vi-radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAErF,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,CAAC;;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,YAAa,SAAQ,iBAAwB;IACxD,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAgB,MAAM,0BAEpB;IAEF,SAAS,CAAC,QAAQ,CAAC,UAAU,mBAA0B;IAI1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAa;IAC5B,QAAQ,CAAC,QAAQ,UAAS;IACzB,QAAQ,CAAC,eAAe,SAAM;IAI3E,wCAAwC;IACX,QAAQ,CAAC,KAAK,SAAM;IAEjD,wCAAwC;IAC5B,QAAQ,CAAC,IAAI,SAAM;IAE/B,iCAAiC;IACW,QAAQ,CAAC,QAAQ,UAAS;IAEtE,2CAA2C;IACd,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAc;IAEtF,oEAAoE;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAQ;IAE3E,iEAAiE;IAEjE,QAAQ,CAAC,kBAAkB,UAAS;IAEpC,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC,OAAO,CAAC,aAAa,CAAM;IAElB,iBAAiB,IAAI,IAAI;IAsBzB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAkB/C,yEAAyE;IACzE,iBAAiB,IAAI,IAAI;IAOzB,0EAA0E;IAC1E,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;cAI1B,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAU/D,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IA0CrB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,UAAU;IA0DlB,OAAO,CAAC,WAAW,CAqBjB;IAIF,OAAO,KAAK,kBAAkB,GAmB7B;IAEQ,MAAM,IAAI,cAAc;CA+BlC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|