@nanoporetech-digital/components 5.11.9 → 5.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.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/{component-store-149aeffe.js → component-store-7427cb36.js} +2 -2
- package/dist/cjs/component-store-7427cb36.js.map +1 -0
- package/dist/cjs/{drag-777bd8dd.js → drag-1cdd881b.js} +9 -9
- package/dist/cjs/drag-1cdd881b.js.map +1 -0
- package/dist/cjs/{fade-dcabf3c1.js → fade-738dbd13.js} +2 -2
- package/dist/cjs/{fade-dcabf3c1.js.map → fade-738dbd13.js.map} +1 -1
- package/dist/cjs/{form-control-cae1e493.js → form-control-9a2379b4.js} +3 -3
- package/dist/cjs/form-control-9a2379b4.js.map +1 -0
- package/dist/cjs/{fullscreen-d24940a1.js → fullscreen-a994dc5b.js} +2 -2
- package/dist/cjs/{fullscreen-d24940a1.js.map → fullscreen-a994dc5b.js.map} +1 -1
- package/dist/cjs/{index-72ee0363.js → index-ece1cb9e.js} +10 -2
- package/dist/cjs/index-ece1cb9e.js.map +1 -0
- package/dist/cjs/index.cjs.js +35 -9
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{lazyload-f6be7590.js → lazyload-d532de2a.js} +2 -2
- package/dist/cjs/{lazyload-f6be7590.js.map → lazyload-d532de2a.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{modal-b9b40f6d.js → modal-f9dce001.js} +2 -3
- package/dist/cjs/modal-f9dce001.js.map +1 -0
- package/dist/cjs/nano-accordion.cjs.entry.js +5 -2
- package/dist/cjs/nano-accordion.cjs.entry.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-filter.cjs.entry.js +3 -3
- package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-algolia.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +12 -14
- package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +2 -2
- 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 +16 -25
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +4 -4
- package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +8 -12
- package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +1 -1
- package/dist/cjs/nano-dialog.cjs.entry.js +2 -2
- 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 +6 -7
- package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-field-validator.cjs.entry.js +3 -6
- package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js +2 -2
- package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +101 -33
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +18 -24
- package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button_2.cjs.entry.js +2 -4
- package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js +7 -2
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +21 -7
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +2 -2
- package/dist/cjs/{nano-slides-2f3dcc02.js → nano-slides-d8032939.js} +23 -22
- package/dist/cjs/nano-slides-d8032939.js.map +1 -0
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +7 -9
- package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +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 +6 -8
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-43f4377f.js → nano-table-84da62a4.js} +53 -53
- package/dist/cjs/nano-table-84da62a4.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{page-dots-ae2cefb4.js → page-dots-d360366a.js} +2 -2
- package/dist/cjs/{page-dots-ae2cefb4.js.map → page-dots-d360366a.js.map} +1 -1
- package/dist/cjs/{table.worker-f258383d.js → table.worker-4aad752d.js} +1 -1
- package/dist/cjs/{table.worker-399650a3.js → table.worker-f386d031.js} +3 -3
- package/dist/cjs/table.worker-f386d031.js.map +1 -0
- package/dist/cjs/{theme-9cbe28c5.js → theme-50275e1a.js} +7 -2
- package/dist/cjs/theme-50275e1a.js.map +1 -0
- package/dist/cjs/{transitions-cc18619c.js → transitions-20fce787.js} +7 -2
- package/dist/cjs/transitions-20fce787.js.map +1 -0
- package/dist/collection/components/accordion/accordion.js +4 -1
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/alert/alert.helpers.js +24 -6
- package/dist/collection/components/alert/alert.helpers.js.map +1 -1
- package/dist/collection/components/alert/alert.js +1 -1
- package/dist/collection/components/alert/alert.js.map +1 -1
- package/dist/collection/components/algolia/algolia-filter.js +2 -2
- package/dist/collection/components/algolia/algolia-filter.js.map +1 -1
- package/dist/collection/components/algolia/algolia.js +1 -1
- package/dist/collection/components/algolia/algolia.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox-group.js +11 -13
- package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/datalist/datalist.js +14 -21
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/date-input/date-input.js +3 -3
- package/dist/collection/components/date-input/date-input.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/date-picker/date-picker.js.map +1 -1
- package/dist/collection/components/demo/demo.js +8 -12
- package/dist/collection/components/demo/demo.js.map +1 -1
- package/dist/collection/components/dialog/dialog.helpers.js +11 -3
- package/dist/collection/components/dialog/dialog.helpers.js.map +1 -1
- package/dist/collection/components/drawer/drawer.js +1 -1
- package/dist/collection/components/drawer/drawer.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.js +6 -7
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/field-validator/field-validator.js +3 -6
- package/dist/collection/components/field-validator/field-validator.js.map +1 -1
- package/dist/collection/components/file-upload/file-upload.js +2 -2
- package/dist/collection/components/file-upload/file-upload.js.map +1 -1
- package/dist/collection/components/form-control/form-control.js +2 -2
- package/dist/collection/components/form-control/form-control.js.map +1 -1
- package/dist/collection/components/global-nav/assets/ont-logo-inverse.svg +47 -0
- package/dist/collection/components/global-nav/global-nav-user-profile.js +1 -2
- package/dist/collection/components/global-nav/global-nav-user-profile.js.map +1 -1
- package/dist/collection/components/global-nav/global-nav.js +4 -8
- package/dist/collection/components/global-nav/global-nav.js.map +1 -1
- package/dist/collection/components/icon/icon.js +6 -1
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/input/input.js +19 -5
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/menu/menu.js +2 -4
- package/dist/collection/components/menu/menu.js.map +1 -1
- package/dist/collection/components/select/select.css +2 -1
- package/dist/collection/components/select/select.js +153 -31
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/slides/slides.js +19 -46
- package/dist/collection/components/slides/slides.js.map +1 -1
- package/dist/collection/components/sortable/sortable.js +6 -8
- package/dist/collection/components/sortable/sortable.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +8 -8
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.header.js +11 -4
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +12 -17
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +11 -11
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +2 -3
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.utils.js +7 -8
- package/dist/collection/components/table/table.utils.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +3 -3
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/components/tabs/tab-content.css +0 -1
- package/dist/collection/components/tabs/tab-group.js +3 -5
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -4
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/utils/drag.js +8 -8
- package/dist/collection/utils/drag.js.map +1 -1
- package/dist/collection/utils/fetch.js +12 -15
- package/dist/collection/utils/fetch.js.map +1 -1
- package/dist/collection/utils/gesture/index.js +9 -1
- package/dist/collection/utils/gesture/index.js.map +1 -1
- package/dist/collection/utils/modal.js +1 -2
- package/dist/collection/utils/modal.js.map +1 -1
- package/dist/collection/utils/store/get-set.js +1 -1
- package/dist/collection/utils/store/get-set.js.map +1 -1
- package/dist/collection/utils/testing/index.js +2 -2
- package/dist/collection/utils/testing/index.js.map +1 -1
- package/dist/collection/utils/theme.js +6 -1
- package/dist/collection/utils/theme.js.map +1 -1
- package/dist/collection/utils/transitions.js +6 -1
- package/dist/collection/utils/transitions.js.map +1 -1
- package/dist/components/algolia.js +1 -1
- package/dist/components/algolia.js.map +1 -1
- package/dist/components/component-store.js +1 -1
- package/dist/components/component-store.js.map +1 -1
- package/dist/components/datalist.js +14 -21
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/drag.js +8 -8
- package/dist/components/drag.js.map +1 -1
- package/dist/components/dropdown.js +6 -7
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/form-control.js +2 -2
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/global-nav-user-profile.js +1 -2
- package/dist/components/global-nav-user-profile.js.map +1 -1
- package/dist/components/icon.js +6 -1
- package/dist/components/icon.js.map +1 -1
- package/dist/components/index.js +35 -9
- package/dist/components/index.js.map +1 -1
- package/dist/components/index3.js +9 -1
- package/dist/components/index3.js.map +1 -1
- package/dist/components/input.js +19 -5
- package/dist/components/input.js.map +1 -1
- package/dist/components/menu.js +2 -4
- package/dist/components/menu.js.map +1 -1
- package/dist/components/modal.js +1 -2
- package/dist/components/modal.js.map +1 -1
- package/dist/components/nano-accordion.js +4 -1
- package/dist/components/nano-accordion.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-algolia-filter.js +2 -2
- package/dist/components/nano-algolia-filter.js.map +1 -1
- package/dist/components/nano-checkbox-group.js +11 -13
- 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 +3 -3
- package/dist/components/nano-date-input.js.map +1 -1
- package/dist/components/nano-demo.js +8 -12
- package/dist/components/nano-demo.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-field-validator.js +3 -6
- package/dist/components/nano-field-validator.js.map +1 -1
- package/dist/components/nano-file-upload.js +2 -2
- package/dist/components/nano-file-upload.js.map +1 -1
- package/dist/components/nano-global-nav.js +16 -22
- package/dist/components/nano-global-nav.js.map +1 -1
- package/dist/components/nano-slides.js +19 -19
- package/dist/components/nano-slides.js.map +1 -1
- package/dist/components/nano-sortable.js +6 -8
- package/dist/components/nano-sortable.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 +3 -5
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/select.js +100 -29
- package/dist/components/select.js.map +1 -1
- package/dist/components/table.js +51 -51
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/components/theme.js +6 -1
- package/dist/components/theme.js.map +1 -1
- package/dist/components/tooltip.js +2 -4
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/transitions.js +6 -1
- package/dist/components/transitions.js.map +1 -1
- package/dist/esm/{component-store-f7eb0a56.js → component-store-486d9d7a.js} +2 -2
- package/dist/esm/component-store-486d9d7a.js.map +1 -0
- package/dist/esm/{drag-1723a4cc.js → drag-d948d158.js} +9 -9
- package/dist/esm/drag-d948d158.js.map +1 -0
- package/dist/esm/{fade-1aa7a6db.js → fade-00c7c18e.js} +2 -2
- package/dist/esm/{fade-1aa7a6db.js.map → fade-00c7c18e.js.map} +1 -1
- package/dist/esm/{form-control-8c2750f9.js → form-control-0bfcc7ea.js} +3 -3
- package/dist/esm/form-control-0bfcc7ea.js.map +1 -0
- package/dist/esm/{fullscreen-86fa276a.js → fullscreen-09677a62.js} +2 -2
- package/dist/esm/{fullscreen-86fa276a.js.map → fullscreen-09677a62.js.map} +1 -1
- package/dist/esm/{index-f626f476.js → index-dc076ea6.js} +10 -2
- package/dist/esm/index-dc076ea6.js.map +1 -0
- package/dist/esm/index.js +35 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{lazyload-994232a6.js → lazyload-43fd583a.js} +2 -2
- package/dist/esm/{lazyload-994232a6.js.map → lazyload-43fd583a.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{modal-bd9638c0.js → modal-88c117cd.js} +2 -3
- package/dist/esm/modal-88c117cd.js.map +1 -0
- package/dist/esm/nano-accordion.entry.js +5 -2
- package/dist/esm/nano-accordion.entry.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-filter.entry.js +3 -3
- package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
- package/dist/esm/nano-algolia.entry.js +2 -2
- package/dist/esm/nano-algolia.entry.js.map +1 -1
- package/dist/esm/nano-checkbox-group.entry.js +12 -14
- package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
- package/dist/esm/nano-checkbox.entry.js +2 -2
- 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 +16 -25
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-date-input.entry.js +4 -4
- package/dist/esm/nano-date-input.entry.js.map +1 -1
- package/dist/esm/nano-date-picker.entry.js +2 -2
- package/dist/esm/nano-date-picker.entry.js.map +1 -1
- package/dist/esm/nano-demo.entry.js +8 -12
- package/dist/esm/nano-demo.entry.js.map +1 -1
- package/dist/esm/nano-details.entry.js +1 -1
- package/dist/esm/nano-dialog.entry.js +2 -2
- 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 +6 -7
- package/dist/esm/nano-dropdown.entry.js.map +1 -1
- package/dist/esm/nano-field-validator.entry.js +3 -6
- package/dist/esm/nano-field-validator.entry.js.map +1 -1
- package/dist/esm/nano-file-upload.entry.js +2 -2
- package/dist/esm/nano-file-upload.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +101 -33
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav.entry.js +18 -24
- package/dist/esm/nano-global-nav.entry.js.map +1 -1
- package/dist/esm/nano-icon-button_2.entry.js +2 -4
- package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js +7 -2
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +21 -7
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +2 -2
- package/dist/esm/{nano-slides-9908c44d.js → nano-slides-4dab533a.js} +24 -23
- package/dist/esm/nano-slides-4dab533a.js.map +1 -0
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-sortable.entry.js +7 -9
- package/dist/esm/nano-sortable.entry.js.map +1 -1
- package/dist/esm/nano-split-pane.entry.js +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 +6 -8
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/{nano-table-85d83eb2.js → nano-table-7c8eb23e.js} +53 -53
- package/dist/esm/nano-table-7c8eb23e.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{page-dots-467ace2e.js → page-dots-a055f884.js} +2 -2
- package/dist/esm/{page-dots-467ace2e.js.map → page-dots-a055f884.js.map} +1 -1
- package/dist/{nano-components/table.worker-f258383d.js → esm/table.worker-4aad752d.js} +1 -1
- package/dist/esm/{table.worker-c5463b23.js → table.worker-bdb6a68c.js} +3 -3
- package/dist/esm/table.worker-bdb6a68c.js.map +1 -0
- package/dist/esm/{theme-82feb8cf.js → theme-931bd452.js} +7 -2
- package/dist/esm/theme-931bd452.js.map +1 -0
- package/dist/esm/{transitions-fb09eb32.js → transitions-bd15e312.js} +7 -2
- package/dist/esm/transitions-bd15e312.js.map +1 -0
- package/dist/nano-assets/hash.txt +1 -1
- package/dist/nano-assets/ont-logo-inverse.svg +47 -0
- package/dist/nano-components/assets/ont-logo-inverse.svg +47 -0
- package/dist/nano-components/component-store-486d9d7a.js +5 -0
- package/dist/nano-components/component-store-486d9d7a.js.map +1 -0
- package/dist/nano-components/drag-d948d158.js +5 -0
- package/dist/nano-components/{drag-1723a4cc.js.map → drag-d948d158.js.map} +1 -1
- package/dist/nano-components/{fade-1aa7a6db.js → fade-00c7c18e.js} +2 -2
- package/dist/nano-components/form-control-0bfcc7ea.js +5 -0
- package/dist/nano-components/form-control-0bfcc7ea.js.map +1 -0
- package/dist/nano-components/{fullscreen-86fa276a.js → fullscreen-09677a62.js} +2 -2
- package/dist/nano-components/{index-f626f476.js → index-dc076ea6.js} +2 -2
- package/dist/nano-components/index-dc076ea6.js.map +1 -0
- package/dist/nano-components/index.esm.js +1 -1
- package/dist/nano-components/index.esm.js.map +1 -1
- package/dist/nano-components/{lazyload-994232a6.js → lazyload-43fd583a.js} +2 -2
- package/dist/nano-components/{modal-bd9638c0.js → modal-88c117cd.js} +2 -2
- package/dist/nano-components/modal-88c117cd.js.map +1 -0
- package/dist/nano-components/nano-accordion.entry.js +1 -1
- package/dist/nano-components/nano-accordion.entry.js.map +1 -1
- package/dist/nano-components/nano-alert.entry.js +1 -1
- package/dist/nano-components/nano-alert.entry.js.map +1 -1
- package/dist/nano-components/nano-algolia-filter.entry.js +1 -1
- package/dist/nano-components/nano-algolia-filter.entry.js.map +1 -1
- package/dist/nano-components/nano-algolia.entry.js +1 -1
- package/dist/nano-components/nano-algolia.entry.js.map +1 -1
- package/dist/nano-components/nano-checkbox-group.entry.js +1 -1
- package/dist/nano-components/nano-checkbox-group.entry.js.map +1 -1
- package/dist/nano-components/nano-checkbox.entry.js +1 -1
- package/dist/nano-components/nano-checkbox.entry.js.map +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/nano-components.esm.js.map +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js.map +1 -1
- package/dist/nano-components/nano-date-input.entry.js +1 -1
- package/dist/nano-components/nano-date-input.entry.js.map +1 -1
- package/dist/nano-components/nano-date-picker.entry.js +1 -1
- package/dist/nano-components/nano-date-picker.entry.js.map +1 -1
- package/dist/nano-components/nano-demo.entry.js +1 -1
- package/dist/nano-components/nano-demo.entry.js.map +1 -1
- package/dist/nano-components/nano-details.entry.js +1 -1
- package/dist/nano-components/nano-dialog.entry.js +1 -1
- package/dist/nano-components/nano-drawer.entry.js +1 -1
- package/dist/nano-components/nano-drawer.entry.js.map +1 -1
- package/dist/nano-components/nano-dropdown.entry.js +1 -1
- package/dist/nano-components/nano-dropdown.entry.js.map +1 -1
- package/dist/nano-components/nano-field-validator.entry.js +1 -1
- package/dist/nano-components/nano-field-validator.entry.js.map +1 -1
- package/dist/nano-components/nano-file-upload.entry.js +1 -1
- package/dist/nano-components/nano-file-upload.entry.js.map +1 -1
- package/dist/nano-components/nano-global-nav-user-profile_3.entry.js +1 -1
- package/dist/nano-components/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/dist/nano-components/nano-global-nav.entry.js.map +1 -1
- package/dist/nano-components/nano-icon-button_2.entry.js +1 -1
- package/dist/nano-components/nano-icon-button_2.entry.js.map +1 -1
- package/dist/nano-components/nano-icon.entry.js +1 -1
- package/dist/nano-components/nano-icon.entry.js.map +1 -1
- package/dist/nano-components/nano-input.entry.js +1 -1
- package/dist/nano-components/nano-input.entry.js.map +1 -1
- package/dist/nano-components/nano-range.entry.js +1 -1
- package/dist/nano-components/nano-slides-4dab533a.js +20 -0
- package/dist/nano-components/nano-slides-4dab533a.js.map +1 -0
- package/dist/nano-components/nano-slides.entry.js +1 -1
- package/dist/nano-components/nano-sortable.entry.js +1 -1
- package/dist/nano-components/nano-sortable.entry.js.map +1 -1
- package/dist/nano-components/nano-split-pane.entry.js +1 -1
- package/dist/nano-components/nano-tab-content.entry.js +1 -1
- package/dist/nano-components/nano-tab-content.entry.js.map +1 -1
- package/dist/nano-components/nano-tab-group.entry.js +1 -1
- package/dist/nano-components/nano-tab-group.entry.js.map +1 -1
- package/dist/nano-components/nano-table-7c8eb23e.js +5 -0
- package/dist/nano-components/nano-table-7c8eb23e.js.map +1 -0
- package/dist/nano-components/nano-table.entry.js +1 -1
- package/dist/nano-components/{page-dots-467ace2e.js → page-dots-a055f884.js} +2 -2
- package/dist/{esm/table.worker-f258383d.js → nano-components/table.worker-4aad752d.js} +1 -1
- package/dist/nano-components/{table.worker-c5463b23.js → table.worker-bdb6a68c.js} +2 -2
- package/dist/nano-components/theme-931bd452.js +5 -0
- package/dist/nano-components/{theme-82feb8cf.js.map → theme-931bd452.js.map} +1 -1
- package/dist/nano-components/transitions-bd15e312.js +5 -0
- package/dist/nano-components/transitions-bd15e312.js.map +1 -0
- package/dist/types/components/select/select.d.ts +18 -4
- package/dist/types/components/slides/slides.d.ts +0 -7
- package/dist/types/components.d.ts +22 -5
- package/docs-json.json +62 -22
- package/docs-vscode.json +5 -1
- package/hydrate/index.js +321 -243
- package/package.json +2 -2
- package/dist/cjs/component-store-149aeffe.js.map +0 -1
- package/dist/cjs/drag-777bd8dd.js.map +0 -1
- package/dist/cjs/form-control-cae1e493.js.map +0 -1
- package/dist/cjs/index-72ee0363.js.map +0 -1
- package/dist/cjs/modal-b9b40f6d.js.map +0 -1
- package/dist/cjs/nano-slides-2f3dcc02.js.map +0 -1
- package/dist/cjs/nano-table-43f4377f.js.map +0 -1
- package/dist/cjs/table.worker-399650a3.js.map +0 -1
- package/dist/cjs/theme-9cbe28c5.js.map +0 -1
- package/dist/cjs/transitions-cc18619c.js.map +0 -1
- package/dist/esm/component-store-f7eb0a56.js.map +0 -1
- package/dist/esm/drag-1723a4cc.js.map +0 -1
- package/dist/esm/form-control-8c2750f9.js.map +0 -1
- package/dist/esm/index-f626f476.js.map +0 -1
- package/dist/esm/modal-bd9638c0.js.map +0 -1
- package/dist/esm/nano-slides-9908c44d.js.map +0 -1
- package/dist/esm/nano-table-85d83eb2.js.map +0 -1
- package/dist/esm/table.worker-c5463b23.js.map +0 -1
- package/dist/esm/theme-82feb8cf.js.map +0 -1
- package/dist/esm/transitions-fb09eb32.js.map +0 -1
- package/dist/nano-components/component-store-f7eb0a56.js +0 -5
- package/dist/nano-components/component-store-f7eb0a56.js.map +0 -1
- package/dist/nano-components/drag-1723a4cc.js +0 -5
- package/dist/nano-components/form-control-8c2750f9.js +0 -5
- package/dist/nano-components/form-control-8c2750f9.js.map +0 -1
- package/dist/nano-components/index-f626f476.js.map +0 -1
- package/dist/nano-components/modal-bd9638c0.js.map +0 -1
- package/dist/nano-components/nano-slides-9908c44d.js +0 -20
- package/dist/nano-components/nano-slides-9908c44d.js.map +0 -1
- package/dist/nano-components/nano-table-85d83eb2.js +0 -5
- package/dist/nano-components/nano-table-85d83eb2.js.map +0 -1
- package/dist/nano-components/theme-82feb8cf.js +0 -5
- package/dist/nano-components/transitions-fb09eb32.js +0 -5
- package/dist/nano-components/transitions-fb09eb32.js.map +0 -1
- /package/dist/nano-components/{fade-1aa7a6db.js.map → fade-00c7c18e.js.map} +0 -0
- /package/dist/nano-components/{fullscreen-86fa276a.js.map → fullscreen-09677a62.js.map} +0 -0
- /package/dist/nano-components/{lazyload-994232a6.js.map → lazyload-43fd583a.js.map} +0 -0
- /package/dist/nano-components/{page-dots-467ace2e.js.map → page-dots-a055f884.js.map} +0 -0
- /package/dist/nano-components/{table.worker-c5463b23.js.map → table.worker-bdb6a68c.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["inputCss","inputIds","Input","nativeInputWrap","this","_nativeInputWrap","ele","setDataListOpts","constructor","hostRef","inputId","didBlurAfterEdit","rtl","charCount","hasRendered","validate","ev","validateOn","nativeInput","validity","valid","showInlineError","preventDefault","errorMessage","validationMessage","_invalid","nanoValidate","emit","isValid","originalEvent","onInput","input","target","value","nanoInput","onBlur","hasFocus","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","clearInput","readonly","disabled","stopPropagation","event","window","Event","dispatchEvent","debounce","handleBlur","bind","datalist","currDWConfig","dropDownConfig","Object","assign","skidding","tetherTo","invalid","validityMessage","shouldValidate","requestAnimationFrame","valueChanged","nanoChange","length","type","resize","style","height","scrollHeight","debounceChanged","debounceEvent","async","validateFirst","Promise","resolve","setTimeout","focus","click","select","getInputElement","message","setCustomValidity","onReset","e","form","document","querySelector","el","closest","kev","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","clearOnEdit","undefined","getValue","slotChangeObserver","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","hasLabelSlot","querySelectorAll","hasHelperSlot","hasHelperEndSlot","console","warn","connectedCallback","CustomEvent","detail","disconnectedCallback","componentDidLoad","autofocus","_","setFocus","componentWillLoad","render","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","floatLabel","label","hideLabel","placeholder","maxlength","showCharCount","wrapOptions","controlId","controlOptions","clearControl","h","Host","class","createColorClasses","color","width","FormControlWrap","FormControl","onClearText","control","ref","id","accept","autoCapitalize","autocapitalise","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","name","pattern","readOnly","required","spellcheck","step","size","onChange","onKeyDown","onInvalid","rows","input__resizable"],"sources":["./src/components/input/input.scss?tag=nano-input&encapsulation=scoped","./src/components/input/input.tsx"],"sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentcolor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus:\n #{$input-border-style} var(\n --nano-color-tint,\n #{nano-color(\n primary,\n tint\n )}\n );\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: 0;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n // min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-block-size: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-block-size: initial;\n }\n\n /* stylelint-disable-next-line selector-no-vendor-prefix */\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","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 <div style={{ width: '100%' }}>\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 </FormControlWrap>\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;0PAAA,MAAMA,EAAW,wxfC4BjB,IAAIC,EAAW,E,MAqBFC,EAAK,MAYJC,sBACV,OAAOC,KAAKC,gB,CAEFF,oB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AAU7K,KAAK6K,SACfC,WAAY9K,KAAK8K,WACjBjJ,MAAOA,EACPH,QAAS1B,KAAK0B,QACduJ,SAAUjL,KAAK0B,QACfS,QAASnC,KAAKmC,QACd+I,UAAWlL,KAAKqC,UAChB8I,UAAWnL,KAAKW,SAChBoB,OAAQ/B,KAAKkD,eAKrB4F,EAAA,c"}
|
1
|
+
{"version":3,"names":["inputCss","inputIds","Input","nativeInputWrap","this","_nativeInputWrap","ele","setDataListOpts","constructor","hostRef","inputId","didBlurAfterEdit","rtl","charCount","hasRendered","validate","ev","validateOn","nativeInput","validity","valid","showInlineError","preventDefault","errorMessage","validationMessage","_invalid","nanoValidate","emit","isValid","originalEvent","onInput","input","target","value","nanoInput","onBlur","hasFocus","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","clearInput","readonly","disabled","stopPropagation","event","window","Event","dispatchEvent","debounce","handleBlur","bind","datalist","currDWConfig","dropDownConfig","skidding","tetherTo","invalid","validityMessage","shouldValidate","requestAnimationFrame","valueChanged","nanoChange","length","type","resize","style","height","scrollHeight","debounceChanged","debounceEvent","async","validateFirst","Promise","resolve","setTimeout","focus","click","select","getInputElement","message","setCustomValidity","onReset","e","form","document","querySelector","el","closest","kev","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","clearOnEdit","undefined","getValue","slotChangeObserver","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","hasLabelSlot","querySelectorAll","hasHelperSlot","hasHelperEndSlot","console","warn","connectedCallback","CustomEvent","detail","disconnectedCallback","componentDidLoad","autofocus","_","setFocus","componentWillLoad","render","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","floatLabel","label","hideLabel","placeholder","maxlength","showCharCount","wrapOptions","controlId","controlOptions","clearControl","h","Host","class","createColorClasses","color","width","FormControlWrap","FormControl","onClearText","control","ref","id","accept","autoCapitalize","autocapitalise","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","name","pattern","readOnly","required","spellcheck","step","size","onChange","onKeyDown","onInvalid","rows","input__resizable"],"sources":["./src/components/input/input.scss?tag=nano-input&encapsulation=scoped","./src/components/input/input.tsx"],"sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentcolor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus:\n #{$input-border-style} var(\n --nano-color-tint,\n #{nano-color(\n primary,\n tint\n )}\n );\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: 0;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n // min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-block-size: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-block-size: initial;\n }\n\n /* stylelint-disable-next-line selector-no-vendor-prefix */\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","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 <div style={{ width: '100%' }}>\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 </FormControlWrap>\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;qPAAA,MAAMA,EAAW,wxfC4BjB,IAAIC,EAAW,E,MAqBFC,EAAK,MAYJC,sBACV,OAAOC,KAAKC,gB,CAEFF,oBAAgBG,GAC1B,GAAIF,KAAKC,mBAAqBC,EAAK,OACnCF,KAAKC,iBAAmBC,EACxBF,KAAKG,iB,CAGPC,YAAAC,G,+RAnBQL,KAAAM,QAAU,cAAcT,MACxBG,KAAAO,iBAAmB,MACnBP,KAAAQ,IAAe,MAEfR,KAAAS,UAAY,EACZT,KAAAU,YAAc,MAyadV,KAAAW,SAAYC,IAClB,GAAIZ,KAAKa,aAAe,kBAAmBb,KAAKa,WAAa,QAE7D,IAAKb,KAAKc,YAAYC,SAASC,MAAO,CACpC,GAAIhB,KAAKiB,gBAAiB,CACxB,GAAIL,EAAIA,EAAGM,iBACXlB,KAAKmB,aAAenB,KAAKc,YAAYM,iB,CAEvCpB,KAAKqB,SAAW,I,MACXrB,KAAKqB,SAAW,MAEvBrB,KAAKsB,aAAaC,KAAK,CACrBC,SAAUxB,KAAKqB,SACfF,aAAcnB,KAAKc,YAAYM,kBAC/BK,cAAeb,GACf,EAGIZ,KAAA0B,QAAWd,IACjB,MAAMe,EAAQf,EAAGgB,OACjB5B,KAAK6B,MAAQF,GAAOE,OAAS,GAC7B7B,KAAK8B,UAAUP,KAAKX,EAAG,EAGjBZ,KAAA+B,OAAS,KACf/B,KAAKgC,SAAW,MAChBhC,KAAKiC,eACL,GAAIjC,KAAKa,aAAe,QAASb,KAAKW,WACtCX,KAAKkC,SAASX,MAAM,EAGdvB,KAAAmC,QAAU,KAChBnC,KAAKgC,SAAW,KAChBhC,KAAKiC,eACLjC,KAAKoC,UAAUb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ACXgF,UAAWpK,KAAKqK,UAChBC,UAAWtK,KAAKsI,UAChBkC,KAAMxK,KAAKwK,KACXnC,YAAarI,KAAKqI,YAClBqC,SAAU1K,KAAK0C,SACfiI,SAAU3K,KAAK2K,SACfC,WAAY5K,KAAK4K,WACjB/I,MAAOA,EACPH,QAAS1B,KAAK0B,QACdqJ,SAAU/K,KAAK0B,QACfS,QAASnC,KAAKmC,QACd6I,UAAWhL,KAAKqC,UAChB4I,UAAWjL,KAAKW,SAChBoB,OAAQ/B,KAAKkD,eAKrB0F,EAAA,c"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as n,c as a,h as e,a as r,g as s}from"./index-9695db0a.js";import{c as t}from"./math-c02ddfda.js";import{c as i}from"./theme-82feb8cf.js";import{a as o}from"./throttle-ac4fcefa.js";const c=(n,a,e,r)=>{let s=n.querySelector("input.aux-input");if(!s){s=n.ownerDocument.createElement("input");s.type="hidden";s.classList.add("aux-input");n.appendChild(s)}s.disabled=r;s.name=a;s.value=e||""};const h='.sc-nano-range-h{box-sizing:border-box}*.sc-nano-range,*.sc-nano-range::before,*.sc-nano-range::after{box-sizing:border-box}[hidden].sc-nano-range{display:none !important}.sc-nano-range-h{--knob-handle-size:(var(--knob-size) * 2);--rgb-inactive:165 165 165;--knob-border-radius:50%;--knob-background:var(--nano-color-primary, #007495);--knob-box-shadow:0 2px 4px 0 rgb(0 0 0 / 30%);--knob-size:30px;--bar-height:8px;--bar-background:#e2e1e0;--bar-background-active:#a5a5a5;--bar-border-radius:4px;--height:42px;--pin-background:var(--nano-color-primary, #007495);--pin-color:var(--nano-color-primary-contrast, #fff);--focus-style:0 0 0 5px var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))}.range-wrap.sc-nano-range{display:flex;position:relative;flex:3;align-items:center;-webkit-user-select:none;user-select:none}.range-wrap.sc-nano-range-s>ion-icon[slot],.range-wrap .sc-nano-range-s>ion-icon[slot]{font-size:1.5em}.range-wrap.sc-nano-range-s>[slot=start],.range-wrap .sc-nano-range-s>[slot=start]{margin-inline:0 14px;margin-block:0;font-size:0.9em}.range-wrap.sc-nano-range-s>[slot=end],.range-wrap .sc-nano-range-s>[slot=end]{margin-inline:14px 0;margin-block:0;font-size:0.9em}.range-slider.sc-nano-range{position:relative;flex:1;inline-size:100%;block-size:var(--height);contain:size layout style;cursor:grab;touch-action:pan-y}.range-pressed.sc-nano-range-h .range-slider.sc-nano-range{cursor:grabbing}.range-bar.sc-nano-range{border-radius:var(--bar-border-radius);inset-block-start:calc((var(--height) - var(--bar-height)) / 2);inset-inline-start:0;position:absolute;inline-size:100%;block-size:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-snaps.sc-nano-range-h .range-bar.sc-nano-range{border-radius:var(--bar-border-radius) 0 0 var(--bar-border-radius)}.range-bar-active.sc-nano-range{inset-block-end:0;inline-size:auto;background:var(--bar-background-active)}.range-knob.sc-nano-range{border-radius:var(--knob-border-radius);inset-block-start:calc(50% - var(--knob-size) / 2);inset-inline-start:calc(50% - var(--knob-size) / 2);position:absolute;inline-size:var(--knob-size);block-size:var(--knob-size);background:var(--knob-background);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none;transform:scale(0.67);transition-duration:120ms;transition-property:transform, background-color, border;transition-timing-function:ease}.sc-nano-range-h:not(.range-has-pin) .range-knob-pressed.sc-nano-range .range-knob.sc-nano-range{transform:scale(1)}.range-knob-handle.sc-nano-range{inset-block-start:calc((var(--height) - var(--knob-handle-size)) / 2);inset-inline-start:0;margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;inline-size:calc(var(--knob-handle-size));block-size:calc(var(--knob-handle-size));text-align:center}.range-knob-handle.sc-nano-range:active,.range-knob-handle.sc-nano-range:focus{outline:none}.range-knob-handle.sc-nano-range:active .range-knob.sc-nano-range,.range-knob-handle.sc-nano-range:focus .range-knob.sc-nano-range{box-shadow:var(--knob-box-shadow), var(--focus-style)}.range-tick.sc-nano-range{position:absolute;inset-block-start:calc((var(--height) - var(--bar-height)) / 2);inline-size:var(--bar-height);block-size:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick.sc-nano-range:first-of-type{border-radius:var(--bar-border-radius) 0 0 var(--bar-border-radius)}.range-tick.sc-nano-range:last-of-type{border-radius:0 var(--bar-border-radius) var(--bar-border-radius) 0}.range-tick-active.sc-nano-range{background:transparent}.range-pin.sc-nano-range{transform:translate3d(0, 0, 0) scale(0.01);transform-origin:center top;padding:0.66em 0;border-radius:50%;text-align:center;box-sizing:border-box;display:inline-block;position:relative;min-inline-size:2.33em;block-size:2.33em;transition:transform 120ms ease, background 120ms ease;background:var(--pin-background);color:var(--pin-color);font-size:0.75em}.range-pin.sc-nano-range::before{inset-block-start:0.25em;inset-inline-start:50%;margin-inline-start:-1.08em;border-radius:50% 50% 50% 0;position:absolute;inline-size:2.16em;block-size:2.16em;transform:rotate(-45deg);transition:background 120ms ease;background:var(--pin-background);content:"";z-index:-1}.range-knob-pressed.sc-nano-range .range-pin.sc-nano-range{transform:translate3d(0, -50%, 0) scale(1);transform:translate3d(0, calc((100% - var(--bar-height)) * -1), 0) scale(1)}.range-disabled.sc-nano-range-h{pointer-events:none}.range-disabled.sc-nano-range-h .range-bar-active.sc-nano-range,.range-disabled.sc-nano-range-h .range-bar.sc-nano-range,.range-disabled.sc-nano-range-h .range-tick.sc-nano-range{background-color:rgb(var(--rgb-inactive)/50%)}.range-disabled.sc-nano-range-h .range-knob.sc-nano-range{transform:scale(0.55);outline:5px solid #fff;background-color:rgb(var(--rgb-inactive)/50%)}.nano-color.sc-nano-range-h .range-bar-active.sc-nano-range,.nano-color.sc-nano-range-h .range-knob.sc-nano-range,.nano-color.sc-nano-range-h .range-pin.sc-nano-range,.nano-color.sc-nano-range-h .range-pin.sc-nano-range::before,.nano-color.sc-nano-range-h .range-tick.sc-nano-range{background:var(--nano-color-base);color:var(--nano-color-contrast)}.nano-color.sc-nano-range-h .range-bar.sc-nano-range{background:rgb(var(--nano-color-base-rgb)/0.26)}.nano-color.sc-nano-range-h .range-knob-handle.sc-nano-range:active .range-knob.sc-nano-range,.nano-color.sc-nano-range-h .range-knob-handle.sc-nano-range:focus .range-knob.sc-nano-range{box-shadow:var(--knob-box-shadow), 0 0 0 5px rgb(var(--nano-color-tint-rgb)/0.56)}';const g=class{constructor(e){n(this,e);this.nanoChange=a(this,"nanoChange",7);this.nanoStyle=a(this,"nanoStyle",7);this.nanoFocus=a(this,"nanoFocus",7);this.nanoBlur=a(this,"nanoBlur",7);this.noUpdate=false;this.hasFocus=false;this.clampBounds=n=>t(this.min,n,this.max);this.ensureValueInBounds=n=>{if(this.dualKnobs){return{lower:this.clampBounds(n.lower),upper:this.clampBounds(n.upper)}}else{return this.clampBounds(n)}};this.handleKeyboard=(n,a)=>{let e=this.step;e=e>0?e:1;e=e/(this.max-this.min);if(!a){e*=-1}if(n==="A"){this.ratioA=t(0,this.ratioA+e,1)}else{this.ratioB=t(0,this.ratioB+e,1)}this.updateValue()};this.onBlur=()=>{if(this.hasFocus){this.hasFocus=false;this.nanoBlur.emit();this.emitStyle()}};this.onFocus=()=>{if(!this.hasFocus){this.hasFocus=true;this.nanoFocus.emit();this.emitStyle()}};this.ratioA=0;this.ratioB=0;this.pressedKnob=undefined;this.color=undefined;this.debounce=0;this.name="";this.dualKnobs=false;this.min=0;this.max=100;this.pin=false;this.snaps=false;this.step=1;this.ticks=false;this.disabled=false;this.value=0}debounceChanged(){this.nanoChange=o(this.nanoChange,this.debounce)}minChanged(){if(!this.noUpdate){this.updateRatio()}}maxChanged(){if(!this.noUpdate){this.updateRatio()}}disabledChanged(){if(this.gesture){this.gesture.enable(!this.disabled)}this.emitStyle()}valueChanged(n){if(!this.noUpdate){this.updateRatio()}n=this.ensureValueInBounds(n);this.nanoChange.emit({value:n})}connectedCallback(){this.updateRatio();this.debounceChanged();this.disabledChanged()}disconnectedCallback(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}}async componentDidLoad(){const n=this.rangeSlider;if(n){this.gesture=(await import("./index-f626f476.js")).createGesture({el:n,gestureName:"range",gesturePriority:100,threshold:0,onStart:n=>this.onStart(n),onMove:n=>this.onMove(n),onEnd:n=>this.onEnd(n)});this.gesture.enable(!this.disabled)}}getValue(){const n=this.value||0;if(this.dualKnobs){if(typeof n==="object"){return n}return{lower:0,upper:n}}else{if(typeof n==="object"){return n.upper}return n}}emitStyle(){this.nanoStyle.emit({interactive:true,"interactive-disabled":this.disabled})}onStart(n){const a=this.rect=this.rangeSlider.getBoundingClientRect();const e=n.currentX;let r=t(0,(e-a.left)/a.width,1);if(document.dir==="rtl"){r=1-r}this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-r)<Math.abs(this.ratioB-r)?"A":"B";this.setFocus(this.pressedKnob);this.update(e)}onMove(n){this.update(n.currentX)}onEnd(n){this.update(n.currentX);this.pressedKnob=undefined}update(n){const a=this.rect;let e=t(0,(n-a.left)/a.width,1);if(document.dir==="rtl"){e=1-e}if(this.snaps){e=d(b(e,this.min,this.max,this.step),this.min,this.max)}if(this.pressedKnob==="A"){this.ratioA=e}else{this.ratioB=e}this.updateValue()}get valA(){return b(this.ratioA,this.min,this.max,this.step)}get valB(){return b(this.ratioB,this.min,this.max,this.step)}get ratioLower(){if(this.dualKnobs){return Math.min(this.ratioA,this.ratioB)}return 0}get ratioUpper(){if(this.dualKnobs){return Math.max(this.ratioA,this.ratioB)}return this.ratioA}updateRatio(){const n=this.getValue();const{min:a,max:e}=this;if(this.dualKnobs){this.ratioA=d(n.lower,a,e);this.ratioB=d(n.upper,a,e)}else{this.ratioA=d(n,a,e)}}updateValue(){this.noUpdate=true;const{valA:n,valB:a}=this;this.value=!this.dualKnobs?n:{lower:Math.min(n,a),upper:Math.max(n,a)};this.noUpdate=false}setFocus(n){if(this.el.shadowRoot){const a=this.el.shadowRoot.querySelector(n==="A"?".range-knob-a":".range-knob-b");if(a){a.focus()}}}render(){const{min:n,max:a,step:s,el:t,handleKeyboard:o,pressedKnob:h,disabled:g,pin:b,ratioLower:u,ratioUpper:p}=this;const k=`${u*100}%`;const f=`${100-p*100}%`;const v=document;const m=v.dir==="rtl";const x=m?"right":"left";const z=m?"left":"right";const w=n=>({[x]:n[x]});const y={[x]:k,[z]:f};const A=[];if(this.snaps&&this.ticks){for(let e=n;e<=a;e+=s){const r=d(e,n,a);const s={ratio:r,active:r>=u&&r<=p};s[x]=`${r*100}%`;A.push(s)}}c(t,this.name,JSON.stringify(this.getValue()),g);return e(r,{onFocusin:this.onFocus,onFocusout:this.onBlur,class:i(this.color,{"range-disabled":g,"range-pressed":h!==undefined,"range-has-pin":b,"range-snaps":this.snaps})},e("div",{class:"range-wrap"},e("slot",{name:"start"}),e("div",{class:"range-slider",ref:n=>this.rangeSlider=n},A.map((n=>e("span",{style:w(n),role:"presentation",class:{"range-tick":true,"range-tick-active":n.active},part:n.active?"tick-active":"tick"}))),e("div",{class:"range-bar",role:"presentation",part:"bar"}),e("div",{class:"range-bar range-bar-active",role:"presentation",style:y,part:"bar-active"}),l(m,{knob:"A",pressed:h==="A",value:this.valA,ratio:this.ratioA,pin:b,disabled:g,handleKeyboard:o,min:n,max:a}),this.dualKnobs&&l(m,{knob:"B",pressed:h==="B",value:this.valB,ratio:this.ratioB,pin:b,disabled:g,handleKeyboard:o,min:n,max:a})),e("slot",{name:"end"})))}get el(){return s(this)}static get watchers(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],disabled:["disabledChanged"],value:["valueChanged"]}}};const l=(n,{knob:a,value:r,ratio:s,min:t,max:i,disabled:o,pressed:c,pin:h,handleKeyboard:g})=>{const l=n?"right":"left";const b=()=>{const n={};n[l]=`${s*100}%`;return n};return e("div",{onKeyDown:n=>{const e=n.key;if(e==="ArrowLeft"||e==="ArrowDown"){g(a,false);n.preventDefault();n.stopPropagation()}else if(e==="ArrowRight"||e==="ArrowUp"){g(a,true);n.preventDefault();n.stopPropagation()}},class:{"range-knob-handle":true,"range-knob-a":a==="A","range-knob-b":a==="B","range-knob-pressed":c,"range-knob-min":r===t,"range-knob-max":r===i},style:b(),role:"slider",tabindex:o?-1:0,"aria-valuemin":t,"aria-valuemax":i,"aria-disabled":o?"true":null,"aria-valuenow":r},h&&e("div",{class:"range-pin",role:"presentation",part:"pin"},Math.round(r)),e("div",{class:"range-knob",role:"presentation",part:"knob"}))};const b=(n,a,e,r)=>{let s=(e-a)*n;if(r>0){s=Math.round(s/r)*r+a}return t(a,s,e)};const d=(n,a,e)=>t(0,(n-a)/(e-a),1);g.style=h;export{g as nano_range};
|
4
|
+
import{r as n,c as a,h as e,a as r,g as s}from"./index-9695db0a.js";import{c as t}from"./math-c02ddfda.js";import{c as i}from"./theme-931bd452.js";import{a as o}from"./throttle-ac4fcefa.js";const c=(n,a,e,r)=>{let s=n.querySelector("input.aux-input");if(!s){s=n.ownerDocument.createElement("input");s.type="hidden";s.classList.add("aux-input");n.appendChild(s)}s.disabled=r;s.name=a;s.value=e||""};const h='.sc-nano-range-h{box-sizing:border-box}*.sc-nano-range,*.sc-nano-range::before,*.sc-nano-range::after{box-sizing:border-box}[hidden].sc-nano-range{display:none !important}.sc-nano-range-h{--knob-handle-size:(var(--knob-size) * 2);--rgb-inactive:165 165 165;--knob-border-radius:50%;--knob-background:var(--nano-color-primary, #007495);--knob-box-shadow:0 2px 4px 0 rgb(0 0 0 / 30%);--knob-size:30px;--bar-height:8px;--bar-background:#e2e1e0;--bar-background-active:#a5a5a5;--bar-border-radius:4px;--height:42px;--pin-background:var(--nano-color-primary, #007495);--pin-color:var(--nano-color-primary-contrast, #fff);--focus-style:0 0 0 5px var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))}.range-wrap.sc-nano-range{display:flex;position:relative;flex:3;align-items:center;-webkit-user-select:none;user-select:none}.range-wrap.sc-nano-range-s>ion-icon[slot],.range-wrap .sc-nano-range-s>ion-icon[slot]{font-size:1.5em}.range-wrap.sc-nano-range-s>[slot=start],.range-wrap .sc-nano-range-s>[slot=start]{margin-inline:0 14px;margin-block:0;font-size:0.9em}.range-wrap.sc-nano-range-s>[slot=end],.range-wrap .sc-nano-range-s>[slot=end]{margin-inline:14px 0;margin-block:0;font-size:0.9em}.range-slider.sc-nano-range{position:relative;flex:1;inline-size:100%;block-size:var(--height);contain:size layout style;cursor:grab;touch-action:pan-y}.range-pressed.sc-nano-range-h .range-slider.sc-nano-range{cursor:grabbing}.range-bar.sc-nano-range{border-radius:var(--bar-border-radius);inset-block-start:calc((var(--height) - var(--bar-height)) / 2);inset-inline-start:0;position:absolute;inline-size:100%;block-size:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-snaps.sc-nano-range-h .range-bar.sc-nano-range{border-radius:var(--bar-border-radius) 0 0 var(--bar-border-radius)}.range-bar-active.sc-nano-range{inset-block-end:0;inline-size:auto;background:var(--bar-background-active)}.range-knob.sc-nano-range{border-radius:var(--knob-border-radius);inset-block-start:calc(50% - var(--knob-size) / 2);inset-inline-start:calc(50% - var(--knob-size) / 2);position:absolute;inline-size:var(--knob-size);block-size:var(--knob-size);background:var(--knob-background);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none;transform:scale(0.67);transition-duration:120ms;transition-property:transform, background-color, border;transition-timing-function:ease}.sc-nano-range-h:not(.range-has-pin) .range-knob-pressed.sc-nano-range .range-knob.sc-nano-range{transform:scale(1)}.range-knob-handle.sc-nano-range{inset-block-start:calc((var(--height) - var(--knob-handle-size)) / 2);inset-inline-start:0;margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;inline-size:calc(var(--knob-handle-size));block-size:calc(var(--knob-handle-size));text-align:center}.range-knob-handle.sc-nano-range:active,.range-knob-handle.sc-nano-range:focus{outline:none}.range-knob-handle.sc-nano-range:active .range-knob.sc-nano-range,.range-knob-handle.sc-nano-range:focus .range-knob.sc-nano-range{box-shadow:var(--knob-box-shadow), var(--focus-style)}.range-tick.sc-nano-range{position:absolute;inset-block-start:calc((var(--height) - var(--bar-height)) / 2);inline-size:var(--bar-height);block-size:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick.sc-nano-range:first-of-type{border-radius:var(--bar-border-radius) 0 0 var(--bar-border-radius)}.range-tick.sc-nano-range:last-of-type{border-radius:0 var(--bar-border-radius) var(--bar-border-radius) 0}.range-tick-active.sc-nano-range{background:transparent}.range-pin.sc-nano-range{transform:translate3d(0, 0, 0) scale(0.01);transform-origin:center top;padding:0.66em 0;border-radius:50%;text-align:center;box-sizing:border-box;display:inline-block;position:relative;min-inline-size:2.33em;block-size:2.33em;transition:transform 120ms ease, background 120ms ease;background:var(--pin-background);color:var(--pin-color);font-size:0.75em}.range-pin.sc-nano-range::before{inset-block-start:0.25em;inset-inline-start:50%;margin-inline-start:-1.08em;border-radius:50% 50% 50% 0;position:absolute;inline-size:2.16em;block-size:2.16em;transform:rotate(-45deg);transition:background 120ms ease;background:var(--pin-background);content:"";z-index:-1}.range-knob-pressed.sc-nano-range .range-pin.sc-nano-range{transform:translate3d(0, -50%, 0) scale(1);transform:translate3d(0, calc((100% - var(--bar-height)) * -1), 0) scale(1)}.range-disabled.sc-nano-range-h{pointer-events:none}.range-disabled.sc-nano-range-h .range-bar-active.sc-nano-range,.range-disabled.sc-nano-range-h .range-bar.sc-nano-range,.range-disabled.sc-nano-range-h .range-tick.sc-nano-range{background-color:rgb(var(--rgb-inactive)/50%)}.range-disabled.sc-nano-range-h .range-knob.sc-nano-range{transform:scale(0.55);outline:5px solid #fff;background-color:rgb(var(--rgb-inactive)/50%)}.nano-color.sc-nano-range-h .range-bar-active.sc-nano-range,.nano-color.sc-nano-range-h .range-knob.sc-nano-range,.nano-color.sc-nano-range-h .range-pin.sc-nano-range,.nano-color.sc-nano-range-h .range-pin.sc-nano-range::before,.nano-color.sc-nano-range-h .range-tick.sc-nano-range{background:var(--nano-color-base);color:var(--nano-color-contrast)}.nano-color.sc-nano-range-h .range-bar.sc-nano-range{background:rgb(var(--nano-color-base-rgb)/0.26)}.nano-color.sc-nano-range-h .range-knob-handle.sc-nano-range:active .range-knob.sc-nano-range,.nano-color.sc-nano-range-h .range-knob-handle.sc-nano-range:focus .range-knob.sc-nano-range{box-shadow:var(--knob-box-shadow), 0 0 0 5px rgb(var(--nano-color-tint-rgb)/0.56)}';const g=class{constructor(e){n(this,e);this.nanoChange=a(this,"nanoChange",7);this.nanoStyle=a(this,"nanoStyle",7);this.nanoFocus=a(this,"nanoFocus",7);this.nanoBlur=a(this,"nanoBlur",7);this.noUpdate=false;this.hasFocus=false;this.clampBounds=n=>t(this.min,n,this.max);this.ensureValueInBounds=n=>{if(this.dualKnobs){return{lower:this.clampBounds(n.lower),upper:this.clampBounds(n.upper)}}else{return this.clampBounds(n)}};this.handleKeyboard=(n,a)=>{let e=this.step;e=e>0?e:1;e=e/(this.max-this.min);if(!a){e*=-1}if(n==="A"){this.ratioA=t(0,this.ratioA+e,1)}else{this.ratioB=t(0,this.ratioB+e,1)}this.updateValue()};this.onBlur=()=>{if(this.hasFocus){this.hasFocus=false;this.nanoBlur.emit();this.emitStyle()}};this.onFocus=()=>{if(!this.hasFocus){this.hasFocus=true;this.nanoFocus.emit();this.emitStyle()}};this.ratioA=0;this.ratioB=0;this.pressedKnob=undefined;this.color=undefined;this.debounce=0;this.name="";this.dualKnobs=false;this.min=0;this.max=100;this.pin=false;this.snaps=false;this.step=1;this.ticks=false;this.disabled=false;this.value=0}debounceChanged(){this.nanoChange=o(this.nanoChange,this.debounce)}minChanged(){if(!this.noUpdate){this.updateRatio()}}maxChanged(){if(!this.noUpdate){this.updateRatio()}}disabledChanged(){if(this.gesture){this.gesture.enable(!this.disabled)}this.emitStyle()}valueChanged(n){if(!this.noUpdate){this.updateRatio()}n=this.ensureValueInBounds(n);this.nanoChange.emit({value:n})}connectedCallback(){this.updateRatio();this.debounceChanged();this.disabledChanged()}disconnectedCallback(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}}async componentDidLoad(){const n=this.rangeSlider;if(n){this.gesture=(await import("./index-dc076ea6.js")).createGesture({el:n,gestureName:"range",gesturePriority:100,threshold:0,onStart:n=>this.onStart(n),onMove:n=>this.onMove(n),onEnd:n=>this.onEnd(n)});this.gesture.enable(!this.disabled)}}getValue(){const n=this.value||0;if(this.dualKnobs){if(typeof n==="object"){return n}return{lower:0,upper:n}}else{if(typeof n==="object"){return n.upper}return n}}emitStyle(){this.nanoStyle.emit({interactive:true,"interactive-disabled":this.disabled})}onStart(n){const a=this.rect=this.rangeSlider.getBoundingClientRect();const e=n.currentX;let r=t(0,(e-a.left)/a.width,1);if(document.dir==="rtl"){r=1-r}this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-r)<Math.abs(this.ratioB-r)?"A":"B";this.setFocus(this.pressedKnob);this.update(e)}onMove(n){this.update(n.currentX)}onEnd(n){this.update(n.currentX);this.pressedKnob=undefined}update(n){const a=this.rect;let e=t(0,(n-a.left)/a.width,1);if(document.dir==="rtl"){e=1-e}if(this.snaps){e=d(b(e,this.min,this.max,this.step),this.min,this.max)}if(this.pressedKnob==="A"){this.ratioA=e}else{this.ratioB=e}this.updateValue()}get valA(){return b(this.ratioA,this.min,this.max,this.step)}get valB(){return b(this.ratioB,this.min,this.max,this.step)}get ratioLower(){if(this.dualKnobs){return Math.min(this.ratioA,this.ratioB)}return 0}get ratioUpper(){if(this.dualKnobs){return Math.max(this.ratioA,this.ratioB)}return this.ratioA}updateRatio(){const n=this.getValue();const{min:a,max:e}=this;if(this.dualKnobs){this.ratioA=d(n.lower,a,e);this.ratioB=d(n.upper,a,e)}else{this.ratioA=d(n,a,e)}}updateValue(){this.noUpdate=true;const{valA:n,valB:a}=this;this.value=!this.dualKnobs?n:{lower:Math.min(n,a),upper:Math.max(n,a)};this.noUpdate=false}setFocus(n){if(this.el.shadowRoot){const a=this.el.shadowRoot.querySelector(n==="A"?".range-knob-a":".range-knob-b");if(a){a.focus()}}}render(){const{min:n,max:a,step:s,el:t,handleKeyboard:o,pressedKnob:h,disabled:g,pin:b,ratioLower:u,ratioUpper:p}=this;const k=`${u*100}%`;const v=`${100-p*100}%`;const f=document;const m=f.dir==="rtl";const x=m?"right":"left";const z=m?"left":"right";const w=n=>({[x]:n[x]});const y={[x]:k,[z]:v};const A=[];if(this.snaps&&this.ticks){for(let e=n;e<=a;e+=s){const r=d(e,n,a);const s={ratio:r,active:r>=u&&r<=p};s[x]=`${r*100}%`;A.push(s)}}c(t,this.name,JSON.stringify(this.getValue()),g);return e(r,{onFocusin:this.onFocus,onFocusout:this.onBlur,class:i(this.color,{"range-disabled":g,"range-pressed":h!==undefined,"range-has-pin":b,"range-snaps":this.snaps})},e("div",{class:"range-wrap"},e("slot",{name:"start"}),e("div",{class:"range-slider",ref:n=>this.rangeSlider=n},A.map((n=>e("span",{style:w(n),role:"presentation",class:{"range-tick":true,"range-tick-active":n.active},part:n.active?"tick-active":"tick"}))),e("div",{class:"range-bar",role:"presentation",part:"bar"}),e("div",{class:"range-bar range-bar-active",role:"presentation",style:y,part:"bar-active"}),l(m,{knob:"A",pressed:h==="A",value:this.valA,ratio:this.ratioA,pin:b,disabled:g,handleKeyboard:o,min:n,max:a}),this.dualKnobs&&l(m,{knob:"B",pressed:h==="B",value:this.valB,ratio:this.ratioB,pin:b,disabled:g,handleKeyboard:o,min:n,max:a})),e("slot",{name:"end"})))}get el(){return s(this)}static get watchers(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],disabled:["disabledChanged"],value:["valueChanged"]}}};const l=(n,{knob:a,value:r,ratio:s,min:t,max:i,disabled:o,pressed:c,pin:h,handleKeyboard:g})=>{const l=n?"right":"left";const b=()=>{const n={};n[l]=`${s*100}%`;return n};return e("div",{onKeyDown:n=>{const e=n.key;if(e==="ArrowLeft"||e==="ArrowDown"){g(a,false);n.preventDefault();n.stopPropagation()}else if(e==="ArrowRight"||e==="ArrowUp"){g(a,true);n.preventDefault();n.stopPropagation()}},class:{"range-knob-handle":true,"range-knob-a":a==="A","range-knob-b":a==="B","range-knob-pressed":c,"range-knob-min":r===t,"range-knob-max":r===i},style:b(),role:"slider",tabindex:o?-1:0,"aria-valuemin":t,"aria-valuemax":i,"aria-disabled":o?"true":null,"aria-valuenow":r},h&&e("div",{class:"range-pin",role:"presentation",part:"pin"},Math.round(r)),e("div",{class:"range-knob",role:"presentation",part:"knob"}))};const b=(n,a,e,r)=>{let s=(e-a)*n;if(r>0){s=Math.round(s/r)*r+a}return t(a,s,e)};const d=(n,a,e)=>t(0,(n-a)/(e-a),1);g.style=h;export{g as nano_range};
|
5
5
|
//# sourceMappingURL=nano-range.entry.js.map
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*!
|
2
|
+
* Web Components for Nanopore digital Web Apps
|
3
|
+
*/
|
4
|
+
import{r as t,c as i,d as s,w as n,h as e,a as o,g as h}from"./index-9695db0a.js";function c(){}const r=c.prototype;r.on=function(t,i){if(!t||!i){return}const s=this._events=this._events||{};const n=s[t]=s[t]||[];if(n.indexOf(i)==-1){n.push(i)}return this};r.once=function(t,i){if(!t||!i){return}this.on(t,i);const s=this._onceEvents=this._onceEvents||{};const n=s[t]=s[t]||{};n[i]=true;return this};r.off=function(t,i){const s=this._events&&this._events[t];if(!s||!s.length){return}const n=s.indexOf(i);if(n!=-1){s.splice(n,1)}return this};r.emitEvent=function(t,i){let s=this._events&&this._events[t];if(!s||!s.length){return}s=s.slice(0);i=i||[];const n=this._onceEvents&&this._onceEvents[t];for(let e=0;e<s.length;e++){const o=s[e];const h=n&&n[o];if(h){this.off(t,o);delete n[o]}o.apply(this,i)}return this};r.allOff=function(){delete this._events;delete this._onceEvents};
|
5
|
+
/*!
|
6
|
+
* getSize v2.0.3
|
7
|
+
* measure size of elements
|
8
|
+
* MIT license
|
9
|
+
*/function u(t){const i=parseFloat(t);const s=t.indexOf("%")==-1&&!isNaN(i);return s&&i}function f(){}const a=typeof console=="undefined"?f:function(t){console.error(t)};const l=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];const d=l.length;function p(){const t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(let i=0;i<d;i++){const s=l[i];t[s]=0}return t}function y(t){const i=getComputedStyle(t);if(!i){a("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return i}let b=false;let g;function w(){if(b){return}b=true;const t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";const i=document.body||document.documentElement;i.appendChild(t);const s=y(t);g=Math.round(u(s.width))==200;k.isBoxSizeOuter=g;i.removeChild(t)}function k(t){w();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}const i=y(t);if(i.display=="none"){return p()}const s={};s.width=t.offsetWidth;s.height=t.offsetHeight;const n=s.isBorderBox=i.boxSizing=="border-box";for(let t=0;t<d;t++){const n=l[t];const e=i[n];const o=parseFloat(e);s[n]=!isNaN(o)?o:0}const e=s.paddingLeft+s.paddingRight;const o=s.paddingTop+s.paddingBottom;const h=s.marginLeft+s.marginRight;const c=s.marginTop+s.marginBottom;const r=s.borderLeftWidth+s.borderRightWidth;const f=s.borderTopWidth+s.borderBottomWidth;const a=n&&g;const b=u(i.width);if(b!==false){s.width=b+(a?0:e+r)}const k=u(i.height);if(k!==false){s.height=k+(a?0:o+f)}s.innerWidth=s.width-(e+r);s.innerHeight=s.height-(o+f);s.outerWidth=s.width+h;s.outerHeight=s.height+c;return s}const m={};m.extend=function(t,i){for(const s in i){t[s]=i[s]}return t};m.docReady=function(t){const i=document.readyState;if(i=="complete"||i=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};m.toDashed=function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,s){return i+"-"+s})).toLowerCase()};m.modulo=function(t,i){return(t%i+i)%i};const v=Array.prototype.slice;m.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}const i=typeof t=="object"&&typeof t.length=="number";if(i){return v.call(t)}return[t]};m.getParent=function(t,i){while(t.parentNode&&t!=document.body){t=t.parentElement;if(t.matches(i)){return t}}};m.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};m.handleEvent=function(t){const i="on"+t.type;if(this[i]){this[i](t)}};m.filterFindElements=function(t,i){t=m.makeArray(t);const s=[];t.forEach((function(t){if(!(t instanceof HTMLElement)){return}if(!i){s.push(t);return}if(t.matches(i)){s.push(t)}const n=t.querySelectorAll(i);for(let t=0;t<n.length;t++){s.push(n[t])}}));return s};m.debounceMethod=function(t,i,s){s=s||100;const n=t.prototype[i];const e=i+"Timeout";t.prototype[i]=function(...t){const i=this[e];clearTimeout(i);const o=this;this[e]=setTimeout((function(){n.apply(o,t);delete o[e]}),s)}};const x=window.console;m.htmlInit=function(t,i){m.docReady((function(){const s=m.toDashed(i);const n="data-"+s;const e=document.querySelectorAll("["+n+"]");const o=document.querySelectorAll(".js-"+s);const h=m.makeArray(e).concat(m.makeArray(o));const c=n+"-options";h.forEach((function(i){const s=i.getAttribute(n)||i.getAttribute(c);let e;try{e=s&&JSON.parse(s)}catch(t){if(x){x.error("Error parsing "+n+" on "+i.className+": "+t)}return}new t(i,e)}))}))};function z(t,i){this.element=t;this.parent=i;this.create()}const S=z.prototype;S.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))};S.destroy=function(){this.unselect();this.element.style.position="";const t=this.parent.originSide;this.element.style[t]=""};S.getSize=function(){this.size=k(this.element)};S.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};S.updateTarget=S.setDefaultTarget=function(){const t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};S.renderPosition=function(t){const i=this.parent.originSide;this.element.style[i]=this.parent.getPositionValue(t)};S.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden");Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.removeAttribute("tabindex")}))};S.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true");Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))};S.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};S.remove=function(){this.element.parentNode.removeChild(this.element)};function C(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}const M=C.prototype;M.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;const i=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[i]}};M.updateTarget=function(){const t=this.isOriginLeft?"marginRight":"marginLeft";const i=this.getLastCell();const s=i?i.size[t]:0;const n=this.outerWidth-(this.firstMargin+s);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};M.getLastCell=function(){return this.cells[this.cells.length-1]};M.select=function(){this.cells.forEach((function(t){t.select()}))};M.unselect=function(){this.cells.forEach((function(t){t.unselect()}))};M.getCellElements=function(){return this.cells.map((function(t){return t.element}))};const T={};T.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};T.animate=function(){this.applyDragForce();this.applySelectedAttraction();const t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){const t=this;requestAnimationFrame((function i(){t.animate()}))}};T.positionSlider=function(){let t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=m.modulo(t,this.slideableWidth);t=t-this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};T.setTranslateX=function(t,i){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;const s=this.getPositionValue(t);this.slider.style.transform="translate3d("+s+",0,0)"};T.dispatchScrollEvent=function(){const t=this.slides[0];if(!t){return}const i=-this.x-t.target;const s=i/this.slidesWidth;this.dispatchEvent("scroll",null,[s,i])};T.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};T.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};T.settle=function(t){if(!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100)){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};T.shiftWrapCells=function(t){const i=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,i,-1);const s=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,s,1)};T._shiftCells=function(t,i,s){for(let n=0;n<t.length;n++){const e=t[n];const o=i>0?s:0;e.wrapShift(o);i-=e.size.outerWidth}};T._unshiftCells=function(t){if(!t||!t.length){return}for(let i=0;i<t.length;i++){t[i].wrapShift(0)}};T.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};T.applyForce=function(t){this.velocity+=t};T.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};T.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};T.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}const t=this.dragX-this.x;const i=t-this.velocity;this.applyForce(i)};T.applySelectedAttraction=function(){const t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}const i=this.selectedSlide.target*-1-this.x;const s=i*this.options.selectedAttraction;this.applyForce(s)};const L=window.getComputedStyle;const P=window.console;function E(t,i){t=m.makeArray(t);while(t.length){i.appendChild(t.shift())}}let A=0;const R={};function D(t,i){const s=m.getQueryElement(t);if(!s){if(P){P.error("Bad element for Flickity: "+(s||t))}return}this.element=s;if(this.element.flickityGUID){const t=R[this.element.flickityGUID];if(!R[this.element.flickityGUID])return;t.option(i);return t}this.options=m.extend({},this.constructor.defaults);this.option(i);this._create()}D.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};D.createMethods=[];const j=D.prototype;m.extend(j,c.prototype);j._create=function(){const t=this.guid=++A;this.element.flickityGUID=t;R[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this.viewport.part.add("slide-viewport");this._createSlider();if(this.options.resize||this.options.watchCSS){window.addEventListener("resize",this)}for(const t in this.options.on){const i=this.options.on[t];this.on(t,i)}D.createMethods.forEach((function(t){this[t]()}),this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};j.option=function(t){m.extend(this.options,t)};j.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();const t=this.element.children;E(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};j._createSlider=function(){const t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};j._filterFindCellElements=function(t){return m.filterFindElements(t,this.options.cellSelector)};j.reloadCells=function(){this.cells=this._makeCells(this.slider.getRootNode().host?this.slider.getRootNode().host.children:this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};j._makeCells=function(t){const i=this._filterFindCellElements(t);const s=i.map((function(t){return new z(t,this)}),this);return s};j.getLastCell=function(){return this.cells[this.cells.length-1]};j.getLastSlide=function(){return this.slides[this.slides.length-1]};j.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};j._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;let i=0;if(t>0){const s=this.cells[t-1];i=s.x+s.size.outerWidth}const s=this.cells.length;for(let n=t;n<s;n++){const t=this.cells[n];t.setPosition(i);i+=t.size.outerWidth;this.maxCellHeight=Math.max(t.size.outerHeight,this.maxCellHeight)}this.slideableWidth=i;this.updateSlides();this._containSlides();this.slidesWidth=s?this.getLastSlide().target-this.slides[0].target:0};j._sizeCells=function(t){t.forEach((function(t){t.getSize()}))};j.updateSlides=function(){this.slides=[];if(!this.cells.length){return}let t=new C(this);this.slides.push(t);const i=this.originSide=="left";const s=i?"marginRight":"marginLeft";const n=this._getCanCellFit();this.cells.forEach((function(i,e){if(!t.cells.length){t.addCell(i);return}const o=t.outerWidth-t.firstMargin+(i.size.outerWidth-i.size[s]);if(n.call(this,e,o)){t.addCell(i)}else{t.updateTarget();t=new C(this);this.slides.push(t);t.addCell(i)}}),this);t.updateTarget();this.updateSelectedSlide()};j._getCanCellFit=function(){const t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){const i=parseInt(t,10);return function(t){return t%i!==0}}const i=typeof t=="string"&&t.match(/^(\d+)%$/);const s=i?parseInt(i[1],10)/100:1;return function(t,i){return i<=(this.size.innerWidth+1)*s}};j._init=j.reposition=function(){this.positionCells();this.positionSliderAtSelected()};j.getSize=function(){this.size=k(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};const N={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};j.setCellAlign=function(){const t=N[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};j.setGallerySize=function(){if(this.options.setGallerySize){const t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};j._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);let t=this.cursorPosition;const i=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,i,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};j._getGapCells=function(t,i,s){const n=[];while(t>0){const e=this.cells[i];if(!e){break}n.push(e);i+=s;t-=e.size.outerWidth}return n};j._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}const t=this.options.rightToLeft;const i=t?"marginRight":"marginLeft";const s=t?"marginLeft":"marginRight";const n=this.slideableWidth-this.getLastCell().size[s];const e=n<this.size.innerWidth;const o=this.cursorPosition+this.cells[0].size[i];const h=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(t){if(e){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,o);t.target=Math.min(t.target,h)}}),this)};j.dispatchEvent=function(t,i,s){const n=i?[i].concat(s):s;this.emitEvent(t,n)};j.select=function(t,i,s){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||i){t=m.modulo(t,this.slides.length)}if(!this.slides[t]){return}const n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(s){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};j._wrapSelect=function(t){const i=this.slides.length;const s=this.options.wrapAround&&i>1;if(!s){return t}const n=m.modulo(t,i);const e=Math.abs(n-this.selectedIndex);const o=Math.abs(n+i-this.selectedIndex);const h=Math.abs(n-i-this.selectedIndex);if(!this.isDragSelect&&o<e){t+=i}else if(!this.isDragSelect&&h<e){t-=i}if(t<0){this.x-=this.slideableWidth}else if(t>=i){this.x+=this.slideableWidth}};j.previous=function(t,i){this.select(this.selectedIndex-1,t,i)};j.next=function(t,i){this.select(this.selectedIndex+1,t,i)};j.updateSelectedSlide=function(){const t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};j.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};j.selectInitialIndex=function(){const t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){const i=this.queryCell(t);if(i){this.selectCell(t,false,true);return}}let i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};j.selectCell=function(t,i,s){const n=this.queryCell(t);if(!n){return}const e=this.getCellSlideIndex(n);this.select(e,i,s)};j.getCellSlideIndex=function(t){for(let i=0;i<this.slides.length;i++){const s=this.slides[i];const n=s.cells.indexOf(t);if(n!=-1){return i}}};j.getCell=function(t){for(let i=0;i<this.cells.length;i++){const s=this.cells[i];if(s.element==t){return s}}};j.getCells=function(t){t=m.makeArray(t);const i=[];t.forEach((function(t){const s=this.getCell(t);if(s){i.push(s)}}),this);return i};j.getCellElements=function(){return this.cells.map((function(t){return t.element}))};j.getParentCell=function(t){const i=this.getCell(t);if(i){return i}t=m.getParent(t,".flickity-slider > *");return this.getCell(t)};j.getAdjacentCellElements=function(t,i){if(!t){return this.selectedSlide.getCellElements()}i=i===undefined?this.selectedIndex:i;const s=this.slides.length;if(1+t*2>=s){return this.getCellElements()}let n=[];for(let e=i-t;e<=i+t;e++){const t=this.options.wrapAround?m.modulo(e,s):e;const i=this.slides[t];if(i){n=n.concat(i.getCellElements())}}return n};j.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#\.]?[\d\/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};j.uiChange=function(){this.emitEvent("uiChange")};j.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};j.onresize=function(){this.watchCSS();this.resize()};m.debounceMethod(D,"onresize",150);j.resize=function(){if(!this.isActive){return}this.getSize();if(this.options.wrapAround){this.x=m.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");const t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};j.watchCSS=function(){const t=this.options.watchCSS;if(!t){return}const i=L(this.element,":after").content;if(i.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};j.onkeydown=function(t){const i=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||i){return}const s=D.keyboardHandlers[t.keyCode];if(s){s.call(this)}};D.keyboardHandlers={37:function(){const t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){const t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};j.focus=function(){const t=window.pageYOffset;this.element.focus({preventScroll:true});if(window.pageYOffset!=t){window.scrollTo(window.pageXOffset,t)}};j.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach((function(t){t.destroy()}));this.element.removeChild(this.viewport);E(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};j.destroy=function(){this.deactivate();window.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");delete this.element.flickityGUID;delete R[this.guid]};m.extend(j,T);D.data=function(t){t=m.getQueryElement(t);const i=t&&t.flickityGUID;return i&&R[i]};m.htmlInit(D,"flickity");D.Cell=z;D.Slide=C;
|
10
|
+
/*!
|
11
|
+
* Unipointer v2.4.0
|
12
|
+
* base class for doing one thing with pointer event
|
13
|
+
* MIT license
|
14
|
+
*/function O(){}function B(){}const I=B.prototype=Object.create(c.prototype);I.bindStartEvent=function(t){this._bindStartEvent(t,true)};I.unbindStartEvent=function(t){this._bindStartEvent(t,false)};I._bindStartEvent=function(t,i){i=i===undefined?true:i;const s=i?"addEventListener":"removeEventListener";let n="mousedown";if("ontouchstart"in window){n="touchstart"}else if(window.PointerEvent){n="pointerdown"}t[s](n,this)};I.handleEvent=function(t){const i="on"+t.type;if(this[i]){this[i](t)}};I.getTouch=function(t){for(let i=0;i<t.length;i++){const s=t[i];if(s.identifier==this.pointerIdentifier){return s}}};I.onmousedown=function(t){const i=t.button;if(i&&i!==0&&i!==1){return}this._pointerDown(t,t)};I.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};I.onpointerdown=function(t){this._pointerDown(t,t)};I._pointerDown=function(t,i){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=i.pointerId!==undefined?i.pointerId:i.identifier;this.pointerDown(t,i)};I.pointerDown=function(t,i){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,i])};const F={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};I._bindPostStartEvents=function(t){if(!t){return}const i=F[t.type];i.forEach((function(t){window.addEventListener(t,this)}),this);this._boundPointerEvents=i};I._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach((function(t){window.removeEventListener(t,this)}),this);delete this._boundPointerEvents};I.onmousemove=function(t){this._pointerMove(t,t)};I.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};I.ontouchmove=function(t){const i=this.getTouch(t.changedTouches);if(i){this._pointerMove(t,i)}};I._pointerMove=function(t,i){this.pointerMove(t,i)};I.pointerMove=function(t,i){this.emitEvent("pointerMove",[t,i])};I.onmouseup=function(t){this._pointerUp(t,t)};I.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};I.ontouchend=function(t){const i=this.getTouch(t.changedTouches);if(i){this._pointerUp(t,i)}};I._pointerUp=function(t,i){this._pointerDone();this.pointerUp(t,i)};I.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i])};I._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};I._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};I.pointerDone=O;I.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};I.ontouchcancel=function(t){const i=this.getTouch(t.changedTouches);if(i){this._pointerCancel(t,i)}};I._pointerCancel=function(t,i){this._pointerDone();this.pointerCancel(t,i)};I.pointerCancel=function(t,i){this.emitEvent("pointerCancel",[t,i])};B.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};
|
15
|
+
/*!
|
16
|
+
* Unidragger v2.4.0
|
17
|
+
* Draggable base class
|
18
|
+
* MIT license
|
19
|
+
*/function W(){}const U=W.prototype=Object.create(B.prototype);U.bindHandles=function(){this._bindHandles(true)};U.unbindHandles=function(){this._bindHandles(false)};U._bindHandles=function(t){t=t===undefined?true:t;const i=t?"addEventListener":"removeEventListener";const s=t?this._touchActionValue:"";for(let n=0;n<this.handles.length;n++){const e=this.handles[n];this._bindStartEvent(e,t);e[i]("click",this);if(window.PointerEvent){e.style.touchAction=s}}};U._touchActionValue="none";U.pointerDown=function(t,i){const s=this.okayPointerDown(t);if(!s){return}this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,i])};const H={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};const X={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};U.okayPointerDown=function(t){const i=H[t.target.nodeName];const s=X[t.target.type];const n=!i||s;if(!n){this._pointerReset()}return n};U.pointerDownBlur=function(){const t=document.activeElement;const i=t&&t.blur&&t!=document.body;if(i){t.blur()}};U.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.emitEvent("pointerMove",[t,i,s]);this._dragMove(t,i,s)};U._dragPointerMove=function(t,i){const s={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(s)){this._dragStart(t,i)}return s};U.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};U.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]);this._dragPointerUp(t,i)};U._dragPointerUp=function(t,i){if(this.isDragging){this._dragEnd(t,i)}else{this._staticClick(t,i)}};U._dragStart=function(t,i){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,i)};U.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])};U._dragMove=function(t,i,s){if(!this.isDragging){return}this.dragMove(t,i,s)};U.dragMove=function(t,i,s){t.preventDefault();this.emitEvent("dragMove",[t,i,s])};U._dragEnd=function(t,i){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,i)};U.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])};U.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};U._staticClick=function(t,i){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,i);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};U.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])};W.getPointerPoint=B.getPointerPoint;m.extend(D.defaults,{draggable:">1",dragThreshold:3});D.createMethods.push("_createDrag");const _=D.prototype;m.extend(_,W.prototype);_._touchActionValue="pan-y";const Y="createTouch"in document;let J=false;_._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable);if(Y&&!J){window.addEventListener("touchmove",(function(){}));J=true}};_.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};_.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};_.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};_.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};_.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};_._uiChangeDrag=function(){delete this.isFreeScrolling};_.pointerDown=function(t,i){if(!this.isDraggable){this._pointerDownDefault(t,i);return}const s=this.okayPointerDown(t);if(!s){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=q();window.addEventListener("scroll",this);this._pointerDownDefault(t,i)};_._pointerDownDefault=function(t,i){this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[i])};const Z={INPUT:true,TEXTAREA:true,SELECT:true};_.pointerDownFocus=function(t){const i=Z[t.target.nodeName];if(!i){this.focus()}};_._pointerDownPreventDefault=function(t){const i=t.type=="touchstart";const s=t.pointerType=="touch";const n=Z[t.target.nodeName];if(!i&&!s&&!n){t.preventDefault()}};_.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};_.pointerUp=function(t,i){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[i]);this._dragPointerUp(t,i)};_.pointerDone=function(){window.removeEventListener("scroll",this);delete this.pointerDownScroll};_.dragStart=function(t,i){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();window.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[i])};_.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,s]);this._dragMove(t,i,s)};_.dragMove=function(t,i,s){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;const n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){s.x=s.x%this.slideableWidth}let e=this.dragStartPosition+s.x*n;if(!this.options.wrapAround&&this.slides.length){const t=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>t?(e+t)*.5:e;const i=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<i?(e+i)*.5:e}this.dragX=e;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[i,s])};_.dragEnd=function(t,i){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}let s=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){const t=this.getRestingPosition();this.isFreeScrolling=-t>this.slides[0].target&&-t<this.getLastSlide().target}else if(!this.options.freeScroll&&s==this.selectedIndex){s+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(s);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[i])};_.dragEndRestingSelect=function(){const t=this.getRestingPosition();const i=Math.abs(this.getSlideDistance(-t,this.selectedIndex));const s=this._getClosestResting(t,i,1);const n=this._getClosestResting(t,i,-1);const e=s.distance<n.distance?s.index:n.index;return e};_._getClosestResting=function(t,i,s){let n=this.selectedIndex;let e=Infinity;const o=this.options.contain&&!this.options.wrapAround?function(t,i){return t<=i}:function(t,i){return t<i};while(o(i,e)){n+=s;e=i;i=this.getSlideDistance(-t,n);if(i===null){break}i=Math.abs(i)}return{distance:e,index:n-s}};_.getSlideDistance=function(t,i){const s=this.slides.length;const n=this.options.wrapAround&&s>1;const e=n?m.modulo(i,s):i;const o=this.slides[e];if(!o){return null}const h=n?this.slideableWidth*Math.floor(i/s):0;return t-(o.target+h)};_.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}const t=this.getSlideDistance(-this.dragX,this.selectedIndex);const i=this.previousDragX-this.dragX;if(t>0&&i>0){return 1}else if(t<0&&i<0){return-1}return 0};_.staticClick=function(t,i){const s=this.getParentCell(t.target);const n=s&&s.element;const e=s&&this.cells.indexOf(s);this.dispatchEvent("staticClick",t,[i,n,e])};_.onscroll=function(){const t=q();const i=this.pointerDownScroll.x-t.x;const s=this.pointerDownScroll.y-t.y;if(Math.abs(i)>3||Math.abs(s)>3){this._pointerDone()}};function q(){return{x:window.pageXOffset,y:window.pageYOffset}}const G="http://www.w3.org/2000/svg";function Q(t,i){this.direction=t;this.parent=i;this.parentElement=this.parent.element.shadowRoot||this.parent.element;this._create()}Q.prototype=Object.create(B.prototype);Q.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;const t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;const i=this.element=document.createElement("button");i.className="flickity-button flickity-prev-next-button";i.part.add("navigation-button");if(this.isPrevious){i.classList.add("previous");i.part.add("navigation-button--previous")}else{i.classList.add("next");i.part.add("navigation-button--next")}i.setAttribute("type","button");this.disable();i.setAttribute("aria-label",this.isPrevious?"Previous":"Next");const s=document.createElement("slot");s.name=this.isPrevious?"previous-icon":"next-icon";i.appendChild(s);s.addEventListener("slotchange",(()=>{s.assignedElements({flatten:true}).forEach((t=>{t.removeAttribute("hidden")}))}));const n=this.createSVG();s.appendChild(n);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};Q.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parentElement.appendChild(this.element)};Q.prototype.deactivate=function(){this.parentElement.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};Q.prototype.createSVG=function(){const t=document.createElementNS(G,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");t.part.add("navigation-icon");const i=document.createElementNS(G,"path");const s=$(this.parent.options.arrowShape);i.setAttribute("d",s);i.setAttribute("class","arrow");if(!this.isLeft){i.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(i);return t};function $(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}Q.prototype.handleEvent=m.handleEvent;Q.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();const t=this.isPrevious?"previous":"next";this.parent[t]()};Q.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};Q.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};Q.prototype.update=function(){const t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}const i=t.length?t.length-1:0;const s=this.isPrevious?0:i;const n=this.parent.selectedIndex==s?"disable":"enable";this[n]()};Q.prototype.destroy=function(){this.deactivate();this.allOff()};m.extend(D.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});D.createMethods.push("_createPrevNextButtons");const K=D.prototype;K._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new Q(-1,this);this.nextButton=new Q(1,this);this.on("activate",this.activatePrevNextButtons)};K.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};K.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};D.PrevNextButton=Q;function V(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}V.prototype=Object.create(c.prototype);V.prototype.play=function(){if(this.state=="playing"){return}const t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};V.prototype.tick=function(){if(this.state!="playing"){return}let t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;const i=this;this.clear();this.timeout=setTimeout((function(){i.parent.next(true);i.tick()}),t)};V.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};V.prototype.clear=function(){clearTimeout(this.timeout)};V.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};V.prototype.unpause=function(){if(this.state=="paused"){this.play()}};V.prototype.visibilityChange=function(){const t=document.hidden;this[t?"pause":"unpause"]()};V.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};m.extend(D.defaults,{pauseAutoPlayOnHover:true});D.createMethods.push("_createPlayer");const tt=D.prototype;tt._createPlayer=function(){this.player=new V(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};tt.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};tt.playPlayer=function(){this.player.play()};tt.stopPlayer=function(){this.player.stop()};tt.pausePlayer=function(){this.player.pause()};tt.unpausePlayer=function(){this.player.unpause()};tt.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};tt.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};tt.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};D.Player=V;const it=D;const st=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-inline-size:100vw}:host([ready]){opacity:1}.slideshow{max-block-size:100%;min-block-size:inherit;block-size:inherit;position:relative}.slideshow.not-ready{inline-size:100%;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;block-size:-moz-fit-content;block-size:fit-content}.not-ready .flickity-container{inline-size:-moz-fit-content;inline-size:fit-content;block-size:-moz-fit-content;block-size:fit-content}.flickity-container.slides-ready{min-block-size:inherit;max-block-size:inherit;block-size:inherit;inline-size:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:none;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.flickity-button-icon{fill:var(--navbtns-icon-color)}.flickity-button:disabled .flickity-button-icon{fill:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;inline-size:44px;block-size:44px;border-radius:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;inset-block-end:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;inline-size:10px;block-size:10px;margin-block:0;margin-inline:8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}.flickity-page-dots .dot.is-selected{opacity:1;background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:rgba(0, 0, 0, 0.9);padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}";const nt=(t,i)=>(t%i+i)%i;const et=class{constructor(s){t(this,s);this.nanoSlidesDidLoad=i(this,"nanoSlidesDidLoad",7);this.nanoSlidesReady=i(this,"nanoSlidesReady",7);this.nanoSlidesSelect=i(this,"nanoSlidesSelect",7);this.nanoSlidesChange=i(this,"nanoSlidesChange",7);this.nanoSlidesScroll=i(this,"nanoSlidesScroll",7);this.nanoSlidesTransitionEnd=i(this,"nanoSlidesTransitionEnd",7);this.nanoSlidesDragStart=i(this,"nanoSlidesDragStart",7);this.nanoSlidesDragMove=i(this,"nanoSlidesDragMove",7);this.nanoSlidesDragEnd=i(this,"nanoSlidesDragEnd",7);this.nanoSlidesTap=i(this,"nanoSlidesTap",7);this.nanoSlidesFullscreenChange=i(this,"nanoSlidesFullscreenChange",7);this.flickityReady=false;this.flickity=new Promise((t=>{this.readyflickity=t}));this.hasFullScreenModule=false;this.hasLazyLoadModule=false;this.hasDotsModule=false;this.hasFadeModule=false;this.parallax=async()=>{const t=await this.flickity;const i=t.cells;i.forEach((i=>{const s=i.element.children[0];let n=t.x;if(t.options.wrapAround&&t.cells.length>1){n=nt(n,t.slideableWidth);n=n-t.slideableWidth}let e=(i.target+n)*-1/3;if(i.shift<0){e=(i.target-t.slideableWidth+n)*-1/3}else if(i.shift>0){e=(i.target+(n+t.slideableWidth))*-1/3}s.style.transform="translate3d("+e+"px, 0, 0)";const o=e*3/i.size.width*100;i.element.style.setProperty("--animation-amount",o.toString())}))};this.handleFullscreen=t=>{this.fullscreen=t;this.nanoSlidesFullscreenChange.emit(t)};this.handleSlideSelect=t=>{this.iCurrentSlide=t;this.nanoSlidesSelect.emit(t)};this.iCurrentSlide=undefined;this.slidesReady=undefined;this.didInit=false;this.options={};this.navbtns=false;this.pager=false;this.fullscreenbtn=false;this.fullscreen=false;this.animation="scroll";this.currentSlide=0;this.autoplay=false;this.ready=false}async optionsChanged(){if(this.flickityReady){const t=await this.getflickity();const i=Object.assign(t.options,this.options);await this.loadFlickityModules(i);await this.update()}}async navbtnsChanged(){Array.from(this._getRoot().querySelectorAll(".flickity-prev-next-button")).forEach((t=>{t.hidden=!this.navbtns}))}async pagerChanged(){const t=this._getRoot().querySelector(".flickity-page-dots");if(t)t.hidden=!this.pager}async fullscreenBtnChanged(){const t=this._getRoot().querySelector(".flickity-fullscreen-button");if(t)t.hidden=!this.fullscreenbtn}async fullscreenChanged(t,i){const s=await this.getflickity();if(this.fullscreen)s.viewFullscreen();else if(typeof i!=="undefined")s.exitFullscreen()}async animationChange(t,i){const[s,n]=await Promise.all([this.getflickity(),ot(this.host)]);n.forEach((t=>{t.style["left"]=undefined}));if(i==="parallax"){s.off("scroll",this.parallax);n.forEach(((t,i)=>{if(this.childrenEles&&this.childrenEles[i])this.childrenEles[i].style["transform"]=undefined}));this.update()}if(typeof i==="function"){s.off("scroll",i)}if(typeof this.animation==="function"){this.options={fade:false,percentPosition:true};s.on("scroll",this.animation);return}switch(this.animation){case"fade":this.options={fade:true,percentPosition:true};break;case"parallax":this.options={fade:false,percentPosition:true};s.on("scroll",this.parallax);break;default:this.options={fade:false,percentPosition:true};break}}currentSlideChange(){if(this.currentSlide!==this.iCurrentSlide)this.slideTo(this.currentSlide)}internalSlideChange(){this.currentSlide=this.iCurrentSlide}async autoPlayChange(){await this.stopAutoplay();if(this.autoplay){if(typeof this.autoplay==="string")this.autoplay=parseInt(this.autoplay);if(this.autoplay>0)this.startAutoplay(this.autoplay)}}async update(){const[t]=await Promise.all([this.getflickity(),ot(this.host)]);this.childrenEles=this.host.querySelectorAll("nano-slide > *");t.reloadCells();t.resize();t.reposition()}async slideTo(t,i){const s=await this.getflickity();s.select(t,i)}async slideNext(t,i){const s=await this.getflickity();s.next(i,t)}async slidePrev(t,i){const s=await this.getflickity();s.previous(t,i)}async getActiveIndex(){const t=await this.getflickity();return t.selectedIndex}async length(){const t=await this.getflickity();return t.slides.length}async isEnd(){const t=await this.getflickity();return t.selectedIndex===t.slides.length-1}async isBeginning(){const t=await this.getflickity();return t.selectedIndex===0}async startAutoplay(t){const i=await this.getflickity();if(t)this.options={autoPlay:t};setTimeout((()=>i.playPlayer()))}async stopAutoplay(){const t=await this.getflickity();t.stopPlayer()}async lockSwipes(t){const i=await this.getflickity();i.options.draggable=!t;i.updateDraggable()}async getflickity(){return this.flickity}async reload(){this.destroyflickity();setTimeout((()=>this.initflickity()),20)}_getRoot(){return this.host.shadowRoot?this.host.shadowRoot:this.host}destroyflickity(){const t=this.syncflickity;if(t!==undefined){t.destroy();this.flickity=new Promise((t=>{this.readyflickity=t}));this.flickityReady=false;this.syncflickity=undefined;this.ready=false}this.didInit=false}async loadFlickityModules(t){if(!this.hasFullScreenModule&&t.fullscreen){await import("./fullscreen-09677a62.js");this.hasFullScreenModule=true}if(!this.hasLazyLoadModule&&t.lazyLoad){await import("./lazyload-43fd583a.js");this.hasLazyLoadModule=true}if(!this.hasDotsModule&&t.pageDots){await import("./page-dots-a055f884.js");this.hasDotsModule=true}if(!this.hasFadeModule&&t.fade){await import("./fade-00c7c18e.js");this.hasFadeModule=true}}async initflickity(){const t=this.normalizeOptions();await this.loadFlickityModules(t);await ot(this.host);this.flickityEl=this.flickityEl||this._getRoot().querySelector(".flickity-container");if(!this.flickityEl)return;this.slidesReady=true;if(this.flickityEl.classList.contains("flickity-enabled")){this.destroyflickity()}this.flickityEl.style.height=this.flickityEl.getBoundingClientRect().height+"px";setTimeout((()=>{this.flickityEl.style.height="";const i=new it(this.flickityEl,t);this.flickityReady=true;this.syncflickity=i;this.animationChange();this.navbtnsChanged();this.pagerChanged();this.fullscreenChanged();this.fullscreenBtnChanged();this.readyflickity(i);this.ready=true;if(!window["ResizeObserver"])return;if(this.resizeO){this.resizeO.disconnect();this.resizeO=undefined}const e=this.resizeO=new ResizeObserver((()=>{s((()=>{const t=this.host.shadowRoot.querySelector(".flickity-viewport");n((()=>{if(t)t.style.height="";i.resize()}))}))}));e.observe(this.host)}),100)}normalizeOptions(){const t={cellSelector:"nano-slide",contain:true,prevNextButtons:true,fullscreen:this.fullscreen,accessibility:true,imagesLoaded:true,pageDots:this.pager};if(this.animation==="fade"){t.fade=true}if(this.currentSlide>0){t.initialIndex=this.currentSlide}if(this.autoplay){if(typeof this.autoplay==="string")this.autoplay=parseInt(this.autoplay);if(this.autoplay>0)t.autoPlay=this.autoplay}const i={ready:()=>{setTimeout((()=>{this.nanoSlidesReady.emit()}),20)},select:this.handleSlideSelect,change:this.nanoSlidesChange.emit,scroll:this.nanoSlidesScroll.emit,settle:this.nanoSlidesTransitionEnd.emit,dragStart:this.nanoSlidesDragStart.emit,dragMove:this.nanoSlidesDragMove.emit,dragEnd:this.nanoSlidesDragEnd.emit,staticClick:this.nanoSlidesTap.emit,fullscreenChange:this.handleFullscreen};const s=!!this.options&&!!this.options.on?this.options.on:{};const n={on:{...s,...i}};return{...t,...n,...this.options}}componentDidLoad(){if(typeof window!=="undefined"&&window.MutationObserver){const t=this.mutationO=new MutationObserver((t=>{if(t[0].addedNodes[0]&&t[0].addedNodes[0].nodeName.toLowerCase()==="nano-slide"&&this.flickityReady){this.update()}}));t.observe(this.host,{childList:true,subtree:true})}}componentWillLoad(){this.nanoSlidesDidLoad.emit();if(!this.didInit){this.didInit=true;this.initflickity()}}disconnectedCallback(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}if(this.resizeO){this.resizeO.disconnect();this.resizeO=undefined}this.destroyflickity()}render(){return e(o,null,e("div",{class:{slideshow:true,ready:this.ready,"not-ready":!this.ready},part:"base"},e("div",{ref:t=>this.flickityEl=t,class:{"flickity-container":true,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},e("slot",null)),e("div",{class:"ui-extras"},e("slot",{name:"ui"}))))}get host(){return h(this)}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}};const ot=t=>{const i=Array.from(t.querySelectorAll("nano-slide"));let s=i.filter((t=>!t.ready));if(!s.length)return Promise.resolve(i);return new Promise((n=>{const e=o=>{s=s.filter((t=>t!==o.target));if(!s.length){n(i);t.removeEventListener("nanoSlideReady",e);t.removeEventListener("nano-slide-ready",e)}};t.addEventListener("nanoSlideReady",e);t.addEventListener("nano-slide-ready",e)}))};et.style=st;export{D as F,et as S,B as U,m as u};
|
20
|
+
//# sourceMappingURL=nano-slides-4dab533a.js.map
|