@nanoporetech-digital/components 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/nano-algolia.cjs.entry.js +5 -1
  4. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  5. package/dist/cjs/nano-components.cjs.js +1 -1
  6. package/dist/cjs/nano-date-input.cjs.entry.js +3 -0
  7. package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nano-field-validator.cjs.entry.js +99 -35
  9. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nano-file-upload.cjs.entry.js +4 -1
  11. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  12. package/dist/cjs/nano-global-search-results.cjs.entry.js +20 -4
  13. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-nav-item_2.cjs.entry.js +1 -0
  15. package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
  16. package/dist/collection/components/accordion/accordion.js +1 -1
  17. package/dist/collection/components/alert/alert.js +1 -1
  18. package/dist/collection/components/algolia/algolia-filter.js +2 -2
  19. package/dist/collection/components/algolia/algolia-input.js +5 -5
  20. package/dist/collection/components/algolia/algolia-results.js +1 -1
  21. package/dist/collection/components/algolia/algolia.js +12 -6
  22. package/dist/collection/components/algolia/algolia.js.map +1 -1
  23. package/dist/collection/components/checkbox/checkbox-group.js +2 -2
  24. package/dist/collection/components/checkbox/checkbox.js +3 -3
  25. package/dist/collection/components/datalist/datalist.js +1 -1
  26. package/dist/collection/components/date-input/date-input.js +11 -8
  27. package/dist/collection/components/date-input/date-input.js.map +1 -1
  28. package/dist/collection/components/date-picker/date-picker.js +5 -5
  29. package/dist/collection/components/details/details.js +1 -1
  30. package/dist/collection/components/dialog/dialog.js +1 -1
  31. package/dist/collection/components/dropdown/dropdown.js +1 -1
  32. package/dist/collection/components/field-validator/field-validator-interface.js +5 -0
  33. package/dist/collection/components/field-validator/field-validator-interface.js.map +1 -0
  34. package/dist/collection/components/field-validator/field-validator.js +166 -50
  35. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  36. package/dist/collection/components/file-upload/file-upload.js +10 -7
  37. package/dist/collection/components/file-upload/file-upload.js.map +1 -1
  38. package/dist/collection/components/global-nav/global-nav.js +4 -4
  39. package/dist/collection/components/global-search-results/global-search-results.css +7 -0
  40. package/dist/collection/components/global-search-results/global-search-results.js +19 -3
  41. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  42. package/dist/collection/components/grid/grid-item.js +1 -1
  43. package/dist/collection/components/icon/icon.js +1 -1
  44. package/dist/collection/components/input/input.js +5 -5
  45. package/dist/collection/components/nav-item/nav-item.js +4 -4
  46. package/dist/collection/components/range/range.js +4 -4
  47. package/dist/collection/components/resize-observe/resize-observe.js +1 -1
  48. package/dist/collection/components/select/select.js +8 -7
  49. package/dist/collection/components/select/select.js.map +1 -1
  50. package/dist/collection/components/slides/slides.js +7 -7
  51. package/dist/collection/components/tabs/tab-group.js +2 -2
  52. package/dist/components/algolia.js +5 -1
  53. package/dist/components/algolia.js.map +1 -1
  54. package/dist/components/nano-date-input.js +3 -0
  55. package/dist/components/nano-date-input.js.map +1 -1
  56. package/dist/components/nano-field-validator.js +103 -37
  57. package/dist/components/nano-field-validator.js.map +1 -1
  58. package/dist/components/nano-file-upload.js +5 -2
  59. package/dist/components/nano-file-upload.js.map +1 -1
  60. package/dist/components/nano-global-search-results.js +20 -4
  61. package/dist/components/nano-global-search-results.js.map +1 -1
  62. package/dist/components/select.js +1 -0
  63. package/dist/components/select.js.map +1 -1
  64. package/dist/custom-elements/index.js +134 -43
  65. package/dist/custom-elements/index.js.map +1 -1
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/nano-algolia.entry.js +5 -1
  68. package/dist/esm/nano-algolia.entry.js.map +1 -1
  69. package/dist/esm/nano-components.js +1 -1
  70. package/dist/esm/nano-date-input.entry.js +3 -0
  71. package/dist/esm/nano-date-input.entry.js.map +1 -1
  72. package/dist/esm/nano-field-validator.entry.js +99 -35
  73. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  74. package/dist/esm/nano-file-upload.entry.js +4 -1
  75. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  76. package/dist/esm/nano-global-search-results.entry.js +20 -4
  77. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  78. package/dist/esm/nano-nav-item_2.entry.js +1 -0
  79. package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
  80. package/dist/esm-es5/loader.js +1 -1
  81. package/dist/esm-es5/loader.js.map +1 -1
  82. package/dist/esm-es5/nano-algolia.entry.js +1 -1
  83. package/dist/esm-es5/nano-algolia.entry.js.map +1 -1
  84. package/dist/esm-es5/nano-components.js +1 -1
  85. package/dist/esm-es5/nano-components.js.map +1 -1
  86. package/dist/esm-es5/nano-date-input.entry.js +1 -1
  87. package/dist/esm-es5/nano-date-input.entry.js.map +1 -1
  88. package/dist/esm-es5/nano-field-validator.entry.js +1 -1
  89. package/dist/esm-es5/nano-field-validator.entry.js.map +1 -1
  90. package/dist/esm-es5/nano-file-upload.entry.js +1 -1
  91. package/dist/esm-es5/nano-file-upload.entry.js.map +1 -1
  92. package/dist/esm-es5/nano-global-search-results.entry.js +1 -1
  93. package/dist/esm-es5/nano-global-search-results.entry.js.map +1 -1
  94. package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
  95. package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
  96. package/dist/nano-components/nano-components.esm.js +1 -1
  97. package/dist/nano-components/nano-components.esm.js.map +1 -1
  98. package/dist/nano-components/p-018b7047.entry.js +5 -0
  99. package/dist/nano-components/p-018b7047.entry.js.map +1 -0
  100. package/dist/nano-components/{p-86bd5194.entry.js → p-055f7d35.entry.js} +2 -2
  101. package/dist/nano-components/p-055f7d35.entry.js.map +1 -0
  102. package/dist/nano-components/p-2b478ca1.system.entry.js +5 -0
  103. package/dist/nano-components/p-2b478ca1.system.entry.js.map +1 -0
  104. package/dist/nano-components/{p-bc394857.system.entry.js → p-4558a9c6.system.entry.js} +2 -2
  105. package/dist/nano-components/p-4558a9c6.system.entry.js.map +1 -0
  106. package/dist/nano-components/p-53957ec6.system.js +1 -1
  107. package/dist/nano-components/p-53957ec6.system.js.map +1 -1
  108. package/dist/nano-components/{p-d61ae833.system.entry.js → p-596c1711.system.entry.js} +2 -2
  109. package/dist/nano-components/p-596c1711.system.entry.js.map +1 -0
  110. package/dist/nano-components/p-5f4fc2b4.entry.js +5 -0
  111. package/dist/nano-components/p-5f4fc2b4.entry.js.map +1 -0
  112. package/dist/nano-components/p-6a949280.system.entry.js +5 -0
  113. package/dist/nano-components/p-6a949280.system.entry.js.map +1 -0
  114. package/dist/nano-components/{p-bf9aa89d.system.entry.js → p-6af10533.system.entry.js} +3 -3
  115. package/dist/nano-components/p-6af10533.system.entry.js.map +1 -0
  116. package/dist/nano-components/{p-f780d2f6.system.entry.js → p-72893d12.system.entry.js} +2 -2
  117. package/dist/nano-components/p-72893d12.system.entry.js.map +1 -0
  118. package/dist/nano-components/{p-1b120f53.entry.js → p-91614b43.entry.js} +2 -2
  119. package/dist/nano-components/p-91614b43.entry.js.map +1 -0
  120. package/dist/nano-components/{p-4e2c0abb.entry.js → p-ccd6c206.entry.js} +2 -2
  121. package/dist/nano-components/p-ccd6c206.entry.js.map +1 -0
  122. package/dist/nano-components/{p-2720ee8f.entry.js → p-ea54ee12.entry.js} +2 -2
  123. package/dist/nano-components/p-ea54ee12.entry.js.map +1 -0
  124. package/dist/types/components/algolia/algolia.d.ts +1 -0
  125. package/dist/types/components/field-validator/field-validator-interface.d.ts +15 -0
  126. package/dist/types/components/field-validator/field-validator.d.ts +16 -19
  127. package/dist/types/components/file-upload/file-upload.d.ts +2 -1
  128. package/dist/types/components/global-search-results/global-search-results.d.ts +1 -0
  129. package/dist/types/components.d.ts +23 -10
  130. package/dist/types/interface.d.ts +1 -0
  131. package/docs-json.json +45 -11
  132. package/docs-vscode.json +1 -1
  133. package/package.json +2 -2
  134. package/dist/nano-components/p-1b120f53.entry.js.map +0 -1
  135. package/dist/nano-components/p-21d6d31e.system.entry.js +0 -5
  136. package/dist/nano-components/p-21d6d31e.system.entry.js.map +0 -1
  137. package/dist/nano-components/p-2720ee8f.entry.js.map +0 -1
  138. package/dist/nano-components/p-4e2c0abb.entry.js.map +0 -1
  139. package/dist/nano-components/p-86bd5194.entry.js.map +0 -1
  140. package/dist/nano-components/p-bc394857.system.entry.js.map +0 -1
  141. package/dist/nano-components/p-bf9aa89d.system.entry.js.map +0 -1
  142. package/dist/nano-components/p-c3830c43.entry.js +0 -5
  143. package/dist/nano-components/p-c3830c43.entry.js.map +0 -1
  144. package/dist/nano-components/p-d61ae833.system.entry.js.map +0 -1
  145. package/dist/nano-components/p-d93274de.entry.js +0 -5
  146. package/dist/nano-components/p-d93274de.entry.js.map +0 -1
  147. package/dist/nano-components/p-e9a279ee.system.entry.js +0 -5
  148. package/dist/nano-components/p-e9a279ee.system.entry.js.map +0 -1
  149. package/dist/nano-components/p-f780d2f6.system.entry.js.map +0 -1
@@ -107,7 +107,7 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
107
107
  };
108
108
 
