q2-tecton-elements 1.11.0-alpha.0 → 1.11.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 (130) 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 +2 -2
  6. package/dist/cjs/q2-calendar.cjs.entry.js +6 -4
  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 +15 -5
  12. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
  14. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  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 +34 -8
  22. package/dist/cjs/q2-radio.cjs.entry.js +7 -2
  23. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-select.cjs.entry.js +14 -6
  25. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  27. package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  29. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  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-calendar/styles.css +1 -1
  33. package/dist/collection/components/q2-card/index.js +290 -0
  34. package/dist/collection/components/q2-card/styles.css +161 -0
  35. package/dist/collection/components/q2-checkbox/index.js +30 -3
  36. package/dist/collection/components/q2-checkbox/styles.css +1 -1
  37. package/dist/collection/components/q2-checkbox-group/index.js +21 -0
  38. package/dist/collection/components/q2-dropdown/styles.css +3 -3
  39. package/dist/collection/components/q2-icon/icons.js +10 -0
  40. package/dist/collection/components/q2-input/index.js +61 -5
  41. package/dist/collection/components/q2-input/styles.css +16 -31
  42. package/dist/collection/components/q2-loading/styles.css +1 -1
  43. package/dist/collection/components/q2-pagination/index.js +277 -0
  44. package/dist/collection/components/q2-pagination/styles.css +120 -0
  45. package/dist/collection/components/q2-radio/index.js +24 -1
  46. package/dist/collection/components/q2-radio-group/index.js +58 -15
  47. package/dist/collection/components/q2-select/index.js +30 -4
  48. package/dist/collection/components/q2-select/styles.css +4 -4
  49. package/dist/collection/components/q2-stepper/styles.css +7 -7
  50. package/dist/collection/utils/index.js +11 -1
  51. package/dist/esm/{icons-3ee662ea.js → icons-6a143c2f.js} +10 -0
  52. package/dist/esm/{index-ec6660af.js → index-0e13a57f.js} +12 -2
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/q2-avatar.entry.js +1 -1
  55. package/dist/esm/q2-btn_2.entry.js +2 -2
  56. package/dist/esm/q2-calendar.entry.js +6 -4
  57. package/dist/esm/q2-card.entry.js +85 -0
  58. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  59. package/dist/esm/q2-carousel.entry.js +1 -1
  60. package/dist/esm/q2-checkbox-group.entry.js +4 -1
  61. package/dist/esm/q2-checkbox.entry.js +15 -5
  62. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  63. package/dist/esm/q2-dropdown.entry.js +2 -2
  64. package/dist/esm/q2-editable-field.entry.js +1 -1
  65. package/dist/esm/q2-icon.entry.js +2 -2
  66. package/dist/esm/q2-input.entry.js +12 -7
  67. package/dist/esm/q2-loc.entry.js +1 -1
  68. package/dist/esm/q2-message.entry.js +1 -1
  69. package/dist/esm/q2-optgroup.entry.js +1 -1
  70. package/dist/esm/q2-pagination.entry.js +114 -0
  71. package/dist/esm/q2-radio-group.entry.js +35 -9
  72. package/dist/esm/q2-radio.entry.js +7 -2
  73. package/dist/esm/q2-section.entry.js +1 -1
  74. package/dist/esm/q2-select.entry.js +14 -6
  75. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  76. package/dist/esm/q2-stepper.entry.js +2 -2
  77. package/dist/esm/q2-tab-container.entry.js +1 -1
  78. package/dist/esm/q2-tecton-elements.js +1 -1
  79. package/dist/esm/q2-textarea.entry.js +1 -1
  80. package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-2372f988.entry.js} +1 -1
  81. package/dist/q2-tecton-elements/p-27ec0a16.entry.js +1 -0
  82. package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-2be33492.entry.js} +1 -1
  83. package/dist/q2-tecton-elements/p-346b65d5.entry.js +1 -0
  84. package/dist/q2-tecton-elements/p-3c6f73cb.js +1 -0
  85. package/dist/q2-tecton-elements/p-3cb34e2e.entry.js +1 -0
  86. package/dist/q2-tecton-elements/{p-843b1ee9.entry.js → p-492dfb55.entry.js} +1 -1
  87. package/dist/q2-tecton-elements/p-564154f3.entry.js +1 -0
  88. package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-6a83a97c.entry.js} +1 -1
  89. package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-701b381a.entry.js} +1 -1
  90. package/dist/q2-tecton-elements/p-7dec37d6.entry.js +1 -0
  91. package/dist/q2-tecton-elements/p-841ec108.entry.js +1 -0
  92. package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-88bc2f49.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/{p-50967020.entry.js → p-9ccbc3d8.entry.js} +1 -1
  94. package/dist/q2-tecton-elements/{p-06fff43d.entry.js → p-a72e7a12.entry.js} +1 -1
  95. package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-af202624.entry.js} +1 -1
  96. package/dist/q2-tecton-elements/{p-b281c349.entry.js → p-b5b12e46.entry.js} +1 -1
  97. package/dist/q2-tecton-elements/{p-c5e55b9f.entry.js → p-bfd77f9b.entry.js} +1 -1
  98. package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-c83dba0a.entry.js} +1 -1
  99. package/dist/q2-tecton-elements/p-ca847db7.entry.js +1 -0
  100. package/dist/q2-tecton-elements/p-d199fca8.entry.js +1 -0
  101. package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-dffbcec3.entry.js} +1 -1
  102. package/dist/q2-tecton-elements/{p-9a977ee6.entry.js → p-f73df612.entry.js} +1 -1
  103. package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-f85bf7fb.entry.js} +1 -1
  104. package/dist/q2-tecton-elements/p-f85da2a8.js +1 -0
  105. package/dist/q2-tecton-elements/p-fc318ae2.entry.js +1 -0
  106. package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-fe61c1aa.entry.js} +1 -1
  107. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  108. package/dist/test/helpers.js +7 -3
  109. package/dist/types/components/q2-calendar/index.d.ts +1 -0
  110. package/dist/types/components/q2-card/index.d.ts +31 -0
  111. package/dist/types/components/q2-checkbox/index.d.ts +2 -0
  112. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
  113. package/dist/types/components/q2-input/index.d.ts +3 -0
  114. package/dist/types/components/q2-pagination/index.d.ts +30 -0
  115. package/dist/types/components/q2-radio/index.d.ts +2 -1
  116. package/dist/types/components/q2-radio-group/index.d.ts +3 -0
  117. package/dist/types/components/q2-select/index.d.ts +1 -0
  118. package/dist/types/components.d.ts +80 -0
  119. package/dist/types/utils/index.d.ts +1 -0
  120. package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +3 -1
  121. package/package.json +2 -2
  122. package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
  123. package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
  124. package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
  125. package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
  126. package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
  127. package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
  128. package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
  129. package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
  130. package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
