@descope/web-components-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/cjs/index.cjs.js +18314 -0
  4. package/dist/cjs/index.cjs.js.map +1 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/index.d.ts +72 -0
  7. package/dist/index.esm.js +20157 -0
  8. package/dist/index.esm.js.map +1 -0
  9. package/dist/umd/1172.js +240 -0
  10. package/dist/umd/1172.js.LICENSE.txt +23 -0
  11. package/dist/umd/1396.js +37 -0
  12. package/dist/umd/1396.js.LICENSE.txt +11 -0
  13. package/dist/umd/1402.js +1 -0
  14. package/dist/umd/1484.js +148 -0
  15. package/dist/umd/1484.js.LICENSE.txt +17 -0
  16. package/dist/umd/189.js +338 -0
  17. package/dist/umd/189.js.LICENSE.txt +11 -0
  18. package/dist/umd/201.js +73 -0
  19. package/dist/umd/201.js.LICENSE.txt +23 -0
  20. package/dist/umd/2159.js +608 -0
  21. package/dist/umd/2159.js.LICENSE.txt +23 -0
  22. package/dist/umd/2540.js +1 -0
  23. package/dist/umd/2570.js +338 -0
  24. package/dist/umd/2570.js.LICENSE.txt +11 -0
  25. package/dist/umd/2666.js +148 -0
  26. package/dist/umd/2666.js.LICENSE.txt +11 -0
  27. package/dist/umd/2755.js +1 -0
  28. package/dist/umd/3110.js +275 -0
  29. package/dist/umd/3110.js.LICENSE.txt +23 -0
  30. package/dist/umd/3191.js +506 -0
  31. package/dist/umd/3191.js.LICENSE.txt +17 -0
  32. package/dist/umd/3437.js +2 -0
  33. package/dist/umd/3437.js.LICENSE.txt +15 -0
  34. package/dist/umd/3638.js +2 -0
  35. package/dist/umd/3638.js.LICENSE.txt +5 -0
  36. package/dist/umd/404.js +148 -0
  37. package/dist/umd/404.js.LICENSE.txt +17 -0
  38. package/dist/umd/4114.js +124 -0
  39. package/dist/umd/4114.js.LICENSE.txt +33 -0
  40. package/dist/umd/4127.js +449 -0
  41. package/dist/umd/4127.js.LICENSE.txt +17 -0
  42. package/dist/umd/4187.js +2 -0
  43. package/dist/umd/4187.js.LICENSE.txt +5 -0
  44. package/dist/umd/4218.js +129 -0
  45. package/dist/umd/4218.js.LICENSE.txt +23 -0
  46. package/dist/umd/4455.js +422 -0
  47. package/dist/umd/4455.js.LICENSE.txt +11 -0
  48. package/dist/umd/4480.js +1 -0
  49. package/dist/umd/4554.js +303 -0
  50. package/dist/umd/4554.js.LICENSE.txt +11 -0
  51. package/dist/umd/4574.js +400 -0
  52. package/dist/umd/4574.js.LICENSE.txt +23 -0
  53. package/dist/umd/4619.js +1 -0
  54. package/dist/umd/4902.js +170 -0
  55. package/dist/umd/4902.js.LICENSE.txt +23 -0
  56. package/dist/umd/507.js +279 -0
  57. package/dist/umd/507.js.LICENSE.txt +11 -0
  58. package/dist/umd/5096.js +109 -0
  59. package/dist/umd/5096.js.LICENSE.txt +5 -0
  60. package/dist/umd/5318.js +1 -0
  61. package/dist/umd/5414.js +2 -0
  62. package/dist/umd/5414.js.LICENSE.txt +1 -0
  63. package/dist/umd/5563.js +319 -0
  64. package/dist/umd/5563.js.LICENSE.txt +55 -0
  65. package/dist/umd/7097.js +338 -0
  66. package/dist/umd/7097.js.LICENSE.txt +11 -0
  67. package/dist/umd/7150.js +2 -0
  68. package/dist/umd/7150.js.LICENSE.txt +485 -0
  69. package/dist/umd/731.js +832 -0
  70. package/dist/umd/731.js.LICENSE.txt +17 -0
  71. package/dist/umd/742.js +2 -0
  72. package/dist/umd/742.js.LICENSE.txt +21 -0
  73. package/dist/umd/7979.js +419 -0
  74. package/dist/umd/7979.js.LICENSE.txt +11 -0
  75. package/dist/umd/8823.js +1 -0
  76. package/dist/umd/9030.js +381 -0
  77. package/dist/umd/9030.js.LICENSE.txt +17 -0
  78. package/dist/umd/9243.js +202 -0
  79. package/dist/umd/9243.js.LICENSE.txt +51 -0
  80. package/dist/umd/9478.js +338 -0
  81. package/dist/umd/9478.js.LICENSE.txt +11 -0
  82. package/dist/umd/DescopeDev.js +1 -0
  83. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -0
  84. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -0
  85. package/dist/umd/boolean-fields-descope-checkbox-index-js.js.LICENSE.txt +5 -0
  86. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -0
  87. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt +5 -0
  88. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -0
  89. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -0
  90. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -0
  91. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -0
  92. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -0
  93. package/dist/umd/descope-alert-index-js.js +1 -0
  94. package/dist/umd/descope-apps-list-index-js.js +1 -0
  95. package/dist/umd/descope-avatar.js +1 -0
  96. package/dist/umd/descope-badge-index-js.js +1 -0
  97. package/dist/umd/descope-button-index-js.js +338 -0
  98. package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
  99. package/dist/umd/descope-code-snippet-index-js.js +1 -0
  100. package/dist/umd/descope-combo-box-index-js.js +113 -0
  101. package/dist/umd/descope-combo-box-index-js.js.LICENSE.txt +11 -0
  102. package/dist/umd/descope-container-index-js.js +1 -0
  103. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -0
  104. package/dist/umd/descope-date-field-index-js.js +1 -0
  105. package/dist/umd/descope-divider-index-js.js +1 -0
  106. package/dist/umd/descope-email-field-index-js.js +54 -0
  107. package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
  108. package/dist/umd/descope-enriched-text-index-js.js +1 -0
  109. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -0
  110. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt +17 -0
  111. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +105 -0
  112. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +29 -0
  113. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -0
  114. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
  115. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -0
  116. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
  117. package/dist/umd/descope-grid-index-js.js +1 -0
  118. package/dist/umd/descope-hybrid-field-index-js.js +19 -0
  119. package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
  120. package/dist/umd/descope-icon-index-js.js +1 -0
  121. package/dist/umd/descope-image-index-js.js +1 -0
  122. package/dist/umd/descope-link-index-js.js +1 -0
  123. package/dist/umd/descope-list-index-js.js +1 -0
  124. package/dist/umd/descope-loader-linear-index-js.js +1 -0
  125. package/dist/umd/descope-loader-radial-index-js.js +1 -0
  126. package/dist/umd/descope-logo-index-js.js +1 -0
  127. package/dist/umd/descope-modal-index-js.js +1 -0
  128. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -0
  129. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -0
  130. package/dist/umd/descope-new-password-index-js.js +1 -0
  131. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -0
  132. package/dist/umd/descope-notification-index-js.js +1 -0
  133. package/dist/umd/descope-notp-image-index-js.js +1 -0
  134. package/dist/umd/descope-number-field-index-js.js +1 -0
  135. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -0
  136. package/dist/umd/descope-passcode-index-js.js +1 -0
  137. package/dist/umd/descope-password-index-js.js +1 -0
  138. package/dist/umd/descope-policy-validation-index-js.js +1 -0
  139. package/dist/umd/descope-radio-group-index-js.js +1 -0
  140. package/dist/umd/descope-recaptcha-index-js.js +1 -0
  141. package/dist/umd/descope-scopes-list-index-js.js +2 -0
  142. package/dist/umd/descope-scopes-list-index-js.js.LICENSE.txt +5 -0
  143. package/dist/umd/descope-security-questions-setup-index-js.js +1 -0
  144. package/dist/umd/descope-security-questions-verify-index-js.js +37 -0
  145. package/dist/umd/descope-security-questions-verify-index-js.js.LICENSE.txt +11 -0
  146. package/dist/umd/descope-text-area-index-js.js +1 -0
  147. package/dist/umd/descope-text-field-index-js.js +37 -0
  148. package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
  149. package/dist/umd/descope-text.js +1 -0
  150. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -0
  151. package/dist/umd/descope-totp-image-index-js.js +1 -0
  152. package/dist/umd/descope-upload-file-index-js.js +1 -0
  153. package/dist/umd/descope-user-attribute-index-js.js +1 -0
  154. package/dist/umd/descope-user-auth-method-index-js.js +1 -0
  155. package/dist/umd/index.js +1 -0
  156. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -0
  157. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -0
  158. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -0
  159. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -0
  160. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -0
  161. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -0
  162. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -0
  163. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -0
  164. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
  165. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -0
  166. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt +17 -0
  167. package/node_modules/common/.eslintrc.json +18 -0
  168. package/node_modules/common/README.md +7 -0
  169. package/node_modules/common/package.json +34 -0
  170. package/node_modules/common/project.json +7 -0
  171. package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +66 -0
  172. package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +14 -0
  173. package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +55 -0
  174. package/node_modules/common/src/baseClasses/index.js +3 -0
  175. package/node_modules/common/src/componentsHelpers/index.js +95 -0
  176. package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +10 -0
  177. package/node_modules/common/src/componentsMixins/index.js +1 -0
  178. package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +14 -0
  179. package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +22 -0
  180. package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +23 -0
  181. package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +12 -0
  182. package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +100 -0
  183. package/node_modules/common/src/componentsMixins/mixins/createProxy.js +58 -0
  184. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +106 -0
  185. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +167 -0
  186. package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +62 -0
  187. package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +93 -0
  188. package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +170 -0
  189. package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +13 -0
  190. package/node_modules/common/src/componentsMixins/mixins/index.js +14 -0
  191. package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +76 -0
  192. package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +210 -0
  193. package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +23 -0
  194. package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +57 -0
  195. package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +112 -0
  196. package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +242 -0
  197. package/node_modules/common/src/constants.js +4 -0
  198. package/node_modules/common/src/icons/errorMessageIconBase64.js +1 -0
  199. package/node_modules/common/src/sbControls.js +302 -0
  200. package/node_modules/common/src/themeHelpers/colorsHelpers.js +94 -0
  201. package/node_modules/common/src/themeHelpers/componentsThemeManager.js +45 -0
  202. package/node_modules/common/src/themeHelpers/index.js +176 -0
  203. package/node_modules/common/src/utils/index.js +68 -0
  204. package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +54 -0
  205. package/node_modules/descope-avatar/package.json +34 -0
  206. package/node_modules/descope-avatar/project.json +7 -0
  207. package/node_modules/descope-avatar/src/component/AvatarClass.js +109 -0
  208. package/node_modules/descope-avatar/src/component/index.js +8 -0
  209. package/node_modules/descope-avatar/src/theme.js +44 -0
  210. package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
  211. package/node_modules/descope-avatar/stories/descope-avatar.stories.js +32 -0
  212. package/node_modules/descope-text/e2e/descope-text.spec.ts +35 -0
  213. package/node_modules/descope-text/package.json +31 -0
  214. package/node_modules/descope-text/project.json +7 -0
  215. package/node_modules/descope-text/src/component/TextClass.js +63 -0
  216. package/node_modules/descope-text/src/component/index.js +5 -0
  217. package/node_modules/descope-text/src/theme.js +91 -0
  218. package/node_modules/descope-text/stories/descope-text.stories.js +55 -0
  219. package/package.json +151 -0
  220. package/src/baseClasses/createBaseClass.js +66 -0
  221. package/src/baseClasses/createBaseInputClass.js +16 -0
  222. package/src/baseClasses/createCssVarImageClass.js +53 -0
  223. package/src/components/boolean-fields/booleanFieldMixin.js +36 -0
  224. package/src/components/boolean-fields/commonStyles.js +50 -0
  225. package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +77 -0
  226. package/src/components/boolean-fields/descope-boolean-field-internal/index.js +3 -0
  227. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +133 -0
  228. package/src/components/boolean-fields/descope-checkbox/index.js +8 -0
  229. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +154 -0
  230. package/src/components/boolean-fields/descope-switch-toggle/index.js +8 -0
  231. package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +171 -0
  232. package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +101 -0
  233. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +67 -0
  234. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js +7 -0
  235. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +108 -0
  236. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/index.js +8 -0
  237. package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +67 -0
  238. package/src/components/button-selection-group-fields/descope-button-selection-group/index.js +7 -0
  239. package/src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +77 -0
  240. package/src/components/button-selection-group-fields/descope-button-selection-group-internal/index.js +8 -0
  241. package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +115 -0
  242. package/src/components/button-selection-group-fields/descope-button-selection-group-item/index.js +6 -0
  243. package/src/components/descope-alert/AlertClass.js +105 -0
  244. package/src/components/descope-alert/index.js +6 -0
  245. package/src/components/descope-apps-list/AppsListClass.js +97 -0
  246. package/src/components/descope-apps-list/index.js +8 -0
  247. package/src/components/descope-badge/BadgeClass.js +57 -0
  248. package/src/components/descope-badge/index.js +5 -0
  249. package/src/components/descope-button/ButtonClass.js +163 -0
  250. package/src/components/descope-button/clickableMixin.js +10 -0
  251. package/src/components/descope-button/index.js +6 -0
  252. package/src/components/descope-code-snippet/CodeSnippetClass.js +238 -0
  253. package/src/components/descope-code-snippet/helpers.js +9 -0
  254. package/src/components/descope-code-snippet/index.js +5 -0
  255. package/src/components/descope-combo-box/ComboBoxClass.js +543 -0
  256. package/src/components/descope-combo-box/index.js +6 -0
  257. package/src/components/descope-container/ContainerClass.js +65 -0
  258. package/src/components/descope-container/index.js +5 -0
  259. package/src/components/descope-date-field/DateCounterClass.js +83 -0
  260. package/src/components/descope-date-field/DateFieldClass.js +702 -0
  261. package/src/components/descope-date-field/consts.js +55 -0
  262. package/src/components/descope-date-field/descope-calendar/CalendarClass.js +668 -0
  263. package/src/components/descope-date-field/descope-calendar/helpers.js +186 -0
  264. package/src/components/descope-date-field/descope-calendar/index.js +9 -0
  265. package/src/components/descope-date-field/formats.js +49 -0
  266. package/src/components/descope-date-field/helpers.js +72 -0
  267. package/src/components/descope-date-field/icons.js +14 -0
  268. package/src/components/descope-date-field/index.js +10 -0
  269. package/src/components/descope-divider/DividerClass.js +105 -0
  270. package/src/components/descope-divider/index.js +6 -0
  271. package/src/components/descope-email-field/EmailFieldClass.js +90 -0
  272. package/src/components/descope-email-field/index.js +6 -0
  273. package/src/components/descope-enriched-text/EnrichedTextClass.js +204 -0
  274. package/src/components/descope-enriched-text/consts.js +14 -0
  275. package/src/components/descope-enriched-text/helpers.js +5 -0
  276. package/src/components/descope-enriched-text/index.js +5 -0
  277. package/src/components/descope-grid/GridClass.js +368 -0
  278. package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +31 -0
  279. package/src/components/descope-grid/descope-grid-custom-column/index.js +7 -0
  280. package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
  281. package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
  282. package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +58 -0
  283. package/src/components/descope-grid/descope-grid-selection-column/index.js +7 -0
  284. package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +26 -0
  285. package/src/components/descope-grid/descope-grid-text-column/index.js +6 -0
  286. package/src/components/descope-grid/helpers.js +74 -0
  287. package/src/components/descope-grid/index.js +12 -0
  288. package/src/components/descope-hybrid-field/HybridFieldClass.js +363 -0
  289. package/src/components/descope-hybrid-field/helpers.js +5 -0
  290. package/src/components/descope-hybrid-field/index.js +9 -0
  291. package/src/components/descope-icon/IconClass.js +82 -0
  292. package/src/components/descope-icon/helpers.js +51 -0
  293. package/src/components/descope-icon/index.js +5 -0
  294. package/src/components/descope-image/ImageClass.js +48 -0
  295. package/src/components/descope-image/index.js +5 -0
  296. package/src/components/descope-link/LinkClass.js +71 -0
  297. package/src/components/descope-link/index.js +6 -0
  298. package/src/components/descope-list/ListClass.js +154 -0
  299. package/src/components/descope-list/ListItemClass.js +56 -0
  300. package/src/components/descope-list/index.js +7 -0
  301. package/src/components/descope-loader-linear/LoaderLinearClass.js +69 -0
  302. package/src/components/descope-loader-linear/index.js +5 -0
  303. package/src/components/descope-loader-radial/LoaderRadialClass.js +50 -0
  304. package/src/components/descope-loader-radial/index.js +5 -0
  305. package/src/components/descope-logo/LogoClass.js +10 -0
  306. package/src/components/descope-logo/index.js +5 -0
  307. package/src/components/descope-modal/ModalClass.js +112 -0
  308. package/src/components/descope-modal/index.js +6 -0
  309. package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +676 -0
  310. package/src/components/descope-multi-select-combo-box/index.js +6 -0
  311. package/src/components/descope-new-password/NewPasswordClass.js +218 -0
  312. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +246 -0
  313. package/src/components/descope-new-password/descope-new-password-internal/componentName.js +3 -0
  314. package/src/components/descope-new-password/descope-new-password-internal/index.js +4 -0
  315. package/src/components/descope-new-password/index.js +9 -0
  316. package/src/components/descope-notification/NotificationClass.js +107 -0
  317. package/src/components/descope-notification/descope-notification-card/NotificationCardClass.js +115 -0
  318. package/src/components/descope-notification/descope-notification-card/index.js +6 -0
  319. package/src/components/descope-notification/descope-notification-container.js +13 -0
  320. package/src/components/descope-notification/index.js +8 -0
  321. package/src/components/descope-notp-image/NotpImageClass.js +10 -0
  322. package/src/components/descope-notp-image/index.js +5 -0
  323. package/src/components/descope-number-field/NumberFieldClass.js +54 -0
  324. package/src/components/descope-number-field/index.js +6 -0
  325. package/src/components/descope-passcode/PasscodeClass.js +209 -0
  326. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +231 -0
  327. package/src/components/descope-passcode/descope-passcode-internal/helpers.js +41 -0
  328. package/src/components/descope-passcode/descope-passcode-internal/index.js +3 -0
  329. package/src/components/descope-passcode/index.js +8 -0
  330. package/src/components/descope-password/PasswordClass.js +302 -0
  331. package/src/components/descope-password/index.js +6 -0
  332. package/src/components/descope-password/passwordDraggableMixin.js +40 -0
  333. package/src/components/descope-policy-validation/PolicyValidationClass.js +220 -0
  334. package/src/components/descope-policy-validation/helpers.js +2 -0
  335. package/src/components/descope-policy-validation/index.js +5 -0
  336. package/src/components/descope-radio-group/RadioButtonClass.js +77 -0
  337. package/src/components/descope-radio-group/RadioGroupClass.js +192 -0
  338. package/src/components/descope-radio-group/index.js +8 -0
  339. package/src/components/descope-recaptcha/RecaptchaClass.js +230 -0
  340. package/src/components/descope-recaptcha/index.js +5 -0
  341. package/src/components/descope-scopes-list/ScopesListClass.js +131 -0
  342. package/src/components/descope-scopes-list/index.js +7 -0
  343. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +240 -0
  344. package/src/components/descope-security-questions-setup/index.js +7 -0
  345. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +232 -0
  346. package/src/components/descope-security-questions-verify/index.js +7 -0
  347. package/src/components/descope-text-area/TextAreaClass.js +102 -0
  348. package/src/components/descope-text-area/index.js +6 -0
  349. package/src/components/descope-text-field/TextFieldClass.js +142 -0
  350. package/src/components/descope-text-field/index.js +9 -0
  351. package/src/components/descope-text-field/textFieldMappings.js +151 -0
  352. package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +103 -0
  353. package/src/components/descope-third-party-app-logo/arrows.svg +4 -0
  354. package/src/components/descope-third-party-app-logo/index.js +7 -0
  355. package/src/components/descope-totp-image/TotpImageClass.js +10 -0
  356. package/src/components/descope-totp-image/index.js +5 -0
  357. package/src/components/descope-upload-file/UploadFileClass.js +236 -0
  358. package/src/components/descope-upload-file/helpers.js +11 -0
  359. package/src/components/descope-upload-file/index.js +6 -0
  360. package/src/components/descope-user-attribute/UserAttributeClass.js +245 -0
  361. package/src/components/descope-user-attribute/delete.svg +3 -0
  362. package/src/components/descope-user-attribute/edit.svg +3 -0
  363. package/src/components/descope-user-attribute/index.js +9 -0
  364. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +204 -0
  365. package/src/components/descope-user-auth-method/green-v.svg +3 -0
  366. package/src/components/descope-user-auth-method/index.js +9 -0
  367. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +188 -0
  368. package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/MappingItem.js +167 -0
  369. package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/index.js +3 -0
  370. package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +257 -0
  371. package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/index.js +3 -0
  372. package/src/components/mapping-fields/descope-mappings-field/index.js +14 -0
  373. package/src/components/mapping-fields/descope-saml-group-mappings/SamlGroupMappingsClass.js +116 -0
  374. package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/SamlGroupMappingsInternal.js +136 -0
  375. package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/index.js +3 -0
  376. package/src/components/mapping-fields/descope-saml-group-mappings/index.js +10 -0
  377. package/src/components/phone-fields/CountryCodes.js +1215 -0
  378. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +313 -0
  379. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +272 -0
  380. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +6 -0
  381. package/src/components/phone-fields/descope-phone-field/helpers.js +52 -0
  382. package/src/components/phone-fields/descope-phone-field/index.js +9 -0
  383. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +236 -0
  384. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +172 -0
  385. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +5 -0
  386. package/src/components/phone-fields/descope-phone-input-box-field/index.js +9 -0
  387. package/src/components/phone-fields/helpers.js +5 -0
  388. package/src/constants.js +4 -0
  389. package/src/darkTheme.js +52 -0
  390. package/src/dev/index.js +3 -0
  391. package/src/helpers/componentHelpers.js +95 -0
  392. package/src/helpers/index.js +68 -0
  393. package/src/helpers/mixinsHelpers.js +10 -0
  394. package/src/helpers/themeHelpers/colorsHelpers.js +94 -0
  395. package/src/helpers/themeHelpers/index.js +175 -0
  396. package/src/helpers/themeHelpers/resetHelpers.js +144 -0
  397. package/src/index.cjs.js +60 -0
  398. package/src/index.d.ts +72 -0
  399. package/src/index.js +62 -0
  400. package/src/index.umd.js +28 -0
  401. package/src/mixins/activableMixin.js +14 -0
  402. package/src/mixins/changeMixin.js +22 -0
  403. package/src/mixins/componentNameValidationMixin.js +23 -0
  404. package/src/mixins/componentsContextMixin.js +12 -0
  405. package/src/mixins/createDynamicDataMixin.js +100 -0
  406. package/src/mixins/createProxy.js +58 -0
  407. package/src/mixins/createStyleMixin/helpers.js +106 -0
  408. package/src/mixins/createStyleMixin/index.js +167 -0
  409. package/src/mixins/draggableMixin.js +62 -0
  410. package/src/mixins/externalInputHelpers.js +93 -0
  411. package/src/mixins/externalInputMixin.js +170 -0
  412. package/src/mixins/hoverableMixin.js +13 -0
  413. package/src/mixins/index.js +13 -0
  414. package/src/mixins/inputEventsDispatchingMixin.js +76 -0
  415. package/src/mixins/inputValidationMixin.js +210 -0
  416. package/src/mixins/lifecycleEventsMixin.js +23 -0
  417. package/src/mixins/normalizeBooleanAttributesMixin.js +59 -0
  418. package/src/mixins/portalMixin.js +111 -0
  419. package/src/mixins/proxyInputMixin.js +242 -0
  420. package/src/theme/components/alert.js +88 -0
  421. package/src/theme/components/appsList.js +36 -0
  422. package/src/theme/components/badge.js +71 -0
  423. package/src/theme/components/button.js +133 -0
  424. package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +23 -0
  425. package/src/theme/components/buttonSelectionGroup/buttonMultiSelectionGroup.js +11 -0
  426. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +11 -0
  427. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +34 -0
  428. package/src/theme/components/calendar.js +91 -0
  429. package/src/theme/components/checkbox.js +39 -0
  430. package/src/theme/components/codeSnippet.js +145 -0
  431. package/src/theme/components/comboBox.js +93 -0
  432. package/src/theme/components/container.js +127 -0
  433. package/src/theme/components/dateField.js +32 -0
  434. package/src/theme/components/divider.js +49 -0
  435. package/src/theme/components/emailField.js +50 -0
  436. package/src/theme/components/enrichedText.js +40 -0
  437. package/src/theme/components/grid.js +52 -0
  438. package/src/theme/components/hybridField.js +22 -0
  439. package/src/theme/components/icon.js +7 -0
  440. package/src/theme/components/image.js +8 -0
  441. package/src/theme/components/index.js +124 -0
  442. package/src/theme/components/inputWrapper.js +130 -0
  443. package/src/theme/components/link.js +36 -0
  444. package/src/theme/components/list/list.js +56 -0
  445. package/src/theme/components/list/listItem.js +41 -0
  446. package/src/theme/components/loader/index.js +4 -0
  447. package/src/theme/components/loader/loaderLinear.js +45 -0
  448. package/src/theme/components/loader/loaderRadial.js +57 -0
  449. package/src/theme/components/logo.js +10 -0
  450. package/src/theme/components/mappingsField.js +30 -0
  451. package/src/theme/components/modal.js +19 -0
  452. package/src/theme/components/multiSelectComboBox.js +86 -0
  453. package/src/theme/components/newPassword.js +40 -0
  454. package/src/theme/components/notificationCard.js +54 -0
  455. package/src/theme/components/notpImage.js +10 -0
  456. package/src/theme/components/numberField.js +50 -0
  457. package/src/theme/components/passcode.js +47 -0
  458. package/src/theme/components/password.js +55 -0
  459. package/src/theme/components/phoneField.js +44 -0
  460. package/src/theme/components/phoneInputBoxField.js +50 -0
  461. package/src/theme/components/policyValidation.js +29 -0
  462. package/src/theme/components/radioGroup/radioButton.js +44 -0
  463. package/src/theme/components/radioGroup/radioGroup.js +42 -0
  464. package/src/theme/components/samlGroupMappings.js +20 -0
  465. package/src/theme/components/scopesList.js +15 -0
  466. package/src/theme/components/securityQuestionsSetup.js +12 -0
  467. package/src/theme/components/securityQuestionsVerify.js +16 -0
  468. package/src/theme/components/switchToggle.js +77 -0
  469. package/src/theme/components/textArea.js +48 -0
  470. package/src/theme/components/textField.js +63 -0
  471. package/src/theme/components/thirdPartyAppLogo.js +36 -0
  472. package/src/theme/components/totpImage.js +10 -0
  473. package/src/theme/components/uploadFile.js +66 -0
  474. package/src/theme/components/userAttribute.js +20 -0
  475. package/src/theme/components/userAuthMethod.js +20 -0
  476. package/src/theme/globals.js +181 -0
  477. package/src/theme/index.js +5 -0
