wcs-core 7.0.0 → 7.1.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/design-tokens/dist/sncf-holding-root-scoped.css +589 -0
- package/design-tokens/dist/sncf-holding.css +13 -0
- package/design-tokens/dist/sncf-holding.json +54 -0
- package/design-tokens/dist/sncf-reseau-root-scoped.css +652 -0
- package/design-tokens/dist/sncf-reseau.css +10 -0
- package/design-tokens/dist/sncf-reseau.json +54 -0
- package/design-tokens/dist/sncf-voyageurs-root-scoped.css +550 -0
- package/design-tokens/dist/sncf-voyageurs.css +13 -0
- package/design-tokens/dist/sncf-voyageurs.json +54 -0
- package/dist/cjs/{com-nav-utils-9f6c99b8.js → com-nav-utils-ff4f0bef.js} +2 -2
- package/dist/cjs/{com-nav-utils-9f6c99b8.js.map → com-nav-utils-ff4f0bef.js.map} +1 -1
- package/dist/cjs/control-component-interface-d9b68f28.js +43 -0
- package/dist/cjs/control-component-interface-d9b68f28.js.map +1 -0
- package/dist/cjs/{grid-pagination-2c752b22.js → grid-pagination-e4f29c78.js} +3 -3
- package/dist/cjs/{grid-pagination-2c752b22.js.map → grid-pagination-e4f29c78.js.map} +1 -1
- package/dist/cjs/{helpers-871f5a3d.js → helpers-2f1a8ddc.js} +44 -1
- package/dist/cjs/helpers-2f1a8ddc.js.map +1 -0
- package/dist/cjs/{keyboard-event-d2c81ce0.js → keyboard-event-40ecdc27.js} +2 -2
- package/dist/cjs/{keyboard-event-d2c81ce0.js.map → keyboard-event-40ecdc27.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/wcs-accordion-panel.cjs.entry.js +1 -1
- package/dist/cjs/wcs-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/wcs-action-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-badge.cjs.entry.js +1 -1
- package/dist/cjs/wcs-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/wcs-button_2.cjs.entry.js +3 -3
- package/dist/cjs/wcs-button_2.cjs.entry.js.map +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-item.cjs.entry.js +1 -1
- package/dist/cjs/wcs-com-nav-item.cjs.entry.js.map +1 -1
- 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 +13 -5
- package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/wcs-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-editable-field.cjs.entry.js +81 -55
- package/dist/cjs/wcs-editable-field.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-error_3.cjs.entry.js +209 -0
- package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -0
- 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-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-galactic-menu.cjs.entry.js +4 -4
- package/dist/cjs/wcs-galactic-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-galactic.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid-column.cjs.entry.js +2 -2
- 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 +6 -6
- package/dist/cjs/wcs-header.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/wcs-input.cjs.entry.js +5 -3
- 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-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-mat-icon.cjs.entry.js +2 -2
- package/dist/cjs/wcs-modal.cjs.entry.js +17 -3
- package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-native-select.cjs.entry.js +1 -1
- package/dist/cjs/wcs-nav-item.cjs.entry.js +3 -3
- package/dist/cjs/wcs-nav-item.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-nav.cjs.entry.js +2 -2
- package/dist/cjs/wcs-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/wcs-progress-radial.cjs.entry.js +3 -3
- package/dist/cjs/wcs-radio-group.cjs.entry.js +5 -2
- package/dist/cjs/wcs-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
- package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-select_2.cjs.entry.js +8 -7
- 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 +6 -2
- package/dist/cjs/wcs-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tab.cjs.entry.js +1 -1
- package/dist/cjs/wcs-tabs.cjs.entry.js +2 -2
- package/dist/cjs/wcs-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
- package/dist/cjs/wcs-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tooltip.cjs.entry.js +8 -4
- package/dist/cjs/wcs-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs.cjs.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +2 -2
- package/dist/collection/components/action-bar/action-bar.js.map +1 -1
- package/dist/collection/components/badge/badge.css +1 -0
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.js +22 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/com-nav-item/com-nav-item.css +2 -1
- package/dist/collection/components/counter/counter.css +3 -0
- package/dist/collection/components/counter/counter.js +13 -5
- package/dist/collection/components/counter/counter.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.js +2 -2
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/editable-field/editable-field.css +31 -10
- package/dist/collection/components/editable-field/editable-field.e2e.js +176 -0
- package/dist/collection/components/editable-field/editable-field.e2e.js.map +1 -0
- package/dist/collection/components/editable-field/editable-field.js +83 -57
- 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/field/field.js +1 -1
- package/dist/collection/components/field-content/field-content.js +1 -1
- package/dist/collection/components/field-label/field-label.js +1 -1
- package/dist/collection/components/footer/footer.js +1 -1
- package/dist/collection/components/footer/footer.js.map +1 -1
- package/dist/collection/components/form-field/form-field.css +39 -12
- package/dist/collection/components/form-field/form-field.e2e.js +122 -0
- package/dist/collection/components/form-field/form-field.e2e.js.map +1 -0
- package/dist/collection/components/form-field/form-field.js +29 -12
- package/dist/collection/components/form-field/form-field.js.map +1 -1
- package/dist/collection/components/galactic/galactic.js +1 -1
- package/dist/collection/components/galactic-menu/galactic-menu.css +1 -0
- package/dist/collection/components/galactic-menu/galactic-menu.js +2 -2
- package/dist/collection/components/grid/grid.js +3 -3
- package/dist/collection/components/grid-column/grid-column.js +2 -2
- package/dist/collection/components/grid-column/grid-column.js.map +1 -1
- package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +1 -1
- package/dist/collection/components/grid-pagination/grid-pagination.js +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.css +10 -1
- package/dist/collection/components/input/input.js +42 -3
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/label/label.js +1 -1
- package/dist/collection/components/list-item/list-item.js +7 -2
- package/dist/collection/components/list-item/list-item.js.map +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 +58 -2
- package/dist/collection/components/modal/modal.js.map +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.css +24 -6
- 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.js +2 -2
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/radio-group/radio-group.js +39 -2
- package/dist/collection/components/radio-group/radio-group.js.map +1 -1
- package/dist/collection/components/select/select.js +22 -3
- 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 +23 -2
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/tabs/tabs.js.map +1 -1
- package/dist/collection/components/textarea/textarea.js +3 -3
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +10 -8
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/utils/control-component-interface.js +37 -0
- package/dist/collection/utils/control-component-interface.js.map +1 -0
- package/dist/collection/utils/helpers.js +40 -0
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/esm/{com-nav-utils-1366c701.js → com-nav-utils-ee7bf77c.js} +2 -2
- package/dist/esm/{com-nav-utils-1366c701.js.map → com-nav-utils-ee7bf77c.js.map} +1 -1
- package/dist/esm/control-component-interface-9f09e520.js +40 -0
- package/dist/esm/control-component-interface-9f09e520.js.map +1 -0
- package/dist/esm/{grid-pagination-421689be.js → grid-pagination-976a86e9.js} +3 -3
- package/dist/esm/{grid-pagination-421689be.js.map → grid-pagination-976a86e9.js.map} +1 -1
- package/dist/esm/{helpers-f137ec8d.js → helpers-ece6a2d3.js} +42 -2
- package/dist/esm/helpers-ece6a2d3.js.map +1 -0
- package/dist/esm/{keyboard-event-bdea408a.js → keyboard-event-26b65ae5.js} +2 -2
- package/dist/esm/{keyboard-event-bdea408a.js.map → keyboard-event-26b65ae5.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-action-bar.entry.js +1 -1
- package/dist/esm/wcs-action-bar.entry.js.map +1 -1
- package/dist/esm/wcs-badge.entry.js +1 -1
- package/dist/esm/wcs-badge.entry.js.map +1 -1
- package/dist/esm/wcs-breadcrumb.entry.js +1 -1
- package/dist/esm/wcs-button_2.entry.js +3 -3
- package/dist/esm/wcs-button_2.entry.js.map +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-item.entry.js +1 -1
- package/dist/esm/wcs-com-nav-item.entry.js.map +1 -1
- 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 +13 -5
- package/dist/esm/wcs-counter.entry.js.map +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 +81 -55
- package/dist/esm/wcs-editable-field.entry.js.map +1 -1
- package/dist/esm/wcs-error_3.entry.js +203 -0
- package/dist/esm/wcs-error_3.entry.js.map +1 -0
- 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-footer.entry.js.map +1 -1
- package/dist/esm/wcs-galactic-menu.entry.js +4 -4
- package/dist/esm/wcs-galactic-menu.entry.js.map +1 -1
- package/dist/esm/wcs-galactic.entry.js +1 -1
- package/dist/esm/wcs-grid-column.entry.js +2 -2
- 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 +6 -6
- 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 +5 -3
- 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-list-item.entry.js.map +1 -1
- package/dist/esm/wcs-mat-icon.entry.js +2 -2
- package/dist/esm/wcs-modal.entry.js +17 -3
- package/dist/esm/wcs-modal.entry.js.map +1 -1
- package/dist/esm/wcs-native-select.entry.js +1 -1
- package/dist/esm/wcs-nav-item.entry.js +3 -3
- package/dist/esm/wcs-nav-item.entry.js.map +1 -1
- 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 +5 -2
- package/dist/esm/wcs-radio-group.entry.js.map +1 -1
- package/dist/esm/wcs-radio.entry.js +2 -2
- package/dist/esm/wcs-radio.entry.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +8 -7
- 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 +6 -2
- package/dist/esm/wcs-switch.entry.js.map +1 -1
- package/dist/esm/wcs-tab.entry.js +1 -1
- package/dist/esm/wcs-tabs.entry.js +2 -2
- package/dist/esm/wcs-tabs.entry.js.map +1 -1
- package/dist/esm/wcs-textarea.entry.js +2 -2
- package/dist/esm/wcs-textarea.entry.js.map +1 -1
- package/dist/esm/wcs-tooltip.entry.js +8 -4
- package/dist/esm/wcs-tooltip.entry.js.map +1 -1
- package/dist/esm/wcs.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +3 -1
- package/dist/types/components/counter/counter.d.ts +6 -0
- package/dist/types/components/editable-field/editable-field.d.ts +23 -9
- package/dist/types/components/input/input.d.ts +3 -0
- package/dist/types/components/list-item/list-item.d.ts +5 -0
- package/dist/types/components/modal/modal.d.ts +23 -0
- package/dist/types/components/radio-group/radio-group.d.ts +3 -1
- package/dist/types/components/select/select.d.ts +4 -0
- package/dist/types/components/switch/switch.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip.d.ts +3 -5
- package/dist/types/components.d.ts +87 -16
- package/dist/types/utils/control-component-interface.d.ts +22 -0
- package/dist/types/utils/helpers.d.ts +21 -0
- package/dist/wcs/p-0017d766.js +2 -0
- package/dist/wcs/{p-45a6934d.entry.js → p-0ffdfc10.entry.js} +2 -2
- package/dist/wcs/{p-9f23c49e.entry.js → p-13090618.entry.js} +2 -2
- package/dist/wcs/{p-8f0e093f.entry.js → p-13e50077.entry.js} +2 -2
- package/dist/wcs/p-1438530e.entry.js +2 -0
- package/dist/wcs/p-1438530e.entry.js.map +1 -0
- package/dist/wcs/{p-2305f257.entry.js → p-16dd21cf.entry.js} +2 -2
- package/dist/wcs/{p-85a5bbb7.entry.js → p-206c01d5.entry.js} +2 -2
- package/dist/wcs/{p-85a5bbb7.entry.js.map → p-206c01d5.entry.js.map} +1 -1
- package/dist/wcs/{p-09d0a296.entry.js → p-21b964cd.entry.js} +3 -3
- package/dist/wcs/p-21b964cd.entry.js.map +1 -0
- package/dist/wcs/p-21d2f06f.entry.js +2 -0
- package/dist/wcs/p-21d2f06f.entry.js.map +1 -0
- package/dist/wcs/{p-2add4d4d.entry.js → p-258855a1.entry.js} +2 -2
- package/dist/wcs/{p-2c9e20c1.entry.js → p-294732f7.entry.js} +2 -2
- package/dist/wcs/{p-15ff9f93.entry.js → p-29f5b974.entry.js} +2 -2
- package/dist/wcs/{p-1ab0d13b.entry.js → p-2adf00be.entry.js} +2 -2
- package/dist/wcs/p-2adf00be.entry.js.map +1 -0
- package/dist/wcs/p-37800935.entry.js +2 -0
- package/dist/wcs/{p-76f07dbd.entry.js → p-388e6d75.entry.js} +2 -2
- package/dist/wcs/{p-8bd1b9ce.entry.js → p-43d70995.entry.js} +2 -2
- package/dist/wcs/{p-9553d60e.entry.js → p-4661290b.entry.js} +2 -2
- package/dist/wcs/{p-9553d60e.entry.js.map → p-4661290b.entry.js.map} +1 -1
- package/dist/wcs/{p-d2a4f609.entry.js → p-4dc52a25.entry.js} +2 -2
- package/dist/wcs/{p-25b96cde.entry.js → p-50523b53.entry.js} +2 -2
- package/dist/wcs/p-50523b53.entry.js.map +1 -0
- package/dist/wcs/p-52d77e1f.js +2 -0
- package/dist/wcs/p-52d77e1f.js.map +1 -0
- package/dist/wcs/p-5974be61.entry.js +2 -0
- package/dist/wcs/p-5974be61.entry.js.map +1 -0
- package/dist/wcs/{p-0fa370d7.entry.js → p-5bf73e05.entry.js} +3 -3
- package/dist/wcs/{p-0fa370d7.entry.js.map → p-5bf73e05.entry.js.map} +1 -1
- package/dist/wcs/{p-e19308cf.entry.js → p-5d5f50ed.entry.js} +2 -2
- package/dist/wcs/{p-94ff8939.entry.js → p-5de993d7.entry.js} +2 -2
- package/dist/wcs/p-5de993d7.entry.js.map +1 -0
- package/dist/wcs/{p-a788b5bd.entry.js → p-619e1110.entry.js} +2 -2
- package/dist/wcs/{p-9e03b379.entry.js → p-694724a2.entry.js} +2 -2
- package/dist/wcs/{p-f8d2be83.entry.js → p-6b06d2e7.entry.js} +2 -2
- package/dist/wcs/p-6f5d570a.entry.js +2 -0
- package/dist/wcs/p-6f5d570a.entry.js.map +1 -0
- package/dist/wcs/p-71db0ed5.entry.js +2 -0
- package/dist/wcs/{p-209145de.entry.js → p-76c92e22.entry.js} +2 -2
- package/dist/wcs/{p-f06aa79d.entry.js → p-796e690d.entry.js} +2 -2
- package/dist/wcs/{p-f06aa79d.entry.js.map → p-796e690d.entry.js.map} +1 -1
- package/dist/wcs/{p-97cbbcfc.entry.js → p-7d665a7e.entry.js} +2 -2
- package/dist/wcs/p-89b8c724.js +2 -0
- package/dist/wcs/{p-412b0021.js → p-8fcceaf1.js} +2 -2
- package/dist/wcs/p-9243a323.entry.js +2 -0
- package/dist/wcs/p-9243a323.entry.js.map +1 -0
- package/dist/wcs/p-94aa269f.entry.js +2 -0
- package/dist/wcs/p-94aa269f.entry.js.map +1 -0
- package/dist/wcs/{p-87b69cac.entry.js → p-9554196c.entry.js} +2 -2
- package/dist/wcs/{p-80a23f9c.entry.js → p-96bff8fe.entry.js} +2 -2
- package/dist/wcs/{p-80a23f9c.entry.js.map → p-96bff8fe.entry.js.map} +1 -1
- package/dist/wcs/{p-fa507e06.entry.js → p-9ad23e83.entry.js} +2 -2
- package/dist/wcs/{p-5ea2aba5.entry.js → p-9c012aae.entry.js} +2 -2
- package/dist/wcs/p-9dc3f9a5.entry.js +2 -0
- package/dist/wcs/p-9dc3f9a5.entry.js.map +1 -0
- package/dist/wcs/p-9eb66fa9.entry.js +2 -0
- package/dist/wcs/p-a7468a3a.js +2 -0
- package/dist/wcs/p-a7468a3a.js.map +1 -0
- package/dist/wcs/{p-4982f96c.entry.js → p-a7891233.entry.js} +2 -2
- package/dist/wcs/p-b2080509.entry.js +2 -0
- package/dist/wcs/{p-806315e6.entry.js.map → p-b2080509.entry.js.map} +1 -1
- package/dist/wcs/p-b96f4921.entry.js +2 -0
- package/dist/wcs/p-b96f4921.entry.js.map +1 -0
- package/dist/wcs/{p-276b8125.entry.js → p-c2d35aa6.entry.js} +3 -3
- package/dist/wcs/{p-276b8125.entry.js.map → p-c2d35aa6.entry.js.map} +1 -1
- package/dist/wcs/p-c752b85a.entry.js +2 -0
- package/dist/wcs/{p-b0f8190f.entry.js → p-d895ffb4.entry.js} +2 -2
- package/dist/wcs/{p-1e5aa960.entry.js → p-d9525519.entry.js} +2 -2
- package/dist/wcs/p-d9525519.entry.js.map +1 -0
- package/dist/wcs/{p-db81b74f.entry.js → p-da4636fa.entry.js} +2 -2
- package/dist/wcs/p-da4636fa.entry.js.map +1 -0
- package/dist/wcs/p-dd60a6db.entry.js +2 -0
- package/dist/wcs/p-dd60a6db.entry.js.map +1 -0
- package/dist/wcs/p-dddcd685.entry.js +2 -0
- package/dist/wcs/p-dddcd685.entry.js.map +1 -0
- package/dist/wcs/p-e36b2ad1.entry.js +2 -0
- package/dist/wcs/p-f87636f6.entry.js +2 -0
- package/dist/wcs/p-f87636f6.entry.js.map +1 -0
- package/dist/wcs/p-fc115de4.entry.js +2 -0
- package/dist/wcs/wcs.esm.js +1 -1
- package/dist/wcs/wcs.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/helpers-871f5a3d.js.map +0 -1
- package/dist/cjs/wcs-error_2.cjs.entry.js +0 -168
- package/dist/cjs/wcs-error_2.cjs.entry.js.map +0 -1
- package/dist/cjs/wcs-label.cjs.entry.js +0 -33
- package/dist/cjs/wcs-label.cjs.entry.js.map +0 -1
- package/dist/esm/helpers-f137ec8d.js.map +0 -1
- package/dist/esm/wcs-error_2.entry.js +0 -163
- package/dist/esm/wcs-error_2.entry.js.map +0 -1
- package/dist/esm/wcs-label.entry.js +0 -29
- package/dist/esm/wcs-label.entry.js.map +0 -1
- package/dist/wcs/p-08e86d69.entry.js +0 -2
- package/dist/wcs/p-08e86d69.entry.js.map +0 -1
- package/dist/wcs/p-09d0a296.entry.js.map +0 -1
- package/dist/wcs/p-0fdaec9e.entry.js +0 -2
- package/dist/wcs/p-0fdaec9e.entry.js.map +0 -1
- package/dist/wcs/p-19c77b5c.entry.js +0 -2
- package/dist/wcs/p-1ab0d13b.entry.js.map +0 -1
- package/dist/wcs/p-1e5aa960.entry.js.map +0 -1
- package/dist/wcs/p-25b96cde.entry.js.map +0 -1
- package/dist/wcs/p-400a71d7.entry.js +0 -2
- package/dist/wcs/p-4ca7c59f.entry.js +0 -2
- package/dist/wcs/p-4ca7c59f.entry.js.map +0 -1
- package/dist/wcs/p-4d6d1d14.js +0 -2
- package/dist/wcs/p-52cd0abb.entry.js +0 -2
- package/dist/wcs/p-52cd0abb.entry.js.map +0 -1
- package/dist/wcs/p-5f517eb5.entry.js +0 -2
- package/dist/wcs/p-806315e6.entry.js +0 -2
- package/dist/wcs/p-8780a429.entry.js +0 -2
- package/dist/wcs/p-8780a429.entry.js.map +0 -1
- package/dist/wcs/p-94ff8939.entry.js.map +0 -1
- package/dist/wcs/p-985c4cf2.entry.js +0 -2
- package/dist/wcs/p-985c4cf2.entry.js.map +0 -1
- package/dist/wcs/p-a3aece7a.js +0 -2
- package/dist/wcs/p-a3aece7a.js.map +0 -1
- package/dist/wcs/p-a66a4289.entry.js +0 -2
- package/dist/wcs/p-bf31245c.entry.js +0 -2
- package/dist/wcs/p-bf31245c.entry.js.map +0 -1
- package/dist/wcs/p-cd592a00.entry.js +0 -2
- package/dist/wcs/p-cd592a00.entry.js.map +0 -1
- package/dist/wcs/p-d42831b2.entry.js +0 -2
- package/dist/wcs/p-d42831b2.entry.js.map +0 -1
- package/dist/wcs/p-d7acbf01.js +0 -2
- package/dist/wcs/p-db81b74f.entry.js.map +0 -1
- package/dist/wcs/p-dbbf0980.entry.js +0 -2
- package/dist/wcs/p-dbbf0980.entry.js.map +0 -1
- package/dist/wcs/p-e64d7437.entry.js +0 -2
- package/dist/wcs/p-e86575d3.entry.js +0 -2
- package/dist/wcs/p-e86575d3.entry.js.map +0 -1
- package/dist/wcs/p-f264d46f.entry.js +0 -2
- package/dist/wcs/p-fd9e731d.entry.js +0 -2
- package/dist/wcs/p-fd9e731d.entry.js.map +0 -1
- /package/dist/wcs/{p-d7acbf01.js.map → p-0017d766.js.map} +0 -0
- /package/dist/wcs/{p-45a6934d.entry.js.map → p-0ffdfc10.entry.js.map} +0 -0
- /package/dist/wcs/{p-9f23c49e.entry.js.map → p-13090618.entry.js.map} +0 -0
- /package/dist/wcs/{p-8f0e093f.entry.js.map → p-13e50077.entry.js.map} +0 -0
- /package/dist/wcs/{p-2305f257.entry.js.map → p-16dd21cf.entry.js.map} +0 -0
- /package/dist/wcs/{p-2add4d4d.entry.js.map → p-258855a1.entry.js.map} +0 -0
- /package/dist/wcs/{p-2c9e20c1.entry.js.map → p-294732f7.entry.js.map} +0 -0
- /package/dist/wcs/{p-15ff9f93.entry.js.map → p-29f5b974.entry.js.map} +0 -0
- /package/dist/wcs/{p-e64d7437.entry.js.map → p-37800935.entry.js.map} +0 -0
- /package/dist/wcs/{p-76f07dbd.entry.js.map → p-388e6d75.entry.js.map} +0 -0
- /package/dist/wcs/{p-8bd1b9ce.entry.js.map → p-43d70995.entry.js.map} +0 -0
- /package/dist/wcs/{p-d2a4f609.entry.js.map → p-4dc52a25.entry.js.map} +0 -0
- /package/dist/wcs/{p-e19308cf.entry.js.map → p-5d5f50ed.entry.js.map} +0 -0
- /package/dist/wcs/{p-a788b5bd.entry.js.map → p-619e1110.entry.js.map} +0 -0
- /package/dist/wcs/{p-9e03b379.entry.js.map → p-694724a2.entry.js.map} +0 -0
- /package/dist/wcs/{p-f8d2be83.entry.js.map → p-6b06d2e7.entry.js.map} +0 -0
- /package/dist/wcs/{p-5f517eb5.entry.js.map → p-71db0ed5.entry.js.map} +0 -0
- /package/dist/wcs/{p-209145de.entry.js.map → p-76c92e22.entry.js.map} +0 -0
- /package/dist/wcs/{p-97cbbcfc.entry.js.map → p-7d665a7e.entry.js.map} +0 -0
- /package/dist/wcs/{p-4d6d1d14.js.map → p-89b8c724.js.map} +0 -0
- /package/dist/wcs/{p-412b0021.js.map → p-8fcceaf1.js.map} +0 -0
- /package/dist/wcs/{p-87b69cac.entry.js.map → p-9554196c.entry.js.map} +0 -0
- /package/dist/wcs/{p-fa507e06.entry.js.map → p-9ad23e83.entry.js.map} +0 -0
- /package/dist/wcs/{p-5ea2aba5.entry.js.map → p-9c012aae.entry.js.map} +0 -0
- /package/dist/wcs/{p-19c77b5c.entry.js.map → p-9eb66fa9.entry.js.map} +0 -0
- /package/dist/wcs/{p-4982f96c.entry.js.map → p-a7891233.entry.js.map} +0 -0
- /package/dist/wcs/{p-400a71d7.entry.js.map → p-c752b85a.entry.js.map} +0 -0
- /package/dist/wcs/{p-b0f8190f.entry.js.map → p-d895ffb4.entry.js.map} +0 -0
- /package/dist/wcs/{p-f264d46f.entry.js.map → p-e36b2ad1.entry.js.map} +0 -0
- /package/dist/wcs/{p-a66a4289.entry.js.map → p-fc115de4.entry.js.map} +0 -0
|
@@ -40,6 +40,7 @@ const INPUT_INHERITED_ATTRS = ['tabindex', 'title'];
|
|
|
40
40
|
* @cssprop --wcs-input-border-color-default - default border color of the input when not focused
|
|
41
41
|
* @cssprop --wcs-input-border-color-disabled - border color of the input when disabled
|
|
42
42
|
* @cssprop --wcs-input-border-color-focus - border color of the input when focused
|
|
43
|
+
* @cssprop --wcs-input-reveal-password-button-border-color-focus - border color of the show/hide password button when focused
|
|
43
44
|
* @cssprop --wcs-input-border-color-error - border color of the input when in error state
|
|
44
45
|
*
|
|
45
46
|
* @cssprop --wcs-input-value-color - color of the input value
|
|
@@ -103,6 +104,8 @@ export class Input {
|
|
|
103
104
|
this.minlength = undefined;
|
|
104
105
|
this.multiple = undefined;
|
|
105
106
|
this.name = this.inputId;
|
|
107
|
+
this.hidePasswordButtonAriaLabel = "Cacher le mot de passe";
|
|
108
|
+
this.showPasswordButtonAriaLabel = "Afficher le mot de passe";
|
|
106
109
|
this.pattern = undefined;
|
|
107
110
|
this.placeholder = undefined;
|
|
108
111
|
this.readonly = false;
|
|
@@ -174,7 +177,7 @@ export class Input {
|
|
|
174
177
|
if (label) {
|
|
175
178
|
label.id = labelId;
|
|
176
179
|
}
|
|
177
|
-
return (h(Host, { key: '
|
|
180
|
+
return (h(Host, { key: '987bb9b2e0f16edc255e3cd33a92fad04a99369f', "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: '395351bfae844314151d7cbdd12f9b4047294b6a', 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));
|
|
178
181
|
}
|
|
179
182
|
static get is() { return "wcs-input"; }
|
|
180
183
|
static get encapsulation() { return "shadow"; }
|
|
@@ -380,7 +383,7 @@ export class Input {
|
|
|
380
383
|
"text": "If `true`, the user cannot interact with the input."
|
|
381
384
|
},
|
|
382
385
|
"attribute": "disabled",
|
|
383
|
-
"reflect":
|
|
386
|
+
"reflect": true,
|
|
384
387
|
"defaultValue": "false"
|
|
385
388
|
},
|
|
386
389
|
"enterkeyhint": {
|
|
@@ -573,6 +576,42 @@ export class Input {
|
|
|
573
576
|
"reflect": false,
|
|
574
577
|
"defaultValue": "this.inputId"
|
|
575
578
|
},
|
|
579
|
+
"hidePasswordButtonAriaLabel": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"mutable": false,
|
|
582
|
+
"complexType": {
|
|
583
|
+
"original": "string",
|
|
584
|
+
"resolved": "string",
|
|
585
|
+
"references": {}
|
|
586
|
+
},
|
|
587
|
+
"required": false,
|
|
588
|
+
"optional": false,
|
|
589
|
+
"docs": {
|
|
590
|
+
"tags": [],
|
|
591
|
+
"text": ""
|
|
592
|
+
},
|
|
593
|
+
"attribute": "hide-password-button-aria-label",
|
|
594
|
+
"reflect": false,
|
|
595
|
+
"defaultValue": "\"Cacher le mot de passe\""
|
|
596
|
+
},
|
|
597
|
+
"showPasswordButtonAriaLabel": {
|
|
598
|
+
"type": "string",
|
|
599
|
+
"mutable": false,
|
|
600
|
+
"complexType": {
|
|
601
|
+
"original": "string",
|
|
602
|
+
"resolved": "string",
|
|
603
|
+
"references": {}
|
|
604
|
+
},
|
|
605
|
+
"required": false,
|
|
606
|
+
"optional": false,
|
|
607
|
+
"docs": {
|
|
608
|
+
"tags": [],
|
|
609
|
+
"text": ""
|
|
610
|
+
},
|
|
611
|
+
"attribute": "show-password-button-aria-label",
|
|
612
|
+
"reflect": false,
|
|
613
|
+
"defaultValue": "\"Afficher le mot de passe\""
|
|
614
|
+
},
|
|
576
615
|
"pattern": {
|
|
577
616
|
"type": "string",
|
|
578
617
|
"mutable": false,
|
|
@@ -622,7 +661,7 @@ export class Input {
|
|
|
622
661
|
"text": "If `true`, the user cannot modify the value."
|
|
623
662
|
},
|
|
624
663
|
"attribute": "readonly",
|
|
625
|
-
"reflect":
|
|
664
|
+
"reflect": true,
|
|
626
665
|
"defaultValue": "false"
|
|
627
666
|
},
|
|
628
667
|
"required": {
|
|
@@ -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;AAC7B,OAAO,EAGH,cAAc,EAGd,kBAAkB,EAKrB,MAAM,mBAA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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 isWcsInputSize,\n TextFieldTypes,\n WcsInputSize,\n WcsInputSizeValues,\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-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 = true;\n\n @State() private passwordReveal = 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 = 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() disabled = 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() 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 /**\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() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = 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 if (!isWcsInputSize(this.size)) {\n console.warn(`Invalid size value for wcs-input : \"${this.size}\". Must be one of \"${WcsInputSizeValues.join(', ')}\"`);\n this.size = \"m\"; // Default fallback value\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\" ? (<wcs-mat-icon class=\"toggle_password\" icon={this.iconPassword} size=\"m\" onClick={() => this.passwordRevealIconClick()}></wcs-mat-icon>) : 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,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,cAAc,EAGd,kBAAkB,EAKrB,MAAM,mBAAmB,CAAC;AAG3B,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;QA8P5B,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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\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 isWcsInputSize,\n TextFieldTypes,\n WcsInputSize,\n WcsInputSizeValues,\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 = true;\n\n @State() private passwordReveal = 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 = 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 = 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() 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 = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = 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 if (!isWcsInputSize(this.size)) {\n console.warn(`Invalid size value for wcs-input : \"${this.size}\". Must be one of \"${WcsInputSizeValues.join(', ')}\"`);\n this.size = \"m\"; // Default fallback value\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"]}
|
|
@@ -28,7 +28,7 @@ export class Label {
|
|
|
28
28
|
setOrRemoveAttribute(this.nativeLabel, attr, value);
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'b606456b6cff950276c8a79b24d0375d4990f0e8', slot: "label" }, h("label", Object.assign({ key: '52143cd88677e7927e18c8425f72884b38700a06', ref: (el) => this.nativeLabel = el }, this.inheritedAttributes), h("slot", { key: '7299df56be0d8f10d40a40e5e9534d2dc45da712' }))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "wcs-label"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,6 +5,11 @@ import { h, Host } from "@stencil/core";
|
|
|
5
5
|
* Standard lists can be used either with or without icons. Depending on the context, the list can have one or more
|
|
6
6
|
* actions (favourite, download, delete, etc.). Use standard lists with a unique action when each line has an action.
|
|
7
7
|
*
|
|
8
|
+
* ## Accessibility guidelines 💡
|
|
9
|
+
* > - You should wrap your list-items inside a container with a `role` attribute set to `list`. On each `wcs-list-item`,
|
|
10
|
+
* you should set a `role` attribute to `listitem`. See the code below.
|
|
11
|
+
* actions (favourite, download, delete, etc.). Use standard lists with a unique action when each line has an action.
|
|
12
|
+
*
|
|
8
13
|
* @slot title - Slot containing the title of the list item
|
|
9
14
|
* @slot properties - Slot containing the `<wcs-list-item-properties>` element
|
|
10
15
|
* @slot actions - Slot containing the actions of the list item, prefer using some `<wcs-button>` inside
|
|
@@ -30,7 +35,7 @@ export class ListItem {
|
|
|
30
35
|
this.activated = false;
|
|
31
36
|
}
|
|
32
37
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'fc01923b2eb3b33d6258718a81455ab790e2dcf4' }, h("slot", { key: '6748668e355f3aec9245110299def03ac8783f1e', name: "icon" }), h("div", { key: '46a944966bd87168ad909d7ff9046362a4adf2e2', class: "content" }, h("div", { key: 'd9d9e1d7bdcc5c1eb947e088b86a7308fd21f9af', class: "header" }, h("div", { key: '5dfb072ab048e89a4afe42e2e94b5299f455d889' }, h("slot", { key: 'ed261613330757d84b1f5f252b32ddf58270b4e8', name: "title" }), h("slot", { key: 'ed9f95eaddf982a4aaa07e7b41ae3b9e091c4c85', name: "properties" })), h("slot", { key: 'c0aae152b37a42ffb57fcd7fb70f44f83ddf8d3e', name: "actions" })), h("slot", { key: 'c7a6b166b7c6e0c160a758640e38feeb5dfcd55d', name: "description" }))));
|
|
34
39
|
}
|
|
35
40
|
static get is() { return "wcs-list-item"; }
|
|
36
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -61,7 +66,7 @@ export class ListItem {
|
|
|
61
66
|
"text": "True if the item is active. Adds a background color that highlights it."
|
|
62
67
|
},
|
|
63
68
|
"attribute": "activated",
|
|
64
|
-
"reflect":
|
|
69
|
+
"reflect": true,
|
|
65
70
|
"defaultValue": "false"
|
|
66
71
|
}
|
|
67
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["../../../src/components/list-item/list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["../../../src/components/list-item/list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAMH,MAAM,OAAO,QAAQ;;yBAI4C,KAAK;;IAElE,MAAM;QACF,OAAO,CACH,EAAC,IAAI;YACD,6DAAM,IAAI,EAAC,MAAM,GAAE;YACnB,4DAAK,KAAK,EAAC,SAAS;gBAChB,4DAAK,KAAK,EAAC,QAAQ;oBACf;wBACI,6DAAM,IAAI,EAAC,OAAO,GAAE;wBACpB,6DAAM,IAAI,EAAC,YAAY,GAAE,CACvB;oBACN,6DAAM,IAAI,EAAC,SAAS,GAAE,CACpB;gBACN,6DAAM,IAAI,EAAC,aAAa,GAAE,CACxB,CACH,CACV,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, ComponentInterface, h, Host, Prop } from '@stencil/core';\n\n/**\n * Lists are used for grouping a collection of related items.\n * \n * Standard lists can be used either with or without icons. Depending on the context, the list can have one or more\n * actions (favourite, download, delete, etc.). Use standard lists with a unique action when each line has an action. \n * \n * ## Accessibility guidelines 💡\n * > - You should wrap your list-items inside a container with a `role` attribute set to `list`. On each `wcs-list-item`, \n * you should set a `role` attribute to `listitem`. See the code below.\n * actions (favourite, download, delete, etc.). Use standard lists with a unique action when each line has an action.\n *\n * @slot title - Slot containing the title of the list item\n * @slot properties - Slot containing the `<wcs-list-item-properties>` element\n * @slot actions - Slot containing the actions of the list item, prefer using some `<wcs-button>` inside\n * @slot description - Slot containing the description of the list item\n * \n * @cssprop --wcs-list-item-padding - Padding of the list item\n * @cssprop --wcs-list-item-border-width - Border width of the list item\n * @cssprop --wcs-list-item-border-color - Border color of the list item\n * @cssprop --wcs-list-item-background-color-default - Background color of the list item\n * @cssprop --wcs-list-item-background-color-hover - Background color of the list item when hovered\n * @cssprop --wcs-list-item-background-color-active - Background color of the list item when active\n * @cssprop --wcs-list-item-transition-duration - Transition duration of the list item\n * @cssprop --wcs-list-item-title-color - Color of the title of the list item\n * @cssprop --wcs-list-item-title-font-weight - Font weight of the title of the list item\n * @cssprop --wcs-list-item-title-line-height - Line height of the title of the list item\n * @cssprop --wcs-list-item-title-margin-bottom - Margin bottom of the title of the list item\n * @cssprop --wcs-list-item-icon-color - Color of the icon of the list item\n * @cssprop --wcs-list-item-icon-margin-right - Margin right of the icon of the list item\n * @cssprop --wcs-list-item-actions-margin-left - Margin left of the actions of the list item\n */\n@Component({\n tag: 'wcs-list-item',\n styleUrl: 'list-item.scss',\n shadow: true\n})\nexport class ListItem implements ComponentInterface {\n /**\n * True if the item is active. Adds a background color that highlights it.\n */\n @Prop({ reflect: true, mutable: true }) activated: boolean = false;\n\n render() {\n return (\n <Host>\n <slot name=\"icon\"/>\n <div class=\"content\">\n <div class=\"header\">\n <div>\n <slot name=\"title\"/>\n <slot name=\"properties\"/>\n </div>\n <slot name=\"actions\"/>\n </div>\n <slot name=\"description\"/>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { h, Host } from "@stencil/core";
|
|
|
11
11
|
*/
|
|
12
12
|
export class ListItemProperties {
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '7bc379354b0bdab45108f2c1d500f224ed99ca1e', slot: "properties" }, h("slot", { key: 'cda45f2972400764901621d4332ae2ef00e29fe0', name: "property" })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "wcs-list-item-properties"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,7 +10,7 @@ import { h, Host } from "@stencil/core";
|
|
|
10
10
|
*/
|
|
11
11
|
export class ListItemProperty {
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'd3a0ac60b5dab19f4af6600c5e50614f5b2f9172', slot: "property" }, h("slot", { key: '4d3e992526dd4ada152af855495a89630627efbe' })));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "wcs-list-item-property"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -25,7 +25,7 @@ export class MatIcon {
|
|
|
25
25
|
setOrRemoveAttribute(this.nativeIcon, attr, value);
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: '1e0c8f28a59f398d0981007401cda39bf9e089d8' }, h("i", Object.assign({ key: 'caa5e118dfeb306aef87a9b10514247d45cc2f9f', "aria-hidden": "true", class: ICON_FAMILY_CLASS_NAME[this.family] + ' size-' + this.size, ref: (el) => (this.nativeIcon = el) }, this.inheritedAttributes), this.icon)));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "wcs-mat-icon"; }
|
|
31
31
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,6 +11,9 @@ const MODAL_INHERITED_ATTRS = [];
|
|
|
11
11
|
* > - Keyboard navigation is trapped inside the modal
|
|
12
12
|
* > - It is mandatory to set the `modal-trigger-controls-id` to the id of the element that opens the dialog, in order
|
|
13
13
|
* > to focus it upon dialog dismissal.
|
|
14
|
+
* > - On modal opening, the default behaviour is to focus the first focusable element. If you want to change the initial
|
|
15
|
+
* > behaviour, you have to use `modal-element-id-to-focus-on-opening` attribute to set the id of the inner modal element you
|
|
16
|
+
* > want to focus. You will see a story as example below
|
|
14
17
|
* > - The modal can be closed at any time by pressing the Escape key.
|
|
15
18
|
* >
|
|
16
19
|
* > - More info : https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
@@ -70,6 +73,8 @@ export class Modal {
|
|
|
70
73
|
this.size = 'm';
|
|
71
74
|
this.hideActions = false;
|
|
72
75
|
this.modalTriggerControlsId = undefined;
|
|
76
|
+
this.initialFocusElementId = undefined;
|
|
77
|
+
this.disableAutoFocus = false;
|
|
73
78
|
}
|
|
74
79
|
componentWillLoad() {
|
|
75
80
|
if (!this.modalTriggerControlsId) {
|
|
@@ -85,7 +90,19 @@ export class Modal {
|
|
|
85
90
|
this.updateFocusableElements();
|
|
86
91
|
if (this.showAttributeChangedMarker) {
|
|
87
92
|
this.showAttributeChangedMarker = false;
|
|
88
|
-
(
|
|
93
|
+
if (this.disableAutoFocus) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!this.initialFocusElementId) {
|
|
97
|
+
(_a = this.firstFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const modalElementToFocusOnOpening = document.getElementById(this.initialFocusElementId);
|
|
101
|
+
if (!modalElementToFocusOnOpening) {
|
|
102
|
+
console.warn(`wcs-modal: Unable to focus element - ID '${this.initialFocusElementId}' not found in DOM`);
|
|
103
|
+
}
|
|
104
|
+
modalElementToFocusOnOpening === null || modalElementToFocusOnOpening === void 0 ? void 0 : modalElementToFocusOnOpening.focus();
|
|
105
|
+
}
|
|
89
106
|
}
|
|
90
107
|
}
|
|
91
108
|
async setAriaAttribute(attr, value) {
|
|
@@ -152,7 +169,7 @@ export class Modal {
|
|
|
152
169
|
}
|
|
153
170
|
render() {
|
|
154
171
|
const modalTitleId = `wcs-modal-title-${this.modalId}`;
|
|
155
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: '1b9a4d86bf1e97ef7ef988b7355b75eb5f344ca8' }, h("div", Object.assign({ key: 'ab5e3938796e950e9e3aa81cd35a723d6429a8e6', class: "wcs-modal-container", "data-size": this.size, "aria-modal": true, role: "dialog", "aria-labelledby": modalTitleId, ref: (el) => (this.nativeDivDialog = el) }, this.inheritedAttributes), h("div", { key: '80fe453c1ffd3453832c799f131d50c97d37954f', class: "wcs-modal-header" }, h("h1", { key: '632853fdbc254e92167fafd022b7f0d392b861bc', id: modalTitleId }, h("slot", { key: 'b84db0d064adae8e50a013315fd3c593a39a6f99', name: "header" })), this.showCloseButton && (h("wcs-button", { key: '27bf915ff1ccebab3de363d8dae6914de112aa7b', shape: "round", mode: "clear", id: "wcs-modal-close-button", "aria-label": this.closeButtonAriaLabel, onClick: ($event) => this.onCloseButtonClick($event) }, h("wcs-mat-icon", { key: 'adacfb9e0b2c435d97f35e8423dd21f4bb534212', icon: "close" })))), h("div", { key: '33757197132d566f2ade4ea1c1cf36bc914702b2', class: "wcs-modal-content" }, h("slot", { key: 'c742e77c50cccc69435c40cf845fa6280a1a7063', onSlotchange: () => this.handleSlotContentChange() })), !this.hideActions && (h("div", { key: 'e98977493e4fc5461fbab1b67d609a1a956b7fbf', class: "wcs-modal-actions" }, h("slot", { key: '56168022f0de471106a15b03f7b16c3c6d3cbc1b', name: "actions" }))))));
|
|
156
173
|
}
|
|
157
174
|
static get is() { return "wcs-modal"; }
|
|
158
175
|
static get originalStyleUrls() {
|
|
@@ -300,6 +317,45 @@ export class Modal {
|
|
|
300
317
|
},
|
|
301
318
|
"attribute": "modal-trigger-controls-id",
|
|
302
319
|
"reflect": false
|
|
320
|
+
},
|
|
321
|
+
"initialFocusElementId": {
|
|
322
|
+
"type": "string",
|
|
323
|
+
"mutable": false,
|
|
324
|
+
"complexType": {
|
|
325
|
+
"original": "string",
|
|
326
|
+
"resolved": "string",
|
|
327
|
+
"references": {}
|
|
328
|
+
},
|
|
329
|
+
"required": false,
|
|
330
|
+
"optional": true,
|
|
331
|
+
"docs": {
|
|
332
|
+
"tags": [{
|
|
333
|
+
"name": "example",
|
|
334
|
+
"text": "<wcs-modal initial-focus-element=\"cancel-button\"></wcs-modal>"
|
|
335
|
+
}],
|
|
336
|
+
"text": "The ID of the element to automatically focus when the modal opens.\n\nIf this property is not set and `disableAutoFocus` is false, the modal will\nautomatically focus the first focusable element within its content.\nThis follows accessibility best practices by ensuring keyboard navigation\nstarts from a logical point when the modal opens."
|
|
337
|
+
},
|
|
338
|
+
"attribute": "initial-focus-element-id",
|
|
339
|
+
"reflect": false,
|
|
340
|
+
"defaultValue": "undefined"
|
|
341
|
+
},
|
|
342
|
+
"disableAutoFocus": {
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"mutable": false,
|
|
345
|
+
"complexType": {
|
|
346
|
+
"original": "boolean",
|
|
347
|
+
"resolved": "boolean",
|
|
348
|
+
"references": {}
|
|
349
|
+
},
|
|
350
|
+
"required": false,
|
|
351
|
+
"optional": false,
|
|
352
|
+
"docs": {
|
|
353
|
+
"tags": [],
|
|
354
|
+
"text": "Disables automatic focus behavior when the modal opens.\n\nWhen set to true, the modal will not automatically focus any element upon opening.\nUse this property with caution, as managing focus is important for accessibility.\nConsider providing an alternative focus management strategy if disabling the default behavior."
|
|
355
|
+
},
|
|
356
|
+
"attribute": "disable-auto-focus",
|
|
357
|
+
"reflect": false,
|
|
358
|
+
"defaultValue": "false"
|
|
303
359
|
}
|
|
304
360
|
};
|
|
305
361
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,SAAS,EACT,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EAEJ,KAAK,EAAE,MAAM,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG/G,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,MAAM,OAAO,KAAK;;QAGN,wBAAmB,GAAyB,EAAE,CAAC;QA8CvD;;;WAGG;QACK,YAAO,GAAW,QAAQ,EAAE,CAAC;QAIrC;;;;;WAKG;QACK,+BAA0B,GAAY,KAAK,CAAC;QACpD;;;;;;;WAOG;QACK,wBAAmB,GAAY,KAAK,CAAC;+BAhEK,KAAK;oBAKD,KAAK;+BAWT,KAAK;oCAMhB,QAAQ;oBAMrB,GAAG;2BAKiB,KAAK;;;IAiCnD,iBAAiB;QACb,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,OAAO,CAAC,IAAI,CAAC,8GAA8G,CAAC,CAAC;QACjI,CAAC;QAED,IAAI,CAAC,mBAAmB,mCACjB,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,GAC9B,iBAAiB,CAAC,IAAI,CAAC,EAAE,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AAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import {\n Element,\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n ComponentInterface,\n Watch, Method\n} from '@stencil/core';\nimport { ModalSize } from './modal-interface';\nimport { isElementFocused, isFocusable } from \"../../utils/accessibility\";\nimport { inheritAriaAttributes, inheritAttributes, isTabKey, setOrRemoveAttribute } from \"../../utils/helpers\";\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst MODAL_INHERITED_ATTRS = [];\n\n/**\n * The modal component (also named dialog or popup) is an interface element that appears on top of the page content.\n * Use it to show a message, a confirmation dialog, or any other content like forms.\n *\n * ## Accessibility guidelines 💡\n * > - Modal element has `role=\"dialog\"` and `aria-modal=\"true\"`\n * > - Keyboard navigation is trapped inside the modal\n * > - It is mandatory to set the `modal-trigger-controls-id` to the id of the element that opens the dialog, in order\n * > to focus it upon dialog dismissal.\n * > - The modal can be closed at any time by pressing the Escape key.\n * >\n * > - More info : https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/\n *\n * @cssprop --wcs-modal-max-height - Max height of the main container\n * @cssprop --wcs-modal-overflow-y - Overflow-y of the content\n *\n * @cssprop --wcs-modal-backdrop-color - Backdrop color of the modal\n * @cssprop --wcs-modal-max-height - Max height of the main container\n * @cssprop --wcs-modal-background-color - Background color of the modal\n * @cssprop --wcs-modal-border-radius - Border radius of the modal\n * @cssprop --wcs-modal-padding - Padding inside the modal\n * @cssprop --wcs-modal-border-width - Border width of the modal\n * @cssprop --wcs-modal-border-color - Border color of the modal\n * @cssprop --wcs-modal-title-margin-bottom - Margin bottom of the modal title\n * @cssprop --wcs-modal-title-font-size - Font size of the modal title\n * @cssprop --wcs-modal-title-font-weight - Font weight of the modal title\n * @cssprop --wcs-modal-title-line-height - Line height of the modal title\n * @cssprop --wcs-modal-actions-margin-top - Margin top of the modal actions\n * @cssprop --wcs-modal-width-s - Width of the modal for size small\n * @cssprop --wcs-modal-width-m - Width of the modal for size medium\n * @cssprop --wcs-modal-width-l - Width of the modal for size large\n * @cssprop --wcs-modal-width-xl - Width of the modal for size extra large\n * \n * @slot <no-name> Main container slot\n * @slot header Header container slot (for title)\n * @slot actions Actions container slot (for buttons)\n */\n@Component({\n tag: 'wcs-modal',\n styleUrl: 'modal.scss',\n shadow: false,\n})\nexport class Modal implements ComponentInterface, MutableAriaAttribute {\n @Element() private el: HTMLElement;\n private nativeDivDialog!: HTMLDivElement;\n private inheritedAttributes: { [k: string]: any } = {};\n\n /**\n * Specifies whether the component should display a backdrop on the entire page\n */\n @Prop({reflect: true}) withoutBackdrop: boolean = false;\n\n /**\n * Displays the modal\n */\n @Prop({reflect: true, mutable: true}) show: boolean = false;\n\n /**\n * Triggered when the user leaves the dialog with the closing button.\n */\n @Event() wcsDialogClosed: EventEmitter<void>;\n\n /**\n * Specifies whether the component should display a close button.\n * if false, it won't close the modal when the escape key is pressed.\n */\n @Prop({reflect: true}) showCloseButton: boolean = false;\n\n /**\n * Specifies the aria-label present on the close button when the modal is opened. \n * Only use when `showCloseButton` is `true`.\n */\n @Prop() closeButtonAriaLabel: string = 'Fermer';\n\n /**\n * There are multiple sizes for modals. The default size is medium (m), however other sizes are available. Select the\n * size best suited for the content and screen size displaying the modal. Remember to test responsiveness.\n */\n @Prop() size: ModalSize = 'm';\n\n /**\n * Specifies whether the component should hide the actions slot or not\n */\n @Prop({reflect: true}) hideActions: boolean = false;\n\n /**\n * Specifies which element id controls the modal\n * @private\n */\n @Prop() modalTriggerControlsId: string;\n\n /**\n * Give an unique id\n * @private\n */\n private modalId: number = modalIds++;\n\n private firstFocusableElement: HTMLElement;\n private lastFocusableElement: HTMLElement;\n /**\n * This attribute is used to determine whether the show attribute has changed since the last rendering. \n * This allows us to call the focus method on the first element of the modal when the show attribute changes to true. \n * This call is made in the componentDidRender method\n * @private\n */\n private showAttributeChangedMarker: boolean = false;\n /**\n * This attribute is used to determine if the modal has been closed for the first time since its last activation.\n * It is set to 'true' when the modal is first closed, and will be reset to 'false' when the modal is shown again.\n * This state is important for accessibility reasons in order to focus the modal trigger element (like the button \n * which controls the modal)\n *\n * @private\n */\n private hasBeenClosedBefore: boolean = false;\n\n componentWillLoad(): Promise<void> | void {\n if (!this.modalTriggerControlsId) {\n console.warn('wcs-modal: You must provide the modal-trigger-controls-id attribute to the modal to make it to work properly');\n }\n\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, MODAL_INHERITED_ATTRS),\n };\n }\n\n componentDidLoad() {\n this.updateFocusableElements();\n }\n\n componentDidRender() {\n this.updateFocusableElements();\n if (this.showAttributeChangedMarker) {\n this.showAttributeChangedMarker = false;\n this.firstFocusableElement?.focus();\n }\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeDivDialog, attr, value);\n }\n \n @Watch(\"show\")\n onShowChange() {\n if(this.show) {\n this.hasBeenClosedBefore = false;\n this.showAttributeChangedMarker = true;\n } else {\n // if we already made actions when the modal was firstly closed, we do nothing\n if(this.hasBeenClosedBefore) {\n return;\n }\n \n this.hasBeenClosedBefore = true;\n\n if(this.modalTriggerControlsId) {\n const modalTriggerControlsHtmlElement = document.getElementById(this.modalTriggerControlsId);\n if(!modalTriggerControlsHtmlElement) {\n console.warn(`wcs-modal: Element with id '${this.modalTriggerControlsId}' could not be found`);\n }\n modalTriggerControlsHtmlElement?.focus();\n }\n }\n }\n\n private updateFocusableElements() {\n const focusableElements = Array.from(this.el.querySelectorAll('*'))\n .filter(element => isFocusable(element));\n\n this.firstFocusableElement = focusableElements.length > 0 && focusableElements[0] as HTMLElement;\n this.lastFocusableElement = focusableElements.length > 0 && focusableElements[focusableElements.length - 1] as HTMLElement;\n }\n \n private close() {\n // If the modal isn't shown, we don't do anything\n if (this.show) {\n this.show = false;\n this.wcsDialogClosed.emit();\n }\n }\n\n @Listen('keydown', {target: 'document'})\n onKeyDown(event: KeyboardEvent) {\n if (this.show && this.showCloseButton && event.key === 'Escape') {\n this.close();\n }\n\n if (this.show) {\n if (isTabKey(event)) {\n this.updateFocusableElements(); // XXX: maybe a performance issue\n const firstElement = this.firstFocusableElement;\n const lastElement = this.lastFocusableElement;\n\n if (event.shiftKey && isElementFocused(firstElement)) {\n event.preventDefault();\n lastElement.focus();\n } else if (!event.shiftKey && isElementFocused(lastElement)) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n }\n\n private onCloseButtonClick(_: MouseEvent) {\n this.close();\n }\n\n private handleSlotContentChange() {\n this.updateFocusableElements();\n }\n\n render() {\n const modalTitleId = `wcs-modal-title-${this.modalId}`;\n return (\n <Host>\n <div class=\"wcs-modal-container\"\n data-size={this.size}\n aria-modal={true}\n role={\"dialog\"}\n aria-labelledby={modalTitleId}\n ref={(el) => (this.nativeDivDialog = el)}\n {...this.inheritedAttributes}\n >\n <div class=\"wcs-modal-header\">\n <h1 id={modalTitleId}>\n <slot name=\"header\"></slot>\n </h1>\n {this.showCloseButton && (\n <wcs-button shape=\"round\" \n mode=\"clear\" \n id=\"wcs-modal-close-button\"\n aria-label={this.closeButtonAriaLabel}\n onClick={($event) => this.onCloseButtonClick($event)}>\n <wcs-mat-icon icon=\"close\"></wcs-mat-icon>\n </wcs-button>)\n }\n\n </div>\n <div class=\"wcs-modal-content\">\n <slot onSlotchange={() => this.handleSlotContentChange()}></slot>\n </div>\n {!this.hideActions && (\n <div class=\"wcs-modal-actions\">\n <slot name=\"actions\"></slot>\n </div>)\n }\n </div>\n </Host>\n );\n }\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,OAAO,GAAgB,CACjC,CAAC,CAGhB;gBACN,4DAAK,KAAK,EAAC,mBAAmB;oBAC1B,6DAAM,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,GAAS,CAC/D;gBACL,CAAC,IAAI,CAAC,WAAW,IAAI,CAClB,4DAAK,KAAK,EAAC,mBAAmB;oBAC1B,6DAAM,IAAI,EAAC,SAAS,GAAQ,CAC1B,CAAC,CAET,CACH,CACV,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import {\n Element,\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n ComponentInterface,\n Watch, Method\n} from '@stencil/core';\nimport { ModalSize } from './modal-interface';\nimport { isElementFocused, isFocusable } from \"../../utils/accessibility\";\nimport { inheritAriaAttributes, inheritAttributes, isTabKey, setOrRemoveAttribute } from \"../../utils/helpers\";\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst MODAL_INHERITED_ATTRS = [];\n\n/**\n * The modal component (also named dialog or popup) is an interface element that appears on top of the page content.\n * Use it to show a message, a confirmation dialog, or any other content like forms.\n *\n * ## Accessibility guidelines 💡\n * > - Modal element has `role=\"dialog\"` and `aria-modal=\"true\"`\n * > - Keyboard navigation is trapped inside the modal\n * > - It is mandatory to set the `modal-trigger-controls-id` to the id of the element that opens the dialog, in order\n * > to focus it upon dialog dismissal.\n * > - On modal opening, the default behaviour is to focus the first focusable element. If you want to change the initial \n * > behaviour, you have to use `modal-element-id-to-focus-on-opening` attribute to set the id of the inner modal element you \n * > want to focus. You will see a story as example below\n * > - The modal can be closed at any time by pressing the Escape key.\n * >\n * > - More info : https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/\n *\n * @cssprop --wcs-modal-max-height - Max height of the main container\n * @cssprop --wcs-modal-overflow-y - Overflow-y of the content\n *\n * @cssprop --wcs-modal-backdrop-color - Backdrop color of the modal\n * @cssprop --wcs-modal-max-height - Max height of the main container\n * @cssprop --wcs-modal-background-color - Background color of the modal\n * @cssprop --wcs-modal-border-radius - Border radius of the modal\n * @cssprop --wcs-modal-padding - Padding inside the modal\n * @cssprop --wcs-modal-border-width - Border width of the modal\n * @cssprop --wcs-modal-border-color - Border color of the modal\n * @cssprop --wcs-modal-title-margin-bottom - Margin bottom of the modal title\n * @cssprop --wcs-modal-title-font-size - Font size of the modal title\n * @cssprop --wcs-modal-title-font-weight - Font weight of the modal title\n * @cssprop --wcs-modal-title-line-height - Line height of the modal title\n * @cssprop --wcs-modal-actions-margin-top - Margin top of the modal actions\n * @cssprop --wcs-modal-width-s - Width of the modal for size small\n * @cssprop --wcs-modal-width-m - Width of the modal for size medium\n * @cssprop --wcs-modal-width-l - Width of the modal for size large\n * @cssprop --wcs-modal-width-xl - Width of the modal for size extra large\n * \n * @slot <no-name> Main container slot\n * @slot header Header container slot (for title)\n * @slot actions Actions container slot (for buttons)\n */\n@Component({\n tag: 'wcs-modal',\n styleUrl: 'modal.scss',\n shadow: false,\n})\nexport class Modal implements ComponentInterface, MutableAriaAttribute {\n @Element() private el: HTMLElement;\n private nativeDivDialog!: HTMLDivElement;\n private inheritedAttributes: { [k: string]: any } = {};\n\n /**\n * Specifies whether the component should display a backdrop on the entire page\n */\n @Prop({reflect: true}) withoutBackdrop: boolean = false;\n\n /**\n * Displays the modal\n */\n @Prop({reflect: true, mutable: true}) show: boolean = false;\n\n /**\n * Triggered when the user leaves the dialog with the closing button.\n */\n @Event() wcsDialogClosed: EventEmitter<void>;\n\n /**\n * Specifies whether the component should display a close button.\n * if false, it won't close the modal when the escape key is pressed.\n */\n @Prop({reflect: true}) showCloseButton: boolean = false;\n\n /**\n * Specifies the aria-label present on the close button when the modal is opened. \n * Only use when `showCloseButton` is `true`.\n */\n @Prop() closeButtonAriaLabel: string = 'Fermer';\n\n /**\n * There are multiple sizes for modals. The default size is medium (m), however other sizes are available. Select the\n * size best suited for the content and screen size displaying the modal. Remember to test responsiveness.\n */\n @Prop() size: ModalSize = 'm';\n\n /**\n * Specifies whether the component should hide the actions slot or not\n */\n @Prop({reflect: true}) hideActions: boolean = false;\n\n /**\n * Specifies which element id controls the modal\n * @private\n */\n @Prop() modalTriggerControlsId: string;\n /**\n * The ID of the element to automatically focus when the modal opens.\n * \n * If this property is not set and `disableAutoFocus` is false, the modal will\n * automatically focus the first focusable element within its content.\n * This follows accessibility best practices by ensuring keyboard navigation\n * starts from a logical point when the modal opens.\n * \n * @example\n * <wcs-modal initial-focus-element=\"cancel-button\"></wcs-modal>\n */\n @Prop() initialFocusElementId?: string = undefined;\n\n /**\n * Disables automatic focus behavior when the modal opens.\n * \n * When set to true, the modal will not automatically focus any element upon opening.\n * Use this property with caution, as managing focus is important for accessibility.\n * Consider providing an alternative focus management strategy if disabling the default behavior.\n */\n @Prop() disableAutoFocus: boolean = false;\n\n /**\n * Give an unique id\n * @private\n */\n private modalId: number = modalIds++;\n\n private firstFocusableElement: HTMLElement;\n private lastFocusableElement: HTMLElement;\n /**\n * This attribute is used to determine whether the show attribute has changed since the last rendering. \n * This allows us to call the focus method on the first element of the modal when the show attribute changes to true. \n * This call is made in the componentDidRender method\n * @private\n */\n private showAttributeChangedMarker: boolean = false;\n /**\n * This attribute is used to determine if the modal has been closed for the first time since its last activation.\n * It is set to 'true' when the modal is first closed, and will be reset to 'false' when the modal is shown again.\n * This state is important for accessibility reasons in order to focus the modal trigger element (like the button \n * which controls the modal)\n *\n * @private\n */\n private hasBeenClosedBefore: boolean = false;\n\n componentWillLoad(): Promise<void> | void {\n if (!this.modalTriggerControlsId) {\n console.warn('wcs-modal: You must provide the modal-trigger-controls-id attribute to the modal to make it to work properly');\n }\n\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, MODAL_INHERITED_ATTRS),\n };\n }\n\n componentDidLoad() {\n this.updateFocusableElements();\n }\n\n componentDidRender() {\n this.updateFocusableElements();\n if (this.showAttributeChangedMarker) {\n this.showAttributeChangedMarker = false;\n \n if(this.disableAutoFocus) {\n return;\n }\n \n if(!this.initialFocusElementId) {\n this.firstFocusableElement?.focus();\n } else {\n const modalElementToFocusOnOpening = document.getElementById(this.initialFocusElementId);\n if(!modalElementToFocusOnOpening) {\n console.warn(`wcs-modal: Unable to focus element - ID '${this.initialFocusElementId}' not found in DOM`);\n }\n \n modalElementToFocusOnOpening?.focus();\n }\n }\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeDivDialog, attr, value);\n }\n \n @Watch(\"show\")\n onShowChange() {\n if(this.show) {\n this.hasBeenClosedBefore = false;\n this.showAttributeChangedMarker = true;\n } else {\n // if we already made actions when the modal was firstly closed, we do nothing\n if(this.hasBeenClosedBefore) {\n return;\n }\n \n this.hasBeenClosedBefore = true;\n\n if(this.modalTriggerControlsId) {\n const modalTriggerControlsHtmlElement = document.getElementById(this.modalTriggerControlsId);\n if(!modalTriggerControlsHtmlElement) {\n console.warn(`wcs-modal: Element with id '${this.modalTriggerControlsId}' could not be found`);\n }\n modalTriggerControlsHtmlElement?.focus();\n }\n }\n }\n\n private updateFocusableElements() {\n const focusableElements = Array.from(this.el.querySelectorAll('*'))\n .filter(element => isFocusable(element));\n\n this.firstFocusableElement = focusableElements.length > 0 && focusableElements[0] as HTMLElement;\n this.lastFocusableElement = focusableElements.length > 0 && focusableElements[focusableElements.length - 1] as HTMLElement;\n }\n \n private close() {\n // If the modal isn't shown, we don't do anything\n if (this.show) {\n this.show = false;\n this.wcsDialogClosed.emit();\n }\n }\n\n @Listen('keydown', {target: 'document'})\n onKeyDown(event: KeyboardEvent) {\n if (this.show && this.showCloseButton && event.key === 'Escape') {\n this.close();\n }\n\n if (this.show) {\n if (isTabKey(event)) {\n this.updateFocusableElements(); // XXX: maybe a performance issue\n const firstElement = this.firstFocusableElement;\n const lastElement = this.lastFocusableElement;\n\n if (event.shiftKey && isElementFocused(firstElement)) {\n event.preventDefault();\n lastElement.focus();\n } else if (!event.shiftKey && isElementFocused(lastElement)) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n }\n\n private onCloseButtonClick(_: MouseEvent) {\n this.close();\n }\n\n private handleSlotContentChange() {\n this.updateFocusableElements();\n }\n\n render() {\n const modalTitleId = `wcs-modal-title-${this.modalId}`;\n return (\n <Host>\n <div class=\"wcs-modal-container\"\n data-size={this.size}\n aria-modal={true}\n role={\"dialog\"}\n aria-labelledby={modalTitleId}\n ref={(el) => (this.nativeDivDialog = el)}\n {...this.inheritedAttributes}\n >\n <div class=\"wcs-modal-header\">\n <h1 id={modalTitleId}>\n <slot name=\"header\"></slot>\n </h1>\n {this.showCloseButton && (\n <wcs-button shape=\"round\" \n mode=\"clear\" \n id=\"wcs-modal-close-button\"\n aria-label={this.closeButtonAriaLabel}\n onClick={($event) => this.onCloseButtonClick($event)}>\n <wcs-mat-icon icon=\"close\"></wcs-mat-icon>\n </wcs-button>)\n }\n\n </div>\n <div class=\"wcs-modal-content\">\n <slot onSlotchange={() => this.handleSlotContentChange()}></slot>\n </div>\n {!this.hideActions && (\n <div class=\"wcs-modal-actions\">\n <slot name=\"actions\"></slot>\n </div>)\n }\n </div>\n </Host>\n );\n }\n}\n\nlet modalIds = 0;\n"]}
|
|
@@ -190,7 +190,7 @@ export class NativeSelect {
|
|
|
190
190
|
this._updateStyles();
|
|
191
191
|
}
|
|
192
192
|
render() {
|
|
193
|
-
return (h(Host, { key: '
|
|
193
|
+
return (h(Host, { key: '73d21d77f3b725f2867f447f9b891a16a26c842f', class: `${this.expanded ? 'expanded' : ''}`, "data-disabled": this.disabled, "data-size": this.size }, h("div", { key: '1d138a4f201b3772dd2f985e01941d2ad60536ee', class: "select-wrapper" }, h("slot", { key: '3b420677784de42d79acd852af58d577de12834e' }), h("div", { key: 'e4562159d84b7d94d942be2f7e5b716ed3e4f23f', class: "arrow-container" }, h(SelectArrow, { key: '7cf362081f043af30f8f62ba8615e821ac3c6511', up: this.expanded })))));
|
|
194
194
|
}
|
|
195
195
|
static get is() { return "wcs-native-select"; }
|
|
196
196
|
static get encapsulation() { return "shadow"; }
|
|
@@ -21,7 +21,7 @@ export class Nav {
|
|
|
21
21
|
setOrRemoveAttribute(this.nativeNav, attr, value);
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h("nav", Object.assign({ key: '
|
|
24
|
+
return (h("nav", Object.assign({ key: '010b8847c02ed7e6c9f3112f486279709f75fbb0', role: "navigation", class: "wcs-nav-container", ref: (el) => (this.nativeNav = el) }, this.inheritedAttributes), h("div", { key: '35117f4736ebeedc66db2c883eeb6a9b570fcc25', role: "list" }, h("slot", { key: 'a08aa2b168519ce86b6bfbabe501f38bfc55c62b' }), h("slot", { key: '0f2f00d3bf339128d64cb2b61eb7029d3a0ce035', name: "bottom" }))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "wcs-nav"; }
|
|
27
27
|
static get encapsulation() { return "shadow"; }
|
|
@@ -18,7 +18,7 @@ wcs-nav-item {
|
|
|
18
18
|
--wcs-nav-item-color-active: var(--wcs-semantic-color-foreground-action-primary-default);
|
|
19
19
|
--wcs-nav-item-color-hover: var(--wcs-semantic-color-foreground-action-primary-default);
|
|
20
20
|
--wcs-nav-item-color-press: var(--wcs-semantic-color-foreground-action-primary-default);
|
|
21
|
-
--wcs-nav-item-border-color-focus: var(--wcs-semantic-color-
|
|
21
|
+
--wcs-nav-item-border-color-focus: var(--wcs-semantic-color-border-focus-base-on-secondary);
|
|
22
22
|
--wcs-nav-item-border-width-focus: var(--wcs-semantic-border-width-large);
|
|
23
23
|
--wcs-nav-item-indicator-background-color: var(--wcs-semantic-color-background-surface-accent-light);
|
|
24
24
|
--wcs-nav-item-indicator-width-desktop: calc(0.5 * var(--wcs-semantic-size-base));
|
|
@@ -36,7 +36,7 @@ wcs-nav-item {
|
|
|
36
36
|
transition-timing-function: ease-in-out;
|
|
37
37
|
background-color: var(--wcs-nav-item-background-color-default);
|
|
38
38
|
}
|
|
39
|
-
wcs-nav-item a {
|
|
39
|
+
wcs-nav-item a, wcs-nav-item button {
|
|
40
40
|
display: flex;
|
|
41
41
|
position: relative;
|
|
42
42
|
flex-direction: column;
|
|
@@ -52,7 +52,7 @@ wcs-nav-item a {
|
|
|
52
52
|
color: var(--wcs-nav-item-color-default);
|
|
53
53
|
}
|
|
54
54
|
@media (max-width: 1199px) {
|
|
55
|
-
wcs-nav-item a {
|
|
55
|
+
wcs-nav-item a, wcs-nav-item button {
|
|
56
56
|
display: flex;
|
|
57
57
|
flex: 1;
|
|
58
58
|
height: var(--wcs-nav-item-height-mobile);
|
|
@@ -60,11 +60,15 @@ wcs-nav-item a {
|
|
|
60
60
|
font-size: var(--wcs-nav-item-font-size-mobile);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
wcs-nav-item
|
|
63
|
+
wcs-nav-item button {
|
|
64
|
+
width: 100%;
|
|
65
|
+
cursor: inherit;
|
|
66
|
+
}
|
|
67
|
+
wcs-nav-item a:focus, wcs-nav-item button:focus {
|
|
64
68
|
outline: none;
|
|
65
69
|
}
|
|
66
70
|
@media (max-width: 1199px) {
|
|
67
|
-
wcs-nav-item:has(a:focus-visible) {
|
|
71
|
+
wcs-nav-item:has(a:focus-visible), wcs-nav-item:has(button:focus-visible) {
|
|
68
72
|
outline: var(--wcs-semantic-border-width-large) dashed var(--wcs-nav-item-border-color-focus);
|
|
69
73
|
outline-offset: -2px;
|
|
70
74
|
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
@@ -76,9 +80,16 @@ wcs-nav-item a:focus {
|
|
|
76
80
|
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
77
81
|
}
|
|
78
82
|
}
|
|
83
|
+
@supports not selector(&:has(button:focus-visible)) {
|
|
84
|
+
wcs-nav-item:focus-within {
|
|
85
|
+
outline: var(--wcs-semantic-border-width-large) dashed var(--wcs-nav-item-border-color-focus);
|
|
86
|
+
outline-offset: -2px;
|
|
87
|
+
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
79
90
|
}
|
|
80
91
|
@media (min-width: 1200px) {
|
|
81
|
-
wcs-nav-item:has(a:focus-visible) {
|
|
92
|
+
wcs-nav-item:has(a:focus-visible), wcs-nav-item:has(button:focus-visible) {
|
|
82
93
|
outline: var(--wcs-semantic-border-width-large) dashed var(--wcs-nav-item-border-color-focus);
|
|
83
94
|
outline-offset: -2px;
|
|
84
95
|
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
@@ -90,6 +101,13 @@ wcs-nav-item a:focus {
|
|
|
90
101
|
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
91
102
|
}
|
|
92
103
|
}
|
|
104
|
+
@supports not selector(&:has(button:focus-visible)) {
|
|
105
|
+
wcs-nav-item:focus-within {
|
|
106
|
+
outline: var(--wcs-semantic-border-width-large) dashed var(--wcs-nav-item-border-color-focus);
|
|
107
|
+
outline-offset: -2px;
|
|
108
|
+
border-radius: var(--wcs-nav-item-border-width-focus);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
93
111
|
}
|
|
94
112
|
wcs-nav-item i {
|
|
95
113
|
margin-bottom: 0.5rem;
|
|
@@ -45,7 +45,7 @@ export class NavItem {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '8a21ba03aacff1aa94ae552a0f76f0e551df6e67', role: "listitem" }, h("slot", { key: '75d250a220a1eaba9cb8dd68adbe267379afb915' })));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "wcs-nav-item"; }
|
|
51
51
|
static get originalStyleUrls() {
|
|
@@ -54,8 +54,8 @@ export class ProgressBar {
|
|
|
54
54
|
const style = {
|
|
55
55
|
width: this.value + '%'
|
|
56
56
|
};
|
|
57
|
-
return (h("div", Object.assign({ key: '
|
|
58
|
-
h("span", { key: '
|
|
57
|
+
return (h("div", Object.assign({ key: '9339cb3c4ef89618cb45119495d3601ce2110d3d', class: this.rootClasses(), role: "progressbar", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.value, "aria-valuetext": this.value + '%', ref: (el) => (this.nativeProgress = el) }, this.inheritedAttributes), h("div", { key: '8b54ef388bcd4e2bff826a18374c4732f7d0e384', class: "progress-bar", style: style }, this.showLabel &&
|
|
58
|
+
h("span", { key: 'f50f5879441f22db9552f6bbaaca3ede6f23a678', class: "progress-label" }, this.value, h("sup", { key: 'b10471901b5d3efc0ae95d3a1de822ead1720b87' }, "%")))));
|
|
59
59
|
}
|
|
60
60
|
rootClasses() {
|
|
61
61
|
let classes = 'progress';
|