@ptcwebops/ptcw-design 0.5.1 → 0.5.3

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 (314) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/icon-asset.cjs.entry.js +54 -54
  3. package/dist/cjs/{interfaces-0ecd8027.js → interfaces-574e6df7.js} +9 -9
  4. package/dist/cjs/list-item.cjs.entry.js +20 -20
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/lottie-player.cjs.entry.js +354 -354
  7. package/dist/cjs/my-component.cjs.entry.js +13 -13
  8. package/dist/cjs/ptc-announcement_2.cjs.entry.js +114 -114
  9. package/dist/cjs/ptc-breadcrumb.cjs.entry.js +13 -13
  10. package/dist/cjs/ptc-button.cjs.entry.js +66 -66
  11. package/dist/cjs/ptc-card-bottom.cjs.entry.js +32 -32
  12. package/dist/cjs/ptc-card-content.cjs.entry.js +32 -32
  13. package/dist/cjs/ptc-card-plm.cjs.entry.js +17 -17
  14. package/dist/cjs/ptc-card.cjs.entry.js +69 -69
  15. package/dist/cjs/ptc-date.cjs.entry.js +49 -49
  16. package/dist/cjs/ptc-hero-footer-cta.cjs.entry.js +9 -9
  17. package/dist/cjs/ptc-hero.cjs.entry.js +19 -19
  18. package/dist/cjs/ptc-icon-list.cjs.entry.js +33 -33
  19. package/dist/cjs/ptc-img_2.cjs.entry.js +171 -171
  20. package/dist/cjs/ptc-link.cjs.entry.js +43 -43
  21. package/dist/cjs/ptc-list.cjs.entry.js +24 -21
  22. package/dist/cjs/ptc-lottie.cjs.entry.js +12 -12
  23. package/dist/cjs/ptc-minimized-footer.cjs.entry.js +9 -9
  24. package/dist/cjs/ptc-minimized-header.cjs.entry.js +12 -12
  25. package/dist/cjs/ptc-mobile-select.cjs.entry.js +70 -70
  26. package/dist/cjs/ptc-modal.cjs.entry.js +107 -104
  27. package/dist/cjs/ptc-nav-item.cjs.entry.js +84 -84
  28. package/dist/cjs/ptc-nav.cjs.entry.js +9 -9
  29. package/dist/cjs/ptc-para.cjs.entry.js +40 -40
  30. package/dist/cjs/ptc-picture.cjs.entry.js +170 -170
  31. package/dist/cjs/ptc-previous-url.cjs.entry.js +9 -9
  32. package/dist/cjs/ptc-quote.cjs.entry.js +26 -26
  33. package/dist/cjs/ptc-responsive-wrapper.cjs.entry.js +54 -54
  34. package/dist/cjs/ptc-social-share.cjs.entry.js +65 -65
  35. package/dist/cjs/ptc-spacer.cjs.entry.js +35 -35
  36. package/dist/cjs/ptc-span.cjs.entry.js +24 -24
  37. package/dist/cjs/ptc-title.cjs.entry.js +49 -45
  38. package/dist/cjs/ptc-two-column-media.cjs.entry.js +15 -15
  39. package/dist/cjs/ptcw-design.cjs.js +1 -1
  40. package/dist/collection/collection-manifest.json +0 -5
  41. package/dist/collection/components/icon-asset/icon-asset.css +26 -1399
  42. package/dist/collection/components/icon-asset/icon-asset.js +199 -199
  43. package/dist/collection/components/icon-asset/media/brands.svg +1381 -1381
  44. package/dist/collection/components/icon-asset/media/designer.svg +327 -327
  45. package/dist/collection/components/icon-asset/media/regular.svg +463 -463
  46. package/dist/collection/components/icon-asset/media/solid.svg +3013 -3013
  47. package/dist/collection/components/icon-asset/media/svg-with-js.min.css +4 -4
  48. package/dist/collection/components/list-item/list-item.css +16 -1409
  49. package/dist/collection/components/list-item/list-item.js +103 -103
  50. package/dist/collection/components/my-component/my-component.css +3 -3
  51. package/dist/collection/components/my-component/my-component.js +73 -73
  52. package/dist/collection/components/ptc-announcement/ptc-announcement.css +37 -1433
  53. package/dist/collection/components/ptc-announcement/ptc-announcement.js +210 -210
  54. package/dist/collection/components/ptc-breadcrumb/ptc-breadcrumb.css +1 -1394
  55. package/dist/collection/components/ptc-breadcrumb/ptc-breadcrumb.js +21 -21
  56. package/dist/collection/components/ptc-button/ptc-button.css +59 -1452
  57. package/dist/collection/components/ptc-button/ptc-button.js +293 -293
  58. package/dist/collection/components/ptc-card/ptc-card.css +43 -1436
  59. package/dist/collection/components/ptc-card/ptc-card.js +282 -282
  60. package/dist/collection/components/ptc-card-bottom/ptc-card-bottom.css +5 -1398
  61. package/dist/collection/components/ptc-card-bottom/ptc-card-bottom.js +105 -105
  62. package/dist/collection/components/ptc-card-content/ptc-card-content.css +25 -1418
  63. package/dist/collection/components/ptc-card-content/ptc-card-content.js +105 -105
  64. package/dist/collection/components/ptc-card-plm/ptc-card-plm.css +12 -1404
  65. package/dist/collection/components/ptc-card-plm/ptc-card-plm.js +97 -97
  66. package/dist/collection/components/ptc-date/ptc-date.css +3 -1396
  67. package/dist/collection/components/ptc-date/ptc-date.js +201 -201
  68. package/dist/collection/components/ptc-hero/ptc-hero.css +0 -1393
  69. package/dist/collection/components/ptc-hero/ptc-hero.js +67 -67
  70. package/dist/collection/components/ptc-hero-footer-cta/ptc-hero-footer-cta.css +17 -1412
  71. package/dist/collection/components/ptc-hero-footer-cta/ptc-hero-footer-cta.js +77 -77
  72. package/dist/collection/components/ptc-icon-list/ptc-icon-list.css +16 -1407
  73. package/dist/collection/components/ptc-icon-list/ptc-icon-list.js +145 -145
  74. package/dist/collection/components/ptc-img/ptc-img.css +7 -1404
  75. package/dist/collection/components/ptc-img/ptc-img.js +314 -314
  76. package/dist/collection/components/ptc-link/ptc-link.css +47 -1440
  77. package/dist/collection/components/ptc-link/ptc-link.js +198 -198
  78. package/dist/collection/components/ptc-list/ptc-list.css +3 -1396
  79. package/dist/collection/components/ptc-list/ptc-list.js +68 -63
  80. package/dist/collection/components/ptc-lottie/ptc-lottie.css +5 -5
  81. package/dist/collection/components/ptc-lottie/ptc-lottie.js +58 -58
  82. package/dist/collection/components/ptc-minimized-footer/ptc-minimized-footer.css +4 -1398
  83. package/dist/collection/components/ptc-minimized-footer/ptc-minimized-footer.js +17 -17
  84. package/dist/collection/components/ptc-minimized-header/ptc-minimized-header.css +12 -1405
  85. package/dist/collection/components/ptc-minimized-header/ptc-minimized-header.js +80 -80
  86. package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.css +8 -1401
  87. package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.js +221 -221
  88. package/dist/collection/components/ptc-modal/ptc-modal.css +6 -1399
  89. package/dist/collection/components/ptc-modal/ptc-modal.js +255 -252
  90. package/dist/collection/components/ptc-nav/ptc-nav.css +1 -1394
  91. package/dist/collection/components/ptc-nav/ptc-nav.js +21 -21
  92. package/dist/collection/components/ptc-nav-item/ptc-nav-item.css +9 -1402
  93. package/dist/collection/components/ptc-nav-item/ptc-nav-item.js +252 -252
  94. package/dist/collection/components/ptc-overlay/ptc-overlay.css +14 -1415
  95. package/dist/collection/components/ptc-overlay/ptc-overlay.js +99 -99
  96. package/dist/collection/components/ptc-para/ptc-para.css +9 -1417
  97. package/dist/collection/components/ptc-para/ptc-para.js +157 -157
  98. package/dist/collection/components/ptc-picture/ptc-picture.css +3 -1404
  99. package/dist/collection/components/ptc-picture/ptc-picture.js +474 -474
  100. package/dist/collection/components/ptc-previous-url/ptc-previous-url.css +4 -1397
  101. package/dist/collection/components/ptc-previous-url/ptc-previous-url.js +54 -54
  102. package/dist/collection/components/ptc-quote/ptc-quote.css +18 -1409
  103. package/dist/collection/components/ptc-quote/ptc-quote.js +154 -154
  104. package/dist/collection/components/ptc-responsive-wrapper/ptc-responsive-wrapper.css +3 -3
  105. package/dist/collection/components/ptc-responsive-wrapper/ptc-responsive-wrapper.js +62 -62
  106. package/dist/collection/components/ptc-social-share/ptc-social-share.css +2 -1395
  107. package/dist/collection/components/ptc-social-share/ptc-social-share.js +206 -206
  108. package/dist/collection/components/ptc-spacer/ptc-spacer.css +322 -322
  109. package/dist/collection/components/ptc-spacer/ptc-spacer.js +99 -99
  110. package/dist/collection/components/ptc-span/ptc-span.css +9 -1402
  111. package/dist/collection/components/ptc-span/ptc-span.js +89 -89
  112. package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.css +9 -1403
  113. package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.js +71 -71
  114. package/dist/collection/components/ptc-title/ptc-title.css +32 -1419
  115. package/dist/collection/components/ptc-title/ptc-title.js +236 -231
  116. package/dist/collection/components/ptc-two-column-media/ptc-two-column-media.css +1 -1394
  117. package/dist/collection/components/ptc-two-column-media/ptc-two-column-media.js +40 -40
  118. package/dist/collection/index.js +1 -1
  119. package/dist/collection/media/svg-imgs/Back-arrow.svg +11 -11
  120. package/dist/collection/media/svg-imgs/close.svg +10 -10
  121. package/dist/collection/media/svg-imgs/slider-arrow-left.svg +18 -18
  122. package/dist/collection/media/svg-imgs/slider-arrow-right.svg +18 -18
  123. package/dist/collection/utils/interfaces.js +11 -11
  124. package/dist/collection/utils/utils.js +3 -3
  125. package/dist/custom-elements/index.d.ts +0 -30
  126. package/dist/custom-elements/index.js +2003 -2196
  127. package/dist/esm/icon-asset.entry.js +54 -54
  128. package/dist/esm/{interfaces-c1c73092.js → interfaces-7c0243be.js} +9 -9
  129. package/dist/esm/list-item.entry.js +20 -20
  130. package/dist/esm/loader.js +1 -1
  131. package/dist/esm/lottie-player.entry.js +354 -354
  132. package/dist/esm/my-component.entry.js +13 -13
  133. package/dist/esm/polyfills/core-js.js +0 -0
  134. package/dist/esm/polyfills/dom.js +0 -0
  135. package/dist/esm/polyfills/es5-html-element.js +0 -0
  136. package/dist/esm/polyfills/index.js +0 -0
  137. package/dist/esm/polyfills/system.js +0 -0
  138. package/dist/esm/ptc-announcement_2.entry.js +114 -114
  139. package/dist/esm/ptc-breadcrumb.entry.js +13 -13
  140. package/dist/esm/ptc-button.entry.js +66 -66
  141. package/dist/esm/ptc-card-bottom.entry.js +32 -32
  142. package/dist/esm/ptc-card-content.entry.js +32 -32
  143. package/dist/esm/ptc-card-plm.entry.js +17 -17
  144. package/dist/esm/ptc-card.entry.js +69 -69
  145. package/dist/esm/ptc-date.entry.js +49 -49
  146. package/dist/esm/ptc-hero-footer-cta.entry.js +9 -9
  147. package/dist/esm/ptc-hero.entry.js +19 -19
  148. package/dist/esm/ptc-icon-list.entry.js +33 -33
  149. package/dist/esm/ptc-img_2.entry.js +171 -171
  150. package/dist/esm/ptc-link.entry.js +43 -43
  151. package/dist/esm/ptc-list.entry.js +24 -21
  152. package/dist/esm/ptc-lottie.entry.js +12 -12
  153. package/dist/esm/ptc-minimized-footer.entry.js +9 -9
  154. package/dist/esm/ptc-minimized-header.entry.js +12 -12
  155. package/dist/esm/ptc-mobile-select.entry.js +70 -70
  156. package/dist/esm/ptc-modal.entry.js +107 -104
  157. package/dist/esm/ptc-nav-item.entry.js +84 -84
  158. package/dist/esm/ptc-nav.entry.js +9 -9
  159. package/dist/esm/ptc-para.entry.js +40 -40
  160. package/dist/esm/ptc-picture.entry.js +170 -170
  161. package/dist/esm/ptc-previous-url.entry.js +9 -9
  162. package/dist/esm/ptc-quote.entry.js +26 -26
  163. package/dist/esm/ptc-responsive-wrapper.entry.js +54 -54
  164. package/dist/esm/ptc-social-share.entry.js +65 -65
  165. package/dist/esm/ptc-spacer.entry.js +35 -35
  166. package/dist/esm/ptc-span.entry.js +24 -24
  167. package/dist/esm/ptc-title.entry.js +49 -45
  168. package/dist/esm/ptc-two-column-media.entry.js +15 -15
  169. package/dist/esm/ptcw-design.js +1 -1
  170. package/dist/ptcw-design/media/brands.svg +1381 -1381
  171. package/dist/ptcw-design/media/designer.svg +327 -327
  172. package/dist/ptcw-design/media/regular.svg +463 -463
  173. package/dist/ptcw-design/media/solid.svg +3013 -3013
  174. package/dist/ptcw-design/media/svg-with-js.min.css +4 -4
  175. package/dist/ptcw-design/p-009537ea.entry.js +1 -0
  176. package/dist/ptcw-design/p-18d0d10a.entry.js +7 -0
  177. package/dist/ptcw-design/p-204a78ce.entry.js +1 -0
  178. package/dist/ptcw-design/p-28174fbe.entry.js +1 -0
  179. package/dist/ptcw-design/p-2a1808f8.entry.js +1 -0
  180. package/dist/ptcw-design/p-2b3a38c3.entry.js +1 -0
  181. package/dist/ptcw-design/p-37ffbdf2.entry.js +1 -0
  182. package/dist/ptcw-design/p-612f7224.entry.js +1 -0
  183. package/dist/ptcw-design/p-64d01929.entry.js +1 -0
  184. package/dist/ptcw-design/p-7133275c.entry.js +1 -0
  185. package/dist/ptcw-design/p-781aacb7.entry.js +1 -0
  186. package/dist/ptcw-design/p-796b4a16.entry.js +1 -0
  187. package/dist/ptcw-design/p-7bcc42e1.entry.js +1 -0
  188. package/dist/ptcw-design/p-8c6b8bc9.entry.js +1 -0
  189. package/dist/ptcw-design/p-90423b6f.entry.js +1 -0
  190. package/dist/ptcw-design/p-a9e7cd3e.entry.js +1 -0
  191. package/dist/ptcw-design/p-b79303ef.entry.js +1 -0
  192. package/dist/ptcw-design/p-c13f31f6.entry.js +1 -0
  193. package/dist/ptcw-design/p-c5951736.entry.js +1 -0
  194. package/dist/ptcw-design/p-cd7119b8.entry.js +1 -0
  195. package/dist/ptcw-design/p-cec492a8.entry.js +1 -0
  196. package/dist/ptcw-design/p-d2ef4221.entry.js +1 -0
  197. package/dist/ptcw-design/p-d64c3892.entry.js +1 -0
  198. package/dist/ptcw-design/p-dbf3779e.entry.js +1 -0
  199. package/dist/ptcw-design/p-dc18ae76.entry.js +1 -0
  200. package/dist/ptcw-design/p-df80470b.entry.js +1 -0
  201. package/dist/ptcw-design/p-ec10f846.entry.js +1 -0
  202. package/dist/ptcw-design/p-f32f9817.entry.js +1 -0
  203. package/dist/ptcw-design/p-fa53e5e5.entry.js +1 -0
  204. package/dist/ptcw-design/p-fe957cbf.entry.js +1 -0
  205. package/dist/ptcw-design/ptcw-design.css +2 -3
  206. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  207. package/dist/types/components/icon-asset/icon-asset.d.ts +36 -36
  208. package/dist/types/components/list-item/list-item.d.ts +8 -8
  209. package/dist/types/components/my-component/my-component.d.ts +16 -16
  210. package/dist/types/components/ptc-announcement/ptc-announcement.d.ts +43 -43
  211. package/dist/types/components/ptc-breadcrumb/ptc-breadcrumb.d.ts +4 -4
  212. package/dist/types/components/ptc-button/ptc-button.d.ts +56 -56
  213. package/dist/types/components/ptc-card/ptc-card.d.ts +50 -50
  214. package/dist/types/components/ptc-card-bottom/ptc-card-bottom.d.ts +15 -15
  215. package/dist/types/components/ptc-card-content/ptc-card-content.d.ts +15 -15
  216. package/dist/types/components/ptc-card-plm/ptc-card-plm.d.ts +8 -8
  217. package/dist/types/components/ptc-date/ptc-date.d.ts +41 -41
  218. package/dist/types/components/ptc-hero/ptc-hero.d.ts +12 -12
  219. package/dist/types/components/ptc-hero-footer-cta/ptc-hero-footer-cta.d.ts +6 -6
  220. package/dist/types/components/ptc-icon-list/ptc-icon-list.d.ts +21 -21
  221. package/dist/types/components/ptc-img/ptc-img.d.ts +51 -51
  222. package/dist/types/components/ptc-link/ptc-link.d.ts +36 -36
  223. package/dist/types/components/ptc-list/ptc-list.d.ts +6 -6
  224. package/dist/types/components/ptc-lottie/ptc-lottie.d.ts +12 -12
  225. package/dist/types/components/ptc-minimized-footer/ptc-minimized-footer.d.ts +3 -3
  226. package/dist/types/components/ptc-minimized-header/ptc-minimized-header.d.ts +6 -6
  227. package/dist/types/components/ptc-mobile-select/ptc-mobile-select.d.ts +40 -40
  228. package/dist/types/components/ptc-modal/ptc-modal.d.ts +46 -46
  229. package/dist/types/components/ptc-nav/ptc-nav.d.ts +3 -3
  230. package/dist/types/components/ptc-nav-item/ptc-nav-item.d.ts +53 -53
  231. package/dist/types/components/ptc-overlay/ptc-overlay.d.ts +20 -20
  232. package/dist/types/components/ptc-para/ptc-para.d.ts +28 -28
  233. package/dist/types/components/ptc-picture/ptc-picture.d.ts +93 -93
  234. package/dist/types/components/ptc-previous-url/ptc-previous-url.d.ts +5 -5
  235. package/dist/types/components/ptc-quote/ptc-quote.d.ts +29 -29
  236. package/dist/types/components/ptc-responsive-wrapper/ptc-responsive-wrapper.d.ts +8 -8
  237. package/dist/types/components/ptc-social-share/ptc-social-share.d.ts +25 -25
  238. package/dist/types/components/ptc-spacer/ptc-spacer.d.ts +16 -16
  239. package/dist/types/components/ptc-span/ptc-span.d.ts +16 -16
  240. package/dist/types/components/ptc-svg-btn/ptc-svg-btn.d.ts +12 -12
  241. package/dist/types/components/ptc-title/ptc-title.d.ts +41 -41
  242. package/dist/types/components/ptc-two-column-media/ptc-two-column-media.d.ts +9 -9
  243. package/dist/types/components.d.ts +42 -131
  244. package/dist/types/global.d.ts +1072 -1072
  245. package/dist/types/index.d.ts +1 -1
  246. package/dist/types/utils/interfaces.d.ts +14 -14
  247. package/dist/types/utils/utils.d.ts +1 -1
  248. package/package.json +59 -59
  249. package/readme.md +11 -11
  250. package/dist/cjs/ptc-countdown.cjs.entry.js +0 -19
  251. package/dist/cjs/ptc-footer.cjs.entry.js +0 -19
  252. package/dist/cjs/ptc-form.cjs.entry.js +0 -117
  253. package/dist/cjs/ptc-input.cjs.entry.js +0 -31
  254. package/dist/cjs/ptc-select.cjs.entry.js +0 -35
  255. package/dist/collection/components/ptc-countdown/ptc-countdown.css +0 -1396
  256. package/dist/collection/components/ptc-countdown/ptc-countdown.js +0 -15
  257. package/dist/collection/components/ptc-footer/ptc-footer.css +0 -1433
  258. package/dist/collection/components/ptc-footer/ptc-footer.js +0 -25
  259. package/dist/collection/components/ptc-form/ptc-form.css +0 -1396
  260. package/dist/collection/components/ptc-form/ptc-form.js +0 -118
  261. package/dist/collection/components/ptc-form/validation/FormValidation.full.min.js +0 -1
  262. package/dist/collection/components/ptc-form/validation/FormValidation.js +0 -4234
  263. package/dist/collection/components/ptc-input/ptc-input.css +0 -1440
  264. package/dist/collection/components/ptc-input/ptc-input.js +0 -133
  265. package/dist/collection/components/ptc-select/ptc-select.css +0 -1415
  266. package/dist/collection/components/ptc-select/ptc-select.js +0 -105
  267. package/dist/esm/ptc-countdown.entry.js +0 -15
  268. package/dist/esm/ptc-footer.entry.js +0 -15
  269. package/dist/esm/ptc-form.entry.js +0 -113
  270. package/dist/esm/ptc-input.entry.js +0 -27
  271. package/dist/esm/ptc-select.entry.js +0 -31
  272. package/dist/ptcw-design/p-0494a6ee.entry.js +0 -1
  273. package/dist/ptcw-design/p-0a146d61.entry.js +0 -1
  274. package/dist/ptcw-design/p-0e7be5b7.entry.js +0 -1
  275. package/dist/ptcw-design/p-1cd1d3d8.entry.js +0 -1
  276. package/dist/ptcw-design/p-24b1823f.entry.js +0 -1
  277. package/dist/ptcw-design/p-3a8b4686.entry.js +0 -1
  278. package/dist/ptcw-design/p-56460bb4.entry.js +0 -1
  279. package/dist/ptcw-design/p-58a9ce3c.entry.js +0 -1
  280. package/dist/ptcw-design/p-614dcc3f.entry.js +0 -1
  281. package/dist/ptcw-design/p-67d35eea.entry.js +0 -1
  282. package/dist/ptcw-design/p-69e30829.entry.js +0 -1
  283. package/dist/ptcw-design/p-6c70abcd.entry.js +0 -1
  284. package/dist/ptcw-design/p-714999f9.entry.js +0 -1
  285. package/dist/ptcw-design/p-7281746f.entry.js +0 -7
  286. package/dist/ptcw-design/p-751e1cb4.entry.js +0 -1
  287. package/dist/ptcw-design/p-8850288e.entry.js +0 -1
  288. package/dist/ptcw-design/p-8f989bd5.entry.js +0 -1
  289. package/dist/ptcw-design/p-902942fe.entry.js +0 -1
  290. package/dist/ptcw-design/p-95f95730.entry.js +0 -1
  291. package/dist/ptcw-design/p-97e626e9.entry.js +0 -1
  292. package/dist/ptcw-design/p-97edf10d.entry.js +0 -1
  293. package/dist/ptcw-design/p-99db01b4.entry.js +0 -1
  294. package/dist/ptcw-design/p-9b7119b1.entry.js +0 -1
  295. package/dist/ptcw-design/p-9c88bc75.entry.js +0 -1
  296. package/dist/ptcw-design/p-a4d9b28c.entry.js +0 -1
  297. package/dist/ptcw-design/p-c5063e59.entry.js +0 -1
  298. package/dist/ptcw-design/p-c738f20a.entry.js +0 -1
  299. package/dist/ptcw-design/p-cf43befa.entry.js +0 -1
  300. package/dist/ptcw-design/p-cf92c175.entry.js +0 -1
  301. package/dist/ptcw-design/p-d04d0530.entry.js +0 -1
  302. package/dist/ptcw-design/p-d625b127.entry.js +0 -1
  303. package/dist/ptcw-design/p-d97f4152.entry.js +0 -1
  304. package/dist/ptcw-design/p-e4ac4e8e.entry.js +0 -1
  305. package/dist/ptcw-design/p-f389d773.entry.js +0 -1
  306. package/dist/ptcw-design/p-f3f455bc.entry.js +0 -1
  307. package/dist/ptcw-design/validation/FormValidation.full.min.js +0 -1
  308. package/dist/ptcw-design/validation/FormValidation.js +0 -4234
  309. package/dist/types/components/ptc-countdown/ptc-countdown.d.ts +0 -3
  310. package/dist/types/components/ptc-footer/ptc-footer.d.ts +0 -3
  311. package/dist/types/components/ptc-form/ptc-form.d.ts +0 -11
  312. package/dist/types/components/ptc-input/ptc-input.d.ts +0 -19
  313. package/dist/types/components/ptc-select/ptc-select.d.ts +0 -9
  314. /package/dist/ptcw-design/{p-50e52c88.js → p-ee1183b2.js} +0 -0
