q2-tecton-elements 1.10.9 → 1.11.1

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 (138) hide show
  1. package/dist/cjs/{icons-4595ee47.js → icons-9bd0febe.js} +10 -0
  2. package/dist/cjs/{index-a55d3c34.js → index-f5807a6a.js} +12 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  5. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-calendar.cjs.entry.js +5 -3
  7. package/dist/cjs/q2-card.cjs.entry.js +89 -0
  8. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-checkbox-group.cjs.entry.js +4 -1
  11. package/dist/cjs/q2-checkbox.cjs.entry.js +26 -7
  12. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-editable-field.cjs.entry.js +23 -18
  15. package/dist/cjs/q2-icon.cjs.entry.js +2 -2
  16. package/dist/cjs/q2-input.cjs.entry.js +12 -7
  17. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-pagination.cjs.entry.js +118 -0
  21. package/dist/cjs/q2-radio-group.cjs.entry.js +48 -3
  22. package/dist/cjs/q2-radio.cjs.entry.js +8 -3
  23. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-select.cjs.entry.js +18 -8
  25. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-stepper.cjs.entry.js +4 -2
  27. package/dist/cjs/q2-tab-container.cjs.entry.js +4 -2
  28. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  29. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  30. package/dist/collection/collection-manifest.json +2 -0
  31. package/dist/collection/components/q2-calendar/index.js +21 -2
  32. package/dist/collection/components/q2-card/index.js +290 -0
  33. package/dist/collection/components/q2-card/styles.css +161 -0
  34. package/dist/collection/components/q2-checkbox/index.js +43 -7
  35. package/dist/collection/components/q2-checkbox/styles.css +6 -2
  36. package/dist/collection/components/q2-checkbox-group/index.js +21 -0
  37. package/dist/collection/components/q2-editable-field/index.js +27 -20
  38. package/dist/collection/components/q2-icon/icons.js +10 -0
  39. package/dist/collection/components/q2-input/index.js +61 -5
  40. package/dist/collection/components/q2-input/styles.css +86 -125
  41. package/dist/collection/components/q2-pagination/index.js +277 -0
  42. package/dist/collection/components/q2-pagination/styles.css +120 -0
  43. package/dist/collection/components/q2-radio/index.js +25 -1
  44. package/dist/collection/components/q2-radio/styles.css +16 -16
  45. package/dist/collection/components/q2-radio-group/index.js +77 -9
  46. package/dist/collection/components/q2-radio-group/styles.css +4 -9
  47. package/dist/collection/components/q2-select/index.js +35 -7
  48. package/dist/collection/components/q2-stepper/index.js +2 -0
  49. package/dist/collection/components/q2-stepper/styles.css +4 -4
  50. package/dist/collection/components/q2-tab-container/index.js +3 -1
  51. package/dist/collection/components/q2-textarea/styles.css +72 -109
  52. package/dist/collection/components/tecton-tab-pane/index.js +1 -1
  53. package/dist/collection/utils/index.js +11 -1
  54. package/dist/esm/{icons-3ee662ea.js → icons-6a143c2f.js} +10 -0
  55. package/dist/esm/{index-ec6660af.js → index-0e13a57f.js} +12 -2
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/esm/q2-avatar.entry.js +1 -1
  58. package/dist/esm/q2-btn_2.entry.js +1 -1
  59. package/dist/esm/q2-calendar.entry.js +5 -3
  60. package/dist/esm/q2-card.entry.js +85 -0
  61. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  62. package/dist/esm/q2-carousel.entry.js +1 -1
  63. package/dist/esm/q2-checkbox-group.entry.js +4 -1
  64. package/dist/esm/q2-checkbox.entry.js +26 -7
  65. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  66. package/dist/esm/q2-dropdown.entry.js +1 -1
  67. package/dist/esm/q2-editable-field.entry.js +23 -18
  68. package/dist/esm/q2-icon.entry.js +2 -2
  69. package/dist/esm/q2-input.entry.js +12 -7
  70. package/dist/esm/q2-loc.entry.js +1 -1
  71. package/dist/esm/q2-message.entry.js +1 -1
  72. package/dist/esm/q2-optgroup.entry.js +1 -1
  73. package/dist/esm/q2-pagination.entry.js +114 -0
  74. package/dist/esm/q2-radio-group.entry.js +49 -4
  75. package/dist/esm/q2-radio.entry.js +8 -3
  76. package/dist/esm/q2-section.entry.js +1 -1
  77. package/dist/esm/q2-select.entry.js +18 -8
  78. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  79. package/dist/esm/q2-stepper.entry.js +4 -2
  80. package/dist/esm/q2-tab-container.entry.js +4 -2
  81. package/dist/esm/q2-tecton-elements.js +1 -1
  82. package/dist/esm/q2-textarea.entry.js +2 -2
  83. package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-2372f988.entry.js} +1 -1
  84. package/dist/q2-tecton-elements/p-27ec0a16.entry.js +1 -0
  85. package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-2be33492.entry.js} +1 -1
  86. package/dist/q2-tecton-elements/p-346b65d5.entry.js +1 -0
  87. package/dist/q2-tecton-elements/p-3c6f73cb.js +1 -0
  88. package/dist/q2-tecton-elements/p-3cb34e2e.entry.js +1 -0
  89. package/dist/q2-tecton-elements/{p-843b1ee9.entry.js → p-492dfb55.entry.js} +1 -1
  90. package/dist/q2-tecton-elements/p-564154f3.entry.js +1 -0
  91. package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-6a83a97c.entry.js} +1 -1
  92. package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-701b381a.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/p-7dec37d6.entry.js +1 -0
  94. package/dist/q2-tecton-elements/p-841ec108.entry.js +1 -0
  95. package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-88bc2f49.entry.js} +1 -1
  96. package/dist/q2-tecton-elements/p-9ccbc3d8.entry.js +1 -0
  97. package/dist/q2-tecton-elements/{p-8509b171.entry.js → p-a72e7a12.entry.js} +1 -1
  98. package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-af202624.entry.js} +1 -1
  99. package/dist/q2-tecton-elements/p-b5b12e46.entry.js +1 -0
  100. package/dist/q2-tecton-elements/{p-c5e55b9f.entry.js → p-bfd77f9b.entry.js} +1 -1
  101. package/dist/q2-tecton-elements/p-c83dba0a.entry.js +1 -0
  102. package/dist/q2-tecton-elements/p-ca847db7.entry.js +1 -0
  103. package/dist/q2-tecton-elements/p-d199fca8.entry.js +1 -0
  104. package/dist/q2-tecton-elements/p-dffbcec3.entry.js +1 -0
  105. package/dist/q2-tecton-elements/{p-5559f126.entry.js → p-f73df612.entry.js} +1 -1
  106. package/dist/q2-tecton-elements/{p-bbacb804.entry.js → p-f85bf7fb.entry.js} +1 -1
  107. package/dist/q2-tecton-elements/p-f85da2a8.js +1 -0
  108. package/dist/q2-tecton-elements/p-fc318ae2.entry.js +1 -0
  109. package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-fe61c1aa.entry.js} +1 -1
  110. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  111. package/dist/test/helpers.js +10 -3
  112. package/dist/types/components/q2-calendar/index.d.ts +1 -0
  113. package/dist/types/components/q2-card/index.d.ts +31 -0
  114. package/dist/types/components/q2-checkbox/index.d.ts +4 -0
  115. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
  116. package/dist/types/components/q2-editable-field/index.d.ts +2 -0
  117. package/dist/types/components/q2-input/index.d.ts +3 -0
  118. package/dist/types/components/q2-pagination/index.d.ts +30 -0
  119. package/dist/types/components/q2-radio/index.d.ts +2 -1
  120. package/dist/types/components/q2-radio-group/index.d.ts +4 -0
  121. package/dist/types/components/q2-select/index.d.ts +2 -0
  122. package/dist/types/components.d.ts +80 -0
  123. package/dist/types/utils/index.d.ts +1 -0
  124. package/dist/types/workspace/workspace/{tecton-production_release_1.10.x → tecton-production_release_1.11.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +4 -1
  125. package/package.json +2 -2
  126. package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
  127. package/dist/q2-tecton-elements/p-4ae9d1f3.entry.js +0 -1
  128. package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
  129. package/dist/q2-tecton-elements/p-52f53e07.entry.js +0 -1
  130. package/dist/q2-tecton-elements/p-78642b7b.entry.js +0 -1
  131. package/dist/q2-tecton-elements/p-7eb39c90.entry.js +0 -1
  132. package/dist/q2-tecton-elements/p-81df91a1.entry.js +0 -1
  133. package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
  134. package/dist/q2-tecton-elements/p-96c9eb75.entry.js +0 -1
  135. package/dist/q2-tecton-elements/p-ab977515.entry.js +0 -1
  136. package/dist/q2-tecton-elements/p-c555f1de.entry.js +0 -1
  137. package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
  138. package/dist/q2-tecton-elements/p-fc804ebd.entry.js +0 -1
@@ -0,0 +1,120 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ text-align: right;
69
+ display: block;
70
+ }
71
+
72
+ :host([hidden]) {
73
+ display: none;
74
+ }
75
+
76
+ .container {
77
+ display: inline-flex;
78
+ column-gap: var(--tct-pagination-column-gap, var(--t-pagination-column-gap, var(--app-scale-2x, 10px)));
79
+ align-items: center;
80
+ height: var(--tct-pagination-height, var(--t-pagination-height, 44px));
81
+ }
82
+
83
+ .btn-group {
84
+ display: flex;
85
+ gap: var(--tct-pagination-btn-gap, var(--t-pagination-btn-gap, 0));
86
+ }
87
+
88
+ .description,
89
+ .controls {
90
+ white-space: nowrap;
91
+ }
92
+
93
+ .controls {
94
+ display: grid;
95
+ grid-template-columns: auto 50px auto;
96
+ align-items: center;
97
+ gap: var(--tct-pagination-controls-gap, var(--t-pagination-controls-gap, var(--app-scale-1x, 5px)));
98
+ }
99
+ .controls[hidden] {
100
+ display: none;
101
+ }
102
+
103
+ .input-wrapper {
104
+ height: var(--tct-pagination-height, var(--t-pagination-height, 44px));
105
+ display: flex;
106
+ align-items: center;
107
+ }
108
+
109
+ q2-icon {
110
+ --tct-icon-size: var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));
111
+ color: var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)));
112
+ }
113
+
114
+ q2-input {
115
+ --tct-input-margin-top: 0;
116
+ --tct-input-margin-bottom: 0;
117
+ --tct-input-height: var(--tct-pagination-input-height, var(--t-pagination-input-height, 30px));
118
+ --tct-input-min-height: var(--tct-input-height);
119
+ --tct-input-align: center;
120
+ }
@@ -5,10 +5,15 @@ export class Q2Radio {
5
5
  this.disabled = false;
6
6
  this.checked = false;
7
7
  this.groupDisabled = false;
8
+ this.groupReadonly = false;
8
9
  this.groupTileLayout = false;
9
10
  this.id = `radio-${createGuid()}`;
10
11
  this.inputChange = (event) => {
11
12
  event.stopPropagation();
13
+ if (this.groupReadonly) {
14
+ event.preventDefault();
15
+ return false;
16
+ }
12
17
  this.change.emit({ value: this.value });
13
18
  };
14
19
  }