@@ -0,0 +1,218 @@
1
+ import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
2
+ import { compose } from '../../helpers';
3
+ import { createStyleMixin, proxyInputMixin, draggableMixin, createProxy } from '../../mixins';
4
+ import { componentName as descopeInternalComponentName } from './descope-new-password-internal/componentName';
5
+ import { PasswordClass } from '../descope-password/PasswordClass';
6
+ import { useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
7
+ import { PolicyValidationClass } from '../descope-policy-validation/PolicyValidationClass';
8
+
9
+ export const componentName = getComponentName('new-password');
10
+
11
+ const policyPreviewVars = PolicyValidationClass.cssVarList;
12
+
13
+ const customMixin = (superclass) =>
14
+ class NewPasswordMixinClass extends superclass {
15
+ init() {
16
+ super.init?.();
17
+
18
+ const template = document.createElement('template');
19
+
20
+ const externalInputAttr = this.getAttribute('external-input');
21
+
22
+ template.innerHTML = `
23
+ <${descopeInternalComponentName}
24
+ name="new-password"
25
+ tabindex="-1"
26
+ slot="input"
27
+ external-input="${externalInputAttr}"
28
+ >
29
+ </${descopeInternalComponentName}>
30
+ `;
31
+
32
+ this.baseElement.appendChild(template.content.cloneNode(true));
33
+
34
+ this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
35
+
36
+ if (this.getAttribute('external-input') === 'true') {
37
+ this.initExternalInput();
38
+ }
39
+
40
+ forwardAttrs(this, this.inputElement, {
41
+ includeAttrs: [
42
+ 'password-label',
43
+ 'password-placeholder',
44
+ 'confirm-label',
45
+ 'confirm-placeholder',
46
+ 'full-width',
47
+ 'size',
48
+ 'bordered',
49
+ 'label',
50
+ 'has-confirm',
51
+ 'invalid',
52
+ 'readonly',
53
+ 'draggable',
54
+ 'has-validation',
55
+ 'policy-label',
56
+ 'active-policies',
57
+ 'available-policies',
58
+ 'data-password-policy-value-minlength',
59
+ 'label-type',
60
+ 'manual-visibility-toggle',
61
+ ],
62
+ });
63
+ }
64
+
65
+ createSlottedExternalInput(node, slotName) {
66
+ const externalInput = node.querySelector('input');
67
+ const slotEle = document.createElement('slot');
68
+
69
+ const targetSlot = externalInput.getAttribute('slot');
70
+
71
+ slotEle.setAttribute('name', slotName);
72
+ slotEle.setAttribute('slot', targetSlot);
73
+
74
+ node.appendChild(slotEle);
75
+
76
+ // move external input
77
+ externalInput.setAttribute('slot', slotName);
78
+ externalInput.setAttribute('name', this.getAttribute('name'));
79
+ externalInput.setAttribute('data-hidden-input', 'true');
80
+
81
+ this.appendChild(externalInput);
82
+ }
83
+
84
+ initExternalInput() {
85
+ // get descope input components
86
+ this.passwordInput = this.inputElement.querySelector('[data-id="password"]');
87
+ this.confirmInput = this.inputElement.querySelector('[data-id="confirm"]');
88
+
89
+ // create slots for external password input
90
+ this.createSlottedExternalInput(this.passwordInput, 'external-password-input');
91
+ this.createSlottedExternalInput(this.confirmInput, 'external-confirm-input');
92
+ }
93
+ };
94
+
95
+ const {
96
+ host,
97
+ label,
98
+ internalInputsWrapper,
99
+ errorMessage,
100
+ helperText,
101
+ passwordInput,
102
+ policyPreview,
103
+ } = {
104
+ host: { selector: () => ':host' },
105
+ label: { selector: '::part(label)' },
106
+ internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },
107
+ helperText: { selector: '::part(helper-text)' },
108
+ errorMessage: { selector: '::part(error-message)' },
109
+ passwordInput: { selector: 'descope-password' },
110
+ policyPreview: { selector: 'descope-policy-validation' },
111
+ };
112
+
113
+ export const NewPasswordClass = compose(
114
+ createStyleMixin({
115
+ mappings: {
116
+ fontSize: [
117
+ host,
118
+ {},
119
+ {
120
+ selector: PasswordClass.componentName,
121
+ property: PasswordClass.cssVarList.fontSize,
122
+ },
123
+ ],
124
+ fontFamily: [label, errorMessage, helperText],
125
+ labelFontSize: { ...label, property: 'font-size' },
126
+ labelFontWeight: { ...label, property: 'font-weight' },
127
+ labelTextColor: { ...label, property: 'color' },
128
+ errorMessageTextColor: { ...errorMessage, property: 'color' },
129
+ errorMessageIcon: { ...errorMessage, property: 'background-image' },
130
+ errorMessageIconSize: { ...errorMessage, property: 'background-size' },
131
+ errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
132
+ errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
133
+ errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
134
+ hostWidth: { ...host, property: 'width' },
135
+ hostMinWidth: { ...host, property: 'min-width' },
136
+ hostDirection: [
137
+ { ...host, property: 'direction' },
138
+ { ...passwordInput, property: PasswordClass.cssVarList.hostDirection },
139
+ ],
140
+ inputsRequiredIndicator: { ...host, property: 'content' },
141
+ spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },
142
+ policyPreviewBackgroundColor: {
143
+ ...policyPreview,
144
+ property: policyPreviewVars.backgroundColor,
145
+ },
146
+ policyPreviewPadding: { ...policyPreview, property: policyPreviewVars.padding },
147
+
148
+ valueInputHeight: { ...passwordInput, property: PasswordClass.cssVarList.valueInputHeight },
149
+ valueInputMarginBottom: {
150
+ ...passwordInput,
151
+ property: PasswordClass.cssVarList.valueInputMarginBottom,
152
+ },
153
+ },
154
+ }),
155
+ draggableMixin,
156
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
157
+ customMixin
158
+ )(
159
+ createProxy({
160
+ slots: [],
161
+ wrappedEleName: 'vaadin-text-field',
162
+ style: () => `
163
+ :host {
164
+ display: inline-block;
165
+ max-width: 100%;
166
+ box-sizing: border-box;
167
+ }
168
+ :host ::part(error-message) {
169
+ direction: ltr;
170
+ }
171
+ ${useHostExternalPadding(PasswordClass.cssVarList)}
172
+ vaadin-text-field {
173
+ padding: 0;
174
+ width: 100%;
175
+ height: 100%;
176
+ }
177
+ vaadin-text-field::part(input-field) {
178
+ min-height: 0;
179
+ background: transparent;
180
+ box-shadow: none;
181
+ padding: 0;
182
+ }
183
+ vaadin-text-field::part(input-field)::after {
184
+ background: transparent;
185
+ opacity: 0;
186
+ }
187
+ descope-new-password-internal {
188
+ -webkit-mask-image: none;
189
+ min-height: 0;
190
+ width: 100%;
191
+ padding: 0;
192
+ }
193
+ descope-new-password-internal > .wrapper {
194
+ -webkit-mask-image: none;
195
+ width: 100%;
196
+ height: 100%;
197
+ display: flex;
198
+ flex-direction: column;
199
+ }
200
+ descope-password {
201
+ display: block;
202
+ width: 100%;
203
+ }
204
+ descope-new-password-internal vaadin-password-field::before {
205
+ height: initial;
206
+ }
207
+ descope-policy-validation {
208
+ margin-top: 8px;
209
+ display: flex;
210
+ }
211
+ descope-policy-validation.hidden {
212
+ display: none;
213
+ }
214
+ `,
215
+ excludeAttrsSync: ['tabindex'],
216
+ componentName,
217
+ })
218
+ );
@@ -0,0 +1,246 @@
1
+ import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';
2
+ import { forwardAttrs, observeAttributes } from '../../../helpers/componentHelpers';
3
+ import { NewPasswordClass } from '../NewPasswordClass';
4
+ import { componentName } from './componentName';
5
+
6
+ const passwordAttrPrefixRegex = /^password-/;
7
+ const confirmAttrPrefixRegex = /^confirm-/;
8
+
9
+ const removeAttrPrefix = (attr, prefix) => attr.replace(prefix, '');
10
+
11
+ const passwordInputAttrs = ['password-label', 'password-placeholder'];
12
+ const confirmInputAttrs = ['confirm-label', 'confirm-placeholder'];
13
+ const policyPanelAttrs = ['has-validation'];
14
+ const commonAttrs = [
15
+ 'has-confirm',
16
+ 'disabled',
17
+ 'bordered',
18
+ 'size',
19
+ 'full-width',
20
+ 'maxlength',
21
+ 'invalid',
22
+ 'readonly',
23
+ 'draggable',
24
+ 'autocomplete',
25
+ 'label-type',
26
+ 'manual-visibility-toggle',
27
+ ];
28
+
29
+ const inputRelatedAttrs = [].concat(
30
+ commonAttrs,
31
+ passwordInputAttrs,
32
+ confirmInputAttrs,
33
+ policyPanelAttrs
34
+ );
35
+
36
+ const BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });
37
+
38
+ class NewPasswordInternal extends BaseInputClass {
39
+ static get observedAttributes() {
40
+ return [].concat(BaseInputClass.observedAttributes || [], inputRelatedAttrs);
41
+ }
42
+
43
+ constructor() {
44
+ super();
45
+
46
+ this.innerHTML = `
47
+ <div class="wrapper"></div>
48
+ `;
49
+
50
+ this.wrapperEle = this.querySelector('.wrapper');
51
+ }
52
+
53
+ get value() {
54
+ return this.passwordInput?.value || '';
55
+ }
56
+
57
+ set value(val) {
58
+ if (val === this.value) return;
59
+ this.value = val;
60
+ }
61
+
62
+ get hasConfirm() {
63
+ return this.getAttribute('has-confirm') === 'true';
64
+ }
65
+
66
+ onHasConfirmChange(hasConfirm) {
67
+ this.confirmInput.style.display = hasConfirm ? '' : 'none';
68
+ }
69
+
70
+ onHasValidationChange(hasValidation) {
71
+ this.policyPanel.style.display = hasValidation ? '' : 'none';
72
+ }
73
+
74
+ get hasValidation() {
75
+ return this.getAttribute('has-validation') === 'true';
76
+ }
77
+
78
+ getValidity() {
79
+ if (this.isRequired && !this.value) {
80
+ return { valueMissing: true };
81
+ }
82
+
83
+ if (this.value && !this.policyPanel.isValid) {
84
+ return { typeMismatch: true };
85
+ }
86
+
87
+ if (this.hasConfirm && this.confirmInput && this.value !== this.confirmInput.value) {
88
+ return { patternMismatch: true };
89
+ }
90
+
91
+ const min = this.getAttribute('minlength');
92
+ const minVal = parseInt(min, 10) || 0;
93
+ const minValid = this.value.length >= minVal;
94
+ if (!minValid) {
95
+ return { tooShort: true };
96
+ }
97
+
98
+ return {};
99
+ }
100
+
101
+ init() {
102
+ this.addEventListener('focus', (e) => {
103
+ // we want to ignore focus events we are dispatching
104
+ if (e.isTrusted) {
105
+ this.passwordInput.focus();
106
+ }
107
+ });
108
+ super.init?.();
109
+ this.renderInputs(this.hasConfirm, this.hasValidation);
110
+ }
111
+
112
+ renderInputs() {
113
+ const hasExternalInput = this.getAttribute('external-input') === 'true';
114
+ const template = `
115
+ <div>
116
+ <descope-password
117
+ autocomplete="new-password"
118
+ manual-visibility-toggle="true"
119
+ data-id="password"
120
+ external-input="${hasExternalInput}"
121
+ ></descope-password>
122
+ <descope-policy-validation></descope-policy-validation>
123
+ </div>
124
+ <descope-password
125
+ autocomplete="new-password"
126
+ manual-visibility-toggle="true"
127
+ external-input="${hasExternalInput}"
128
+ data-id="confirm"
129
+ ></descope-password>
130
+ `;
131
+
132
+ this.wrapperEle.innerHTML = template;
133
+
134
+ this.passwordInput = this.querySelector('[data-id="password"]');
135
+ this.confirmInput = this.querySelector('[data-id="confirm"]');
136
+ this.policyPanel = this.querySelector('descope-policy-validation');
137
+
138
+ this.inputs = [this.passwordInput, this.confirmInput];
139
+
140
+ this.initInputs();
141
+
142
+ // sync input value to policy validation panel
143
+ this.passwordInput.addEventListener('input', (e) => {
144
+ this.policyPanel.setAttribute('value', e.target.value);
145
+ });
146
+
147
+ forwardAttrs(this, this.policyPanel, {
148
+ includeAttrs: [
149
+ 'policy-label',
150
+ 'available-policies',
151
+ 'active-policies',
152
+ 'data-password-policy-value-minlength',
153
+ 'manual-visibility-toggle',
154
+ ],
155
+ mapAttrs: {
156
+ 'policy-label': 'label',
157
+ 'available-policies': 'data',
158
+ },
159
+ });
160
+ }
161
+
162
+ // the inputs are not required but we still want it to have a required
163
+ // indicator in case the root component is required
164
+ handleIndicatorStyle() {
165
+ this.inputs.forEach((input) => {
166
+ const styleTag = document.createElement('style');
167
+ styleTag.innerHTML = `
168
+ :host ::part(required-indicator)::after {
169
+ content: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});
170
+ width: 1em;
171
+ text-align: center;
172
+ }
173
+ :host ::part(required-indicator) {
174
+ display: inline-flex;
175
+ }
176
+ `;
177
+ input?.shadowRoot.appendChild(styleTag);
178
+ });
179
+ }
180
+
181
+ get isInvalid() {
182
+ return this.hasAttribute('invalid') && this.getAttribute('invalid') !== 'false';
183
+ }
184
+
185
+ // for some reason, Vaadin is removing the invalid attribute on several events,
186
+ // e.g. focus, input, etc..., so we need to make sure the inputs will stay invalid
187
+ // if the root component is invalid
188
+ handleInputsInvalidAttribute() {
189
+ this.inputs.forEach((input) => {
190
+ input &&
191
+ observeAttributes(
192
+ input,
193
+ (changedAttributes) => {
194
+ if (changedAttributes.includes('invalid')) {
195
+ const inputInvalidValue = input.getAttribute('invalid');
196
+ const rootInvalidValue = this.getAttribute('invalid');
197
+
198
+ if (this.isInvalid && rootInvalidValue !== inputInvalidValue) {
199
+ input.setAttribute('invalid', 'true');
200
+ }
201
+ }
202
+ },
203
+ {}
204
+ );
205
+ });
206
+ }
207
+
208
+ initInputs() {
209
+ this.handleIndicatorStyle();
210
+ this.handleInputsInvalidAttribute();
211
+ this.handleFocusEventsDispatching(this.inputs);
212
+ }
213
+
214
+ // eslint-disable-next-line class-methods-use-this
215
+ toggleBooleanAttribute(ele, name, value) {
216
+ value === null ? ele?.removeAttribute(name) : ele?.setAttribute(name, value);
217
+ }
218
+
219
+ attributeChangedCallback(attrName, oldValue, newValue) {
220
+ super.attributeChangedCallback?.(attrName, oldValue, newValue);
221
+
222
+ if (oldValue !== newValue) {
223
+ if (attrName === 'has-validation') {
224
+ this.onHasValidationChange(newValue === 'true');
225
+ } else if (attrName === 'has-confirm') {
226
+ this.onHasConfirmChange(newValue === 'true');
227
+ } else if (commonAttrs.includes(attrName)) {
228
+ this.inputs.forEach((input) => this.toggleBooleanAttribute(input, attrName, newValue));
229
+ } else if (passwordInputAttrs.includes(attrName)) {
230
+ this.toggleBooleanAttribute(
231
+ this.passwordInput,
232
+ removeAttrPrefix(attrName, passwordAttrPrefixRegex),
233
+ newValue
234
+ );
235
+ } else if (confirmInputAttrs.includes(attrName)) {
236
+ this.toggleBooleanAttribute(
237
+ this.confirmInput,
238
+ removeAttrPrefix(attrName, confirmAttrPrefixRegex),
239
+ newValue
240
+ );
241
+ }
242
+ }
243
+ }
244
+ }
245
+
246
+ export default NewPasswordInternal;
@@ -0,0 +1,3 @@
1
+ import { getComponentName } from '../../../helpers/componentHelpers';
2
+
3
+ export const componentName = getComponentName('new-password-internal');
@@ -0,0 +1,4 @@
1
+ import NewPasswordInternal from './NewPasswordInternal';
2
+ import { componentName } from './componentName';
3
+
4
+ customElements.define(componentName, NewPasswordInternal);
@@ -0,0 +1,9 @@
1
+ import { componentName, NewPasswordClass } from './NewPasswordClass';
2
+ import '../descope-text-field';
3
+ import '../descope-password';
4
+ import '../descope-policy-validation';
5
+ import './descope-new-password-internal';
6
+
7
+ customElements.define(componentName, NewPasswordClass);
8
+
9
+ export { NewPasswordClass };
@@ -0,0 +1,107 @@
1
+ import { compose } from '../../helpers';
2
+ import { forwardAttrs, getComponentName, syncAttrs } from '../../helpers/componentHelpers';
3
+ import {
4
+ draggableMixin,
5
+ createProxy,
6
+ componentNameValidationMixin,
7
+ hoverableMixin,
8
+ } from '../../mixins';
9
+
10
+ export const componentName = getComponentName('notification');
11
+
12
+ const NotificationMixin = (superclass) =>
13
+ class NotificationMixinClass extends superclass {
14
+ #card;
15
+
16
+ constructor() {
17
+ super();
18
+
19
+ const that = this;
20
+
21
+ Object.defineProperty(this.baseElement, '_container', {
22
+ get() {
23
+ if (!NotificationMixinClass._container) {
24
+ NotificationMixinClass._container = document.createElement(
25
+ 'descope-notification-container'
26
+ );
27
+
28
+ // we are overriding the container position to be absolute because we want to keep in inside the flow/widget boundaries
29
+ NotificationMixinClass._container.style.position = 'absolute';
30
+
31
+ // we're adding the container to body to avoid Vaadin's container's `openChanged`
32
+ // from breaking when trying to remove it directly from the body.
33
+ document.body.appendChild(NotificationMixinClass._container);
34
+ }
35
+
36
+ if (!NotificationMixinClass._container.isConnected) {
37
+ // Then, we're adding the container to the parentNode, which is the desired location
38
+ // for us on the DOM
39
+ setTimeout(() => that.parentNode.appendChild(NotificationMixinClass._container));
40
+ }
41
+
42
+ return NotificationMixinClass._container;
43
+ },
44
+ });
45
+
46
+ Object.defineProperty(this.baseElement, '_card', {
47
+ get() {
48
+ return that.#card;
49
+ },
50
+ });
51
+
52
+ // we want to replace the card with vaadin's remove notification so it will not throw
53
+ this.baseElement._removeNotificationCard = this.close.bind(this);
54
+ }
55
+
56
+ close() {
57
+ this.#card.close();
58
+ }
59
+
60
+ init() {
61
+ super.init?.();
62
+
63
+ this.createCard();
64
+
65
+ forwardAttrs(this, this.#card);
66
+ syncAttrs(this.#card, this, { includeAttrs: ['opened'] });
67
+
68
+ this.baseElement.renderer = (cardRoot) => {
69
+ Array.from(this.childNodes).forEach((child) => cardRoot.appendChild(child));
70
+ };
71
+ }
72
+
73
+ // eslint-disable-next-line class-methods-use-this
74
+ get isContainerEmpty() {
75
+ return !NotificationMixinClass._container.children.length;
76
+ }
77
+
78
+ // eslint-disable-next-line class-methods-use-this
79
+ removeContainer() {
80
+ NotificationMixinClass._container.remove();
81
+ }
82
+
83
+ removeNotification() {
84
+ // remove descope-notification from the DOM
85
+ this.remove();
86
+ // if needed, remove descope-notification-container
87
+ if (this.isContainerEmpty) this.removeContainer();
88
+ }
89
+
90
+ createCard() {
91
+ this.#card = document.createElement('descope-notification-card');
92
+ this.#card.addEventListener('card-closed', this.removeNotification.bind(this));
93
+ }
94
+ };
95
+
96
+ export const NotificationClass = compose(
97
+ draggableMixin,
98
+ componentNameValidationMixin,
99
+ hoverableMixin,
100
+ NotificationMixin
101
+ )(
102
+ createProxy({
103
+ wrappedEleName: 'vaadin-notification',
104
+ excludeAttrsSync: ['tabindex'],
105
+ componentName,
106
+ })
107
+ );
@@ -0,0 +1,115 @@
1
+ import { compose } from '../../../helpers';
2
+ import { getComponentName } from '../../../helpers/componentHelpers';
3
+ import { createStyleMixin, createProxy } from '../../../mixins';
4
+
5
+ export const componentName = getComponentName('notification-card');
6
+
7
+ const notificationCardMixin = (superclass) =>
8
+ class NotificationCardMixinClass extends superclass {
9
+ close() {
10
+ // if animation is not applied to the element, the node will not be removed
11
+ // from the DOM. We should avoid that. So, if in any case we allow
12
+ // customizing the animation - we should check if animation is applied
13
+ // and if it's not applied - remove the element from the DOM and dispatch
14
+ // `card-closed` event.
15
+ this.baseElement.addEventListener('animationend', () => {
16
+ this.remove();
17
+ this.dispatchEvent(new Event('card-closed'));
18
+ });
19
+
20
+ this.setAttribute('opened', 'false');
21
+ }
22
+
23
+ constructor() {
24
+ super();
25
+
26
+ this.baseElement.innerHTML = `
27
+ <div part="root">
28
+ <div part="content">
29
+ <slot></slot>
30
+ </div>
31
+ <div part="close">
32
+ <slot name="close"></slot>
33
+ </div>
34
+ </div>
35
+ `;
36
+
37
+ this.closeEle = this.shadowRoot.querySelector('[part="close"]');
38
+ }
39
+
40
+ init() {
41
+ super.init?.();
42
+
43
+ this.closeEle.onclick = () => {
44
+ this.close();
45
+ };
46
+ }
47
+ };
48
+
49
+ const selectors = {
50
+ content: () => 'vaadin-notification-card::part(content)',
51
+ overlay: () => 'vaadin-notification-card::part(overlay)',
52
+ };
53
+
54
+ export const NotificationCardClass = compose(
55
+ createStyleMixin({
56
+ mappings: {
57
+ hostMinWidth: { selector: selectors.content, property: 'min-width' },
58
+ fontFamily: {},
59
+ fontSize: {},
60
+ backgroundColor: { selector: selectors.content },
61
+ textColor: { property: 'color' },
62
+ boxShadow: {},
63
+ borderWidth: { selector: selectors.content, property: 'border-width' },
64
+ borderColor: { selector: selectors.content, property: 'border-color' },
65
+ borderStyle: { selector: selectors.content, property: 'border-style' },
66
+ borderRadius: [
67
+ { selector: selectors.content, property: 'border-radius' },
68
+ { selector: selectors.overlay, property: 'border-radius' },
69
+ ],
70
+ verticalPadding: [
71
+ { selector: selectors.content, property: 'padding-top' },
72
+ { selector: selectors.content, property: 'padding-bottom' },
73
+ ],
74
+ horizontalPadding: [
75
+ { selector: selectors.content, property: 'padding-right' },
76
+ { selector: selectors.content, property: 'padding-left' },
77
+ ],
78
+ },
79
+ }),
80
+ notificationCardMixin
81
+ )(
82
+ createProxy({
83
+ slots: [],
84
+ wrappedEleName: 'vaadin-notification-card',
85
+ style: () => `
86
+ vaadin-notification-card {
87
+ box-shadow: none;
88
+ }
89
+ ::part(overlay) {
90
+ box-shadow: none;
91
+ background: none;
92
+ }
93
+
94
+ [part="close"] {
95
+ cursor: pointer;
96
+ display: flex;
97
+ }
98
+
99
+ [part="content"] {
100
+ display: flex;
101
+ align-items: center;
102
+ flex-grow: 1;
103
+ }
104
+
105
+ [part="root"] {
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: space-between;
109
+ width: 100%;
110
+ }
111
+ `,
112
+ excludeAttrsSync: ['tabindex'],
113
+ componentName,
114
+ })
115
+ );