q2-tecton-elements 1.51.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere_2.cjs.entry.js +16 -5
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-9aa4a776.js → index-07285783.js} +86 -2
- package/dist/cjs/index-07285783.js.map +1 -0
- package/dist/cjs/{index-14c3693c.js → index-e7e68b1e.js} +40 -5
- package/dist/cjs/index-e7e68b1e.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q2-action-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-action-sheet.cjs.entry.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge_7.cjs.entry.js +49 -44
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +17 -20
- package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +4 -2
- package/dist/cjs/q2-card.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +4 -4
- package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +16 -3
- package/dist/cjs/q2-chart-area.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-donut.cjs.entry.js +19 -3
- package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -5
- package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/q2-currency.cjs.entry.js +14 -2
- package/dist/cjs/q2-currency.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +3 -3
- package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +3 -3
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +12 -14
- package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +7 -5
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +3 -3
- package/dist/cjs/q2-example.cjs.entry.js +145 -0
- package/dist/cjs/q2-example.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-formatted-text.cjs.entry.js +2 -2
- package/dist/cjs/q2-item.cjs.entry.js +3 -3
- package/dist/cjs/q2-legend.cjs.entry.js +2 -2
- package/dist/cjs/q2-link.cjs.entry.js +4 -4
- package/dist/cjs/q2-link.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-list.cjs.entry.js +6 -7
- package/dist/cjs/q2-list.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-loading-element.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +52 -3
- package/dist/cjs/q2-loc.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +3 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +4 -4
- package/dist/cjs/q2-optgroup.cjs.entry.js +5 -4
- package/dist/cjs/q2-optgroup.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +50 -33
- package/dist/cjs/q2-option.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +11 -7
- package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +19 -18
- package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-radio-group.cjs.entry.js +5 -5
- package/dist/cjs/q2-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +3 -3
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-resize-observer.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +8 -6
- package/dist/cjs/q2-section.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +6 -5
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +5 -4
- package/dist/cjs/q2-stepper-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +16 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +6 -4
- package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +6 -4
- package/dist/cjs/q2-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +2 -2
- package/dist/cjs/q2-textarea.cjs.entry.js +3 -3
- package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{shapes-be198cc0.js → shapes-5d45fc11.js} +2 -2
- package/dist/cjs/{shapes-be198cc0.js.map → shapes-5d45fc11.js.map} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +16 -18
- package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +27 -0
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-card/q2-card.js +2 -0
- package/dist/collection/components/q2-card/q2-card.js.map +1 -1
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +42 -1
- package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js +15 -0
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +41 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js +11 -0
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +30 -23
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +4 -3
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +37 -1
- package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
- package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js +34 -23
- package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js +6 -4
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.css +5 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +10 -4
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +59 -14
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.css +29 -11
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +9 -11
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js +108 -74
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
- package/dist/collection/components/q2-example/q2-example.css +66 -0
- package/dist/collection/components/q2-example/q2-example.js +312 -0
- package/dist/collection/components/q2-example/q2-example.js.map +1 -0
- package/dist/collection/components/q2-example/test/q2-example.e2e.js +27 -0
- package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -0
- package/dist/collection/components/q2-example/test/q2-example.spec.js +126 -0
- package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -0
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-input/formatting/alpha.spec.js +10 -0
- package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/currency.spec.js +20 -0
- package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/date.spec.js +17 -0
- package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/numeric.spec.js +32 -0
- package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/phone.spec.js +16 -0
- package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/postal.spec.js +28 -0
- package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/ssn.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/tin.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -0
- package/dist/collection/components/q2-input/q2-input.js +58 -44
- package/dist/collection/components/q2-input/q2-input.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.e2e.js +259 -2106
- package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js +4035 -0
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -0
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-link/q2-link.css +17 -20
- package/dist/collection/components/q2-link/q2-link.js +2 -2
- package/dist/collection/components/q2-link/q2-link.js.map +1 -1
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js +6 -6
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-list/q2-list.js +4 -5
- package/dist/collection/components/q2-list/q2-list.js.map +1 -1
- package/dist/collection/components/q2-loc/q2-loc.js +66 -4
- package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js +19 -30
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js +164 -0
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -0
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +3 -2
- package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
- package/dist/collection/components/q2-option/q2-option.css +1 -1
- package/dist/collection/components/q2-option/q2-option.js +57 -34
- package/dist/collection/components/q2-option/q2-option.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js +110 -106
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js +532 -0
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -0
- package/dist/collection/components/q2-pagination/q2-pagination.js +9 -5
- package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +18 -1
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-pill/q2-pill.js +18 -17
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +128 -57
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +17 -4
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +19 -9
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +2 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +6 -4
- package/dist/collection/components/q2-section/q2-section.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +5 -3
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +123 -62
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +4 -2
- package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +3 -2
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +46 -2
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js +26 -0
- package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +4 -3
- package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +5 -2
- package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +55 -4
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/collection/utils/helpers.js +63 -41
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/index.js +83 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +84 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-group.js +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-calendar.js +16 -18
- package/dist/components/q2-calendar.js.map +1 -1
- package/dist/components/q2-card.js +2 -0
- package/dist/components/q2-card.js.map +1 -1
- package/dist/components/q2-carousel-pane.js +2 -2
- package/dist/components/q2-chart-area.js +16 -2
- package/dist/components/q2-chart-area.js.map +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +19 -2
- package/dist/components/q2-chart-donut.js.map +1 -1
- package/dist/components/q2-checkbox-group.js +5 -4
- package/dist/components/q2-checkbox-group.js.map +1 -1
- package/dist/components/q2-currency.js +15 -2
- package/dist/components/q2-currency.js.map +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-data-table.js.map +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown-item2.js +12 -26
- package/dist/components/q2-dropdown-item2.js.map +1 -1
- package/dist/components/q2-dropdown.js +6 -3
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-example.d.ts +11 -0
- package/dist/components/q2-example.js +170 -0
- package/dist/components/q2-example.js.map +1 -0
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-input2.js +41 -37
- package/dist/components/q2-input2.js.map +1 -1
- package/dist/components/q2-item.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-link.js +3 -3
- package/dist/components/q2-link.js.map +1 -1
- package/dist/components/q2-list.js +4 -5
- package/dist/components/q2-list.js.map +1 -1
- package/dist/components/q2-loc.js +55 -2
- package/dist/components/q2-loc.js.map +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-optgroup2.js +3 -2
- package/dist/components/q2-optgroup2.js.map +1 -1
- package/dist/components/q2-option-list2.js +1 -1
- package/dist/components/q2-option2.js +52 -33
- package/dist/components/q2-option2.js.map +1 -1
- package/dist/components/q2-pagination.js +9 -5
- package/dist/components/q2-pagination.js.map +1 -1
- package/dist/components/q2-pill.js +18 -17
- package/dist/components/q2-pill.js.map +1 -1
- package/dist/components/q2-popover2.js +16 -4
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-radio-group.js +3 -3
- package/dist/components/q2-radio-group.js.map +1 -1
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +6 -4
- package/dist/components/q2-section.js.map +1 -1
- package/dist/components/q2-select2.js +6 -4
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-stepper-pane.js +3 -2
- package/dist/components/q2-stepper-pane.js.map +1 -1
- package/dist/components/q2-stepper-vertical.js +16 -3
- package/dist/components/q2-stepper-vertical.js.map +1 -1
- package/dist/components/q2-stepper.js +4 -2
- package/dist/components/q2-stepper.js.map +1 -1
- package/dist/components/q2-tab-container.js +4 -3
- package/dist/components/q2-tab-container.js.map +1 -1
- package/dist/components/q2-tab-pane.js +1 -1
- package/dist/components/q2-tag.js +5 -2
- package/dist/components/q2-tag.js.map +1 -1
- package/dist/components/q2-textarea.js +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/click-elsewhere_2.entry.js +16 -5
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/{index-1e1ce94e.js → index-7a5365e2.js} +40 -5
- package/dist/esm/index-7a5365e2.js.map +1 -0
- package/dist/esm/{index-844fc010.js → index-d18e2a20.js} +86 -3
- package/dist/esm/index-d18e2a20.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q2-action-group.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +3 -3
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge_7.entry.js +49 -44
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +17 -20
- package/dist/esm/q2-calendar.entry.js.map +1 -1
- package/dist/esm/q2-card.entry.js +4 -2
- package/dist/esm/q2-card.entry.js.map +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +4 -4
- package/dist/esm/q2-carousel.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +16 -3
- package/dist/esm/q2-chart-area.entry.js.map +1 -1
- package/dist/esm/q2-chart-bar.entry.js +3 -3
- package/dist/esm/q2-chart-donut.entry.js +19 -3
- package/dist/esm/q2-chart-donut.entry.js.map +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +6 -5
- package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
- package/dist/esm/q2-checkbox.entry.js +2 -2
- package/dist/esm/q2-currency.entry.js +14 -2
- package/dist/esm/q2-currency.entry.js.map +1 -1
- package/dist/esm/q2-data-table.entry.js +3 -3
- package/dist/esm/q2-data-table.entry.js.map +1 -1
- package/dist/esm/q2-detail.entry.js +3 -3
- package/dist/esm/q2-dropdown-item.entry.js +12 -14
- package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +7 -5
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +3 -3
- package/dist/esm/q2-example.entry.js +141 -0
- package/dist/esm/q2-example.entry.js.map +1 -0
- package/dist/esm/q2-formatted-text.entry.js +2 -2
- package/dist/esm/q2-item.entry.js +3 -3
- package/dist/esm/q2-legend.entry.js +2 -2
- package/dist/esm/q2-link.entry.js +4 -4
- package/dist/esm/q2-link.entry.js.map +1 -1
- package/dist/esm/q2-list.entry.js +6 -7
- package/dist/esm/q2-list.entry.js.map +1 -1
- package/dist/esm/q2-loading-element.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +52 -3
- package/dist/esm/q2-loc.entry.js.map +1 -1
- package/dist/esm/q2-message.entry.js +3 -3
- package/dist/esm/q2-month-picker.entry.js +4 -4
- package/dist/esm/q2-optgroup.entry.js +5 -4
- package/dist/esm/q2-optgroup.entry.js.map +1 -1
- package/dist/esm/q2-option-list.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +50 -33
- package/dist/esm/q2-option.entry.js.map +1 -1
- package/dist/esm/q2-pagination.entry.js +11 -7
- package/dist/esm/q2-pagination.entry.js.map +1 -1
- package/dist/esm/q2-pill.entry.js +19 -18
- package/dist/esm/q2-pill.entry.js.map +1 -1
- package/dist/esm/q2-radio-group.entry.js +5 -5
- package/dist/esm/q2-radio-group.entry.js.map +1 -1
- package/dist/esm/q2-radio.entry.js +3 -3
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-resize-observer.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +8 -6
- package/dist/esm/q2-section.entry.js.map +1 -1
- package/dist/esm/q2-select.entry.js +6 -5
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +5 -4
- package/dist/esm/q2-stepper-pane.entry.js.map +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +16 -4
- package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
- package/dist/esm/q2-stepper.entry.js +6 -4
- package/dist/esm/q2-stepper.entry.js.map +1 -1
- package/dist/esm/q2-tag.entry.js +6 -4
- package/dist/esm/q2-tag.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +3 -3
- package/dist/esm/q2-tooltip.entry.js +2 -2
- package/dist/esm/{shapes-36183b2a.js → shapes-c7e1a3fa.js} +2 -2
- package/dist/esm/{shapes-36183b2a.js.map → shapes-c7e1a3fa.js.map} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +3 -3
- package/dist/q2-tecton-elements/action-sheet-e64cb6f7.js +77 -0
- package/dist/q2-tecton-elements/{p-b7554a79.js.map → action-sheet-e64cb6f7.js.map} +1 -1
- package/dist/q2-tecton-elements/app-globals-0f993ce5.js +4 -0
- package/dist/q2-tecton-elements/{p-e1255160.js.map → app-globals-0f993ce5.js.map} +1 -1
- package/dist/q2-tecton-elements/charting-1abfb877.js +34872 -0
- package/dist/q2-tecton-elements/{p-2941aafa.js.map → charting-1abfb877.js.map} +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +410 -0
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -0
- package/dist/q2-tecton-elements/dataSample-7b62e101.js +2602 -0
- package/dist/q2-tecton-elements/{p-ad80aef0.js.map → dataSample-7b62e101.js.map} +1 -1
- package/dist/q2-tecton-elements/index-3184c760.js +18168 -0
- package/dist/q2-tecton-elements/{p-f1e887f5.js.map → index-3184c760.js.map} +1 -1
- package/dist/q2-tecton-elements/index-7a5365e2.js +1792 -0
- package/dist/q2-tecton-elements/index-7a5365e2.js.map +1 -0
- package/dist/q2-tecton-elements/index-d18e2a20.js +323 -0
- package/dist/q2-tecton-elements/index-d18e2a20.js.map +1 -0
- package/dist/q2-tecton-elements/q2-action-group.entry.js +56 -0
- package/dist/q2-tecton-elements/{p-5637c486.entry.js.map → q2-action-group.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1480 -0
- package/dist/q2-tecton-elements/{p-188eb162.entry.js.map → q2-action-sheet.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-avatar.entry.js +101 -0
- package/dist/q2-tecton-elements/{p-07d1c3ae.entry.js.map → q2-avatar.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +5449 -0
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-calendar.entry.js +1313 -0
- package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-card.entry.js +170 -0
- package/dist/q2-tecton-elements/q2-card.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +130 -0
- package/dist/q2-tecton-elements/{p-7aef0c08.entry.js.map → q2-carousel-pane.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +4613 -0
- package/dist/q2-tecton-elements/{p-e216ef3f.entry.js.map → q2-carousel.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +4330 -0
- package/dist/q2-tecton-elements/q2-chart-area.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +1479 -0
- package/dist/q2-tecton-elements/{p-7906f49e.entry.js.map → q2-chart-bar.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +4537 -0
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +166 -0
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +223 -0
- package/dist/q2-tecton-elements/{p-b7de110e.entry.js.map → q2-checkbox.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-currency.entry.js +153 -0
- package/dist/q2-tecton-elements/q2-currency.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-data-table.entry.js +622 -0
- package/dist/q2-tecton-elements/{p-7903cd15.entry.js.map → q2-data-table.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +128 -0
- package/dist/q2-tecton-elements/{p-f5f23659.entry.js.map → q2-detail.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +146 -0
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +432 -0
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +296 -0
- package/dist/q2-tecton-elements/{p-896c7008.entry.js.map → q2-editable-field.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-example.entry.js +152 -0
- package/dist/q2-tecton-elements/q2-example.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +73 -0
- package/dist/q2-tecton-elements/{p-7c9f8b62.entry.js.map → q2-formatted-text.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +158 -0
- package/dist/q2-tecton-elements/{p-7c9a0122.entry.js.map → q2-item.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-legend.entry.js +146 -0
- package/dist/q2-tecton-elements/{p-ff8f1a32.entry.js.map → q2-legend.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-link.entry.js +83 -0
- package/dist/q2-tecton-elements/q2-link.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-list.entry.js +100 -0
- package/dist/q2-tecton-elements/q2-list.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-loading-element.entry.js +36 -0
- package/dist/q2-tecton-elements/{p-a068c84c.entry.js.map → q2-loading-element.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +82 -0
- package/dist/q2-tecton-elements/q2-loc.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-message.entry.js +99 -0
- package/dist/q2-tecton-elements/{p-8d2b02e1.entry.js.map → q2-message.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +198 -0
- package/dist/q2-tecton-elements/{p-8d07cf91.entry.js.map → q2-month-picker.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +88 -0
- package/dist/q2-tecton-elements/q2-optgroup.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-option-list.entry.js +585 -0
- package/dist/q2-tecton-elements/{p-a5d0e252.entry.js.map → q2-option-list.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +110 -0
- package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-pagination.entry.js +377 -0
- package/dist/q2-tecton-elements/q2-pagination.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-pill.entry.js +434 -0
- package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +227 -0
- package/dist/q2-tecton-elements/q2-radio-group.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-radio.entry.js +144 -0
- package/dist/q2-tecton-elements/{p-c235ab3f.entry.js.map → q2-radio.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +162 -0
- package/dist/q2-tecton-elements/{p-95a7c042.entry.js.map → q2-relative-time.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +100 -0
- package/dist/q2-tecton-elements/{p-e2c800ef.entry.js.map → q2-resize-observer.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +256 -0
- package/dist/q2-tecton-elements/q2-section.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-select.entry.js +684 -0
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +124 -0
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +356 -0
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper.entry.js +332 -0
- package/dist/q2-tecton-elements/q2-stepper.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tag.entry.js +213 -0
- package/dist/q2-tecton-elements/q2-tag.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +21 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +364 -0
- package/dist/q2-tecton-elements/{p-f135b265.entry.js.map → q2-textarea.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +105 -0
- package/dist/q2-tecton-elements/{p-c5667d5d.entry.js.map → q2-tooltip.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/sectorHelper-183cedd0.js +949 -0
- package/dist/q2-tecton-elements/{p-eea5aa01.js.map → sectorHelper-183cedd0.js.map} +1 -1
- package/dist/q2-tecton-elements/shapes-c7e1a3fa.js +132 -0
- package/dist/q2-tecton-elements/{p-50b425de.js.map → shapes-c7e1a3fa.js.map} +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +134 -0
- package/dist/q2-tecton-elements/{p-96b1406c.entry.js.map → tecton-tab-pane.entry.js.map} +1 -1
- package/dist/types/components/q2-calendar/q2-calendar.d.ts +4 -5
- package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +6 -0
- package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +6 -0
- package/dist/types/components/q2-currency/q2-currency.d.ts +7 -0
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +1 -1
- package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +2 -2
- package/dist/types/components/q2-example/q2-example.d.ts +119 -0
- package/dist/types/components/q2-input/formatting/date.d.ts +22 -0
- package/dist/types/components/q2-input/formatting/postal.d.ts +197 -0
- package/dist/types/components/q2-input/q2-input.d.ts +15 -12
- package/dist/types/components/q2-loc/q2-loc.d.ts +15 -1
- package/dist/types/components/q2-option/q2-option.d.ts +11 -3
- package/dist/types/components/q2-pill/q2-pill.d.ts +3 -3
- package/dist/types/components/q2-popover/q2-popover.d.ts +1 -0
- package/dist/types/components/q2-select/q2-select.d.ts +1 -1
- package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +6 -0
- package/dist/types/components/q2-tag/q2-tag.d.ts +1 -1
- package/dist/types/components.d.ts +104 -14
- package/dist/types/utils/helpers.d.ts +13 -0
- package/dist/types/utils/index.d.ts +11 -0
- package/package.json +7 -7
- package/dist/cjs/index-14c3693c.js.map +0 -1
- package/dist/cjs/index-9aa4a776.js.map +0 -1
- package/dist/esm/index-1e1ce94e.js.map +0 -1
- package/dist/esm/index-844fc010.js.map +0 -1
- package/dist/q2-tecton-elements/p-06701928.entry.js +0 -2
- package/dist/q2-tecton-elements/p-06701928.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-07d1c3ae.entry.js +0 -2
- package/dist/q2-tecton-elements/p-15ac45d6.js +0 -2
- package/dist/q2-tecton-elements/p-15ac45d6.js.map +0 -1
- package/dist/q2-tecton-elements/p-16910682.entry.js +0 -2
- package/dist/q2-tecton-elements/p-16910682.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-188eb162.entry.js +0 -3
- package/dist/q2-tecton-elements/p-1c760a89.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1c760a89.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-1c88d057.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1c88d057.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-20a3d6ed.entry.js +0 -2
- package/dist/q2-tecton-elements/p-20a3d6ed.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-2733583e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-2733583e.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-2941aafa.js +0 -39
- package/dist/q2-tecton-elements/p-3e428290.entry.js +0 -2
- package/dist/q2-tecton-elements/p-3e428290.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4774e5b3.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4774e5b3.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-490ef8e5.entry.js +0 -2
- package/dist/q2-tecton-elements/p-490ef8e5.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4e10550d.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4e10550d.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-50b425de.js +0 -2
- package/dist/q2-tecton-elements/p-50f7328f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-50f7328f.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5637c486.entry.js +0 -2
- package/dist/q2-tecton-elements/p-56df21b0.entry.js +0 -2
- package/dist/q2-tecton-elements/p-56df21b0.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5a834214.entry.js +0 -2
- package/dist/q2-tecton-elements/p-5a834214.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5f99a4a8.entry.js +0 -2
- package/dist/q2-tecton-elements/p-5f99a4a8.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-72d948b4.entry.js +0 -2
- package/dist/q2-tecton-elements/p-72d948b4.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-7903cd15.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7906f49e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7aef0c08.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7c9a0122.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7c9f8b62.entry.js +0 -2
- package/dist/q2-tecton-elements/p-81fbe718.entry.js +0 -2
- package/dist/q2-tecton-elements/p-81fbe718.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-896c7008.entry.js +0 -2
- package/dist/q2-tecton-elements/p-8d07cf91.entry.js +0 -2
- package/dist/q2-tecton-elements/p-8d2b02e1.entry.js +0 -2
- package/dist/q2-tecton-elements/p-95a7c042.entry.js +0 -2
- package/dist/q2-tecton-elements/p-96b1406c.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a068c84c.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a47597dd.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a47597dd.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-a5d0e252.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a5f18e27.js +0 -3
- package/dist/q2-tecton-elements/p-a5f18e27.js.map +0 -1
- package/dist/q2-tecton-elements/p-ac6aa392.entry.js +0 -2
- package/dist/q2-tecton-elements/p-ac6aa392.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ad057d10.entry.js +0 -2
- package/dist/q2-tecton-elements/p-ad057d10.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ad798287.entry.js +0 -2
- package/dist/q2-tecton-elements/p-ad798287.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ad80aef0.js +0 -2
- package/dist/q2-tecton-elements/p-b0e5e9dc.entry.js +0 -2
- package/dist/q2-tecton-elements/p-b0e5e9dc.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-b1784be3.entry.js +0 -2
- package/dist/q2-tecton-elements/p-b1784be3.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-b7554a79.js +0 -2
- package/dist/q2-tecton-elements/p-b7de110e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-c235ab3f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-c5667d5d.entry.js +0 -2
- package/dist/q2-tecton-elements/p-e1255160.js +0 -2
- package/dist/q2-tecton-elements/p-e216ef3f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-e2c800ef.entry.js +0 -2
- package/dist/q2-tecton-elements/p-eea5aa01.js +0 -2
- package/dist/q2-tecton-elements/p-f135b265.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f1e887f5.js +0 -2
- package/dist/q2-tecton-elements/p-f5f23659.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f7867f21.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f7867f21.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ff8f1a32.entry.js +0 -2
- package/dist/q2-tecton-elements/p-fff01dc1.entry.js +0 -2
- package/dist/q2-tecton-elements/p-fff01dc1.entry.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import formatNumeric, { formatPercentage } from "./numeric";
|
|
2
|
+
describe('formatNumeric', () => {
|
|
3
|
+
it('should format numeric values correctly', () => {
|
|
4
|
+
expect(formatNumeric('12345', 'integer').fullyFormattedValue).toBe('12345');
|
|
5
|
+
expect(formatNumeric('12345.678', '2decimal').fullyFormattedValue).toBe('123456.78');
|
|
6
|
+
expect(formatNumeric('12345', 'integer-delimited').fullyFormattedValue).toBe('12,345');
|
|
7
|
+
expect(formatNumeric('12345', 'integer-positive').fullyFormattedValue).toBe('12345');
|
|
8
|
+
expect(formatNumeric('12345', 'integer-delimited-positive').fullyFormattedValue).toBe('12,345');
|
|
9
|
+
expect(formatNumeric('12345.678', '2decimal-delimited').fullyFormattedValue).toBe('123,456.78');
|
|
10
|
+
expect(formatNumeric('12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78');
|
|
11
|
+
expect(formatNumeric('12345.678', '2decimal-delimited-positive').fullyFormattedValue).toBe('123,456.78');
|
|
12
|
+
});
|
|
13
|
+
it('should format negative numeric values correctly', () => {
|
|
14
|
+
expect(formatNumeric('-12345', 'integer').fullyFormattedValue).toBe('-12345');
|
|
15
|
+
expect(formatNumeric('-12345.678', '2decimal').fullyFormattedValue).toBe('-123456.78');
|
|
16
|
+
expect(formatNumeric('-12345', 'integer-delimited').fullyFormattedValue).toBe('-12,345');
|
|
17
|
+
expect(formatNumeric('-12345.678', '2decimal-delimited').fullyFormattedValue).toBe('-123,456.78');
|
|
18
|
+
});
|
|
19
|
+
it('should handle negative numbers with positive-only modifiers', () => {
|
|
20
|
+
expect(formatNumeric('-12345', 'integer-positive').fullyFormattedValue).toBe('12345');
|
|
21
|
+
expect(formatNumeric('-12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe('formatPercentage', () => {
|
|
25
|
+
it('should format percentage values correctly', () => {
|
|
26
|
+
expect(formatPercentage('0.1234', '2decimal').fullyFormattedValue).toBe('12.34%');
|
|
27
|
+
expect(formatPercentage('12345.678', '2decimal-delimited').fullyFormattedValue).toBe('123,456.78%');
|
|
28
|
+
expect(formatPercentage('12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78%');
|
|
29
|
+
expect(formatPercentage('12345.678', '2decimal-delimited-positive').fullyFormattedValue).toBe('123,456.78%');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=numeric.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/numeric.spec.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,EAAE,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,wCA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values correctly', () => {\n expect(formatNumeric('12345', 'integer').fullyFormattedValue).toBe('12345');\n expect(formatNumeric('12345.678', '2decimal').fullyFormattedValue).toBe('123456.78');\n expect(formatNumeric('12345', 'integer-delimited').fullyFormattedValue).toBe('12,345');\n expect(formatNumeric('12345', 'integer-positive').fullyFormattedValue).toBe('12345');\n expect(formatNumeric('12345', 'integer-delimited-positive').fullyFormattedValue).toBe('12,345');\n expect(formatNumeric('12345.678', '2decimal-delimited').fullyFormattedValue).toBe('123,456.78');\n expect(formatNumeric('12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78');\n expect(formatNumeric('12345.678', '2decimal-delimited-positive').fullyFormattedValue).toBe('123,456.78');\n });\n\n it('should format negative numeric values correctly', () => {\n expect(formatNumeric('-12345', 'integer').fullyFormattedValue).toBe('-12345');\n expect(formatNumeric('-12345.678', '2decimal').fullyFormattedValue).toBe('-123456.78');\n expect(formatNumeric('-12345', 'integer-delimited').fullyFormattedValue).toBe('-12,345');\n expect(formatNumeric('-12345.678', '2decimal-delimited').fullyFormattedValue).toBe('-123,456.78');\n });\n\n it('should handle negative numbers with positive-only modifiers', () => {\n expect(formatNumeric('-12345', 'integer-positive').fullyFormattedValue).toBe('12345');\n expect(formatNumeric('-12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78');\n });\n});\n\ndescribe('formatPercentage', () => {\n it('should format percentage values correctly', () => {\n expect(formatPercentage('0.1234', '2decimal').fullyFormattedValue).toBe('12.34%');\n expect(formatPercentage('12345.678', '2decimal-delimited').fullyFormattedValue).toBe('123,456.78%');\n expect(formatPercentage('12345.678', '2decimal-positive').fullyFormattedValue).toBe('123456.78%');\n expect(formatPercentage('12345.678', '2decimal-delimited-positive').fullyFormattedValue).toBe('123,456.78%');\n });\n});\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import formatPhoneNumber, { phoneNumberFormats } from "./phone";
|
|
2
|
+
describe('formatPhoneNumber', () => {
|
|
3
|
+
it('should apply format modifiers correctly', () => {
|
|
4
|
+
Object.entries(phoneNumberFormats).forEach(([isoCode, data]) => {
|
|
5
|
+
const examplePhoneNumber = data.mask.replace(/[#?]/g, '1');
|
|
6
|
+
const exampleResult = `${data.prefix}${data.mask.replace(/[#?]/g, '1')}`;
|
|
7
|
+
expect(formatPhoneNumber(examplePhoneNumber, isoCode).fullyFormattedValue).toBe(exampleResult);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
it('handles BR mobile phone edge cases correctly', () => {
|
|
11
|
+
const examplePhoneNumber = '11999999999';
|
|
12
|
+
const exampleResult = '+55 (11) 99999-9999';
|
|
13
|
+
expect(formatPhoneNumber(examplePhoneNumber, 'BR').fullyFormattedValue).toBe(exampleResult);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=phone.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/phone.spec.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,EAAE,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEhE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAC3D,MAAM,kBAAkB,GAAW,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACnE,MAAM,aAAa,GAAW,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;YACjF,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,MAAM,kBAAkB,GAAW,aAAa,CAAC;QACjD,MAAM,aAAa,GAAW,qBAAqB,CAAC;QACpD,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatPhoneNumber, { phoneNumberFormats } from './phone';\n\ndescribe('formatPhoneNumber', () => {\n it('should apply format modifiers correctly', () => {\n Object.entries(phoneNumberFormats).forEach(([isoCode, data]) => {\n const examplePhoneNumber: string = data.mask.replace(/[#?]/g, '1');\n const exampleResult: string = `${data.prefix}${data.mask.replace(/[#?]/g, '1')}`;\n expect(formatPhoneNumber(examplePhoneNumber, isoCode).fullyFormattedValue).toBe(exampleResult);\n });\n });\n it('handles BR mobile phone edge cases correctly', () => {\n const examplePhoneNumber: string = '11999999999';\n const exampleResult: string = '+55 (11) 99999-9999';\n expect(formatPhoneNumber(examplePhoneNumber, 'BR').fullyFormattedValue).toBe(exampleResult);\n });\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postal.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/postal.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,kBAAkB,MAAM,gBAAgB,CAAC;AAEhD,MAAM,iBAAiB,GAAG;
|
|
1
|
+
{"version":3,"file":"postal.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/postal.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,kBAAkB,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,EAAE,EAAE,MAAM;I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AmB,IAAI;IAC3E,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEzC,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import formatValue from './generic';\nimport formatAlphanumeric from './alphanumeric';\n\nexport const postalCodeFormats = {\n AF: '####',\n AL: '####',\n DZ: '#####',\n AC: 'ASCN 1ZZ',\n AD: 'AD###', // pre\n AR: '####',\n 'AR+': '@####@@@',\n AI: 'AI-2640',\n AM: '####',\n AS: '#####',\n 'AS+4': '#####-####',\n AU: '####',\n AT: '####',\n AZ: 'AZ ####', // pre\n BH: '###?',\n BD: '####',\n BB: 'BB#####', // pre\n BY: '######',\n BE: '####',\n BM: '@@ **',\n BT: '#####',\n BA: '######',\n BR: '#####',\n 'BR+3': '#####-###',\n VG: 'VG####', // pre\n BN: '@@####',\n BG: '####',\n KH: '#####',\n KY: 'KY#-####', // pre\n CA: '@#@ #@#',\n CL: '###-####',\n CN: '######',\n CX: '####',\n CC: '####',\n CO: '######',\n CR: '#####',\n 'CR+4': '#####-####',\n CV: '####',\n HR: '#####',\n CU: '#####',\n CY: '####',\n CZ: '### ##',\n DK: '####',\n DO: '#####',\n EC: '######',\n SV: '####',\n EG: '#####',\n EE: '#####',\n ET: '####',\n FK: 'FIQQ 1ZZ',\n FO: '###',\n FI: '#####',\n FR: '#####',\n GF: '973##', // pre?\n PF: '987##', // pre?\n GI: 'GX11 1AA',\n GE: '####',\n DE: '#####',\n GR: '### ##',\n GL: '####',\n GP: '971##', // pre?\n GU: '#####',\n 'GU+4': '#####-####',\n GT: '#####',\n GG: 'GY#? #@@',\n GN: '###',\n GS: 'SIQQ 1ZZ',\n GW: '####',\n HT: '####',\n HN: '@@####',\n 'HN-': '#####',\n HU: '####',\n IS: '###',\n IN: '### ###',\n ID: '#####',\n IE: '*** ****',\n IR: '##########',\n IQ: '#####',\n IM: 'IM#? #@@', // pre\n IL: '#######',\n IT: '#####',\n JM: '##',\n JP: '###-####',\n JE: 'JE#? #@@', // pre\n JO: '#####',\n KZ: '######',\n KE: '#####',\n KR: '#####',\n KN: 'KN####',\n XK: '#####',\n KW: '#####',\n KG: '######',\n LA: '#####',\n LV: 'LV-####', // pre\n LB: '####? ????', // also 00000\n LS: '###',\n LR: '####',\n LI: '####',\n LT: '#####', // pre-\n LU: '####',\n MK: '####',\n MG: '###',\n MY: '#####',\n MV: '#####',\n MT: '@@@ ####',\n MH: '#####',\n 'MH+4': '#####-####',\n MU: '#####',\n MQ: '972##', // pre?\n MW: '######',\n YT: '976##', // pre?\n MX: '#####',\n FM: '#####',\n 'FM+4': '#####-####',\n MD: '####', // pre\n MC: '980##', // pre?\n MN: '#####',\n ME: '#####',\n MA: '#####',\n MZ: '####',\n MM: '#####',\n NA: '#####',\n NP: '#####',\n NC: '988##', // pre?\n NZ: '####',\n NI: '#####',\n NE: '####',\n NG: '######',\n NF: '####',\n MP: '#####',\n NO: '####',\n OM: '###',\n PK: '#####',\n PW: '#####',\n 'PW+4': '#####-####',\n PS: '###',\n PA: '####',\n PG: '###',\n PY: '####',\n PE: '#####',\n 'PE+': '####', // pre\n PH: '####',\n PL: '##-###',\n PT: '####',\n 'PT+3': '####-###',\n PR: '#####',\n 'PR+4': '#####-####',\n RE: '974##', // pre?\n PM: '975##',\n PN: 'PCRN 1ZZ',\n RO: '######',\n RU: '######',\n LC: 'LC## ###', // pre\n VC: '####', // pre\n WS: '####', // pre\n SM: '4879#', // pre?\n SA: '#####',\n 'SA+4': '#####-####',\n SN: '#####',\n RS: '#####',\n SG: '######',\n SH: '@@@@ 1ZZ',\n SK: '### ##',\n SI: '####', // pre?\n SO: '@@ #####',\n ZA: '####',\n ES: '#####',\n LK: '#####',\n SD: '#####',\n SZ: '@###',\n SE: '### ##',\n CH: '####',\n SJ: '####',\n TW: '###',\n 'TW+2': '###-##?',\n TJ: '######',\n TZ: '#####',\n TH: '#####',\n TT: '######',\n TN: '####',\n TR: '#####',\n TM: '######',\n UA: '#####',\n UY: '#####',\n VI: '#####',\n 'VI+4': '#####-####',\n UZ: '######',\n VE: '####',\n 'VE-': '####-@',\n VN: '#####?',\n YU: '#####',\n WF: '986##', // pre?\n ZM: '#####',\n US: '#####',\n 'US+4': '#####-####',\n};\nexport default function formatPostalCode(value: string, modifier: string = 'US') {\n const mask = postalCodeFormats[modifier];\n\n if (!mask) {\n return formatAlphanumeric(value);\n }\n\n return formatValue(value, mask);\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import formatPostalCode, { postalCodeFormats } from "./postal";
|
|
2
|
+
describe('formatPostalCode', () => {
|
|
3
|
+
Object.entries(postalCodeFormats).forEach(([region, format]) => {
|
|
4
|
+
// MC had a weird issue where replacing the # with only 0's was not working
|
|
5
|
+
if (region === 'MC') {
|
|
6
|
+
it('formats the provided value to the MC region postal code format: 980##', () => {
|
|
7
|
+
expect(formatPostalCode('98012', region).fullyFormattedValue).toBe('98012');
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
describe('when providing values for all possible characters', () => {
|
|
12
|
+
it(`formats to the ${region} region postal code format: ${format}`, () => {
|
|
13
|
+
const exampleValue = format.replace(/\s/g, '').replace(/[#*?]/g, '0').replace(/[@]/g, 'A');
|
|
14
|
+
const resultValue = format.replace(/[#*?]/g, '0').replace(/[@]/g, 'A');
|
|
15
|
+
expect(formatPostalCode(exampleValue, region).fullyFormattedValue).toBe(resultValue);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('when NOT providing values for optional (?) characters', () => {
|
|
19
|
+
it(`formats to the ${region} region postal code format: ${format}`, () => {
|
|
20
|
+
const exampleValue = format.replace(/\s\?/g, '').replace(/[#*]/g, '0').replace(/[@]/g, 'A');
|
|
21
|
+
const resultValue = format.replace(/\?/g, '').replace(/[#*]/g, '0').replace(/[@]/g, 'A');
|
|
22
|
+
expect(formatPostalCode(exampleValue, region).fullyFormattedValue).toBe(resultValue);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=postal.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postal.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/postal.spec.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE/D,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE;QAC3D,2EAA2E;QAC3E,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;gBAC7E,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;QACP,CAAC;aAAM,CAAC;YACJ,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;gBAC/D,EAAE,CAAC,kBAAkB,MAAM,+BAA+B,MAAM,EAAE,EAAE,GAAG,EAAE;oBACrE,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAC3F,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAEvE,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACzF,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,QAAQ,CAAC,uDAAuD,EAAE,GAAG,EAAE;gBACnE,EAAE,CAAC,kBAAkB,MAAM,+BAA+B,MAAM,EAAE,EAAE,GAAG,EAAE;oBACrE,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAC5F,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAEzF,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACzF,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatPostalCode, { postalCodeFormats } from './postal';\n\ndescribe('formatPostalCode', () => {\n Object.entries(postalCodeFormats).forEach(([region, format]) => {\n // MC had a weird issue where replacing the # with only 0's was not working\n if (region === 'MC') {\n it('formats the provided value to the MC region postal code format: 980##', () => {\n expect(formatPostalCode('98012', region).fullyFormattedValue).toBe('98012');\n });\n } else {\n describe('when providing values for all possible characters', () => {\n it(`formats to the ${region} region postal code format: ${format}`, () => {\n const exampleValue = format.replace(/\\s/g, '').replace(/[#*?]/g, '0').replace(/[@]/g, 'A');\n const resultValue = format.replace(/[#*?]/g, '0').replace(/[@]/g, 'A');\n\n expect(formatPostalCode(exampleValue, region).fullyFormattedValue).toBe(resultValue);\n });\n });\n describe('when NOT providing values for optional (?) characters', () => {\n it(`formats to the ${region} region postal code format: ${format}`, () => {\n const exampleValue = format.replace(/\\s\\?/g, '').replace(/[#*]/g, '0').replace(/[@]/g, 'A');\n const resultValue = format.replace(/\\?/g, '').replace(/[#*]/g, '0').replace(/[@]/g, 'A');\n\n expect(formatPostalCode(exampleValue, region).fullyFormattedValue).toBe(resultValue);\n });\n });\n }\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssn.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/ssn.spec.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,OAAO,CAAC;AAE9B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatSSN from './ssn';\n\ndescribe('formatSSN', () => {\n it('should format SSN values correctly', () => {\n expect(formatSSN('123456789').fullyFormattedValue).toBe('123-45-6789');\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tin.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/tin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,OAAO,CAAC;AAE9B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatTIN from './tin';\n\ndescribe('formatTIN', () => {\n it('should format TIN values correctly', () => {\n expect(formatTIN('987654321').fullyFormattedValue).toBe('98-7654321');\n });\n});\n"]}
|
|
@@ -57,6 +57,11 @@ export class Q2Input {
|
|
|
57
57
|
}
|
|
58
58
|
this.setCursorPosition(cursorPosition);
|
|
59
59
|
};
|
|
60
|
+
this.initMutationObserver = () => {
|
|
61
|
+
const observer = new MutationObserver(this.onMutationObserved);
|
|
62
|
+
observer.observe(this.hostElement, { childList: true });
|
|
63
|
+
this.mutationObserver = observer;
|
|
64
|
+
};
|
|
60
65
|
this.onClearInput = () => {
|
|
61
66
|
const eventDetail = {
|
|
62
67
|
value: '',
|
|
@@ -208,16 +213,13 @@ export class Q2Input {
|
|
|
208
213
|
this.manageClearableResizeObserver(this.clearable);
|
|
209
214
|
}
|
|
210
215
|
componentDidLoad() {
|
|
211
|
-
|
|
216
|
+
overrideFocus(this.hostElement);
|
|
217
|
+
if (!this.pseudo)
|
|
212
218
|
this.inputField.value = this.formattedValueObject.formattedValue;
|
|
213
|
-
|
|
214
|
-
if (this.autofocus === true) {
|
|
219
|
+
if (!!this.autofocus)
|
|
215
220
|
this.inputField.focus();
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const observer = new MutationObserver(this.onMutationObserved);
|
|
219
|
-
observer.observe(this.hostElement, { childList: true });
|
|
220
|
-
this.mutationObserver = observer;
|
|
221
|
+
if ('MutationObserver' in window)
|
|
222
|
+
this.initMutationObserver();
|
|
221
223
|
}
|
|
222
224
|
componentDidRender() {
|
|
223
225
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
@@ -226,7 +228,10 @@ export class Q2Input {
|
|
|
226
228
|
// #endregion
|
|
227
229
|
// #region Listeners
|
|
228
230
|
onHostElementChange(event) {
|
|
229
|
-
event
|
|
231
|
+
if (!(event instanceof CustomEvent)) {
|
|
232
|
+
event.stopPropagation();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
230
235
|
if (event.target === this.hostElement && !this.hostElement.onchange) {
|
|
231
236
|
this.value = event.detail.value;
|
|
232
237
|
}
|
|
@@ -241,7 +246,7 @@ export class Q2Input {
|
|
|
241
246
|
/**
|
|
242
247
|
* Emulates firing checkValidity on `<input>`, emits `invalid` event if validation failed.
|
|
243
248
|
*/
|
|
244
|
-
checkValidity() {
|
|
249
|
+
async checkValidity() {
|
|
245
250
|
this.inputRef.checkValidity();
|
|
246
251
|
this.validateInput();
|
|
247
252
|
}
|
|
@@ -253,7 +258,7 @@ export class Q2Input {
|
|
|
253
258
|
*
|
|
254
259
|
* @testOnly
|
|
255
260
|
*/
|
|
256
|
-
clearValue() {
|
|
261
|
+
async clearValue() {
|
|
257
262
|
if (!this.clearable)
|
|
258
263
|
return;
|
|
259
264
|
this.onClearInput();
|
|
@@ -280,6 +285,8 @@ export class Q2Input {
|
|
|
280
285
|
}
|
|
281
286
|
manageClearableResizeObserver(clearable) {
|
|
282
287
|
var _a;
|
|
288
|
+
if ('ResizeObserver' in window === false)
|
|
289
|
+
return;
|
|
283
290
|
const isSmallThreshold = 190;
|
|
284
291
|
if (clearable) {
|
|
285
292
|
if (this.resizeObserver)
|
|
@@ -377,7 +384,7 @@ export class Q2Input {
|
|
|
377
384
|
}
|
|
378
385
|
}
|
|
379
386
|
get hasCustomDisplaySlot() {
|
|
380
|
-
return
|
|
387
|
+
return hasSlotContent(this.hostElement, 'custom-display');
|
|
381
388
|
}
|
|
382
389
|
get hasError() {
|
|
383
390
|
return Array.isArray(this.errors) && this.errors.length > 0;
|
|
@@ -443,7 +450,8 @@ export class Q2Input {
|
|
|
443
450
|
return this.messages.length > 0 && !this.hideMessages;
|
|
444
451
|
}
|
|
445
452
|
get stringValue() {
|
|
446
|
-
|
|
453
|
+
const notCoercable = Object.prototype.toString.call(this.value) === '[object Object]';
|
|
454
|
+
return notCoercable ? '' : (this.value && String(this.value)) || '';
|
|
447
455
|
}
|
|
448
456
|
get visibilityToggleAriaLabel() {
|
|
449
457
|
return `tecton.element.input.toggleAriaLabel.${this.textHidden ? 'show' : 'hide'}`;
|
|
@@ -490,7 +498,7 @@ export class Q2Input {
|
|
|
490
498
|
startingPosition,
|
|
491
499
|
valueLength,
|
|
492
500
|
previousValueLength: valueLength,
|
|
493
|
-
hasSelection: getSelection().toString().length > 0,
|
|
501
|
+
hasSelection: window.getSelection().toString().length > 0,
|
|
494
502
|
};
|
|
495
503
|
}
|
|
496
504
|
calculateCursorPositionOnInput() {
|
|
@@ -505,12 +513,6 @@ export class Q2Input {
|
|
|
505
513
|
hasSelection: false,
|
|
506
514
|
};
|
|
507
515
|
}
|
|
508
|
-
countDOM() {
|
|
509
|
-
if (!this.showCount)
|
|
510
|
-
return;
|
|
511
|
-
const { maxlength, formattedValueObject } = this;
|
|
512
|
-
return (h("div", { class: "count-tag" }, formattedValueObject.unformattedValue.length, maxlength && `/${maxlength}`));
|
|
513
|
-
}
|
|
514
516
|
formatAndUpdateValueFromProp() {
|
|
515
517
|
this.formattedValueObject = this.getFormattedValue(this.stringValue, true);
|
|
516
518
|
if (!this.pseudo) {
|
|
@@ -611,21 +613,10 @@ export class Q2Input {
|
|
|
611
613
|
}
|
|
612
614
|
this.handleValueAndCursor();
|
|
613
615
|
}
|
|
614
|
-
/* tslint:disable:cyclomatic-complexity */
|
|
615
|
-
inputContainerDOM() {
|
|
616
|
-
const { hasInputLeftSlot, hasInputRightSlot } = this;
|
|
617
|
-
return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" })), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: loc(this.visibilityToggleAriaLabel, { label: this.label }), "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (h("div", null, h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && h("slot", { name: "input-right" }))));
|
|
618
|
-
}
|
|
619
616
|
placeCursorAtEnd() {
|
|
620
617
|
const { inputField } = this;
|
|
621
618
|
inputField.selectionStart = inputField.selectionEnd = inputField.value.length;
|
|
622
619
|
}
|
|
623
|
-
/* tslint:enable:cyclomatic-complexity */
|
|
624
|
-
pseudoInputDOM() {
|
|
625
|
-
const showPlaceholder = !this.value && !!this.placeholder;
|
|
626
|
-
const { ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
|
|
627
|
-
return (h("div", { class: "pseudo-input-container" }, h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-invalid": `${this.hasError}`, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, role: (this.role && `${this.role}`) || 'textbox', disabled: !!this.disabled, "test-id": "q2InputInnerClearButton", onFocus: this.onInputFocus, onBlur: this.onInputBlur }, h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }, h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value))))));
|
|
628
|
-
}
|
|
629
620
|
setCursorPosition(cursorData) {
|
|
630
621
|
if (this.canSetSelection && !cursorData.hasSelection) {
|
|
631
622
|
const input = this.inputField;
|
|
@@ -647,9 +638,24 @@ export class Q2Input {
|
|
|
647
638
|
}
|
|
648
639
|
}
|
|
649
640
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
641
|
+
// #endregion
|
|
642
|
+
// #region Render Methods
|
|
643
|
+
renderCountDOM() {
|
|
644
|
+
if (!this.showCount)
|
|
645
|
+
return;
|
|
646
|
+
const { maxlength, formattedValueObject } = this;
|
|
647
|
+
return (h("div", { class: "count-tag" }, formattedValueObject.unformattedValue.length, maxlength && `/${maxlength}`));
|
|
648
|
+
}
|
|
649
|
+
renderInputContainerDOM() {
|
|
650
|
+
const { hasInputLeftSlot, hasInputRightSlot } = this;
|
|
651
|
+
return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.renderPseudoInputDOM() : this.renderStandardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), label: loc('tecton.element.input.clear', [this.label]), hideLabel: true, "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" })), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: loc(this.visibilityToggleAriaLabel, { label: this.label }), "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (h("div", null, h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && h("slot", { name: "input-right" }))));
|
|
652
|
+
}
|
|
653
|
+
renderPseudoInputDOM() {
|
|
654
|
+
const showPlaceholder = !this.value && !!this.placeholder;
|
|
655
|
+
const { ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
|
|
656
|
+
return (h("div", { class: "pseudo-input-container" }, h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-invalid": `${this.hasError}`, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, role: (this.role && `${this.role}`) || 'textbox', disabled: !!this.disabled, "test-id": "q2InputInnerClearButton", onFocus: this.onInputFocus, onBlur: this.onInputBlur }, h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }, h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? loc(this.placeholder) : loc(this.value)))))));
|
|
657
|
+
}
|
|
658
|
+
renderStandardInputDOM() {
|
|
653
659
|
const { hasCustomDisplaySlot } = this;
|
|
654
660
|
const inputClasses = ['input-field'];
|
|
655
661
|
const { ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
|
|
@@ -657,10 +663,8 @@ export class Q2Input {
|
|
|
657
663
|
inputClasses.push('sr');
|
|
658
664
|
return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("input", { ref: el => (this.inputRef = el), class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, maxlength: ['date', 'currency'].includes(this.type) ? undefined : this.maxlength || undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect === 'on' ? 'on' : 'off', autofocus: this.autofocus, placeholder: (this.placeholder && loc(this.placeholder)) || undefined, role: this._role, "test-id": "inputField", readonly: this.readonly || this._preventEntry, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode, pattern: this.pattern || undefined })));
|
|
659
665
|
}
|
|
660
|
-
// #endregion
|
|
661
|
-
// #region Render Methods
|
|
662
666
|
render() {
|
|
663
|
-
return (h("div", { key: '
|
|
667
|
+
return (h("div", { key: '0f8acdf9b35d6fe0859a328037dc805102d451c5', class: this.wrapperClasses }, h("div", { key: 'e9d85bf0f092b1f823cf80b2fcdf4440c48511ad', class: "label-wrapper" }, renderLabel(this), this.renderCountDOM()), this.renderInputContainerDOM(), renderMessages(this)));
|
|
664
668
|
}
|
|
665
669
|
static get is() { return "q2-input"; }
|
|
666
670
|
static get encapsulation() { return "shadow"; }
|
|
@@ -838,7 +842,7 @@ export class Q2Input {
|
|
|
838
842
|
"name": "info",
|
|
839
843
|
"text": "This attribute only affects the behavior of input mechanisms like virtual keyboards on mobile devices and voice input."
|
|
840
844
|
}],
|
|
841
|
-
"text": "The `autocapitalize` attribute is an enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user."
|
|
845
|
+
"text": "The `autocapitalize` attribute is an enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user.\n\n[See MDN for a list of supported values](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize#value)."
|
|
842
846
|
},
|
|
843
847
|
"attribute": "autocapitalize",
|
|
844
848
|
"reflect": true
|
|
@@ -915,7 +919,7 @@ export class Q2Input {
|
|
|
915
919
|
"optional": false,
|
|
916
920
|
"docs": {
|
|
917
921
|
"tags": [],
|
|
918
|
-
"text": "The color of the badge when in the active state."
|
|
922
|
+
"text": "The color of the badge when in the active state. The property `badgeValue` must be provided."
|
|
919
923
|
},
|
|
920
924
|
"attribute": "badge-theme",
|
|
921
925
|
"reflect": true
|
|
@@ -1056,7 +1060,7 @@ export class Q2Input {
|
|
|
1056
1060
|
"optional": false,
|
|
1057
1061
|
"docs": {
|
|
1058
1062
|
"tags": [],
|
|
1059
|
-
"text": "When `true` and the input field has an active validation error, the field shows the error state without displaying associated error messages below the field (from the errors array
|
|
1063
|
+
"text": "When `true` and the input field has an active validation error, the field shows the error state without displaying associated error messages below the field (from the errors array).\nPrimarily used for dropdown selects and date pickers whose controls appear below the input field (where the error messages, if displayed, would also appear)."
|
|
1060
1064
|
},
|
|
1061
1065
|
"attribute": "hide-messages",
|
|
1062
1066
|
"reflect": true
|
|
@@ -1372,7 +1376,7 @@ export class Q2Input {
|
|
|
1372
1376
|
"name": "info",
|
|
1373
1377
|
"text": "Only applicable when `type=\"number\"`."
|
|
1374
1378
|
}],
|
|
1375
|
-
"text": "When present, it jumps the value in
|
|
1379
|
+
"text": "When present, it jumps the value in increments of `step` when the user uses the Up/Down arrow keys to change the value."
|
|
1376
1380
|
},
|
|
1377
1381
|
"attribute": "step",
|
|
1378
1382
|
"reflect": true
|
|
@@ -1412,7 +1416,7 @@ export class Q2Input {
|
|
|
1412
1416
|
"optional": false,
|
|
1413
1417
|
"docs": {
|
|
1414
1418
|
"tags": [],
|
|
1415
|
-
"text": "Specifies the field's
|
|
1419
|
+
"text": "Specifies the field's expected [input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types), and provides the optimal keyboard on mobile devices."
|
|
1416
1420
|
},
|
|
1417
1421
|
"attribute": "type",
|
|
1418
1422
|
"reflect": true,
|
|
@@ -1585,7 +1589,12 @@ export class Q2Input {
|
|
|
1585
1589
|
"complexType": {
|
|
1586
1590
|
"signature": "() => Promise<void>",
|
|
1587
1591
|
"parameters": [],
|
|
1588
|
-
"references": {
|
|
1592
|
+
"references": {
|
|
1593
|
+
"Promise": {
|
|
1594
|
+
"location": "global",
|
|
1595
|
+
"id": "global::Promise"
|
|
1596
|
+
}
|
|
1597
|
+
},
|
|
1589
1598
|
"return": "Promise<void>"
|
|
1590
1599
|
},
|
|
1591
1600
|
"docs": {
|
|
@@ -1597,7 +1606,12 @@ export class Q2Input {
|
|
|
1597
1606
|
"complexType": {
|
|
1598
1607
|
"signature": "() => Promise<void>",
|
|
1599
1608
|
"parameters": [],
|
|
1600
|
-
"references": {
|
|
1609
|
+
"references": {
|
|
1610
|
+
"Promise": {
|
|
1611
|
+
"location": "global",
|
|
1612
|
+
"id": "global::Promise"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1601
1615
|
"return": "Promise<void>"
|
|
1602
1616
|
},
|
|
1603
1617
|
"docs": {
|