q2-tecton-elements 1.25.1 → 1.26.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 (132) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/q2-badge_2.cjs.entry.js +22 -22
  3. package/dist/cjs/q2-btn_2.cjs.entry.js +4 -4
  4. package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
  5. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-checkbox.cjs.entry.js +4 -4
  8. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-option-list_2.cjs.entry.js +55 -16
  12. package/dist/cjs/q2-pill.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-radio-group.cjs.entry.js +8 -6
  14. package/dist/cjs/q2-radio.cjs.entry.js +4 -4
  15. package/dist/cjs/q2-select.cjs.entry.js +5 -2
  16. package/dist/cjs/q2-tab-container.cjs.entry.js +14 -2
  17. package/dist/cjs/q2-tab-pane.cjs.entry.js +6 -1
  18. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  19. package/dist/cjs/q2-tooltip.cjs.entry.js +17 -2
  20. package/dist/cjs/tecton-tab-pane.cjs.entry.js +5 -0
  21. package/dist/collection/collection-manifest.json +2 -2
  22. package/dist/collection/components/q2-btn/index.js +52 -43
  23. package/dist/collection/components/q2-calendar/index.js +48 -39
  24. package/dist/collection/components/q2-carousel/index.js +21 -18
  25. package/dist/collection/components/q2-checkbox/index.js +42 -36
  26. package/dist/collection/components/q2-checkbox-group/index.js +1 -1
  27. package/dist/collection/components/q2-dropdown/index.js +25 -22
  28. package/dist/collection/components/q2-dropdown-item/index.js +11 -8
  29. package/dist/collection/components/q2-editable-field/index.js +32 -24
  30. package/dist/collection/components/q2-input/index.js +72 -50
  31. package/dist/collection/components/q2-loading/index.js +18 -15
  32. package/dist/collection/components/q2-pill/styles.css +1 -1
  33. package/dist/collection/components/q2-popover/index.js +55 -16
  34. package/dist/collection/components/q2-popover/styles.css +1 -1
  35. package/dist/collection/components/q2-radio/index.js +24 -21
  36. package/dist/collection/components/q2-radio/styles.css +6 -6
  37. package/dist/collection/components/q2-radio-group/index.js +14 -9
  38. package/dist/collection/components/q2-select/index.js +25 -19
  39. package/dist/collection/components/q2-tab-container/index.js +18 -6
  40. package/dist/collection/components/q2-tab-pane/index.js +55 -0
  41. package/dist/collection/components/q2-tooltip/index.js +42 -3
  42. package/dist/collection/components/tecton-tab-pane/index.js +55 -0
  43. package/dist/components/index14.js +56 -17
  44. package/dist/components/index5.js +7 -7
  45. package/dist/components/index6.js +4 -4
  46. package/dist/components/index8.js +23 -23
  47. package/dist/components/index9.js +3 -3
  48. package/dist/components/q2-calendar.js +6 -6
  49. package/dist/components/q2-carousel.js +2 -2
  50. package/dist/components/q2-checkbox-group.js +1 -1
  51. package/dist/components/q2-checkbox.js +7 -7
  52. package/dist/components/q2-dropdown.js +4 -4
  53. package/dist/components/q2-editable-field.js +4 -4
  54. package/dist/components/q2-pill.js +1 -1
  55. package/dist/components/q2-radio-group.js +10 -8
  56. package/dist/components/q2-radio.js +7 -7
  57. package/dist/components/q2-select.js +6 -3
  58. package/dist/components/q2-tab-container.js +14 -2
  59. package/dist/components/q2-tab-pane.js +8 -1
  60. package/dist/components/q2-tooltip.js +19 -3
  61. package/dist/components/tecton-tab-pane.js +7 -0
  62. package/dist/docs.json +427 -40
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/q2-badge_2.entry.js +22 -22
  65. package/dist/esm/q2-btn_2.entry.js +4 -4
  66. package/dist/esm/q2-calendar.entry.js +2 -2
  67. package/dist/esm/q2-carousel.entry.js +1 -1
  68. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  69. package/dist/esm/q2-checkbox.entry.js +4 -4
  70. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  71. package/dist/esm/q2-dropdown.entry.js +1 -1
  72. package/dist/esm/q2-editable-field.entry.js +1 -1
  73. package/dist/esm/q2-option-list_2.entry.js +55 -16
  74. package/dist/esm/q2-pill.entry.js +1 -1
  75. package/dist/esm/q2-radio-group.entry.js +8 -6
  76. package/dist/esm/q2-radio.entry.js +4 -4
  77. package/dist/esm/q2-select.entry.js +5 -2
  78. package/dist/esm/q2-tab-container.entry.js +14 -2
  79. package/dist/esm/q2-tab-pane.entry.js +6 -1
  80. package/dist/esm/q2-tecton-elements.js +1 -1
  81. package/dist/esm/q2-tooltip.entry.js +17 -2
  82. package/dist/esm/tecton-tab-pane.entry.js +5 -0
  83. package/dist/q2-tecton-elements/p-09639e95.entry.js +1 -0
  84. package/dist/q2-tecton-elements/p-0b82891e.entry.js +1 -0
  85. package/dist/q2-tecton-elements/{p-73c12774.entry.js → p-0cbad3bc.entry.js} +1 -1
  86. package/dist/q2-tecton-elements/p-159d94cc.entry.js +1 -0
  87. package/dist/q2-tecton-elements/p-18808c27.entry.js +1 -0
  88. package/dist/q2-tecton-elements/p-4734a577.entry.js +1 -0
  89. package/dist/q2-tecton-elements/{p-fa8cb091.entry.js → p-55d192b3.entry.js} +1 -1
  90. package/dist/q2-tecton-elements/p-5878b8bd.entry.js +1 -0
  91. package/dist/q2-tecton-elements/{p-f573fe5a.entry.js → p-721d0aee.entry.js} +1 -1
  92. package/dist/q2-tecton-elements/{p-d4909df7.entry.js → p-74ac19cd.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/{p-82fef3f9.entry.js → p-87cecc80.entry.js} +1 -1
  94. package/dist/q2-tecton-elements/p-8d703466.entry.js +1 -0
  95. package/dist/q2-tecton-elements/{p-3fe98171.entry.js → p-a411f2f3.entry.js} +1 -1
  96. package/dist/q2-tecton-elements/{p-30069b63.entry.js → p-a7679912.entry.js} +1 -1
  97. package/dist/q2-tecton-elements/p-b8420bfe.entry.js +1 -0
  98. package/dist/q2-tecton-elements/{p-406f8ca9.entry.js → p-bc8a507b.entry.js} +1 -1
  99. package/dist/q2-tecton-elements/{p-f83d2df5.entry.js → p-bfaff58b.entry.js} +1 -1
  100. package/dist/q2-tecton-elements/p-e43d437d.entry.js +1 -0
  101. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  102. package/dist/test/helpers.js +11 -0
  103. package/dist/types/components/q2-btn/index.d.ts +6 -3
  104. package/dist/types/components/q2-calendar/index.d.ts +5 -2
  105. package/dist/types/components/q2-carousel/index.d.ts +2 -1
  106. package/dist/types/components/q2-checkbox/index.d.ts +6 -4
  107. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -1
  108. package/dist/types/components/q2-dropdown/index.d.ts +3 -2
  109. package/dist/types/components/q2-dropdown-item/index.d.ts +2 -1
  110. package/dist/types/components/q2-editable-field/index.d.ts +5 -3
  111. package/dist/types/components/q2-input/index.d.ts +31 -7
  112. package/dist/types/components/q2-loading/index.d.ts +4 -3
  113. package/dist/types/components/q2-popover/index.d.ts +5 -1
  114. package/dist/types/components/q2-radio/index.d.ts +3 -2
  115. package/dist/types/components/q2-radio-group/index.d.ts +3 -2
  116. package/dist/types/components/q2-select/index.d.ts +2 -1
  117. package/dist/types/components/q2-tab-container/index.d.ts +5 -2
  118. package/dist/types/components/q2-tab-pane/index.d.ts +3 -0
  119. package/dist/types/components/q2-tooltip/index.d.ts +4 -1
  120. package/dist/types/components/tecton-tab-pane/index.d.ts +3 -0
  121. package/dist/types/components.d.ts +140 -24
  122. package/dist/types/workspace/workspace/{tecton-production_release_1.25.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -1
  123. package/package.json +3 -3
  124. package/dist/q2-tecton-elements/p-18d9cea8.entry.js +0 -1
  125. package/dist/q2-tecton-elements/p-2313e9a9.entry.js +0 -1
  126. package/dist/q2-tecton-elements/p-2b9c1815.entry.js +0 -1
  127. package/dist/q2-tecton-elements/p-3410c675.entry.js +0 -1
  128. package/dist/q2-tecton-elements/p-471e5d58.entry.js +0 -1
  129. package/dist/q2-tecton-elements/p-a6bfe392.entry.js +0 -1
  130. package/dist/q2-tecton-elements/p-c01d0332.entry.js +0 -1
  131. package/dist/q2-tecton-elements/p-df91e954.entry.js +0 -1
  132. package/dist/q2-tecton-elements/p-e8e113c2.entry.js +0 -1
@@ -9,6 +9,25 @@ import formatNumeric, { formatPercentage } from './formatting/numeric';
9
9
  import formatPostalCode from './formatting/postal';
10
10
  import formatDate from './formatting/date';
11
11
  import formatCreditCard from './formatting/credit-card';
12
+ const inputTypeMap = {
13
+ text: 'text',
14
+ tel: 'tel',
15
+ number: 'number',
16
+ password: 'text',
17
+ search: 'search',
18
+ url: 'url',
19
+ email: 'email',
20
+ currency: 'text',
21
+ phone: 'tel',
22
+ ssn: 'text',
23
+ alphanumeric: 'text',
24
+ alpha: 'text',
25
+ numeric: 'text',
26
+ percentage: 'text',
27
+ postal: 'text',
28
+ date: 'text',
29
+ 'credit-card': 'text',
30
+ };
12
31
  export class Q2Input {
13
32
  constructor() {
14
33
  this.scheduledAfterRender = [];
@@ -100,11 +119,11 @@ export class Q2Input {
100
119
  this.ariaControls = undefined;
101
120
  this.role = undefined;
102
121
  this.ariaOwns = undefined;
103
- this.ariaLabel = undefined;
104
122
  this.ariaHaspopup = undefined;
105
123
  this.ariaExpanded = undefined;
106
124
  this.ariaActivedescendant = undefined;
107
125
  this.current = undefined;
126
+ this.ariaLabel = undefined;
108
127
  this.errors = undefined;
109
128
  this.hints = undefined;
110
129
  this.formattedValueObject = undefined;
@@ -225,25 +244,6 @@ export class Q2Input {
225
244
  return classNames.join(' ');
226
245
  }
227
246
  get computedType() {
228
- const inputTypeMap = {
229
- text: 'text',
230
- tel: 'tel',
231
- number: 'number',
232
- password: 'text',
233
- search: 'search',
234
- url: 'url',
235
- email: 'email',
236
- currency: 'text',
237
- phone: 'tel',
238
- ssn: 'text',
239
- alphanumeric: 'text',
240
- alpha: 'text',
241
- numeric: 'text',
242
- percentage: 'text',
243
- postal: 'text',
244
- date: 'text',
245
- 'credit-card': 'text',
246
- };
247
247
  if (['password', 'text', 'ssn'].includes(this.type) && this.textHidden) {
248
248
  return 'password';
249
249
  }
@@ -362,7 +362,7 @@ export class Q2Input {
362
362
  }
363
363
  /* tslint:disable:cyclomatic-complexity */
364
364
  inputContainerDOM() {
365
- return (h("div", { class: "input-container" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
365
+ return (h("div", { class: "input-container", tabindex: -1 }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
366
366
  }
367
367
  /* tslint:enable:cyclomatic-complexity */
368
368
  /* tslint:disable:cyclomatic-complexity */
@@ -371,7 +371,7 @@ export class Q2Input {
371
371
  const inputClasses = ['input-field'];
372
372
  if (hasCustomDisplaySlot)
373
373
  inputClasses.push('sr');
374
- return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-controls": (this.ariaControls && `${this.ariaControls}`) || undefined, "aria-owns": (this.ariaOwns && `${this.ariaOwns}`) || undefined, "aria-haspopup": (this.ariaHaspopup && `${this.ariaHaspopup}`) || undefined, "aria-expanded": (!!this.ariaExpanded && `${!!this.ariaExpanded}`) || undefined, "aria-activedescendant": this.ariaActivedescendant && `${this.ariaActivedescendant}`, "aria-label": this.hideLabel && this.label ? loc(this.label) : undefined, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize === 'on' ? 'on' : 'off', autocorrect: this.autocorrect === 'on' ? 'on' : 'off', placeholder: (this.placeholder && loc(this.placeholder)) || undefined, role: (this.role && `${this.role}`) || undefined, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode })));
374
+ return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-controls": (this.ariaControls && `${this.ariaControls}`) || undefined, "aria-owns": (this.ariaOwns && `${this.ariaOwns}`) || undefined, "aria-haspopup": (this.ariaHaspopup && `${this.ariaHaspopup}`) || undefined, "aria-expanded": (!!this.ariaExpanded && `${!!this.ariaExpanded}`) || undefined, "aria-activedescendant": this.ariaActivedescendant && `${this.ariaActivedescendant}`, "aria-label": this.hideLabel && this.label ? loc(this.label) : undefined, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect === 'on' ? 'on' : 'off', placeholder: (this.placeholder && loc(this.placeholder)) || undefined, role: (this.role && `${this.role}`) || undefined, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode })));
375
375
  }
376
376
  /* tslint:enable:cyclomatic-complexity */
377
377
  pseudoInputDOM() {
@@ -497,9 +497,13 @@ export class Q2Input {
497
497
  "type": "string",
498
498
  "mutable": false,
499
499
  "complexType": {
500
- "original": "string",
501
- "resolved": "string",
502
- "references": {}
500
+ "original": "InputType",
501
+ "resolved": "\"alpha\" | \"alphanumeric\" | \"credit-card\" | \"currency\" | \"date\" | \"email\" | \"number\" | \"numeric\" | \"password\" | \"percentage\" | \"phone\" | \"postal\" | \"search\" | \"ssn\" | \"tel\" | \"text\" | \"url\"",
502
+ "references": {
503
+ "InputType": {
504
+ "location": "local"
505
+ }
506
+ }
503
507
  },
504
508
  "required": false,
505
509
  "optional": false,
@@ -567,8 +571,8 @@ export class Q2Input {
567
571
  "type": "string",
568
572
  "mutable": false,
569
573
  "complexType": {
570
- "original": "string",
571
- "resolved": "string",
574
+ "original": "'on' | 'off'",
575
+ "resolved": "\"off\" | \"on\"",
572
576
  "references": {}
573
577
  },
574
578
  "required": false,
@@ -618,9 +622,14 @@ export class Q2Input {
618
622
  "type": "string",
619
623
  "mutable": false,
620
624
  "complexType": {
621
- "original": "string",
625
+ "original": "Q2Icon['type']",
622
626
  "resolved": "string",
623
- "references": {}
627
+ "references": {
628
+ "Q2Icon": {
629
+ "location": "import",
630
+ "path": "../q2-icon"
631
+ }
632
+ }
624
633
  },
625
634
  "required": false,
626
635
  "optional": false,
@@ -635,9 +644,14 @@ export class Q2Input {
635
644
  "type": "string",
636
645
  "mutable": false,
637
646
  "complexType": {
638
- "original": "string",
647
+ "original": "Q2Icon['type']",
639
648
  "resolved": "string",
640
- "references": {}
649
+ "references": {
650
+ "Q2Icon": {
651
+ "location": "import",
652
+ "path": "../q2-icon"
653
+ }
654
+ }
641
655
  },
642
656
  "required": false,
643
657
  "optional": false,
@@ -857,9 +871,14 @@ export class Q2Input {
857
871
  "type": "string",
858
872
  "mutable": false,
859
873
  "complexType": {
860
- "original": "'primary' | 'secondary' | 'tertiary'",
874
+ "original": "Q2Badge['theme']",
861
875
  "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
862
- "references": {}
876
+ "references": {
877
+ "Q2Badge": {
878
+ "location": "import",
879
+ "path": "../q2-badge"
880
+ }
881
+ }
863
882
  },
864
883
  "required": false,
865
884
  "optional": false,
@@ -921,23 +940,6 @@ export class Q2Input {
921
940
  "attribute": "aria-owns",
922
941
  "reflect": false
923
942
  },
924
- "ariaLabel": {
925
- "type": "string",
926
- "mutable": true,
927
- "complexType": {
928
- "original": "string",
929
- "resolved": "string",
930
- "references": {}
931
- },
932
- "required": false,
933
- "optional": false,
934
- "docs": {
935
- "tags": [],
936
- "text": ""
937
- },
938
- "attribute": "aria-label",
939
- "reflect": true
940
- },
941
943
  "ariaHaspopup": {
942
944
  "type": "string",
943
945
  "mutable": false,
@@ -1006,6 +1008,26 @@ export class Q2Input {
1006
1008
  "attribute": "current",
1007
1009
  "reflect": false
1008
1010
  },
1011
+ "ariaLabel": {
1012
+ "type": "string",
1013
+ "mutable": true,
1014
+ "complexType": {
1015
+ "original": "string",
1016
+ "resolved": "string",
1017
+ "references": {}
1018
+ },
1019
+ "required": false,
1020
+ "optional": false,
1021
+ "docs": {
1022
+ "tags": [{
1023
+ "name": "deprecated",
1024
+ "text": undefined
1025
+ }],
1026
+ "text": ""
1027
+ },
1028
+ "attribute": "aria-label",
1029
+ "reflect": true
1030
+ },
1009
1031
  "errors": {
1010
1032
  "type": "unknown",
1011
1033
  "mutable": false,
@@ -17,8 +17,8 @@ export class Q2Loading {
17
17
  this.modifiers = undefined;
18
18
  this.counts = undefined;
19
19
  this.label = undefined;
20
- this.ariaLabel = undefined;
21
20
  this.inline = undefined;
21
+ this.ariaLabel = undefined;
22
22
  }
23
23
  get loader() {
24
24
  const loaderMap = {
@@ -81,8 +81,8 @@ export class Q2Loading {
81
81
  "type": "string",
82
82
  "mutable": false,
83
83
  "complexType": {
84
- "original": "string",
85
- "resolved": "string",
84
+ "original": "'spinner' | 'skeleton'",
85
+ "resolved": "\"skeleton\" | \"spinner\"",
86
86
  "references": {}
87
87
  },
88
88
  "required": false,
@@ -162,12 +162,12 @@ export class Q2Loading {
162
162
  "attribute": "label",
163
163
  "reflect": true
164
164
  },
165
- "ariaLabel": {
166
- "type": "string",
165
+ "inline": {
166
+ "type": "boolean",
167
167
  "mutable": false,
168
168
  "complexType": {
169
- "original": "string",
170
- "resolved": "string",
169
+ "original": "boolean",
170
+ "resolved": "boolean",
171
171
  "references": {}
172
172
  },
173
173
  "required": false,
@@ -176,24 +176,27 @@ export class Q2Loading {
176
176
  "tags": [],
177
177
  "text": ""
178
178
  },
179
- "attribute": "aria-label",
179
+ "attribute": "inline",
180
180
  "reflect": true
181
181
  },
182
- "inline": {
183
- "type": "boolean",
184
- "mutable": false,
182
+ "ariaLabel": {
183
+ "type": "string",
184
+ "mutable": true,
185
185
  "complexType": {
186
- "original": "boolean",
187
- "resolved": "boolean",
186
+ "original": "string",
187
+ "resolved": "string",
188
188
  "references": {}
189
189
  },
190
190
  "required": false,
191
191
  "optional": false,
192
192
  "docs": {
193
- "tags": [],
193
+ "tags": [{
194
+ "name": "deprecated",
195
+ "text": undefined
196
+ }],
194
197
  "text": ""
195
198
  },
196
- "attribute": "inline",
199
+ "attribute": "aria-label",
197
200
  "reflect": true
198
201
  }
199
202
  };
@@ -156,7 +156,7 @@ q2-popover,
156
156
  .btn-primary {
157
157
  background: var(--comp-btn-background);
158
158
  border-width: var(--comp-pill-btn-border-width);
159
- border-color: var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-gray-9, #999999)));
159
+ border-color: var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-a11y-gray-color-AA, #949494)));
160
160
  padding-inline: var(--comp-btn-padding);
161
161
  padding-right: calc(var(--comp-btn-padding) + var(--comp-close-size));
162
162
  font-size: var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));
@@ -3,13 +3,19 @@ import { resizeIframe, waitForNextPaint } from 'src/utils';
3
3
  export class Q2Popover {
4
4
  constructor() {
5
5
  this.scheduledAfterRender = [];
6
+ /// Helpers ///
7
+ this.viewPortChanged = () => {
8
+ if (!this.open)
9
+ return;
10
+ this.determinePopDirection();
11
+ };
6
12
  this.direction = undefined;
7
13
  this.align = undefined;
8
14
  this.open = undefined;
9
15
  this.block = undefined;
10
16
  this.minHeight = undefined;
11
17
  this.controlElement = undefined;
12
- this.privateDirection = 'down';
18
+ this.currentDirection = undefined;
13
19
  this.show = false;
14
20
  }
15
21
  /// Lifecycle hooks ///
@@ -23,6 +29,9 @@ export class Q2Popover {
23
29
  this.scheduledAfterRender = [];
24
30
  }, 25);
25
31
  }
32
+ disconnectedCallback() {
33
+ this.removeViewportListeners();
34
+ }
26
35
  /// Methods ///
27
36
  async toggle() {
28
37
  this.open = !this.open;
@@ -32,9 +41,18 @@ export class Q2Popover {
32
41
  this.popoverStateChanged.emit({ open });
33
42
  this.scheduledAfterRender.push(resizeIframe);
34
43
  if (open) {
44
+ this.addViewportListeners();
35
45
  this.determinePopDirection();
36
46
  }
37
47
  else {
48
+ this.removeViewportListeners();
49
+ // Reset currentDirection after close transition completes
50
+ this.containerElement.addEventListener('transitionend', () => {
51
+ if (this.open)
52
+ return;
53
+ this.currentDirection = undefined;
54
+ this.containerElement.style.removeProperty('--comp-pop-max-height');
55
+ }, { once: true });
38
56
  this.show = false;
39
57
  }
40
58
  }
@@ -46,17 +64,24 @@ export class Q2Popover {
46
64
  this.open = open;
47
65
  event.stopPropagation();
48
66
  }
67
+ addViewportListeners() {
68
+ // window.visualViewport.addEventListener('scroll', this.viewPortChanged);
69
+ window.visualViewport.addEventListener('resize', this.viewPortChanged);
70
+ }
71
+ removeViewportListeners() {
72
+ // window.visualViewport.removeEventListener('scroll', this.viewPortChanged);
73
+ window.visualViewport.removeEventListener('resize', this.viewPortChanged);
74
+ }
49
75
  async setDirectionAndShow(direction) {
50
76
  if (direction === 'up') {
51
77
  this.determinePopOffset();
52
78
  }
53
- this.privateDirection = direction;
79
+ this.currentDirection = direction;
54
80
  this.show = true;
55
81
  }
56
- /// Helpers ///
57
82
  async determinePopDirection() {
58
- var _a, _b, _c, _d, _e;
59
- const { containerElement, contentElement, direction, controlElement } = this;
83
+ var _a, _b, _c, _d, _e, _f, _g;
84
+ const { containerElement, contentElement, direction, controlElement, currentDirection } = this;
60
85
  if (containerElement)
61
86
  containerElement.style.maxHeight = null;
62
87
  // If direction defined, use it
@@ -71,32 +96,46 @@ export class Q2Popover {
71
96
  height: 0,
72
97
  };
73
98
  const contentHeight = contentElement.clientHeight;
74
- const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
75
- const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
99
+ const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) ||
100
+ ((_d = window.visualViewport) === null || _d === void 0 ? void 0 : _d.offsetTop) || // Only Android Chrome provides this which we need when scrolled
101
+ 0;
102
+ const innerHeight = ((_f = (_e = window.Tecton) === null || _e === void 0 ? void 0 : _e.platformDimensions) === null || _f === void 0 ? void 0 : _f.innerHeight) || ((_g = window.visualViewport) === null || _g === void 0 ? void 0 : _g.height) || window.innerHeight;
76
103
  const bottomOffset = scrollY + innerHeight - topOffset - height;
77
104
  const canShowFullSizeBelow = bottomOffset > contentHeight;
78
- const canShowFullSizeAbove = contentHeight <= topOffset || !this.minHeight;
105
+ const canShowFullSizeAbove = contentHeight <= topOffset;
79
106
  let determinedDirection;
80
107
  // Show the full-size popover below or above if it will fit
81
- if (canShowFullSizeBelow)
108
+ if (currentDirection === 'down' && canShowFullSizeBelow)
109
+ return this.setDirectionAndShow('down');
110
+ else if (currentDirection === 'up' && canShowFullSizeAbove)
111
+ return this.setDirectionAndShow('up');
112
+ else if (currentDirection === undefined && canShowFullSizeBelow)
82
113
  determinedDirection = 'down';
83
- else if (canShowFullSizeAbove)
114
+ else if (currentDirection === undefined && canShowFullSizeAbove)
84
115
  determinedDirection = 'up';
85
116
  if (determinedDirection)
86
117
  return this.setDirectionAndShow(determinedDirection);
87
- // If full size will not fit and minHeight is set, then make as tall as possible
118
+ // If full size will not fit then make it as tall as possible
88
119
  const { minHeight = 150 } = this;
89
120
  const displayBuffer = 5;
90
- const canShowSmallBelow = bottomOffset >= minHeight + displayBuffer;
121
+ const canShowMinHeightBelow = bottomOffset >= minHeight + displayBuffer;
91
122
  let maxHeight;
92
- if (canShowSmallBelow) {
123
+ if (currentDirection === 'down') {
93
124
  maxHeight = Math.max(bottomOffset - displayBuffer, minHeight);
94
125
  determinedDirection = 'down';
95
126
  }
96
- else {
127
+ else if (currentDirection === 'up') {
97
128
  maxHeight = Math.max(topOffset - displayBuffer, minHeight);
98
129
  determinedDirection = 'up';
99
130
  }
131
+ else if (canShowMinHeightBelow) {
132
+ maxHeight = Math.max(bottomOffset - displayBuffer, minHeight);
133
+ determinedDirection = 'down';
134
+ }
135
+ else {
136
+ maxHeight = Math.max(topOffset - scrollY - displayBuffer, minHeight);
137
+ determinedDirection = 'up';
138
+ }
100
139
  containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);
101
140
  return this.setDirectionAndShow(determinedDirection);
102
141
  }
@@ -108,7 +147,7 @@ export class Q2Popover {
108
147
  }
109
148
  /// DOM ///
110
149
  render() {
111
- const containerClasses = ['container', this.privateDirection];
150
+ const containerClasses = ['container', this.currentDirection];
112
151
  if (this.show)
113
152
  containerClasses.push('show');
114
153
  return (h("div", { ref: el => (this.containerElement = el), class: containerClasses.join(' '), role: "menu" }, h("div", { ref: el => (this.contentElement = el), class: "content" }, h("slot", null))));
@@ -235,7 +274,7 @@ export class Q2Popover {
235
274
  }
236
275
  static get states() {
237
276
  return {
238
- "privateDirection": {},
277
+ "currentDirection": {},
239
278
  "show": {}
240
279
  };
241
280
  }
@@ -94,7 +94,7 @@ button {
94
94
  box-shadow: var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));
95
95
  text-align: start;
96
96
  left: 0;
97
- transition: opacity var(--app-tween-1, 0.2s ease);
97
+ transition: opacity var(--app-tween-1, 0.2s ease), max-height var(--app-tween-1, 0.2s ease);
98
98
  border-radius: var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));
99
99
  max-height: var(--comp-pop-max-height);
100
100
  --comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
@@ -2,7 +2,7 @@ import { h } from '@stencil/core';
2
2
  import { createGuid, handleAriaLabel, loc, overrideFocus } from 'src/utils';
3
3
  export class Q2Radio {
4
4
  constructor() {
5
- this.id = `radio-${createGuid()}`;
5
+ this._id = `radio-${createGuid()}`;
6
6
  this.isLoaded = false;
7
7
  this.inputChange = (event) => {
8
8
  event.stopPropagation();
@@ -20,10 +20,10 @@ export class Q2Radio {
20
20
  this.disabled = false;
21
21
  this.checked = false;
22
22
  this.name = undefined;
23
- this.ariaLabel = undefined;
24
23
  this.groupDisabled = false;
25
24
  this.groupReadonly = false;
26
25
  this.groupTileLayout = false;
26
+ this.ariaLabel = undefined;
27
27
  }
28
28
  ////////// LIFECYCLE HOOKS ////////
29
29
  componentWillLoad() {
@@ -57,7 +57,7 @@ export class Q2Radio {
57
57
  }
58
58
  }
59
59
  render() {
60
- return (h("div", { class: this.groupTileLayout ? 'radio-tile' : 'radio-container' }, h("input", { ref: el => (this.inputField = el), class: "sr", id: this.id, type: "radio", name: this.name, value: this.value, disabled: this.disabled || this.groupDisabled, checked: this.checked, "aria-label": this.label && this.hideLabel ? loc(this.label) : undefined, onChange: this.inputChange, "test-id": "q2RadioInnerRadioBox" }), h("label", { htmlFor: this.id, "test-id": "radioButton" }, !this.groupTileLayout && (h("svg", { viewBox: "0 0 18 18" }, h("circle", { stroke: "none", fill: "none", cx: "9", cy: "9", r: "8" }), h("circle", { stroke: "none", fill: "none", cx: "9", cy: "9", r: "4" }))), !this.hideLabel && (h("div", { class: "label-content" }, (this.label && loc(this.label)) || '', h("slot", null))))));
60
+ return (h("div", { class: this.groupTileLayout ? 'radio-tile' : 'radio-container' }, h("input", { ref: el => (this.inputField = el), class: "sr", id: this._id, type: "radio", name: this.name, value: this.value, disabled: this.disabled || this.groupDisabled, checked: this.checked, "aria-label": this.label && this.hideLabel ? loc(this.label) : undefined, onChange: this.inputChange, "test-id": "q2RadioInnerRadioBox" }), h("label", { htmlFor: this._id, "test-id": "radioButton" }, !this.groupTileLayout && (h("svg", { viewBox: "0 0 18 18" }, h("circle", { stroke: "none", fill: "none", cx: "9", cy: "9", r: "8" }), h("circle", { stroke: "none", fill: "none", cx: "9", cy: "9", r: "4" }))), !this.hideLabel && (h("div", { class: "label-content" }, (this.label && loc(this.label)) || '', h("slot", null))))));
61
61
  }
62
62
  static get is() { return "q2-radio"; }
63
63
  static get encapsulation() { return "shadow"; }
@@ -92,7 +92,7 @@ export class Q2Radio {
92
92
  },
93
93
  "hideLabel": {
94
94
  "type": "boolean",
95
- "mutable": false,
95
+ "mutable": true,
96
96
  "complexType": {
97
97
  "original": "boolean",
98
98
  "resolved": "boolean",
@@ -177,23 +177,6 @@ export class Q2Radio {
177
177
  "attribute": "name",
178
178
  "reflect": true
179
179
  },
180
- "ariaLabel": {
181
- "type": "string",
182
- "mutable": true,
183
- "complexType": {
184
- "original": "string",
185
- "resolved": "string",
186
- "references": {}
187
- },
188
- "required": false,
189
- "optional": false,
190
- "docs": {
191
- "tags": [],
192
- "text": ""
193
- },
194
- "attribute": "aria-label",
195
- "reflect": true
196
- },
197
180
  "groupDisabled": {
198
181
  "type": "boolean",
199
182
  "mutable": false,
@@ -247,6 +230,26 @@ export class Q2Radio {
247
230
  "attribute": "group-tile-layout",
248
231
  "reflect": false,
249
232
  "defaultValue": "false"
233
+ },
234
+ "ariaLabel": {
235
+ "type": "string",
236
+ "mutable": true,
237
+ "complexType": {
238
+ "original": "string",
239
+ "resolved": "string",
240
+ "references": {}
241
+ },
242
+ "required": false,
243
+ "optional": false,
244
+ "docs": {
245
+ "tags": [{
246
+ "name": "deprecated",
247
+ "text": undefined
248
+ }],
249
+ "text": ""
250
+ },
251
+ "attribute": "aria-label",
252
+ "reflect": true
250
253
  }
251
254
  };
252
255
  }
@@ -91,7 +91,7 @@ button {
91
91
  }
92
92
  .radio-container circle:nth-child(1) {
93
93
  stroke-width: 2;
94
- stroke: var(--tct-radio-stroke-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc)))));
94
+ stroke: var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494));
95
95
  }
96
96
  .radio-container input:focus + label svg {
97
97
  box-shadow: var(--const-double-focus-ring);
@@ -101,7 +101,7 @@ button {
101
101
  }
102
102
  .radio-container input:checked + label circle:nth-child(1) {
103
103
  background-color: var(--tct-radio-checked-bg, transparent);
104
- stroke: var(--tct-radio-checked-stroke-color, var(--tct-radio-stroke-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));
104
+ stroke: var(--tct-radio-checked-stroke-color, var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494)));
105
105
  }
106
106
  .radio-container input:checked + label .label-content {
107
107
  font-weight: var(--tct-checkbox-selected-font-weight, 600);
@@ -119,7 +119,7 @@ button {
119
119
  .radio-tile label[for] {
120
120
  align-items: center;
121
121
  border-radius: 3px;
122
- border: 2px solid var(--tct-radio-stroke-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc)))));
122
+ border: 2px solid var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494));
123
123
  cursor: pointer;
124
124
  display: block;
125
125
  padding: 10px;
@@ -129,16 +129,16 @@ button {
129
129
  white-space: nowrap;
130
130
  }
131
131
  .radio-tile input:focus + label, .radio-tile input:focus:checked + label {
132
- border-color: #0079c1;
132
+ border-color: var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)));
133
133
  box-shadow: var(--const-double-focus-ring), var(--tct-global-focus, 0 0 0 2px #33b4ff);
134
134
  }
135
135
  .radio-tile input:checked + label {
136
- border-color: var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e));
136
+ border-color: var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)));
137
137
  box-shadow: inset 0 0 0 2px #ffffff;
138
138
  }
139
139
  .radio-tile input:checked + label:after {
140
140
  border-bottom-width: 3px;
141
- border-bottom: 5px solid #0079c1;
141
+ border-bottom: 5px solid var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)));
142
142
  border-left-width: 5px;
143
143
  border-left: 8px solid transparent;
144
144
  border-right-width: 5px;