@descope/web-components-ui 1.109.0 → 1.111.0
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/cjs/index.cjs.js +2086 -1839
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2452 -2204
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1995.js +7 -22
- package/dist/umd/1995.js.LICENSE.txt +0 -6
- package/dist/umd/1995.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +3 -3
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js.map +1 -1
- package/dist/umd/descope-apps-list.js +18 -0
- package/dist/umd/descope-apps-list.js.LICENSE.txt +23 -0
- package/dist/umd/descope-apps-list.js.map +1 -0
- package/dist/umd/descope-avatar.js +17 -1
- package/dist/umd/descope-avatar.js.LICENSE.txt +23 -0
- package/dist/umd/descope-avatar.js.map +1 -1
- package/dist/umd/descope-button.js +4 -4
- package/dist/umd/descope-button.js.map +1 -1
- package/dist/umd/descope-collapsible-container.js +1 -1
- package/dist/umd/descope-collapsible-container.js.map +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js.map +1 -1
- package/dist/umd/descope-enriched-text.js +1 -1
- package/dist/umd/descope-enriched-text.js.map +1 -1
- package/dist/umd/descope-icon.js +1 -1
- package/dist/umd/descope-icon.js.map +1 -1
- package/dist/umd/descope-image.js +1 -1
- package/dist/umd/descope-image.js.map +1 -1
- package/dist/umd/descope-link.js +1 -1
- package/dist/umd/descope-link.js.map +1 -1
- package/dist/umd/descope-list-item.js +2 -0
- package/dist/umd/descope-list-item.js.map +1 -0
- package/dist/umd/descope-list.js +2 -0
- package/dist/umd/descope-list.js.map +1 -0
- package/dist/umd/descope-outbound-apps.js +339 -0
- package/dist/umd/descope-outbound-apps.js.LICENSE.txt +5 -0
- package/dist/umd/descope-outbound-apps.js.map +1 -0
- package/dist/umd/descope-recovery-codes.js +1 -1
- package/dist/umd/descope-recovery-codes.js.map +1 -1
- package/dist/umd/descope-scopes-list-index-js.js +1 -1
- package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
- package/dist/umd/descope-text.js +1 -1
- package/dist/umd/descope-text.js.map +1 -1
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
- package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
- package/dist/umd/descope-timer-button.js +2 -2
- package/dist/umd/descope-timer-button.js.map +1 -1
- package/dist/umd/descope-timer.js +1 -1
- package/dist/umd/descope-timer.js.map +1 -1
- package/dist/umd/descope-upload-file-index-js.js +3 -3
- package/dist/umd/descope-upload-file-index-js.js.map +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +4 -4
- package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +2 -2
- package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
- package/package.json +21 -17
- package/src/components/descope-scopes-list/index.js +2 -1
- package/src/index.cjs.js +0 -3
- package/src/index.js +0 -2
- package/src/theme/components/index.js +5 -3
- package/dist/umd/descope-apps-list-index-js.js +0 -2
- package/dist/umd/descope-apps-list-index-js.js.map +0 -1
- package/dist/umd/descope-list-index-js.js +0 -2
- package/dist/umd/descope-list-index-js.js.map +0 -1
- package/src/components/descope-apps-list/AppsListClass.js +0 -97
- package/src/components/descope-apps-list/index.js +0 -8
- package/src/components/descope-list/ListClass.js +0 -156
- package/src/components/descope-list/ListItemClass.js +0 -58
- package/src/components/descope-list/index.js +0 -7
- package/src/theme/components/appsList.js +0 -36
- package/src/theme/components/list/list.js +0 -56
- package/src/theme/components/list/listItem.js +0 -41
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@descope/web-components-ui",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.111.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/cjs/index.cjs.js",
|
6
6
|
"module": "dist/index.esm.js",
|
@@ -75,22 +75,26 @@
|
|
75
75
|
"libphonenumber-js": "^1.11.12",
|
76
76
|
"lodash.debounce": "4.0.8",
|
77
77
|
"lodash.merge": "4.6.2",
|
78
|
-
"@descope-ui/common": "0.0.
|
79
|
-
"@descope-ui/descope-button": "0.0.
|
80
|
-
"@descope-ui/descope-image": "0.0.
|
81
|
-
"@descope-ui/descope-icon": "0.0.
|
82
|
-
"@descope-ui/descope-text": "0.0.
|
83
|
-
"@descope-ui/descope-avatar": "0.0.
|
84
|
-
"@descope-ui/descope-combo-box": "0.1.
|
85
|
-
"@descope-ui/descope-autocomplete-field": "0.0.
|
86
|
-
"@descope-ui/descope-address-field": "0.0.
|
87
|
-
"@descope-ui/descope-timer": "0.0.
|
88
|
-
"@descope-ui/descope-timer-button": "0.0.
|
89
|
-
"@descope-ui/descope-
|
90
|
-
"@descope-ui/descope-
|
91
|
-
"@descope-ui/descope-
|
92
|
-
"@descope-ui/descope-
|
93
|
-
"@descope-ui/descope-
|
78
|
+
"@descope-ui/common": "0.0.18",
|
79
|
+
"@descope-ui/descope-button": "0.0.18",
|
80
|
+
"@descope-ui/descope-image": "0.0.10",
|
81
|
+
"@descope-ui/descope-icon": "0.0.17",
|
82
|
+
"@descope-ui/descope-text": "0.0.19",
|
83
|
+
"@descope-ui/descope-avatar": "0.0.19",
|
84
|
+
"@descope-ui/descope-combo-box": "0.1.9",
|
85
|
+
"@descope-ui/descope-autocomplete-field": "0.0.22",
|
86
|
+
"@descope-ui/descope-address-field": "0.0.21",
|
87
|
+
"@descope-ui/descope-timer": "0.0.17",
|
88
|
+
"@descope-ui/descope-timer-button": "0.0.19",
|
89
|
+
"@descope-ui/descope-list": "0.0.1",
|
90
|
+
"@descope-ui/descope-list-item": "0.0.1",
|
91
|
+
"@descope-ui/descope-apps-list": "0.0.1",
|
92
|
+
"@descope-ui/descope-outbound-apps": "0.0.1",
|
93
|
+
"@descope-ui/descope-password-strength": "0.0.13",
|
94
|
+
"@descope-ui/descope-collapsible-container": "0.0.18",
|
95
|
+
"@descope-ui/descope-recovery-codes": "0.0.6",
|
96
|
+
"@descope-ui/descope-link": "0.0.3",
|
97
|
+
"@descope-ui/descope-enriched-text": "0.0.3"
|
94
98
|
},
|
95
99
|
"overrides": {
|
96
100
|
"@vaadin/avatar": "24.3.4",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { componentName, ScopesListClass } from './ScopesListClass';
|
2
|
-
import '
|
2
|
+
import '@descope-ui/descope-list';
|
3
3
|
import '../boolean-fields/descope-checkbox';
|
4
|
+
import '../boolean-fields/descope-switch-toggle';
|
4
5
|
|
5
6
|
customElements.define(componentName, ScopesListClass);
|
6
7
|
|
package/src/index.cjs.js
CHANGED
@@ -43,9 +43,6 @@ export { RadioGroupClass } from './components/descope-radio-group/RadioGroupClas
|
|
43
43
|
export { RadioButtonClass } from './components/descope-radio-group/RadioButtonClass';
|
44
44
|
export { DateFieldClass } from './components/descope-date-field/DateFieldClass';
|
45
45
|
export { CalendarClass } from './components/descope-date-field/descope-calendar/CalendarClass';
|
46
|
-
export { ListClass } from './components/descope-list/ListClass';
|
47
|
-
export { ListItemClass } from './components/descope-list/ListItemClass';
|
48
|
-
export { AppsListClass } from './components/descope-apps-list/AppsListClass';
|
49
46
|
export { ScopesListClass } from './components/descope-scopes-list/ScopesListClass';
|
50
47
|
export { ThirdPartyAppLogoClass } from './components/descope-third-party-app-logo/ThirdPartyAppLogoClass';
|
51
48
|
export { SecurityQuestionsSetupClass } from './components/descope-security-questions-setup/SecurityQuestionsSetupClass';
|
package/src/index.js
CHANGED
@@ -34,8 +34,6 @@ export * from './components/mapping-fields/descope-saml-group-mappings';
|
|
34
34
|
export * from './components/descope-policy-validation';
|
35
35
|
export * from './components/descope-code-snippet';
|
36
36
|
export * from './components/descope-radio-group';
|
37
|
-
export * from './components/descope-list';
|
38
|
-
export * from './components/descope-apps-list';
|
39
37
|
export * from './components/descope-scopes-list';
|
40
38
|
export * from './components/descope-third-party-app-logo';
|
41
39
|
export * from './components/descope-security-questions-setup';
|
@@ -43,9 +43,9 @@ import * as radioGroup from './radioGroup/radioGroup';
|
|
43
43
|
import * as radioButton from './radioGroup/radioButton';
|
44
44
|
import * as calendar from './calendar';
|
45
45
|
import * as dateField from './dateField';
|
46
|
-
import * as
|
47
|
-
import * as
|
48
|
-
import * as
|
46
|
+
import * as appsList from '@descope-ui/descope-apps-list/theme';
|
47
|
+
import * as list from '@descope-ui/descope-list/theme';
|
48
|
+
import * as listItem from '@descope-ui/descope-list-item/theme';
|
49
49
|
import * as scopesList from './scopesList';
|
50
50
|
import * as thirdPartyAppLogo from './thirdPartyAppLogo';
|
51
51
|
import * as securityQuestionsSetup from './securityQuestionsSetup';
|
@@ -60,6 +60,7 @@ import * as timerButton from '@descope-ui/descope-timer-button/theme';
|
|
60
60
|
import * as passwordStrength from '@descope-ui/descope-password-strength/theme';
|
61
61
|
import * as collapsibleContainer from '@descope-ui/descope-collapsible-container/theme';
|
62
62
|
import * as recoveryCodes from '@descope-ui/descope-recovery-codes/theme';
|
63
|
+
import * as outboundApps from '@descope-ui/descope-outbound-apps/theme';
|
63
64
|
|
64
65
|
const components = {
|
65
66
|
button,
|
@@ -125,6 +126,7 @@ const components = {
|
|
125
126
|
collapsibleContainer,
|
126
127
|
recoveryCodes,
|
127
128
|
hcaptcha,
|
129
|
+
outboundApps,
|
128
130
|
};
|
129
131
|
|
130
132
|
const theme = Object.keys(components).reduce(
|
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2272,2294,3057,7640],{18708:(t,e,n)=>{n.r(e),n.d(e,{ListClass:()=>h,componentName:()=>p});var o=n(79365),s=n(81365),i=n(9696),r=n(97810),a=n(25964);const l=(0,r.xE)("list-item"),d=(0,i.Zz)((0,o.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),o.VO,o.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,a.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}}),(t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",(t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",(()=>this.removeAttribute("active")),{once:!0})}))}}))((0,s.q)({componentName:l,baseSelector:"slot"})),p=(0,r.xE)("list");class c extends((0,s.q)({componentName:p,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,a.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==d.componentName&&(e=t.querySelector(d.componentName));const n="tiles"===this.variant?"tile":"row";e.setAttribute("variant",n)}))}init(){super.init?.(),(0,r.Ge)(this,(()=>{this.#t(),this.#e(),this.#n()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#n(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#e():"readonly"===t&&this.#n())}}const h=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),o.VO,o.tQ)(c);customElements.define(p,h),customElements.define(l,d)},45503:(t,e,n)=>{n.r(e),n.d(e,{AppsListClass:()=>d,componentName:()=>l}),n(18708),n(53557),n(63595);var o=n(9696),s=n(97810),i=n(79365),r=n(72203),a=n(66434);const l=(0,s.xE)("apps-list"),d=(0,o.Zz)((0,i.RF)({mappings:{maxHeight:{selector:()=>":host"},minHeight:{selector:()=>":host"},hostDirection:{selector:()=>":host",property:"direction"},itemsFontWeight:{selector:a.s.componentName,property:a.s.cssVarList.fontWeight},itemsFontSize:{selector:a.s.componentName,property:a.s.cssVarList.fontSize},itemsTextAlign:{selector:a.s.componentName,property:a.s.cssVarList.textAlign}}}),(0,r.t)({itemRenderer:({name:t,icon:e,url:n},o,s)=>`\n <a ${n?`href="${n}" title="${n}"`:""} target="_blank">\n <descope-list-item>\n <descope-avatar\n ${e?`img="${e}"`:""}\n ${t?`display-name="${t}" abbr=${((t,e=2)=>t.trim().split(" ").splice(0,e).map((t=>t[0]?.toUpperCase())).join(""))(t)}`:""}\n size=${s.size}\n ></descope-avatar>\n <descope-text\n variant="body1"\n mode="primary"\n >${t}</descope-text>\n </descope-list-item>\n </a>\n`,rerenderAttrsList:["size"]}),i.VO,i.tQ,(t=>class extends t{get size(){return this.getAttribute("size")||"sm"}}))((0,i.tz)({slots:["empty-state"],wrappedEleName:"descope-list",excludeAttrsSync:["tabindex","class","empty"],componentName:l,style:()=>`\n :host {\n width: 100%;\n display: inline-flex;\n }\n\n descope-text::part(text-wrapper) {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n a {\n text-decoration: none;\n }\n\n descope-text {\n ${a.s.cssVarList.hostDirection}: var(${d.cssVarList.hostDirection});\n }\n `}));customElements.define(l,d)},53557:(t,e,n)=>{n.r(e),n.d(e,{AvatarClass:()=>h,componentName:()=>a});var o=n(88961),s=n(72270),i=n(63200),r=n(25964);const a=(0,r.xE)("avatar");class l extends((0,s.qu)({componentName:a,baseSelector:":host > .wrapper"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <vaadin-avatar></vaadin-avatar>\n <div class="editableBadge">\n <vaadin-icon icon="vaadin:pencil"></vaadin-icon>\n </div>\n </div>\n\t\t',(0,r.fz)("\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n ",this),this.avatarComponent=this.shadowRoot.querySelector("vaadin-avatar"),(0,r.EA)(this,this.avatarComponent,{includeAttrs:["display-name","img","abbr"],mapAttrs:{"display-name":"name"}});const t=this.shadowRoot.querySelector(".editableBadge");(0,r.mx)(this,(()=>{t.style.display=this.isEditable?"":"none"}),{includeAttrs:["editable"]})}get isEditable(){return"true"===this.getAttribute("editable")}}const{host:d,editableBadge:p,avatar:c}={host:{selector:()=>":host"},editableBadge:{selector:"> .editableBadge"},avatar:{selector:"vaadin-avatar"}},h=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:[{...d,property:"width"},{...d,property:"min-width"}],hostHeight:{...d,property:"height"},cursor:[c,d],hostDirection:{...d,property:"direction"},avatarTextColor:{...c,property:"color"},avatarBackgroundColor:{...c,property:"background-color"},editableIconColor:{...p,property:"color"},editableBorderColor:{...p,property:"border-color"},editableBackgroundColor:{...p,property:"background-color"}}}),o.VO,o.tQ)(l);n(4408),n(95260),n(37182),customElements.define(a,h)},63595:(t,e,n)=>{n.r(e),n.d(e,{TextClass:()=>o.s,componentName:()=>o.T});var o=n(66434);customElements.define(o.T,o.s)},66434:(t,e,n)=>{n.d(e,{T:()=>a,s:()=>p});var o=n(88961),s=n(63200),i=n(25964),r=n(72270);const a=(0,i.xE)("text");class l extends((0,r.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:d}={host:{selector:()=>":host"}},p=(0,s.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(l)},72203:(t,e,n)=>{n.d(e,{t:()=>r});var o=n(97810);const s=()=>!0,i=t=>`<pre>${JSON.stringify(t,null,4)}</pre>`,r=({itemRenderer:t=i,validateSchema:e=s,slotName:n,rerenderAttrsList:r=[]})=>s=>class extends s{#o=[];#s(t){if(!e)return!0;const n=e(t);return!0===n||(console.error("Data schema validation failed",n||""),!1)}#i(){const t=n?`*[slot="${n}"]`:":not([slot])";this.baseElement.querySelectorAll(t).forEach((t=>t.remove()))}#r(){this.#i(),this.data.forEach(((e,n)=>{const o="string"==typeof(s=t(e,n,this))?(t=>{const e=document.createElement("template");return e.innerHTML=t,e})(s).content:s instanceof HTMLTemplateElement?s.content:(console.error("Invalid template",s),null);var s;this.baseElement.appendChild(o?.cloneNode(!0))}))}set data(t){this.#s(t)&&(this.#o=t,this.#r())}get data(){return this.#o}init(){super.init?.(),(0,o.mx)(this,(t=>{t.includes("data")?this.#a():this.#r()}),{includeAttrs:[...r,"data"]})}#a(){const t=this.getAttribute("data");if(t)try{this.data=JSON.parse(t)}catch(e){console.warn("Invalid JSON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,WACArC,oBAAoB,MAErBjF,GACC,cAAoCA,EAClC,GAAQ,GAGR,GAAgBuH,GACd,IAAKF,EAAgB,OAAO,EAE5B,MAAMG,EAAaH,EAAeE,GAClC,OAAmB,IAAfC,IAGJC,QAAQC,MAAM,gCAAiCF,GAAc,KAEtD,EACT,CAEA,KACE,MAAM5H,EAAW0H,EAAW,WAAWA,MAAe,eACtDnH,KAAKK,YAAYmH,iBAAiB/H,GAAU+B,SAASC,GAASA,EAAKgG,UACrE,CAEA,KACEzH,MAAK,IACLA,KAAKoH,KAAK5F,SAAQ,CAACC,EAAMiG,KACvB,MAAMC,EA7CkB,iBADNC,EA8CiB9D,EAAarC,EAAMiG,EAAO1H,OArDhD,CAAC6H,IACtB,MAAMC,EAAWC,SAASC,cAAc,YAGxC,OAFAF,EAAS3H,UAAY0H,EAEdC,CAAQ,EAKNG,CAAeL,GAAkBD,QAGtCC,aAA4BM,oBACvBN,EAAiBD,SAI1BL,QAAQC,MAAM,mBAAoBK,GAC3B,MAXkB,IAACA,EA+ClB5H,KAAKK,YAAY8H,YAAYR,GAASS,WAAU,GAAM,GAE1D,CAEA,QAAIhB,CAAKiB,GACHrI,MAAK,EAAgBqI,KACvBrI,MAAK,EAAQqI,EACbrI,MAAK,IAET,CAEA,QAAIoH,GACF,OAAOpH,MAAK,CACd,CAEA,IAAAI,GACEL,MAAMK,UAEN,QACEJ,MACCsI,IACKA,EAAMC,SAAS,QAASvI,MAAK,IAC5BA,MAAK,GAAc,GAE1B,CAAEqF,aAAc,IAAIP,EAAmB,SAE3C,CAEA,KACE,MAAM0D,EAAWxI,KAAKuB,aAAa,QAEnC,GAAKiH,EAEL,IACExI,KAAKoH,KAAOJ,KAAKyB,MAAMD,EACzB,CAAE,MAAOjI,GAEP+G,QAAQoB,KAAK,oBAAqBF,EACpC,CACF,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-list/ListItemClass.js","webpack://@descope/web-components-ui/./src/mixins/activableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-list/ListClass.js","webpack://@descope/web-components-ui/./src/components/descope-list/index.js","webpack://@descope/web-components-ui/./src/components/descope-apps-list/AppsListClass.js","webpack://@descope/web-components-ui/./src/components/descope-apps-list/index.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/AvatarClass.js","webpack://@descope/web-components-ui/../components/descope-avatar/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/./src/mixins/createDynamicDataMixin.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { activeableMixin } from '../../mixins/activableMixin';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n padding: {},\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n","export const activeableMixin = (superclass) =>\n class ActiveableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mousedown', (e) => {\n e.preventDefault();\n this.setAttribute('active', 'true');\n window.addEventListener('mouseup', () => this.removeAttribute('active'), {\n once: true,\n });\n });\n }\n };\n","import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { ListItemClass } from './ListItemClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({ componentName, baseSelector: '.wrapper' }) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'max-width' },\n minItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'min-width' },\n itemsHorizontalAlign: { selector: () => '::slotted(*)', property: 'justify-self' },\n emptyStateTextColor: { selector: () => 'slot[name=\"empty-state\"]', property: 'color' },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawList);\n","import { componentName as listComponentName, ListClass } from './ListClass';\nimport { componentName as listItemComponentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(listComponentName, ListClass);\ncustomElements.define(listItemComponentName, ListItemClass);\n\nexport { ListClass, listComponentName as componentName };\n","import { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n} from '../../mixins';\nimport { createDynamicDataMixin } from '../../mixins/createDynamicDataMixin';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('apps-list');\n\nconst limitAbbreviation = (str, limit = 2) =>\n str\n .trim()\n .split(' ')\n .splice(0, limit)\n .map((s) => s[0]?.toUpperCase())\n .join('');\n\nconst itemRenderer = ({ name, icon, url }, _, ref) => `\n <a ${url ? `href=\"${url}\" title=\"${url}\"` : ''} target=\"_blank\">\n <descope-list-item>\n <descope-avatar\n ${icon ? `img=\"${icon}\"` : ''}\n ${name ? `display-name=\"${name}\" abbr=${limitAbbreviation(name)}` : ''}\n size=${ref.size}\n ></descope-avatar>\n <descope-text\n variant=\"body1\"\n mode=\"primary\"\n >${name}</descope-text>\n </descope-list-item>\n </a>\n`;\n\nconst customMixin = (superclass) =>\n class AppsListMixinClass extends superclass {\n get size() {\n return this.getAttribute('size') || 'sm';\n }\n };\n\nexport const AppsListClass = compose(\n createStyleMixin({\n mappings: {\n maxHeight: { selector: () => ':host' },\n minHeight: { selector: () => ':host' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n itemsFontWeight: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.fontWeight,\n },\n itemsFontSize: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.fontSize,\n },\n itemsTextAlign: {\n selector: TextClass.componentName,\n property: TextClass.cssVarList.textAlign,\n },\n },\n }),\n createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size'] }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['empty-state'],\n wrappedEleName: 'descope-list',\n excludeAttrsSync: ['tabindex', 'class', 'empty'],\n componentName,\n style: () => `\n :host {\n width: 100%;\n display: inline-flex;\n }\n\n descope-text::part(text-wrapper) {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n a {\n text-decoration: none;\n }\n\n descope-text {\n ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});\n }\n `,\n })\n);\n","import '../descope-list';\nimport '@descope-ui/descope-avatar';\nimport '@descope-ui/descope-text';\nimport { componentName, AppsListClass } from './AppsListClass';\n\ncustomElements.define(componentName, AppsListClass);\n\nexport { AppsListClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('avatar');\nclass RawAvatar extends createBaseClass({\n componentName,\n baseSelector: ':host > .wrapper',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <vaadin-avatar></vaadin-avatar>\n <div class=\"editableBadge\">\n <vaadin-icon icon=\"vaadin:pencil\"></vaadin-icon>\n </div>\n </div>\n\t\t`;\n\n injectStyle(`\n :host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\n .editableBadge {\n border: 1px solid;\n border-radius: 100%;\n height: fit-content;\n width: 25%;\n height: 25%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5%;\n box-sizing: border-box;\n position: absolute;\n bottom: 0;\n inset-inline-end: 0;\n }\n\n vaadin-icon {\n color: currentcolor;\n }\n\n vaadin-avatar {\n width: 100%;\n height: 100%;\n margin: 0;\n border: none\n }\n\n .wrapper {\n display: inline-flex;\n position: relative;\n width: 100%;\n height: 100%;\n }\n `, this);\n\n this.avatarComponent = this.shadowRoot.querySelector('vaadin-avatar');\n\n forwardAttrs(this, this.avatarComponent, {\n includeAttrs: ['display-name', 'img', 'abbr'],\n mapAttrs: { 'display-name': 'name' },\n });\n\n const editableIcon = this.shadowRoot.querySelector('.editableBadge');\n\n observeAttributes(\n this,\n () => {\n editableIcon.style.display = this.isEditable ? '' : 'none';\n },\n { includeAttrs: ['editable'] },\n );\n }\n\n get isEditable() {\n return this.getAttribute('editable') === 'true';\n }\n}\n\nconst { host, editableBadge, avatar } = {\n host: { selector: () => ':host' },\n editableBadge: { selector: '> .editableBadge' },\n avatar: { selector: 'vaadin-avatar' },\n};\n\nexport const AvatarClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: [\n { ...host, property: 'width' },\n { ...host, property: 'min-width' },\n ],\n hostHeight: { ...host, property: 'height' },\n cursor: [avatar, host],\n hostDirection: { ...host, property: 'direction' },\n avatarTextColor: { ...avatar, property: 'color' },\n avatarBackgroundColor: { ...avatar, property: 'background-color' },\n editableIconColor: { ...editableBadge, property: 'color' },\n editableBorderColor: { ...editableBadge, property: 'border-color' },\n editableBackgroundColor: {\n ...editableBadge,\n property: 'background-color',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawAvatar);\n","import { componentName, AvatarClass } from './AvatarClass';\nimport '@vaadin/avatar';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\ncustomElements.define(componentName, AvatarClass);\n\nexport { AvatarClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { observeAttributes } from '../helpers/componentHelpers';\n\nconst defaultValidateSchema = () => true;\nconst defaultItemRenderer = (item) => `<pre>${JSON.stringify(item, null, 4)}</pre>`;\n\nconst createTemplate = (templateString) => {\n const template = document.createElement('template');\n template.innerHTML = templateString;\n\n return template;\n};\n\nconst getTemplateContent = (templateOrString) => {\n if (typeof templateOrString === 'string') {\n return createTemplate(templateOrString).content;\n }\n\n if (templateOrString instanceof HTMLTemplateElement) {\n return templateOrString.content;\n }\n\n // eslint-disable-next-line no-console\n console.error('Invalid template', templateOrString);\n return null;\n};\n\nexport const createDynamicDataMixin =\n ({\n itemRenderer = defaultItemRenderer,\n validateSchema = defaultValidateSchema,\n slotName,\n rerenderAttrsList = [],\n }) =>\n (superclass) =>\n class DynamicDataMixinClass extends superclass {\n #data = [];\n\n // eslint-disable-next-line class-methods-use-this\n #validateSchema(data) {\n if (!validateSchema) return true;\n\n const validation = validateSchema(data);\n if (validation === true) return true;\n\n // eslint-disable-next-line no-console\n console.error('Data schema validation failed', validation || '');\n\n return false;\n }\n\n #removeOldItems() {\n const selector = slotName ? `*[slot=\"${slotName}\"]` : ':not([slot])';\n this.baseElement.querySelectorAll(selector).forEach((item) => item.remove());\n }\n\n #renderItems() {\n this.#removeOldItems();\n this.data.forEach((item, index) => {\n const content = getTemplateContent(itemRenderer(item, index, this));\n this.baseElement.appendChild(content?.cloneNode(true));\n });\n }\n\n set data(value) {\n if (this.#validateSchema(value)) {\n this.#data = value;\n this.#renderItems();\n }\n }\n\n get data() {\n return this.#data;\n }\n\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) => {\n if (attrs.includes('data')) this.#handleDataAttr();\n else this.#renderItems();\n },\n { includeAttrs: [...rerenderAttrsList, 'data'] }\n );\n }\n\n #handleDataAttr() {\n const dataAttr = this.getAttribute('data');\n\n if (!dataAttr) return;\n\n try {\n this.data = JSON.parse(dataAttr);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Invalid JSON data', dataAttr);\n }\n }\n };\n"],"names":["componentName","ListItemClass","mappings","padding","backgroundColor","borderColor","borderStyle","borderWidth","borderRadius","outline","cursor","gap","maxWidth","selector","alignItems","flexDirection","transition","superclass","constructor","super","this","attachShadow","mode","innerHTML","init","baseElement","addEventListener","e","preventDefault","setAttribute","window","removeAttribute","once","createBaseClass","baseSelector","RawList","observedAttributes","items","shadowRoot","querySelector","assignedElements","length","variant","getAttribute","forEach","item","listItem","localName","listItemVariant","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","hostWidth","property","maxHeight","minHeight","verticalPadding","horizontalPadding","hostDirection","fontFamily","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","customElements","define","AppsListClass","itemsFontWeight","TextClass","cssVarList","fontWeight","itemsFontSize","fontSize","itemsTextAlign","textAlign","createDynamicDataMixin","itemRenderer","icon","url","_","ref","str","limit","trim","split","splice","map","s","toUpperCase","join","limitAbbreviation","size","rerenderAttrsList","slots","wrappedEleName","excludeAttrsSync","style","RawAvatar","avatarComponent","includeAttrs","mapAttrs","editableIcon","display","isEditable","host","editableBadge","avatar","AvatarClass","hostHeight","avatarTextColor","avatarBackgroundColor","editableIconColor","editableBorderColor","editableBackgroundColor","RawText","hideWhenEmpty","hasChildren","childNodes","textColor","textLineHeight","textLetterSpacing","textShadow","textTransform","fontStyle","defaultValidateSchema","defaultItemRenderer","JSON","stringify","validateSchema","slotName","data","validation","console","error","querySelectorAll","remove","index","content","templateOrString","templateString","template","document","createElement","createTemplate","HTMLTemplateElement","appendChild","cloneNode","value","attrs","includes","dataAttr","parse","warn"],"sourceRoot":""}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7640],{18708:(t,e,n)=>{n.r(e),n.d(e,{ListClass:()=>m,componentName:()=>p});var o=n(79365),s=n(81365),i=n(9696),r=n(97810),a=n(25964);const l=(0,r.xE)("list-item"),d=(0,i.Zz)((0,o.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),o.VO,o.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,a.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}}),(t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",(t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",(()=>this.removeAttribute("active")),{once:!0})}))}}))((0,s.q)({componentName:l,baseSelector:"slot"})),p=(0,r.xE)("list");class h extends((0,s.q)({componentName:p,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,a.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==d.componentName&&(e=t.querySelector(d.componentName));const n="tiles"===this.variant?"tile":"row";e.setAttribute("variant",n)}))}init(){super.init?.(),(0,r.Ge)(this,(()=>{this.#t(),this.#e(),this.#n()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#n(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#e():"readonly"===t&&this.#n())}}const m=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),o.VO,o.tQ)(h);customElements.define(p,m),customElements.define(l,d)}}]);
|
2
|
-
//# sourceMappingURL=descope-list-index-js.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"descope-list-index-js.js","mappings":"uPA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BAAqB,CAAEvD,SAAU,IAAM,2BAA4B2C,SAAU,SAC7Ea,yBAA0B,CACxBxD,SAAU,IAAM,2BAChB2C,SAAU,kBAIhB,KACA,KA/BuB,CAgCvBrB,GCxJFmC,eAAeC,OAAO,EAAmBjB,GACzCgB,eAAeC,OAAO,EAAuBtE,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-list/ListItemClass.js","webpack://@descope/web-components-ui/./src/mixins/activableMixin.js","webpack://@descope/web-components-ui/./src/components/descope-list/ListClass.js","webpack://@descope/web-components-ui/./src/components/descope-list/index.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport { activeableMixin } from '../../mixins/activableMixin';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n padding: {},\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n","export const activeableMixin = (superclass) =>\n class ActiveableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mousedown', (e) => {\n e.preventDefault();\n this.setAttribute('active', 'true');\n window.addEventListener('mouseup', () => this.removeAttribute('active'), {\n once: true,\n });\n });\n }\n };\n","import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { ListItemClass } from './ListItemClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({ componentName, baseSelector: '.wrapper' }) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'max-width' },\n minItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'min-width' },\n itemsHorizontalAlign: { selector: () => '::slotted(*)', property: 'justify-self' },\n emptyStateTextColor: { selector: () => 'slot[name=\"empty-state\"]', property: 'color' },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawList);\n","import { componentName as listComponentName, ListClass } from './ListClass';\nimport { componentName as listItemComponentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(listComponentName, ListClass);\ncustomElements.define(listItemComponentName, ListItemClass);\n\nexport { ListClass, listComponentName as componentName };\n"],"names":["componentName","ListItemClass","mappings","padding","backgroundColor","borderColor","borderStyle","borderWidth","borderRadius","outline","cursor","gap","maxWidth","selector","alignItems","flexDirection","transition","superclass","constructor","super","this","attachShadow","mode","innerHTML","init","baseElement","addEventListener","e","preventDefault","setAttribute","window","removeAttribute","once","createBaseClass","baseSelector","RawList","observedAttributes","items","shadowRoot","querySelector","assignedElements","length","variant","getAttribute","forEach","item","listItem","localName","listItemVariant","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","hostWidth","property","maxHeight","minHeight","verticalPadding","horizontalPadding","hostDirection","fontFamily","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","customElements","define"],"sourceRoot":""}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
import { compose } from '../../helpers';
|
2
|
-
import { getComponentName } from '../../helpers/componentHelpers';
|
3
|
-
import {
|
4
|
-
createStyleMixin,
|
5
|
-
draggableMixin,
|
6
|
-
createProxy,
|
7
|
-
componentNameValidationMixin,
|
8
|
-
} from '../../mixins';
|
9
|
-
import { createDynamicDataMixin } from '../../mixins/createDynamicDataMixin';
|
10
|
-
import { TextClass } from '@descope-ui/descope-text/class';
|
11
|
-
|
12
|
-
export const componentName = getComponentName('apps-list');
|
13
|
-
|
14
|
-
const limitAbbreviation = (str, limit = 2) =>
|
15
|
-
str
|
16
|
-
.trim()
|
17
|
-
.split(' ')
|
18
|
-
.splice(0, limit)
|
19
|
-
.map((s) => s[0]?.toUpperCase())
|
20
|
-
.join('');
|
21
|
-
|
22
|
-
const itemRenderer = ({ name, icon, url }, _, ref) => `
|
23
|
-
<a ${url ? `href="${url}" title="${url}"` : ''} target="_blank">
|
24
|
-
<descope-list-item>
|
25
|
-
<descope-avatar
|
26
|
-
${icon ? `img="${icon}"` : ''}
|
27
|
-
${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
|
28
|
-
size=${ref.size}
|
29
|
-
></descope-avatar>
|
30
|
-
<descope-text
|
31
|
-
variant="body1"
|
32
|
-
mode="primary"
|
33
|
-
>${name}</descope-text>
|
34
|
-
</descope-list-item>
|
35
|
-
</a>
|
36
|
-
`;
|
37
|
-
|
38
|
-
const customMixin = (superclass) =>
|
39
|
-
class AppsListMixinClass extends superclass {
|
40
|
-
get size() {
|
41
|
-
return this.getAttribute('size') || 'sm';
|
42
|
-
}
|
43
|
-
};
|
44
|
-
|
45
|
-
export const AppsListClass = compose(
|
46
|
-
createStyleMixin({
|
47
|
-
mappings: {
|
48
|
-
maxHeight: { selector: () => ':host' },
|
49
|
-
minHeight: { selector: () => ':host' },
|
50
|
-
hostDirection: { selector: () => ':host', property: 'direction' },
|
51
|
-
itemsFontWeight: {
|
52
|
-
selector: TextClass.componentName,
|
53
|
-
property: TextClass.cssVarList.fontWeight,
|
54
|
-
},
|
55
|
-
itemsFontSize: {
|
56
|
-
selector: TextClass.componentName,
|
57
|
-
property: TextClass.cssVarList.fontSize,
|
58
|
-
},
|
59
|
-
itemsTextAlign: {
|
60
|
-
selector: TextClass.componentName,
|
61
|
-
property: TextClass.cssVarList.textAlign,
|
62
|
-
},
|
63
|
-
},
|
64
|
-
}),
|
65
|
-
createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size'] }),
|
66
|
-
draggableMixin,
|
67
|
-
componentNameValidationMixin,
|
68
|
-
customMixin
|
69
|
-
)(
|
70
|
-
createProxy({
|
71
|
-
slots: ['empty-state'],
|
72
|
-
wrappedEleName: 'descope-list',
|
73
|
-
excludeAttrsSync: ['tabindex', 'class', 'empty'],
|
74
|
-
componentName,
|
75
|
-
style: () => `
|
76
|
-
:host {
|
77
|
-
width: 100%;
|
78
|
-
display: inline-flex;
|
79
|
-
}
|
80
|
-
|
81
|
-
descope-text::part(text-wrapper) {
|
82
|
-
display: -webkit-box;
|
83
|
-
-webkit-line-clamp: 2;
|
84
|
-
-webkit-box-orient: vertical;
|
85
|
-
overflow: hidden;
|
86
|
-
}
|
87
|
-
|
88
|
-
a {
|
89
|
-
text-decoration: none;
|
90
|
-
}
|
91
|
-
|
92
|
-
descope-text {
|
93
|
-
${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
|
94
|
-
}
|
95
|
-
`,
|
96
|
-
})
|
97
|
-
);
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import '../descope-list';
|
2
|
-
import '@descope-ui/descope-avatar';
|
3
|
-
import '@descope-ui/descope-text';
|
4
|
-
import { componentName, AppsListClass } from './AppsListClass';
|
5
|
-
|
6
|
-
customElements.define(componentName, AppsListClass);
|
7
|
-
|
8
|
-
export { AppsListClass, componentName };
|
@@ -1,156 +0,0 @@
|
|
1
|
-
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
2
|
-
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
3
|
-
import { compose } from '../../helpers';
|
4
|
-
import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
|
5
|
-
import { ListItemClass } from './ListItemClass';
|
6
|
-
import { injectStyle } from '@descope-ui/common/components-helpers';
|
7
|
-
|
8
|
-
export const componentName = getComponentName('list');
|
9
|
-
|
10
|
-
class RawList extends createBaseClass({ componentName, baseSelector: '.wrapper' }) {
|
11
|
-
static get observedAttributes() {
|
12
|
-
return ['variant', 'readonly'];
|
13
|
-
}
|
14
|
-
|
15
|
-
constructor() {
|
16
|
-
super();
|
17
|
-
|
18
|
-
this.attachShadow({ mode: 'open' }).innerHTML = `
|
19
|
-
<div class="wrapper">
|
20
|
-
<slot></slot>
|
21
|
-
<slot name="empty-state">
|
22
|
-
No item...
|
23
|
-
</slot>
|
24
|
-
</div>
|
25
|
-
`;
|
26
|
-
|
27
|
-
injectStyle(
|
28
|
-
`
|
29
|
-
.wrapper {
|
30
|
-
overflow: auto;
|
31
|
-
display: grid;
|
32
|
-
max-height: 100%;
|
33
|
-
width: 100%;
|
34
|
-
}
|
35
|
-
|
36
|
-
:host {
|
37
|
-
display: inline-flex;
|
38
|
-
width: 100%;
|
39
|
-
}
|
40
|
-
slot[name="empty-state"] {
|
41
|
-
justify-content: center;
|
42
|
-
align-items: center;
|
43
|
-
display: flex;
|
44
|
-
flex-grow: 1;
|
45
|
-
}
|
46
|
-
|
47
|
-
:host slot[name="empty-state"] {
|
48
|
-
display: none;
|
49
|
-
}
|
50
|
-
:host([empty]) slot[name="empty-state"] {
|
51
|
-
display: flex;
|
52
|
-
}
|
53
|
-
::slotted(:not([slot])) {
|
54
|
-
width: 100%;
|
55
|
-
}
|
56
|
-
`,
|
57
|
-
this
|
58
|
-
);
|
59
|
-
}
|
60
|
-
|
61
|
-
get items() {
|
62
|
-
return this.shadowRoot.querySelector('slot').assignedElements();
|
63
|
-
}
|
64
|
-
|
65
|
-
#handleEmptyState() {
|
66
|
-
if (this.items.length === 0) {
|
67
|
-
this.setAttribute('empty', 'true');
|
68
|
-
} else {
|
69
|
-
this.removeAttribute('empty');
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
get variant() {
|
74
|
-
return this.getAttribute('variant') || 'list';
|
75
|
-
}
|
76
|
-
|
77
|
-
#handleItemsVariant() {
|
78
|
-
this.items.forEach((item) => {
|
79
|
-
let listItem = item;
|
80
|
-
if (listItem.localName !== ListItemClass.componentName) {
|
81
|
-
listItem = item.querySelector(ListItemClass.componentName);
|
82
|
-
}
|
83
|
-
|
84
|
-
const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';
|
85
|
-
listItem.setAttribute('variant', listItemVariant);
|
86
|
-
});
|
87
|
-
}
|
88
|
-
|
89
|
-
init() {
|
90
|
-
super.init?.();
|
91
|
-
|
92
|
-
// we want new items to get the size
|
93
|
-
observeChildren(this, () => {
|
94
|
-
this.#handleEmptyState();
|
95
|
-
this.#handleItemsVariant();
|
96
|
-
this.#handleReadOnly();
|
97
|
-
});
|
98
|
-
}
|
99
|
-
|
100
|
-
get isReadOnly() {
|
101
|
-
return this.getAttribute('readonly') === 'true';
|
102
|
-
}
|
103
|
-
|
104
|
-
#handleReadOnly() {
|
105
|
-
this.items.forEach((item) => {
|
106
|
-
if (this.isReadOnly) item.setAttribute('inert', '');
|
107
|
-
else item.removeAttribute('inert');
|
108
|
-
});
|
109
|
-
}
|
110
|
-
|
111
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
112
|
-
super.attributeChangedCallback?.(name, oldValue, newValue);
|
113
|
-
|
114
|
-
if (newValue === oldValue) return;
|
115
|
-
|
116
|
-
if (name === 'variant') {
|
117
|
-
this.#handleItemsVariant();
|
118
|
-
} else if (name === 'readonly') {
|
119
|
-
this.#handleReadOnly();
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
123
|
-
|
124
|
-
export const ListClass = compose(
|
125
|
-
createStyleMixin({
|
126
|
-
mappings: {
|
127
|
-
hostWidth: { selector: () => ':host', property: 'width' },
|
128
|
-
maxHeight: { selector: () => ':host' },
|
129
|
-
minHeight: {},
|
130
|
-
verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],
|
131
|
-
horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],
|
132
|
-
hostDirection: { selector: () => ':host', property: 'direction' },
|
133
|
-
fontFamily: {},
|
134
|
-
gap: {},
|
135
|
-
|
136
|
-
backgroundColor: {},
|
137
|
-
borderRadius: {},
|
138
|
-
borderColor: {},
|
139
|
-
borderStyle: {},
|
140
|
-
borderWidth: {},
|
141
|
-
|
142
|
-
boxShadow: {},
|
143
|
-
gridTemplateColumns: {},
|
144
|
-
maxItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'max-width' },
|
145
|
-
minItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'min-width' },
|
146
|
-
itemsHorizontalAlign: { selector: () => '::slotted(*)', property: 'justify-self' },
|
147
|
-
emptyStateTextColor: { selector: () => 'slot[name="empty-state"]', property: 'color' },
|
148
|
-
emptyStateTextFontFamily: {
|
149
|
-
selector: () => 'slot[name="empty-state"]',
|
150
|
-
property: 'font-family',
|
151
|
-
},
|
152
|
-
},
|
153
|
-
}),
|
154
|
-
draggableMixin,
|
155
|
-
componentNameValidationMixin
|
156
|
-
)(RawList);
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
2
|
-
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
3
|
-
import { compose } from '../../helpers';
|
4
|
-
import { getComponentName } from '../../helpers/componentHelpers';
|
5
|
-
import { activeableMixin } from '../../mixins/activableMixin';
|
6
|
-
import { injectStyle } from '@descope-ui/common/components-helpers';
|
7
|
-
|
8
|
-
export const componentName = getComponentName('list-item');
|
9
|
-
|
10
|
-
const customMixin = (superclass) =>
|
11
|
-
class ListItemMixinClass extends superclass {
|
12
|
-
constructor() {
|
13
|
-
super();
|
14
|
-
|
15
|
-
this.attachShadow({ mode: 'open' }).innerHTML = `
|
16
|
-
<slot></slot>
|
17
|
-
`;
|
18
|
-
|
19
|
-
injectStyle(
|
20
|
-
`
|
21
|
-
slot {
|
22
|
-
width: 100%;
|
23
|
-
display: flex;
|
24
|
-
overflow: hidden;
|
25
|
-
box-sizing: border-box;
|
26
|
-
}
|
27
|
-
:host {
|
28
|
-
display: block;
|
29
|
-
}
|
30
|
-
`,
|
31
|
-
this
|
32
|
-
);
|
33
|
-
}
|
34
|
-
};
|
35
|
-
|
36
|
-
export const ListItemClass = compose(
|
37
|
-
createStyleMixin({
|
38
|
-
mappings: {
|
39
|
-
padding: {},
|
40
|
-
backgroundColor: {},
|
41
|
-
borderColor: {},
|
42
|
-
borderStyle: {},
|
43
|
-
borderWidth: {},
|
44
|
-
borderRadius: {},
|
45
|
-
outline: {},
|
46
|
-
cursor: {},
|
47
|
-
gap: {},
|
48
|
-
maxWidth: { selector: () => ':host' },
|
49
|
-
alignItems: {},
|
50
|
-
flexDirection: {},
|
51
|
-
transition: {},
|
52
|
-
},
|
53
|
-
}),
|
54
|
-
draggableMixin,
|
55
|
-
componentNameValidationMixin,
|
56
|
-
customMixin,
|
57
|
-
activeableMixin
|
58
|
-
)(createBaseClass({ componentName, baseSelector: 'slot' }));
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { componentName as listComponentName, ListClass } from './ListClass';
|
2
|
-
import { componentName as listItemComponentName, ListItemClass } from './ListItemClass';
|
3
|
-
|
4
|
-
customElements.define(listComponentName, ListClass);
|
5
|
-
customElements.define(listItemComponentName, ListItemClass);
|
6
|
-
|
7
|
-
export { ListClass, listComponentName as componentName };
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { AppsListClass } from '../../components/descope-apps-list/AppsListClass';
|
2
|
-
import { getThemeRefs } from '../../helpers/themeHelpers';
|
3
|
-
import globals from '../globals';
|
4
|
-
|
5
|
-
export const vars = AppsListClass.cssVarList;
|
6
|
-
const globalRefs = getThemeRefs(globals);
|
7
|
-
|
8
|
-
const defaultHeight = '400px';
|
9
|
-
|
10
|
-
const appsList = {
|
11
|
-
[vars.itemsFontWeight]: 'normal',
|
12
|
-
[vars.itemsTextAlign]: 'start',
|
13
|
-
[vars.hostDirection]: globalRefs.direction,
|
14
|
-
[vars.maxHeight]: defaultHeight,
|
15
|
-
|
16
|
-
_empty: {
|
17
|
-
[vars.minHeight]: defaultHeight,
|
18
|
-
},
|
19
|
-
|
20
|
-
size: {
|
21
|
-
xs: {
|
22
|
-
[vars.itemsFontSize]: '14px',
|
23
|
-
},
|
24
|
-
sm: {
|
25
|
-
[vars.itemsFontSize]: '14px',
|
26
|
-
},
|
27
|
-
md: {
|
28
|
-
[vars.itemsFontSize]: '16px',
|
29
|
-
},
|
30
|
-
lg: {
|
31
|
-
[vars.itemsFontSize]: '20px',
|
32
|
-
},
|
33
|
-
},
|
34
|
-
};
|
35
|
-
|
36
|
-
export default appsList;
|