109
109
  patchBrowser().then(options => {
110
- return bootstrapLazy(JSON.parse("[[\"nano-global-nav\",[[1,\"nano-global-nav\",{\"env\":[1],\"ssoDataUrl\":[1,\"sso-data-url\"],\"ssoRedirect\":[1,\"sso-redirect\"],\"getMyAccountData\":[4,\"get-my-account-data\"],\"activeMyAccountSections\":[16],\"showSearch\":[4,\"show-search\"],\"showLogo\":[4,\"show-logo\"],\"logoUrl\":[1,\"logo-url\"],\"searchIndeces\":[16],\"myAccountUser\":[1040],\"searchAppId\":[1025,\"search-app-id\"],\"searchApiKey\":[1025,\"search-api-key\"],\"searchValue\":[1025,\"search-value\"],\"searchIndex\":[1025,\"search-index\"],\"cartCount\":[1026,\"cart-count\"],\"msgCount\":[1026,\"msg-count\"],\"cartUrl\":[1025,\"cart-url\"],\"msgUrl\":[1025,\"msg-url\"],\"hasLoggedinSlot\":[32],\"hasSiteSlot\":[32],\"hasPromotionSlot\":[32],\"aboutSlotLen\":[32],\"iconSlotLen\":[32],\"mainSlotLen\":[32],\"overflowSlotLen\":[32],\"searchSlotLen\":[32],\"internalSearchIndeces\":[32],\"thresholdReady\":[32],\"remoteDataReady\":[32],\"ready\":[32],\"isResizing\":[32],\"intersectRatio\":[32],\"threshold\":[32],\"modalOpen\":[32],\"modalIsOpen\":[32],\"searchBarShown\":[32],\"scrollingUp\":[32],\"searchLoading\":[32],\"showAutocomplete\":[32],\"secondaryMenuOpen\":[32],\"userMenuOpen\":[32],\"menuFullScreen\":[32],\"searchValInternal\":[32],\"submitSearch\":[64]},[[0,\"nanoOpen\",\"secondaryOpen\"],[0,\"nanoClose\",\"secondaryClose\"]]]]],[\"nano-hero\",[[1,\"nano-hero\",{\"imgSrc\":[1,\"img-src\"],\"imgSrcSet\":[1,\"img-src-set\"],\"largeScreenBP\":[2,\"large-screen-b-p\"],\"theme\":[1],\"level\":[1],\"gridSizes\":[32],\"hasIconBox\":[32],\"hasScrim\":[32],\"hasSecondaryContent\":[32],\"hasQuote\":[32],\"hasBg\":[32],\"hasBackBtn\":[32],\"hasCtas\":[32],\"breadCrumbs\":[32],\"iconBoxItems\":[32]}]]],[\"nano-date-input\",[[6,\"nano-date-input\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"helperText\":[4,\"helper-text\"],\"helperTextFormat\":[16],\"floatLabel\":[4,\"float-label\"],\"name\":[1],\"readonly\":[4],\"size\":[2],\"form\":[1],\"firstDayOfWeek\":[2,\"first-day-of-week\"],\"localization\":[16],\"disabled\":[4],\"color\":[1],\"autofocus\":[4],\"clearInput\":[4,\"clear-input\"],\"label\":[1],\"placeholder\":[1025],\"value\":[1537],\"validateOn\":[1,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"dateOrder\":[1,\"date-order\"],\"required\":[4],\"min\":[1],\"max\":[1],\"hideLabel\":[4,\"hide-label\"],\"picker\":[4],\"initialPickerDate\":[1,\"initial-picker-date\"],\"pickerOpen\":[1540,\"picker-open\"],\"closeAfterPicked\":[4,\"close-after-picked\"],\"dropDownConfig\":[6160],\"dateValue\":[2064],\"isDateDisabled\":[16],\"pattern\":[32],\"inputValue\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]}]]],[\"nano-dialog\",[[1,\"nano-dialog\",{\"showRibbon\":[4,\"show-ribbon\"],\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"noFooter\":[4,\"no-footer\"],\"noUserDismiss\":[4,\"no-user-dismiss\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"hoist\":[4],\"isVisible\":[32],\"noDismiss\":[32],\"hasFooter\":[32],\"show\":[64],\"hide\":[64]}]]],[\"nano-file-upload\",[[6,\"nano-file-upload\",{\"name\":[1],\"accept\":[1],\"capture\":[1],\"maxFileSize\":[2,\"max-file-size\"],\"maxFiles\":[2,\"max-files\"],\"label\":[1],\"placeholder\":[1],\"hideLabel\":[4,\"hide-label\"],\"required\":[4],\"disabled\":[516],\"clearInput\":[4,\"clear-input\"],\"showInlineError\":[516,\"show-inline-error\"],\"validateOn\":[1025,\"validate-on\"],\"form\":[1],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"files\":[2064],\"value\":[6145],\"hasHelperSlot\":[32],\"hasLabelSlot\":[32],\"errorMessage\":[32],\"isDragging\":[32],\"fileList\":[32],\"hasFocus\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]},[[8,\"click\",\"globalClickHandler\"],[8,\"keydown\",\"globalKeydownHandler\"],[16,\"reset\",\"onReset\"]]]]],[\"nano-alert\",[[1,\"nano-alert\",{\"open\":[1540],\"closable\":[516],\"color\":[513],\"duration\":[2],\"isModal\":[32],\"isToast\":[32],\"isShowing\":[32],\"label\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64],\"alert\":[64]}]]],[\"nano-global-search-results\",[[1,\"nano-global-search-results\",{\"algoliaEle\":[32],\"currentWidth\":[32],\"apiKey\":[32],\"appId\":[32],\"index\":[32]},[[16,\"nanoSearchReset\",\"handleGlobalNavReset\"],[16,\"nanoSearchResult\",\"handleGlobalNavSearch\"],[0,\"nanoChange\",\"handleReorder\"],[0,\"nanoResultsShown\",\"attachListeners\"],[16,\"nanoNewResults\",\"attachResultListeners\"]]]]],[\"nano-tab\",[[1,\"nano-tab\",{\"panel\":[513],\"active\":[516],\"disabled\":[516],\"closable\":[4],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"nano-menu-drawer\",[[1,\"nano-menu-drawer\",{\"open\":[4],\"saveState\":[4,\"save-state\"],\"hideWidth\":[2,\"hide-width\"],\"hideHeight\":[4,\"hide-height\"],\"reset\":[32],\"widthOk\":[32],\"heightOk\":[32],\"isLoading\":[32],\"hide\":[32]},[[0,\"nanoOpen\",\"cancelNavItemEvents\"],[0,\"nanoClose\",\"cancelNavItemEvents\"],[16,\"nanoIsReady\",\"handleGlobalNavReady\"]]]]],[\"nano-split-pane\",[[1,\"nano-split-pane\",{\"position\":[6146],\"positionInPixels\":[1026,\"position-in-pixels\"],\"vertical\":[516],\"disabled\":[516],\"primary\":[1],\"snap\":[1],\"snapThreshold\":[2,\"snap-threshold\"],\"animationDuration\":[2,\"animation-duration\"],\"getPercentageToPixels\":[64],\"getPixelsToPercentage\":[64]}]]],[\"nano-tab-group\",[[1,\"nano-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"color\":[1],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"disableSwipe\":[4,\"disable-swipe\"],\"hasScrollControls\":[32],\"hideControlRight\":[32],\"hideControlLeft\":[32],\"isLegacy\":[32],\"tab\":[32],\"show\":[64]},[[0,\"nanoTabClose\",\"handleTabClose\"]]]]],[\"nano-accordion\",[[1,\"nano-accordion\",{\"color\":[1],\"itemOpened\":[32]},[[0,\"nanoOpened\",\"onToggleHandler\"],[0,\"nanoClosed\",\"onClosedHandler\"]]]]],[\"nano-algolia-filter\",[[1,\"nano-algolia-filter\",{\"filterName\":[1,\"filter-name\"],\"value\":[1025],\"operator\":[1],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"changeEvent\":[32],\"internalValue\":[32],\"showFilter\":[32],\"indexResults\":[32],\"filterChanged\":[32],\"facets\":[32],\"tplRenderFn\":[32],\"globalStoreMethod\":[32]},[[0,\"nanoChange\",\"handleChangeEvent\"],[0,\"change\",\"handleChangeEvent\"]]]]],[\"nano-algolia-input\",[[1,\"nano-algolia-input\",{\"appId\":[1,\"app-id\"],\"apiKey\":[1,\"api-key\"],\"searchIndex\":[1040],\"searchIndexName\":[1,\"search-index-name\"],\"minChars\":[2,\"min-chars\"],\"autoEmit\":[4,\"auto-emit\"],\"browseIndex\":[1028,\"browse-index\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"searchStr\":[32],\"algoliaIndex\":[32],\"currentResults\":[32],\"search\":[64]},[[0,\"nanoChange\",\"searchSubmit\"]]]]],[\"nano-algolia-pagination\",[[1,\"nano-algolia-pagination\",{\"maxToShow\":[2,\"max-to-show\"],\"currentPage\":[32],\"canGoPrev\":[32],\"canGoNext\":[32],\"show\":[32],\"tplRenderFn\":[32],\"indexResults\":[32],\"infiniteScroll\":[32],\"nextPage\":[64],\"prevPage\":[64],\"goToPage\":[64]}]]],[\"nano-algolia-results\",[[1,\"nano-algolia-results\",{\"infiniteScroll\":[4,\"infinite-scroll\"],\"appendPages\":[4,\"append-pages\"],\"showResults\":[32],\"tplRenderFn\":[32],\"results\":[32],\"indexResults\":[32],\"resultsPage\":[32],\"changeEvent\":[32],\"facets\":[32],\"isLoading\":[32]}]]],[\"nano-aspect-ratio\",[[1,\"nano-aspect-ratio\",{\"aspectRatio\":[1,\"aspect-ratio\"],\"fit\":[1]}]]],[\"nano-checkbox\",[[6,\"nano-checkbox\",{\"hasFocus\":[1540,\"has-focus\"],\"checked\":[1540],\"disabled\":[516],\"value\":[513],\"name\":[513],\"required\":[516],\"type\":[513],\"label\":[1],\"indeterminate\":[1540],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"form\":[1],\"inputType\":[32],\"_invalid\":[32],\"getInputElement\":[64],\"reportValidity\":[64],\"setError\":[64],\"setFocus\":[64],\"removeFocus\":[64]},[[16,\"reset\",\"onReset\"]]]]],[\"nano-checkbox-group\",[[6,\"nano-checkbox-group\",{\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[4,\"show-inline-error\"],\"min\":[2],\"max\":[2],\"disabled\":[516],\"legend\":[1],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"checkboxes\":[32],\"nativeCbs\":[32],\"errorMessage\":[32],\"showErrorMsg\":[32],\"hasHelperSlot\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"showError\":[64]},[[0,\"nanoChange\",\"handleCbChange\"]]]]],[\"nano-details\",[[1,\"nano-details\",{\"label\":[1],\"open\":[1540],\"noHandle\":[4,\"no-handle\"],\"iconRotation\":[2,\"icon-rotation\"],\"color\":[1],\"isLoading\":[32]}]]],[\"nano-drawer\",[[1,\"nano-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"type\":[1],\"contentSelector\":[1,\"content-selector\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"nano-field-validator\",[[4,\"nano-field-validator\",{\"validateOn\":[1025,\"validate-on\"],\"scrollToInvalid\":[4,\"scroll-to-invalid\"],\"dirty\":[2564],\"valid\":[2564],\"payload\":[2064],\"showValidation\":[2052,\"show-validation\"],\"validationState\":[2064],\"validation\":[16],\"store\":[32],\"userForm\":[32],\"submitted\":[32],\"_dirty\":[32],\"_valid\":[32]}]]],[\"nano-range\",[[6,\"nano-range\",{\"color\":[1],\"debounce\":[2],\"name\":[1],\"dualKnobs\":[4,\"dual-knobs\"],\"min\":[2],\"max\":[2],\"pin\":[4],\"snaps\":[4],\"step\":[2],\"ticks\":[4],\"disabled\":[4],\"value\":[1026],\"ratioA\":[32],\"ratioB\":[32],\"pressedKnob\":[32]}]]],[\"nano-rating\",[[2,\"nano-rating\",{\"value\":[1538],\"max\":[2],\"precision\":[2],\"readonly\":[4],\"disabled\":[4],\"name\":[1],\"symbolName\":[1,\"symbol-name\"],\"symbol\":[16],\"hoverValue\":[32],\"isHovering\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"nano-slide\",[[1,\"nano-slide\",{\"ready\":[1540]}]]],[\"nano-slides\",[[1,\"nano-slides\",{\"options\":[1040],\"navbtns\":[4],\"pager\":[4],\"fullscreenbtn\":[4],\"fullscreen\":[1540],\"animation\":[513],\"currentSlide\":[1538,\"current-slide\"],\"autoplay\":[8],\"ready\":[1540],\"iCurrentSlide\":[32],\"slidesReady\":[32],\"didInit\":[32],\"update\":[64],\"updateAutoHeight\":[64],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"getActiveIndex\":[64],\"length\":[64],\"isEnd\":[64],\"isBeginning\":[64],\"startAutoplay\":[64],\"stopAutoplay\":[64],\"lockSwipes\":[64],\"getflickity\":[64],\"reload\":[64]}]]],[\"nano-tab-content\",[[1,\"nano-tab-content\",{\"name\":[513],\"active\":[516]}]]],[\"nano-algolia\",[[1,\"nano-algolia\",{\"showResults\":[1028,\"show-results\"],\"resultsPage\":[1026,\"results-page\"],\"appId\":[1025,\"app-id\"],\"apiKey\":[1025,\"api-key\"],\"searchIndex\":[1040],\"searchIndexName\":[1025,\"search-index-name\"],\"listenTo\":[1,\"listen-to\"],\"query\":[1025],\"operator\":[1],\"filters\":[16],\"tplEngine\":[16],\"tplRenderFn\":[16],\"replicaIndex\":[1025,\"replica-index\"],\"browseIndex\":[1028,\"browse-index\"],\"minChars\":[2,\"min-chars\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"_dynFacetFilters\":[32],\"inputField\":[32],\"algoliaIndex\":[32],\"indeces\":[32],\"resultsEmitterEle\":[32],\"indexResults\":[32],\"filterChanged\":[32],\"currentHits\":[32],\"changeEvent\":[32],\"isLoading\":[32],\"wormholeState\":[32],\"removeFilters\":[64]},[[0,\"nanoTplUpdated\",\"onAllTplUpdate\"],[0,\"nanoPageChanged\",\"onPageChange\"],[0,\"nanoFilterChanged\",\"onFilterChange\"],[16,\"nanoChange\",\"handleInputChange\"],[16,\"change\",\"handleInputChange\"]]]]],[\"nano-date-picker\",[[1,\"nano-date-picker\",{\"selectedDate\":[1025,\"selected-date\"],\"min\":[1],\"max\":[1],\"firstDayOfWeek\":[2,\"first-day-of-week\"],\"localization\":[16],\"color\":[1],\"isDateDisabled\":[16],\"isModal\":[4,\"is-modal\"],\"firstFocusEle\":[16],\"activeFocus\":[32],\"focusedDay\":[32],\"setFocus\":[64]}]]],[\"nano-tooltip\",[[1,\"nano-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"nano-spinner\",[[1,\"nano-spinner\",{\"type\":[1],\"overlay\":[516],\"hasText\":[32]}]]],[\"nano-sticker\",[[1,\"nano-sticker\",{\"autoResize\":[4,\"auto-resize\"],\"isSticky\":[1028,\"is-sticky\"],\"offset\":[1026],\"position\":[1],\"quietMode\":[1,\"quiet-mode\"],\"hideOnNewStickers\":[4,\"hide-on-new-stickers\"],\"breakPointMax\":[2,\"break-point-max\"],\"breakPointMin\":[2,\"break-point-min\"],\"scrollParent\":[1040],\"stickTo\":[1,\"stick-to\"],\"isStuck\":[32],\"isRootSticker\":[32],\"hide\":[32],\"scrollHide\":[32],\"multiStickerHide\":[32],\"scrollingTo\":[32],\"quietModeIsOn\":[32],\"stuckCounter\":[32],\"stickerIndex\":[32],\"stickToEle\":[32],\"triggerPos\":[32],\"trigger\":[32],\"_offset\":[32],\"isHiding\":[64],\"isSticking\":[64],\"setTriggerPos\":[64],\"getTriggerPos\":[64],\"pauseHiding\":[64]}]]],[\"nano-icon-button\",[[2,\"nano-icon-button\",{\"iconName\":[1,\"icon-name\"],\"iconSrc\":[1,\"icon-src\"],\"type\":[513],\"name\":[513],\"value\":[513],\"label\":[1],\"disabled\":[516],\"href\":[1],\"target\":[1],\"setFocus\":[64]}]]],[\"nano-resize-observe_2\",[[1,\"nano-resize-observe\",{\"states\":[1],\"currentWidth\":[32],\"currentHeight\":[32],\"classNames\":[32]}],[1,\"nano-skeleton\",{\"animated\":[4]}]]],[\"nano-dropdown\",[[1,\"nano-dropdown\",{\"autoOpen\":[4,\"auto-open\"],\"open\":[1540],\"closeOnSelect\":[4,\"close-on-select\"],\"containingElement\":[1040],\"tetherTo\":[16],\"placement\":[1],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"dialogTitle\":[1,\"dialog-title\"],\"show\":[64],\"hide\":[64]},[[0,\"nanoOpen\",\"secondaryOpen\"],[0,\"nanoClose\",\"secondaryClose\"],[0,\"nanoSelect\",\"handlePanelSelect\"]]]]],[\"nano-icon\",[[1,\"nano-icon\",{\"color\":[1],\"ariaLabel\":[1537,\"aria-label\"],\"flipRtl\":[4,\"flip-rtl\"],\"name\":[1],\"src\":[1],\"icon\":[8],\"size\":[1],\"lazy\":[4],\"svgContent\":[32],\"isVisible\":[32],\"isLoading\":[32]}]]],[\"nano-datalist_3\",[[1,\"nano-datalist\",{\"selected\":[1040],\"dropDownConfig\":[6160],\"options\":[16],\"input\":[1],\"type\":[1],\"activeOptions\":[2064],\"open\":[1028],\"disableFilter\":[4,\"disable-filter\"],\"disabled\":[4],\"actvOptEles\":[32],\"connectedInput\":[32],\"inputLabel\":[32],\"hasNoResult\":[32],\"shouldOpen\":[32],\"canOpen\":[32],\"optionIds\":[32]}],[1,\"nano-option\",{\"value\":[1537],\"label\":[1537],\"selected\":[516],\"disabled\":[516],\"filterMeta\":[1,\"filter-meta\"],\"hasFocus\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[1,\"nano-menu\",{\"hasFocus\":[2052,\"has-focus\"],\"type\":[1],\"label\":[1],\"setFocus\":[64],\"removeFocus\":[64],\"showActiveElement\":[64],\"resetActiveItem\":[64]},[[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]]]],[\"nano-nav-item_2\",[[6,\"nano-select\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"autofocus\":[4],\"disabled\":[516],\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"label\":[1],\"hideLabel\":[4,\"hide-label\"],\"floatLabel\":[4,\"float-label\"],\"multiple\":[4],\"name\":[1],\"placeholder\":[1],\"readonly\":[516],\"required\":[4],\"size\":[2],\"max\":[2],\"min\":[2],\"form\":[1],\"allowCustomValues\":[4,\"allow-custom-values\"],\"value\":[6145],\"options\":[6160],\"clearSelect\":[4,\"clear-select\"],\"mask\":[4],\"debounce\":[2],\"dropDownConfig\":[1040],\"currInsertIndex\":[32],\"showErrorMsg\":[32],\"errorMessage\":[32],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"hasHelperSlot\":[32],\"hasHelperEndSlot\":[32],\"inputSearchVal\":[32],\"_invalid\":[32],\"_eOptions\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getSelectElement\":[64],\"showError\":[64]},[[16,\"reset\",\"onReset\"],[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]],[1,\"nano-nav-item\",{\"href\":[1025],\"target\":[1],\"disabled\":[4],\"open\":[1540],\"selected\":[516],\"secondaryActiveWidth\":[2,\"secondary-active-width\"],\"secondaryFallback\":[16],\"closeOnBlur\":[4,\"close-on-blur\"],\"notification\":[4],\"didOpen\":[32],\"isInGlobalNav\":[32],\"isInMenuDrawer\":[32],\"isInMenu\":[32],\"isLegacy\":[32],\"hasFocus\":[32],\"setFocus\":[64]}]]],[\"nano-input\",[[6,\"nano-input\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"accept\":[1],\"autocapitalise\":[1],\"autocomplete\":[1],\"autocorrect\":[1],\"autofocus\":[4],\"clearInput\":[4,\"clear-input\"],\"clearOnEdit\":[4,\"clear-on-edit\"],\"debounce\":[2],\"disabled\":[516],\"inputmode\":[1],\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"label\":[1],\"hideLabel\":[4,\"hide-label\"],\"floatLabel\":[4,\"float-label\"],\"max\":[1],\"maxlength\":[2],\"min\":[1],\"minlength\":[2],\"multiple\":[4],\"name\":[1],\"pattern\":[1],\"placeholder\":[1],\"readonly\":[516],\"required\":[4],\"spellcheck\":[4],\"step\":[1],\"size\":[2],\"type\":[513],\"form\":[1],\"value\":[1025],\"resize\":[1],\"rows\":[2],\"showCharCount\":[4,\"show-char-count\"],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"hasHelperSlot\":[32],\"hasHelperEndSlot\":[32],\"errorMessage\":[32],\"datalist\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]},[[16,\"reset\",\"onReset\"],[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]]]],[\"nano-grid_3\",[[1,\"nano-img\",{\"alt\":[1],\"src\":[1],\"srcSet\":[1,\"src-set\"],\"lazy\":[4],\"background\":[4],\"autoHeight\":[1,\"auto-height\"],\"loadSrc\":[32],\"loadError\":[32],\"hasLoaded\":[32],\"imgStates\":[32],\"_src\":[32]}],[1,\"nano-grid\",{\"sSize\":[2,\"s-size\"],\"mSize\":[2,\"m-size\"],\"lSize\":[2,\"l-size\"],\"xlSize\":[2,\"xl-size\"],\"sCols\":[2,\"s-cols\"],\"mCols\":[2,\"m-cols\"],\"lCols\":[2,\"l-cols\"],\"xlCols\":[2,\"xl-cols\"],\"xxlCols\":[2,\"xxl-cols\"],\"showHelper\":[516,\"show-helper\"],\"contentPanel\":[516,\"content-panel\"],\"fullHeight\":[516,\"full-height\"],\"ready\":[32],\"isSmall\":[32],\"isMedium\":[32],\"isLarge\":[32],\"isXL\":[32],\"isXXL\":[32]}],[1,\"nano-grid-item\",{\"gridStates\":[1,\"grid-states\"],\"changeBP\":[64]}]]]]"), options);
110
+ return bootstrapLazy(JSON.parse("[[\"nano-global-nav\",[[1,\"nano-global-nav\",{\"env\":[1],\"ssoDataUrl\":[1,\"sso-data-url\"],\"ssoRedirect\":[1,\"sso-redirect\"],\"getMyAccountData\":[4,\"get-my-account-data\"],\"activeMyAccountSections\":[16],\"showSearch\":[4,\"show-search\"],\"showLogo\":[4,\"show-logo\"],\"logoUrl\":[1,\"logo-url\"],\"searchIndeces\":[16],\"myAccountUser\":[1040],\"searchAppId\":[1025,\"search-app-id\"],\"searchApiKey\":[1025,\"search-api-key\"],\"searchValue\":[1025,\"search-value\"],\"searchIndex\":[1025,\"search-index\"],\"cartCount\":[1026,\"cart-count\"],\"msgCount\":[1026,\"msg-count\"],\"cartUrl\":[1025,\"cart-url\"],\"msgUrl\":[1025,\"msg-url\"],\"hasLoggedinSlot\":[32],\"hasSiteSlot\":[32],\"hasPromotionSlot\":[32],\"aboutSlotLen\":[32],\"iconSlotLen\":[32],\"mainSlotLen\":[32],\"overflowSlotLen\":[32],\"searchSlotLen\":[32],\"internalSearchIndeces\":[32],\"thresholdReady\":[32],\"remoteDataReady\":[32],\"ready\":[32],\"isResizing\":[32],\"intersectRatio\":[32],\"threshold\":[32],\"modalOpen\":[32],\"modalIsOpen\":[32],\"searchBarShown\":[32],\"scrollingUp\":[32],\"searchLoading\":[32],\"showAutocomplete\":[32],\"secondaryMenuOpen\":[32],\"userMenuOpen\":[32],\"menuFullScreen\":[32],\"searchValInternal\":[32],\"submitSearch\":[64]},[[0,\"nanoOpen\",\"secondaryOpen\"],[0,\"nanoClose\",\"secondaryClose\"]]]]],[\"nano-hero\",[[1,\"nano-hero\",{\"imgSrc\":[1,\"img-src\"],\"imgSrcSet\":[1,\"img-src-set\"],\"largeScreenBP\":[2,\"large-screen-b-p\"],\"theme\":[1],\"level\":[1],\"gridSizes\":[32],\"hasIconBox\":[32],\"hasScrim\":[32],\"hasSecondaryContent\":[32],\"hasQuote\":[32],\"hasBg\":[32],\"hasBackBtn\":[32],\"hasCtas\":[32],\"breadCrumbs\":[32],\"iconBoxItems\":[32]}]]],[\"nano-date-input\",[[6,\"nano-date-input\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"helperText\":[4,\"helper-text\"],\"helperTextFormat\":[16],\"floatLabel\":[4,\"float-label\"],\"name\":[1],\"readonly\":[4],\"size\":[2],\"form\":[1],\"firstDayOfWeek\":[2,\"first-day-of-week\"],\"localization\":[16],\"disabled\":[4],\"color\":[1],\"autofocus\":[4],\"clearInput\":[4,\"clear-input\"],\"label\":[1],\"placeholder\":[1025],\"value\":[1537],\"validateOn\":[1,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"dateOrder\":[1,\"date-order\"],\"required\":[4],\"min\":[1],\"max\":[1],\"hideLabel\":[4,\"hide-label\"],\"picker\":[4],\"initialPickerDate\":[1,\"initial-picker-date\"],\"pickerOpen\":[1540,\"picker-open\"],\"closeAfterPicked\":[4,\"close-after-picked\"],\"dropDownConfig\":[6160],\"dateValue\":[2064],\"isDateDisabled\":[16],\"pattern\":[32],\"inputValue\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]}]]],[\"nano-dialog\",[[1,\"nano-dialog\",{\"showRibbon\":[4,\"show-ribbon\"],\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"noFooter\":[4,\"no-footer\"],\"noUserDismiss\":[4,\"no-user-dismiss\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"hoist\":[4],\"isVisible\":[32],\"noDismiss\":[32],\"hasFooter\":[32],\"show\":[64],\"hide\":[64]}]]],[\"nano-file-upload\",[[6,\"nano-file-upload\",{\"name\":[1],\"accept\":[1],\"capture\":[1],\"maxFileSize\":[2,\"max-file-size\"],\"maxFiles\":[2,\"max-files\"],\"label\":[1],\"placeholder\":[1],\"hideLabel\":[4,\"hide-label\"],\"required\":[4],\"disabled\":[516],\"clearInput\":[4,\"clear-input\"],\"showInlineError\":[516,\"show-inline-error\"],\"validateOn\":[1025,\"validate-on\"],\"form\":[1],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"files\":[6160],\"value\":[6145],\"hasHelperSlot\":[32],\"hasLabelSlot\":[32],\"errorMessage\":[32],\"isDragging\":[32],\"fileList\":[32],\"hasFocus\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]},[[8,\"click\",\"globalClickHandler\"],[8,\"keydown\",\"globalKeydownHandler\"],[16,\"reset\",\"onReset\"]]]]],[\"nano-alert\",[[1,\"nano-alert\",{\"open\":[1540],\"closable\":[516],\"color\":[513],\"duration\":[2],\"isModal\":[32],\"isToast\":[32],\"isShowing\":[32],\"label\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64],\"alert\":[64]}]]],[\"nano-global-search-results\",[[1,\"nano-global-search-results\",{\"algoliaEle\":[32],\"currentWidth\":[32],\"apiKey\":[32],\"appId\":[32],\"index\":[32]},[[16,\"nanoSearchReset\",\"handleGlobalNavReset\"],[16,\"nanoSearchResult\",\"handleGlobalNavSearch\"],[0,\"nanoChange\",\"handleReorder\"],[0,\"nanoResultsShown\",\"attachListeners\"],[16,\"nanoNewResults\",\"attachResultListeners\"]]]]],[\"nano-tab\",[[1,\"nano-tab\",{\"panel\":[513],\"active\":[516],\"disabled\":[516],\"closable\":[4],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"nano-menu-drawer\",[[1,\"nano-menu-drawer\",{\"open\":[4],\"saveState\":[4,\"save-state\"],\"hideWidth\":[2,\"hide-width\"],\"hideHeight\":[4,\"hide-height\"],\"reset\":[32],\"widthOk\":[32],\"heightOk\":[32],\"isLoading\":[32],\"hide\":[32]},[[0,\"nanoOpen\",\"cancelNavItemEvents\"],[0,\"nanoClose\",\"cancelNavItemEvents\"],[16,\"nanoIsReady\",\"handleGlobalNavReady\"]]]]],[\"nano-split-pane\",[[1,\"nano-split-pane\",{\"position\":[6146],\"positionInPixels\":[1026,\"position-in-pixels\"],\"vertical\":[516],\"disabled\":[516],\"primary\":[1],\"snap\":[1],\"snapThreshold\":[2,\"snap-threshold\"],\"animationDuration\":[2,\"animation-duration\"],\"getPercentageToPixels\":[64],\"getPixelsToPercentage\":[64]}]]],[\"nano-tab-group\",[[1,\"nano-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"color\":[1],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"disableSwipe\":[4,\"disable-swipe\"],\"hasScrollControls\":[32],\"hideControlRight\":[32],\"hideControlLeft\":[32],\"isLegacy\":[32],\"tab\":[32],\"show\":[64]},[[0,\"nanoTabClose\",\"handleTabClose\"]]]]],[\"nano-accordion\",[[1,\"nano-accordion\",{\"color\":[1],\"itemOpened\":[32]},[[0,\"nanoOpened\",\"onToggleHandler\"],[0,\"nanoClosed\",\"onClosedHandler\"]]]]],[\"nano-algolia-filter\",[[1,\"nano-algolia-filter\",{\"filterName\":[1,\"filter-name\"],\"value\":[1025],\"operator\":[1],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"changeEvent\":[32],\"internalValue\":[32],\"showFilter\":[32],\"indexResults\":[32],\"filterChanged\":[32],\"facets\":[32],\"tplRenderFn\":[32],\"globalStoreMethod\":[32]},[[0,\"nanoChange\",\"handleChangeEvent\"],[0,\"change\",\"handleChangeEvent\"]]]]],[\"nano-algolia-input\",[[1,\"nano-algolia-input\",{\"appId\":[1,\"app-id\"],\"apiKey\":[1,\"api-key\"],\"searchIndex\":[1040],\"searchIndexName\":[1,\"search-index-name\"],\"minChars\":[2,\"min-chars\"],\"autoEmit\":[4,\"auto-emit\"],\"browseIndex\":[1028,\"browse-index\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"searchStr\":[32],\"algoliaIndex\":[32],\"currentResults\":[32],\"search\":[64]},[[0,\"nanoChange\",\"searchSubmit\"]]]]],[\"nano-algolia-pagination\",[[1,\"nano-algolia-pagination\",{\"maxToShow\":[2,\"max-to-show\"],\"currentPage\":[32],\"canGoPrev\":[32],\"canGoNext\":[32],\"show\":[32],\"tplRenderFn\":[32],\"indexResults\":[32],\"infiniteScroll\":[32],\"nextPage\":[64],\"prevPage\":[64],\"goToPage\":[64]}]]],[\"nano-algolia-results\",[[1,\"nano-algolia-results\",{\"infiniteScroll\":[4,\"infinite-scroll\"],\"appendPages\":[4,\"append-pages\"],\"showResults\":[32],\"tplRenderFn\":[32],\"results\":[32],\"indexResults\":[32],\"resultsPage\":[32],\"changeEvent\":[32],\"facets\":[32],\"isLoading\":[32]}]]],[\"nano-aspect-ratio\",[[1,\"nano-aspect-ratio\",{\"aspectRatio\":[1,\"aspect-ratio\"],\"fit\":[1]}]]],[\"nano-checkbox\",[[6,\"nano-checkbox\",{\"hasFocus\":[1540,\"has-focus\"],\"checked\":[1540],\"disabled\":[516],\"value\":[513],\"name\":[513],\"required\":[516],\"type\":[513],\"label\":[1],\"indeterminate\":[1540],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"form\":[1],\"inputType\":[32],\"_invalid\":[32],\"getInputElement\":[64],\"reportValidity\":[64],\"setError\":[64],\"setFocus\":[64],\"removeFocus\":[64]},[[16,\"reset\",\"onReset\"]]]]],[\"nano-checkbox-group\",[[6,\"nano-checkbox-group\",{\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[4,\"show-inline-error\"],\"min\":[2],\"max\":[2],\"disabled\":[516],\"legend\":[1],\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"checkboxes\":[32],\"nativeCbs\":[32],\"errorMessage\":[32],\"showErrorMsg\":[32],\"hasHelperSlot\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"showError\":[64]},[[0,\"nanoChange\",\"handleCbChange\"]]]]],[\"nano-details\",[[1,\"nano-details\",{\"label\":[1],\"open\":[1540],\"noHandle\":[4,\"no-handle\"],\"iconRotation\":[2,\"icon-rotation\"],\"color\":[1],\"isLoading\":[32]}]]],[\"nano-drawer\",[[1,\"nano-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"type\":[1],\"contentSelector\":[1,\"content-selector\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"nano-field-validator\",[[4,\"nano-field-validator\",{\"validateOn\":[1025,\"validate-on\"],\"scrollToInvalid\":[4,\"scroll-to-invalid\"],\"dirty\":[2564],\"valid\":[2564],\"store\":[2064],\"payload\":[2064],\"showValidation\":[2052,\"show-validation\"],\"validationState\":[2064],\"validation\":[16],\"userForm\":[32],\"submitted\":[32],\"_dirty\":[32],\"_valid\":[32],\"_store\":[32],\"setStore\":[64]}]]],[\"nano-range\",[[6,\"nano-range\",{\"color\":[1],\"debounce\":[2],\"name\":[1],\"dualKnobs\":[4,\"dual-knobs\"],\"min\":[2],\"max\":[2],\"pin\":[4],\"snaps\":[4],\"step\":[2],\"ticks\":[4],\"disabled\":[4],\"value\":[1026],\"ratioA\":[32],\"ratioB\":[32],\"pressedKnob\":[32]}]]],[\"nano-rating\",[[2,\"nano-rating\",{\"value\":[1538],\"max\":[2],\"precision\":[2],\"readonly\":[4],\"disabled\":[4],\"name\":[1],\"symbolName\":[1,\"symbol-name\"],\"symbol\":[16],\"hoverValue\":[32],\"isHovering\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"nano-slide\",[[1,\"nano-slide\",{\"ready\":[1540]}]]],[\"nano-slides\",[[1,\"nano-slides\",{\"options\":[1040],\"navbtns\":[4],\"pager\":[4],\"fullscreenbtn\":[4],\"fullscreen\":[1540],\"animation\":[513],\"currentSlide\":[1538,\"current-slide\"],\"autoplay\":[8],\"ready\":[1540],\"iCurrentSlide\":[32],\"slidesReady\":[32],\"didInit\":[32],\"update\":[64],\"updateAutoHeight\":[64],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"getActiveIndex\":[64],\"length\":[64],\"isEnd\":[64],\"isBeginning\":[64],\"startAutoplay\":[64],\"stopAutoplay\":[64],\"lockSwipes\":[64],\"getflickity\":[64],\"reload\":[64]}]]],[\"nano-tab-content\",[[1,\"nano-tab-content\",{\"name\":[513],\"active\":[516]}]]],[\"nano-algolia\",[[1,\"nano-algolia\",{\"showResults\":[1028,\"show-results\"],\"resultsPage\":[1026,\"results-page\"],\"appId\":[1025,\"app-id\"],\"apiKey\":[1025,\"api-key\"],\"searchIndex\":[1040],\"searchIndexName\":[1025,\"search-index-name\"],\"listenTo\":[1,\"listen-to\"],\"query\":[1025],\"operator\":[1],\"filters\":[16],\"tplEngine\":[16],\"tplRenderFn\":[16],\"replicaIndex\":[1025,\"replica-index\"],\"browseIndex\":[1028,\"browse-index\"],\"minChars\":[2,\"min-chars\"],\"storeId\":[1,\"store-id\"],\"storeMethod\":[1,\"store-method\"],\"_dynFacetFilters\":[32],\"inputField\":[32],\"algoliaIndex\":[32],\"indeces\":[32],\"resultsEmitterEle\":[32],\"indexResults\":[32],\"filterChanged\":[32],\"currentHits\":[32],\"changeEvent\":[32],\"isLoading\":[32],\"wormholeState\":[32],\"removeFilters\":[64]},[[0,\"nanoTplUpdated\",\"onAllTplUpdate\"],[0,\"nanoPageChanged\",\"onPageChange\"],[0,\"nanoFilterChanged\",\"onFilterChange\"],[16,\"nanoChange\",\"handleInputChange\"],[16,\"change\",\"handleInputChange\"]]]]],[\"nano-date-picker\",[[1,\"nano-date-picker\",{\"selectedDate\":[1025,\"selected-date\"],\"min\":[1],\"max\":[1],\"firstDayOfWeek\":[2,\"first-day-of-week\"],\"localization\":[16],\"color\":[1],\"isDateDisabled\":[16],\"isModal\":[4,\"is-modal\"],\"firstFocusEle\":[16],\"activeFocus\":[32],\"focusedDay\":[32],\"setFocus\":[64]}]]],[\"nano-tooltip\",[[1,\"nano-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"nano-spinner\",[[1,\"nano-spinner\",{\"type\":[1],\"overlay\":[516],\"hasText\":[32]}]]],[\"nano-sticker\",[[1,\"nano-sticker\",{\"autoResize\":[4,\"auto-resize\"],\"isSticky\":[1028,\"is-sticky\"],\"offset\":[1026],\"position\":[1],\"quietMode\":[1,\"quiet-mode\"],\"hideOnNewStickers\":[4,\"hide-on-new-stickers\"],\"breakPointMax\":[2,\"break-point-max\"],\"breakPointMin\":[2,\"break-point-min\"],\"scrollParent\":[1040],\"stickTo\":[1,\"stick-to\"],\"isStuck\":[32],\"isRootSticker\":[32],\"hide\":[32],\"scrollHide\":[32],\"multiStickerHide\":[32],\"scrollingTo\":[32],\"quietModeIsOn\":[32],\"stuckCounter\":[32],\"stickerIndex\":[32],\"stickToEle\":[32],\"triggerPos\":[32],\"trigger\":[32],\"_offset\":[32],\"isHiding\":[64],\"isSticking\":[64],\"setTriggerPos\":[64],\"getTriggerPos\":[64],\"pauseHiding\":[64]}]]],[\"nano-icon-button\",[[2,\"nano-icon-button\",{\"iconName\":[1,\"icon-name\"],\"iconSrc\":[1,\"icon-src\"],\"type\":[513],\"name\":[513],\"value\":[513],\"label\":[1],\"disabled\":[516],\"href\":[1],\"target\":[1],\"setFocus\":[64]}]]],[\"nano-resize-observe_2\",[[1,\"nano-resize-observe\",{\"states\":[1],\"currentWidth\":[32],\"currentHeight\":[32],\"classNames\":[32]}],[1,\"nano-skeleton\",{\"animated\":[4]}]]],[\"nano-dropdown\",[[1,\"nano-dropdown\",{\"autoOpen\":[4,\"auto-open\"],\"open\":[1540],\"closeOnSelect\":[4,\"close-on-select\"],\"containingElement\":[1040],\"tetherTo\":[16],\"placement\":[1],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"dialogTitle\":[1,\"dialog-title\"],\"show\":[64],\"hide\":[64]},[[0,\"nanoOpen\",\"secondaryOpen\"],[0,\"nanoClose\",\"secondaryClose\"],[0,\"nanoSelect\",\"handlePanelSelect\"]]]]],[\"nano-icon\",[[1,\"nano-icon\",{\"color\":[1],\"ariaLabel\":[1537,\"aria-label\"],\"flipRtl\":[4,\"flip-rtl\"],\"name\":[1],\"src\":[1],\"icon\":[8],\"size\":[1],\"lazy\":[4],\"svgContent\":[32],\"isVisible\":[32],\"isLoading\":[32]}]]],[\"nano-datalist_3\",[[1,\"nano-datalist\",{\"selected\":[1040],\"dropDownConfig\":[6160],\"options\":[16],\"input\":[1],\"type\":[1],\"activeOptions\":[2064],\"open\":[1028],\"disableFilter\":[4,\"disable-filter\"],\"disabled\":[4],\"actvOptEles\":[32],\"connectedInput\":[32],\"inputLabel\":[32],\"hasNoResult\":[32],\"shouldOpen\":[32],\"canOpen\":[32],\"optionIds\":[32]}],[1,\"nano-option\",{\"value\":[1537],\"label\":[1537],\"selected\":[516],\"disabled\":[516],\"filterMeta\":[1,\"filter-meta\"],\"hasFocus\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[1,\"nano-menu\",{\"hasFocus\":[2052,\"has-focus\"],\"type\":[1],\"label\":[1],\"setFocus\":[64],\"removeFocus\":[64],\"showActiveElement\":[64],\"resetActiveItem\":[64]},[[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]]]],[\"nano-nav-item_2\",[[6,\"nano-select\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"autofocus\":[4],\"disabled\":[516],\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"label\":[1],\"hideLabel\":[4,\"hide-label\"],\"floatLabel\":[4,\"float-label\"],\"multiple\":[4],\"name\":[1],\"placeholder\":[1],\"readonly\":[516],\"required\":[4],\"size\":[2],\"max\":[2],\"min\":[2],\"form\":[1],\"allowCustomValues\":[4,\"allow-custom-values\"],\"value\":[6145],\"options\":[6160],\"clearSelect\":[4,\"clear-select\"],\"mask\":[4],\"debounce\":[2],\"dropDownConfig\":[1040],\"currInsertIndex\":[32],\"showErrorMsg\":[32],\"errorMessage\":[32],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"hasHelperSlot\":[32],\"hasHelperEndSlot\":[32],\"inputSearchVal\":[32],\"_invalid\":[32],\"_eOptions\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getSelectElement\":[64],\"showError\":[64]},[[16,\"reset\",\"onReset\"],[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]],[1,\"nano-nav-item\",{\"href\":[1025],\"target\":[1],\"disabled\":[4],\"open\":[1540],\"selected\":[516],\"secondaryActiveWidth\":[2,\"secondary-active-width\"],\"secondaryFallback\":[16],\"closeOnBlur\":[4,\"close-on-blur\"],\"notification\":[4],\"didOpen\":[32],\"isInGlobalNav\":[32],\"isInMenuDrawer\":[32],\"isInMenu\":[32],\"isLegacy\":[32],\"hasFocus\":[32],\"setFocus\":[64]}]]],[\"nano-input\",[[6,\"nano-input\",{\"invalid\":[2564],\"validityMessage\":[2049,\"validity-message\"],\"color\":[1],\"accept\":[1],\"autocapitalise\":[1],\"autocomplete\":[1],\"autocorrect\":[1],\"autofocus\":[4],\"clearInput\":[4,\"clear-input\"],\"clearOnEdit\":[4,\"clear-on-edit\"],\"debounce\":[2],\"disabled\":[516],\"inputmode\":[1],\"validateOn\":[1025,\"validate-on\"],\"showInlineError\":[516,\"show-inline-error\"],\"label\":[1],\"hideLabel\":[4,\"hide-label\"],\"floatLabel\":[4,\"float-label\"],\"max\":[1],\"maxlength\":[2],\"min\":[1],\"minlength\":[2],\"multiple\":[4],\"name\":[1],\"pattern\":[1],\"placeholder\":[1],\"readonly\":[516],\"required\":[4],\"spellcheck\":[4],\"step\":[1],\"size\":[2],\"type\":[513],\"form\":[1],\"value\":[1025],\"resize\":[1],\"rows\":[2],\"showCharCount\":[4,\"show-char-count\"],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"hasHelperSlot\":[32],\"hasHelperEndSlot\":[32],\"errorMessage\":[32],\"datalist\":[32],\"_invalid\":[32],\"reportValidity\":[64],\"setFocus\":[64],\"getInputElement\":[64],\"showError\":[64]},[[16,\"reset\",\"onReset\"],[17,\"mousedown\",\"handleBlur\"],[0,\"keydown\",\"handleBlur\"]]]]],[\"nano-grid_3\",[[1,\"nano-img\",{\"alt\":[1],\"src\":[1],\"srcSet\":[1,\"src-set\"],\"lazy\":[4],\"background\":[4],\"autoHeight\":[1,\"auto-height\"],\"loadSrc\":[32],\"loadError\":[32],\"hasLoaded\":[32],\"imgStates\":[32],\"_src\":[32]}],[1,\"nano-grid\",{\"sSize\":[2,\"s-size\"],\"mSize\":[2,\"m-size\"],\"lSize\":[2,\"l-size\"],\"xlSize\":[2,\"xl-size\"],\"sCols\":[2,\"s-cols\"],\"mCols\":[2,\"m-cols\"],\"lCols\":[2,\"l-cols\"],\"xlCols\":[2,\"xl-cols\"],\"xxlCols\":[2,\"xxl-cols\"],\"showHelper\":[516,\"show-helper\"],\"contentPanel\":[516,\"content-panel\"],\"fullHeight\":[516,\"full-height\"],\"ready\":[32],\"isSmall\":[32],\"isMedium\":[32],\"isLarge\":[32],\"isXL\":[32],\"isXXL\":[32]}],[1,\"nano-grid-item\",{\"gridStates\":[1,\"grid-states\"],\"changeBP\":[64]}]]]]"), options);
111
111
  });
