-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed dts-bundle-generator in favor of dedicated vite plugin * fixing some treeshaking related issues * update dependencies * update tooling setup
- Loading branch information
Showing
118 changed files
with
5,330 additions
and
5,946 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
"use strict";var C=Object.defineProperty;var g=(s,t,e)=>t in s?C(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var o=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);const n=require("@thednp/shorty"),a=require("@thednp/event-listener"),E=require("./fadeClass-Co6nOzNJ.js"),l=require("./showClass-D_Ms1FgG.js"),p=require("./dataBsDismiss-CMHF7If_.js"),q=require("./base-component-DBcDoOjV.js"),r="alert",u="Alert",L=`.${r}`,f=`[${p.dataBsDismiss}="${r}"]`,$=s=>n.getInstance(s,u),b=s=>new i(s),d=n.createCustomEvent(`close.bs.${r}`),w=n.createCustomEvent(`closed.bs.${r}`),m=s=>{const{element:t}=s;n.dispatchEvent(t,w),s._toggleEventListeners(),s.dispose(),t.remove()};class i extends q.BaseComponent{constructor(e){super(e);o(this,"dismiss");o(this,"close",()=>{const{element:e}=this;// istanbul ignore else @preserve | ||
e&&n.hasClass(e,l.showClass)&&(n.dispatchEvent(e,d),d.defaultPrevented||(n.removeClass(e,l.showClass),n.hasClass(e,E.fadeClass)?n.emulateTransitionEnd(e,()=>m(this)):m(this)))});o(this,"_toggleEventListeners",e=>{const h=e?a.addListener:a.removeListener,{dismiss:c,close:v}=this;// istanbul ignore else @preserve | ||
c&&h(c,n.mouseclickEvent,v)});this.dismiss=n.querySelector(f,this.element),this._toggleEventListeners(!0)}get name(){return u}dispose(){this._toggleEventListeners(),super.dispose()}}o(i,"selector",L),o(i,"init",b),o(i,"getInstance",$);module.exports=i; | ||
"use strict";const s=require("./base-component-D3rSrWwH.js"),i=require("./event-listener-W3RGkfJ6.js"),h=require("./fadeClass-Co6nOzNJ.js"),r=require("./showClass-D_Ms1FgG.js"),v=require("./dataBsDismiss-CMHF7If_.js"),n="alert",l="Alert",C=`.${n}`,E=`[${v.dataBsDismiss}="${n}"]`,g=t=>s.getInstance(t,l),p=t=>new d(t),c=s.createCustomEvent(`close.bs.${n}`),q=s.createCustomEvent(`closed.bs.${n}`),a=t=>{const{element:e}=t;s.dispatchEvent(e,q),t._toggleEventListeners(),t.dispose(),e.remove()};class d extends s.BaseComponent{static selector=C;static init=p;static getInstance=g;dismiss;constructor(e){super(e),this.dismiss=s.querySelector(E,this.element),this._toggleEventListeners(!0)}get name(){return l}close=()=>{const{element:e}=this;e&&s.hasClass(e,r.showClass)&&(s.dispatchEvent(e,c),c.defaultPrevented||(s.removeClass(e,r.showClass),s.hasClass(e,h.fadeClass)?s.emulateTransitionEnd(e,()=>a(this)):a(this)))};_toggleEventListeners=e=>{const m=e?i.E:i.r,{dismiss:o,close:u}=this;o&&m(o,s.mouseclickEvent,u)};dispose(){this._toggleEventListeners(),super.dispose()}}module.exports=d; | ||
//# sourceMappingURL=alert.cjs.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,49 @@ | ||
export interface BaseOptions { | ||
[key: string]: unknown; | ||
} | ||
declare class BaseComponent { | ||
element: HTMLElement; | ||
options?: BaseOptions; | ||
/** | ||
* @param target `HTMLElement` or selector string | ||
* @param config component instance options | ||
*/ | ||
constructor(target: HTMLElement | string, config?: BaseOptions); | ||
get version(): string; | ||
get name(): string; | ||
get defaults(): {}; | ||
/** just to have something to extend from */ | ||
_toggleEventListeners: () => void; | ||
/** Removes component from target element. */ | ||
dispose(): void; | ||
} | ||
/** Creates a new Alert instance. */ | ||
declare class Alert extends BaseComponent { | ||
static selector: string; | ||
static init: (element: HTMLElement) => Alert; | ||
static getInstance: (element: HTMLElement) => Alert | null; | ||
dismiss: HTMLElement | null; | ||
constructor(target: HTMLElement | string); | ||
/** Returns component name string. */ | ||
get name(): string; | ||
/** | ||
* Public method that hides the `.alert` element from the user, | ||
* disposes the instance once animation is complete, then | ||
* removes the element from the DOM. | ||
*/ | ||
close: () => void; | ||
/** | ||
* Toggle on / off the `click` event listener. | ||
* | ||
* @param add when `true`, event listener is added | ||
*/ | ||
_toggleEventListeners: (add?: boolean) => void; | ||
/** Remove the component from target element. */ | ||
dispose(): void; | ||
} | ||
|
||
export { | ||
Alert as default, | ||
}; | ||
|
||
export as namespace Alert; | ||
|
||
export {}; | ||
/** Creates a new Alert instance. */ | ||
declare class Alert extends BaseComponent { | ||
static selector: string; | ||
static init: (element: HTMLElement) => Alert; | ||
static getInstance: (element: HTMLElement) => Alert | null; | ||
dismiss: HTMLElement | null; | ||
constructor(target: HTMLElement | string); | ||
/** Returns component name string. */ | ||
get name(): string; | ||
/** | ||
* Public method that hides the `.alert` element from the user, | ||
* disposes the instance once animation is complete, then | ||
* removes the element from the DOM. | ||
*/ | ||
close: () => void; | ||
/** | ||
* Toggle on / off the `click` event listener. | ||
* | ||
* @param add when `true`, event listener is added | ||
*/ | ||
_toggleEventListeners: (add?: boolean) => void; | ||
/** Remove the component from target element. */ | ||
dispose(): void; | ||
} | ||
export default Alert; | ||
|
||
/** Returns a new `BaseComponent` instance. */ | ||
declare class BaseComponent { | ||
element: HTMLElement; | ||
options?: BaseOptions; | ||
/** | ||
* @param target `HTMLElement` or selector string | ||
* @param config component instance options | ||
*/ | ||
constructor(target: HTMLElement | string, config?: BaseOptions); | ||
get version(): string; | ||
get name(): string; | ||
get defaults(): {}; | ||
/** just to have something to extend from */ | ||
_toggleEventListeners: () => void; | ||
/** Removes component from target element. */ | ||
dispose(): void; | ||
} | ||
|
||
declare interface BaseOptions { | ||
[key: string]: unknown; | ||
} | ||
|
||
export { } |
Oops, something went wrong.