@usecapsule/core-components 3.0.0 → 3.0.1-dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. package/css/capsule-core.css +83 -14
  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-0d0a0037.entry.js → p-127ac658.entry.js} +2 -2
  8. package/dist/capsule/{p-0d0a0037.entry.js.map → p-127ac658.entry.js.map} +1 -1
  9. package/dist/capsule/p-39584a7b.entry.js +2 -0
  10. package/dist/capsule/p-39584a7b.entry.js.map +1 -0
  11. package/dist/capsule/p-69756614.entry.js +10 -0
  12. package/dist/capsule/{p-d28b96ba.entry.js.map → p-69756614.entry.js.map} +1 -1
  13. package/dist/capsule/p-73398222.entry.js +2 -0
  14. package/dist/capsule/{p-fcead80b.entry.js.map → p-73398222.entry.js.map} +1 -1
  15. package/dist/capsule/p-8de15b15.entry.js +29 -0
  16. package/dist/capsule/p-8de15b15.entry.js.map +1 -0
  17. package/dist/capsule/p-97c33636.js +3 -0
  18. package/dist/capsule/p-97c33636.js.map +1 -0
  19. package/dist/capsule/p-f2393be6.js +2 -0
  20. package/dist/capsule/p-f2393be6.js.map +1 -0
  21. package/dist/capsule/p-f72482c3.entry.js +2 -0
  22. package/dist/capsule/{p-ad14a817.entry.js.map → p-f72482c3.entry.js.map} +1 -1
  23. package/dist/capsule/{p-fa078837.entry.js → p-fd26ce6e.entry.js} +2 -2
  24. package/dist/capsule/{p-fa078837.entry.js.map → p-fd26ce6e.entry.js.map} +1 -1
  25. package/dist/cjs/capsule.cjs.js +10 -10
  26. package/dist/cjs/capsule.cjs.js.map +1 -1
  27. package/dist/cjs/{constants-0869a780.js → constants-9b1b01bb.js} +3 -3
  28. package/dist/cjs/{constants-0869a780.js.map → constants-9b1b01bb.js.map} +1 -1
  29. package/dist/cjs/{cpsl-alert_29.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +608 -95
  30. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
  31. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  32. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  33. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  34. package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
  35. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  36. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +55 -0
  37. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -0
  38. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  39. package/dist/cjs/index-5293d431.js +1414 -0
  40. package/dist/cjs/index-5293d431.js.map +1 -0
  41. package/dist/cjs/index.cjs.js +16 -4
  42. package/dist/cjs/index.cjs.js.map +1 -1
  43. package/dist/cjs/loader.cjs.js +2 -2
  44. package/dist/collection/assets/icons/brush.svg +3 -0
  45. package/dist/collection/assets/icons/chevron-up.svg +2 -2
  46. package/dist/collection/assets/icons/close.svg +3 -4
  47. package/dist/collection/assets/icons/cube.svg +3 -0
  48. package/dist/collection/assets/icons/file.svg +3 -0
  49. package/dist/collection/assets/icons/image.svg +3 -0
  50. package/dist/collection/assets/icons/index.js +10 -1
  51. package/dist/collection/assets/icons/index.js.map +1 -1
  52. package/dist/collection/assets/icons/lightning-01.svg +3 -0
  53. package/dist/collection/assets/icons/lightning.svg +2 -2
  54. package/dist/collection/assets/icons/menu.svg +3 -0
  55. package/dist/collection/assets/icons/refresh.svg +3 -0
  56. package/dist/collection/assets/icons/stars.svg +4 -0
  57. package/dist/collection/assets/icons/x.svg +3 -0
  58. package/dist/collection/collection-manifest.json +7 -2
  59. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  60. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  61. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  62. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +20 -4
  63. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  64. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  65. package/dist/collection/components/cpsl-button/cpsl-button.css +113 -17
  66. package/dist/collection/components/cpsl-button/cpsl-button.js +63 -7
  67. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  68. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +1 -0
  69. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
  70. package/dist/collection/components/cpsl-card/cpsl-card.css +1 -1
  71. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  72. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -1
  73. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +2 -2
  74. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  75. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +1 -1
  76. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +2 -2
  77. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  78. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  79. package/dist/collection/components/cpsl-divider/cpsl-divider.css +1 -1
  80. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  81. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +84 -11
  82. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  83. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  84. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  85. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.css +210 -0
  86. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +406 -0
  87. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -0
  88. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +29 -0
  89. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +1 -0
  90. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +37 -0
  91. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +1 -0
  92. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  93. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  94. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
  95. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  96. package/dist/collection/components/cpsl-input/cpsl-input.css +7 -6
  97. package/dist/collection/components/cpsl-input/cpsl-input.js +3 -8
  98. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  99. package/dist/collection/components/cpsl-modal/cpsl-modal.css +4 -4
  100. package/dist/collection/components/cpsl-modal/cpsl-modal.js +1 -0
  101. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  102. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.css +91 -0
  103. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +224 -0
  104. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -0
  105. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +29 -0
  106. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +1 -0
  107. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +37 -0
  108. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +1 -0
  109. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  110. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +1 -1
  111. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  112. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  113. package/dist/collection/components/cpsl-pill/cpsl-pill.css +1 -1
  114. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  115. package/dist/collection/components/cpsl-popover/cpsl-popover.css +98 -0
  116. package/dist/collection/components/cpsl-popover/cpsl-popover.js +470 -0
  117. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -0
  118. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +29 -0
  119. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +1 -0
  120. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +37 -0
  121. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +1 -0
  122. package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
  123. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +1 -1
  124. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  125. package/dist/collection/components/cpsl-radio/cpsl-radio.css +2 -2
  126. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  127. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  128. package/dist/collection/components/cpsl-select/cpsl-select.css +227 -0
  129. package/dist/collection/components/cpsl-select/cpsl-select.js +393 -0
  130. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -0
  131. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +29 -0
  132. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +1 -0
  133. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +37 -0
  134. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +1 -0
  135. package/dist/collection/components/cpsl-select-item/cpsl-select-item.css +104 -0
  136. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +85 -0
  137. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -0
  138. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +29 -0
  139. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +1 -0
  140. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +37 -0
  141. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +1 -0
  142. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +3 -3
  143. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  144. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  145. package/dist/collection/components/cpsl-switch/cpsl-switch.css +4 -4
  146. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  147. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  148. package/dist/collection/components/cpsl-table/cpsl-table.css +25 -64
  149. package/dist/collection/components/cpsl-table/cpsl-table.js +1 -63
  150. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  151. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +2 -2
  152. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  153. package/dist/collection/components/cpsl-text/cpsl-text.css +4 -0
  154. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  155. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  156. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +1 -1
  157. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  158. package/dist/collection/constants.js +2 -2
  159. package/dist/collection/constants.js.map +1 -1
  160. package/dist/collection/index.js.map +1 -1
  161. package/dist/collection/interface.js.map +1 -1
  162. package/dist/collection/utils/theme/generateBorderRadii.js +4 -0
  163. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  164. package/dist/collection/utils/theme/generatePalette.js +11 -3
  165. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  166. package/dist/esm/capsule.js +11 -11
  167. package/dist/esm/capsule.js.map +1 -1
  168. package/dist/esm/{constants-6acf4ea8.js → constants-fce138fa.js} +3 -3
  169. package/dist/esm/{constants-6acf4ea8.js.map → constants-fce138fa.js.map} +1 -1
  170. package/dist/esm/{cpsl-alert_29.entry.js → cpsl-alert_33.entry.js} +605 -96
  171. package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
  172. package/dist/esm/cpsl-animation.entry.js +2 -2
  173. package/dist/esm/cpsl-col.entry.js +2 -2
  174. package/dist/esm/cpsl-grid.entry.js +3 -3
  175. package/dist/esm/cpsl-info-box.entry.js +3 -3
  176. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  177. package/dist/esm/cpsl-modal-v2.entry.js +51 -0
  178. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -0
  179. package/dist/esm/cpsl-row.entry.js +2 -2
  180. package/dist/esm/index-97ed6ec1.js +1383 -0
  181. package/dist/esm/index-97ed6ec1.js.map +1 -0
  182. package/dist/esm/index.js +16 -4
  183. package/dist/esm/index.js.map +1 -1
  184. package/dist/esm/loader.js +3 -3
  185. package/dist/loader/cdn.js +1 -3
  186. package/dist/loader/index.cjs.js +1 -3
  187. package/dist/loader/index.es2017.js +1 -3
  188. package/dist/loader/index.js +1 -3
  189. package/dist/types/assets/icons/index.d.ts +9 -0
  190. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +1 -0
  191. package/dist/types/components/cpsl-button/cpsl-button.d.ts +4 -1
  192. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +10 -1
  193. package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +34 -0
  194. package/dist/types/components/cpsl-input/cpsl-input.d.ts +1 -1
  195. package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +17 -0
  196. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +33 -0
  197. package/dist/types/components/cpsl-select/cpsl-select.d.ts +35 -0
  198. package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +8 -0
  199. package/dist/types/components/cpsl-table/cpsl-table.d.ts +0 -3
  200. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  201. package/dist/types/components.d.ts +580 -28
  202. package/dist/types/constants.d.ts +2 -2
  203. package/dist/types/index.d.ts +1 -1
  204. package/dist/types/interface.d.ts +44 -0
  205. package/dist/types/stencil-public-runtime.d.ts +3 -8
  206. package/package.json +2 -3
  207. package/dist/capsule/p-4d8e4d86.entry.js +0 -29
  208. package/dist/capsule/p-4d8e4d86.entry.js.map +0 -1
  209. package/dist/capsule/p-86e48e61.js +0 -3
  210. package/dist/capsule/p-86e48e61.js.map +0 -1
  211. package/dist/capsule/p-ad14a817.entry.js +0 -2
  212. package/dist/capsule/p-b6b38e73.js +0 -2
  213. package/dist/capsule/p-b6b38e73.js.map +0 -1
  214. package/dist/capsule/p-d28b96ba.entry.js +0 -10
  215. package/dist/capsule/p-fcead80b.entry.js +0 -2
  216. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +0 -1
  217. package/dist/cjs/index-5733071e.js +0 -2020
  218. package/dist/cjs/index-5733071e.js.map +0 -1
  219. package/dist/collection/components/cpsl-table/table-interface.js +0 -2
  220. package/dist/collection/components/cpsl-table/table-interface.js.map +0 -1
  221. package/dist/esm/cpsl-alert_29.entry.js.map +0 -1
  222. package/dist/esm/index-8fe9f35e.js +0 -1990
  223. package/dist/esm/index-8fe9f35e.js.map +0 -1
  224. package/dist/esm/polyfills/core-js.js +0 -11
  225. package/dist/esm/polyfills/dom.js +0 -79
  226. package/dist/esm/polyfills/es5-html-element.js +0 -1
  227. package/dist/esm/polyfills/index.js +0 -34
  228. package/dist/esm/polyfills/system.js +0 -6
  229. package/dist/types/components/cpsl-table/table-interface.d.ts +0 -19
@@ -115,9 +115,7 @@ export class CpslInput {
115
115
  }
116
116
  }
