@tet/tet-components 1.3.157-testing → 1.4.0-staging
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/dist/cjs/{address-5271d3aa.js → address-b695d769.js} +1 -1
- package/dist/cjs/{assets-e3bb045c.js → assets-39f8cd2c.js} +1 -1
- package/dist/cjs/{async-request-29b32d63.js → async-request-77d8e0b8.js} +27 -26
- package/dist/cjs/compare-cards-tab-products-filters-10b06fe0.js +100 -0
- package/dist/cjs/{http-codes-2f72a8b2.js → http-codes-38914116.js} +25 -19
- package/dist/cjs/{index-f559cb2e.js → index-28359ea5.js} +1672 -1598
- package/dist/cjs/{index-84ede372.js → index-bf7cfd19.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{phone-d414fe5a.js → phone-ed64bd26.js} +8 -6
- package/dist/cjs/{product-comparison-f784fb1b.js → product-comparison-ae2ccae4.js} +1 -1
- package/dist/cjs/{tasks-af99ad61.js → tasks-57ad40ae.js} +2 -2
- package/dist/cjs/tet-accordion_2.cjs.entry.js +62 -46
- package/dist/cjs/tet-address-offers-filters-products_2.cjs.entry.js +249 -232
- package/dist/cjs/tet-address-offers-view.cjs.entry.js +43 -35
- package/dist/cjs/tet-address-offers_4.cjs.entry.js +343 -313
- package/dist/cjs/tet-address-search.cjs.entry.js +175 -167
- package/dist/cjs/tet-asset-addresses.cjs.entry.js +106 -95
- package/dist/cjs/tet-autocomplete-dropdown.cjs.entry.js +40 -30
- package/dist/cjs/tet-autocomplete.cjs.entry.js +203 -190
- package/dist/cjs/tet-b2b-check-out-form_5.cjs.entry.js +280 -241
- package/dist/cjs/tet-b2b-configurator.cjs.entry.js +396 -378
- package/dist/cjs/tet-b2b-service-calculator.cjs.entry.js +28 -28
- package/dist/cjs/tet-banner-nav.cjs.entry.js +23 -11
- package/dist/cjs/tet-bar-graph.cjs.entry.js +222 -215
- package/dist/cjs/tet-border-radius.cjs.entry.js +1 -1
- package/dist/cjs/tet-business-card.cjs.entry.js +38 -32
- package/dist/cjs/tet-business-compare-card.cjs.entry.js +18 -11
- package/dist/cjs/tet-business-lines.cjs.entry.js +25 -26
- package/dist/cjs/tet-business-round-stepper.cjs.entry.js +10 -10
- package/dist/cjs/tet-button.cjs.entry.js +9 -9
- package/dist/cjs/tet-card-list.cjs.entry.js +557 -530
- package/dist/cjs/tet-carousel.cjs.entry.js +180 -184
- package/dist/cjs/tet-checkbox.cjs.entry.js +15 -11
- package/dist/cjs/tet-cloud-application-form-dialog.cjs.entry.js +30 -4
- package/dist/cjs/tet-cloud-configurator.cjs.entry.js +132 -124
- package/dist/cjs/tet-colors.cjs.entry.js +42 -42
- package/dist/cjs/tet-compare-card-v2.cjs.entry.js +51 -49
- package/dist/cjs/tet-compare-cards-tab.cjs.entry.js +29 -28
- package/dist/cjs/tet-compare-cards_2.cjs.entry.js +41 -34
- package/dist/cjs/tet-components.cjs.js +3 -3
- package/dist/cjs/tet-contact-form.cjs.entry.js +55 -46
- package/dist/cjs/tet-contact-info.cjs.entry.js +1 -1
- package/dist/cjs/tet-container_2.cjs.entry.js +62 -58
- package/dist/cjs/tet-customer-assets.cjs.entry.js +90 -85
- package/dist/cjs/tet-datepicker-header_4.cjs.entry.js +202 -187
- package/dist/cjs/tet-datepicker.cjs.entry.js +35 -30
- package/dist/cjs/tet-dialog.cjs.entry.js +41 -35
- package/dist/cjs/tet-dropdown_2.cjs.entry.js +137 -115
- package/dist/cjs/tet-dynamic-card.cjs.entry.js +68 -71
- package/dist/cjs/tet-expandable-input.cjs.entry.js +97 -80
- package/dist/cjs/tet-expansion-panel.cjs.entry.js +17 -19
- package/dist/cjs/tet-filter.cjs.entry.js +26 -11
- package/dist/cjs/tet-font-weight.cjs.entry.js +1 -1
- package/dist/cjs/tet-fonts.cjs.entry.js +1 -1
- package/dist/cjs/tet-grid.cjs.entry.js +1 -1
- package/dist/cjs/tet-icon.cjs.entry.js +25 -24
- package/dist/cjs/tet-inline-message.cjs.entry.js +7 -7
- package/dist/cjs/tet-input.cjs.entry.js +47 -37
- package/dist/cjs/tet-label.cjs.entry.js +3 -3
- package/dist/cjs/tet-layout.cjs.entry.js +1 -1
- package/dist/cjs/tet-link.cjs.entry.js +1 -1
- package/dist/cjs/tet-loader.cjs.entry.js +1 -1
- package/dist/cjs/tet-macd-view.cjs.entry.js +50 -23
- package/dist/cjs/tet-menu-mobile.cjs.entry.js +13 -14
- package/dist/cjs/tet-menu.cjs.entry.js +4 -5
- package/dist/cjs/tet-multi-step-dialog.cjs.entry.js +86 -72
- package/dist/cjs/tet-navigation-mobile.cjs.entry.js +19 -15
- package/dist/cjs/tet-news-card-list.cjs.entry.js +35 -36
- package/dist/cjs/tet-number-input.cjs.entry.js +56 -42
- package/dist/cjs/tet-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/tet-price-view.cjs.entry.js +4 -4
- package/dist/cjs/tet-radio.cjs.entry.js +11 -7
- package/dist/cjs/tet-range-slider.cjs.entry.js +632 -620
- package/dist/cjs/tet-referral.cjs.entry.js +30 -26
- package/dist/cjs/tet-round-stepper.cjs.entry.js +2 -2
- package/dist/cjs/tet-spacing.cjs.entry.js +1 -1
- package/dist/cjs/tet-spinner.cjs.entry.js +16 -16
- package/dist/cjs/tet-stepper-input.cjs.entry.js +32 -26
- package/dist/cjs/tet-stepper-v2.cjs.entry.js +28 -29
- package/dist/cjs/tet-stepper-v3.cjs.entry.js +20 -21
- package/dist/cjs/tet-stepper.cjs.entry.js +62 -63
- package/dist/cjs/tet-switch.cjs.entry.js +4 -2
- package/dist/cjs/tet-tab-header.cjs.entry.js +68 -65
- package/dist/cjs/tet-table.cjs.entry.js +132 -138
- package/dist/cjs/tet-tag_2.cjs.entry.js +11 -11
- package/dist/cjs/tet-text-list.cjs.entry.js +12 -4
- package/dist/cjs/tet-textarea.cjs.entry.js +14 -14
- package/dist/cjs/tet-thank-you-view-v2.cjs.entry.js +36 -33
- package/dist/cjs/tet-thank-you-view-v3.cjs.entry.js +36 -33
- package/dist/cjs/tet-thank-you-view.cjs.entry.js +52 -46
- package/dist/cjs/tet-tv-gift-block.cjs.entry.js +15 -15
- package/dist/cjs/tet-tv-gift-list.cjs.entry.js +15 -15
- package/dist/cjs/{theme-wrapper-a5bbadf6.js → theme-wrapper-6ae60d67.js} +2 -2
- package/dist/cjs/{translations-ed68775f.js → translations-2637e1f9.js} +52 -51
- package/dist/cjs/{utils-ac9be2ff.js → utils-1f67c4b7.js} +23 -8
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/advanced/address/tet-address-offers/tet-address-offers.js +108 -101
- package/dist/collection/components/advanced/address/tet-address-offers-filters/address-offers-filters.js +128 -129
- package/dist/collection/components/advanced/address/tet-address-offers-filters/tet-address-offers-filters.js +17 -17
- package/dist/collection/components/advanced/address/tet-address-offers-filters-products/address-offers-products-filters.js +90 -89
- package/dist/collection/components/advanced/address/tet-address-offers-filters-products/tet-address-offers-filters-products.js +33 -19
- package/dist/collection/components/advanced/address/tet-address-search/tet-address-search.js +171 -163
- package/dist/collection/components/advanced/address/tet-autocomplete/tet-autocomplete.js +203 -206
- package/dist/collection/components/advanced/address/tet-autocomplete-dropdown/tet-autocomplete-dropdown.js +39 -29
- package/dist/collection/components/advanced/cards/tet-b2b-compare-card/tet-b2b-compare-card.js +75 -62
- package/dist/collection/components/advanced/cards/tet-business-card/tet-business-card.js +40 -30
- package/dist/collection/components/advanced/cards/tet-business-compare-card/tet-business-compare-card.js +17 -10
- package/dist/collection/components/advanced/cards/tet-business-summary-card/tet-business-summary-card.js +38 -32
- package/dist/collection/components/advanced/cards/tet-card-list/tet-card-list.js +356 -337
- package/dist/collection/components/advanced/cards/tet-compare-card/tet-compare-card.js +125 -119
- package/dist/collection/components/advanced/cards/tet-compare-card-v2/tet-compare-card-v2.js +51 -45
- package/dist/collection/components/advanced/cards/tet-compare-cards/tet-compare-cards.js +21 -15
- package/dist/collection/components/advanced/cards/tet-compare-cards-tab/compare-cards-tab-products-filters.js +89 -88
- package/dist/collection/components/advanced/cards/tet-compare-cards-tab/tet-compare-cards-tab.js +25 -22
- package/dist/collection/components/advanced/cards/tet-dynamic-card/tet-dynamic-card.js +67 -70
- package/dist/collection/components/advanced/cards/utils.js +23 -8
- package/dist/collection/components/advanced/customer/tet-asset-addresses/tet-asset-addresses.js +103 -92
- package/dist/collection/components/advanced/customer/tet-asset-availability-addresses/tet-asset-availability-addresses.js +29 -14
- package/dist/collection/components/advanced/customer/tet-customer-assets/tet-customer-assets.js +87 -82
- package/dist/collection/components/advanced/customer/tet-referral/tet-referral.js +24 -19
- package/dist/collection/components/advanced/dialog/tet-multi-step-dialog/tet-multi-step-dialog.js +83 -69
- package/dist/collection/components/advanced/forms/tet-availability-contact-form/tet-availability-contact-form.js +54 -43
- package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.js +11 -3
- package/dist/collection/components/advanced/forms/tet-contact-form/tet-contact-form.js +49 -40
- package/dist/collection/components/advanced/promotions/tv-gift/tet-tv-gift-block/tet-tv-gift-block.js +14 -13
- package/dist/collection/components/advanced/promotions/tv-gift/tet-tv-gift-list/tet-tv-gift-list.js +15 -13
- package/dist/collection/components/basic/buttons/tet-button/tet-button.js +8 -8
- package/dist/collection/components/basic/buttons/tet-checkbox/tet-checkbox.js +14 -10
- package/dist/collection/components/basic/buttons/tet-radio/tet-radio.js +10 -6
- package/dist/collection/components/basic/buttons/tet-switch/tet-switch.js +3 -1
- package/dist/collection/components/basic/buttons/tet-tabs/tet-tab-content/tet-tab-content.js +17 -13
- package/dist/collection/components/basic/buttons/tet-tabs/tet-tab-header/tet-tab-header.js +67 -63
- package/dist/collection/components/basic/buttons/tet-tag-group/tet-tag-group.js +8 -8
- package/dist/collection/components/basic/carousel/tet-carousel/tet-carousel.js +177 -181
- package/dist/collection/components/basic/icon/tet-icon.js +23 -22
- package/dist/collection/components/basic/loaders/tet-spinner/tet-spinner.js +15 -14
- package/dist/collection/components/basic/steppers/tet-banner-nav/tet-banner-nav.js +20 -8
- package/dist/collection/components/basic/steppers/tet-business-round-stepper/tet-business-round-stepper.js +9 -9
- package/dist/collection/components/basic/steppers/tet-round-stepper/tet-round-stepper.js +4 -0
- package/dist/collection/components/basic/steppers/tet-stepper/tet-stepper.js +61 -62
- package/dist/collection/components/basic/steppers/tet-stepper-v2/tet-stepper-v2.js +27 -28
- package/dist/collection/components/basic/steppers/tet-stepper-v3/tet-stepper-v3.js +19 -20
- package/dist/collection/components/simple/filter/tet-filter/tet-filter.js +25 -10
- package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-header/tet-datepicker-header.js +20 -16
- package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-month-view/tet-datepicker-month-view.js +135 -132
- package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-multi-year-view/tet-datepicker-multi-year-view.js +20 -17
- package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-year-view/tet-datepicker-year-view.js +26 -21
- package/dist/collection/components/simple/inputs/tet-datepicker/tet-datepicker.js +34 -28
- package/dist/collection/components/simple/inputs/tet-dropdown/tet-dropdown.js +20 -8
- package/dist/collection/components/simple/inputs/tet-expandable-input/tet-expandable-input.js +99 -78
- package/dist/collection/components/simple/inputs/tet-input/tet-input.js +44 -34
- package/dist/collection/components/simple/inputs/tet-number-input/tet-number-input.js +55 -41
- package/dist/collection/components/simple/inputs/tet-range-slider/tet-range-slider.js +631 -618
- package/dist/collection/components/simple/inputs/tet-stepper-input/tet-stepper-input.js +29 -23
- package/dist/collection/components/simple/inputs/tet-textarea/tet-textarea.js +13 -13
- package/dist/collection/components/simple/lists/tet-news-card-list/tet-news-card-list.js +37 -34
- package/dist/collection/components/simple/lists/tet-selection-list/tet-selection-list.js +61 -57
- package/dist/collection/components/simple/lists/tet-text-list/tet-text-list.js +14 -2
- package/dist/collection/components/simple/menu/tet-business-navigation/tet-business-navigation.js +48 -45
- package/dist/collection/components/simple/menu/tet-menu/tet-menu.js +3 -4
- package/dist/collection/components/simple/menu/tet-menu-mobile/tet-menu-mobile.js +15 -12
- package/dist/collection/components/simple/menu/tet-navigation-mobile/tet-navigation-mobile.js +18 -14
- package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.js +37 -20
- package/dist/collection/components/simple/structural/tet-expansion-panel/tet-expansion-panel.js +16 -17
- package/dist/collection/components/simple/tables-and-graphs/tet-bar-graph/tet-bar-graph.js +222 -213
- package/dist/collection/components/simple/tables-and-graphs/tet-table/tet-table.js +132 -136
- package/dist/collection/components/simple/text-blocks/tet-cloud-application-form-dialog/tet-cloud-application-form-dialog.js +27 -1
- package/dist/collection/components/simple/text-blocks/tet-dialog/tet-dialog.js +39 -31
- package/dist/collection/components/simple/text-blocks/tet-inline-message/tet-inline-message.js +6 -6
- package/dist/collection/components/simple/text-blocks/tet-notification/tet-notification.js +27 -23
- package/dist/collection/components/simple/text-blocks/tet-tooltip/tet-tooltip.js +119 -105
- package/dist/collection/components/views/tet-address-offers-view/tet-address-offers-view.js +40 -32
- package/dist/collection/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/tet-b2b-configurator-cart.js +99 -88
- package/dist/collection/components/views/tet-b2b-configurator/tet-b2b-configurator.js +392 -373
- package/dist/collection/components/views/tet-b2b-service-calculator/tet-b2b-service-calculator.js +25 -25
- package/dist/collection/components/views/tet-business-lines/tet-business-lines.js +21 -22
- package/dist/collection/components/views/tet-cloud-configurator/tet-cloud-configurator.js +130 -120
- package/dist/collection/components/views/tet-macd-view/tet-macd-view.js +42 -13
- package/dist/collection/components/views/tet-price-view/tet-price-view.js +4 -2
- package/dist/collection/components/views/tet-thank-you-view/tet-thank-you-view.js +52 -44
- package/dist/collection/components/views/tet-thank-you-view-v2/tet-thank-you-view-v2.js +34 -29
- package/dist/collection/components/views/tet-thank-you-view-v3/tet-thank-you-view-v3.js +34 -29
- package/dist/collection/config/bradcasting.js +1 -2
- package/dist/collection/config/endpoints.js +7 -5
- package/dist/collection/config/forms-portal.js +1 -2
- package/dist/collection/config/landing-pages.js +1 -2
- package/dist/collection/config/mytet-portal.js +1 -2
- package/dist/collection/docs/styling/colors/tet-colors.js +41 -41
- package/dist/collection/services/api/async-request.js +26 -25
- package/dist/collection/services/api/request.js +16 -11
- package/dist/collection/services/api/services/tv/tv-channel-count-parser.js +73 -74
- package/dist/collection/services/translations/translations-manager.js +46 -47
- package/dist/collection/services/translations/translations.js +1 -2
- package/dist/collection/services/translations/translations.store.js +2 -3
- package/dist/collection/services/utils/inertia-scroll.js +203 -191
- package/dist/collection/services/utils/object.js +5 -3
- package/dist/collection/services/validators/validators/e-mail.js +6 -5
- package/dist/collection/services/validators/validators/phone.js +6 -5
- package/dist/collection/services/validators/validators/required.js +2 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-35e72a2b.js → p-01f21691.js} +58 -44
- package/dist/components/{p-cec65d0a.js → p-02c55c0d.js} +121 -116
- package/dist/components/{p-7ddd71bd.js → p-08fbbbf9.js} +3 -3
- package/dist/components/{p-00c91e96.js → p-0e0dcb37.js} +2 -2
- package/dist/components/{p-639c9d1a.js → p-11a7865e.js} +80 -69
- package/dist/components/{p-ca66b4b1.js → p-12649d6e.js} +8 -6
- package/dist/components/{p-03177920.js → p-1278b6e9.js} +181 -173
- package/dist/components/{p-f18e5ae3.js → p-153245c0.js} +28 -23
- package/dist/components/{p-7b3c7bf1.js → p-243407f8.js} +4 -2
- package/dist/components/p-245f534d.js +869 -0
- package/dist/components/{p-856695a3.js → p-2630a661.js} +43 -37
- package/dist/components/{p-3fd7310f.js → p-269298f7.js} +1 -1
- package/dist/components/{p-50f207fd.js → p-27b54fb3.js} +54 -34
- package/dist/components/{p-53ca0a91.js → p-281300b4.js} +39 -23
- package/dist/components/{p-163de6e2.js → p-29df1df5.js} +23 -11
- package/dist/components/{p-42ff76b5.js → p-2c7320b5.js} +22 -18
- package/dist/components/{p-aca28e71.js → p-3444731e.js} +53 -52
- package/dist/components/{p-9a47b95f.js → p-35eefb16.js} +26 -26
- package/dist/components/{p-68f0e894.js → p-36c5e434.js} +10 -10
- package/dist/components/{p-9573f82c.js → p-392981a3.js} +41 -35
- package/dist/components/{p-965cea5b.js → p-39c66558.js} +137 -134
- package/dist/components/{p-9fe57fd0.js → p-3bb2ad44.js} +68 -65
- package/dist/components/{p-a188f09e.js → p-3e04ea5b.js} +11 -7
- package/dist/components/{p-eb54f5b9.js → p-4ae2dab9.js} +21 -18
- package/dist/components/{p-9bf262a8.js → p-52152f5b.js} +33 -27
- package/dist/components/{p-a0d406ca.js → p-549fe76f.js} +117 -72
- package/dist/components/{p-e707e73a.js → p-65770d46.js} +13 -5
- package/dist/components/{p-bb324278.js → p-68024f5b.js} +1 -1
- package/dist/components/{p-4d33055f.js → p-6bfd47c5.js} +117 -107
- package/dist/components/{p-a81e545d.js → p-6e8a8d28.js} +1 -1
- package/dist/components/{p-489ae3a0.js → p-6f4bf94f.js} +27 -26
- package/dist/components/{p-df1fe72c.js → p-754dce81.js} +47 -37
- package/dist/components/{p-5c8c2d8d.js → p-7dd65c3a.js} +1 -1
- package/dist/components/{p-6a2a81d8.js → p-85821f41.js} +104 -94
- package/dist/components/{p-817bee22.js → p-8b4a75b2.js} +12 -12
- package/dist/{esm/http-codes-7faa9f6e.js → components/p-94a1eb7a.js} +66 -59
- package/dist/components/{p-045bec85.js → p-98b10b48.js} +16 -16
- package/dist/components/{p-7790eae2.js → p-99823afc.js} +128 -126
- package/dist/components/{p-b0d6ed2e.js → p-9ee3e98b.js} +25 -24
- package/dist/components/{p-6847eb2d.js → p-a09504f7.js} +62 -63
- package/dist/components/{p-88b42c67.js → p-a15512ce.js} +63 -59
- package/dist/components/{p-6b7e73c0.js → p-bd9b1f18.js} +218 -202
- package/dist/components/{p-881093d4.js → p-bf642eca.js} +206 -194
- package/dist/components/{p-91651432.js → p-bfcce1dd.js} +1 -1
- package/dist/components/{p-21c5cfc4.js → p-c47caf67.js} +64 -53
- package/dist/components/{p-c1876db7.js → p-c7dba63e.js} +36 -21
- package/dist/components/{p-5dc5e13c.js → p-c8fc3c1f.js} +2 -2
- package/dist/components/{p-bd3402f6.js → p-c97d9f10.js} +17 -15
- package/dist/components/p-c996a768.js +169 -0
- package/dist/components/{p-37ed3ebb.js → p-c9d79ad4.js} +190 -135
- package/dist/components/{p-029ff2b3.js → p-d22e1c96.js} +24 -24
- package/dist/components/{p-0088d040.js → p-d7d60ba4.js} +16 -12
- package/dist/components/{p-00e689fb.js → p-d92a53ea.js} +1 -1
- package/dist/components/{p-e04716ac.js → p-da4e6cfb.js} +29 -30
- package/dist/components/{p-cb2daf20.js → p-dcf5c661.js} +25 -16
- package/dist/components/{p-04fe59fc.js → p-dcffa870.js} +50 -47
- package/dist/components/{p-616c71e1.js → p-e4f00545.js} +559 -532
- package/dist/components/{p-530ef38b.js → p-f44eb3d8.js} +4 -4
- package/dist/components/{p-144dffdc.js → p-f7bd56ce.js} +1 -1
- package/dist/components/{p-818742ad.js → p-f8ef72c1.js} +21 -22
- package/dist/components/tet-accordion.js +1 -1
- package/dist/components/tet-address-offers-filters-products.js +1 -1
- package/dist/components/tet-address-offers-filters.js +1 -1
- package/dist/components/tet-address-offers-view.js +65 -57
- package/dist/components/tet-address-offers.js +1 -1
- package/dist/components/tet-address-search.js +1 -1
- package/dist/components/tet-asset-addresses.js +116 -105
- package/dist/components/tet-asset-availability-addresses.js +1 -1
- package/dist/components/tet-autocomplete-dropdown.js +44 -34
- package/dist/components/tet-autocomplete.js +1 -1
- package/dist/components/tet-availability-contact-form.js +1 -1
- package/dist/components/tet-b2b-check-out-form.js +1 -1
- package/dist/components/tet-b2b-compare-card.js +1 -1
- package/dist/components/tet-b2b-configurator-cart.js +1 -1
- package/dist/components/tet-b2b-configurator.js +411 -393
- package/dist/components/tet-b2b-service-calculator.js +33 -33
- package/dist/components/tet-banner-nav.js +23 -11
- package/dist/components/tet-bar-graph.js +222 -215
- package/dist/components/tet-border-radius.js +1 -1
- package/dist/components/tet-business-card.js +38 -32
- package/dist/components/tet-business-compare-card.js +20 -13
- package/dist/components/tet-business-lines.js +26 -27
- package/dist/components/tet-business-navigation.js +1 -1
- package/dist/components/tet-business-round-stepper.js +11 -11
- package/dist/components/tet-business-summary-card.js +1 -1
- package/dist/components/tet-button.js +1 -1
- package/dist/components/tet-card-list.js +1 -1
- package/dist/components/tet-carousel.js +181 -185
- package/dist/components/tet-checkbox.js +1 -1
- package/dist/components/tet-cloud-application-form-dialog.js +35 -9
- package/dist/components/tet-cloud-configurator.js +140 -132
- package/dist/components/tet-colors.js +42 -42
- package/dist/components/tet-compare-card-v2.js +57 -55
- package/dist/components/tet-compare-card.js +1 -1
- package/dist/components/tet-compare-cards-tab.js +40 -39
- package/dist/components/tet-compare-cards.js +1 -1
- package/dist/components/tet-contact-form.js +59 -50
- package/dist/components/tet-contact-info.js +1 -1
- package/dist/components/tet-container.js +1 -1
- package/dist/components/tet-customer-assets.js +95 -90
- package/dist/components/tet-datepicker-header.js +1 -1
- package/dist/components/tet-datepicker-month-view.js +1 -1
- package/dist/components/tet-datepicker-multi-year-view.js +1 -1
- package/dist/components/tet-datepicker-year-view.js +1 -1
- package/dist/components/tet-datepicker.js +41 -36
- package/dist/components/tet-dialog.js +1 -1
- package/dist/components/tet-dropdown.js +1 -1
- package/dist/components/tet-dynamic-card.js +71 -74
- package/dist/components/tet-expandable-input.js +99 -82
- package/dist/components/tet-expansion-panel.js +17 -19
- package/dist/components/tet-filter.js +29 -14
- package/dist/components/tet-font-weight.js +1 -1
- package/dist/components/tet-fonts.js +1 -1
- package/dist/components/tet-grid.js +1 -1
- package/dist/components/tet-icon.js +1 -1
- package/dist/components/tet-inline-message.js +8 -8
- package/dist/components/tet-input.js +1 -1
- package/dist/components/tet-label.js +3 -3
- package/dist/components/tet-layout.js +1 -1
- package/dist/components/tet-link.js +1 -1
- package/dist/components/tet-loader.js +1 -1
- package/dist/components/tet-macd-view.js +55 -28
- package/dist/components/tet-menu-mobile.js +14 -15
- package/dist/components/tet-menu.js +5 -6
- package/dist/components/tet-multi-step-dialog.js +88 -74
- package/dist/components/tet-navigation-mobile.js +20 -16
- package/dist/components/tet-news-card-list.js +38 -39
- package/dist/components/tet-notification.js +1 -1
- package/dist/components/tet-number-input.js +1 -1
- package/dist/components/tet-placeholder.js +1 -1
- package/dist/components/tet-price-view.js +1 -1
- package/dist/components/tet-radio.js +1 -1
- package/dist/components/tet-range-slider.js +1 -1
- package/dist/components/tet-referral.js +32 -28
- package/dist/components/tet-round-stepper.js +3 -3
- package/dist/components/tet-selection-list.js +1 -1
- package/dist/components/tet-spacing.js +1 -1
- package/dist/components/tet-spinner.js +1 -1
- package/dist/components/tet-stepper-input.js +1 -1
- package/dist/components/tet-stepper-v2.js +1 -1
- package/dist/components/tet-stepper-v3.js +1 -1
- package/dist/components/tet-stepper.js +1 -1
- package/dist/components/tet-switch.js +1 -1
- package/dist/components/tet-tab-content.js +1 -1
- package/dist/components/tet-tab-header.js +1 -1
- package/dist/components/tet-table.js +134 -140
- package/dist/components/tet-tag-group.js +1 -1
- package/dist/components/tet-tag.js +1 -1
- package/dist/components/tet-text-list.js +1 -1
- package/dist/components/tet-textarea.js +14 -14
- package/dist/components/tet-thank-you-view-v2.js +38 -35
- package/dist/components/tet-thank-you-view-v3.js +38 -35
- package/dist/components/tet-thank-you-view.js +55 -49
- package/dist/components/tet-tooltip.js +1 -1
- package/dist/components/tet-tv-gift-block.js +15 -15
- package/dist/components/tet-tv-gift-list.js +16 -16
- package/dist/esm/{address-979a9993.js → address-1ff7cd1f.js} +1 -1
- package/dist/esm/{assets-b971f105.js → assets-79f78adb.js} +1 -1
- package/dist/esm/{async-request-6675e5f5.js → async-request-ab25480d.js} +27 -26
- package/dist/esm/compare-cards-tab-products-filters-79b7b7c6.js +98 -0
- package/dist/{components/p-6830b44d.js → esm/http-codes-eb08ff6f.js} +65 -60
- package/dist/esm/{index-1bf36cb9.js → index-8ebb7ad1.js} +1 -1
- package/dist/esm/{index-7f1e2a22.js → index-950abbb7.js} +1672 -1598
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{phone-99c2f297.js → phone-4b016684.js} +8 -6
- package/dist/esm/{product-comparison-830e2764.js → product-comparison-286ce057.js} +1 -1
- package/dist/esm/{tasks-3dfcc330.js → tasks-770dc32d.js} +2 -2
- package/dist/esm/tet-accordion_2.entry.js +62 -46
- package/dist/esm/tet-address-offers-filters-products_2.entry.js +250 -233
- package/dist/esm/tet-address-offers-view.entry.js +44 -36
- package/dist/esm/tet-address-offers_4.entry.js +344 -314
- package/dist/esm/tet-address-search.entry.js +176 -168
- package/dist/esm/tet-asset-addresses.entry.js +106 -95
- package/dist/esm/tet-autocomplete-dropdown.entry.js +40 -30
- package/dist/esm/tet-autocomplete.entry.js +204 -191
- package/dist/esm/tet-b2b-check-out-form_5.entry.js +281 -242
- package/dist/esm/tet-b2b-configurator.entry.js +397 -379
- package/dist/esm/tet-b2b-service-calculator.entry.js +29 -29
- package/dist/esm/tet-banner-nav.entry.js +24 -12
- package/dist/esm/tet-bar-graph.entry.js +222 -215
- package/dist/esm/tet-border-radius.entry.js +1 -1
- package/dist/esm/tet-business-card.entry.js +38 -32
- package/dist/esm/tet-business-compare-card.entry.js +18 -11
- package/dist/esm/tet-business-lines.entry.js +26 -27
- package/dist/esm/tet-business-round-stepper.entry.js +10 -10
- package/dist/esm/tet-button.entry.js +9 -9
- package/dist/esm/tet-card-list.entry.js +557 -530
- package/dist/esm/tet-carousel.entry.js +181 -185
- package/dist/esm/tet-checkbox.entry.js +15 -11
- package/dist/esm/tet-cloud-application-form-dialog.entry.js +31 -5
- package/dist/esm/tet-cloud-configurator.entry.js +133 -125
- package/dist/esm/tet-colors.entry.js +42 -42
- package/dist/esm/tet-compare-card-v2.entry.js +51 -49
- package/dist/esm/tet-compare-cards-tab.entry.js +29 -28
- package/dist/esm/tet-compare-cards_2.entry.js +41 -34
- package/dist/esm/tet-components.js +4 -4
- package/dist/esm/tet-contact-form.entry.js +56 -47
- package/dist/esm/tet-contact-info.entry.js +1 -1
- package/dist/esm/tet-container_2.entry.js +63 -59
- package/dist/esm/tet-customer-assets.entry.js +90 -85
- package/dist/esm/tet-datepicker-header_4.entry.js +203 -188
- package/dist/esm/tet-datepicker.entry.js +36 -31
- package/dist/esm/tet-dialog.entry.js +42 -36
- package/dist/esm/tet-dropdown_2.entry.js +137 -115
- package/dist/esm/tet-dynamic-card.entry.js +68 -71
- package/dist/esm/tet-expandable-input.entry.js +97 -80
- package/dist/esm/tet-expansion-panel.entry.js +17 -19
- package/dist/esm/tet-filter.entry.js +26 -11
- package/dist/esm/tet-font-weight.entry.js +1 -1
- package/dist/esm/tet-fonts.entry.js +1 -1
- package/dist/esm/tet-grid.entry.js +1 -1
- package/dist/esm/tet-icon.entry.js +25 -24
- package/dist/esm/tet-inline-message.entry.js +7 -7
- package/dist/esm/tet-input.entry.js +48 -38
- package/dist/esm/tet-label.entry.js +4 -4
- package/dist/esm/tet-layout.entry.js +1 -1
- package/dist/esm/tet-link.entry.js +1 -1
- package/dist/esm/tet-loader.entry.js +1 -1
- package/dist/esm/tet-macd-view.entry.js +51 -24
- package/dist/esm/tet-menu-mobile.entry.js +13 -14
- package/dist/esm/tet-menu.entry.js +4 -5
- package/dist/esm/tet-multi-step-dialog.entry.js +87 -73
- package/dist/esm/tet-navigation-mobile.entry.js +19 -15
- package/dist/esm/tet-news-card-list.entry.js +35 -36
- package/dist/esm/tet-number-input.entry.js +56 -42
- package/dist/esm/tet-placeholder.entry.js +1 -1
- package/dist/esm/tet-price-view.entry.js +4 -4
- package/dist/esm/tet-radio.entry.js +11 -7
- package/dist/esm/tet-range-slider.entry.js +632 -620
- package/dist/esm/tet-referral.entry.js +31 -27
- package/dist/esm/tet-round-stepper.entry.js +2 -2
- package/dist/esm/tet-spacing.entry.js +1 -1
- package/dist/esm/tet-spinner.entry.js +16 -16
- package/dist/esm/tet-stepper-input.entry.js +33 -27
- package/dist/esm/tet-stepper-v2.entry.js +28 -29
- package/dist/esm/tet-stepper-v3.entry.js +20 -21
- package/dist/esm/tet-stepper.entry.js +62 -63
- package/dist/esm/tet-switch.entry.js +4 -2
- package/dist/esm/tet-tab-header.entry.js +68 -65
- package/dist/esm/tet-table.entry.js +132 -138
- package/dist/esm/tet-tag_2.entry.js +12 -12
- package/dist/esm/tet-text-list.entry.js +12 -4
- package/dist/esm/tet-textarea.entry.js +14 -14
- package/dist/esm/tet-thank-you-view-v2.entry.js +37 -34
- package/dist/esm/tet-thank-you-view-v3.entry.js +37 -34
- package/dist/esm/tet-thank-you-view.entry.js +52 -46
- package/dist/esm/tet-tv-gift-block.entry.js +15 -15
- package/dist/esm/tet-tv-gift-list.entry.js +15 -15
- package/dist/esm/{theme-wrapper-6e6b2089.js → theme-wrapper-f83deed6.js} +2 -2
- package/dist/esm/{translations-eff34607.js → translations-baabae60.js} +53 -52
- package/dist/esm/{typecheck-31fd6c02.js → typecheck-4abf0258.js} +1 -1
- package/dist/esm/{utils-f8f08058.js → utils-c110a4b1.js} +23 -8
- package/dist/tet-components/{p-c7dbb16f.entry.js → p-0847a214.entry.js} +1 -1
- package/dist/tet-components/p-086f464e.entry.js +1 -0
- package/dist/tet-components/{p-eed2b508.entry.js → p-0ecbcf94.entry.js} +1 -1
- package/dist/tet-components/p-1215e5c0.entry.js +1 -0
- package/dist/tet-components/p-12649d6e.js +1 -0
- package/dist/tet-components/p-15cd7158.entry.js +1 -0
- package/dist/tet-components/p-203651e5.entry.js +1 -0
- package/dist/tet-components/p-20a93866.entry.js +1 -0
- package/dist/tet-components/p-25c9957d.js +1 -0
- package/dist/tet-components/p-29268caf.entry.js +1 -0
- package/dist/tet-components/{p-8f545d45.entry.js → p-29b1a959.entry.js} +1 -1
- package/dist/tet-components/p-2a0bbc16.js +1 -0
- package/dist/tet-components/p-2a346803.entry.js +1 -0
- package/dist/tet-components/p-300dcb5e.entry.js +1 -0
- package/dist/tet-components/{p-1a89919e.entry.js → p-30677f37.entry.js} +1 -1
- package/dist/tet-components/p-30f27049.entry.js +1 -0
- package/dist/tet-components/p-316f0d93.entry.js +1 -0
- package/dist/tet-components/{p-66dd0ede.entry.js → p-39153b16.entry.js} +1 -1
- package/dist/tet-components/p-3b5c1dfc.entry.js +1 -0
- package/dist/tet-components/p-3f630a8d.entry.js +1 -0
- package/dist/tet-components/p-446f550d.entry.js +1 -0
- package/dist/tet-components/{p-a07cada6.entry.js → p-44827a7f.entry.js} +1 -1
- package/dist/tet-components/p-47f100fa.entry.js +1 -0
- package/dist/tet-components/{p-9b027102.entry.js → p-4b4626ec.entry.js} +1 -1
- package/dist/tet-components/p-4e4095c1.js +1 -0
- package/dist/tet-components/{p-46e5b573.entry.js → p-50479341.entry.js} +1 -1
- package/dist/tet-components/p-536dd157.entry.js +1 -0
- package/dist/tet-components/{p-ecff869b.entry.js → p-56b8b4ec.entry.js} +1 -1
- package/dist/tet-components/p-56d32115.entry.js +1 -0
- package/dist/tet-components/p-5d2f0c13.entry.js +1 -0
- package/dist/tet-components/p-618e8591.entry.js +1 -0
- package/dist/tet-components/p-63a909de.entry.js +1 -0
- package/dist/tet-components/p-63b83c11.entry.js +1 -0
- package/dist/tet-components/p-641f4ab5.entry.js +1 -0
- package/dist/tet-components/p-6d468c83.entry.js +1 -0
- package/dist/tet-components/{p-e263ecdf.js → p-6d681c43.js} +1 -1
- package/dist/tet-components/p-72082f3b.entry.js +1 -0
- package/dist/tet-components/{p-7a04bcd7.entry.js → p-739d3344.entry.js} +1 -1
- package/dist/tet-components/p-77d8a2a5.entry.js +1 -0
- package/dist/tet-components/p-77dea317.entry.js +1 -0
- package/dist/tet-components/p-78eb86ff.entry.js +1 -0
- package/dist/tet-components/p-7b91c3d4.entry.js +1 -0
- package/dist/tet-components/{p-f9a1fbb2.entry.js → p-7f520852.entry.js} +1 -1
- package/dist/tet-components/p-8254455b.entry.js +1 -0
- package/dist/tet-components/p-87be3264.entry.js +1 -0
- package/dist/tet-components/{p-918e4e84.entry.js → p-87f36453.entry.js} +1 -1
- package/dist/tet-components/p-88c9ef00.entry.js +1 -0
- package/dist/tet-components/{p-de142575.js → p-88f7bb98.js} +1 -1
- package/dist/tet-components/p-89ae73f2.entry.js +1 -0
- package/dist/tet-components/p-8aecb130.entry.js +1 -0
- package/dist/tet-components/{p-77372984.js → p-90205e46.js} +1 -1
- package/dist/tet-components/p-9081ba98.entry.js +1 -0
- package/dist/tet-components/{p-b680d126.entry.js → p-90ef663e.entry.js} +1 -1
- package/dist/tet-components/p-93e2d958.entry.js +1 -0
- package/dist/tet-components/p-9464cc18.entry.js +1 -0
- package/dist/tet-components/{p-bb9f1a6f.entry.js → p-988b6712.entry.js} +1 -1
- package/dist/tet-components/p-98f93bec.entry.js +1 -0
- package/dist/tet-components/p-9a2b6ee2.js +1 -0
- package/dist/tet-components/{p-8c964cca.js → p-9af9c5e3.js} +2 -2
- package/dist/tet-components/p-9c188d1b.entry.js +1 -0
- package/dist/tet-components/p-a263681d.entry.js +1 -0
- package/dist/tet-components/{p-8b405467.entry.js → p-a43badd1.entry.js} +1 -1
- package/dist/tet-components/{p-775aa778.entry.js → p-a77b7388.entry.js} +1 -1
- package/dist/tet-components/p-ad14115e.entry.js +1 -0
- package/dist/tet-components/{p-36d2a380.entry.js → p-af82e64e.entry.js} +1 -1
- package/dist/tet-components/p-b47e0d55.entry.js +1 -0
- package/dist/tet-components/p-b4b92f9b.js +2 -0
- package/dist/tet-components/p-b9359fea.entry.js +1 -0
- package/dist/tet-components/p-ba494985.entry.js +1 -0
- package/dist/tet-components/p-bda2a644.entry.js +1 -0
- package/dist/tet-components/{p-bc16c07b.js → p-c2a00b6a.js} +1 -1
- package/dist/tet-components/p-c3d9064d.entry.js +1 -0
- package/dist/tet-components/{p-a9ed4e2b.entry.js → p-c61ef9e0.entry.js} +1 -1
- package/dist/tet-components/p-c6818401.entry.js +1 -0
- package/dist/tet-components/{p-ed67bd52.entry.js → p-c7830c8a.entry.js} +1 -1
- package/dist/tet-components/p-c7e4365a.entry.js +1 -0
- package/dist/tet-components/{p-9f1a810e.entry.js → p-c88cdf25.entry.js} +1 -1
- package/dist/tet-components/p-c9cdf98c.js +1 -0
- package/dist/tet-components/p-cba8d001.js +1 -0
- package/dist/tet-components/p-ce271068.entry.js +1 -0
- package/dist/tet-components/p-d55c2f9e.entry.js +1 -0
- package/dist/tet-components/p-db090557.entry.js +1 -0
- package/dist/tet-components/p-df542648.entry.js +1 -0
- package/dist/tet-components/p-e11eb73d.entry.js +1 -0
- package/dist/tet-components/{p-49122f6a.entry.js → p-e6fea049.entry.js} +1 -1
- package/dist/tet-components/p-e87226cb.entry.js +1 -0
- package/dist/tet-components/{p-b2b384d2.js → p-ec1c990e.js} +1 -1
- package/dist/tet-components/p-ec892e18.entry.js +1 -0
- package/dist/tet-components/p-ede893e6.entry.js +1 -0
- package/dist/tet-components/p-eefc4f3d.entry.js +1 -0
- package/dist/tet-components/{p-44d068ac.entry.js → p-efa6f09b.entry.js} +1 -1
- package/dist/tet-components/p-f6f98ea9.entry.js +1 -0
- package/dist/tet-components/{p-5c86ad42.entry.js → p-fca864a8.entry.js} +1 -1
- package/dist/tet-components/{p-f023f124.entry.js → p-ffd1a0d9.entry.js} +1 -1
- package/dist/tet-components/tet-components.esm.js +1 -1
- package/dist/types/components/advanced/address/tet-autocomplete/tet-autocomplete.d.ts +3 -2
- package/dist/types/components.d.ts +0 -8
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +3 -0
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/package.json +6 -12
- package/dist/cjs/compare-cards-tab-products-filters-58410792.js +0 -99
- package/dist/collection/components/advanced/address/tet-address-offers-filters/address-offers-filters.spec.js +0 -105
- package/dist/collection/components/advanced/address/tet-address-offers-filters/test/tet-address-offers-filters.spec.js +0 -23
- package/dist/collection/components/advanced/address/tet-address-offers-filters-products/test/tet-address-offers-filters-products.spec.js +0 -23
- package/dist/collection/components/advanced/address/tet-autocomplete/test/tet-autocomplete.spec.js +0 -110
- package/dist/collection/components/advanced/cards/tet-b2b-compare-card/test/tet-b2b-compare-card.spec.js +0 -86
- package/dist/collection/components/advanced/cards/tet-card-list/test/tet-card-list.spec.js +0 -69
- package/dist/collection/components/advanced/cards/tet-compare-card/test/tet-compare-card.spec.js +0 -292
- package/dist/collection/components/advanced/cards/tet-compare-card-v2/test/tet-compare-card-v2.spec.js +0 -40
- package/dist/collection/components/advanced/cards/tet-compare-cards/test/tet-compare-cards.spec.js +0 -65
- package/dist/collection/components/advanced/cards/tet-compare-cards-tab/test/tet-compare-cards-tab.spec.js +0 -399
- package/dist/collection/components/advanced/customer/tet-asset-addresses/test/tet-asset-addresses.spec.js +0 -30
- package/dist/collection/components/advanced/customer/tet-asset-availability-addresses/test/tet-asset-availability-addresses.spec.js +0 -30
- package/dist/collection/components/advanced/customer/tet-referral/test/tet-referral.spec.js +0 -85
- package/dist/collection/components/advanced/dialog/tet-multi-step-dialog/test/tet-multi-step-dialog.spec.js +0 -53
- package/dist/collection/components/advanced/forms/tet-availability-contact-form/test/tet-availability-contact-form.spec.js +0 -35
- package/dist/collection/components/advanced/promotions/tv-gift/tet-tv-gift-block/test/tet-tv-gift-block.spec.js +0 -61
- package/dist/collection/components/advanced/promotions/tv-gift/tet-tv-gift-list/test/tet-tv-gift-list.spec.js +0 -55
- package/dist/collection/components/basic/buttons/tet-button/test/tet-button.spec.js +0 -131
- package/dist/collection/components/basic/buttons/tet-checkbox/test/tet-checkbox.spec.js +0 -28
- package/dist/collection/components/basic/buttons/tet-radio/test/tet-radio.spec.js +0 -26
- package/dist/collection/components/basic/buttons/tet-switch/test/tet-switch.spec.js +0 -27
- package/dist/collection/components/basic/buttons/tet-tabs/test/tet-tab-content.spec.js +0 -35
- package/dist/collection/components/basic/buttons/tet-tabs/test/tet-tab-header.spec.js +0 -42
- package/dist/collection/components/basic/buttons/tet-tag/test/tet-tag.spec.js +0 -76
- package/dist/collection/components/basic/buttons/tet-tag-group/test/tet-tag-group.spec.js +0 -92
- package/dist/collection/components/basic/carousel/tet-carousel/test/tet-carousel.spec.js +0 -63
- package/dist/collection/components/basic/container/tet-container/test/tet-container.spec.js +0 -50
- package/dist/collection/components/basic/loaders/tet-loader/test/tet-loader.spec.js +0 -19
- package/dist/collection/components/basic/loaders/tet-placeholder/test/tet-placeholder.spec.js +0 -19
- package/dist/collection/components/basic/loaders/tet-spinner/test/tet-spinner.spec.js +0 -52
- package/dist/collection/components/basic/steppers/tet-business-round-stepper/test/tet-business-round-stepper.spec.js +0 -82
- package/dist/collection/components/basic/steppers/tet-round-stepper/test/tet-round-stepper.spec.js +0 -78
- package/dist/collection/components/basic/steppers/tet-stepper/test/tet-stepper.spec.js +0 -110
- package/dist/collection/components/basic/steppers/tet-stepper-v2/test/tet-stepper-v2.spec.js +0 -136
- package/dist/collection/components/basic/steppers/tet-stepper-v3/test/tet-stepper-v3.spec.js +0 -135
- package/dist/collection/components/simple/inputs/tet-dropdown/test/tet-dropdown.spec.js +0 -122
- package/dist/collection/components/simple/inputs/tet-input/test/tet-input.spec.js +0 -110
- package/dist/collection/components/simple/inputs/tet-range-slider/test/tet-range-slider.spec.js +0 -145
- package/dist/collection/components/simple/lists/tet-news-card-list/test/tet-news-card-list.spec.js +0 -111
- package/dist/collection/components/simple/lists/tet-selection-list/test/tet-selection-list.spec.js +0 -64
- package/dist/collection/components/simple/lists/tet-text-list/test/tet-text-list.spec.js +0 -171
- package/dist/collection/components/simple/menu/tet-menu/test/tet-menu.spec.js +0 -231
- package/dist/collection/components/simple/menu/tet-menu-mobile/test/tet-menu-mobile.spec.js +0 -87
- package/dist/collection/components/simple/menu/tet-navigation-mobile/test/tet-navigation-mobile.spec.js +0 -81
- package/dist/collection/components/simple/structural/tet-accordion/test/tet-accordion.spec.js +0 -108
- package/dist/collection/components/simple/structural/tet-expansion-panel/test/tet-expansion-panel.spec.js +0 -42
- package/dist/collection/components/simple/tables-and-graphs/tet-bar-graph/test/tet-bar-graph.spec.js +0 -85
- package/dist/collection/components/simple/tables-and-graphs/tet-table/test/tet-table.spec.js +0 -360
- package/dist/collection/components/simple/text-blocks/tet-dialog/test/tet-dialog.spec.js +0 -84
- package/dist/collection/components/simple/text-blocks/tet-inline-message/test/tet-inline-message.spec.js +0 -22
- package/dist/collection/components/simple/text-blocks/tet-notification/test/tet-notification.spec.js +0 -88
- package/dist/collection/components/simple/text-blocks/tet-tooltip/test/tet-tooltip.spec.js +0 -79
- package/dist/collection/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/test/tet-b2b-configurator-cart.spec.js +0 -50
- package/dist/collection/components/views/tet-b2b-configurator/test/tet-b2b-configurator.spec.js +0 -136
- package/dist/collection/components/views/tet-business-lines/test/tet-business-lines.spec.js +0 -23
- package/dist/collection/components/views/tet-contact-info/test/tet-contact-info.spec.js +0 -44
- package/dist/collection/components/views/tet-macd-view/test/tet-macd-view.spec.js +0 -498
- package/dist/collection/components/views/tet-price-view/test/tet-price-view.spec.js +0 -98
- package/dist/collection/components/views/tet-thank-you-view/test/tet-thank-you-view.spec.js +0 -275
- package/dist/collection/components/views/tet-thank-you-view-v2/test/tet-thank-you-view-v2.spec.js +0 -175
- package/dist/collection/components/views/tet-thank-you-view-v3/test/tet-thank-you-view-v3.spec.js +0 -175
- package/dist/collection/services/api/async-request.spec.js +0 -37
- package/dist/collection/services/api/request.spec.js +0 -32
- package/dist/collection/services/api/services/address.spec.js +0 -39
- package/dist/collection/services/api/services/catalog/product-comparison.spec.js +0 -22
- package/dist/collection/services/api/services/components/component-data.spec.js +0 -20
- package/dist/collection/services/api/services/customer/assets.spec.js +0 -25
- package/dist/collection/services/api/services/customer/query.spec.js +0 -25
- package/dist/collection/services/api/services/macd/macd.spec.js +0 -91
- package/dist/collection/services/api/services/operations/operations.spec.js +0 -19
- package/dist/collection/services/api/services/tasks.spec.js +0 -25
- package/dist/collection/services/api/services/translations.spec.js +0 -20
- package/dist/collection/services/products/product-codes.spec.js +0 -11
- package/dist/collection/services/translations/translations.spec.js +0 -30
- package/dist/collection/services/url/build-url-params.spec.js +0 -11
- package/dist/collection/services/url/url.spec.js +0 -16
- package/dist/collection/services/utils/array.spec.js +0 -10
- package/dist/collection/services/utils/debounce.spec.js +0 -19
- package/dist/collection/services/utils/execute-until.spec.js +0 -10
- package/dist/collection/services/utils/inertia-scroll.spec.js +0 -56
- package/dist/collection/services/utils/isFocusableElementOrChild.spec.js +0 -67
- package/dist/collection/services/utils/object.spec.js +0 -84
- package/dist/collection/services/utils/price.spec.js +0 -18
- package/dist/collection/services/utils/random.spec.js +0 -10
- package/dist/collection/services/utils/reactive.spec.js +0 -15
- package/dist/collection/services/utils/size.spec.js +0 -13
- package/dist/collection/services/utils/string.spec.js +0 -9
- package/dist/collection/services/utils/throttle.spec.js +0 -32
- package/dist/collection/services/utils/typecheck.spec.js +0 -49
- package/dist/collection/services/validators/validator-group.spec.js +0 -30
- package/dist/collection/services/validators/validators/e-mail.spec.js +0 -20
- package/dist/collection/services/validators/validators/phone.spec.js +0 -23
- package/dist/collection/services/validators/validators/required.spec.js +0 -16
- package/dist/components/p-8e19c5da.js +0 -857
- package/dist/components/p-e34bf267.js +0 -170
- package/dist/esm/compare-cards-tab-products-filters-f0fa0712.js +0 -97
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/tet-components/p-021268b7.entry.js +0 -1
- package/dist/tet-components/p-02e548d5.entry.js +0 -1
- package/dist/tet-components/p-06bf08a4.entry.js +0 -1
- package/dist/tet-components/p-0738afc0.entry.js +0 -1
- package/dist/tet-components/p-1b797a96.entry.js +0 -1
- package/dist/tet-components/p-1be23b32.entry.js +0 -1
- package/dist/tet-components/p-1e840eca.entry.js +0 -1
- package/dist/tet-components/p-1ec7f341.js +0 -2
- package/dist/tet-components/p-2e870f4d.entry.js +0 -1
- package/dist/tet-components/p-2f029068.entry.js +0 -1
- package/dist/tet-components/p-34ed0dd7.entry.js +0 -1
- package/dist/tet-components/p-3604bf21.entry.js +0 -1
- package/dist/tet-components/p-3d2dc872.entry.js +0 -1
- package/dist/tet-components/p-48bd3f87.entry.js +0 -1
- package/dist/tet-components/p-4e3c6172.entry.js +0 -1
- package/dist/tet-components/p-4e917b52.entry.js +0 -1
- package/dist/tet-components/p-511680d5.entry.js +0 -1
- package/dist/tet-components/p-5d920c98.entry.js +0 -1
- package/dist/tet-components/p-618134c3.entry.js +0 -1
- package/dist/tet-components/p-695cdc78.entry.js +0 -1
- package/dist/tet-components/p-6a5eca28.js +0 -1
- package/dist/tet-components/p-71cbde0c.entry.js +0 -1
- package/dist/tet-components/p-7751035d.entry.js +0 -1
- package/dist/tet-components/p-78014763.entry.js +0 -1
- package/dist/tet-components/p-78a0c398.entry.js +0 -1
- package/dist/tet-components/p-79255c00.entry.js +0 -1
- package/dist/tet-components/p-805c9ef3.entry.js +0 -1
- package/dist/tet-components/p-88885ba1.entry.js +0 -1
- package/dist/tet-components/p-8a6831bc.entry.js +0 -1
- package/dist/tet-components/p-8c7c6590.entry.js +0 -1
- package/dist/tet-components/p-8c89d1f5.entry.js +0 -1
- package/dist/tet-components/p-8d644f8b.entry.js +0 -1
- package/dist/tet-components/p-9102c6d9.entry.js +0 -1
- package/dist/tet-components/p-977ea27a.entry.js +0 -1
- package/dist/tet-components/p-9a5b8dbc.entry.js +0 -1
- package/dist/tet-components/p-a15d2b6a.entry.js +0 -1
- package/dist/tet-components/p-a549f1dd.entry.js +0 -1
- package/dist/tet-components/p-a8030923.entry.js +0 -1
- package/dist/tet-components/p-aff1e911.entry.js +0 -1
- package/dist/tet-components/p-b0112dde.entry.js +0 -1
- package/dist/tet-components/p-b14b8531.entry.js +0 -1
- package/dist/tet-components/p-bc2e65ab.entry.js +0 -1
- package/dist/tet-components/p-bfa02c13.entry.js +0 -1
- package/dist/tet-components/p-c4a95bbe.entry.js +0 -1
- package/dist/tet-components/p-c4ed060b.entry.js +0 -1
- package/dist/tet-components/p-ca66b4b1.js +0 -1
- package/dist/tet-components/p-cf7d5c84.js +0 -1
- package/dist/tet-components/p-d0d6a340.js +0 -1
- package/dist/tet-components/p-d2919aae.js +0 -1
- package/dist/tet-components/p-d795f9c3.entry.js +0 -1
- package/dist/tet-components/p-dc12dee9.entry.js +0 -1
- package/dist/tet-components/p-dcbe09b5.js +0 -1
- package/dist/tet-components/p-de040767.entry.js +0 -1
- package/dist/tet-components/p-de4c32ee.entry.js +0 -1
- package/dist/tet-components/p-e423fe76.entry.js +0 -1
- package/dist/tet-components/p-e69056de.entry.js +0 -1
- package/dist/tet-components/p-e86164ef.entry.js +0 -1
- package/dist/tet-components/p-eb66d7b2.js +0 -1
- package/dist/tet-components/p-ecbfde88.entry.js +0 -1
- package/dist/tet-components/p-ed4b8bbe.entry.js +0 -1
- package/dist/tet-components/p-eed7244f.entry.js +0 -1
- package/dist/tet-components/p-f48500fd.entry.js +0 -1
- package/dist/tet-components/p-fab4ab39.entry.js +0 -1
- package/dist/tet-components/p-fd4131ad.entry.js +0 -1
|
@@ -5,620 +5,6 @@ import { debounce, getRemSize } from "../../../../services/utils/index";
|
|
|
5
5
|
*/
|
|
6
6
|
export class TetRangeSlider {
|
|
7
7
|
constructor() {
|
|
8
|
-
/**
|
|
9
|
-
* Slider event handler.
|
|
10
|
-
* Updates progress bar.
|
|
11
|
-
* Calculates `currentValue`.
|
|
12
|
-
*
|
|
13
|
-
* @param event input event.
|
|
14
|
-
*/
|
|
15
|
-
this.onSliderInput = (event) => {
|
|
16
|
-
this.updateProgress();
|
|
17
|
-
const inputValue = parseFloat(event.target.value);
|
|
18
|
-
const closestDataPoint = this.getClosestOriginalDataPoint(inputValue);
|
|
19
|
-
const closestValueIndex = this.dataSet.indexOf(closestDataPoint);
|
|
20
|
-
const originalValue = parseFloat(Object.keys(closestDataPoint)[0]);
|
|
21
|
-
const overrideValue = closestDataPoint[originalValue];
|
|
22
|
-
if (inputValue === originalValue) {
|
|
23
|
-
this.currentValue = overrideValue;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const range = [closestDataPoint];
|
|
27
|
-
if (inputValue < originalValue) {
|
|
28
|
-
range.unshift(this.dataSet[closestValueIndex - 1]);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
range.push(this.dataSet[closestValueIndex + 1]);
|
|
32
|
-
}
|
|
33
|
-
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
34
|
-
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
35
|
-
const originalRange = originalRangeEnd - originalRangeStart;
|
|
36
|
-
const overrideRangeStart = range[0][originalRangeStart];
|
|
37
|
-
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
38
|
-
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
39
|
-
let currentValue = (inputValue - originalRangeStart) * (overrideRange / originalRange) + overrideRangeStart;
|
|
40
|
-
if (currentValue > this.maxValue) {
|
|
41
|
-
currentValue = this.maxValue;
|
|
42
|
-
}
|
|
43
|
-
else if (currentValue < this.minValue) {
|
|
44
|
-
currentValue = this.minValue;
|
|
45
|
-
}
|
|
46
|
-
const decimals = this.getStepDecimals(this.step);
|
|
47
|
-
let snappedValue = Math.round(currentValue / this.step) * this.step;
|
|
48
|
-
snappedValue = parseFloat(snappedValue.toFixed(decimals));
|
|
49
|
-
this.currentValue = snappedValue;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Manual value input event handler.
|
|
53
|
-
* Updates slider position.
|
|
54
|
-
* @param event input event.
|
|
55
|
-
*/
|
|
56
|
-
this.onInputChange = (event) => {
|
|
57
|
-
let inputValue = parseFloat(event.target.value);
|
|
58
|
-
if (Number.isNaN(inputValue)) {
|
|
59
|
-
inputValue = 0;
|
|
60
|
-
}
|
|
61
|
-
if (inputValue > this.inputMaxValue) {
|
|
62
|
-
inputValue = this.inputMaxValue;
|
|
63
|
-
event.target.value = this.inputMaxValue;
|
|
64
|
-
}
|
|
65
|
-
this.setSliderValue(inputValue);
|
|
66
|
-
this.currentValue = inputValue;
|
|
67
|
-
this.updateProgress();
|
|
68
|
-
};
|
|
69
|
-
/** Input keydown event listener.
|
|
70
|
-
* Limits the input range to the defined `minValue` and `maxValue` values when using keyboard to increment values.
|
|
71
|
-
* @param {KeyboardEvent} event
|
|
72
|
-
*/
|
|
73
|
-
this.onInputKeyDown = (event, ignoreHorizontalArrows = false) => {
|
|
74
|
-
const incrementKeyCodes = ['PageUp', 'ArrowUp', 'ArrowRight'];
|
|
75
|
-
const decrementKeyCodes = ['PageDown', 'ArrowDown', 'ArrowLeft'];
|
|
76
|
-
const keycode = event.code;
|
|
77
|
-
if (ignoreHorizontalArrows) {
|
|
78
|
-
incrementKeyCodes.pop();
|
|
79
|
-
decrementKeyCodes.pop();
|
|
80
|
-
}
|
|
81
|
-
if (incrementKeyCodes.includes(keycode)) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
event.stopImmediatePropagation();
|
|
84
|
-
if (this.lockToDataPoint || keycode === 'PageUp') {
|
|
85
|
-
this.onControlNextClick();
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
this.handleSliderArrowKeys('increment');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (decrementKeyCodes.includes(keycode)) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
event.stopImmediatePropagation();
|
|
94
|
-
if (this.lockToDataPoint || keycode === 'PageDown') {
|
|
95
|
-
this.onControlPreviousClick();
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.handleSliderArrowKeys('decrement');
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const keyCodes = incrementKeyCodes.concat(decrementKeyCodes);
|
|
102
|
-
if (keyCodes.includes(keycode)) {
|
|
103
|
-
setTimeout(() => this.sliderChange.emit(this.currentValue));
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* `sliderContainerRef` scroll listener.
|
|
108
|
-
* Updates slider values relative to the container scroll amount.
|
|
109
|
-
*/
|
|
110
|
-
this.onContainerScroll = () => {
|
|
111
|
-
if (this.isSliding) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
this.onSliderChangeDebounce();
|
|
115
|
-
let currentScroll = this.sliderContainerRef.scrollLeft;
|
|
116
|
-
const thumbWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
117
|
-
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
118
|
-
const minScrollLeft = sliderWidth / 2 + thumbWidth / 2;
|
|
119
|
-
const maxScrollLeft = minScrollLeft + sliderWidth - thumbWidth;
|
|
120
|
-
if (currentScroll < minScrollLeft) {
|
|
121
|
-
currentScroll = minScrollLeft;
|
|
122
|
-
}
|
|
123
|
-
if (currentScroll > maxScrollLeft) {
|
|
124
|
-
currentScroll = maxScrollLeft;
|
|
125
|
-
}
|
|
126
|
-
currentScroll = Math.round(currentScroll * 100) / 100;
|
|
127
|
-
this.sliderContainerRef.scrollLeft = currentScroll;
|
|
128
|
-
const scrollRange = maxScrollLeft - minScrollLeft;
|
|
129
|
-
const sliderRange = this.maxValue - this.minValue;
|
|
130
|
-
const currentScrollInRange = currentScroll - minScrollLeft;
|
|
131
|
-
const currentScrollPercent = Math.round((currentScrollInRange / scrollRange) * 1000) / 1000;
|
|
132
|
-
const sliderValue = sliderRange * currentScrollPercent + this.minValue;
|
|
133
|
-
const closestDataPoint = this.getClosestOriginalDataPoint(sliderValue);
|
|
134
|
-
const dataSetIndex = this.dataSet.indexOf(closestDataPoint);
|
|
135
|
-
if (dataSetIndex === 0 && sliderValue < parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
136
|
-
this.currentValue = Object.values(closestDataPoint)[0];
|
|
137
|
-
this.setSliderValue(this.currentValue);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (sliderValue === parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
141
|
-
this.currentValue = Object.values(closestDataPoint)[0];
|
|
142
|
-
this.setSliderValue(this.currentValue);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const range = [closestDataPoint];
|
|
146
|
-
if (sliderValue < parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
147
|
-
range.unshift(this.dataSet[dataSetIndex - 1]);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
range.push(this.dataSet[dataSetIndex + 1]);
|
|
151
|
-
}
|
|
152
|
-
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
153
|
-
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
154
|
-
const originalRange = originalRangeEnd - originalRangeStart;
|
|
155
|
-
const overrideRangeStart = range[0][originalRangeStart];
|
|
156
|
-
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
157
|
-
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
158
|
-
const currentValue = (sliderValue - originalRangeStart) * (overrideRange / originalRange) + overrideRangeStart;
|
|
159
|
-
this.currentValue = Math.round(currentValue);
|
|
160
|
-
this.setSliderValue(this.currentValue);
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Manual value input blur event handler.
|
|
164
|
-
* Checks whether the input is within the range of the slider.
|
|
165
|
-
* Updates the slider position and input value if the entered value is out of range.
|
|
166
|
-
* @param event blur event.
|
|
167
|
-
*/
|
|
168
|
-
this.onInputBlur = (event) => {
|
|
169
|
-
let inputValue = parseFloat(event.target.value);
|
|
170
|
-
if (Number.isNaN(inputValue)) {
|
|
171
|
-
inputValue = this.minValue;
|
|
172
|
-
}
|
|
173
|
-
const dataSet = JSON.parse(JSON.stringify(this.dataSet));
|
|
174
|
-
const firstDataPoint = dataSet.shift();
|
|
175
|
-
const lastDataPoint = dataSet.pop();
|
|
176
|
-
if (inputValue < firstDataPoint[this.minValue]) {
|
|
177
|
-
this.currentValue = firstDataPoint[this.minValue];
|
|
178
|
-
this.sliderRef.value = Object.keys(firstDataPoint)[0];
|
|
179
|
-
this.setInputValue(firstDataPoint[this.minValue]);
|
|
180
|
-
}
|
|
181
|
-
const maxInputValue = Math.max(this.inputMaxValue, lastDataPoint[this.maxValue]);
|
|
182
|
-
if (inputValue > maxInputValue) {
|
|
183
|
-
this.currentValue = maxInputValue;
|
|
184
|
-
this.sliderRef.value = Object.keys(lastDataPoint)[0];
|
|
185
|
-
this.setInputValue(maxInputValue);
|
|
186
|
-
}
|
|
187
|
-
this.updateProgress();
|
|
188
|
-
this.sliderChange.emit(this.currentValue);
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Slider change event handler.
|
|
192
|
-
* Depending on `lockToDataPoint` flag changes the slider value to the closest data point or emits `slider-change` event.
|
|
193
|
-
*/
|
|
194
|
-
this.onSliderChange = () => {
|
|
195
|
-
if (this.lockToDataPoint) {
|
|
196
|
-
this.slideToClosestDataPoint();
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
this.sliderChange.emit(this.currentValue);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
/** Debounced slider change event. */
|
|
203
|
-
this.onSliderChangeDebounce = debounce(this.onSliderChange, 50);
|
|
204
|
-
/**
|
|
205
|
-
* Control previous button handler.
|
|
206
|
-
*/
|
|
207
|
-
this.onControlPreviousClick = () => {
|
|
208
|
-
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
209
|
-
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
210
|
-
const dataPointIndex = this.dataSet.indexOf(closestDataPoint);
|
|
211
|
-
let previousDataPoint = this.dataSet[dataPointIndex - 1];
|
|
212
|
-
if (dataPointIndex === 0) {
|
|
213
|
-
previousDataPoint = closestDataPoint;
|
|
214
|
-
}
|
|
215
|
-
if (this.currentValue > closestDataPointValue) {
|
|
216
|
-
previousDataPoint = closestDataPoint;
|
|
217
|
-
}
|
|
218
|
-
const previousDataPointValue = Object.values(previousDataPoint)[0];
|
|
219
|
-
this.currentValue = previousDataPointValue;
|
|
220
|
-
this.setSliderValue(previousDataPointValue);
|
|
221
|
-
this.updateProgress();
|
|
222
|
-
this.scrollToThumbCenter();
|
|
223
|
-
this.sliderChange.emit(this.currentValue);
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* Control next button handler.
|
|
227
|
-
*/
|
|
228
|
-
this.onControlNextClick = () => {
|
|
229
|
-
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
230
|
-
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
231
|
-
const dataPointIndex = this.dataSet.indexOf(closestDataPoint);
|
|
232
|
-
let nextDataPoint = this.dataSet[dataPointIndex + 1];
|
|
233
|
-
if (dataPointIndex + 1 === this.dataSet.length) {
|
|
234
|
-
nextDataPoint = closestDataPoint;
|
|
235
|
-
}
|
|
236
|
-
if (this.currentValue < closestDataPointValue) {
|
|
237
|
-
nextDataPoint = closestDataPoint;
|
|
238
|
-
}
|
|
239
|
-
const nextDataPointValue = Object.values(nextDataPoint)[0];
|
|
240
|
-
this.currentValue = nextDataPointValue;
|
|
241
|
-
this.setSliderValue(nextDataPointValue);
|
|
242
|
-
this.updateProgress();
|
|
243
|
-
this.scrollToThumbCenter();
|
|
244
|
-
this.sliderChange.emit(this.currentValue);
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* Slider pointer down event handler.
|
|
248
|
-
*/
|
|
249
|
-
this.onSliderPointerDown = () => {
|
|
250
|
-
this.animateSliderThumb('normal');
|
|
251
|
-
};
|
|
252
|
-
/**
|
|
253
|
-
* Slider pointer up event handler.
|
|
254
|
-
*/
|
|
255
|
-
this.onSliderPointerUp = () => {
|
|
256
|
-
this.animateSliderThumb('reverse');
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Container touch start event handler.
|
|
260
|
-
*/
|
|
261
|
-
this.onContainerTouchStart = () => {
|
|
262
|
-
this.isPointerDown = true;
|
|
263
|
-
this.animateSliderThumb('normal');
|
|
264
|
-
};
|
|
265
|
-
/**
|
|
266
|
-
* Container touch end event handler.
|
|
267
|
-
*/
|
|
268
|
-
this.onContainerTouchEnd = () => {
|
|
269
|
-
this.isPointerDown = false;
|
|
270
|
-
this.animateSliderThumb('reverse');
|
|
271
|
-
this.onSliderChangeDebounce();
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* Initialises the mouse drag.
|
|
275
|
-
* @param {MouseEvent} e Current mouse event.
|
|
276
|
-
*/
|
|
277
|
-
this.onContainerMouseDown = (e) => {
|
|
278
|
-
if (this.type !== 'secondary' || this.containerSize !== 'small') {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
this.isPointerDown = true;
|
|
282
|
-
this.positions = {
|
|
283
|
-
scrollLeft: this.sliderContainerRef.scrollLeft,
|
|
284
|
-
mouseX: e.clientX,
|
|
285
|
-
};
|
|
286
|
-
this.element.addEventListener('mousemove', this.onContainerMouseMove);
|
|
287
|
-
this.element.addEventListener('mouseup', this.onContainerMouseUp);
|
|
288
|
-
this.element.addEventListener('mouseleave', this.onContainerMouseUp);
|
|
289
|
-
this.animateSliderThumb('normal');
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* Scrolls the `sliderContainerRef` on mouse drag.
|
|
293
|
-
* @param {MouseEvent} e Current mouse event.
|
|
294
|
-
*/
|
|
295
|
-
this.onContainerMouseMove = (e) => {
|
|
296
|
-
e.preventDefault();
|
|
297
|
-
const mouseButton = e.buttons;
|
|
298
|
-
this.isPointerDown = mouseButton === 1;
|
|
299
|
-
if (!this.isPointerDown) {
|
|
300
|
-
this.onContainerMouseUp();
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const deltaX = e.clientX - this.positions.mouseX;
|
|
304
|
-
this.sliderContainerRef.scrollTo(this.positions.scrollLeft - deltaX, 0);
|
|
305
|
-
};
|
|
306
|
-
/**
|
|
307
|
-
* Removes mouse drag events.
|
|
308
|
-
*/
|
|
309
|
-
this.onContainerMouseUp = () => {
|
|
310
|
-
this.isPointerDown = false;
|
|
311
|
-
this.element.removeEventListener('mousemove', this.onContainerMouseMove);
|
|
312
|
-
this.element.removeEventListener('mouseup', this.onContainerMouseUp);
|
|
313
|
-
this.element.removeEventListener('mouseleave', this.onContainerMouseUp);
|
|
314
|
-
this.animateSliderThumb('reverse');
|
|
315
|
-
this.onSliderChangeDebounce();
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* Updates the progress track of the slider.
|
|
319
|
-
*/
|
|
320
|
-
this.updateProgress = () => {
|
|
321
|
-
const progressTrack = this.progressTrackRef;
|
|
322
|
-
if (progressTrack === undefined) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
let percent = this.getSliderPercent();
|
|
326
|
-
if (percent < 50) {
|
|
327
|
-
percent += 0.5;
|
|
328
|
-
}
|
|
329
|
-
progressTrack.style.width = percent + '%';
|
|
330
|
-
this.updateTooltipHandlePosition();
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Updates the `tooltipHandleRef` position to mimick the sliders thumb position.
|
|
334
|
-
*/
|
|
335
|
-
this.updateTooltipHandlePosition = () => {
|
|
336
|
-
const percent = this.getSliderPercent();
|
|
337
|
-
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
338
|
-
const tooltipHandleWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
339
|
-
const positionLeft = (sliderWidth - tooltipHandleWidth) * (percent / 100) +
|
|
340
|
-
this.sliderRef.getBoundingClientRect().left -
|
|
341
|
-
this.element.getBoundingClientRect().left;
|
|
342
|
-
this.tooltipHandleRef.style.left = `${positionLeft}px`;
|
|
343
|
-
const handlePosition = this.tooltipHandleRef.getBoundingClientRect().x;
|
|
344
|
-
const handlePositionLeftRem = handlePosition / getRemSize();
|
|
345
|
-
const windowWidth = window.innerWidth;
|
|
346
|
-
const handlePositionRight = (windowWidth - handlePosition - tooltipHandleWidth) / getRemSize();
|
|
347
|
-
let tooltipOffset = 0;
|
|
348
|
-
if (handlePositionLeftRem < 1) {
|
|
349
|
-
tooltipOffset = 2;
|
|
350
|
-
}
|
|
351
|
-
else if (handlePositionLeftRem < 3) {
|
|
352
|
-
tooltipOffset = 3 - handlePositionLeftRem;
|
|
353
|
-
}
|
|
354
|
-
else if (handlePositionRight < 1) {
|
|
355
|
-
tooltipOffset = -2;
|
|
356
|
-
}
|
|
357
|
-
else if (handlePositionRight < 3) {
|
|
358
|
-
tooltipOffset = (3 - handlePositionRight) * -1;
|
|
359
|
-
}
|
|
360
|
-
this.tooltipOffset = tooltipOffset;
|
|
361
|
-
};
|
|
362
|
-
/**
|
|
363
|
-
* Gets the closest display value from the `dataSet`.
|
|
364
|
-
* @param value the value to check against. `currentValue` by default.
|
|
365
|
-
*/
|
|
366
|
-
this.getClosestOverrideDataPoint = (value = this.currentValue) => {
|
|
367
|
-
return this.dataSet.reduce(function (prev, curr) {
|
|
368
|
-
return Math.abs(Object.values(curr)[0] - value) < Math.abs(Object.values(prev)[0] - value) ? curr : prev;
|
|
369
|
-
});
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* Gets the closest slider value from the `dataSet`.
|
|
373
|
-
* @param value the value to check against.
|
|
374
|
-
*/
|
|
375
|
-
this.getClosestOriginalDataPoint = (value) => {
|
|
376
|
-
return this.dataSet.reduce(function (prev, curr) {
|
|
377
|
-
return Math.abs(parseFloat(Object.keys(curr)[0]) - value) < Math.abs(parseFloat(Object.keys(prev)[0]) - value)
|
|
378
|
-
? curr
|
|
379
|
-
: prev;
|
|
380
|
-
});
|
|
381
|
-
};
|
|
382
|
-
/**
|
|
383
|
-
* Gets the current percent of the thumb position relative to the slider width.
|
|
384
|
-
* @returns {number}
|
|
385
|
-
*/
|
|
386
|
-
this.getSliderPercent = () => {
|
|
387
|
-
const slider = this.sliderRef;
|
|
388
|
-
if (slider === null) {
|
|
389
|
-
return 0;
|
|
390
|
-
}
|
|
391
|
-
const range = this.maxValue - this.minValue;
|
|
392
|
-
const absoluteValue = parseFloat(slider.value) - this.minValue;
|
|
393
|
-
const sliderPercent = (absoluteValue / range) * 100;
|
|
394
|
-
return sliderPercent;
|
|
395
|
-
};
|
|
396
|
-
/**
|
|
397
|
-
* Gets the current display value for the toolip.
|
|
398
|
-
* @returns The display value for the tooltip.
|
|
399
|
-
*/
|
|
400
|
-
this.getTooltipValue = () => {
|
|
401
|
-
if (this.type === 'secondary') {
|
|
402
|
-
return `${Object.values(this.getClosestOverrideDataPoint())[0]} ${this.dataUnits}`;
|
|
403
|
-
}
|
|
404
|
-
let tooltipValue = this.currentValue;
|
|
405
|
-
if (this.currentValue < this.minValue) {
|
|
406
|
-
tooltipValue = this.minValue;
|
|
407
|
-
}
|
|
408
|
-
if (this.currentValue > this.maxValue) {
|
|
409
|
-
tooltipValue = this.maxValue;
|
|
410
|
-
}
|
|
411
|
-
return `${tooltipValue} ${this.dataUnits}`;
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* Converts the display value of the slider to a slider value and updates slider position.
|
|
415
|
-
* @param value the display value.
|
|
416
|
-
*/
|
|
417
|
-
this.setSliderValue = (value) => {
|
|
418
|
-
if (Number.isNaN(value)) {
|
|
419
|
-
value = this.minValue;
|
|
420
|
-
}
|
|
421
|
-
const dataSet = JSON.parse(JSON.stringify(this.dataSet));
|
|
422
|
-
const firstDataPoint = dataSet.shift();
|
|
423
|
-
const lastDataPoint = dataSet.pop();
|
|
424
|
-
if (value < firstDataPoint[this.minValue]) {
|
|
425
|
-
this.sliderRef.value = this.minValue.toString();
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
if (value > lastDataPoint[this.maxValue]) {
|
|
429
|
-
this.sliderRef.value = this.maxValue.toString();
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
const closestDataPoint = this.getClosestOverrideDataPoint(value);
|
|
433
|
-
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
434
|
-
if (value === closestDataPointValue) {
|
|
435
|
-
this.sliderRef.value = Object.keys(closestDataPoint)[0];
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const dataSetIndex = this.dataSet.indexOf(closestDataPoint);
|
|
439
|
-
const range = [closestDataPoint];
|
|
440
|
-
if (value < closestDataPointValue) {
|
|
441
|
-
range.unshift(this.dataSet[dataSetIndex - 1]);
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
range.push(this.dataSet[dataSetIndex + 1]);
|
|
445
|
-
}
|
|
446
|
-
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
447
|
-
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
448
|
-
const originalRange = originalRangeEnd - originalRangeStart;
|
|
449
|
-
const overrideRangeStart = range[0][originalRangeStart];
|
|
450
|
-
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
451
|
-
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
452
|
-
const sliderValue = (value - overrideRangeStart) * (originalRange / overrideRange) + originalRangeStart;
|
|
453
|
-
this.sliderRef.value = sliderValue.toString();
|
|
454
|
-
};
|
|
455
|
-
/**
|
|
456
|
-
* Sets `containerSize` state depending on `element` width.
|
|
457
|
-
* Sets `sliderContainerRef` overflow style depending on `type` and `containerSize` states.
|
|
458
|
-
*/
|
|
459
|
-
this.autoSetContainerSize = () => {
|
|
460
|
-
if (this.size !== 'auto') {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
let containerWidth = 0;
|
|
464
|
-
if (this.parentContainer.hasOwnProperty('innerWidth')) {
|
|
465
|
-
containerWidth = this.parentContainer.innerWidth;
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
containerWidth = this.parentContainer.getBoundingClientRect().width;
|
|
469
|
-
}
|
|
470
|
-
if (containerWidth >= 1024) {
|
|
471
|
-
this.containerSize = 'large';
|
|
472
|
-
}
|
|
473
|
-
else if (containerWidth >= 768) {
|
|
474
|
-
this.containerSize = 'medium';
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
this.containerSize = 'small';
|
|
478
|
-
}
|
|
479
|
-
if (this.sliderContainerRef === undefined) {
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
if (this.type === 'secondary' && this.containerSize === 'small') {
|
|
483
|
-
this.sliderContainerRef.style.overflowX = 'scroll';
|
|
484
|
-
setTimeout(this.scrollToThumbCenter, 50);
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
this.sliderContainerRef.style.overflowX = 'unset';
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
/**
|
|
491
|
-
* Sets the manual input value.
|
|
492
|
-
* @param value number to be displayed in the input.
|
|
493
|
-
*/
|
|
494
|
-
this.setInputValue = (value) => {
|
|
495
|
-
this.inputRef.value = value.toString();
|
|
496
|
-
};
|
|
497
|
-
/**
|
|
498
|
-
* Gradually sets the slider value until it matches the closest `dataPoint` entry.
|
|
499
|
-
* Sets `isSliding` state.
|
|
500
|
-
*/
|
|
501
|
-
this.slideToClosestDataPoint = () => {
|
|
502
|
-
if (this.isPointerDown) {
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
506
|
-
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
507
|
-
this.isSliding = true;
|
|
508
|
-
const interval = setInterval(() => {
|
|
509
|
-
const valueDelta = Math.abs(closestDataPointValue - this.currentValue);
|
|
510
|
-
this.scrollToThumbCenter();
|
|
511
|
-
if (!valueDelta) {
|
|
512
|
-
clearInterval(interval);
|
|
513
|
-
this.sliderChange.emit(this.currentValue);
|
|
514
|
-
setTimeout(() => {
|
|
515
|
-
this.isSliding = false;
|
|
516
|
-
}, 50);
|
|
517
|
-
}
|
|
518
|
-
if (valueDelta < 5) {
|
|
519
|
-
this.currentValue = closestDataPointValue;
|
|
520
|
-
this.setSliderValue(closestDataPointValue);
|
|
521
|
-
this.updateProgress();
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
let changeBy = 5;
|
|
525
|
-
if (valueDelta > 100) {
|
|
526
|
-
changeBy = 10;
|
|
527
|
-
}
|
|
528
|
-
if (this.currentValue > closestDataPointValue) {
|
|
529
|
-
this.currentValue = this.currentValue - changeBy;
|
|
530
|
-
this.setSliderValue(this.currentValue);
|
|
531
|
-
}
|
|
532
|
-
if (this.currentValue < closestDataPointValue) {
|
|
533
|
-
this.currentValue = this.currentValue + changeBy;
|
|
534
|
-
this.setSliderValue(this.currentValue);
|
|
535
|
-
}
|
|
536
|
-
this.updateProgress();
|
|
537
|
-
}, 1);
|
|
538
|
-
};
|
|
539
|
-
/**
|
|
540
|
-
* Calculates the `dataSet` state from the provided `dataPoints`.
|
|
541
|
-
*/
|
|
542
|
-
this.calculateDataSet = () => {
|
|
543
|
-
const dataSteps = this.dataPoints.length ? this.dataPoints.length : 2;
|
|
544
|
-
const dataPoints = this.dataPoints.length ? this.dataPoints : [this.minValue, this.maxValue];
|
|
545
|
-
const inputRange = this.maxValue - this.minValue;
|
|
546
|
-
const increment = inputRange / (dataSteps - 1);
|
|
547
|
-
this.dataSet.length = 0;
|
|
548
|
-
for (let index = 0; index < dataSteps; index++) {
|
|
549
|
-
this.dataSet.push({ [increment * index + this.minValue]: dataPoints[index] });
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
/**
|
|
553
|
-
* Scrolls `sliderContainerRef` to place slider thumb in the center of the screen.
|
|
554
|
-
*/
|
|
555
|
-
this.scrollToThumbCenter = () => {
|
|
556
|
-
if (this.type !== 'secondary' || this.containerSize !== 'small') {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
560
|
-
const thumbWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
561
|
-
const minScrollLeft = sliderWidth / 2 + thumbWidth / 2;
|
|
562
|
-
const maxScrollLeft = minScrollLeft + sliderWidth - thumbWidth;
|
|
563
|
-
const scrollRange = maxScrollLeft - minScrollLeft;
|
|
564
|
-
const sliderPercent = this.getSliderPercent();
|
|
565
|
-
this.sliderContainerRef.scrollLeft = minScrollLeft + (scrollRange * sliderPercent) / 100;
|
|
566
|
-
};
|
|
567
|
-
/**
|
|
568
|
-
* Animates the shadows of the slider thumb.
|
|
569
|
-
* @param {PlaybackDirection} direction sets the animation direction.
|
|
570
|
-
*/
|
|
571
|
-
this.animateSliderThumb = (direction) => {
|
|
572
|
-
const shadowDefault = getComputedStyle(this.element).getPropertyValue('--slider-thumb-shadow');
|
|
573
|
-
const shadowActive = getComputedStyle(this.element).getPropertyValue('--slider-thumb-active-shadow');
|
|
574
|
-
if (direction === 'normal') {
|
|
575
|
-
this.tooltipHandleRef.classList.add('range-slider__tooltip-handle--active');
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
this.tooltipHandleRef.classList.remove('range-slider__tooltip-handle--active');
|
|
579
|
-
}
|
|
580
|
-
this.tooltipHandleRef.animate([{ boxShadow: shadowDefault }, { boxShadow: 'none' }, { boxShadow: shadowActive }], {
|
|
581
|
-
duration: 300,
|
|
582
|
-
direction,
|
|
583
|
-
});
|
|
584
|
-
};
|
|
585
|
-
/** Renders a tick mark. */
|
|
586
|
-
this.renderTick = () => {
|
|
587
|
-
let tick = document.createElement('span');
|
|
588
|
-
tick.className = 'range-slider__tick';
|
|
589
|
-
this.tickContainerRef.appendChild(tick);
|
|
590
|
-
};
|
|
591
|
-
/** Renders data labels. */
|
|
592
|
-
this.renderDataLabels = () => {
|
|
593
|
-
const inputRange = this.maxValue - this.minValue;
|
|
594
|
-
this.dataLabelRef.innerHTML = '';
|
|
595
|
-
this.tickContainerRef.innerHTML = '';
|
|
596
|
-
for (const dataLabel of this.dataSet) {
|
|
597
|
-
const position = parseFloat(Object.keys(dataLabel)[0]);
|
|
598
|
-
const label = Object.values(dataLabel)[0];
|
|
599
|
-
const absolutePosition = position - this.minValue;
|
|
600
|
-
const relativePosition = (absolutePosition / inputRange) * 100;
|
|
601
|
-
this.renderTick();
|
|
602
|
-
if (this.displayDataPoints.length && !this.displayDataPoints.includes(label)) {
|
|
603
|
-
continue;
|
|
604
|
-
}
|
|
605
|
-
this.dataLabelRef.appendChild(this.renderDataLabel(label.toString(), relativePosition));
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
/**
|
|
609
|
-
* Creates a data label node.
|
|
610
|
-
* @param label data label to be displayed.
|
|
611
|
-
* @param position position relative to the slider container.
|
|
612
|
-
* @returns {HTMLElement} representing data label.
|
|
613
|
-
*/
|
|
614
|
-
this.renderDataLabel = (label, position) => {
|
|
615
|
-
const dataListItem = document.createElement('span');
|
|
616
|
-
const valueNode = document.createTextNode(label);
|
|
617
|
-
dataListItem.appendChild(valueNode);
|
|
618
|
-
dataListItem.classList.add('range-slider__data-label');
|
|
619
|
-
dataListItem.style.left = `calc(${position}% - 1.5rem)`;
|
|
620
|
-
return dataListItem;
|
|
621
|
-
};
|
|
622
8
|
this.parentContainer = null;
|
|
623
9
|
this.minValue = 1;
|
|
624
10
|
this.maxValue = 500;
|
|
@@ -647,6 +33,19 @@ export class TetRangeSlider {
|
|
|
647
33
|
this.isPointerDown = false;
|
|
648
34
|
this.positions = { scrollLeft: 0, mouseX: 0 };
|
|
649
35
|
}
|
|
36
|
+
inputRef;
|
|
37
|
+
sliderRef;
|
|
38
|
+
sliderContainerRef;
|
|
39
|
+
dataLabelRef;
|
|
40
|
+
tickContainerRef;
|
|
41
|
+
progressTrackRef;
|
|
42
|
+
tooltipHandleRef;
|
|
43
|
+
sliderResizeObserver;
|
|
44
|
+
element;
|
|
45
|
+
/** The event that is emitted on slider input. */
|
|
46
|
+
sliderInput;
|
|
47
|
+
/** The event that is emitted on slider change. */
|
|
48
|
+
sliderChange;
|
|
650
49
|
/**
|
|
651
50
|
* Watches for `dataPoints` mutations and updates `dataSet` and re-renders data labels.
|
|
652
51
|
*/
|
|
@@ -683,6 +82,315 @@ export class TetRangeSlider {
|
|
|
683
82
|
this.containerSize = size;
|
|
684
83
|
}
|
|
685
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Slider event handler.
|
|
87
|
+
* Updates progress bar.
|
|
88
|
+
* Calculates `currentValue`.
|
|
89
|
+
*
|
|
90
|
+
* @param event input event.
|
|
91
|
+
*/
|
|
92
|
+
onSliderInput = (event) => {
|
|
93
|
+
this.updateProgress();
|
|
94
|
+
const inputValue = parseFloat(event.target.value);
|
|
95
|
+
const closestDataPoint = this.getClosestOriginalDataPoint(inputValue);
|
|
96
|
+
const closestValueIndex = this.dataSet.indexOf(closestDataPoint);
|
|
97
|
+
const originalValue = parseFloat(Object.keys(closestDataPoint)[0]);
|
|
98
|
+
const overrideValue = closestDataPoint[originalValue];
|
|
99
|
+
if (inputValue === originalValue) {
|
|
100
|
+
this.currentValue = overrideValue;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const range = [closestDataPoint];
|
|
104
|
+
if (inputValue < originalValue) {
|
|
105
|
+
range.unshift(this.dataSet[closestValueIndex - 1]);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
range.push(this.dataSet[closestValueIndex + 1]);
|
|
109
|
+
}
|
|
110
|
+
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
111
|
+
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
112
|
+
const originalRange = originalRangeEnd - originalRangeStart;
|
|
113
|
+
const overrideRangeStart = range[0][originalRangeStart];
|
|
114
|
+
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
115
|
+
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
116
|
+
let currentValue = (inputValue - originalRangeStart) * (overrideRange / originalRange) + overrideRangeStart;
|
|
117
|
+
if (currentValue > this.maxValue) {
|
|
118
|
+
currentValue = this.maxValue;
|
|
119
|
+
}
|
|
120
|
+
else if (currentValue < this.minValue) {
|
|
121
|
+
currentValue = this.minValue;
|
|
122
|
+
}
|
|
123
|
+
const decimals = this.getStepDecimals(this.step);
|
|
124
|
+
let snappedValue = Math.round(currentValue / this.step) * this.step;
|
|
125
|
+
snappedValue = parseFloat(snappedValue.toFixed(decimals));
|
|
126
|
+
this.currentValue = snappedValue;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Manual value input event handler.
|
|
130
|
+
* Updates slider position.
|
|
131
|
+
* @param event input event.
|
|
132
|
+
*/
|
|
133
|
+
onInputChange = (event) => {
|
|
134
|
+
let inputValue = parseFloat(event.target.value);
|
|
135
|
+
if (Number.isNaN(inputValue)) {
|
|
136
|
+
inputValue = 0;
|
|
137
|
+
}
|
|
138
|
+
if (inputValue > this.inputMaxValue) {
|
|
139
|
+
inputValue = this.inputMaxValue;
|
|
140
|
+
event.target.value = this.inputMaxValue;
|
|
141
|
+
}
|
|
142
|
+
this.setSliderValue(inputValue);
|
|
143
|
+
this.currentValue = inputValue;
|
|
144
|
+
this.updateProgress();
|
|
145
|
+
};
|
|
146
|
+
/** Input keydown event listener.
|
|
147
|
+
* Limits the input range to the defined `minValue` and `maxValue` values when using keyboard to increment values.
|
|
148
|
+
* @param {KeyboardEvent} event
|
|
149
|
+
*/
|
|
150
|
+
onInputKeyDown = (event, ignoreHorizontalArrows = false) => {
|
|
151
|
+
const incrementKeyCodes = ['PageUp', 'ArrowUp', 'ArrowRight'];
|
|
152
|
+
const decrementKeyCodes = ['PageDown', 'ArrowDown', 'ArrowLeft'];
|
|
153
|
+
const keycode = event.code;
|
|
154
|
+
if (ignoreHorizontalArrows) {
|
|
155
|
+
incrementKeyCodes.pop();
|
|
156
|
+
decrementKeyCodes.pop();
|
|
157
|
+
}
|
|
158
|
+
if (incrementKeyCodes.includes(keycode)) {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
event.stopImmediatePropagation();
|
|
161
|
+
if (this.lockToDataPoint || keycode === 'PageUp') {
|
|
162
|
+
this.onControlNextClick();
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this.handleSliderArrowKeys('increment');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (decrementKeyCodes.includes(keycode)) {
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
event.stopImmediatePropagation();
|
|
171
|
+
if (this.lockToDataPoint || keycode === 'PageDown') {
|
|
172
|
+
this.onControlPreviousClick();
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.handleSliderArrowKeys('decrement');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const keyCodes = incrementKeyCodes.concat(decrementKeyCodes);
|
|
179
|
+
if (keyCodes.includes(keycode)) {
|
|
180
|
+
setTimeout(() => this.sliderChange.emit(this.currentValue));
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* `sliderContainerRef` scroll listener.
|
|
185
|
+
* Updates slider values relative to the container scroll amount.
|
|
186
|
+
*/
|
|
187
|
+
onContainerScroll = () => {
|
|
188
|
+
if (this.isSliding) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this.onSliderChangeDebounce();
|
|
192
|
+
let currentScroll = this.sliderContainerRef.scrollLeft;
|
|
193
|
+
const thumbWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
194
|
+
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
195
|
+
const minScrollLeft = sliderWidth / 2 + thumbWidth / 2;
|
|
196
|
+
const maxScrollLeft = minScrollLeft + sliderWidth - thumbWidth;
|
|
197
|
+
if (currentScroll < minScrollLeft) {
|
|
198
|
+
currentScroll = minScrollLeft;
|
|
199
|
+
}
|
|
200
|
+
if (currentScroll > maxScrollLeft) {
|
|
201
|
+
currentScroll = maxScrollLeft;
|
|
202
|
+
}
|
|
203
|
+
currentScroll = Math.round(currentScroll * 100) / 100;
|
|
204
|
+
this.sliderContainerRef.scrollLeft = currentScroll;
|
|
205
|
+
const scrollRange = maxScrollLeft - minScrollLeft;
|
|
206
|
+
const sliderRange = this.maxValue - this.minValue;
|
|
207
|
+
const currentScrollInRange = currentScroll - minScrollLeft;
|
|
208
|
+
const currentScrollPercent = Math.round((currentScrollInRange / scrollRange) * 1000) / 1000;
|
|
209
|
+
const sliderValue = sliderRange * currentScrollPercent + this.minValue;
|
|
210
|
+
const closestDataPoint = this.getClosestOriginalDataPoint(sliderValue);
|
|
211
|
+
const dataSetIndex = this.dataSet.indexOf(closestDataPoint);
|
|
212
|
+
if (dataSetIndex === 0 && sliderValue < parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
213
|
+
this.currentValue = Object.values(closestDataPoint)[0];
|
|
214
|
+
this.setSliderValue(this.currentValue);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (sliderValue === parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
218
|
+
this.currentValue = Object.values(closestDataPoint)[0];
|
|
219
|
+
this.setSliderValue(this.currentValue);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const range = [closestDataPoint];
|
|
223
|
+
if (sliderValue < parseFloat(Object.keys(closestDataPoint)[0])) {
|
|
224
|
+
range.unshift(this.dataSet[dataSetIndex - 1]);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
range.push(this.dataSet[dataSetIndex + 1]);
|
|
228
|
+
}
|
|
229
|
+
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
230
|
+
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
231
|
+
const originalRange = originalRangeEnd - originalRangeStart;
|
|
232
|
+
const overrideRangeStart = range[0][originalRangeStart];
|
|
233
|
+
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
234
|
+
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
235
|
+
const currentValue = (sliderValue - originalRangeStart) * (overrideRange / originalRange) + overrideRangeStart;
|
|
236
|
+
this.currentValue = Math.round(currentValue);
|
|
237
|
+
this.setSliderValue(this.currentValue);
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Manual value input blur event handler.
|
|
241
|
+
* Checks whether the input is within the range of the slider.
|
|
242
|
+
* Updates the slider position and input value if the entered value is out of range.
|
|
243
|
+
* @param event blur event.
|
|
244
|
+
*/
|
|
245
|
+
onInputBlur = (event) => {
|
|
246
|
+
let inputValue = parseFloat(event.target.value);
|
|
247
|
+
if (Number.isNaN(inputValue)) {
|
|
248
|
+
inputValue = this.minValue;
|
|
249
|
+
}
|
|
250
|
+
const dataSet = JSON.parse(JSON.stringify(this.dataSet));
|
|
251
|
+
const firstDataPoint = dataSet.shift();
|
|
252
|
+
const lastDataPoint = dataSet.pop();
|
|
253
|
+
if (inputValue < firstDataPoint[this.minValue]) {
|
|
254
|
+
this.currentValue = firstDataPoint[this.minValue];
|
|
255
|
+
this.sliderRef.value = Object.keys(firstDataPoint)[0];
|
|
256
|
+
this.setInputValue(firstDataPoint[this.minValue]);
|
|
257
|
+
}
|
|
258
|
+
const maxInputValue = Math.max(this.inputMaxValue, lastDataPoint[this.maxValue]);
|
|
259
|
+
if (inputValue > maxInputValue) {
|
|
260
|
+
this.currentValue = maxInputValue;
|
|
261
|
+
this.sliderRef.value = Object.keys(lastDataPoint)[0];
|
|
262
|
+
this.setInputValue(maxInputValue);
|
|
263
|
+
}
|
|
264
|
+
this.updateProgress();
|
|
265
|
+
this.sliderChange.emit(this.currentValue);
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Slider change event handler.
|
|
269
|
+
* Depending on `lockToDataPoint` flag changes the slider value to the closest data point or emits `slider-change` event.
|
|
270
|
+
*/
|
|
271
|
+
onSliderChange = () => {
|
|
272
|
+
if (this.lockToDataPoint) {
|
|
273
|
+
this.slideToClosestDataPoint();
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
this.sliderChange.emit(this.currentValue);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
/** Debounced slider change event. */
|
|
280
|
+
onSliderChangeDebounce = debounce(this.onSliderChange, 50);
|
|
281
|
+
/**
|
|
282
|
+
* Control previous button handler.
|
|
283
|
+
*/
|
|
284
|
+
onControlPreviousClick = () => {
|
|
285
|
+
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
286
|
+
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
287
|
+
const dataPointIndex = this.dataSet.indexOf(closestDataPoint);
|
|
288
|
+
let previousDataPoint = this.dataSet[dataPointIndex - 1];
|
|
289
|
+
if (dataPointIndex === 0) {
|
|
290
|
+
previousDataPoint = closestDataPoint;
|
|
291
|
+
}
|
|
292
|
+
if (this.currentValue > closestDataPointValue) {
|
|
293
|
+
previousDataPoint = closestDataPoint;
|
|
294
|
+
}
|
|
295
|
+
const previousDataPointValue = Object.values(previousDataPoint)[0];
|
|
296
|
+
this.currentValue = previousDataPointValue;
|
|
297
|
+
this.setSliderValue(previousDataPointValue);
|
|
298
|
+
this.updateProgress();
|
|
299
|
+
this.scrollToThumbCenter();
|
|
300
|
+
this.sliderChange.emit(this.currentValue);
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Control next button handler.
|
|
304
|
+
*/
|
|
305
|
+
onControlNextClick = () => {
|
|
306
|
+
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
307
|
+
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
308
|
+
const dataPointIndex = this.dataSet.indexOf(closestDataPoint);
|
|
309
|
+
let nextDataPoint = this.dataSet[dataPointIndex + 1];
|
|
310
|
+
if (dataPointIndex + 1 === this.dataSet.length) {
|
|
311
|
+
nextDataPoint = closestDataPoint;
|
|
312
|
+
}
|
|
313
|
+
if (this.currentValue < closestDataPointValue) {
|
|
314
|
+
nextDataPoint = closestDataPoint;
|
|
315
|
+
}
|
|
316
|
+
const nextDataPointValue = Object.values(nextDataPoint)[0];
|
|
317
|
+
this.currentValue = nextDataPointValue;
|
|
318
|
+
this.setSliderValue(nextDataPointValue);
|
|
319
|
+
this.updateProgress();
|
|
320
|
+
this.scrollToThumbCenter();
|
|
321
|
+
this.sliderChange.emit(this.currentValue);
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* Slider pointer down event handler.
|
|
325
|
+
*/
|
|
326
|
+
onSliderPointerDown = () => {
|
|
327
|
+
this.animateSliderThumb('normal');
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Slider pointer up event handler.
|
|
331
|
+
*/
|
|
332
|
+
onSliderPointerUp = () => {
|
|
333
|
+
this.animateSliderThumb('reverse');
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Container touch start event handler.
|
|
337
|
+
*/
|
|
338
|
+
onContainerTouchStart = () => {
|
|
339
|
+
this.isPointerDown = true;
|
|
340
|
+
this.animateSliderThumb('normal');
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Container touch end event handler.
|
|
344
|
+
*/
|
|
345
|
+
onContainerTouchEnd = () => {
|
|
346
|
+
this.isPointerDown = false;
|
|
347
|
+
this.animateSliderThumb('reverse');
|
|
348
|
+
this.onSliderChangeDebounce();
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Initialises the mouse drag.
|
|
352
|
+
* @param {MouseEvent} e Current mouse event.
|
|
353
|
+
*/
|
|
354
|
+
onContainerMouseDown = (e) => {
|
|
355
|
+
if (this.type !== 'secondary' || this.containerSize !== 'small') {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
this.isPointerDown = true;
|
|
359
|
+
this.positions = {
|
|
360
|
+
scrollLeft: this.sliderContainerRef.scrollLeft,
|
|
361
|
+
mouseX: e.clientX,
|
|
362
|
+
};
|
|
363
|
+
this.element.addEventListener('mousemove', this.onContainerMouseMove);
|
|
364
|
+
this.element.addEventListener('mouseup', this.onContainerMouseUp);
|
|
365
|
+
this.element.addEventListener('mouseleave', this.onContainerMouseUp);
|
|
366
|
+
this.animateSliderThumb('normal');
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Scrolls the `sliderContainerRef` on mouse drag.
|
|
370
|
+
* @param {MouseEvent} e Current mouse event.
|
|
371
|
+
*/
|
|
372
|
+
onContainerMouseMove = (e) => {
|
|
373
|
+
e.preventDefault();
|
|
374
|
+
const mouseButton = e.buttons;
|
|
375
|
+
this.isPointerDown = mouseButton === 1;
|
|
376
|
+
if (!this.isPointerDown) {
|
|
377
|
+
this.onContainerMouseUp();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const deltaX = e.clientX - this.positions.mouseX;
|
|
381
|
+
this.sliderContainerRef.scrollTo(this.positions.scrollLeft - deltaX, 0);
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Removes mouse drag events.
|
|
385
|
+
*/
|
|
386
|
+
onContainerMouseUp = () => {
|
|
387
|
+
this.isPointerDown = false;
|
|
388
|
+
this.element.removeEventListener('mousemove', this.onContainerMouseMove);
|
|
389
|
+
this.element.removeEventListener('mouseup', this.onContainerMouseUp);
|
|
390
|
+
this.element.removeEventListener('mouseleave', this.onContainerMouseUp);
|
|
391
|
+
this.animateSliderThumb('reverse');
|
|
392
|
+
this.onSliderChangeDebounce();
|
|
393
|
+
};
|
|
686
394
|
/**
|
|
687
395
|
* Initialises `dataSet` state from the provided `dataPoints`.
|
|
688
396
|
*/
|
|
@@ -711,6 +419,51 @@ export class TetRangeSlider {
|
|
|
711
419
|
this.setSliderValue(this.currentValue);
|
|
712
420
|
this.updateProgress();
|
|
713
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* Updates the progress track of the slider.
|
|
424
|
+
*/
|
|
425
|
+
updateProgress = () => {
|
|
426
|
+
const progressTrack = this.progressTrackRef;
|
|
427
|
+
if (progressTrack === undefined) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
let percent = this.getSliderPercent();
|
|
431
|
+
if (percent < 50) {
|
|
432
|
+
percent += 0.5;
|
|
433
|
+
}
|
|
434
|
+
progressTrack.style.width = percent + '%';
|
|
435
|
+
this.updateTooltipHandlePosition();
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* Updates the `tooltipHandleRef` position to mimick the sliders thumb position.
|
|
439
|
+
*/
|
|
440
|
+
updateTooltipHandlePosition = () => {
|
|
441
|
+
const percent = this.getSliderPercent();
|
|
442
|
+
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
443
|
+
const tooltipHandleWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
444
|
+
const positionLeft = (sliderWidth - tooltipHandleWidth) * (percent / 100) +
|
|
445
|
+
this.sliderRef.getBoundingClientRect().left -
|
|
446
|
+
this.element.getBoundingClientRect().left;
|
|
447
|
+
this.tooltipHandleRef.style.left = `${positionLeft}px`;
|
|
448
|
+
const handlePosition = this.tooltipHandleRef.getBoundingClientRect().x;
|
|
449
|
+
const handlePositionLeftRem = handlePosition / getRemSize();
|
|
450
|
+
const windowWidth = window.innerWidth;
|
|
451
|
+
const handlePositionRight = (windowWidth - handlePosition - tooltipHandleWidth) / getRemSize();
|
|
452
|
+
let tooltipOffset = 0;
|
|
453
|
+
if (handlePositionLeftRem < 1) {
|
|
454
|
+
tooltipOffset = 2;
|
|
455
|
+
}
|
|
456
|
+
else if (handlePositionLeftRem < 3) {
|
|
457
|
+
tooltipOffset = 3 - handlePositionLeftRem;
|
|
458
|
+
}
|
|
459
|
+
else if (handlePositionRight < 1) {
|
|
460
|
+
tooltipOffset = -2;
|
|
461
|
+
}
|
|
462
|
+
else if (handlePositionRight < 3) {
|
|
463
|
+
tooltipOffset = (3 - handlePositionRight) * -1;
|
|
464
|
+
}
|
|
465
|
+
this.tooltipOffset = tooltipOffset;
|
|
466
|
+
};
|
|
714
467
|
/**
|
|
715
468
|
* Determines how many decimal places are present in the specified step value.
|
|
716
469
|
*
|
|
@@ -746,6 +499,266 @@ export class TetRangeSlider {
|
|
|
746
499
|
this.setSliderValue(value);
|
|
747
500
|
this.updateProgress();
|
|
748
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Gets the closest display value from the `dataSet`.
|
|
504
|
+
* @param value the value to check against. `currentValue` by default.
|
|
505
|
+
*/
|
|
506
|
+
getClosestOverrideDataPoint = (value = this.currentValue) => {
|
|
507
|
+
return this.dataSet.reduce(function (prev, curr) {
|
|
508
|
+
return Math.abs(Object.values(curr)[0] - value) < Math.abs(Object.values(prev)[0] - value) ? curr : prev;
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* Gets the closest slider value from the `dataSet`.
|
|
513
|
+
* @param value the value to check against.
|
|
514
|
+
*/
|
|
515
|
+
getClosestOriginalDataPoint = (value) => {
|
|
516
|
+
return this.dataSet.reduce(function (prev, curr) {
|
|
517
|
+
return Math.abs(parseFloat(Object.keys(curr)[0]) - value) < Math.abs(parseFloat(Object.keys(prev)[0]) - value)
|
|
518
|
+
? curr
|
|
519
|
+
: prev;
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Gets the current percent of the thumb position relative to the slider width.
|
|
524
|
+
* @returns {number}
|
|
525
|
+
*/
|
|
526
|
+
getSliderPercent = () => {
|
|
527
|
+
const slider = this.sliderRef;
|
|
528
|
+
if (slider === null) {
|
|
529
|
+
return 0;
|
|
530
|
+
}
|
|
531
|
+
const range = this.maxValue - this.minValue;
|
|
532
|
+
const absoluteValue = parseFloat(slider.value) - this.minValue;
|
|
533
|
+
const sliderPercent = (absoluteValue / range) * 100;
|
|
534
|
+
return sliderPercent;
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* Gets the current display value for the toolip.
|
|
538
|
+
* @returns The display value for the tooltip.
|
|
539
|
+
*/
|
|
540
|
+
getTooltipValue = () => {
|
|
541
|
+
if (this.type === 'secondary') {
|
|
542
|
+
return `${Object.values(this.getClosestOverrideDataPoint())[0]} ${this.dataUnits}`;
|
|
543
|
+
}
|
|
544
|
+
let tooltipValue = this.currentValue;
|
|
545
|
+
if (this.currentValue < this.minValue) {
|
|
546
|
+
tooltipValue = this.minValue;
|
|
547
|
+
}
|
|
548
|
+
if (this.currentValue > this.maxValue) {
|
|
549
|
+
tooltipValue = this.maxValue;
|
|
550
|
+
}
|
|
551
|
+
return `${tooltipValue} ${this.dataUnits}`;
|
|
552
|
+
};
|
|
553
|
+
/**
|
|
554
|
+
* Converts the display value of the slider to a slider value and updates slider position.
|
|
555
|
+
* @param value the display value.
|
|
556
|
+
*/
|
|
557
|
+
setSliderValue = (value) => {
|
|
558
|
+
if (Number.isNaN(value)) {
|
|
559
|
+
value = this.minValue;
|
|
560
|
+
}
|
|
561
|
+
const dataSet = JSON.parse(JSON.stringify(this.dataSet));
|
|
562
|
+
const firstDataPoint = dataSet.shift();
|
|
563
|
+
const lastDataPoint = dataSet.pop();
|
|
564
|
+
if (value < firstDataPoint[this.minValue]) {
|
|
565
|
+
this.sliderRef.value = this.minValue.toString();
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
if (value > lastDataPoint[this.maxValue]) {
|
|
569
|
+
this.sliderRef.value = this.maxValue.toString();
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
const closestDataPoint = this.getClosestOverrideDataPoint(value);
|
|
573
|
+
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
574
|
+
if (value === closestDataPointValue) {
|
|
575
|
+
this.sliderRef.value = Object.keys(closestDataPoint)[0];
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const dataSetIndex = this.dataSet.indexOf(closestDataPoint);
|
|
579
|
+
const range = [closestDataPoint];
|
|
580
|
+
if (value < closestDataPointValue) {
|
|
581
|
+
range.unshift(this.dataSet[dataSetIndex - 1]);
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
range.push(this.dataSet[dataSetIndex + 1]);
|
|
585
|
+
}
|
|
586
|
+
const originalRangeStart = parseFloat(Object.keys(range[0])[0]);
|
|
587
|
+
const originalRangeEnd = parseFloat(Object.keys(range[1])[0]);
|
|
588
|
+
const originalRange = originalRangeEnd - originalRangeStart;
|
|
589
|
+
const overrideRangeStart = range[0][originalRangeStart];
|
|
590
|
+
const overrideRangeEnd = range[1][originalRangeEnd];
|
|
591
|
+
const overrideRange = overrideRangeEnd - overrideRangeStart;
|
|
592
|
+
const sliderValue = (value - overrideRangeStart) * (originalRange / overrideRange) + originalRangeStart;
|
|
593
|
+
this.sliderRef.value = sliderValue.toString();
|
|
594
|
+
};
|
|
595
|
+
/**
|
|
596
|
+
* Sets `containerSize` state depending on `element` width.
|
|
597
|
+
* Sets `sliderContainerRef` overflow style depending on `type` and `containerSize` states.
|
|
598
|
+
*/
|
|
599
|
+
autoSetContainerSize = () => {
|
|
600
|
+
if (this.size !== 'auto') {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
let containerWidth = 0;
|
|
604
|
+
if (this.parentContainer.hasOwnProperty('innerWidth')) {
|
|
605
|
+
containerWidth = this.parentContainer.innerWidth;
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
containerWidth = this.parentContainer.getBoundingClientRect().width;
|
|
609
|
+
}
|
|
610
|
+
if (containerWidth >= 1024) {
|
|
611
|
+
this.containerSize = 'large';
|
|
612
|
+
}
|
|
613
|
+
else if (containerWidth >= 768) {
|
|
614
|
+
this.containerSize = 'medium';
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
this.containerSize = 'small';
|
|
618
|
+
}
|
|
619
|
+
if (this.sliderContainerRef === undefined) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
if (this.type === 'secondary' && this.containerSize === 'small') {
|
|
623
|
+
this.sliderContainerRef.style.overflowX = 'scroll';
|
|
624
|
+
setTimeout(this.scrollToThumbCenter, 50);
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
this.sliderContainerRef.style.overflowX = 'unset';
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Sets the manual input value.
|
|
632
|
+
* @param value number to be displayed in the input.
|
|
633
|
+
*/
|
|
634
|
+
setInputValue = (value) => {
|
|
635
|
+
this.inputRef.value = value.toString();
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* Gradually sets the slider value until it matches the closest `dataPoint` entry.
|
|
639
|
+
* Sets `isSliding` state.
|
|
640
|
+
*/
|
|
641
|
+
slideToClosestDataPoint = () => {
|
|
642
|
+
if (this.isPointerDown) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
const closestDataPoint = this.getClosestOverrideDataPoint();
|
|
646
|
+
const closestDataPointValue = Object.values(closestDataPoint)[0];
|
|
647
|
+
this.isSliding = true;
|
|
648
|
+
const interval = setInterval(() => {
|
|
649
|
+
const valueDelta = Math.abs(closestDataPointValue - this.currentValue);
|
|
650
|
+
this.scrollToThumbCenter();
|
|
651
|
+
if (!valueDelta) {
|
|
652
|
+
clearInterval(interval);
|
|
653
|
+
this.sliderChange.emit(this.currentValue);
|
|
654
|
+
setTimeout(() => {
|
|
655
|
+
this.isSliding = false;
|
|
656
|
+
}, 50);
|
|
657
|
+
}
|
|
658
|
+
if (valueDelta < 5) {
|
|
659
|
+
this.currentValue = closestDataPointValue;
|
|
660
|
+
this.setSliderValue(closestDataPointValue);
|
|
661
|
+
this.updateProgress();
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
let changeBy = 5;
|
|
665
|
+
if (valueDelta > 100) {
|
|
666
|
+
changeBy = 10;
|
|
667
|
+
}
|
|
668
|
+
if (this.currentValue > closestDataPointValue) {
|
|
669
|
+
this.currentValue = this.currentValue - changeBy;
|
|
670
|
+
this.setSliderValue(this.currentValue);
|
|
671
|
+
}
|
|
672
|
+
if (this.currentValue < closestDataPointValue) {
|
|
673
|
+
this.currentValue = this.currentValue + changeBy;
|
|
674
|
+
this.setSliderValue(this.currentValue);
|
|
675
|
+
}
|
|
676
|
+
this.updateProgress();
|
|
677
|
+
}, 1);
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Calculates the `dataSet` state from the provided `dataPoints`.
|
|
681
|
+
*/
|
|
682
|
+
calculateDataSet = () => {
|
|
683
|
+
const dataSteps = this.dataPoints.length ? this.dataPoints.length : 2;
|
|
684
|
+
const dataPoints = this.dataPoints.length ? this.dataPoints : [this.minValue, this.maxValue];
|
|
685
|
+
const inputRange = this.maxValue - this.minValue;
|
|
686
|
+
const increment = inputRange / (dataSteps - 1);
|
|
687
|
+
this.dataSet.length = 0;
|
|
688
|
+
for (let index = 0; index < dataSteps; index++) {
|
|
689
|
+
this.dataSet.push({ [increment * index + this.minValue]: dataPoints[index] });
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Scrolls `sliderContainerRef` to place slider thumb in the center of the screen.
|
|
694
|
+
*/
|
|
695
|
+
scrollToThumbCenter = () => {
|
|
696
|
+
if (this.type !== 'secondary' || this.containerSize !== 'small') {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const sliderWidth = this.sliderRef.getBoundingClientRect().width;
|
|
700
|
+
const thumbWidth = this.tooltipHandleRef.getBoundingClientRect().width;
|
|
701
|
+
const minScrollLeft = sliderWidth / 2 + thumbWidth / 2;
|
|
702
|
+
const maxScrollLeft = minScrollLeft + sliderWidth - thumbWidth;
|
|
703
|
+
const scrollRange = maxScrollLeft - minScrollLeft;
|
|
704
|
+
const sliderPercent = this.getSliderPercent();
|
|
705
|
+
this.sliderContainerRef.scrollLeft = minScrollLeft + (scrollRange * sliderPercent) / 100;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* Animates the shadows of the slider thumb.
|
|
709
|
+
* @param {PlaybackDirection} direction sets the animation direction.
|
|
710
|
+
*/
|
|
711
|
+
animateSliderThumb = (direction) => {
|
|
712
|
+
const shadowDefault = getComputedStyle(this.element).getPropertyValue('--slider-thumb-shadow');
|
|
713
|
+
const shadowActive = getComputedStyle(this.element).getPropertyValue('--slider-thumb-active-shadow');
|
|
714
|
+
if (direction === 'normal') {
|
|
715
|
+
this.tooltipHandleRef.classList.add('range-slider__tooltip-handle--active');
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
this.tooltipHandleRef.classList.remove('range-slider__tooltip-handle--active');
|
|
719
|
+
}
|
|
720
|
+
this.tooltipHandleRef.animate([{ boxShadow: shadowDefault }, { boxShadow: 'none' }, { boxShadow: shadowActive }], {
|
|
721
|
+
duration: 300,
|
|
722
|
+
direction,
|
|
723
|
+
});
|
|
724
|
+
};
|
|
725
|
+
/** Renders a tick mark. */
|
|
726
|
+
renderTick = () => {
|
|
727
|
+
let tick = document.createElement('span');
|
|
728
|
+
tick.className = 'range-slider__tick';
|
|
729
|
+
this.tickContainerRef.appendChild(tick);
|
|
730
|
+
};
|
|
731
|
+
/** Renders data labels. */
|
|
732
|
+
renderDataLabels = () => {
|
|
733
|
+
const inputRange = this.maxValue - this.minValue;
|
|
734
|
+
this.dataLabelRef.innerHTML = '';
|
|
735
|
+
this.tickContainerRef.innerHTML = '';
|
|
736
|
+
for (const dataLabel of this.dataSet) {
|
|
737
|
+
const position = parseFloat(Object.keys(dataLabel)[0]);
|
|
738
|
+
const label = Object.values(dataLabel)[0];
|
|
739
|
+
const absolutePosition = position - this.minValue;
|
|
740
|
+
const relativePosition = (absolutePosition / inputRange) * 100;
|
|
741
|
+
this.renderTick();
|
|
742
|
+
if (this.displayDataPoints.length && !this.displayDataPoints.includes(label)) {
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
this.dataLabelRef.appendChild(this.renderDataLabel(label.toString(), relativePosition));
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
/**
|
|
749
|
+
* Creates a data label node.
|
|
750
|
+
* @param label data label to be displayed.
|
|
751
|
+
* @param position position relative to the slider container.
|
|
752
|
+
* @returns {HTMLElement} representing data label.
|
|
753
|
+
*/
|
|
754
|
+
renderDataLabel = (label, position) => {
|
|
755
|
+
const dataListItem = document.createElement('span');
|
|
756
|
+
const valueNode = document.createTextNode(label);
|
|
757
|
+
dataListItem.appendChild(valueNode);
|
|
758
|
+
dataListItem.classList.add('range-slider__data-label');
|
|
759
|
+
dataListItem.style.left = `calc(${position}% - 1.5rem)`;
|
|
760
|
+
return dataListItem;
|
|
761
|
+
};
|
|
749
762
|
render() {
|
|
750
763
|
return (h(Host, { key: 'fe4d87f523c54b6d3bde6a4aeb062d3903571091' }, h("div", { key: 'c07051d59b5534b32df81830d998d874ed14fd8f', class: {
|
|
751
764
|
'range-slider': true,
|
|
@@ -757,21 +770,21 @@ export class TetRangeSlider {
|
|
|
757
770
|
} }, h("div", { key: '6cf218ba806685aa060f835562f02c5b6cf9ace5', class: {
|
|
758
771
|
'range-slider__input-container': true,
|
|
759
772
|
'hidden': !this.withInput,
|
|
760
|
-
} }, h("tet-input",
|
|
773
|
+
} }, h("tet-input", { key: '16067f25184f3b4a4a2dec1d3246b6f602e05985', "input-class": "range-slider__input", "input-type": "number", "input-value": this.currentValue, ref: inputEl => (this.inputRef = inputEl), theme: this.theme, onInput: this.onInputChange, onKeyDown: (event) => this.onInputKeyDown(event, true), accessibilityLabel: this.numberInputAccessibilityLabel, ...(this.containerSize !== 'large' ? { inputTabindex: 3 } : {}) })), h("div", { key: 'ec4bd9cb5b732089c8b3a02f1892aef4a3af7a89', class: "range-slider__container" }, h("tet-button", { key: '02061d179102586b3518bb8e47b561311e82b9c2', theme: this.theme, iconMode: true, class: {
|
|
761
774
|
'range-slider__control': true,
|
|
762
775
|
'range-slider__control--left': true,
|
|
763
776
|
'hidden': !this.withControls,
|
|
764
|
-
}, clickCallback: this.onControlPreviousClick
|
|
777
|
+
}, clickCallback: this.onControlPreviousClick, ...(this.reduceButtonAccessibilityLabel ? { accessibilityLabel: this.reduceButtonAccessibilityLabel } : {}), ...(this.containerSize !== 'large' ? { tabindex: 2 } : {}) }, h("tet-icon", { key: 'f69c0f996709d6d4ee780b3b3601da2aecb0ef53', name: "remove", class: "range-slider__control--icon" })), h("div", { key: '163bc4c424eb02a14f4aa5af3cb8dc15a95e8323', onTouchStart: this.onContainerTouchStart, onTouchEnd: this.onContainerTouchEnd, onMouseDown: this.onContainerMouseDown, onScroll: this.onContainerScroll, ref: sliderContainerEl => (this.sliderContainerRef = sliderContainerEl), class: "range-slider__slider-container", draggable: false }, h("div", { key: '87faebff4efc96466b045cb30e2195aca1e7b125', class: "range-slider__slider-wrapper" }, h("input", { key: '395e6b19348b9db47c6a01e5e62d38540e15b631', ref: sliderEl => (this.sliderRef = sliderEl), type: "range", min: this.minValue, max: this.maxValue, step: this.step, value: this.defaultValue, list: "steplist", id: "rangeInput", onInput: this.onSliderInput, onChange: this.onSliderChange, onPointerDown: this.onSliderPointerDown, onPointerUp: this.onSliderPointerUp, onKeyDown: this.onInputKeyDown, class: "range-slider__slider", ...(this.sliderInputAccessibilityLabel ? { "aria-label": this.sliderInputAccessibilityLabel } : {}), ...(this.containerSize !== 'large' ? { tabindex: 1 } : {}) })), h("div", { key: 'ce03add3fa4235f1dc1dec6ee4c2249b7c6ab411', class: "range-slider__track range-slider__track--background" }), h("div", { key: 'b5fbdc67265f9bc567f193994f8d5bd8000a3cec', ref: progressTrackEl => (this.progressTrackRef = progressTrackEl), class: "range-slider__track range-slider__track--progress" }), h("div", { key: 'c7144b949d09573c4e2f446f80b54f0ba28ba854', ref: tickContainerEl => (this.tickContainerRef = tickContainerEl), class: "range-slider__tick-container" }), h("div", { key: '576ed7c7f3e9d892eb19e74f61f229ea62383c63', ref: dataLabelEl => (this.dataLabelRef = dataLabelEl), class: {
|
|
765
778
|
'range-slider__data-label-container': true,
|
|
766
779
|
'hidden': this.type === 'secondary' && this.containerSize === 'small',
|
|
767
780
|
} })), h("div", { key: 'a479431596824a05d55a8775f73c9e7071950e3a', class: {
|
|
768
781
|
'range-slider__current-step-container': true,
|
|
769
782
|
'hidden': !this.withCurrentStepCounter,
|
|
770
|
-
} }, h("div", { key: 'e2c0a91402037601d8865476ae2d25623d0083bd', class: "range-slider__current-step", "aria-live": "polite" }, this.dataSet.indexOf(this.getClosestOverrideDataPoint()) + 1, "/", this.dataPoints.length)), h("div", { key: 'cf187a5376842141b09291db7029842e1b14577c', ref: toolbarHandleEl => (this.tooltipHandleRef = toolbarHandleEl), class: "range-slider__tooltip-handle" }, h("div", { key: '0a41fc6a3c162e1a2eb907551f592c58865c9836', class: "range-slider__tooltip translation-none", style: { [`--tooltip-offset`]: `${this.tooltipOffset}rem` }, "aria-live": "polite" }, this.getTooltipValue())), h("tet-button",
|
|
783
|
+
} }, h("div", { key: 'e2c0a91402037601d8865476ae2d25623d0083bd', class: "range-slider__current-step", "aria-live": "polite" }, this.dataSet.indexOf(this.getClosestOverrideDataPoint()) + 1, "/", this.dataPoints.length)), h("div", { key: 'cf187a5376842141b09291db7029842e1b14577c', ref: toolbarHandleEl => (this.tooltipHandleRef = toolbarHandleEl), class: "range-slider__tooltip-handle" }, h("div", { key: '0a41fc6a3c162e1a2eb907551f592c58865c9836', class: "range-slider__tooltip translation-none", style: { [`--tooltip-offset`]: `${this.tooltipOffset}rem` }, "aria-live": "polite" }, this.getTooltipValue())), h("tet-button", { key: '06d21777945c8f42f83179546a35e6a3112d6bca', theme: this.theme, iconMode: true, class: {
|
|
771
784
|
'range-slider__control': true,
|
|
772
785
|
'range-slider__control--right': true,
|
|
773
786
|
'hidden': !this.withControls,
|
|
774
|
-
}, clickCallback: this.onControlNextClick
|
|
787
|
+
}, clickCallback: this.onControlNextClick, ...(this.addButtonAccessibilityLabel ? { accessibilityLabel: this.addButtonAccessibilityLabel } : {}), ...(this.containerSize !== 'large' ? { tabindex: 4 } : {}) }, h("tet-icon", { key: '35a49113a21c71b1f79f871597c2feeb7ae112e1', name: "add", class: "range-slider__control--icon" }))))));
|
|
775
788
|
}
|
|
776
789
|
static get is() { return "tet-range-slider"; }
|
|
777
790
|
static get encapsulation() { return "shadow"; }
|