@otto-de/b2b-core-components 1.4.0 → 1.6.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/b2b-core-components/b2b-core-components.css +1 -1
- package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
- package/dist/b2b-core-components/p-01fd54a1.entry.js +1 -0
- package/dist/b2b-core-components/p-04fc18cd.entry.js +1 -0
- package/dist/b2b-core-components/p-06aa96a8.entry.js +1 -0
- package/dist/b2b-core-components/p-077217b3.entry.js +1 -0
- package/dist/b2b-core-components/p-0965b990.entry.js +1 -0
- package/dist/b2b-core-components/p-0beabdb4.entry.js +1 -0
- package/dist/b2b-core-components/p-163466cf.entry.js +1 -0
- package/dist/b2b-core-components/{p-c2bcf0a8.entry.js → p-197c1a6d.entry.js} +1 -1
- package/dist/b2b-core-components/p-1d007eea.entry.js +1 -0
- package/dist/b2b-core-components/{p-400b3111.entry.js → p-1e2752b2.entry.js} +1 -1
- package/dist/b2b-core-components/p-2328144b.entry.js +1 -0
- package/dist/b2b-core-components/{p-9184036b.entry.js → p-2ad8bdb6.entry.js} +1 -1
- package/dist/b2b-core-components/p-2d01e68a.entry.js +1 -0
- package/dist/b2b-core-components/{p-34f6555e.entry.js → p-3c0671ef.entry.js} +1 -1
- package/dist/b2b-core-components/p-42e7f397.entry.js +1 -0
- package/dist/b2b-core-components/p-44ccd8f4.entry.js +1 -0
- package/dist/b2b-core-components/p-542a358a.entry.js +1 -0
- package/dist/b2b-core-components/p-54fd68eb.entry.js +1 -0
- package/dist/b2b-core-components/p-60badad5.entry.js +1 -0
- package/dist/b2b-core-components/p-6140304e.entry.js +1 -0
- package/dist/b2b-core-components/{p-f0aa5e83.entry.js → p-681d6880.entry.js} +1 -1
- package/dist/b2b-core-components/p-8ad1bb92.entry.js +1 -0
- package/dist/b2b-core-components/p-90a3ffed.entry.js +1 -0
- package/dist/b2b-core-components/p-97ef9805.entry.js +1 -0
- package/dist/b2b-core-components/{p-48d4d224.entry.js → p-a50ea33f.entry.js} +1 -1
- package/dist/b2b-core-components/p-b3ccfc58.entry.js +1 -0
- package/dist/b2b-core-components/p-b6a8a06f.entry.js +1 -0
- package/dist/b2b-core-components/p-b8049234.entry.js +1 -0
- package/dist/b2b-core-components/p-bb5e7c53.js +1 -0
- package/dist/b2b-core-components/p-c294dd0c.entry.js +1 -0
- package/dist/b2b-core-components/p-d07210e2.entry.js +1 -0
- package/dist/b2b-core-components/p-d7bb8aa1.entry.js +1 -0
- package/dist/b2b-core-components/p-d83c2084.entry.js +1 -0
- package/dist/b2b-core-components/p-db7d2ec3.entry.js +1 -0
- package/dist/b2b-core-components/{p-9facba86.entry.js → p-dd79ab5b.entry.js} +1 -1
- package/dist/b2b-core-components/p-e5b78075.entry.js +1 -0
- package/dist/b2b-core-components/p-e811411a.entry.js +1 -0
- package/dist/b2b-core-components/p-f190bf79.entry.js +1 -0
- package/dist/b2b-core-components/p-f24515bf.entry.js +1 -0
- package/dist/b2b-core-components/p-f3ce95bf.js +2 -0
- package/dist/b2b-core-components/p-f7e9f889.entry.js +1 -0
- package/dist/cjs/b2b-alert.cjs.entry.js +4 -4
- package/dist/cjs/b2b-anchor.cjs.entry.js +2 -2
- package/dist/cjs/b2b-button_2.cjs.entry.js +13 -9
- package/dist/cjs/b2b-card.cjs.entry.js +2 -2
- package/dist/cjs/b2b-checkbox-group.cjs.entry.js +7 -5
- package/dist/cjs/b2b-checkbox_3.cjs.entry.js +206 -0
- package/dist/cjs/b2b-core-components.cjs.js +3 -3
- package/dist/cjs/b2b-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
- package/dist/cjs/b2b-grid-row.cjs.entry.js +2 -2
- package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
- package/dist/cjs/b2b-headline.cjs.entry.js +2 -2
- package/dist/cjs/b2b-icon.cjs.entry.js +4 -4
- package/dist/cjs/b2b-input-group_2.cjs.entry.js +12 -9
- package/dist/cjs/b2b-input-label.cjs.entry.js +1 -1
- package/dist/cjs/b2b-input_2.cjs.entry.js +8 -7
- package/dist/cjs/b2b-label.cjs.entry.js +2 -2
- package/dist/cjs/b2b-modal.cjs.entry.js +5 -5
- package/dist/cjs/b2b-pagination.cjs.entry.js +5 -5
- package/dist/cjs/b2b-paragraph.cjs.entry.js +5 -5
- package/dist/cjs/b2b-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/b2b-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/b2b-required-separator.cjs.entry.js +3 -3
- package/dist/cjs/b2b-rounded-icon.cjs.entry.js +4 -2
- package/dist/cjs/b2b-scrollable-container.cjs.entry.js +2 -2
- package/dist/cjs/b2b-search.cjs.entry.js +6 -1
- package/dist/cjs/b2b-separator.cjs.entry.js +2 -2
- package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/b2b-tab.cjs.entry.js +2 -2
- package/dist/cjs/b2b-table-row.cjs.entry.js +78 -23
- package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +87 -26
- package/dist/cjs/b2b-table.cjs.entry.js +13 -13
- package/dist/cjs/b2b-textarea.cjs.entry.js +2 -2
- package/dist/cjs/b2b-toggle-button.cjs.entry.js +7 -7
- package/dist/cjs/b2b-toggle-group.cjs.entry.js +3 -3
- package/dist/cjs/b2b-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/b2b-wizard-icon.cjs.entry.js +6 -4
- package/dist/cjs/b2b-wizard-step.cjs.entry.js +26 -0
- package/dist/cjs/b2b-wizard.cjs.entry.js +61 -0
- package/dist/cjs/{index-496aa5dd.js → index-04e07a00.js} +100 -35
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{types-ef85a0bf.js → table.types-00c8228a.js} +4 -4
- package/dist/cjs/wizard.types-690c64bb.js +10 -0
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/alert/alert.css +8 -9
- package/dist/collection/components/alert/alert.e2e.js +67 -0
- package/dist/collection/components/alert/alert.js +2 -2
- package/dist/collection/components/anchor/anchor.css +3 -4
- package/dist/collection/components/anchor/anchor.spec.js +68 -0
- package/dist/collection/components/button/button.css +36 -41
- package/dist/collection/components/button/button.e2e.js +80 -0
- package/dist/collection/components/button/button.js +31 -6
- package/dist/collection/components/card/card.css +3 -4
- package/dist/collection/components/card/card.e2e.js +110 -0
- package/dist/collection/components/card/card.spec.js +32 -0
- package/dist/collection/components/checkbox/checkbox.css +36 -16
- package/dist/collection/components/checkbox/checkbox.e2e.js +30 -0
- package/dist/collection/components/checkbox/checkbox.js +81 -6
- package/dist/collection/components/checkbox/checkbox.spec.js +45 -0
- package/dist/collection/components/checkbox-group/checkbox-group.css +7 -8
- package/dist/collection/components/checkbox-group/checkbox-group.e2e.js +78 -0
- package/dist/collection/components/checkbox-group/checkbox-group.js +5 -3
- package/dist/collection/components/checkbox-group/checkbox-group.spec.js +38 -0
- package/dist/collection/components/dropdown/dropdown.css +9 -10
- package/dist/collection/components/dropdown/dropdown.e2e.js +48 -0
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/dropdown/dropdown.spec.js +52 -0
- package/dist/collection/components/grid/grid.e2e.js +17 -0
- package/dist/collection/components/grid/row.js +1 -1
- package/dist/collection/components/headline/headline.css +3 -4
- package/dist/collection/components/headline/headline.e2e.js +13 -0
- package/dist/collection/components/headline/headline.spec.js +67 -0
- package/dist/collection/components/icon/icon.css +10 -11
- package/dist/collection/components/icon/icon.js +2 -2
- package/dist/collection/components/icon/icon.spec.js +21 -0
- package/dist/collection/components/input/input.css +16 -17
- package/dist/collection/components/input/input.e2e.js +43 -0
- package/dist/collection/components/input/input.js +26 -4
- package/dist/collection/components/input/input.spec.js +45 -0
- package/dist/collection/components/input-group/input-group.css +6 -7
- package/dist/collection/components/input-group/input-group.e2e.js +76 -0
- package/dist/collection/components/input-group/input-group.js +6 -4
- package/dist/collection/components/input-group/input-group.spec.js +56 -0
- package/dist/collection/components/input-label/input-label.e2e.js +10 -0
- package/dist/collection/components/input-list/input-list.css +8 -9
- package/dist/collection/components/input-list/input-list.e2e.js +227 -0
- package/dist/collection/components/input-list/input-list.js +24 -2
- package/dist/collection/components/label/label.css +4 -5
- package/dist/collection/components/label/label.e2e.js +17 -0
- package/dist/collection/components/label/label.spec.js +58 -0
- package/dist/collection/components/modal/modal.css +14 -20
- package/dist/collection/components/modal/modal.e2e.js +115 -0
- package/dist/collection/components/modal/modal.js +3 -3
- package/dist/collection/components/pagination/pagination.css +8 -9
- package/dist/collection/components/pagination/pagination.e2e.js +256 -0
- package/dist/collection/components/pagination/pagination.js +3 -3
- package/dist/collection/components/pagination/pagination.spec.js +104 -0
- package/dist/collection/components/paragraph/paragraph.css +11 -12
- package/dist/collection/components/paragraph/paragraph.e2e.js +13 -0
- package/dist/collection/components/paragraph/paragraph.js +3 -3
- package/dist/collection/components/radio/radio.css +4 -5
- package/dist/collection/components/radio/radio.e2e.js +36 -0
- package/dist/collection/components/radio/radio.spec.js +38 -0
- package/dist/collection/components/radio-group/radio-group.css +4 -5
- package/dist/collection/components/radio-group/radio-group.e2e.js +71 -0
- package/dist/collection/components/radio-group/radio-group.spec.js +31 -0
- package/dist/collection/components/required-separator/required-separator.css +5 -6
- package/dist/collection/components/required-separator/required-separator.e2e.js +17 -0
- package/dist/collection/components/required-separator/required-separator.js +1 -1
- package/dist/collection/components/rounded-icon/rounded-icon.css +4 -5
- package/dist/collection/components/rounded-icon/rounded-icon.js +19 -0
- package/dist/collection/components/scrollable-container/scrollable-container.css +3 -4
- package/dist/collection/components/search/search.e2e.js +97 -0
- package/dist/collection/components/search/search.js +14 -0
- package/dist/collection/components/separator/separator.css +3 -4
- package/dist/collection/components/separator/separator.e2e.js +22 -0
- package/dist/collection/components/spinner/spinner.css +3 -4
- package/dist/collection/components/spinner/spinner.e2e.js +12 -0
- package/dist/collection/components/spinner/spinner.spec.js +41 -0
- package/dist/collection/components/tab/tab.css +3 -4
- package/dist/collection/components/tab/tab.e2e.js +35 -0
- package/dist/collection/components/tab/tab.spec.js +31 -0
- package/dist/collection/components/tab-group/tab-group.e2e.js +98 -0
- package/dist/collection/components/tab-panel/tab-panel.css +3 -4
- package/dist/collection/components/tab-panel/tab-panel.e2e.js +12 -0
- package/dist/collection/components/tab-panel/tab-panel.spec.js +10 -0
- package/dist/collection/components/table/stories.data.js +6 -6
- package/dist/collection/components/table/table-cell/table-cell.css +3 -4
- package/dist/collection/components/table/table-cell/table-cell.js +4 -4
- package/dist/collection/components/table/table-header/table-header.css +18 -19
- package/dist/collection/components/table/table-header/table-header.js +7 -7
- package/dist/collection/components/table/table-row/table-row.css +4 -5
- package/dist/collection/components/table/table-row/table-row.js +187 -28
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +4 -5
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +119 -24
- package/dist/collection/components/table/table.css +3 -4
- package/dist/collection/components/table/table.e2e.js +370 -0
- package/dist/collection/components/table/table.js +10 -10
- package/dist/collection/components/table/table.stories.js +17 -8
- package/dist/collection/components/table/utils.js +18 -0
- package/dist/collection/components/textarea/textarea.css +4 -5
- package/dist/collection/components/textarea/textarea.e2e.js +91 -0
- package/dist/collection/components/toggle-button/toggle-button.css +10 -11
- package/dist/collection/components/toggle-button/toggle-button.e2e.js +44 -0
- package/dist/collection/components/toggle-button/toggle-button.js +5 -5
- package/dist/collection/components/toggle-group/toggle-group.css +4 -5
- package/dist/collection/components/toggle-group/toggle-group.e2e.js +65 -0
- package/dist/collection/components/toggle-group/toggle-group.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +16 -17
- package/dist/collection/components/tooltip/tooltip.e2e.js +64 -0
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/components/wizard/wizard-step.js +95 -0
- package/dist/collection/components/wizard/wizard.css +240 -0
- package/dist/collection/components/wizard/wizard.e2e.js +149 -0
- package/dist/collection/components/wizard/wizard.js +125 -0
- package/dist/collection/components/wizard/wizard.stories.js +44 -0
- package/dist/collection/components/wizard-icon/wizard-icon.css +3 -4
- package/dist/collection/components/wizard-icon/wizard-icon.js +38 -8
- package/dist/collection/components/wizard-icon/wizard-icon.stories.js +14 -3
- package/dist/collection/docs/config/replace-prop-controls.spec.js +32 -0
- package/dist/collection/{components/table/types.js → utils/types/table.types.js} +7 -3
- package/dist/collection/utils/types/wizard.types.js +6 -0
- package/dist/collection/utils/utils.spec.js +15 -0
- package/dist/components/b2b-alert.js +4 -4
- package/dist/components/b2b-anchor.js +2 -2
- package/dist/components/b2b-card.js +2 -2
- package/dist/components/b2b-checkbox-group.js +7 -5
- package/dist/components/b2b-checkbox.js +1 -99
- package/dist/components/b2b-dropdown.js +3 -3
- package/dist/components/b2b-grid-col.js +1 -1
- package/dist/components/b2b-grid-row.js +2 -2
- package/dist/components/b2b-grid.js +1 -1
- package/dist/components/b2b-label.js +2 -2
- package/dist/components/b2b-modal.js +5 -5
- package/dist/components/b2b-pagination.js +5 -5
- package/dist/components/b2b-paragraph.js +5 -5
- package/dist/components/b2b-radio-button.js +2 -2
- package/dist/components/b2b-radio-group.js +2 -2
- package/dist/components/b2b-required-separator.js +3 -3
- package/dist/components/b2b-scrollable-container.js +2 -2
- package/dist/components/b2b-search.js +7 -2
- package/dist/components/b2b-tab-group.js +1 -1
- package/dist/components/b2b-tab-panel.js +2 -2
- package/dist/components/b2b-tab.js +2 -2
- package/dist/components/b2b-table-row.js +97 -26
- package/dist/components/b2b-table-rowgroup.js +91 -27
- package/dist/components/b2b-table.js +11 -11
- package/dist/components/b2b-textarea.js +2 -2
- package/dist/components/b2b-toggle-button.js +7 -7
- package/dist/components/b2b-toggle-group.js +3 -3
- package/dist/components/b2b-tooltip.js +4 -4
- package/dist/components/b2b-wizard-icon.js +1 -47
- package/dist/components/b2b-wizard-step.d.ts +11 -0
- package/dist/components/b2b-wizard-step.js +62 -0
- package/dist/components/b2b-wizard.d.ts +11 -0
- package/dist/components/b2b-wizard.js +79 -0
- package/dist/components/button.js +13 -8
- package/dist/components/checkbox.js +123 -0
- package/dist/components/headline.js +2 -2
- package/dist/components/icon.js +4 -4
- package/dist/components/input-group.js +8 -6
- package/dist/components/input-label.js +1 -1
- package/dist/components/input-list-option.js +2 -2
- package/dist/components/input-list.js +6 -4
- package/dist/components/input.js +8 -6
- package/dist/components/rounded-icon.js +5 -2
- package/dist/components/separator.js +2 -2
- package/dist/components/spinner.js +2 -2
- package/dist/components/table-cell.js +3 -3
- package/dist/components/table-header.js +7 -7
- package/dist/components/{types.js → table.types.js} +4 -4
- package/dist/components/wizard-icon.js +52 -0
- package/dist/components/wizard.types.js +8 -0
- package/dist/custom-elements.json +132 -13
- package/dist/esm/b2b-alert.entry.js +4 -4
- package/dist/esm/b2b-anchor.entry.js +2 -2
- package/dist/esm/b2b-button_2.entry.js +13 -9
- package/dist/esm/b2b-card.entry.js +2 -2
- package/dist/esm/b2b-checkbox-group.entry.js +7 -5
- package/dist/esm/b2b-checkbox_3.entry.js +200 -0
- package/dist/esm/b2b-core-components.js +4 -4
- package/dist/esm/b2b-dropdown.entry.js +3 -3
- package/dist/esm/b2b-grid-col.entry.js +1 -1
- package/dist/esm/b2b-grid-row.entry.js +2 -2
- package/dist/esm/b2b-grid.entry.js +1 -1
- package/dist/esm/b2b-headline.entry.js +2 -2
- package/dist/esm/b2b-icon.entry.js +4 -4
- package/dist/esm/b2b-input-group_2.entry.js +12 -9
- package/dist/esm/b2b-input-label.entry.js +1 -1
- package/dist/esm/b2b-input_2.entry.js +8 -7
- package/dist/esm/b2b-label.entry.js +2 -2
- package/dist/esm/b2b-modal.entry.js +5 -5
- package/dist/esm/b2b-pagination.entry.js +5 -5
- package/dist/esm/b2b-paragraph.entry.js +5 -5
- package/dist/esm/b2b-radio-button.entry.js +2 -2
- package/dist/esm/b2b-radio-group.entry.js +2 -2
- package/dist/esm/b2b-required-separator.entry.js +3 -3
- package/dist/esm/b2b-rounded-icon.entry.js +4 -2
- package/dist/esm/b2b-scrollable-container.entry.js +2 -2
- package/dist/esm/b2b-search.entry.js +6 -1
- package/dist/esm/b2b-separator.entry.js +2 -2
- package/dist/esm/b2b-tab-group.entry.js +1 -1
- package/dist/esm/b2b-tab-panel.entry.js +2 -2
- package/dist/esm/b2b-tab.entry.js +2 -2
- package/dist/esm/b2b-table-row.entry.js +77 -22
- package/dist/esm/b2b-table-rowgroup.entry.js +85 -24
- package/dist/esm/b2b-table.entry.js +11 -11
- package/dist/esm/b2b-textarea.entry.js +2 -2
- package/dist/esm/b2b-toggle-button.entry.js +7 -7
- package/dist/esm/b2b-toggle-group.entry.js +3 -3
- package/dist/esm/b2b-tooltip.entry.js +4 -4
- package/dist/esm/b2b-wizard-icon.entry.js +6 -4
- package/dist/esm/b2b-wizard-step.entry.js +22 -0
- package/dist/esm/b2b-wizard.entry.js +57 -0
- package/dist/esm/{index-026605c2.js → index-dfdbf4b9.js} +100 -35
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{types-5aa59787.js → table.types-dd829d83.js} +4 -4
- package/dist/esm/wizard.types-2a03b8e0.js +8 -0
- package/dist/types/components/alert/alert.stories.d.ts +1 -1
- package/dist/types/components/anchor/anchor.stories.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +2 -0
- package/dist/types/components/button/button.stories.d.ts +1 -1
- package/dist/types/components/card/card.stories.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +8 -1
- package/dist/types/components/checkbox/checkbox.stories.d.ts +1 -1
- package/dist/types/components/checkbox-group/checkbox-group.stories.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.stories.d.ts +1 -1
- package/dist/types/components/grid/grid.stories.d.ts +1 -1
- package/dist/types/components/headline/headline.stories.d.ts +1 -1
- package/dist/types/components/icon/icon.stories.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +2 -0
- package/dist/types/components/input/input.stories.d.ts +1 -1
- package/dist/types/components/input-group/input-group.stories.d.ts +1 -1
- package/dist/types/components/input-list/input-list.d.ts +2 -0
- package/dist/types/components/input-list/input-list.stories.d.ts +1 -1
- package/dist/types/components/label/label.stories.d.ts +1 -1
- package/dist/types/components/modal/modal.stories.d.ts +1 -1
- package/dist/types/components/pagination/pagination.stories.d.ts +1 -1
- package/dist/types/components/paragraph/paragraph.stories.d.ts +1 -1
- package/dist/types/components/radio/radio.stories.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.stories.d.ts +1 -1
- package/dist/types/components/required-separator/required-separator.stories.d.ts +1 -1
- package/dist/types/components/rounded-icon/rounded-icon.d.ts +4 -0
- package/dist/types/components/rounded-icon/rounded-icon.stories.d.ts +1 -1
- package/dist/types/components/scrollable-container/scrollable-container.stories.d.ts +1 -1
- package/dist/types/components/search/search.d.ts +1 -0
- package/dist/types/components/search/search.stories.d.ts +1 -1
- package/dist/types/components/separator/separator.stories.d.ts +1 -1
- package/dist/types/components/spinner/spinner.stories.d.ts +1 -1
- package/dist/types/components/tab-group/tab-group.stories.d.ts +1 -1
- package/dist/types/components/table/table-cell/table-cell.d.ts +1 -1
- package/dist/types/components/table/table-header/table-header.d.ts +1 -1
- package/dist/types/components/table/table-row/table-row.d.ts +23 -7
- package/dist/types/components/table/table-rowgroup/table-rowgroup.d.ts +13 -3
- package/dist/types/components/table/table.d.ts +2 -2
- package/dist/types/components/table/table.stories.d.ts +2 -1
- package/dist/types/components/table/utils.d.ts +4 -0
- package/dist/types/components/textarea/textarea.stories.d.ts +1 -1
- package/dist/types/components/toggle-group/toggle-group.stories.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.stories.d.ts +1 -1
- package/dist/types/components/wizard/wizard-step.d.ts +11 -0
- package/dist/types/components/wizard/wizard.d.ts +19 -0
- package/dist/types/components/wizard/wizard.stories.d.ts +5 -0
- package/dist/types/components/wizard-icon/wizard-icon.d.ts +6 -2
- package/dist/types/components/wizard-icon/wizard-icon.stories.d.ts +3 -1
- package/dist/types/components.d.ts +167 -13
- package/dist/types/docs/tokens/color.stories.d.ts +1 -1
- package/dist/types/docs/tokens/font.stories.d.ts +1 -1
- package/dist/types/docs/tokens/size.stories.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -0
- package/dist/types/utils/interfaces/content.interface.d.ts +4 -0
- package/dist/types/utils/interfaces/form.interface.d.ts +1 -0
- package/dist/types/{components/table/types.d.ts → utils/types/table.types.d.ts} +7 -2
- package/dist/types/utils/types/wizard.types.d.ts +8 -0
- package/dist/web-types.json +184 -9
- package/loader/index.d.ts +1 -1
- package/package.json +5 -5
- package/dist/b2b-core-components/p-08a50b6c.entry.js +0 -1
- package/dist/b2b-core-components/p-10414c0b.entry.js +0 -1
- package/dist/b2b-core-components/p-144a3c59.entry.js +0 -1
- package/dist/b2b-core-components/p-1493f7df.entry.js +0 -1
- package/dist/b2b-core-components/p-14f1b674.entry.js +0 -1
- package/dist/b2b-core-components/p-15a499b0.entry.js +0 -1
- package/dist/b2b-core-components/p-22dab2b4.entry.js +0 -1
- package/dist/b2b-core-components/p-4b25559c.entry.js +0 -1
- package/dist/b2b-core-components/p-515eb49e.entry.js +0 -1
- package/dist/b2b-core-components/p-541ffefb.entry.js +0 -1
- package/dist/b2b-core-components/p-5572aab3.entry.js +0 -1
- package/dist/b2b-core-components/p-5c316460.entry.js +0 -1
- package/dist/b2b-core-components/p-686d6598.entry.js +0 -1
- package/dist/b2b-core-components/p-6e0e6acc.entry.js +0 -1
- package/dist/b2b-core-components/p-6e3b27cd.entry.js +0 -1
- package/dist/b2b-core-components/p-7af1b977.entry.js +0 -1
- package/dist/b2b-core-components/p-7ca9b704.entry.js +0 -1
- package/dist/b2b-core-components/p-81a52d1a.entry.js +0 -1
- package/dist/b2b-core-components/p-8970ae74.entry.js +0 -1
- package/dist/b2b-core-components/p-925e40af.entry.js +0 -1
- package/dist/b2b-core-components/p-965ae161.entry.js +0 -1
- package/dist/b2b-core-components/p-99f8cf34.entry.js +0 -1
- package/dist/b2b-core-components/p-a6248754.entry.js +0 -1
- package/dist/b2b-core-components/p-a7417890.js +0 -2
- package/dist/b2b-core-components/p-b6e0a6ea.entry.js +0 -1
- package/dist/b2b-core-components/p-ba74cde5.entry.js +0 -1
- package/dist/b2b-core-components/p-bf4c58dc.entry.js +0 -1
- package/dist/b2b-core-components/p-d6ce3259.entry.js +0 -1
- package/dist/b2b-core-components/p-da6a1f55.entry.js +0 -1
- package/dist/b2b-core-components/p-f0c565ef.entry.js +0 -1
- package/dist/b2b-core-components/p-fc639b29.entry.js +0 -1
- package/dist/b2b-core-components/p-ff49e330.entry.js +0 -1
- package/dist/cjs/b2b-checkbox.cjs.entry.js +0 -74
- package/dist/cjs/b2b-table-cell_2.cjs.entry.js +0 -119
- package/dist/esm/b2b-checkbox.entry.js +0 -70
- package/dist/esm/b2b-table-cell_2.entry.js +0 -114
- /package/dist/b2b-core-components/{p-4130f1ae.js → p-34eb99cb.js} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { LabelComponent } from './label';
|
|
4
|
+
it('should render the label component with default values', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [LabelComponent],
|
|
7
|
+
template: () => h("b2b-label", null, "Neutral"),
|
|
8
|
+
});
|
|
9
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
10
|
+
<span class="b2b-label b2b-label--neutral">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</span>
|
|
13
|
+
`);
|
|
14
|
+
});
|
|
15
|
+
it('should render the label component with info styles', async () => {
|
|
16
|
+
const page = await newSpecPage({
|
|
17
|
+
components: [LabelComponent],
|
|
18
|
+
template: () => h("b2b-label", { type: "info" }, "Neutral"),
|
|
19
|
+
});
|
|
20
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
21
|
+
<span class="b2b-label b2b-label--info">
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</span>
|
|
24
|
+
`);
|
|
25
|
+
});
|
|
26
|
+
it('should render the label component with success styles', async () => {
|
|
27
|
+
const page = await newSpecPage({
|
|
28
|
+
components: [LabelComponent],
|
|
29
|
+
template: () => h("b2b-label", { type: "success" }, "Neutral"),
|
|
30
|
+
});
|
|
31
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
32
|
+
<span class="b2b-label b2b-label--success">
|
|
33
|
+
<slot></slot>
|
|
34
|
+
</span>
|
|
35
|
+
`);
|
|
36
|
+
});
|
|
37
|
+
it('should render the label component with warning styles', async () => {
|
|
38
|
+
const page = await newSpecPage({
|
|
39
|
+
components: [LabelComponent],
|
|
40
|
+
template: () => h("b2b-label", { type: "warning" }, "Neutral"),
|
|
41
|
+
});
|
|
42
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
43
|
+
<span class="b2b-label b2b-label--warning">
|
|
44
|
+
<slot></slot>
|
|
45
|
+
</span>
|
|
46
|
+
`);
|
|
47
|
+
});
|
|
48
|
+
it('should render the label component with error styles', async () => {
|
|
49
|
+
const page = await newSpecPage({
|
|
50
|
+
components: [LabelComponent],
|
|
51
|
+
template: () => h("b2b-label", { type: "error" }, "Neutral"),
|
|
52
|
+
});
|
|
53
|
+
expect(page.root.shadowRoot).toEqualHtml(`
|
|
54
|
+
<span class="b2b-label b2b-label--error">
|
|
55
|
+
<slot></slot>
|
|
56
|
+
</span>
|
|
57
|
+
`);
|
|
58
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -236,7 +235,7 @@
|
|
|
236
235
|
:host .b2b-modal--open {
|
|
237
236
|
display: flex;
|
|
238
237
|
}
|
|
239
|
-
:host .b2b-
|
|
238
|
+
:host .b2b-modal__backdrop {
|
|
240
239
|
top: 0;
|
|
241
240
|
left: 0;
|
|
242
241
|
z-index: 0;
|
|
@@ -244,7 +243,7 @@
|
|
|
244
243
|
height: 100%;
|
|
245
244
|
position: absolute;
|
|
246
245
|
}
|
|
247
|
-
:host .b2b-
|
|
246
|
+
:host .b2b-modal__dialog {
|
|
248
247
|
z-index: 1;
|
|
249
248
|
position: relative;
|
|
250
249
|
min-width: var(--b2b-component-modal-default-min-width);
|
|
@@ -254,53 +253,48 @@
|
|
|
254
253
|
box-shadow: 0 3px 8px 0 var(--b2b-color-background-overlay-transparent-40);
|
|
255
254
|
margin: auto;
|
|
256
255
|
}
|
|
257
|
-
:host .b2b-
|
|
256
|
+
:host .b2b-modal__dialog__header {
|
|
258
257
|
display: flex;
|
|
259
258
|
justify-content: space-between;
|
|
260
259
|
align-items: center;
|
|
261
260
|
margin-bottom: var(--b2b-size-space-75);
|
|
262
261
|
}
|
|
263
|
-
:host .b2b-
|
|
262
|
+
:host .b2b-modal__dialog__close {
|
|
264
263
|
cursor: pointer;
|
|
265
264
|
background: transparent;
|
|
266
265
|
padding: 0;
|
|
267
266
|
border: none;
|
|
268
|
-
/* this is a workaround to force purgecss to include the overwrites of the variable --b2b-icon-cursor */
|
|
269
267
|
}
|
|
270
|
-
:host .b2b-
|
|
268
|
+
:host .b2b-modal__dialog__close b2b-icon {
|
|
271
269
|
transition: all 0.3s ease;
|
|
272
|
-
--b2b-icon-cursor: pointer;
|
|
273
270
|
}
|
|
274
|
-
:host .b2b-
|
|
275
|
-
cursor: var(--b2b-icon-cursor);
|
|
276
|
-
}
|
|
277
|
-
:host .b2b-modal-dialog--footer {
|
|
271
|
+
:host .b2b-modal__dialog__footer {
|
|
278
272
|
display: flex;
|
|
279
273
|
justify-content: space-between;
|
|
280
274
|
padding-top: calc(var(--b2b-size-space-75) * 2);
|
|
281
275
|
margin-top: calc(var(--b2b-size-space-75) * 2);
|
|
282
276
|
border-top: var(--b2b-size-1) solid var(--b2b-color-border-100);
|
|
283
277
|
}
|
|
284
|
-
:host .b2b-
|
|
278
|
+
:host .b2b-modal__dialog__footer-left {
|
|
285
279
|
display: flex;
|
|
286
280
|
justify-content: flex-start;
|
|
287
281
|
}
|
|
288
|
-
:host .b2b-
|
|
282
|
+
:host .b2b-modal__dialog__footer-right {
|
|
289
283
|
display: flex;
|
|
290
284
|
justify-content: flex-end;
|
|
291
285
|
}
|
|
292
|
-
:host .b2b-
|
|
286
|
+
:host .b2b-modal__dialog--large {
|
|
293
287
|
max-width: var(--b2b-component-modal-large-max-width);
|
|
294
288
|
}
|
|
295
289
|
@media only screen and (max-width: var(--b2b-component-modal-large-max-width)) {
|
|
296
|
-
:host .b2b-
|
|
290
|
+
:host .b2b-modal__dialog--large {
|
|
297
291
|
left: 0;
|
|
298
292
|
width: auto;
|
|
299
293
|
max-width: var(--b2b-component-modal-large-max-width);
|
|
300
294
|
}
|
|
301
295
|
}
|
|
302
296
|
@media only screen and (max-width: var(--b2b-component-modal-default-max-width)) {
|
|
303
|
-
:host .b2b-
|
|
297
|
+
:host .b2b-modal__dialog {
|
|
304
298
|
left: 0;
|
|
305
299
|
width: auto;
|
|
306
300
|
max-width: var(--b2b-component-modal-default-max-width);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('b2b-modal', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="false">Test</b2b-modal>');
|
|
6
|
+
const element = await page.find('b2b-modal');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
const modalDiv = await page.find('b2b-modal >>> div');
|
|
9
|
+
expect(await modalDiv.isVisible()).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
it('open modal & heading', async () => {
|
|
12
|
+
const page = await newE2EPage();
|
|
13
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
14
|
+
const modalDiv = await page.find('b2b-modal >>> div');
|
|
15
|
+
expect(await modalDiv.isVisible()).toBe(true);
|
|
16
|
+
const headingElm = await modalDiv.find('b2b-headline');
|
|
17
|
+
expect(headingElm.textContent).toBe('Test Modal');
|
|
18
|
+
});
|
|
19
|
+
it('verify initial focus', async () => {
|
|
20
|
+
const page = await newE2EPage();
|
|
21
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
22
|
+
const modalDiv = await page.find('b2b-modal >>> div');
|
|
23
|
+
expect(await modalDiv.isVisible()).toBe(true);
|
|
24
|
+
await page.keyboard.press('Tab');
|
|
25
|
+
const closeContent = await page.evaluate(() => {
|
|
26
|
+
return document.activeElement.shadowRoot.activeElement.className;
|
|
27
|
+
});
|
|
28
|
+
expect(closeContent).toBe('b2b-modal__dialog__close');
|
|
29
|
+
});
|
|
30
|
+
it('verify focus trap', async () => {
|
|
31
|
+
const page = await newE2EPage();
|
|
32
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
33
|
+
const modalDiv = await page.find('b2b-modal >>> div');
|
|
34
|
+
expect(await modalDiv.isVisible()).toBe(true);
|
|
35
|
+
await page.keyboard.press('Tab');
|
|
36
|
+
let closeContent = await page.evaluate(() => {
|
|
37
|
+
return document.activeElement.shadowRoot.activeElement.className;
|
|
38
|
+
});
|
|
39
|
+
expect(closeContent).toBe('b2b-modal__dialog__close');
|
|
40
|
+
await page.keyboard.press('Tab');
|
|
41
|
+
closeContent = await page.evaluate(() => {
|
|
42
|
+
return document.activeElement.shadowRoot.activeElement.className;
|
|
43
|
+
});
|
|
44
|
+
expect(closeContent).toBe('b2b-modal__dialog__close');
|
|
45
|
+
});
|
|
46
|
+
it('verify close hover', async () => {
|
|
47
|
+
const page = await newE2EPage();
|
|
48
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
49
|
+
const modalDiv = await page.find('b2b-modal >>> div');
|
|
50
|
+
expect(await modalDiv.isVisible()).toBe(true);
|
|
51
|
+
const closeIcon = await page.find('b2b-modal >>> b2b-icon');
|
|
52
|
+
const closeIconColorBefore = await closeIcon.getProperty('color');
|
|
53
|
+
expect(closeIconColorBefore).toBe('secondary');
|
|
54
|
+
await closeIcon.hover();
|
|
55
|
+
await page.waitForChanges();
|
|
56
|
+
const closeIconColorAfter = await closeIcon.getProperty('color');
|
|
57
|
+
expect(closeIconColorAfter).toBe('primary');
|
|
58
|
+
});
|
|
59
|
+
it('verify close emit', async () => {
|
|
60
|
+
const page = await newE2EPage();
|
|
61
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
62
|
+
const b2bBeforeClose = await page.spyOnEvent('b2b-before-close');
|
|
63
|
+
const b2bClose = await page.spyOnEvent('b2b-close');
|
|
64
|
+
const closeIcon = await page.find('b2b-modal >>> b2b-icon');
|
|
65
|
+
await closeIcon.click();
|
|
66
|
+
expect(b2bBeforeClose).toHaveReceivedEvent();
|
|
67
|
+
expect(b2bClose).toHaveReceivedEvent();
|
|
68
|
+
});
|
|
69
|
+
it('verify esc emit', async () => {
|
|
70
|
+
const page = await newE2EPage();
|
|
71
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
72
|
+
const b2bBeforeClose = await page.spyOnEvent('b2b-before-close');
|
|
73
|
+
const b2bClose = await page.spyOnEvent('b2b-close');
|
|
74
|
+
await page.keyboard.press('Tab');
|
|
75
|
+
await page.keyboard.press('Escape');
|
|
76
|
+
expect(b2bBeforeClose).toHaveReceivedEvent();
|
|
77
|
+
expect(b2bClose).toHaveReceivedEvent();
|
|
78
|
+
});
|
|
79
|
+
it('verify esc no-emit', async () => {
|
|
80
|
+
const page = await newE2EPage();
|
|
81
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true" esc-dismiss="false">Test</b2b-modal>');
|
|
82
|
+
const b2bBeforeClose = await page.spyOnEvent('b2b-before-close');
|
|
83
|
+
const b2bClose = await page.spyOnEvent('b2b-close');
|
|
84
|
+
await page.keyboard.press('Tab');
|
|
85
|
+
await page.keyboard.press('Escape');
|
|
86
|
+
expect(b2bBeforeClose).not.toHaveReceivedEvent();
|
|
87
|
+
expect(b2bClose).not.toHaveReceivedEvent();
|
|
88
|
+
});
|
|
89
|
+
it('verify backdrop dismiss emit', async () => {
|
|
90
|
+
const page = await newE2EPage();
|
|
91
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true" backdrop-dismiss="true">Test</b2b-modal>');
|
|
92
|
+
const b2bBeforeClose = await page.spyOnEvent('b2b-before-close');
|
|
93
|
+
const b2bClose = await page.spyOnEvent('b2b-close');
|
|
94
|
+
await page.evaluate(() => {
|
|
95
|
+
document
|
|
96
|
+
.querySelector('b2b-modal')
|
|
97
|
+
.shadowRoot.querySelector('div > div.b2b-modal__backdrop').click();
|
|
98
|
+
});
|
|
99
|
+
expect(b2bBeforeClose).toHaveReceivedEvent();
|
|
100
|
+
expect(b2bClose).toHaveReceivedEvent();
|
|
101
|
+
});
|
|
102
|
+
it('verify backdrop dismiss not emit', async () => {
|
|
103
|
+
const page = await newE2EPage();
|
|
104
|
+
await page.setContent('<b2b-modal heading="Test Modal" opened="true">Test</b2b-modal>');
|
|
105
|
+
const b2bBeforeClose = await page.spyOnEvent('b2b-before-close');
|
|
106
|
+
const b2bClose = await page.spyOnEvent('b2b-close');
|
|
107
|
+
await page.evaluate(() => {
|
|
108
|
+
document
|
|
109
|
+
.querySelector('b2b-modal')
|
|
110
|
+
.shadowRoot.querySelector('div > div.b2b-modal__backdrop').click();
|
|
111
|
+
});
|
|
112
|
+
expect(b2bBeforeClose).not.toHaveReceivedEvent();
|
|
113
|
+
expect(b2bClose).not.toHaveReceivedEvent();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -83,9 +83,9 @@ export class ModalComponent {
|
|
|
83
83
|
}
|
|
84
84
|
render() {
|
|
85
85
|
return (h(Host, null, h("div", { class: { 'b2b-modal': true, 'b2b-modal--open': this.opened } }, h("div", { "data-focus-trap-edge": true, onFocus: this.handleTopFocus, tabIndex: 0 }), h("div", { class: {
|
|
86
|
-
'b2b-
|
|
87
|
-
[`b2b-
|
|
88
|
-
} }, h("div", { class: "b2b-
|
|
86
|
+
'b2b-modal__dialog': true,
|
|
87
|
+
[`b2b-modal__dialog--${this.variant}`]: true,
|
|
88
|
+
} }, h("div", { class: "b2b-modal__dialog__header" }, h("b2b-headline", { align: "center", size: "200", noMargin: true }, this.heading), h("button", { type: "button", class: "b2b-modal__dialog__close", onMouseEnter: this.toggleIconHover, onMouseLeave: this.toggleIconHover, onClick: this.handleClickDismiss, ref: el => (this.closeButton = el) }, h("b2b-icon", { clickable: true, icon: "b2b_icon-close", color: this.iconHover ? 'primary' : 'secondary' }))), h("div", { class: "b2b-modal__dialog__body" }, h("slot", null)), h("div", { class: "b2b-modal__dialog__footer" }, h("div", { class: "b2b-modal__dialog__footer-left" }, h("slot", { name: "footer-left" })), h("div", { class: "b2b-modal__dialog__footer-right" }, h("slot", { name: "footer-right" })))), h("div", { "data-focus-trap-edge": true, onFocus: this.handleBottomFocus, tabIndex: 0 }), h("div", { class: "b2b-modal__backdrop", onClick: this.handleBackdropDismiss }))));
|
|
89
89
|
}
|
|
90
90
|
static get is() { return "b2b-modal"; }
|
|
91
91
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -226,20 +225,20 @@
|
|
|
226
225
|
.b2b-pagination li {
|
|
227
226
|
transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
228
227
|
}
|
|
229
|
-
.b2b-pagination li:first-child:not(.b2b-
|
|
228
|
+
.b2b-pagination li:first-child:not(.b2b-pagination__first-item) {
|
|
230
229
|
margin-right: var(--b2b-size-15);
|
|
231
230
|
}
|
|
232
|
-
.b2b-pagination li:last-child:not(.b2b-
|
|
231
|
+
.b2b-pagination li:last-child:not(.b2b-pagination__last-item) {
|
|
233
232
|
margin-left: var(--b2b-size-15);
|
|
234
233
|
}
|
|
235
|
-
.b2b-pagination li.b2b-
|
|
234
|
+
.b2b-pagination li.b2b-pagination__item b2b-button {
|
|
236
235
|
--b2b-border-radius: 0;
|
|
237
236
|
--b2b-border-right: 0;
|
|
238
237
|
}
|
|
239
|
-
.b2b-pagination li.b2b-
|
|
238
|
+
.b2b-pagination li.b2b-pagination__first-item b2b-button {
|
|
240
239
|
--b2b-border-radius: var(--b2b-size-border-no-radius-right);
|
|
241
240
|
}
|
|
242
|
-
.b2b-pagination li.b2b-
|
|
241
|
+
.b2b-pagination li.b2b-pagination__last-item b2b-button {
|
|
243
242
|
--b2b-border-right: 1px solid var(--b2b-button-secondary-border-color);
|
|
244
243
|
--b2b-border-radius: var(--b2b-size-border-no-radius-left);
|
|
245
244
|
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
import { PaginationConstants } from './pagination.constants';
|
|
3
|
+
describe('B2B-Pagination', () => {
|
|
4
|
+
let page;
|
|
5
|
+
const getPaginationElement = async (page) => await page.find('b2b-pagination >>> nav');
|
|
6
|
+
const clickBack = async (pagination) => {
|
|
7
|
+
const backButton = await pagination.find({
|
|
8
|
+
text: PaginationConstants.BACK,
|
|
9
|
+
});
|
|
10
|
+
await backButton.click();
|
|
11
|
+
};
|
|
12
|
+
const clickNext = async (pagination) => {
|
|
13
|
+
const nextButton = await pagination.find({
|
|
14
|
+
text: PaginationConstants.NEXT,
|
|
15
|
+
});
|
|
16
|
+
await nextButton.click();
|
|
17
|
+
};
|
|
18
|
+
const navigationItemsSelector = 'b2b-pagination >>> li.b2b-pagination--item';
|
|
19
|
+
it('should set next page to active when click on next button', async () => {
|
|
20
|
+
page = await newE2EPage();
|
|
21
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='1'></b2b-pagination>`);
|
|
22
|
+
await page.waitForChanges();
|
|
23
|
+
const pagination = await getPaginationElement(page);
|
|
24
|
+
let firstItem = await pagination.find({ text: '1' });
|
|
25
|
+
expect(firstItem).toHaveAttribute('active');
|
|
26
|
+
await clickNext(pagination);
|
|
27
|
+
await page.waitForChanges();
|
|
28
|
+
firstItem = await pagination.find({ text: '1' });
|
|
29
|
+
expect(firstItem).not.toHaveAttribute('active');
|
|
30
|
+
const secondItem = await pagination.find({ text: '2' });
|
|
31
|
+
expect(secondItem).toHaveAttribute('active');
|
|
32
|
+
});
|
|
33
|
+
it('should set previous page to active when click on previous button', async () => {
|
|
34
|
+
page = await newE2EPage();
|
|
35
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='5'></b2b-pagination>`);
|
|
36
|
+
await page.waitForChanges();
|
|
37
|
+
const pagination = await getPaginationElement(page);
|
|
38
|
+
let lastItem = await pagination.find({ text: '5' });
|
|
39
|
+
expect(lastItem).toHaveAttribute('active');
|
|
40
|
+
await clickBack(pagination);
|
|
41
|
+
await page.waitForChanges();
|
|
42
|
+
lastItem = await pagination.find({ text: '5' });
|
|
43
|
+
expect(lastItem).not.toHaveAttribute('active');
|
|
44
|
+
const secondItem = await pagination.find({ text: '4' });
|
|
45
|
+
expect(secondItem).toHaveAttribute('active');
|
|
46
|
+
});
|
|
47
|
+
it('should update the items collection when navigating forward', async () => {
|
|
48
|
+
page = await newE2EPage();
|
|
49
|
+
await page.setContent(`<b2b-pagination total-pages='7' active-page='3'></b2b-pagination>`);
|
|
50
|
+
await page.waitForChanges();
|
|
51
|
+
const pagination = await getPaginationElement(page);
|
|
52
|
+
let items = await page.findAll(navigationItemsSelector);
|
|
53
|
+
const startingItemsCollection = ['1', '2', '3', '...', '7'];
|
|
54
|
+
items.forEach((item, index) => {
|
|
55
|
+
expect(item.textContent).toBe(startingItemsCollection[index]);
|
|
56
|
+
});
|
|
57
|
+
await clickNext(pagination);
|
|
58
|
+
await page.waitForChanges();
|
|
59
|
+
items = await page.findAll(navigationItemsSelector);
|
|
60
|
+
const expectedNextItemCollection = ['1', '...', '3', '4', '5', '...', '7'];
|
|
61
|
+
items.forEach((item, index) => {
|
|
62
|
+
expect(item.textContent).toBe(expectedNextItemCollection[index]);
|
|
63
|
+
});
|
|
64
|
+
const nextActiveItem = await pagination.find({ text: '4' });
|
|
65
|
+
expect(nextActiveItem).toHaveAttribute('active');
|
|
66
|
+
});
|
|
67
|
+
it('should update the items collection when navigating back', async () => {
|
|
68
|
+
page = await newE2EPage();
|
|
69
|
+
await page.setContent(`<b2b-pagination total-pages='7' active-page='5'></b2b-pagination>`);
|
|
70
|
+
await page.waitForChanges();
|
|
71
|
+
const pagination = await getPaginationElement(page);
|
|
72
|
+
let items = await page.findAll(navigationItemsSelector);
|
|
73
|
+
const startingItemsCollection = ['1', '...', '5', '6', '7'];
|
|
74
|
+
items.forEach((item, index) => {
|
|
75
|
+
expect(item.textContent).toBe(startingItemsCollection[index]);
|
|
76
|
+
});
|
|
77
|
+
await clickBack(pagination);
|
|
78
|
+
await page.waitForChanges();
|
|
79
|
+
items = await page.findAll(navigationItemsSelector);
|
|
80
|
+
const expectedBackItemCollection = ['1', '...', '3', '4', '5', '...', '7'];
|
|
81
|
+
items.forEach((item, index) => {
|
|
82
|
+
expect(item.textContent).toBe(expectedBackItemCollection[index]);
|
|
83
|
+
});
|
|
84
|
+
const nextActiveItem = await pagination.find({ text: '4' });
|
|
85
|
+
expect(nextActiveItem).toHaveAttribute('active');
|
|
86
|
+
});
|
|
87
|
+
it('should navigate to the selected item', async () => {
|
|
88
|
+
page = await newE2EPage();
|
|
89
|
+
await page.setContent(`<b2b-pagination total-pages='7' active-page='1'></b2b-pagination>`);
|
|
90
|
+
await page.waitForChanges();
|
|
91
|
+
const pagination = await getPaginationElement(page);
|
|
92
|
+
let nextSelectedItem = await pagination.find({ text: '2' });
|
|
93
|
+
expect(nextSelectedItem).not.toHaveAttribute('active');
|
|
94
|
+
await nextSelectedItem.click();
|
|
95
|
+
await page.waitForChanges();
|
|
96
|
+
nextSelectedItem = await pagination.find({ text: '2' });
|
|
97
|
+
expect(nextSelectedItem).toHaveAttribute('active');
|
|
98
|
+
});
|
|
99
|
+
it('should jump 2 steps forward when clicking right DOTS', async () => {
|
|
100
|
+
page = await newE2EPage();
|
|
101
|
+
await page.setContent(`<b2b-pagination total-pages='10' active-page='3'></b2b-pagination>`);
|
|
102
|
+
await page.waitForChanges();
|
|
103
|
+
const pagination = await getPaginationElement(page);
|
|
104
|
+
// only one DOTS element in this example - right DOTS
|
|
105
|
+
let dotsItem = await pagination.find({ text: PaginationConstants.DOTS });
|
|
106
|
+
await dotsItem.click();
|
|
107
|
+
await page.waitForChanges();
|
|
108
|
+
const nextItem = await pagination.find({ text: '5' });
|
|
109
|
+
expect(nextItem).toHaveAttribute('active');
|
|
110
|
+
const items = await page.findAll(navigationItemsSelector);
|
|
111
|
+
const expectedBackItemCollection = ['1', '...', '4', '5', '6', '...', '10'];
|
|
112
|
+
items.forEach((item, index) => {
|
|
113
|
+
expect(item.textContent).toBe(expectedBackItemCollection[index]);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
it('should jump 2 steps back when clicking left DOTS', async () => {
|
|
117
|
+
page = await newE2EPage();
|
|
118
|
+
await page.setContent(`<b2b-pagination total-pages='10' active-page='8'></b2b-pagination>`);
|
|
119
|
+
await page.waitForChanges();
|
|
120
|
+
const pagination = await getPaginationElement(page);
|
|
121
|
+
// only one DOTS element in this example - left DOTS
|
|
122
|
+
let dotsItem = await pagination.find({ text: PaginationConstants.DOTS });
|
|
123
|
+
await dotsItem.click();
|
|
124
|
+
await page.waitForChanges();
|
|
125
|
+
const nextItem = await pagination.find({ text: '6' });
|
|
126
|
+
expect(nextItem).toHaveAttribute('active');
|
|
127
|
+
const items = await page.findAll(navigationItemsSelector);
|
|
128
|
+
const expectedBackItemCollection = ['1', '...', '5', '6', '7', '...', '10'];
|
|
129
|
+
items.forEach((item, index) => {
|
|
130
|
+
expect(item.textContent).toBe(expectedBackItemCollection[index]);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
it('back button should disappear when first page is selected ', async () => {
|
|
134
|
+
page = await newE2EPage();
|
|
135
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='2'></b2b-pagination>`);
|
|
136
|
+
await page.waitForChanges();
|
|
137
|
+
const pagination = await getPaginationElement(page);
|
|
138
|
+
let backButton = await pagination.find({ text: PaginationConstants.BACK });
|
|
139
|
+
expect(backButton).not.toBeNull();
|
|
140
|
+
let firstPage = await pagination.find({ text: '1' });
|
|
141
|
+
await firstPage.click();
|
|
142
|
+
backButton = await pagination.find({ text: PaginationConstants.BACK });
|
|
143
|
+
expect(backButton).toBeNull();
|
|
144
|
+
});
|
|
145
|
+
it('next button should disappear when last page is selected ', async () => {
|
|
146
|
+
page = await newE2EPage();
|
|
147
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='4'></b2b-pagination>`);
|
|
148
|
+
await page.waitForChanges();
|
|
149
|
+
const pagination = await getPaginationElement(page);
|
|
150
|
+
let nextButton = await pagination.find({ text: PaginationConstants.NEXT });
|
|
151
|
+
expect(nextButton).not.toBeNull();
|
|
152
|
+
let lastPage = await pagination.find({ text: '5' });
|
|
153
|
+
await lastPage.click();
|
|
154
|
+
nextButton = await pagination.find({ text: PaginationConstants.NEXT });
|
|
155
|
+
expect(nextButton).toBeNull();
|
|
156
|
+
});
|
|
157
|
+
it('should emit event with details when click on next button', async () => {
|
|
158
|
+
page = await newE2EPage();
|
|
159
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='1'></b2b-pagination>`);
|
|
160
|
+
await page.waitForChanges();
|
|
161
|
+
const paginationEvent = await page.spyOnEvent('b2b-page-change');
|
|
162
|
+
const pagination = await getPaginationElement(page);
|
|
163
|
+
await clickNext(pagination);
|
|
164
|
+
expect(paginationEvent).toHaveReceivedEvent();
|
|
165
|
+
expect(paginationEvent).toHaveFirstReceivedEventDetail({
|
|
166
|
+
lastSelectedPage: 1,
|
|
167
|
+
currentPage: 2,
|
|
168
|
+
direction: 'NEXT',
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
it('should emit event with details when click on back button', async () => {
|
|
172
|
+
page = await newE2EPage();
|
|
173
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='5'></b2b-pagination>`);
|
|
174
|
+
await page.waitForChanges();
|
|
175
|
+
const paginationEvent = await page.spyOnEvent('b2b-page-change');
|
|
176
|
+
const pagination = await getPaginationElement(page);
|
|
177
|
+
await clickBack(pagination);
|
|
178
|
+
expect(paginationEvent).toHaveReceivedEvent();
|
|
179
|
+
expect(paginationEvent).toHaveFirstReceivedEventDetail({
|
|
180
|
+
lastSelectedPage: 5,
|
|
181
|
+
currentPage: 4,
|
|
182
|
+
direction: 'PREVIOUS',
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
it('should emit event with details when click on an item', async () => {
|
|
186
|
+
page = await newE2EPage();
|
|
187
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='1'></b2b-pagination>`);
|
|
188
|
+
await page.waitForChanges();
|
|
189
|
+
const paginationEvent = await page.spyOnEvent('b2b-page-change');
|
|
190
|
+
const pagination = await getPaginationElement(page);
|
|
191
|
+
let nextItem = await pagination.find({ text: '4' });
|
|
192
|
+
await nextItem.click();
|
|
193
|
+
await page.waitForChanges();
|
|
194
|
+
expect(paginationEvent).toHaveReceivedEvent();
|
|
195
|
+
expect(paginationEvent).toHaveFirstReceivedEventDetail({
|
|
196
|
+
lastSelectedPage: 1,
|
|
197
|
+
currentPage: 4,
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
it('should refresh items when total items changes dynamically', async () => {
|
|
201
|
+
page = await newE2EPage();
|
|
202
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='1'></b2b-pagination>`);
|
|
203
|
+
await page.waitForChanges();
|
|
204
|
+
let items = await page.findAll(navigationItemsSelector);
|
|
205
|
+
const expectedInitialCollection = ['1', '2', '3', '4', '5'];
|
|
206
|
+
items.forEach((item, index) => {
|
|
207
|
+
expect(item.textContent).toBe(expectedInitialCollection[index]);
|
|
208
|
+
});
|
|
209
|
+
const element = await page.find('b2b-pagination');
|
|
210
|
+
await element.setAttribute('total-pages', 20);
|
|
211
|
+
await page.waitForChanges();
|
|
212
|
+
items = await page.findAll(navigationItemsSelector);
|
|
213
|
+
const expectedUpdatedCollection = ['1', '2', '3', '...', '20'];
|
|
214
|
+
items.forEach((item, index) => {
|
|
215
|
+
expect(item.textContent).toBe(expectedUpdatedCollection[index]);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
it('should set selected page to total pages when total items changes dynamically and is lower than selected page', async () => {
|
|
219
|
+
page = await newE2EPage();
|
|
220
|
+
await page.setContent(`<b2b-pagination total-pages='20' active-page='10'></b2b-pagination>`);
|
|
221
|
+
await page.waitForChanges();
|
|
222
|
+
const element = await page.find('b2b-pagination');
|
|
223
|
+
expect(element.getAttribute('active-page')).toBe('10');
|
|
224
|
+
await element.setAttribute('total-pages', 5);
|
|
225
|
+
await page.waitForChanges();
|
|
226
|
+
expect(element.getAttribute('active-page')).toBe('5');
|
|
227
|
+
});
|
|
228
|
+
it('should refresh items when active page changes dynamically', async () => {
|
|
229
|
+
page = await newE2EPage();
|
|
230
|
+
await page.setContent(`<b2b-pagination total-pages='10' active-page='1'></b2b-pagination>`);
|
|
231
|
+
await page.waitForChanges();
|
|
232
|
+
let items = await page.findAll(navigationItemsSelector);
|
|
233
|
+
const expectedInitialCollection = ['1', '2', '3', '...', '10'];
|
|
234
|
+
items.forEach((item, index) => {
|
|
235
|
+
expect(item.textContent).toBe(expectedInitialCollection[index]);
|
|
236
|
+
});
|
|
237
|
+
const element = await page.find('b2b-pagination');
|
|
238
|
+
await element.setAttribute('active-page', 5);
|
|
239
|
+
await page.waitForChanges();
|
|
240
|
+
items = await page.findAll(navigationItemsSelector);
|
|
241
|
+
const expectedUpdatedCollection = ['1', '...', '4', '5', '6', '...', '10'];
|
|
242
|
+
items.forEach((item, index) => {
|
|
243
|
+
expect(item.textContent).toBe(expectedUpdatedCollection[index]);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
it('should set selected page to total pages when selected page changes dynamically and is higher than total pages', async () => {
|
|
247
|
+
page = await newE2EPage();
|
|
248
|
+
await page.setContent(`<b2b-pagination total-pages='5' active-page='2'></b2b-pagination>`);
|
|
249
|
+
await page.waitForChanges();
|
|
250
|
+
const element = await page.find('b2b-pagination');
|
|
251
|
+
expect(element.getAttribute('active-page')).toBe('2');
|
|
252
|
+
await element.setAttribute('active-page', 20);
|
|
253
|
+
await page.waitForChanges();
|
|
254
|
+
expect(element.getAttribute('active-page')).toBe('5');
|
|
255
|
+
});
|
|
256
|
+
});
|
|
@@ -86,9 +86,9 @@ export class PaginationComponent {
|
|
|
86
86
|
}
|
|
87
87
|
getItemClass(navItem) {
|
|
88
88
|
return {
|
|
89
|
-
'b2b-
|
|
90
|
-
'b2b-
|
|
91
|
-
'b2b-
|
|
89
|
+
'b2b-pagination__first-item': navItem === this.firstPageIndex,
|
|
90
|
+
'b2b-pagination__last-item': navItem === this.totalPages,
|
|
91
|
+
'b2b-pagination__item': true,
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
render() {
|