@@ -36,7 +41,7 @@ export class Q2Radio {
36
41
  }
37
42
  render() {
38
43
  return (h("div", { class: this.groupTileLayout ? 'radio-tile' : 'radio-container' },
39
- 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" }),
44
+ 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, onClick: this.inputChange, "test-id": "q2RadioInnerRadioBox" }),
40
45
  h("label", { htmlFor: this.id, "test-id": "radioButton" },
41
46
  !this.groupTileLayout && (h("svg", { viewBox: "0 0 18 18" },
42
47
  h("circle", { stroke: "none", fill: "none", cx: "9", cy: "9", r: "8" }),
@@ -46,6 +51,7 @@ export class Q2Radio {
46
51
  h("slot", null))))));
47
52
  }
48
53
  static get is() { return "q2-radio"; }
54
+ static get encapsulation() { return "shadow"; }
49
55
  static get originalStyleUrls() { return {
50
56
  "$": ["styles.scss"]
51
57
  }; }
@@ -192,6 +198,24 @@ export class Q2Radio {
192
198
  "reflect": false,
193
199
  "defaultValue": "false"
194
200
  },
201
+ "groupReadonly": {
202
+ "type": "boolean",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "boolean",
206
+ "resolved": "boolean",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "attribute": "group-readonly",
216
+ "reflect": false,
217
+ "defaultValue": "false"
218
+ },
195
219
  "groupTileLayout": {
196
220
  "type": "boolean",
197
221
  "mutable": false,
@@ -64,15 +64,15 @@ button {
64
64
  visibility: hidden;
65
65
  }
66
66
 
67
- q2-radio {
67
+ :host {
68
68
  margin-top: var(--tct-radio-margin-vertical, var(--tct-scale-2, 10px));
69
69
  margin-right: var(--tct-radio-margin-horizontal, var(--tct-scale-3, 15px));
70
70
  display: block;
71
71
  }
72
- q2-radio .radio-container {
72
+ :host .radio-container {
73
73
  margin-bottom: var(--tct-radio-margin-vertical, var(--tct-scale-2, 10px));
74
74
  }
75
- q2-radio .radio-container label[for] {
75
+ :host .radio-container label[for] {
76
76
  font-weight: var(--tct-radio-font-weight, var(--tct-checkbox-font-weight, 400));
77
77
  align-items: center;
78
78
  cursor: pointer;
@@ -81,39 +81,39 @@ q2-radio .radio-container label[for] {
81
81
  grid-template-columns: 18px 1fr;
82
82
  gap: var(--tct-scale-1, var(--app-scale-1, 5px));
83
83
  }
84
- q2-radio .radio-container svg {
84
+ :host .radio-container svg {
85
85
  border-radius: 50%;
86
86
  transition: box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
87
87
  outline: 0;
88
88
  width: 100%;
89
89
  }
90
- q2-radio .radio-container circle:nth-child(1) {
90
+ :host .radio-container circle:nth-child(1) {
91
91
  stroke-width: 2;
92
92
  stroke: var(--tct-radio-stroke-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc)))));
93
93
  }
94
- q2-radio .radio-container input:focus + label svg {
94
+ :host .radio-container input:focus + label svg {
95
95
  box-shadow: var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff));
96
96
  }
97
- q2-radio .radio-container input:focus + label circle:nth-child(1) {
97
+ :host .radio-container input:focus + label circle:nth-child(1) {
98
98
  stroke: var(--tct-radio-focus-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)));
99
99
  }
100
- q2-radio .radio-container input:checked + label circle:nth-child(1) {
100
+ :host .radio-container input:checked + label circle:nth-child(1) {
101
101
  background-color: var(--tct-radio-checked-bg, transparent);
102
102
  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))))));
