wcs-core 4.1.0 → 5.0.0-rc.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/LICENSE +1 -1
- package/README.md +59 -90
- package/dist/cjs/accessibility-c0c4e648.js +74 -0
- package/dist/cjs/accessibility-c0c4e648.js.map +1 -0
- package/dist/cjs/button-interface-044a8a8a.js +12 -0
- package/dist/cjs/button-interface-044a8a8a.js.map +1 -0
- package/dist/cjs/grid-pagination-3511fdfa.js +111 -0
- package/dist/cjs/grid-pagination-3511fdfa.js.map +1 -0
- package/dist/cjs/{helpers-4a14051a.js → helpers-6280db6e.js} +75 -2
- package/dist/cjs/helpers-6280db6e.js.map +1 -0
- package/dist/cjs/{index-ca67a6dc.js → index-749d999e.js} +4 -1
- package/dist/cjs/index-749d999e.js.map +1 -0
- package/dist/cjs/{isEqual-9ea7ee49.js → keyboard-event-1cad4036.js} +77 -1
- package/dist/cjs/keyboard-event-1cad4036.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{select-arrow-c9583ea9.js → select-arrow-8169c0cb.js} +2 -2
- package/dist/cjs/{select-arrow-c9583ea9.js.map → select-arrow-8169c0cb.js.map} +1 -1
- package/dist/cjs/wcs-accordion-content.cjs.entry.js +1 -1
- package/dist/cjs/wcs-accordion-header.cjs.entry.js +1 -1
- package/dist/cjs/wcs-accordion-panel.cjs.entry.js +2 -2
- package/dist/cjs/wcs-accordion.cjs.entry.js +1 -1
- package/dist/cjs/wcs-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/wcs-app.cjs.entry.js +1 -1
- package/dist/cjs/wcs-badge.cjs.entry.js +3 -2
- package/dist/cjs/wcs-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/{wcs-button.cjs.entry.js → wcs-button_2.cjs.entry.js} +21 -12
- package/dist/cjs/wcs-button_2.cjs.entry.js.map +1 -0
- package/dist/cjs/wcs-card-body.cjs.entry.js +1 -1
- package/dist/cjs/wcs-card.cjs.entry.js +1 -1
- package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
- package/dist/cjs/wcs-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-com-nav-category.cjs.entry.js +2 -2
- package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +2 -2
- package/dist/cjs/wcs-com-nav.cjs.entry.js +2 -2
- package/dist/cjs/wcs-counter.cjs.entry.js +17 -6
- package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-divider.cjs.entry.js +1 -1
- package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +1 -1
- package/dist/cjs/wcs-dropdown-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown-header.cjs.entry.js +1 -1
- package/dist/cjs/wcs-dropdown-header.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown-item.cjs.entry.js +2 -2
- package/dist/cjs/wcs-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown.cjs.entry.js +14 -10
- package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-editable-field.cjs.entry.js +18 -3
- package/dist/cjs/wcs-editable-field.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-error_2.cjs.entry.js +36 -2
- package/dist/cjs/wcs-error_2.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-field-content.cjs.entry.js +1 -1
- package/dist/cjs/wcs-field-label.cjs.entry.js +1 -1
- package/dist/cjs/wcs-field.cjs.entry.js +1 -1
- package/dist/cjs/wcs-footer.cjs.entry.js +1 -1
- package/dist/cjs/wcs-galactic-menu.cjs.entry.js +2 -2
- package/dist/cjs/wcs-galactic.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid-column.cjs.entry.js +25 -4
- package/dist/cjs/wcs-grid-column.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid-pagination.cjs.entry.js +2 -2
- package/dist/cjs/wcs-grid.cjs.entry.js +309 -64
- 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 +16 -18
- package/dist/cjs/wcs-input.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-label.cjs.entry.js +1 -1
- package/dist/cjs/wcs-label.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 +2 -2
- package/dist/cjs/wcs-mat-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-modal.cjs.entry.js +97 -8
- package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-native-select.cjs.entry.js +25 -3
- package/dist/cjs/wcs-native-select.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-nav-item.cjs.entry.js +2 -2
- package/dist/cjs/wcs-nav.cjs.entry.js +1 -1
- package/dist/cjs/wcs-progress-bar.cjs.entry.js +4 -6
- package/dist/cjs/wcs-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-progress-radial.cjs.entry.js +14 -6
- package/dist/cjs/wcs-progress-radial.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-radio-group.cjs.entry.js +57 -6
- package/dist/cjs/wcs-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-radio.cjs.entry.js +26 -6
- package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-select_2.cjs.entry.js +604 -111
- 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 +5 -2
- package/dist/cjs/wcs-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tab.cjs.entry.js +5 -2
- package/dist/cjs/wcs-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tabs.cjs.entry.js +41 -5
- package/dist/cjs/wcs-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-textarea.cjs.entry.js +16 -13
- package/dist/cjs/wcs-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/wcs.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/badge/badge-interface.js.map +1 -1
- package/dist/collection/components/badge/badge.css +19 -1
- package/dist/collection/components/badge/badge.js +24 -0
- package/dist/collection/components/badge/badge.js.map +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/checkbox/checkbox.js +35 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/counter/counter.css +6 -1
- package/dist/collection/components/counter/counter.js +62 -3
- package/dist/collection/components/counter/counter.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.css +15 -4
- package/dist/collection/components/dropdown/dropdown.js +38 -1
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/dropdown-divider/dropdown-divider.js +3 -0
- package/dist/collection/components/dropdown-divider/dropdown-divider.js.map +1 -1
- package/dist/collection/components/dropdown-header/dropdown-header.js +4 -0
- package/dist/collection/components/dropdown-header/dropdown-header.js.map +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js +5 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js.map +1 -1
- package/dist/collection/components/editable-field/editable-field.js +17 -2
- package/dist/collection/components/editable-field/editable-field.js.map +1 -1
- package/dist/collection/components/error/error.js +1 -1
- package/dist/collection/components/error/error.js.map +1 -1
- package/dist/collection/components/form-field/form-field.js +31 -0
- package/dist/collection/components/form-field/form-field.js.map +1 -1
- package/dist/collection/components/grid/grid-keyboard-event.js +52 -0
- package/dist/collection/components/grid/grid-keyboard-event.js.map +1 -0
- package/dist/collection/components/grid/grid.css +5 -0
- package/dist/collection/components/grid/grid.js +251 -25
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/grid-column/grid-column.css +5 -0
- package/dist/collection/components/grid-column/grid-column.js +60 -1
- package/dist/collection/components/grid-column/grid-column.js.map +1 -1
- package/dist/collection/components/grid-column/grid-sort-arrow.js +1 -1
- package/dist/collection/components/grid-column/grid-sort-arrow.js.map +1 -1
- package/dist/collection/components/grid-pagination/grid-pagination-arrow.js +32 -23
- package/dist/collection/components/grid-pagination/grid-pagination-arrow.js.map +1 -1
- package/dist/collection/components/grid-pagination/grid-pagination.css +17 -0
- package/dist/collection/components/grid-pagination/grid-pagination.js +1 -1
- package/dist/collection/components/grid-pagination/grid-pagination.js.map +1 -1
- package/dist/collection/components/input/input.js +65 -31
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/label/label.js.map +1 -1
- package/dist/collection/components/mat-icon/mat-icon.js +1 -1
- package/dist/collection/components/mat-icon/mat-icon.js.map +1 -1
- package/dist/collection/components/modal/modal.css +2 -2
- package/dist/collection/components/modal/modal.js +140 -7
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/native-select/native-select.css +6 -5
- package/dist/collection/components/native-select/{native-select.component.js → native-select.js} +87 -7
- package/dist/collection/components/native-select/native-select.js.map +1 -0
- package/dist/collection/components/progress-bar/progress-bar.css +12 -11
- package/dist/collection/components/progress-bar/progress-bar.js +22 -13
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/collection/components/progress-radial/progress-radial.css +5 -0
- package/dist/collection/components/progress-radial/progress-radial.js +18 -7
- package/dist/collection/components/progress-radial/progress-radial.js.map +1 -1
- package/dist/collection/components/radio/radio.css +21 -17
- package/dist/collection/components/radio/{radio.component.js → radio.js} +44 -4
- package/dist/collection/components/radio/radio.js.map +1 -0
- package/dist/collection/components/radio-group/radio-group.js +98 -5
- package/dist/collection/components/radio-group/radio-group.js.map +1 -1
- package/dist/collection/components/select/select-interface.js +10 -0
- package/dist/collection/components/select/select-interface.js.map +1 -1
- package/dist/collection/components/select/select-keyboard-event.js +306 -0
- package/dist/collection/components/select/select-keyboard-event.js.map +1 -0
- package/dist/collection/components/select/select.css +59 -6
- package/dist/collection/components/select/select.js +436 -111
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/select-option/select-option.css +15 -0
- package/dist/collection/components/select-option/select-option.js +30 -5
- package/dist/collection/components/select-option/select-option.js.map +1 -1
- package/dist/collection/components/switch/switch.js +34 -1
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab/tab.css +7 -0
- package/dist/collection/components/tab/tab.js +12 -2
- package/dist/collection/components/tab/tab.js.map +1 -1
- package/dist/collection/components/tabs/tabs.js +61 -4
- package/dist/collection/components/tabs/tabs.js.map +1 -1
- package/dist/collection/components/textarea/textarea.css +8 -3
- package/dist/collection/components/textarea/textarea.js +49 -16
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/utils/accessibility.js +64 -0
- package/dist/collection/utils/accessibility.js.map +1 -1
- package/dist/collection/utils/helpers.js +76 -1
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/keyboard-event.js +74 -0
- package/dist/collection/utils/keyboard-event.js.map +1 -0
- package/dist/collection/utils/mutable-aria-attribute.js +4 -0
- package/dist/collection/utils/mutable-aria-attribute.js.map +1 -0
- package/dist/esm/accessibility-64feea8a.js +71 -0
- package/dist/esm/accessibility-64feea8a.js.map +1 -0
- package/dist/esm/button-interface-c21c265f.js +9 -0
- package/dist/esm/button-interface-c21c265f.js.map +1 -0
- package/dist/esm/grid-pagination-f7b01e2e.js +109 -0
- package/dist/esm/grid-pagination-f7b01e2e.js.map +1 -0
- package/dist/esm/{helpers-1f7170dd.js → helpers-a21ae7d0.js} +75 -3
- package/dist/esm/helpers-a21ae7d0.js.map +1 -0
- package/dist/esm/{index-dc4d96d4.js → index-4f282598.js} +4 -1
- package/dist/esm/index-4f282598.js.map +1 -0
- package/dist/esm/{isEqual-20881bca.js → keyboard-event-ba3d20e7.js} +77 -2
- package/dist/esm/keyboard-event-ba3d20e7.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{select-arrow-81d069f7.js → select-arrow-28e8687b.js} +2 -2
- package/dist/esm/{select-arrow-81d069f7.js.map → select-arrow-28e8687b.js.map} +1 -1
- package/dist/esm/wcs-accordion-content.entry.js +1 -1
- package/dist/esm/wcs-accordion-header.entry.js +1 -1
- package/dist/esm/wcs-accordion-panel.entry.js +2 -2
- package/dist/esm/wcs-accordion.entry.js +1 -1
- package/dist/esm/wcs-action-bar.entry.js +1 -1
- package/dist/esm/wcs-app.entry.js +1 -1
- package/dist/esm/wcs-badge.entry.js +3 -2
- package/dist/esm/wcs-badge.entry.js.map +1 -1
- package/dist/esm/{wcs-button.entry.js → wcs-button_2.entry.js} +19 -11
- package/dist/esm/wcs-button_2.entry.js.map +1 -0
- package/dist/esm/wcs-card-body.entry.js +1 -1
- package/dist/esm/wcs-card.entry.js +1 -1
- package/dist/esm/wcs-checkbox.entry.js +6 -2
- package/dist/esm/wcs-checkbox.entry.js.map +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 +17 -6
- package/dist/esm/wcs-counter.entry.js.map +1 -1
- package/dist/esm/wcs-divider.entry.js +1 -1
- package/dist/esm/wcs-dropdown-divider.entry.js +1 -1
- package/dist/esm/wcs-dropdown-divider.entry.js.map +1 -1
- package/dist/esm/wcs-dropdown-header.entry.js +1 -1
- package/dist/esm/wcs-dropdown-header.entry.js.map +1 -1
- package/dist/esm/wcs-dropdown-item.entry.js +2 -2
- package/dist/esm/wcs-dropdown-item.entry.js.map +1 -1
- package/dist/esm/wcs-dropdown.entry.js +13 -9
- package/dist/esm/wcs-dropdown.entry.js.map +1 -1
- package/dist/esm/wcs-editable-field.entry.js +18 -3
- package/dist/esm/wcs-editable-field.entry.js.map +1 -1
- package/dist/esm/wcs-error_2.entry.js +36 -2
- package/dist/esm/wcs-error_2.entry.js.map +1 -1
- package/dist/esm/wcs-field-content.entry.js +1 -1
- package/dist/esm/wcs-field-label.entry.js +1 -1
- package/dist/esm/wcs-field.entry.js +1 -1
- package/dist/esm/wcs-footer.entry.js +1 -1
- package/dist/esm/wcs-galactic-menu.entry.js +2 -2
- package/dist/esm/wcs-galactic.entry.js +1 -1
- package/dist/esm/wcs-grid-column.entry.js +25 -4
- package/dist/esm/wcs-grid-column.entry.js.map +1 -1
- 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 +271 -26
- package/dist/esm/wcs-grid.entry.js.map +1 -1
- package/dist/esm/wcs-header.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/wcs-input.entry.js +16 -18
- package/dist/esm/wcs-input.entry.js.map +1 -1
- package/dist/esm/wcs-label.entry.js +1 -1
- package/dist/esm/wcs-label.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-mat-icon.entry.js.map +1 -1
- package/dist/esm/wcs-modal.entry.js +97 -8
- package/dist/esm/wcs-modal.entry.js.map +1 -1
- package/dist/esm/wcs-native-select.entry.js +25 -3
- package/dist/esm/wcs-native-select.entry.js.map +1 -1
- package/dist/esm/wcs-nav-item.entry.js +2 -2
- package/dist/esm/wcs-nav.entry.js +1 -1
- package/dist/esm/wcs-progress-bar.entry.js +4 -6
- package/dist/esm/wcs-progress-bar.entry.js.map +1 -1
- package/dist/esm/wcs-progress-radial.entry.js +14 -6
- package/dist/esm/wcs-progress-radial.entry.js.map +1 -1
- package/dist/esm/wcs-radio-group.entry.js +57 -6
- package/dist/esm/wcs-radio-group.entry.js.map +1 -1
- package/dist/esm/wcs-radio.entry.js +26 -6
- package/dist/esm/wcs-radio.entry.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +603 -110
- 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 +5 -2
- package/dist/esm/wcs-switch.entry.js.map +1 -1
- package/dist/esm/wcs-tab.entry.js +5 -2
- package/dist/esm/wcs-tab.entry.js.map +1 -1
- package/dist/esm/wcs-tabs.entry.js +41 -5
- package/dist/esm/wcs-tabs.entry.js.map +1 -1
- package/dist/esm/wcs-textarea.entry.js +16 -13
- package/dist/esm/wcs-textarea.entry.js.map +1 -1
- package/dist/esm/wcs-tooltip.entry.js +1 -1
- package/dist/esm/wcs.js +3 -3
- package/dist/types/components/badge/badge-interface.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +5 -1
- package/dist/types/components/checkbox/checkbox.d.ts +4 -1
- package/dist/types/components/counter/counter.d.ts +8 -1
- package/dist/types/components/dropdown/dropdown.d.ts +10 -1
- package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
- package/dist/types/components/dropdown-header/dropdown-header.d.ts +4 -0
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +7 -0
- package/dist/types/components/editable-field/editable-field.d.ts +7 -0
- package/dist/types/components/form-field/form-field.d.ts +4 -0
- package/dist/types/components/grid/grid-keyboard-event.d.ts +16 -0
- package/dist/types/components/grid/grid.d.ts +56 -2
- package/dist/types/components/grid-column/grid-column.d.ts +17 -0
- package/dist/types/components/input/input.d.ts +41 -20
- package/dist/types/components/modal/modal.d.ts +61 -5
- package/dist/types/components/native-select/{native-select.component.d.ts → native-select.d.ts} +25 -6
- package/dist/types/components/progress-bar/progress-bar.d.ts +8 -3
- package/dist/types/components/progress-radial/progress-radial.d.ts +12 -0
- package/dist/types/components/radio/{radio.component.d.ts → radio.d.ts} +5 -0
- package/dist/types/components/radio-group/radio-group.d.ts +6 -1
- package/dist/types/components/select/select-interface.d.ts +12 -0
- package/dist/types/components/select/select-keyboard-event.d.ts +38 -0
- package/dist/types/components/select/select.d.ts +76 -15
- package/dist/types/components/select-option/select-option.d.ts +10 -4
- package/dist/types/components/switch/switch.d.ts +4 -1
- package/dist/types/components/tab/tab.d.ts +3 -0
- package/dist/types/components/tabs/tabs.d.ts +17 -0
- package/dist/types/components/textarea/textarea.d.ts +10 -6
- package/dist/types/components.d.ts +427 -75
- package/dist/types/utils/accessibility.d.ts +6 -0
- package/dist/types/utils/helpers.d.ts +12 -1
- package/dist/types/utils/keyboard-event.d.ts +13 -0
- package/dist/types/utils/mutable-aria-attribute.d.ts +5 -0
- package/dist/wcs/{p-7a3f70da.entry.js → p-00f6a79a.entry.js} +2 -2
- package/dist/wcs/{p-ee453b6e.entry.js → p-016e4dd9.entry.js} +2 -2
- package/dist/wcs/p-0ae177cf.js +2 -0
- package/dist/wcs/p-0ae177cf.js.map +1 -0
- package/dist/wcs/p-0d02d9e4.entry.js +2 -0
- package/dist/wcs/p-0d02d9e4.entry.js.map +1 -0
- package/dist/wcs/{p-30d8f9c3.entry.js → p-11ab4ffc.entry.js} +2 -2
- package/dist/wcs/p-13548191.entry.js +2 -0
- package/dist/wcs/p-13548191.entry.js.map +1 -0
- package/dist/wcs/p-13ffe5f3.entry.js +2 -0
- package/dist/wcs/p-13ffe5f3.entry.js.map +1 -0
- package/dist/wcs/{p-dfddec76.entry.js → p-17442a2f.entry.js} +2 -2
- package/dist/wcs/{p-d6c3e615.js → p-24611014.js} +2 -2
- package/dist/wcs/p-250b3794.entry.js +2 -0
- package/dist/wcs/{p-91b3e4b5.entry.js.map → p-250b3794.entry.js.map} +1 -1
- package/dist/wcs/{p-292ca644.entry.js → p-2d62b3dd.entry.js} +2 -2
- package/dist/wcs/{p-d6b3f742.entry.js → p-33a5594d.entry.js} +2 -2
- package/dist/wcs/p-33a570ee.js +2 -0
- package/dist/wcs/p-33a570ee.js.map +1 -0
- package/dist/wcs/{p-e86c6cbb.entry.js → p-34079054.entry.js} +2 -2
- package/dist/wcs/{p-e86c6cbb.entry.js.map → p-34079054.entry.js.map} +1 -1
- package/dist/wcs/{p-257b15b9.entry.js → p-36e83879.entry.js} +2 -2
- package/dist/wcs/p-44410e32.entry.js +2 -0
- package/dist/wcs/p-44410e32.entry.js.map +1 -0
- package/dist/wcs/{p-b6cd196d.entry.js → p-46184d47.entry.js} +2 -2
- package/dist/wcs/p-46975b1e.entry.js +2 -0
- package/dist/wcs/p-46975b1e.entry.js.map +1 -0
- package/dist/wcs/{p-4a9f8e94.entry.js → p-46d56c4e.entry.js} +3 -3
- package/dist/wcs/{p-fc3f5b53.entry.js → p-4820154c.entry.js} +2 -2
- package/dist/wcs/p-49b0de03.entry.js +2 -0
- package/dist/wcs/p-49b0de03.entry.js.map +1 -0
- package/dist/wcs/{p-ff9967eb.entry.js → p-4af68f13.entry.js} +2 -2
- package/dist/wcs/{p-4b4d53e2.entry.js → p-5f0ab1dc.entry.js} +2 -2
- package/dist/wcs/p-5f0ab1dc.entry.js.map +1 -0
- package/dist/wcs/p-5f3e6b0c.entry.js +2 -0
- package/dist/wcs/p-5f3e6b0c.entry.js.map +1 -0
- package/dist/wcs/{p-50dce764.entry.js → p-61b934a7.entry.js} +2 -2
- package/dist/wcs/p-64855188.js +2 -0
- package/dist/wcs/p-64855188.js.map +1 -0
- package/dist/wcs/p-680b107c.entry.js +2 -0
- package/dist/wcs/p-68d654da.js +2 -0
- package/dist/wcs/p-68d654da.js.map +1 -0
- package/dist/wcs/p-69d1223c.js +3 -0
- package/dist/wcs/p-69d1223c.js.map +1 -0
- package/dist/wcs/p-6dc8f984.entry.js +2 -0
- package/dist/wcs/p-6dc8f984.entry.js.map +1 -0
- package/dist/wcs/p-6f538b67.entry.js +2 -0
- package/dist/wcs/p-6f538b67.entry.js.map +1 -0
- package/dist/wcs/p-7c145ed0.entry.js +2 -0
- package/dist/wcs/p-7c145ed0.entry.js.map +1 -0
- package/dist/wcs/p-8724a296.entry.js +2 -0
- package/dist/wcs/p-8724a296.entry.js.map +1 -0
- package/dist/wcs/{p-d084dd61.entry.js → p-88b1cdfe.entry.js} +2 -2
- package/dist/wcs/{p-c7494651.entry.js → p-8ff7e463.entry.js} +2 -2
- package/dist/wcs/p-90a7fd68.entry.js +2 -0
- package/dist/wcs/p-90a7fd68.entry.js.map +1 -0
- package/dist/wcs/{p-cfcacc44.entry.js → p-914aa964.entry.js} +2 -2
- package/dist/wcs/{p-429bd9fb.entry.js → p-9b1c73b3.entry.js} +2 -2
- package/dist/wcs/p-9cc48d75.js +2 -0
- package/dist/wcs/p-9cc48d75.js.map +1 -0
- package/dist/wcs/p-a3518f66.entry.js +2 -0
- package/dist/wcs/p-a361d9f1.entry.js +2 -0
- package/dist/wcs/{p-31a8d23f.entry.js → p-a85208ca.entry.js} +2 -2
- package/dist/wcs/{p-d3f1cafe.entry.js → p-b91323fc.entry.js} +2 -2
- package/dist/wcs/{p-47d8ece5.entry.js → p-bd4029f8.entry.js} +2 -2
- package/dist/wcs/{p-f82e7a61.entry.js → p-bed4e3ce.entry.js} +2 -2
- package/dist/wcs/p-c261353f.entry.js +2 -0
- package/dist/wcs/p-c261353f.entry.js.map +1 -0
- package/dist/wcs/p-c3227f01.entry.js +2 -0
- package/dist/wcs/p-c3227f01.entry.js.map +1 -0
- package/dist/wcs/{p-810aff71.entry.js → p-c38adf4b.entry.js} +2 -2
- package/dist/wcs/{p-554ca93c.entry.js → p-c6a8c6f9.entry.js} +2 -2
- package/dist/wcs/p-c9478849.entry.js +2 -0
- package/dist/wcs/p-c9478849.entry.js.map +1 -0
- package/dist/wcs/p-ce3ef5d0.entry.js +2 -0
- package/dist/wcs/p-ce3ef5d0.entry.js.map +1 -0
- package/dist/wcs/{p-54e29233.entry.js → p-ce40b012.entry.js} +2 -2
- package/dist/wcs/{p-54e29233.entry.js.map → p-ce40b012.entry.js.map} +1 -1
- package/dist/wcs/p-d39eb1e5.entry.js +16 -0
- package/dist/wcs/p-d39eb1e5.entry.js.map +1 -0
- package/dist/wcs/p-d6c482fc.entry.js +2 -0
- package/dist/wcs/p-d6c482fc.entry.js.map +1 -0
- package/dist/wcs/{p-1e43122f.entry.js → p-d84cee70.entry.js} +2 -2
- package/dist/wcs/p-dca2f42c.entry.js +2 -0
- package/dist/wcs/p-de46cc49.entry.js +2 -0
- package/dist/wcs/p-de46cc49.entry.js.map +1 -0
- package/dist/wcs/{p-966a241e.entry.js → p-e0d5908a.entry.js} +2 -2
- package/dist/wcs/{p-a5cd4c07.entry.js → p-e487ff2c.entry.js} +2 -2
- package/dist/wcs/p-e487ff2c.entry.js.map +1 -0
- package/dist/wcs/{p-84afb8af.entry.js → p-e52c11e4.entry.js} +2 -2
- package/dist/wcs/{p-0ede0c37.entry.js → p-e7661047.entry.js} +2 -2
- package/dist/wcs/p-ea6e33ee.entry.js +2 -0
- package/dist/wcs/{p-cc03627c.entry.js → p-f7ce4e0d.entry.js} +2 -2
- package/dist/wcs/{p-b6160b7c.entry.js → p-faf04401.entry.js} +2 -2
- package/dist/wcs/p-fc1767ae.entry.js +2 -0
- package/dist/wcs/p-fc1767ae.entry.js.map +1 -0
- package/dist/wcs/p-feebc469.entry.js +2 -0
- package/dist/wcs/p-feebc469.entry.js.map +1 -0
- package/dist/wcs/wcs.css +1 -1
- package/dist/wcs/wcs.esm.js +1 -1
- package/dist/wcs/wcs.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/cjs/grid-pagination-4b55c908.js +0 -101
- package/dist/cjs/grid-pagination-4b55c908.js.map +0 -1
- package/dist/cjs/helpers-4a14051a.js.map +0 -1
- package/dist/cjs/index-ca67a6dc.js.map +0 -1
- package/dist/cjs/isEqual-9ea7ee49.js.map +0 -1
- package/dist/cjs/wcs-button.cjs.entry.js.map +0 -1
- package/dist/cjs/wcs-spinner.cjs.entry.js +0 -22
- package/dist/cjs/wcs-spinner.cjs.entry.js.map +0 -1
- package/dist/collection/components/native-select/native-select.component.js.map +0 -1
- package/dist/collection/components/radio/radio.component.js.map +0 -1
- package/dist/esm/grid-pagination-41354861.js +0 -99
- package/dist/esm/grid-pagination-41354861.js.map +0 -1
- package/dist/esm/helpers-1f7170dd.js.map +0 -1
- package/dist/esm/index-dc4d96d4.js.map +0 -1
- package/dist/esm/isEqual-20881bca.js.map +0 -1
- package/dist/esm/wcs-button.entry.js.map +0 -1
- package/dist/esm/wcs-spinner.entry.js +0 -18
- package/dist/esm/wcs-spinner.entry.js.map +0 -1
- package/dist/wcs/p-02b95dbf.entry.js +0 -2
- package/dist/wcs/p-02b95dbf.entry.js.map +0 -1
- package/dist/wcs/p-069555a1.entry.js +0 -2
- package/dist/wcs/p-069555a1.entry.js.map +0 -1
- package/dist/wcs/p-07b8cd36.entry.js +0 -2
- package/dist/wcs/p-07b8cd36.entry.js.map +0 -1
- package/dist/wcs/p-12ac2547.js +0 -2
- package/dist/wcs/p-12ac2547.js.map +0 -1
- package/dist/wcs/p-15058c29.entry.js +0 -2
- package/dist/wcs/p-15058c29.entry.js.map +0 -1
- package/dist/wcs/p-17630eea.entry.js +0 -2
- package/dist/wcs/p-22480bd8.entry.js +0 -2
- package/dist/wcs/p-22480bd8.entry.js.map +0 -1
- package/dist/wcs/p-269d244c.entry.js +0 -2
- package/dist/wcs/p-269d244c.entry.js.map +0 -1
- package/dist/wcs/p-26c4c983.entry.js +0 -2
- package/dist/wcs/p-26c4c983.entry.js.map +0 -1
- package/dist/wcs/p-405140f9.entry.js +0 -16
- package/dist/wcs/p-405140f9.entry.js.map +0 -1
- package/dist/wcs/p-463667c9.entry.js +0 -2
- package/dist/wcs/p-475ac7c5.js +0 -2
- package/dist/wcs/p-475ac7c5.js.map +0 -1
- package/dist/wcs/p-4b4d53e2.entry.js.map +0 -1
- package/dist/wcs/p-57560d7d.entry.js +0 -2
- package/dist/wcs/p-57560d7d.entry.js.map +0 -1
- package/dist/wcs/p-627bbb6a.entry.js +0 -2
- package/dist/wcs/p-627bbb6a.entry.js.map +0 -1
- package/dist/wcs/p-64dd7356.entry.js +0 -2
- package/dist/wcs/p-64dd7356.entry.js.map +0 -1
- package/dist/wcs/p-6acbf38a.entry.js +0 -2
- package/dist/wcs/p-6acbf38a.entry.js.map +0 -1
- package/dist/wcs/p-6b66ce85.entry.js +0 -2
- package/dist/wcs/p-6b66ce85.entry.js.map +0 -1
- package/dist/wcs/p-732b2faa.entry.js +0 -2
- package/dist/wcs/p-732b2faa.entry.js.map +0 -1
- package/dist/wcs/p-747a5962.entry.js +0 -2
- package/dist/wcs/p-8181f8cd.js +0 -2
- package/dist/wcs/p-8181f8cd.js.map +0 -1
- package/dist/wcs/p-8d57835f.entry.js +0 -2
- package/dist/wcs/p-91b3e4b5.entry.js +0 -2
- package/dist/wcs/p-94d95b99.entry.js +0 -2
- package/dist/wcs/p-94d95b99.entry.js.map +0 -1
- package/dist/wcs/p-9910fedd.entry.js +0 -2
- package/dist/wcs/p-9910fedd.entry.js.map +0 -1
- package/dist/wcs/p-9d798de4.entry.js +0 -2
- package/dist/wcs/p-9d798de4.entry.js.map +0 -1
- package/dist/wcs/p-9ecdeaf9.entry.js +0 -2
- package/dist/wcs/p-9ecdeaf9.entry.js.map +0 -1
- package/dist/wcs/p-a2df3a49.js +0 -3
- package/dist/wcs/p-a2df3a49.js.map +0 -1
- package/dist/wcs/p-a5cd4c07.entry.js.map +0 -1
- package/dist/wcs/p-b229a91c.entry.js +0 -2
- package/dist/wcs/p-b229a91c.entry.js.map +0 -1
- package/dist/wcs/p-b856f2f6.entry.js +0 -2
- package/dist/wcs/p-b856f2f6.entry.js.map +0 -1
- package/dist/wcs/p-cdd172b4.entry.js +0 -2
- package/dist/wcs/p-d2da0c9f.entry.js +0 -2
- package/dist/wcs/p-d2da0c9f.entry.js.map +0 -1
- package/dist/wcs/p-d5a0e271.entry.js +0 -2
- package/dist/wcs/p-d5a0e271.entry.js.map +0 -1
- /package/dist/wcs/{p-7a3f70da.entry.js.map → p-00f6a79a.entry.js.map} +0 -0
- /package/dist/wcs/{p-ee453b6e.entry.js.map → p-016e4dd9.entry.js.map} +0 -0
- /package/dist/wcs/{p-30d8f9c3.entry.js.map → p-11ab4ffc.entry.js.map} +0 -0
- /package/dist/wcs/{p-dfddec76.entry.js.map → p-17442a2f.entry.js.map} +0 -0
- /package/dist/wcs/{p-d6c3e615.js.map → p-24611014.js.map} +0 -0
- /package/dist/wcs/{p-292ca644.entry.js.map → p-2d62b3dd.entry.js.map} +0 -0
- /package/dist/wcs/{p-d6b3f742.entry.js.map → p-33a5594d.entry.js.map} +0 -0
- /package/dist/wcs/{p-257b15b9.entry.js.map → p-36e83879.entry.js.map} +0 -0
- /package/dist/wcs/{p-b6cd196d.entry.js.map → p-46184d47.entry.js.map} +0 -0
- /package/dist/wcs/{p-4a9f8e94.entry.js.map → p-46d56c4e.entry.js.map} +0 -0
- /package/dist/wcs/{p-fc3f5b53.entry.js.map → p-4820154c.entry.js.map} +0 -0
- /package/dist/wcs/{p-ff9967eb.entry.js.map → p-4af68f13.entry.js.map} +0 -0
- /package/dist/wcs/{p-50dce764.entry.js.map → p-61b934a7.entry.js.map} +0 -0
- /package/dist/wcs/{p-17630eea.entry.js.map → p-680b107c.entry.js.map} +0 -0
- /package/dist/wcs/{p-d084dd61.entry.js.map → p-88b1cdfe.entry.js.map} +0 -0
- /package/dist/wcs/{p-c7494651.entry.js.map → p-8ff7e463.entry.js.map} +0 -0
- /package/dist/wcs/{p-cfcacc44.entry.js.map → p-914aa964.entry.js.map} +0 -0
- /package/dist/wcs/{p-429bd9fb.entry.js.map → p-9b1c73b3.entry.js.map} +0 -0
- /package/dist/wcs/{p-8d57835f.entry.js.map → p-a3518f66.entry.js.map} +0 -0
- /package/dist/wcs/{p-463667c9.entry.js.map → p-a361d9f1.entry.js.map} +0 -0
- /package/dist/wcs/{p-31a8d23f.entry.js.map → p-a85208ca.entry.js.map} +0 -0
- /package/dist/wcs/{p-d3f1cafe.entry.js.map → p-b91323fc.entry.js.map} +0 -0
- /package/dist/wcs/{p-47d8ece5.entry.js.map → p-bd4029f8.entry.js.map} +0 -0
- /package/dist/wcs/{p-f82e7a61.entry.js.map → p-bed4e3ce.entry.js.map} +0 -0
- /package/dist/wcs/{p-810aff71.entry.js.map → p-c38adf4b.entry.js.map} +0 -0
- /package/dist/wcs/{p-554ca93c.entry.js.map → p-c6a8c6f9.entry.js.map} +0 -0
- /package/dist/wcs/{p-1e43122f.entry.js.map → p-d84cee70.entry.js.map} +0 -0
- /package/dist/wcs/{p-747a5962.entry.js.map → p-dca2f42c.entry.js.map} +0 -0
- /package/dist/wcs/{p-966a241e.entry.js.map → p-e0d5908a.entry.js.map} +0 -0
- /package/dist/wcs/{p-84afb8af.entry.js.map → p-e52c11e4.entry.js.map} +0 -0
- /package/dist/wcs/{p-0ede0c37.entry.js.map → p-e7661047.entry.js.map} +0 -0
- /package/dist/wcs/{p-cdd172b4.entry.js.map → p-ea6e33ee.entry.js.map} +0 -0
- /package/dist/wcs/{p-cc03627c.entry.js.map → p-f7ce4e0d.entry.js.map} +0 -0
- /package/dist/wcs/{p-b6160b7c.entry.js.map → p-faf04401.entry.js.map} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,112 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://wcs.dev.sncf" target="blank">
|
|
2
|
+
<img src="stories/assets/images/cover.webp" style="max-width: 100%" alt="SNCF Design System Cover" />
|
|
3
|
+
</a>
|
|
4
|
+
|
|
5
|
+
# Web Components SNCF
|
|
6
|
+
|
|
7
|
+
[](https://img.shields.io/gitlab/pipeline-status/SNCF%2Fwcs?branch=master&style=for-the-badge)
|
|
8
|
+
[](https://img.shields.io/gitlab/v/tag/13813721?color=success&label=release&style=for-the-badge)
|
|
9
|
+
[](https://img.shields.io/npm/dt/wcs-core?style=for-the-badge)
|
|
10
|
+
|
|
11
|
+
[](https://stenciljs.com)
|
|
12
|
+
[](https://storybook.js.org/)
|
|
13
|
+
|
|
14
|
+
### **OFFICIAL DOCUMENTATION** 👉 [WCS.DEV.SNCF](https://wcs.dev.sncf)
|
|
2
15
|
|
|
3
16
|
This project is the web component implementation of the [SNCF design system](https://designmetier-bootstrap.sncf.fr/).
|
|
4
|
-
It is built using
|
|
17
|
+
It is built using [Stencil](https://github.com/ionic-team/stencil) and documented using [Storybook](https://storybook.js.org/).
|
|
5
18
|
|
|
6
|
-
If you read this documentation on GitHub, only the development branch is updated at the moment. We use
|
|
19
|
+
If you read this documentation on GitHub, only the development branch is updated at the moment. We use the [GitLab project](https://gitlab.com/SNCF/wcs/) for WCS development and releases.
|
|
7
20
|
|
|
8
21
|
## Packages
|
|
9
22
|
|
|
10
23
|
Here is the list of published npm packages and their goal :
|
|
11
24
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
| Package | Usage | Version |
|
|
26
|
+
|:--------------|:-------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------:|
|
|
27
|
+
| `wcs-core` | Contains the web components compiled with StencilJS | [](https://www.npmjs.com/package/wcs-core) |
|
|
28
|
+
| `wcs-angular` | Angular integrations (value accessors, types, bindings, ...) | [](https://www.npmjs.com/package/wcs-angular) |
|
|
29
|
+
| `wcs-formly` | Angular Formly integration for WCS | [](https://www.npmjs.com/package/wcs-formly) |
|
|
30
|
+
| `wcs-react` | React integration for WCS (types, bindings, ...) | [](https://www.npmjs.com/package/wcs-react) |
|
|
16
31
|
|
|
17
|
-
##
|
|
32
|
+
## StackBlitz templates
|
|
18
33
|
|
|
19
|
-
|
|
34
|
+
We created 3 StackBlitz templates to help you test quickly without worrying about WCS configuration :
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
- WcsAngular + WcsFormly : https://stackblitz.com/edit/wcs-angular-template
|
|
37
|
+
- WcsReact : https://stackblitz.com/edit/wcs-react-template
|
|
38
|
+
- WcsCore only (Plain HTML) : https://stackblitz.com/edit/wcs-plain-html-template
|
|
22
39
|
|
|
23
|
-
##
|
|
40
|
+
## Roadmap
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
This project is still under heavy development.
|
|
43
|
+
You can get a preview of what's planned for the following months in the [GitLab Milestones](https://gitlab.com/SNCF/wcs/-/milestones).
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
Consult the [changelog](https://wcs.dev.sncf/?path=/docs/documentation-changelog--documentation) to know what's going on.
|
|
28
46
|
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
47
|
+
Major versions releases :
|
|
48
|
+
- **v0** 👉 Jul 2019
|
|
49
|
+
- **v1** 👉 Sep 2020
|
|
50
|
+
- **v2** 👉 Jun 2021
|
|
51
|
+
- **v3** 👉 Feb 2023
|
|
52
|
+
- **v4** 👉 Sep 2023
|
|
33
53
|
|
|
34
54
|
|
|
35
55
|
### Example usage
|
|
36
56
|
|
|
37
|
-
There
|
|
57
|
+
There are example projects under `example` folder for angular and react.
|
|
38
58
|
|
|
39
59
|
Step to start the example project :
|
|
40
60
|
```shell
|
|
41
61
|
# wcs-core build
|
|
42
62
|
npm install
|
|
43
63
|
npm run build
|
|
64
|
+
```
|
|
65
|
+
```shell
|
|
44
66
|
# angular build (use --watch option to watch files)
|
|
45
67
|
cd angular
|
|
46
68
|
npm install
|
|
47
69
|
ng build --project wcs-angular
|
|
48
70
|
ng build --project wcs-formly
|
|
49
|
-
# start example
|
|
50
|
-
cd ../example
|
|
71
|
+
# start angular example
|
|
72
|
+
cd ../example/angular
|
|
51
73
|
npm install
|
|
52
74
|
ng serve
|
|
53
75
|
```
|
|
76
|
+
```shell
|
|
77
|
+
# react build
|
|
78
|
+
cd react
|
|
79
|
+
npm install
|
|
80
|
+
npm run clean && npm run compile
|
|
81
|
+
# start react example
|
|
82
|
+
cd ../example/react
|
|
83
|
+
npm install
|
|
84
|
+
npm run start
|
|
85
|
+
```
|
|
54
86
|
|
|
55
|
-
If you have any question, don't hesitate to fill an issue
|
|
87
|
+
If you have any question, don't hesitate to [fill an issue](https://gitlab.com/SNCF/wcs/-/issues/new).
|
|
56
88
|
|
|
57
89
|
### Install in your project
|
|
58
90
|
|
|
59
|
-
You can refer to the
|
|
60
|
-
|
|
61
|
-
to use wcs with Angular or React. For other frameworks, StencilJS offers many integrations with different JS frameworks.
|
|
91
|
+
You can refer to the [official WCS documentation](https://wcs.dev.sncf/?path=/docs/documentation-integrations-framework-integrations--documentation)
|
|
92
|
+
to use the lib with Angular or React. For other, StencilJS offers many integrations with different JS frameworks.
|
|
62
93
|
|
|
63
94
|
You can refer to [their official documentation](https://stenciljs.com/docs/overview) to add WCS to your project.
|
|
64
95
|
|
|
65
|
-
After added wcs dependencies, you must add Avenir and icons font faces like so :
|
|
66
|
-
|
|
67
|
-
```css
|
|
68
|
-
@font-face {
|
|
69
|
-
font-family: Avenir;
|
|
70
|
-
src: url("your-custom-path/avenir-lighter.woff");
|
|
71
|
-
font-weight: 300;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@font-face {
|
|
75
|
-
font-family: Avenir;
|
|
76
|
-
src: url("your-custom-path/avenir-book.woff");
|
|
77
|
-
font-weight: 400;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@font-face {
|
|
81
|
-
font-family: Avenir;
|
|
82
|
-
src: url("your-custom-path/avenir-medium.woff");
|
|
83
|
-
font-weight: 500;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@font-face {
|
|
87
|
-
font-family: Avenir;
|
|
88
|
-
src: url("your-custom-path/avenir-black.woff");
|
|
89
|
-
font-weight: 900;
|
|
90
|
-
}
|
|
91
|
-
@font-face {
|
|
92
|
-
font-family: "icons";
|
|
93
|
-
src: url("your-custom-path/icons.eot?#iefix") format("embedded-opentype"),
|
|
94
|
-
url("your-custom-path/icons.woff2") format("woff2"),
|
|
95
|
-
url("your-custom-path/icons.woff") format("woff"),
|
|
96
|
-
url("your-custom-path/icons.ttf") format("truetype"),
|
|
97
|
-
url("your-custom-path/icons.svg#icons") format("svg");
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
96
|
|
|
101
97
|
## Contributing
|
|
102
98
|
|
|
103
99
|
### Bug, Feature request, etc...
|
|
104
100
|
|
|
105
|
-
Don't hesitate to fill in an issue and we'll discuss about it.
|
|
106
|
-
|
|
107
|
-
### Dev requirements
|
|
108
|
-
|
|
109
|
-
- Minimum node version : 10.16
|
|
101
|
+
Don't hesitate to [fill in an issue](https://gitlab.com/SNCF/wcs/-/issues/new) and we'll discuss about it.
|
|
102
|
+
If you want to contribute code, please fill in an issue first so we can handle it properly.
|
|
110
103
|
|
|
111
104
|
### Starting the project
|
|
112
105
|
|
|
@@ -139,30 +132,6 @@ npm run test:e2e path_to_tests_file
|
|
|
139
132
|
npm run test:e2e src/components/tabs/tabs.e2e.ts
|
|
140
133
|
```
|
|
141
134
|
|
|
142
|
-
###
|
|
135
|
+
### License
|
|
143
136
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
# Make sure you're on develop branch
|
|
148
|
-
git checkout develop
|
|
149
|
-
# Pull latest changes
|
|
150
|
-
git pull
|
|
151
|
-
# Build the project to make sure that all automatically generated files are up-to-date
|
|
152
|
-
npm run build
|
|
153
|
-
# Update the changelog by replacing the 'Unreleased' section with the released version number
|
|
154
|
-
# Commit your changes
|
|
155
|
-
git add . && git commit -m "chore: prepare next release"
|
|
156
|
-
# Go on master
|
|
157
|
-
git checkout master
|
|
158
|
-
# Merge latest changes
|
|
159
|
-
git merge develop
|
|
160
|
-
# Do the release, we use semantic versioning for choosing release number
|
|
161
|
-
npm run update-version -- --version <major|minor|patch>
|
|
162
|
-
# Go on develop
|
|
163
|
-
git checkout develop
|
|
164
|
-
# Merge the release
|
|
165
|
-
git merge master
|
|
166
|
-
# Push the changes
|
|
167
|
-
git push
|
|
168
|
-
```
|
|
137
|
+
[MIT](https://gitlab.com/SNCF/wcs/-/blob/master/LICENSE)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function isElementFocused(element) {
|
|
4
|
+
return element === document.activeElement;
|
|
5
|
+
}
|
|
6
|
+
const wcsFocusableElements = [
|
|
7
|
+
'wcs-select',
|
|
8
|
+
'wcs-select-option',
|
|
9
|
+
'wcs-dropdown',
|
|
10
|
+
'wcs-dropdown-item',
|
|
11
|
+
'wcs-nav-item',
|
|
12
|
+
'wcs-button',
|
|
13
|
+
'wcs-input',
|
|
14
|
+
'wcs-textarea',
|
|
15
|
+
'wcs-checkbox',
|
|
16
|
+
'wcs-radio',
|
|
17
|
+
'wcs-switch',
|
|
18
|
+
'wcs-tab',
|
|
19
|
+
'wcs-counter',
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if the provided element is part of the wcsFocusableElements list
|
|
23
|
+
*/
|
|
24
|
+
function isWcsFocusableElement(element) {
|
|
25
|
+
return wcsFocusableElements.includes(element.tagName.toLowerCase());
|
|
26
|
+
}
|
|
27
|
+
function isFocusable(element) {
|
|
28
|
+
if (parseInt(element.getAttribute('tabindex')) < 0) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (element.disabled) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const boundingRect = element.getBoundingClientRect();
|
|
35
|
+
if (boundingRect.bottom === 0 &&
|
|
36
|
+
boundingRect.top === 0 &&
|
|
37
|
+
boundingRect.left === 0 &&
|
|
38
|
+
boundingRect.right === 0 &&
|
|
39
|
+
boundingRect.height === 0 &&
|
|
40
|
+
boundingRect.width === 0 &&
|
|
41
|
+
boundingRect.x === 0 &&
|
|
42
|
+
boundingRect.y === 0) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
if (element.style.display === 'none' ||
|
|
46
|
+
element.style.visibility === 'hidden' ||
|
|
47
|
+
element.style.opacity === 0) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (element.getAttribute('role') === 'button') {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (isWcsFocusableElement(element)) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
// To identify other native focus elements.
|
|
57
|
+
switch (element.nodeName) {
|
|
58
|
+
case 'A':
|
|
59
|
+
return !!element.href && element.rel !== 'ignore';
|
|
60
|
+
case 'INPUT':
|
|
61
|
+
return element.type !== 'hidden';
|
|
62
|
+
case 'BUTTON':
|
|
63
|
+
case 'SELECT':
|
|
64
|
+
case 'TEXTAREA':
|
|
65
|
+
return true;
|
|
66
|
+
default:
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exports.isElementFocused = isElementFocused;
|
|
72
|
+
exports.isFocusable = isFocusable;
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=accessibility-c0c4e648.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"accessibility-c0c4e648.js","mappings":";;SAAgB,gBAAgB,CAAC,OAAoB;EACjD,OAAO,OAAO,KAAK,QAAQ,CAAC,aAAa,CAAC;AAC9C,CAAC;AAEM,MAAM,oBAAoB,GAAG;EAChC,YAAY;EACZ,mBAAmB;EACnB,cAAc;EACd,mBAAmB;EACnB,cAAc;EACd,YAAY;EACZ,WAAW;EACX,cAAc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AAC,IAAI,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC;IACtD,KAAK,OAAO;MACR,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;IACrC,KAAK,QAAQ,CAAC;IACd,KAAK,QAAQ,CAAC;IACd,KAAK,UAAU;MACX,OAAO,IAAI,CAAC;IAChB;MACI,OAAO,KAAK,CAAC;GACpB;AACL;;;;;","names":[],"sources":["./src/utils/accessibility.ts"],"sourcesContent":["export function isElementFocused(element: HTMLElement) {\n return element === document.activeElement;\n}\n\nexport const wcsFocusableElements = [\n 'wcs-select',\n 'wcs-select-option',\n 'wcs-dropdown',\n 'wcs-dropdown-item',\n 'wcs-nav-item',\n 'wcs-button',\n 'wcs-input',\n 'wcs-textarea',\n 'wcs-checkbox',\n 'wcs-radio',\n 'wcs-switch',\n 'wcs-tab',\n 'wcs-counter',\n];\n\n/**\n * Returns true if the provided element is part of the wcsFocusableElements list\n */\nexport function isWcsFocusableElement(element: any): boolean {\n return wcsFocusableElements.includes(element.tagName.toLowerCase());\n}\n\nexport function isFocusable(element: any) {\n if (parseInt(element.getAttribute('tabindex')) < 0) {\n return false;\n }\n if (element.disabled) {\n return false;\n }\n const boundingRect = element.getBoundingClientRect();\n if (\n boundingRect.bottom === 0 &&\n boundingRect.top === 0 &&\n boundingRect.left === 0 &&\n boundingRect.right === 0 &&\n boundingRect.height === 0 &&\n boundingRect.width === 0 &&\n boundingRect.x === 0 &&\n boundingRect.y === 0\n ) {\n return false;\n }\n if (\n element.style.display === 'none' ||\n element.style.visibility === 'hidden' ||\n element.style.opacity === 0\n ) {\n return false;\n }\n if (element.getAttribute('role') === 'button') {\n return true;\n }\n\n if (isWcsFocusableElement(element)) {\n return true;\n }\n\n // To identify other native focus elements.\n switch (element.nodeName) {\n case 'A':\n return !!element.href && element.rel !== 'ignore';\n case 'INPUT':\n return element.type !== 'hidden';\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n default:\n return false;\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const WcsButtonSizeValues = ['s', 'm', 'l']; // as const keyword is used to infer and preserve the exact literal values of an array or object.
|
|
4
|
+
function isWcsButtonSize(size) {
|
|
5
|
+
// @ts-ignore : ignore size type, as it is checked with WcsButtonSizeValues
|
|
6
|
+
return WcsButtonSizeValues.includes(size);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exports.WcsButtonSizeValues = WcsButtonSizeValues;
|
|
10
|
+
exports.isWcsButtonSize = isWcsButtonSize;
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=button-interface-044a8a8a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"button-interface-044a8a8a.js","mappings":";;MAQa,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAW;SAI5C,eAAe,CAAC,IAAY;;EAExC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9C;;;;;","names":[],"sources":["./src/components/button/button-interface.ts"],"sourcesContent":["import { WcsSize } from '../../shared-types';\n\nexport type WcsButtonType = 'button' | 'submit';\n\nexport type WcsButtonShape = 'normal' | 'round' | 'square';\n\nexport type WcsButtonMode = 'plain' | 'stroked' | 'clear';\n\nexport const WcsButtonSizeValues = ['s', 'm', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object.\n\nexport type WcsButtonSize = Extract<WcsSize, typeof WcsButtonSizeValues[number]>;\n\nexport function isWcsButtonSize(size: string): size is WcsButtonSize {\n // @ts-ignore : ignore size type, as it is checked with WcsButtonSizeValues\n return WcsButtonSizeValues.includes(size);\n}\n"],"version":3}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-749d999e.js');
|
|
4
|
+
|
|
5
|
+
const getAccessibleName = (order, double) => {
|
|
6
|
+
switch (order) {
|
|
7
|
+
case 'next':
|
|
8
|
+
return double ? 'Last page' : 'Next page';
|
|
9
|
+
case 'previous':
|
|
10
|
+
default:
|
|
11
|
+
return double ? 'First page' : 'Previous page';
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const GridPaginationArrow = ({ active, order, double = false }) => (index.h("wcs-button", { mode: "clear", shape: "square", size: "s", disabled: !active, title: getAccessibleName(order, double) },
|
|
15
|
+
index.h("svg", { style: { cursor: 'pointer' }, "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "20", viewBox: "0 0 24 20" },
|
|
16
|
+
index.h("style", { type: "text/css" }, `
|
|
17
|
+
.arrow-group {
|
|
18
|
+
transform-origin: 50% 51%;
|
|
19
|
+
transition: transform 175ms ease-in-out;
|
|
20
|
+
}
|
|
21
|
+
.arrow {
|
|
22
|
+
transition: fill 175ms ease-in-out;
|
|
23
|
+
fill: var(--wcs-text-light);
|
|
24
|
+
}
|
|
25
|
+
.second-arrow {
|
|
26
|
+
transform: translateY(-8px);
|
|
27
|
+
}
|
|
28
|
+
.next {
|
|
29
|
+
transform: rotate(90deg);
|
|
30
|
+
}
|
|
31
|
+
.previous {
|
|
32
|
+
transform: rotate(-90deg);
|
|
33
|
+
}
|
|
34
|
+
.active {
|
|
35
|
+
fill: var(--wcs-primary);
|
|
36
|
+
}
|
|
37
|
+
`),
|
|
38
|
+
index.h("g", { fill: "none", class: order + ' arrow-group' },
|
|
39
|
+
index.h("path", { class: (active ? 'active' : '') + ' arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
|
|
40
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })),
|
|
41
|
+
double ?
|
|
42
|
+
index.h("g", { fill: "none", class: order + ' arrow-group' },
|
|
43
|
+
index.h("path", { class: (active ? 'active' : '') + ' arrow second-arrow', d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" }),
|
|
44
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" }))
|
|
45
|
+
: '')));
|
|
46
|
+
|
|
47
|
+
const gridPaginationCss = ":host{display:block;border-style:solid none none;border-width:1px;border-color:var(--wcs-text-light)}.container{display:grid;grid-template-columns:auto auto auto;justify-content:space-between;color:var(--wcs-text-medium);align-items:center}.available-page-sizes{width:auto}.page-management,.page-size,.items-count{display:flex;align-items:center}.page-management{margin:0;padding:0;list-style-type:none}.pagination-arrow{display:flex}.pagination-counter{padding:0 var(--wcs-padding-s)}.items-count span:focus{outline:2px dashed var(--wcs-primary);outline-offset:4px;border-radius:0.1rem}";
|
|
48
|
+
|
|
49
|
+
const GridPagination = class {
|
|
50
|
+
constructor(hostRef) {
|
|
51
|
+
index.registerInstance(this, hostRef);
|
|
52
|
+
this.wcsGridPaginationChange = index.createEvent(this, "wcsGridPaginationChange", 7);
|
|
53
|
+
this.availablePageSizes = [10, 20, 50];
|
|
54
|
+
this.currentPage = GridPagination.INDEX_FIRST_PAGE;
|
|
55
|
+
this.pageSize = this.availablePageSizes[0];
|
|
56
|
+
this.itemsCount = 0;
|
|
57
|
+
this.pageCount = 1;
|
|
58
|
+
}
|
|
59
|
+
lastPage() {
|
|
60
|
+
this.currentPage = this.pageCount - 1;
|
|
61
|
+
this.emitPaginationChange();
|
|
62
|
+
}
|
|
63
|
+
nextPage() {
|
|
64
|
+
if (this.canGoToNextPage()) {
|
|
65
|
+
this.currentPage++;
|
|
66
|
+
this.emitPaginationChange();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
canGoToNextPage() {
|
|
70
|
+
return this.currentPage + 1 < this.pageCount;
|
|
71
|
+
}
|
|
72
|
+
previousPage() {
|
|
73
|
+
if (this.canGoToPreviousPage()) {
|
|
74
|
+
this.currentPage--;
|
|
75
|
+
this.emitPaginationChange();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
canGoToPreviousPage() {
|
|
79
|
+
return this.currentPage > 0;
|
|
80
|
+
}
|
|
81
|
+
firstPage() {
|
|
82
|
+
this.currentPage = 0;
|
|
83
|
+
this.emitPaginationChange();
|
|
84
|
+
}
|
|
85
|
+
onChangePagesize(event) {
|
|
86
|
+
this.pageSize = event.detail.value;
|
|
87
|
+
if (this.currentPage + 1 > this.pageSize) {
|
|
88
|
+
this.currentPage = 0;
|
|
89
|
+
}
|
|
90
|
+
this.emitPaginationChange();
|
|
91
|
+
}
|
|
92
|
+
emitPaginationChange() {
|
|
93
|
+
this.wcsGridPaginationChange.emit({
|
|
94
|
+
pagination: {
|
|
95
|
+
currentPage: this.currentPage,
|
|
96
|
+
pageSize: this.pageSize,
|
|
97
|
+
itemsCount: this.itemsCount,
|
|
98
|
+
pageCount: this.pageCount
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
render() {
|
|
103
|
+
return (index.h(index.Host, { slot: "grid-pagination" }, index.h("div", { class: "container" }, index.h("div", { class: "page-size" }, index.h("wcs-select", { 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) => index.h("wcs-select-option", { value: pageSize }, pageSize))), index.h("span", { id: "elements-per-page-number", hidden: true }, this.pageSize), index.h("span", { id: "elements-per-page-text" }, "\u00A0\u00E9l\u00E9ments par page")), index.h("div", { class: "items-count" }, index.h("span", null, this.itemsCount, " \u00E9l\u00E9ments")), index.h("nav", { "aria-label": "pagination" }, index.h("ul", { class: "page-management" }, index.h("li", { class: "pagination-arrow", onClick: this.firstPage.bind(this) }, index.h(GridPaginationArrow, { active: this.canGoToPreviousPage(), order: "previous", double: true })), index.h("li", { class: "pagination-arrow", onClick: this.previousPage.bind(this) }, index.h(GridPaginationArrow, { active: this.canGoToPreviousPage(), order: "previous" })), index.h("li", { class: "pagination-counter" }, index.h("span", { "aria-label": `Page ${this.currentPage + 1} sur ${this.pageCount}`, "aria-current": "page" }, this.currentPage + 1, " / ", this.pageCount)), index.h("li", { class: "pagination-arrow", onClick: this.nextPage.bind(this) }, index.h(GridPaginationArrow, { active: this.canGoToNextPage(), order: "next" })), index.h("li", { class: "pagination-arrow", onClick: this.lastPage.bind(this) }, index.h(GridPaginationArrow, { active: this.canGoToNextPage(), order: "next", double: true })))))));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
GridPagination.INDEX_FIRST_PAGE = 0;
|
|
107
|
+
GridPagination.style = gridPaginationCss;
|
|
108
|
+
|
|
109
|
+
exports.GridPagination = GridPagination;
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=grid-pagination-3511fdfa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"grid-pagination-3511fdfa.js","mappings":";;;;AAQA,MAAM,iBAAiB,GAAG,CAAC,KAAwC,EAAE,MAA0C;EAC7G,QAAQ,KAAK;IACX,KAAK,MAAM;MACT,OAAO,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;IAC5C,KAAK,UAAU,CAAC;IAChB;MACE,OAAO,MAAM,GAAG,YAAY,GAAG,eAAe,CAAC;GAClD;AACH,CAAC,CAAA;AAEM,MAAM,mBAAmB,GAAkD,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,EAAC,MAChHA,wBAAY,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,QAAQ,EACd,IAAI,EAAC,GAAG,EACR,QAAQ,EAAE,CAAC,MAAM,EACjB,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC;EACjDA,iBAAK,KAAK,EAAE,EAAC,MAAM,EAAE,SAAS,EAAC,iBACd,MAAM,EAClB,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW;IAChFA,mBAAO,IAAI,EAAC,UAAU,IAAE;;;;;;;;;;;;;;;;;;;;;WAqBnB,CAAS;IACdA,eAAG,IAAI,EAAC,MAAM,EAAC,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GAAW,CAAC,CAAC;;;;;","names":["h","Host"],"sources":["./src/components/grid-pagination/grid-pagination-arrow.tsx","./src/components/grid-pagination/grid-pagination.scss?tag=wcs-grid-pagination&encapsulation=shadow","./src/components/grid-pagination/grid-pagination.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\n\ninterface GridPaginationArrowProps {\n active: boolean;\n order: 'next' | 'previous';\n double?: boolean;\n}\n\nconst getAccessibleName = (order: GridPaginationArrowProps['order'], double: GridPaginationArrowProps['double']): string => {\n switch (order) {\n case 'next':\n return double ? 'Last page' : 'Next page';\n case 'previous':\n default:\n return double ? 'First page' : 'Previous page';\n }\n}\n\nexport const GridPaginationArrow: FunctionalComponent<GridPaginationArrowProps> = ({active, order, double = false}) => (\n <wcs-button mode=\"clear\"\n shape=\"square\"\n size=\"s\"\n disabled={!active}\n title={getAccessibleName(order, double)}>\n <svg style={{cursor: 'pointer'}}\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"20\" viewBox=\"0 0 24 20\">\n <style type=\"text/css\">{`\n .arrow-group {\n transform-origin: 50% 51%;\n transition: transform 175ms ease-in-out;\n }\n .arrow {\n transition: fill 175ms ease-in-out;\n fill: var(--wcs-text-light);\n }\n .second-arrow {\n transform: translateY(-8px);\n }\n .next {\n transform: rotate(90deg);\n }\n .previous {\n transform: rotate(-90deg);\n }\n .active {\n fill: var(--wcs-primary);\n }\n `}</style>\n <g fill=\"none\" class={order + ' arrow-group'}>\n <path class={(active ? 'active' : '') + ' arrow'} d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n </g>\n {\n double ?\n <g fill=\"none\" class={order + ' arrow-group'}>\n <path class={(active ? 'active' : '') + ' arrow second-arrow'}\n d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n </g>\n : ''\n }\n </svg>\n </wcs-button>\n);\n","@import '../../style/focus-outline.scss';\n\n:host {\n display: block;\n border-style: solid none none;\n border-width: 1px;\n border-color: var(--wcs-text-light);\n}\n\n.container {\n display: grid;\n grid-template-columns: auto auto auto;\n justify-content: space-between;\n color: var(--wcs-text-medium);\n align-items: center;\n}\n\n.available-page-sizes {\n width: auto;\n}\n\n.page-management, .page-size, .items-count {\n display: flex;\n align-items: center;\n}\n\n.page-management {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.pagination-arrow {\n display: flex;\n}\n\n.pagination-counter {\n padding: 0 var(--wcs-padding-s);\n}\n\n.items-count span:focus {\n @include focus-outline();\n}\n","import {\n Component,\n ComponentInterface,\n Event, EventEmitter,\n h,\n Host,\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';\n\n/**\n * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.\n */\n@Component({\n tag: 'wcs-grid-pagination',\n styleUrl: 'grid-pagination.scss',\n shadow: true\n})\nexport class GridPagination implements ComponentInterface {\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() 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 private lastPage(): void {\n this.currentPage = this.pageCount - 1;\n this.emitPaginationChange();\n }\n\n private nextPage(): void {\n if (this.canGoToNextPage()) {\n this.currentPage++;\n this.emitPaginationChange();\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 }\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 }\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 }\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\">\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"],"version":3}
|
|
@@ -24,7 +24,7 @@ const debounce = (func, wait = 0) => {
|
|
|
24
24
|
/**
|
|
25
25
|
* Elements inside of web components sometimes need to inherit global attributes
|
|
26
26
|
* set on the host. For example, the inner input in `wcs-input` should inherit
|
|
27
|
-
* the `title` attribute that developers set directly on `
|
|
27
|
+
* the `title` attribute that developers set directly on `wcs-input`. This
|
|
28
28
|
* helper function should be called in componentWillLoad and assigned to a variable
|
|
29
29
|
* that is later used in the render function.
|
|
30
30
|
*
|
|
@@ -44,6 +44,78 @@ const inheritAttributes = (el, attributes = []) => {
|
|
|
44
44
|
});
|
|
45
45
|
return attributeObject;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* List of available ARIA attributes + `role`.
|
|
49
|
+
* Removed deprecated attributes.
|
|
50
|
+
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
|
|
51
|
+
*/
|
|
52
|
+
const ariaAttributes = [
|
|
53
|
+
'role',
|
|
54
|
+
'aria-activedescendant',
|
|
55
|
+
'aria-atomic',
|
|
56
|
+
'aria-autocomplete',
|
|
57
|
+
'aria-braillelabel',
|
|
58
|
+
'aria-brailleroledescription',
|
|
59
|
+
'aria-busy',
|
|
60
|
+
'aria-checked',
|
|
61
|
+
'aria-colcount',
|
|
62
|
+
'aria-colindex',
|
|
63
|
+
'aria-colindextext',
|
|
64
|
+
'aria-colspan',
|
|
65
|
+
'aria-controls',
|
|
66
|
+
'aria-current',
|
|
67
|
+
'aria-describedby',
|
|
68
|
+
'aria-description',
|
|
69
|
+
'aria-details',
|
|
70
|
+
'aria-disabled',
|
|
71
|
+
'aria-errormessage',
|
|
72
|
+
'aria-expanded',
|
|
73
|
+
'aria-flowto',
|
|
74
|
+
'aria-haspopup',
|
|
75
|
+
'aria-hidden',
|
|
76
|
+
'aria-invalid',
|
|
77
|
+
'aria-keyshortcuts',
|
|
78
|
+
'aria-label',
|
|
79
|
+
'aria-labelledby',
|
|
80
|
+
'aria-level',
|
|
81
|
+
'aria-live',
|
|
82
|
+
'aria-multiline',
|
|
83
|
+
'aria-multiselectable',
|
|
84
|
+
'aria-orientation',
|
|
85
|
+
'aria-owns',
|
|
86
|
+
'aria-placeholder',
|
|
87
|
+
'aria-posinset',
|
|
88
|
+
'aria-pressed',
|
|
89
|
+
'aria-readonly',
|
|
90
|
+
'aria-relevant',
|
|
91
|
+
'aria-required',
|
|
92
|
+
'aria-roledescription',
|
|
93
|
+
'aria-rowcount',
|
|
94
|
+
'aria-rowindex',
|
|
95
|
+
'aria-rowindextext',
|
|
96
|
+
'aria-rowspan',
|
|
97
|
+
'aria-selected',
|
|
98
|
+
'aria-setsize',
|
|
99
|
+
'aria-sort',
|
|
100
|
+
'aria-valuemax',
|
|
101
|
+
'aria-valuemin',
|
|
102
|
+
'aria-valuenow',
|
|
103
|
+
'aria-valuetext',
|
|
104
|
+
];
|
|
105
|
+
/**
|
|
106
|
+
* Returns an array of aria attributes that should be copied from
|
|
107
|
+
* the shadow host element to a target within the light DOM.
|
|
108
|
+
* @param el The element that the attributes should be copied from.
|
|
109
|
+
* @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.
|
|
110
|
+
* Use this in instances where we manually specify aria attributes on the `<Host>` element.
|
|
111
|
+
*/
|
|
112
|
+
const inheritAriaAttributes = (el, ignoreList) => {
|
|
113
|
+
let attributesToInherit = ariaAttributes;
|
|
114
|
+
if (ignoreList && ignoreList.length > 0) {
|
|
115
|
+
attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));
|
|
116
|
+
}
|
|
117
|
+
return inheritAttributes(el, attributesToInherit);
|
|
118
|
+
};
|
|
47
119
|
const findItemLabel = (componentEl) => {
|
|
48
120
|
const itemEl = componentEl.closest('wcs-form-field');
|
|
49
121
|
if (itemEl) {
|
|
@@ -127,6 +199,7 @@ exports.debounceEvent = debounceEvent;
|
|
|
127
199
|
exports.findItemLabel = findItemLabel;
|
|
128
200
|
exports.generateUniqueId = generateUniqueId;
|
|
129
201
|
exports.hasShadowDom = hasShadowDom;
|
|
202
|
+
exports.inheritAriaAttributes = inheritAriaAttributes;
|
|
130
203
|
exports.inheritAttributes = inheritAttributes;
|
|
131
204
|
exports.isDownArrowKey = isDownArrowKey;
|
|
132
205
|
exports.isElement = isElement;
|
|
@@ -145,4 +218,4 @@ exports.isTabKey = isTabKey;
|
|
|
145
218
|
exports.isUpArrowKey = isUpArrowKey;
|
|
146
219
|
exports.raf = raf;
|
|
147
220
|
|
|
148
|
-
//# sourceMappingURL=helpers-
|
|
221
|
+
//# sourceMappingURL=helpers-6280db6e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"helpers-6280db6e.js","mappings":";;SAEgB,SAAS,CAAC,OAAY;EAClC,OAAO,aAAa,IAAI,OAAO;OACxB,cAAc,IAAI,OAAO,CAAC;AACrC,CAAC;SAEe,YAAY,CAAC,EAAe;EACxC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,IAAI,CAAC,CAAE,EAAU,CAAC,YAAY,CAAC;AACzD,CAAC;MAEY,aAAa,GAAG,CAAC,KAAmB,EAAE,IAAY;EAC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ACxC,OAAO,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AAC/B,CAAC;SAEe,QAAQ,CAAC,GAAkB;EACvC,OAAO,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC;AAC9B,CAAC;SAEe,YAAY,CAAC,GAAkB;EAC3C,OAAO,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC;AACjC,CAAC;SAEe,cAAc,CAAC,GAAkB;EAC7C,OAAO,GAAG,CAAC,GAAG,KAAK,WAAW,CAAC;AACnC,CAAC;SAEe,cAAc,CAAC,GAAkB;EAC7C,OAAO,GAAG,CAAC,GAAG,KAAK,WAAW,CAAC;AACnC,CAAC;SAEe,eAAe,CAAC,GAAkB;EAC9C,OAAO,GAAG,CAAC,GAAG,KAAK,YAAY,CAAC;AACpC,CAAC;SAEe,aAAa,CAAC,GAAkB;EAC5C,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,CAAC;AAClC,CAAC;SAEe,WAAW,CAAC,GAAkB;EAC1C,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;SAEe,QAAQ,CAAC,GAAkB;EACvC,OAAO,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/utils/helpers.ts"],"sourcesContent":["import { EventEmitter } from '@stencil/core';\n\nexport function isElement(element: any): element is Element {\n return 'clientWidth' in element\n && 'clientHeight' in element;\n}\n\nexport function hasShadowDom(el: HTMLElement) {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n}\n\nexport const debounceEvent = (event: EventEmitter, wait: number): EventEmitter => {\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait)\n } as EventEmitter;\n};\n\nexport const debounce = (func: (...args: any[]) => void, wait = 0) => {\n let timer: any;\n return (...args: any[]): any => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `wcs-input` should inherit\n * the `title` attribute that developers set directly on `wcs-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {};\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n\n/**\n * List of available ARIA attributes + `role`.\n * Removed deprecated attributes.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes\n */\nconst ariaAttributes = [\n 'role',\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n];\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n * @param el The element that the attributes should be copied from.\n * @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.\n * Use this in instances where we manually specify aria attributes on the `<Host>` element.\n */\nexport const inheritAriaAttributes = (el: HTMLElement, ignoreList?: string[]) => {\n let attributesToInherit = ariaAttributes;\n if (ignoreList && ignoreList.length > 0) {\n attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));\n }\n return inheritAttributes(el, attributesToInherit);\n};\n\nexport const findItemLabel = (componentEl: HTMLElement): HTMLWcsLabelElement | null => {\n const itemEl = componentEl.closest('wcs-form-field');\n if (itemEl) {\n return itemEl.querySelector('wcs-label');\n }\n return null;\n};\n\ndeclare const __zone_symbol__requestAnimationFrame: any;\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nexport const raf = (h: any) => {\n if (typeof __zone_symbol__requestAnimationFrame === 'function') {\n return __zone_symbol__requestAnimationFrame(h);\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h);\n }\n return setTimeout(h);\n};\n\n/**\n * Return true if the mouseEvent click is inside the given HTML element\n */\nexport const clickInsideElement = (event: MouseEvent, element: HTMLElement): boolean => {\n return event.x >= element.getBoundingClientRect().x && event.x <= element.getBoundingClientRect().x + element.getBoundingClientRect().width\n && event.y >= element.getBoundingClientRect().y && event.y <= element.getBoundingClientRect().y + element.getBoundingClientRect().height;\n}\n\n\nexport const clickTargetIsElementOrChildren = (mouseEvent: MouseEvent, element: HTMLElement) => {\n return mouseEvent.target instanceof Node\n && element.contains(mouseEvent.target);\n}\n\nexport function generateUniqueId(componentName: string): string {\n return componentName + \"-\" + Math.random().toString(36);\n}\n\nexport function isKeyup(evt: KeyboardEvent) {\n return evt.code === 'ArrowUp';\n}\n\nexport function isKeydown(evt: KeyboardEvent) {\n return evt.code === 'ArrowDown';\n}\n\nexport function isEscapeKey(evt: KeyboardEvent) {\n return evt.code === 'Escape';\n}\n\nexport function isSpaceKey(evt: KeyboardEvent) {\n return evt.code === 'Space';\n}\n\nexport function isEnterKey(evt: KeyboardEvent) {\n return evt.key === 'Enter';\n}\n\nexport function isHomeKey(evt: KeyboardEvent) {\n return evt.code === 'Home';\n}\n\nexport function isEndKey(evt: KeyboardEvent) {\n return evt.code === 'End';\n}\n\nexport function isUpArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowUp';\n}\n\nexport function isDownArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowDown';\n}\n\nexport function isLeftArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowLeft';\n}\n\nexport function isRightArrowKey(evt: KeyboardEvent) {\n return evt.key === 'ArrowRight';\n}\n\nexport function isPageDownKey(evt: KeyboardEvent) {\n return evt.key === 'PageDown';\n}\n\nexport function isPageUpKey(evt: KeyboardEvent) {\n return evt.key === 'PageUp';\n}\n\nexport function isTabKey(evt: KeyboardEvent) {\n return evt.key === 'Tab';\n}\n\nexport function isCtrlA(evt: KeyboardEvent) {\n return evt.key === 'a' && evt.ctrlKey;\n}"],"version":3}
|
|
@@ -1407,6 +1407,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1407
1407
|
promise = safeCall(instance, 'componentWillUpdate');
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
|
+
{
|
|
1411
|
+
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1412
|
+
}
|
|
1410
1413
|
endSchedule();
|
|
1411
1414
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1412
1415
|
};
|
|
@@ -2153,4 +2156,4 @@ exports.readTask = readTask;
|
|
|
2153
2156
|
exports.registerInstance = registerInstance;
|
|
2154
2157
|
exports.setNonce = setNonce;
|
|
2155
2158
|
|
|
2156
|
-
//# sourceMappingURL=index-
|
|
2159
|
+
//# sourceMappingURL=index-749d999e.js.map
|