@material/dialog
Version:
The Material Components Web dialog component
82 lines • 4 kB
JavaScript
/**
* @license
* Copyright 2016 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export var cssClasses = {
CLOSING: 'mdc-dialog--closing',
OPEN: 'mdc-dialog--open',
OPENING: 'mdc-dialog--opening',
SCROLLABLE: 'mdc-dialog--scrollable',
SCROLL_LOCK: 'mdc-dialog-scroll-lock',
STACKED: 'mdc-dialog--stacked',
FULLSCREEN: 'mdc-dialog--fullscreen',
// Class for showing a scroll divider on full-screen dialog header element.
// Should only be displayed on scrollable content, when the dialog content is
// scrolled "underneath" the header.
SCROLL_DIVIDER_HEADER: 'mdc-dialog-scroll-divider-header',
// Class for showing a scroll divider on a full-screen dialog footer element.
// Should only be displayed on scrolalble content, when the dialog content is
// obscured "underneath" the footer.
SCROLL_DIVIDER_FOOTER: 'mdc-dialog-scroll-divider-footer',
// The "surface scrim" is a scrim covering only the surface of a dialog. This
// is used in situations where a confirmation dialog is shown over an already
// opened full-screen dialog. On larger screen-sizes, the full-screen dialog
// is sized as a modal and so in these situations we display a "surface scrim"
// to prevent a "double scrim" (where the scrim from the secondary
// confirmation dialog would overlap with the scrim from the full-screen
// dialog).
SURFACE_SCRIM_SHOWN: 'mdc-dialog__surface-scrim--shown',
// "Showing" animating class for the surface-scrim.
SURFACE_SCRIM_SHOWING: 'mdc-dialog__surface-scrim--showing',
// "Hiding" animating class for the surface-scrim.
SURFACE_SCRIM_HIDING: 'mdc-dialog__surface-scrim--hiding',
// Class to hide a dialog's scrim (used in conjunction with a surface-scrim).
// Note that we only hide the original scrim rather than removing it entirely
// to prevent interactions with the content behind this scrim, and to capture
// scrim clicks.
SCRIM_HIDDEN: 'mdc-dialog__scrim--hidden',
};
export var strings = {
ACTION_ATTRIBUTE: 'data-mdc-dialog-action',
BUTTON_DEFAULT_ATTRIBUTE: 'data-mdc-dialog-button-default',
BUTTON_SELECTOR: '.mdc-dialog__button',
CLOSED_EVENT: 'MDCDialog:closed',
CLOSE_ACTION: 'close',
CLOSING_EVENT: 'MDCDialog:closing',
CONTAINER_SELECTOR: '.mdc-dialog__container',
CONTENT_SELECTOR: '.mdc-dialog__content',
DESTROY_ACTION: 'destroy',
INITIAL_FOCUS_ATTRIBUTE: 'data-mdc-dialog-initial-focus',
OPENED_EVENT: 'MDCDialog:opened',
OPENING_EVENT: 'MDCDialog:opening',
SCRIM_SELECTOR: '.mdc-dialog__scrim',
SUPPRESS_DEFAULT_PRESS_SELECTOR: [
'textarea',
'.mdc-menu .mdc-list-item',
'.mdc-menu .mdc-deprecated-list-item',
].join(', '),
SURFACE_SELECTOR: '.mdc-dialog__surface',
};
export var numbers = {
DIALOG_ANIMATION_CLOSE_TIME_MS: 75,
DIALOG_ANIMATION_OPEN_TIME_MS: 150,
};
//# sourceMappingURL=constants.js.map