@usecapsule/core-components 2.0.9 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/css/capsule-core.css +54 -19
  2. package/css/capsule-core.css.map +1 -1
  3. package/dist/capsule/capsule.esm.js +1 -1
  4. package/dist/capsule/capsule.esm.js.map +1 -1
  5. package/dist/capsule/index.esm.js +1 -1
  6. package/dist/capsule/index.esm.js.map +1 -1
  7. package/dist/capsule/{p-415384b7.entry.js → p-0d0a0037.entry.js} +2 -2
  8. package/dist/capsule/p-4d8e4d86.entry.js +29 -0
  9. package/dist/capsule/p-4d8e4d86.entry.js.map +1 -0
  10. package/dist/capsule/p-86e48e61.js +3 -0
  11. package/dist/capsule/p-86e48e61.js.map +1 -0
  12. package/dist/capsule/p-ad14a817.entry.js +2 -0
  13. package/dist/capsule/p-b6b38e73.js +2 -0
  14. package/dist/capsule/p-b6b38e73.js.map +1 -0
  15. package/dist/capsule/p-d28b96ba.entry.js +10 -0
  16. package/dist/capsule/{p-b76350fd.entry.js.map → p-d28b96ba.entry.js.map} +1 -1
  17. package/dist/capsule/{p-4d957466.entry.js → p-fa078837.entry.js} +2 -2
  18. package/dist/capsule/{p-fa4e3c14.entry.js → p-fcead80b.entry.js} +2 -2
  19. package/dist/cjs/capsule.cjs.js +2 -2
  20. package/dist/cjs/constants-0869a780.js +29 -0
  21. package/dist/cjs/constants-0869a780.js.map +1 -0
  22. package/dist/cjs/{cpsl-alert_18.cjs.entry.js → cpsl-alert_29.cjs.entry.js} +598 -185
  23. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +1 -0
  24. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  25. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  26. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  29. package/dist/cjs/{index-87ba56f9.js → index-5733071e.js} +6 -3
  30. package/dist/cjs/index-5733071e.js.map +1 -0
  31. package/dist/cjs/index.cjs.js +53 -24
  32. package/dist/cjs/index.cjs.js.map +1 -1
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/collection/assets/icons/check-circle.svg +3 -0
  35. package/dist/collection/assets/icons/home.svg +3 -0
  36. package/dist/collection/assets/icons/index.js +4 -1
  37. package/dist/collection/assets/icons/index.js.map +1 -1
  38. package/dist/collection/assets/icons/settings.svg +4 -0
  39. package/dist/collection/collection-manifest.json +11 -0
  40. package/dist/collection/components/cpsl-alert/cpsl-alert.css +21 -11
  41. package/dist/collection/components/cpsl-alert/cpsl-alert.js +34 -26
  42. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  43. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  44. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.css +67 -0
  45. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +69 -0
  46. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -0
  47. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +29 -0
  48. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +1 -0
  49. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +37 -0
  50. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +1 -0
  51. package/dist/collection/components/cpsl-avatar/cpsl-avatar.css +31 -0
  52. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +81 -0
  53. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js.map +1 -0
  54. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +29 -0
  55. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +1 -0
  56. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +37 -0
  57. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +1 -0
  58. package/dist/collection/components/cpsl-button/cpsl-button.css +175 -51
  59. package/dist/collection/components/cpsl-button/cpsl-button.js +46 -5
  60. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  61. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +88 -0
  62. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +78 -0
  63. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -0
  64. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +29 -0
  65. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +1 -0
  66. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +37 -0
  67. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +1 -0
  68. package/dist/collection/components/cpsl-card/cpsl-card.css +81 -0
  69. package/dist/collection/components/cpsl-card/cpsl-card.js +19 -0
  70. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -0
  71. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +29 -0
  72. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +1 -0
  73. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +37 -0
  74. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +1 -0
  75. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +110 -0
  76. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +64 -0
  77. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js.map +1 -0
  78. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +29 -0
  79. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +1 -0
  80. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +37 -0
  81. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +1 -0
  82. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
  83. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  84. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  85. package/dist/collection/components/cpsl-drawer/cpsl-drawer.css +90 -0
  86. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +149 -0
  87. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -0
  88. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +29 -0
  89. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +1 -0
  90. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +37 -0
  91. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +1 -0
  92. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  93. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  94. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  95. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  96. package/dist/collection/components/cpsl-input/cpsl-input.css +35 -19
  97. package/dist/collection/components/cpsl-input/cpsl-input.js +47 -6
  98. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  99. package/dist/collection/components/cpsl-modal/cpsl-modal.css +12 -2
  100. package/dist/collection/components/cpsl-modal/cpsl-modal.js +20 -2
  101. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  102. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.css +50 -0
  103. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +78 -0
  104. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -0
  105. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +29 -0
  106. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +1 -0
  107. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +37 -0
  108. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +1 -0
  109. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +61 -3
  110. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +35 -17
  111. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  112. package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +67 -0
  113. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +174 -0
  114. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -0
  115. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +29 -0
  116. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +1 -0
  117. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +37 -0
  118. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +1 -0
  119. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  120. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  121. package/dist/collection/components/cpsl-radio/cpsl-radio.css +97 -0
  122. package/dist/collection/components/cpsl-radio/cpsl-radio.js +66 -0
  123. package/dist/collection/components/cpsl-radio/cpsl-radio.js.map +1 -0
  124. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +29 -0
  125. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +1 -0
  126. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +37 -0
  127. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +1 -0
  128. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  129. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  130. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  131. package/dist/collection/components/cpsl-switch/cpsl-switch.css +115 -0
  132. package/dist/collection/components/cpsl-switch/cpsl-switch.js +64 -0
  133. package/dist/collection/components/cpsl-switch/cpsl-switch.js.map +1 -0
  134. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +29 -0
  135. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +1 -0
  136. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +37 -0
  137. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +1 -0
  138. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  139. package/dist/collection/components/cpsl-table/cpsl-table.css +179 -0
  140. package/dist/collection/components/cpsl-table/cpsl-table.js +88 -0
  141. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -0
  142. package/dist/collection/components/cpsl-table/table-interface.js +2 -0
  143. package/dist/collection/components/cpsl-table/table-interface.js.map +1 -0
  144. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +29 -0
  145. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +1 -0
  146. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +37 -0
  147. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +1 -0
  148. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  149. package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
  150. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  151. package/dist/collection/constants.js +14 -0
  152. package/dist/collection/constants.js.map +1 -1
  153. package/dist/collection/interface.js.map +1 -1
  154. package/dist/collection/utils/theme/generateBorderRadii.js +24 -7
  155. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  156. package/dist/collection/utils/theme/generatePalette.js +22 -18
  157. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  158. package/dist/collection/utils/theme/utils.js +8 -0
  159. package/dist/collection/utils/theme/utils.js.map +1 -1
  160. package/dist/esm/capsule.js +3 -3
  161. package/dist/esm/constants-6acf4ea8.js +23 -0
  162. package/dist/esm/constants-6acf4ea8.js.map +1 -0
  163. package/dist/esm/{cpsl-alert_18.entry.js → cpsl-alert_29.entry.js} +588 -186
  164. package/dist/esm/cpsl-alert_29.entry.js.map +1 -0
  165. package/dist/esm/cpsl-animation.entry.js +2 -2
  166. package/dist/esm/cpsl-col.entry.js +2 -2
  167. package/dist/esm/cpsl-grid.entry.js +3 -3
  168. package/dist/esm/cpsl-info-box.entry.js +2 -2
  169. package/dist/esm/cpsl-row.entry.js +2 -2
  170. package/dist/esm/{index-fd970ca2.js → index-8fe9f35e.js} +6 -3
  171. package/dist/esm/index-8fe9f35e.js.map +1 -0
  172. package/dist/esm/index.js +53 -24
  173. package/dist/esm/index.js.map +1 -1
  174. package/dist/esm/loader.js +3 -3
  175. package/dist/types/assets/icons/index.d.ts +3 -0
  176. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +2 -2
  177. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +5 -0
  178. package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +6 -0
  179. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -0
  180. package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +9 -0
  181. package/dist/types/components/cpsl-card/cpsl-card.d.ts +3 -0
  182. package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +7 -0
  183. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +9 -0
  184. package/dist/types/components/cpsl-input/cpsl-input.d.ts +4 -0
  185. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +1 -0
  186. package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +9 -0
  187. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -1
  188. package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +14 -0
  189. package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +7 -0
  190. package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +7 -0
  191. package/dist/types/components/cpsl-table/cpsl-table.d.ts +9 -0
  192. package/dist/types/components/cpsl-table/table-interface.d.ts +19 -0
  193. package/dist/types/components.d.ts +435 -6
  194. package/dist/types/constants.d.ts +14 -0
  195. package/dist/types/interface.d.ts +35 -0
  196. package/dist/types/utils/theme/utils.d.ts +1 -0
  197. package/package.json +3 -2
  198. package/dist/capsule/p-2ce99420.entry.js +0 -29
  199. package/dist/capsule/p-2ce99420.entry.js.map +0 -1
  200. package/dist/capsule/p-6b02ea8d.entry.js +0 -2
  201. package/dist/capsule/p-b2997f3c.js +0 -3
  202. package/dist/capsule/p-b2997f3c.js.map +0 -1
  203. package/dist/capsule/p-b76350fd.entry.js +0 -10
  204. package/dist/capsule/p-c2bf050b.js +0 -2
  205. package/dist/capsule/p-c2bf050b.js.map +0 -1
  206. package/dist/cjs/constants-4bb85cc5.js +0 -12
  207. package/dist/cjs/constants-4bb85cc5.js.map +0 -1
  208. package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +0 -1
  209. package/dist/cjs/index-87ba56f9.js.map +0 -1
  210. package/dist/esm/constants-7b49abd5.js +0 -9
  211. package/dist/esm/constants-7b49abd5.js.map +0 -1
  212. package/dist/esm/cpsl-alert_18.entry.js.map +0 -1
  213. package/dist/esm/index-fd970ca2.js.map +0 -1
  214. /package/dist/capsule/{p-415384b7.entry.js.map → p-0d0a0037.entry.js.map} +0 -0
  215. /package/dist/capsule/{p-6b02ea8d.entry.js.map → p-ad14a817.entry.js.map} +0 -0
  216. /package/dist/capsule/{p-4d957466.entry.js.map → p-fa078837.entry.js.map} +0 -0
  217. /package/dist/capsule/{p-fa4e3c14.entry.js.map → p-fcead80b.entry.js.map} +0 -0
  218. /package/dist/types/Users/{vinay → taylorbosch}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -62,6 +62,7 @@ export class CpslInput {
62
62
  this.placeholder = undefined;
63
63
  this.readonly = false;
64
64
  this.required = false;
65
+ this.showOptionalLabel = false;
65
66
  this.spellcheck = false;
66
67
  this.startIconSrc = undefined;
67
68
  this.startIcon = undefined;
@@ -78,6 +79,7 @@ export class CpslInput {
78
79
  }
79
80
  }