@@ -1,1072 +1,1072 @@
1
- /**
2
- * FormValidation (https://formvalidation.io)
3
- * The best validation library for JavaScript
4
- * (c) 2013 - 2021 Nguyen Huu Phuoc <me@phuoc.ng>
5
- */
6
-
7
- // This should be used with FormValidation UMD package
8
- declare namespace FormValidation {
9
- // Core
10
- // ----
11
-
12
- namespace core {
13
- interface ValidatorOptions {
14
- enabled?: boolean;
15
- message?: string;
16
- [option: string]: unknown;
17
- }
18
- interface FieldOptions {
19
- selector?: string;
20
- validators: {
21
- [validatorName: string]: ValidatorOptions,
22
- };
23
- }
24
- interface FieldsOptions {
25
- [field: string]: FieldOptions;
26
- }
27
- interface Localization {
28
- [validator: string]: {
29
- default?: string,
30
- };
31
- }
32
- interface LocalizationMessage {
33
- [locale: string]: string;
34
- }
35
- type LocalizationMessageType = LocalizationMessage | string;
36
- interface ValidateOptions {
37
- message?: string;
38
- }
39
- interface ValidateInput<T extends ValidateOptions, L extends Localization> {
40
- element?: HTMLElement;
41
- elements?: HTMLElement[];
42
- field?: string;
43
- options?: T;
44
- l10n?: L;
45
- value: string;
46
- }
47
- interface ValidateResult {
48
- message?: LocalizationMessageType;
49
- meta?: unknown;
50
- valid: boolean;
51
- }
52
-
53
- interface ValidateFunctionInterface<K extends ValidateOptions, T> {
54
- validate(input: ValidateInput<K, Localization>): T;
55
- }
56
- type ValidateFunction<K extends ValidateOptions> = ValidateFunctionInterface<K, ValidateResult | Promise<ValidateResult>>;
57
-
58
- class Core {
59
- constructor(form: HTMLElement, fields?: FieldsOptions);
60
-
61
- on(event: string, func: (...arg: unknown[]) => unknown): Core;
62
- off(event: string, func: (...arg: unknown[]) => unknown): Core;
63
- emit(event: string, ...args: unknown[]): Core;
64
-
65
- registerPlugin(name: string, plugin: Plugin<unknown>): Core;
66
- deregisterPlugin(name: string): Core;
67
-
68
- registerValidator(name: string, func: () => ValidateFunction<ValidateOptions>): Core;
69
- registerValidator<K extends ValidateOptions>(name: string, func: () => ValidateFunction<K>): Core;
70
- registerFilter(name: string, func: (...arg: unknown[]) => unknown): Core;
71
- deregisterFilter(name: string, func: (...arg: unknown[]) => unknown): Core;
72
- executeFilter<T>(name: string, defaultValue: T, args: unknown[]): T;
73
-
74
- addField(field: string, options?: FieldOptions): Core;
75
- removeField(field: string): Core;
76
-
77
- revalidateField(field: string): Promise<string>;
78
- validate(): Promise<string>;
79
- validateField(field: string): Promise<string>;
80
- validateElement(field: string, ele: HTMLElement): Promise<string>;
81
- executeValidator(field: string, ele: HTMLElement, v: string, opts: ValidatorOptions): Promise<string>;
82
-
83
- getElementValue(field: string, ele: HTMLElement, validator?: string): string;
84
- getElements(field: string): HTMLElement[];
85
- getFields(): FieldsOptions;
86
- getFormElement(): HTMLElement;
87
- getLocale(): string;
88
- getPlugin(name: string): Plugin<unknown>;
89
-
90
- updateFieldStatus(field: string, status: string, validator?: string): Core;
91
- updateElementStatus(field: string, ele: HTMLElement, status: string, validator?: string): Core;
92
-
93
- resetForm(reset?: boolean): Core;
94
- resetField(field: string, reset?: boolean): Core;
95
-
96
- disableValidator(field: string, validator?: string): Core;
97
- enableValidator(field: string, validator?: string): Core;
98
- updateValidatorOption(field: string, validator: string, name: string, value: unknown): Core;
99
- setFieldOptions(field: string, options: FieldOptions): Core;
100
-
101
- destroy(): Core;
102
-
103
- setLocale(locale: string, localization: Localization): Core;
104
- }
105
-
106
- class Plugin<T> {
107
- constructor(opts?: T);
108
- setCore(core: core.Core): Plugin<T>;
109
- install(): void;
110
- uninstall(): void;
111
- }
112
- }
113
-
114
- type Plugin<T> = core.Plugin<T>;
115
-
116
- // Algorithms
117
- // ----------
118
-
119
- namespace algorithms {
120
- function luhn(value: string): boolean;
121
- function mod11And10(value: string): boolean;
122
- function mod37And36(value: string, alphabet?: string): boolean;
123
- function verhoeff(value: number[]): boolean;
124
- }
125
-
126
- // formValidation
127
- // --------------
128
-
129
- interface Options {
130
- fields?: core.FieldsOptions;
131
- locale?: string;
132
- localization?: core.Localization;
133
- plugins?: {
134
- [name: string]: core.Plugin<unknown>,
135
- };
136
- init?(core: core.Core): void;
137
- }
138
- function formValidation(form: HTMLElement, options?: Options): core.Core;
139
-
140
- // Locales
141
- // -------
142
-
143
- let locales: {};
144
-
145
- // Plugins
146
- // -------
147
- namespace plugins {
148
- interface AliasOptions {
149
- // Map the alias with defined validator name
150
- [alias: string]: string;
151
- }
152
- class Alias extends core.Plugin<AliasOptions> {
153
- constructor(opts?: AliasOptions);
154
- }
155
-
156
- class Aria extends core.Plugin<{}> {
157
- constructor();
158
- }
159
-
160
- interface AutoFocusOptions {
161
- onPrefocus: (AutoFocusPrefocusEvent) => void;
162
- }
163
- interface AutoFocusPrefocusEvent {
164
- field: string;
165
- firstElement: HTMLElement;
166
- }
167
- class AutoFocus extends core.Plugin<AutoFocusOptions> {
168
- constructor(opts?: AutoFocusOptions);
169
- }
170
-
171
- interface DeclarativeOptions {
172
- // Set it to `true` to enable the validators automatically based on the input type or particular HTML 5 attributes:
173
- // -----------------+---------------------
174
- // HTML 5 attribute | Equivalent validator
175
- // -----------------+---------------------
176
- // max="..." | lessThan
177
- // min="..." | greaterThan
178
- // maxlength="..." | stringLength
179
- // minlength="..." | stringLength
180
- // pattern="..." | regexp
181
- // required | notEmpty
182
- // type="color" | color
183
- // type="email" | emailAddress
184
- // type="range" | between
185
- // type="url" | uri
186
- // -----------------+---------------------
187
- // It's not enabled by default
188
- html5Input?: boolean;
189
- // The prefix of plugin declaration attributes. By default, it is set to `data-fvp-`
190
- pluginPrefix?: string;
191
- // The prefix of attributes. By default, it is set to `data-fv-`
192
- prefix?: string;
193
- }
194
- class Declarative extends core.Plugin<DeclarativeOptions> {
195
- constructor(opts?: DeclarativeOptions);
196
- }
197
-
198
- class DefaultSubmit extends core.Plugin<{}> {
199
- constructor();
200
- }
201
-
202
- interface DependencyOptions {
203
- [field: string]: string;
204
- }
205
- class Dependency extends core.Plugin<DependencyOptions> {
206
- constructor(opts: DependencyOptions);
207
- }
208
-
209
- type ExcludedCallback = (field: string, element: HTMLElement, elements: HTMLElement[]) => boolean;
210
- interface ExcludedOptions {
211
- excluded: ExcludedCallback;
212
- }
213
- class Excluded extends core.Plugin<ExcludedOptions> {
214
- constructor(opts?: ExcludedOptions);
215
- }
216
-
217
- interface FieldStatusOptions {
218
- onStatusChanged?: (areFieldsValid: boolean) => void;
219
- }
220
- class FieldStatus extends core.Plugin<FieldStatusOptions> {
221
- constructor(opts?: FieldStatusOptions);
222
- }
223
-
224
- interface IconOptions {
225
- invalid?: string;
226
- valid?: string;
227
- validating?: string;
228
- onPlaced?: (IconPlacedEvent) => void;
229
- onSet?: (IconSetEvent) => void;
230
- }
231
- interface IconPlacedEvent {
232
- element: HTMLElement;
233
- field: string;
234
- iconElement: HTMLElement;
235
- classes: IconOptions;
236
- }
237
- interface IconSetEvent {
238
- element: HTMLElement;
239
- field: string;
240
- status: string;
241
- iconElement: HTMLElement;
242
- }
243
- class Icon extends core.Plugin<IconOptions> {
244
- constructor(opts?: IconOptions);
245
- }
246
-
247
- interface InternationalTelephoneInputOptions {
248
- autoPlaceholder?: string;
249
- field: string | string[];
250
- message: string;
251
- utilsScript?: string;
252
- }
253
- class InternationalTelephoneInput extends core.Plugin<InternationalTelephoneInputOptions> {
254
- constructor(opts?: InternationalTelephoneInputOptions);
255
- static INT_TEL_VALIDATOR: string;
256
- }
257
-
258
- interface LiteralMessage {
259
- [locale: string]: string;
260
- }
261
- type CallbackMessage = (field: string, validator: string) => LiteralMessage;
262
- interface L10nOptions {
263
- [field: string]: {
264
- [validator: string]: LiteralMessage | CallbackMessage,
265
- };
266
- }
267
- class L10n extends core.Plugin<L10nOptions> {
268
- constructor(opts?: L10nOptions);
269
- }
270
-
271
- interface MailgunOptions {
272
- // The API key provided by Mailgun
273
- apiKey: string;
274
- // The field name that will be validated
275
- field: string;
276
- // Error message indicates the input is not valid
277
- message: string;
278
- // Show suggestion if the email is not valid
279
- suggestion?: boolean;
280
- }
281
- class Mailgun extends core.Plugin<MailgunOptions> {
282
- constructor(opts?: MailgunOptions);
283
- }
284
-
285
- interface MandatoryIconOptions {
286
- icon: string;
287
- }
288
- class MandatoryIcon extends core.Plugin<MandatoryIconOptions> {
289
- constructor(opts?: MandatoryIconOptions);
290
- }
291
-
292
- interface PasswordStrengthOptions {
293
- field: string;
294
- message: string;
295
- minimalScore: number;
296
- onValidated?: (valid: boolean, message: string, score: number) => void;
297
- }
298
- class PasswordStrength extends core.Plugin<PasswordStrengthOptions> {
299
- constructor(opts?: PasswordStrengthOptions);
300
- static PASSWORD_STRENGTH_VALIDATOR: string;
301
- }
302
-
303
- type ContainerCallback = (field: string, element: HTMLElement) => HTMLElement;
304
- interface MessageOptions {
305
- clazz?: string;
306
- container?: string | ContainerCallback;
307
- }
308
- class Message extends core.Plugin<MessageOptions> {
309
- constructor(opts?: MessageOptions);
310
- static getClosestContainer(element: HTMLElement, upper: HTMLElement, pattern: RegExp): HTMLElement;
311
- }
312
-
313
- interface RecaptchaOptions {
314
- // The ID of element showing the captcha
315
- element: string;
316
- // The language code defined by reCAPTCHA
317
- // See https://developers.google.com/recaptcha/docs/language
318
- language?: string;
319
- // The invalid message that will be shown in case the captcha is not valid
320
- // You don't need to define it if the back-end URL above returns the message
321
- message: string;
322
- // The site key provided by Google
323
- siteKey: string;
324
- backendVerificationUrl?: string;
325
-
326
- // The size of widget. It can be 'compact', 'normal' (default), or 'invisible'
327
- size?: string;
328
-
329
- // reCAPTCHA widget option (size can be 'compact' or 'normal')
330
- // See https://developers.google.com/recaptcha/docs/display
331
-
332
- // The theme name provided by Google. It can be light (default), dark
333
- theme?: string;
334
-
335
- // Invisible reCAPTCHA
336
- // See https://developers.google.com/recaptcha/docs/invisible
337
- // The position of reCAPTCHA. Can be 'bottomright' (default), 'bottomleft', 'inline'
338
- badge?: string;
339
- }
340
- class Recaptcha extends core.Plugin<RecaptchaOptions> {
341
- constructor(opts?: RecaptchaOptions);
342
- static CAPTCHA_FIELD: string;
343
- }
344
-
345
- interface Recaptcha3Options {
346
- // The ID of element showing the captcha error
347
- element: string;
348
- // The language code defined by reCAPTCHA
349
- // See https://developers.google.com/recaptcha/docs/language
350
- language?: string;
351
- // Minimum score, between 0 and 1
352
- minimumScore?: number;
353
- // The invalid message that will be shown in case the captcha is not valid
354
- // You don't need to define it if the back-end URL above returns the message
355
- message: string;
356
- // The site key provided by Google
357
- siteKey: string;
358
- backendVerificationUrl: string;
359
- action: string;
360
- }
361
- class Recaptcha3 extends core.Plugin<Recaptcha3Options> {
362
- constructor(opts?: Recaptcha3Options);
363
- static CAPTCHA_FIELD: string;
364
- }
365
-
366
- interface Recaptcha3TokenOptions {
367
- action: string;
368
- hiddenTokenName: string;
369
- language?: string;
370
- siteKey: string;
371
- }
372
- class Recaptcha3Token extends core.Plugin<Recaptcha3TokenOptions> {
373
- constructor(opts?: Recaptcha3TokenOptions);
374
- }
375
-
376
- interface SequenceOptions {
377
- enabled: boolean | { [field: string]: boolean };
378
- }
379
- class Sequence extends core.Plugin<SequenceOptions> {
380
- constructor(opts?: SequenceOptions);
381
- }
382
-
383
- interface StartEndDateOptions {
384
- format: string;
385
- startDate: {
386
- field: string;
387
- message: string;
388
- };
389
- endDate: {
390
- field: string;
391
- message: string;
392
- };
393
- }
394
- class StartEndDate extends core.Plugin<StartEndDateOptions> {
395
- constructor(opts?: StartEndDateOptions);
396
- }
397
-
398
- interface SubmitButtonOptions {
399
- aspNetButton?: boolean;
400
- // Allow to query the submit button(s)
401
- // It's useful in case the submit button is outside of form
402
- buttons?: (form: HTMLFormElement) => Element[];
403
- }
404
- class SubmitButton extends core.Plugin<SubmitButtonOptions> {
405
- constructor(opts?: SubmitButtonOptions);
406
- }
407
-
408
- interface TooltipOptions {
409
- placement: string;
410
- trigger: string;
411
- }
412
- class Tooltip extends core.Plugin<TooltipOptions> {
413
- constructor(opts?: TooltipOptions);
414
- }
415
-
416
- interface TransformerOptions {
417
- [field: string]: {
418
- [validator: string]: (field: string, element: HTMLElement, validator: string) => string,
419
- };
420
- }
421
- class Transformer extends core.Plugin<TransformerOptions> {
422
- constructor(opts?: TransformerOptions);
423
- }
424
-
425
- interface TriggerOptions {
426
- delay?: number | {
427
- [field: string]: number,
428
- };
429
- event: string | {
430
- [field: string]: boolean | string,
431
- };
432
- // Only perform the validation if the field value exceed this number of characters
433
- threshold?: number | {
434
- [field: string]: number,
435
- };
436
- }
437
- class Trigger extends core.Plugin<TriggerOptions> {
438
- constructor(opts?: TriggerOptions);
439
- }
440
-
441
- interface WizardOptions {
442
- stepSelector: string;
443
- prevButton: string;
444
- nextButton: string;
445
- onStepActive?: (WizardStepEvent) => void;
446
- onStepInvalid?: (WizardStepEvent) => void;
447
- onStepValid?: (WizardStepEvent) => void;
448
- onValid?: (WizardValidEvent) => void;
449
- activeStepClass?: string;
450
- isFieldExcluded?: (field: string, element: HTMLElement, elements: HTMLElement[]) => boolean;
451
- isStepSkipped?:(WizardIsStepSkipped) => boolean;
452
- stepClass?: string;
453
- }
454
- interface WizardStepEvent {
455
- step: number;
456
- numSteps: number;
457
- }
458
- interface WizardValidEvent {
459
- numSteps: number;
460
- }
461
- interface WizardIsStepSkipped {
462
- currentStep: number;
463
- numSteps: number;
464
- targetStep: number;
465
- }
466
- class Wizard extends core.Plugin<WizardOptions> {
467
- constructor(opts?: WizardOptions);
468
- static EXCLUDED_PLUGIN: string;
469
- }
470
-
471
- // Plugins that supports popular CSS frameworks
472
-
473
- type RowSelector = (field: string, element: HTMLElement) => string;
474
- interface FrameworkOptions {
475
- defaultMessageContainer?: boolean;
476
- formClass: string;
477
- messageClass?: string;
478
- rowInvalidClass: string;
479
- // A list of CSS classes (separated by a space) that will be added to the row
480
- rowClasses?: string;
481
- rowPattern: RegExp;
482
- rowSelector: string | RowSelector;
483
- rowValidatingClass?: string;
484
- rowValidClass: string;
485
- // A CSS class added to valid element
486
- eleValidClass?: string;
487
- // A CSS class added to invalid element
488
- eleInvalidClass?: string;
489
- }
490
- class Framework extends core.Plugin<FrameworkOptions> {
491
- constructor(opts?: FrameworkOptions);
492
- }
493
-
494
- class Bootstrap extends plugins.Framework {
495
- constructor(opts?: plugins.FrameworkOptions);
496
- }
497
- class Bootstrap3 extends plugins.Framework {
498
- constructor(opts?: plugins.FrameworkOptions);
499
- }
500
- class Bootstrap5 extends plugins.Framework {
501
- constructor(opts?: plugins.FrameworkOptions);
502
- }
503
- class Bulma extends plugins.Framework {
504
- constructor(opts?: plugins.FrameworkOptions);
505
- }
506
- class Foundation extends plugins.Framework {
507
- constructor(opts?: plugins.FrameworkOptions);
508
- }
509
- class Materialize extends plugins.Framework {
510
- constructor(opts?: plugins.FrameworkOptions);
511
- }
512
- class Milligram extends plugins.Framework {
513
- constructor(opts?: plugins.FrameworkOptions);
514
- }
515
- class Mini extends plugins.Framework {
516
- constructor(opts?: plugins.FrameworkOptions);
517
- }
518
- class Mui extends plugins.Framework {
519
- constructor(opts?: plugins.FrameworkOptions);
520
- }
521
- class Pure extends plugins.Framework {
522
- constructor(opts?: plugins.FrameworkOptions);
523
- }
524
- class Semantic extends plugins.Framework {
525
- constructor(opts?: plugins.FrameworkOptions);
526
- }
527
- class Shoelace extends plugins.Framework {
528
- constructor(opts?: plugins.FrameworkOptions);
529
- }
530
- class Spectre extends plugins.Framework {
531
- constructor(opts?: plugins.FrameworkOptions);
532
- }
533
- class Tachyons extends plugins.Framework {
534
- constructor(opts?: plugins.FrameworkOptions);
535
- }
536
- class Turret extends plugins.Framework {
537
- constructor(opts?: plugins.FrameworkOptions);
538
- }
539
- class Uikit extends plugins.Framework {
540
- constructor(opts?: plugins.FrameworkOptions);
541
- }
542
- }
543
-
544
- // Utils
545
- // -----
546
- namespace utils {
547
- function call(functionName: ((...arg: unknown[]) => unknown) | string, args: unknown[]): unknown;
548
- function classSet(element: HTMLElement, classes: { [clazz: string]: boolean }): void;
549
- function closest(element: HTMLElement, selector: string): HTMLElement;
550
-
551
- interface FetchOptions {
552
- // Does it request to other domain? Default value is `false`
553
- crossDomain?: boolean;
554
- // Additional headers
555
- headers?: {
556
- [name: string]: string,
557
- };
558
- // The request method. For example, `GET` (default), `POST`
559
- method?: string;
560
- params: {
561
- [name: string]: unknown,
562
- };
563
- }
564
- function fetch(url: string, options: FetchOptions): Promise<unknown>;
565
-
566
- function format(message: string, parameters: string | string[]): string;
567
- function hasClass(element: HTMLElement, clazz: string): boolean;
568
- function isValidDate(year: number, month: number, day: number, notInFuture?: boolean): boolean;
569
- }
570
-
571
- // Validators
572
- // ----------
573
- namespace validators {
574
- function base64(): {
575
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
576
- };
577
-
578
- interface BetweenOptions extends core.ValidateOptions {
579
- // Default is true
580
- inclusive: boolean;
581
- max?: number;
582
- min?: number;
583
- }
584
- interface BetweenLocalization extends core.Localization {
585
- between: {
586
- default: string,
587
- notInclusive: string,
588
- };
589
- }
590
- function between(): {
591
- validate(input: core.ValidateInput<BetweenOptions, BetweenLocalization>): core.ValidateResult,
592
- };
593
-
594
- function bic(): {
595
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
596
- };
597
- function blank(): {
598
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
599
- };
600
-
601
- interface CallbackOptions extends core.ValidateOptions {
602
- callback: ((...arg: unknown[]) => unknown) | string;
603
- }
604
- function callback(): {
605
- validate(input: core.ValidateInput<CallbackOptions, core.Localization>): core.ValidateResult,
606
- };
607
-
608
- interface ChoiceOptions extends core.ValidateOptions {
609
- max?: number;
610
- min?: number;
611
- }
612
- interface ChoiceLocalization extends core.Localization {
613
- choice: {
614
- between: string,
615
- default: string,
616
- less: string,
617
- more: string,
618
- };
619
- }
620
- function choice(): {
621
- validate(input: core.ValidateInput<ChoiceOptions, ChoiceLocalization>): core.ValidateResult,
622
- };
623
-
624
- interface ColorOptions extends core.ValidateOptions {
625
- // The array of valid color types
626
- // For example: 'hex', 'hex rgb', ['hex', 'rgb']
627
- type: string | string[];
628
- }
629
- function color(): {
630
- validate(input: core.ValidateInput<ColorOptions, core.Localization>): core.ValidateResult,
631
- };
632
-
633
- function creditCard(): {
634
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
635
- };
636
- function cusip(): {
637
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
638
- };
639
-
640
- type CompareDateCallback = () => (string | Date);
641
- interface DateOptions extends core.ValidateOptions {
642
- // The date format. Default is MM/DD/YYYY
643
- // The format can be:
644
- // - date: Consist of DD, MM, YYYY parts which are separated by the separator option
645
- // - date and time: The time can consist of h, m, s parts which are separated by :
646
- // - date, time and A (indicating AM or PM)
647
- format: string;
648
- // The maximum date
649
- max?: string | Date | CompareDateCallback;
650
- // The minimum date
651
- min?: string | Date | CompareDateCallback;
652
- // Use to separate the date, month, and year. By default, it is /
653
- separator?: string;
654
- }
655
- interface DateLocalization extends core.Localization {
656
- date: {
657
- default: string,
658
- max: string,
659
- min: string,
660
- range: string,
661
- };
662
- }
663
- function date(): {
664
- validate(input: core.ValidateInput<DateOptions, DateLocalization>): core.ValidateResult,
665
- };
666
-
667
- type CompareDifferentCallback = () => string;
668
- interface DifferentOptions extends core.ValidateOptions {
669
- compare: string | CompareDifferentCallback;
670
- }
671
- function different(): {
672
- validate(input: core.ValidateInput<DifferentOptions, core.Localization>): core.ValidateResult,
673
- };
674
-
675
- function digits(): {
676
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
677
- };
678
- function ean(): {
679
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
680
- };
681
- function ein(): {
682
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
683
- };
684
-
685
- interface EmailAddressOptions extends core.ValidateOptions {
686
- // Allow multiple email addresses, separated by a comma or semicolon; default is false.
687
- multiple?: boolean | string;
688
- // Regex for character or characters expected as separator between addresses
689
- // default is comma /[,;]/, i.e. comma or semicolon.
690
- separator?: string | RegExp;
691
- }
692
- function emailAddress(): {
693
- validate(input: core.ValidateInput<EmailAddressOptions, core.Localization>): core.ValidateResult,
694
- };
695
-
696
- interface FileOptions extends core.ValidateOptions {
697
- // The allowed extensions, separated by a comma
698
- extension: string;
699
- // The maximum number of files
700
- maxFiles: number;
701
- // The maximum size in bytes
702
- maxSize: number;
703
- // The maximum size in bytes for all files
704
- maxTotalSize: number;
705
- // The minimum number of files
706
- minFiles: number;
707
- // The minimum size in bytes
708
- minSize: number;
709
- // The minimum size in bytes for all files
710
- minTotalSize: number;
711
- // The allowed MIME type, separated by a comma
712
- type: string;
713
- }
714
- function file(): {
715
- validate(input: core.ValidateInput<FileOptions, core.Localization>): core.ValidateResult,
716
- };
717
-
718
- interface GreaterThanOptions extends core.ValidateOptions {
719
- // Default is true
720
- inclusive: boolean;
721
- message: string;
722
- min?: number;
723
- }
724
- interface GreaterThanLocalization extends core.Localization {
725
- greaterThan: {
726
- default: string,
727
- notInclusive: string,
728
- };
729
- }
730
- function greaterThan(): {
731
- validate(input: core.ValidateInput<GreaterThanOptions, GreaterThanLocalization>): core.ValidateResult,
732
- };
733
-
734
- function grid(): {
735
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
736
- };
737
- function hex(): {
738
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
739
- };
740
-
741
- interface IbanOptions extends core.ValidateOptions {
742
- // The ISO 3166-1 country code. It can be
743
- // - A country code
744
- // - Name of field which its value defines the country code
745
- // - Name of callback function that returns the country code
746
- // - A callback function that returns the country code
747
- country?: string;
748
- // Set it to true (false) to indicate that the IBAN number must be (not be) from SEPA countries
749
- sepa?: boolean | string;
750
- }
751
- interface IbanLocalization extends core.Localization {
752
- iban: {
753
- countries: {
754
- [countryCode: string]: string,
755
- },
756
- country: string,
757
- default: string,
758
- };
759
- }
760
- function iban(): {
761
- validate(input: core.ValidateInput<IbanOptions, IbanLocalization>): core.ValidateResult,
762
- };
763
-
764
- interface IdOptions extends core.ValidateOptions {
765
- // The ISO 3166-1 country code. It can be
766
- // - A country code
767
- // - A callback function that returns the country code
768
- country: string | (() => string);
769
- }
770
- interface IdLocalization extends core.Localization {
771
- id: {
772
- countries: {
773
- [countryCode: string]: string,
774
- },
775
- country: string,
776
- default: string,
777
- };
778
- }
779
- function id(): {
780
- validate(input: core.ValidateInput<IdOptions, IdLocalization>): core.ValidateResult,
781
- };
782
-
783
- type CompareIdenticalCallback = () => string;
784
- interface IdenticalOptions extends core.ValidateOptions {
785
- compare: string | CompareIdenticalCallback;
786
- }
787
- function identical(): {
788
- validate(input: core.ValidateInput<IdenticalOptions, core.Localization>): core.ValidateResult,
789
- };
790
-
791
- function imei(): {
792
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
793
- };
794
- function imo(): {
795
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
796
- };
797
-
798
- interface IntegerOptions extends core.ValidateOptions {
799
- // The decimal separator. It's '.' by default
800
- decimalSeparator: string;
801
- // The thousands separator. It's empty by default
802
- thousandsSeparator: string;
803
- }
804
- function integer(): {
805
- validate(input: core.ValidateInput<IntegerOptions, core.Localization>): core.ValidateResult,
806
- };
807
-
808
- interface IpOptions extends core.ValidateOptions {
809
- // Enable IPv4 validator, default to true
810
- ipv4?: boolean;
811
- // Enable IPv6 validator, default to true
812
- ipv6?: boolean;
813
- }
814
- interface IpLocalization extends core.Localization {
815
- ip: {
816
- default: string,
817
- ipv4: string,
818
- ipv6: string,
819
- };
820
- }
821
- function ip(): {
822
- validate(input: core.ValidateInput<IpOptions, IpLocalization>): core.ValidateResult,
823
- };
824
-
825
- function isbn(): {
826
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
827
- };
828
- function isin(): {
829
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
830
- };
831
- function ismn(): {
832
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
833
- };
834
- function issn(): {
835
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
836
- };
837
-
838
- interface LessThanOptions extends core.ValidateOptions {
839
- // Default is true
840
- inclusive: boolean;
841
- max?: number;
842
- }
843
- interface LessThanLocalization extends core.Localization {
844
- lessThan: {
845
- default: string,
846
- notInclusive: string,
847
- };
848
- }
849
- function lessThan(): {
850
- validate(input: core.ValidateInput<LessThanOptions, LessThanLocalization>): core.ValidateResult,
851
- };
852
-
853
- function mac(): {
854
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
855
- };
856
- function meid(): {
857
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
858
- };
859
-
860
- interface NotEmptyOptions extends core.ValidateOptions {
861
- trim?: boolean;
862
- }
863
- function notEmpty(): {
864
- validate(input: core.ValidateInput<NotEmptyOptions, core.Localization>): core.ValidateResult,
865
- };
866
-
867
- interface NumericOptions extends core.ValidateOptions {
868
- // The decimal separator. It's '.' by default
869
- decimalSeparator: string;
870
- // The thousands separator. It's empty by default
871
- thousandsSeparator: string;
872
- }
873
- function numeric(): {
874
- validate(input: core.ValidateInput<NumericOptions, core.Localization>): core.ValidateResult,
875
- };
876
-
877
- interface PhoneOptions extends core.ValidateOptions {
878
- // The ISO 3166-1 country code. It can be
879
- // - A country code
880
- // - A callback function that returns the country code
881
- country: string | (() => string);
882
- }
883
- interface PhoneLocalization extends core.Localization {
884
- phone: {
885
- countries: {
886
- [countryCode: string]: string,
887
- },
888
- country: string,
889
- default: string,
890
- };
891
- }
892
- function phone(): {
893
- validate(input: core.ValidateInput<PhoneOptions, PhoneLocalization>): core.ValidateResult,
894
- };
895
-
896
- interface PromiseOptions extends core.ValidateOptions {
897
- promise: (...arg: unknown[]) => unknown | string;
898
- }
899
- function promise(): {
900
- validate(input: core.ValidateInput<PromiseOptions, core.Localization>): core.ValidateResult,
901
- };
902
-
903
- interface RegexpOptions extends core.ValidateOptions {
904
- // If specified, flags can have any combination of JavaScript regular expression flags such as:
905
- // g: global match
906
- // i: ignore case
907
- // m: multiple line
908
- flags?: string;
909
- // The regular expression you need to check
910
- regexp: string | RegExp;
911
- }
912
- function regexp(): {
913
- validate(input: core.ValidateInput<RegexpOptions, core.Localization>): core.ValidateResult,
914
- };
915
-
916
- interface RemoteOptions extends core.ValidateOptions {
917
- url: string;
918
- // Does it request to other domain? Default value is `false`
919
- crossDomain?: boolean;
920
- // By default, it will take the value `{ <fieldName>: <fieldValue> }`
921
- data?: Record<string, unknown> | ((...arg: unknown[]) => unknown);
922
- // Additional headers
923
- headers?: {
924
- [name: string]: string,
925
- };
926
- // Override the field name for the request
927
- name?: string;
928
- // Can be GET or POST (default)
929
- method?: string;
930
- // The valid key. It's `valid` by default
931
- // This is useful when connecting to external remote server or APIs provided by 3rd parties
932
- validKey?: string;
933
- }
934
- function remote(): {
935
- validate(input: core.ValidateInput<RemoteOptions, core.Localization>): core.ValidateResult,
936
- };
937
-
938
- function rtn(): {
939
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
940
- };
941
- function sedol(): {
942
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
943
- };
944
- function siren(): {
945
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
946
- };
947
- function siret(): {
948
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
949
- };
950
-
951
- interface StepOptions extends core.ValidateOptions {
952
- baseValue: number;
953
- step: number;
954
- }
955
- interface StepLocalization extends core.Localization {
956
- step: {
957
- default: string,
958
- };
959
- }
960
- function step(): {
961
- validate(input: core.ValidateInput<StepOptions, StepLocalization>): core.ValidateResult,
962
- };
963
-
964
- interface StringCaseOptions extends core.ValidateOptions {
965
- // Can be 'lower' (default) or 'upper'
966
- case: string;
967
- }
968
- interface StringCaseLocalization extends core.Localization {
969
- stringCase: {
970
- default: string,
971
- upper: string,
972
- };
973
- }
974
- function stringCase(): {
975
- validate(input: core.ValidateInput<StringCaseOptions, StringCaseLocalization>): core.ValidateResult,
976
- };
977
-
978
- interface StringLengthOptions extends core.ValidateOptions {
979
- // At least one of two options is required
980
- // The min, max keys define the number which the field value compares to. min, max can be
981
- // - A number
982
- // - Name of field which its value defines the number
983
- // - Name of callback function that returns the number
984
- // - A callback function that returns the number
985
- max?: number | string;
986
- min?: number | string;
987
- // Indicate the length will be calculated after trimming the value or not. It is false, by default
988
- trim?: boolean | string;
989
- // Evaluate string length in UTF-8 bytes, default to false
990
- utf8Bytes?: boolean | string;
991
- }
992
- interface StringLengthLocalization extends core.Localization {
993
- stringLength: {
994
- between: string,
995
- default: string,
996
- less: string,
997
- more: string,
998
- };
999
- }
1000
- function stringLength(): {
1001
- validate(input: core.ValidateInput<StringLengthOptions, StringLengthLocalization>): core.ValidateResult,
1002
- };
1003
-
1004
- interface UriOptions extends core.ValidateOptions {
1005
- // Allow the URI without protocol. Default to false
1006
- allowEmptyProtocol?: boolean | string;
1007
- // Allow the private and local network IP. Default to false
1008
- allowLocal?: boolean | string;
1009
- // The protocols, separated by a comma. Default to "http, https, ftp"
1010
- protocol?: string;
1011
- }
1012
- function uri(): {
1013
- validate(input: core.ValidateInput<UriOptions, core.Localization>): core.ValidateResult,
1014
- };
1015
-
1016
- interface UuidOptions extends core.ValidateOptions {
1017
- // Can be 3, 4, 5, null
1018
- version?: string;
1019
- }
1020
- interface UuidLocalization extends core.Localization {
1021
- uuid: {
1022
- default: string,
1023
- version: string,
1024
- };
1025
- }
1026
- function uuid(): {
1027
- validate(input: core.ValidateInput<UuidOptions, UuidLocalization>): core.ValidateResult,
1028
- };
1029
-
1030
- interface VatOptions extends core.ValidateOptions {
1031
- // The ISO 3166-1 country code. It can be
1032
- // - A country code
1033
- // - A callback function that returns the country code
1034
- country: string | (() => string);
1035
- }
1036
- interface VatLocalization extends core.Localization {
1037
- vat: {
1038
- countries: {
1039
- [countryCode: string]: string,
1040
- },
1041
- country: string,
1042
- default: string,
1043
- };
1044
- }
1045
- function vat(): {
1046
- validate(input: core.ValidateInput<VatOptions, VatLocalization>): core.ValidateResult,
1047
- };
1048
-
1049
- function vin(): {
1050
- validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
1051
- };
1052
-
1053
- interface ZipCodeOptions extends core.ValidateOptions {
1054
- // The ISO 3166-1 country code. It can be
1055
- // - A country code
1056
- // - A callback function that returns the country code
1057
- country: string | (() => string);
1058
- }
1059
- interface ZipCodeLocalization extends core.Localization {
1060
- zipCode: {
1061
- countries: {
1062
- [countryCode: string]: string,
1063
- },
1064
- country: string,
1065
- default: string,
1066
- };
1067
- }
1068
- function zipCode(): {
1069
- validate(input: core.ValidateInput<ZipCodeOptions, ZipCodeLocalization>): core.ValidateResult,
1070
- };
1071
- }
1072
- }
1
+ /**
2
+ * FormValidation (https://formvalidation.io)
3
+ * The best validation library for JavaScript
4
+ * (c) 2013 - 2021 Nguyen Huu Phuoc <me@phuoc.ng>
5
+ */
6
+
7
+ // This should be used with FormValidation UMD package
8
+ declare namespace FormValidation {
9
+ // Core
10
+ // ----
11
+
12
+ namespace core {
13
+ interface ValidatorOptions {
14
+ enabled?: boolean;
15
+ message?: string;
16
+ [option: string]: unknown;
17
+ }
18
+ interface FieldOptions {
19
+ selector?: string;
20
+ validators: {
21
+ [validatorName: string]: ValidatorOptions,
22
+ };
23
+ }
24
+ interface FieldsOptions {
25
+ [field: string]: FieldOptions;
26
+ }
27
+ interface Localization {
28
+ [validator: string]: {
29
+ default?: string,
30
+ };
31
+ }
32
+ interface LocalizationMessage {
33
+ [locale: string]: string;
34
+ }
35
+ type LocalizationMessageType = LocalizationMessage | string;
36
+ interface ValidateOptions {
37
+ message?: string;
38
+ }
39
+ interface ValidateInput<T extends ValidateOptions, L extends Localization> {
40
+ element?: HTMLElement;
41
+ elements?: HTMLElement[];
42
+ field?: string;
43
+ options?: T;
44
+ l10n?: L;
45
+ value: string;
46
+ }
47
+ interface ValidateResult {
48
+ message?: LocalizationMessageType;
49
+ meta?: unknown;
50
+ valid: boolean;
51
+ }
52
+
53
+ interface ValidateFunctionInterface<K extends ValidateOptions, T> {
54
+ validate(input: ValidateInput<K, Localization>): T;
55
+ }
56
+ type ValidateFunction<K extends ValidateOptions> = ValidateFunctionInterface<K, ValidateResult | Promise<ValidateResult>>;
57
+
58
+ class Core {
59
+ constructor(form: HTMLElement, fields?: FieldsOptions);
60
+
61
+ on(event: string, func: (...arg: unknown[]) => unknown): Core;
62
+ off(event: string, func: (...arg: unknown[]) => unknown): Core;
63
+ emit(event: string, ...args: unknown[]): Core;
64
+
65
+ registerPlugin(name: string, plugin: Plugin<unknown>): Core;
66
+ deregisterPlugin(name: string): Core;
67
+
68
+ registerValidator(name: string, func: () => ValidateFunction<ValidateOptions>): Core;
69
+ registerValidator<K extends ValidateOptions>(name: string, func: () => ValidateFunction<K>): Core;
70
+ registerFilter(name: string, func: (...arg: unknown[]) => unknown): Core;
71
+ deregisterFilter(name: string, func: (...arg: unknown[]) => unknown): Core;
72
+ executeFilter<T>(name: string, defaultValue: T, args: unknown[]): T;
73
+
74
+ addField(field: string, options?: FieldOptions): Core;
75
+ removeField(field: string): Core;
76
+
77
+ revalidateField(field: string): Promise<string>;
78
+ validate(): Promise<string>;
79
+ validateField(field: string): Promise<string>;
80
+ validateElement(field: string, ele: HTMLElement): Promise<string>;
81
+ executeValidator(field: string, ele: HTMLElement, v: string, opts: ValidatorOptions): Promise<string>;
82
+
83
+ getElementValue(field: string, ele: HTMLElement, validator?: string): string;
84
+ getElements(field: string): HTMLElement[];
85
+ getFields(): FieldsOptions;
86
+ getFormElement(): HTMLElement;
87
+ getLocale(): string;
88
+ getPlugin(name: string): Plugin<unknown>;
89
+
90
+ updateFieldStatus(field: string, status: string, validator?: string): Core;
91
+ updateElementStatus(field: string, ele: HTMLElement, status: string, validator?: string): Core;
92
+
93
+ resetForm(reset?: boolean): Core;
94
+ resetField(field: string, reset?: boolean): Core;
95
+
96
+ disableValidator(field: string, validator?: string): Core;
97
+ enableValidator(field: string, validator?: string): Core;
98
+ updateValidatorOption(field: string, validator: string, name: string, value: unknown): Core;
99
+ setFieldOptions(field: string, options: FieldOptions): Core;
100
+
101
+ destroy(): Core;
102
+
103
+ setLocale(locale: string, localization: Localization): Core;
104
+ }
105
+
106
+ class Plugin<T> {
107
+ constructor(opts?: T);
108
+ setCore(core: core.Core): Plugin<T>;
109
+ install(): void;
110
+ uninstall(): void;
111
+ }
112
+ }
113
+
114
+ type Plugin<T> = core.Plugin<T>;
115
+
116
+ // Algorithms
117
+ // ----------
118
+
119
+ namespace algorithms {
120
+ function luhn(value: string): boolean;
121
+ function mod11And10(value: string): boolean;
122
+ function mod37And36(value: string, alphabet?: string): boolean;
123
+ function verhoeff(value: number[]): boolean;
124
+ }
125
+
126
+ // formValidation
127
+ // --------------
128
+
129
+ interface Options {
130
+ fields?: core.FieldsOptions;
131
+ locale?: string;
132
+ localization?: core.Localization;
133
+ plugins?: {
134
+ [name: string]: core.Plugin<unknown>,
135
+ };
136
+ init?(core: core.Core): void;
137
+ }
138
+ function formValidation(form: HTMLElement, options?: Options): core.Core;
139
+
140
+ // Locales
141
+ // -------
142
+
143
+ let locales: {};
144
+
145
+ // Plugins
146
+ // -------
147
+ namespace plugins {
148
+ interface AliasOptions {
149
+ // Map the alias with defined validator name
150
+ [alias: string]: string;
151
+ }
152
+ class Alias extends core.Plugin<AliasOptions> {
153
+ constructor(opts?: AliasOptions);
154
+ }
155
+
156
+ class Aria extends core.Plugin<{}> {
157
+ constructor();
158
+ }
159
+
160
+ interface AutoFocusOptions {
161
+ onPrefocus: (AutoFocusPrefocusEvent) => void;
162
+ }
163
+ interface AutoFocusPrefocusEvent {
164
+ field: string;
165
+ firstElement: HTMLElement;
166
+ }
167
+ class AutoFocus extends core.Plugin<AutoFocusOptions> {
168
+ constructor(opts?: AutoFocusOptions);
169
+ }
170
+
171
+ interface DeclarativeOptions {
172
+ // Set it to `true` to enable the validators automatically based on the input type or particular HTML 5 attributes:
173
+ // -----------------+---------------------
174
+ // HTML 5 attribute | Equivalent validator
175
+ // -----------------+---------------------
176
+ // max="..." | lessThan
177
+ // min="..." | greaterThan
178
+ // maxlength="..." | stringLength
179
+ // minlength="..." | stringLength
180
+ // pattern="..." | regexp
181
+ // required | notEmpty
182
+ // type="color" | color
183
+ // type="email" | emailAddress
184
+ // type="range" | between
185
+ // type="url" | uri
186
+ // -----------------+---------------------
187
+ // It's not enabled by default
188
+ html5Input?: boolean;
189
+ // The prefix of plugin declaration attributes. By default, it is set to `data-fvp-`
190
+ pluginPrefix?: string;
191
+ // The prefix of attributes. By default, it is set to `data-fv-`
192
+ prefix?: string;
193
+ }
194
+ class Declarative extends core.Plugin<DeclarativeOptions> {
195
+ constructor(opts?: DeclarativeOptions);
196
+ }
197
+
198
+ class DefaultSubmit extends core.Plugin<{}> {
199
+ constructor();
200
+ }
201
+
202
+ interface DependencyOptions {
203
+ [field: string]: string;
204
+ }
205
+ class Dependency extends core.Plugin<DependencyOptions> {
206
+ constructor(opts: DependencyOptions);
207
+ }
208
+
209
+ type ExcludedCallback = (field: string, element: HTMLElement, elements: HTMLElement[]) => boolean;
210
+ interface ExcludedOptions {
211
+ excluded: ExcludedCallback;
212
+ }
213
+ class Excluded extends core.Plugin<ExcludedOptions> {
214
+ constructor(opts?: ExcludedOptions);
215
+ }
216
+
217
+ interface FieldStatusOptions {
218
+ onStatusChanged?: (areFieldsValid: boolean) => void;
219
+ }
220
+ class FieldStatus extends core.Plugin<FieldStatusOptions> {
221
+ constructor(opts?: FieldStatusOptions);
222
+ }
223
+
224
+ interface IconOptions {
225
+ invalid?: string;
226
+ valid?: string;
227
+ validating?: string;
228
+ onPlaced?: (IconPlacedEvent) => void;
229
+ onSet?: (IconSetEvent) => void;
230
+ }
231
+ interface IconPlacedEvent {
232
+ element: HTMLElement;
233
+ field: string;
234
+ iconElement: HTMLElement;
235
+ classes: IconOptions;
236
+ }
237
+ interface IconSetEvent {
238
+ element: HTMLElement;
239
+ field: string;
240
+ status: string;
241
+ iconElement: HTMLElement;
242
+ }
243
+ class Icon extends core.Plugin<IconOptions> {
244
+ constructor(opts?: IconOptions);
245
+ }
246
+
247
+ interface InternationalTelephoneInputOptions {
248
+ autoPlaceholder?: string;
249
+ field: string | string[];
250
+ message: string;
251
+ utilsScript?: string;
252
+ }
253
+ class InternationalTelephoneInput extends core.Plugin<InternationalTelephoneInputOptions> {
254
+ constructor(opts?: InternationalTelephoneInputOptions);
255
+ static INT_TEL_VALIDATOR: string;
256
+ }
257
+
258
+ interface LiteralMessage {
259
+ [locale: string]: string;
260
+ }
261
+ type CallbackMessage = (field: string, validator: string) => LiteralMessage;
262
+ interface L10nOptions {
263
+ [field: string]: {
264
+ [validator: string]: LiteralMessage | CallbackMessage,
265
+ };
266
+ }
267
+ class L10n extends core.Plugin<L10nOptions> {
268
+ constructor(opts?: L10nOptions);
269
+ }
270
+
271
+ interface MailgunOptions {
272
+ // The API key provided by Mailgun
273
+ apiKey: string;
274
+ // The field name that will be validated
275
+ field: string;
276
+ // Error message indicates the input is not valid
277
+ message: string;
278
+ // Show suggestion if the email is not valid
279
+ suggestion?: boolean;
280
+ }
281
+ class Mailgun extends core.Plugin<MailgunOptions> {
282
+ constructor(opts?: MailgunOptions);
283
+ }
284
+
285
+ interface MandatoryIconOptions {
286
+ icon: string;
287
+ }
288
+ class MandatoryIcon extends core.Plugin<MandatoryIconOptions> {
289
+ constructor(opts?: MandatoryIconOptions);
290
+ }
291
+
292
+ interface PasswordStrengthOptions {
293
+ field: string;
294
+ message: string;
295
+ minimalScore: number;
296
+ onValidated?: (valid: boolean, message: string, score: number) => void;
297
+ }
298
+ class PasswordStrength extends core.Plugin<PasswordStrengthOptions> {
299
+ constructor(opts?: PasswordStrengthOptions);
300
+ static PASSWORD_STRENGTH_VALIDATOR: string;
301
+ }
302
+
303
+ type ContainerCallback = (field: string, element: HTMLElement) => HTMLElement;
304
+ interface MessageOptions {
305
+ clazz?: string;
306
+ container?: string | ContainerCallback;
307
+ }
308
+ class Message extends core.Plugin<MessageOptions> {
309
+ constructor(opts?: MessageOptions);
310
+ static getClosestContainer(element: HTMLElement, upper: HTMLElement, pattern: RegExp): HTMLElement;
311
+ }
312
+
313
+ interface RecaptchaOptions {
314
+ // The ID of element showing the captcha
315
+ element: string;
316
+ // The language code defined by reCAPTCHA
317
+ // See https://developers.google.com/recaptcha/docs/language
318
+ language?: string;
319
+ // The invalid message that will be shown in case the captcha is not valid
320
+ // You don't need to define it if the back-end URL above returns the message
321
+ message: string;
322
+ // The site key provided by Google
323
+ siteKey: string;
324
+ backendVerificationUrl?: string;
325
+
326
+ // The size of widget. It can be 'compact', 'normal' (default), or 'invisible'
327
+ size?: string;
328
+
329
+ // reCAPTCHA widget option (size can be 'compact' or 'normal')
330
+ // See https://developers.google.com/recaptcha/docs/display
331
+
332
+ // The theme name provided by Google. It can be light (default), dark
333
+ theme?: string;
334
+
335
+ // Invisible reCAPTCHA
336
+ // See https://developers.google.com/recaptcha/docs/invisible
337
+ // The position of reCAPTCHA. Can be 'bottomright' (default), 'bottomleft', 'inline'
338
+ badge?: string;
339
+ }
340
+ class Recaptcha extends core.Plugin<RecaptchaOptions> {
341
+ constructor(opts?: RecaptchaOptions);
342
+ static CAPTCHA_FIELD: string;
343
+ }
344
+
345
+ interface Recaptcha3Options {
346
+ // The ID of element showing the captcha error
347
+ element: string;
348
+ // The language code defined by reCAPTCHA
349
+ // See https://developers.google.com/recaptcha/docs/language
350
+ language?: string;
351
+ // Minimum score, between 0 and 1
352
+ minimumScore?: number;
353
+ // The invalid message that will be shown in case the captcha is not valid
354
+ // You don't need to define it if the back-end URL above returns the message
355
+ message: string;
356
+ // The site key provided by Google
357
+ siteKey: string;
358
+ backendVerificationUrl: string;
359
+ action: string;
360
+ }
361
+ class Recaptcha3 extends core.Plugin<Recaptcha3Options> {
362
+ constructor(opts?: Recaptcha3Options);
363
+ static CAPTCHA_FIELD: string;
364
+ }
365
+
366
+ interface Recaptcha3TokenOptions {
367
+ action: string;
368
+ hiddenTokenName: string;
369
+ language?: string;
370
+ siteKey: string;
371
+ }
372
+ class Recaptcha3Token extends core.Plugin<Recaptcha3TokenOptions> {
373
+ constructor(opts?: Recaptcha3TokenOptions);
374
+ }
375
+
376
+ interface SequenceOptions {
377
+ enabled: boolean | { [field: string]: boolean };
378
+ }
379
+ class Sequence extends core.Plugin<SequenceOptions> {
380
+ constructor(opts?: SequenceOptions);
381
+ }
382
+
383
+ interface StartEndDateOptions {
384
+ format: string;
385
+ startDate: {
386
+ field: string;
387
+ message: string;
388
+ };
389
+ endDate: {
390
+ field: string;
391
+ message: string;
392
+ };
393
+ }
394
+ class StartEndDate extends core.Plugin<StartEndDateOptions> {
395
+ constructor(opts?: StartEndDateOptions);
396
+ }
397
+
398
+ interface SubmitButtonOptions {
399
+ aspNetButton?: boolean;
400
+ // Allow to query the submit button(s)
401
+ // It's useful in case the submit button is outside of form
402
+ buttons?: (form: HTMLFormElement) => Element[];
403
+ }
404
+ class SubmitButton extends core.Plugin<SubmitButtonOptions> {
405
+ constructor(opts?: SubmitButtonOptions);
406
+ }
407
+
408
+ interface TooltipOptions {
409
+ placement: string;
410
+ trigger: string;
411
+ }
412
+ class Tooltip extends core.Plugin<TooltipOptions> {
413
+ constructor(opts?: TooltipOptions);
414
+ }
415
+
416
+ interface TransformerOptions {
417
+ [field: string]: {
418
+ [validator: string]: (field: string, element: HTMLElement, validator: string) => string,
419
+ };
420
+ }
421
+ class Transformer extends core.Plugin<TransformerOptions> {
422
+ constructor(opts?: TransformerOptions);
423
+ }
424
+
425
+ interface TriggerOptions {
426
+ delay?: number | {
427
+ [field: string]: number,
428
+ };
429
+ event: string | {
430
+ [field: string]: boolean | string,
431
+ };
432
+ // Only perform the validation if the field value exceed this number of characters
433
+ threshold?: number | {
434
+ [field: string]: number,
435
+ };
436
+ }
437
+ class Trigger extends core.Plugin<TriggerOptions> {
438
+ constructor(opts?: TriggerOptions);
439
+ }
440
+
441
+ interface WizardOptions {
442
+ stepSelector: string;
443
+ prevButton: string;
444
+ nextButton: string;
445
+ onStepActive?: (WizardStepEvent) => void;
446
+ onStepInvalid?: (WizardStepEvent) => void;
447
+ onStepValid?: (WizardStepEvent) => void;
448
+ onValid?: (WizardValidEvent) => void;
449
+ activeStepClass?: string;
450
+ isFieldExcluded?: (field: string, element: HTMLElement, elements: HTMLElement[]) => boolean;
451
+ isStepSkipped?:(WizardIsStepSkipped) => boolean;
452
+ stepClass?: string;
453
+ }
454
+ interface WizardStepEvent {
455
+ step: number;
456
+ numSteps: number;
457
+ }
458
+ interface WizardValidEvent {
459
+ numSteps: number;
460
+ }
461
+ interface WizardIsStepSkipped {
462
+ currentStep: number;
463
+ numSteps: number;
464
+ targetStep: number;
465
+ }
466
+ class Wizard extends core.Plugin<WizardOptions> {
467
+ constructor(opts?: WizardOptions);
468
+ static EXCLUDED_PLUGIN: string;
469
+ }
470
+
471
+ // Plugins that supports popular CSS frameworks
472
+
473
+ type RowSelector = (field: string, element: HTMLElement) => string;
474
+ interface FrameworkOptions {
475
+ defaultMessageContainer?: boolean;
476
+ formClass: string;
477
+ messageClass?: string;
478
+ rowInvalidClass: string;
479
+ // A list of CSS classes (separated by a space) that will be added to the row
480
+ rowClasses?: string;
481
+ rowPattern: RegExp;
482
+ rowSelector: string | RowSelector;
483
+ rowValidatingClass?: string;
484
+ rowValidClass: string;
485
+ // A CSS class added to valid element
486
+ eleValidClass?: string;
487
+ // A CSS class added to invalid element
488
+ eleInvalidClass?: string;
489
+ }
490
+ class Framework extends core.Plugin<FrameworkOptions> {
491
+ constructor(opts?: FrameworkOptions);
492
+ }
493
+
494
+ class Bootstrap extends plugins.Framework {
495
+ constructor(opts?: plugins.FrameworkOptions);
496
+ }
497
+ class Bootstrap3 extends plugins.Framework {
498
+ constructor(opts?: plugins.FrameworkOptions);
499
+ }
500
+ class Bootstrap5 extends plugins.Framework {
501
+ constructor(opts?: plugins.FrameworkOptions);
502
+ }
503
+ class Bulma extends plugins.Framework {
504
+ constructor(opts?: plugins.FrameworkOptions);
505
+ }
506
+ class Foundation extends plugins.Framework {
507
+ constructor(opts?: plugins.FrameworkOptions);
508
+ }
509
+ class Materialize extends plugins.Framework {
510
+ constructor(opts?: plugins.FrameworkOptions);
511
+ }
512
+ class Milligram extends plugins.Framework {
513
+ constructor(opts?: plugins.FrameworkOptions);
514
+ }
515
+ class Mini extends plugins.Framework {
516
+ constructor(opts?: plugins.FrameworkOptions);
517
+ }
518
+ class Mui extends plugins.Framework {
519
+ constructor(opts?: plugins.FrameworkOptions);
520
+ }
521
+ class Pure extends plugins.Framework {
522
+ constructor(opts?: plugins.FrameworkOptions);
523
+ }
524
+ class Semantic extends plugins.Framework {
525
+ constructor(opts?: plugins.FrameworkOptions);
526
+ }
527
+ class Shoelace extends plugins.Framework {
528
+ constructor(opts?: plugins.FrameworkOptions);
529
+ }
530
+ class Spectre extends plugins.Framework {
531
+ constructor(opts?: plugins.FrameworkOptions);
532
+ }
533
+ class Tachyons extends plugins.Framework {
534
+ constructor(opts?: plugins.FrameworkOptions);
535
+ }
536
+ class Turret extends plugins.Framework {
537
+ constructor(opts?: plugins.FrameworkOptions);
538
+ }
539
+ class Uikit extends plugins.Framework {
540
+ constructor(opts?: plugins.FrameworkOptions);
541
+ }
542
+ }
543
+
544
+ // Utils
545
+ // -----
546
+ namespace utils {
547
+ function call(functionName: ((...arg: unknown[]) => unknown) | string, args: unknown[]): unknown;
548
+ function classSet(element: HTMLElement, classes: { [clazz: string]: boolean }): void;
549
+ function closest(element: HTMLElement, selector: string): HTMLElement;
550
+
551
+ interface FetchOptions {
552
+ // Does it request to other domain? Default value is `false`
553
+ crossDomain?: boolean;
554
+ // Additional headers
555
+ headers?: {
556
+ [name: string]: string,
557
+ };
558
+ // The request method. For example, `GET` (default), `POST`
559
+ method?: string;
560
+ params: {
561
+ [name: string]: unknown,
562
+ };
563
+ }
564
+ function fetch(url: string, options: FetchOptions): Promise<unknown>;
565
+
566
+ function format(message: string, parameters: string | string[]): string;
567
+ function hasClass(element: HTMLElement, clazz: string): boolean;
568
+ function isValidDate(year: number, month: number, day: number, notInFuture?: boolean): boolean;
569
+ }
570
+
571
+ // Validators
572
+ // ----------
573
+ namespace validators {
574
+ function base64(): {
575
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
576
+ };
577
+
578
+ interface BetweenOptions extends core.ValidateOptions {
579
+ // Default is true
580
+ inclusive: boolean;
581
+ max?: number;
582
+ min?: number;
583
+ }
584
+ interface BetweenLocalization extends core.Localization {
585
+ between: {
586
+ default: string,
587
+ notInclusive: string,
588
+ };
589
+ }
590
+ function between(): {
591
+ validate(input: core.ValidateInput<BetweenOptions, BetweenLocalization>): core.ValidateResult,
592
+ };
593
+
594
+ function bic(): {
595
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
596
+ };
597
+ function blank(): {
598
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
599
+ };
600
+
601
+ interface CallbackOptions extends core.ValidateOptions {
602
+ callback: ((...arg: unknown[]) => unknown) | string;
603
+ }
604
+ function callback(): {
605
+ validate(input: core.ValidateInput<CallbackOptions, core.Localization>): core.ValidateResult,
606
+ };
607
+
608
+ interface ChoiceOptions extends core.ValidateOptions {
609
+ max?: number;
610
+ min?: number;
611
+ }
612
+ interface ChoiceLocalization extends core.Localization {
613
+ choice: {
614
+ between: string,
615
+ default: string,
616
+ less: string,
617
+ more: string,
618
+ };
619
+ }
620
+ function choice(): {
621
+ validate(input: core.ValidateInput<ChoiceOptions, ChoiceLocalization>): core.ValidateResult,
622
+ };
623
+
624
+ interface ColorOptions extends core.ValidateOptions {
625
+ // The array of valid color types
626
+ // For example: 'hex', 'hex rgb', ['hex', 'rgb']
627
+ type: string | string[];
628
+ }
629
+ function color(): {
630
+ validate(input: core.ValidateInput<ColorOptions, core.Localization>): core.ValidateResult,
631
+ };
632
+
633
+ function creditCard(): {
634
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
635
+ };
636
+ function cusip(): {
637
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
638
+ };
639
+
640
+ type CompareDateCallback = () => (string | Date);
641
+ interface DateOptions extends core.ValidateOptions {
642
+ // The date format. Default is MM/DD/YYYY
643
+ // The format can be:
644
+ // - date: Consist of DD, MM, YYYY parts which are separated by the separator option
645
+ // - date and time: The time can consist of h, m, s parts which are separated by :
646
+ // - date, time and A (indicating AM or PM)
647
+ format: string;
648
+ // The maximum date
649
+ max?: string | Date | CompareDateCallback;
650
+ // The minimum date
651
+ min?: string | Date | CompareDateCallback;
652
+ // Use to separate the date, month, and year. By default, it is /
653
+ separator?: string;
654
+ }
655
+ interface DateLocalization extends core.Localization {
656
+ date: {
657
+ default: string,
658
+ max: string,
659
+ min: string,
660
+ range: string,
661
+ };
662
+ }
663
+ function date(): {
664
+ validate(input: core.ValidateInput<DateOptions, DateLocalization>): core.ValidateResult,
665
+ };
666
+
667
+ type CompareDifferentCallback = () => string;
668
+ interface DifferentOptions extends core.ValidateOptions {
669
+ compare: string | CompareDifferentCallback;
670
+ }
671
+ function different(): {
672
+ validate(input: core.ValidateInput<DifferentOptions, core.Localization>): core.ValidateResult,
673
+ };
674
+
675
+ function digits(): {
676
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
677
+ };
678
+ function ean(): {
679
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
680
+ };
681
+ function ein(): {
682
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
683
+ };
684
+
685
+ interface EmailAddressOptions extends core.ValidateOptions {
686
+ // Allow multiple email addresses, separated by a comma or semicolon; default is false.
687
+ multiple?: boolean | string;
688
+ // Regex for character or characters expected as separator between addresses
689
+ // default is comma /[,;]/, i.e. comma or semicolon.
690
+ separator?: string | RegExp;
691
+ }
692
+ function emailAddress(): {
693
+ validate(input: core.ValidateInput<EmailAddressOptions, core.Localization>): core.ValidateResult,
694
+ };
695
+
696
+ interface FileOptions extends core.ValidateOptions {
697
+ // The allowed extensions, separated by a comma
698
+ extension: string;
699
+ // The maximum number of files
700
+ maxFiles: number;
701
+ // The maximum size in bytes
702
+ maxSize: number;
703
+ // The maximum size in bytes for all files
704
+ maxTotalSize: number;
705
+ // The minimum number of files
706
+ minFiles: number;
707
+ // The minimum size in bytes
708
+ minSize: number;
709
+ // The minimum size in bytes for all files
710
+ minTotalSize: number;
711
+ // The allowed MIME type, separated by a comma
712
+ type: string;
713
+ }
714
+ function file(): {
715
+ validate(input: core.ValidateInput<FileOptions, core.Localization>): core.ValidateResult,
716
+ };
717
+
718
+ interface GreaterThanOptions extends core.ValidateOptions {
719
+ // Default is true
720
+ inclusive: boolean;
721
+ message: string;
722
+ min?: number;
723
+ }
724
+ interface GreaterThanLocalization extends core.Localization {
725
+ greaterThan: {
726
+ default: string,
727
+ notInclusive: string,
728
+ };
729
+ }
730
+ function greaterThan(): {
731
+ validate(input: core.ValidateInput<GreaterThanOptions, GreaterThanLocalization>): core.ValidateResult,
732
+ };
733
+
734
+ function grid(): {
735
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
736
+ };
737
+ function hex(): {
738
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
739
+ };
740
+
741
+ interface IbanOptions extends core.ValidateOptions {
742
+ // The ISO 3166-1 country code. It can be
743
+ // - A country code
744
+ // - Name of field which its value defines the country code
745
+ // - Name of callback function that returns the country code
746
+ // - A callback function that returns the country code
747
+ country?: string;
748
+ // Set it to true (false) to indicate that the IBAN number must be (not be) from SEPA countries
749
+ sepa?: boolean | string;
750
+ }
751
+ interface IbanLocalization extends core.Localization {
752
+ iban: {
753
+ countries: {
754
+ [countryCode: string]: string,
755
+ },
756
+ country: string,
757
+ default: string,
758
+ };
759
+ }
760
+ function iban(): {
761
+ validate(input: core.ValidateInput<IbanOptions, IbanLocalization>): core.ValidateResult,
762
+ };
763
+
764
+ interface IdOptions extends core.ValidateOptions {
765
+ // The ISO 3166-1 country code. It can be
766
+ // - A country code
767
+ // - A callback function that returns the country code
768
+ country: string | (() => string);
769
+ }
770
+ interface IdLocalization extends core.Localization {
771
+ id: {
772
+ countries: {
773
+ [countryCode: string]: string,
774
+ },
775
+ country: string,
776
+ default: string,
777
+ };
778
+ }
779
+ function id(): {
780
+ validate(input: core.ValidateInput<IdOptions, IdLocalization>): core.ValidateResult,
781
+ };
782
+
783
+ type CompareIdenticalCallback = () => string;
784
+ interface IdenticalOptions extends core.ValidateOptions {
785
+ compare: string | CompareIdenticalCallback;
786
+ }
787
+ function identical(): {
788
+ validate(input: core.ValidateInput<IdenticalOptions, core.Localization>): core.ValidateResult,
789
+ };
790
+
791
+ function imei(): {
792
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
793
+ };
794
+ function imo(): {
795
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
796
+ };
797
+
798
+ interface IntegerOptions extends core.ValidateOptions {
799
+ // The decimal separator. It's '.' by default
800
+ decimalSeparator: string;
801
+ // The thousands separator. It's empty by default
802
+ thousandsSeparator: string;
803
+ }
804
+ function integer(): {
805
+ validate(input: core.ValidateInput<IntegerOptions, core.Localization>): core.ValidateResult,
806
+ };
807
+
808
+ interface IpOptions extends core.ValidateOptions {
809
+ // Enable IPv4 validator, default to true
810
+ ipv4?: boolean;
811
+ // Enable IPv6 validator, default to true
812
+ ipv6?: boolean;
813
+ }
814
+ interface IpLocalization extends core.Localization {
815
+ ip: {
816
+ default: string,
817
+ ipv4: string,
818
+ ipv6: string,
819
+ };
820
+ }
821
+ function ip(): {
822
+ validate(input: core.ValidateInput<IpOptions, IpLocalization>): core.ValidateResult,
823
+ };
824
+
825
+ function isbn(): {
826
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
827
+ };
828
+ function isin(): {
829
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
830
+ };
831
+ function ismn(): {
832
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
833
+ };
834
+ function issn(): {
835
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
836
+ };
837
+
838
+ interface LessThanOptions extends core.ValidateOptions {
839
+ // Default is true
840
+ inclusive: boolean;
841
+ max?: number;
842
+ }
843
+ interface LessThanLocalization extends core.Localization {
844
+ lessThan: {
845
+ default: string,
846
+ notInclusive: string,
847
+ };
848
+ }
849
+ function lessThan(): {
850
+ validate(input: core.ValidateInput<LessThanOptions, LessThanLocalization>): core.ValidateResult,
851
+ };
852
+
853
+ function mac(): {
854
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
855
+ };
856
+ function meid(): {
857
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
858
+ };
859
+
860
+ interface NotEmptyOptions extends core.ValidateOptions {
861
+ trim?: boolean;
862
+ }
863
+ function notEmpty(): {
864
+ validate(input: core.ValidateInput<NotEmptyOptions, core.Localization>): core.ValidateResult,
865
+ };
866
+
867
+ interface NumericOptions extends core.ValidateOptions {
868
+ // The decimal separator. It's '.' by default
869
+ decimalSeparator: string;
870
+ // The thousands separator. It's empty by default
871
+ thousandsSeparator: string;
872
+ }
873
+ function numeric(): {
874
+ validate(input: core.ValidateInput<NumericOptions, core.Localization>): core.ValidateResult,
875
+ };
876
+
877
+ interface PhoneOptions extends core.ValidateOptions {
878
+ // The ISO 3166-1 country code. It can be
879
+ // - A country code
880
+ // - A callback function that returns the country code
881
+ country: string | (() => string);
882
+ }
883
+ interface PhoneLocalization extends core.Localization {
884
+ phone: {
885
+ countries: {
886
+ [countryCode: string]: string,
887
+ },
888
+ country: string,
889
+ default: string,
890
+ };
891
+ }
892
+ function phone(): {
893
+ validate(input: core.ValidateInput<PhoneOptions, PhoneLocalization>): core.ValidateResult,
894
+ };
895
+
896
+ interface PromiseOptions extends core.ValidateOptions {
897
+ promise: (...arg: unknown[]) => unknown | string;
898
+ }
899
+ function promise(): {
900
+ validate(input: core.ValidateInput<PromiseOptions, core.Localization>): core.ValidateResult,
901
+ };
902
+
903
+ interface RegexpOptions extends core.ValidateOptions {
904
+ // If specified, flags can have any combination of JavaScript regular expression flags such as:
905
+ // g: global match
906
+ // i: ignore case
907
+ // m: multiple line
908
+ flags?: string;
909
+ // The regular expression you need to check
910
+ regexp: string | RegExp;
911
+ }
912
+ function regexp(): {
913
+ validate(input: core.ValidateInput<RegexpOptions, core.Localization>): core.ValidateResult,
914
+ };
915
+
916
+ interface RemoteOptions extends core.ValidateOptions {
917
+ url: string;
918
+ // Does it request to other domain? Default value is `false`
919
+ crossDomain?: boolean;
920
+ // By default, it will take the value `{ <fieldName>: <fieldValue> }`
921
+ data?: Record<string, unknown> | ((...arg: unknown[]) => unknown);
922
+ // Additional headers
923
+ headers?: {
924
+ [name: string]: string,
925
+ };
926
+ // Override the field name for the request
927
+ name?: string;
928
+ // Can be GET or POST (default)
929
+ method?: string;
930
+ // The valid key. It's `valid` by default
931
+ // This is useful when connecting to external remote server or APIs provided by 3rd parties
932
+ validKey?: string;
933
+ }
934
+ function remote(): {
935
+ validate(input: core.ValidateInput<RemoteOptions, core.Localization>): core.ValidateResult,
936
+ };
937
+
938
+ function rtn(): {
939
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
940
+ };
941
+ function sedol(): {
942
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
943
+ };
944
+ function siren(): {
945
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
946
+ };
947
+ function siret(): {
948
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
949
+ };
950
+
951
+ interface StepOptions extends core.ValidateOptions {
952
+ baseValue: number;
953
+ step: number;
954
+ }
955
+ interface StepLocalization extends core.Localization {
956
+ step: {
957
+ default: string,
958
+ };
959
+ }
960
+ function step(): {
961
+ validate(input: core.ValidateInput<StepOptions, StepLocalization>): core.ValidateResult,
962
+ };
963
+
964
+ interface StringCaseOptions extends core.ValidateOptions {
965
+ // Can be 'lower' (default) or 'upper'
966
+ case: string;
967
+ }
968
+ interface StringCaseLocalization extends core.Localization {
969
+ stringCase: {
970
+ default: string,
971
+ upper: string,
972
+ };
973
+ }
974
+ function stringCase(): {
975
+ validate(input: core.ValidateInput<StringCaseOptions, StringCaseLocalization>): core.ValidateResult,
976
+ };
977
+
978
+ interface StringLengthOptions extends core.ValidateOptions {
979
+ // At least one of two options is required
980
+ // The min, max keys define the number which the field value compares to. min, max can be
981
+ // - A number
982
+ // - Name of field which its value defines the number
983
+ // - Name of callback function that returns the number
984
+ // - A callback function that returns the number
985
+ max?: number | string;
986
+ min?: number | string;
987
+ // Indicate the length will be calculated after trimming the value or not. It is false, by default
988
+ trim?: boolean | string;
989
+ // Evaluate string length in UTF-8 bytes, default to false
990
+ utf8Bytes?: boolean | string;
991
+ }
992
+ interface StringLengthLocalization extends core.Localization {
993
+ stringLength: {
994
+ between: string,
995
+ default: string,
996
+ less: string,
997
+ more: string,
998
+ };
999
+ }
1000
+ function stringLength(): {
1001
+ validate(input: core.ValidateInput<StringLengthOptions, StringLengthLocalization>): core.ValidateResult,
1002
+ };
1003
+
1004
+ interface UriOptions extends core.ValidateOptions {
1005
+ // Allow the URI without protocol. Default to false
1006
+ allowEmptyProtocol?: boolean | string;
1007
+ // Allow the private and local network IP. Default to false
1008
+ allowLocal?: boolean | string;
1009
+ // The protocols, separated by a comma. Default to "http, https, ftp"
1010
+ protocol?: string;
1011
+ }
1012
+ function uri(): {
1013
+ validate(input: core.ValidateInput<UriOptions, core.Localization>): core.ValidateResult,
1014
+ };
1015
+
1016
+ interface UuidOptions extends core.ValidateOptions {
1017
+ // Can be 3, 4, 5, null
1018
+ version?: string;
1019
+ }
1020
+ interface UuidLocalization extends core.Localization {
1021
+ uuid: {
1022
+ default: string,
1023
+ version: string,
1024
+ };
1025
+ }
1026
+ function uuid(): {
1027
+ validate(input: core.ValidateInput<UuidOptions, UuidLocalization>): core.ValidateResult,
1028
+ };
1029
+
1030
+ interface VatOptions extends core.ValidateOptions {
1031
+ // The ISO 3166-1 country code. It can be
1032
+ // - A country code
1033
+ // - A callback function that returns the country code
1034
+ country: string | (() => string);
1035
+ }
1036
+ interface VatLocalization extends core.Localization {
1037
+ vat: {
1038
+ countries: {
1039
+ [countryCode: string]: string,
1040
+ },
1041
+ country: string,
1042
+ default: string,
1043
+ };
1044
+ }
1045
+ function vat(): {
1046
+ validate(input: core.ValidateInput<VatOptions, VatLocalization>): core.ValidateResult,
1047
+ };
1048
+
1049
+ function vin(): {
1050
+ validate(input: core.ValidateInput<core.ValidateOptions, core.Localization>): core.ValidateResult,
1051
+ };
1052
+
1053
+ interface ZipCodeOptions extends core.ValidateOptions {
1054
+ // The ISO 3166-1 country code. It can be
1055
+ // - A country code
1056
+ // - A callback function that returns the country code
1057
+ country: string | (() => string);
1058
+ }
1059
+ interface ZipCodeLocalization extends core.Localization {
1060
+ zipCode: {
1061
+ countries: {
1062
+ [countryCode: string]: string,
1063
+ },
1064
+ country: string,
1065
+ default: string,
1066
+ };
1067
+ }
1068
+ function zipCode(): {
1069
+ validate(input: core.ValidateInput<ZipCodeOptions, ZipCodeLocalization>): core.ValidateResult,
1070
+ };
1071
+ }
1072
+ }