103
103
  }
104
- q2-radio .radio-container input:checked + label .label-content {
104
+ :host .radio-container input:checked + label .label-content {
105
105
  font-weight: var(--tct-checkbox-selected-font-weight, 600);
106
106
  letter-spacing: var(--tct-checkbox-selected-letter-spacing, 0.25);
107
107
  }
108
- q2-radio .radio-container input:checked + label circle:nth-child(2) {
108
+ :host .radio-container input:checked + label circle:nth-child(2) {
109
109
  fill: var(--tct-radio-checked-fill, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)));
110
110
  }
111
- q2-radio .radio-tile {
111
+ :host .radio-tile {
112
112
  flex-basis: 100px;
113
113
  flex-grow: 0;
114
114
  flex-wrap: wrap;
115
115
  }
116
- q2-radio .radio-tile label[for] {
116
+ :host .radio-tile label[for] {
117
117
  align-items: center;
118
118
  border-radius: 3px;
119
119
  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)))));
@@ -125,15 +125,15 @@ q2-radio .radio-tile label[for] {
125
125
  transition: border-color var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
126
126
  white-space: nowrap;
127
127
  }
128
- q2-radio .radio-tile input:focus + label {
128
+ :host .radio-tile input:focus + label {
129
129
  border-color: #0079c1;
130
130
  box-shadow: var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff));
