Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@descope/sdk-component-drivers

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@descope/sdk-component-drivers - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

dist/cjs/index.cjs.js

@@ -1,2 +0,2 @@

"use strict";var e=require("tslib"),t=require("@descope/sdk-helpers");var s,i;class r{constructor(t,i){s.set(this,void 0),this.nodeName="",e.__classPrivateFieldSet(this,s,t,"f"),this.logger=i.logger}get asyncEle(){return(async(e,t)=>new Promise((s=>{const i=setInterval((()=>{const t="function"==typeof e?e():e;t&&(clearInterval(i),s(t))}),100);setTimeout((()=>{clearInterval(i),s(null)}),t)})))(e.__classPrivateFieldGet(this,s,"f"),1e3)}get ele(){var t,i;const r="function"==typeof e.__classPrivateFieldGet(this,s,"f")?e.__classPrivateFieldGet(this,s,"f").call(this):e.__classPrivateFieldGet(this,s,"f");return r?(null==r?void 0:r.localName)!==this.nodeName?(null===(i=this.logger)||void 0===i||i.debug(`node name do not match, expected "${this.nodeName}", received "${r.localName}" `,Error()),null):r:(null===(t=this.logger)||void 0===t||t.debug("no element for driver ",this.constructor.name,new Error),null)}}s=new WeakMap;const l=/^descope-grid-([^-]+)-column$/,n={text:class extends r{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends r{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};i=new WeakMap;var o;o=new WeakMap;exports.ButtonDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}},exports.GridDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-grid",i.set(this,void 0)}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var s;const i=null===(s=l.exec(t.localName))||void 0===s?void 0:s[1],r=n[i];return r?(e.push(new r(t,{logger:this.logger})),e):e}),[]):[]}filterColumns(s){var r,l;const n=null===(r=this.ele.columns)||void 0===r?void 0:r.filter(s);t.compareArrays(n,this.ele.columns)||(this.ele.columns=n,null===(l=e.__classPrivateFieldGet(this,i,"f"))||void 0===l||l.call(this,n))}onColumnsChange(t){e.__classPrivateFieldSet(this,i,t,"f")}set renderColumn(e){this.ele.renderColumn=e}},exports.ModalDriver=class extends r{constructor(){super(...arguments),o.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}async open(){var e,t;await(null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this)),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}reset(){var t;this.ele&&(this.ele.innerHTML=""),e.__classPrivateFieldGet(this,o,"f")&&(null===(t=this.ele)||void 0===t||t.append(e.__classPrivateFieldGet(this,o,"f").content.cloneNode(!0)))}setContent(t){e.__classPrivateFieldSet(this,o,t,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}},exports.MultiSelectDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}},exports.NotificationDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}},exports.SingleSelectDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-combo-box"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}},exports.TextDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}},exports.TextFieldDriver=class extends r{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}};
"use strict";var e=require("tslib"),t=require("@descope/sdk-helpers");var i,r;class l{constructor(t,r){i.set(this,void 0),this.nodeName="",e.__classPrivateFieldSet(this,i,t,"f"),this.logger=r.logger}get asyncEle(){return(async(e,t)=>new Promise((i=>{const r=setInterval((()=>{const t="function"==typeof e?e():e;t&&(clearInterval(r),i(t))}),100);setTimeout((()=>{clearInterval(r),i(null)}),t)})))(e.__classPrivateFieldGet(this,i,"f"),1e3)}get ele(){var t,r;const l="function"==typeof e.__classPrivateFieldGet(this,i,"f")?e.__classPrivateFieldGet(this,i,"f").call(this):e.__classPrivateFieldGet(this,i,"f");return l?(null==l?void 0:l.localName)!==this.nodeName?(null===(r=this.logger)||void 0===r||r.debug(`node name do not match, expected "${this.nodeName}", received "${l.localName}" `,Error()),null):l:(null===(t=this.logger)||void 0===t||t.debug("no element for driver ",this.constructor.name,new Error),null)}}i=new WeakMap;const s=/^descope-grid-([^-]+)-column$/,n={text:class extends l{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends l{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};r=new WeakMap;var o;o=new WeakMap;exports.AvatarDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-avatar"}set displayName(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("display-name",e)}set image(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("img",e)}get flowId(){var e;return null===(e=this.ele)||void 0===e?void 0:e.getAttribute("flow-id")}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}},exports.ButtonDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}},exports.FlowDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-wc"}set projectId(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("project-id",e)}set baseUrl(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("base-url",e)}set flowId(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("flow-id",e)}onSuccess(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("success",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("success",e)}}},exports.GridDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-grid",r.set(this,void 0)}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var i;const r=null===(i=s.exec(t.localName))||void 0===i?void 0:i[1],l=n[r];return l?(e.push(new l(t,{logger:this.logger})),e):e}),[]):[]}filterColumns(i){var l,s;const n=null===(l=this.ele.columns)||void 0===l?void 0:l.filter(i);t.compareArrays(n,this.ele.columns)||(this.ele.columns=n,null===(s=e.__classPrivateFieldGet(this,r,"f"))||void 0===s||s.call(this,n))}onColumnsChange(t){e.__classPrivateFieldSet(this,r,t,"f")}set renderColumn(e){this.ele.renderColumn=e}},exports.ModalDriver=class extends l{constructor(){super(...arguments),o.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}async open(){var e,t;await(null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this)),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}reset(){var t;this.ele&&(this.ele.innerHTML=""),e.__classPrivateFieldGet(this,o,"f")&&(null===(t=this.ele)||void 0===t||t.append(e.__classPrivateFieldGet(this,o,"f").content.cloneNode(!0)))}setContent(t){e.__classPrivateFieldSet(this,o,t,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}},exports.MultiSelectDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}},exports.NotificationDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}},exports.SingleSelectDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-combo-box"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}},exports.TextDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}},exports.TextFieldDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}},exports.UserAttributeDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-user-attribute"}set value(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("value",e)}set badgeLabel(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("badge-label",e)}get label(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("label"))||""}get editFlowId(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("edit-flow-id"))||""}get deleteFlowId(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("delete-flow-id"))||""}onEditClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("edit-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("edit-clicked",e)}}onDeleteClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("delete-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("delete-clicked",e)}}},exports.UserAuthMethodDriver=class extends l{constructor(){super(...arguments),this.nodeName="descope-user-auth-method"}set fulfilled(e){var t,i;e?null===(t=this.ele)||void 0===t||t.setAttribute("fulfilled","true"):null===(i=this.ele)||void 0===i||i.removeAttribute("fulfilled")}onButtonClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("button-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("button-clicked",e)}}get flowId(){var e;return null===(e=this.ele)||void 0===e?void 0:e.getAttribute("flow-id")}};
//# sourceMappingURL=index.cjs.js.map