@@ -7,7 +7,7 @@ export class Q2Checkbox {
7
7
  ///// Actions ////////
8
8
  this.onInputChange = (event) => {
9
9
  event.stopPropagation();
10
- if (this.disabled)
10
+ if (this.disabled || this.readonly)
11
11
  return;
12
12
  if (!(event.target instanceof HTMLInputElement))
13
13
  return;
@@ -19,8 +19,15 @@ export class Q2Checkbox {
19
19
  };
20
20
  this.onControlClick = (event) => {
21
21
  event.stopPropagation();
22
+ if (this.readonly)
23
+ return;
22
24
  this.inputElement.click();
23
25
  };
26
+ this.onKeyDown = (event) => {
27
+ if (this.readonly && event.code === 'Space') {
28
+ event.preventDefault();
29
+ }
30
+ };
24
31
  }
25
32
  ////////// LIFECYCLE HOOKS ////////
26
33
  componentWillLoad() {
@@ -31,7 +38,10 @@ export class Q2Checkbox {
31
38
  }
32
39
  //////// Host Element Events ////////
33
40
  defaultChangeHandler(event) {
34
- 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) {
35
45
  this.checked = event.detail.checked;
36
46
  }
37
47
  }
@@ -47,7 +57,7 @@ export class Q2Checkbox {
47
57
  /////// View Methods ///////
48
58
  render() {
49
59
  return (h("div", { class: "checkbox-container" },
50
- 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", onChange: this.onInputChange }),
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 }),
51
61
  h("label", { "test-id": "checkboxButton" },
52
62
  this.generateCheckboxSVG(),
53
63
  !this.hideLabel && (h("div", { class: "q2-checkbox-label-content" },
@@ -210,6 +220,23 @@ export class Q2Checkbox {
210
220
  "attribute": "disabled",
211
221
  "reflect": true
212
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
+ },
213
240
  "value": {
214
241
  "type": "string",
215
242
  "mutable": false,
@@ -138,7 +138,7 @@ input:focus + label .checkbox-icon {
138
138
 
139
139
  .q2-checkbox-label-content {
140
140
  font-weight: var(--tct-checkbox-font-weight, 400);
141
- width: calc(100% - var(--tct-checkbox-size, 20px) - var(--tct-scale-2, var(--app-scale-2, 10px)));
141
+ width: calc( 100% - var(--tct-checkbox-size, 20px) - var(--tct-scale-2, var(--app-scale-2, 10px)) );
142
142
  cursor: inherit;
143
143
  }
144
144
 
@@ -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,
@@ -146,14 +146,14 @@ button {
146
146
 
147
147
  q2-btn[color=primary] ~ .q2-element-dropdown.dropup,
148
148
  q2-btn[intent=workflow-primary] ~ .q2-element-dropdown.dropup {
149
- bottom: calc(var(--tct-btn-icon-height, var(--t-btn-icon-height, 44px)) + var(--tct-btn-primary-border-width, var(--t-btn-primary-border-width, 0)));
149
+ bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-primary-border-width), 0) );
150
150
  }
151
151
 
152
152
  q2-btn[color=secondary] ~ .q2-element-dropdown.dropup,
153
153
  q2-btn[intent=workflow-secondary] ~ .q2-element-dropdown.dropup {
154
- bottom: calc(var(--tct-btn-icon-height, var(--t-btn-icon-height, 44px)) + var(--tct-btn-secondary-border-width, var(--t-btn-secondary-border-width, 0)));
154
+ bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-secondary-border-width), 0) );
155
155
  }
156
156
 
157
157
  q2-btn[intent=neutral] ~ .q2-element-dropdown.dropup {
158
- bottom: calc(var(--tct-btn-icon-height, var(--t-btn-icon-height, 44px)) + var(--tct-btn-neutral-border-width, var(--t-btn-neutral-border-width, 0)));
158
+ bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-neutral-border-width), 0) );
159
159
  }