131
131
  }
132
- q2-radio .radio-tile input:checked + label {
132
+ :host .radio-tile input:checked + label {
133
133
  border-color: var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e));
134
134
  box-shadow: inset 0 0 0 2px #ffffff;
135
135
  }
136
- q2-radio .radio-tile input:checked + label:after {
136
+ :host .radio-tile input:checked + label:after {
137
137
  border-bottom-width: 3px;
138
138
  border-bottom: 5px solid #0079c1;
139
139
  border-left-width: 5px;
@@ -148,7 +148,7 @@ q2-radio .radio-tile input:checked + label:after {
148
148
  position: absolute;
149
149
  width: 0;
150
150
  }
151
- q2-radio input:disabled + label {
151
+ :host input:disabled + label {
152
152
  cursor: not-allowed;
153
153
  opacity: var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));
154
154
  }
@@ -1,4 +1,4 @@
1
- import { Component, Prop, Element, h, Listen, Event, Watch } from '@stencil/core';
1
+ import { Component, Prop, Element, h, Listen, Event, Watch, Fragment } from '@stencil/core';
2
2
  import { createGuid, isEventFromElement, loc, overrideFocus } from 'src/utils';
3
3
  export class Q2RadioGroup {
4
4
  constructor() {
@@ -10,10 +10,13 @@ export class Q2RadioGroup {
10
10
  this.valueUpdated();
11
11
  this.nameUpdated();
12
12
  this.disabledUpdated();
13
+ this.readonlyUpdated();
13
14
  this.tileLayoutUpdated();
14
15
  };
15
16
  this.onInnerRadioChange = (event) => {
16
17
  event.stopImmediatePropagation();
18
+ if (this.readonly)
19
+ return;
17
20
  this.change.emit({ value: event.detail.value });
18
21
  };
19
22
  }
@@ -44,6 +47,10 @@ export class Q2RadioGroup {
44
47
  radio.groupDisabled = this.disabled;
45
48
  });
46
49
  }
