@rededor/cura 1.5.0-alpha.2 → 1.5.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/app-globals-57c5b283.js +51 -0
- package/dist/cjs/app-globals-57c5b283.js.map +1 -0
- package/dist/cjs/cura-accordion_12.cjs.entry.js +1 -1
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +33 -28
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/{esm/app-globals-e54ee4c3.js → cjs/cura-theme-module-14544f5f.js} +25 -54
- package/dist/cjs/cura-theme-module-14544f5f.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -1
- package/dist/cjs/cura.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-module.js +21 -8
- package/dist/collection/api/modules/cura-theme-module.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +33 -28
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/index.js +5 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button-transparent2.js.map +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +33 -28
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/index.js +26 -9
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/index.esm.js +1 -1
- package/dist/cura/index.esm.js.map +1 -1
- package/dist/cura/{p-82b99090.js → p-1051a947.js} +2 -2
- package/dist/cura/p-1051a947.js.map +1 -0
- package/dist/cura/{p-04006a3e.entry.js → p-57ad7c56.entry.js} +2 -2
- package/dist/cura/{p-04006a3e.entry.js.map → p-57ad7c56.entry.js.map} +1 -1
- package/dist/cura/p-62a3056f.entry.js +2 -0
- package/dist/cura/p-62a3056f.entry.js.map +1 -0
- package/dist/cura/p-d21364b2.js +2 -0
- package/dist/cura/p-d21364b2.js.map +1 -0
- package/dist/cura/{p-0a133399.entry.js → p-dbab7864.entry.js} +2 -2
- package/dist/cura/{p-0a133399.entry.js.map → p-dbab7864.entry.js.map} +1 -1
- package/dist/cura/p-f30270f0.entry.js +2 -0
- package/dist/cura/p-f30270f0.entry.js.map +1 -0
- package/dist/esm/app-globals-036c3b80.js +49 -0
- package/dist/esm/app-globals-036c3b80.js.map +1 -0
- package/dist/esm/cura-accordion_12.entry.js +1 -1
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-outline.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-button-transparent.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search.entry.js +33 -28
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/{cjs/app-globals-f33ceef8.js → esm/cura-theme-module-b23f8ac8.js} +23 -56
- package/dist/esm/cura-theme-module-b23f8ac8.js.map +1 -0
- package/dist/esm/cura.js +2 -1
- package/dist/esm/cura.js.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -1
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/api/modules/cura-theme-module.d.ts +8 -6
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
- package/dist/cjs/app-globals-f33ceef8.js.map +0 -1
- package/dist/cura/p-82b99090.js.map +0 -1
- package/dist/cura/p-9d7c6e96.entry.js +0 -2
- package/dist/cura/p-9d7c6e96.entry.js.map +0 -1
- package/dist/cura/p-ced52230.entry.js +0 -2
- package/dist/cura/p-ced52230.entry.js.map +0 -1
- package/dist/esm/app-globals-e54ee4c3.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as t}from"./p-1051a947.js";class n{constructor(n){this.localAssetsPath=n&&n.localAssetsPath?n.localAssetsPath:`/assets`;const o=new t;this.theme={load:function(t){o.load(t)},setCustom:function(t){o.setCustom(t)},colors:{getColor:function(t,n){return o.colors.getColor(t,n)}},fonts:{getFamily:function(t){return o.fonts.getFamily(t)},getWeights:function(){return o.fonts.getWeights()},getSize:function(){return o.fonts.getSize()},getColor:function(){return o.fonts.getColor()}},spacing:{getSpacing:function(){return o.spacing.getSpacing()}},breakpoints:{get:function(t,n){return o.breakpoints.get(t,n)}}};if(n&&n.customTheme){this.theme.setCustom(n.customTheme)}else{const t=n&&n.theme?n.theme:"default";this.theme.load(t)}}}function o(){const t=window.CuraInit;window.CuraAPI=t?new n(t):new n;const o=window.CuraAPI;window.dispatchEvent(new CustomEvent("CuraAPIReady",{detail:{api:o}}));if(t&&typeof t.onReady==="function")t.onReady(o)}const e=o;export{e as g};
|
|
2
|
+
//# sourceMappingURL=p-d21364b2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CuraAPI","constructor","config","this","localAssetsPath","themeModule","CuraThemeModule","theme","load","themeTag","setCustom","customThemeDefinitions","colors","getColor","colorWithDepth","opacity","fonts","getFamily","type","getWeights","getSize","spacing","getSpacing","breakpoints","get","size","position","customTheme","window","CuraInit","api","dispatchEvent","CustomEvent","detail","onReady","globalScripts","appGlobalScript"],"sources":["src/api/cura-api.ts","src/rededor-cura-start.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { CuraConfig, APIThemeFunctions, CuraCustomTheme } from './cura-api.type';\nimport CuraThemeModule from './modules/cura-theme-module';\n\nexport default class CuraAPI {\n\n theme: APIThemeFunctions;\n localAssetsPath: string;\n\n constructor (config?: CuraConfig) {\n this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;\n const themeModule = new CuraThemeModule();\n this.theme = {\n load: function(themeTag: string) { themeModule.load(themeTag); },\n setCustom: function(customThemeDefinitions: CuraCustomTheme) { themeModule.setCustom(customThemeDefinitions); },\n colors: {\n getColor: function(colorWithDepth?: string, opacity?: number) { return themeModule.colors.getColor(colorWithDepth, opacity) },\n },\n fonts: {\n getFamily: function(type?: string) { return themeModule.fonts.getFamily(type) },\n getWeights: function() { return themeModule.fonts.getWeights() },\n getSize: function() { return themeModule.fonts.getSize() },\n getColor: function() { return themeModule.fonts.getColor() }\n },\n spacing: {\n getSpacing: function() { return themeModule.spacing.getSpacing(); },\n },\n breakpoints: {\n get: function(size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge', position?: 'min' | 'max') { return themeModule.breakpoints.get(size, position); }\n }\n };\n if (config && config.customTheme) {\n this.theme.setCustom(config.customTheme);\n } else {\n const theme = config && config.theme ? config.theme : 'default';\n this.theme.load(theme);\n }\n }\n\n}\n","import CuraAPI from './api/cura-api';\nimport { CuraConfig } from './api/cura-api.type';\n// import { setAssetPath } from '@stencil/core';\n\n// setAssetPath(import.meta.url);\ndeclare global {\n interface Window {\n CuraAPI?: CuraAPI,\n CuraInit?: CuraConfig\n }\n}\n\nexport default function() {\n const config = window.CuraInit;\n window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();\n const api = window.CuraAPI;\n window.dispatchEvent(new CustomEvent(\"CuraAPIReady\", { detail: {api} }));\n if (config && typeof config.onReady === 'function') config.onReady(api);\n}\n","import appGlobalScript from '/Users/fellipesoares/Code/cura/packages/component-lib/src/rededor-cura-start.ts';\nexport const globalScripts = appGlobalScript;\n"],"mappings":"0CAGqBA,EAKnB,WAAAC,CAAaC,GACXC,KAAKC,gBAAkBF,GAAUA,EAAOE,gBAAkBF,EAAOE,gBAAkB,UACnF,MAAMC,EAAc,IAAIC,EACxBH,KAAKI,MAAQ,CACXC,KAAM,SAASC,GAAoBJ,EAAYG,KAAKC,EAAU,EAC9DC,UAAW,SAASC,GAA2CN,EAAYK,UAAUC,EAAwB,EAC7GC,OAAQ,CACNC,SAAU,SAASC,EAAyBC,GAAoB,OAAOV,EAAYO,OAAOC,SAASC,EAAgBC,EAAQ,GAE7HC,MAAO,CACLC,UAAW,SAASC,GAAiB,OAAOb,EAAYW,MAAMC,UAAUC,EAAK,EAC7EC,WAAY,WAAa,OAAOd,EAAYW,MAAMG,YAAY,EAC9DC,QAAS,WAAa,OAAOf,EAAYW,MAAMI,SAAS,EACxDP,SAAU,WAAa,OAAOR,EAAYW,MAAMH,UAAU,GAE5DQ,QAAS,CACPC,WAAY,WAAa,OAAOjB,EAAYgB,QAAQC,YAAa,GAEnEC,YAAa,CACXC,IAAK,SAASC,EAA2DC,GAA4B,OAAOrB,EAAYkB,YAAYC,IAAIC,EAAMC,EAAU,IAG5J,GAAIxB,GAAUA,EAAOyB,YAAa,CAChCxB,KAAKI,MAAMG,UAAUR,EAAOyB,Y,KACvB,CACL,MAAMpB,EAAQL,GAAUA,EAAOK,MAAQL,EAAOK,MAAQ,UACtDJ,KAAKI,MAAMC,KAAKD,E,gBCrBpB,MAAML,EAAS0B,OAAOC,SACtBD,OAAO5B,QAAUE,EAAS,IAAIF,EAAQE,GAAU,IAAIF,EACpD,MAAM8B,EAAMF,OAAO5B,QACnB4B,OAAOG,cAAc,IAAIC,YAAY,eAAgB,CAAEC,OAAQ,CAACH,UAChE,GAAI5B,UAAiBA,EAAOgC,UAAY,WAAYhC,EAAOgC,QAAQJ,EACrE,CCjBY,MAACK,EAAgBC,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as o,H as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-dark-neutral-purewhite);border-radius:var(--border-radius)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{background-color:var(--color-lighter-color-darker)}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{background-color:var(--color-light-color-darker)}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.disabled,:host a.disabled{cursor:not-allowed}:host button.disabled::before,:host a.disabled::before{border-color:var(--neutral-dark)}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 3px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 2px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}';const n=a;const e=class{constructor(o){t(this,o);if(o.$hostElement$["s-ei"]){this.internals=o.$hostElement$["s-ei"]}else{this.internals=o.$hostElement$.attachInternals();o.$hostElement$["s-ei"]=this.internals}this.type="button";this.size="large";this.disabled=false;this.isLoading=false;this.iconName=undefined;this.iconset="default";this.iconPosition="left";this.iconOnly=false;this.href=undefined;this.target="_self";this.color="primary";this.background="light";this.fontColor="dark";this.textAlign="left";this.justify=false;this.styles={};this.hovered=false}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--text-align"]=this.textAlign;this.setColors()}getClasses(){var t;const o={};o[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;o[`icon-${this.iconPosition.toLowerCase()}`]=true;o[`icon-only`]=this.iconOnly;o["disabled"]=this.disabled;o["isLoading"]=this.isLoading;o["justify"]=this.justify;return o}setColors(){const t=[{name:"--color-dark-neutral-purewhite",thema:`${this.background==="light"?`${this.color}-dark`:"neutral-purewhite"}`},{name:"--color-lighter-color-darker",thema:`${this.background==="light"?`${this.color}-lighter`:`${this.color}-darker`}`},{name:"--color-light-color-darker",thema:`${this.background==="light"?`${this.color}-light`:`${this.color}-lighter`}`},{name:"--neutral-dark",thema:"neutral-dark"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getIcon(){if(!this.iconName)return"";const t=this.size==="large"?20:16;return o("cura-icon",{name:this.iconName,iconset:this.iconset,size:t,color:this.getSymbolColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}getSymbolColor(){if(this.disabled)return"neutral-dark";return this.fontColor==="light"?"neutral-purewhite":`${this.color}-darker`}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault();return}if(!this.href){if(this.type==="submit"&&this.internals.form)this.internals.form.submit();if(this.type==="reset"&&this.internals.form)this.internals.form.reset()}}render(){const t=this.getSymbolColor();const a=s[this.size]||s["default"];return o(i,{key:"0a0c25f94d0c18dbb90e4836ca3e7bcbbe10d032"},this.href?o("a",{href:this.disabled?"":this.href,target:this.target,class:this.getClasses(),style:this.styles,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as o,H as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-dark-neutral-purewhite);border-radius:var(--border-radius)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{background-color:var(--color-lighter-color-darker)}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{background-color:var(--color-light-color-darker)}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.disabled,:host a.disabled{cursor:not-allowed}:host button.disabled::before,:host a.disabled::before{border-color:var(--neutral-dark)}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 3px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 2px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}';const n=a;const e=class{constructor(o){t(this,o);if(o.$hostElement$["s-ei"]){this.internals=o.$hostElement$["s-ei"]}else{this.internals=o.$hostElement$.attachInternals();o.$hostElement$["s-ei"]=this.internals}this.type="button";this.size="large";this.disabled=false;this.isLoading=false;this.iconName=undefined;this.iconset="default";this.iconPosition="left";this.iconOnly=false;this.href=undefined;this.target="_self";this.color="primary";this.background="light";this.fontColor="dark";this.textAlign="left";this.justify=false;this.styles={};this.hovered=false}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--text-align"]=this.textAlign;this.setColors()}getClasses(){var t;const o={};o[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;o[`icon-${this.iconPosition.toLowerCase()}`]=true;o[`icon-only`]=this.iconOnly;o["disabled"]=this.disabled;o["isLoading"]=this.isLoading;o["justify"]=this.justify;return o}setColors(){const t=[{name:"--color-dark-neutral-purewhite",thema:`${this.background==="light"?`${this.color}-dark`:"neutral-purewhite"}`},{name:"--color-lighter-color-darker",thema:`${this.background==="light"?`${this.color}-lighter`:`${this.color}-darker`}`},{name:"--color-light-color-darker",thema:`${this.background==="light"?`${this.color}-light`:`${this.color}-lighter`}`},{name:"--neutral-dark",thema:"neutral-dark"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getIcon(){if(!this.iconName)return"";const t=this.size==="large"?20:16;return o("cura-icon",{name:this.iconName,iconset:this.iconset,size:t,color:this.getSymbolColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}getSymbolColor(){if(this.disabled)return"neutral-dark";return this.fontColor==="light"?"neutral-purewhite":`${this.color}-darker`}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault();return}if(!this.href){if(this.type==="submit"&&this.internals.form)this.internals.form.submit();if(this.type==="reset"&&this.internals.form)this.internals.form.reset()}}render(){const t=this.getSymbolColor();const a=s[this.size]||s["default"];return o(i,{key:"0a0c25f94d0c18dbb90e4836ca3e7bcbbe10d032"},this.href?o("a",{href:this.disabled?"":this.href,target:this.target,class:this.getClasses(),style:this.styles,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"normal",color:t},o("slot",null))),o("cura-loader-circle",{size:this.size,color:t})):o("button",{class:this.getClasses(),style:this.styles,disabled:this.disabled||null,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave(),type:this.type},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"normal",color:t},o("slot",null))),o("cura-loader-circle",{size:this.size,color:t})))}static get formAssociated(){return true}static get watchers(){return{background:["setColors"],color:["setColors","getSymbolColor"],fontColor:["getSymbolColor"]}}};e.style=n;export{e as cura_button_outline};
|
|
2
|
+
//# sourceMappingURL=p-dbab7864.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["curaButtonOutlineCss","CuraButtonOutlineStyle0","CuraButtonOutline","connectedCallback","this","weights","window","CuraAPI","theme","fonts","getWeights","styles","spacing","getSpacing","colors","getColor","getSize","getFamily","medium","textAlign","setColors","getClasses","classes","_a","size","toLowerCase","iconPosition","iconOnly","disabled","isLoading","justify","name","thema","background","color","forEach","Object","assign","getIcon","iconName","iconSize","h","iconset","getSymbolColor","handleMouseEnter","hovered","handleMouseLeave","fontColor","handleClick","e","preventDefault","href","type","internals","form","submit","reset","render","symbolColor","labelSize","labelSizes","Host","key","target","class","style","onClick","onMouseEnter","onMouseLeave","lineHeight"],"sources":["src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-dark-neutral-purewhite);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):not(.isLoading):hover {\n background-color: var(--color-lighter-color-darker);\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active {\n background-color: var(--color-light-color-darker);\n }\n\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label();\n\n\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n &::before {\n border-color: var(--neutral-dark);\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State, AttachInternals } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n formAssociated: true\n})\nexport class CuraButtonOutline {\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Button type: button (default) | submit | reset\n */\n @Prop({ reflect: true }) type: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({ reflect: true }) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({ reflect: true }) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({ reflect: true }) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({ reflect: true }) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({ reflect: true }) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({ reflect: true }) href: string;\n /**\n * Set target if link.\n */\n @Prop({ reflect: true }) target = \"_self\";\n /**\n * Color base from color scheme. Default: primary.\n */\n @Prop() color = 'primary';\n /**\n * Set the font background to dark or light.\n */\n @Prop() background: 'dark' | 'light' = 'light';\n\n /**\n * Set the font color to dark or light.\n */\n @Prop() fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({ reflect: true }) textAlign: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Justify icons and label inside the button.\n * Vales: false (default) | true.\n */\n @Prop({ reflect: true }) justify = false;\n\n @State() styles = {};\n\n @State() hovered = false;\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n classes['justify'] = this.justify;\n return classes;\n }\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-dark-neutral-purewhite', thema: `${this.background === 'light' ? `${this.color}-dark` : 'neutral-purewhite'}` },\n { name: '--color-lighter-color-darker', thema: `${this.background === 'light' ? `${this.color}-lighter` : `${this.color}-darker`}` },\n { name: '--color-light-color-darker', thema: `${this.background === 'light' ? `${this.color}-light` : `${this.color}-lighter`}` },\n { name: '--neutral-dark', thema: 'neutral-dark' },\n ]\n\n colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema));\n this.styles = { ...this.styles };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={this.getSymbolColor()}></cura-icon>;\n }\n\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Watch('fontColor')\n @Watch('color')\n getSymbolColor() {\n if (this.disabled) return 'neutral-dark';\n return this.fontColor === 'light' ? 'neutral-purewhite' : `${this.color}-darker`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) {\n e.preventDefault();\n return;\n }\n if (!this.href) {\n if (this.type === 'submit' && this.internals.form) this.internals.form.submit();\n if (this.type === 'reset' && this.internals.form) this.internals.form.reset();\n }\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n const labelSize = labelSizes[this.size] || labelSizes[\"default\"];\n return (\n <Host>\n {this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='105%' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n type={this.type}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='105%' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"mappings":"sFAAA,MAAMA,EAAuB,q5GAC7B,MAAAC,EAAeD,E,MCQFE,E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,OAAQ3D,KAAK2D,OACbC,MAAO5D,KAAKiB,aACZ4C,MAAO7D,KAAKO,OACZuD,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,oBACzBL,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,OAAOnC,MAAOwB,GAAajB,EAAA,eAErEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,KAG9CjB,EAAA,UAAQuB,MAAO5D,KAAKiB,aAClB4C,MAAO7D,KAAKO,OACZiB,SAAUxB,KAAKwB,UAAY,KAC3BsC,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,mBACzBM,KAAMhD,KAAKgD,MACXX,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,OAAOnC,MAAOwB,GAAajB,EAAA,eAErEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["curaButtonOutlineCss","CuraButtonOutlineStyle0","CuraButtonOutline","connectedCallback","this","weights","window","CuraAPI","theme","fonts","getWeights","styles","spacing","getSpacing","colors","getColor","getSize","getFamily","medium","textAlign","setColors","getClasses","classes","_a","size","toLowerCase","iconPosition","iconOnly","disabled","isLoading","justify","name","thema","background","color","forEach","Object","assign","getIcon","iconName","iconSize","h","iconset","getSymbolColor","handleMouseEnter","hovered","handleMouseLeave","fontColor","handleClick","e","preventDefault","href","type","internals","form","submit","reset","render","symbolColor","labelSize","labelSizes","Host","key","target","class","style","onClick","onMouseEnter","onMouseLeave","lineHeight"],"sources":["src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-dark-neutral-purewhite);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):not(.isLoading):hover {\n background-color: var(--color-lighter-color-darker);\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active {\n background-color: var(--color-light-color-darker);\n }\n\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label();\n\n\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n &::before {\n border-color: var(--neutral-dark);\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State, AttachInternals } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n formAssociated: true\n})\nexport class CuraButtonOutline {\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Button type: button (default) | submit | reset\n */\n @Prop({ reflect: true }) type: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({ reflect: true }) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({ reflect: true }) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({ reflect: true }) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({ reflect: true }) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({ reflect: true }) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({ reflect: true }) href: string;\n /**\n * Set target if link.\n */\n @Prop({ reflect: true }) target = \"_self\";\n /**\n * Color base from color scheme. Default: primary.\n */\n @Prop() color = 'primary';\n /**\n * Set the font background to dark or light.\n */\n @Prop() background: 'dark' | 'light' = 'light';\n\n /**\n * Set the font color to dark or light.\n */\n @Prop() fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({ reflect: true }) textAlign: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Justify icons and label inside the button.\n * Vales: false (default) | true.\n */\n @Prop({ reflect: true }) justify = false;\n\n @State() styles = {};\n\n @State() hovered = false;\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n classes['justify'] = this.justify;\n return classes;\n }\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-dark-neutral-purewhite', thema: `${this.background === 'light' ? `${this.color}-dark` : 'neutral-purewhite'}` },\n { name: '--color-lighter-color-darker', thema: `${this.background === 'light' ? `${this.color}-lighter` : `${this.color}-darker`}` },\n { name: '--color-light-color-darker', thema: `${this.background === 'light' ? `${this.color}-light` : `${this.color}-lighter`}` },\n { name: '--neutral-dark', thema: 'neutral-dark' },\n ]\n\n colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema));\n this.styles = { ...this.styles };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={this.getSymbolColor()}></cura-icon>;\n }\n\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Watch('fontColor')\n @Watch('color')\n getSymbolColor() {\n if (this.disabled) return 'neutral-dark';\n return this.fontColor === 'light' ? 'neutral-purewhite' : `${this.color}-darker`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) {\n e.preventDefault();\n return;\n }\n if (!this.href) {\n if (this.type === 'submit' && this.internals.form) this.internals.form.submit();\n if (this.type === 'reset' && this.internals.form) this.internals.form.reset();\n }\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n const labelSize = labelSizes[this.size] || labelSizes[\"default\"];\n return (\n <Host>\n {this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='normal' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n type={this.type}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='normal' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"mappings":"sFAAA,MAAMA,EAAuB,q5GAC7B,MAAAC,EAAeD,E,MCQFE,EAAiB,M,mMAOmC,S,UAKD,Q,cAK1B,M,eAIC,M,qCASF,U,kBAIuB,O,cAItB,M,gCASF,Q,WAIlB,U,gBAIuB,Q,eAKD,O,eAK4B,O,aAM/B,M,YAEjB,G,aAEC,K,CAInB,iBAAAC,GACEC,KAAKC,QAAUC,OAAOC,QAAQC,MAAMC,MAAMC,aAC1CN,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMI,QAAQC,aAC7DT,KAAKO,OAAO,mBAAqBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,iBACtEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,eAAiBL,OAAOC,QAAQC,MAAMC,MAAMO,UACxDZ,KAAKO,OAAO,iBAAmBL,OAAOC,QAAQC,MAAMC,MAAMQ,YAC1Db,KAAKO,OAAO,wBAA0BP,KAAKC,QAAQa,OACnDd,KAAKO,OAAO,gBAAkBP,KAAKe,UACnCf,KAAKgB,W,CAIP,UAAAC,G,MACE,MAAMC,EAAU,GAChBA,EAAQ,IAAGC,EAAAnB,KAAKoB,QAAI,MAAAD,SAAA,SAAAA,EAAEE,iBAAmB,KACzCH,EAAQ,QAAQlB,KAAKsB,aAAaD,iBAAmB,KACrDH,EAAQ,aAAelB,KAAKuB,SAC5BL,EAAQ,YAAclB,KAAKwB,SAC3BN,EAAQ,aAAelB,KAAKyB,UAC5BP,EAAQ,WAAalB,KAAK0B,QAC1B,OAAOR,C,CAKT,SAAAF,GACE,MAAMN,E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MAAAC,GACE,MAAMC,EAActD,KAAKuC,iBACzB,MAAMgB,EAAYC,EAAWxD,KAAKoB,OAASoC,EAAW,WACtD,OACEnB,EAACoB,EAAI,CAAAC,IAAA,4CACF1D,KAAK+C,KACJV,EAAA,KAAGU,KAAM/C,KAAKwB,SAAW,GAAKxB,KAAK+C,KACjCY,OAAQ3D,KAAK2D,OACbC,MAAO5D,KAAKiB,aACZ4C,MAAO7D,KAAKO,OACZuD,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,oBACzBL,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,SAASnC,MAAOwB,GAAajB,EAAA,eAEvEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,KAG9CjB,EAAA,UAAQuB,MAAO5D,KAAKiB,aAClB4C,MAAO7D,KAAKO,OACZiB,SAAUxB,KAAKwB,UAAY,KAC3BsC,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,mBACzBM,KAAMhD,KAAKgD,MACXX,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,SAASnC,MAAOwB,GAAajB,EAAA,eAEvEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,K","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as i,c as t,h as o,H as e,g as s}from"./p-fd5ed6b0.js";const d=":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown .dropdown-search-list{z-index:1000}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:1%;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex;margin-right:4px}.dropdown-mobile .dropdown-input-search cura-input-text{padding:12px 8px 12px 0px}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:calc(100vh - var(--dynamic-input-search-height, 0));max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";const r=d;const n=class{constructor(o){i(this,o);this.valueChanged=t(this,"valueChanged",7);this.onselect=t(this,"onselect",7);this.overlayElement=null;this.adjustInputPosition=()=>{setTimeout((()=>{var i,t;const o=(window===null||window===void 0?void 0:window.innerHeight)<this.screenDefaultHeight;const e=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-mobile");if(e){e.style.position=o?"absolute":"fixed";e.style.bottom=o?`${((t=window===null||window===void 0?void 0:window.screen)===null||t===void 0?void 0:t.height)-(window===null||window===void 0?void 0:window.innerHeight)}px`:"0";window.scroll({top:0,left:0})}}),300)};this.handleSlotChange=()=>{this.options=Array.from(this.host.querySelectorAll("cura-dropdown-search-option"));this.addClickListenersToOptions();this.updateHoveredIndex()};this.handleInputChange=i=>{const t=i.target;this.value=t.value;this.onValueChange(this.value)};this.handleKeyDown=i=>{if(i.key==="ArrowDown"){i.preventDefault();this.moveHighlight(1)}else if(i.key==="ArrowUp"){i.preventDefault();this.moveHighlight(-1)}else if(i.key==="Enter"){i.preventDefault();if(this.hoveredIndex>-1){this.handleOnBlur();this.onSelectedOption(this.hoveredIndex)}}};this.handleResize=()=>{this.isMobile=window.innerWidth<768;if(this.isDropdownOpen){if(this.isMobile){this.showOverlay()}else{this.resetDropdownStyles();this.removeOverlay()}}};this.setUp=()=>{this.handleResize();this.adjustInputPosition()};this.size="large";this.status="default";this.disabled=false;this.name=undefined;this.required=false;this.selected=false;this.value="";this.placeholder="";this.label="";this.iconName="search";this.dropdownMaxHeight="630px";this.overlayVisible=false;this.isDropdownOpen=false;this.styles={};this.isMobile=window.innerWidth<768;this.mode="default";this.inputTextRef=undefined;this.isOnBlurInput=true;this.hoveredIndex=-1;this.options=[];this.originalOverflow="";this.screenDefaultHeight=0}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--info-base"]=window.CuraAPI.theme.colors.getColor("info-base");this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor("neutral-purewhite");this.styles["--neutral-light"]=window.CuraAPI.theme.colors.getColor("neutral-light");this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor("neutral-dark");this.styles["--neutral-black-shadow"]=window.CuraAPI.theme.colors.getColor(`neutral-black`,.16);this.styles["--error-dark"]=window.CuraAPI.theme.colors.getColor("error-dark");this.styles["--error-lighter"]=window.CuraAPI.theme.colors.getColor("error-lighter");this.styles["--breakpoints"]=window.CuraAPI.theme.breakpoints.get();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium}onValueChange(i){this.value=i;this.updateSelectedOption(i);this.valueChanged.emit(i)}componentWillLoad(){this.updateSelectedOption(this.value)}componentDidRender(){if(this.isDropdownOpen&&this.isMobile){this.showOverlay();this.getDropdownSearchListHeight()}else{this.removeOverlay()}}componentDidLoad(){var i;this.screenDefaultHeight=window===null||window===void 0?void 0:window.innerHeight;window===null||window===void 0?void 0:window.addEventListener("resize",this.setUp);(i=window===null||window===void 0?void 0:window.visualViewport)===null||i===void 0?void 0:i.addEventListener("resize",this.adjustInputPosition)}disconnectedCallback(){var i;window===null||window===void 0?void 0:window.removeEventListener("resize",this.setUp);(i=window===null||window===void 0?void 0:window.visualViewport)===null||i===void 0?void 0:i.removeEventListener("resize",this.adjustInputPosition)}showOverlay(){if(!this.overlayElement){this.overlayElement=document.createElement("div");this.overlayElement.className="dropdown-overlay";this.overlayElement.style.position="fixed";this.overlayElement.style.top="0";this.overlayElement.style.left="0";this.overlayElement.style.width="100%";this.overlayElement.style.height="100%";this.overlayElement.style.zIndex="9999";this.overlayElement.style.backgroundColor="white";document.body.appendChild(this.overlayElement);this.originalOverflow=document.body.style.overflow;document.body.style.overflow="hidden"}}removeOverlay(){if(this.overlayElement&&this.overlayElement.parentNode===document.body){document.body.removeChild(this.overlayElement);this.overlayElement=null;document.body.style.overflow=this.originalOverflow}}addClickListenersToOptions(){this.options.forEach(((i,t)=>{i===null||i===void 0?void 0:i.addEventListener("optionSelected",(()=>this.onSelectedOption(t)))}))}updateSelectedOption(i){const t=this.options.findIndex((t=>t.getAttribute("value")===i));this.hoveredIndex=t;this.updateOptionAttribute("hovered",this.hoveredIndex);this.updateOptionAttribute("selected",this.hoveredIndex);this.scrollHoveredOptionIntoView();this.adjustInputPosition()}onSelectedOption(i){setTimeout((()=>{const t=this.options[i];if(t.selectable){const i=t.getAttribute("value")||t.textContent;this.value=i||"";this.updateSelectedOption(this.value);this.isDropdownOpen=false;this.isOnBlurInput=true;this.resetDropdownStyles();this.removeOverlay()}}),200)}moveHighlight(i){const t=this.options;const o=(this.hoveredIndex+i+t.length)%t.length;this.hoveredIndex=o;this.updateOptionAttribute("hovered",this.hoveredIndex);this.scrollHoveredOptionIntoView()}updateOptionAttribute(i,t){this.options.forEach(((o,e)=>{o[i]=e===t}))}updateHoveredIndex(){const i=this.options;const t=this.value;this.hoveredIndex=i.findIndex((i=>i.getAttribute("value")===t))}scrollHoveredOptionIntoView(){var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-search-list");const o=this.options[this.hoveredIndex];if(t&&o){const i=o.getBoundingClientRect();const e=t.getBoundingClientRect();if(i.bottom>e.bottom){t.scrollTop+=i.bottom-e.bottom}if(i.top<e.top){t.scrollTop-=e.top-i.top}}}handleOnBlur(){if(this.isOnBlurInput===true){setTimeout((()=>{this.isDropdownOpen=false;this.resetDropdownStyles();this.removeOverlay()}),200)}}getClasses(){return{"dropdown-input-search":true,"dropdown-open":this.isDropdownOpen,disabled:this.disabled,[this.status]:true}}getDropdownClasses(){return{"dropdown-search-list":true,visible:this.options.length&&this.isDropdownOpen?true:false}}hostCSSProperties(){return{"--dropdown-max-height":this.dropdownMaxHeight}}handleOnFocus(){this.isDropdownOpen=true}getDropdownSearchListHeight(){setTimeout((()=>{var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-input-search");if(t){this.host.style.setProperty("--dynamic-input-search-height",`${t.offsetHeight}px`)}}),310)}handleGoBack(){this.resetDropdownStyles();this.isMobile=false}resetDropdownStyles(){var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-mobile");if(t&&t.style.position==="fixed"){t.style.position="relative";t.style.removeProperty("bottom")}}render(){const i=this.isMobile&&this.isDropdownOpen;return o(e,{key:"29caf35386c324e85a5b68caa280193e8f1a3aae",style:this.hostCSSProperties(),class:"dropdown-overlay"},o("div",{key:"879dc628c89920323a97f5b29aeadf6e774615ef",class:`dropdown ${i?"dropdown-mobile":""}`,style:this.styles},o("div",{key:"31c2df66c5311abedfd1661fb9d8b135dde4ea8a",class:this.getClasses()},this.isMobile&&this.isDropdownOpen&&o("cura-button-transparent",{key:"418fa19788b7dd8374d4c9c78837ad89c9f11f9e",fontColor:"dark",onClick:()=>this.handleGoBack(),iconName:"arrowLeft",size:"medium",iconOnly:true,color:"primary"}),o("cura-input-text",{key:"78dfa84f63f4a5a3b72f94e589b9c362d8e78e19",disabled:this.disabled,label:this.label,part:"cura-input-field",mode:i?"transparent":"default",required:this.required,hideErrorIcon:this.status==="error",iconName:this.iconName||"search",value:this.value,status:this.status,onValueChange:i=>this.onValueChange(i.target.value),onInput:i=>this.handleInputChange(i),onFocus:()=>this.handleOnFocus(),onClick:()=>window.innerWidth<768?this.isMobile=true:null,onBlur:()=>{this.handleOnBlur()},placeholder:this.placeholder,size:this.size,onKeyDown:this.handleKeyDown},o("slot",{key:"e7f13fc467083f08b4666f4323b8734fb734fe1c",name:"helperText"}))),o("div",{key:"9a39a16c1dfefd6481593ce062036e19cd1b65fa",id:"dropdown-search-list",class:this.getDropdownClasses()},o("slot",{key:"36af7eb7212ea066af0edb68b5e12bf9f931fae1",name:"dropdown-search-option",onSlotchange:this.handleSlotChange}))))}get host(){return s(this)}static get watchers(){return{value:["onValueChange"]}}};n.style=r;export{n as cura_dropdown_search};
|
|
2
|
+
//# sourceMappingURL=p-f30270f0.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaDropdownSearchCss","CuraDropdownSearchStyle0","CuraDropdownSearch","this","overlayElement","adjustInputPosition","setTimeout","isKeyboardOpen","window","innerHeight","screenDefaultHeight","dropdown","_a","host","shadowRoot","querySelector","style","position","bottom","_b","screen","height","scroll","top","left","handleSlotChange","options","Array","from","querySelectorAll","addClickListenersToOptions","updateHoveredIndex","handleInputChange","event","input","target","value","onValueChange","handleKeyDown","key","preventDefault","moveHighlight","hoveredIndex","handleOnBlur","onSelectedOption","handleResize","isMobile","innerWidth","isDropdownOpen","showOverlay","resetDropdownStyles","removeOverlay","setUp","connectedCallback","weights","CuraAPI","theme","fonts","getWeights","styles","colors","getColor","breakpoints","get","getSize","getFamily","medium","newValue","updateSelectedOption","valueChanged","emit","componentWillLoad","componentDidRender","getDropdownSearchListHeight","componentDidLoad","addEventListener","visualViewport","disconnectedCallback","removeEventListener","document","createElement","className","width","zIndex","backgroundColor","body","appendChild","originalOverflow","overflow","parentNode","removeChild","forEach","option","index","selectedOptionIndex","findIndex","getAttribute","updateOptionAttribute","scrollHoveredOptionIntoView","selectedOption","selectable","selectedValue","textContent","isOnBlurInput","direction","visibleOptions","newIndex","length","attribute","indexToUpdate","currentValue","container","hoveredOption","optionRect","getBoundingClientRect","containerRect","scrollTop","getClasses","disabled","status","getDropdownClasses","visible","hostCSSProperties","dropdownMaxHeight","handleOnFocus","dropdownInputSearchElement","setProperty","offsetHeight","handleGoBack","removeProperty","render","isMobileDropdown","h","Host","class","fontColor","onClick","iconName","size","iconOnly","color","label","part","mode","required","hideErrorIcon","e","onInput","onFocus","onBlur","placeholder","onKeyDown","name","id","onSlotchange"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search.scss?tag=cura-dropdown-search&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"sourcesContent":["@import '../../../scss/mixins/shadows.scss';\n\n:host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown {\n display: flex;\n position: relative;\n\n flex-direction: column;\n width: inherit;\n\n .dropdown-search-list {\n z-index: 1000;\n }\n\n &-input-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n\n\n &.dropdown-open {\n ::part(cura-input-field) {\n border-radius: 4px 4px 0px 0px;\n }\n ::slotted([slot='helperText']) {\n display: none;\n }\n\n cura-input-text {\n ::slotted([slot='helperText']) {\n display: none;\n }\n }\n }\n }\n\n &-search-list {\n position: absolute;\n top: calc(100% - 8px);\n width: 100%;\n max-height: var(--dropdown-max-height);\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n @include shadow-level3(--neutral-black-shadow);\n border-radius: 0px 0px 4px 4px;\n border-top: 0 var(--neutral-light);\n border-right: 2px solid var(--neutral-light);\n border-bottom: 2px solid var(--neutral-light);\n border-left: 2px solid var(--neutral-light);\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n display: none;\n\n &.visible {\n display: block;\n }\n\n &-input-search {\n width: inherit;\n\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 16px 8px;\n border-bottom: 2px solid var(--info-base);\n background-color: var(--neutral-purewhite);\n\n cura-input-text {\n width: inherit;\n }\n\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n }\n }\n\n &-mobile {\n position: fixed;\n top: 1%;\n left: 0;\n right: 0;\n width: 100%;\n z-index: 10000;\n \n .dropdown-input-search {\n display: flex;\n background-color: var(--neutral-purewhite);\n border-bottom: 2px solid var(--info-base);\n z-index: 10000;\n cura-button-transparent {\n display: flex;\n margin-right: 4px;\n }\n cura-input-text {\n padding: 12px 8px 12px 0px;\n }\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n &.dropdown-open {\n display: flex;\n\n ::slotted([slot='helperText']) {\n display: block;\n }\n }\n }\n\n .dropdown-search-list {\n position: static;\n width: 100%;\n height: calc(100vh - var(--dynamic-input-search-height, 0));\n max-height: none;\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n box-shadow: none;\n border: none;\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n z-index: 10000;\n }\n }\n}\n","import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n /**\n *\n * Stores the original value of the 'overflow' style of the body\n * before blocking the scroll.\n */\n @State() originalOverflow: string = '';\n @State() screenDefaultHeight = 0;\n\n private adjustInputPosition = () => {\n setTimeout(() => {\n const isKeyboardOpen = window?.innerHeight < this.screenDefaultHeight;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLElement;\n if (dropdown) {\n dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';\n dropdown.style.bottom = isKeyboardOpen ? `${window?.screen?.height - window?.innerHeight}px` : '0';\n window.scroll({ top: 0, left: 0 });\n }\n }, 300);\n };\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.value = newValue;\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n this.getDropdownSearchListHeight();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n this.screenDefaultHeight = window?.innerHeight;\n window?.addEventListener('resize', this.setUp);\n window?.visualViewport?.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window?.removeEventListener('resize', this.setUp);\n window?.visualViewport?.removeEventListener('resize', this.adjustInputPosition);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n\n this.originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n document.body.style.overflow = this.originalOverflow;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option?.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollHoveredOptionIntoView();\n this.adjustInputPosition();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n };\n\n private onSelectedOption(index: number) {\n setTimeout(() => {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }, 200);\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollHoveredOptionIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollHoveredOptionIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.resetDropdownStyles();\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n getDropdownSearchListHeight() {\n setTimeout(() => {\n const dropdownInputSearchElement = this.host.shadowRoot?.querySelector('.dropdown-input-search') as HTMLInputElement;\n if (dropdownInputSearchElement) {\n this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);\n }\n }, 310)\n }\n\n handleGoBack() {\n this.resetDropdownStyles();\n this.isMobile = false;\n }\n\n resetDropdownStyles() {\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n if (dropdown && dropdown.style.position === 'fixed') {\n dropdown.style.position = 'relative';\n dropdown.style.removeProperty('bottom');\n }\n }\n\n setUp = () => {\n this.handleResize()\n this.adjustInputPosition();\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent fontColor=\"dark\" onClick={() => this.handleGoBack()} iconName=\"arrowLeft\" size=\"medium\" iconOnly color=\"primary\"></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAwB,g9EAC9B,MAAAC,EAAeD,E,MCMFE,EAAkB,M,uGAmHrBC,KAAAC,eAAwC,KAYxCD,KAAAE,oBAAsB,KAC5BC,YAAW,K,QACT,MAAMC,GAAiBC,SAAM,MAANA,cAAM,SAANA,OAAQC,aAAcN,KAAKO,oBAClD,MAAMC,GAAWC,EAAAT,KAAKU,KAAKC,cAAU,MAAAF,SAAA,SAAAA,EAAEG,cAAc,oBACrD,GAAIJ,EAAU,CACZA,EAASK,MAAMC,SAAWV,EAAiB,WAAa,QACxDI,EAASK,MAAME,OAASX,EAAiB,KAAGY,EAAAX,SAAM,MAANA,cAAM,SAANA,OAAQY,UAAM,MAAAD,SAAA,SAAAA,EAAEE,SAASb,SAAM,MAANA,cAAM,SAANA,OAAQC,iBAAkB,IAC/FD,OAAOc,OAAO,CAAEC,IAAK,EAAGC,KAAM,G,IAE/B,IAAI,EA0EDrB,KAAAsB,iBA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,2BAAA7F,IAAA,2CAAyBgG,UAAU,OAAOC,QAAS,IAAMrI,KAAK6H,eAAgBS,SAAS,YAAYC,KAAK,SAASC,SAAQ,KAACC,MAAM,YAElIR,EAAA,mBAAA7F,IAAA,2CACE+E,SAAUnH,KAAKmH,SACfuB,MAAO1I,KAAK0I,MACZC,KAAK,mBACLC,KAAMZ,EAAmB,cAAgB,UACzCa,SAAU7I,KAAK6I,SACfC,cAAe9I,KAAKoH,SAAW,QAC/BkB,SAAUtI,KAAKsI,UAAY,SAC3BrG,MAAOjC,KAAKiC,MACZmF,OAAQpH,KAAKoH,OACblF,cAAe6G,GAAK/I,KAAKkC,cAAc6G,EAAE/G,OAAOC,OAChD+G,QAASD,GAAK/I,KAAK6B,kBAAkBkH,GACrCE,QAAS,IAAMjJ,KAAKyH,gBACpBY,QAAS,IAAOhI,OAAOuC,WAAa,IAAO5C,KAAK2C,SAAW,KAAQ,KACnEuG,OAAQ,KACNlJ,KAAKwC,cAAc,EAErB2G,YAAanJ,KAAKmJ,YAClBZ,KAAMvI,KAAKuI,KACXa,UAAWpJ,KAAKmC,eAEhB8F,EAAA,QAAA7F,IAAA,2CAAMiH,KAAK,iBAGfpB,EAAA,OAAA7F,IAAA,2CAAKkH,GAAG,uBAAuBnB,MAAOnI,KAAKqH,sBACzCY,EAAA,QAAA7F,IAAA,2CAAMiH,KAAK,yBAAyBE,aAAcvJ,KAAKsB,qB","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { C as CuraThemeModule } from './cura-theme-module-b23f8ac8.js';
|
|
2
|
+
|
|
3
|
+
class CuraAPI {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;
|
|
6
|
+
const themeModule = new CuraThemeModule();
|
|
7
|
+
this.theme = {
|
|
8
|
+
load: function (themeTag) { themeModule.load(themeTag); },
|
|
9
|
+
setCustom: function (customThemeDefinitions) { themeModule.setCustom(customThemeDefinitions); },
|
|
10
|
+
colors: {
|
|
11
|
+
getColor: function (colorWithDepth, opacity) { return themeModule.colors.getColor(colorWithDepth, opacity); },
|
|
12
|
+
},
|
|
13
|
+
fonts: {
|
|
14
|
+
getFamily: function (type) { return themeModule.fonts.getFamily(type); },
|
|
15
|
+
getWeights: function () { return themeModule.fonts.getWeights(); },
|
|
16
|
+
getSize: function () { return themeModule.fonts.getSize(); },
|
|
17
|
+
getColor: function () { return themeModule.fonts.getColor(); }
|
|
18
|
+
},
|
|
19
|
+
spacing: {
|
|
20
|
+
getSpacing: function () { return themeModule.spacing.getSpacing(); },
|
|
21
|
+
},
|
|
22
|
+
breakpoints: {
|
|
23
|
+
get: function (size, position) { return themeModule.breakpoints.get(size, position); }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
if (config && config.customTheme) {
|
|
27
|
+
this.theme.setCustom(config.customTheme);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const theme = config && config.theme ? config.theme : 'default';
|
|
31
|
+
this.theme.load(theme);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function appGlobalScript () {
|
|
37
|
+
const config = window.CuraInit;
|
|
38
|
+
window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();
|
|
39
|
+
const api = window.CuraAPI;
|
|
40
|
+
window.dispatchEvent(new CustomEvent("CuraAPIReady", { detail: { api } }));
|
|
41
|
+
if (config && typeof config.onReady === 'function')
|
|
42
|
+
config.onReady(api);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const globalScripts = appGlobalScript;
|
|
46
|
+
|
|
47
|
+
export { globalScripts as g };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=app-globals-036c3b80.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"app-globals-036c3b80.js","mappings":";;MAGqB,OAAO;IAK1B,YAAa,MAAmB;QAC9B,IAAI,CAAC,eAAe,GAAG,MAAM,I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SAC1C;aAAM;YACL,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxB;KACF;;;;ICvBD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC/B,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3B,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC,CAAC;IACzE,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1E;;ACjBY,MAAC,aAAa,GAAG;;;;","names":[],"sources":["src/api/cura-api.ts","src/rededor-cura-start.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { CuraConfig, APIThemeFunctions, CuraCustomTheme } from './cura-api.type';\nimport CuraThemeModule from './modules/cura-theme-module';\n\nexport default class CuraAPI {\n\n theme: APIThemeFunctions;\n localAssetsPath: string;\n\n constructor (config?: CuraConfig) {\n this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;\n const themeModule = new CuraThemeModule();\n this.theme = {\n load: function(themeTag: string) { themeModule.load(themeTag); },\n setCustom: function(customThemeDefinitions: CuraCustomTheme) { themeModule.setCustom(customThemeDefinitions); },\n colors: {\n getColor: function(colorWithDepth?: string, opacity?: number) { return themeModule.colors.getColor(colorWithDepth, opacity) },\n },\n fonts: {\n getFamily: function(type?: string) { return themeModule.fonts.getFamily(type) },\n getWeights: function() { return themeModule.fonts.getWeights() },\n getSize: function() { return themeModule.fonts.getSize() },\n getColor: function() { return themeModule.fonts.getColor() }\n },\n spacing: {\n getSpacing: function() { return themeModule.spacing.getSpacing(); },\n },\n breakpoints: {\n get: function(size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge', position?: 'min' | 'max') { return themeModule.breakpoints.get(size, position); }\n }\n };\n if (config && config.customTheme) {\n this.theme.setCustom(config.customTheme);\n } else {\n const theme = config && config.theme ? config.theme : 'default';\n this.theme.load(theme);\n }\n }\n\n}\n","import CuraAPI from './api/cura-api';\nimport { CuraConfig } from './api/cura-api.type';\n// import { setAssetPath } from '@stencil/core';\n\n// setAssetPath(import.meta.url);\ndeclare global {\n interface Window {\n CuraAPI?: CuraAPI,\n CuraInit?: CuraConfig\n }\n}\n\nexport default function() {\n const config = window.CuraInit;\n window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();\n const api = window.CuraAPI;\n window.dispatchEvent(new CustomEvent(\"CuraAPIReady\", { detail: {api} }));\n if (config && typeof config.onReady === 'function') config.onReady(api);\n}\n","import appGlobalScript from '/Users/fellipesoares/Code/cura/packages/component-lib/src/rededor-cura-start.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
|
|
@@ -226,7 +226,7 @@ const CuraButton = class {
|
|
|
226
226
|
render() {
|
|
227
227
|
const symbolColor = this.getSymbolColor();
|
|
228
228
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
229
|
-
return (h(Host, { key: '07b87d98fb398bc2897e666dc8cd54734f20734d' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '
|
|
229
|
+
return (h(Host, { key: '07b87d98fb398bc2897e666dc8cd54734f20734d' }, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: 'normal', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: 'normal', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
230
230
|
}
|
|
231
231
|
static get formAssociated() { return true; }
|
|
232
232
|
static get watchers() { return {
|