112
112
 
113
113
  //# sourceMappingURL=nano-components.js.map
@@ -248,6 +248,9 @@ let DateInput = class {
248
248
  * @returns `{ isValid: boolean, errorMessage: string }`
249
249
  */
250
250
  async reportValidity(validateFirst) {
251
+ const initValidity = await this.input.reportValidity(validateFirst);
252
+ if (initValidity.isValid && validateFirst)
253
+ this.testDateValidity();
251
254
  return await this.input.reportValidity(validateFirst);
252
255
  }
253
256
  /**
@@ -1 +1 @@
1
- {"file":"nano-date-input.entry.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,gyFAAgyF;;ACiCrzF,MAAM,UAAU,GAAG;EACjB,CAAC,EAAE,YAAY;EACf,CAAC,EAAE,YAAY;EACf,CAAC,EAAE,UAAU;CACd,CAAC;AAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;IAeJ,SAAS;EALtB;;;;IAaU,gBAAW,GAAG,KAAK,CAAC;IACpB,qBAAgB,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACxC,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;IACrC,WAAM,GACX,MAAM,CAAC,SAAS,CAAC,SAAsB;MACxC,MAAM,CAAC,SAAS,CAAC,QAAQ;MACzB,SAAS,CAAC;IAmBH,aAAQ,GAAG,KAAK,CAAC;;;;IAclB,eAAU,GAAY,IAAI,CAAC;;;;IAK3B,qBAAgB,GAAkB;MACxC,IAAI,EAAE,SAAS;MACf,KAAK,EAAE,MAAM;MACb,GAAG,EAAE,SAAS;KACf,CAAC;;;;IAKM,eAAU,GAAY,KAAK,CAAC;;;;IAK5B,SAAI,GAAW,IAAI,CAAC,OAAO,CAAC;;;;IAK5B,aAAQ,GAAG,KAAK,CAAC;;;;IA2BjB,aAAQ,GAAG,KAAK,CAAC;;;;IAUjB,cAAS,GAAG,KAAK,CAAC;;;;IAKlB,eAAU,GAAG,KAAK,CAAC;;;;IAgBa,UAAK,GAAW,EAAE,CAAC;;;;IAiBnD,eAAU,GAChB,iBAAiB,CAAC;;;;IAKK,oBAAe,GAAG,IAAI,C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KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAC9B,IAAI,EAAC,aAAa,GACA,CAChB,CACQ;KACjB,EACA,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,eAAe,MACxD,YAAM,IAAI,EAAC,QAAQ,IACjB,YAAM,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAC3C,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,EACN,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,KAC7B,gBACG,SAAS,CAAC,kBAAkB,CAC3B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,gBAAgB,CACtB,CACI,CACR,CACI,CACR,CACU,EACb,aAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CACvD,CACD,EACP;GACH;;;;;;;;;;;;;;","names":[],"sources":["./src/components/date-input/date-input.scss?tag=nano-date-input&encapsulation=scoped","./src/components/date-input/date-input.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/layers';\n@import '../../global/style/utilities/globals';\n\n:host {\n /**\n * @prop --focus-shadow: defaults to #{$control-focus-style};\n * @prop --open-btn-color: defaults to #{$button-bg-color};\n * @prop --open-btn-border: defaults to none;\n * @prop --close-btn-color: defaults to #{map.get($colors, celsius)};\n * @prop --picker-base-size: Base font size of the date picker component. Defaults to 16px;\n */\n\n display: inline-block;\n width: 100%;\n\n --focus-shadow: #{$control-focus-style};\n --open-btn-color: #{$button-bg-color};\n --open-btn-border: none;\n --close-btn-color: #{$button-bg-color};\n --picker-base-size: 16px;\n}\n\n:host(.nano-color) {\n --focus-shadow: #{$control-focus-size current-color(tint, 0.56)};\n}\n\nnano-icon {\n pointer-events: none;\n}\n\n.date-field {\n display: flex;\n flex-direction: column;\n position: relative;\n\n &__dropdown {\n --padding: 0;\n --overflow: visible;\n\n padding: 0 !important;\n width: 0 !important;\n width: 100%;\n z-index: $layer-index-dropdown !important;\n }\n\n &__close-bar {\n align-items: center;\n display: flex;\n justify-content: space-between;\n text-overflow: ellipsis;\n white-space: nowrap;\n border: 0;\n margin: 0;\n overflow: visible;\n padding: 0;\n position: absolute;\n right: -8px;\n top: -8px;\n width: auto;\n z-index: 1;\n }\n\n &__open {\n background: var(--open-btn-color);\n border: var(--open-btn-border);\n margin: 0;\n appearance: none;\n\n &:focus {\n box-shadow: var(--focus-shadow);\n outline: none;\n }\n }\n\n &__close {\n -webkit-appearance: none;\n align-items: center;\n appearance: none;\n background: var(--close-btn-color);\n border: 0;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n height: 24px;\n justify-content: center;\n padding: 0;\n width: 24px;\n\n @media (min-width: 36em) {\n opacity: 0;\n }\n\n &:focus {\n box-shadow: var(--focus-shadow);\n outline: none;\n\n @media (min-width: 36em) {\n opacity: 1;\n }\n }\n\n nano-icon {\n margin: 0 auto;\n }\n }\n\n nano-date-picker {\n font-size: var(--picker-base-size);\n }\n}\n\n.vhidden {\n @include visually-hide();\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n h,\n Prop,\n Watch,\n State,\n Event,\n EventEmitter,\n Host,\n Method,\n} from '@stencil/core';\nimport {\n createDate,\n DaysOfWeek,\n printISODate,\n parseISODate,\n} from '../../utils/date-utils';\n\nimport {\n PickerChangeEvent,\n DateInputChangeEventDetail,\n Color,\n LocalDateOpts,\n DuetLocalizedText,\n ControlValidity,\n ControlValidityEventDetail,\n DateDisabledPredicate,\n} from '../../interface';\nimport { createColorClasses } from '../../utils';\nimport type { Dropdown } from '../dropdown/dropdown';\n\nconst DateRegxps = {\n d: '(\\\\d{1,2})',\n m: '(\\\\d{1,2})',\n y: '(\\\\d{4})',\n};\n\nlet inputIds = 0;\n\n/**\n * The date-input component combines `nano-dropdown`, `nano-input` and `nano-date-picker` components to make a fully featured date form field. It has specific options for localisation, date formatting and validation.\n *\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot start - input start slot\n * @slot end - input end slot\n */\n@Component({\n tag: 'nano-date-input',\n styleUrl: 'date-input.scss',\n scoped: true,\n})\nexport class DateInput implements ComponentInterface {\n private pickerEle!: HTMLNanoDatePickerElement;\n private trigger!: HTMLButtonElement;\n private pickerCloseBtn!: HTMLButtonElement;\n private dropdown!: HTMLNanoDropdownElement;\n private input: HTMLNanoInputElement;\n private pickerOpenSource: 'key' | 'mouse';\n\n private directInput = false;\n private dateOrderIndeces = { d: 0, m: 1, y: 3 };\n private inputId = `nano-input-${inputIds++}`;\n private locale =\n (window.navigator.languages as string[]) ||\n window.navigator.language ||\n undefined;\n\n @Element() host: HTMLNanoDateInputElement;\n\n // Private state\n\n @State() pattern!: string;\n @State() inputValue: string;\n\n // Public Api / Prop\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.input) return '';\n return this.input.validityMessage;\n }\n\n /**\n * Whether to show a long form, confirmation date string of the one currently entered\n */\n @Prop() helperText: boolean = true;\n\n /**\n * Options for the date string display. Refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString.\n */\n @Prop() helperTextFormat: LocalDateOpts = {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n };\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * The initial size (number of characters) of the control.\n */\n @Prop() size?: number;\n\n /**\n * The form element to associate the select with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @Prop() firstDayOfWeek?: DaysOfWeek;\n\n /**\n * Button labels, day names, month names, etc, used for localization.\n * Default is English.\n */\n @Prop() localization?: DuetLocalizedText;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * The pattern prop will be used to create a placeholder automatically if unused.\n */\n @Prop({ mutable: true }) placeholder: string;\n\n /**\n * Current value. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n @Watch('value')\n handleValueChange() {\n if (!this.directInput) this.inputValue = this.formatIsoDate(this.value);\n setTimeout(() => {\n this.nanoChange.emit({\n value: this.value,\n date: parseISODate(this.value),\n });\n }, 20);\n this.directInput = false;\n }\n\n /**\n * When should the field perform validation\n */\n @Prop() validateOn?: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * The order of the date parts for entry and display.\n * e.g. dmy = dd mm yyyy\n */\n @Prop() dateOrder: 'dmy' | 'mdy' | 'ymd' | 'dym' = 'dmy';\n\n @Watch('dateOrder')\n handleDateOrderChange() {\n this.setDatePattern();\n }\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() min?: string;\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() max?: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n @Watch('min')\n @Watch('max')\n @Watch('value')\n testDateValidity() {\n const valueDate = parseISODate(this.value);\n let min: Date,\n max: Date,\n error: string = '';\n\n if (this.value && valueDate) {\n if (this.min && (min = parseISODate(this.min)) && valueDate < min) {\n error =\n 'Date below the minimum: ' +\n min.toLocaleDateString(this.locale, this.helperTextFormat);\n }\n if (this.max && (max = parseISODate(this.max)) && valueDate > max) {\n error =\n 'Date above the maximum: ' +\n max.toLocaleDateString(this.locale, this.helperTextFormat);\n }\n if (this.isDateDisabled(valueDate)) {\n error = 'Date selected is disabled.';\n }\n }\n\n requestAnimationFrame(async (_) => {\n if (!this.input) return;\n const input = await this.input.getInputElement();\n if (this.value.length && !valueDate) error = 'Please enter a valid date';\n\n input.setCustomValidity(error);\n if (this.input.validateOn === 'dirty') {\n this.input.showError(error);\n }\n });\n }\n\n /**\n * Show a date picker. Date pickers are not very useful\n * if the potential input is too far in the distance or past\n * e.g. Birthdays\n */\n @Prop() picker: boolean = true;\n\n /**\n * Initial picker date. Will be to `value` if set. Will be today's date if nothing set.\n * Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @Prop() initialPickerDate?: string;\n\n /**\n * Set / read whether the picker is currently open.\n */\n @Prop({ reflect: true, mutable: true }) pickerOpen: boolean = false;\n\n @Watch('pickerOpen')\n handlePickerOpenChange() {\n this.dropdown.open = this.pickerOpen;\n }\n\n /**\n * Close the picker after a date is selected\n */\n @Prop() closeAfterPicked: boolean = true;\n\n /** nano-dropdown config options you can pass to the nested dropdown component */\n @Prop()\n get dropDownConfig() {\n return this._dropDownConfig;\n }\n set dropDownConfig(ddc: Partial<Dropdown>) {\n this._dropDownConfig = { ...this._dropDownConfig, ...ddc };\n }\n private _dropDownConfig: Partial<Dropdown> = {};\n\n /** @readonly get the value as a `Date` */\n @Prop()\n get dateValue() {\n return parseISODate(this.value);\n }\n\n /** Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends. */\n @Prop() isDateDisabled: DateDisabledPredicate = () => false;\n\n // Event emitters\n\n /**\n * Event emitted when a date is selected.\n */\n @Event() nanoChange: EventEmitter<DateInputChangeEventDetail>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n // Methods\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return await this.input.reportValidity(validateFirst);\n }\n\n /**\n * Sets focus on the child `nano-input`.\n */\n @Method()\n async setFocus() {\n if (this.input) this.input.setFocus();\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n async getInputElement() {\n return await this.input.getInputElement();\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (!this.input) return;\n this.input.showError(message);\n }\n\n // Event handlers\n\n private onInputChange = (\n e: CustomEvent & {\n target: HTMLInputElement;\n }\n ) => {\n e.stopPropagation();\n this.setValue(e.target.value);\n };\n\n private onInputValidate = (e: CustomEvent<ControlValidityEventDetail>) => {\n e.stopPropagation();\n this._invalid = !e.detail.isValid;\n this.nanoValidate.emit({\n isValid: e.detail.isValid,\n errorMessage: e.detail.errorMessage,\n originalEvent: e.detail.originalEvent,\n });\n };\n\n private onInputKey = () => {\n this.directInput = true;\n };\n\n private onDatePicked = (e: { detail: PickerChangeEvent }) => {\n this.directInput = false;\n this.value = e.detail.value;\n if (this.closeAfterPicked) this.pickerOpen = false;\n };\n\n private onDropdownHide = () => {\n setTimeout((_) => (this.pickerOpen = false), 200);\n setTimeout((_) => this.trigger.focus(), 50);\n };\n\n private onDropdownShow = () => {\n setTimeout((_) => {\n this.pickerEle.setFocus(false, this.pickerOpenSource === 'key');\n this.pickerOpenSource = null;\n }, 200);\n };\n\n private onTriggerClick = () => {\n if (!this.pickerOpen) {\n this.pickerOpen = true;\n this.pickerOpenSource = 'mouse';\n }\n };\n\n private onTriggerKey = (e: KeyboardEvent) => {\n if ([' ', 'Enter'].includes(e.key)) {\n if (!this.pickerOpen) {\n this.pickerOpen = true;\n this.pickerOpenSource = 'key';\n }\n }\n };\n\n private onCloseClick = () => {\n if (this.pickerOpen) this.pickerOpen = false;\n };\n\n private onCloseKeyDown = (e: KeyboardEvent) => {\n // this ensures focus is trapped inside the picker\n if (e.key === 'Tab' && e.shiftKey) {\n this.pickerEle.setFocus(true);\n e.preventDefault();\n }\n if (e.key === ' ' || e.key === 'Enter') {\n if (this.pickerOpen) this.pickerOpen = false;\n }\n };\n\n // Private logic\n\n // set the regexp input pattern and placeholder (if necessary)\n private setDatePattern() {\n let dateRegexOrdered = [];\n let dateStrOrd = [];\n Array.from(this.dateOrder).map((datepart, i) => {\n dateRegexOrdered.push(DateRegxps[datepart]);\n this.dateOrderIndeces[datepart] = i;\n dateStrOrd.push(datepart === 'y' ? 'yyyy' : datepart + datepart);\n });\n this.pattern = dateRegexOrdered.join('\\\\W+');\n\n if (!this.placeholder && this.placeholder !== 'false')\n this.placeholder = dateStrOrd.join(' ');\n }\n\n // set the public facing date string\n private formatIsoDate(isoDate: string) {\n let dateRegexOrdered = [];\n Array.from('ymd').map((datepart) =>\n dateRegexOrdered.push(DateRegxps[datepart])\n );\n const matches = isoDate.match(new RegExp(dateRegexOrdered.join('\\\\W+')));\n if (!matches) return '';\n\n let formatted = [];\n formatted[this.dateOrderIndeces.d] = matches[3];\n formatted[this.dateOrderIndeces.m] = matches[2];\n formatted[this.dateOrderIndeces.y] = matches[1];\n\n return formatted.join(' ');\n }\n\n // on manual user entry, set the value that will be sent with the form field\n private setValue(inputValue: string) {\n const matches = inputValue.match(new RegExp(this.pattern));\n\n // it's an invalid date, but we still need to set it\n if (!matches) {\n this.value = inputValue;\n return;\n }\n\n let date = createDate(\n matches[this.dateOrderIndeces.y + 1],\n matches[this.dateOrderIndeces.m + 1],\n matches[this.dateOrderIndeces.d + 1]\n );\n\n if (!date) {\n // last ditch attempt - see if the browser can get something\n date = new Date(inputValue);\n\n // it's definitely an invalid date, but set it anyway for validation messages\n if (!date) {\n this.value = inputValue;\n return;\n }\n }\n\n const dateStr = printISODate(date);\n this.value = dateStr;\n return dateStr;\n }\n\n connectedCallback() {\n this.setDatePattern();\n this.handleValueChange();\n }\n\n componentDidLoad() {\n if (!this.pickerCloseBtn || !this.picker) return;\n this.pickerEle.firstFocusEle = this.pickerCloseBtn;\n this.dropdown.tetherTo = this.trigger;\n setTimeout((_) => this.handlePickerOpenChange(), 300);\n }\n\n render() {\n this.locale =\n (navigator.languages as string[]) || navigator.language || undefined;\n\n this.dropDownConfig.placement =\n this.dropDownConfig.placement || 'bottom-end';\n\n if ((this.host.ownerDocument as Document).dir === 'rtl') {\n this.dropDownConfig.placement.replace('start', 'end');\n }\n if (this.trigger) this.dropDownConfig.tetherTo = this.trigger;\n\n const valueDate = parseISODate(this.value);\n const hasHelperSlot = !!this.host.querySelector('[slot=\"helper\"]');\n\n return (\n <Host class={{ ...createColorClasses(this.color) }}>\n <div class=\"date-field\">\n <nano-input\n class=\"date-field__input\"\n slot=\"trigger\"\n required={this.required || undefined}\n showInlineError={this.showInlineError}\n validateOn={this.validateOn}\n placeholder={\n this.placeholder !== 'false' ? this.placeholder : undefined\n }\n pattern={this.pattern}\n label={this.label}\n disabled={this.disabled || undefined}\n color={this.color || undefined}\n autofocus={this.autofocus || undefined}\n clearInput={this.clearInput || undefined}\n onNanoChange={this.onInputChange}\n onNanoInput={this.onInputKey}\n onNanoValidate={this.onInputValidate}\n name=\"\"\n form={this.form || undefined}\n size={this.size || undefined}\n readonly={this.readonly}\n value={this.inputValue}\n ref={(input) => (this.input = input)}\n floatLabel={this.floatLabel}\n hideLabel={this.hideLabel}\n inputmode={'numeric'}\n part=\"input\"\n >\n <slot name=\"start\" slot=\"start\" />\n <slot name=\"label\" />\n <slot name=\"end\" slot=\"end\" />\n {this.picker && [\n <button\n slot=\"end\"\n class=\"date-field__open\"\n type=\"button\"\n onKeyDown={this.onTriggerKey}\n onClick={this.onTriggerClick}\n ref={(trigger) => (this.trigger = trigger)}\n disabled={this.disabled || this.readonly}\n >\n <nano-icon name=\"light/calendar-alt\"></nano-icon>\n </button>,\n\n <nano-dropdown\n slot=\"end\"\n onNanoHide={this.onDropdownHide}\n onNanoShow={this.onDropdownShow}\n dialogTitle=\"Choose a date\"\n class=\"date-field__dropdown\"\n ref={(dropdown) => (this.dropdown = dropdown)}\n {...this.dropDownConfig}\n part=\"dropdown\"\n >\n <div>\n <div class=\"date-field__close-bar\">\n <button\n class=\"date-field__close\"\n type=\"button\"\n onMouseDown={this.onCloseClick}\n onKeyDown={this.onCloseKeyDown}\n ref={(pickerClose) => (this.pickerCloseBtn = pickerClose)}\n >\n <nano-icon name=\"light/times\"></nano-icon>\n <span class=\"vhidden\">Close window</span>\n </button>\n </div>\n <nano-date-picker\n isDateDisabled={this.isDateDisabled}\n onNanoDatePicked={this.onDatePicked}\n min={this.min || undefined}\n max={this.max || undefined}\n is-modal={true}\n ref={(picker) => (this.pickerEle = picker)}\n localization={this.localization}\n selectedDate={this.value || this.initialPickerDate}\n firstDayOfWeek={this.firstDayOfWeek}\n color={this.color || undefined}\n part=\"date-picker\"\n ></nano-date-picker>\n </div>\n </nano-dropdown>,\n ]}\n {(hasHelperSlot || this.helperText || this.showInlineError) && (\n <span slot=\"helper\">\n <span class={{ vhidden: !!this.value.length }}>\n <slot name=\"helper\" />\n </span>\n {this.helperText && !!valueDate && (\n <span>\n {valueDate.toLocaleDateString(\n this.locale,\n this.helperTextFormat\n )}\n </span>\n )}\n </span>\n )}\n </nano-input>\n <input type=\"hidden\" value={this.value} name={this.name} />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"nano-date-input.entry.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,gyFAAgyF;;ACiCrzF,MAAM,UAAU,GAAG;EACjB,CAAC,EAAE,YAAY;EACf,CAAC,EAAE,YAAY;EACf,CAAC,EAAE,UAAU;CACd,CAAC;AAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;IAeJ,SAAS;EALtB;;;;IAaU,gBAAW,GAAG,KAAK,CAAC;IACpB,qBAAgB,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACxC,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;IACrC,WAAM,GACX,MAAM,CAAC,SAAS,CAAC,SAAsB;MACxC,MAAM,CAAC,SAAS,CAAC,QAAQ;MACzB,SAAS,CAAC;IAmBH,aAAQ,GAAG,KAAK,CAAC;;;;IAclB,eAAU,GAAY,IAAI,CAAC;;;;IAK3B,qBAAgB,GAAkB;MACxC,IAAI,EAAE,SAAS;MACf,KAAK,EAAE,MAAM;MACb,GAAG,EAAE,SAAS;KACf,CAAC;;;;IAKM,eAAU,GAAY,KAAK,CAAC;;;;IAK5B,SAAI,GAAW,IAAI,CAAC,OAAO,CAAC;;;;IAK5B,aAAQ,GAAG,KAAK,CAAC;;;;IA2BjB,aAAQ,GAAG,KAAK,CAAC;;;;IAUjB,cAAS,GAAG,KAAK,CAAC;;;;IAKlB,eAAU,GAAG,KAAK,CAAC;;;;IAgBa,UAAK,GAAW,EAAE,CAAC;;;;IAiBnD,eAAU,GAChB,iBAAiB,CAAC;;;;IAKK,oBAAe,GAAG,IAAI,CAAC;;;;;IAMxC,cAAS,GAAkC,KAAK,CAAC;;;;IAUjD,aAAQ,GAAG,KAAK,CAAC;;;;IAiBjB,cA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AK,IAAI,IAAI,CAAC,iBAAiB,EAClD,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAC9B,IAAI,EAAC,aAAa,GACA,CAChB,CACQ;KACjB,EACA,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,eAAe,MACxD,YAAM,IAAI,EAAC,QAAQ,IACjB,YAAM,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAC3C,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,EACN,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,KAC7B,gBACG,SAAS,CAAC,kBAAkB,CAC3B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,gBAAgB,CACtB,CACI,CACR,CACI,CACR,CACU,EACb,aAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CACvD,CACD,EACP;GACH;;;;;;;;;;;;;;","names":[],"sources":["./src/components/date-input/date-input.scss?tag=nano-date-input&encapsulation=scoped","./src/components/date-input/date-input.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/layers';\n@import '../../global/style/utilities/globals';\n\n:host {\n /**\n * @prop --focus-shadow: defaults to #{$control-focus-style};\n * @prop --open-btn-color: defaults to #{$button-bg-color};\n * @prop --open-btn-border: defaults to none;\n * @prop --close-btn-color: defaults to #{map.get($colors, celsius)};\n * @prop --picker-base-size: Base font size of the date picker component. Defaults to 16px;\n */\n\n display: inline-block;\n width: 100%;\n\n --focus-shadow: #{$control-focus-style};\n --open-btn-color: #{$button-bg-color};\n --open-btn-border: none;\n --close-btn-color: #{$button-bg-color};\n --picker-base-size: 16px;\n}\n\n:host(.nano-color) {\n --focus-shadow: #{$control-focus-size current-color(tint, 0.56)};\n}\n\nnano-icon {\n pointer-events: none;\n}\n\n.date-field {\n display: flex;\n flex-direction: column;\n position: relative;\n\n &__dropdown {\n --padding: 0;\n --overflow: visible;\n\n padding: 0 !important;\n width: 0 !important;\n width: 100%;\n z-index: $layer-index-dropdown !important;\n }\n\n &__close-bar {\n align-items: center;\n display: flex;\n justify-content: space-between;\n text-overflow: ellipsis;\n white-space: nowrap;\n border: 0;\n margin: 0;\n overflow: visible;\n padding: 0;\n position: absolute;\n right: -8px;\n top: -8px;\n width: auto;\n z-index: 1;\n }\n\n &__open {\n background: var(--open-btn-color);\n border: var(--open-btn-border);\n margin: 0;\n appearance: none;\n\n &:focus {\n box-shadow: var(--focus-shadow);\n outline: none;\n }\n }\n\n &__close {\n -webkit-appearance: none;\n align-items: center;\n appearance: none;\n background: var(--close-btn-color);\n border: 0;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n height: 24px;\n justify-content: center;\n padding: 0;\n width: 24px;\n\n @media (min-width: 36em) {\n opacity: 0;\n }\n\n &:focus {\n box-shadow: var(--focus-shadow);\n outline: none;\n\n @media (min-width: 36em) {\n opacity: 1;\n }\n }\n\n nano-icon {\n margin: 0 auto;\n }\n }\n\n nano-date-picker {\n font-size: var(--picker-base-size);\n }\n}\n\n.vhidden {\n @include visually-hide();\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n h,\n Prop,\n Watch,\n State,\n Event,\n EventEmitter,\n Host,\n Method,\n} from '@stencil/core';\nimport {\n createDate,\n DaysOfWeek,\n printISODate,\n parseISODate,\n} from '../../utils/date-utils';\n\nimport {\n PickerChangeEvent,\n DateInputChangeEventDetail,\n Color,\n LocalDateOpts,\n DuetLocalizedText,\n ControlValidity,\n ControlValidityEventDetail,\n DateDisabledPredicate,\n} from '../../interface';\nimport { createColorClasses } from '../../utils';\nimport type { Dropdown } from '../dropdown/dropdown';\n\nconst DateRegxps = {\n d: '(\\\\d{1,2})',\n m: '(\\\\d{1,2})',\n y: '(\\\\d{4})',\n};\n\nlet inputIds = 0;\n\n/**\n * The date-input component combines `nano-dropdown`, `nano-input` and `nano-date-picker` components to make a fully featured date form field. It has specific options for localisation, date formatting and validation.\n *\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot start - input start slot\n * @slot end - input end slot\n */\n@Component({\n tag: 'nano-date-input',\n styleUrl: 'date-input.scss',\n scoped: true,\n})\nexport class DateInput implements ComponentInterface {\n private pickerEle!: HTMLNanoDatePickerElement;\n private trigger!: HTMLButtonElement;\n private pickerCloseBtn!: HTMLButtonElement;\n private dropdown!: HTMLNanoDropdownElement;\n private input: HTMLNanoInputElement;\n private pickerOpenSource: 'key' | 'mouse';\n\n private directInput = false;\n private dateOrderIndeces = { d: 0, m: 1, y: 3 };\n private inputId = `nano-input-${inputIds++}`;\n private locale =\n (window.navigator.languages as string[]) ||\n window.navigator.language ||\n undefined;\n\n @Element() host: HTMLNanoDateInputElement;\n\n // Private state\n\n @State() pattern!: string;\n @State() inputValue: string;\n\n // Public Api / Prop\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.input) return '';\n return this.input.validityMessage;\n }\n\n /**\n * Whether to show a long form, confirmation date string of the one currently entered\n */\n @Prop() helperText: boolean = true;\n\n /**\n * Options for the date string display. Refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString.\n */\n @Prop() helperTextFormat: LocalDateOpts = {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n };\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * The initial size (number of characters) of the control.\n */\n @Prop() size?: number;\n\n /**\n * The form element to associate the select with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @Prop() firstDayOfWeek?: DaysOfWeek;\n\n /**\n * Button labels, day names, month names, etc, used for localization.\n * Default is English.\n */\n @Prop() localization?: DuetLocalizedText;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * The pattern prop will be used to create a placeholder automatically if unused.\n */\n @Prop({ mutable: true }) placeholder: string;\n\n /**\n * Current value. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n @Watch('value')\n handleValueChange() {\n if (!this.directInput) this.inputValue = this.formatIsoDate(this.value);\n setTimeout(() => {\n this.nanoChange.emit({\n value: this.value,\n date: parseISODate(this.value),\n });\n }, 20);\n this.directInput = false;\n }\n\n /**\n * When should the field perform validation\n */\n @Prop() validateOn?: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * The order of the date parts for entry and display.\n * e.g. dmy = dd mm yyyy\n */\n @Prop() dateOrder: 'dmy' | 'mdy' | 'ymd' | 'dym' = 'dmy';\n\n @Watch('dateOrder')\n handleDateOrderChange() {\n this.setDatePattern();\n }\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() min?: string;\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() max?: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n @Watch('min')\n @Watch('max')\n @Watch('value')\n testDateValidity() {\n const valueDate = parseISODate(this.value);\n\n let min: Date,\n max: Date,\n error: string = '';\n\n if (this.value && valueDate) {\n if (this.min && (min = parseISODate(this.min)) && valueDate < min) {\n error =\n 'Date below the minimum: ' +\n min.toLocaleDateString(this.locale, this.helperTextFormat);\n }\n if (this.max && (max = parseISODate(this.max)) && valueDate > max) {\n error =\n 'Date above the maximum: ' +\n max.toLocaleDateString(this.locale, this.helperTextFormat);\n }\n if (this.isDateDisabled(valueDate)) {\n error = 'Date selected is disabled.';\n }\n }\n\n requestAnimationFrame(async (_) => {\n if (!this.input) return;\n const input = await this.input.getInputElement();\n if (this.value.length && !valueDate) error = 'Please enter a valid date';\n\n input.setCustomValidity(error);\n if (this.input.validateOn === 'dirty') {\n this.input.showError(error);\n }\n });\n }\n\n /**\n * Show a date picker. Date pickers are not very useful\n * if the potential input is too far in the distance or past\n * e.g. Birthdays\n */\n @Prop() picker: boolean = true;\n\n /**\n * Initial picker date. Will be to `value` if set. Will be today's date if nothing set.\n * Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @Prop() initialPickerDate?: string;\n\n /**\n * Set / read whether the picker is currently open.\n */\n @Prop({ reflect: true, mutable: true }) pickerOpen: boolean = false;\n\n @Watch('pickerOpen')\n handlePickerOpenChange() {\n this.dropdown.open = this.pickerOpen;\n }\n\n /**\n * Close the picker after a date is selected\n */\n @Prop() closeAfterPicked: boolean = true;\n\n /** nano-dropdown config options you can pass to the nested dropdown component */\n @Prop()\n get dropDownConfig() {\n return this._dropDownConfig;\n }\n set dropDownConfig(ddc: Partial<Dropdown>) {\n this._dropDownConfig = { ...this._dropDownConfig, ...ddc };\n }\n private _dropDownConfig: Partial<Dropdown> = {};\n\n /** @readonly get the value as a `Date` */\n @Prop()\n get dateValue() {\n return parseISODate(this.value);\n }\n\n /** Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends. */\n @Prop() isDateDisabled: DateDisabledPredicate = () => false;\n\n // Event emitters\n\n /**\n * Event emitted when a date is selected.\n */\n @Event() nanoChange: EventEmitter<DateInputChangeEventDetail>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n // Methods\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n const initValidity = await this.input.reportValidity(validateFirst);\n if (initValidity.isValid && validateFirst) this.testDateValidity();\n return await this.input.reportValidity(validateFirst);\n }\n\n /**\n * Sets focus on the child `nano-input`.\n */\n @Method()\n async setFocus() {\n if (this.input) this.input.setFocus();\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n async getInputElement() {\n return await this.input.getInputElement();\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (!this.input) return;\n this.input.showError(message);\n }\n\n // Event handlers\n\n private onInputChange = (\n e: CustomEvent & {\n target: HTMLInputElement;\n }\n ) => {\n e.stopPropagation();\n this.setValue(e.target.value);\n };\n\n private onInputValidate = (e: CustomEvent<ControlValidityEventDetail>) => {\n e.stopPropagation();\n this._invalid = !e.detail.isValid;\n\n this.nanoValidate.emit({\n isValid: e.detail.isValid,\n errorMessage: e.detail.errorMessage,\n originalEvent: e.detail.originalEvent,\n });\n };\n\n private onInputKey = () => {\n this.directInput = true;\n };\n\n private onDatePicked = (e: { detail: PickerChangeEvent }) => {\n this.directInput = false;\n this.value = e.detail.value;\n if (this.closeAfterPicked) this.pickerOpen = false;\n };\n\n private onDropdownHide = () => {\n setTimeout((_) => (this.pickerOpen = false), 200);\n setTimeout((_) => this.trigger.focus(), 50);\n };\n\n private onDropdownShow = () => {\n setTimeout((_) => {\n this.pickerEle.setFocus(false, this.pickerOpenSource === 'key');\n this.pickerOpenSource = null;\n }, 200);\n };\n\n private onTriggerClick = () => {\n if (!this.pickerOpen) {\n this.pickerOpen = true;\n this.pickerOpenSource = 'mouse';\n }\n };\n\n private onTriggerKey = (e: KeyboardEvent) => {\n if ([' ', 'Enter'].includes(e.key)) {\n if (!this.pickerOpen) {\n this.pickerOpen = true;\n this.pickerOpenSource = 'key';\n }\n }\n };\n\n private onCloseClick = () => {\n if (this.pickerOpen) this.pickerOpen = false;\n };\n\n private onCloseKeyDown = (e: KeyboardEvent) => {\n // this ensures focus is trapped inside the picker\n if (e.key === 'Tab' && e.shiftKey) {\n this.pickerEle.setFocus(true);\n e.preventDefault();\n }\n if (e.key === ' ' || e.key === 'Enter') {\n if (this.pickerOpen) this.pickerOpen = false;\n }\n };\n\n // Private logic\n\n // set the regexp input pattern and placeholder (if necessary)\n private setDatePattern() {\n let dateRegexOrdered = [];\n let dateStrOrd = [];\n Array.from(this.dateOrder).map((datepart, i) => {\n dateRegexOrdered.push(DateRegxps[datepart]);\n this.dateOrderIndeces[datepart] = i;\n dateStrOrd.push(datepart === 'y' ? 'yyyy' : datepart + datepart);\n });\n this.pattern = dateRegexOrdered.join('\\\\W+');\n\n if (!this.placeholder && this.placeholder !== 'false')\n this.placeholder = dateStrOrd.join(' ');\n }\n\n // set the public facing date string\n private formatIsoDate(isoDate: string) {\n let dateRegexOrdered = [];\n Array.from('ymd').map((datepart) =>\n dateRegexOrdered.push(DateRegxps[datepart])\n );\n const matches = isoDate.match(new RegExp(dateRegexOrdered.join('\\\\W+')));\n if (!matches) return '';\n\n let formatted = [];\n formatted[this.dateOrderIndeces.d] = matches[3];\n formatted[this.dateOrderIndeces.m] = matches[2];\n formatted[this.dateOrderIndeces.y] = matches[1];\n\n return formatted.join(' ');\n }\n\n // on manual user entry, set the value that will be sent with the form field\n private setValue(inputValue: string) {\n const matches = inputValue.match(new RegExp(this.pattern));\n\n // it's an invalid date, but we still need to set it\n if (!matches) {\n this.value = inputValue;\n return;\n }\n\n let date = createDate(\n matches[this.dateOrderIndeces.y + 1],\n matches[this.dateOrderIndeces.m + 1],\n matches[this.dateOrderIndeces.d + 1]\n );\n\n if (!date) {\n // last ditch attempt - see if the browser can get something\n date = new Date(inputValue);\n\n // it's definitely an invalid date, but set it anyway for validation messages\n if (!date) {\n this.value = inputValue;\n return;\n }\n }\n\n const dateStr = printISODate(date);\n this.value = dateStr;\n return dateStr;\n }\n\n connectedCallback() {\n this.setDatePattern();\n this.handleValueChange();\n }\n\n componentDidLoad() {\n if (!this.pickerCloseBtn || !this.picker) return;\n this.pickerEle.firstFocusEle = this.pickerCloseBtn;\n this.dropdown.tetherTo = this.trigger;\n setTimeout((_) => this.handlePickerOpenChange(), 300);\n }\n\n render() {\n this.locale =\n (navigator.languages as string[]) || navigator.language || undefined;\n\n this.dropDownConfig.placement =\n this.dropDownConfig.placement || 'bottom-end';\n\n if ((this.host.ownerDocument as Document).dir === 'rtl') {\n this.dropDownConfig.placement.replace('start', 'end');\n }\n if (this.trigger) this.dropDownConfig.tetherTo = this.trigger;\n\n const valueDate = parseISODate(this.value);\n const hasHelperSlot = !!this.host.querySelector('[slot=\"helper\"]');\n\n return (\n <Host class={{ ...createColorClasses(this.color) }}>\n <div class=\"date-field\">\n <nano-input\n class=\"date-field__input\"\n slot=\"trigger\"\n required={this.required || undefined}\n showInlineError={this.showInlineError}\n validateOn={this.validateOn}\n placeholder={\n this.placeholder !== 'false' ? this.placeholder : undefined\n }\n pattern={this.pattern}\n label={this.label}\n disabled={this.disabled || undefined}\n color={this.color || undefined}\n autofocus={this.autofocus || undefined}\n clearInput={this.clearInput || undefined}\n onNanoChange={this.onInputChange}\n onNanoInput={this.onInputKey}\n onNanoValidate={this.onInputValidate}\n name=\"\"\n form={this.form || undefined}\n size={this.size || undefined}\n readonly={this.readonly}\n value={this.inputValue}\n ref={(input) => (this.input = input)}\n floatLabel={this.floatLabel}\n hideLabel={this.hideLabel}\n inputmode={'numeric'}\n part=\"input\"\n >\n <slot name=\"start\" slot=\"start\" />\n <slot name=\"label\" />\n <slot name=\"end\" slot=\"end\" />\n {this.picker && [\n <button\n slot=\"end\"\n class=\"date-field__open\"\n type=\"button\"\n onKeyDown={this.onTriggerKey}\n onClick={this.onTriggerClick}\n ref={(trigger) => (this.trigger = trigger)}\n disabled={this.disabled || this.readonly}\n >\n <nano-icon name=\"light/calendar-alt\"></nano-icon>\n </button>,\n\n <nano-dropdown\n slot=\"end\"\n onNanoHide={this.onDropdownHide}\n onNanoShow={this.onDropdownShow}\n dialogTitle=\"Choose a date\"\n class=\"date-field__dropdown\"\n ref={(dropdown) => (this.dropdown = dropdown)}\n {...this.dropDownConfig}\n part=\"dropdown\"\n >\n <div>\n <div class=\"date-field__close-bar\">\n <button\n class=\"date-field__close\"\n type=\"button\"\n onMouseDown={this.onCloseClick}\n onKeyDown={this.onCloseKeyDown}\n ref={(pickerClose) => (this.pickerCloseBtn = pickerClose)}\n >\n <nano-icon name=\"light/times\"></nano-icon>\n <span class=\"vhidden\">Close window</span>\n </button>\n </div>\n <nano-date-picker\n isDateDisabled={this.isDateDisabled}\n onNanoDatePicked={this.onDatePicked}\n min={this.min || undefined}\n max={this.max || undefined}\n is-modal={true}\n ref={(picker) => (this.pickerEle = picker)}\n localization={this.localization}\n selectedDate={this.value || this.initialPickerDate}\n firstDayOfWeek={this.firstDayOfWeek}\n color={this.color || undefined}\n part=\"date-picker\"\n ></nano-date-picker>\n </div>\n </nano-dropdown>,\n ]}\n {(hasHelperSlot || this.helperText || this.showInlineError) && (\n <span slot=\"helper\">\n <span class={{ vhidden: !!this.value.length }}>\n <slot name=\"helper\" />\n </span>\n {this.helperText && !!valueDate && (\n <span>\n {valueDate.toLocaleDateString(\n this.locale,\n this.helperTextFormat\n )}\n </span>\n )}\n </span>\n )}\n </nano-input>\n <input type=\"hidden\" value={this.value} name={this.name} />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -206,19 +206,22 @@ let FieldValidator = class {
206
206
  this._dirty = false;
207
207
  // Event handlers
208
208
  /** Fired whenever store values change and potentially checks validity */
209
- this.handleStoreChange = async (_key, _newVal) => {
209
+ this.handleStoreChange = async (key, newVal) => {
210
+ const found = this.fields.find((field) => field.name === key);
211
+ if (found && found.value !== newVal)
212
+ this.storeToFields([found]);
210
213
  if (this.validateOn === 'dirty' && this.dirty) {
211
214
  this.internalValidate = true;
212
215
  await this.validateAllFields();
213
216
  this._valid = this.activeForm.checkValidity();
214
217
  this.internalValidate = false;
215
218
  }
216
- this.nanoPayloadChange.emit(this.store.state);
219
+ this.nanoPayloadChange.emit(this._store.state);
217
220
  };
218
221
  /** Handles field value changes and passes to store */
219
222
  this.handleFieldChange = (ev) => {
220
223
  this._dirty = true;
221
- this.setFieldValue([ev.target]);
224
+ this.fieldsToStore([ev.target]);
222
225
  };
223
226
  /** Handles default field validation events */
224
227
  this.handleFormInvalid = async (ev) => {
@@ -230,13 +233,13 @@ let FieldValidator = class {
230
233
  this.validateOn = 'dirty';
231
234
  this.submitted = true;
232
235
  await this.validateAllFields();
236
+ this.internalValidate = true;
237
+ this._valid = this.activeForm.checkValidity();
238
+ this.internalValidate = false;
233
239
  // kinda insane...but if we're only validating on submit, then if the form is currently
234
240
  // in an invalid state, when submitting, it will fire an invalid event and not
235
241
  // submit the form. So let's test to make sure it is really invalid, and submit if not
236
242
  if (this.validateOn === 'submit') {
237
- this.internalValidate = true;
238
- this._valid = this.activeForm.checkValidity();
239
- this.internalValidate = false;
240
243
  if (this._valid) {
241
244
  this.submitForm();
242
245
  return;
@@ -270,10 +273,12 @@ let FieldValidator = class {
270
273
  return this._activeForm;
271
274
  }
272
275
  set activeForm(form) {
273
- if (this._activeForm)
276
+ if (!form)
277
+ return;
278
+ if (this._activeForm) {
274
279
  this._activeForm.removeEventListener('invalid', this.handleFormInvalid, true);
275
- if (form)
276
- form.addEventListener('invalid', this.handleFormInvalid, true);
280
+ }
281
+ form.addEventListener('invalid', this.handleFormInvalid, true);
277
282
  this._activeForm = form;
278
283
  }
279
284
  /** Sync up validateOn with all fields */
@@ -298,9 +303,13 @@ let FieldValidator = class {
298
303
  get valid() {
299
304
  return this._valid;
300
305
  }
301
- /** The current form payload as a reactive store. @readonly */
306
+ /** The current form state as a stencil store. */
307
+ get store() {
308
+ return this._store;
309
+ }
310
+ /** The current form payload as a reactive proxy. @readonly */
302
311
  get payload() {
303
- return this.store.state;
312
+ return this._store.state;
304
313
  }
305
314
  /** Returns true if validation errors will be displayed to the user */
306
315
  get showValidation() {
@@ -336,20 +345,27 @@ let FieldValidator = class {
336
345
  fields: [field],
337
346
  name: field.name,
338
347
  valid: !field.invalid,
339
- value: this.store.state[field.name],
348
+ value: this._store.state[field.name],
340
349
  dirty: false,
341
350
  validityMessage: field.validityMessage,
342
351
  });
343
352
  });
344
353
  return validationState;
345
354
  }
355
+ /**
356
+ * Sets the state of the form using an object of key / value pairs.
357
+ * @param state - the state to load in the store
358
+ */
359
+ async setStore(state) {
360
+ Object.entries(state).forEach(([key, val]) => (this.store.state[key] = val));
361
+ }
346
362
  // private methods
347
363
  attachSlotObserver() {
348
364
  if (!!this.mo)
349
365
  return;
350
366
  const mo = (this.mo = new MutationObserver((_entries) => {
351
367
  const form = this.host.querySelector('form');
352
- if (form !== this.activeForm)
368
+ if (form && form !== this.activeForm)
353
369
  this.activeForm = form;
354
370
  this.setupFields();
355
371
  }));
@@ -375,12 +391,53 @@ let FieldValidator = class {
375
391
  return;
376
392
  // setup the initial store state / refresh on new fields
377
393
  this.fields = fields;
394
+ this.storeToFields(this.fields);
378
395
  this.validateOnChange();
379
- this.setFieldValue(this.fields);
380
- this.nanoPayloadChange.emit(this.store.state);
396
+ this.fieldsToStore(this.fields);
397
+ this.nanoPayloadChange.emit(this._store.state);
398
+ }
399
+ storeToFields(fields) {
400
+ fields.forEach((field) => {
401
+ const fieldName = field.name;
402
+ if (!fieldName.length ||
403
+ typeof this._store.state[fieldName] === 'undefined')
404
+ return;
405
+ switch (field.tagName) {
406
+ case 'NANO-CHECKBOX':
407
+ let cb = field;
408
+ if (cb.type === 'radio' ||
409
+ cb.type === 'segment' ||
410
+ cb.type === 'segment-pill') {
411
+ if (this._store.state[fieldName] === cb.value)
412
+ cb.checked = true;
413
+ else
414
+ cb.checked = false;
415
+ }
416
+ else if (Array.isArray(this._store.state[fieldName])) {
417
+ if (this._store.state[fieldName].includes(cb.value))
418
+ cb.checked = true;
419
+ else
420
+ cb.checked = false;
421
+ }
422
+ else {
423
+ if (this._store.state[fieldName] === cb.value)
424
+ cb.checked = true;
425
+ else
426
+ cb.checked = false;
427
+ }
428
+ break;
429
+ case 'NANO-FILE-UPLOAD':
430
+ field.files =
431
+ this._store.state[fieldName];
432
+ break;
433
+ default:
434
+ field.value = this._store.state[fieldName];
435
+ break;
436
+ }
437
+ });
381
438
  }
382
439
  /** Loops through all `nano-...` fields and extracts their values into our store */
383
- setFieldValue(fields) {
440
+ fieldsToStore(fields) {
384
441
  fields.forEach((field) => {
385
442
  const fieldName = field.name;
386
443
  if (!fieldName.length)
@@ -391,34 +448,41 @@ let FieldValidator = class {
391
448
  if (cb.type === 'radio' ||
392
449
  cb.type === 'segment' ||
393
450
  cb.type === 'segment-pill') {
451
+ // radio type control - only one can be checked
394
452
  if (cb.checked)
395
- this.store.state[fieldName] = cb.value;
453
+ this._store.state[fieldName] = cb.value;
396
454
  else if (!cb.checked &&
397
- (cb.value === this.store.state[fieldName] ||
398
- !this.store.state[fieldName]))
399
- this.store.state[fieldName] = '';
455
+ (cb.value === this._store.state[fieldName] ||
456
+ !this._store.state[fieldName]))
457
+ this._store.state[fieldName] = '';
400
458
  }
401
459
  else if (this.fields.filter((f) => f.name === fieldName && f.tagName === 'NANO-CHECKBOX').length > 1) {
402
- const currentArr = Array.isArray(this.store.state[fieldName])
403
- ? this.store.state[fieldName]
460
+ // multiple checkbox type control
461
+ const currentArr = Array.isArray(this._store.state[fieldName])
462
+ ? this._store.state[fieldName]
404
463
  : [];
405
464
  if (cb.checked) {
406
- if (!this.store.state[fieldName].includes(cb.value)) {
407
- this.store.state[fieldName] = [...currentArr, cb.value];
465
+ if (!this._store.state[fieldName].includes(cb.value)) {
466
+ this._store.state[fieldName] = [...currentArr, cb.value];
408
467
  }
409
468
  }
410
469
  else {
411
- this.store.state[fieldName] = currentArr.filter((v) => v !== cb.value);
470
+ this._store.state[fieldName] = currentArr.filter((v) => v !== cb.value);
412
471
  }
413
472
  }
414
- else
415
- this.store.state[fieldName] = cb.value;
473
+ else {
474
+ // single checkbox - on or off
475
+ if (cb.checked)
476
+ this._store.state[fieldName] = cb.value;
477
+ else
478
+ this._store.state[fieldName] = '';
479
+ }
416
480
  break;
417
481
  case 'NANO-FILE-UPLOAD':
418
- this.store.state[fieldName] = field.files;
482
+ this._store.state[fieldName] = field.files;
419
483
  break;
420
484
  default:
421
- this.store.state[fieldName] = field.value;
485
+ this._store.state[fieldName] = field.value;
422
486
  break;
423
487
  }
424
488
  });
@@ -427,12 +491,12 @@ let FieldValidator = class {
427
491
  async validate(key, newVal) {
428
492
  if (!this.validation)
429
493
  return;
430
- const res = this.validation(key, newVal, this.store.state);
494
+ const res = this.validation(key, newVal, this._store.state);
431
495
  // no nothing - return
432
496
  if (!res)
433
497
  return;
434
498
  // stencil public methods are async
435
- // so we must to coerce our validation
499
+ // so we must coerce our validation
436
500
  // collection loop into a promise
437
501
  await Promise.all(Object.entries(res).map(async ([key, o]) => {
438
502
  // switch on/off validation messages
@@ -466,7 +530,7 @@ let FieldValidator = class {
466
530
  /** Loops through all store entries and checks field validity */
467
531
  async validateAllFields() {
468
532
  // This forces our loop to `await` and finish sequentially ... silly async stencil methods
469
- await Object.entries(this.store.state).reduce(async (memo, [key, value]) => {
533
+ await Object.entries(this._store.state).reduce(async (memo, [key, value]) => {
470
534
  await memo;
471
535
  await this.validate(key, value);
472
536
  }, undefined);
@@ -492,13 +556,13 @@ let FieldValidator = class {
492
556
  }
493
557
  connectedCallback() {
494
558
  this.userForm = this.host.querySelector('form');
559
+ this._store = createStore({});
495
560
  }
496
561
  componentDidLoad() {
497
562
  requestAnimationFrame(() => {
498
- this.store = createStore({});
499
563
  this.setupFields();
500
564
  this.attachSlotObserver();
501
- this.store.on('set', (key, value) => this.handleStoreChange(key, value));
565
+ this._store.on('set', (key, value) => this.handleStoreChange(key, value));
502
566
  this.host.addEventListener('nanoChange', this.handleFieldChange);
503
567
  this.host.addEventListener('submit', this.handleSubmit);
504
568
  });
@@ -506,7 +570,7 @@ let FieldValidator = class {
506
570
  disconnectedCallback() {
507
571
  if (this.mo)
508
572
  this.mo.disconnect();
509
- this.store.dispose();
573
+ this._store.reset();
510
574
  this.host.removeEventListener('nanoChange', this.handleFieldChange);
511
575
  this.host.removeEventListener('submit', this.handleSubmit);
512
576
  if (this.activeForm)