117
117
  emitInputChange(event) {
118
- const { value } = this;
119
- const newValue = value == null ? value : value.toString();
120
- this.cpslInput.emit({ value: newValue, event });
118
+ this.cpslInput.emit({ value: this.nativeInput.value, event });
121
119
  }
122
120
  emitValueChange(event) {
123
121
  const { value } = this;
@@ -125,9 +123,6 @@ export class CpslInput {
125
123
  this.focusedValue = newValue;
126
124
  this.cpslChange.emit({ value: newValue, event });
127
125
  }
128
- get nativeInput() {
129
- return this.el.shadowRoot.getElementById(this.inputId);
130
- }
131
126
  get startEl() {
132
127
  return this.el.querySelector('[slot="start"]');
133
128
  }
@@ -136,7 +131,7 @@ export class CpslInput {
136
131
  }
137
132
  render() {
138
133
  var _a;
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)))));
134
+ return (h(Host, { key: '9e8eece493074613305b6303e9c095b89ee08eb0', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (h("label", { key: '97ee8423a02cd2547b764609751fbd301e21ccc9', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '933c4863226a6de14910cfe14b5e48015e6a04fd', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: 'a69f5c53c2fabc038aca226fb4a3965c1516fe53', name: "start" }), h("input", { key: 'f4a7e5234fe5d6b32e14bc226791d5aea9df151d', class: "native-input", ref: input => (this.nativeInput = 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: '6c74cecde29d9f1f9bf00a05e53197324f83f2bf', name: "end" })), (this.errorText || this.helperText) && (h("div", { key: '245c0413133d70b909415f10cdbfbd21ed03da61', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: 'a96f3e844d74ba481418e375ccaeab85cfb92836' }, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
140
135
  }
141
136
  static get is() { return "cpsl-input"; }
142
137
  static get encapsulation() { return "shadow"; }
@@ -581,7 +576,7 @@ export class CpslInput {
581
576
  "mutable": false,
582
577
  "complexType": {
583
578
  "original": "IconType",
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\"",
579
+ "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\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\"",
585
580
  "references": {
586
581
  "IconType": {
587
582
  "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;QAkRrC,YAAO,GAAG,CAAC,EAAsB,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI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,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"]}
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;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA0RrC,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;YACnC,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;YAED,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,CAAC;YAC3B,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC,CAA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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 private nativeInput?: HTMLInputElement;\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 /**\n * Update the native input element when the value changes\n */\n // @Watch('value')\n // protected valueChanged() {\n // const nativeInput = this.nativeInput;\n // const value = this.value;\n // if (nativeInput && nativeInput.value !== value) {\n // nativeInput.value = value;\n // }\n // Boolean(value) ? this.disableSlots() : this.enableSlots();\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 this.cpslInput.emit({ value: this.nativeInput.value, 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) => {\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\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 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 ref={input => (this.nativeInput = 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"]}
@@ -61,7 +61,7 @@
61
61
  --container-border-color: var(--cpsl-color-modal-border);
62
62
  --container-background-color: var(--cpsl-color-modal-surface-footer);
63
63
  --container-padding-bottom: 16px;
64
- --container-box-shadow: 0px 2px 4px 0px var(--cpsl-color-alpha-black-8);
64
+ --container-box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.12);
65
65
  --inner-container-background-color: var(--cpsl-color-modal-surface-main);
66
66
  --inner-container-border-radius: var(--cpsl-border-radius-modal);
67
67
  --inner-container-box-shadow: 0px 1px 2px 0px var(--cpsl-color-alpha-black-8);
@@ -103,7 +103,7 @@
103
103
  position: sticky;
104
104
  top: 0;
105
105
  padding-top: var(--inner-container-padding-top);
106
- background-color: var(--inner-container-background-color);
106
+ background: var(--inner-container-background-color);
107
107
  }
108
108
 
109
109
  .modal-wrapper {
@@ -136,7 +136,7 @@
136
136
  border: var(--container-border-width) solid var(--container-border-color);
137
137
  border-radius: var(--container-border-radius);
138
138
  box-shadow: var(--container-box-shadow);
139
- background-color: var(--container-background-color);
139
+ background: var(--container-background-color);
140
140
  max-width: 95vw;
141
141
  max-height: 95vh;
142
142
  max-height: 95dvh;
@@ -159,7 +159,7 @@
159
159
  margin-bottom: var(--inner-container-margin-bottom);
160
160
  border-radius: var(--inner-container-border-radius);
161
161
  box-shadow: var(--inner-container-box-shadow);
162
- background-color: var(--inner-container-background-color);
162
+ background: var(--inner-container-background-color);
163
163
  }
164
164
 
165
165
  .expanded {
@@ -38,6 +38,7 @@ export class CpslModal {
38
38
  this.initDraggable();
39
39
  gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });
40
40
  });
41
+ this.hasFooter = this.footerSlotEl.assignedNodes().length >= 1;
41
42
  this.footerSlotEl.addEventListener('slotchange', () => {
42
43
  if (this.footerSlotEl.assignedNodes().length >= 1) {
43
44
  this.hasFooter = true;
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-modal.js","sourceRoot":"","sources":["../../../../src/components/cpsl-modal/cpsl-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;AAM7B,MAAM,OAAO,SAAS;;QA0MZ,uBAAkB,GAAG,GAAG,EAAE;YAChC,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;QAC5C,CAAC,CAAC;;uCA/LyC,IAAI;sCAML,IAAI;;wCAWF,IAAI;;;;;IA2ChD,YAAY;QACV,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cA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CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAC,YAAY,IACtG,IAAI,CAAC,KAAK,CACN,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,wBAAwB,EAAE,IAAI,EAAE;YAC9H,oBACE,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,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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AAE,IAAI,EAAE;YAC9H,oBACE,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,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.hasFooter = this.footerSlotEl.assignedNodes().length >= 1;\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,91 @@
1
+ /**
2
+ * Convert a font size to a dynamic font size.
3
+ * Fonts that participate in Dynamic Type should use
4
+ * dynamic font sizes.
5
+ * @param size - The initial font size including the unit (i.e. px or pt)
6
+ * @param unit (optional) - The unit to convert to. Use this if you want to
7
+ * convert to a unit other than $baselineUnit.
8
+ */
9
+ /**
10
+ * Convert a font size to a dynamic font size but impose
11
+ * a maximum font size.
12
+ * @param size - The initial font size including the unit (i.e. px or pt)
13
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
14
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
15
+ * convert to a unit other than $baselineUnit.
16
+ */
17
+ /**
18
+ * Convert a font size to a dynamic font size but impose
19
+ * a minimum font size.
20
+ * @param size - The initial font size including the unit (i.e. px or pt)
21
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
22
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
23
+ * convert to a unit other than $baselineUnit.
24
+ */
25
+ /**
26
+ * Convert a font size to a dynamic font size but impose
27
+ * maximum and minimum font sizes.
28
+ * @param size - The initial font size including the unit (i.e. px or pt)
29
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
30
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
31
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
32
+ * convert to a unit other than $baselineUnit.
33
+ */
34
+ /**
35
+ * A heuristic that applies CSS to tablet
36
+ * viewports.
37
+ *
38
+ * Usage:
39
+ * @include tablet-viewport() {
40
+ * :host {
41
+ * background-color: green;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * A heuristic that applies CSS to mobile
47
+ * viewports (i.e. phones, not tablets).
48
+ *
49
+ * Usage:
50
+ * @include mobile-viewport() {
51
+ * :host {
52
+ * background-color: blue;
53
+ * }
54
+ * }
55
+ */
56
+ :host {
57
+ display: none;
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ width: 100vw;
62
+ height: 100vh;
63
+ justify-content: center;
64
+ align-items: center;
65
+ z-index: 10005;
66
+ }
67
+ :host .card {
68
+ z-index: 10005;
69
+ opacity: 0;
70
+ position: relative;
71
+ transition: all;
72
+ }
73
+
74
+ :host(.no-overlay) {
75
+ position: relative;
76
+ top: unset;
77
+ left: unset;
78
+ width: 100%;
79
+ height: auto;
80
+ }
81
+
82
+ :host(.open) .card {
83
+ opacity: 1;
84
+ }
85
+
86
+ :host(.elevated) .card {
87
+ --card-border-width: 0px;
88
+ }
89
+ :host(.elevated) .card::part(card-container) {
90
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.12);
91
+ }
@@ -0,0 +1,224 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CpslModalV2 {
3
+ constructor() {
4
+ this.enterTransitionDuration = 0.15;
5
+ this.exitTransitionDuration = 0.15;
6
+ this.elevated = undefined;
7
+ this.noOverlay = undefined;
8
+ this.open = undefined;
9
+ this.zIndexOverride = undefined;
10
+ }
11
+ toggleHeight() {
12
+ if (!this.open) {
13
+ this.cpslModalExiting.emit();
14
+ setTimeout(() => {
15
+ this.el.style.display = 'none';
16
+ this.cpslModalExited.emit();
17
+ }, this.exitTransitionDuration * 1000);
18
+ }
19
+ else {
20
+ this.cpslModalEntering.emit();
21
+ this.el.style.display = 'flex';
22
+ setTimeout(() => {
23
+ this.cpslModalEntered.emit();
24
+ }, this.enterTransitionDuration * 1000);
25
+ }
26
+ }
27
+ componentDidLoad() {
28
+ this.toggleHeight();
29
+ }
30
+ render() {
31
+ return (h(Host, { key: '916ab0ce5ec3ce2a33103e67773b5420dd44241d', class: { 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay } }, !this.noOverlay && (h("cpsl-overlay", { key: 'de5a3d5d1784fb4b2e07530ba0edcecc4c4c0e04', zIndexOverride: Boolean(this.zIndexOverride) ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration })), h("cpsl-card", { key: '8cbdc7a258583092b89c52e1167fb4094a4cc5b3', class: "card", style: { transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` } }, h("slot", { key: '5382dc704ac6fdb1f159139bac1bddd544749b32' }))));
32
+ }
33
+ static get is() { return "cpsl-modal-v2"; }
34
+ static get encapsulation() { return "shadow"; }
35
+ static get originalStyleUrls() {
36
+ return {
37
+ "$": ["cpsl-modal-v2.scss"]
38
+ };
39
+ }
40
+ static get styleUrls() {
41
+ return {
42
+ "$": ["cpsl-modal-v2.css"]
43
+ };
44
+ }
45
+ static get properties() {
46
+ return {
47
+ "enterTransitionDuration": {
48
+ "type": "number",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "number",
52
+ "resolved": "number",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": true,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": "Duration in seconds of the modal entering.\nDefault is .15."
60
+ },
61
+ "attribute": "enter-transition-duration",
62
+ "reflect": false,
63
+ "defaultValue": "0.15"
64
+ },
65
+ "exitTransitionDuration": {
66
+ "type": "number",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "number",
70
+ "resolved": "number",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": true,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": "Duration in seconds of the modal exiting.\nDefault is .15."
78
+ },
79
+ "attribute": "exit-transition-duration",
80
+ "reflect": false,
81
+ "defaultValue": "0.15"
82
+ },
83
+ "elevated": {
84
+ "type": "boolean",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "boolean",
88
+ "resolved": "boolean",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": "Whether or not to show the modal with a box shadow."
96
+ },
97
+ "attribute": "elevated",
98
+ "reflect": false
99
+ },
100
+ "noOverlay": {
101
+ "type": "boolean",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "boolean",
105
+ "resolved": "boolean",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": "Whether or not to show the overlay."
113
+ },
114
+ "attribute": "no-overlay",
115
+ "reflect": false
116
+ },
117
+ "open": {
118
+ "type": "boolean",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "boolean",
122
+ "resolved": "boolean",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": "Whether or not to show the modal."
130
+ },
131
+ "attribute": "open",
132
+ "reflect": false
133
+ },
134
+ "zIndexOverride": {
135
+ "type": "number",
136
+ "mutable": false,
137
+ "complexType": {
138
+ "original": "number",
139
+ "resolved": "number",
140
+ "references": {}
141
+ },
142
+ "required": false,
143
+ "optional": true,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": "Override z-index."
147
+ },
148
+ "attribute": "z-index-override",
149
+ "reflect": false
150
+ }
151
+ };
152
+ }
153
+ static get events() {
154
+ return [{
155
+ "method": "cpslModalEntering",
156
+ "name": "cpslModalEntering",
157
+ "bubbles": true,
158
+ "cancelable": true,
159
+ "composed": true,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": "Emitted when enter animation starts."
163
+ },
164
+ "complexType": {
165
+ "original": "null",
166
+ "resolved": "null",
167
+ "references": {}
168
+ }
169
+ }, {
170
+ "method": "cpslModalEntered",
171
+ "name": "cpslModalEntered",
172
+ "bubbles": true,
173
+ "cancelable": true,
174
+ "composed": true,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "Emitted when enter animation finishes."
178
+ },
179
+ "complexType": {
180
+ "original": "null",
181
+ "resolved": "null",
182
+ "references": {}
183
+ }
184
+ }, {
185
+ "method": "cpslModalExiting",
186
+ "name": "cpslModalExiting",
187
+ "bubbles": true,
188
+ "cancelable": true,
189
+ "composed": true,
190
+ "docs": {
191
+ "tags": [],
192
+ "text": "Emitted when exit animation starts."
193
+ },
194
+ "complexType": {
195
+ "original": "null",
196
+ "resolved": "null",
197
+ "references": {}
198
+ }
199
+ }, {
200
+ "method": "cpslModalExited",
201
+ "name": "cpslModalExited",
202
+ "bubbles": true,
203
+ "cancelable": true,
204
+ "composed": true,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "Emitted when exit animation finishes."
208
+ },
209
+ "complexType": {
210
+ "original": "null",
211
+ "resolved": "null",
212
+ "references": {}
213
+ }
214
+ }];
215
+ }
216
+ static get elementRef() { return "el"; }
217
+ static get watchers() {
218
+ return [{
219
+ "propName": "open",
220
+ "methodName": "toggleHeight"
221
+ }];
222
+ }
223
+ }
224
+ //# sourceMappingURL=cpsl-modal-v2.js.map