wcs-core 7.5.0 → 7.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/bundle/{p-763371a0.js → p-1329a1af.js} +3 -3
- package/bundle/p-1329a1af.js.map +1 -0
- package/bundle/p-2f7bca1e.js +2 -0
- package/bundle/p-2f7bca1e.js.map +1 -0
- package/bundle/p-475be4d2.js +2 -0
- package/bundle/{p-010cf905.js → p-5ef2bc63.js} +2 -2
- package/bundle/{p-44a3b0b9.js → p-7a06295b.js} +2 -2
- package/bundle/{p-2751ddc1.js → p-8b186fcf.js} +2 -2
- package/bundle/{p-d23d7658.js → p-a0268a31.js} +2 -2
- package/bundle/{p-c8b73e93.js → p-bce8c93f.js} +2 -2
- package/bundle/{p-2e9b9605.js → p-bf326ae8.js} +2 -2
- package/bundle/{p-98bd8a96.js → p-d018450c.js} +2 -2
- package/bundle/p-d05140f5.js +2 -0
- package/bundle/p-d05140f5.js.map +1 -0
- package/bundle/{p-f0dda0b8.js → p-d3fe6951.js} +2 -2
- package/bundle/{p-9c2aa87a.js → p-ee6ff5f8.js} +2 -2
- package/bundle/{p-cdc6f6c2.js → p-ff261e50.js} +2 -2
- package/bundle/wcs-accordion-panel.js +1 -1
- package/bundle/wcs-alert-drawer.js +1 -1
- package/bundle/wcs-alert.js +1 -1
- package/bundle/wcs-breadcrumb.js +1 -1
- package/bundle/wcs-button.js +1 -1
- package/bundle/wcs-card-content.js +1 -1
- package/bundle/wcs-card-content.js.map +1 -1
- package/bundle/wcs-card.js +1 -1
- package/bundle/wcs-card.js.map +1 -1
- package/bundle/wcs-checkbox.js +1 -1
- package/bundle/wcs-com-nav-category.js +1 -1
- package/bundle/wcs-com-nav-submenu.js +1 -1
- package/bundle/wcs-com-nav.js +1 -1
- package/bundle/wcs-counter.js +1 -1
- package/bundle/wcs-dropdown-item.js +1 -1
- package/bundle/wcs-dropdown.js +1 -1
- package/bundle/wcs-dropdown.js.map +1 -1
- package/bundle/wcs-editable-field.js +1 -1
- package/bundle/wcs-editable-field.js.map +1 -1
- package/bundle/wcs-form-field.js +1 -1
- package/bundle/wcs-galactic-menu.js +1 -1
- package/bundle/wcs-grid-column.js +1 -1
- package/bundle/wcs-grid-column.js.map +1 -1
- package/bundle/wcs-grid-custom-cell.js +1 -1
- package/bundle/wcs-grid-custom-cell.js.map +1 -1
- package/bundle/wcs-grid-pagination.js +1 -1
- package/bundle/wcs-grid.js +1 -1
- package/bundle/wcs-grid.js.map +1 -1
- package/bundle/wcs-header.js +1 -1
- package/bundle/wcs-hint.js +1 -1
- package/bundle/wcs-horizontal-stepper.js +1 -1
- package/bundle/wcs-icon.js +1 -1
- package/bundle/wcs-input.js +1 -1
- package/bundle/wcs-input.js.map +1 -1
- package/bundle/wcs-label.js +1 -1
- package/bundle/wcs-list-item-properties.js +1 -1
- package/bundle/wcs-list-item-property.js +1 -1
- package/bundle/wcs-list-item.js +1 -1
- package/bundle/wcs-mat-icon.js +1 -1
- package/bundle/wcs-modal.js +1 -1
- package/bundle/wcs-native-select.js +1 -1
- package/bundle/wcs-nav-item.js +1 -1
- package/bundle/wcs-nav.js +1 -1
- package/bundle/wcs-progress-bar.js +1 -1
- package/bundle/wcs-progress-radial.js +1 -1
- package/bundle/wcs-radio-group.js +1 -1
- package/bundle/wcs-radio-group.js.map +1 -1
- package/bundle/wcs-radio.js +1 -1
- package/bundle/wcs-radio.js.map +1 -1
- package/bundle/wcs-select-option.js +1 -1
- package/bundle/wcs-select.js +1 -1
- package/bundle/wcs-skeleton-circle.js +1 -1
- package/bundle/wcs-skeleton-rectangle.js +1 -1
- package/bundle/wcs-skeleton-text.js +1 -1
- package/bundle/wcs-spinner.js +1 -1
- package/bundle/wcs-switch.js +1 -1
- package/bundle/wcs-tab.js +1 -1
- package/bundle/wcs-tabs.js +1 -1
- package/bundle/wcs-textarea.js +1 -1
- package/bundle/wcs-tooltip.js +2 -2
- package/composite-elements/{p-af24fb0d.js → p-00dd13c3.js} +3 -3
- package/composite-elements/p-00dd13c3.js.map +1 -0
- package/composite-elements/p-6b91c7bd.js +2 -0
- package/composite-elements/p-6b91c7bd.js.map +1 -0
- package/{bundle/p-30d83d3d.js → composite-elements/p-7feba658.js} +2 -2
- package/composite-elements/p-7feba658.js.map +1 -0
- package/composite-elements/{p-b83afff9.js → p-87e97a2e.js} +2 -2
- package/composite-elements/{p-b92e818b.js → p-a70a3379.js} +2 -2
- package/composite-elements/{p-55668982.js → p-c028b8e6.js} +2 -2
- package/composite-elements/{p-2a51c239.js → p-c6adb221.js} +2 -2
- package/composite-elements/{p-04663560.js → p-e4e3ed2c.js} +2 -2
- package/composite-elements/{p-51517fda.js → p-ec3ce4d4.js} +2 -2
- package/composite-elements/wcs-alert-drawer.js +1 -1
- package/composite-elements/wcs-alert.js +1 -1
- package/composite-elements/wcs-breadcrumb.js +1 -1
- package/composite-elements/wcs-button.js +1 -1
- package/composite-elements/wcs-card-content.js +1 -1
- package/composite-elements/wcs-card-content.js.map +1 -1
- package/composite-elements/wcs-card.js +1 -1
- package/composite-elements/wcs-card.js.map +1 -1
- package/composite-elements/wcs-counter.js +1 -1
- package/composite-elements/wcs-dropdown.js +1 -1
- package/composite-elements/wcs-dropdown.js.map +1 -1
- package/composite-elements/wcs-editable-field.js +1 -1
- package/composite-elements/wcs-editable-field.js.map +1 -1
- package/composite-elements/wcs-galactic-menu.js +1 -1
- package/composite-elements/wcs-grid-column.js +1 -1
- package/composite-elements/wcs-grid-column.js.map +1 -1
- package/composite-elements/wcs-grid-custom-cell.js +1 -1
- package/composite-elements/wcs-grid-custom-cell.js.map +1 -1
- package/composite-elements/wcs-grid-pagination.js +1 -1
- package/composite-elements/wcs-grid.js +1 -1
- package/composite-elements/wcs-grid.js.map +1 -1
- package/composite-elements/wcs-header.js +1 -1
- package/composite-elements/wcs-hint.js +1 -1
- package/composite-elements/wcs-horizontal-stepper.js +1 -1
- package/composite-elements/wcs-icon.js +1 -1
- package/composite-elements/wcs-input.js +1 -1
- package/composite-elements/wcs-input.js.map +1 -1
- package/composite-elements/wcs-label.js +1 -1
- package/composite-elements/wcs-list-item-properties.js +1 -1
- package/composite-elements/wcs-list-item-property.js +1 -1
- package/composite-elements/wcs-list-item.js +1 -1
- package/composite-elements/wcs-mat-icon.js +1 -1
- package/composite-elements/wcs-modal.js +1 -1
- package/composite-elements/wcs-native-select.js +1 -1
- package/composite-elements/wcs-nav-item.js +1 -1
- package/composite-elements/wcs-nav.js +1 -1
- package/composite-elements/wcs-progress-bar.js +1 -1
- package/composite-elements/wcs-progress-radial.js +1 -1
- package/composite-elements/wcs-radio-group.js +1 -1
- package/composite-elements/wcs-radio.js +1 -1
- package/composite-elements/wcs-radio.js.map +1 -1
- package/composite-elements/wcs-select-option.js +1 -1
- package/composite-elements/wcs-select.js +1 -1
- package/composite-elements/wcs-skeleton-circle.js +1 -1
- package/composite-elements/wcs-skeleton-rectangle.js +1 -1
- package/composite-elements/wcs-skeleton-text.js +1 -1
- package/composite-elements/wcs-spinner.js +1 -1
- package/composite-elements/wcs-switch.js +1 -1
- package/composite-elements/wcs-tab.js +1 -1
- package/composite-elements/wcs-tabs.js +1 -1
- package/composite-elements/wcs-textarea.js +1 -1
- package/composite-elements/wcs-tooltip.js +1 -1
- package/dist/cjs/{grid-pagination-4505d7b6.js → grid-pagination-ded127cc.js} +2 -2
- package/dist/cjs/grid-pagination-ded127cc.js.map +1 -0
- package/dist/cjs/{isEqual-8a0a6936.js → isEqual-be8e5a57.js} +2 -2
- package/dist/cjs/{isEqual-8a0a6936.js.map → isEqual-be8e5a57.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/wcs-button_2.cjs.entry.js +1 -1
- package/dist/cjs/wcs-card-content.cjs.entry.js +1 -1
- package/dist/cjs/wcs-card-content.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-card.cjs.entry.js +1 -1
- package/dist/cjs/wcs-card.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-editable-field.cjs.entry.js +34 -10
- package/dist/cjs/wcs-editable-field.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-error_3.cjs.entry.js +2 -2
- package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-grid-column.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid-pagination.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid.cjs.entry.js +6 -6
- package/dist/cjs/wcs-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-header.cjs.entry.js +1 -1
- package/dist/cjs/wcs-hint.cjs.entry.js +1 -1
- package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +1 -1
- package/dist/cjs/wcs-icon.cjs.entry.js +1 -1
- package/dist/cjs/wcs-input.cjs.entry.js +1 -6
- package/dist/cjs/wcs-input.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-list-item-properties.cjs.entry.js +1 -1
- package/dist/cjs/wcs-list-item-property.cjs.entry.js +1 -1
- package/dist/cjs/wcs-list-item.cjs.entry.js +1 -1
- package/dist/cjs/wcs-mat-icon.cjs.entry.js +1 -1
- package/dist/cjs/wcs-modal.cjs.entry.js +1 -1
- package/dist/cjs/wcs-native-select.cjs.entry.js +1 -1
- package/dist/cjs/wcs-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/wcs-nav.cjs.entry.js +1 -1
- package/dist/cjs/wcs-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/wcs-progress-radial.cjs.entry.js +2 -2
- package/dist/cjs/wcs-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/wcs-radio.cjs.entry.js +24 -20
- package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-select_2.cjs.entry.js +19 -9
- package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-skeleton-circle.cjs.entry.js +1 -1
- package/dist/cjs/wcs-skeleton-rectangle.cjs.entry.js +1 -1
- package/dist/cjs/wcs-skeleton-text.cjs.entry.js +1 -1
- package/dist/cjs/wcs-switch.cjs.entry.js +1 -1
- package/dist/cjs/wcs-tab.cjs.entry.js +1 -1
- package/dist/cjs/wcs-tabs.cjs.entry.js +1 -1
- package/dist/cjs/wcs-textarea.cjs.entry.js +1 -1
- package/dist/cjs/wcs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/wcs.cjs.js +1 -1
- package/dist/collection/components/card/card.js +11 -4
- package/dist/collection/components/card/card.js.map +1 -1
- package/dist/collection/components/card-content/card-content.js +8 -3
- package/dist/collection/components/card-content/card-content.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.css +8 -0
- package/dist/collection/components/dropdown/dropdown.e2e.playwright.js +53 -0
- package/dist/collection/components/dropdown/dropdown.e2e.playwright.js.map +1 -1
- package/dist/collection/components/editable-field/editable-field.e2e.playwright.js +214 -0
- package/dist/collection/components/editable-field/editable-field.e2e.playwright.js.map +1 -1
- package/dist/collection/components/editable-field/editable-field.js +34 -10
- package/dist/collection/components/editable-field/editable-field.js.map +1 -1
- package/dist/collection/components/grid/grid-radio.css +8 -0
- package/dist/collection/components/grid/grid.e2e.playwright.js +55 -0
- package/dist/collection/components/grid/grid.e2e.playwright.js.map +1 -1
- package/dist/collection/components/grid/grid.js +3 -3
- package/dist/collection/components/grid-column/grid-column.js +1 -1
- package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +1 -1
- package/dist/collection/components/grid-pagination/grid-pagination.js +4 -1
- package/dist/collection/components/grid-pagination/grid-pagination.js.map +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/hint/hint.js +1 -1
- package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/input/input.js +2 -7
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/label/label.css +12 -9
- package/dist/collection/components/label/label.e2e.playwright.js +104 -0
- package/dist/collection/components/label/label.e2e.playwright.js.map +1 -0
- package/dist/collection/components/label/label.js +1 -1
- package/dist/collection/components/label/label.js.map +1 -1
- package/dist/collection/components/list-item/list-item.js +1 -1
- package/dist/collection/components/list-item-properties/list-item-properties.js +1 -1
- package/dist/collection/components/list-item-property/list-item-property.js +1 -1
- package/dist/collection/components/mat-icon/mat-icon.js +1 -1
- package/dist/collection/components/modal/modal.js +1 -1
- package/dist/collection/components/native-select/native-select.js +1 -1
- package/dist/collection/components/nav/nav.js +1 -1
- package/dist/collection/components/nav-item/nav-item.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +2 -2
- package/dist/collection/components/progress-radial/progress-radial.js +2 -2
- package/dist/collection/components/radio/radio.css +48 -37
- package/dist/collection/components/radio/radio.js +24 -20
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/radio-group/radio-group.e2e.playwright.js +92 -7
- package/dist/collection/components/radio-group/radio-group.e2e.playwright.js.map +1 -1
- package/dist/collection/components/radio-group/radio-group.js +1 -1
- package/dist/collection/components/select/select-interface.js.map +1 -1
- package/dist/collection/components/select/select.e2e.playwright.js +9 -9
- package/dist/collection/components/select/select.e2e.playwright.js.map +1 -1
- package/dist/collection/components/select/select.js +16 -6
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/select-option/select-option.js +2 -2
- package/dist/collection/components/skeleton-circle/skeleton-circle.js +1 -1
- package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.js +1 -1
- package/dist/collection/components/skeleton-text/skeleton-text.js +1 -1
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/textarea/textarea.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/utils/playwright/test.js +6 -0
- package/dist/collection/utils/playwright/test.js.map +1 -1
- package/dist/esm/{com-nav-utils-ee7bf77c.js → com-nav-utils-27c1efdf.js} +2 -2
- package/dist/esm/{com-nav-utils-ee7bf77c.js.map → com-nav-utils-27c1efdf.js.map} +1 -1
- package/dist/esm/{grid-pagination-731726a6.js → grid-pagination-23102986.js} +3 -3
- package/dist/esm/grid-pagination-23102986.js.map +1 -0
- package/dist/esm/{helpers-ece6a2d3.js → helpers-89faa1b1.js} +2 -2
- package/dist/esm/{helpers-ece6a2d3.js.map → helpers-89faa1b1.js.map} +1 -1
- package/dist/esm/{isEqual-f2a07f4c.js → isEqual-89e74e17.js} +2 -2
- package/dist/esm/{isEqual-f2a07f4c.js.map → isEqual-89e74e17.js.map} +1 -1
- package/dist/esm/{keyboard-event-26b65ae5.js → keyboard-event-dd35bb6b.js} +2 -2
- package/dist/esm/{keyboard-event-26b65ae5.js.map → keyboard-event-dd35bb6b.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/wcs-accordion-panel.entry.js +1 -1
- package/dist/esm/wcs-alert-drawer.entry.js +1 -1
- package/dist/esm/wcs-breadcrumb.entry.js +1 -1
- package/dist/esm/wcs-button_2.entry.js +2 -2
- package/dist/esm/wcs-card-content.entry.js +1 -1
- package/dist/esm/wcs-card-content.entry.js.map +1 -1
- package/dist/esm/wcs-card.entry.js +1 -1
- package/dist/esm/wcs-card.entry.js.map +1 -1
- package/dist/esm/wcs-checkbox.entry.js +1 -1
- package/dist/esm/wcs-com-nav-category.entry.js +2 -2
- package/dist/esm/wcs-com-nav-submenu.entry.js +2 -2
- package/dist/esm/wcs-com-nav.entry.js +2 -2
- package/dist/esm/wcs-counter.entry.js +1 -1
- package/dist/esm/wcs-dropdown-item.entry.js +1 -1
- package/dist/esm/wcs-dropdown.entry.js +3 -3
- package/dist/esm/wcs-dropdown.entry.js.map +1 -1
- package/dist/esm/wcs-editable-field.entry.js +35 -11
- package/dist/esm/wcs-editable-field.entry.js.map +1 -1
- package/dist/esm/wcs-error_3.entry.js +3 -3
- package/dist/esm/wcs-error_3.entry.js.map +1 -1
- package/dist/esm/wcs-galactic-menu.entry.js +1 -1
- package/dist/esm/wcs-grid-column.entry.js +2 -2
- package/dist/esm/wcs-grid-custom-cell.entry.js +1 -1
- package/dist/esm/wcs-grid-pagination.entry.js +2 -2
- package/dist/esm/wcs-grid.entry.js +8 -8
- package/dist/esm/wcs-grid.entry.js.map +1 -1
- package/dist/esm/wcs-header.entry.js +2 -2
- package/dist/esm/wcs-hint.entry.js +1 -1
- package/dist/esm/wcs-horizontal-stepper.entry.js +1 -1
- package/dist/esm/wcs-icon.entry.js +2 -2
- package/dist/esm/wcs-input.entry.js +2 -7
- package/dist/esm/wcs-input.entry.js.map +1 -1
- package/dist/esm/wcs-list-item-properties.entry.js +1 -1
- package/dist/esm/wcs-list-item-property.entry.js +1 -1
- package/dist/esm/wcs-list-item.entry.js +1 -1
- package/dist/esm/wcs-mat-icon.entry.js +2 -2
- package/dist/esm/wcs-modal.entry.js +2 -2
- package/dist/esm/wcs-native-select.entry.js +1 -1
- package/dist/esm/wcs-nav-item.entry.js +2 -2
- package/dist/esm/wcs-nav.entry.js +2 -2
- package/dist/esm/wcs-progress-bar.entry.js +3 -3
- package/dist/esm/wcs-progress-radial.entry.js +3 -3
- package/dist/esm/wcs-radio-group.entry.js +2 -2
- package/dist/esm/wcs-radio.entry.js +25 -21
- package/dist/esm/wcs-radio.entry.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +21 -11
- package/dist/esm/wcs-select_2.entry.js.map +1 -1
- package/dist/esm/wcs-skeleton-circle.entry.js +1 -1
- package/dist/esm/wcs-skeleton-rectangle.entry.js +1 -1
- package/dist/esm/wcs-skeleton-text.entry.js +1 -1
- package/dist/esm/wcs-switch.entry.js +2 -2
- package/dist/esm/wcs-tab.entry.js +1 -1
- package/dist/esm/wcs-tabs.entry.js +2 -2
- package/dist/esm/wcs-textarea.entry.js +2 -2
- package/dist/esm/wcs-tooltip.entry.js +2 -2
- package/dist/esm/wcs.js +1 -1
- package/dist/types/components/card/card.d.ts +10 -3
- package/dist/types/components/card-content/card-content.d.ts +7 -2
- package/dist/types/components/editable-field/editable-field.d.ts +3 -0
- package/dist/types/components/grid-pagination/grid-pagination.d.ts +3 -0
- package/dist/types/components/label/label.e2e.playwright.d.ts +1 -0
- package/dist/types/components/radio/radio.d.ts +4 -5
- package/dist/types/components/select/select-interface.d.ts +4 -0
- package/dist/types/components.d.ts +52 -16
- package/dist/wcs/{p-1ba616c2.entry.js → p-03838b42.entry.js} +2 -2
- package/dist/wcs/{p-b0a6eec6.entry.js → p-0cbf08fb.entry.js} +2 -2
- package/dist/wcs/{p-cad10435.entry.js → p-0d233c6a.entry.js} +2 -2
- package/dist/wcs/{p-db7ba599.entry.js → p-14dfa087.entry.js} +3 -3
- package/dist/wcs/p-1c356201.entry.js +2 -0
- package/dist/wcs/p-1c356201.entry.js.map +1 -0
- package/dist/wcs/{p-b28b2fba.entry.js → p-218b5f3d.entry.js} +2 -2
- package/dist/wcs/{p-aadf37e7.entry.js → p-25d7b2f8.entry.js} +2 -2
- package/dist/wcs/{p-850fa9c9.entry.js → p-3e57c746.entry.js} +2 -2
- package/dist/wcs/{p-52d77e1f.js → p-5314a64d.js} +2 -2
- package/dist/wcs/{p-27b438c0.entry.js → p-53bc2cae.entry.js} +2 -2
- package/dist/wcs/p-5443c9af.entry.js +2 -0
- package/dist/wcs/p-5443c9af.entry.js.map +1 -0
- package/dist/wcs/{p-ad286030.entry.js → p-56d9554a.entry.js} +2 -2
- package/dist/wcs/p-59f96b21.entry.js +2 -0
- package/dist/wcs/{p-ff826ebe.js → p-5cea30cb.js} +1 -1
- package/dist/wcs/{p-ff826ebe.js.map → p-5cea30cb.js.map} +1 -1
- package/dist/wcs/{p-2329af04.entry.js → p-63a8e5cc.entry.js} +2 -2
- package/dist/wcs/{p-fbd68522.entry.js → p-6d8f0040.entry.js} +2 -2
- package/dist/wcs/p-6e7db56e.entry.js +2 -0
- package/dist/wcs/p-6e7db56e.entry.js.map +1 -0
- package/dist/wcs/{p-c84ae00d.entry.js → p-6f937b20.entry.js} +2 -2
- package/dist/wcs/p-7af9a2f3.js +2 -0
- package/dist/wcs/p-7b60d4c7.js +2 -0
- package/dist/wcs/p-7b60d4c7.js.map +1 -0
- package/dist/wcs/{p-2221bf0c.entry.js → p-82838611.entry.js} +3 -3
- package/dist/wcs/p-82838611.entry.js.map +1 -0
- package/dist/wcs/{p-bc009574.entry.js → p-8f95bbf3.entry.js} +2 -2
- package/dist/wcs/{p-9fd3366c.entry.js → p-912c2c9b.entry.js} +2 -2
- package/dist/wcs/p-9197e9b5.entry.js +2 -0
- package/dist/wcs/p-9197e9b5.entry.js.map +1 -0
- package/dist/wcs/{p-1e7ea63c.entry.js → p-9388283a.entry.js} +2 -2
- package/dist/wcs/{p-18fa39f4.entry.js → p-9c6db857.entry.js} +2 -2
- package/dist/wcs/{p-637ec45a.entry.js → p-9d4c8f84.entry.js} +2 -2
- package/dist/wcs/p-9d4c8f84.entry.js.map +1 -0
- package/dist/wcs/{p-dfb52a1c.entry.js → p-9e091c53.entry.js} +2 -2
- package/dist/wcs/{p-450942b1.entry.js → p-a60ba874.entry.js} +3 -3
- package/dist/wcs/{p-c6f8c45c.entry.js → p-a6d64e5b.entry.js} +2 -2
- package/dist/wcs/{p-9c73744c.entry.js → p-ae299c3f.entry.js} +2 -2
- package/dist/wcs/{p-a0f6ef30.entry.js → p-b04471f5.entry.js} +2 -2
- package/dist/wcs/p-b04471f5.entry.js.map +1 -0
- package/dist/wcs/{p-4ae08567.entry.js → p-b3b31d43.entry.js} +2 -2
- package/dist/wcs/{p-abd8d5a0.entry.js → p-b42f441f.entry.js} +2 -2
- package/dist/wcs/{p-5202b323.entry.js → p-b9368690.entry.js} +2 -2
- package/dist/wcs/{p-e56b9ce2.entry.js → p-beeec782.entry.js} +2 -2
- package/dist/wcs/{p-c261eaf9.entry.js → p-c169d496.entry.js} +2 -2
- package/dist/wcs/p-c3b733ff.entry.js +2 -0
- package/dist/wcs/{p-9b76b8e6.entry.js → p-c42a6c1c.entry.js} +2 -2
- package/dist/wcs/p-c42a6c1c.entry.js.map +1 -0
- package/dist/wcs/p-c6808cab.entry.js +2 -0
- package/dist/wcs/{p-ed3b0709.entry.js → p-cb9147b8.entry.js} +2 -2
- package/dist/wcs/{p-f2f7595e.entry.js → p-cceee683.entry.js} +2 -2
- package/dist/wcs/{p-f2f7595e.entry.js.map → p-cceee683.entry.js.map} +1 -1
- package/dist/wcs/p-d3afc02f.entry.js +2 -0
- package/dist/wcs/{p-5e8fff73.entry.js → p-d89ad962.entry.js} +2 -2
- package/dist/wcs/{p-4e2d6227.entry.js → p-d8c4dbc3.entry.js} +2 -2
- package/dist/wcs/p-dbf82cb9.js +2 -0
- package/dist/wcs/{p-dff8641e.entry.js → p-e35b138e.entry.js} +2 -2
- package/dist/wcs/{p-fdeae83e.entry.js → p-f2c49d83.entry.js} +2 -2
- package/dist/wcs/{p-cbda74f6.entry.js → p-f411974e.entry.js} +2 -2
- package/dist/wcs/{p-0326f834.entry.js → p-f974210c.entry.js} +2 -2
- package/dist/wcs/{p-352e1f99.entry.js → p-ff48a8b2.entry.js} +2 -2
- package/dist/wcs/wcs.esm.js +1 -1
- package/dist/wcs/wcs.esm.js.map +1 -1
- package/package.json +2 -2
- package/bundle/p-30d83d3d.js.map +0 -1
- package/bundle/p-763371a0.js.map +0 -1
- package/bundle/p-97e70e10.js +0 -2
- package/bundle/p-fc9ba34d.js +0 -2
- package/bundle/p-fc9ba34d.js.map +0 -1
- package/composite-elements/p-0c306f8c.js +0 -2
- package/composite-elements/p-0c306f8c.js.map +0 -1
- package/composite-elements/p-af24fb0d.js.map +0 -1
- package/composite-elements/p-bc4c736d.js +0 -2
- package/composite-elements/p-bc4c736d.js.map +0 -1
- package/dist/cjs/grid-pagination-4505d7b6.js.map +0 -1
- package/dist/esm/grid-pagination-731726a6.js.map +0 -1
- package/dist/wcs/p-0017d766.js +0 -2
- package/dist/wcs/p-0b8157e7.entry.js +0 -2
- package/dist/wcs/p-2221bf0c.entry.js.map +0 -1
- package/dist/wcs/p-3823f54e.entry.js +0 -2
- package/dist/wcs/p-580b3142.entry.js +0 -2
- package/dist/wcs/p-5da0534f.entry.js +0 -2
- package/dist/wcs/p-5da0534f.entry.js.map +0 -1
- package/dist/wcs/p-637ec45a.entry.js.map +0 -1
- package/dist/wcs/p-86ec9ead.entry.js +0 -2
- package/dist/wcs/p-86ec9ead.entry.js.map +0 -1
- package/dist/wcs/p-89b8c724.js +0 -2
- package/dist/wcs/p-98a8b806.entry.js +0 -2
- package/dist/wcs/p-98a8b806.entry.js.map +0 -1
- package/dist/wcs/p-9b76b8e6.entry.js.map +0 -1
- package/dist/wcs/p-a0f6ef30.entry.js.map +0 -1
- package/dist/wcs/p-ad5192cd.entry.js +0 -2
- package/dist/wcs/p-c5bad0b8.js +0 -2
- package/dist/wcs/p-c5bad0b8.js.map +0 -1
- package/dist/wcs/p-fe303f58.entry.js +0 -2
- package/dist/wcs/p-fe303f58.entry.js.map +0 -1
- /package/bundle/{p-97e70e10.js.map → p-475be4d2.js.map} +0 -0
- /package/bundle/{p-010cf905.js.map → p-5ef2bc63.js.map} +0 -0
- /package/bundle/{p-44a3b0b9.js.map → p-7a06295b.js.map} +0 -0
- /package/bundle/{p-2751ddc1.js.map → p-8b186fcf.js.map} +0 -0
- /package/bundle/{p-d23d7658.js.map → p-a0268a31.js.map} +0 -0
- /package/bundle/{p-c8b73e93.js.map → p-bce8c93f.js.map} +0 -0
- /package/bundle/{p-2e9b9605.js.map → p-bf326ae8.js.map} +0 -0
- /package/bundle/{p-98bd8a96.js.map → p-d018450c.js.map} +0 -0
- /package/bundle/{p-f0dda0b8.js.map → p-d3fe6951.js.map} +0 -0
- /package/bundle/{p-9c2aa87a.js.map → p-ee6ff5f8.js.map} +0 -0
- /package/bundle/{p-cdc6f6c2.js.map → p-ff261e50.js.map} +0 -0
- /package/composite-elements/{p-b83afff9.js.map → p-87e97a2e.js.map} +0 -0
- /package/composite-elements/{p-b92e818b.js.map → p-a70a3379.js.map} +0 -0
- /package/composite-elements/{p-55668982.js.map → p-c028b8e6.js.map} +0 -0
- /package/composite-elements/{p-2a51c239.js.map → p-c6adb221.js.map} +0 -0
- /package/composite-elements/{p-04663560.js.map → p-e4e3ed2c.js.map} +0 -0
- /package/composite-elements/{p-51517fda.js.map → p-ec3ce4d4.js.map} +0 -0
- /package/dist/wcs/{p-1ba616c2.entry.js.map → p-03838b42.entry.js.map} +0 -0
- /package/dist/wcs/{p-b0a6eec6.entry.js.map → p-0cbf08fb.entry.js.map} +0 -0
- /package/dist/wcs/{p-cad10435.entry.js.map → p-0d233c6a.entry.js.map} +0 -0
- /package/dist/wcs/{p-db7ba599.entry.js.map → p-14dfa087.entry.js.map} +0 -0
- /package/dist/wcs/{p-b28b2fba.entry.js.map → p-218b5f3d.entry.js.map} +0 -0
- /package/dist/wcs/{p-aadf37e7.entry.js.map → p-25d7b2f8.entry.js.map} +0 -0
- /package/dist/wcs/{p-850fa9c9.entry.js.map → p-3e57c746.entry.js.map} +0 -0
- /package/dist/wcs/{p-52d77e1f.js.map → p-5314a64d.js.map} +0 -0
- /package/dist/wcs/{p-27b438c0.entry.js.map → p-53bc2cae.entry.js.map} +0 -0
- /package/dist/wcs/{p-ad286030.entry.js.map → p-56d9554a.entry.js.map} +0 -0
- /package/dist/wcs/{p-3823f54e.entry.js.map → p-59f96b21.entry.js.map} +0 -0
- /package/dist/wcs/{p-2329af04.entry.js.map → p-63a8e5cc.entry.js.map} +0 -0
- /package/dist/wcs/{p-fbd68522.entry.js.map → p-6d8f0040.entry.js.map} +0 -0
- /package/dist/wcs/{p-c84ae00d.entry.js.map → p-6f937b20.entry.js.map} +0 -0
- /package/dist/wcs/{p-89b8c724.js.map → p-7af9a2f3.js.map} +0 -0
- /package/dist/wcs/{p-bc009574.entry.js.map → p-8f95bbf3.entry.js.map} +0 -0
- /package/dist/wcs/{p-9fd3366c.entry.js.map → p-912c2c9b.entry.js.map} +0 -0
- /package/dist/wcs/{p-1e7ea63c.entry.js.map → p-9388283a.entry.js.map} +0 -0
- /package/dist/wcs/{p-18fa39f4.entry.js.map → p-9c6db857.entry.js.map} +0 -0
- /package/dist/wcs/{p-dfb52a1c.entry.js.map → p-9e091c53.entry.js.map} +0 -0
- /package/dist/wcs/{p-450942b1.entry.js.map → p-a60ba874.entry.js.map} +0 -0
- /package/dist/wcs/{p-c6f8c45c.entry.js.map → p-a6d64e5b.entry.js.map} +0 -0
- /package/dist/wcs/{p-9c73744c.entry.js.map → p-ae299c3f.entry.js.map} +0 -0
- /package/dist/wcs/{p-4ae08567.entry.js.map → p-b3b31d43.entry.js.map} +0 -0
- /package/dist/wcs/{p-abd8d5a0.entry.js.map → p-b42f441f.entry.js.map} +0 -0
- /package/dist/wcs/{p-5202b323.entry.js.map → p-b9368690.entry.js.map} +0 -0
- /package/dist/wcs/{p-e56b9ce2.entry.js.map → p-beeec782.entry.js.map} +0 -0
- /package/dist/wcs/{p-c261eaf9.entry.js.map → p-c169d496.entry.js.map} +0 -0
- /package/dist/wcs/{p-0b8157e7.entry.js.map → p-c3b733ff.entry.js.map} +0 -0
- /package/dist/wcs/{p-580b3142.entry.js.map → p-c6808cab.entry.js.map} +0 -0
- /package/dist/wcs/{p-ed3b0709.entry.js.map → p-cb9147b8.entry.js.map} +0 -0
- /package/dist/wcs/{p-ad5192cd.entry.js.map → p-d3afc02f.entry.js.map} +0 -0
- /package/dist/wcs/{p-5e8fff73.entry.js.map → p-d89ad962.entry.js.map} +0 -0
- /package/dist/wcs/{p-4e2d6227.entry.js.map → p-d8c4dbc3.entry.js.map} +0 -0
- /package/dist/wcs/{p-0017d766.js.map → p-dbf82cb9.js.map} +0 -0
- /package/dist/wcs/{p-dff8641e.entry.js.map → p-e35b138e.entry.js.map} +0 -0
- /package/dist/wcs/{p-fdeae83e.entry.js.map → p-f2c49d83.entry.js.map} +0 -0
- /package/dist/wcs/{p-cbda74f6.entry.js.map → p-f411974e.entry.js.map} +0 -0
- /package/dist/wcs/{p-0326f834.entry.js.map → p-f974210c.entry.js.map} +0 -0
- /package/dist/wcs/{p-352e1f99.entry.js.map → p-ff48a8b2.entry.js.map} +0 -0
|
@@ -149,5 +149,60 @@ test.describe('Grid component', () => {
|
|
|
149
149
|
}).toPass();
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
|
+
test.describe('Behavior in window with scroll', () => {
|
|
153
|
+
test('should preserve the window scroll position when clicking on a single-selection radio inside a scrollable container', async ({ page }) => {
|
|
154
|
+
// Given
|
|
155
|
+
const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }];
|
|
156
|
+
await setWcsContent(page, `
|
|
157
|
+
<div id="scroll-container" style="height: 100vh; overflow-y: auto;">
|
|
158
|
+
<div style="margin-top: 150vh; display: flex; flex-direction: column; gap: 16px;">
|
|
159
|
+
<wcs-grid id="simpleGrid" selection-config="single" sort="">
|
|
160
|
+
<wcs-grid-column path="first_name" name="First Name"></wcs-grid-column>
|
|
161
|
+
</wcs-grid>
|
|
162
|
+
</div>
|
|
163
|
+
<div style="margin-top: 200vh;">Other content</div>
|
|
164
|
+
</div>
|
|
165
|
+
`);
|
|
166
|
+
const simpleGrid = page.locator('#simpleGrid');
|
|
167
|
+
await simpleGrid.evaluate((el, d) => el.data = d, data);
|
|
168
|
+
const body = page.locator('body');
|
|
169
|
+
const gridRadioFirstRow = simpleGrid.locator('table tbody tr:first-child td .grid-radio');
|
|
170
|
+
await gridRadioFirstRow.scrollIntoViewIfNeeded();
|
|
171
|
+
// When
|
|
172
|
+
await gridRadioFirstRow.click();
|
|
173
|
+
await page.waitForChanges();
|
|
174
|
+
// Then
|
|
175
|
+
const scrollY = await body.evaluate(() => window.scrollY);
|
|
176
|
+
expect(scrollY).toBe(0);
|
|
177
|
+
});
|
|
178
|
+
test('should preserve the window scroll position when tabbing to a single-selection grid inside a scrollable container', async ({ page }) => {
|
|
179
|
+
// Given
|
|
180
|
+
const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }];
|
|
181
|
+
await setWcsContent(page, `
|
|
182
|
+
<div id="scroll-container" style="height: 100vh; overflow-y: auto;">
|
|
183
|
+
<div style="margin-top: 150vh; display: flex; flex-direction: column; gap: 16px;">
|
|
184
|
+
<button id="before-grid">Before grid</button>
|
|
185
|
+
<wcs-grid id="simpleGrid" selection-config="single" sort="">
|
|
186
|
+
<wcs-grid-column path="first_name" name="First Name"></wcs-grid-column>
|
|
187
|
+
</wcs-grid>
|
|
188
|
+
</div>
|
|
189
|
+
<div style="margin-top: 200vh;">Other content</div>
|
|
190
|
+
</div>
|
|
191
|
+
`);
|
|
192
|
+
const simpleGrid = page.locator('#simpleGrid');
|
|
193
|
+
await simpleGrid.evaluate((el, d) => el.data = d, data);
|
|
194
|
+
const body = page.locator('body');
|
|
195
|
+
const beforeGridButton = page.locator('#before-grid');
|
|
196
|
+
const firstGridRadio = simpleGrid.locator('table tbody tr:first-child td .grid-radio input');
|
|
197
|
+
await beforeGridButton.scrollIntoViewIfNeeded();
|
|
198
|
+
await beforeGridButton.focus();
|
|
199
|
+
// When
|
|
200
|
+
await page.keyboard.press('Tab');
|
|
201
|
+
// Then
|
|
202
|
+
await expect(firstGridRadio).toBeFocused();
|
|
203
|
+
const scrollY = await body.evaluate(() => window.scrollY);
|
|
204
|
+
expect(scrollY).toBe(0);
|
|
205
|
+
});
|
|
206
|
+
});
|
|
152
207
|
});
|
|
153
208
|
//# sourceMappingURL=grid.e2e.playwright.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.e2e.playwright.js","sourceRoot":"","sources":["../../../src/components/grid/grid.e2e.playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAW,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM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C,+BAA+B;YAE/B,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;YACzF,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC;YAE3F,MAAM,MAAM,CAAC,KAAK,IAAI,EAAE;gBACpB,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAClD,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { setWcsContent } from '../../utils/playwright/test';\nimport { test, E2EPage } from \"@stencil/playwright\";\n\nimport { expect } from \"@playwright/test\";\n\ntest.describe('Grid component', () => {\n test.describe('Events', () => {\n test.describe('simple', () => {\n test('should emit a wcsGridSelectionChange event when a row is selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"single\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const gridRadioFirstRow = simpleGrid.locator('table tbody tr:first-child td .grid-radio');\n await gridRadioFirstRow.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[0].selected).toBe(true);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n });\n\n test.describe('multiple', () => {\n test('should emit a wcsGridSelectionChange event when a row is selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[0].selected).toBe(true);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n\n test('should emit a wcsGridSelectionChange event when a row is unselected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click(); // Row is selected\n await page.waitForChanges();\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n await wcsCheckboxFirstRow.click(); // Row is unselected\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows).toEqual([]);\n expect(detail.changedRow.selected).toBe(false);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n\n test('should emit a wcsGridSelectionChange event when a new row is selected while another are already selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click();\n await page.waitForChanges();\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxLastChild = simpleGrid.locator('table tbody tr:last-child td wcs-checkbox');\n await wcsCheckboxLastChild.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows.length).toBe(2);\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[1].data).toEqual(data[data.length - 1]);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[data.length - 1]);\n });\n\n test('should emit a wcsGridSelectionChange event when all rows are selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxAll = simpleGrid.locator('table thead th:first-child wcs-checkbox');\n await wcsCheckboxAll.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows.length).toBe(data.length);\n expect(detail.changedRow).toBe('allCheckbox');\n });\n });\n });\n\n test.describe('Sort', () => {\n test('should well sort with pagination', async ({ page }: { page: E2EPage }) => {\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Zoe' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\" sort sort-order=\"desc\"></wcs-grid-column>\n <wcs-grid-pagination available-page-sizes=\"2\"></wcs-grid-pagination>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n // First page should contain 2 elements (page-size = 2) sorted descending by first_name\n // Data order before sort: John, Doe, Jane, Zoe\n // After descending sort: Zoe, John, Jane, Doe\n // Page 1 should show Zoe, John\n\n const firstRowFirstCell = simpleGrid.locator('table tbody tr:first-child td:last-child');\n const secondRowFirstCell = simpleGrid.locator('table tbody tr:nth-child(2) td:last-child');\n\n await expect(async () => {\n await expect(firstRowFirstCell).toHaveText('Zoe');\n await expect(secondRowFirstCell).toHaveText('John');\n }).toPass();\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"grid.e2e.playwright.js","sourceRoot":"","sources":["../../../src/components/grid/grid.e2e.playwright.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C;YAE/B,OAAO;YACP,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAEjC,OAAO;YACP,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE,CAAC;YAC3C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { setWcsContent } from '../../utils/playwright/test';\nimport { test, E2EPage } from \"@stencil/playwright\";\n\nimport { expect } from \"@playwright/test\";\n\ntest.describe('Grid component', () => {\n test.describe('Events', () => {\n test.describe('simple', () => {\n test('should emit a wcsGridSelectionChange event when a row is selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"single\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const gridRadioFirstRow = simpleGrid.locator('table tbody tr:first-child td .grid-radio');\n await gridRadioFirstRow.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[0].selected).toBe(true);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n });\n\n test.describe('multiple', () => {\n test('should emit a wcsGridSelectionChange event when a row is selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[0].selected).toBe(true);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n\n test('should emit a wcsGridSelectionChange event when a row is unselected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click(); // Row is selected\n await page.waitForChanges();\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n await wcsCheckboxFirstRow.click(); // Row is unselected\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows).toEqual([]);\n expect(detail.changedRow.selected).toBe(false);\n expect(detail.changedRow.data).toEqual(data[0]);\n });\n\n test('should emit a wcsGridSelectionChange event when a new row is selected while another are already selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const wcsCheckboxFirstRow = simpleGrid.locator('table tbody tr:first-child td wcs-checkbox');\n await wcsCheckboxFirstRow.click();\n await page.waitForChanges();\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxLastChild = simpleGrid.locator('table tbody tr:last-child td wcs-checkbox');\n await wcsCheckboxLastChild.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows.length).toBe(2);\n expect(detail.selectedRows[0].data).toEqual(data[0]);\n expect(detail.selectedRows[1].data).toEqual(data[data.length - 1]);\n expect(detail.changedRow.selected).toBe(true);\n expect(detail.changedRow.data).toEqual(data[data.length - 1]);\n });\n\n test('should emit a wcsGridSelectionChange event when all rows are selected', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Smith' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const selectionSpy = await page.spyOnEvent('wcsGridSelectionChange');\n\n // When\n const wcsCheckboxAll = simpleGrid.locator('table thead th:first-child wcs-checkbox');\n await wcsCheckboxAll.click();\n await page.waitForChanges();\n\n // Then\n expect(selectionSpy).toHaveReceivedEventTimes(1);\n const detail = selectionSpy.events[0].detail;\n expect(detail.selectedRows.length).toBe(data.length);\n expect(detail.changedRow).toBe('allCheckbox');\n });\n });\n });\n\n test.describe('Sort', () => {\n test('should well sort with pagination', async ({ page }: { page: E2EPage }) => {\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }, { id: 3, first_name: 'Jane' }, { id: 4, first_name: 'Zoe' }];\n await setWcsContent(page, `\n <wcs-grid id=\"simpleGrid\" selection-config=\"multiple\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\" sort sort-order=\"desc\"></wcs-grid-column>\n <wcs-grid-pagination available-page-sizes=\"2\"></wcs-grid-pagination>\n </wcs-grid>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n // First page should contain 2 elements (page-size = 2) sorted descending by first_name\n // Data order before sort: John, Doe, Jane, Zoe\n // After descending sort: Zoe, John, Jane, Doe\n // Page 1 should show Zoe, John\n\n const firstRowFirstCell = simpleGrid.locator('table tbody tr:first-child td:last-child');\n const secondRowFirstCell = simpleGrid.locator('table tbody tr:nth-child(2) td:last-child');\n\n await expect(async () => {\n await expect(firstRowFirstCell).toHaveText('Zoe');\n await expect(secondRowFirstCell).toHaveText('John');\n }).toPass();\n });\n });\n\n test.describe('Behavior in window with scroll', () => {\n test('should preserve the window scroll position when clicking on a single-selection radio inside a scrollable container', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }];\n await setWcsContent(page, `\n <div id=\"scroll-container\" style=\"height: 100vh; overflow-y: auto;\">\n <div style=\"margin-top: 150vh; display: flex; flex-direction: column; gap: 16px;\">\n <wcs-grid id=\"simpleGrid\" selection-config=\"single\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n </div>\n <div style=\"margin-top: 200vh;\">Other content</div>\n </div>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const body = page.locator('body');\n const gridRadioFirstRow = simpleGrid.locator('table tbody tr:first-child td .grid-radio');\n\n await gridRadioFirstRow.scrollIntoViewIfNeeded();\n\n // When\n await gridRadioFirstRow.click();\n await page.waitForChanges();\n\n // Then\n const scrollY = await body.evaluate(() => window.scrollY);\n expect(scrollY).toBe(0);\n });\n\n test('should preserve the window scroll position when tabbing to a single-selection grid inside a scrollable container', async ({ page }: { page: E2EPage }) => {\n // Given\n const data = [{ id: 1, first_name: 'John' }, { id: 2, first_name: 'Doe' }];\n await setWcsContent(page, `\n <div id=\"scroll-container\" style=\"height: 100vh; overflow-y: auto;\">\n <div style=\"margin-top: 150vh; display: flex; flex-direction: column; gap: 16px;\">\n <button id=\"before-grid\">Before grid</button>\n <wcs-grid id=\"simpleGrid\" selection-config=\"single\" sort=\"\">\n <wcs-grid-column path=\"first_name\" name=\"First Name\"></wcs-grid-column>\n </wcs-grid>\n </div>\n <div style=\"margin-top: 200vh;\">Other content</div>\n </div>\n `);\n\n const simpleGrid = page.locator('#simpleGrid');\n await simpleGrid.evaluate((el: any, d) => el.data = d, data);\n\n const body = page.locator('body');\n const beforeGridButton = page.locator('#before-grid');\n const firstGridRadio = simpleGrid.locator('table tbody tr:first-child td .grid-radio input');\n\n await beforeGridButton.scrollIntoViewIfNeeded();\n await beforeGridButton.focus();\n\n // When\n await page.keyboard.press('Tab');\n\n // Then\n await expect(firstGridRadio).toBeFocused();\n const scrollY = await body.evaluate(() => window.scrollY);\n expect(scrollY).toBe(0);\n });\n });\n});\n"]}
|
|
@@ -506,12 +506,12 @@ export class Grid {
|
|
|
506
506
|
}
|
|
507
507
|
render() {
|
|
508
508
|
var _a, _b, _c, _d;
|
|
509
|
-
return (h(Host, { key: '
|
|
509
|
+
return (h(Host, { key: 'b19822a50c13e2c45df1457d9e7a5100b2ba62ef' }, h("table", Object.assign({ key: '26b9e13d87544a151d6b31e6019f44f980541153', role: "grid", ref: (el) => (this.nativeTable = el), "aria-rowcount": !this.loading && ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.length), "aria-colcount": !this.loading && this.totalDisplayedColumnCount() }, this.inheritedAttributes), h("thead", { key: '1e5a328e858cbf3a6ad29e2db070c4c44c67bfe5' }, h("tr", { key: '121c5b20769d31b4366b3c563fd3fce695f6ef83', "aria-rowindex": "1" }, this.selectionConfig === 'none' ? ''
|
|
510
510
|
: h("th", { class: "wcs-grid-selection-column" }, this.selectionConfig === 'single' ? '' :
|
|
511
511
|
h("wcs-checkbox", { tabIndex: ((_b = this.cursorPosition) === null || _b === void 0 ? void 0 : _b.col) === 0
|
|
512
|
-
&& ((_c = this.cursorPosition) === null || _c === void 0 ? void 0 : _c.row) === 0 ? 0 : -1, part: "all-rows-checkbox", checked: this.allRowsAreSelected(), onWcsChange: this.selectAllRows.bind(this) })), h("slot", { key: '
|
|
512
|
+
&& ((_c = this.cursorPosition) === null || _c === void 0 ? void 0 : _c.row) === 0 ? 0 : -1, part: "all-rows-checkbox", checked: this.allRowsAreSelected(), onWcsChange: this.selectAllRows.bind(this) })), h("slot", { key: '20977331e2ea13fae89d239155d9800764dd2695', name: "grid-column" }))), h("tbody", { key: '6587df7ab7251139904249def1a347f3e6718f70' }, this.loading
|
|
513
513
|
? h("tr", { "aria-busy": "true" }, h("td", { colSpan: this.totalColumnCount(), class: "loading" }, h("wcs-spinner", null)))
|
|
514
|
-
: (_d = this.rows) === null || _d === void 0 ? void 0 : _d.filter(row => this.serverMode || !this.paginationEl || row.page === this.paginationEl.currentPage).map((row, index) => this.renderRow(row, index)))), h("slot", { key: '
|
|
514
|
+
: (_d = this.rows) === null || _d === void 0 ? void 0 : _d.filter(row => this.serverMode || !this.paginationEl || row.page === this.paginationEl.currentPage).map((row, index) => this.renderRow(row, index)))), h("slot", { key: '134dcd235b562cd2734889cfd6eb43e4eda012ad', name: "grid-pagination" })));
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
* Returns the row with all mapped cells inside.
|
|
@@ -69,7 +69,7 @@ export class GridColumn {
|
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
71
|
const ButtonOrDiv = this.getTagName();
|
|
72
|
-
return (h(Host, { key: '
|
|
72
|
+
return (h(Host, { key: 'dae8ba0823c68e3029faa505a061b80ae911f84a', slot: "grid-column" }, h("th", Object.assign({ key: '02d892d695ee9faa1f91be08c67c200aa770d489', style: { width: this.width }, class: this.sort ? 'pointer' : '', tabIndex: this.sort ? -1 : this.getTabIndex(), scope: "col", onClick: this.onSortClick.bind(this), onKeyDown: this.handleSortKeyDown.bind(this), onFocus: this.delegateFocusToButton.bind(this), "aria-sort": this.sort ? this.getSortOrderForAriaSort(this.sortOrder) : null, ref: (el) => (this.nativeTh = el) }, this.inheritedAttributes), h(ButtonOrDiv, { key: '2da3c848ac260aa272e78e52f282ff0078ecc1e1', class: "grid-column-th-content", ref: (el) => this.buttonOrDiv = el, tabIndex: this.sort ? this.getTabIndex() : -1 }, h("span", { key: '063de5c95a3fb63444cf5e10e291252bc3474fad' }, this.name), this.sort ? h("div", { class: "sort-arrow-container" }, h(GridSortArrow, { state: this.sortOrder })) : ''))));
|
|
73
73
|
}
|
|
74
74
|
onSortClick() {
|
|
75
75
|
if (!this.sort)
|
|
@@ -8,7 +8,7 @@ export class GridCustomCell {
|
|
|
8
8
|
this.rowId = undefined;
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: 'dd57a3792ccd2dbf7bb23f5055eb3136a06a9acb', slot: this.columnId + '-' + this.rowId }, h("slot", { key: '5fa475118d263c77b9ccbc1bb7e0c808b1578e87' })));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "wcs-grid-custom-cell"; }
|
|
14
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -14,6 +14,9 @@ const GRID_PAGINATION_INHERITED_ATTRS = ['tabindex', 'title'];
|
|
|
14
14
|
* @cssprop --wcs-grid-pagination-margin-top - Margin between the grid and the pagination
|
|
15
15
|
* @cssprop --wcs-grid-pagination-arrow-color-inactive - Color of the inactive arrow
|
|
16
16
|
* @cssprop --wcs-grid-pagination-arrow-color-active - Color of the active arrow
|
|
17
|
+
*
|
|
18
|
+
* @slot elements-per-page-text - Text following the page size select. Default text is " éléments par page". You may want to add a non-breaking space before the text to separate it from the number.
|
|
19
|
+
* @slot items-count-text - Text following the number of elements. Default text is " éléments". You may want to add a non-breaking space before the text to separate it from the number.
|
|
17
20
|
*/
|
|
18
21
|
export class GridPagination {
|
|
19
22
|
constructor() {
|
|
@@ -94,7 +97,7 @@ export class GridPagination {
|
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
99
|
render() {
|
|
97
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '3efc96789e89f352f23038016baf6cbc232d6e0c', slot: "grid-pagination" }, h("div", { key: 'df2365f3367fe20bfb66f8b4969036a1662daef3', class: "container" }, h("div", { key: 'b700909bbdcef7087af7a7f5d624db07bf909315', class: "page-size" }, h("wcs-select", { key: 'bd9454c106da98c1dfbd7c5081f1bc2c564db2ae', placeholder: "El\u00E9ments par page", class: "available-page-sizes", "aria-labelledby": "elements-per-page-number elements-per-page-text", value: this.pageSize, onWcsChange: this.onChangePageSize.bind(this) }, this.availablePageSizes.map((pageSize) => h("wcs-select-option", { value: pageSize }, pageSize))), h("span", { key: '792711f34454bb10a42c44b7e13d03f8fbf4af74', id: "elements-per-page-number", hidden: true }, this.pageSize), h("span", { key: '00848f6a348aed84d37ebb19172e3d7818ba3c17', id: "elements-per-page-text" }, h("slot", { key: '21848ccaf60179a82c53916f8e438e8b63ebaf61', name: "elements-per-page-text" }, h("span", { key: '6bf5a0c3e6dc2bd81193e362abab61b7e165de54' }, " \u00E9l\u00E9ments par page")))), h("div", { key: 'ef6378352c7251430bb90540b28d52407b792b4d', class: "items-count" }, h("span", { key: 'a0f8ebf6564358233cf2683107d7a3af50bbd3e7' }, this.itemsCount, h("slot", { key: 'b0549af31d518ea3d748ba615c226d242aa1ea3e', name: "items-count-text" }, h("span", { key: 'b0266239fa9726005d9946ccedf59bfe26e030a3' }, " \u00E9l\u00E9ments")))), h("nav", Object.assign({ key: '43a87e737be4890ac0f4fcb8f76e56fc5a40a27d', "aria-label": "pagination", ref: (el) => (this.nativeNav = el) }, this.inheritedAttributes), h("ul", { key: '6e95be555deb6741ac851eaa0163483bd9a33e19', class: "page-management" }, h("li", { key: 'faab6e7ab55628be3b5bf4e61c559a67c6ea2a57', class: "pagination-arrow", onClick: this.firstPage.bind(this) }, h(GridPaginationArrow, { key: '699c51108204e3e13c408abb43ed59039b12cddb', active: this.canGoToPreviousPage(), order: "previous", double: true })), h("li", { key: '3e13d327cab3e2b4c54ad915e38c10effa852970', class: "pagination-arrow", onClick: this.previousPage.bind(this) }, h(GridPaginationArrow, { key: '5fbe8676685d367affe840948a4ae037e7e1b0d0', active: this.canGoToPreviousPage(), order: "previous" })), h("li", { key: '086fd79d45cc0d8c60cf53b9ae44015944341b95', class: "pagination-counter" }, h("span", { key: '9bd2e83985ae3b482830628ed9384c1583392f70', "aria-label": `Page ${this.currentPage + 1} sur ${this.pageCount}`, "aria-current": "page" }, this.currentPage + 1, " / ", this.pageCount)), h("li", { key: '6a61141774ba5ddc261e911945cbe71282c34793', class: "pagination-arrow", onClick: this.nextPage.bind(this) }, h(GridPaginationArrow, { key: '4c41d7cdce692495b67227f0bb24fd0b605998e0', active: this.canGoToNextPage(), order: "next" })), h("li", { key: 'c929ccd8c749763034a42a7006264747eed59b02', class: "pagination-arrow", onClick: this.lastPage.bind(this) }, h(GridPaginationArrow, { key: '184d97af95b7fad98617f7fb138463826f94c9a8', active: this.canGoToNextPage(), order: "next", double: true })))))));
|
|
98
101
|
}
|
|
99
102
|
static get is() { return "wcs-grid-pagination"; }
|
|
100
103
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pagination.js","sourceRoot":"","sources":["../../../src/components/grid-pagination/grid-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACW,OAAO,EAC3B,KAAK,EACL,CAAC,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EACP,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAErG,MAAM,+BAA+B,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAE9D;;;;;;;;;;;;GAYG;AAMH,MAAM,OAAO,cAAc;;QAGf,wBAAmB,GAAyB,EAAE,CAAC;kCAMhB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;2BAIN,cAAc,CAAC,gBAAgB;wBAKjD,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;0BAMxB,CAAC;yBAMF,CAAC;;IAM7B,iBAAiB;QACb,IAAI,CAAC,mBAAmB,mCACjB,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,GAC9B,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,+BAA+B,CAAC,CACjE,CAAC;IACN,CAAC;IAGD,KAAK,CAAC,gBAAgB,CAAC,IAAuB,EAAE,KAAgC;QAC5E,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAEO,UAAU;QACd,OAAO,IAAI,CAAC,EA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AAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,SAAuB,CAC9F,CACJ,CACH,CACJ,CACH,CAAC,CAAA;IACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApKe,+BAAgB,GAAW,CAAC,AAAZ,CAAa","sourcesContent":["import {\n Component,\n ComponentInterface, Element,\n Event, EventEmitter,\n h,\n Host, Method,\n Prop\n} from '@stencil/core';\nimport {\n WcsGridPaginationChangeEventDetails\n} from '../grid/grid-interface';\nimport { SelectChangeEventDetail } from '../select/select-interface';\nimport { GridPaginationArrow } from './grid-pagination-arrow';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst GRID_PAGINATION_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.\n * \n * @cssprop --wcs-grid-pagination-color - Text color of the grid pagination\n * @cssprop --wcs-grid-pagination-font-size - Font-size of the grid pagination\n * @cssprop --wcs-grid-pagination-font-weight - Font-weight of the grid pagination\n * @cssprop --wcs-grid-pagination-gap - Gap between the page size, number of elements and page management\n * @cssprop --wcs-grid-pagination-page-size-gap - Gap between the select and the text within the page size container\n * @cssprop --wcs-grid-pagination-counter-gap - Gap within the page management counter\n * @cssprop --wcs-grid-pagination-margin-top - Margin between the grid and the pagination\n * @cssprop --wcs-grid-pagination-arrow-color-inactive - Color of the inactive arrow\n * @cssprop --wcs-grid-pagination-arrow-color-active - Color of the active arrow\n */\n@Component({\n tag: 'wcs-grid-pagination',\n styleUrl: 'grid-pagination.scss',\n shadow: true\n})\nexport class GridPagination implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeNav!: HTMLElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n static readonly INDEX_FIRST_PAGE: number = 0;\n /**\n * Set the available page sizes in the pagination dropdown on the left.\n */\n @Prop() availablePageSizes: number[] = [10, 20, 50];\n /**\n * The current page of the pagination. First page starts at index 0.\n */\n @Prop({mutable: true}) currentPage: number = GridPagination.INDEX_FIRST_PAGE;\n /**\n * Maximum number of elements shown per page. \n * Default is the first value of `availablePageSizes`.\n */\n @Prop() pageSize: number = this.availablePageSizes[0];\n /**\n * Total elements in the grid. \n * - **Grid in `Server mode`** : You have to set `itemsCount` = your total data length. \n * - **Grid not in Server mode** : Do not set it manually : itemsCount is set and updated every pagination refresh.\n */\n @Prop() itemsCount: number = 0;\n /**\n * Max number of pages. \n * - **Grid in `Server mode`** : You have to set `pageCount` = `itemsCount` divided by `pageSize`. \n * - **Grid not in Server mode** : Do not set it manually : pageCount is set and updated every pagination refresh.\n */\n @Prop() pageCount: number = 1;\n /**\n * Event emitted when the pagination changes.\n */\n @Event() wcsGridPaginationChange!: EventEmitter<WcsGridPaginationChangeEventDetails>;\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, GRID_PAGINATION_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeNav, attr, value);\n }\n \n private getWcsGrid(): HTMLWcsGridElement | undefined {\n return this.el.parentElement.tagName === 'WCS-GRID' ? this.el.parentElement as HTMLWcsGridElement : undefined;\n }\n\n private lastPage(): void {\n this.currentPage = this.pageCount - 1;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n private nextPage(): void {\n if (this.canGoToNextPage()) {\n this.currentPage++;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n }\n\n private canGoToNextPage(): boolean {\n return this.currentPage + 1 < this.pageCount;\n }\n\n private previousPage(): void {\n if (this.canGoToPreviousPage()) {\n this.currentPage--;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n }\n\n private canGoToPreviousPage(): boolean {\n return this.currentPage > 0;\n }\n\n private firstPage(): void {\n this.currentPage = 0;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n private onChangePageSize(event: CustomEvent<SelectChangeEventDetail>): void {\n this.pageSize = event.detail.value;\n if (this.currentPage + 1 > this.pageSize) {\n this.currentPage = 0;\n }\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n /**\n * Move focus to the first grid cell after a pagination change\n */\n private focusFirstGridCell() {\n const grid = this.getWcsGrid();\n if (grid) {\n requestAnimationFrame(() => {\n this.el.blur();\n grid.focusFirstCell();\n })\n }\n }\n\n private emitPaginationChange(): void {\n this.wcsGridPaginationChange.emit({\n pagination: {\n currentPage: this.currentPage,\n pageSize: this.pageSize,\n itemsCount: this.itemsCount,\n pageCount: this.pageCount\n }\n });\n }\n\n render(): any {\n return (<Host slot=\"grid-pagination\">\n <div class=\"container\">\n <div class=\"page-size\">\n <wcs-select placeholder=\"Eléments par page\"\n class=\"available-page-sizes\"\n aria-labelledby=\"elements-per-page-number elements-per-page-text\"\n value={this.pageSize}\n onWcsChange={this.onChangePageSize.bind(this)}>\n {\n this.availablePageSizes.map((pageSize) =>\n <wcs-select-option value={pageSize}>{pageSize}</wcs-select-option>\n )\n }\n </wcs-select>\n <span id=\"elements-per-page-number\" hidden>{this.pageSize}</span>\n <span id=\"elements-per-page-text\">éléments par page</span>\n </div>\n\n <div class=\"items-count\">\n <span>{this.itemsCount} éléments</span>\n </div>\n\n <nav aria-label=\"pagination\" ref={(el) => (this.nativeNav = el)} {...this.inheritedAttributes}>\n <ul class=\"page-management\">\n <li class=\"pagination-arrow\" onClick={this.firstPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\" double></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.previousPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\"></GridPaginationArrow>\n </li>\n \n <li class=\"pagination-counter\">\n <span aria-label={`Page ${this.currentPage + 1} sur ${this.pageCount}`} aria-current=\"page\">\n {this.currentPage + 1} / {this.pageCount}\n </span>\n </li>\n \n <li class=\"pagination-arrow\" onClick={this.nextPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\"></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.lastPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\" double></GridPaginationArrow>\n </li>\n </ul>\n </nav>\n </div>\n </Host>)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"grid-pagination.js","sourceRoot":"","sources":["../../../src/components/grid-pagination/grid-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACW,OAAO,EAC3B,KAAK,EACL,CAAC,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EACP,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAErG,MAAM,+BAA+B,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AAMH,MAAM,OAAO,cAAc;;QAGf,wBAAmB,GAAyB,EAAE,CAAC;kCAMhB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;2BAIN,cAAc,CAAC,gBAAgB;wBAKjD,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;0BAMxB,CAAC;yBAMF,CAAC;;IAM7B,iBAAiB;QACb,IAAI,CAAC,mBAAmB,mCACjB,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,GAC9B,iBAAi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C,CACN;wBAEL,2DAAI,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;4BAC1D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAC,MAAM,GAAuB,CACvF;wBACL,2DAAI,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;4BAC1D,EAAC,mBAAmB,qDAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,SAAuB,CAC9F,CACJ,CACH,CACJ,CACH,CAAC,CAAA;IACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5Ke,+BAAgB,GAAW,CAAC,AAAZ,CAAa","sourcesContent":["import {\n Component,\n ComponentInterface, Element,\n Event, EventEmitter,\n h,\n Host, Method,\n Prop\n} from '@stencil/core';\nimport {\n WcsGridPaginationChangeEventDetails\n} from '../grid/grid-interface';\nimport { SelectChangeEventDetail } from '../select/select-interface';\nimport { GridPaginationArrow } from './grid-pagination-arrow';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst GRID_PAGINATION_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.\n * \n * @cssprop --wcs-grid-pagination-color - Text color of the grid pagination\n * @cssprop --wcs-grid-pagination-font-size - Font-size of the grid pagination\n * @cssprop --wcs-grid-pagination-font-weight - Font-weight of the grid pagination\n * @cssprop --wcs-grid-pagination-gap - Gap between the page size, number of elements and page management\n * @cssprop --wcs-grid-pagination-page-size-gap - Gap between the select and the text within the page size container\n * @cssprop --wcs-grid-pagination-counter-gap - Gap within the page management counter\n * @cssprop --wcs-grid-pagination-margin-top - Margin between the grid and the pagination\n * @cssprop --wcs-grid-pagination-arrow-color-inactive - Color of the inactive arrow\n * @cssprop --wcs-grid-pagination-arrow-color-active - Color of the active arrow\n * \n * @slot elements-per-page-text - Text following the page size select. Default text is \" éléments par page\". You may want to add a non-breaking space before the text to separate it from the number.\n * @slot items-count-text - Text following the number of elements. Default text is \" éléments\". You may want to add a non-breaking space before the text to separate it from the number.\n */\n@Component({\n tag: 'wcs-grid-pagination',\n styleUrl: 'grid-pagination.scss',\n shadow: true\n})\nexport class GridPagination implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeNav!: HTMLElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n static readonly INDEX_FIRST_PAGE: number = 0;\n /**\n * Set the available page sizes in the pagination dropdown on the left.\n */\n @Prop() availablePageSizes: number[] = [10, 20, 50];\n /**\n * The current page of the pagination. First page starts at index 0.\n */\n @Prop({mutable: true}) currentPage: number = GridPagination.INDEX_FIRST_PAGE;\n /**\n * Maximum number of elements shown per page. \n * Default is the first value of `availablePageSizes`.\n */\n @Prop() pageSize: number = this.availablePageSizes[0];\n /**\n * Total elements in the grid. \n * - **Grid in `Server mode`** : You have to set `itemsCount` = your total data length. \n * - **Grid not in Server mode** : Do not set it manually : itemsCount is set and updated every pagination refresh.\n */\n @Prop() itemsCount: number = 0;\n /**\n * Max number of pages. \n * - **Grid in `Server mode`** : You have to set `pageCount` = `itemsCount` divided by `pageSize`. \n * - **Grid not in Server mode** : Do not set it manually : pageCount is set and updated every pagination refresh.\n */\n @Prop() pageCount: number = 1;\n /**\n * Event emitted when the pagination changes.\n */\n @Event() wcsGridPaginationChange!: EventEmitter<WcsGridPaginationChangeEventDetails>;\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, GRID_PAGINATION_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeNav, attr, value);\n }\n \n private getWcsGrid(): HTMLWcsGridElement | undefined {\n return this.el.parentElement.tagName === 'WCS-GRID' ? this.el.parentElement as HTMLWcsGridElement : undefined;\n }\n\n private lastPage(): void {\n this.currentPage = this.pageCount - 1;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n private nextPage(): void {\n if (this.canGoToNextPage()) {\n this.currentPage++;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n }\n\n private canGoToNextPage(): boolean {\n return this.currentPage + 1 < this.pageCount;\n }\n\n private previousPage(): void {\n if (this.canGoToPreviousPage()) {\n this.currentPage--;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n }\n\n private canGoToPreviousPage(): boolean {\n return this.currentPage > 0;\n }\n\n private firstPage(): void {\n this.currentPage = 0;\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n private onChangePageSize(event: CustomEvent<SelectChangeEventDetail>): void {\n this.pageSize = event.detail.value;\n if (this.currentPage + 1 > this.pageSize) {\n this.currentPage = 0;\n }\n this.emitPaginationChange();\n this.focusFirstGridCell();\n }\n\n /**\n * Move focus to the first grid cell after a pagination change\n */\n private focusFirstGridCell() {\n const grid = this.getWcsGrid();\n if (grid) {\n requestAnimationFrame(() => {\n this.el.blur();\n grid.focusFirstCell();\n })\n }\n }\n\n private emitPaginationChange(): void {\n this.wcsGridPaginationChange.emit({\n pagination: {\n currentPage: this.currentPage,\n pageSize: this.pageSize,\n itemsCount: this.itemsCount,\n pageCount: this.pageCount\n }\n });\n }\n\n render(): any {\n return (<Host slot=\"grid-pagination\">\n <div class=\"container\">\n <div class=\"page-size\">\n <wcs-select placeholder=\"Eléments par page\"\n class=\"available-page-sizes\"\n aria-labelledby=\"elements-per-page-number elements-per-page-text\"\n value={this.pageSize}\n onWcsChange={this.onChangePageSize.bind(this)}>\n {\n this.availablePageSizes.map((pageSize) =>\n <wcs-select-option value={pageSize}>{pageSize}</wcs-select-option>\n )\n }\n </wcs-select>\n <span id=\"elements-per-page-number\" hidden>{this.pageSize}</span>\n <span id=\"elements-per-page-text\"> \n <slot name=\"elements-per-page-text\">\n <span> éléments par page</span>\n </slot>\n </span>\n </div>\n\n <div class=\"items-count\">\n <span>{this.itemsCount}\n <slot name=\"items-count-text\">\n <span> éléments</span>\n </slot>\n </span>\n </div>\n\n <nav aria-label=\"pagination\" ref={(el) => (this.nativeNav = el)} {...this.inheritedAttributes}>\n <ul class=\"page-management\">\n <li class=\"pagination-arrow\" onClick={this.firstPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\" double></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.previousPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToPreviousPage()} order=\"previous\"></GridPaginationArrow>\n </li>\n \n <li class=\"pagination-counter\">\n <span aria-label={`Page ${this.currentPage + 1} sur ${this.pageCount}`} aria-current=\"page\">\n {this.currentPage + 1} / {this.pageCount}\n </span>\n </li>\n \n <li class=\"pagination-arrow\" onClick={this.nextPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\"></GridPaginationArrow>\n </li>\n <li class=\"pagination-arrow\" onClick={this.lastPage.bind(this)}>\n <GridPaginationArrow active={this.canGoToNextPage()} order=\"next\" double></GridPaginationArrow>\n </li>\n </ul>\n </nav>\n </div>\n </Host>)\n }\n}\n"]}
|
|
@@ -37,7 +37,7 @@ export class Header {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h("header", Object.assign({ key: '
|
|
40
|
+
return (h("header", Object.assign({ key: 'd8d14874c0caf8bd0774bfbc43ec74b602d5e3eb', role: "banner", ref: (el) => (this.nativeHeader = el) }, this.inheritedAttributes), h("slot", { key: '7c7dcc8f6760d45a5c6ad530cee9947025a87771', name: "logo" }), h("slot", { key: '5e5ba145dd565729887993e1e934107311c98738', name: "title" }), h("slot", { key: 'fe799951e59ad6288fa5e44480c5e49f47da6c3d', name: "center" }), h("slot", { key: '3fabde05983e0bbd226d3d4112e567f7565fb1be', name: "actions" })));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "wcs-header"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,7 +17,7 @@ export class Hint {
|
|
|
17
17
|
this.small = false;
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '6fae15a2dd3769e29fd86d510739a2e7b7c47123', slot: "messages" }, h("slot", { key: 'aa531d55bfb557aaba527f63af0f275b7e869d63' })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "wcs-hint"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60,7 +60,7 @@ export class HorizontalStepper {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: '5da8afa26c57a0c1022ff0f07f39df0237642f9d' }, h("ul", { key: '842228ca2f4e136a3937b02281ca3194d4caef91', role: "list", class: "steps" }, this.steps.map((step, index) => (h(HorizontalStep, { step: step, passed: index <= this.internalCurrentStepIndex, checkOnComplete: this.checkOnComplete, complete: this.isComplete(step, index), active: index === this.internalCurrentStepIndex, first: index === 0, disable: this.isDisable(step, index), onClick: step => this.wcsHorizontalStepClick.emit({ step, index }) })))), this.renderLabels()));
|
|
64
64
|
}
|
|
65
65
|
isComplete(step, index) {
|
|
66
66
|
return index <= this.internalCurrentStepIndex || step.complete;
|
|
@@ -23,7 +23,7 @@ export class Icon {
|
|
|
23
23
|
[`icons-size-${this.size}`]: true
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return (h("i", Object.assign({ key: '
|
|
26
|
+
return (h("i", Object.assign({ key: '21e345e63fdb54bd03dac7b4574cdc6bddedfaa9' }, cssClass, { ref: (el) => (this.nativeIcon = el) }, this.inheritedAttributes)));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "wcs-icon"; }
|
|
29
29
|
static get properties() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Build, h, Host } from "@stencil/core";
|
|
2
|
-
import { debounceEvent,
|
|
2
|
+
import { debounceEvent, inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from "../../utils/helpers";
|
|
3
3
|
const INPUT_INHERITED_ATTRS = ['tabindex', 'title'];
|
|
4
4
|
/**
|
|
5
5
|
* The input component is a form control that accepts a single line of text.
|
|
@@ -167,12 +167,7 @@ export class Input {
|
|
|
167
167
|
}
|
|
168
168
|
render() {
|
|
169
169
|
const value = this.getValueAsString();
|
|
170
|
-
|
|
171
|
-
const label = findItemLabel(this.el);
|
|
172
|
-
if (label) {
|
|
173
|
-
label.id = labelId;
|
|
174
|
-
}
|
|
175
|
-
return (h(Host, { key: '20899914842d410ef72a8f81906e1e2be6e423cf', "aria-disabled": this.disabled ? 'true' : null, "data-has-prefix": !!this.prefixLabel, "data-has-suffix": !!this.suffixLabel }, this.prefixLabel ? (h("span", { class: "prefix", part: "prefix" }, this.prefixLabel)) : null, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, h("input", Object.assign({ key: '059fb987112d535b3f1cf51ea9bbaa01f36667c5', class: "native-input", ref: input => this.nativeInput = input, "aria-labelledby": label ? labelId : null, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.passwordReveal ? 'text' : this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus }, this.inheritedAttributes)), this.type === "password" ? (h("button", { title: this.passwordReveal ? this.hidePasswordButtonAriaLabel : this.showPasswordButtonAriaLabel, class: "toggle_password", onClick: () => this.passwordRevealIconClick() }, h("wcs-mat-icon", { icon: this.iconPassword, size: "m" }))) : null, this.suffixLabel ? (h("span", { class: "suffix", part: "suffix" }, this.suffixLabel)) : null));
|
|
170
|
+
return (h(Host, { key: 'd3123d1eb17f9fe38d6081ec94b15e027f706506', "aria-disabled": this.disabled ? 'true' : null, "data-has-prefix": !!this.prefixLabel, "data-has-suffix": !!this.suffixLabel }, this.prefixLabel ? (h("span", { class: "prefix", part: "prefix" }, this.prefixLabel)) : null, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, h("input", Object.assign({ key: 'b799b4443242f73609e337b33fc5794775aa7e1c', class: "native-input", ref: input => this.nativeInput = input, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.passwordReveal ? 'text' : this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus }, this.inheritedAttributes)), this.type === "password" ? (h("button", { title: this.passwordReveal ? this.hidePasswordButtonAriaLabel : this.showPasswordButtonAriaLabel, class: "toggle_password", onClick: () => this.passwordRevealIconClick() }, h("wcs-mat-icon", { icon: this.iconPassword, size: "m" }))) : null, this.suffixLabel ? (h("span", { class: "suffix", part: "suffix" }, this.suffixLabel)) : null));
|
|
176
171
|
}
|
|
177
172
|
static get is() { return "wcs-input"; }
|
|
178
173
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,SAAS,EAET,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAa7B,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAMH,MAAM,OAAO,KAAK;;QAGN,YAAO,GAAG,aAAa,QAAQ,EAAE,EAAE,CAAC;QACpC,wBAAmB,GAAyB,EAAE,CAAC;QAC/C,iBAAY,GAAG,YAAY,CAAC;QAyP5B,YAAO,GAAG,CAAC,EAAS,EAAE,EAAE;YAC5B,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,KAAK,EAAE,CAAC;gBACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YACnC,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAmB,CAAC,CAAC;QAC5C,CAAC,CAAA;QAEO,aAAQ,GAAG,CAAC,CAAQ,EAAE,EAAE;YAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAC,CAAC,CAAC;QACzD,CAAC,CAAA;QAEO,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAChC,IAAI,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport {\n debounceEvent,\n findItemLabel,\n inheritAriaAttributes,\n inheritAttributes,\n setOrRemoveAttribute\n} from '../../utils/helpers';\nimport {\n AutocompleteTypes,\n InputChangeEventDetail,\n TextFieldTypes,\n WcsInputSize,\n WcsInputAutocorrect,\n WcsInputEnterKeyHint,\n WcsInputInputMode,\n WcsInputState\n} from './input-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst INPUT_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The input component is a form control that accepts a single line of text.\n * Implementation mainly inspired from Ionic Input Component.\n *\n * ## Accessibility guidelines 💡\n * > - If you use wcs-input outside a wcs-form-field, you have to manage the label and the error message yourself.\n * > You can use the `aria-label` attribute to provide a label for screen readers but adds no visual label.\n * \n * @cssprop --wcs-input-icon-color-default - default icon color when the input is not focused\n * @cssprop --wcs-input-icon-color-focus - icon color when the input is focused\n * @cssprop --wcs-input-icon-color-disabled - icon color when the input is disabled\n *\n * @cssprop --wcs-input-background-color - background color of the input\n *\n * @cssprop --wcs-input-border-radius-left - border radius of the left side of the input\n * @cssprop --wcs-input-border-radius-right - border radius of the right side of the input\n * \n * @cssprop --wcs-input-border-width - border width of the input\n * @cssprop --wcs-input-border-width-focus - border width of the input when focused\n *\n * @cssprop --wcs-input-height-l - large height of the input\n * @cssprop --wcs-input-height-m - medium height of the input\n * @cssprop --wcs-input-height-s - small height of the input\n * @cssprop --wcs-input-font-size-l - large font size of the input\n * @cssprop --wcs-input-font-size-m - medium font size of the input\n * @cssprop --wcs-input-font-size-s - small font size of the input\n *\n * @cssprop --wcs-input-border-style-default - default border style of the input\n * @cssprop --wcs-input-border-style-focus - border style of the input when focused\n * \n * @cssprop --wcs-input-prefix-suffix-background-color - background color of the suffix/prefix\n * @cssprop --wcs-input-prefix-suffix-color - color of the suffix/prefix\n * @cssprop --wcs-input-prefix-suffix-color-disabled - color of the suffix/prefix when the input is disabled\n * @cssprop --wcs-input-prefix-suffix-font-weight - font weight of the suffix/prefix\n *\n * @cssprop --wcs-input-border-color-default - default border color of the input when not focused\n * @cssprop --wcs-input-border-color-disabled - border color of the input when disabled\n * @cssprop --wcs-input-border-color-focus - border color of the input when focused\n * @cssprop --wcs-input-reveal-password-button-border-color-focus - border color of the show/hide password button when focused\n * @cssprop --wcs-input-border-color-error - border color of the input when in error state\n *\n * @cssprop --wcs-input-value-color - color of the input value\n * @cssprop --wcs-input-value-font-weight - font weight of the input value\n * \n * @cssprop --wcs-input-placeholder-color - color of the input placeholder\n * @cssprop --wcs-input-placeholder-font-weight - font weight of the input placeholder\n * @cssprop --wcs-input-placeholder-font-style - font style of the input placeholder\n * \n * @cssprop --wcs-input-text-color-disabled - color of the input when disabled\n *\n * @cssprop --wcs-input-padding-horizontal-s - horizontal padding of the input in small size\n * @cssprop --wcs-input-padding-horizontal-m - horizontal padding of the input in medium size\n * @cssprop --wcs-input-padding-horizontal-l - horizontal padding of the input in large size\n * \n * @cssprop --wcs-input-gap - gap between text input and icon\n */\n@Component({\n tag: 'wcs-input',\n styleUrl: 'input.scss',\n shadow: { delegatesFocus: true },\n})\nexport class Input implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeInput?: HTMLInputElement;\n private inputId = `wcs-input-${inputIds++}`;\n private inheritedAttributes: { [k: string]: any } = {};\n private iconPassword = \"visibility\";\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents: boolean = true;\n\n @State() private passwordReveal: boolean = false;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the\n * server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: WcsInputAutocorrect = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus: boolean = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsInput` event after each keystroke.\n * This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsInput = debounceEvent(this.wcsInput, this.debounce);\n }\n\n /**\n * Prefix displayed before the text field contents. This is not included in the value.\n */\n @Prop() prefixLabel: string;\n\n /**\n * Suffix displayed after the text field contents. This is not included in the value.\n */\n @Prop() suffixLabel: string;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * A hint to the browser for which enter key to display.\n */\n @Prop() enterkeyhint?: WcsInputEnterKeyHint;\n\n /**\n * Specify the size (height) of the input.\n */\n @Prop({reflect: true}) size: WcsInputSize = 'm';\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n */\n @Prop() inputmode?: WcsInputInputMode;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute\n * specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute\n * specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to\n * `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop({ reflect: true }) multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n @Prop() hidePasswordButtonAriaLabel: string = \"Cacher le mot de passe\";\n @Prop() showPasswordButtonAriaLabel: string = \"Afficher le mot de passe\";\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some\n * subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value\n * of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise\n * it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support\n * the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for\n * more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n\n /**\n * Specifies the state of the input. By default the input is in an normal state but you can to set it to 'error'\n * state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: WcsInputState = 'initial';\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Emitted when a keyboard input occurred. See https://developer.mozilla.org/en-US/docs/Web/Events/input\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed. See https://developer.mozilla.org/en-US/docs/Web/Events/change\n */\n @Event() wcsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, INPUT_INHERITED_ATTRS)\n };\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n /**\n * Sets blur on the native `input` in `wcs-input`. Use this method instead of the global\n * `input.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement> {\n return Promise.resolve(this.nativeInput!);\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeInput, attr, value);\n }\n \n private getValueAsString(): string {\n return typeof this.value === 'number' ? this.value.toString() :\n (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n\n private onChange = (_: Event) => {\n this.wcsChange.emit({value: this.nativeInput.value});\n }\n\n private onBlur = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n private onFocus = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private passwordRevealIconClick(): void {\n this.passwordReveal = !this.passwordReveal;\n }\n\n @Watch('passwordReveal')\n onPasswordRevealChange(): void {\n this.iconPassword = this.passwordReveal ? 'visibility_off' : 'visibility';\n }\n\n render() {\n const value = this.getValueAsString();\n const labelId = this.inputId + '-lbl';\n const label = findItemLabel(this.el);\n if (label) {\n label.id = labelId;\n }\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n data-has-prefix={!!this.prefixLabel}\n data-has-suffix={!!this.suffixLabel}\n >\n {this.prefixLabel ? (<span class=\"prefix\" part=\"prefix\">{this.prefixLabel}</span>) : null}\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <input\n class=\"native-input\"\n ref={input => this.nativeInput = input}\n aria-labelledby={label ? labelId : null}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n type={this.passwordReveal ? 'text' : this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onChange}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n {...this.inheritedAttributes}\n />\n {this.type === \"password\" ? (\n <button title={this.passwordReveal ? this.hidePasswordButtonAriaLabel : this.showPasswordButtonAriaLabel} class=\"toggle_password\" onClick={() => this.passwordRevealIconClick()}>\n <wcs-mat-icon icon={this.iconPassword} size=\"m\"></wcs-mat-icon>\n </button>\n ) : null}\n {this.suffixLabel ? (<span class=\"suffix\" part=\"suffix\">{this.suffixLabel}</span>) : null}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,SAAS,EAET,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAa7B,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAMH,MAAM,OAAO,KAAK;;QAGN,YAAO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AAI,EAAC,QAAQ,IAAE,IAAI,CAAC,WAAW,CAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CACtF,CACV,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport {\n debounceEvent,\n inheritAriaAttributes,\n inheritAttributes,\n setOrRemoveAttribute\n} from '../../utils/helpers';\nimport {\n AutocompleteTypes,\n InputChangeEventDetail,\n TextFieldTypes,\n WcsInputSize,\n WcsInputAutocorrect,\n WcsInputEnterKeyHint,\n WcsInputInputMode,\n WcsInputState\n} from './input-interface';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst INPUT_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The input component is a form control that accepts a single line of text.\n * Implementation mainly inspired from Ionic Input Component.\n *\n * ## Accessibility guidelines 💡\n * > - If you use wcs-input outside a wcs-form-field, you have to manage the label and the error message yourself.\n * > You can use the `aria-label` attribute to provide a label for screen readers but adds no visual label.\n * \n * @cssprop --wcs-input-icon-color-default - default icon color when the input is not focused\n * @cssprop --wcs-input-icon-color-focus - icon color when the input is focused\n * @cssprop --wcs-input-icon-color-disabled - icon color when the input is disabled\n *\n * @cssprop --wcs-input-background-color - background color of the input\n *\n * @cssprop --wcs-input-border-radius-left - border radius of the left side of the input\n * @cssprop --wcs-input-border-radius-right - border radius of the right side of the input\n * \n * @cssprop --wcs-input-border-width - border width of the input\n * @cssprop --wcs-input-border-width-focus - border width of the input when focused\n *\n * @cssprop --wcs-input-height-l - large height of the input\n * @cssprop --wcs-input-height-m - medium height of the input\n * @cssprop --wcs-input-height-s - small height of the input\n * @cssprop --wcs-input-font-size-l - large font size of the input\n * @cssprop --wcs-input-font-size-m - medium font size of the input\n * @cssprop --wcs-input-font-size-s - small font size of the input\n *\n * @cssprop --wcs-input-border-style-default - default border style of the input\n * @cssprop --wcs-input-border-style-focus - border style of the input when focused\n * \n * @cssprop --wcs-input-prefix-suffix-background-color - background color of the suffix/prefix\n * @cssprop --wcs-input-prefix-suffix-color - color of the suffix/prefix\n * @cssprop --wcs-input-prefix-suffix-color-disabled - color of the suffix/prefix when the input is disabled\n * @cssprop --wcs-input-prefix-suffix-font-weight - font weight of the suffix/prefix\n *\n * @cssprop --wcs-input-border-color-default - default border color of the input when not focused\n * @cssprop --wcs-input-border-color-disabled - border color of the input when disabled\n * @cssprop --wcs-input-border-color-focus - border color of the input when focused\n * @cssprop --wcs-input-reveal-password-button-border-color-focus - border color of the show/hide password button when focused\n * @cssprop --wcs-input-border-color-error - border color of the input when in error state\n *\n * @cssprop --wcs-input-value-color - color of the input value\n * @cssprop --wcs-input-value-font-weight - font weight of the input value\n * \n * @cssprop --wcs-input-placeholder-color - color of the input placeholder\n * @cssprop --wcs-input-placeholder-font-weight - font weight of the input placeholder\n * @cssprop --wcs-input-placeholder-font-style - font style of the input placeholder\n * \n * @cssprop --wcs-input-text-color-disabled - color of the input when disabled\n *\n * @cssprop --wcs-input-padding-horizontal-s - horizontal padding of the input in small size\n * @cssprop --wcs-input-padding-horizontal-m - horizontal padding of the input in medium size\n * @cssprop --wcs-input-padding-horizontal-l - horizontal padding of the input in large size\n * \n * @cssprop --wcs-input-gap - gap between text input and icon\n */\n@Component({\n tag: 'wcs-input',\n styleUrl: 'input.scss',\n shadow: { delegatesFocus: true },\n})\nexport class Input implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeInput?: HTMLInputElement;\n private inputId = `wcs-input-${inputIds++}`;\n private inheritedAttributes: { [k: string]: any } = {};\n private iconPassword = \"visibility\";\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents: boolean = true;\n\n @State() private passwordReveal: boolean = false;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the\n * server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: WcsInputAutocorrect = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus: boolean = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsInput` event after each keystroke.\n * This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsInput = debounceEvent(this.wcsInput, this.debounce);\n }\n\n /**\n * Prefix displayed before the text field contents. This is not included in the value.\n */\n @Prop() prefixLabel: string;\n\n /**\n * Suffix displayed after the text field contents. This is not included in the value.\n */\n @Prop() suffixLabel: string;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * A hint to the browser for which enter key to display.\n */\n @Prop() enterkeyhint?: WcsInputEnterKeyHint;\n\n /**\n * Specify the size (height) of the input.\n */\n @Prop({reflect: true}) size: WcsInputSize = 'm';\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n */\n @Prop() inputmode?: WcsInputInputMode;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute\n * specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute\n * specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to\n * `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop({ reflect: true }) multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n @Prop() hidePasswordButtonAriaLabel: string = \"Cacher le mot de passe\";\n @Prop() showPasswordButtonAriaLabel: string = \"Afficher le mot de passe\";\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some\n * subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value\n * of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise\n * it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support\n * the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for\n * more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n\n /**\n * Specifies the state of the input. By default the input is in an normal state but you can to set it to 'error'\n * state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: WcsInputState = 'initial';\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Emitted when a keyboard input occurred. See https://developer.mozilla.org/en-US/docs/Web/Events/input\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed. See https://developer.mozilla.org/en-US/docs/Web/Events/change\n */\n @Event() wcsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, INPUT_INHERITED_ATTRS)\n };\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n /**\n * Sets blur on the native `input` in `wcs-input`. Use this method instead of the global\n * `input.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement> {\n return Promise.resolve(this.nativeInput!);\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeInput, attr, value);\n }\n \n private getValueAsString(): string {\n return typeof this.value === 'number' ? this.value.toString() :\n (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n\n private onChange = (_: Event) => {\n this.wcsChange.emit({value: this.nativeInput.value});\n }\n\n private onBlur = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n private onFocus = (ev: FocusEvent) => {\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private passwordRevealIconClick(): void {\n this.passwordReveal = !this.passwordReveal;\n }\n\n @Watch('passwordReveal')\n onPasswordRevealChange(): void {\n this.iconPassword = this.passwordReveal ? 'visibility_off' : 'visibility';\n }\n\n render() {\n const value = this.getValueAsString();\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n data-has-prefix={!!this.prefixLabel}\n data-has-suffix={!!this.suffixLabel}\n >\n {this.prefixLabel ? (<span class=\"prefix\" part=\"prefix\">{this.prefixLabel}</span>) : null}\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <input\n class=\"native-input\"\n ref={input => this.nativeInput = input}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n type={this.passwordReveal ? 'text' : this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onChange}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n {...this.inheritedAttributes}\n />\n {this.type === \"password\" ? (\n <button title={this.passwordReveal ? this.hidePasswordButtonAriaLabel : this.showPasswordButtonAriaLabel} class=\"toggle_password\" onClick={() => this.passwordRevealIconClick()}>\n <wcs-mat-icon icon={this.iconPassword} size=\"m\"></wcs-mat-icon>\n </button>\n ) : null}\n {this.suffixLabel ? (<span class=\"suffix\" part=\"suffix\">{this.suffixLabel}</span>) : null}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
font-weight: var(--wcs-label-font-weight);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
label {
|
|
10
|
+
display: inline-block;
|
|
11
|
+
color: var(--wcs-label-color);
|
|
10
12
|
font-weight: var(--wcs-label-font-weight);
|
|
11
|
-
color: var(--wcs-label-required-marker-color);
|
|
12
|
-
content: " *";
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
label {
|
|
14
|
+
label ::slotted(wcs-mat-icon) {
|
|
16
15
|
display: inline-flex;
|
|
17
|
-
align
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
vertical-align: text-top;
|
|
17
|
+
margin-left: var(--wcs-label-gap);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.required-marker {
|
|
21
|
+
margin-left: 4px;
|
|
22
|
+
vertical-align: text-top;
|
|
23
|
+
color: var(--wcs-label-required-marker-color);
|
|
21
24
|
font-weight: var(--wcs-label-font-weight);
|
|
22
25
|
}
|