80
81
  componentDidLoad() {
82
+ this.initButtons();
81
83
  if (Boolean(this.value)) {
82
84
  this.enableSlots();
83
85
  }
@@ -88,14 +90,29 @@ export class CpslInput {
88
90
  disableSlots() {
89
91
  var _a, _b;
90
92
  if (!this.noAutoDisable) {
91
- (_a = this.el.querySelector('[slot="end"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'true');
92
- (_b = this.el.querySelector('[slot="start"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'true');
93
+ (_a = this.endEl) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'true');
94
+ (_b = this.startEl) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'true');
93
95
  }
94
96
  }
95
97
  enableSlots() {
96
98
  var _a, _b;
97
- (_a = this.el.querySelector('[slot="end"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'false');
98
- (_b = this.el.querySelector('[slot="start"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'false');
99
+ (_a = this.endEl) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'false');
100
+ (_b = this.startEl) === null || _b === void 0 ? void 0 : _b.setAttribute('disabled', 'false');
101
+ }
102
+ initButtons() {
103
+ var _a, _b;
104
+ if (((_a = this.endEl) === null || _a === void 0 ? void 0 : _a.tagName) === 'CPSL-BUTTON') {
105
+ this.endEl.setAttribute('full-width', 'true');
106
+ this.endEl.addEventListener('mousedown', e => {
107
+ e.preventDefault();
108
+ });
109
+ }
110
+ if (((_b = this.startEl) === null || _b === void 0 ? void 0 : _b.tagName) === 'CPSL-BUTTON') {
111
+ this.startEl.setAttribute('full-width', 'true');
112
+ this.startEl.addEventListener('mousedown', e => {
113
+ e.preventDefault();
114
+ });
115
+ }
99
116
  }
100
117
  emitInputChange(event) {
101
118
  const { value } = this;
@@ -111,9 +128,15 @@ export class CpslInput {
111
128
  get nativeInput() {
112
129
  return this.el.shadowRoot.getElementById(this.inputId);
113
130
  }
131
+ get startEl() {
132
+ return this.el.querySelector('[slot="start"]');
133
+ }
134
+ get endEl() {
135
+ return this.el.querySelector('[slot="end"]');
136
+ }
114
137
  render() {
115
138
  var _a;
116
- return (h(Host, { key: 'd056945f2cfe5bff44af5987d2a9591fb1a3cd4c', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (h("label", { class: "label", htmlFor: this.inputId }, this.label)), h("div", { key: '4599fe40c9ebbaf3c0e21c1cc365325163a1054d', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: '5404baae8ccc419431f88379e1266fd69ca41670', name: "start" }), h("input", { key: '9cab32fee2375ac5e65f41140674275b1c18c039', class: "native-input", id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: '75ab014ee4e8b87375b67dfda539b59833168b46', name: "end" })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("cpsl-icon", { icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
139
+ return (h(Host, { key: '323cd77e6a96a6259c294cf30c1acfc8b638295d', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (h("label", { class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '645781496038445cb011ba003a54ca5a63d80731', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: 'c32784e17782d18f44d5e1adda605ca47bf6937c', name: "start" }), h("input", { key: 'bbe3efcc48eb71aaf6d6f58e32fc466a19bb06ae', class: "native-input", id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: '646727d4e5be630242778f6df967810be7dea7a6', name: "end" })), (this.errorText || this.helperText) && (h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
117
140
  }
118
141
  static get is() { return "cpsl-input"; }
119
142
  static get encapsulation() { return "shadow"; }
@@ -500,6 +523,24 @@ export class CpslInput {
500
523
  "reflect": false,
501
524
  "defaultValue": "false"
502
525
  },
526
+ "showOptionalLabel": {
527
+ "type": "boolean",
528
+ "mutable": false,
529
+ "complexType": {
530
+ "original": "boolean",
531
+ "resolved": "boolean",
532
+ "references": {}
533
+ },
534
+ "required": false,
535
+ "optional": false,
536
+ "docs": {
537
+ "tags": [],
538
+ "text": "If `true`, the label will display an \"optional\" tag."
539
+ },
540
+ "attribute": "show-optional-label",
541
+ "reflect": false,
542
+ "defaultValue": "false"
543
+ },
503
544
  "spellcheck": {
504
545
  "type": "boolean",
505
546
  "mutable": false,
@@ -540,7 +581,7 @@ export class CpslInput {
540
581
  "mutable": false,
541
582
  "complexType": {
542
583
  "original": "IconType",
543
- "resolved": "\"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"figmaBrand\" | \"figma\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"youtubeBrand\" | \"youtube\"",
584
+ "resolved": "\"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"figmaBrand\" | \"figma\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"youtubeBrand\" | \"youtube\"",
544
585
  "references": {
545
586
  "IconType": {
546
587
  "location": "import",
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAGZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA6PrC,YAAO,GAAG,CAAC,EAAsB,EAAE,EAAE;YAC3C,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n componentDidLoad() {\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'true');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.el.querySelector('[slot=\"end\"]')?.setAttribute('disabled', 'false');\n this.el.querySelector('[slot=\"start\"]')?.setAttribute('disabled', 'false');\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.cpslInput.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent | Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n \n // Manually set the value\n input.value = pasteData;\n this.value = pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitValueChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get nativeInput() {\n return this.el.shadowRoot.getElementById(this.inputId);\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <cpsl-icon icon={Boolean(this.errorText) ? 'alertCircle' : 'infoCircle'} />\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
1
+ {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAGZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QAkRrC,YAAO,GAAG,CAAC,EAAsB,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YACD,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,EAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;gBAKrC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n componentDidLoad() {\n this.initButtons();\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.cpslInput.emit({ value: newValue, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent | Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n \n // Manually set the value\n input.value = pasteData;\n this.value = pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitValueChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get nativeInput() {\n return this.el.shadowRoot.getElementById(this.inputId);\n }\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -70,7 +70,13 @@
70
70
  --inner-container-padding-bottom: 24px;
71
71
  --inner-container-padding-start: 16px;
72
72
  --inner-container-margin-bottom: 16px;
73
- display: inline-block;
73
+ display: block;
74
+ z-index: 10005;
75
+ position: relative;
76
+ }
77
+
78
+ :host cpsl-overlay {
79
+ z-index: 10005;
74
80
  }
75
81
 
76
82
  @media (max-width: 480px) {
@@ -89,6 +95,10 @@
89
95
  }
90
96
  }
91
97
 
98
+ :host(.no-overlay) {
99
+ z-index: 0;
100
+ }
101
+
92
102
  .modal-header {
93
103
  position: sticky;
94
104
  top: 0;
@@ -97,7 +107,7 @@
97
107
  }
98
108
 
99
109
  .modal-wrapper {
100
- z-index: 9999999999998;
110
+ z-index: 10005;
101
111
  position: fixed;
102
112
  top: 0;
103
113
  left: 0;
@@ -16,6 +16,7 @@ export class CpslModal {
16
16
  this.footerTransitionDuration = 0.15;
17
17
  this.noOverlay = undefined;
18
18
  this.open = undefined;
19
+ this.zIndexOverride = undefined;
19
20
  }
20
21
  toggleHeight() {
21
22
  this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();
@@ -209,9 +210,9 @@ export class CpslModal {
209
210
  }
210
211
  render() {
211
212
  if (this.noOverlay) {
212
- return h(Host, null, this.Modal);
213
+ return (h(Host, { style: Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {}, class: "no-overlay" }, this.Modal));
213
214
  }
214
- return (h(Host, { class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
215
+ return (h(Host, { style: Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {}, class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { zIndexOverride: Boolean(this.zIndexOverride) ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
215
216
  }
216
217
  static get is() { return "cpsl-modal"; }
217
218
  static get encapsulation() { return "shadow"; }
@@ -331,6 +332,23 @@ export class CpslModal {
331
332
  },
332
333
  "attribute": "open",
333
334
  "reflect": false
335
+ },
336
+ "zIndexOverride": {
337
+ "type": "number",
338
+ "mutable": false,
339
+ "complexType": {
340
+ "original": "number",
341
+ "resolved": "number",
342
+ "references": {}
343
+ },
344
+ "required": false,
345
+ "optional": true,
346
+ "docs": {
347
+ "tags": [],
348
+ "text": "Override z-index."
349
+ },
350
+ "attribute": "z-index-override",
351
+ "reflect": false
334
352
  }
335
353
  };
336
354
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-modal.js","sourceRoot":"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;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport gsap from 'gsap';\nimport Draggable from 'gsap/Draggable';\nimport { MOBILE_SIZE } from '../../constants';\n\ngsap.registerPlugin(Draggable);\nconst mm = gsap.matchMedia();\n@Component({\n tag: 'cpsl-modal',\n styleUrl: 'cpsl-modal.scss',\n shadow: true,\n})\nexport class CpslModal {\n private draggable: Draggable;\n private expandFooterTl: gsap.core.Timeline;\n private hasAnimatedIn: boolean;\n\n @Element() el!: HTMLCpslModalElement;\n\n @State() hasFooter: boolean;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.\n */\n @Prop() footerExpanded?: boolean;\n\n /**\n * Duration in seconds of the footer expansion animation.\n * Default is 0.15.\n */\n @Prop() footerTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.\n */\n @Prop() noOverlay?: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalRequestClose!: EventEmitter<null>;\n\n @Watch('footerExpanded')\n toggleHeight() {\n this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();\n }\n\n @Watch('open')\n toggleModal() {\n if (this.hasAnimatedIn) {\n this.handleAnimation();\n }\n }\n\n componentDidLoad() {\n this.handleAnimation();\n this.hasAnimatedIn = true;\n\n mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {\n this.draggable?.disable();\n gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });\n });\n mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {\n this.initDraggable();\n gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });\n });\n\n this.footerSlotEl.addEventListener('slotchange', () => {\n if (this.footerSlotEl.assignedNodes().length >= 1) {\n this.hasFooter = true;\n } else {\n this.hasFooter = false;\n }\n });\n }\n\n private handleAnimation() {\n if (this.open) {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })\n .to(this.modalWrapperEl, {\n scale: 1,\n opacity: 1,\n duration: this.enterTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })\n .to(this.modalWrapperEl, {\n yPercent: -100,\n duration: this.enterTransitionDuration,\n });\n }\n } else {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n scale: 0.8,\n opacity: 0,\n duration: this.exitTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n yPercent: 0,\n duration: this.exitTransitionDuration,\n })\n .set(this.modalContainerEl, { y: 0 });\n }\n }\n }\n\n private addExpandAnim() {\n setTimeout(() => {\n this.expandFooterTl = gsap\n .timeline({\n reversed: true,\n paused: true,\n onReverseComplete: () => {\n this.contentEl.style.setProperty('height', 'auto');\n },\n defaults: {\n duration: this.footerTransitionDuration,\n },\n })\n .set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })\n .set(this.headerExpandedEl, { display: 'block' })\n .to(this.innerContainerEl, { paddingBottom: '8px' })\n .to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')\n .to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');\n }, 10);\n }\n\n private getDraggableHeight = () => {\n return this.innerContainerEl.clientHeight;\n };\n\n private initDraggable() {\n this.draggable = Draggable.create(this.modalContainerEl, {\n trigger: this.headerEl,\n dragClickables: false,\n type: 'y',\n edgeResistance: 0.2,\n liveSnap: {\n y: function (y) {\n if (y < 0) return 0; // Restricts dragging to down\n return y;\n },\n },\n onDrag: () => {\n const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);\n gsap.set(this.overlayEl, { opacity: y });\n },\n onDragEnd: () => {\n if (this.draggable.y > 60) {\n this.cpslModalRequestClose.emit();\n } else {\n gsap.set(this.overlayEl, { opacity: 1 });\n gsap.set(this.modalWrapperEl, { yPercent: -100 });\n gsap.set(this.modalContainerEl, { y: 0 });\n }\n },\n })[0];\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get footerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-footer-expanded');\n }\n\n private get headerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-header-expanded');\n }\n\n private get innerContainerEl() {\n return this.el.shadowRoot.getElementById('modal-inner-container');\n }\n\n private get contentEl() {\n return this.el.shadowRoot.getElementById('modal-content');\n }\n\n private get modalWrapperEl() {\n return this.el.shadowRoot.getElementById('modal-wrapper');\n }\n\n private get modalContainerEl() {\n return this.el.shadowRoot.getElementById('modal-container');\n }\n\n private get overlayEl() {\n return this.el.shadowRoot.getElementById('overlay');\n }\n\n private get footerSlotEl() {\n return this.footerEl.querySelectorAll('slot')[0];\n }\n\n private get headerEl() {\n return this.el.shadowRoot.getElementById('modal-header');\n }\n\n private get Modal() {\n return (\n <div class={{ 'modal-container': true, 'no-footer': !this.hasFooter }} part=\"modal-container\" id=\"modal-container\">\n <slot></slot>\n <div id=\"modal-inner-container\" class={{ 'modal-inner-container': true, 'no-footer': !this.hasFooter }} part=\"modal-inner-container\">\n <div id=\"modal-content\" part=\"modal-content\">\n <div id=\"modal-header\" class=\"modal-header\" part=\"modal-header\">\n <slot name=\"header\"></slot>\n </div>\n <div id=\"modal-body\" class=\"modal-body\" part=\"modal-body\">\n <slot name=\"body\"></slot>\n </div>\n </div>\n <div id=\"modal-header-expanded\" class={{ 'modal-header': true, 'expanded': true, 'no-opacity': true }} part=\"modal-header-expanded\">\n <slot name=\"footerExpandedHeader\"></slot>\n </div>\n </div>\n <div id=\"modal-footer\" part=\"modal-footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div id=\"modal-footer-expanded\" class={{ 'expanded': true, 'no-opacity': true }} part=\"modal-footer-expanded\">\n <slot name=\"footerExpandedFooter\"></slot>\n </div>\n </div>\n );\n }\n\n render() {\n if (this.noOverlay) {\n return <Host>{this.Modal}</Host>;\n }\n\n return (\n <Host class={{ 'include-mobile-styling': true }}>\n <cpsl-overlay id=\"overlay\" open={this.open} enterTransitionDuration={this.enterTransitionDuration} exitTransitionDuration={this.exitTransitionDuration} />\n <div id=\"modal-wrapper\" class=\"modal-wrapper\">\n {this.Modal}\n </div>\n </Host>\n );\n }\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AAC,SAAS,EAC9E,EAAE,EAAC,SAAS,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD;YACF,WAAK,EAAE,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe,IAC1C,IAAI,CAAC,KAAK,CACP,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport gsap from 'gsap';\nimport Draggable from 'gsap/Draggable';\nimport { MOBILE_SIZE } from '../../constants';\n\ngsap.registerPlugin(Draggable);\nconst mm = gsap.matchMedia();\n@Component({\n tag: 'cpsl-modal',\n styleUrl: 'cpsl-modal.scss',\n shadow: true,\n})\nexport class CpslModal {\n private draggable: Draggable;\n private expandFooterTl: gsap.core.Timeline;\n private hasAnimatedIn: boolean;\n\n @Element() el!: HTMLCpslModalElement;\n\n @State() hasFooter: boolean;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.\n */\n @Prop() footerExpanded?: boolean;\n\n /**\n * Duration in seconds of the footer expansion animation.\n * Default is 0.15.\n */\n @Prop() footerTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.\n */\n @Prop() noOverlay?: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalRequestClose!: EventEmitter<null>;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n @Watch('footerExpanded')\n toggleHeight() {\n this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();\n }\n\n @Watch('open')\n toggleModal() {\n if (this.hasAnimatedIn) {\n this.handleAnimation();\n }\n }\n\n componentDidLoad() {\n this.handleAnimation();\n this.hasAnimatedIn = true;\n\n mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {\n this.draggable?.disable();\n gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });\n });\n mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {\n this.initDraggable();\n gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });\n });\n\n this.footerSlotEl.addEventListener('slotchange', () => {\n if (this.footerSlotEl.assignedNodes().length >= 1) {\n this.hasFooter = true;\n } else {\n this.hasFooter = false;\n }\n });\n }\n\n private handleAnimation() {\n if (this.open) {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })\n .to(this.modalWrapperEl, {\n scale: 1,\n opacity: 1,\n duration: this.enterTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.addExpandAnim();\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })\n .to(this.modalWrapperEl, {\n yPercent: -100,\n duration: this.enterTransitionDuration,\n });\n }\n } else {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n scale: 0.8,\n opacity: 0,\n duration: this.exitTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n yPercent: 0,\n duration: this.exitTransitionDuration,\n })\n .set(this.modalContainerEl, { y: 0 });\n }\n }\n }\n\n private addExpandAnim() {\n setTimeout(() => {\n this.expandFooterTl = gsap\n .timeline({\n reversed: true,\n paused: true,\n onReverseComplete: () => {\n this.contentEl.style.setProperty('height', 'auto');\n },\n defaults: {\n duration: this.footerTransitionDuration,\n },\n })\n .set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })\n .set(this.headerExpandedEl, { display: 'block' })\n .to(this.innerContainerEl, { paddingBottom: '8px' })\n .to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')\n .to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')\n .to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');\n }, 10);\n }\n\n private getDraggableHeight = () => {\n return this.innerContainerEl.clientHeight;\n };\n\n private initDraggable() {\n this.draggable = Draggable.create(this.modalContainerEl, {\n trigger: this.headerEl,\n dragClickables: false,\n type: 'y',\n edgeResistance: 0.2,\n liveSnap: {\n y: function (y) {\n if (y < 0) return 0; // Restricts dragging to down\n return y;\n },\n },\n onDrag: () => {\n const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);\n gsap.set(this.overlayEl, { opacity: y });\n },\n onDragEnd: () => {\n if (this.draggable.y > 60) {\n this.cpslModalRequestClose.emit();\n } else {\n gsap.set(this.overlayEl, { opacity: 1 });\n gsap.set(this.modalWrapperEl, { yPercent: -100 });\n gsap.set(this.modalContainerEl, { y: 0 });\n }\n },\n })[0];\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get footerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-footer-expanded');\n }\n\n private get headerExpandedEl() {\n return this.el.shadowRoot.getElementById('modal-header-expanded');\n }\n\n private get innerContainerEl() {\n return this.el.shadowRoot.getElementById('modal-inner-container');\n }\n\n private get contentEl() {\n return this.el.shadowRoot.getElementById('modal-content');\n }\n\n private get modalWrapperEl() {\n return this.el.shadowRoot.getElementById('modal-wrapper');\n }\n\n private get modalContainerEl() {\n return this.el.shadowRoot.getElementById('modal-container');\n }\n\n private get overlayEl() {\n return this.el.shadowRoot.getElementById('overlay');\n }\n\n private get footerSlotEl() {\n return this.footerEl.querySelectorAll('slot')[0];\n }\n\n private get headerEl() {\n return this.el.shadowRoot.getElementById('modal-header');\n }\n\n private get Modal() {\n return (\n <div class={{ 'modal-container': true, 'no-footer': !this.hasFooter }} part=\"modal-container\" id=\"modal-container\">\n <slot></slot>\n <div id=\"modal-inner-container\" class={{ 'modal-inner-container': true, 'no-footer': !this.hasFooter }} part=\"modal-inner-container\">\n <div id=\"modal-content\" part=\"modal-content\">\n <div id=\"modal-header\" class=\"modal-header\" part=\"modal-header\">\n <slot name=\"header\"></slot>\n </div>\n <div id=\"modal-body\" class=\"modal-body\" part=\"modal-body\">\n <slot name=\"body\"></slot>\n </div>\n </div>\n <div id=\"modal-header-expanded\" class={{ 'modal-header': true, 'expanded': true, 'no-opacity': true }} part=\"modal-header-expanded\">\n <slot name=\"footerExpandedHeader\"></slot>\n </div>\n </div>\n <div id=\"modal-footer\" part=\"modal-footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div id=\"modal-footer-expanded\" class={{ 'expanded': true, 'no-opacity': true }} part=\"modal-footer-expanded\">\n <slot name=\"footerExpandedFooter\"></slot>\n </div>\n </div>\n );\n }\n\n render() {\n if (this.noOverlay) {\n return (\n <Host style={Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {}} class=\"no-overlay\">\n {this.Modal}\n </Host>\n );\n }\n\n return (\n <Host style={Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {}} class={{ 'include-mobile-styling': true }}>\n <cpsl-overlay\n zIndexOverride={Boolean(this.zIndexOverride) ? this.zIndexOverride : undefined}\n id=\"overlay\"\n open={this.open}\n enterTransitionDuration={this.enterTransitionDuration}\n exitTransitionDuration={this.exitTransitionDuration}\n />\n <div id=\"modal-wrapper\" class=\"modal-wrapper\">\n {this.Modal}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,50 @@
1
+ :host {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 8px;
5
+ padding: 0px 16px;
6
+ box-sizing: border-box;
7
+ width: 100%;
8
+ }
9
+
10
+ :host ::slotted(cpsl-button) {
11
+ --button-padding-start: 8px;
12
+ --button-padding-end: 8px;
13
+ --button-padding-top: 8px;
14
+ --button-padding-bottom: 8px;
15
+ --button-justify-content: start;
16
+ --button-primary-color: var(--cpsl-color-background-48);
17
+ --button-primary-background-color: var(--cpsl-color-background-0);
18
+ --button-primary-border-color: var(--cpsl-color-background-0);
19
+ --button-primary-icon-color: var(--cpsl-color-background-48);
20
+ --button-primary-disabled-color: var(--cpsl-color-background-48);
21
+ --button-primary-disabled-background-color: var(--cpsl-color-background-0);
22
+ --button-primary-disabled-border-color: var(--cpsl-color-background-0);
23
+ --button-primary-disabled-icon-color: var(--cpsl-color-background-48);
24
+ --button-primary-hover-color: var(--cpsl-color-background-48);
25
+ --button-primary-hover-background-color: var(--cpsl-color-background-4);
26
+ --button-primary-hover-border-color: var(--cpsl-color-background-4);
27
+ --button-primary-hover-icon-color: var(--cpsl-color-background-48);
28
+ --button-primary-active-color: var(--cpsl-color-background-48);
29
+ --button-primary-active-background-color: var(--cpsl-color-background-4);
30
+ --button-primary-active-border-color: var(--cpsl-color-background-4);
31
+ --button-primary-active-icon-color: var(--cpsl-color-background-48);
32
+ }
33
+ :host ::slotted(cpsl-button.selected) {
34
+ --button-primary-color: var(--cpsl-color-text-primary);
35
+ --button-primary-background-color: var(--cpsl-color-background-4);
36
+ --button-primary-border-color: var(--cpsl-color-background-4);
37
+ --button-primary-icon-color: var(--cpsl-color-text-primary);
38
+ --button-primary-disabled-color: var(--cpsl-color-text-primary);
39
+ --button-primary-disabled-background-color: var(--cpsl-color-background-4);
40
+ --button-primary-disabled-border-color: var(--cpsl-color-background-4);
41
+ --button-primary-disabled-icon-color: var(--cpsl-color-text-primary);
42
+ --button-primary-hover-color: var(--cpsl-color-text-primary);
43
+ --button-primary-hover-background-color: var(--cpsl-color-background-4);
44
+ --button-primary-hover-border-color: var(--cpsl-color-background-4);
45
+ --button-primary-hover-icon-color: var(--cpsl-color-text-primary);
46
+ --button-primary-active-color: var(--cpsl-color-text-primary);
47
+ --button-primary-active-background-color: var(--cpsl-color-background-4);
48
+ --button-primary-active-border-color: var(--cpsl-color-background-4);
49
+ --button-primary-active-icon-color: var(--cpsl-color-text-primary);
50
+ }
@@ -0,0 +1,78 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CpslNavButtonGroup {
3
+ constructor() {
4
+ this.selectedId = undefined;
5
+ }
6
+ selectItem() {
7
+ this.buttonSlots.forEach(item => {
8
+ if (item.id === this.selectedId) {
9
+ item.classList.add('selected');
10
+ }
11
+ else {
12
+ item.classList.remove('selected');
13
+ }
14
+ });
15
+ }
16
+ componentWillRender() {
17
+ var _a;
18
+ this.buttonSlots.forEach(item => {
19
+ item.setAttribute('variant', 'primary');
20
+ item.setAttribute('full-width', 'true');
21
+ this.selectItem();
22
+ });
23
+ if (Boolean((_a = this.otherSlots) === null || _a === void 0 ? void 0 : _a.length)) {
24
+ console.error('cpsl-button is the only valid child of cpsl-nav-button-group');
25
+ this.otherSlots.forEach(item => item.remove());
26
+ }
27
+ }
28
+ get buttonSlots() {
29
+ return this.el.querySelectorAll('cpsl-button');
30
+ }
31
+ get otherSlots() {
32
+ return this.el.querySelectorAll('&> *:not(cpsl-button)');
33
+ }
34
+ render() {
35
+ return (h(Host, { key: '4de8526be6448d13688e491a0d460557939fe83b' }, h("slot", { key: '633ee1b8e1e637171e8fd55b0375df99bb9d4607' })));
36
+ }
37
+ static get is() { return "cpsl-nav-button-group"; }
38
+ static get encapsulation() { return "shadow"; }
39
+ static get originalStyleUrls() {
40
+ return {
41
+ "$": ["cpsl-nav-button-group.scss"]
42
+ };
43
+ }
44
+ static get styleUrls() {
45
+ return {
46
+ "$": ["cpsl-nav-button-group.css"]
47
+ };
48
+ }
49
+ static get properties() {
50
+ return {
51
+ "selectedId": {
52
+ "type": "string",
53
+ "mutable": false,
54
+ "complexType": {
55
+ "original": "string",
56
+ "resolved": "string",
57
+ "references": {}
58
+ },
59
+ "required": false,
60
+ "optional": true,
61
+ "docs": {
62
+ "tags": [],
63
+ "text": "The id of the selected button."
64
+ },
65
+ "attribute": "selected-id",
66
+ "reflect": false
67
+ }
68
+ };
69
+ }
70
+ static get elementRef() { return "el"; }
71
+ static get watchers() {
72
+ return [{
73
+ "propName": "selectedId",
74
+ "methodName": "selectItem"
75
+ }];
76
+ }
77
+ }
78
+ //# sourceMappingURL=cpsl-nav-button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-nav-button-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-nav-button-group/cpsl-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,CACL,EAAC,IAAI;YACH,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Element, Prop, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-nav-button-group',\n styleUrl: 'cpsl-nav-button-group.scss',\n shadow: true,\n})\nexport class CpslNavButtonGroup {\n @Element() el!: HTMLCpslNavButtonGroupElement;\n\n /**\n * The id of the selected button.\n */\n @Prop() selectedId?: string;\n\n @Watch('selectedId')\n selectItem() {\n this.buttonSlots.forEach(item => {\n if (item.id === this.selectedId) {\n item.classList.add('selected');\n } else {\n item.classList.remove('selected');\n }\n });\n }\n\n componentWillRender() {\n this.buttonSlots.forEach(item => {\n item.setAttribute('variant', 'primary');\n item.setAttribute('full-width', 'true');\n this.selectItem();\n });\n\n if (Boolean(this.otherSlots?.length)) {\n console.error('cpsl-button is the only valid child of cpsl-nav-button-group');\n this.otherSlots.forEach(item => item.remove());\n }\n }\n\n private get buttonSlots() {\n return this.el.querySelectorAll('cpsl-button');\n }\n\n private get otherSlots() {\n return this.el.querySelectorAll('&> *:not(cpsl-button)');\n }\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try {
5
+ step(generator.next(value));
6
+ }
7
+ catch (e) {
8
+ reject(e);
9
+ } }
10
+ function rejected(value) { try {
11
+ step(generator["throw"](value));
12
+ }
13
+ catch (e) {
14
+ reject(e);
15
+ } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ import { newE2EPage } from "@stencil/core/testing";
21
+ describe('cpsl-nav-button-group', () => {
22
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const page = yield newE2EPage();
24
+ yield page.setContent('<cpsl-nav-button-group></cpsl-nav-button-group>');
25
+ const element = yield page.find('cpsl-nav-button-group');
26
+ expect(element).toHaveClass('hydrated');
27
+ }));
28
+ });
29
+ //# sourceMappingURL=cpsl-nav-button-group.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-nav-button-group.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,iDAAiD,CAAC,CAAC;QAEzE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cpsl-nav-button-group', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-nav-button-group></cpsl-nav-button-group>');\n\n const element = await page.find('cpsl-nav-button-group');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -0,0 +1,37 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try {
5
+ step(generator.next(value));
6
+ }
7
+ catch (e) {
8
+ reject(e);
9
+ } }
10
+ function rejected(value) { try {
11
+ step(generator["throw"](value));
12
+ }
13
+ catch (e) {
14
+ reject(e);
15
+ } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ import { newSpecPage } from "@stencil/core/testing";
21
+ import { CpslNavButtonGroup } from "../cpsl-nav-button-group";
22
+ describe('cpsl-nav-button-group', () => {
23
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const page = yield newSpecPage({
25
+ components: [CpslNavButtonGroup],
26
+ html: `<cpsl-nav-button-group></cpsl-nav-button-group>`,
27
+ });
28
+ expect(page.root).toEqualHtml(`
29
+ <cpsl-nav-button-group>
30
+ <mock:shadow-root>
31
+ <slot></slot>
32
+ </mock:shadow-root>
33
+ </cpsl-nav-button-group>
34
+ `);
35
+ }));
36
+ });
37
+ //# sourceMappingURL=cpsl-nav-button-group.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-nav-button-group.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,kBAAkB,CAAC;YAChC,IAAI,EAAE,iDAAiD;SACxD,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CpslNavButtonGroup } from '../cpsl-nav-button-group';\n\ndescribe('cpsl-nav-button-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslNavButtonGroup],\n html: `<cpsl-nav-button-group></cpsl-nav-button-group>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-nav-button-group>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-nav-button-group>\n `);\n });\n});\n"]}