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,161 @@
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
+ display: block;
69
+ }
70
+
71
+ button,
72
+ a {
73
+ width: 100%;
74
+ text-align: start;
75
+ cursor: pointer;
76
+ height: 100%;
77
+ display: grid;
78
+ gap: var(--tct-card-gap, var(--t-card-gap, var(--app-scale-3x, 15px)));
79
+ margin: 0;
80
+ border: none;
81
+ background: var(--tct-card-background, var(--t-card-background, var(--t-base, #ffffff)));
82
+ padding: var(--tct-card-padding, var(--t-card-padding, var(--app-scale-4x, 20px)));
83
+ color: var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));
84
+ text-decoration: none;
85
+ border-radius: var(--tct-card-border-radius, var(--t-card-border-radius, var(--app-border-radius-1, 3px)));
86
+ transition: box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
87
+ box-shadow: var(--tct-card-box-shadow, var(--t-card-box-shadow, var(--app-shadow-2, 0 3px 6px rgba(0, 0, 0, 0.3))));
88
+ --comp-avatar-size: var(--tct-card-avatar-size, var(--t-card-avatar-size, 44px));
89
+ --comp-chevron-size: 0;
90
+ }
91
+ @media (hover: hover) {
92
+ button:hover, button:active, button:focus,
93
+ a:hover,
94
+ a:active,
95
+ a:focus {
96
+ color: var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));
97
+ }
98
+ button:hover,
99
+ a:hover {
100
+ box-shadow: var(--tct-card-hover-box-shadow, var(--t-card-hover-box-shadow, var(--app-shadow-3, 0 4px 12px rgba(0, 0, 0, 0.3))));
101
+ }
102
+ button:active,
103
+ a:active {
104
+ box-shadow: var(--tct-card-active-box-shadow, var(--t-card-active-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));
105
+ }
106
+ }
107
+ button.is-small,
108
+ a.is-small {
109
+ --comp-avatar-size: var(--tct-card-avatar-size, var(--t-card-avatar-size, 26px));
110
+ }
111
+ button.is-touch,
112
+ a.is-touch {
113
+ --comp-chevron-size: var(--tct-card-chevron-size, var(--t-card-chevron-size, 26px));
114
+ grid-template-columns: 1fr var(--comp-chevron-size);
115
+ }
116
+ button.has-avatar,
117
+ a.has-avatar {
118
+ grid-template-columns: var(--comp-avatar-size) 1fr;
119
+ --tct-avatar-width: var(--comp-avatar-size);
120
+ --tct-avatar-height: var(--comp-avatar-size);
121
+ --tct-icon-size: var(--comp-avatar-size);
122
+ }
123
+ button.has-avatar.is-touch,
124
+ a.has-avatar.is-touch {
125
+ grid-template-columns: var(--comp-avatar-size) 1fr var(--comp-chevron-size);
126
+ }
127
+
128
+ .container {
129
+ overflow: hidden;
130
+ display: grid;
131
+ gap: var(--tct-card-container-gap, var(--t-card-container-gap, var(--app-scale-1x, 5px)));
132
+ align-content: start;
133
+ }
134
+
135
+ h3,
136
+ p {
137
+ margin: 0;
138
+ padding: 0;
139
+ line-height: var(--tct-card-font-height, var(--t-card-font-height, 20px));
140
+ }
141
+
142
+ h3 {
143
+ font-weight: var(--tct-card-font-weight, var(--t-card-font-weight, 600));
144
+ font-size: var(--tct-card-font-size, var(--t-card-font-size, 17px));
145
+ text-overflow: ellipsis;
146
+ overflow: hidden;
147
+ white-space: nowrap;
148
+ }
149
+
150
+ p {
151
+ text-overflow: ellipsis;
152
+ overflow: hidden;
153
+ display: -webkit-box;
154
+ -webkit-line-clamp: 2;
155
+ -webkit-box-orient: vertical;
156
+ }
157
+
158
+ .touch-indicator {
159
+ align-self: center;
160
+ --tct-icon-size: var(--comp-chevron-size);
161
+ }
@@ -7,10 +7,26 @@ export class Q2Checkbox {
7
7
  ///// Actions ////////
8
8
  this.onInputChange = (event) => {
9
9
  event.stopPropagation();
10
+ if (this.disabled || this.readonly)
11
+ return;
12
+ if (!(event.target instanceof HTMLInputElement))
13
+ return;
10
14
  this.change.emit({
11
15
  value: event.target.value,
12
16
  checked: event.target.checked
13
17
  });
18
+ this.inputElement.focus();
19
+ };
20
+ this.onControlClick = (event) => {
21
+ event.stopPropagation();
22
+ if (this.readonly)
23
+ return;
24
+ this.inputElement.click();
25
+ };
26
+ this.onKeyDown = (event) => {
27
+ if (this.readonly && event.code === 'Space') {
28
+ event.preventDefault();
29
+ }
14
30
  };
15
31
  }