@@ -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,
@@ -128,7 +128,7 @@ label {
128
128
  3 * var(--tct-input-prefix-font-size, 14px) + var(--tct-scale-1, 5px)
129
129
  );
130
130
  --comp-input-icon-clearance: 34px;
131
- --comp-input-min-height: 44px;
131
+ --comp-input-min-height: var(--tct-input-min-height, 44px);
132
132
  border-width: var(--comp-input-border-width);
133
133
  border-style: solid;
134
134
  border-color: var(--tct-input-border-color, var(--t-input-border-color, var(--tct-gray-11, var(--t-gray-11, #cccccc))));
@@ -153,6 +153,8 @@ label {
153
153
  padding: 0 var(--tct-input-horizontal-padding, var(--t-input-horizontal-padding, var(--tct-scale-2, var(--app-scale-2, 10px))));
154
154
  background-color: transparent;
155
155
  color: var(--tct-input-font-color, var(--t-input-font-color, var(--t-text, inherit)));
156
+ display: inline-block;
157
+ text-align: var(--tct-input-align, "start");
156
158
  /* To remove up/down arrow in number field for webkit based browser */
157
159
  /* For Firefox */
158
160
  }
@@ -167,6 +169,12 @@ label {
167
169
  .input-field[type=number] {
168
170
  -moz-appearance: textfield;
169
171
  }
172
+ .input-field::-ms-clear {
173
+ display: none;
174
+ }
175
+ .input-field[type=search]::-webkit-search-decoration, .input-field[type=search]::-webkit-search-cancel-button, .input-field[type=search]::-webkit-search-results-button, .input-field[type=search]::-webkit-search-results-decoration {
176
+ display: none;
177
+ }
170
178
  .input-field[disabled] {
171
179
  cursor: not-allowed;
172
180
  }
@@ -180,17 +188,7 @@ label {
180
188
  box-shadow: var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff)), var(--tct-input-focus-box-shadow, var(--t-input-focus-box-shadow, 0 0 transparent));
181
189
  }
182
190
 
183
- input {
184
- display: inline-block;
185
- }
186
- input::-ms-clear {
187
- display: none;
188
- }
189
- input[type=search]::-webkit-search-decoration, input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-results-button, input[type=search]::-webkit-search-results-decoration {
190
- display: none;
191
- }
192
-
193
- input::placeholder,
191
+ .input-field::placeholder,
194
192
  .placeholder-text {
195
193
  color: var(--tct-input-placeholder-font-color, var(--t-input-placeholder-font-color, var(--t-textA, var(--app-gray-d1, rgba(77, 77, 77, 0.77)))));
196
194
  }
@@ -249,13 +247,8 @@ q2-icon {
249
247
  display: inline-flex;
250
248
  align-items: center;
251
249
  justify-content: center;
252
- min-height: calc(
253
- var(--comp-input-min-height) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) -
254
- var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px))
255
- );
256
- height: calc(
257
- var(--tct-input-height, var(--t-input-height, 44px)) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) - var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px))
258
- );
250
+ min-height: calc( var(--comp-input-min-height) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) - var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px)) );
251
+ height: calc( var(--tct-input-height, var(--t-input-height, 44px)) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) - var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px)) );
259
252
  font-size: var(--tct-input-prefix-font-size, var(--t-input-prefix-font-size, inherit));
