@ncino/web-components 13.8.0 → 13.8.1
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/components/toast/gator/toast-constants.js +1 -1
- package/dist/components/toaster/gator/toaster.gator.js +4 -8
- package/dist/packages/web-components/src/components/toaster/gator/toaster.gator.scss.js +1 -1
- package/dist/types/components/toast/gator/toast-constants.d.ts +2 -2
- package/dist/types/components/toaster/gator/toaster.gator.d.ts +4 -4
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const A=2,T=300,
|
|
1
|
+
const A=2,T=300,O=350;export{A as MAX_TOAST_ACTIONS,T as TOAST_ANIMATION_DURATION_MS,O as TOAST_CLOSE_POPOVER_DELAY_MS};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as h}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as
|
|
2
|
-
<
|
|
3
|
-
${v(this._dialogRef)}
|
|
4
|
-
class="gator-toaster-dialog"
|
|
5
|
-
@click=${this.preventDialogClose}
|
|
6
|
-
>
|
|
1
|
+
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as h}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as f}from"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as u}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as m}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as _}from"../../../utils/decorators/custom-element-decorator.js";import v from"../../../packages/web-components/src/components/toaster/gator/toaster.gator.scss.js";import d from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import T from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"../../toast-container/gator/toast-container.gator.js";import{createRef as O,ref as P}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{MAX_TOAST_ACTIONS as n,TOAST_CLOSE_POPOVER_DELAY_MS as g}from"../../toast/gator/toast-constants.js";import{unsafeCSS as c}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var y=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(o,t,s,r)=>{for(var e=r>1?void 0:r?S(t,s):t,a=o.length-1,l;a>=0;a--)(l=o[a])&&(e=(r?l(t,s,e):l(e))||e);return r&&e&&y(t,s,e),e};let i=class extends f{constructor(){super(...arguments),this.position="top-right",this.defaultToastOptions={},this._toasts=[],this._popoverOpen=!1,this._popoverRef=O(),this._closePopoverTimeout=null}addToast(o){const t=crypto.randomUUID(),s=o.duration??this.defaultToastOptions?.duration??i.defaultDuration,r=!s||s===0;let e=o.actions;e&&e.length>n&&(console.warn(`[ngc-toaster] Toast actions are limited to ${n}. Extra actions were ignored.`),e=e.slice(0,n));const a={...this.defaultToastOptions,...o,id:t,sticky:r,actions:e};return this._toasts=[...this._toasts,a],this._closePopoverTimeout!==null&&(clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=null),this._popoverOpen=!0,r||setTimeout(()=>{this.removeToast(t)},s),t}removeToast(o){this._toasts=this._toasts.filter(t=>t.id!==o),this._toasts.length===0&&this.scheduleClose()}clearAll(){this._toasts=[],this.scheduleClose()}scheduleClose(){this._closePopoverTimeout!==null&&clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=window.setTimeout(()=>{this._popoverOpen=!1,this._closePopoverTimeout=null},g)}handleToastDismiss(o){const t=o.detail.id;t&&this.removeToast(t)}updated(o){if(super.updated(o),o.has("_popoverOpen")){const t=this._popoverRef.value;if(!t)return;const s=t.matches(":popover-open");try{this._popoverOpen&&!s?t.showPopover():!this._popoverOpen&&s&&t.hidePopover()}catch{}}}disconnectedCallback(){super.disconnectedCallback(),this._closePopoverTimeout!==null&&(clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=null)}render(){return h`
|
|
2
|
+
<div ${P(this._popoverRef)} popover="manual" class="gator-toaster-popover">
|
|
7
3
|
<div class="gator-toaster ${this.position}">
|
|
8
4
|
<ngc-toast-container
|
|
9
5
|
.toasts=${this._toasts}
|
|
10
6
|
@dismiss=${this.handleToastDismiss}
|
|
11
7
|
></ngc-toast-container>
|
|
12
8
|
</div>
|
|
13
|
-
</
|
|
14
|
-
`}
|
|
9
|
+
</div>
|
|
10
|
+
`}};i.styles=[c(v),c(d),c(T)];i.defaultDuration=5e3;p([u({type:String})],i.prototype,"position",2);p([u({type:Object,attribute:"default-toast-options"})],i.prototype,"defaultToastOptions",2);p([m()],i.prototype,"_toasts",2);p([m()],i.prototype,"_popoverOpen",2);i=p([_("ngc-toaster")],i);export{i as NgcToaster};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=".gator-toaster-
|
|
1
|
+
const t=".gator-toaster-popover{position:fixed;inset:auto;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:none;background:transparent;overflow:visible;pointer-events:none}.gator-toaster-popover::backdrop{display:none}.gator-toaster{position:fixed;display:flex;flex-direction:column;pointer-events:auto}.gator-toaster.top-left{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.top-center{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.top-right{inset-block-start:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}.gator-toaster.bottom-left{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.bottom-center{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.bottom-right{inset-block-end:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}";export{t as default};
|
|
@@ -7,6 +7,6 @@ export declare const MAX_TOAST_ACTIONS = 2;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const TOAST_ANIMATION_DURATION_MS = 300;
|
|
9
9
|
/**
|
|
10
|
-
* Amount of time to wait before
|
|
10
|
+
* Amount of time to wait before hiding the toast popover (leaving the top layer) to account for animation timing
|
|
11
11
|
*/
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const TOAST_CLOSE_POPOVER_DELAY_MS: number;
|
|
@@ -18,20 +18,20 @@ export declare class NgcToaster extends LitElement {
|
|
|
18
18
|
**/
|
|
19
19
|
defaultToastOptions: DefaultToastOptions;
|
|
20
20
|
private _toasts;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
21
|
+
private _popoverOpen;
|
|
22
|
+
private _popoverRef;
|
|
23
|
+
private _closePopoverTimeout;
|
|
24
24
|
addToast(options: Partial<DefaultToastOptions> & {
|
|
25
25
|
title?: string;
|
|
26
26
|
subtitle?: string;
|
|
27
27
|
}): `${string}-${string}-${string}-${string}-${string}`;
|
|
28
28
|
removeToast(id: string): void;
|
|
29
29
|
clearAll(): void;
|
|
30
|
+
private scheduleClose;
|
|
30
31
|
private handleToastDismiss;
|
|
31
32
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
32
33
|
disconnectedCallback(): void;
|
|
33
34
|
render(): import('lit').TemplateResult<1>;
|
|
34
|
-
private preventDialogClose;
|
|
35
35
|
}
|
|
36
36
|
declare global {
|
|
37
37
|
interface HTMLElementTagNameMap {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncino/web-components",
|
|
3
3
|
"author": "nCino",
|
|
4
|
-
"version": "13.8.
|
|
4
|
+
"version": "13.8.1",
|
|
5
5
|
"license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"vite-plugin-static-copy": "^3.3.0",
|
|
101
101
|
"vitest": "^4.1.0",
|
|
102
102
|
"yaml-eslint-parser": "^2.0.0",
|
|
103
|
-
"@ncino/styles": "13.8.
|
|
103
|
+
"@ncino/styles": "13.8.1"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@ncino/styles": "13.8.
|
|
106
|
+
"@ncino/styles": "13.8.1"
|
|
107
107
|
},
|
|
108
108
|
"bugs": {
|
|
109
109
|
"url": "https://github.com/ncino/force-sdk-web-components/issues"
|
package/web-types.json
CHANGED