@tylertech/forge 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +124 -0
- package/dist/busy-indicator/forge-busy-indicator.css +6 -0
- package/dist/button/forge-button.css +6 -0
- package/dist/dialog/forge-dialog-utils.css +6 -0
- package/dist/dialog/forge-dialog.css +6 -0
- package/dist/expansion-panel/forge-expansion-panel.css +6 -0
- package/dist/floating-action-button/forge-floating-action-button.css +6 -0
- package/dist/floating-label/forge-floating-label.css +6 -0
- package/dist/forge-core.css +6 -0
- package/dist/forge-dark.css +6 -0
- package/dist/forge.css +6 -0
- package/dist/form-field/forge-form-field.css +6 -0
- package/dist/icon-button/forge-icon-button.css +6 -0
- package/dist/popup/forge-popup.css +6 -0
- package/dist/quantity-field/forge-quantity-field.css +6 -0
- package/dist/ripple/forge-ripple.css +6 -0
- package/dist/scaffold/forge-scaffold.css +6 -0
- package/dist/table/forge-table.css +6 -0
- package/dist/theme/forge-theme.css +6 -0
- package/dist/tooltip/forge-tooltip.css +6 -0
- package/dist/typography/forge-form.css +6 -0
- package/dist/typography/forge-typography.css +6 -0
- package/dist/utils/forge-flex.css +6 -0
- package/dist/utils/forge-grid.css +6 -0
- package/dist/utils/forge-utils.css +6 -0
- package/esm/accordion/accordion-adapter.d.ts +48 -0
- package/esm/accordion/accordion-adapter.js +63 -0
- package/esm/accordion/accordion-constants.d.ts +11 -0
- package/esm/accordion/accordion-constants.js +14 -0
- package/esm/accordion/accordion-foundation.d.ts +27 -0
- package/esm/accordion/accordion-foundation.js +61 -0
- package/esm/accordion/accordion.d.ts +30 -0
- package/esm/accordion/accordion.js +52 -0
- package/esm/accordion/index.d.ts +10 -0
- package/esm/accordion/index.js +14 -0
- package/esm/app-bar/app-bar-adapter.d.ts +43 -0
- package/esm/app-bar/app-bar-adapter.js +60 -0
- package/esm/app-bar/app-bar-constants.d.ts +33 -0
- package/esm/app-bar/app-bar-constants.js +37 -0
- package/esm/app-bar/app-bar-foundation.d.ts +35 -0
- package/esm/app-bar/app-bar-foundation.js +70 -0
- package/esm/app-bar/app-bar.d.ts +34 -0
- package/esm/app-bar/app-bar.js +71 -0
- package/esm/app-bar/help-button/app-bar-help-button-adapter.d.ts +18 -0
- package/esm/app-bar/help-button/app-bar-help-button-adapter.js +19 -0
- package/esm/app-bar/help-button/app-bar-help-button-constants.d.ts +8 -0
- package/esm/app-bar/help-button/app-bar-help-button-constants.js +10 -0
- package/esm/app-bar/help-button/app-bar-help-button-foundation.d.ts +21 -0
- package/esm/app-bar/help-button/app-bar-help-button-foundation.js +29 -0
- package/esm/app-bar/help-button/app-bar-help-button.d.ts +23 -0
- package/esm/app-bar/help-button/app-bar-help-button.js +48 -0
- package/esm/app-bar/help-button/index.d.ts +10 -0
- package/esm/app-bar/help-button/index.js +14 -0
- package/esm/app-bar/index.d.ts +16 -0
- package/esm/app-bar/index.js +20 -0
- package/esm/app-bar/menu-button/app-bar-menu-button-constants.d.ts +8 -0
- package/esm/app-bar/menu-button/app-bar-menu-button-constants.js +10 -0
- package/esm/app-bar/menu-button/app-bar-menu-button.d.ts +17 -0
- package/esm/app-bar/menu-button/app-bar-menu-button.js +34 -0
- package/esm/app-bar/menu-button/index.d.ts +8 -0
- package/esm/app-bar/menu-button/index.js +12 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-adapter.d.ts +23 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-adapter.js +28 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-constants.d.ts +14 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-constants.js +17 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-foundation.d.ts +32 -0
- package/esm/app-bar/notification-button/app-bar-notification-button-foundation.js +79 -0
- package/esm/app-bar/notification-button/app-bar-notification-button.d.ts +29 -0
- package/esm/app-bar/notification-button/app-bar-notification-button.js +78 -0
- package/esm/app-bar/notification-button/index.d.ts +10 -0
- package/esm/app-bar/notification-button/index.js +14 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-adapter.d.ts +34 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-adapter.js +72 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-constants.d.ts +31 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-constants.js +25 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-foundation.d.ts +66 -0
- package/esm/app-bar/profile-button/app-bar-profile-button-foundation.js +199 -0
- package/esm/app-bar/profile-button/app-bar-profile-button.d.ts +42 -0
- package/esm/app-bar/profile-button/app-bar-profile-button.js +112 -0
- package/esm/app-bar/profile-button/index.d.ts +10 -0
- package/esm/app-bar/profile-button/index.js +14 -0
- package/esm/app-bar/search/app-bar-search-adapter.d.ts +59 -0
- package/esm/app-bar/search/app-bar-search-adapter.js +73 -0
- package/esm/app-bar/search/app-bar-search-constants.d.ts +38 -0
- package/esm/app-bar/search/app-bar-search-constants.js +42 -0
- package/esm/app-bar/search/app-bar-search-foundation.d.ts +62 -0
- package/esm/app-bar/search/app-bar-search-foundation.js +126 -0
- package/esm/app-bar/search/app-bar-search.d.ts +52 -0
- package/esm/app-bar/search/app-bar-search.js +101 -0
- package/esm/app-bar/search/index.d.ts +10 -0
- package/esm/app-bar/search/index.js +14 -0
- package/esm/autocomplete/autocomplete-adapter.d.ts +90 -0
- package/esm/autocomplete/autocomplete-adapter.js +222 -0
- package/esm/autocomplete/autocomplete-component-delegate.d.ts +34 -0
- package/esm/autocomplete/autocomplete-component-delegate.js +76 -0
- package/esm/autocomplete/autocomplete-constants.d.ts +68 -0
- package/esm/autocomplete/autocomplete-constants.js +49 -0
- package/esm/autocomplete/autocomplete-foundation.d.ts +175 -0
- package/esm/autocomplete/autocomplete-foundation.js +857 -0
- package/esm/autocomplete/autocomplete-utils.d.ts +22 -0
- package/esm/autocomplete/autocomplete-utils.js +36 -0
- package/esm/autocomplete/autocomplete.d.ts +85 -0
- package/esm/autocomplete/autocomplete.js +162 -0
- package/esm/autocomplete/index.d.ts +12 -0
- package/esm/autocomplete/index.js +16 -0
- package/esm/avatar/avatar-adapter.d.ts +42 -0
- package/esm/avatar/avatar-adapter.js +63 -0
- package/esm/avatar/avatar-component-delegate.d.ts +16 -0
- package/esm/avatar/avatar-component-delegate.js +15 -0
- package/esm/avatar/avatar-constants.d.ts +25 -0
- package/esm/avatar/avatar-constants.js +32 -0
- package/esm/avatar/avatar-foundation.d.ts +47 -0
- package/esm/avatar/avatar-foundation.js +119 -0
- package/esm/avatar/avatar.d.ts +36 -0
- package/esm/avatar/avatar.js +71 -0
- package/esm/avatar/index.d.ts +11 -0
- package/esm/avatar/index.js +15 -0
- package/esm/backdrop/backdrop-adapter.d.ts +36 -0
- package/esm/backdrop/backdrop-adapter.js +40 -0
- package/esm/backdrop/backdrop-constants.d.ts +26 -0
- package/esm/backdrop/backdrop-constants.js +31 -0
- package/esm/backdrop/backdrop-foundation.d.ts +38 -0
- package/esm/backdrop/backdrop-foundation.js +82 -0
- package/esm/backdrop/backdrop.d.ts +51 -0
- package/esm/backdrop/backdrop.js +85 -0
- package/esm/backdrop/index.d.ts +10 -0
- package/esm/backdrop/index.js +14 -0
- package/esm/badge/badge-adapter.d.ts +17 -0
- package/esm/badge/badge-adapter.js +20 -0
- package/esm/badge/badge-component-delegate.d.ts +16 -0
- package/esm/badge/badge-component-delegate.js +15 -0
- package/esm/badge/badge-constants.d.ts +21 -0
- package/esm/badge/badge-constants.js +26 -0
- package/esm/badge/badge-foundation.d.ts +24 -0
- package/esm/badge/badge-foundation.js +55 -0
- package/esm/badge/badge.d.ts +26 -0
- package/esm/badge/badge.js +51 -0
- package/esm/badge/index.d.ts +11 -0
- package/esm/badge/index.js +15 -0
- package/esm/banner/banner-adapter.d.ts +30 -0
- package/esm/banner/banner-adapter.js +44 -0
- package/esm/banner/banner-constants.d.ts +34 -0
- package/esm/banner/banner-constants.js +41 -0
- package/esm/banner/banner-foundation.d.ts +31 -0
- package/esm/banner/banner-foundation.js +73 -0
- package/esm/banner/banner.d.ts +35 -0
- package/esm/banner/banner.js +67 -0
- package/esm/banner/index.d.ts +10 -0
- package/esm/banner/index.js +14 -0
- package/esm/bottom-sheet/bottom-sheet-adapter.d.ts +70 -0
- package/esm/bottom-sheet/bottom-sheet-adapter.js +129 -0
- package/esm/bottom-sheet/bottom-sheet-constants.d.ts +49 -0
- package/esm/bottom-sheet/bottom-sheet-constants.js +47 -0
- package/esm/bottom-sheet/bottom-sheet-foundation.d.ts +79 -0
- package/esm/bottom-sheet/bottom-sheet-foundation.js +327 -0
- package/esm/bottom-sheet/bottom-sheet.d.ts +58 -0
- package/esm/bottom-sheet/bottom-sheet.js +85 -0
- package/esm/bottom-sheet/index.d.ts +10 -0
- package/esm/bottom-sheet/index.js +14 -0
- package/esm/busy-indicator/busy-indicator-adapter.d.ts +159 -0
- package/esm/busy-indicator/busy-indicator-adapter.js +201 -0
- package/esm/busy-indicator/busy-indicator-constants.d.ts +49 -0
- package/esm/busy-indicator/busy-indicator-constants.js +58 -0
- package/esm/busy-indicator/busy-indicator-foundation.d.ts +97 -0
- package/esm/busy-indicator/busy-indicator-foundation.js +268 -0
- package/esm/busy-indicator/busy-indicator.d.ts +73 -0
- package/esm/busy-indicator/busy-indicator.js +111 -0
- package/esm/busy-indicator/index.d.ts +10 -0
- package/esm/busy-indicator/index.js +14 -0
- package/esm/button/button-component-delegate.d.ts +24 -0
- package/esm/button/button-component-delegate.js +39 -0
- package/esm/button/button-constants.d.ts +28 -0
- package/esm/button/button-constants.js +33 -0
- package/esm/button/button.d.ts +43 -0
- package/esm/button/button.js +160 -0
- package/esm/button/index.d.ts +9 -0
- package/esm/button/index.js +13 -0
- package/esm/button-toggle/button-toggle/button-toggle-adapter.d.ts +30 -0
- package/esm/button-toggle/button-toggle/button-toggle-adapter.js +62 -0
- package/esm/button-toggle/button-toggle/button-toggle-constants.d.ts +33 -0
- package/esm/button-toggle/button-toggle/button-toggle-constants.js +35 -0
- package/esm/button-toggle/button-toggle/button-toggle-foundation.d.ts +37 -0
- package/esm/button-toggle/button-toggle/button-toggle-foundation.js +74 -0
- package/esm/button-toggle/button-toggle/button-toggle.d.ts +37 -0
- package/esm/button-toggle/button-toggle/button-toggle.js +76 -0
- package/esm/button-toggle/button-toggle/index.d.ts +10 -0
- package/esm/button-toggle/button-toggle/index.js +14 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-adapter.d.ts +44 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-adapter.js +125 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-constants.d.ts +35 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-constants.js +33 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-foundation.d.ts +57 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group-foundation.js +198 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group.d.ts +38 -0
- package/esm/button-toggle/button-toggle-group/button-toggle-group.js +94 -0
- package/esm/button-toggle/button-toggle-group/index.d.ts +10 -0
- package/esm/button-toggle/button-toggle-group/index.js +14 -0
- package/esm/button-toggle/index.d.ts +7 -0
- package/esm/button-toggle/index.js +7 -0
- package/esm/calendar/calendar-adapter.d.ts +160 -0
- package/esm/calendar/calendar-adapter.js +425 -0
- package/esm/calendar/calendar-component-delegate.d.ts +21 -0
- package/esm/calendar/calendar-component-delegate.js +27 -0
- package/esm/calendar/calendar-constants.d.ts +261 -0
- package/esm/calendar/calendar-constants.js +170 -0
- package/esm/calendar/calendar-dom-utils.d.ts +46 -0
- package/esm/calendar/calendar-dom-utils.js +301 -0
- package/esm/calendar/calendar-dropdown/calendar-dropdown-constants.d.ts +15 -0
- package/esm/calendar/calendar-dropdown/calendar-dropdown-constants.js +11 -0
- package/esm/calendar/calendar-dropdown/calendar-dropdown.d.ts +41 -0
- package/esm/calendar/calendar-dropdown/calendar-dropdown.js +106 -0
- package/esm/calendar/calendar-dropdown/index.d.ts +7 -0
- package/esm/calendar/calendar-dropdown/index.js +7 -0
- package/esm/calendar/calendar-foundation.d.ts +547 -0
- package/esm/calendar/calendar-foundation.js +2218 -0
- package/esm/calendar/calendar-locale-utils.d.ts +20 -0
- package/esm/calendar/calendar-locale-utils.js +133 -0
- package/esm/calendar/calendar-menu/calendar-menu-adapter.d.ts +43 -0
- package/esm/calendar/calendar-menu/calendar-menu-adapter.js +156 -0
- package/esm/calendar/calendar-menu/calendar-menu-constants.d.ts +74 -0
- package/esm/calendar/calendar-menu/calendar-menu-constants.js +76 -0
- package/esm/calendar/calendar-menu/calendar-menu-foundation.d.ts +66 -0
- package/esm/calendar/calendar-menu/calendar-menu-foundation.js +229 -0
- package/esm/calendar/calendar-menu/calendar-menu-utils.d.ts +12 -0
- package/esm/calendar/calendar-menu/calendar-menu-utils.js +85 -0
- package/esm/calendar/calendar-menu/calendar-menu.d.ts +48 -0
- package/esm/calendar/calendar-menu/calendar-menu.js +86 -0
- package/esm/calendar/calendar-menu/index.d.ts +11 -0
- package/esm/calendar/calendar-menu/index.js +15 -0
- package/esm/calendar/calendar-utils.d.ts +64 -0
- package/esm/calendar/calendar-utils.js +309 -0
- package/esm/calendar/calendar.d.ts +96 -0
- package/esm/calendar/calendar.js +282 -0
- package/esm/calendar/core/calendar-base.d.ts +34 -0
- package/esm/calendar/core/calendar-base.js +6 -0
- package/esm/calendar/core/date-range.d.ts +15 -0
- package/esm/calendar/core/date-range.js +16 -0
- package/esm/calendar/core/index.d.ts +7 -0
- package/esm/calendar/core/index.js +7 -0
- package/esm/calendar/index.d.ts +17 -0
- package/esm/calendar/index.js +21 -0
- package/esm/card/card-constants.d.ts +17 -0
- package/esm/card/card-constants.js +22 -0
- package/esm/card/card.d.ts +27 -0
- package/esm/card/card.js +58 -0
- package/esm/card/index.d.ts +8 -0
- package/esm/card/index.js +12 -0
- package/esm/checkbox/checkbox-adapter.d.ts +71 -0
- package/esm/checkbox/checkbox-adapter.js +216 -0
- package/esm/checkbox/checkbox-component-delegate.d.ts +37 -0
- package/esm/checkbox/checkbox-component-delegate.js +92 -0
- package/esm/checkbox/checkbox-constants.d.ts +72 -0
- package/esm/checkbox/checkbox-constants.js +67 -0
- package/esm/checkbox/checkbox-foundation.d.ts +35 -0
- package/esm/checkbox/checkbox-foundation.js +175 -0
- package/esm/checkbox/checkbox.d.ts +28 -0
- package/esm/checkbox/checkbox.js +69 -0
- package/esm/checkbox/index.d.ts +11 -0
- package/esm/checkbox/index.js +15 -0
- package/esm/chip-field/chip-field-adapter.d.ts +32 -0
- package/esm/chip-field/chip-field-adapter.js +51 -0
- package/esm/chip-field/chip-field-component-delegate.d.ts +45 -0
- package/esm/chip-field/chip-field-component-delegate.js +125 -0
- package/esm/chip-field/chip-field-constants.d.ts +31 -0
- package/esm/chip-field/chip-field-constants.js +36 -0
- package/esm/chip-field/chip-field-foundation.d.ts +30 -0
- package/esm/chip-field/chip-field-foundation.js +151 -0
- package/esm/chip-field/chip-field.d.ts +21 -0
- package/esm/chip-field/chip-field.js +28 -0
- package/esm/chip-field/index.d.ts +11 -0
- package/esm/chip-field/index.js +15 -0
- package/esm/chips/chip/chip-adapter.d.ts +51 -0
- package/esm/chips/chip/chip-adapter.js +115 -0
- package/esm/chips/chip/chip-constants.d.ts +53 -0
- package/esm/chips/chip/chip-constants.js +47 -0
- package/esm/chips/chip/chip-foundation.d.ts +69 -0
- package/esm/chips/chip/chip-foundation.js +264 -0
- package/esm/chips/chip/chip.d.ts +50 -0
- package/esm/chips/chip/chip.js +98 -0
- package/esm/chips/chip/index.d.ts +10 -0
- package/esm/chips/chip/index.js +14 -0
- package/esm/chips/chip-set/chip-set-adapter.d.ts +23 -0
- package/esm/chips/chip-set/chip-set-adapter.js +33 -0
- package/esm/chips/chip-set/chip-set-constants.d.ts +21 -0
- package/esm/chips/chip-set/chip-set-constants.js +26 -0
- package/esm/chips/chip-set/chip-set-foundation.d.ts +35 -0
- package/esm/chips/chip-set/chip-set-foundation.js +74 -0
- package/esm/chips/chip-set/chip-set.d.ts +29 -0
- package/esm/chips/chip-set/chip-set.js +67 -0
- package/esm/chips/chip-set/index.d.ts +10 -0
- package/esm/chips/chip-set/index.js +14 -0
- package/esm/chips/index.d.ts +7 -0
- package/esm/chips/index.js +7 -0
- package/esm/circular-progress/circular-progress-adapter.d.ts +28 -0
- package/esm/circular-progress/circular-progress-adapter.js +42 -0
- package/esm/circular-progress/circular-progress-constants.d.ts +17 -0
- package/esm/circular-progress/circular-progress-constants.js +21 -0
- package/esm/circular-progress/circular-progress-foundation.d.ts +32 -0
- package/esm/circular-progress/circular-progress-foundation.js +66 -0
- package/esm/circular-progress/circular-progress.d.ts +27 -0
- package/esm/circular-progress/circular-progress.js +65 -0
- package/esm/circular-progress/index.d.ts +10 -0
- package/esm/circular-progress/index.js +14 -0
- package/esm/color-picker/color-picker-adapter.d.ts +78 -0
- package/esm/color-picker/color-picker-adapter.js +175 -0
- package/esm/color-picker/color-picker-constants.d.ts +79 -0
- package/esm/color-picker/color-picker-constants.js +65 -0
- package/esm/color-picker/color-picker-foundation.d.ts +67 -0
- package/esm/color-picker/color-picker-foundation.js +235 -0
- package/esm/color-picker/color-picker-gradient-slider.d.ts +30 -0
- package/esm/color-picker/color-picker-gradient-slider.js +135 -0
- package/esm/color-picker/color-picker-slider.d.ts +38 -0
- package/esm/color-picker/color-picker-slider.js +118 -0
- package/esm/color-picker/color-picker-utils.d.ts +40 -0
- package/esm/color-picker/color-picker-utils.js +197 -0
- package/esm/color-picker/color-picker.d.ts +43 -0
- package/esm/color-picker/color-picker.js +80 -0
- package/esm/color-picker/index.d.ts +10 -0
- package/esm/color-picker/index.js +14 -0
- package/esm/constants.d.ts +9 -0
- package/esm/constants.js +9 -0
- package/esm/core/base/base-adapter.d.ts +42 -0
- package/esm/core/base/base-adapter.js +56 -0
- package/esm/core/base/base-component.d.ts +11 -0
- package/esm/core/base/base-component.js +8 -0
- package/esm/core/base/index.d.ts +7 -0
- package/esm/core/base/index.js +7 -0
- package/esm/core/delegates/base-component-delegate.d.ts +40 -0
- package/esm/core/delegates/base-component-delegate.js +84 -0
- package/esm/core/delegates/form-field-component-delegate.d.ts +24 -0
- package/esm/core/delegates/form-field-component-delegate.js +11 -0
- package/esm/core/delegates/index.d.ts +7 -0
- package/esm/core/delegates/index.js +7 -0
- package/esm/core/index.d.ts +9 -0
- package/esm/core/index.js +9 -0
- package/esm/core/mask/date-input-mask.d.ts +35 -0
- package/esm/core/mask/date-input-mask.js +155 -0
- package/esm/core/mask/index.d.ts +7 -0
- package/esm/core/mask/index.js +7 -0
- package/esm/core/mask/time-input-mask.d.ts +38 -0
- package/esm/core/mask/time-input-mask.js +163 -0
- package/esm/core/utils/date-utils.d.ts +42 -0
- package/esm/core/utils/date-utils.js +133 -0
- package/esm/core/utils/index.d.ts +9 -0
- package/esm/core/utils/index.js +9 -0
- package/esm/core/utils/svg-utils.d.ts +14 -0
- package/esm/core/utils/svg-utils.js +62 -0
- package/esm/core/utils/time-utils.d.ts +21 -0
- package/esm/core/utils/time-utils.js +111 -0
- package/esm/core/utils/utils.d.ts +11 -0
- package/esm/core/utils/utils.js +26 -0
- package/esm/date-picker/base/base-date-picker-adapter.d.ts +98 -0
- package/esm/date-picker/base/base-date-picker-adapter.js +157 -0
- package/esm/date-picker/base/base-date-picker-constants.d.ts +52 -0
- package/esm/date-picker/base/base-date-picker-constants.js +33 -0
- package/esm/date-picker/base/base-date-picker-foundation.d.ts +152 -0
- package/esm/date-picker/base/base-date-picker-foundation.js +608 -0
- package/esm/date-picker/base/base-date-picker-utils.d.ts +6 -0
- package/esm/date-picker/base/base-date-picker-utils.js +21 -0
- package/esm/date-picker/base/base-date-picker.d.ts +82 -0
- package/esm/date-picker/base/base-date-picker.js +135 -0
- package/esm/date-picker/date-picker-adapter.d.ts +39 -0
- package/esm/date-picker/date-picker-adapter.js +121 -0
- package/esm/date-picker/date-picker-component-delegate.d.ts +34 -0
- package/esm/date-picker/date-picker-component-delegate.js +73 -0
- package/esm/date-picker/date-picker-constants.d.ts +20 -0
- package/esm/date-picker/date-picker-constants.js +25 -0
- package/esm/date-picker/date-picker-foundation.d.ts +34 -0
- package/esm/date-picker/date-picker-foundation.js +155 -0
- package/esm/date-picker/date-picker.d.ts +26 -0
- package/esm/date-picker/date-picker.js +54 -0
- package/esm/date-picker/index.d.ts +11 -0
- package/esm/date-picker/index.js +15 -0
- package/esm/date-range-picker/date-range-picker-adapter.d.ts +65 -0
- package/esm/date-range-picker/date-range-picker-adapter.js +190 -0
- package/esm/date-range-picker/date-range-picker-component-delegate.d.ts +41 -0
- package/esm/date-range-picker/date-range-picker-component-delegate.js +86 -0
- package/esm/date-range-picker/date-range-picker-constants.d.ts +34 -0
- package/esm/date-range-picker/date-range-picker-constants.js +38 -0
- package/esm/date-range-picker/date-range-picker-foundation.d.ts +60 -0
- package/esm/date-range-picker/date-range-picker-foundation.js +342 -0
- package/esm/date-range-picker/date-range-picker.d.ts +33 -0
- package/esm/date-range-picker/date-range-picker.js +64 -0
- package/esm/date-range-picker/index.d.ts +11 -0
- package/esm/date-range-picker/index.js +15 -0
- package/esm/dialog/dialog-adapter.d.ts +75 -0
- package/esm/dialog/dialog-adapter.js +164 -0
- package/esm/dialog/dialog-constants.d.ts +65 -0
- package/esm/dialog/dialog-constants.js +59 -0
- package/esm/dialog/dialog-foundation.d.ts +102 -0
- package/esm/dialog/dialog-foundation.js +451 -0
- package/esm/dialog/dialog.d.ts +71 -0
- package/esm/dialog/dialog.js +120 -0
- package/esm/dialog/index.d.ts +10 -0
- package/esm/dialog/index.js +14 -0
- package/esm/divider/divider-constants.d.ts +11 -0
- package/esm/divider/divider-constants.js +14 -0
- package/esm/divider/divider.d.ts +19 -0
- package/esm/divider/divider.js +26 -0
- package/esm/divider/index.d.ts +8 -0
- package/esm/divider/index.js +12 -0
- package/esm/drawer/base/base-drawer-adapter.d.ts +24 -0
- package/esm/drawer/base/base-drawer-adapter.js +48 -0
- package/esm/drawer/base/base-drawer-constants.d.ts +27 -0
- package/esm/drawer/base/base-drawer-constants.js +30 -0
- package/esm/drawer/base/base-drawer-foundation.d.ts +32 -0
- package/esm/drawer/base/base-drawer-foundation.js +89 -0
- package/esm/drawer/base/base-drawer.d.ts +30 -0
- package/esm/drawer/base/base-drawer.js +42 -0
- package/esm/drawer/base/index.d.ts +9 -0
- package/esm/drawer/base/index.js +9 -0
- package/esm/drawer/drawer/drawer-constants.d.ts +8 -0
- package/esm/drawer/drawer/drawer-constants.js +10 -0
- package/esm/drawer/drawer/drawer.d.ts +21 -0
- package/esm/drawer/drawer/drawer.js +24 -0
- package/esm/drawer/drawer/index.d.ts +8 -0
- package/esm/drawer/drawer/index.js +12 -0
- package/esm/drawer/index.d.ts +9 -0
- package/esm/drawer/index.js +9 -0
- package/esm/drawer/mini-drawer/index.d.ts +8 -0
- package/esm/drawer/mini-drawer/index.js +12 -0
- package/esm/drawer/mini-drawer/mini-drawer-constants.d.ts +11 -0
- package/esm/drawer/mini-drawer/mini-drawer-constants.js +14 -0
- package/esm/drawer/mini-drawer/mini-drawer.d.ts +17 -0
- package/esm/drawer/mini-drawer/mini-drawer.js +24 -0
- package/esm/drawer/modal-drawer/index.d.ts +10 -0
- package/esm/drawer/modal-drawer/index.js +14 -0
- package/esm/drawer/modal-drawer/modal-drawer-adapter.d.ts +20 -0
- package/esm/drawer/modal-drawer/modal-drawer-adapter.js +30 -0
- package/esm/drawer/modal-drawer/modal-drawer-constants.d.ts +15 -0
- package/esm/drawer/modal-drawer/modal-drawer-constants.js +19 -0
- package/esm/drawer/modal-drawer/modal-drawer-foundation.d.ts +22 -0
- package/esm/drawer/modal-drawer/modal-drawer-foundation.js +52 -0
- package/esm/drawer/modal-drawer/modal-drawer.d.ts +21 -0
- package/esm/drawer/modal-drawer/modal-drawer.js +28 -0
- package/esm/expansion-panel/expansion-panel-adapter.d.ts +33 -0
- package/esm/expansion-panel/expansion-panel-adapter.js +182 -0
- package/esm/expansion-panel/expansion-panel-constants.d.ts +38 -0
- package/esm/expansion-panel/expansion-panel-constants.js +47 -0
- package/esm/expansion-panel/expansion-panel-foundation.d.ts +59 -0
- package/esm/expansion-panel/expansion-panel-foundation.js +151 -0
- package/esm/expansion-panel/expansion-panel.d.ts +60 -0
- package/esm/expansion-panel/expansion-panel.js +81 -0
- package/esm/expansion-panel/index.d.ts +10 -0
- package/esm/expansion-panel/index.js +14 -0
- package/esm/field/field-adapter.d.ts +101 -0
- package/esm/field/field-adapter.js +184 -0
- package/esm/field/field-constants.d.ts +36 -0
- package/esm/field/field-constants.js +36 -0
- package/esm/field/field-foundation.d.ts +65 -0
- package/esm/field/field-foundation.js +328 -0
- package/esm/field/field.d.ts +40 -0
- package/esm/field/field.js +78 -0
- package/esm/file-picker/file-picker-adapter.d.ts +81 -0
- package/esm/file-picker/file-picker-adapter.js +134 -0
- package/esm/file-picker/file-picker-component-delegate.d.ts +23 -0
- package/esm/file-picker/file-picker-component-delegate.js +49 -0
- package/esm/file-picker/file-picker-constants.d.ts +41 -0
- package/esm/file-picker/file-picker-constants.js +44 -0
- package/esm/file-picker/file-picker-foundation.d.ts +66 -0
- package/esm/file-picker/file-picker-foundation.js +226 -0
- package/esm/file-picker/file-picker.d.ts +45 -0
- package/esm/file-picker/file-picker.js +88 -0
- package/esm/file-picker/index.d.ts +11 -0
- package/esm/file-picker/index.js +15 -0
- package/esm/floating-action-button/floating-action-button-component-delegate.d.ts +22 -0
- package/esm/floating-action-button/floating-action-button-component-delegate.js +36 -0
- package/esm/floating-action-button/floating-action-button-constants.d.ts +27 -0
- package/esm/floating-action-button/floating-action-button-constants.js +32 -0
- package/esm/floating-action-button/floating-action-button.d.ts +40 -0
- package/esm/floating-action-button/floating-action-button.js +126 -0
- package/esm/floating-action-button/index.d.ts +9 -0
- package/esm/floating-action-button/index.js +13 -0
- package/esm/floating-label/floating-label-adapter.d.ts +23 -0
- package/esm/floating-label/floating-label-adapter.js +32 -0
- package/esm/floating-label/floating-label-constants.d.ts +13 -0
- package/esm/floating-label/floating-label-constants.js +14 -0
- package/esm/floating-label/floating-label-foundation.d.ts +17 -0
- package/esm/floating-label/floating-label-foundation.js +71 -0
- package/esm/floating-label/floating-label.d.ts +27 -0
- package/esm/floating-label/floating-label.js +34 -0
- package/esm/floating-label/index.d.ts +9 -0
- package/esm/floating-label/index.js +9 -0
- package/esm/icon/icon-adapter.d.ts +23 -0
- package/esm/icon/icon-adapter.js +43 -0
- package/esm/icon/icon-component-delegate.d.ts +15 -0
- package/esm/icon/icon-component-delegate.js +15 -0
- package/esm/icon/icon-constants.d.ts +27 -0
- package/esm/icon/icon-constants.js +31 -0
- package/esm/icon/icon-foundation.d.ts +58 -0
- package/esm/icon/icon-foundation.js +187 -0
- package/esm/icon/icon-registry.d.ts +53 -0
- package/esm/icon/icon-registry.js +94 -0
- package/esm/icon/icon-utils.d.ts +12 -0
- package/esm/icon/icon-utils.js +66 -0
- package/esm/icon/icon.d.ts +46 -0
- package/esm/icon/icon.js +89 -0
- package/esm/icon/index.d.ts +13 -0
- package/esm/icon/index.js +23 -0
- package/esm/icon-button/icon-button-component-delegate.d.ts +31 -0
- package/esm/icon-button/icon-button-component-delegate.js +68 -0
- package/esm/icon-button/icon-button-constants.d.ts +30 -0
- package/esm/icon-button/icon-button-constants.js +43 -0
- package/esm/icon-button/icon-button.d.ts +57 -0
- package/esm/icon-button/icon-button.js +219 -0
- package/esm/icon-button/index.d.ts +9 -0
- package/esm/icon-button/index.js +13 -0
- package/esm/index.d.ts +70 -0
- package/esm/index.js +212 -0
- package/esm/inline-message/index.d.ts +8 -0
- package/esm/inline-message/index.js +12 -0
- package/esm/inline-message/inline-message-constants.d.ts +11 -0
- package/esm/inline-message/inline-message-constants.js +14 -0
- package/esm/inline-message/inline-message.d.ts +16 -0
- package/esm/inline-message/inline-message.js +23 -0
- package/esm/keyboard-shortcut/index.d.ts +11 -0
- package/esm/keyboard-shortcut/index.js +15 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-adapter.d.ts +44 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-adapter.js +79 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-constants.d.ts +29 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-constants.js +44 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-foundation.d.ts +63 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-foundation.js +165 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-utils.d.ts +16 -0
- package/esm/keyboard-shortcut/keyboard-shortcut-utils.js +61 -0
- package/esm/keyboard-shortcut/keyboard-shortcut.d.ts +45 -0
- package/esm/keyboard-shortcut/keyboard-shortcut.js +93 -0
- package/esm/label-value/index.d.ts +11 -0
- package/esm/label-value/index.js +15 -0
- package/esm/label-value/label-value-adapter.d.ts +24 -0
- package/esm/label-value/label-value-adapter.js +47 -0
- package/esm/label-value/label-value-component-delegate.d.ts +29 -0
- package/esm/label-value/label-value-component-delegate.js +54 -0
- package/esm/label-value/label-value-constants.d.ts +27 -0
- package/esm/label-value/label-value-constants.js +30 -0
- package/esm/label-value/label-value-foundation.d.ts +33 -0
- package/esm/label-value/label-value-foundation.js +80 -0
- package/esm/label-value/label-value.d.ts +34 -0
- package/esm/label-value/label-value.js +65 -0
- package/esm/linear-progress/index.d.ts +8 -0
- package/esm/linear-progress/index.js +12 -0
- package/esm/linear-progress/linear-progress-constants.d.ts +18 -0
- package/esm/linear-progress/linear-progress-constants.js +22 -0
- package/esm/linear-progress/linear-progress.d.ts +44 -0
- package/esm/linear-progress/linear-progress.js +143 -0
- package/esm/list/index.d.ts +7 -0
- package/esm/list/index.js +7 -0
- package/esm/list/list/index.d.ts +10 -0
- package/esm/list/list/index.js +14 -0
- package/esm/list/list/list-adapter.d.ts +61 -0
- package/esm/list/list/list-adapter.js +99 -0
- package/esm/list/list/list-constants.d.ts +18 -0
- package/esm/list/list/list-constants.js +22 -0
- package/esm/list/list/list-foundation.d.ts +48 -0
- package/esm/list/list/list-foundation.js +142 -0
- package/esm/list/list/list.d.ts +38 -0
- package/esm/list/list/list.js +77 -0
- package/esm/list/list-item/index.d.ts +10 -0
- package/esm/list/list-item/index.js +14 -0
- package/esm/list/list-item/list-item-adapter.d.ts +101 -0
- package/esm/list/list-item/list-item-adapter.js +175 -0
- package/esm/list/list-item/list-item-constants.d.ts +57 -0
- package/esm/list/list-item/list-item-constants.js +59 -0
- package/esm/list/list-item/list-item-foundation.d.ts +102 -0
- package/esm/list/list-item/list-item-foundation.js +305 -0
- package/esm/list/list-item/list-item.d.ts +72 -0
- package/esm/list/list-item/list-item.js +168 -0
- package/esm/list-dropdown/cascading-list-dropdown-aware-foundation.d.ts +43 -0
- package/esm/list-dropdown/cascading-list-dropdown-aware-foundation.js +62 -0
- package/esm/list-dropdown/index.d.ts +10 -0
- package/esm/list-dropdown/index.js +10 -0
- package/esm/list-dropdown/list-dropdown-adapter.d.ts +64 -0
- package/esm/list-dropdown/list-dropdown-adapter.js +282 -0
- package/esm/list-dropdown/list-dropdown-aware-foundation.d.ts +40 -0
- package/esm/list-dropdown/list-dropdown-aware-foundation.js +62 -0
- package/esm/list-dropdown/list-dropdown-aware.d.ts +34 -0
- package/esm/list-dropdown/list-dropdown-aware.js +54 -0
- package/esm/list-dropdown/list-dropdown-constants.d.ts +101 -0
- package/esm/list-dropdown/list-dropdown-constants.js +39 -0
- package/esm/list-dropdown/list-dropdown-foundation.d.ts +64 -0
- package/esm/list-dropdown/list-dropdown-foundation.js +224 -0
- package/esm/list-dropdown/list-dropdown-utils.d.ts +35 -0
- package/esm/list-dropdown/list-dropdown-utils.js +347 -0
- package/esm/list-dropdown/list-dropdown.d.ts +63 -0
- package/esm/list-dropdown/list-dropdown.js +86 -0
- package/esm/menu/index.d.ts +10 -0
- package/esm/menu/index.js +14 -0
- package/esm/menu/menu-adapter.d.ts +67 -0
- package/esm/menu/menu-adapter.js +202 -0
- package/esm/menu/menu-constants.d.ts +59 -0
- package/esm/menu/menu-constants.js +48 -0
- package/esm/menu/menu-foundation.d.ts +101 -0
- package/esm/menu/menu-foundation.js +514 -0
- package/esm/menu/menu.d.ts +71 -0
- package/esm/menu/menu.js +136 -0
- package/esm/open-icon/index.d.ts +10 -0
- package/esm/open-icon/index.js +14 -0
- package/esm/open-icon/open-icon-adapter.d.ts +18 -0
- package/esm/open-icon/open-icon-adapter.js +27 -0
- package/esm/open-icon/open-icon-constants.d.ts +20 -0
- package/esm/open-icon/open-icon-constants.js +25 -0
- package/esm/open-icon/open-icon-foundation.d.ts +22 -0
- package/esm/open-icon/open-icon-foundation.js +35 -0
- package/esm/open-icon/open-icon.d.ts +29 -0
- package/esm/open-icon/open-icon.js +55 -0
- package/esm/page-state/index.d.ts +8 -0
- package/esm/page-state/index.js +12 -0
- package/esm/page-state/page-state-constants.d.ts +8 -0
- package/esm/page-state/page-state-constants.js +10 -0
- package/esm/page-state/page-state.d.ts +16 -0
- package/esm/page-state/page-state.js +23 -0
- package/esm/paginator/index.d.ts +10 -0
- package/esm/paginator/index.js +14 -0
- package/esm/paginator/paginator-adapter.d.ts +96 -0
- package/esm/paginator/paginator-adapter.js +149 -0
- package/esm/paginator/paginator-constants.d.ts +74 -0
- package/esm/paginator/paginator-constants.js +75 -0
- package/esm/paginator/paginator-foundation.d.ts +132 -0
- package/esm/paginator/paginator-foundation.js +402 -0
- package/esm/paginator/paginator.d.ts +59 -0
- package/esm/paginator/paginator.js +135 -0
- package/esm/popup/index.d.ts +10 -0
- package/esm/popup/index.js +14 -0
- package/esm/popup/popup-adapter.d.ts +43 -0
- package/esm/popup/popup-adapter.js +136 -0
- package/esm/popup/popup-constants.d.ts +54 -0
- package/esm/popup/popup-constants.js +52 -0
- package/esm/popup/popup-foundation.d.ts +68 -0
- package/esm/popup/popup-foundation.js +249 -0
- package/esm/popup/popup.d.ts +49 -0
- package/esm/popup/popup.js +94 -0
- package/esm/product-icon/index.d.ts +10 -0
- package/esm/product-icon/index.js +14 -0
- package/esm/product-icon/product-icon-adapter.d.ts +27 -0
- package/esm/product-icon/product-icon-adapter.js +50 -0
- package/esm/product-icon/product-icon-constants.d.ts +38 -0
- package/esm/product-icon/product-icon-constants.js +46 -0
- package/esm/product-icon/product-icon-foundation.d.ts +40 -0
- package/esm/product-icon/product-icon-foundation.js +116 -0
- package/esm/product-icon/product-icon.d.ts +32 -0
- package/esm/product-icon/product-icon.js +65 -0
- package/esm/profile-card/index.d.ts +10 -0
- package/esm/profile-card/index.js +14 -0
- package/esm/profile-card/profile-card-adapter.d.ts +46 -0
- package/esm/profile-card/profile-card-adapter.js +81 -0
- package/esm/profile-card/profile-card-constants.d.ts +33 -0
- package/esm/profile-card/profile-card-constants.js +39 -0
- package/esm/profile-card/profile-card-foundation.d.ts +48 -0
- package/esm/profile-card/profile-card-foundation.js +108 -0
- package/esm/profile-card/profile-card.d.ts +38 -0
- package/esm/profile-card/profile-card.js +94 -0
- package/esm/quantity-field/index.d.ts +11 -0
- package/esm/quantity-field/index.js +15 -0
- package/esm/quantity-field/quantity-field-adapter.d.ts +77 -0
- package/esm/quantity-field/quantity-field-adapter.js +225 -0
- package/esm/quantity-field/quantity-field-component-delegate.d.ts +44 -0
- package/esm/quantity-field/quantity-field-component-delegate.js +129 -0
- package/esm/quantity-field/quantity-field-constants.d.ts +35 -0
- package/esm/quantity-field/quantity-field-constants.js +41 -0
- package/esm/quantity-field/quantity-field-foundation.d.ts +36 -0
- package/esm/quantity-field/quantity-field-foundation.js +100 -0
- package/esm/quantity-field/quantity-field.d.ts +29 -0
- package/esm/quantity-field/quantity-field.js +89 -0
- package/esm/radio/index.d.ts +8 -0
- package/esm/radio/index.js +12 -0
- package/esm/radio/radio-adapter.d.ts +70 -0
- package/esm/radio/radio-adapter.js +250 -0
- package/esm/radio/radio-constants.d.ts +30 -0
- package/esm/radio/radio-constants.js +36 -0
- package/esm/radio/radio-foundation.d.ts +31 -0
- package/esm/radio/radio-foundation.js +80 -0
- package/esm/radio/radio.d.ts +31 -0
- package/esm/radio/radio.js +73 -0
- package/esm/ripple/forge-ripple.d.ts +11 -0
- package/esm/ripple/forge-ripple.js +10 -0
- package/esm/ripple/index.d.ts +11 -0
- package/esm/ripple/index.js +15 -0
- package/esm/ripple/ripple-adapter.d.ts +23 -0
- package/esm/ripple/ripple-adapter.js +47 -0
- package/esm/ripple/ripple-constants.d.ts +15 -0
- package/esm/ripple/ripple-constants.js +19 -0
- package/esm/ripple/ripple-foundation.d.ts +30 -0
- package/esm/ripple/ripple-foundation.js +48 -0
- package/esm/ripple/ripple.d.ts +31 -0
- package/esm/ripple/ripple.js +59 -0
- package/esm/scaffold/index.d.ts +8 -0
- package/esm/scaffold/index.js +12 -0
- package/esm/scaffold/scaffold-constants.d.ts +8 -0
- package/esm/scaffold/scaffold-constants.js +10 -0
- package/esm/scaffold/scaffold.d.ts +19 -0
- package/esm/scaffold/scaffold.js +26 -0
- package/esm/select/core/base-select-adapter.d.ts +68 -0
- package/esm/select/core/base-select-adapter.js +167 -0
- package/esm/select/core/base-select-constants.d.ts +28 -0
- package/esm/select/core/base-select-constants.js +22 -0
- package/esm/select/core/base-select-foundation.d.ts +137 -0
- package/esm/select/core/base-select-foundation.js +609 -0
- package/esm/select/core/base-select.d.ts +51 -0
- package/esm/select/core/base-select.js +67 -0
- package/esm/select/core/index.d.ts +10 -0
- package/esm/select/core/index.js +10 -0
- package/esm/select/core/select-utils.d.ts +18 -0
- package/esm/select/core/select-utils.js +27 -0
- package/esm/select/index.d.ts +20 -0
- package/esm/select/index.js +11 -0
- package/esm/select/option/index.d.ts +10 -0
- package/esm/select/option/index.js +14 -0
- package/esm/select/option/option-adapter.d.ts +17 -0
- package/esm/select/option/option-adapter.js +14 -0
- package/esm/select/option/option-constants.d.ts +21 -0
- package/esm/select/option/option-constants.js +24 -0
- package/esm/select/option/option-foundation.d.ts +67 -0
- package/esm/select/option/option-foundation.js +149 -0
- package/esm/select/option/option.d.ts +51 -0
- package/esm/select/option/option.js +122 -0
- package/esm/select/option-group/index.d.ts +8 -0
- package/esm/select/option-group/index.js +12 -0
- package/esm/select/option-group/option-group-constants.d.ts +11 -0
- package/esm/select/option-group/option-group-constants.js +14 -0
- package/esm/select/option-group/option-group.d.ts +26 -0
- package/esm/select/option-group/option-group.js +45 -0
- package/esm/select/select/index.d.ts +10 -0
- package/esm/select/select/index.js +14 -0
- package/esm/select/select/select-adapter.d.ts +85 -0
- package/esm/select/select/select-adapter.js +159 -0
- package/esm/select/select/select-constants.d.ts +37 -0
- package/esm/select/select/select-constants.js +42 -0
- package/esm/select/select/select-foundation.d.ts +96 -0
- package/esm/select/select/select-foundation.js +338 -0
- package/esm/select/select/select.d.ts +54 -0
- package/esm/select/select/select.js +129 -0
- package/esm/select/select-component-delegate.d.ts +30 -0
- package/esm/select/select-component-delegate.js +62 -0
- package/esm/select/select-dropdown/index.d.ts +10 -0
- package/esm/select/select-dropdown/index.js +14 -0
- package/esm/select/select-dropdown/select-dropdown-adapter.d.ts +36 -0
- package/esm/select/select-dropdown/select-dropdown-adapter.js +123 -0
- package/esm/select/select-dropdown/select-dropdown-constants.d.ts +16 -0
- package/esm/select/select-dropdown/select-dropdown-constants.js +21 -0
- package/esm/select/select-dropdown/select-dropdown-foundation.d.ts +35 -0
- package/esm/select/select-dropdown/select-dropdown-foundation.js +88 -0
- package/esm/select/select-dropdown/select-dropdown.d.ts +31 -0
- package/esm/select/select-dropdown/select-dropdown.js +83 -0
- package/esm/skeleton/index.d.ts +8 -0
- package/esm/skeleton/index.js +12 -0
- package/esm/skeleton/skeleton-constants.d.ts +8 -0
- package/esm/skeleton/skeleton-constants.js +10 -0
- package/esm/skeleton/skeleton.d.ts +16 -0
- package/esm/skeleton/skeleton.js +23 -0
- package/esm/slider/index.d.ts +9 -0
- package/esm/slider/index.js +13 -0
- package/esm/slider/slider-component-delegate.d.ts +27 -0
- package/esm/slider/slider-component-delegate.js +42 -0
- package/esm/slider/slider-constants.d.ts +41 -0
- package/esm/slider/slider-constants.js +38 -0
- package/esm/slider/slider.d.ts +92 -0
- package/esm/slider/slider.js +298 -0
- package/esm/stepper/core/stepper-utils.d.ts +51 -0
- package/esm/stepper/core/stepper-utils.js +139 -0
- package/esm/stepper/index.d.ts +7 -0
- package/esm/stepper/index.js +7 -0
- package/esm/stepper/step/index.d.ts +10 -0
- package/esm/stepper/step/index.js +14 -0
- package/esm/stepper/step/step-adapter.d.ts +76 -0
- package/esm/stepper/step/step-adapter.js +161 -0
- package/esm/stepper/step/step-constants.d.ts +76 -0
- package/esm/stepper/step/step-constants.js +82 -0
- package/esm/stepper/step/step-foundation.d.ts +78 -0
- package/esm/stepper/step/step-foundation.js +248 -0
- package/esm/stepper/step/step.d.ts +49 -0
- package/esm/stepper/step/step.js +127 -0
- package/esm/stepper/stepper/index.d.ts +10 -0
- package/esm/stepper/stepper/index.js +14 -0
- package/esm/stepper/stepper/stepper-adapter.d.ts +67 -0
- package/esm/stepper/stepper/stepper-adapter.js +148 -0
- package/esm/stepper/stepper/stepper-constants.d.ts +77 -0
- package/esm/stepper/stepper/stepper-constants.js +79 -0
- package/esm/stepper/stepper/stepper-foundation.d.ts +76 -0
- package/esm/stepper/stepper/stepper-foundation.js +292 -0
- package/esm/stepper/stepper/stepper.d.ts +44 -0
- package/esm/stepper/stepper/stepper.js +95 -0
- package/esm/switch/index.d.ts +9 -0
- package/esm/switch/index.js +13 -0
- package/esm/switch/switch-component-delegate.d.ts +32 -0
- package/esm/switch/switch-component-delegate.js +70 -0
- package/esm/switch/switch-constants.d.ts +26 -0
- package/esm/switch/switch-constants.js +31 -0
- package/esm/switch/switch.d.ts +53 -0
- package/esm/switch/switch.js +155 -0
- package/esm/table/index.d.ts +12 -0
- package/esm/table/index.js +16 -0
- package/esm/table/multi-sort-manager.d.ts +18 -0
- package/esm/table/multi-sort-manager.js +67 -0
- package/esm/table/table-adapter.d.ts +80 -0
- package/esm/table/table-adapter.js +120 -0
- package/esm/table/table-constants.d.ts +104 -0
- package/esm/table/table-constants.js +115 -0
- package/esm/table/table-foundation.d.ts +271 -0
- package/esm/table/table-foundation.js +918 -0
- package/esm/table/table-row.d.ts +13 -0
- package/esm/table/table-row.js +14 -0
- package/esm/table/table-utils.d.ts +389 -0
- package/esm/table/table-utils.js +1415 -0
- package/esm/table/table.d.ts +182 -0
- package/esm/table/table.js +290 -0
- package/esm/table/types.d.ts +157 -0
- package/esm/table/types.js +26 -0
- package/esm/tabs/index.d.ts +7 -0
- package/esm/tabs/index.js +7 -0
- package/esm/tabs/tab/index.d.ts +10 -0
- package/esm/tabs/tab/index.js +14 -0
- package/esm/tabs/tab/tab-adapter.d.ts +54 -0
- package/esm/tabs/tab/tab-adapter.js +103 -0
- package/esm/tabs/tab/tab-constants.d.ts +32 -0
- package/esm/tabs/tab/tab-constants.js +32 -0
- package/esm/tabs/tab/tab-foundation.d.ts +43 -0
- package/esm/tabs/tab/tab-foundation.js +98 -0
- package/esm/tabs/tab/tab.d.ts +42 -0
- package/esm/tabs/tab/tab.js +79 -0
- package/esm/tabs/tab-bar/index.d.ts +10 -0
- package/esm/tabs/tab-bar/index.js +14 -0
- package/esm/tabs/tab-bar/tab-bar-adapter.d.ts +98 -0
- package/esm/tabs/tab-bar/tab-bar-adapter.js +223 -0
- package/esm/tabs/tab-bar/tab-bar-constants.d.ts +64 -0
- package/esm/tabs/tab-bar/tab-bar-constants.js +79 -0
- package/esm/tabs/tab-bar/tab-bar-foundation.d.ts +96 -0
- package/esm/tabs/tab-bar/tab-bar-foundation.js +385 -0
- package/esm/tabs/tab-bar/tab-bar.d.ts +64 -0
- package/esm/tabs/tab-bar/tab-bar.js +123 -0
- package/esm/text-field/index.d.ts +11 -0
- package/esm/text-field/index.js +15 -0
- package/esm/text-field/text-field-adapter.d.ts +34 -0
- package/esm/text-field/text-field-adapter.js +109 -0
- package/esm/text-field/text-field-component-delegate.d.ts +45 -0
- package/esm/text-field/text-field-component-delegate.js +125 -0
- package/esm/text-field/text-field-constants.d.ts +21 -0
- package/esm/text-field/text-field-constants.js +25 -0
- package/esm/text-field/text-field-foundation.d.ts +14 -0
- package/esm/text-field/text-field-foundation.js +16 -0
- package/esm/text-field/text-field.d.ts +17 -0
- package/esm/text-field/text-field.js +26 -0
- package/esm/theme/color-constants.d.ts +313 -0
- package/esm/theme/color-constants.js +363 -0
- package/esm/theme/index.d.ts +7 -0
- package/esm/theme/index.js +7 -0
- package/esm/theme/theme-utils.d.ts +9 -0
- package/esm/theme/theme-utils.js +68 -0
- package/esm/time-picker/index.d.ts +12 -0
- package/esm/time-picker/index.js +16 -0
- package/esm/time-picker/time-picker-adapter.d.ts +80 -0
- package/esm/time-picker/time-picker-adapter.js +208 -0
- package/esm/time-picker/time-picker-component-delegate.d.ts +33 -0
- package/esm/time-picker/time-picker-component-delegate.js +68 -0
- package/esm/time-picker/time-picker-constants.d.ts +59 -0
- package/esm/time-picker/time-picker-constants.js +48 -0
- package/esm/time-picker/time-picker-foundation.d.ts +146 -0
- package/esm/time-picker/time-picker-foundation.js +814 -0
- package/esm/time-picker/time-picker-utils.d.ts +25 -0
- package/esm/time-picker/time-picker-utils.js +122 -0
- package/esm/time-picker/time-picker.d.ts +76 -0
- package/esm/time-picker/time-picker.js +198 -0
- package/esm/toast/index.d.ts +10 -0
- package/esm/toast/index.js +14 -0
- package/esm/toast/toast-adapter.d.ts +83 -0
- package/esm/toast/toast-adapter.js +146 -0
- package/esm/toast/toast-constants.d.ts +58 -0
- package/esm/toast/toast-constants.js +63 -0
- package/esm/toast/toast-foundation.d.ts +67 -0
- package/esm/toast/toast-foundation.js +150 -0
- package/esm/toast/toast.d.ts +49 -0
- package/esm/toast/toast.js +93 -0
- package/esm/toolbar/index.d.ts +8 -0
- package/esm/toolbar/index.js +12 -0
- package/esm/toolbar/toolbar-constants.d.ts +25 -0
- package/esm/toolbar/toolbar-constants.js +30 -0
- package/esm/toolbar/toolbar.d.ts +26 -0
- package/esm/toolbar/toolbar.js +58 -0
- package/esm/tooltip/index.d.ts +11 -0
- package/esm/tooltip/index.js +15 -0
- package/esm/tooltip/tooltip-adapter.d.ts +74 -0
- package/esm/tooltip/tooltip-adapter.js +127 -0
- package/esm/tooltip/tooltip-constants.d.ts +35 -0
- package/esm/tooltip/tooltip-constants.js +41 -0
- package/esm/tooltip/tooltip-foundation.d.ts +104 -0
- package/esm/tooltip/tooltip-foundation.js +251 -0
- package/esm/tooltip/tooltip-utils.d.ts +13 -0
- package/esm/tooltip/tooltip-utils.js +53 -0
- package/esm/tooltip/tooltip.d.ts +47 -0
- package/esm/tooltip/tooltip.js +80 -0
- package/esm/utils/color-utils.d.ts +14 -0
- package/esm/utils/color-utils.js +35 -0
- package/esm/utils/index.d.ts +6 -0
- package/esm/utils/index.js +6 -0
- package/esm/view-switcher/index.d.ts +11 -0
- package/esm/view-switcher/index.js +15 -0
- package/esm/view-switcher/view/index.d.ts +8 -0
- package/esm/view-switcher/view/index.js +12 -0
- package/esm/view-switcher/view/view-constants.d.ts +8 -0
- package/esm/view-switcher/view/view-constants.js +10 -0
- package/esm/view-switcher/view/view.d.ts +16 -0
- package/esm/view-switcher/view/view.js +23 -0
- package/esm/view-switcher/view-switcher-adapter.d.ts +93 -0
- package/esm/view-switcher/view-switcher-adapter.js +281 -0
- package/esm/view-switcher/view-switcher-constants.d.ts +38 -0
- package/esm/view-switcher/view-switcher-constants.js +43 -0
- package/esm/view-switcher/view-switcher-foundation.d.ts +38 -0
- package/esm/view-switcher/view-switcher-foundation.js +122 -0
- package/esm/view-switcher/view-switcher.d.ts +40 -0
- package/esm/view-switcher/view-switcher.js +73 -0
- package/package.json +22 -0
- package/styles/app-bar/_mixins.scss +242 -0
- package/styles/app-bar/_variables.scss +34 -0
- package/styles/app-bar/app-bar.scss +22 -0
- package/styles/app-bar/search/_mixins.scss +238 -0
- package/styles/app-bar/search/_variables.scss +18 -0
- package/styles/app-bar/search/app-bar-search.scss +16 -0
- package/styles/autocomplete/autocomplete.scss +12 -0
- package/styles/avatar/_mixins.scss +46 -0
- package/styles/avatar/_variables.scss +16 -0
- package/styles/avatar/avatar.scss +16 -0
- package/styles/backdrop/_mixins.scss +31 -0
- package/styles/backdrop/_variables.scss +12 -0
- package/styles/backdrop/backdrop.scss +32 -0
- package/styles/badge/_mixins.scss +121 -0
- package/styles/badge/_variables.scss +87 -0
- package/styles/badge/badge.scss +40 -0
- package/styles/banner/_mixins.scss +219 -0
- package/styles/banner/_variables.scss +88 -0
- package/styles/banner/banner.scss +24 -0
- package/styles/bottom-sheet/_mixins.scss +98 -0
- package/styles/bottom-sheet/_variables.scss +7 -0
- package/styles/bottom-sheet/bottom-sheet.scss +21 -0
- package/styles/busy-indicator/_mixins.scss +184 -0
- package/styles/busy-indicator/_variables.scss +9 -0
- package/styles/busy-indicator/busy-indicator.scss +23 -0
- package/styles/busy-indicator/forge-busy-indicator.scss +8 -0
- package/styles/button/_button-base.scss +183 -0
- package/styles/button/_button-filled-theme.scss +60 -0
- package/styles/button/_button-filled.scss +71 -0
- package/styles/button/_button-outlined-theme.scss +175 -0
- package/styles/button/_button-outlined.scss +76 -0
- package/styles/button/_button-protected-theme.scss +60 -0
- package/styles/button/_button-protected.scss +88 -0
- package/styles/button/_button-ripple.scss +69 -0
- package/styles/button/_button-shared-theme.scss +447 -0
- package/styles/button/_button-text-theme.scss +60 -0
- package/styles/button/_button-text.scss +57 -0
- package/styles/button/_button.mixins.scss +148 -0
- package/styles/button/_mixins.scss +183 -0
- package/styles/button/forge-button.scss +9 -0
- package/styles/button-toggle/button-toggle/_mixins.scss +98 -0
- package/styles/button-toggle/button-toggle/button-toggle.scss +35 -0
- package/styles/button-toggle/button-toggle-group/_mixins.scss +79 -0
- package/styles/button-toggle/button-toggle-group/button-toggle-group.scss +16 -0
- package/styles/calendar/_mixins.scss +440 -0
- package/styles/calendar/_variables.scss +79 -0
- package/styles/calendar/calendar-menu/_mixins.scss +419 -0
- package/styles/calendar/calendar-menu/_variables.scss +10 -0
- package/styles/calendar/calendar-menu/calendar-menu.scss +22 -0
- package/styles/calendar/calendar.scss +26 -0
- package/styles/card/_mixins.scss +45 -0
- package/styles/card/_variables.scss +9 -0
- package/styles/card/card.scss +16 -0
- package/styles/checkbox/_checkbox-custom-properties.scss +11 -0
- package/styles/checkbox/_checkbox-theme.scss +577 -0
- package/styles/checkbox/_checkbox.mixins.scss +595 -0
- package/styles/checkbox/checkbox.scss +19 -0
- package/styles/chip-field/_base.scss +298 -0
- package/styles/chip-field/_core.scss +25 -0
- package/styles/chip-field/_mixins.scss +26 -0
- package/styles/chip-field/_selector.scss +229 -0
- package/styles/chip-field/_variables.scss +76 -0
- package/styles/chip-field/chip-field.scss +16 -0
- package/styles/chips/chip/_mixins.scss +277 -0
- package/styles/chips/chip/_variables.scss +7 -0
- package/styles/chips/chip/chip.scss +22 -0
- package/styles/chips/chip-set/_mixins.scss +40 -0
- package/styles/chips/chip-set/_variables.scss +6 -0
- package/styles/chips/chip-set/chip-set.scss +16 -0
- package/styles/circular-progress/_keyframes.scss +185 -0
- package/styles/circular-progress/_mixins.scss +320 -0
- package/styles/circular-progress/_variables.scss +50 -0
- package/styles/circular-progress/circular-progress.scss +9 -0
- package/styles/color-picker/_mixins.scss +231 -0
- package/styles/color-picker/_variables.scss +6 -0
- package/styles/color-picker/color-picker.scss +21 -0
- package/styles/date-picker/date-picker.scss +12 -0
- package/styles/date-range-picker/date-range-picker.scss +12 -0
- package/styles/dialog/_mixins.scss +199 -0
- package/styles/dialog/_variables.scss +22 -0
- package/styles/dialog/dialog.scss +16 -0
- package/styles/dialog/forge-dialog-utils.scss +31 -0
- package/styles/dialog/forge-dialog.scss +8 -0
- package/styles/divider/_mixins.scss +47 -0
- package/styles/divider/_variables.scss +7 -0
- package/styles/divider/divider.scss +31 -0
- package/styles/drawer/base/_mixins.scss +137 -0
- package/styles/drawer/base/_variables.scss +11 -0
- package/styles/drawer/drawer/_mixins.scss +10 -0
- package/styles/drawer/drawer/_variables.scss +12 -0
- package/styles/drawer/drawer/drawer.scss +25 -0
- package/styles/drawer/mini-drawer/_mixins.scss +66 -0
- package/styles/drawer/mini-drawer/_variables.scss +7 -0
- package/styles/drawer/mini-drawer/mini-drawer.scss +40 -0
- package/styles/drawer/modal-drawer/_mixins.scss +69 -0
- package/styles/drawer/modal-drawer/modal-drawer.scss +8 -0
- package/styles/expansion-panel/_mixins.scss +87 -0
- package/styles/expansion-panel/expansion-panel.scss +16 -0
- package/styles/expansion-panel/forge-expansion-panel.scss +16 -0
- package/styles/field/_base.scss +622 -0
- package/styles/field/_core.scss +61 -0
- package/styles/field/_selector.scss +560 -0
- package/styles/field/_utils.scss +48 -0
- package/styles/field/_variables.scss +126 -0
- package/styles/file-picker/_mixins.scss +153 -0
- package/styles/file-picker/_variables.scss +8 -0
- package/styles/file-picker/file-picker.scss +16 -0
- package/styles/floating-action-button/_extended-fab-theme.scss +238 -0
- package/styles/floating-action-button/_fab-custom-properties.scss +29 -0
- package/styles/floating-action-button/_fab-theme.scss +541 -0
- package/styles/floating-action-button/_fab.mixins.scss +351 -0
- package/styles/floating-action-button/forge-floating-action-button.scss +16 -0
- package/styles/floating-label/_mixins.scss +291 -0
- package/styles/floating-label/_variables.scss +15 -0
- package/styles/floating-label/forge-floating-label.scss +8 -0
- package/styles/forge-core.scss +14 -0
- package/styles/forge-dark.scss +10 -0
- package/styles/forge.scss +26 -0
- package/styles/form-field/_mixins.scss +71 -0
- package/styles/form-field/forge-form-field.scss +8 -0
- package/styles/icon/_mixins.scss +37 -0
- package/styles/icon/_variables.scss +10 -0
- package/styles/icon/icon.scss +26 -0
- package/styles/icon-button/_mixins.scss +345 -0
- package/styles/icon-button/_variables.scss +42 -0
- package/styles/icon-button/forge-icon-button.scss +8 -0
- package/styles/inline-message/_mixins.scss +82 -0
- package/styles/inline-message/_variables.scss +67 -0
- package/styles/inline-message/inline-message.scss +18 -0
- package/styles/label-value/_base.scss +252 -0
- package/styles/label-value/_core.scss +15 -0
- package/styles/label-value/_mixins.scss +15 -0
- package/styles/label-value/_selector.scss +167 -0
- package/styles/label-value/_variables.scss +37 -0
- package/styles/label-value/label-value.scss +17 -0
- package/styles/linear-progress/_mixins.scss +11 -0
- package/styles/linear-progress/_variables.scss +15 -0
- package/styles/linear-progress/linear-progress.scss +40 -0
- package/styles/list/list/_mixins.scss +45 -0
- package/styles/list/list/list.scss +16 -0
- package/styles/list/list-item/_mixins.scss +392 -0
- package/styles/list/list-item/_variables.scss +25 -0
- package/styles/list/list-item/list-item.scss +30 -0
- package/styles/menu/menu.scss +12 -0
- package/styles/open-icon/_mixins.scss +39 -0
- package/styles/open-icon/_variables.scss +8 -0
- package/styles/open-icon/open-icon.scss +16 -0
- package/styles/page-state/_mixins.scss +123 -0
- package/styles/page-state/_variables.scss +9 -0
- package/styles/page-state/page-state.scss +17 -0
- package/styles/paginator/_mixins.scss +136 -0
- package/styles/paginator/_variables.scss +6 -0
- package/styles/paginator/paginator.scss +21 -0
- package/styles/popup/_mixins.scss +86 -0
- package/styles/popup/_variables.scss +7 -0
- package/styles/popup/forge-popup.scss +8 -0
- package/styles/popup/popup.scss +16 -0
- package/styles/product-icon/_mixins.scss +49 -0
- package/styles/product-icon/_variables.scss +7 -0
- package/styles/product-icon/product-icon.scss +16 -0
- package/styles/profile-card/_mixins.scss +83 -0
- package/styles/profile-card/profile-card.scss +22 -0
- package/styles/quantity-field/_mixins.scss +116 -0
- package/styles/quantity-field/forge-quantity-field.scss +18 -0
- package/styles/quantity-field/quantity-field.scss +16 -0
- package/styles/radio/_mixins.scss +309 -0
- package/styles/radio/_radio-theme.scss +314 -0
- package/styles/radio/radio.scss +19 -0
- package/styles/ripple/forge-ripple.scss +17 -0
- package/styles/scaffold/_mixins.scss +194 -0
- package/styles/scaffold/forge-scaffold.scss +43 -0
- package/styles/scaffold/scaffold.scss +21 -0
- package/styles/select/select/_base.scss +84 -0
- package/styles/select/select/_core.scss +23 -0
- package/styles/select/select/_mixins.scss +25 -0
- package/styles/select/select/_selector.scss +88 -0
- package/styles/select/select/_variables.scss +16 -0
- package/styles/select/select/select.scss +17 -0
- package/styles/select/select-dropdown/select-dropdown.scss +8 -0
- package/styles/skeleton/_mixins.scss +132 -0
- package/styles/skeleton/_variables.scss +45 -0
- package/styles/skeleton/skeleton.scss +18 -0
- package/styles/slider/slider.scss +33 -0
- package/styles/stepper/step/_mixins.scss +416 -0
- package/styles/stepper/step/_variables.scss +21 -0
- package/styles/stepper/step/step.scss +164 -0
- package/styles/stepper/stepper/_mixins.scss +113 -0
- package/styles/stepper/stepper/stepper.scss +22 -0
- package/styles/switch/_switch-mixins.scss +301 -0
- package/styles/switch/_switch-theme.scss +701 -0
- package/styles/switch/switch.scss +80 -0
- package/styles/table/_mixins.scss +527 -0
- package/styles/table/_variables.scss +57 -0
- package/styles/table/forge-table.scss +12 -0
- package/styles/tabs/tab/_mixins.scss +165 -0
- package/styles/tabs/tab/_variables.scss +9 -0
- package/styles/tabs/tab/tab.scss +30 -0
- package/styles/tabs/tab-bar/_mixins.scss +78 -0
- package/styles/tabs/tab-bar/tab-bar.scss +19 -0
- package/styles/text-field/_base.scss +76 -0
- package/styles/text-field/_core.scss +19 -0
- package/styles/text-field/_mixins.scss +28 -0
- package/styles/text-field/_selector.scss +57 -0
- package/styles/text-field/_variables.scss +20 -0
- package/styles/text-field/text-field.scss +17 -0
- package/styles/theme/_custom-properties.scss +311 -0
- package/styles/theme/_icon-mixins.scss +62 -0
- package/styles/theme/_index.scss +7 -0
- package/styles/theme/_keys.scss +477 -0
- package/styles/theme/_theme-dark.scss +47 -0
- package/styles/theme/_theme-utils.scss +23 -0
- package/styles/theme/_theme-values.scss +244 -0
- package/styles/theme/_theme.scss +353 -0
- package/styles/theme/forge-material-icons.scss +19 -0
- package/styles/theme/forge-theme.scss +9 -0
- package/styles/time-picker/time-picker.scss +12 -0
- package/styles/toast/_mixins.scss +242 -0
- package/styles/toast/_variables.scss +52 -0
- package/styles/toast/toast.scss +18 -0
- package/styles/toolbar/_mixins.scss +79 -0
- package/styles/toolbar/_variables.scss +10 -0
- package/styles/toolbar/toolbar.scss +28 -0
- package/styles/tooltip/_mixins.scss +98 -0
- package/styles/tooltip/_variables.scss +18 -0
- package/styles/tooltip/forge-tooltip.scss +12 -0
- package/styles/typography/_index.scss +7 -0
- package/styles/typography/_mixins.scss +93 -0
- package/styles/typography/_variables.scss +100 -0
- package/styles/typography/forge-form.scss +67 -0
- package/styles/typography/forge-typography.scss +9 -0
- package/styles/utils/_functions-grid.scss +8 -0
- package/styles/utils/_mixins-animation.scss +37 -0
- package/styles/utils/_mixins-core.scss +18 -0
- package/styles/utils/_mixins-flex.scss +53 -0
- package/styles/utils/_mixins-grid.scss +29 -0
- package/styles/utils/_mixins-media.scss +38 -0
- package/styles/utils/_mixins.scss +45 -0
- package/styles/utils/_variables-flex.scss +30 -0
- package/styles/utils/_variables-grid.scss +9 -0
- package/styles/utils/_variables-media.scss +11 -0
- package/styles/utils/forge-flex.scss +30 -0
- package/styles/utils/forge-grid.scss +54 -0
- package/styles/utils/forge-utils.scss +45 -0
- package/styles/view-switcher/_mixins.scss +49 -0
- package/styles/view-switcher/_variables.scss +6 -0
- package/styles/view-switcher/view/view.scss +12 -0
- package/styles/view-switcher/view-switcher.scss +32 -0
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { createPredicate, getEventPath, isNumber, isObject, ItemManager, matchesPredicate } from '@tylertech/forge-core';
|
|
7
|
+
import { MultiSortManager } from './multi-sort-manager';
|
|
8
|
+
import { TABLE_CONSTANTS } from './table-constants';
|
|
9
|
+
import { TableRow } from './table-row';
|
|
10
|
+
import { TableUtils } from './table-utils';
|
|
11
|
+
import { SortDirection, CellAlign } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* The state class behind the `TableComponent` custom element.
|
|
14
|
+
*/
|
|
15
|
+
export class TableFoundation {
|
|
16
|
+
constructor(_adapter) {
|
|
17
|
+
this._adapter = _adapter;
|
|
18
|
+
// Backing model values
|
|
19
|
+
this._tableRows = [];
|
|
20
|
+
this._data = [];
|
|
21
|
+
this._columnConfigurations = [];
|
|
22
|
+
this._select = false;
|
|
23
|
+
this._multiselect = true;
|
|
24
|
+
this._dense = false;
|
|
25
|
+
this._roomy = false;
|
|
26
|
+
this._filter = false;
|
|
27
|
+
this._fixedHeaders = false;
|
|
28
|
+
this._layoutType = TABLE_CONSTANTS.strings.DEFAULT_LAYOUT_TYPE;
|
|
29
|
+
this._wrapContent = true;
|
|
30
|
+
this._resizable = false;
|
|
31
|
+
this._minResizeWidth = TABLE_CONSTANTS.numbers.MIN_RESIZE_WIDTH;
|
|
32
|
+
this._multiColumnSort = false;
|
|
33
|
+
this._selectCheckboxAlignment = CellAlign.Center;
|
|
34
|
+
// State variables
|
|
35
|
+
this._isAllSelected = false;
|
|
36
|
+
this._sortedColumnIndex = -1;
|
|
37
|
+
this._rendered = false;
|
|
38
|
+
this._allowRowClick = false;
|
|
39
|
+
this._multiSortManager = new MultiSortManager();
|
|
40
|
+
// Create all listeners
|
|
41
|
+
this._rowClickListener = evt => this._onRowClick(evt);
|
|
42
|
+
this._rowDoubleClickListener = evt => this._onRowDoubleClick(evt);
|
|
43
|
+
this._selectRowListener = evt => this._onRowSelected(evt);
|
|
44
|
+
this._selectAllListener = evt => this._onSelectAll(evt);
|
|
45
|
+
this._headRowMouseDownListener = evt => this._onHeadRowMouseDown(evt);
|
|
46
|
+
this._headRowContextMenuListener = evt => this._onHeadRowContextMenu(evt);
|
|
47
|
+
this._documentMouseMoveListener = evt => this._onMouseMove(evt);
|
|
48
|
+
this._documentMouseUpListener = evt => this._onMouseUp(evt);
|
|
49
|
+
this._filterListener = (value, columnIndex) => this._onFilter(value, columnIndex);
|
|
50
|
+
// Create helpers
|
|
51
|
+
this._selectionManager = new ItemManager(this._selectKey);
|
|
52
|
+
this._hiddenColumnManager = new ItemManager();
|
|
53
|
+
}
|
|
54
|
+
/** Called when the component is connected to the DOM. */
|
|
55
|
+
initialize() {
|
|
56
|
+
this.connect();
|
|
57
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.SELECT, this._select.toString());
|
|
58
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.MULTISELECT, this._multiselect.toString());
|
|
59
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.DENSE, this._dense.toString());
|
|
60
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.ROOMY, this._roomy.toString());
|
|
61
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.FILTER, this._filter.toString());
|
|
62
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.INITIALIZED, undefined, false);
|
|
63
|
+
}
|
|
64
|
+
connect() {
|
|
65
|
+
this._adapter.initialize();
|
|
66
|
+
}
|
|
67
|
+
disconnect() {
|
|
68
|
+
this._resizeDescriptor = undefined;
|
|
69
|
+
this._adapter.removeDocumentListener('mousemove', this._documentMouseMoveListener);
|
|
70
|
+
this._adapter.removeDocumentListener('mouseup', this._documentMouseUpListener);
|
|
71
|
+
}
|
|
72
|
+
/** The data to be displayed in the table body. */
|
|
73
|
+
set data(value) {
|
|
74
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
75
|
+
if (isObject(value[0])) {
|
|
76
|
+
this._data = value.map(v => (Object.assign({}, v)));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this._data = [...value];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this._data = [];
|
|
84
|
+
}
|
|
85
|
+
this._tableRows = this._data.map(data => new TableRow(data, this._selectionManager.exists(data)));
|
|
86
|
+
this._renderBody();
|
|
87
|
+
}
|
|
88
|
+
get data() {
|
|
89
|
+
return JSON.parse(JSON.stringify(this._data));
|
|
90
|
+
}
|
|
91
|
+
/** The column configuration options. */
|
|
92
|
+
set columnConfigurations(value) {
|
|
93
|
+
// Intentional shallow copy of member properties. These member objects have properties that are references to functions.
|
|
94
|
+
// The typical JSON.parse(JSON.stringify(object)) will not work here. If this becomes an issue we'll add a deepClone
|
|
95
|
+
// function to the core library.
|
|
96
|
+
this._columnConfigurations = value.map(cc => (Object.assign({}, cc)));
|
|
97
|
+
// Update hidden column manager
|
|
98
|
+
this._hiddenColumnManager.clear();
|
|
99
|
+
this._columnConfigurations.forEach(cc => {
|
|
100
|
+
if (cc.hidden) {
|
|
101
|
+
this._hiddenColumnManager.add(cc);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
this._refreshTableSort(); // Must be called after updating the hidden columns
|
|
105
|
+
this.render();
|
|
106
|
+
}
|
|
107
|
+
get columnConfigurations() {
|
|
108
|
+
// Intentional shallow copy of member properties. These member objects have properties that are references to functions.
|
|
109
|
+
// The typical JSON.parse(JSON.stringify(object)) will not work here. If this becomes an issue we'll add a deepClone
|
|
110
|
+
// function to the core library.
|
|
111
|
+
return this._columnConfigurations.map(cc => (Object.assign({}, cc)));
|
|
112
|
+
}
|
|
113
|
+
/** Gets the visible column configurations. */
|
|
114
|
+
get _visibleColumnConfigurations() {
|
|
115
|
+
return this._columnConfigurations.filter(cc => !this._hiddenColumnManager.exists(cc));
|
|
116
|
+
}
|
|
117
|
+
/** Gets the table configuration. */
|
|
118
|
+
get _tableConfiguration() {
|
|
119
|
+
return {
|
|
120
|
+
tableElement: this._adapter.getTableElement(),
|
|
121
|
+
columnConfigurations: this._visibleColumnConfigurations,
|
|
122
|
+
data: this._tableRows,
|
|
123
|
+
clickListener: this._allowRowClick ? this._rowClickListener : null,
|
|
124
|
+
doubleClickListener: this._allowRowClick ? this._rowDoubleClickListener : null,
|
|
125
|
+
selectListener: this._select ? this._selectRowListener : null,
|
|
126
|
+
selectAllListener: this._multiselect ? this._selectAllListener : null,
|
|
127
|
+
headRowMouseDownListener: this._headRowMouseDownListener,
|
|
128
|
+
headRowContextMenuListener: this._headRowContextMenuListener,
|
|
129
|
+
filterListener: this._filter ? this._filterListener : null,
|
|
130
|
+
sortDirection: this._sortDirection,
|
|
131
|
+
sortedColumn: this._sortedColumnIndex,
|
|
132
|
+
multiColumnSort: this._multiColumnSort,
|
|
133
|
+
filter: this._filter,
|
|
134
|
+
wrapContent: this._wrapContent,
|
|
135
|
+
fixedHeaders: this._fixedHeaders,
|
|
136
|
+
layoutType: this._layoutType,
|
|
137
|
+
dense: this._dense,
|
|
138
|
+
resizable: this._resizable,
|
|
139
|
+
rowCreatedCallback: this._rowCreatedCallback,
|
|
140
|
+
cellCreatedCallback: this._cellCreatedCallback,
|
|
141
|
+
selectAllTemplate: this._selectAllTemplate,
|
|
142
|
+
selectCheckboxAlignment: this._selectCheckboxAlignment,
|
|
143
|
+
tooltipSelect: this._tooltipSelect,
|
|
144
|
+
tooltipSelectAll: this._tooltipSelectAll
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** Controls the visibility of the select column. */
|
|
148
|
+
set select(value) {
|
|
149
|
+
if (this._select !== value) {
|
|
150
|
+
this._select = value;
|
|
151
|
+
// Now we can add/remove the column
|
|
152
|
+
this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(), this._select, this._selectRowListener, this._multiselect ? this._selectAllListener : undefined, this._multiselect ? this._selectAllTemplate : null, this._selectCheckboxAlignment, this._tableRows, this._tooltipSelect, this._tooltipSelectAll);
|
|
153
|
+
this._updateSelections(true);
|
|
154
|
+
// Update the attribute on the host element
|
|
155
|
+
if (this._select) {
|
|
156
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.SELECT, this._select.toString());
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
this._adapter.removeHostAttribute(TABLE_CONSTANTS.attributes.SELECT);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
get select() {
|
|
164
|
+
return this._select;
|
|
165
|
+
}
|
|
166
|
+
/** Controls the visibility of the select all checkbox. */
|
|
167
|
+
set multiselect(value) {
|
|
168
|
+
if (this._multiselect !== value) {
|
|
169
|
+
this._multiselect = value;
|
|
170
|
+
if (this._select) {
|
|
171
|
+
this._adapter.setSelectAllVisibility(this._adapter.getTableElement(), this._multiselect, this._multiselect ? this._selectAllListener : null, this._multiselect ? this.selectAllTemplate : null, this._selectCheckboxAlignment, this._tooltipSelectAll);
|
|
172
|
+
this._updateSelections(true);
|
|
173
|
+
}
|
|
174
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.MULTISELECT, this._multiselect.toString());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
get multiselect() {
|
|
178
|
+
return this._multiselect;
|
|
179
|
+
}
|
|
180
|
+
/** The row key for matching data to selections. */
|
|
181
|
+
get selectKey() {
|
|
182
|
+
if (Array.isArray(this._selectKey)) {
|
|
183
|
+
return [...this._selectKey];
|
|
184
|
+
}
|
|
185
|
+
return this._selectKey;
|
|
186
|
+
}
|
|
187
|
+
set selectKey(value) {
|
|
188
|
+
if (this._originalSelectKey === value) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (Array.isArray(value)) {
|
|
192
|
+
this._originalSelectKey = [...value];
|
|
193
|
+
this._selectKey = [...value];
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this._originalSelectKey = value;
|
|
197
|
+
this._selectKey = [value];
|
|
198
|
+
}
|
|
199
|
+
this._selectionManager.setKey(this._selectKey);
|
|
200
|
+
this._updateSelections(false);
|
|
201
|
+
}
|
|
202
|
+
/** Controls whether the table is dense or not. False by default. */
|
|
203
|
+
get dense() {
|
|
204
|
+
return this._dense;
|
|
205
|
+
}
|
|
206
|
+
set dense(value) {
|
|
207
|
+
if (this._dense !== value) {
|
|
208
|
+
this._dense = value;
|
|
209
|
+
this._adapter.setDense(this._adapter.getTableElement(), this._dense);
|
|
210
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.DENSE, this._dense.toString());
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
get roomy() {
|
|
214
|
+
return this._roomy;
|
|
215
|
+
}
|
|
216
|
+
set roomy(value) {
|
|
217
|
+
if (value !== this._roomy) {
|
|
218
|
+
this._roomy = value;
|
|
219
|
+
this._applyRoomy();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/** Controls whether the table filters are visible or not. */
|
|
223
|
+
set filter(value) {
|
|
224
|
+
if (this._filter !== value) {
|
|
225
|
+
this._filter = value;
|
|
226
|
+
this._adapter.setFilterRow(this._tableConfiguration);
|
|
227
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.FILTER, this._filter.toString());
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
get filter() {
|
|
231
|
+
return this._filter;
|
|
232
|
+
}
|
|
233
|
+
/** Controls whether the table has fixed headers or not. */
|
|
234
|
+
set fixedHeaders(value) {
|
|
235
|
+
if (this._fixedHeaders !== value) {
|
|
236
|
+
this._fixedHeaders = value;
|
|
237
|
+
this._adapter.setFixedHeaders(this._tableConfiguration);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
get fixedHeaders() {
|
|
241
|
+
return this._fixedHeaders;
|
|
242
|
+
}
|
|
243
|
+
/** Controls the table layout algorithm */
|
|
244
|
+
get layoutType() {
|
|
245
|
+
return this._layoutType;
|
|
246
|
+
}
|
|
247
|
+
set layoutType(value) {
|
|
248
|
+
if (this._layoutType !== value) {
|
|
249
|
+
this._layoutType = value;
|
|
250
|
+
this._adapter.setTableLayoutType(this._tableConfiguration);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Controls whether the content in each cell wraps or not */
|
|
254
|
+
get wrapContent() {
|
|
255
|
+
return this._wrapContent;
|
|
256
|
+
}
|
|
257
|
+
set wrapContent(value) {
|
|
258
|
+
if (this._wrapContent !== value) {
|
|
259
|
+
this._wrapContent = value;
|
|
260
|
+
this._adapter.setWrapContentState(this._tableConfiguration);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/** Controls whether the columns are resizable or not. */
|
|
264
|
+
get resizable() {
|
|
265
|
+
return this._resizable;
|
|
266
|
+
}
|
|
267
|
+
set resizable(value) {
|
|
268
|
+
if (this._resizable !== value) {
|
|
269
|
+
this._resizable = value;
|
|
270
|
+
this._adapter.setResizable(this._tableConfiguration);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/** Gets/sets the minimum width that a column can be resized to by the user dragging the resize handle. */
|
|
274
|
+
get minResizeWidth() {
|
|
275
|
+
return this._minResizeWidth;
|
|
276
|
+
}
|
|
277
|
+
set minResizeWidth(value) {
|
|
278
|
+
if (this._minResizeWidth !== value) {
|
|
279
|
+
this._minResizeWidth = value;
|
|
280
|
+
if (!isNumber(this._minResizeWidth)) {
|
|
281
|
+
this._minResizeWidth = TABLE_CONSTANTS.numbers.MIN_RESIZE_WIDTH;
|
|
282
|
+
}
|
|
283
|
+
else if (this._minResizeWidth < 0) {
|
|
284
|
+
this._minResizeWidth = 0;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** Gets/sets whether the rows respond to click events or not. */
|
|
289
|
+
get allowRowClick() {
|
|
290
|
+
return this._allowRowClick;
|
|
291
|
+
}
|
|
292
|
+
set allowRowClick(value) {
|
|
293
|
+
if (this._allowRowClick !== value) {
|
|
294
|
+
this._allowRowClick = value;
|
|
295
|
+
if (this._rendered) {
|
|
296
|
+
this._adapter.setRowClickListeners(this._adapter.getTableElement(), this._allowRowClick, this._rowClickListener, this._rowDoubleClickListener);
|
|
297
|
+
this._adapter.setRowClickAttributes(this._adapter.getTableElement(), this._allowRowClick);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/** Gets/sets whether the table can sort multiple columns. */
|
|
302
|
+
get multiColumnSort() {
|
|
303
|
+
return this._multiColumnSort;
|
|
304
|
+
}
|
|
305
|
+
set multiColumnSort(value) {
|
|
306
|
+
if (value !== this._multiColumnSort) {
|
|
307
|
+
this._multiColumnSort = value;
|
|
308
|
+
this._refreshTableSort();
|
|
309
|
+
this.render();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
get selectCheckboxAlignment() {
|
|
313
|
+
return this._selectCheckboxAlignment;
|
|
314
|
+
}
|
|
315
|
+
set selectCheckboxAlignment(value) {
|
|
316
|
+
if (value !== this._selectCheckboxAlignment) {
|
|
317
|
+
this._selectCheckboxAlignment = value;
|
|
318
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.SELECT_CHECKBOX_ALIGNMENT, value);
|
|
319
|
+
this.render();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
get tooltipSelect() {
|
|
323
|
+
return this._tooltipSelect;
|
|
324
|
+
}
|
|
325
|
+
set tooltipSelect(value) {
|
|
326
|
+
if (value !== this._tooltipSelect) {
|
|
327
|
+
this._tooltipSelect = value;
|
|
328
|
+
if (typeof value === 'string') {
|
|
329
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.TOOLTIP_SELECT, value);
|
|
330
|
+
}
|
|
331
|
+
this.render();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
get tooltipSelectAll() {
|
|
335
|
+
return this._tooltipSelectAll;
|
|
336
|
+
}
|
|
337
|
+
set tooltipSelectAll(value) {
|
|
338
|
+
if (value !== this._tooltipSelectAll) {
|
|
339
|
+
this._tooltipSelectAll = value;
|
|
340
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.TOOLTIP_SELECT_ALL, value);
|
|
341
|
+
this.render();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
get selectAllTemplate() {
|
|
345
|
+
return this._selectAllTemplate;
|
|
346
|
+
}
|
|
347
|
+
set selectAllTemplate(value) {
|
|
348
|
+
if (value !== this._selectAllTemplate) {
|
|
349
|
+
this._selectAllTemplate = value;
|
|
350
|
+
this.render();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
get rowCreated() {
|
|
354
|
+
return this._rowCreatedCallback;
|
|
355
|
+
}
|
|
356
|
+
set rowCreated(value) {
|
|
357
|
+
this._rowCreatedCallback = value;
|
|
358
|
+
}
|
|
359
|
+
get cellCreated() {
|
|
360
|
+
return this._cellCreatedCallback;
|
|
361
|
+
}
|
|
362
|
+
set cellCreated(value) {
|
|
363
|
+
this._cellCreatedCallback = value;
|
|
364
|
+
}
|
|
365
|
+
isRowSelected(rowData) {
|
|
366
|
+
const predicate = createPredicate(Array.isArray(this._selectKey) ? this._selectKey : [this._selectKey], rowData);
|
|
367
|
+
return this.selectKey ? !!this._selectionManager.getItems().find(item => matchesPredicate(item, predicate)) : this._selectionManager.exists(rowData);
|
|
368
|
+
}
|
|
369
|
+
/** Returns the selected row instances. */
|
|
370
|
+
getSelectedRows() {
|
|
371
|
+
return this._selectionManager.getItems();
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Sets the selected items in the table.
|
|
375
|
+
* @param {any[]} data The data to select.
|
|
376
|
+
* @param {boolean} clearCurrentSelections True to clear the current selections before setting the new selections.
|
|
377
|
+
*/
|
|
378
|
+
selectRows(data, clearCurrentSelections) {
|
|
379
|
+
if (!this._selectKey) {
|
|
380
|
+
throw new Error('You must set a selectKey to select rows.');
|
|
381
|
+
}
|
|
382
|
+
if (!this._multiselect || clearCurrentSelections) {
|
|
383
|
+
this.clearSelections();
|
|
384
|
+
}
|
|
385
|
+
if (data && data.length) {
|
|
386
|
+
this._selectionManager.add(data);
|
|
387
|
+
this._updateSelections(!clearCurrentSelections);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Deselects rows from in the table data.
|
|
392
|
+
* @param {any[]} data The array of items to deselect.
|
|
393
|
+
*/
|
|
394
|
+
deselectRows(data) {
|
|
395
|
+
if (data && data.length) {
|
|
396
|
+
this._selectionManager.remove(data);
|
|
397
|
+
this._updateSelections(false);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Clears all selections from the table.
|
|
402
|
+
*/
|
|
403
|
+
clearSelections() {
|
|
404
|
+
const tableElement = this._adapter.getTableElement();
|
|
405
|
+
this._selectionManager.clear();
|
|
406
|
+
this._tableRows.forEach(tableRow => tableRow.selected = false);
|
|
407
|
+
this._isAllSelected = false;
|
|
408
|
+
this._adapter.clearSelectedRows(tableElement);
|
|
409
|
+
if (this._select && this._multiselect) {
|
|
410
|
+
this._adapter.updateSelectAllState(tableElement, false);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Hides a table column.
|
|
415
|
+
* @param {number} columnIndex The index of the column to hide.
|
|
416
|
+
*/
|
|
417
|
+
hideColumn(columnIndex) {
|
|
418
|
+
const columnConfig = this._columnConfigurations[columnIndex];
|
|
419
|
+
if (this._sortedColumnIndex === columnIndex) {
|
|
420
|
+
this._sortedColumnIndex = -1;
|
|
421
|
+
}
|
|
422
|
+
if (!this._hiddenColumnManager.exists(columnConfig)) {
|
|
423
|
+
this._hiddenColumnManager.add(columnConfig);
|
|
424
|
+
this.render();
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Shows a column that is currently hidden.
|
|
429
|
+
* @param {number} columnIndex The index of the column to show.
|
|
430
|
+
*/
|
|
431
|
+
showColumn(columnIndex) {
|
|
432
|
+
const columnConfig = this._columnConfigurations[columnIndex];
|
|
433
|
+
if (this._hiddenColumnManager.exists(columnConfig)) {
|
|
434
|
+
this._hiddenColumnManager.remove(columnConfig);
|
|
435
|
+
this.render();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Creates and renders the table with the current column configuration and data.
|
|
440
|
+
*/
|
|
441
|
+
render() {
|
|
442
|
+
this._adapter.createTable(this._tableConfiguration);
|
|
443
|
+
this._renderSelections();
|
|
444
|
+
this._rendered = true;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Renders the table body only.
|
|
448
|
+
*/
|
|
449
|
+
_renderBody() {
|
|
450
|
+
if (!this._rendered) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
this._adapter.recreateTableBody(this._tableConfiguration);
|
|
454
|
+
this._renderSelections();
|
|
455
|
+
}
|
|
456
|
+
_renderSelections() {
|
|
457
|
+
if (this.select) {
|
|
458
|
+
this._isAllSelected = this._getSelectAllState();
|
|
459
|
+
if (this._multiselect) {
|
|
460
|
+
this._adapter.updateSelectAllState(this._adapter.getTableElement(), this._isAllSelected, this._isIndeterminate(this._isAllSelected));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const selections = this._selectionManager.getItems();
|
|
464
|
+
if (selections.length) {
|
|
465
|
+
this._adapter.setSelectedRows(this._adapter.getTableElement(), this._selectKey, this._data, selections, false);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Expands a collapsed row.
|
|
470
|
+
* @param rowIndex The index of the row to expand.
|
|
471
|
+
*/
|
|
472
|
+
expandRow(rowIndex, template) {
|
|
473
|
+
if (!this._rendered) {
|
|
474
|
+
throw new Error('Cannot expand a row before the table has rendered.');
|
|
475
|
+
}
|
|
476
|
+
if (rowIndex < 0 || rowIndex > this._tableRows.length) {
|
|
477
|
+
throw new Error(`Invalid row index: ${rowIndex}.`);
|
|
478
|
+
}
|
|
479
|
+
return this._adapter.expandRow(this._tableConfiguration, rowIndex, template);
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Collapses an expanded row.
|
|
483
|
+
* @param rowIndex The index of the row to expand.
|
|
484
|
+
*/
|
|
485
|
+
collapseRow(rowIndex) {
|
|
486
|
+
if (!this._rendered) {
|
|
487
|
+
return Promise.resolve();
|
|
488
|
+
}
|
|
489
|
+
if (rowIndex < 0 || rowIndex > this._tableRows.length) {
|
|
490
|
+
return Promise.resolve();
|
|
491
|
+
}
|
|
492
|
+
return this._adapter.collapseRow(this._tableConfiguration, rowIndex);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Check if a row is expanded or not.
|
|
496
|
+
* @param rowIndex The row index to check.
|
|
497
|
+
*/
|
|
498
|
+
isRowExpanded(rowIndex) {
|
|
499
|
+
return this._adapter.isRowExpanded(this._tableConfiguration, rowIndex);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Selects the rows by the index or indexes.
|
|
503
|
+
* @param indexes The row indexes to select
|
|
504
|
+
* @param preserveExisting Whether or not the existing selections should be preserved
|
|
505
|
+
*/
|
|
506
|
+
selectRowsByIndex(indexes, preserveExisting) {
|
|
507
|
+
const rowsToSelect = indexes.map(i => this._data[i]).filter(obj => !!obj);
|
|
508
|
+
this.selectRows(rowsToSelect, !preserveExisting);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Selects the rows by the index or indexes.
|
|
512
|
+
* @param indexes The row indexes to deselect
|
|
513
|
+
*/
|
|
514
|
+
deselectRowsByIndex(indexes) {
|
|
515
|
+
const rowsToDeselect = indexes.map(i => this._data[i]).filter(obj => !!obj);
|
|
516
|
+
this.deselectRows(rowsToDeselect);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Determines if every row is selected or not.
|
|
520
|
+
*/
|
|
521
|
+
_getSelectAllState() {
|
|
522
|
+
return this._tableRows.length > 0 && this._tableRows.every(tr => tr.selected);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Updates the internal selection state as well as UI state.
|
|
526
|
+
* @param {boolean} preserveExisting Should existing selections be preserved when updating selection state.
|
|
527
|
+
*/
|
|
528
|
+
_updateSelections(preserveExisting) {
|
|
529
|
+
this._tableRows.forEach(tableRow => tableRow.selected = this._selectionManager.exists(tableRow.data));
|
|
530
|
+
const isAllSelected = this._getSelectAllState();
|
|
531
|
+
this._adapter.setSelectedRows(this._adapter.getTableElement(), this._selectKey, this._data, this._selectionManager.getItems(), preserveExisting);
|
|
532
|
+
if (isAllSelected !== this._isAllSelected || this._isIndeterminate(isAllSelected)) {
|
|
533
|
+
this._isAllSelected = isAllSelected;
|
|
534
|
+
// (derek.moss): while writting test it seemed like this could never be false.
|
|
535
|
+
// maybe an unneeded check
|
|
536
|
+
if (this._multiselect) {
|
|
537
|
+
this._adapter.updateSelectAllState(this._adapter.getTableElement(), this._isAllSelected, this._isIndeterminate(this._isAllSelected));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
/** Handles a row being single clicked. */
|
|
542
|
+
_onRowClick(evt) {
|
|
543
|
+
evt.stopImmediatePropagation();
|
|
544
|
+
// Ignore if the element being clicked is the checkbox element
|
|
545
|
+
if (evt.target.tagName === 'INPUT' && evt.target.type === 'checkbox') {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
const composedPath = getEventPath(evt);
|
|
549
|
+
const composedElements = composedPath.filter(node => node.nodeType === 1);
|
|
550
|
+
const customCellTemplateElement = composedElements.find(el => el.hasAttribute(TABLE_CONSTANTS.attributes.CUSTOM_CELL_TEMPLATE));
|
|
551
|
+
const stopClickPropagation = customCellTemplateElement && customCellTemplateElement.hasAttribute(TABLE_CONSTANTS.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION);
|
|
552
|
+
if (stopClickPropagation) {
|
|
553
|
+
return; // We ignore click events that bubble from custom templates if they were configured to stop propagation
|
|
554
|
+
}
|
|
555
|
+
const { index, data } = this._getSelectedRowFromEvent(evt);
|
|
556
|
+
const evtData = { index, data };
|
|
557
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.ROW_CLICK, evtData, true, false);
|
|
558
|
+
}
|
|
559
|
+
/** Handles a row being double clicked. */
|
|
560
|
+
_onRowDoubleClick(evt) {
|
|
561
|
+
evt.stopPropagation();
|
|
562
|
+
// Ignore if the element being clicked is the checkbox element
|
|
563
|
+
if (evt.target.tagName === 'INPUT' && evt.target.type === 'checkbox') {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
const rowSelectedInfo = this._getSelectedRowFromEvent(evt);
|
|
567
|
+
const detail = {
|
|
568
|
+
index: rowSelectedInfo.index,
|
|
569
|
+
data: rowSelectedInfo.data
|
|
570
|
+
};
|
|
571
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SELECT_DOUBLE, detail, true, false);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Handles a row being selected/deselected.
|
|
575
|
+
*/
|
|
576
|
+
_onRowSelected(evt) {
|
|
577
|
+
const rowSelectedInfo = this._getSelectedRowFromEvent(evt);
|
|
578
|
+
// Deselect the previously selected row(s) when not in multiselect mode (only if it's different than the newly selected row)
|
|
579
|
+
if (!this._multiselect) {
|
|
580
|
+
const existingSelections = this._tableRows.filter(item => item.selected);
|
|
581
|
+
existingSelections.forEach(selection => {
|
|
582
|
+
if (!matchesPredicate(selection.data, createPredicate(this._selectKey, rowSelectedInfo.data))) {
|
|
583
|
+
this.deselectRows([selection.data]);
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
// Determine what the new selected state should be for this row (opposite of current state)
|
|
588
|
+
const isSelected = !this._selectionManager.exists(rowSelectedInfo.data);
|
|
589
|
+
// Update the table row based on the new selected state
|
|
590
|
+
this._adapter.updateSelectedState(rowSelectedInfo.rowElement, isSelected);
|
|
591
|
+
// Update the selection manager
|
|
592
|
+
if (isSelected) {
|
|
593
|
+
this._selectionManager.add(rowSelectedInfo.data);
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
this._selectionManager.remove(rowSelectedInfo.data);
|
|
597
|
+
}
|
|
598
|
+
// Update the state for this row
|
|
599
|
+
this._tableRows[rowSelectedInfo.index].selected = isSelected;
|
|
600
|
+
// The indexes that we need to emit select events for
|
|
601
|
+
let selectionIndexes = [rowSelectedInfo.index];
|
|
602
|
+
let isAllSelected = false;
|
|
603
|
+
// If we have multiselect on, then we need to update the select all state
|
|
604
|
+
if (this._multiselect) {
|
|
605
|
+
const shift = evt.shiftKey;
|
|
606
|
+
if (shift && this._previouslyClickedRow) {
|
|
607
|
+
selectionIndexes = this._shiftSelectRows(rowSelectedInfo);
|
|
608
|
+
if (selectionIndexes.includes(this._previouslyClickedRow.index)) {
|
|
609
|
+
const idx = selectionIndexes.indexOf(this._previouslyClickedRow.index);
|
|
610
|
+
selectionIndexes.splice(idx, 1);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
// Update the state of the select all checkbox
|
|
614
|
+
isAllSelected = this._getSelectAllState();
|
|
615
|
+
this._adapter.updateSelectAllState(this._adapter.getTableElement(), isAllSelected, this._isIndeterminate(isAllSelected));
|
|
616
|
+
}
|
|
617
|
+
// Emit a table row selection changed event
|
|
618
|
+
for (const index of selectionIndexes) {
|
|
619
|
+
const data = this._tableRows[index].data;
|
|
620
|
+
const selected = this._selectionManager.exists(data);
|
|
621
|
+
const detail = { selected, index, data };
|
|
622
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SELECT, detail, true, false);
|
|
623
|
+
}
|
|
624
|
+
// If selecting/deselecting this row causes the select all state to be changed, then emit the select all changed event.
|
|
625
|
+
if (this._isAllSelected !== isAllSelected) {
|
|
626
|
+
this._isAllSelected = isAllSelected;
|
|
627
|
+
const data = {
|
|
628
|
+
status: this._isAllSelected,
|
|
629
|
+
count: this._tableRows.filter(row => row.selected).length,
|
|
630
|
+
data: [...this._data],
|
|
631
|
+
targetType: 'row'
|
|
632
|
+
};
|
|
633
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SELECT_ALL, data, true, false);
|
|
634
|
+
}
|
|
635
|
+
this._previouslyClickedRow = Object.assign({}, rowSelectedInfo);
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Determines which row was chosen from the given event.
|
|
639
|
+
* @param {Event} evt The click event.
|
|
640
|
+
*/
|
|
641
|
+
_getSelectedRowFromEvent(evt) {
|
|
642
|
+
const composedPath = getEventPath(evt);
|
|
643
|
+
const rowElement = composedPath.find(el => el.tagName === 'TR');
|
|
644
|
+
// We need to get the index of the row element from its parent tbody in case the
|
|
645
|
+
// element has been removed from the DOM (table re-rendered) between when this event
|
|
646
|
+
// was dispatched and when this method is executed
|
|
647
|
+
const tbody = rowElement.parentElement;
|
|
648
|
+
const index = this._getNonExpandedRows(tbody).findIndex(el => el === rowElement);
|
|
649
|
+
const data = this._tableRows[index].data;
|
|
650
|
+
return { rowElement, index, data };
|
|
651
|
+
}
|
|
652
|
+
_getNonExpandedRows(tbodyElement) {
|
|
653
|
+
return Array.from(tbodyElement.rows)
|
|
654
|
+
.filter(row => !row.classList.contains(TABLE_CONSTANTS.classes.TABLE_ROW_EXPANDABLE_CONTENT));
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Handles the select all checkbox being checked/unchecked.
|
|
658
|
+
*/
|
|
659
|
+
_onSelectAll(evt) {
|
|
660
|
+
evt.stopPropagation();
|
|
661
|
+
// Toggle the status of our select all state
|
|
662
|
+
this._isAllSelected = !this._isAllSelected;
|
|
663
|
+
const tableElement = this._adapter.getTableElement();
|
|
664
|
+
// Update the select all checkbox in the table based on the new state
|
|
665
|
+
this._adapter.updateSelectAllState(tableElement, this._isAllSelected);
|
|
666
|
+
// Select/deselect every row based on our new select all state
|
|
667
|
+
this._tableRows.forEach((tableRow, index) => {
|
|
668
|
+
// Update the state for each row
|
|
669
|
+
tableRow.selected = this._isAllSelected;
|
|
670
|
+
// Update the selection manager
|
|
671
|
+
if (this._isAllSelected) {
|
|
672
|
+
this._selectionManager.add(tableRow.data);
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
this._selectionManager.remove(tableRow.data);
|
|
676
|
+
}
|
|
677
|
+
// Update the table row selected state
|
|
678
|
+
const rowElement = TableUtils.getRowByIndex(tableElement, index);
|
|
679
|
+
if (rowElement) {
|
|
680
|
+
this._adapter.updateSelectedState(rowElement, this._isAllSelected);
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
// Emit the select all changed event
|
|
684
|
+
const data = {
|
|
685
|
+
status: this._isAllSelected,
|
|
686
|
+
count: this._tableRows.filter(row => row.selected).length,
|
|
687
|
+
data: [...this._data],
|
|
688
|
+
targetType: 'select-all'
|
|
689
|
+
};
|
|
690
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SELECT_ALL, data, true, false);
|
|
691
|
+
}
|
|
692
|
+
_onHeadRowContextMenu(evt) {
|
|
693
|
+
evt.preventDefault();
|
|
694
|
+
}
|
|
695
|
+
_onHeadRowMouseDown(evt) {
|
|
696
|
+
if (evt.button !== 0) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const composedPath = getEventPath(evt);
|
|
700
|
+
const target = evt.target;
|
|
701
|
+
// Find the row and cell elements that the event originated within
|
|
702
|
+
const rowElement = composedPath.find(el => el.tagName === 'TR');
|
|
703
|
+
const thElement = composedPath.find(el => el.tagName === 'TH');
|
|
704
|
+
const cellIndex = Array.from(rowElement.cells).findIndex(c => c === thElement);
|
|
705
|
+
this._headCellMouseDownIndex = cellIndex;
|
|
706
|
+
if (target !== thElement && target.classList.contains(TABLE_CONSTANTS.classes.TABLE_RESIZE_HANDLE)) {
|
|
707
|
+
this._resizeDescriptor = {
|
|
708
|
+
element: thElement,
|
|
709
|
+
startWidth: thElement.offsetWidth,
|
|
710
|
+
startX: evt.pageX,
|
|
711
|
+
width: thElement.offsetWidth,
|
|
712
|
+
index: this._select ? cellIndex - 1 : cellIndex
|
|
713
|
+
};
|
|
714
|
+
this._adapter.addDocumentListener('mousemove', this._documentMouseMoveListener);
|
|
715
|
+
this._adapter.setResizeColumnVisibility(this._tableConfiguration, cellIndex, true);
|
|
716
|
+
}
|
|
717
|
+
this._adapter.addDocumentListener('mouseup', this._documentMouseUpListener);
|
|
718
|
+
}
|
|
719
|
+
_onMouseMove(evt) {
|
|
720
|
+
if (this._resizeDescriptor) {
|
|
721
|
+
let newWidth = this._resizeDescriptor.startWidth + (evt.pageX - this._resizeDescriptor.startX);
|
|
722
|
+
// Ensure that the user can't drag the column past the minimum column width
|
|
723
|
+
if (newWidth < this._minResizeWidth) {
|
|
724
|
+
newWidth = this._minResizeWidth;
|
|
725
|
+
}
|
|
726
|
+
this._resizeDescriptor.width = newWidth;
|
|
727
|
+
this._resizeDescriptor.element.style.width = `${newWidth}px`;
|
|
728
|
+
this._adapter.addTableClass(TABLE_CONSTANTS.classes.TABLE_RESIZING);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
_onMouseUp(evt) {
|
|
732
|
+
this._adapter.removeDocumentListener('mousemove', this._documentMouseMoveListener);
|
|
733
|
+
this._adapter.removeDocumentListener('mouseup', this._documentMouseUpListener);
|
|
734
|
+
this._adapter.removeTableClass(TABLE_CONSTANTS.classes.TABLE_RESIZING);
|
|
735
|
+
if (this._headCellMouseDownIndex === undefined) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
if (this._resizeDescriptor) {
|
|
739
|
+
this._adapter.normalizeColumnWidths(this._tableConfiguration);
|
|
740
|
+
this._adapter.setResizeColumnVisibility(this._tableConfiguration, this._headCellMouseDownIndex, false);
|
|
741
|
+
const resizeEventData = {
|
|
742
|
+
index: this._resizeDescriptor.index,
|
|
743
|
+
width: this._resizeDescriptor.width
|
|
744
|
+
};
|
|
745
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.COLUMN_RESIZE, resizeEventData);
|
|
746
|
+
this._resizeDescriptor = undefined;
|
|
747
|
+
}
|
|
748
|
+
else if (this._tableConfiguration.tableElement.tHead.contains(evt.target)) {
|
|
749
|
+
if (this._multiColumnSort) {
|
|
750
|
+
this._onMultiSort(this._headCellMouseDownIndex, evt.ctrlKey);
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
this._onSort(this._headCellMouseDownIndex);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
this._headCellMouseDownIndex = undefined;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Called when a click event is triggered on the table header row.
|
|
760
|
+
* We use this to capture all click events on the row, and determine which
|
|
761
|
+
* header cell was clicked.
|
|
762
|
+
*/
|
|
763
|
+
_onSort(cellIndex) {
|
|
764
|
+
// Get the column index so we can access the config for that column (this depends on whether there is a select column or not)
|
|
765
|
+
const columnIndex = this._select ? cellIndex - 1 : cellIndex;
|
|
766
|
+
// Get the column config
|
|
767
|
+
const columnConfig = columnIndex >= 0 ? this._visibleColumnConfigurations[columnIndex] : null;
|
|
768
|
+
// If this column was not sortable, or was the select column then we just return
|
|
769
|
+
if (!columnConfig || !columnConfig.sortable) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
// Always default to ascending sort on a newly sorted column
|
|
773
|
+
let desiredSortDirection = SortDirection.Ascending;
|
|
774
|
+
// Toggle the sort direction class
|
|
775
|
+
const isTogglingSortOnSameColumn = columnIndex === this._sortedColumnIndex;
|
|
776
|
+
const currentSortDirectionIsAscending = this._sortDirection === SortDirection.Ascending || this._sortDirection === undefined;
|
|
777
|
+
const isUnsorting = isTogglingSortOnSameColumn && this._sortDirection === SortDirection.Descending;
|
|
778
|
+
if (isTogglingSortOnSameColumn && currentSortDirectionIsAscending) {
|
|
779
|
+
desiredSortDirection = SortDirection.Descending;
|
|
780
|
+
}
|
|
781
|
+
if (isUnsorting && !columnConfig.preventUnsort) {
|
|
782
|
+
desiredSortDirection = SortDirection.Unset;
|
|
783
|
+
}
|
|
784
|
+
// Emit the sort event for this column
|
|
785
|
+
const data = {
|
|
786
|
+
direction: desiredSortDirection,
|
|
787
|
+
columnIndex
|
|
788
|
+
};
|
|
789
|
+
if (!this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SORT, data, true, true)) {
|
|
790
|
+
// If defaultPrevented is true, we emit the event without updating internal state.
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (isTogglingSortOnSameColumn && this._sortDirection === SortDirection.Descending && !columnConfig.preventUnsort) {
|
|
794
|
+
this._adapter.removeColumnSort(this._adapter.getTableElement(), this._select ? this._sortedColumnIndex + 1 : this._sortedColumnIndex);
|
|
795
|
+
this._sortedColumnIndex = -1;
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
// Update internal state
|
|
799
|
+
this._sortDirection = desiredSortDirection;
|
|
800
|
+
// Toggle the sort direction class
|
|
801
|
+
if (columnIndex === this._sortedColumnIndex) {
|
|
802
|
+
// Update the table with the new sort direction
|
|
803
|
+
this._adapter.setSortDirection(this._adapter.getTableElement(), cellIndex, this._sortDirection);
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
// If we have a column this is currently sorted, remove the sort from that column
|
|
807
|
+
if (this._sortedColumnIndex >= 0) {
|
|
808
|
+
this._adapter.removeColumnSort(this._adapter.getTableElement(), this._select ? this._sortedColumnIndex + 1 : this._sortedColumnIndex);
|
|
809
|
+
}
|
|
810
|
+
// Set this column as the sorted column
|
|
811
|
+
this._sortedColumnIndex = columnIndex;
|
|
812
|
+
// Set the new sort direction on the newly sorted column
|
|
813
|
+
this._adapter.setSortedColumn(this._adapter.getTableElement(), cellIndex, this._sortDirection);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
_onMultiSort(cellIndex, ctrlKey) {
|
|
817
|
+
// Get the column index so we can access the config for that column (this depends on whether there is a select column or not)
|
|
818
|
+
const columnIndex = this._select ? cellIndex - 1 : cellIndex;
|
|
819
|
+
// Get the column config
|
|
820
|
+
const columnConfig = columnIndex >= 0 ? this._visibleColumnConfigurations[columnIndex] : null;
|
|
821
|
+
// If this column was not sortable, or was the select column then we just return
|
|
822
|
+
if (!columnConfig || !columnConfig.sortable) {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
const revertColumns = this._multiSortManager.sortedColumns;
|
|
826
|
+
const sortColumn = this._multiSortManager.getSortColumn(columnIndex);
|
|
827
|
+
if (sortColumn) {
|
|
828
|
+
this._multiSortManager.updateSortColumn(sortColumn);
|
|
829
|
+
}
|
|
830
|
+
else if (ctrlKey) {
|
|
831
|
+
this._multiSortManager.addSortColumn({ direction: SortDirection.Descending, columnIndex, propertyName: columnConfig.property });
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
this._multiSortManager.clearMultiSort();
|
|
835
|
+
this._multiSortManager.addSortColumn({ direction: SortDirection.Descending, columnIndex, propertyName: columnConfig.property });
|
|
836
|
+
}
|
|
837
|
+
const data = this._multiSortManager.sortedColumns.map(col => (Object.assign({}, col)));
|
|
838
|
+
if (!this._adapter.emitHostEvent(TABLE_CONSTANTS.events.SORT, data, true, true)) {
|
|
839
|
+
// If defaultPrevented is true, we emit the event without updating internal state.
|
|
840
|
+
this._multiSortManager.setSortColumns(revertColumns);
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
const newSortedColumns = this._multiSortManager.sortedColumns;
|
|
844
|
+
const hasMultipleColumnsSorted = newSortedColumns.length > 1;
|
|
845
|
+
// clear any unsorted columns in the UI
|
|
846
|
+
for (let virtualIndex = 0; virtualIndex < this._visibleColumnConfigurations.length; virtualIndex++) {
|
|
847
|
+
// actualIndex takes into account if there is a select column, virtualIndex is 0 -> visible data columns length
|
|
848
|
+
const actualIndex = this._select ? virtualIndex + 1 : virtualIndex;
|
|
849
|
+
if (!this._multiSortManager.isSortColumn(virtualIndex)) {
|
|
850
|
+
this._adapter.removeColumnSort(this._adapter.getTableElement(), actualIndex);
|
|
851
|
+
TableUtils.setMultiSortColumnSortNumber(this._adapter.getTableElement(), hasMultipleColumnsSorted, actualIndex, null);
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
const column = this._multiSortManager.getSortColumn(virtualIndex);
|
|
855
|
+
if (column) {
|
|
856
|
+
this._adapter.setSortedColumn(this._adapter.getTableElement(), actualIndex, column.direction);
|
|
857
|
+
TableUtils.setMultiSortColumnSortNumber(this._adapter.getTableElement(), hasMultipleColumnsSorted, actualIndex, column.sortOrder || null);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Handles filter events and emits the filter information event.
|
|
864
|
+
* @param evt The event.
|
|
865
|
+
*/
|
|
866
|
+
_onFilter(value, columnIndex) {
|
|
867
|
+
const data = { value, columnIndex };
|
|
868
|
+
this._adapter.emitHostEvent(TABLE_CONSTANTS.events.FILTER, data, true, false);
|
|
869
|
+
}
|
|
870
|
+
_shiftSelectRows(selectedRow) {
|
|
871
|
+
const indexes = [];
|
|
872
|
+
if (this._previouslyClickedRow) {
|
|
873
|
+
const prevIndex = this._previouslyClickedRow.index;
|
|
874
|
+
const currIndex = selectedRow.index;
|
|
875
|
+
let startIndex = currIndex >= prevIndex ? prevIndex : currIndex;
|
|
876
|
+
let endIndex = currIndex >= prevIndex ? currIndex : prevIndex;
|
|
877
|
+
endIndex += endIndex > startIndex ? 1 : 0;
|
|
878
|
+
startIndex += startIndex > endIndex ? 1 : 0;
|
|
879
|
+
let action = (data) => this.selectRows(data, false);
|
|
880
|
+
const existingSelection = this._tableRows.find(item => item.selected && item.data === selectedRow.data);
|
|
881
|
+
const shouldDeselect = this._tableRows.find(item => { var _a; return item.data === ((_a = this._previouslyClickedRow) === null || _a === void 0 ? void 0 : _a.data) && !item.selected; });
|
|
882
|
+
// If you are clicking a checkbox that is already selected, deselect all the rows
|
|
883
|
+
if (!existingSelection || shouldDeselect) {
|
|
884
|
+
action = (data) => this.deselectRows(data);
|
|
885
|
+
}
|
|
886
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
887
|
+
indexes.push(i);
|
|
888
|
+
}
|
|
889
|
+
action(this.data.filter((v, i) => indexes.includes(i)));
|
|
890
|
+
}
|
|
891
|
+
return indexes;
|
|
892
|
+
}
|
|
893
|
+
_isIndeterminate(isAllSelected) {
|
|
894
|
+
return !isAllSelected && this.getSelectedRows().length > 0 && this._data.length !== this.getSelectedRows().length;
|
|
895
|
+
}
|
|
896
|
+
_applyRoomy() {
|
|
897
|
+
this._adapter.setRoomy(this._adapter.getTableElement(), this._roomy);
|
|
898
|
+
this._adapter.setHostAttribute(TABLE_CONSTANTS.attributes.ROOMY, this._roomy.toString());
|
|
899
|
+
}
|
|
900
|
+
_refreshTableSort() {
|
|
901
|
+
this._sortedColumnIndex = this._visibleColumnConfigurations.findIndex(c => c.initialSort);
|
|
902
|
+
this._sortDirection = this._sortedColumnIndex >= 0 ? this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection : undefined;
|
|
903
|
+
if (this._multiColumnSort) {
|
|
904
|
+
const sortedColumns = [];
|
|
905
|
+
this._visibleColumnConfigurations.forEach((col, index) => {
|
|
906
|
+
if (typeof col.initialSort === 'object') {
|
|
907
|
+
sortedColumns.push({
|
|
908
|
+
columnIndex: index,
|
|
909
|
+
direction: col.initialSort.direction,
|
|
910
|
+
sortOrder: col.initialSort.sortOrder,
|
|
911
|
+
propertyName: col.property
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
this._multiSortManager.setSortColumns(sortedColumns);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|