@duetds/components 5.1.9 → 5.2.2
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/hydrate/index.js +392 -125
- package/lib/cjs/{dom-66424ef2.js → dom-96576bce.js} +1 -1
- package/lib/cjs/duet-action-button.cjs.entry.js +16 -8
- package/lib/cjs/duet-alert.cjs.entry.js +2 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +2 -2
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +17 -2
- package/lib/cjs/duet-caption_4.cjs.entry.js +2 -2
- package/lib/cjs/duet-card.cjs.entry.js +2 -2
- package/lib/cjs/duet-checkbox.cjs.entry.js +15 -3
- package/lib/cjs/duet-choice_2.cjs.entry.js +16 -4
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-combobox.cjs.entry.js +2 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +2 -2
- package/lib/cjs/duet-date-picker.cjs.entry.js +3 -4
- package/lib/cjs/duet-divider_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +5 -4
- package/lib/cjs/duet-empty-state.cjs.entry.js +2 -2
- package/lib/cjs/duet-fieldset.cjs.entry.js +2 -2
- package/lib/cjs/duet-footer.cjs.entry.js +2 -2
- package/lib/cjs/duet-grid_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-header_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-hero.cjs.entry.js +2 -2
- package/lib/cjs/duet-icon.cjs.entry.js +2 -2
- package/lib/cjs/duet-input_2.cjs.entry.js +18 -4
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-modal.cjs.entry.js +12 -4
- package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-number-input.cjs.entry.js +106 -49
- package/lib/cjs/duet-pagination_2.cjs.entry.js +50 -14
- package/lib/cjs/duet-progress.cjs.entry.js +15 -3
- package/lib/cjs/duet-radio_2.cjs.entry.js +15 -3
- package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +2 -2
- package/lib/cjs/duet-select.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-textarea.cjs.entry.js +17 -3
- package/lib/cjs/duet-toggle.cjs.entry.js +15 -3
- package/lib/cjs/duet-tooltip.cjs.entry.js +2 -2
- package/lib/cjs/duet-tray.cjs.entry.js +2 -2
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/{focus-utils-3ef68d4c.js → focus-utils-4648b81b.js} +1 -1
- package/lib/cjs/{index-e1907091.js → index-d690ab34.js} +11 -9
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{shadow-css-1ff2f74f.js → shadow-css-38b9e725.js} +2 -3
- package/lib/cjs/{themeable-component-940d3b50.js → themeable-component-fdeaef9f.js} +0 -0
- package/lib/collection/collection-manifest.json +1 -1
- package/lib/collection/{utils/form-components.js → common/a11y-component.js} +0 -0
- package/lib/collection/common/form-components.js +4 -0
- package/lib/collection/common/index.js +4 -0
- package/lib/collection/{utils → common}/themeable-component.js +0 -0
- package/lib/collection/components/duet-action-button/duet-action-button.js +57 -13
- package/lib/collection/components/duet-alert/duet-alert.js +1 -1
- package/lib/collection/components/duet-badge/duet-badge.js +1 -1
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumb.js +1 -1
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.js +1 -1
- package/lib/collection/components/duet-button/duet-button.js +70 -1
- package/lib/collection/components/duet-caption/duet-caption.js +1 -1
- package/lib/collection/components/duet-card/duet-card.js +1 -1
- package/lib/collection/components/duet-checkbox/duet-checkbox.js +68 -2
- package/lib/collection/components/duet-choice/duet-choice.js +68 -2
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +1 -1
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +1 -1
- package/lib/collection/components/duet-combobox/duet-combobox.js +1 -1
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.js +1 -1
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +1 -1
- package/lib/collection/components/duet-date-picker/utils.js +0 -1
- package/lib/collection/components/duet-divider/duet-divider.js +1 -1
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +3 -2
- package/lib/collection/components/duet-empty-state/duet-empty-state.js +1 -1
- package/lib/collection/components/duet-fieldset/duet-fieldset.js +1 -1
- package/lib/collection/components/duet-footer/duet-footer.js +1 -1
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +1 -1
- package/lib/collection/components/duet-header/duet-header.css +1 -1
- package/lib/collection/components/duet-header/duet-header.js +1 -1
- package/lib/collection/components/duet-heading/duet-heading.js +1 -1
- package/lib/collection/components/duet-hero/duet-hero.js +1 -1
- package/lib/collection/components/duet-icon/duet-icon.js +1 -1
- package/lib/collection/components/duet-input/duet-input.js +72 -4
- package/lib/collection/components/duet-label/duet-label.js +1 -1
- package/lib/collection/components/duet-link/duet-link.js +1 -1
- package/lib/collection/components/duet-list/duet-list.js +1 -1
- package/lib/collection/components/duet-logo/duet-logo.js +1 -1
- package/lib/collection/components/duet-modal/duet-modal.js +80 -2
- package/lib/collection/components/duet-notification/duet-notification.js +1 -1
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +1 -1
- package/lib/collection/components/duet-number-input/duet-number-input.js +90 -29
- package/lib/collection/components/duet-pagination/duet-pagination.js +94 -3
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +1 -1
- package/lib/collection/components/duet-progress/duet-progress.js +68 -2
- package/lib/collection/components/duet-radio/duet-radio.js +68 -2
- package/lib/collection/components/duet-radio-group/duet-radio-group.js +1 -1
- package/lib/collection/components/duet-range-slider/duet-range-slider.js +1 -1
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +29 -12
- package/lib/collection/components/duet-scrollable/duet-scrollable.js +1 -1
- package/lib/collection/components/duet-select/duet-select.js +1 -1
- package/lib/collection/components/duet-spinner/duet-spinner.js +1 -1
- package/lib/collection/components/duet-step/duet-step.js +1 -1
- package/lib/collection/components/duet-stepper/duet-stepper.js +1 -1
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +1 -1
- package/lib/collection/components/duet-table/duet-table.css +30 -18
- package/lib/collection/components/duet-table/duet-table.js +1 -1
- package/lib/collection/components/duet-textarea/duet-textarea.js +70 -2
- package/lib/collection/components/duet-toggle/duet-toggle.js +68 -2
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +1 -1
- package/lib/collection/components/duet-tray/duet-tray.js +1 -1
- package/lib/collection/components/duet-upload/duet-upload.js +1 -1
- package/lib/collection/utils/math.utils.js +76 -0
- package/lib/custom-elements-bundle/index.js +323 -112
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-d92b2eac.system.entry.js → p-057e3337.system.entry.js} +1 -1
- package/lib/duet/{p-7f705e70.entry.js → p-08829649.entry.js} +1 -1
- package/lib/duet/{p-cd158ec2.system.entry.js → p-0a62f171.system.entry.js} +1 -1
- package/lib/duet/{p-7772d2f3.system.entry.js → p-0da92109.system.entry.js} +1 -1
- package/lib/duet/p-10b144b0.system.entry.js +4 -0
- package/lib/duet/p-113531de.entry.js +4 -0
- package/lib/duet/{p-1c315e22.system.entry.js → p-1164c8a6.system.entry.js} +1 -1
- package/lib/duet/{p-6b87a943.system.entry.js → p-14a98f4b.system.entry.js} +1 -1
- package/lib/duet/{p-8c372ef6.system.entry.js → p-1527b7e3.system.entry.js} +2 -2
- package/lib/duet/{p-d2c9bb5f.system.entry.js → p-188d7eb5.system.entry.js} +1 -1
- package/lib/duet/{p-41ed75d0.system.entry.js → p-1c6a3c81.system.entry.js} +1 -1
- package/lib/duet/{p-ae5872e3.system.entry.js → p-1d6d8314.system.entry.js} +1 -1
- package/lib/duet/{p-b953aedb.system.entry.js → p-1fdc5601.system.entry.js} +1 -1
- package/lib/duet/p-2135afa1.system.entry.js +4 -0
- package/lib/duet/p-216d4da8.entry.js +4 -0
- package/lib/duet/{p-1d87a095.system.js → p-2260d4d2.system.js} +1 -1
- package/lib/duet/{p-fbc61588.system.entry.js → p-24201d53.system.entry.js} +1 -1
- package/lib/duet/{p-b67edf51.system.entry.js → p-31f7ef10.system.entry.js} +1 -1
- package/lib/duet/p-336ddadc.js +4 -0
- package/lib/duet/{p-6b03322b.system.js → p-33b3aba4.system.js} +0 -0
- package/lib/duet/p-355f9884.entry.js +4 -0
- package/lib/duet/{p-851b469e.system.entry.js → p-35611d73.system.entry.js} +2 -2
- package/lib/duet/{p-b5ef3764.entry.js → p-3735b874.entry.js} +1 -1
- package/lib/duet/p-38c52a73.entry.js +4 -0
- package/lib/duet/{p-3ed22b96.system.entry.js → p-3a529853.system.entry.js} +1 -1
- package/lib/duet/{p-fa59ebf4.js → p-3b31184e.js} +0 -0
- package/lib/duet/{p-2d244cbb.system.entry.js → p-3b871ee9.system.entry.js} +1 -1
- package/lib/duet/{p-d7e383e1.system.entry.js → p-3c0d7470.system.entry.js} +2 -2
- package/lib/duet/p-3cf51bd3.entry.js +4 -0
- package/lib/duet/p-3dadaaf9.entry.js +4 -0
- package/lib/duet/p-3e510a51.entry.js +4 -0
- package/lib/duet/{p-fcf30d60.system.entry.js → p-43c0c459.system.entry.js} +1 -1
- package/lib/duet/p-479657e4.entry.js +4 -0
- package/lib/duet/p-4804b9d8.system.entry.js +4 -0
- package/lib/duet/{p-d50a26ce.system.entry.js → p-4a000e12.system.entry.js} +2 -2
- package/lib/duet/p-4be66230.js +5 -0
- package/lib/duet/{p-abf8eaf7.js → p-4ebf1618.js} +0 -0
- package/lib/duet/{p-43a54146.system.entry.js → p-54eadbb6.system.entry.js} +1 -1
- package/lib/duet/{p-b32178af.entry.js → p-55fbbafb.entry.js} +1 -1
- package/lib/duet/{p-0a8cb1f2.system.entry.js → p-56a92e4b.system.entry.js} +1 -1
- package/lib/duet/{p-eda1280f.entry.js → p-57934454.entry.js} +1 -1
- package/lib/duet/{p-6fd465b3.entry.js → p-5a4a83ce.entry.js} +1 -1
- package/lib/duet/{p-2e68b854.system.entry.js → p-5aec2bd7.system.entry.js} +1 -1
- package/lib/duet/p-5da3ec79.entry.js +4 -0
- package/lib/duet/{p-5b0f15e4.entry.js → p-6009349f.entry.js} +1 -1
- package/lib/duet/{p-f4b909bd.system.entry.js → p-636c9c24.system.entry.js} +1 -1
- package/lib/duet/{p-ca10ad5f.system.entry.js → p-65b4903d.system.entry.js} +1 -1
- package/lib/duet/{p-5d2204fc.entry.js → p-6ecb8b94.entry.js} +1 -1
- package/lib/duet/{p-906e53f9.entry.js → p-7bad44b0.entry.js} +1 -1
- package/lib/duet/{p-0da0c06d.system.entry.js → p-7ccefcc3.system.entry.js} +2 -2
- package/lib/duet/p-7e3eec66.system.entry.js +4 -0
- package/lib/duet/{p-ef5c2a47.system.entry.js → p-7fbb09c1.system.entry.js} +1 -1
- package/lib/duet/{p-d5b3feeb.system.entry.js → p-804eb7eb.system.entry.js} +1 -1
- package/lib/duet/p-808d661f.system.entry.js +4 -0
- package/lib/duet/{p-5b609e18.entry.js → p-834242e9.entry.js} +1 -1
- package/lib/duet/{p-8fa561be.system.entry.js → p-84a95f49.system.entry.js} +1 -1
- package/lib/duet/{p-0e3fad96.entry.js → p-879ab923.entry.js} +1 -1
- package/lib/duet/p-89368497.system.js +4 -0
- package/lib/duet/p-8d7c2cf4.entry.js +4 -0
- package/lib/duet/{p-1ce6c0c0.entry.js → p-928e0b63.entry.js} +1 -1
- package/lib/duet/{p-c5b1e054.system.entry.js → p-95dc8004.system.entry.js} +1 -1
- package/lib/duet/{p-36455aba.entry.js → p-96e03d88.entry.js} +1 -1
- package/lib/duet/{p-95be8318.system.entry.js → p-974143b1.system.entry.js} +1 -1
- package/lib/duet/{p-2911128f.entry.js → p-999dec9f.entry.js} +1 -1
- package/lib/duet/p-9e3cd6b5.entry.js +4 -0
- package/lib/duet/p-9ed30f80.entry.js +4 -0
- package/lib/duet/p-a1980c81.entry.js +4 -0
- package/lib/duet/{p-007518fb.entry.js → p-a7e5cd45.entry.js} +1 -1
- package/lib/duet/p-aae30188.system.js +5 -0
- package/lib/duet/{p-7f26e522.entry.js → p-ab66df54.entry.js} +1 -1
- package/lib/duet/p-af5f34fb.entry.js +4 -0
- package/lib/duet/p-afc7cc44.entry.js +4 -0
- package/lib/duet/{p-542af014.system.js → p-b668b67c.system.js} +0 -0
- package/lib/duet/p-b6cea2fb.entry.js +4 -0
- package/lib/duet/p-be1a1ee5.entry.js +4 -0
- package/lib/duet/{p-c23ef060.entry.js → p-bf306f77.entry.js} +1 -1
- package/lib/duet/{p-76dc3268.entry.js → p-c0cb67d7.entry.js} +1 -1
- package/lib/duet/p-c858aedd.entry.js +4 -0
- package/lib/duet/{p-00f69be4.entry.js → p-cbb59840.entry.js} +1 -1
- package/lib/duet/{p-27d238c5.js → p-d4c234ed.js} +1 -1
- package/lib/duet/{p-4fb88265.entry.js → p-d511ca66.entry.js} +1 -1
- package/lib/duet/{p-fcb0ac03.system.entry.js → p-db48e77a.system.entry.js} +2 -2
- package/lib/duet/{p-6d148390.system.entry.js → p-dc429d5d.system.entry.js} +2 -2
- package/lib/duet/p-e0ba5d9e.system.entry.js +4 -0
- package/lib/duet/{p-70f5c86d.entry.js → p-e3010ea3.entry.js} +1 -1
- package/lib/duet/{p-43bdb5df.system.entry.js → p-e3e092e1.system.entry.js} +2 -2
- package/lib/duet/p-e406a3b7.entry.js +4 -0
- package/lib/duet/{p-080ce662.entry.js → p-e4133a47.entry.js} +1 -1
- package/lib/duet/{p-86395c08.entry.js → p-e5992e2a.entry.js} +1 -1
- package/lib/duet/{p-eeeadb94.entry.js → p-e67563e7.entry.js} +1 -1
- package/lib/duet/{p-f4bba24d.system.entry.js → p-e6ff063e.system.entry.js} +1 -1
- package/lib/duet/{p-4fcde9bd.system.entry.js → p-e7eb9f7a.system.entry.js} +1 -1
- package/lib/duet/{p-f1f59897.system.entry.js → p-e8658390.system.entry.js} +1 -1
- package/lib/duet/p-ea59bb06.system.entry.js +4 -0
- package/lib/duet/p-ff46ec81.system.js +16 -0
- package/lib/esm/{dom-3c479050.js → dom-3dbcb0d8.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +16 -8
- package/lib/esm/duet-alert.entry.js +2 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-breadcrumb.entry.js +2 -2
- package/lib/esm/duet-breadcrumbs.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +17 -2
- package/lib/esm/duet-caption_4.entry.js +2 -2
- package/lib/esm/duet-card.entry.js +2 -2
- package/lib/esm/duet-checkbox.entry.js +15 -3
- package/lib/esm/duet-choice_2.entry.js +16 -4
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-combobox.entry.js +2 -2
- package/lib/esm/duet-cookie-consent.entry.js +2 -2
- package/lib/esm/duet-date-picker.entry.js +3 -4
- package/lib/esm/duet-divider_2.entry.js +2 -2
- package/lib/esm/duet-editable-table_3.entry.js +5 -4
- package/lib/esm/duet-empty-state.entry.js +2 -2
- package/lib/esm/duet-fieldset.entry.js +2 -2
- package/lib/esm/duet-footer.entry.js +2 -2
- package/lib/esm/duet-grid_2.entry.js +2 -2
- package/lib/esm/duet-header_2.entry.js +3 -3
- package/lib/esm/duet-hero.entry.js +2 -2
- package/lib/esm/duet-icon.entry.js +2 -2
- package/lib/esm/duet-input_2.entry.js +18 -4
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +2 -2
- package/lib/esm/duet-modal.entry.js +12 -4
- package/lib/esm/duet-notification_2.entry.js +2 -2
- package/lib/esm/duet-number-input.entry.js +106 -49
- package/lib/esm/duet-pagination_2.entry.js +50 -14
- package/lib/esm/duet-progress.entry.js +15 -3
- package/lib/esm/duet-radio_2.entry.js +15 -3
- package/lib/esm/duet-range-slider.entry.js +2 -2
- package/lib/esm/duet-scrollable_3.entry.js +2 -2
- package/lib/esm/duet-select.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +2 -2
- package/lib/esm/duet-textarea.entry.js +17 -3
- package/lib/esm/duet-toggle.entry.js +15 -3
- package/lib/esm/duet-tooltip.entry.js +2 -2
- package/lib/esm/duet-tray.entry.js +2 -2
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{focus-utils-dbdd6235.js → focus-utils-6313db97.js} +1 -1
- package/lib/esm/{index-33a07cd5.js → index-9e6ac831.js} +11 -9
- package/lib/esm/loader.js +3 -3
- package/lib/esm/polyfills/css-shim.js +1 -1
- package/lib/esm/{shadow-css-fbe49d20.js → shadow-css-501eda9a.js} +2 -3
- package/lib/esm/{themeable-component-e8fc98bf.js → themeable-component-cb76be7c.js} +0 -0
- package/lib/esm-es5/{dom-3c479050.js → dom-3dbcb0d8.js} +0 -0
- package/lib/esm-es5/duet-action-button.entry.js +2 -2
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +2 -2
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-combobox.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table_3.entry.js +2 -2
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +2 -2
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +2 -2
- package/lib/esm-es5/duet-pagination_2.entry.js +2 -2
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +2 -2
- package/lib/esm-es5/duet-toggle.entry.js +2 -2
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-6313db97.js +4 -0
- package/lib/esm-es5/index-9e6ac831.js +5 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/shadow-css-501eda9a.js +15 -0
- package/lib/esm-es5/{themeable-component-e8fc98bf.js → themeable-component-cb76be7c.js} +0 -0
- package/lib/types/common/a11y-component.d.ts +13 -0
- package/lib/types/{utils → common}/form-components.d.ts +0 -1
- package/lib/types/common/index.d.ts +3 -0
- package/lib/types/{utils → common}/themeable-component.d.ts +0 -0
- package/lib/types/components/duet-action-button/duet-action-button.d.ts +15 -7
- package/lib/types/components/duet-alert/duet-alert.d.ts +1 -1
- package/lib/types/components/duet-badge/duet-badge.d.ts +1 -1
- package/lib/types/components/duet-breadcrumbs/duet-breadcrumb.d.ts +1 -1
- package/lib/types/components/duet-breadcrumbs/duet-breadcrumbs.d.ts +1 -1
- package/lib/types/components/duet-button/duet-button.d.ts +14 -3
- package/lib/types/components/duet-caption/duet-caption.d.ts +1 -1
- package/lib/types/components/duet-card/duet-card.d.ts +1 -1
- package/lib/types/components/duet-checkbox/duet-checkbox.d.ts +14 -3
- package/lib/types/components/duet-choice/duet-choice.d.ts +14 -3
- package/lib/types/components/duet-choice-group/duet-choice-group.d.ts +1 -1
- package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +1 -1
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +1 -1
- package/lib/types/components/duet-cookie-consent/duet-cookie-consent.d.ts +1 -1
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +2 -2
- package/lib/types/components/duet-divider/duet-divider.d.ts +1 -1
- package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +1 -1
- package/lib/types/components/duet-empty-state/duet-empty-state.d.ts +1 -1
- package/lib/types/components/duet-fieldset/duet-fieldset.d.ts +1 -1
- package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
- package/lib/types/components/duet-grid-item/duet-grid-item.d.ts +1 -1
- package/lib/types/components/duet-header/duet-header.d.ts +1 -1
- package/lib/types/components/duet-heading/duet-heading.d.ts +1 -1
- package/lib/types/components/duet-hero/duet-hero.d.ts +1 -1
- package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
- package/lib/types/components/duet-input/duet-input.d.ts +15 -4
- package/lib/types/components/duet-label/duet-label.d.ts +1 -1
- package/lib/types/components/duet-link/duet-link.d.ts +1 -1
- package/lib/types/components/duet-list/duet-list.d.ts +1 -1
- package/lib/types/components/duet-logo/duet-logo.d.ts +1 -1
- package/lib/types/components/duet-modal/duet-modal.d.ts +18 -2
- package/lib/types/components/duet-notification/duet-notification.d.ts +1 -1
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +1 -1
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +14 -4
- package/lib/types/components/duet-pagination/duet-pagination.d.ts +18 -2
- package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +1 -1
- package/lib/types/components/duet-progress/duet-progress.d.ts +14 -2
- package/lib/types/components/duet-radio/duet-radio.d.ts +14 -3
- package/lib/types/components/duet-radio-group/duet-radio-group.d.ts +1 -1
- package/lib/types/components/duet-range-slider/duet-range-slider.d.ts +2 -2
- package/lib/types/components/duet-range-stepper/duet-range-stepper.d.ts +4 -2
- package/lib/types/components/duet-scrollable/duet-scrollable.d.ts +1 -1
- package/lib/types/components/duet-select/duet-select.d.ts +2 -2
- package/lib/types/components/duet-spinner/duet-spinner.d.ts +1 -1
- package/lib/types/components/duet-step/duet-step.d.ts +1 -1
- package/lib/types/components/duet-stepper/duet-stepper.d.ts +1 -1
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +1 -1
- package/lib/types/components/duet-table/duet-table.d.ts +1 -1
- package/lib/types/components/duet-textarea/duet-textarea.d.ts +14 -3
- package/lib/types/components/duet-toggle/duet-toggle.d.ts +14 -3
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +1 -1
- package/lib/types/components/duet-tray/duet-tray.d.ts +1 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +2 -2
- package/lib/types/components.d.ts +520 -112
- package/lib/types/utils/math.utils.d.ts +11 -0
- package/package.json +6 -6
- package/lib/collection/components/duet-number-input/number-input-utils.js +0 -26
- package/lib/duet/p-0fce5ee0.entry.js +0 -4
- package/lib/duet/p-112c7cf4.entry.js +0 -4
- package/lib/duet/p-14940019.entry.js +0 -4
- package/lib/duet/p-1a39ba08.entry.js +0 -4
- package/lib/duet/p-2c66423c.system.entry.js +0 -4
- package/lib/duet/p-3504f285.system.entry.js +0 -4
- package/lib/duet/p-356c2c34.entry.js +0 -4
- package/lib/duet/p-41e0b7a6.entry.js +0 -4
- package/lib/duet/p-46aab89e.entry.js +0 -4
- package/lib/duet/p-539f2a06.system.js +0 -4
- package/lib/duet/p-55376e66.system.entry.js +0 -4
- package/lib/duet/p-56212fca.js +0 -4
- package/lib/duet/p-60931fe2.entry.js +0 -4
- package/lib/duet/p-65256911.entry.js +0 -4
- package/lib/duet/p-6d4f68c7.entry.js +0 -4
- package/lib/duet/p-80d48e3c.entry.js +0 -4
- package/lib/duet/p-92a25fb5.system.js +0 -16
- package/lib/duet/p-934b6e46.entry.js +0 -4
- package/lib/duet/p-aa3a10db.system.entry.js +0 -4
- package/lib/duet/p-b97e1c6e.entry.js +0 -4
- package/lib/duet/p-c94d980f.system.entry.js +0 -4
- package/lib/duet/p-c953e685.entry.js +0 -4
- package/lib/duet/p-cce3f6c1.system.js +0 -4
- package/lib/duet/p-ce973d95.entry.js +0 -4
- package/lib/duet/p-da4808e6.entry.js +0 -4
- package/lib/duet/p-da6ec22c.js +0 -4
- package/lib/duet/p-e70200b0.entry.js +0 -4
- package/lib/duet/p-e93e4714.system.entry.js +0 -4
- package/lib/duet/p-fb9b713b.entry.js +0 -4
- package/lib/duet/p-fec90322.entry.js +0 -4
- package/lib/duet/p-ff54acdd.system.entry.js +0 -4
- package/lib/esm-es5/focus-utils-dbdd6235.js +0 -4
- package/lib/esm-es5/index-33a07cd5.js +0 -4
- package/lib/esm-es5/shadow-css-fbe49d20.js +0 -15
- package/lib/types/components/duet-number-input/number-input-utils.d.ts +0 -4
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, Event, h, Host, Method, Prop, Watch, } from "@stencil/core";
|
|
5
|
+
import { inheritGlobalTheme } from "../../common";
|
|
5
6
|
import { createID } from "../../utils/create-id";
|
|
6
7
|
import { cleanValue } from "../../utils/input-utils";
|
|
7
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
8
8
|
const CharacterCount = ({ value, maxlength, label, theme }) => {
|
|
9
9
|
if (maxlength == null) {
|
|
10
10
|
return;
|
|
@@ -35,6 +35,18 @@ export class DuetTextarea {
|
|
|
35
35
|
* Controls the margin of the component.
|
|
36
36
|
*/
|
|
37
37
|
this.margin = "auto";
|
|
38
|
+
/**
|
|
39
|
+
* Aria Details of the component
|
|
40
|
+
*/
|
|
41
|
+
this.accessibleDetails = undefined;
|
|
42
|
+
/**
|
|
43
|
+
* String of id's that indicate alternative labels elements
|
|
44
|
+
*/
|
|
45
|
+
this.accessibleLabelledBy = undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Aria description the button
|
|
48
|
+
*/
|
|
49
|
+
this.accessibleDescription = undefined;
|
|
38
50
|
/**
|
|
39
51
|
* Theme of the textarea.
|
|
40
52
|
*/
|
|
@@ -185,7 +197,9 @@ export class DuetTextarea {
|
|
|
185
197
|
this.caption && (h("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)),
|
|
186
198
|
h("div", { class: "duet-textarea-wrapper" },
|
|
187
199
|
this.placeholder && this.echoPlaceholder && this.value && (h("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-textarea-placeholder", size: "small" }, this.placeholder)),
|
|
188
|
-
h("textarea", { onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, ref: input => (this.nativeInput = input), class: { "duet-textarea": true, disabled: this.disabled }, value: this.value, disabled: this.disabled, "aria-labelledby":
|
|
200
|
+
h("textarea", { onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, ref: input => (this.nativeInput = input), class: { "duet-textarea": true, disabled: this.disabled }, value: this.value, disabled: this.disabled, "aria-labelledby": this.accessibleLabelledBy
|
|
201
|
+
? `${this.labelId} ${this.errorId} ${this.accessibleLabelledBy}`
|
|
202
|
+
: `${this.labelId} ${this.errorId} `, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": `${this.isCaptionVisible ? this.topCaptionId : ""} ${this.accessibleDescribedBy}`, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, placeholder: this.placeholder, spellcheck: "false", required: this.required, minlength: this.minlength, maxlength: this.maxlength, role: this.role, name: this.name, id: identifier })),
|
|
189
203
|
h("duet-grid", { alignment: "stretch" },
|
|
190
204
|
h("duet-grid-item", { margin: "none", fill: true },
|
|
191
205
|
h("div", { class: "duet-textarea-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error))),
|
|
@@ -274,6 +288,60 @@ export class DuetTextarea {
|
|
|
274
288
|
"attribute": "accessible-controls",
|
|
275
289
|
"reflect": false
|
|
276
290
|
},
|
|
291
|
+
"accessibleDetails": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"mutable": false,
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "string",
|
|
296
|
+
"resolved": "string",
|
|
297
|
+
"references": {}
|
|
298
|
+
},
|
|
299
|
+
"required": false,
|
|
300
|
+
"optional": false,
|
|
301
|
+
"docs": {
|
|
302
|
+
"tags": [],
|
|
303
|
+
"text": "Aria Details of the component"
|
|
304
|
+
},
|
|
305
|
+
"attribute": "accessible-details",
|
|
306
|
+
"reflect": false,
|
|
307
|
+
"defaultValue": "undefined"
|
|
308
|
+
},
|
|
309
|
+
"accessibleLabelledBy": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"mutable": false,
|
|
312
|
+
"complexType": {
|
|
313
|
+
"original": "string",
|
|
314
|
+
"resolved": "string",
|
|
315
|
+
"references": {}
|
|
316
|
+
},
|
|
317
|
+
"required": false,
|
|
318
|
+
"optional": false,
|
|
319
|
+
"docs": {
|
|
320
|
+
"tags": [],
|
|
321
|
+
"text": "String of id's that indicate alternative labels elements"
|
|
322
|
+
},
|
|
323
|
+
"attribute": "accessible-labelled-by",
|
|
324
|
+
"reflect": false,
|
|
325
|
+
"defaultValue": "undefined"
|
|
326
|
+
},
|
|
327
|
+
"accessibleDescription": {
|
|
328
|
+
"type": "string",
|
|
329
|
+
"mutable": false,
|
|
330
|
+
"complexType": {
|
|
331
|
+
"original": "string",
|
|
332
|
+
"resolved": "string",
|
|
333
|
+
"references": {}
|
|
334
|
+
},
|
|
335
|
+
"required": false,
|
|
336
|
+
"optional": false,
|
|
337
|
+
"docs": {
|
|
338
|
+
"tags": [],
|
|
339
|
+
"text": "Aria description the button"
|
|
340
|
+
},
|
|
341
|
+
"attribute": "accessible-description",
|
|
342
|
+
"reflect": false,
|
|
343
|
+
"defaultValue": "undefined"
|
|
344
|
+
},
|
|
277
345
|
"accessibleOwns": {
|
|
278
346
|
"type": "string",
|
|
279
347
|
"mutable": false,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, Event, h, Host, Method, Prop, Watch } from "@stencil/core";
|
|
5
|
+
import { inheritGlobalTheme } from "../../common";
|
|
5
6
|
import { createID } from "../../utils/create-id";
|
|
6
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
7
7
|
export class DuetToggle {
|
|
8
8
|
constructor() {
|
|
9
9
|
/**
|
|
@@ -18,6 +18,18 @@ export class DuetToggle {
|
|
|
18
18
|
* Controls the margin of the component.
|
|
19
19
|
*/
|
|
20
20
|
this.margin = "auto";
|
|
21
|
+
/**
|
|
22
|
+
* Aria Details of the component
|
|
23
|
+
*/
|
|
24
|
+
this.accessibleDetails = undefined;
|
|
25
|
+
/**
|
|
26
|
+
* String of id's that indicate alternative labels elements
|
|
27
|
+
*/
|
|
28
|
+
this.accessibleLabelledBy = undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Aria description the button
|
|
31
|
+
*/
|
|
32
|
+
this.accessibleDescription = undefined;
|
|
21
33
|
/**
|
|
22
34
|
* Label for the toggle.
|
|
23
35
|
*/
|
|
@@ -83,7 +95,7 @@ export class DuetToggle {
|
|
|
83
95
|
} },
|
|
84
96
|
h("duet-label", { theme: this.theme, for: identifier }, this.label),
|
|
85
97
|
h("label", { class: "duet-switch", htmlFor: identifier },
|
|
86
|
-
h("input", { type: "checkbox", value: this.value, "aria-controls": this.accessibleControls, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, id: identifier, role: this.role, name: this.name, checked: this.checked, required: this.required, disabled: this.disabled, ref: input => (this.nativeInput = input) }),
|
|
98
|
+
h("input", { type: "checkbox", value: this.value, "aria-controls": this.accessibleControls, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, id: identifier, role: this.role, name: this.name, checked: this.checked, required: this.required, disabled: this.disabled, ref: input => (this.nativeInput = input) }),
|
|
87
99
|
h("div", { class: "duet-slider" })))));
|
|
88
100
|
}
|
|
89
101
|
static get is() { return "duet-toggle"; }
|
|
@@ -209,6 +221,60 @@ export class DuetToggle {
|
|
|
209
221
|
"attribute": "accessible-described-by",
|
|
210
222
|
"reflect": false
|
|
211
223
|
},
|
|
224
|
+
"accessibleDetails": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"mutable": false,
|
|
227
|
+
"complexType": {
|
|
228
|
+
"original": "string",
|
|
229
|
+
"resolved": "string",
|
|
230
|
+
"references": {}
|
|
231
|
+
},
|
|
232
|
+
"required": false,
|
|
233
|
+
"optional": false,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "Aria Details of the component"
|
|
237
|
+
},
|
|
238
|
+
"attribute": "accessible-details",
|
|
239
|
+
"reflect": false,
|
|
240
|
+
"defaultValue": "undefined"
|
|
241
|
+
},
|
|
242
|
+
"accessibleLabelledBy": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"mutable": false,
|
|
245
|
+
"complexType": {
|
|
246
|
+
"original": "string",
|
|
247
|
+
"resolved": "string",
|
|
248
|
+
"references": {}
|
|
249
|
+
},
|
|
250
|
+
"required": false,
|
|
251
|
+
"optional": false,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": "String of id's that indicate alternative labels elements"
|
|
255
|
+
},
|
|
256
|
+
"attribute": "accessible-labelled-by",
|
|
257
|
+
"reflect": false,
|
|
258
|
+
"defaultValue": "undefined"
|
|
259
|
+
},
|
|
260
|
+
"accessibleDescription": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"mutable": false,
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "string",
|
|
265
|
+
"resolved": "string",
|
|
266
|
+
"references": {}
|
|
267
|
+
},
|
|
268
|
+
"required": false,
|
|
269
|
+
"optional": false,
|
|
270
|
+
"docs": {
|
|
271
|
+
"tags": [],
|
|
272
|
+
"text": "Aria description the button"
|
|
273
|
+
},
|
|
274
|
+
"attribute": "accessible-description",
|
|
275
|
+
"reflect": false,
|
|
276
|
+
"defaultValue": "undefined"
|
|
277
|
+
},
|
|
212
278
|
"label": {
|
|
213
279
|
"type": "string",
|
|
214
280
|
"mutable": false,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, h, Host, Listen, Prop, State, Watch } from "@stencil/core";
|
|
5
|
+
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
5
6
|
import { createID } from "../../utils/create-id";
|
|
6
7
|
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
7
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
8
8
|
export class DuetTooltip {
|
|
9
9
|
constructor() {
|
|
10
10
|
/**
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { sizeHeader } from "@duetds/tokens";
|
|
5
5
|
import { Component, Element, Fragment, h, Listen, Prop, State } from "@stencil/core";
|
|
6
|
+
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
6
7
|
import { createID } from "../../utils/create-id";
|
|
7
8
|
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
8
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
9
9
|
const topOffset = parseFloat(sizeHeader) * 2 * 16; // convert rem -> px
|
|
10
10
|
/**
|
|
11
11
|
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, Event, h, Host, Method, Prop, State, Watch } from "@stencil/core";
|
|
5
|
+
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
5
6
|
import { createID } from "../../utils/create-id";
|
|
6
7
|
import { debounce } from "../../utils/js-utils";
|
|
7
8
|
import { getLocaleString, sanitizeString } from "../../utils/language-utils";
|
|
8
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
9
9
|
import { getError, getI18nError } from "./errorcodes.utils";
|
|
10
10
|
import { ErrorItem } from "./upload-editable-item-error";
|
|
11
11
|
import { ProgressItem } from "./upload-editable-item-inprogres";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* function that takes a string value or number and looks for any character resembling a minus,
|
|
6
|
+
* it will then replace it with a hypen-minus and return the parseFloat value of that string
|
|
7
|
+
* it will string / number cast the value to a number and return that number
|
|
8
|
+
* known issues: if a negative number is indicated with other characters than a "minus like" character, it will throw
|
|
9
|
+
* - an example is that some locales use (number) as an indicator for negative values instead of -number
|
|
10
|
+
*/
|
|
11
|
+
export function SafeParseFloat(value, locale) {
|
|
12
|
+
let results;
|
|
13
|
+
if (typeof value === "string") {
|
|
14
|
+
//the minuses are NOT the same characters, they differ in unicode for some languages
|
|
15
|
+
// "‐", "−", "–", and "—"
|
|
16
|
+
let convertedMinus = value.replace("−", "-").replace("‐", "-").replace("−", "-").replace("–", "-").replace("—", "-");
|
|
17
|
+
if (locale) {
|
|
18
|
+
convertedMinus = ConvertToEnUS(convertedMinus, locale, false);
|
|
19
|
+
}
|
|
20
|
+
// replace all possible spaces from the string
|
|
21
|
+
convertedMinus = convertedMinus.replace(/\s+/g, "");
|
|
22
|
+
convertedMinus = convertedMinus.replace(/(?!^-?\d*\.{0,1}\d+$)/g, "");
|
|
23
|
+
/*
|
|
24
|
+
example: https://regex101.com/r/np7FqS/1
|
|
25
|
+
/(?!^-?\d*\.{0,1}\d+$)/g
|
|
26
|
+
Negative Lookahead (?!^-?\d*\.{0,1}\d+$)
|
|
27
|
+
Assert that the Regex below does not match
|
|
28
|
+
^ asserts position at start of a line
|
|
29
|
+
- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
|
|
30
|
+
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
|
|
31
|
+
\d matches a digit (equivalent to [0-9])
|
|
32
|
+
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
|
|
33
|
+
\. matches the character . with index 4610 (2E16 or 568) literally (case sensitive)
|
|
34
|
+
{0,1} matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
|
|
35
|
+
\d matches a digit (equivalent to [0-9])
|
|
36
|
+
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
|
|
37
|
+
$ asserts position at the end of a line
|
|
38
|
+
Global pattern flags
|
|
39
|
+
g modifier: global. All matches (don't return after first match)
|
|
40
|
+
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
|
|
41
|
+
*/
|
|
42
|
+
results = parseFloat(convertedMinus);
|
|
43
|
+
}
|
|
44
|
+
if (typeof value === "number") {
|
|
45
|
+
results = parseFloat(String(value));
|
|
46
|
+
}
|
|
47
|
+
if (!isNaN(Number(results))) {
|
|
48
|
+
return Number(results);
|
|
49
|
+
}
|
|
50
|
+
if (value === null || value === undefined) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
throw new Error("Invalid value passed to SafeParseFloat");
|
|
54
|
+
}
|
|
55
|
+
// string conversion function that takes a locale and coverts decimal indicator to en-US indicator
|
|
56
|
+
// and takes the thousand separator for the given locale and transforms that to the en-US separator
|
|
57
|
+
export function ConvertToEnUS(value, locale, replaceThousands = false) {
|
|
58
|
+
let replacedValue;
|
|
59
|
+
const localeSeparator = new Intl.NumberFormat(locale).format(1 / 2).replace(/[0-9]/g, "");
|
|
60
|
+
const enUSSeparator = new Intl.NumberFormat("en-US").format(1 / 2).replace(/[0-9]/g, "");
|
|
61
|
+
const thousandSeparator = new Intl.NumberFormat(locale).format(1000).replace(/[0-9]/g, "");
|
|
62
|
+
const enUSThousandSeparator = new Intl.NumberFormat("en-US").format(1000).replace(/[0-9]/g, "");
|
|
63
|
+
// double conversions to avoid ,->. and .->, at the same time resulting in a double conversion
|
|
64
|
+
replacedValue = value.replace(localeSeparator, "DECIMALSEPARATOR");
|
|
65
|
+
if (replaceThousands) {
|
|
66
|
+
replacedValue = replacedValue.replace(thousandSeparator, "THOUSANDSEPARATOR");
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
replacedValue = replacedValue.replace(thousandSeparator, "");
|
|
70
|
+
}
|
|
71
|
+
replacedValue = replacedValue.replace("DECIMALSEPARATOR", enUSSeparator);
|
|
72
|
+
replacedValue = replacedValue.replace("THOUSANDSEPARATOR", enUSThousandSeparator);
|
|
73
|
+
return replacedValue;
|
|
74
|
+
}
|
|
75
|
+
export const roundTo = (val, multiple) => Math.round(val / multiple) * multiple;
|
|
76
|
+
export const clamp = (val, min, max) => Math.min(Math.max(val, min), max);
|