@digital-realty/ix-drawer 1.1.16 → 1.1.18
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/dist/IxDrawer.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare class IxDrawer extends LitElement {
|
|
|
34
34
|
handleCloseButton(): void;
|
|
35
35
|
handleOnBlur(): void;
|
|
36
36
|
handleClosing(): void;
|
|
37
|
+
renderCloseButton(): typeof nothing | import("lit").TemplateResult<1>;
|
|
37
38
|
renderMinimiseButton(): typeof nothing | import("lit").TemplateResult<1>;
|
|
38
39
|
renderMaximiseButton(): import("lit").TemplateResult<1>;
|
|
39
40
|
renderDeleteButton(): import("lit").TemplateResult<1>;
|
package/dist/IxDrawer.js
CHANGED
|
@@ -118,6 +118,15 @@ export class IxDrawer extends LitElement {
|
|
|
118
118
|
this.handleClosed();
|
|
119
119
|
}, 300);
|
|
120
120
|
}
|
|
121
|
+
renderCloseButton() {
|
|
122
|
+
if (this.hideClose) {
|
|
123
|
+
return nothing;
|
|
124
|
+
}
|
|
125
|
+
return html `<ix-icon-button
|
|
126
|
+
@click=${this.handleCloseButton}
|
|
127
|
+
icon="close"
|
|
128
|
+
></ix-icon-button>`;
|
|
129
|
+
}
|
|
121
130
|
renderMinimiseButton() {
|
|
122
131
|
if (this.minimisable)
|
|
123
132
|
return html `<ix-button
|
|
@@ -166,14 +175,16 @@ export class IxDrawer extends LitElement {
|
|
|
166
175
|
appearance="text"
|
|
167
176
|
form="form-id"
|
|
168
177
|
@click=${this.handleOnCancel}
|
|
169
|
-
>NO</ix-button
|
|
170
178
|
>
|
|
179
|
+
NO
|
|
180
|
+
</ix-button>
|
|
171
181
|
<ix-button
|
|
172
182
|
appearance="text"
|
|
173
183
|
form="form-id"
|
|
174
184
|
@click=${this.handleClosing}
|
|
175
|
-
>YES</ix-button
|
|
176
185
|
>
|
|
186
|
+
YES
|
|
187
|
+
</ix-button>
|
|
177
188
|
</div>
|
|
178
189
|
</ix-dialog>
|
|
179
190
|
`;
|
|
@@ -215,17 +226,9 @@ export class IxDrawer extends LitElement {
|
|
|
215
226
|
<div class="drawer-header__minimise-btn">
|
|
216
227
|
${this.renderMinimiseButton()}
|
|
217
228
|
</div>
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
: html `
|
|
222
|
-
<div class="drawer-header__close-btn">
|
|
223
|
-
<ix-icon-button
|
|
224
|
-
@click=${this.handleCloseButton}
|
|
225
|
-
icon="close"
|
|
226
|
-
></ix-icon-button>
|
|
227
|
-
</div>
|
|
228
|
-
`}
|
|
229
|
+
<div class="drawer-header__close-btn">
|
|
230
|
+
${this.renderCloseButton()}
|
|
231
|
+
</div>
|
|
229
232
|
</div>
|
|
230
233
|
<div
|
|
231
234
|
class="drawer-body ${this.scrollable ? '' : 'no-scroll'} ${this
|
package/dist/IxDrawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IxDrawer.js","sourceRoot":"","sources":["../src/IxDrawer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,wCAAwC,CAAC;AAChD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kDAAkD,CAAC;AAC1D,OAAO,wCAAwC,CAAC;AAEhD,MAAM,OAAO,QAAS,SAAQ,UAAU;IAAxC;;QAKqB,cAAS,GAAG,KAAK,CAAC;QAElB,iCAA4B,GAAG,KAAK,CAAC;QAE3B,cAAS,GAAG,KAAK,CAAC;QAInB,mBAAc,GAAG,OAAO,CAAC;QAEzB,sBAAiB,GAAG,EAAE,CAAC;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DAA0B;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAwB;AAEtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAqB;AAEpB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAmB;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+DAAuC;AAEP;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;iDACnD;AAE8C;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;2CAAmB;AAE3C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAmB;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAiB;AAEpC;IAAR,KAAK,EAAE;yCAAiB;AAEhB;IAAR,KAAK,EAAE;4CAAoB;AAEE;IAA7B,KAAK,CAAC,qBAAqB,CAAC;4CAAqC","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { IxDrawerStyles } from './styles/ix-drawer-styles.js';\nimport '@digital-realty/ix-button/ix-button.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-dialog/ix-dialog.js';\n\nexport class IxDrawer extends LitElement {\n static get styles() {\n return [IxDrawerStyles];\n }\n\n @state() protected minimised = false;\n\n @state() protected openDeleteConfirmationDialog = false;\n\n @property({ type: Boolean }) isVisible = false;\n\n @property({ type: Function }) onClosed: any;\n\n @property({ type: String }) minimisedTitle = 'Draft';\n\n @property({ type: String }) minimisedSubTitle = '';\n\n @property({ type: Boolean }) minimisable = false;\n\n @property({ type: Boolean }) hideAside = false;\n\n @property({ type: Boolean }) showConfirmationDialogOnClose = false;\n\n @property({ type: Boolean, attribute: 'animate-vertical' }) animateVertical =\n false;\n\n @property({ type: Boolean, attribute: 'hide-close' }) hideClose = false;\n\n @property({ type: Boolean }) scrollable = true;\n\n @property({ type: Boolean }) compact = false;\n\n @state() closing = false;\n\n @state() minimising = false;\n\n @query('#content-scroll-box') contentBox: HTMLElement | undefined;\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.resetState();\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('isVisible')) {\n if (this.isVisible) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'initial';\n }\n }\n }\n\n resetState() {\n this.closing = false;\n this.minimising = false;\n this.openDeleteConfirmationDialog = false;\n this.minimised = false;\n }\n\n handleOnScroll = () => {\n if (this.contentBox) {\n const scrollEvent = new CustomEvent('on-content-scroll', {\n detail: {\n scrollTop: this.contentBox.scrollTop,\n scrollHeight: this.contentBox.scrollHeight,\n clientHeight: this.contentBox.clientHeight,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(scrollEvent);\n }\n };\n\n onMinimised() {\n this.minimising = true;\n this.closing = true;\n setTimeout(() => {\n this.handleClosed();\n }, 300);\n }\n\n onMaximised() {\n this.minimised = false;\n }\n\n handleOnCancel() {\n this.openDeleteConfirmationDialog = false;\n }\n\n handleOnDelete() {\n this.openDeleteConfirmationDialog = true;\n }\n\n handleClosed() {\n if (this.closing) {\n this.closing = false;\n this.openDeleteConfirmationDialog = false;\n\n if (this.minimising) {\n this.minimising = false;\n this.minimised = !this.minimised;\n return;\n }\n\n this.minimised = false;\n\n this.onClosed();\n }\n }\n\n clickOutsideDrawer(event: MouseEvent) {\n const el = event.target as HTMLElement;\n if (el.classList.contains('drawer-container')) {\n if (!this.minimising && this.showConfirmationDialogOnClose)\n this.openDeleteConfirmationDialog = true;\n else this.handleClosing();\n }\n }\n\n handleCloseButton() {\n if (this.showConfirmationDialogOnClose)\n this.openDeleteConfirmationDialog = true;\n else this.handleClosing();\n }\n\n handleOnBlur() {\n this.handleOnCancel();\n }\n\n handleClosing() {\n this.closing = true;\n // Backup timeout to complete closing\n // if animation end event has not fired\n setTimeout(() => {\n this.handleClosed();\n }, 300);\n }\n\n renderMinimiseButton() {\n if (this.minimisable)\n return html`<ix-button\n data-testid=\"hideButton\"\n appearance=\"text\"\n has-icon\n @click=${this.onMinimised}\n >\n <ix-icon slot=\"icon\">fullscreen_exit</ix-icon>\n HIDE\n </ix-button>`;\n\n return nothing;\n }\n\n renderMaximiseButton() {\n return html`<div class=\"drawer__maximise-btn\">\n <ix-icon @click=${this.onMaximised}>fullscreen</ix-icon>\n </div>`;\n }\n\n renderDeleteButton() {\n return html`<svg\n class=\"drawer__delete-btn\"\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n data-testid=\"deleteIcon\"\n @click=${this.handleOnDelete}\n >\n <path\n d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\"\n ></path>\n </svg> `;\n }\n\n renderDeleteConfirmationDialog() {\n return html`\n <ix-dialog\n .open=${this.openDeleteConfirmationDialog}\n @blur=${this.handleOnBlur}\n >\n <form slot=\"content\" id=\"form-id\" method=\"dialog\">\n <h2 class=\"drawer-delete-dialog__title\">\n Are you sure you want to proceed? All details provided will be lost.\n </h2>\n </form>\n <div slot=\"actions\">\n <ix-button\n appearance=\"text\"\n form=\"form-id\"\n @click=${this.handleOnCancel}\n >NO</ix-button\n >\n <ix-button\n appearance=\"text\"\n form=\"form-id\"\n @click=${this.handleClosing}\n >YES</ix-button\n >\n </div>\n </ix-dialog>\n `;\n }\n\n renderMinimisedContainer() {\n return html`<div class=\"drawer-minimised-container\">\n <div class=\"drawer-minimised-body\">\n <div>\n <div class=\"drawer-minimised-title\">${this.minimisedTitle}</div>\n <div class=\"drawer-minimised-sub-title\">\n ${this.minimisedSubTitle}\n </div>\n </div>\n <div class=\"drawer-minimised-actions\">\n ${this.renderDeleteButton()} ${this.renderMaximiseButton()}\n </div>\n </div>\n </div>`;\n }\n\n renderDrawerContainer() {\n const drawerClasses = {\n drawer: true,\n 'animate-vert': this.animateVertical,\n 'aside-hidden': this.hideAside,\n compact: this.compact,\n };\n\n return html`\n <div\n class=\"drawer-container\"\n ?closing=${this.closing}\n @click=${this.clickOutsideDrawer}\n @keydown=${this.clickOutsideDrawer}\n >\n <aside\n class=${classMap(drawerClasses)}\n @animationend=${this.handleClosed}\n >\n <div class=\"drawer-header\">\n <div class=\"drawer-header__minimise-btn\">\n ${this.renderMinimiseButton()}\n </div>\n <slot name=\"header\"></slot>\n ${this.hideClose\n ? nothing\n : html`\n <div class=\"drawer-header__close-btn\">\n <ix-icon-button\n @click=${this.handleCloseButton}\n icon=\"close\"\n ></ix-icon-button>\n </div>\n `}\n </div>\n <div\n class=\"drawer-body ${this.scrollable ? '' : 'no-scroll'} ${this\n .minimisable\n ? 'minimisable'\n : ''}\"\n @scroll=${this.handleOnScroll}\n id=\"content-scroll-box\"\n >\n <slot name=\"content\"></slot>\n </div>\n </aside>\n </div>\n `;\n }\n\n render() {\n if (!this.isVisible) return nothing;\n\n return html`\n ${this.minimised\n ? this.renderMinimisedContainer()\n : this.renderDrawerContainer()}\n ${this.renderDeleteConfirmationDialog()}\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IxDrawer.js","sourceRoot":"","sources":["../src/IxDrawer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3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 'lit/directives/class-map.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { IxDrawerStyles } from './styles/ix-drawer-styles.js';\nimport '@digital-realty/ix-button/ix-button.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-dialog/ix-dialog.js';\n\nexport class IxDrawer extends LitElement {\n static get styles() {\n return [IxDrawerStyles];\n }\n\n @state() protected minimised = false;\n\n @state() protected openDeleteConfirmationDialog = false;\n\n @property({ type: Boolean }) isVisible = false;\n\n @property({ type: Function }) onClosed: any;\n\n @property({ type: String }) minimisedTitle = 'Draft';\n\n @property({ type: String }) minimisedSubTitle = '';\n\n @property({ type: Boolean }) minimisable = false;\n\n @property({ type: Boolean }) hideAside = false;\n\n @property({ type: Boolean }) showConfirmationDialogOnClose = false;\n\n @property({ type: Boolean, attribute: 'animate-vertical' }) animateVertical =\n false;\n\n @property({ type: Boolean, attribute: 'hide-close' }) hideClose = false;\n\n @property({ type: Boolean }) scrollable = true;\n\n @property({ type: Boolean }) compact = false;\n\n @state() closing = false;\n\n @state() minimising = false;\n\n @query('#content-scroll-box') contentBox: HTMLElement | undefined;\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this.resetState();\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('isVisible')) {\n if (this.isVisible) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'initial';\n }\n }\n }\n\n resetState() {\n this.closing = false;\n this.minimising = false;\n this.openDeleteConfirmationDialog = false;\n this.minimised = false;\n }\n\n handleOnScroll = () => {\n if (this.contentBox) {\n const scrollEvent = new CustomEvent('on-content-scroll', {\n detail: {\n scrollTop: this.contentBox.scrollTop,\n scrollHeight: this.contentBox.scrollHeight,\n clientHeight: this.contentBox.clientHeight,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(scrollEvent);\n }\n };\n\n onMinimised() {\n this.minimising = true;\n this.closing = true;\n setTimeout(() => {\n this.handleClosed();\n }, 300);\n }\n\n onMaximised() {\n this.minimised = false;\n }\n\n handleOnCancel() {\n this.openDeleteConfirmationDialog = false;\n }\n\n handleOnDelete() {\n this.openDeleteConfirmationDialog = true;\n }\n\n handleClosed() {\n if (this.closing) {\n this.closing = false;\n this.openDeleteConfirmationDialog = false;\n\n if (this.minimising) {\n this.minimising = false;\n this.minimised = !this.minimised;\n return;\n }\n\n this.minimised = false;\n\n this.onClosed();\n }\n }\n\n clickOutsideDrawer(event: MouseEvent) {\n const el = event.target as HTMLElement;\n if (el.classList.contains('drawer-container')) {\n if (!this.minimising && this.showConfirmationDialogOnClose)\n this.openDeleteConfirmationDialog = true;\n else this.handleClosing();\n }\n }\n\n handleCloseButton() {\n if (this.showConfirmationDialogOnClose)\n this.openDeleteConfirmationDialog = true;\n else this.handleClosing();\n }\n\n handleOnBlur() {\n this.handleOnCancel();\n }\n\n handleClosing() {\n this.closing = true;\n // Backup timeout to complete closing\n // if animation end event has not fired\n setTimeout(() => {\n this.handleClosed();\n }, 300);\n }\n\n renderCloseButton() {\n if (this.hideClose) {\n return nothing;\n }\n\n return html`<ix-icon-button\n @click=${this.handleCloseButton}\n icon=\"close\"\n ></ix-icon-button>`;\n }\n\n renderMinimiseButton() {\n if (this.minimisable)\n return html`<ix-button\n data-testid=\"hideButton\"\n appearance=\"text\"\n has-icon\n @click=${this.onMinimised}\n >\n <ix-icon slot=\"icon\">fullscreen_exit</ix-icon>\n HIDE\n </ix-button>`;\n\n return nothing;\n }\n\n renderMaximiseButton() {\n return html`<div class=\"drawer__maximise-btn\">\n <ix-icon @click=${this.onMaximised}>fullscreen</ix-icon>\n </div>`;\n }\n\n renderDeleteButton() {\n return html`<svg\n class=\"drawer__delete-btn\"\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n data-testid=\"deleteIcon\"\n @click=${this.handleOnDelete}\n >\n <path\n d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\"\n ></path>\n </svg> `;\n }\n\n renderDeleteConfirmationDialog() {\n return html`\n <ix-dialog\n .open=${this.openDeleteConfirmationDialog}\n @blur=${this.handleOnBlur}\n >\n <form slot=\"content\" id=\"form-id\" method=\"dialog\">\n <h2 class=\"drawer-delete-dialog__title\">\n Are you sure you want to proceed? All details provided will be lost.\n </h2>\n </form>\n <div slot=\"actions\">\n <ix-button\n appearance=\"text\"\n form=\"form-id\"\n @click=${this.handleOnCancel}\n >\n NO\n </ix-button>\n <ix-button\n appearance=\"text\"\n form=\"form-id\"\n @click=${this.handleClosing}\n >\n YES\n </ix-button>\n </div>\n </ix-dialog>\n `;\n }\n\n renderMinimisedContainer() {\n return html`<div class=\"drawer-minimised-container\">\n <div class=\"drawer-minimised-body\">\n <div>\n <div class=\"drawer-minimised-title\">${this.minimisedTitle}</div>\n <div class=\"drawer-minimised-sub-title\">\n ${this.minimisedSubTitle}\n </div>\n </div>\n <div class=\"drawer-minimised-actions\">\n ${this.renderDeleteButton()} ${this.renderMaximiseButton()}\n </div>\n </div>\n </div>`;\n }\n\n renderDrawerContainer() {\n const drawerClasses = {\n drawer: true,\n 'animate-vert': this.animateVertical,\n 'aside-hidden': this.hideAside,\n compact: this.compact,\n };\n\n return html`\n <div\n class=\"drawer-container\"\n ?closing=${this.closing}\n @click=${this.clickOutsideDrawer}\n @keydown=${this.clickOutsideDrawer}\n >\n <aside\n class=${classMap(drawerClasses)}\n @animationend=${this.handleClosed}\n >\n <div class=\"drawer-header\">\n <div class=\"drawer-header__minimise-btn\">\n ${this.renderMinimiseButton()}\n </div>\n <div class=\"drawer-header__close-btn\">\n ${this.renderCloseButton()}\n </div>\n </div>\n <div\n class=\"drawer-body ${this.scrollable ? '' : 'no-scroll'} ${this\n .minimisable\n ? 'minimisable'\n : ''}\"\n @scroll=${this.handleOnScroll}\n id=\"content-scroll-box\"\n >\n <slot name=\"content\"></slot>\n </div>\n </aside>\n </div>\n `;\n }\n\n render() {\n if (!this.isVisible) return nothing;\n\n return html`\n ${this.minimised\n ? this.renderMinimisedContainer()\n : this.renderDrawerContainer()}\n ${this.renderDeleteConfirmationDialog()}\n `;\n }\n}\n"]}
|
package/dist/ix-drawer.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{css,LitElement,html,nothing}from"lit";import{classMap}from"lit/directives/class-map.js";import{state,property,query}from"lit/decorators.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-icon/ix-icon.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"@digital-realty/ix-dialog/ix-dialog.js";let IxDrawerStyles=css`:host,:host :root,:root{font-size:var(--ix-drawer-font-size,.875rem);line-height:var(--ix-drawer-line-height,1.25rem);--ix-drawer-animation-time:225ms}.drawer-container{z-index:1000;display:block;position:fixed;top:0;bottom:0;left:0;right:0;background-color:var(--ix-draw-scrim-bg,rgba(0,0,0,.5));scroll-behavior:auto;overflow:auto}.drawer-container[closing]{animation:fadeOut var(--ix-drawer-animation-time,225ms) linear forwards}.drawer{display:flex;flex-direction:column;width:var(--ix-draw-width-sm,90vw);top:0;bottom:0;right:0;position:fixed;padding:var(--ix-drawer-padding,0 40px);background-color:#fff;border-radius:var(--ix-drawer-border-radius,16px 0 0 16px);box-sizing:border-box;box-shadow:0 12px 20px -12px rgba(0,0,0,.12),0 0 0 1px #e1e4e8 inset;transform:translateX(100%);z-index:2}.drawer.animate-vert{transform:translateY(-100%)}.aside-hidden{display:none}:host([isvisible]) .drawer{animation:slideIn var(--ix-drawer-animation-time,225ms) cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer-container[closing] .drawer{animation:slideOut var(--ix-drawer-animation-time,225ms) 0s cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer.animate-vert{animation:slideInVert var(--ix-drawer-animation-time,225ms) cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer-container[closing] .drawer.animate-vert{animation:slideOutVert var(--ix-drawer-animation-time,225ms) 0s cubic-bezier(0,0,.2,1) forwards}@keyframes fadeIn{0%{background-color:transparent}100%{background-color:var(--ix-draw-scrim-bg,#00000080)}}@keyframes fadeOut{0%{background-color:var(--ix-draw-scrim-bg,#00000080)}100%{background-color:transparent}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}@keyframes slideInVert{100%{transform:translateY(0)}}@keyframes slideOutVert{0%{transform:translateY(0)}100%{transform:translateY(-100%)}}@media screen and (min-width:1024px){.drawer{width:var(--ix-draw-width-lg,45vw)}}.drawer-header{display:flex;justify-content:space-between;position:fixed;left:40px;right:40px;top:0;padding-top:2rem;background-color:#fff;z-index:10}.drawer-header__close-btn{background:#fff;border-radius:50%;position:relative;z-index:9}.drawer-header__minimise-btn{flex:0}.drawer-body{overflow-y:auto;position:absolute;top:0;bottom:0;left:32px;padding-left:8px;right:40px;padding-top:32px}.drawer-body.no-scroll{overflow:hidden;padding-left:1rem}.drawer-body.minimisable{padding-top:72px}.drawer-minimised-container{bottom:24px;position:absolute;right:24px;z-index:1200;display:flex;flex-direction:row;gap:8px}.drawer-minimised-body{background-color:#fff;height:72px;display:flex;-webkit-box-align:center;align-items:center;padding:4px 24px;box-shadow:rgba(0,0,0,.12) 0 12px 20px -12px,#e1e4e8 0 0 0 1px inset;border-radius:16px;-webkit-box-pack:justify;justify-content:space-between}.drawer-minimised-title{color:rgba(9,34,65,.7);font-style:normal;font-weight:400;font-size:12px;line-height:16px;letter-spacing:.4px;font-family:'Open Sans',sans-serif}.drawer-minimised-sub-title{font-style:normal;font-weight:700;font-size:14px;line-height:24px;letter-spacing:.1px;font-family:'Open Sans',sans-serif}.drawer-minimised-actions{margin-left:42px;display:flex;-webkit-box-align:center;align-items:center}.drawer-delete-dialog__title{line-height:1.25}.drawer__delete-btn{user-select:none;width:1em;height:1em;display:inline-block;fill:currentcolor;flex-shrink:0;transition:fill .2s cubic-bezier(.4,0,.2,1) 0s;font-size:1.5rem;color:#db0028;cursor:pointer;margin-right:20px}.drawer__maximise-btn{display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;outline:0;border:0;margin:0;cursor:pointer;user-select:none;vertical-align:middle;appearance:none;text-decoration:none;font-family:'Red Hat Display',sans-serif;font-weight:700;font-style:normal;font-size:1.5rem;line-height:18.52px;letter-spacing:1.25px;text-transform:uppercase;min-height:36px;transition:background-color 250ms cubic-bezier(.4,0,.2,1) 0s,box-shadow 250ms cubic-bezier(.4,0,.2,1) 0s,border-color 250ms cubic-bezier(.4,0,.2,1) 0s;border-radius:50%;padding:0;min-width:0;z-index:1050;color:#fff;height:40px!important;width:40px!important;background-color:#1456e0!important;box-shadow:none!important}.drawer.compact .drawer-header{display:flex;justify-content:space-between;align-items:center;position:relative;left:0;right:0;top:0;padding-top:0;background-color:#fff;z-index:10}.drawer.compact .drawer-body{position:relative;top:initial;bottom:initial;left:initial;padding-left:0;right:initial;padding-top:0}`;class IxDrawer extends LitElement{constructor(){super(...arguments),this.minimised=!1,this.openDeleteConfirmationDialog=!1,this.isVisible=!1,this.minimisedTitle="Draft",this.minimisedSubTitle="",this.minimisable=!1,this.hideAside=!1,this.showConfirmationDialogOnClose=!1,this.animateVertical=!1,this.hideClose=!1,this.scrollable=!0,this.compact=!1,this.closing=!1,this.minimising=!1,this.handleOnScroll=()=>{var i;this.contentBox&&(i=new CustomEvent("on-content-scroll",{detail:{scrollTop:this.contentBox.scrollTop,scrollHeight:this.contentBox.scrollHeight,clientHeight:this.contentBox.clientHeight},bubbles:!0,composed:!0}),this.dispatchEvent(i))}}static get styles(){return[IxDrawerStyles]}disconnectedCallback(){super.disconnectedCallback(),this.resetState()}updated(i){super.updated(i),i.has("isVisible")&&(this.isVisible?document.body.style.overflow="hidden":document.body.style.overflow="initial")}resetState(){this.closing=!1,this.minimising=!1,this.openDeleteConfirmationDialog=!1,this.minimised=!1}onMinimised(){this.minimising=!0,this.closing=!0,setTimeout(()=>{this.handleClosed()},300)}onMaximised(){this.minimised=!1}handleOnCancel(){this.openDeleteConfirmationDialog=!1}handleOnDelete(){this.openDeleteConfirmationDialog=!0}handleClosed(){this.closing&&(this.closing=!1,this.openDeleteConfirmationDialog=!1,this.minimising?(this.minimising=!1,this.minimised=!this.minimised):(this.minimised=!1,this.onClosed()))}clickOutsideDrawer(i){i.target.classList.contains("drawer-container")&&(!this.minimising&&this.showConfirmationDialogOnClose?this.openDeleteConfirmationDialog=!0:this.handleClosing())}handleCloseButton(){this.showConfirmationDialogOnClose?this.openDeleteConfirmationDialog=!0:this.handleClosing()}handleOnBlur(){this.handleOnCancel()}handleClosing(){this.closing=!0,setTimeout(()=>{this.handleClosed()},300)}renderMinimiseButton(){return this.minimisable?html`<ix-button data-testid="hideButton" appearance="text" has-icon @click="${this.onMinimised}"><ix-icon slot="icon">fullscreen_exit</ix-icon>HIDE</ix-button>`:nothing}renderMaximiseButton(){return html`<div class="drawer__maximise-btn"><ix-icon @click="${this.onMaximised}">fullscreen</ix-icon></div>`}renderDeleteButton(){return html`<svg class="drawer__delete-btn" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="deleteIcon" @click="${this.handleOnDelete}"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"></path></svg>`}renderDeleteConfirmationDialog(){return html`<ix-dialog .open="${this.openDeleteConfirmationDialog}" @blur="${this.handleOnBlur}"><form slot="content" id="form-id" method="dialog"><h2 class="drawer-delete-dialog__title">Are you sure you want to proceed? All details provided will be lost.</h2></form><div slot="actions"><ix-button appearance="text" form="form-id" @click="${this.handleOnCancel}">NO</ix-button><ix-button appearance="text" form="form-id" @click="${this.handleClosing}">YES</ix-button></div></ix-dialog>`}renderMinimisedContainer(){return html`<div class="drawer-minimised-container"><div class="drawer-minimised-body"><div><div class="drawer-minimised-title">${this.minimisedTitle}</div><div class="drawer-minimised-sub-title">${this.minimisedSubTitle}</div></div><div class="drawer-minimised-actions">${this.renderDeleteButton()} ${this.renderMaximiseButton()}</div></div></div>`}renderDrawerContainer(){var i={drawer:!0,"animate-vert":this.animateVertical,"aside-hidden":this.hideAside,compact:this.compact};return html`<div class="drawer-container" ?closing="${this.closing}" @click="${this.clickOutsideDrawer}" @keydown="${this.clickOutsideDrawer}"><aside class="${classMap(i)}" @animationend="${this.handleClosed}"><div class="drawer-header"><div class="drawer-header__minimise-btn">${this.renderMinimiseButton()}</div><slot name="header"></slot>${this.hideClose?nothing:html`<div class="drawer-header__close-btn"><ix-icon-button @click="${this.handleCloseButton}" icon="close"></ix-icon-button></div>`}</div><div class="drawer-body ${this.scrollable?"":"no-scroll"} ${this.minimisable?"minimisable":""}" @scroll="${this.handleOnScroll}" id="content-scroll-box"><slot name="content"></slot></div></aside></div>`}render(){return this.isVisible?html`${this.minimised?this.renderMinimisedContainer():this.renderDrawerContainer()} ${this.renderDeleteConfirmationDialog()}`:nothing}}__decorate([state()],IxDrawer.prototype,"minimised",void 0),__decorate([state()],IxDrawer.prototype,"openDeleteConfirmationDialog",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"isVisible",void 0),__decorate([property({type:Function})],IxDrawer.prototype,"onClosed",void 0),__decorate([property({type:String})],IxDrawer.prototype,"minimisedTitle",void 0),__decorate([property({type:String})],IxDrawer.prototype,"minimisedSubTitle",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"minimisable",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"hideAside",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"showConfirmationDialogOnClose",void 0),__decorate([property({type:Boolean,attribute:"animate-vertical"})],IxDrawer.prototype,"animateVertical",void 0),__decorate([property({type:Boolean,attribute:"hide-close"})],IxDrawer.prototype,"hideClose",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"scrollable",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"compact",void 0),__decorate([state()],IxDrawer.prototype,"closing",void 0),__decorate([state()],IxDrawer.prototype,"minimising",void 0),__decorate([query("#content-scroll-box")],IxDrawer.prototype,"contentBox",void 0),window.customElements.define("ix-drawer",IxDrawer);
|
|
1
|
+
import{__decorate}from"tslib";import{css,LitElement,nothing,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{state,property,query}from"lit/decorators.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-icon/ix-icon.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"@digital-realty/ix-dialog/ix-dialog.js";let IxDrawerStyles=css`:host,:host :root,:root{font-size:var(--ix-drawer-font-size,.875rem);line-height:var(--ix-drawer-line-height,1.25rem);--ix-drawer-animation-time:225ms}.drawer-container{z-index:1000;display:block;position:fixed;top:0;bottom:0;left:0;right:0;background-color:var(--ix-draw-scrim-bg,rgba(0,0,0,.5));scroll-behavior:auto;overflow:auto}.drawer-container[closing]{animation:fadeOut var(--ix-drawer-animation-time,225ms) linear forwards}.drawer{display:flex;flex-direction:column;width:var(--ix-draw-width-sm,90vw);top:0;bottom:0;right:0;position:fixed;padding:var(--ix-drawer-padding,0 40px);background-color:#fff;border-radius:var(--ix-drawer-border-radius,16px 0 0 16px);box-sizing:border-box;box-shadow:0 12px 20px -12px rgba(0,0,0,.12),0 0 0 1px #e1e4e8 inset;transform:translateX(100%);z-index:2}.drawer.animate-vert{transform:translateY(-100%)}.aside-hidden{display:none}:host([isvisible]) .drawer{animation:slideIn var(--ix-drawer-animation-time,225ms) cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer-container[closing] .drawer{animation:slideOut var(--ix-drawer-animation-time,225ms) 0s cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer.animate-vert{animation:slideInVert var(--ix-drawer-animation-time,225ms) cubic-bezier(0,0,.2,1) forwards}:host([isvisible]) .drawer-container[closing] .drawer.animate-vert{animation:slideOutVert var(--ix-drawer-animation-time,225ms) 0s cubic-bezier(0,0,.2,1) forwards}@keyframes fadeIn{0%{background-color:transparent}100%{background-color:var(--ix-draw-scrim-bg,#00000080)}}@keyframes fadeOut{0%{background-color:var(--ix-draw-scrim-bg,#00000080)}100%{background-color:transparent}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}@keyframes slideInVert{100%{transform:translateY(0)}}@keyframes slideOutVert{0%{transform:translateY(0)}100%{transform:translateY(-100%)}}@media screen and (min-width:1024px){.drawer{width:var(--ix-draw-width-lg,45vw)}}.drawer-header{display:flex;justify-content:space-between;position:fixed;left:40px;right:40px;top:0;padding-top:2rem;z-index:10}.drawer-header__close-btn{background:#fff;border-radius:50%;position:relative;z-index:9}.drawer-header__minimise-btn{flex:0}.drawer-body{overflow:auto;padding-top:32px}.drawer.compact .drawer-body{padding-top:0}.drawer-body.no-scroll{overflow:hidden}.drawer-body.minimisable{padding-top:72px}.drawer-minimised-container{bottom:24px;position:absolute;right:24px;z-index:1200;display:flex;flex-direction:row;gap:8px}.drawer-minimised-body{background-color:#fff;height:72px;display:flex;-webkit-box-align:center;align-items:center;padding:4px 24px;box-shadow:rgba(0,0,0,.12) 0 12px 20px -12px,#e1e4e8 0 0 0 1px inset;border-radius:16px;-webkit-box-pack:justify;justify-content:space-between}.drawer-minimised-title{color:rgba(9,34,65,.7);font-style:normal;font-weight:400;font-size:12px;line-height:16px;letter-spacing:.4px;font-family:'Open Sans',sans-serif}.drawer-minimised-sub-title{font-style:normal;font-weight:700;font-size:14px;line-height:24px;letter-spacing:.1px;font-family:'Open Sans',sans-serif}.drawer-minimised-actions{margin-left:42px;display:flex;-webkit-box-align:center;align-items:center}.drawer-delete-dialog__title{line-height:1.25}.drawer__delete-btn{user-select:none;width:1em;height:1em;display:inline-block;fill:currentcolor;flex-shrink:0;transition:fill .2s cubic-bezier(.4,0,.2,1) 0s;font-size:1.5rem;color:#db0028;cursor:pointer;margin-right:20px}.drawer__maximise-btn{display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;outline:0;border:0;margin:0;cursor:pointer;user-select:none;vertical-align:middle;appearance:none;text-decoration:none;font-family:'Red Hat Display',sans-serif;font-weight:700;font-style:normal;font-size:1.5rem;line-height:18.52px;letter-spacing:1.25px;text-transform:uppercase;min-height:36px;transition:background-color 250ms cubic-bezier(.4,0,.2,1) 0s,box-shadow 250ms cubic-bezier(.4,0,.2,1) 0s,border-color 250ms cubic-bezier(.4,0,.2,1) 0s;border-radius:50%;padding:0;min-width:0;z-index:1050;color:#fff;height:40px!important;width:40px!important;background-color:#1456e0!important;box-shadow:none!important}.drawer.compact .drawer-header{display:flex;justify-content:space-between;align-items:center;position:relative;left:0;right:0;top:0;padding-top:0;background-color:#fff;z-index:10}`;class IxDrawer extends LitElement{constructor(){super(...arguments),this.minimised=!1,this.openDeleteConfirmationDialog=!1,this.isVisible=!1,this.minimisedTitle="Draft",this.minimisedSubTitle="",this.minimisable=!1,this.hideAside=!1,this.showConfirmationDialogOnClose=!1,this.animateVertical=!1,this.hideClose=!1,this.scrollable=!0,this.compact=!1,this.closing=!1,this.minimising=!1,this.handleOnScroll=()=>{var e;this.contentBox&&(e=new CustomEvent("on-content-scroll",{detail:{scrollTop:this.contentBox.scrollTop,scrollHeight:this.contentBox.scrollHeight,clientHeight:this.contentBox.clientHeight},bubbles:!0,composed:!0}),this.dispatchEvent(e))}}static get styles(){return[IxDrawerStyles]}disconnectedCallback(){super.disconnectedCallback(),this.resetState()}updated(e){super.updated(e),e.has("isVisible")&&(this.isVisible?document.body.style.overflow="hidden":document.body.style.overflow="initial")}resetState(){this.closing=!1,this.minimising=!1,this.openDeleteConfirmationDialog=!1,this.minimised=!1}onMinimised(){this.minimising=!0,this.closing=!0,setTimeout(()=>{this.handleClosed()},300)}onMaximised(){this.minimised=!1}handleOnCancel(){this.openDeleteConfirmationDialog=!1}handleOnDelete(){this.openDeleteConfirmationDialog=!0}handleClosed(){this.closing&&(this.closing=!1,this.openDeleteConfirmationDialog=!1,this.minimising?(this.minimising=!1,this.minimised=!this.minimised):(this.minimised=!1,this.onClosed()))}clickOutsideDrawer(e){e.target.classList.contains("drawer-container")&&(!this.minimising&&this.showConfirmationDialogOnClose?this.openDeleteConfirmationDialog=!0:this.handleClosing())}handleCloseButton(){this.showConfirmationDialogOnClose?this.openDeleteConfirmationDialog=!0:this.handleClosing()}handleOnBlur(){this.handleOnCancel()}handleClosing(){this.closing=!0,setTimeout(()=>{this.handleClosed()},300)}renderCloseButton(){return this.hideClose?nothing:html`<ix-icon-button @click="${this.handleCloseButton}" icon="close"></ix-icon-button>`}renderMinimiseButton(){return this.minimisable?html`<ix-button data-testid="hideButton" appearance="text" has-icon @click="${this.onMinimised}"><ix-icon slot="icon">fullscreen_exit</ix-icon>HIDE</ix-button>`:nothing}renderMaximiseButton(){return html`<div class="drawer__maximise-btn"><ix-icon @click="${this.onMaximised}">fullscreen</ix-icon></div>`}renderDeleteButton(){return html`<svg class="drawer__delete-btn" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="deleteIcon" @click="${this.handleOnDelete}"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"></path></svg>`}renderDeleteConfirmationDialog(){return html`<ix-dialog .open="${this.openDeleteConfirmationDialog}" @blur="${this.handleOnBlur}"><form slot="content" id="form-id" method="dialog"><h2 class="drawer-delete-dialog__title">Are you sure you want to proceed? All details provided will be lost.</h2></form><div slot="actions"><ix-button appearance="text" form="form-id" @click="${this.handleOnCancel}">NO</ix-button><ix-button appearance="text" form="form-id" @click="${this.handleClosing}">YES</ix-button></div></ix-dialog>`}renderMinimisedContainer(){return html`<div class="drawer-minimised-container"><div class="drawer-minimised-body"><div><div class="drawer-minimised-title">${this.minimisedTitle}</div><div class="drawer-minimised-sub-title">${this.minimisedSubTitle}</div></div><div class="drawer-minimised-actions">${this.renderDeleteButton()} ${this.renderMaximiseButton()}</div></div></div>`}renderDrawerContainer(){var e={drawer:!0,"animate-vert":this.animateVertical,"aside-hidden":this.hideAside,compact:this.compact};return html`<div class="drawer-container" ?closing="${this.closing}" @click="${this.clickOutsideDrawer}" @keydown="${this.clickOutsideDrawer}"><aside class="${classMap(e)}" @animationend="${this.handleClosed}"><div class="drawer-header"><div class="drawer-header__minimise-btn">${this.renderMinimiseButton()}</div><div class="drawer-header__close-btn">${this.renderCloseButton()}</div></div><div class="drawer-body ${this.scrollable?"":"no-scroll"} ${this.minimisable?"minimisable":""}" @scroll="${this.handleOnScroll}" id="content-scroll-box"><slot name="content"></slot></div></aside></div>`}render(){return this.isVisible?html`${this.minimised?this.renderMinimisedContainer():this.renderDrawerContainer()} ${this.renderDeleteConfirmationDialog()}`:nothing}}__decorate([state()],IxDrawer.prototype,"minimised",void 0),__decorate([state()],IxDrawer.prototype,"openDeleteConfirmationDialog",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"isVisible",void 0),__decorate([property({type:Function})],IxDrawer.prototype,"onClosed",void 0),__decorate([property({type:String})],IxDrawer.prototype,"minimisedTitle",void 0),__decorate([property({type:String})],IxDrawer.prototype,"minimisedSubTitle",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"minimisable",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"hideAside",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"showConfirmationDialogOnClose",void 0),__decorate([property({type:Boolean,attribute:"animate-vertical"})],IxDrawer.prototype,"animateVertical",void 0),__decorate([property({type:Boolean,attribute:"hide-close"})],IxDrawer.prototype,"hideClose",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"scrollable",void 0),__decorate([property({type:Boolean})],IxDrawer.prototype,"compact",void 0),__decorate([state()],IxDrawer.prototype,"closing",void 0),__decorate([state()],IxDrawer.prototype,"minimising",void 0),__decorate([query("#content-scroll-box")],IxDrawer.prototype,"contentBox",void 0),window.customElements.define("ix-drawer",IxDrawer);
|
|
@@ -133,7 +133,6 @@ export const IxDrawerStyles = css `
|
|
|
133
133
|
right: 40px;
|
|
134
134
|
top: 0;
|
|
135
135
|
padding-top: 2rem;
|
|
136
|
-
background-color: #ffffff;
|
|
137
136
|
z-index: 10;
|
|
138
137
|
}
|
|
139
138
|
|
|
@@ -149,19 +148,16 @@ export const IxDrawerStyles = css `
|
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
.drawer-body {
|
|
152
|
-
overflow
|
|
153
|
-
position: absolute;
|
|
154
|
-
top: 0;
|
|
155
|
-
bottom: 0;
|
|
156
|
-
left: 32px;
|
|
157
|
-
padding-left: 8px;
|
|
158
|
-
right: 40px;
|
|
151
|
+
overflow: auto;
|
|
159
152
|
padding-top: 32px;
|
|
160
153
|
}
|
|
161
154
|
|
|
155
|
+
.drawer.compact .drawer-body {
|
|
156
|
+
padding-top: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
162
159
|
.drawer-body.no-scroll {
|
|
163
160
|
overflow: hidden;
|
|
164
|
-
padding-left: 1rem;
|
|
165
161
|
}
|
|
166
162
|
|
|
167
163
|
.drawer-body.minimisable {
|
|
@@ -297,14 +293,5 @@ export const IxDrawerStyles = css `
|
|
|
297
293
|
background-color: #ffffff;
|
|
298
294
|
z-index: 10;
|
|
299
295
|
}
|
|
300
|
-
.drawer.compact .drawer-body {
|
|
301
|
-
position: relative;
|
|
302
|
-
top: initial;
|
|
303
|
-
bottom: initial;
|
|
304
|
-
left: initial;
|
|
305
|
-
padding-left: 0;
|
|
306
|
-
right: initial;
|
|
307
|
-
padding-top: 0;
|
|
308
|
-
}
|
|
309
296
|
`;
|
|
310
297
|
//# sourceMappingURL=ix-drawer-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ix-drawer-styles.js","sourceRoot":"","sources":["../../src/styles/ix-drawer-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"ix-drawer-styles.js","sourceRoot":"","sources":["../../src/styles/ix-drawer-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsShC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxDrawerStyles = css`\n :root,\n :host :root,\n :host {\n font-size: var(--ix-drawer-font-size, 0.875rem);\n line-height: var(--ix-drawer-line-height, 1.25rem);\n --ix-drawer-animation-time: 225ms;\n }\n\n .drawer-container {\n z-index: 1000;\n display: block;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: var(--ix-draw-scrim-bg, rgba(0, 0, 0, 0.5));\n scroll-behavior: auto;\n overflow: auto;\n }\n\n .drawer-container[closing] {\n animation: fadeOut var(--ix-drawer-animation-time, 225ms) linear forwards;\n }\n\n .drawer {\n display: flex;\n flex-direction: column;\n width: var(--ix-draw-width-sm, 90vw);\n top: 0;\n bottom: 0;\n right: 0;\n position: fixed;\n padding: var(--ix-drawer-padding, 0 40px);\n background-color: white;\n border-radius: var(--ix-drawer-border-radius, 16px 0px 0px 16px);\n box-sizing: border-box;\n box-shadow: 0px 12px 20px -12px rgba(0, 0, 0, 0.12),\n 0px 0px 0px 1px #e1e4e8 inset;\n transform: translateX(100%);\n z-index: 2;\n }\n\n .drawer.animate-vert {\n transform: translateY(-100%);\n }\n\n .aside-hidden {\n display: none;\n }\n\n :host([isvisible]) .drawer {\n animation: slideIn var(--ix-drawer-animation-time, 225ms)\n cubic-bezier(0, 0, 0.2, 1) forwards;\n }\n\n :host([isvisible]) .drawer-container[closing] .drawer {\n animation: slideOut var(--ix-drawer-animation-time, 225ms) 0ms\n cubic-bezier(0, 0, 0.2, 1) forwards;\n }\n\n :host([isvisible]) .drawer.animate-vert {\n animation: slideInVert var(--ix-drawer-animation-time, 225ms)\n cubic-bezier(0, 0, 0.2, 1) forwards;\n }\n\n :host([isvisible]) .drawer-container[closing] .drawer.animate-vert {\n animation: slideOutVert var(--ix-drawer-animation-time, 225ms) 0ms\n cubic-bezier(0, 0, 0.2, 1) forwards;\n }\n\n @keyframes fadeIn {\n 0% {\n background-color: transparent;\n }\n 100% {\n background-color: var(--ix-draw-scrim-bg, #00000080);\n }\n }\n\n @keyframes fadeOut {\n 0% {\n background-color: var(--ix-draw-scrim-bg, #00000080);\n }\n 100% {\n background-color: transparent;\n }\n }\n\n @keyframes slideIn {\n 100% {\n transform: translateX(0);\n }\n }\n\n @keyframes slideOut {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n }\n\n @keyframes slideInVert {\n 100% {\n transform: translateY(0);\n }\n }\n\n @keyframes slideOutVert {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-100%);\n }\n }\n\n @media screen and (min-width: 1024px) {\n .drawer {\n width: var(--ix-draw-width-lg, 45vw);\n }\n }\n\n .drawer-header {\n display: flex;\n justify-content: space-between;\n position: fixed;\n left: 40px;\n right: 40px;\n top: 0;\n padding-top: 2rem;\n z-index: 10;\n }\n\n .drawer-header__close-btn {\n background: white;\n border-radius: 50%;\n position: relative;\n z-index: 9;\n }\n\n .drawer-header__minimise-btn {\n flex: 0;\n }\n\n .drawer-body {\n overflow: auto;\n padding-top: 32px;\n }\n\n .drawer.compact .drawer-body {\n padding-top: 0;\n }\n\n .drawer-body.no-scroll {\n overflow: hidden;\n }\n\n .drawer-body.minimisable {\n padding-top: 72px;\n }\n\n .drawer-minimised-container {\n bottom: 24px;\n position: absolute;\n right: 24px;\n z-index: 1200;\n display: flex;\n flex-direction: row;\n gap: 8px;\n }\n\n .drawer-minimised-body {\n background-color: rgb(255, 255, 255);\n height: 72px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n padding: 4px 24px;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,\n rgb(225, 228, 232) 0px 0px 0px 1px inset;\n border-radius: 16px;\n -webkit-box-pack: justify;\n justify-content: space-between;\n }\n\n .drawer-minimised-title {\n color: rgba(9, 34, 65, 0.7);\n font-style: normal;\n font-weight: normal;\n font-size: 12px;\n line-height: 16px;\n letter-spacing: 0.4px;\n font-family: 'Open Sans', sans-serif;\n }\n\n .drawer-minimised-sub-title {\n font-style: normal;\n font-weight: bold;\n font-size: 14px;\n line-height: 24px;\n letter-spacing: 0.1px;\n font-family: 'Open Sans', sans-serif;\n }\n\n .drawer-minimised-actions {\n margin-left: 42px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n }\n\n .drawer-delete-dialog__title {\n line-height: 1.25;\n }\n\n .drawer__delete-btn {\n user-select: none;\n width: 1em;\n height: 1em;\n display: inline-block;\n fill: currentcolor;\n flex-shrink: 0;\n transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n font-size: 1.5rem;\n color: rgb(219, 0, 40);\n cursor: pointer;\n margin-right: 20px;\n }\n\n .drawer__maximise-btn {\n display: inline-flex;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n outline: 0px;\n border: 0px;\n margin: 0px;\n cursor: pointer;\n user-select: none;\n vertical-align: middle;\n appearance: none;\n text-decoration: none;\n font-family: 'Red Hat Display', sans-serif;\n font-weight: 700;\n font-style: normal;\n font-size: 1.5rem;\n line-height: 18.52px;\n letter-spacing: 1.25px;\n text-transform: uppercase;\n min-height: 36px;\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n border-radius: 50%;\n padding: 0px;\n min-width: 0px;\n z-index: 1050;\n color: rgb(255, 255, 255);\n height: 40px !important;\n width: 40px !important;\n background-color: rgb(20, 86, 224) !important;\n box-shadow: none !important;\n }\n\n ix-dialog {\n form {\n max-width: 500px;\n }\n }\n\n /* Notifications / compact drawer */\n .drawer.compact {\n padding: 15px 10px 15px 0;\n }\n .drawer.compact .drawer-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n left: 0;\n right: 0;\n top: 0;\n padding-top: 0;\n background-color: #ffffff;\n z-index: 10;\n }\n`;\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-drawer following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "interxion",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.18",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"README.md",
|
|
110
110
|
"LICENSE"
|
|
111
111
|
],
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "21926e2af4f4c2fb4243a5c00b631ca02b38f4a8"
|
|
113
113
|
}
|