16
32
  ////////// LIFECYCLE HOOKS ////////
@@ -22,7 +38,10 @@ export class Q2Checkbox {
22
38
  }
23
39
  //////// Host Element Events ////////
24
40
  defaultChangeHandler(event) {
25
- if (event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {
41
+ if (!this.readonly &&
42
+ event.target === this.hostElement &&
43
+ !this.hostElement.onchange &&
44
+ !!event.detail) {
26
45
  this.checked = event.detail.checked;
27
46
  }
28
47
  }
@@ -38,21 +57,21 @@ export class Q2Checkbox {
38
57
  /////// View Methods ///////
39
58
  render() {
40
59
  return (h("div", { class: "checkbox-container" },
41
- h("input", { id: this.id, type: "checkbox", checked: this.indeterminate || this.checked || false, disabled: !!this.disabled || !!this.groupDisabled, class: "sr", value: this.value, name: this.name || this.id, "aria-label": this.label && this.hideLabel ? loc(this.label) : undefined, onChange: this.onInputChange, "test-id": "q2CheckboxInnerCheckBox" }),
42
- h("label", { htmlFor: this.id, "test-id": "checkboxButton" },
60
+ h("input", { ref: el => (this.inputElement = el), id: this.id, type: "checkbox", checked: this.indeterminate || this.checked || false, disabled: !!this.disabled || !!this.groupDisabled, class: "sr", value: this.value, name: this.name || this.id, "aria-label": this.label && this.hideLabel ? loc(this.label) : undefined, "test-id": "q2CheckboxInnerCheckBox", onKeyDown: this.onKeyDown, onChange: this.onInputChange }),
61
+ h("label", { "test-id": "checkboxButton" },
43
62
  this.generateCheckboxSVG(),
44
63
  !this.hideLabel && (h("div", { class: "q2-checkbox-label-content" },
45
- loc(this.label),
64
+ h("span", { class: "label-text", onClick: this.onControlClick }, loc(this.label)),
46
65
  h("slot", null))))));
47
66
  }
48
67
  generateCheckboxSVG() {
49
68
  if (this.type === 'favorite') {
50
- return h("q2-icon", { type: "star", class: "checkbox-icon" });
69
+ return h("q2-icon", { type: "star", class: "checkbox-icon", onClick: this.onControlClick });
51
70
  }
52
71
  if (this.type === 'toggle') {
53
72
  return this.generateToggleSVG();
54
73
  }
55
- return (h("svg", { "aria-hidden": "true", width: "20", height: "20", viewBox: "0 0 20 20", class: "checkbox-icon", focusable: "false" },
74
+ return (h("svg", { "aria-hidden": "true", width: "20", height: "20", viewBox: "0 0 20 20", class: "checkbox-icon", focusable: "false", onClick: this.onControlClick },
56
75
  h("rect", { x: "1", y: "1", width: "18", height: "18", rx: "3" }),
57
76
  (this.checked || this.indeterminate) && this.generateCheckBoxSVGFill()));
58
77
  }
@@ -63,7 +82,7 @@ export class Q2Checkbox {
63
82
  return h("polyline", { class: "checkbox-fill checked-fill", points: "5 11 8.5 14.5 15 6" });
64
83
  }
65
84
  generateToggleSVG() {
66
- return (h("div", { class: "toggle-svg" },
85
+ return (h("div", { class: "toggle-svg", onClick: this.onControlClick },
67
86
  h("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 46 14", class: "toggle-track" },
68
87
  h("rect", { width: "36", height: "14", rx: "7", x: "5" })),
69
88
  h("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 30 30", class: "toggle-indicator" },
@@ -201,6 +220,23 @@ export class Q2Checkbox {
201
220
  "attribute": "disabled",
202
221
  "reflect": true
203
222
  },
223
+ "readonly": {
224
+ "type": "boolean",
225
+ "mutable": false,
226
+ "complexType": {
227
+ "original": "boolean",
228
+ "resolved": "boolean",
229
+ "references": {}
230
+ },
231
+ "required": false,
232
+ "optional": false,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": ""
236
+ },
237
+ "attribute": "readonly",
238
+ "reflect": true
239
+ },
204
240
  "value": {
205
241
  "type": "string",
206
242
  "mutable": false,
@@ -72,7 +72,6 @@ button {
72
72
  label {
73
73
  display: flex;
74
74
  align-items: center;
75
- cursor: pointer;
76
75
  --comp-checkbox-outer-stroke-color: var(
77
76
  --tct-checkbox-outer-stroke-color,
78
77
  var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))
@@ -106,6 +105,10 @@ input:disabled + label {
106
105
  flex-shrink: 0;
107
106
  }
108
107
 
108
+ .checkbox-icon, .label-text {
109
+ cursor: pointer;
110
+ }
111
+
109
112
  input:focus + label .checkbox-icon {
110
113
  box-shadow: var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff));
111
114
  }
@@ -135,8 +138,8 @@ input:focus + label .checkbox-icon {
135
138
 
136
139
  .q2-checkbox-label-content {
137
140
  font-weight: var(--tct-checkbox-font-weight, 400);
138
- flex: 1 1 auto;
139
141
  width: calc( 100% - var(--tct-checkbox-size, 20px) - var(--tct-scale-2, var(--app-scale-2, 10px)) );
142
+ cursor: inherit;
140
143
  }
141
144
 
142
145
  input:checked + label .q2-checkbox-label-content {
@@ -193,6 +196,7 @@ input:checked + label .q2-checkbox-label-content {
193
196
 
194
197
  :host([alignment=right]) .checkbox-icon,
195
198
  .toggle-svg {
199
+ cursor: pointer;
196
200
  margin-right: 0;
197
201
  margin-left: var(--tct-scale-2, var(--app-scale-2, 10px));
198
202
  }
@@ -3,6 +3,7 @@ import { createGuid, loc } from 'src/utils';
3
3
  export class Q2CheckboxGroup {
4
4
  constructor() {
5
5
  this.disabled = false;
6
+ this.readonly = false;
6
7
  this.optional = false;
7
8
  this.hasError = false;
8
9
  this.id = `checkbox-group-${createGuid()}`;
@@ -39,6 +40,8 @@ export class Q2CheckboxGroup {
39
40
  }
40
41
  }
41
42
  valueUpdated() {
43
+ if (this.readonly)
44
+ return;
42
45
  this.checkboxElements.forEach(check => {
43
46
  if (this.protectedValue.hasOwnProperty(check.value)) {
44
47
  check.checked = this.value[check.value];
@@ -130,6 +133,24 @@ export class Q2CheckboxGroup {
130
133
  "reflect": true,
131
134
  "defaultValue": "false"
132
135
  },
136
+ "readonly": {
137
+ "type": "boolean",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "boolean",
141
+ "resolved": "boolean",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "readonly",
151
+ "reflect": true,
152
+ "defaultValue": "false"
153
+ },
133
154
  "optional": {
134
155
  "type": "boolean",
135
156
  "mutable": false,
@@ -6,6 +6,7 @@ export class Q2EditableField {
6
6
  this.editing = false;
7
7
  this.label = '';
8
8
  this.scheduledAfterRender = [];
9
+ this.defaultValue = this.value;
9
10
  //////// ACTIONS /////////
10
11
  this.inputInput = (e) => {
11
12
  e.stopPropagation();
@@ -34,12 +35,19 @@ export class Q2EditableField {
34
35
  this.saveClick = (event) => {
35
36
  event && event.stopPropagation();
36
37
  const valueFromInputProp = this.hostElement.shadowRoot.querySelector('q2-input').value;
38
+ this.defaultValue = valueFromInputProp;
37
39
  this.change.emit({
38
40
  editing: false,
39
41
  name: 'save',
40
42
  value: this.innerValue || valueFromInputProp,
41
43
  formattedValue: this.formattedValue || valueFromInputProp
42
44
  });
45
+ setTimeout(() => {
46
+ const { errors = [] } = this;
47
+ if (!errors.length)
48
+ return;
49
+ this.hostElement.focus();
50
+ }, 1);
43
51
  };
44
52
  this.editClick = (event) => {
45
53
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -48,6 +56,7 @@ export class Q2EditableField {
48
56
  this.cancelClick = (event) => {
49
57
  event === null || event === void 0 ? void 0 : event.stopPropagation();
50
58
  this.change.emit({ editing: false, name: 'cancel' });
59
+ this.hostElement.shadowRoot.querySelector('q2-input').value = this.defaultValue;
51
60
  };
52
61
  }
53
62
  get locLabel() {
@@ -65,28 +74,23 @@ export class Q2EditableField {
65
74
  overrideFocus(this.hostElement);
66
75
  }
67
76
  //////// OBSERVERS //////////
77
+ errorsObserver() {
78
+ var _a;
79
+ const { editing, errors = [] } = this;
80
+ const focusedElement = this.hostElement.shadowRoot.activeElement;
81
+ const isInputFocused = (_a = (focusedElement === null || focusedElement === void 0 ? void 0 : focusedElement.tagName) === 'Q2-INPUT') !== null && _a !== void 0 ? _a : false;
82
+ const hasErrors = errors.length;
83
+ if (isInputFocused || !focusedElement || !editing || !hasErrors)
84
+ return;
85
+ this.q2InputElement.focus();
86
+ }
68
87
  ariaLabelObserver() {
69
88
  handleAriaLabel(this);
70
89
  }
71
90
  observesEditing(newValue, oldValue) {
72
- if (newValue === oldValue) {
91
+ if (newValue === oldValue)
73
92
  return;
74
- }
75
- //When editing state changes focus on input or edit button after render
76
- if (newValue) {
77
- this.scheduledAfterRender.push(() => {
78
- this.hostElement.shadowRoot
79
- .querySelector('q2-input')
80
- .dispatchEvent(new FocusEvent('focus'));
81
- });
82
- }
83
- else {
84
- this.scheduledAfterRender.push(() => {
85
- this.hostElement.shadowRoot
86
- .querySelector('.begin-edit')
87
- .dispatchEvent(new FocusEvent('focus'));
88
- });
89
- }
93
+ this.scheduledAfterRender.push(this.hostElement.focus);
90
94
  }
91
95
  get wrapperClass() {
92
96
  return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;
@@ -190,7 +194,7 @@ export class Q2EditableField {
190
194
  },
191
195
  "label": {
192
196
  "type": "string",
193
- "mutable": false,
197
+ "mutable": true,
194
198
  "complexType": {
195
199
  "original": "string",
196
200
  "resolved": "string",
@@ -208,7 +212,7 @@ export class Q2EditableField {
208
212
  },
209
213
  "hideLabel": {
210
214
  "type": "boolean",
211
- "mutable": false,
215
+ "mutable": true,
212
216
  "complexType": {
213
217
  "original": "boolean",
214
218
  "resolved": "boolean",
@@ -225,7 +229,7 @@ export class Q2EditableField {
225
229
  },
226
230
  "ariaLabel": {
227
231
  "type": "string",
228
- "mutable": false,
232
+ "mutable": true,
229
233
  "complexType": {
230
234
  "original": "string",
231
235
  "resolved": "string",
@@ -389,6 +393,9 @@ export class Q2EditableField {
389
393
  }]; }
390
394
  static get elementRef() { return "hostElement"; }
391
395
  static get watchers() { return [{
396
+ "propName": "errors",
397
+ "methodName": "errorsObserver"
398
+ }, {
392
399
  "propName": "ariaLabel",
393
400
  "methodName": "ariaLabelObserver"
394
401
  }, {
@@ -163,6 +163,16 @@ const icons = {
163
163
  markup: () => (h("g", null,
164
164
  h("path", { d: "M13 2C6.986 2 2.11 6.559 2.11 12.182c0 3.2 1.579 6.054 4.046 7.92V24l3.716-2.062c.991.278 2.04.427 3.128.427 6.014 0 10.89-4.559 10.89-10.183C23.89 6.56 19.013 2 13 2zm1.147 13.655l-2.816-2.926-5.424 2.999 5.946-6.31 2.816 2.926 5.424-3-5.946 6.31z", class: "filled" })))
165
165
  },
166
+ 'brand-payrecs-color': {
167
+ markup: () => (h("g", { "fill-rule": "evenodd" },
168
+ h("path", { fill: "#194879", d: "M9.27-347v-6.29h3.17c1.99 0 3.27.01 3.43.02.97.06 1.8.25 2.55.59 1.21.55 2.08 1.53 2.43 2.74.27.96.25 2.09-.06 2.99-.03.1-.12.3-.19.43-.38.78-1 1.42-1.81 1.86-.07.04-.12.07-.12.08 0 0 .59.88 1.31 1.93.72 1.06 1.31 1.93 1.31 1.94s-1.02.01-2.25.01h-2.25l-1.07-1.58-1.07-1.58H13.5v3.16H9.27v-6.3zm6.01-.08c.36-.03.64-.1.86-.23.06-.03.17-.12.25-.21.13-.13.16-.17.23-.31.09-.19.12-.3.15-.53.04-.38-.04-.77-.22-1.05-.17-.26-.39-.42-.72-.52-.29-.09-.32-.09-1.36-.1l-.96-.01v2.96h.79c.43.02.87.01.98 0z", transform: "translate(4 360)" }),
169
+ h("path", { fill: "#508dca", d: "M-3.3-383v-6.29h3.14c1.86 0 3.25.01 3.41.02 2.48.14 4.21 1.18 4.92 2.97.37.93.42 2.14.13 3.15-.27.92-.86 1.75-1.64 2.29-.67.47-1.49.79-2.44.94-.59.1-.96.12-2.25.12H.92v3.1H-3.3v-6.3zm6.26-.1c.48-.09.81-.28 1.02-.6.17-.25.23-.5.21-.91-.01-.3-.03-.44-.13-.63-.22-.47-.63-.71-1.31-.77-.1-.01-.55-.02-1.01-.02H.92v2.96l.95-.01c.8.01.96 0 1.09-.02z", transform: "translate(4 396)" })))
170
+ },
171
+ 'brand-payrecs-filled': {
172
+ markup: () => (h("g", { class: "filled" },
173
+ h("path", { d: "M9.27-347v-6.29h3.17c1.99 0 3.27.01 3.43.02.97.06 1.8.25 2.55.59 1.21.55 2.08 1.53 2.43 2.74.27.96.25 2.09-.06 2.99-.03.1-.12.3-.19.43-.38.78-1 1.42-1.81 1.86-.07.04-.12.07-.12.08 0 0 .59.88 1.31 1.93.72 1.06 1.31 1.93 1.31 1.94s-1.02.01-2.25.01h-2.25l-1.07-1.58-1.07-1.58H13.5v3.16H9.27v-6.3zm6.01-.08c.36-.03.64-.1.86-.23.06-.03.17-.12.25-.21.13-.13.16-.17.23-.31.09-.19.12-.3.15-.53.04-.38-.04-.77-.22-1.05-.17-.26-.39-.42-.72-.52-.29-.09-.32-.09-1.36-.1l-.96-.01v2.96h.79c.43.02.87.01.98 0z", transform: "translate(4 360)" }),
174
+ h("path", { d: "M-3.3-383v-6.29h3.14c1.86 0 3.25.01 3.41.02 2.48.14 4.21 1.18 4.92 2.97.37.93.42 2.14.13 3.15-.27.92-.86 1.75-1.64 2.29-.67.47-1.49.79-2.44.94-.59.1-.96.12-2.25.12H.92v3.1H-3.3v-6.3zm6.26-.1c.48-.09.81-.28 1.02-.6.17-.25.23-.5.21-.91-.01-.3-.03-.44-.13-.63-.22-.47-.63-.71-1.31-.77-.1-.01-.55-.02-1.01-.02H.92v2.96l.95-.01c.8.01.96 0 1.09-.02z", transform: "translate(4 396)" })))
175
+ },
166
176
  'brand-snapchat-color': {
167
177
  markup: () => (h("g", { fill: "none", "fill-rule": "evenodd" },
168
178
  h("g", null,
@@ -288,7 +288,7 @@ export class Q2Input {
288
288
  this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })),
289
289
  this.showIconSeperator && h("div", { class: "vertical-separator" }),
290
290
  this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))),
291
- this.pseudo ? (this.pseudoInputDOM()) : (h("input", { class: "input-field", id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : 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.autocomplete ? this.autocomplete : 'off', 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, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste })),
291
+ this.pseudo ? (this.pseudoInputDOM()) : (h("input", { class: "input-field", id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, "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.autocomplete ? this.autocomplete : 'off', 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, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste })),
292
292
  h("div", { class: "input-icons-container-right" },
293
293
  this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput },
294
294
  h("q2-icon", { type: "close", class: "icon-clear" }))),
@@ -299,10 +299,15 @@ export class Q2Input {
299
299
  }
300
300
  pseudoInputDOM() {
301
301
  const showPlaceholder = !this.value && !!this.placeholder;
302
- return (h("button", { class: "pseudo-input input-field", type: "button", id: this.inputId, "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.value}, ${(this.label && loc(this.label)) || ''}${(this
303
- .optional &&
304
- loc('tecton.element.input.optional')) ||
305
- ''}`, role: (this.role && `${this.role}`) || undefined, disabled: !!this.disabled, "test-id": "q2InputInnerClearButton" },
302
+ let ariaLabelSuffix = '';
303
+ if (this.optional) {
304
+ ariaLabelSuffix = loc('tecton.element.input.optional');
305
+ }
306
+ if (this.readonly) {
307
+ ariaLabelSuffix = loc('tecton.element.input.readonly');
308
+ }
309
+ return (h("button", { class: "pseudo-input input-field", type: "button", id: this.inputId, "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.value}, ${(this.label && loc(this.label)) ||
310
+ ''}${ariaLabelSuffix}`, role: (this.role && `${this.role}`) || undefined, disabled: !!this.disabled, "test-id": "q2InputInnerClearButton" },
306
311
  h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value)));
307
312
  }
308
313
  calculateCursorPositionOnInput() {
@@ -610,6 +615,40 @@ export class Q2Input {
610
615
  "attribute": "optional",
611
616
  "reflect": true
612
617
  },
618
+ "min": {
619
+ "type": "number",
620
+ "mutable": false,
621
+ "complexType": {
622
+ "original": "number",
623
+ "resolved": "number",
624
+ "references": {}
625
+ },
626
+ "required": false,
627
+ "optional": false,
628
+ "docs": {
629
+ "tags": [],
630
+ "text": ""
631
+ },
632
+ "attribute": "min",
633
+ "reflect": true
634
+ },
635
+ "max": {
636
+ "type": "number",
637
+ "mutable": false,
638
+ "complexType": {
639
+ "original": "number",
640
+ "resolved": "number",
641
+ "references": {}
642
+ },
643
+ "required": false,
644
+ "optional": false,
645
+ "docs": {
646
+ "tags": [],
647
+ "text": ""
648
+ },
649
+ "attribute": "max",
650
+ "reflect": true
651
+ },
613
652
  "formatModifier": {
614
653
  "type": "string",
615
654
  "mutable": false,
@@ -815,6 +854,23 @@ export class Q2Input {
815
854
  "attribute": "aria-activedescendant",
816
855
  "reflect": false
817
856
  },
857
+ "current": {
858
+ "type": "string",
859
+ "mutable": false,
860
+ "complexType": {
861
+ "original": "'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'",
862
+ "resolved": "\"date\" | \"false\" | \"location\" | \"page\" | \"step\" | \"time\" | \"true\"",
863
+ "references": {}
864
+ },
865
+ "required": false,
866
+ "optional": false,
867
+ "docs": {
868
+ "tags": [],
869
+ "text": ""
870
+ },
871
+ "attribute": "current",
872
+ "reflect": false
873
+ },
818
874
  "errors": {
819
875
  "type": "unknown",
820
876
  "mutable": false,