@@ -120,2 +120,36 @@ type Empty = null | undefined;

export { ButtonDriver, GridDriver, ModalDriver, MultiSelectDriver, NotificationDriver, SingleSelectDriver, TextDriver, TextFieldDriver };
declare class AvatarDriver extends BaseDriver {
nodeName: string;
set displayName(name: string);
set image(imgUrl: string);
get flowId(): string;
onClick(cb: (e: Event) => void): () => void;
}
declare class UserAttributeDriver extends BaseDriver {
nodeName: string;
set value(value: string);
set badgeLabel(label: string);
get label(): string;
get editFlowId(): string;
get deleteFlowId(): string;
onEditClick(cb: (e: Event) => void): () => void;
onDeleteClick(cb: (e: Event) => void): () => void;
}
declare class UserAuthMethodDriver extends BaseDriver {
nodeName: string;
set fulfilled(isFulfilled: boolean);
onButtonClick(cb: (e: Event) => void): () => void;
get flowId(): string;
}
declare class FlowDriver extends BaseDriver {
nodeName: string;
set projectId(projectId: string);
set baseUrl(baseUrl: string);
set flowId(flowId: string);
onSuccess(cb: () => void): () => void;
}
export { AvatarDriver, ButtonDriver, FlowDriver, GridDriver, ModalDriver, MultiSelectDriver, NotificationDriver, SingleSelectDriver, TextDriver, TextFieldDriver, UserAttributeDriver, UserAuthMethodDriver };

