@descope/web-components-ui 1.0.71 → 1.0.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.esm.js +120 -69
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/descope-image-index-js.js +1 -0
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-image/Image.js +53 -0
- package/src/components/descope-image/index.js +5 -0
- package/src/index.js +1 -0
- package/src/theme/components/container.js +1 -1
- package/src/theme/components/image.js +7 -0
- package/src/theme/components/index.js +3 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[772],{8116:(t,e,s)=>{s.r(e),s.d(e,{Image:()=>r});var n=s(4877),c=s(3346),o=s(2061),i=s(4567);const a=["src","alt"],h=(0,i.iY)("image"),l=(0,c.s)({componentName:h,baseSelector:":host > img"}),r=(0,o.qC)((0,n.yk)({mappings:{height:{selector:()=>":host"},width:{selector:()=>":host"}}}),n.e4)(class extends l{static get observedAttributes(){return a.concat(l.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > img {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t</style>\n\t\t<img/>\n\t"}connectedCallback(){super.connectedCallback?.(),(0,i.oP)(this,this.baseElement,{includeAttrs:a})}});customElements.define(h,r)}}]);
|
package/dist/umd/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DescopeUI=t():e.DescopeUI=t()}(self,(()=>(()=>{var e,t,o,r={534:(e,t,o)=>{var r={"./descope-button/index.js":[3029,840,767,211,513,729,809,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,809,761],"./descope-combo-box/index.js":[9258,840,786,208,233,824,314,809,483],"./descope-container/index.js":[147,809,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,211,824,513,541,809,17],"./descope-divider/index.js":[6446,809,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,725,437,809,447,760],"./descope-link/index.js":[8029,809,528,58],"./descope-loader-linear/index.js":[9929,809,453],"./descope-loader-radial/index.js":[7603,809,72],"./descope-logo/index.js":[4641,809,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,809,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,809,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,725,789,809,447,841,934,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,767,725,211,56,809,447,320],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,809,739],"./descope-text-area/index.js":[178,840,786,233,422,101,809,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,725,789,809,447,934],"./descope-text/index.js":[1876,809,528]};function s(e){if(!o.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],s=t[0];return Promise.all(t.slice(1).map(o.e)).then((()=>o(s)))}s.keys=()=>Object.keys(r),s.id=534,e.exports=s},5561:(e,t,o)=>{"use strict";o.r(t),o.d(t,{componentsThemeManager:()=>r});const r=new class{static mountOnPropName="DescopeThemeManager";#e={};#t="light";#o=new Set;#r(){this.#o.forEach((e=>e?.()))}get currentThemeName(){return this.#t}set currentThemeName(e){this.#t=e,this.#r()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#o.add(e),()=>{this.#o.delete(e)}}set themes(e){this.#e=e,this.#r()}}},7507:(e,t,o)=>{const{componentsThemeManager:r}=o(5561),s=o(534);e.exports=s.keys().reduce(((e,t)=>(e[t.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>s(t),e)),{}),e.exports.componentsThemeManager=r}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var i=1/0;for(p=0;p<e.length;p++){for(var[o,r,s]=e[p],d=!0,c=0;c<o.length;c++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(d=!1,s<i&&(i=s));if(d){e.splice(p--,1);var a=r();void 0!==a&&(t=a)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,r,s]},n.F={},n.E=e=>{Object.keys(n.F).map((t=>{n.F[t](e)}))},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,o)=>(n.f[o](e,t),t)),[])),n.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},o="DescopeUI:",n.l=(e,r,s,i)=>{if(t[e])t[e].push(r);else{var d,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+s){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",o+s),d.src=e),t[e]=[r];var u=(o,r)=>{d.onerror=d.onload=null,clearTimeout(m);var s=t[e];if(delete t[e],d.parentNode&&d.parentNode.removeChild(d),s&&s.forEach((e=>e(r))),o)return o(r)},m=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");o.length&&(e=o[o.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,o)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var s=new Promise(((o,s)=>r=e[t]=[o,s]));o.push(r[2]=s);var i=n.p+n.u(t),d=new Error;n.l(i,(o=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;d.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",d.name="ChunkLoadError",d.type=s,d.request=i,r[1](d)}}),"chunk-"+t,t)}},n.F.j=t=>{if(!n.o(e,t)||void 0===e[t]){e[t]=null;var o=document.createElement("link");n.nc&&o.setAttribute("nonce",n.nc),o.rel="prefetch",o.as="script",o.href=n.p+n.u(t),document.head.appendChild(o)}},n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[i,d,c]=o,a=0;if(i.some((t=>0!==e[t]))){for(r in d)n.o(d,r)&&(n.m[r]=d[r]);if(c)var p=c(n)}for(t&&t(o);a<i.length;a++)s=i[a],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),n.O(0,[826],(()=>{[840,767,211,513,729,809,662,786,208,515,761,233,824,314,483,317,541,17,528,178,422,725,437,447,760,58,453,72,984,806,142,841,789,934,939,56,320,739,101,322].map(n.E)}),5);var i=n(7507);return n.O(i)})()));
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DescopeUI=t():e.DescopeUI=t()}(self,(()=>(()=>{var e,t,o,r={534:(e,t,o)=>{var r={"./descope-button/index.js":[3029,840,767,211,513,729,809,662],"./descope-checkbox/index.js":[7904,840,786,208,767,515,809,761],"./descope-combo-box/index.js":[9258,840,786,208,233,824,314,809,483],"./descope-container/index.js":[147,809,317],"./descope-date-picker/index.js":[2552,840,786,208,233,767,211,824,513,541,809,17],"./descope-divider/index.js":[6446,809,528,178],"./descope-email-field/index.js":[689,840,786,208,233,422,725,437,809,447,760],"./descope-image/index.js":[8116,809,772],"./descope-link/index.js":[8029,809,528,58],"./descope-loader-linear/index.js":[9929,809,453],"./descope-loader-radial/index.js":[7603,809,72],"./descope-logo/index.js":[4641,809,984],"./descope-number-field/index.js":[4951,840,786,208,233,422,806,809,447,142],"./descope-passcode/descope-passcode-internal/index.js":[4775,809,841],"./descope-passcode/index.js":[7102,840,786,208,233,422,725,789,809,447,841,934,939],"./descope-password-field/index.js":[1721,840,786,208,233,422,767,725,211,56,809,447,320],"./descope-switch-toggle/index.js":[3774,840,786,208,767,515,809,739],"./descope-text-area/index.js":[178,840,786,233,422,101,809,322],"./descope-text-field/index.js":[9357,840,786,208,233,422,725,789,809,447,934],"./descope-text/index.js":[1876,809,528]};function s(e){if(!o.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],s=t[0];return Promise.all(t.slice(1).map(o.e)).then((()=>o(s)))}s.keys=()=>Object.keys(r),s.id=534,e.exports=s},5561:(e,t,o)=>{"use strict";o.r(t),o.d(t,{componentsThemeManager:()=>r});const r=new class{static mountOnPropName="DescopeThemeManager";#e={};#t="light";#o=new Set;#r(){this.#o.forEach((e=>e?.()))}get currentThemeName(){return this.#t}set currentThemeName(e){this.#t=e,this.#r()}get currentTheme(){return this.#e[this.currentThemeName]}onCurrentThemeChange(e){return this.#o.add(e),()=>{this.#o.delete(e)}}set themes(e){this.#e=e,this.#r()}}},7507:(e,t,o)=>{const{componentsThemeManager:r}=o(5561),s=o(534);e.exports=s.keys().reduce(((e,t)=>(e[t.replace(/.*?([^\/]+)\/index\.js$/,"$1")]=()=>s(t),e)),{}),e.exports.componentsThemeManager=r}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var i=1/0;for(p=0;p<e.length;p++){for(var[o,r,s]=e[p],d=!0,c=0;c<o.length;c++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(d=!1,s<i&&(i=s));if(d){e.splice(p--,1);var a=r();void 0!==a&&(t=a)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,r,s]},n.F={},n.E=e=>{Object.keys(n.F).map((t=>{n.F[t](e)}))},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,o)=>(n.f[o](e,t),t)),[])),n.u=e=>(({17:"descope-date-picker-index-js",58:"descope-link-index-js",72:"descope-loader-radial-index-js",142:"descope-number-field-index-js",178:"descope-divider-index-js",317:"descope-container-index-js",320:"descope-password-field-index-js",322:"descope-text-area-index-js",453:"descope-loader-linear-index-js",483:"descope-combo-box-index-js",528:"descope-text-index-js",662:"descope-button-index-js",739:"descope-switch-toggle-index-js",760:"descope-email-field-index-js",761:"descope-checkbox-index-js",772:"descope-image-index-js",841:"descope-passcode-descope-passcode-internal-index-js",934:"descope-text-field-index-js",939:"descope-passcode-index-js",984:"descope-logo-index-js"}[e]||e)+".js"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},o="DescopeUI:",n.l=(e,r,s,i)=>{if(t[e])t[e].push(r);else{var d,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),p=0;p<a.length;p++){var l=a[p];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+s){d=l;break}}d||(c=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,n.nc&&d.setAttribute("nonce",n.nc),d.setAttribute("data-webpack",o+s),d.src=e),t[e]=[r];var u=(o,r)=>{d.onerror=d.onload=null,clearTimeout(m);var s=t[e];if(delete t[e],d.parentNode&&d.parentNode.removeChild(d),s&&s.forEach((e=>e(r))),o)return o(r)},m=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),c&&document.head.appendChild(d)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");o.length&&(e=o[o.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={826:0};n.f.j=(t,o)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var s=new Promise(((o,s)=>r=e[t]=[o,s]));o.push(r[2]=s);var i=n.p+n.u(t),d=new Error;n.l(i,(o=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;d.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",d.name="ChunkLoadError",d.type=s,d.request=i,r[1](d)}}),"chunk-"+t,t)}},n.F.j=t=>{if(!n.o(e,t)||void 0===e[t]){e[t]=null;var o=document.createElement("link");n.nc&&o.setAttribute("nonce",n.nc),o.rel="prefetch",o.as="script",o.href=n.p+n.u(t),document.head.appendChild(o)}},n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[i,d,c]=o,a=0;if(i.some((t=>0!==e[t]))){for(r in d)n.o(d,r)&&(n.m[r]=d[r]);if(c)var p=c(n)}for(t&&t(o);a<i.length;a++)s=i[a],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),n.O(0,[826],(()=>{[840,767,211,513,729,809,662,786,208,515,761,233,824,314,483,317,541,17,528,178,422,725,437,447,760,772,58,453,72,984,806,142,841,789,934,939,56,320,739,101,322].map(n.E)}),5);var i=n(7507);return n.O(i)})()));
|
package/package.json
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
import {
|
2
|
+
createStyleMixin,
|
3
|
+
draggableMixin,
|
4
|
+
} from '../../mixins';
|
5
|
+
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
6
|
+
import { compose } from '../../helpers';
|
7
|
+
import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
8
|
+
|
9
|
+
const observedAttributes = ['src', 'alt']
|
10
|
+
|
11
|
+
export const componentName = getComponentName('image');
|
12
|
+
|
13
|
+
const BaseClass = createBaseClass({ componentName, baseSelector: ':host > img' })
|
14
|
+
class RawImage extends BaseClass {
|
15
|
+
static get observedAttributes() {
|
16
|
+
return observedAttributes.concat(BaseClass.observedAttributes || []);
|
17
|
+
}
|
18
|
+
|
19
|
+
constructor() {
|
20
|
+
super();
|
21
|
+
|
22
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
23
|
+
<style>
|
24
|
+
:host > img {
|
25
|
+
width: 100%;
|
26
|
+
height: 100%
|
27
|
+
}
|
28
|
+
:host {
|
29
|
+
display: inline-flex;
|
30
|
+
}
|
31
|
+
</style>
|
32
|
+
<img/>
|
33
|
+
`;
|
34
|
+
}
|
35
|
+
|
36
|
+
connectedCallback(){
|
37
|
+
super.connectedCallback?.();
|
38
|
+
|
39
|
+
forwardAttrs(this, this.baseElement, {includeAttrs: observedAttributes})
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
const Image = compose(
|
44
|
+
createStyleMixin({
|
45
|
+
mappings: {
|
46
|
+
height: { selector: () => ':host' },
|
47
|
+
width: { selector: () => ':host' },
|
48
|
+
}
|
49
|
+
}),
|
50
|
+
draggableMixin,
|
51
|
+
)(RawImage);
|
52
|
+
|
53
|
+
export default Image;
|
package/src/index.js
CHANGED
@@ -23,7 +23,7 @@ const [helperTheme, helperRefs, helperVars] =
|
|
23
23
|
verticalAlignment,
|
24
24
|
horizontalAlignment,
|
25
25
|
shadowColor: '#00000020' //if we want to support transparency vars, we should use different color format
|
26
|
-
},
|
26
|
+
}, Container.componentName)
|
27
27
|
|
28
28
|
const container = {
|
29
29
|
...helperTheme,
|
@@ -14,6 +14,7 @@ import divider from './divider';
|
|
14
14
|
import passcode from './passcode';
|
15
15
|
import { loaderRadial, loaderLinear } from './loader';
|
16
16
|
import comboBox from './comboBox';
|
17
|
+
import image from './image';
|
17
18
|
|
18
19
|
export default {
|
19
20
|
button,
|
@@ -32,5 +33,6 @@ export default {
|
|
32
33
|
passcode,
|
33
34
|
loaderRadial,
|
34
35
|
loaderLinear,
|
35
|
-
comboBox
|
36
|
+
comboBox,
|
37
|
+
image
|
36
38
|
};
|