260
253
  color: var(--tct-input-prefix-font-color, var(--t-input-prefix-font-color, inherit));
261
254
  background-color: var(--tct-input-prefix-bg, var(--t-input-prefix-bg, var(--tct-input-bg, var(--t-input-bg, var(--tct-gray-14, var(--t-gray-14, #f2f2f2))))));
@@ -263,23 +256,15 @@ q2-icon {
263
256
  }
264
257
 
265
258
  .input-prefix {
266
- border-top-left-radius: calc(
267
- var(--comp-input-border-top-left-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px))
268
- );
269
- border-bottom-left-radius: calc(
270
- var(--comp-input-border-bottom-left-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px))
271
- );
259
+ border-top-left-radius: calc( var(--comp-input-border-top-left-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px)) );
260
+ border-bottom-left-radius: calc( var(--comp-input-border-bottom-left-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px)) );
272
261
  pointer-events: none;
273
262
  /* used to allow iOS voiceover to display keyboard in input TCT-1194 */
274
263
  }
275
264
 
276
265
  .input-suffix {
277
- border-top-right-radius: calc(
278
- var(--comp-input-border-top-right-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px))
279
- );
280
- border-bottom-right-radius: calc(
281
- var(--comp-input-border-bottom-right-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px))
282
- );
266
+ border-top-right-radius: calc( var(--comp-input-border-top-right-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px)) );
267
+ border-bottom-right-radius: calc( var(--comp-input-border-bottom-right-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px)) );
283
268
  }
284
269
 