@@ -1,2 +0,2 @@

import{__classPrivateFieldSet as e,__classPrivateFieldGet as t}from"tslib";import{compareArrays as s}from"@descope/sdk-helpers";var n,l;class i{constructor(t,s){n.set(this,void 0),this.nodeName="",e(this,n,t,"f"),this.logger=s.logger}get asyncEle(){return(async(e,t)=>new Promise((s=>{const n=setInterval((()=>{const t="function"==typeof e?e():e;t&&(clearInterval(n),s(t))}),100);setTimeout((()=>{clearInterval(n),s(null)}),t)})))(t(this,n,"f"),1e3)}get ele(){var e,s;const l="function"==typeof t(this,n,"f")?t(this,n,"f").call(this):t(this,n,"f");return l?(null==l?void 0:l.localName)!==this.nodeName?(null===(s=this.logger)||void 0===s||s.debug(`node name do not match, expected "${this.nodeName}", received "${l.localName}" `,Error()),null):l:(null===(e=this.logger)||void 0===e||e.debug("no element for driver ",this.constructor.name,new Error),null)}}n=new WeakMap;const r=/^descope-grid-([^-]+)-column$/,o={text:class extends i{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends i{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};class d extends i{constructor(){super(...arguments),this.nodeName="descope-grid",l.set(this,void 0)}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var s;const n=null===(s=r.exec(t.localName))||void 0===s?void 0:s[1],l=o[n];return l?(e.push(new l(t,{logger:this.logger})),e):e}),[]):[]}filterColumns(e){var n,i;const r=null===(n=this.ele.columns)||void 0===n?void 0:n.filter(e);s(r,this.ele.columns)||(this.ele.columns=r,null===(i=t(this,l,"f"))||void 0===i||i.call(this,r))}onColumnsChange(t){e(this,l,t,"f")}set renderColumn(e){this.ele.renderColumn=e}}l=new WeakMap;class a extends i{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}var u;class v extends i{constructor(){super(...arguments),u.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}async open(){var e,t;await(null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this)),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}reset(){var e;this.ele&&(this.ele.innerHTML=""),t(this,u,"f")&&(null===(e=this.ele)||void 0===e||e.append(t(this,u,"f").content.cloneNode(!0)))}setContent(t){e(this,u,t,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}u=new WeakMap;class c extends i{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}}class h extends i{constructor(){super(...arguments),this.nodeName="descope-combo-box"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}}class m extends i{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}class p extends i{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}}class g extends i{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}export{a as ButtonDriver,d as GridDriver,v as ModalDriver,c as MultiSelectDriver,m as NotificationDriver,h as SingleSelectDriver,p as TextDriver,g as TextFieldDriver};
import{__classPrivateFieldSet as e,__classPrivateFieldGet as t}from"tslib";import{compareArrays as l}from"@descope/sdk-helpers";var i,s;class r{constructor(t,l){i.set(this,void 0),this.nodeName="",e(this,i,t,"f"),this.logger=l.logger}get asyncEle(){return(async(e,t)=>new Promise((l=>{const i=setInterval((()=>{const t="function"==typeof e?e():e;t&&(clearInterval(i),l(t))}),100);setTimeout((()=>{clearInterval(i),l(null)}),t)})))(t(this,i,"f"),1e3)}get ele(){var e,l;const s="function"==typeof t(this,i,"f")?t(this,i,"f").call(this):t(this,i,"f");return s?(null==s?void 0:s.localName)!==this.nodeName?(null===(l=this.logger)||void 0===l||l.debug(`node name do not match, expected "${this.nodeName}", received "${s.localName}" `,Error()),null):s:(null===(e=this.logger)||void 0===e||e.debug("no element for driver ",this.constructor.name,new Error),null)}}i=new WeakMap;const n=/^descope-grid-([^-]+)-column$/,o={text:class extends r{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends r{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};class d extends r{constructor(){super(...arguments),this.nodeName="descope-grid",s.set(this,void 0)}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var l;const i=null===(l=n.exec(t.localName))||void 0===l?void 0:l[1],s=o[i];return s?(e.push(new s(t,{logger:this.logger})),e):e}),[]):[]}filterColumns(e){var i,r;const n=null===(i=this.ele.columns)||void 0===i?void 0:i.filter(e);l(n,this.ele.columns)||(this.ele.columns=n,null===(r=t(this,s,"f"))||void 0===r||r.call(this,n))}onColumnsChange(t){e(this,s,t,"f")}set renderColumn(e){this.ele.renderColumn=e}}s=new WeakMap;class u extends r{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}var a;class v extends r{constructor(){super(...arguments),a.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}async open(){var e,t;await(null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this)),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}reset(){var e;this.ele&&(this.ele.innerHTML=""),t(this,a,"f")&&(null===(e=this.ele)||void 0===e||e.append(t(this,a,"f").content.cloneNode(!0)))}setContent(t){e(this,a,t,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}a=new WeakMap;class c extends r{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}}class h extends r{constructor(){super(...arguments),this.nodeName="descope-combo-box"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}}class m extends r{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}class p extends r{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}}class g extends r{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}class b extends r{constructor(){super(...arguments),this.nodeName="descope-avatar"}set displayName(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("display-name",e)}set image(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("img",e)}get flowId(){var e;return null===(e=this.ele)||void 0===e?void 0:e.getAttribute("flow-id")}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}}class f extends r{constructor(){super(...arguments),this.nodeName="descope-user-attribute"}set value(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("value",e)}set badgeLabel(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("badge-label",e)}get label(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("label"))||""}get editFlowId(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("edit-flow-id"))||""}get deleteFlowId(){var e;return(null===(e=this.ele)||void 0===e?void 0:e.getAttribute("delete-flow-id"))||""}onEditClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("edit-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("edit-clicked",e)}}onDeleteClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("delete-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("delete-clicked",e)}}}class E extends r{constructor(){super(...arguments),this.nodeName="descope-user-auth-method"}set fulfilled(e){var t,l;e?null===(t=this.ele)||void 0===t||t.setAttribute("fulfilled","true"):null===(l=this.ele)||void 0===l||l.removeAttribute("fulfilled")}onButtonClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("button-clicked",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("button-clicked",e)}}get flowId(){var e;return null===(e=this.ele)||void 0===e?void 0:e.getAttribute("flow-id")}}class x extends r{constructor(){super(...arguments),this.nodeName="descope-wc"}set projectId(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("project-id",e)}set baseUrl(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("base-url",e)}set flowId(e){var t;null===(t=this.ele)||void 0===t||t.setAttribute("flow-id",e)}onSuccess(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("success",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("success",e)}}}export{b as AvatarDriver,u as ButtonDriver,x as FlowDriver,d as GridDriver,v as ModalDriver,c as MultiSelectDriver,m as NotificationDriver,h as SingleSelectDriver,p as TextDriver,g as TextFieldDriver,f as UserAttributeDriver,E as UserAuthMethodDriver};
//# sourceMappingURL=index.esm.js.map
{
"name": "@descope/sdk-component-drivers",
"version": "0.2.0",
"version": "0.2.1",
"author": "Descope Team <info@descope.com>",

@@ -55,3 +55,3 @@ "homepage": "https://github.com/descope/sdk-component-drivers",

"eslint-plugin-jest": "27.9.0",
"eslint-plugin-jest-dom": "5.1.0",
"eslint-plugin-jest-dom": "5.2.0",
"eslint-plugin-jest-formatting": "3.1.0",

@@ -84,3 +84,3 @@ "eslint-plugin-n": "16.6.2",

"tslib": "2.6.2",
"@descope/sdk-helpers": "0.1.19"
"@descope/sdk-helpers": "0.1.20"
},

@@ -87,0 +87,0 @@ "overrides": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc