@nanoporetech-digital/components 3.1.1 → 3.3.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.
- package/CHANGELOG.md +38 -0
- package/dist/cjs/dom-d7c33f11.js.map +1 -1
- package/dist/cjs/index-41582c2a.js +4 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{modal-f09e431f.js → modal-e4defcc3.js} +3 -3
- package/dist/cjs/{modal-f09e431f.js.map → modal-e4defcc3.js.map} +1 -1
- package/dist/cjs/nano-alert.cjs.entry.js +3 -3
- package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-algolia.cjs.entry.js +1 -1
- package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
- package/dist/cjs/nano-aspect-ratio.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +1 -1
- package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dialog.cjs.entry.js +3 -3
- package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-drawer.cjs.entry.js +3 -3
- package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +10 -5
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +41 -25
- package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-search-results.cjs.entry.js +1 -1
- package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-hero.cjs.entry.js +1 -1
- package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +1 -1
- package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/nano-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-rating.cjs.entry.js +1 -1
- package/dist/cjs/nano-rating.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +23 -12
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
- package/dist/cjs/nano-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-content.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-844394ad.js → nano-table-2ddb22be.js} +27 -26
- package/dist/cjs/nano-table-2ddb22be.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/nano-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/nano-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{tabbable-de4c23d8.js → tabbable-bdf10c84.js} +13 -4
- package/dist/cjs/tabbable-bdf10c84.js.map +1 -0
- package/dist/cjs/{table.worker-1bc19978.js → table.worker-ec62a083.js} +2 -2
- package/dist/cjs/table.worker-ec62a083.js.map +1 -0
- package/dist/collection/components/alert/alert.css +16 -56
- package/dist/collection/components/algolia/algolia.css +5 -22
- package/dist/collection/components/aspect-ratio/aspect-ratio.css +2 -4
- package/dist/collection/components/checkbox/checkbox-group.css +8 -19
- package/dist/collection/components/checkbox/checkbox.css +24 -61
- package/dist/collection/components/date-input/date-input.css +8 -29
- package/dist/collection/components/date-picker/date-picker.css +22 -61
- package/dist/collection/components/details/details.css +7 -27
- package/dist/collection/components/dialog/dialog.css +20 -79
- package/dist/collection/components/drawer/drawer.css +13 -42
- package/dist/collection/components/dropdown/dropdown.css +5 -13
- package/dist/collection/components/file-upload/file-upload.css +45 -127
- package/dist/collection/components/global-nav/global-nav.js +40 -24
- package/dist/collection/components/global-nav/global-nav.js.map +1 -1
- package/dist/collection/components/global-nav/style/global-nav.css +147 -302
- package/dist/collection/components/global-search-results/global-search-results.css +81 -248
- package/dist/collection/components/grid/grid.css +21 -76
- package/dist/collection/components/hero/hero.css +22 -63
- package/dist/collection/components/icon/icon.css +2 -5
- package/dist/collection/components/icon-button/icon-button.css +4 -15
- package/dist/collection/components/img/img.css +9 -19
- package/dist/collection/components/input/input.css +34 -148
- package/dist/collection/components/input/input.js +2 -2
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/menu/menu.css +1 -2
- package/dist/collection/components/menu-drawer/menu-drawer.css +16 -47
- package/dist/collection/components/nav-item/nav-item.css +73 -147
- package/dist/collection/components/nav-item/nav-item.js +8 -3
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/option/option.css +10 -40
- package/dist/collection/components/progress-bar/progress-bar.css +5 -26
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/collection/components/range/range.css +20 -56
- package/dist/collection/components/rating/rating.css +9 -28
- package/dist/collection/components/resize-observe/resize-observe.js +38 -12
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/select/select.css +56 -210
- package/dist/collection/components/skeleton/skeleton.css +2 -17
- package/dist/collection/components/slides/slide.css +4 -13
- package/dist/collection/components/slides/slides.css +3 -14
- package/dist/collection/components/spinner/spinner.css +34 -122
- package/dist/collection/components/split-pane/split-pane.css +4 -18
- package/dist/collection/components/sticker/sticker.css +8 -18
- package/dist/collection/components/table/table.children.js +10 -10
- package/dist/collection/components/table/table.children.js.map +1 -1
- package/dist/collection/components/table/table.css +111 -61
- package/dist/collection/components/table/table.js +22 -20
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.service.js +1 -1
- package/dist/collection/components/table/table.service.js.map +1 -1
- package/dist/collection/components/tabs/tab-content.css +11 -59
- package/dist/collection/components/tabs/tab-group.css +20 -77
- package/dist/collection/components/tabs/tab.css +11 -30
- package/dist/collection/components/tooltip/tooltip.css +26 -56
- package/dist/collection/utils/dom.js.map +1 -1
- package/dist/collection/utils/modal.js +1 -1
- package/dist/collection/utils/modal.js.map +1 -1
- package/dist/collection/utils/tabbable.js +12 -3
- package/dist/collection/utils/tabbable.js.map +1 -1
- package/dist/components/algolia.js +1 -1
- package/dist/components/algolia.js.map +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dom.js.map +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/grid.js.map +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon.js +1 -1
- package/dist/components/icon.js.map +1 -1
- package/dist/components/img.js +1 -1
- package/dist/components/img.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/menu.js.map +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.js.map +1 -1
- package/dist/components/nano-alert.js +1 -1
- package/dist/components/nano-alert.js.map +1 -1
- package/dist/components/nano-aspect-ratio.js +1 -1
- package/dist/components/nano-aspect-ratio.js.map +1 -1
- package/dist/components/nano-checkbox-group.js +1 -1
- package/dist/components/nano-checkbox-group.js.map +1 -1
- package/dist/components/nano-checkbox.js +1 -1
- package/dist/components/nano-checkbox.js.map +1 -1
- package/dist/components/nano-date-input.js +1 -1
- package/dist/components/nano-date-input.js.map +1 -1
- package/dist/components/nano-details.js +1 -1
- package/dist/components/nano-details.js.map +1 -1
- package/dist/components/nano-dialog.js +1 -1
- package/dist/components/nano-dialog.js.map +1 -1
- package/dist/components/nano-drawer.js +1 -1
- package/dist/components/nano-drawer.js.map +1 -1
- package/dist/components/nano-file-upload.js +1 -1
- package/dist/components/nano-file-upload.js.map +1 -1
- package/dist/components/nano-global-nav.js +41 -25
- package/dist/components/nano-global-nav.js.map +1 -1
- package/dist/components/nano-global-search-results.js +1 -1
- package/dist/components/nano-global-search-results.js.map +1 -1
- package/dist/components/nano-hero.js +1 -1
- package/dist/components/nano-hero.js.map +1 -1
- package/dist/components/nano-menu-drawer.js +1 -1
- package/dist/components/nano-menu-drawer.js.map +1 -1
- package/dist/components/nano-range.js +1 -1
- package/dist/components/nano-range.js.map +1 -1
- package/dist/components/nano-rating.js +1 -1
- package/dist/components/nano-rating.js.map +1 -1
- package/dist/components/nano-slide.js +1 -1
- package/dist/components/nano-slide.js.map +1 -1
- package/dist/components/nano-slides.js +1 -1
- package/dist/components/nano-slides.js.map +1 -1
- package/dist/components/nano-split-pane.js +1 -1
- package/dist/components/nano-split-pane.js.map +1 -1
- package/dist/components/nano-tab-content.js +1 -1
- package/dist/components/nano-tab-content.js.map +1 -1
- package/dist/components/nano-tab-group.js +1 -1
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nano-tab.js +1 -1
- package/dist/components/nano-tab.js.map +1 -1
- package/dist/components/nano-table.js +35 -28
- package/dist/components/nano-table.js.map +1 -1
- package/dist/components/nav-item.js +9 -4
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/option.js +1 -1
- package/dist/components/option.js.map +1 -1
- package/dist/components/progress-bar.js +2 -2
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/resize-observe.js +23 -13
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/sticker.js +1 -1
- package/dist/components/sticker.js.map +1 -1
- package/dist/components/tabbable.js +12 -3
- package/dist/components/tabbable.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/custom-elements/index.js +147 -106
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/dom-d3ad49e2.js.map +1 -1
- package/dist/esm/index-3c280603.js +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{modal-215df46b.js → modal-5c9ce466.js} +3 -3
- package/dist/esm/{modal-215df46b.js.map → modal-5c9ce466.js.map} +1 -1
- package/dist/esm/nano-alert.entry.js +3 -3
- package/dist/esm/nano-alert.entry.js.map +1 -1
- package/dist/esm/nano-algolia.entry.js +1 -1
- package/dist/esm/nano-algolia.entry.js.map +1 -1
- package/dist/esm/nano-aspect-ratio.entry.js +1 -1
- package/dist/esm/nano-aspect-ratio.entry.js.map +1 -1
- package/dist/esm/nano-checkbox-group.entry.js +1 -1
- package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
- package/dist/esm/nano-checkbox.entry.js +1 -1
- package/dist/esm/nano-checkbox.entry.js.map +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +2 -2
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-date-input.entry.js +1 -1
- package/dist/esm/nano-date-input.entry.js.map +1 -1
- package/dist/esm/nano-date-picker.entry.js +1 -1
- package/dist/esm/nano-date-picker.entry.js.map +1 -1
- package/dist/esm/nano-details.entry.js +1 -1
- package/dist/esm/nano-details.entry.js.map +1 -1
- package/dist/esm/nano-dialog.entry.js +3 -3
- package/dist/esm/nano-dialog.entry.js.map +1 -1
- package/dist/esm/nano-drawer.entry.js +3 -3
- package/dist/esm/nano-drawer.entry.js.map +1 -1
- package/dist/esm/nano-dropdown.entry.js +2 -2
- package/dist/esm/nano-dropdown.entry.js.map +1 -1
- package/dist/esm/nano-file-upload.entry.js +1 -1
- package/dist/esm/nano-file-upload.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +10 -5
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav.entry.js +41 -25
- package/dist/esm/nano-global-nav.entry.js.map +1 -1
- package/dist/esm/nano-global-search-results.entry.js +1 -1
- package/dist/esm/nano-global-search-results.entry.js.map +1 -1
- package/dist/esm/nano-grid_3.entry.js +2 -2
- package/dist/esm/nano-grid_3.entry.js.map +1 -1
- package/dist/esm/nano-hero.entry.js +1 -1
- package/dist/esm/nano-hero.entry.js.map +1 -1
- package/dist/esm/nano-icon-button.entry.js +1 -1
- package/dist/esm/nano-icon-button.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js +1 -1
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +1 -1
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-menu-drawer.entry.js +1 -1
- package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
- package/dist/esm/nano-progress-bar.entry.js +2 -2
- package/dist/esm/nano-progress-bar.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-range.entry.js.map +1 -1
- package/dist/esm/nano-rating.entry.js +1 -1
- package/dist/esm/nano-rating.entry.js.map +1 -1
- package/dist/esm/nano-resize-observe_2.entry.js +23 -12
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/nano-slide.entry.js.map +1 -1
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-slides.entry.js.map +1 -1
- package/dist/esm/nano-spinner.entry.js +1 -1
- package/dist/esm/nano-spinner.entry.js.map +1 -1
- package/dist/esm/nano-split-pane.entry.js +1 -1
- package/dist/esm/nano-split-pane.entry.js.map +1 -1
- package/dist/esm/nano-sticker.entry.js +1 -1
- package/dist/esm/nano-sticker.entry.js.map +1 -1
- package/dist/esm/nano-tab-content.entry.js +1 -1
- package/dist/esm/nano-tab-content.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +1 -1
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/nano-tab.entry.js +1 -1
- package/dist/esm/nano-tab.entry.js.map +1 -1
- package/dist/esm/{nano-table-19d19d72.js → nano-table-9d4fbd41.js} +27 -26
- package/dist/esm/nano-table-9d4fbd41.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/nano-tooltip.entry.js +1 -1
- package/dist/esm/nano-tooltip.entry.js.map +1 -1
- package/dist/esm/{tabbable-614f515e.js → tabbable-31485ff7.js} +13 -4
- package/dist/esm/tabbable-31485ff7.js.map +1 -0
- package/dist/esm/{table.worker-c82cecdf.js → table.worker-1ba8ac3f.js} +2 -2
- package/dist/esm/table.worker-1ba8ac3f.js.map +1 -0
- package/dist/nano-components/index.esm.js +1 -1
- package/dist/nano-components/nano-components.css +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/{p-35295332.entry.js → p-151aad1e.entry.js} +5 -5
- package/dist/nano-components/{p-35295332.entry.js.map → p-151aad1e.entry.js.map} +1 -1
- package/dist/nano-components/p-15543295.entry.js +5 -0
- package/dist/nano-components/{p-6e3412d2.entry.js.map → p-15543295.entry.js.map} +1 -1
- package/dist/nano-components/p-1e709f87.entry.js +5 -0
- package/dist/nano-components/p-1e709f87.entry.js.map +1 -0
- package/dist/nano-components/p-1f347342.entry.js +5 -0
- package/dist/nano-components/{p-02df1f62.entry.js.map → p-1f347342.entry.js.map} +1 -1
- package/dist/nano-components/p-216ece9a.js +5 -0
- package/dist/nano-components/{p-7ade1695.js.map → p-216ece9a.js.map} +0 -0
- package/dist/nano-components/p-23575705.entry.js +5 -0
- package/dist/nano-components/{p-6958df8c.entry.js.map → p-23575705.entry.js.map} +1 -1
- package/dist/nano-components/p-244223f0.entry.js +5 -0
- package/dist/nano-components/{p-6cd59e58.entry.js.map → p-244223f0.entry.js.map} +1 -1
- package/dist/nano-components/p-284dd9a2.entry.js +5 -0
- package/dist/nano-components/{p-5107646c.entry.js.map → p-284dd9a2.entry.js.map} +1 -1
- package/dist/nano-components/p-2cb4615b.entry.js +5 -0
- package/dist/nano-components/{p-e3730878.entry.js.map → p-2cb4615b.entry.js.map} +1 -1
- package/dist/nano-components/p-36842a50.entry.js +5 -0
- package/dist/nano-components/{p-f69f93e9.entry.js.map → p-36842a50.entry.js.map} +1 -1
- package/dist/nano-components/p-41addb3a.entry.js +5 -0
- package/dist/nano-components/{p-0a5ad0ef.entry.js.map → p-41addb3a.entry.js.map} +1 -1
- package/dist/nano-components/{p-9a385481.js → p-45abbbdd.js} +2 -2
- package/dist/nano-components/p-45abbbdd.js.map +1 -0
- package/dist/nano-components/p-46b348b7.entry.js +5 -0
- package/dist/nano-components/{p-28f713fb.entry.js.map → p-46b348b7.entry.js.map} +1 -1
- package/dist/nano-components/p-4b69178e.entry.js +5 -0
- package/dist/nano-components/{p-5e33798f.entry.js.map → p-4b69178e.entry.js.map} +1 -1
- package/dist/nano-components/p-4f0e14b5.entry.js +5 -0
- package/dist/nano-components/{p-8f5e0022.entry.js.map → p-4f0e14b5.entry.js.map} +1 -1
- package/dist/nano-components/p-559a6492.entry.js +5 -0
- package/dist/nano-components/p-559a6492.entry.js.map +1 -0
- package/dist/nano-components/p-601e18d5.entry.js +5 -0
- package/dist/nano-components/p-601e18d5.entry.js.map +1 -0
- package/dist/nano-components/p-69e5a37d.entry.js +5 -0
- package/dist/nano-components/{p-282987e6.entry.js.map → p-69e5a37d.entry.js.map} +1 -1
- package/dist/nano-components/p-751927d1.entry.js +5 -0
- package/dist/nano-components/{p-5d81773d.entry.js.map → p-751927d1.entry.js.map} +1 -1
- package/dist/nano-components/p-845ae77e.js.map +1 -1
- package/dist/nano-components/p-866e7e88.js +5 -0
- package/dist/nano-components/p-866e7e88.js.map +1 -0
- package/dist/nano-components/{p-b4a045a2.entry.js → p-89b8ce4f.entry.js} +2 -2
- package/dist/nano-components/{p-b4a045a2.entry.js.map → p-89b8ce4f.entry.js.map} +0 -0
- package/dist/nano-components/p-9059c8c1.entry.js +5 -0
- package/dist/nano-components/{p-d8e8d7e3.entry.js.map → p-9059c8c1.entry.js.map} +1 -1
- package/dist/nano-components/p-92504f7f.entry.js +5 -0
- package/dist/nano-components/{p-50fcb11c.entry.js.map → p-92504f7f.entry.js.map} +1 -1
- package/dist/nano-components/p-99fbae74.entry.js +5 -0
- package/dist/nano-components/{p-8a52a411.entry.js.map → p-99fbae74.entry.js.map} +1 -1
- package/dist/nano-components/p-9eeed8f5.entry.js +5 -0
- package/dist/nano-components/{p-4c97f05f.entry.js.map → p-9eeed8f5.entry.js.map} +1 -1
- package/dist/nano-components/p-a183e3c7.entry.js +5 -0
- package/dist/nano-components/{p-b290a970.entry.js.map → p-a183e3c7.entry.js.map} +1 -1
- package/dist/nano-components/p-a2e38472.entry.js +5 -0
- package/dist/nano-components/p-a2e38472.entry.js.map +1 -0
- package/dist/nano-components/p-b87539f0.entry.js +5 -0
- package/dist/nano-components/{p-efa8c520.entry.js.map → p-b87539f0.entry.js.map} +1 -1
- package/dist/nano-components/p-b9c8b99f.entry.js +5 -0
- package/dist/nano-components/p-b9c8b99f.entry.js.map +1 -0
- package/dist/nano-components/{p-cb79d1ec.js → p-c9a7c7ea.js} +2 -2
- package/dist/nano-components/{p-cb79d1ec.js.map → p-c9a7c7ea.js.map} +1 -1
- package/dist/nano-components/{p-c45851c3.entry.js → p-d1c8eca4.entry.js} +2 -2
- package/dist/nano-components/{p-c45851c3.entry.js.map → p-d1c8eca4.entry.js.map} +1 -1
- package/dist/nano-components/p-d8678bdc.entry.js +5 -0
- package/dist/nano-components/p-d8678bdc.entry.js.map +1 -0
- package/dist/nano-components/p-db4b6602.entry.js +5 -0
- package/dist/nano-components/{p-716064b6.entry.js.map → p-db4b6602.entry.js.map} +1 -1
- package/dist/nano-components/{p-916e4b6b.entry.js → p-dba8a88d.entry.js} +2 -2
- package/dist/nano-components/{p-916e4b6b.entry.js.map → p-dba8a88d.entry.js.map} +1 -1
- package/dist/nano-components/p-e4e41e06.entry.js +5 -0
- package/dist/nano-components/p-e4e41e06.entry.js.map +1 -0
- package/dist/nano-components/p-e5408bc8.entry.js +5 -0
- package/dist/nano-components/{p-c5bb5540.entry.js.map → p-e5408bc8.entry.js.map} +1 -1
- package/dist/nano-components/p-f43d1d8e.entry.js +5 -0
- package/dist/nano-components/p-f43d1d8e.entry.js.map +1 -0
- package/dist/nano-components/p-f7471cca.entry.js +5 -0
- package/dist/nano-components/{p-66ad1418.entry.js.map → p-f7471cca.entry.js.map} +1 -1
- package/dist/nano-components/p-fe94eeff.entry.js +5 -0
- package/dist/nano-components/{p-701e8ebf.entry.js.map → p-fe94eeff.entry.js.map} +1 -1
- package/dist/nano-components/p-feb9f164.entry.js +5 -0
- package/dist/nano-components/{p-81136f24.entry.js.map → p-feb9f164.entry.js.map} +1 -1
- package/dist/themes/nanopore.css +1 -1
- package/dist/themes/nanopore.css.map +1 -1
- package/dist/types/components/global-nav/global-nav.d.ts +8 -3
- package/dist/types/components/input/input.d.ts +2 -2
- package/dist/types/components/resize-observe/resize-observe.d.ts +5 -2
- package/dist/types/components/table/table.d.ts +8 -7
- package/dist/types/components.d.ts +4 -0
- package/dist/types/utils/dom.d.ts +1 -1
- package/docs-json.json +175 -9
- package/docs-vscode.json +2 -2
- package/package.json +2 -2
- package/dist/cjs/nano-table-844394ad.js.map +0 -1
- package/dist/cjs/tabbable-de4c23d8.js.map +0 -1
- package/dist/cjs/table.worker-1bc19978.js.map +0 -1
- package/dist/esm/nano-table-19d19d72.js.map +0 -1
- package/dist/esm/tabbable-614f515e.js.map +0 -1
- package/dist/esm/table.worker-c82cecdf.js.map +0 -1
- package/dist/nano-components/p-02df1f62.entry.js +0 -5
- package/dist/nano-components/p-0a5ad0ef.entry.js +0 -5
- package/dist/nano-components/p-1ae8c03e.entry.js +0 -5
- package/dist/nano-components/p-1ae8c03e.entry.js.map +0 -1
- package/dist/nano-components/p-282987e6.entry.js +0 -5
- package/dist/nano-components/p-28b43ee9.entry.js +0 -5
- package/dist/nano-components/p-28b43ee9.entry.js.map +0 -1
- package/dist/nano-components/p-28f713fb.entry.js +0 -5
- package/dist/nano-components/p-37553477.entry.js +0 -5
- package/dist/nano-components/p-37553477.entry.js.map +0 -1
- package/dist/nano-components/p-4c97f05f.entry.js +0 -5
- package/dist/nano-components/p-50fcb11c.entry.js +0 -5
- package/dist/nano-components/p-5107646c.entry.js +0 -5
- package/dist/nano-components/p-5d81773d.entry.js +0 -5
- package/dist/nano-components/p-5e33798f.entry.js +0 -5
- package/dist/nano-components/p-66ad1418.entry.js +0 -5
- package/dist/nano-components/p-6958df8c.entry.js +0 -5
- package/dist/nano-components/p-6cd59e58.entry.js +0 -5
- package/dist/nano-components/p-6e3412d2.entry.js +0 -5
- package/dist/nano-components/p-701e8ebf.entry.js +0 -5
- package/dist/nano-components/p-716064b6.entry.js +0 -5
- package/dist/nano-components/p-7ade1695.js +0 -5
- package/dist/nano-components/p-81136f24.entry.js +0 -5
- package/dist/nano-components/p-8a52a411.entry.js +0 -5
- package/dist/nano-components/p-8f5e0022.entry.js +0 -5
- package/dist/nano-components/p-9a385481.js.map +0 -1
- package/dist/nano-components/p-a151dea5.entry.js +0 -5
- package/dist/nano-components/p-a151dea5.entry.js.map +0 -1
- package/dist/nano-components/p-b290a970.entry.js +0 -5
- package/dist/nano-components/p-b7901427.entry.js +0 -5
- package/dist/nano-components/p-b7901427.entry.js.map +0 -1
- package/dist/nano-components/p-b83a8320.js +0 -5
- package/dist/nano-components/p-b83a8320.js.map +0 -1
- package/dist/nano-components/p-c5bb5540.entry.js +0 -5
- package/dist/nano-components/p-d8e8d7e3.entry.js +0 -5
- package/dist/nano-components/p-e3730878.entry.js +0 -5
- package/dist/nano-components/p-efa8c520.entry.js +0 -5
- package/dist/nano-components/p-f69f93e9.entry.js +0 -5
- package/dist/nano-components/p-f71f69c9.entry.js +0 -5
- package/dist/nano-components/p-f71f69c9.entry.js.map +0 -1
- package/dist/nano-components/p-f95a263c.entry.js +0 -5
- package/dist/nano-components/p-f95a263c.entry.js.map +0 -1
- package/dist/nano-components/p-fa2a6733.entry.js +0 -5
- package/dist/nano-components/p-fa2a6733.entry.js.map +0 -1
@@ -19,8 +19,6 @@
|
|
19
19
|
display: block;
|
20
20
|
}
|
21
21
|
.form-ctrl.has-helper-end {
|
22
|
-
display: -webkit-box;
|
23
|
-
display: -ms-flexbox;
|
24
22
|
display: flex;
|
25
23
|
gap: 1rem;
|
26
24
|
opacity: 0;
|
@@ -29,9 +27,7 @@
|
|
29
27
|
opacity: 1;
|
30
28
|
}
|
31
29
|
.form-ctrl.has-helper-end .form-ctrl__wrapper {
|
32
|
-
|
33
|
-
-ms-flex: 1 1 100%;
|
34
|
-
flex: 1 1 100%;
|
30
|
+
flex: 1 1 100%;
|
35
31
|
}
|
36
32
|
.form-ctrl.has-helper-end .form-ctrl__helper-end {
|
37
33
|
display: none;
|
@@ -74,31 +70,24 @@ label.visually-hide,
|
|
74
70
|
|
75
71
|
.form-ctrl__float-label {
|
76
72
|
padding-block: 0;
|
77
|
-
-
|
78
|
-
|
79
|
-
-webkit-padding-start: var(--padding-start);
|
80
|
-
padding-inline-start: var(--padding-start);
|
73
|
+
padding-inline-end: 0;
|
74
|
+
padding-inline-start: var(--padding-start);
|
81
75
|
color: var(--label-color);
|
82
76
|
position: absolute;
|
83
77
|
font-size: 1.15em;
|
84
|
-
|
85
|
-
|
86
|
-
-webkit-transform-origin: top left;
|
87
|
-
transform-origin: top left;
|
78
|
+
transform: translateY(-50%);
|
79
|
+
transform-origin: top left;
|
88
80
|
inset-block-start: 50%;
|
89
|
-
-webkit-transition: all 0.125s ease-in;
|
90
81
|
transition: all 0.125s ease-in;
|
91
82
|
opacity: 1;
|
92
83
|
}
|
93
84
|
:host(.has-focus) .form-ctrl__float-label, :host(.has-value) .form-ctrl__float-label {
|
94
|
-
|
95
|
-
transform: translateY(-110%);
|
85
|
+
transform: translateY(-110%);
|
96
86
|
font-size: 0.8em;
|
97
87
|
opacity: 0.7;
|
98
88
|
}
|
99
89
|
.form-ctrl__float-label .form-ctrl__label-charcount {
|
100
90
|
opacity: 0;
|
101
|
-
-webkit-transition: opacity 0.125s ease-in;
|
102
91
|
transition: opacity 0.125s ease-in;
|
103
92
|
}
|
104
93
|
:host(.has-focus) .form-ctrl__float-label .form-ctrl__label-charcount, :host(.has-value) .form-ctrl__float-label .form-ctrl__label-charcount {
|
@@ -109,53 +98,40 @@ label.visually-hide,
|
|
109
98
|
}
|
110
99
|
:host(.has-focus) .form-ctrl__textarea .form-ctrl__float-label {
|
111
100
|
inset-block-start: 0;
|
112
|
-
|
113
|
-
transform: translateY(38%);
|
101
|
+
transform: translateY(38%);
|
114
102
|
}
|
115
103
|
:host(.has-value) .form-ctrl__textarea .form-ctrl__float-label {
|
116
104
|
inset-block-start: 0;
|
117
|
-
|
118
|
-
transform: translateY(38%);
|
105
|
+
transform: translateY(38%);
|
119
106
|
}
|
120
107
|
|
121
108
|
.form-ctrl__label {
|
122
109
|
color: var(--label-color);
|
123
110
|
font-size: var(--label-font-size);
|
124
|
-
-
|
125
|
-
padding-block-end: var(--padding-bottom);
|
111
|
+
padding-block-end: var(--padding-bottom);
|
126
112
|
line-height: 1;
|
127
|
-
display: -webkit-box;
|
128
|
-
display: -ms-flexbox;
|
129
113
|
display: flex;
|
130
114
|
}
|
131
115
|
.form-ctrl__label .form-ctrl__label-wrap {
|
132
|
-
|
133
|
-
-ms-flex: 1;
|
134
|
-
flex: 1;
|
116
|
+
flex: 1;
|
135
117
|
overflow: hidden;
|
136
118
|
white-space: nowrap;
|
137
119
|
text-overflow: ellipsis;
|
138
120
|
}
|
139
121
|
.form-ctrl__label .form-ctrl__label-placeholder {
|
140
122
|
margin-block: unset;
|
141
|
-
-
|
142
|
-
|
143
|
-
-webkit-margin-start: 0;
|
144
|
-
margin-inline-start: 0;
|
123
|
+
margin-inline-end: 5px;
|
124
|
+
margin-inline-start: 0;
|
145
125
|
opacity: 0;
|
146
126
|
-webkit-appearance: none;
|
147
|
-
-moz-appearance: none;
|
148
127
|
appearance: none;
|
149
|
-
-webkit-transition: 0.3s ease opacity;
|
150
128
|
transition: 0.3s ease opacity;
|
151
129
|
font-size: 0.9em;
|
152
130
|
}
|
153
131
|
.form-ctrl__label .form-ctrl__label-charcount {
|
154
132
|
margin-block: unset;
|
155
|
-
-
|
156
|
-
|
157
|
-
-webkit-margin-start: auto;
|
158
|
-
margin-inline-start: auto;
|
133
|
+
margin-inline-end: 0;
|
134
|
+
margin-inline-start: auto;
|
159
135
|
font-size: 0.9em;
|
160
136
|
opacity: 0.5;
|
161
137
|
}
|
@@ -173,7 +149,6 @@ label.visually-hide,
|
|
173
149
|
.has-float-label .select__native-input,
|
174
150
|
.has-float-label .input__native-ctrl {
|
175
151
|
opacity: 0;
|
176
|
-
-webkit-transition: opacity 0.125s ease-in;
|
177
152
|
transition: opacity 0.125s ease-in;
|
178
153
|
}
|
179
154
|
:host(.has-focus) .has-float-label .select__multi-input, :host(.has-value) .has-float-label .select__multi-input,
|
@@ -198,7 +173,6 @@ label.visually-hide,
|
|
198
173
|
position: absolute;
|
199
174
|
font-size: var(--invalid-msg-font-size);
|
200
175
|
line-height: 1.2;
|
201
|
-
-webkit-transition: 0.3s ease-out opacity;
|
202
176
|
transition: 0.3s ease-out opacity;
|
203
177
|
}
|
204
178
|
|
@@ -211,9 +185,7 @@ label.visually-hide,
|
|
211
185
|
}
|
212
186
|
|
213
187
|
.form-ctrl__helper-end {
|
214
|
-
|
215
|
-
-ms-flex: 1 1 30%;
|
216
|
-
flex: 1 1 30%;
|
188
|
+
flex: 1 1 30%;
|
217
189
|
min-inline-size: 150px;
|
218
190
|
font-size: var(--invalid-msg-font-size);
|
219
191
|
color: var(--help-msg-color);
|
@@ -246,55 +218,39 @@ label.visually-hide,
|
|
246
218
|
inline-size: 100%;
|
247
219
|
padding: 0 !important;
|
248
220
|
position: relative;
|
249
|
-
|
250
|
-
-ms-flex: 1 0 auto;
|
251
|
-
flex: 1 0 auto;
|
252
|
-
display: -webkit-box;
|
253
|
-
display: -ms-flexbox;
|
221
|
+
flex: 1 0 auto;
|
254
222
|
display: flex;
|
255
223
|
background: var(--input-bg-color);
|
256
224
|
border: var(--input-border-style);
|
257
225
|
border-width: var(--input-border-width);
|
258
226
|
font-size: var(--input-font-size);
|
259
|
-
-
|
260
|
-
padding-inline-start: calc(var(--input-border-hint-width) - var(--input-border-width)) !important;
|
227
|
+
padding-inline-start: calc(var(--input-border-hint-width) - var(--input-border-width)) !important;
|
261
228
|
}
|
262
229
|
:host(.has-focus) .form-ctrl__input {
|
263
230
|
background: var(--input-bg-color--focus);
|
264
231
|
border: var(--input-border-style--focus);
|
265
232
|
border-width: var(--input-border-width);
|
266
|
-
-
|
267
|
-
padding-inline-start: calc(var(--input-border-hint-width) - var(--input-border-width)) !important;
|
233
|
+
padding-inline-start: calc(var(--input-border-hint-width) - var(--input-border-width)) !important;
|
268
234
|
}
|
269
235
|
:host(.is-invalid) .form-ctrl__input {
|
270
236
|
background: var(--input-bg-color--invalid);
|
271
237
|
border: var(--input-border-style--invalid);
|
272
238
|
border-width: var(--input-border-width);
|
273
|
-
-
|
274
|
-
|
275
|
-
-webkit-padding-start: 0 !important;
|
276
|
-
padding-inline-start: 0 !important;
|
239
|
+
border-inline-start: var(--input-border-style--invalid-focus) var(--input-border-hint-width);
|
240
|
+
padding-inline-start: 0 !important;
|
277
241
|
}
|
278
242
|
:host(.is-invalid.has-focus) .form-ctrl__input {
|
279
243
|
background: var(--input-bg-color--invalid);
|
280
244
|
border: var(--input-border-style--invalid-focus);
|
281
245
|
border-width: var(--input-border-width);
|
282
|
-
-
|
283
|
-
|
284
|
-
-webkit-padding-start: 0 !important;
|
285
|
-
padding-inline-start: 0 !important;
|
246
|
+
border-inline-start: var(--input-border-style--invalid-focus) var(--input-border-hint-width);
|
247
|
+
padding-inline-start: 0 !important;
|
286
248
|
}
|
287
249
|
|
288
250
|
.form-ctrl__input-wrap {
|
289
|
-
display: -webkit-box;
|
290
|
-
display: -ms-flexbox;
|
291
251
|
display: flex;
|
292
|
-
-
|
293
|
-
|
294
|
-
align-items: stretch;
|
295
|
-
-webkit-box-flex: 1;
|
296
|
-
-ms-flex: 1;
|
297
|
-
flex: 1;
|
252
|
+
align-items: stretch;
|
253
|
+
flex: 1;
|
298
254
|
max-inline-size: 100%;
|
299
255
|
}
|
300
256
|
|
@@ -310,12 +266,8 @@ label.visually-hide,
|
|
310
266
|
outline: none;
|
311
267
|
background-color: transparent;
|
312
268
|
background-repeat: no-repeat;
|
313
|
-
display: -webkit-box;
|
314
|
-
display: -ms-flexbox;
|
315
269
|
display: flex;
|
316
|
-
-
|
317
|
-
-ms-flex-align: stretch;
|
318
|
-
align-items: stretch;
|
270
|
+
align-items: stretch;
|
319
271
|
inline-size: auto;
|
320
272
|
}
|
321
273
|
|
@@ -332,16 +284,10 @@ label.visually-hide,
|
|
332
284
|
.form-ctrl__slot-value-end * {
|
333
285
|
--nano-icon-size: 1.4em;
|
334
286
|
padding-inline: unset;
|
335
|
-
-
|
336
|
-
|
337
|
-
-webkit-padding-end: var(--padding-end);
|
338
|
-
padding-inline-end: var(--padding-end);
|
287
|
+
padding-inline-start: var(--padding-start);
|
288
|
+
padding-inline-end: var(--padding-end);
|
339
289
|
font-size: 1em;
|
340
|
-
-
|
341
|
-
-ms-flex-align: center;
|
342
|
-
align-items: center;
|
343
|
-
display: -webkit-box;
|
344
|
-
display: -ms-flexbox;
|
290
|
+
align-items: center;
|
345
291
|
display: flex;
|
346
292
|
block-size: 100%;
|
347
293
|
z-index: 1;
|
@@ -368,11 +314,8 @@ label.visually-hide,
|
|
368
314
|
opacity: 0;
|
369
315
|
inline-size: 0;
|
370
316
|
-webkit-appearance: none;
|
371
|
-
-moz-appearance: none;
|
372
317
|
appearance: none;
|
373
|
-
-
|
374
|
-
-ms-flex-align: center;
|
375
|
-
align-items: center;
|
318
|
+
align-items: center;
|
376
319
|
overflow: hidden;
|
377
320
|
}
|
378
321
|
:host(.is-invalid) .form-ctrl__clear-btn {
|
@@ -505,9 +448,7 @@ label.visually-hide,
|
|
505
448
|
text-overflow: ellipsis;
|
506
449
|
color: var(--input-text-color);
|
507
450
|
display: inline-block;
|
508
|
-
|
509
|
-
-ms-flex: 1;
|
510
|
-
flex: 1;
|
451
|
+
flex: 1;
|
511
452
|
inline-size: 100%;
|
512
453
|
max-inline-size: 100%;
|
513
454
|
max-block-size: 100%;
|
@@ -515,11 +456,9 @@ label.visually-hide,
|
|
515
456
|
outline: none;
|
516
457
|
background: transparent;
|
517
458
|
-webkit-appearance: none;
|
518
|
-
-moz-appearance: none;
|
519
459
|
appearance: none;
|
520
460
|
margin: 0;
|
521
|
-
|
522
|
-
box-sizing: border-box;
|
461
|
+
box-sizing: border-box;
|
523
462
|
resize: none;
|
524
463
|
overflow: hidden;
|
525
464
|
line-height: 2.5em;
|
@@ -527,44 +466,7 @@ label.visually-hide,
|
|
527
466
|
.has-float-label .input__native-ctrl {
|
528
467
|
line-height: 2.1em;
|
529
468
|
min-height: 2.1em;
|
530
|
-
-
|
531
|
-
padding-block-start: 1.4em;
|
532
|
-
}
|
533
|
-
.input__native-ctrl::-webkit-input-placeholder {
|
534
|
-
color: var(--placeholder-color);
|
535
|
-
font-family: inherit;
|
536
|
-
font-style: var(--placeholder-font-style);
|
537
|
-
font-weight: var(--placeholder-font-weight);
|
538
|
-
opacity: var(--placeholder-opacity);
|
539
|
-
line-height: inherit;
|
540
|
-
min-height: initial;
|
541
|
-
}
|
542
|
-
.input__native-ctrl::-moz-placeholder {
|
543
|
-
color: var(--placeholder-color);
|
544
|
-
font-family: inherit;
|
545
|
-
font-style: var(--placeholder-font-style);
|
546
|
-
font-weight: var(--placeholder-font-weight);
|
547
|
-
opacity: var(--placeholder-opacity);
|
548
|
-
line-height: inherit;
|
549
|
-
min-height: initial;
|
550
|
-
}
|
551
|
-
.input__native-ctrl:-ms-input-placeholder {
|
552
|
-
color: var(--placeholder-color);
|
553
|
-
font-family: inherit;
|
554
|
-
font-style: var(--placeholder-font-style);
|
555
|
-
font-weight: var(--placeholder-font-weight);
|
556
|
-
opacity: var(--placeholder-opacity);
|
557
|
-
line-height: inherit;
|
558
|
-
min-height: initial;
|
559
|
-
}
|
560
|
-
.input__native-ctrl::-ms-input-placeholder {
|
561
|
-
color: var(--placeholder-color);
|
562
|
-
font-family: inherit;
|
563
|
-
font-style: var(--placeholder-font-style);
|
564
|
-
font-weight: var(--placeholder-font-weight);
|
565
|
-
opacity: var(--placeholder-opacity);
|
566
|
-
line-height: inherit;
|
567
|
-
min-height: initial;
|
469
|
+
padding-block-start: 1.4em;
|
568
470
|
}
|
569
471
|
.input__native-ctrl::placeholder {
|
570
472
|
color: var(--placeholder-color);
|
@@ -587,8 +489,7 @@ label.visually-hide,
|
|
587
489
|
appearance: none;
|
588
490
|
}
|
589
491
|
.input__native-ctrl:invalid {
|
590
|
-
|
591
|
-
box-shadow: none;
|
492
|
+
box-shadow: none;
|
592
493
|
}
|
593
494
|
.input__native-ctrl::-ms-clear, .input__native-ctrl::-ms-reveal {
|
594
495
|
display: none;
|
@@ -602,28 +503,13 @@ label.visually-hide,
|
|
602
503
|
padding-block: var(--padding-top) 0.25em;
|
603
504
|
white-space: pre-wrap;
|
604
505
|
}
|
605
|
-
.form-ctrl__textarea .input__native-ctrl::-webkit-input-placeholder {
|
606
|
-
line-height: 1.5em;
|
607
|
-
}
|
608
|
-
.form-ctrl__textarea .input__native-ctrl::-moz-placeholder {
|
609
|
-
line-height: 1.5em;
|
610
|
-
}
|
611
|
-
.form-ctrl__textarea .input__native-ctrl:-ms-input-placeholder {
|
612
|
-
line-height: 1.5em;
|
613
|
-
}
|
614
|
-
.form-ctrl__textarea .input__native-ctrl::-ms-input-placeholder {
|
615
|
-
line-height: 1.5em;
|
616
|
-
}
|
617
506
|
.form-ctrl__textarea .input__native-ctrl::placeholder {
|
618
507
|
line-height: 1.5em;
|
619
508
|
}
|
620
509
|
.has-float-label .form-ctrl__textarea .input__native-ctrl {
|
621
|
-
-
|
622
|
-
padding-block-start: 1.75em;
|
510
|
+
padding-block-start: 1.75em;
|
623
511
|
}
|
624
512
|
:host([readonly]:not([readonly=false])) .input__native-ctrl {
|
625
513
|
-webkit-user-select: none;
|
626
|
-
-moz-user-select: none;
|
627
|
-
-ms-user-select: none;
|
628
514
|
user-select: none;
|
629
515
|
}
|
@@ -8,8 +8,8 @@ import { debounceEvent, debounce } from '../../utils/throttle';
|
|
8
8
|
import { FormControl, FormControlWrap } from '../form-control/form-control';
|
9
9
|
let inputIds = 0;
|
10
10
|
/**
|
11
|
-
* The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
|
12
|
-
|
11
|
+
* The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
12
|
+
*
|
13
13
|
It is meant for text type inputs only, such as "text", "password", "email", "number", "search", "tel", and "url". It supports all standard text input events including keyup, keydown, keypress, and more.
|
14
14
|
The default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)
|
15
15
|
* @slot start - suitable for inline action buttons or icons that may add extra contextual information
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EAET,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,EACD,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,iB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport { closestElement } from '../../utils/dom';\nimport { createColorClasses } from '../../utils/theme';\nimport { debounceEvent, debounce } from '../../utils/throttle';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\nimport type {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\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 helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\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.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * 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 * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) 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 * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\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 /**\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 new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\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.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n requestAnimationFrame(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EAET,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,EACD,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAS5E,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AAMH,MAAM,OAAO,KAAK;EAqBhB;IAnBQ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;IACrC,qBAAgB,GAAG,KAAK,CAAC;IACzB,QAAG,GAAY,KAAK,CAAC;IAErB,cAAS,GAAG,CAAC,CAAC;IACd,gBAAW,GAAG,KAAK,CAAC;IAyapB,aAAQ,GAAG,CAAC,EAAU,EAAE,EAAE;MAChC,IAAI,IAAI,CAAC,UAAU,KAAK,iBAAiB;QAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;MAErE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE;QACpC,IAAI,IAAI,CAAC,eAAe,EAAE;UAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport { closestElement } from '../../utils/dom';\nimport { createColorClasses } from '../../utils/theme';\nimport { debounceEvent, debounce } from '../../utils/throttle';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\nimport type {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).\n *\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\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 helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\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.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * 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 * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) 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 * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\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 /**\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 new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\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.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n requestAnimationFrame(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
|