285
270
  .icon-error {
@@ -125,7 +125,7 @@ button {
125
125
  width: 100%;
126
126
  height: 100%;
127
127
  border-radius: 100%;
128
- border: 0.0833333333em solid transparent;
128
+ border: calc(1em / 12) solid transparent;
129
129
  }
130
130
 
131
131
  .half-circle-spinner .circle.circle-1 {
@@ -0,0 +1,277 @@
1
+ import { Component, State, Prop, h, Listen, Element, Event } from '@stencil/core';
2
+ import { isEventFromElement, loc, nextPaint, overrideFocus } from 'src/utils';
3
+ export class Q2Pagination {
4
+ constructor() {
5
+ this.handlePageChange = (page) => {
6
+ const { totalPages, inputField } = this;
7
+ if (page < 1) {
8
+ page = 1;
9
+ }
10
+ else if (page > totalPages) {
11
+ page = totalPages;
12
+ }
13
+ if (inputField.value !== `${page}`)
14
+ inputField.value = `${page}`;
15
+ if (!this.hostElement.onchange) {
16
+ this.page = page;
17
+ }
18
+ this.change.emit({ value: page });
19
+ };
20
+ }
21
+ ////////// LIFECYCLE HOOKS ////////
22
+ componentDidLoad() {
23
+ if (this.recordsOnly || this.pagesOnly)
24
+ return;
25
+ this.containerWidth = this.containerElement.clientWidth;
26
+ this.resizeObserver = new ResizeObserver(() => this.checkSize());
27
+ this.resizeObserver.observe(this.hostElement);
28
+ overrideFocus(this.hostElement);
29
+ }
30
+ disconnectedCallback() {
31
+ var _a;
32
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
33
+ }
34
+ onHostElementFocus(event) {
35
+ var _a;
36
+ if (!isEventFromElement(event, this.hostElement))
37
+ return;
38
+ const { isFullViewHidden, containerElement, inputField } = this;
39
+ if (isFullViewHidden) {
40
+ (_a = containerElement.querySelector('q2-btn:not([disabled])')) === null || _a === void 0 ? void 0 : _a.focus();
41
+ }
42
+ else {
43
+ inputField.focus();
44
+ }
45
+ }
46
+ get isFullViewHidden() {
47
+ return this.isSmall || this.recordsOnly || this.pagesOnly;
48
+ }
49
+ get pageWithDefault() {
50
+ return this.page || 1;
51
+ }
52
+ get perPageWithDefault() {
53
+ return this.perPage || 10;
54
+ }
55
+ get totalWithDefault() {
56
+ return this.total || 0;
57
+ }
58
+ get recordTypeWithDefault() {
59
+ return this.recordType || loc('tecton.element.pagination.defaultRecordType');
60
+ }
61
+ get currentRange() {
62
+ const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;
63
+ const start = (page - 1) * perPage + 1;
64
+ const end = Math.min(page * perPage, total);
65
+ return `${start} - ${end}`;
66
+ }
67
+ get totalPages() {
68
+ const { pagesOnly, totalWithDefault: total, perPageWithDefault: perPage, pages } = this;
69
+ if (pagesOnly && pages && !isNaN(parseInt(`${pages}`)))
70
+ return pages;
71
+ return Math.ceil(total / perPage);
72
+ }
73
+ checkSize() {
74
+ const { hostElement, containerElement } = this;
75
+ const isOverflowing = this.containerWidth > hostElement.clientWidth;
76
+ this.isSmall = isOverflowing;
77
+ if (isOverflowing)
78
+ return;
79
+ nextPaint(() => {
80
+ const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;
81
+ if (containerWidthHasNotChanged)
82
+ return;
83
+ this.containerWidth = containerElement.clientWidth;
84
+ this.checkSize();
85
+ });
86
+ }
87
+ ////////// OBSERVERS //////////
88
+ render() {
89
+ const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange } = this;
90
+ const onFirstPage = page === 1;
91
+ const onLastPage = page === totalPages;
92
+ return (h("nav", { class: "container", ref: el => (this.containerElement = el), "aria-label": loc('tecton.element.pagination.title') },
93
+ h("div", { class: "description", "test-id": "description" }, pagesOnly
94
+ ? loc('tecton.element.pagination.pages', {
95
+ current: page,
96
+ total: totalPages
97
+ })
98
+ : loc('tecton.element.pagination.description', {
99
+ range: currentRange,
100
+ recordType: recordType.toLowerCase(),
101
+ total: total.toLocaleString()
102
+ })),
103
+ h("div", { class: "btn-group" },
104
+ h("q2-btn", { label: "tecton.element.pagination.goToFirstPage", disabled: onFirstPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(1), "test-id": "firstPageBtn", "hide-label": true },
105
+ h("q2-icon", { type: "chevron-double-left" })),
106
+ h("q2-btn", { label: loc('tecton.element.pagination.goToPage', [page - 1]), disabled: onFirstPage, onClick: () => this.handlePageChange(page - 1), "test-id": "prevPageBtn", "hide-label": true },
107
+ h("q2-icon", { type: "chevron-left" }))),
108
+ h("div", { class: "controls", hidden: isFullViewHidden, "test-id": "controls" },
109
+ h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.page')),
110
+ h("div", { class: "input-wrapper", onClick: () => this.inputField.dispatchEvent(new FocusEvent('focus')) },
111
+ h("q2-input", { type: "number", value: `${page}`, min: 1, max: this.totalPages, hideLabel: true, optional: true, label: `${loc('tecton.element.pagination.page')} (${loc('tecton.element.pagination.ofPages', [
112
+ totalPages.toLocaleString()
113
+ ])})`, onChange: event => this.handlePageChange(event.detail.value), "test-id": "pageInput", current: "page", ref: el => (this.inputField = el) })),
114
+ h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()]))),
115
+ h("div", { class: "btn-group" },
116
+ h("q2-btn", { label: loc('tecton.element.pagination.goToPage', [page + 1]), disabled: onLastPage, onClick: () => this.handlePageChange(page + 1), "test-id": "nextPageBtn", "hide-label": true },
117
+ h("q2-icon", { type: "chevron-right" })),
118
+ h("q2-btn", { label: "tecton.element.pagination.goToLastPage", disabled: onLastPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(totalPages), "test-id": "lastPageBtn", "hide-label": true },
119
+ h("q2-icon", { type: "chevron-double-right" })))));
120
+ }
121
+ static get is() { return "q2-pagination"; }
122
+ static get encapsulation() { return "shadow"; }
123
+ static get originalStyleUrls() { return {
124
+ "$": ["styles.scss"]
125
+ }; }
126
+ static get styleUrls() { return {
127
+ "$": ["styles.css"]
128
+ }; }
129
+ static get properties() { return {
130
+ "recordType": {
131
+ "type": "string",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "string",
135
+ "resolved": "string",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": false,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": ""
143
+ },
144
+ "attribute": "record-type",
145
+ "reflect": false
146
+ },
147
+ "perPage": {
148
+ "type": "number",
149
+ "mutable": false,
150
+ "complexType": {
151
+ "original": "number",
152
+ "resolved": "number",
153
+ "references": {}
154
+ },
155
+ "required": false,
156
+ "optional": false,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": ""
160
+ },
161
+ "attribute": "per-page",
162
+ "reflect": false
163
+ },
164
+ "total": {
165
+ "type": "number",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "number",
169
+ "resolved": "number",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": ""
177
+ },
178
+ "attribute": "total",
179
+ "reflect": true
180
+ },
181
+ "page": {
182
+ "type": "number",
183
+ "mutable": true,
184
+ "complexType": {
185
+ "original": "number",
186
+ "resolved": "number",
187
+ "references": {}
188
+ },
189
+ "required": false,
190
+ "optional": false,
191
+ "docs": {
192
+ "tags": [],
193
+ "text": ""
194
+ },
195
+ "attribute": "page",
196
+ "reflect": true
197
+ },
198
+ "pages": {
199
+ "type": "number",
200
+ "mutable": true,
201
+ "complexType": {
202
+ "original": "number",
203
+ "resolved": "number",
204
+ "references": {}
205
+ },
206
+ "required": false,
207
+ "optional": false,
208
+ "docs": {
209
+ "tags": [],
210
+ "text": ""
211
+ },
212
+ "attribute": "pages",
213
+ "reflect": true
214
+ },
215
+ "recordsOnly": {
216
+ "type": "boolean",
217
+ "mutable": true,
218
+ "complexType": {
219
+ "original": "boolean",
220
+ "resolved": "boolean",
221
+ "references": {}
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": ""
228
+ },
229
+ "attribute": "records-only",
230
+ "reflect": true
231
+ },
232
+ "pagesOnly": {
233
+ "type": "boolean",
234
+ "mutable": true,
235
+ "complexType": {
236
+ "original": "boolean",
237
+ "resolved": "boolean",
238
+ "references": {}
239
+ },
240
+ "required": false,
241
+ "optional": false,
242
+ "docs": {
243
+ "tags": [],
244
+ "text": ""
245
+ },
246
+ "attribute": "pages-only",
247
+ "reflect": true
248
+ }
249
+ }; }
250
+ static get states() { return {
251
+ "isSmall": {}
252
+ }; }
253
+ static get events() { return [{
254
+ "method": "change",
255
+ "name": "change",
256
+ "bubbles": true,
257
+ "cancelable": true,
258
+ "composed": true,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": ""
262
+ },
263
+ "complexType": {
264
+ "original": "any",
265
+ "resolved": "any",
266
+ "references": {}
267
+ }
268
+ }]; }
269
+ static get elementRef() { return "hostElement"; }
270
+ static get listeners() { return [{
271
+ "name": "focus",
272
+ "method": "onHostElementFocus",
273
+ "target": undefined,
274
+ "capture": false,
275
+ "passive": false
276
+ }]; }
277
+ }