50
+ readonlyUpdated() {
51
+ const readonly = this.readonly;
52
+ this.radioElements.forEach(radio => (radio.groupReadonly = readonly));
53
+ }
47
54
  tileLayoutUpdated() {
48
55
  this.radioElements.forEach(radio => {
49
56
  radio.groupTileLayout = this.tilelayout;
@@ -63,16 +70,51 @@ export class Q2RadioGroup {
63
70
  this.hostElement.querySelector('q2-radio');
64
71
  radio === null || radio === void 0 ? void 0 : radio.dispatchEvent(new FocusEvent('focus'));
65
72
  }
73
+ keydownHandler(event) {
74
+ const currentValue = event.target.getAttribute('value') || this.value;
75
+ let index = this.radioElements.findIndex(el => el === event.target || el.getAttribute('value') === currentValue);
76
+ let sign = 0;
77
+ switch (event.key) {
78
+ case 'ArrowLeft':
79
+ case 'ArrowUp':
80
+ sign = -1;
81
+ break;
82
+ case 'ArrowRight':
83
+ case 'ArrowDown':
84
+ sign = 1;
85
+ break;
86
+ }
87
+ if (index === -1 || sign === 0) {
88
+ return;
89
+ }
90
+ index += sign;
91
+ index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);
92
+ event.preventDefault();
93
+ if (!this.readonly) {
94
+ this.value = this.radioElements[index].value;
95
+ }
96
+ this.radioElements[index].dispatchEvent(new FocusEvent('focus'));
97
+ }
98
+ labelDOM() {
99
+ const { label, optional, readonly } = this;
100
+ let helpText = '';
101
+ if (readonly) {
102
+ helpText = h("span", { class: "optional-tag" }, loc('tecton.element.input.readonly'));
103
+ }
104
+ else if (optional) {
105
+ helpText = h("span", { class: "optional-tag" }, loc('tecton.element.input.optional'));
106
+ }
107
+ return (h(Fragment, null,
108
+ label && loc(label),
109
+ !!helpText && h("span", { class: "optional-tag" }, helpText)));
110
+ }
66
111
  render() {
112
+ const showLabel = this.label || this.optional || this.readonly;
67
113
  return (h("div", null,
68
- this.label || this.optional ? (h("div", { class: "group-legend" },
69
- this.label && loc(this.label),
70
- this.optional ? (h("span", { class: "optional-tag" }, loc('tecton.element.input.optional'))) : (''))) : (''),
71
- h("fieldset", { class: `q2-radio-fieldset ${this.hasError ? 'has-error' : ''}`, onChange: this.onInnerRadioChange, "aria-required": `${!this.optional}` },
72
- this.label || this.optional ? (h("legend", { class: "sr-only" },
73
- this.label && loc(this.label),
74
- this.optional ? (h("span", { class: "optional-tag" }, loc('tecton.element.input.optional'))) : (''))) : (''),
75
- this.hasError ? (h("div", { class: `error-icon-container ${this.label || this.optional ? '' : 'no-label'}` },
114
+ showLabel && h("div", { class: "group-legend" }, this.labelDOM()),
115
+ h("fieldset", { class: `q2-radio-fieldset ${this.hasError ? 'has-error' : ''}`, onChange: this.onInnerRadioChange, "aria-required": `${!this.optional}`, "aria-readonly": `${this.readonly}` },
116
+ showLabel && h("legend", { class: "sr-only" }, this.labelDOM()),
117
+ this.hasError ? (h("div", { class: `error-icon-container ${!showLabel && 'no-label'}` },
76
118
  h("q2-icon", { class: "h(4) w(4) mrg-b(2)", type: "error" }))) : (''),
77
119
  this.inputDom())));
78
120
  }
@@ -184,6 +226,23 @@ export class Q2RadioGroup {
184
226
  "attribute": "optional",
185
227
  "reflect": true
186
228
  },
229
+ "readonly": {
230
+ "type": "boolean",
231
+ "mutable": false,
232
+ "complexType": {
233
+ "original": "boolean",
234
+ "resolved": "boolean",
235
+ "references": {}
236
+ },
237
+ "required": false,
238
+ "optional": false,
239
+ "docs": {
240
+ "tags": [],
241
+ "text": ""
242
+ },
243
+ "attribute": "readonly",
244
+ "reflect": true
245
+ },
187
246
  "tilelayout": {
188
247
  "type": "boolean",
189
248
  "mutable": false,
@@ -264,6 +323,9 @@ export class Q2RadioGroup {
264
323
  }, {
265
324
  "propName": "disabled",
266
325
  "methodName": "disabledUpdated"
326
+ }, {
327
+ "propName": "readonly",
328
+ "methodName": "readonlyUpdated"
267
329
  }, {
268
330
  "propName": "tilelayout",
269
331
  "methodName": "tileLayoutUpdated"
@@ -280,5 +342,11 @@ export class Q2RadioGroup {
280
342
  "target": undefined,
281
343
  "capture": false,
282
344
  "passive": false
345
+ }, {
346
+ "name": "keydown",
347
+ "method": "keydownHandler",
348
+ "target": undefined,
349
+ "capture": false,
350
+ "passive": false
283
351
  }]; }
284
352
  }
@@ -73,7 +73,6 @@ fieldset {
73
73
  margin: 0;
74
74
  border: 0;
75
75
  }
76
-
77
76
  fieldset.has-error {
78
77
  border-color: var(--tct-input-error-border-color, var(--const-stoplight-alert, #c30000));
79
78
  border-width: 1px;
@@ -81,7 +80,6 @@ fieldset.has-error {
81
80
  border-radius: var(--tct-border-radius-1, var(--app-border-radius-1, 2px));
82
81
  position: relative;
83
82
  }
84
-
85
83
  fieldset.has-error .error-icon-container {
86
84
  top: 8px;
87
85
  right: 8px;
@@ -90,7 +88,6 @@ fieldset.has-error .error-icon-container {
90
88
  text-align: right;
91
89
  background: linear-gradient(to right, transparent, white);
92
90
  }
93
-
94
91
  fieldset.has-error legend + div.error-icon-container.no-label {
95
92
  top: 28px;
96
93
  }
@@ -110,10 +107,10 @@ legend.sr-only {
110
107
  }
111
108
 
112
109
  .optional-tag {
113
- margin-left: var(--tct-input-label-optional-margin-left, var(--tct-scale-1, var(--app-scale-1, 5px)));
114
- color: var(--tct-input-label-optional-font-color, var(--tct-a11y-color, var(--t-a11y-gray-color, #767676)));
115
- font-size: var(--tct-input-label-optional-font-size, 12px);
116
- font-weight: var(--tct-input-label-optional-font-weight, 400);
110
+ margin-left: var(--tct-input-label-optional-margin-left, var(--t-input-label-optional-margin-left, var(--tct-scale-1, var(--app-scale-1, 5px))));
111
+ color: var(--tct-input-label-optional-font-color, var(--t-input-label-optional-font-color, var(--t-textA, var(--t-a11y-gray-color, rgba(77, 77, 77, 0.77)))));
112
+ font-size: var(--tct-input-label-optional-font-size, var(--t-input-label-optional-font-size, 12px));
113
+ font-weight: var(--tct-input-label-optional-font-weight, var(--t-input-label-optional-font-weight, 400));
117
114
  }
118
115
 
119
116
  .flexed {
@@ -123,11 +120,9 @@ legend.sr-only {
123
120
  align-items: center;
124
121
  justify-content: center;
125
122
  }
126
-
127
123
  .flexed.left {
128
124
  justify-content: left;
129
125
  }
130
-
131
126
  .flexed.right {
132
127
  justify-content: right;
133
128
  }
@@ -4,6 +4,7 @@ export class Q2Select {
4
4
  constructor() {
5
5
  this.selectedOptions = [];
6
6
  this.disabled = false;
7
+ this.readonly = false;
7
8
  this.multiple = false;
8
9
  this.minRows = 3;
9
10
  this.searchable = false;
@@ -42,9 +43,9 @@ export class Q2Select {
42
43
  this.searchAndFocus = keyValue => {
43
44
  // pseudo search in non-searchable select
44
45
  const reorder = () => {
45
- const pivotIndex = (this.activeIndex || 0) + 1;
46
+ this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;
46
47
  const list = this.optionElements.map((element, index) => ({ element, index }));
47
- return [...list.slice(pivotIndex), ...list.slice(0, pivotIndex)];
48
+ return [...list.slice(this.pivotIndex), ...list.slice(0, this.pivotIndex)];
48
49
  };
49
50
  const buildQueue = () => {
50
51
  const now = new Date();
@@ -60,6 +61,7 @@ export class Q2Select {
60
61
  const searchIndex = list => {
61
62
  return list.find(v => {
62
63
  return (!v.element.disabled &&
64
+ v.element.display &&
63
65
  v.element.display
64
66
  .replace(/\s/g, '')
65
67
  .match(new RegExp(`^${this.keyStore.queue.join('')}`, 'i')));
@@ -96,9 +98,10 @@ export class Q2Select {
96
98
  event.stopPropagation();
97
99
  const { activeIndex, searchable, optionElements, multiSelectHeader } = this;
98
100
  const { key, shiftKey } = event;
99
- if (multiSelectHeader &&
100
- multiSelectHeader.contains(event.target) &&
101
- [' ', 'Enter'].includes(key))
101
+ if (this.readonly ||
102
+ (multiSelectHeader &&
103
+ multiSelectHeader.contains(event.target) &&
104
+ [' ', 'Enter'].includes(key)))
102
105
  return;
103
106
  switch (key) {
104
107
  case ' ':
@@ -180,6 +183,7 @@ export class Q2Select {
180
183
  }
181
184
  };
182
185
  this.inputKeydownHandler = (event) => {
186
+ event.stopPropagation();
183
187
  const { key } = event;
184
188
  const { optionElements, dropdownOpen, searchable } = this;
185
189
  switch (key) {
@@ -342,7 +346,7 @@ export class Q2Select {
342
346
  get minPopHeight() {
343
347
  const { minRows } = this;
344
348
  const firstOption = this.hostElement.querySelector('q2-option:not([hidden])');
345
- const minHeight = window.getComputedStyle(firstOption).minHeight;
349
+ const minHeight = firstOption ? window.getComputedStyle(firstOption).minHeight : '44px';
346
350
  return minRows * parseInt(minHeight);
347
351
  }
348
352
  get selectedDisplay() {
@@ -413,12 +417,16 @@ export class Q2Select {
413
417
  activeOption === null || activeOption === void 0 ? void 0 : activeOption.scrollIntoView({ block: 'nearest' });
414
418
  }
415
419
  openDropdownWithoutActiveElement() {
420
+ if (this.readonly)
421
+ return;
416
422
  this.activeIndex = undefined;
417
423
  this.setActiveOption();
418
424
  this.dropdownOpen = true;
419
425
  this.scheduledAfterRender.push(this.resizeIframe);
420
426
  }
421
427
  openDropdownWithActiveElement(activeIndex) {
428
+ if (this.readonly)
429
+ return;
422
430
  this.activeIndex = activeIndex;
423
431
  this.dropdownOpen = true;
424
432
  this.setActiveOption();
@@ -528,6 +536,8 @@ export class Q2Select {
528
536
  });
529
537
  }
530
538
  onHostElementChange(event) {
539
+ if (this.readonly)
540
+ return;
531
541
  if (event.target === this.hostElement && !this.hostElement.onchange) {
532
542
  if (this.multiple) {
533
543
  this.selectedOptions = event.detail.selectedOptions;
@@ -591,7 +601,7 @@ export class Q2Select {
591
601
  this.errors.length > 0 &&
592
602
  this.errors.map(error => loc(error))) ||
593
603
  (this.invalid && ['tecton.element.select.invalid']) ||
594
- [], disabled: this.disabled, optional: this.optional, hideLabel: this.hideLabel, ariaExpanded: this.dropdownOpen, ariaOwns: "dropdown", ariaHaspopup: "listbox", role: this.searchable ? 'combobox' : null, pseudo: !this.searchable, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler }),
604
+ [], disabled: this.disabled, optional: this.optional, readonly: this.readonly, hideLabel: this.hideLabel, ariaExpanded: this.dropdownOpen, ariaOwns: "dropdown", ariaHaspopup: "listbox", role: this.searchable ? 'combobox' : null, pseudo: !this.searchable, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler }),
595
605
  h("div", { class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick },
596
606
  h("slot", { name: "q2-select-display" })),
597
607
  this.optionsDropdown()));
@@ -724,6 +734,24 @@ export class Q2Select {
724
734
  "reflect": true,
725
735
  "defaultValue": "false"
726
736
  },
737
+ "readonly": {
738
+ "type": "boolean",
739
+ "mutable": false,
740
+ "complexType": {
741
+ "original": "boolean",
742
+ "resolved": "boolean",
743
+ "references": {}
744
+ },
745
+ "required": false,
746
+ "optional": false,
747
+ "docs": {
748
+ "tags": [],
749
+ "text": ""
750
+ },
751
+ "attribute": "readonly",
752
+ "reflect": true,
753
+ "defaultValue": "false"
754
+ },
727
755
  "invalid": {
728
756
  "type": "boolean",
729
757
  "mutable": false,
@@ -65,6 +65,8 @@ export class Q2Stepper {
65
65
  this.stepCount = allPanes.length;
66
66
  };
67
67
  this.checkScrollState = () => {
68
+ if (!this.listElement)
69
+ return;
68
70
  const { scrollLeft, scrollWidth, clientWidth } = this.listElement;
69
71
  this.scrollEnabled = scrollWidth > clientWidth;
70
72
  this.showScrollLeft = !!scrollLeft;
@@ -190,11 +190,11 @@ hr {
190
190
  color: var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d)));
191
191
  font-size: var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px)));
192
192
  height: 1.5em;
193
+ text-overflow: ellipsis;
194
+ overflow: hidden;
193
195
  display: -webkit-box;
194
196
  -webkit-line-clamp: 2;
195
197
  -webkit-box-orient: vertical;
196
- overflow: hidden;
197
- text-overflow: ellipsis;
198
198
  }
199
199
  [aria-selected] .step-label {
200
200
  font-weight: var(--tct-stepper-active-font-weight, var(--t-stepper-active-font-weight, 600));
@@ -206,11 +206,11 @@ hr {
206
206
  .step-description {
207
207
  color: var(--tct-stepper-description-color, var(--t-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));
208
208
  font-size: var(--tct-stepper-description-font-size, var(--t-stepper-description-font-size, var(--app-font-size-small, 12px)));
209
+ text-overflow: ellipsis;
210
+ overflow: hidden;
209
211
  display: -webkit-box;
210
212
  -webkit-line-clamp: 4;
211
213
  -webkit-box-orient: vertical;
212
- overflow: hidden;
213
- text-overflow: ellipsis;
214
214
  padding-bottom: 0.2em;
215
215
  }
216
216
 
@@ -97,6 +97,8 @@ export class Q2TabContainer {
97
97
  return focusedTab;
98
98
  };
99
99
  this.checkScrollState = () => {
100
+ if (!this.listElement)
101
+ return;
100
102
  const { scrollLeft, scrollWidth, clientWidth } = this.listElement;
101
103
  this.scrollEnabled = scrollWidth > clientWidth;
102
104
  this.showScrollLeft = !!scrollLeft;
@@ -164,7 +166,7 @@ export class Q2TabContainer {
164
166
  overrideFocus(this.hostElement);
165
167
  const index = this.tabs.findIndex(el => el.value === this.value);
166
168
  this.scheduledAfterRender.push(() => {
167
- const tab = this.moveFocus(Math.max(index, 0), false);
169
+ const tab = this.moveFocus(Math.max(index, 0));
168
170
  this.value = tab.dataset.value;
169
171
  tab.blur();
170
172
  });