@freshworks/crayons
Version:
Crayons Web Components library
1 lines • 5.59 kB
JavaScript
import{r as registerInstance,h,i as getElement}from"./index-25bc21e4.js";import{h as hasSlot}from"./index-04e9b0fa.js";import{i as i18n}from"./Translation-f65767b0.js";var modalContentCss=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}:host{-ms-flex:1;flex:1;overflow-y:auto;font-size:14px;font-weight:400;color:#12344d;line-height:20px}.content{padding:12px 32px 32px;overflow:visible;-webkit-box-sizing:border-box;box-sizing:border-box}';var ModalContent=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"content"},h("slot",null))};return e}();ModalContent.style=modalContentCss;var modalFooterCss=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.modal-footer-container{padding:12px 16px;-webkit-box-sizing:border-box;box-sizing:border-box;height:56px;background-color:#f3f5f7;border-radius:0 0 4px 4px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;-ms-flex:none;flex:none}.modal-footer-container fw-button{margin-left:12px}';var __decorate=undefined&&undefined.__decorate||function(e,o,t,i){var n=arguments.length,l=n<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,t):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")l=Reflect.decorate(e,o,t,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])l=(n<3?a(l):n>3?a(o,t,l):a(o,t))||l;return n>3&&l&&Object.defineProperty(o,t,l),l};var ModalFooter=function(){function e(e){registerInstance(this,e);this.submitText="";this.cancelText="";this.submitDisabled=false;this.submitColor="primary";this.custom=null;this.submit=function(){};this.close=function(){}}e.prototype.componentWillLoad=function(){if(this.custom===null){this.custom=hasSlot(this.el)}};e.prototype.render=function(){var e=this;return h("div",{class:"modal-footer-container"},h("div",{class:"modal-footer"},this.custom?h("slot",null):h("span",null,h("fw-button",{color:"secondary",onClick:function(){return e.close()}},this.cancelText),h("fw-button",{color:this.submitColor,disabled:this.submitDisabled,onClick:function(){return e.submit()}},this.submitText))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([i18n({keyName:"modal.ok"})],ModalFooter.prototype,"submitText",void 0);__decorate([i18n({keyName:"modal.cancel"})],ModalFooter.prototype,"cancelText",void 0);ModalFooter.style=modalFooterCss;var modalTitleCss=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.modal-header-container{padding:32px 32px 0;position:relative;background:#fff;border-radius:4px 4px 0 0;-webkit-transition:all 0.1s linear;transition:all 0.1s linear;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex:none;flex:none}.modal-header-container .modal-header{width:100%;height:auto;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;font-size:18px;font-weight:600;line-height:24px;color:#12344d}.modal-header-container .modal-header .modal-header-body{width:100%;height:auto;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0px}.modal-header-container .modal-header .modal-header-body .modal-title{width:100%;height:auto;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:10px;color:#12344d}.modal-header-container .modal-header .modal-header-body .modal-title .modal-title-icon{width:auto;height:24px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.modal-header-container .modal-header .modal-header-body .modal-title .title-label{font-size:18px;font-weight:600;line-height:24px}.modal-header-container .modal-header .modal-header-body .description{font-size:14px;font-weight:400;color:#475867;line-height:20px;padding:6px 0px}';var ModalTitle=function(){function e(e){registerInstance(this,e);this.icon="";this.custom=null}e.prototype.componentWillLoad=function(){if(this.custom===null){this.custom=hasSlot(this.el)}};e.prototype.renderIcon=function(){return h("span",{class:"modal-title-icon"},h("fw-icon",{name:this.icon,size:16}))};e.prototype.render=function(){return h("div",{class:"modal-header-container"},h("div",{class:"modal-header"},this.custom?h("slot",null):h("div",{class:"modal-header-body"},h("div",{class:"modal-title"},this.icon!==""?this.renderIcon():null,h("label",{class:"title-label"},this.titleText)),this.description&&h("label",{class:"description"},this.description))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ModalTitle.style=modalTitleCss;export{ModalContent as fw_modal_content,ModalFooter as fw_modal_footer,ModalTitle as fw_modal_title};