easy-component-ui 2.0.2 → 2.0.5
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/components/ea-button/index.js +1 -1
- package/components/ea-button/src/style/stylesheet.js +1 -1
- package/components/ea-checkbox/index.js +1 -1
- package/components/ea-checkbox-group/index.js +1 -1
- package/components/ea-descriptions/index.js +1 -1
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -1
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -1
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -1
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -1
- package/components/ea-descriptions-item/index.js +1 -1
- package/components/ea-form/index.js +1 -1
- package/components/ea-form-item/src/style/stylesheet.js +1 -1
- package/components/ea-icon/index.js +1 -1
- package/components/ea-image/index.js +1 -1
- package/components/ea-image/src/assets/errorImage.js +1 -1
- package/components/ea-image/src/style/stylesheet.js +1 -1
- package/components/ea-image/src/utils/createPreviewTools.js +1 -1
- package/components/ea-infinite-scroll/index.js +1 -1
- package/components/ea-input/index.js +1 -1
- package/components/ea-input/src/components/createSuggestionBoard.js +1 -1
- package/components/ea-input/src/components/createWordLimitElement.js +1 -1
- package/components/ea-input/src/style/stylesheet.js +1 -1
- package/components/ea-link/index.js +1 -1
- package/components/ea-radio/index.js +1 -1
- package/components/ea-radio-group/index.js +1 -1
- package/package.json +1 -1
- package/.github/workflows/publish.yml +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-icon/index.js";import{ButtonComm}from"./src/components/ButtonComm.js";import{HrefComm}from"./src/components/HrefComm.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaButton extends Base{#t="button";#e;constructor(){super();const t=this.attachShadow({mode:"open"});this.getAttribute("href")?(t.innerHTML=HrefComm,this.#t="a"):(t.innerHTML=ButtonComm,this.#t="button"),this.#e=t.querySelector(".ea-button"),this.build(t,stylesheet)}get BUTTON_STYLE(){return["plain","round"]}get BUTTON_TYPE(){return["normal","primary","success","warning","danger","text"]}get BUTTON_SIZE(){return["medium","small","mini"]}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),this.#e.classList.toggle("disabled",t)}get plain(){return this.getAttrBoolean("plain")}set plain(t){this.toggleAttr("plain",t),this.#e.classList.toggle("plain",t)}get round(){return this.getAttrBoolean("round")}set round(t){this.toggleAttr("round",t),this.#e.classList.toggle("round",t)}get type(){const t=this.getAttribute("type");return this.BUTTON_TYPE.includes(t)?t:"normal"}set type(t){this.setAttribute("type",t),this.#e.classList.add(t)}get size(){const t=this.getAttribute("size");return this.BUTTON_SIZE.includes(t)?t:"medium"}set size(t){this.toggleAttr("size",t),this.#e.classList.add(t)}get loading(){return this.getAttrBoolean("loading")}set loading(t){if(this.toggleAttr("loading",t),this.disabled=t,t){const t=document.createElement("ea-icon");t.id="ea-loading-icon",t.icon="icon-spin6 animate-spin",this.#e.insertBefore(t,this.#e.firstChild)}else{const t=this.#e?.querySelectorAll("#ea-loading-icon");t?.length>0&&t?.forEach((t=>t.remove()))}}get icon(){return this.getAttribute("icon")||""}set icon(t){if(this.setAttribute("icon",t),t&&!this.#e.querySelector("ea-icon")){const e=document.createElement("ea-icon");e.icon=t,e.part="icon",this.#e.insertBefore(e,this.#e.firstChild)}}get href(){return this.getAttribute("href")||""}set href(t){"button"!==this.#t&&(this.setAttribute("href",t),this.#e.setAttribute("href",t))}connectedCallback(){this.plain=this.plain,this.round=this.round,this.type=this.type,this.size=this.size,this.icon=this.icon,this.disabled=this.disabled,this.href=this.href,this.loading&&(this.loading=this.loading)}}window.customElements.get("ea-button")||window.customElements.define("ea-button",EaButton);
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import{ButtonComm}from"./src/components/ButtonComm.js";import{HrefComm}from"./src/components/HrefComm.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaButton extends Base{#t="button";#e;constructor(){super();const t=this.attachShadow({mode:"open"});this.getAttribute("href")?(t.innerHTML=HrefComm,this.#t="a"):(t.innerHTML=ButtonComm,this.#t="button"),this.#e=t.querySelector(".ea-button"),this.build(t,stylesheet)}get BUTTON_STYLE(){return["plain","round"]}get BUTTON_TYPE(){return["normal","primary","success","warning","danger","text"]}get BUTTON_SIZE(){return["medium","small","mini"]}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),this.#e.classList.toggle("disabled",t),this.style.cursor=t?"not-allowed":"pointer",t&&this.#e.setAttribute("disabled",t)}get plain(){return this.getAttrBoolean("plain")}set plain(t){this.toggleAttr("plain",t),this.#e.classList.toggle("plain",t)}get round(){return this.getAttrBoolean("round")}set round(t){this.toggleAttr("round",t),this.#e.classList.toggle("round",t)}get type(){const t=this.getAttribute("type");return this.BUTTON_TYPE.includes(t)?t:"normal"}set type(t){this.setAttribute("type",t),this.#e.classList.add(t)}get size(){const t=this.getAttribute("size");return this.BUTTON_SIZE.includes(t)?t:"medium"}set size(t){this.toggleAttr("size",t),this.#e.classList.add(t)}get loading(){return this.getAttrBoolean("loading")}set loading(t){if(this.toggleAttr("loading",t),this.disabled=t,t){const t=document.createElement("ea-icon");t.id="ea-loading-icon",t.icon="icon-spin6 animate-spin",this.#e.insertBefore(t,this.#e.firstChild)}else{const t=this.#e?.querySelectorAll("#ea-loading-icon");t?.length>0&&t?.forEach((t=>t.remove()))}}get icon(){return this.getAttribute("icon")||""}set icon(t){if(this.setAttribute("icon",t),t&&!this.#e.querySelector("ea-icon")){const e=document.createElement("ea-icon");e.icon=t,e.part="icon",this.#e.insertBefore(e,this.#e.firstChild)}}get href(){return this.getAttribute("href")||""}set href(t){"button"!==this.#t&&(this.setAttribute("href",t),this.#e.setAttribute("href",t))}connectedCallback(){this.plain=this.plain,this.round=this.round,this.type=this.type,this.size=this.size,this.icon=this.icon,this.disabled=this.disabled,this.href=this.href,this.loading&&(this.loading=this.loading)}}window.customElements.get("ea-button")||window.customElements.define("ea-button",EaButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const stylesheet="\n:host {\n --border-radius: 6px;\n}\n\n.ea-button {\n box-sizing: border-box;\n padding: 0.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n font-size: 1rem;\n line-height: 1.25;\n font-weight: 500;\n transition: background-color 0.1s, color 0.1s;\n text-decoration: none;\n will-change: width;\n}\n.ea-button.normal {\n border: 1px solid #dcdfe6;\n color: #606266;\n background-color: transparent;\n}\n.ea-button.normal.disabled {\n background-color: rgba(64, 64, 64, 0) !important;\n border-color: white !important;\n color: white !important;\n pointer-events: none;\n border-color: #ebedf1 !important;\n color: #babcbe !important;\n}\n.ea-button.normal.plain {\n background-color: rgba(92, 92, 92, 0);\n border-color: white;\n color: transparent;\n background-color: transparent;\n color: #606266;\n border-color: #dcdfe6;\n}\n.ea-button.normal.plain:hover {\n background-color: transparent;\n}\n.ea-button.normal:hover {\n border-color: rgba(160, 207, 255, 0.4);\n color: #3a9bff;\n background-color: rgba(160, 207, 255, 0.05);\n}\n.ea-button.normal:active {\n background-color: rgba(7, 130, 255, 0.05);\n}\n.ea-button.primary {\n border: 1px solid #409eff;\n color: #fff;\n background-color: #409eff;\n}\n.ea-button.primary.disabled {\n background-color: #c0dfff !important;\n border-color: #c0dfff !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.primary.plain {\n background-color: #f8fbff;\n border-color: #c0dfff;\n color: #409eff;\n}\n.ea-button.primary:hover {\n border-color: #73b8ff;\n color: white;\n background-color: #73b8ff;\n}\n.ea-button.primary:active {\n background-color: #006bd9;\n}\n.ea-button.success {\n border: 1px solid #67c23a;\n color: #fff;\n background-color: #67c23a;\n}\n.ea-button.success.disabled {\n background-color: #b2e19b !important;\n border-color: #b2e19b !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.success.plain {\n background-color: #d3eec6;\n border-color: #b2e19b;\n color: #67c23a;\n}\n.ea-button.success:hover {\n border-color: #85cf60;\n color: white;\n background-color: #85cf60;\n}\n.ea-button.success:active {\n background-color: #3d7323;\n}\n.ea-button.info {\n border: 1px solid #909399;\n color: #fff;\n background-color: #909399;\n}\n.ea-button.info.disabled {\n background-color: #d2d4d6 !important;\n border-color: #d2d4d6 !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.info.plain {\n background-color: #f0f0f1;\n border-color: #d2d4d6;\n color: #909399;\n}\n.ea-button.info:hover {\n border-color: #abadb1;\n color: white;\n background-color: #abadb1;\n}\n.ea-button.info:active {\n background-color: #5d6066;\n}\n.ea-button.warning {\n border: 1px solid #e6a23c;\n color: #fff;\n background-color: #e6a23c;\n}\n.ea-button.warning.disabled {\n background-color: #f4d8ad !important;\n border-color: #f4d8ad !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.warning.plain {\n background-color: #fbf0df;\n border-color: #f4d8ad;\n color: #e6a23c;\n}\n.ea-button.warning:hover {\n border-color: #ecb869;\n color: white;\n background-color: #ecb869;\n}\n.ea-button.warning:active {\n background-color: #a76d15;\n}\n.ea-button.danger {\n border: 1px solid #f56c6c;\n color: #fff;\n background-color: #f56c6c;\n}\n.ea-button.danger.disabled {\n background-color: #fde3e3 !important;\n border-color: #fde3e3 !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.danger.plain {\n background-color: white;\n border-color: #fde3e3;\n color: #f56c6c;\n background-color: #fde8e8;\n}\n.ea-button.danger:hover {\n border-color: #f89c9c;\n color: white;\n background-color: #f89c9c;\n}\n.ea-button.danger:active {\n background-color: #eb1010;\n}\n.ea-button.text {\n border: 1px solid transparent;\n color: #409eff;\n background-color: transparent;\n}\n.ea-button.text.disabled {\n background-color: rgba(64, 64, 64, 0) !important;\n border-color: rgba(64, 64, 64, 0) !important;\n color: white !important;\n pointer-events: none;\n color: #c0c4cc !important;\n}\n.ea-button.text.plain {\n background-color: rgba(92, 92, 92, 0);\n border-color: rgba(64, 64, 64, 0);\n color: transparent;\n}\n.ea-button.text:hover {\n border-color: rgba(26, 26, 26, 0);\n color: #73b8ff;\n background-color: rgba(26, 26, 26, 0);\n}\n.ea-button.text:active {\n background-color: rgba(0, 0, 0, 0);\n}\n.ea-button.round {\n border-radius:
|
|
1
|
+
export const stylesheet="\n:host {\n --border-radius: 6px;\n}\n\n.ea-button {\n box-sizing: border-box;\n padding: 0.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n font-size: 1rem;\n line-height: 1.25;\n font-weight: 500;\n transition: background-color 0.1s, color 0.1s;\n text-decoration: none;\n will-change: width;\n}\n.ea-button.normal {\n border: 1px solid #dcdfe6;\n color: #606266;\n background-color: transparent;\n}\n.ea-button.normal.disabled {\n background-color: rgba(64, 64, 64, 0) !important;\n border-color: white !important;\n color: white !important;\n pointer-events: none;\n border-color: #ebedf1 !important;\n color: #babcbe !important;\n}\n.ea-button.normal.plain {\n background-color: rgba(92, 92, 92, 0);\n border-color: white;\n color: transparent;\n background-color: transparent;\n color: #606266;\n border-color: #dcdfe6;\n}\n.ea-button.normal.plain:hover {\n background-color: transparent;\n}\n.ea-button.normal:hover {\n border-color: rgba(160, 207, 255, 0.4);\n color: #3a9bff;\n background-color: rgba(160, 207, 255, 0.05);\n}\n.ea-button.normal:active {\n background-color: rgba(7, 130, 255, 0.05);\n}\n.ea-button.primary {\n border: 1px solid #409eff;\n color: #fff;\n background-color: #409eff;\n}\n.ea-button.primary.disabled {\n background-color: #c0dfff !important;\n border-color: #c0dfff !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.primary.plain {\n background-color: #f8fbff;\n border-color: #c0dfff;\n color: #409eff;\n}\n.ea-button.primary:hover {\n border-color: #73b8ff;\n color: white;\n background-color: #73b8ff;\n}\n.ea-button.primary:active {\n background-color: #006bd9;\n}\n.ea-button.success {\n border: 1px solid #67c23a;\n color: #fff;\n background-color: #67c23a;\n}\n.ea-button.success.disabled {\n background-color: #b2e19b !important;\n border-color: #b2e19b !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.success.plain {\n background-color: #d3eec6;\n border-color: #b2e19b;\n color: #67c23a;\n}\n.ea-button.success:hover {\n border-color: #85cf60;\n color: white;\n background-color: #85cf60;\n}\n.ea-button.success:active {\n background-color: #3d7323;\n}\n.ea-button.info {\n border: 1px solid #909399;\n color: #fff;\n background-color: #909399;\n}\n.ea-button.info.disabled {\n background-color: #d2d4d6 !important;\n border-color: #d2d4d6 !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.info.plain {\n background-color: #f0f0f1;\n border-color: #d2d4d6;\n color: #909399;\n}\n.ea-button.info:hover {\n border-color: #abadb1;\n color: white;\n background-color: #abadb1;\n}\n.ea-button.info:active {\n background-color: #5d6066;\n}\n.ea-button.warning {\n border: 1px solid #e6a23c;\n color: #fff;\n background-color: #e6a23c;\n}\n.ea-button.warning.disabled {\n background-color: #f4d8ad !important;\n border-color: #f4d8ad !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.warning.plain {\n background-color: #fbf0df;\n border-color: #f4d8ad;\n color: #e6a23c;\n}\n.ea-button.warning:hover {\n border-color: #ecb869;\n color: white;\n background-color: #ecb869;\n}\n.ea-button.warning:active {\n background-color: #a76d15;\n}\n.ea-button.danger {\n border: 1px solid #f56c6c;\n color: #fff;\n background-color: #f56c6c;\n}\n.ea-button.danger.disabled {\n background-color: #fde3e3 !important;\n border-color: #fde3e3 !important;\n color: white !important;\n pointer-events: none;\n}\n.ea-button.danger.plain {\n background-color: white;\n border-color: #fde3e3;\n color: #f56c6c;\n background-color: #fde8e8;\n}\n.ea-button.danger:hover {\n border-color: #f89c9c;\n color: white;\n background-color: #f89c9c;\n}\n.ea-button.danger:active {\n background-color: #eb1010;\n}\n.ea-button.text {\n border: 1px solid transparent;\n color: #409eff;\n background-color: transparent;\n}\n.ea-button.text.disabled {\n background-color: rgba(64, 64, 64, 0) !important;\n border-color: rgba(64, 64, 64, 0) !important;\n color: white !important;\n pointer-events: none;\n color: #c0c4cc !important;\n}\n.ea-button.text.plain {\n background-color: rgba(92, 92, 92, 0);\n border-color: rgba(64, 64, 64, 0);\n color: transparent;\n}\n.ea-button.text:hover {\n border-color: rgba(26, 26, 26, 0);\n color: #73b8ff;\n background-color: rgba(26, 26, 26, 0);\n}\n.ea-button.text:active {\n background-color: rgba(0, 0, 0, 0);\n}\n.ea-button.round {\n border-radius: 999px;\n}\n.ea-button.medium {\n font-size: 14px;\n}\n.ea-button.small {\n font-size: 12px;\n}\n.ea-button.mini {\n font-size: 10px;\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaCheckbox extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <label class="ea-checkbox_wrap" part="container">\n <input type="checkbox" class="ea-checkbox-input_input"/>\n <span class="ea-checkbox-input_wrap" part="input-container">\n <span class="ea-checkbox-input_inner" part="input"></span>\n </span>\n <span class="ea-checkbox-label_desc" part="label-container">\n <slot></slot>\n </span>\n </label>\n ',this.#t=e.querySelector(".ea-checkbox_wrap"),this.#e=e.querySelector(".ea-checkbox-input_input"),this.build(e,stylesheet)}get checked(){return this.getAttrBoolean("checked")}set checked(e){this.setAttribute("checked",e),this.#e.checked=e}get name(){return this.getAttribute("name")||""}set name(e){this.#e.setAttribute("name",e)}get value(){return this.getAttribute("value")}set value(e){this.#t.setAttribute("for",e),this.#e.setAttribute("id",e),this.#e.setAttribute("value",e)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){this.setAttribute("disabled",e),this.#e.disabled=e}get border(){return this.getAttrBoolean("border")}set border(e){this.#t.classList.toggle("border",e)}get indeterminate(){return this.getAttrBoolean("indeterminate")}set indeterminate(e){this.setAttribute("indeterminate",e),this.#e.setAttribute("indeterminate",e),e&&(this.checked=!1,this.#t.classList.remove("checked"),this.setAttribute("indeterminate",!0),this.#e.setAttribute("indeterminate",!0))}connectedCallback(){this.checked=this.checked,this.name=this.name,this.value=this.value,this.disabled=this.disabled,this.border=this.border,this.indeterminate=this.indeterminate,this.#e.addEventListener("change",(e=>{e.preventDefault(),this.indeterminate=!1,this.checked=e.target.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{checked:this.checked,value:this.value,name:this.name}}))}))}}window.customElements.get("ea-checkbox")||window.customElements.define("ea-checkbox",EaCheckbox);
|
|
1
|
+
import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaCheckbox extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <label class="ea-checkbox_wrap" part="container">\n <input type="checkbox" class="ea-checkbox-input_input"/>\n <span class="ea-checkbox-input_wrap" part="input-container">\n <span class="ea-checkbox-input_inner" part="input"></span>\n </span>\n <span class="ea-checkbox-label_desc" part="label-container">\n <slot></slot>\n </span>\n </label>\n ',this.#t=e.querySelector(".ea-checkbox_wrap"),this.#e=e.querySelector(".ea-checkbox-input_input"),this.build(e,stylesheet)}get checked(){return this.getAttrBoolean("checked")}set checked(e){this.setAttribute("checked",e),this.#e.checked=e}get name(){return this.getAttribute("name")||""}set name(e){this.setAttribute("name",e),this.#e.setAttribute("name",e)}get value(){return this.getAttribute("value")}set value(e){this.setAttribute("value",e),this.#t.setAttribute("for",e),this.#e.setAttribute("id",e),this.#e.setAttribute("value",e)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){this.setAttribute("disabled",e),this.#e.disabled=e}get border(){return this.getAttrBoolean("border")}set border(e){this.#t.classList.toggle("border",e)}get indeterminate(){return this.getAttrBoolean("indeterminate")}set indeterminate(e){this.setAttribute("indeterminate",e),this.#e.setAttribute("indeterminate",e),e&&(this.checked=!1,this.#t.classList.remove("checked"),this.setAttribute("indeterminate",!0),this.#e.setAttribute("indeterminate",!0))}connectedCallback(){this.checked=this.checked,this.name=this.name,this.value=this.value,this.disabled=this.disabled,this.border=this.border,this.indeterminate=this.indeterminate,this.#e.addEventListener("change",(e=>{e.preventDefault(),this.indeterminate=!1,this.checked=e.target.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{checked:this.checked,value:this.value,name:this.name}}))}))}}window.customElements.get("ea-checkbox")||window.customElements.define("ea-checkbox",EaCheckbox);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{timeout}from"../../utils/timeout.js";import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaCheckboxGroup extends Base{#e=!1;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-checkbox-group_wrap" part="container">\n <slot></slot>\n </div>\n ',this.build(e,stylesheet)}get name(){return this.getAttribute("name")||"ea-checkbox"}set name(e){this.querySelectorAll("ea-checkbox").forEach((t=>{t.setAttribute("name",e),t.name=e}))}get value(){return this.getAttribute("value")||""}set value(e){this.setAttribute("value",e);try{const t=e.split(",").map((e=>e.trimStart()));t.map((e=>{this.querySelector(`ea-checkbox[value="${e}"]`).checked="true"})),this.dispatchEvent(new CustomEvent("change",{detail:t}))}catch(e){}}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){if(!e&&!this.#e)return;this.querySelectorAll("ea-checkbox").forEach((t=>{t.disabled=e}))}#t(e){let t=[];Array.from(e).filter((e=>!!e.checked&&t.push(e.value))),this.value=t.join(",")}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,
|
|
1
|
+
import{timeout}from"../../utils/timeout.js";import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaCheckboxGroup extends Base{#e=!1;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-checkbox-group_wrap" part="container">\n <slot></slot>\n </div>\n ',this.build(e,stylesheet)}get name(){return this.getAttribute("name")||"ea-checkbox"}set name(e){this.setAttribute("name",e),this.querySelectorAll("ea-checkbox").forEach((t=>{t.setAttribute("name",e),t.name=e}))}get value(){return this.getAttribute("value")||""}set value(e){this.setAttribute("value",e);try{const t=e.split(",").map((e=>e.trimStart()));t.map((e=>{this.querySelector(`ea-checkbox[value="${e}"]`).checked="true"})),this.dispatchEvent(new CustomEvent("change",{detail:t}))}catch(e){}}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){if(!e&&!this.#e)return;this.querySelectorAll("ea-checkbox").forEach((t=>{t.disabled=e}))}#t(e){let t=[];Array.from(e).filter((e=>!!e.checked&&t.push(e.value))),this.value=t.join(",")}connectedCallback(){this.setAttribute("data-ea-component",!0),setTimeout((()=>{this.name=this.name,this.value=this.value,this.disabled=this.disabled;const e=this.querySelectorAll("ea-checkbox");e.forEach((t=>{t.addEventListener("change",(t=>{this.#t(e)}))})),this.#t(e),this.#e=!0}),50)}}window.customElements.get("ea-checkbox-group")||window.customElements.define("ea-checkbox-group",EaCheckboxGroup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-descriptions-item/index.js";import{getThTemplate_direction}from"./src/components/getThTemplate_direction.js";import{getTdTemplate_direction}from"./src/components/getTdTemplate_direction.js";import{contentTemplate}from"./src/components/contentTemplate.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaDescriptions extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-descriptions_wrap" part="container">\n <div class="ea-descriptions_header" part="header-wrap"></div>\n <div class="ea-descriptions_body" part="body-wrap">\n <table class="ea-descriptions_table" part="table-wrap"></table>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-descriptions_table"),this.#e=t.querySelector(".ea-descriptions_header"),this.build(t,stylesheet)}get title(){return this.getAttribute("title")||""}set title(t){this.setAttribute("title",t),this.#e.innerHTML=t}get col(){return this.getAttrNumber("col")||3}set col(t){this.setAttribute("col",t)}get border(){return this.getAttrBoolean("border")}set border(t){this.toggleAttr("border",t)}get direction(){return this.getAttribute("direction")||"horizontal"}set direction(t){this.setAttribute("direction",t)}#i(t){const e=Number(t.length);for(let i=0;i<e;i+=3){let e=0;const r=document.createElement("tbody");switch(this.direction){case"horizontal":{const s=document.createElement("tr");for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=contentTemplate(t[r],i,this.border)}r.appendChild(s);break}case"vertical":{const s=document.createElement("tr"),o=document.createElement("tr");for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=getThTemplate_direction(t[r].getAttribute("label"),this.border),o.innerHTML+=getTdTemplate_direction(t[r].innerHTML,this.border,i)}r.appendChild(s),r.appendChild(o);break}}this.#t.appendChild(r)}t.forEach((t=>{t.remove()}))}connectedCallback(){this.title=this.title,this.col=this.col,this.border=this.border,this.direction=this.direction;const t=this.querySelectorAll("ea-descriptions-item");this.#i(t)}}customElements.get("ea-descriptions")||customElements.define("ea-descriptions",EaDescriptions);
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-descriptions-item/index.js";import{getThTemplate_direction}from"./src/components/getThTemplate_direction.js";import{getTdTemplate_direction}from"./src/components/getTdTemplate_direction.js";import{contentTemplate}from"./src/components/contentTemplate.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaDescriptions extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-descriptions_wrap" part="container">\n <div class="ea-descriptions_header" part="header-wrap"></div>\n <div class="ea-descriptions_body" part="body-wrap">\n <table class="ea-descriptions_table" part="table-wrap"></table>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-descriptions_table"),this.#e=t.querySelector(".ea-descriptions_header"),this.build(t,stylesheet)}get title(){return this.getAttribute("title")||""}set title(t){this.setAttribute("title",t),this.#e.innerHTML=t}get col(){return this.getAttrNumber("col")||3}set col(t){this.setAttribute("col",t)}get border(){return this.getAttrBoolean("border")}set border(t){this.toggleAttr("border",t)}get direction(){return this.getAttribute("direction")||"horizontal"}set direction(t){this.setAttribute("direction",t)}#i(t){const e=Number(t.length);for(let i=0;i<e;i+=3){let e=0;const r=document.createElement("tbody");switch(r.part="table-tbody",this.direction){case"horizontal":{const s=document.createElement("tr");s.part="table-tr";for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=contentTemplate(t[r],i,this.border)}r.appendChild(s);break}case"vertical":{const s=document.createElement("tr"),o=document.createElement("tr");s.part="table-tr",o.part="table-tr";for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=getThTemplate_direction(t[r].getAttribute("label"),this.border),o.innerHTML+=getTdTemplate_direction(t[r].innerHTML,this.border,i)}r.appendChild(s),r.appendChild(o);break}}this.#t.appendChild(r)}t.forEach((t=>{t.remove()})),this.shadowRoot?.querySelectorAll("[slot]").forEach((t=>{t.remove()}))}#r(){const t=this.shadowRoot?.querySelector("ea-icon");t&&(this.shadowRoot.innerHTML+=`\n <link rel="stylesheet" href="${new URL("../ea-icon/index.css",import.meta.url).href}">\n `)}connectedCallback(){this.title=this.title,this.col=this.col,this.border=this.border,this.direction=this.direction;const t=this.querySelectorAll("ea-descriptions-item");this.#i(t),this.#r()}}customElements.get("ea-descriptions")||customElements.define("ea-descriptions",EaDescriptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getTdTemplate_border=(e,t,s)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell is-border" colspan="1">${e}</th>\n <td class="ea-descriptions-item_content ea-descriptions-item_cell is-border" colspan="${s}">${t}</td>\n `;
|
|
1
|
+
export const getTdTemplate_border=(e,t,s)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell is-border" colspan="1" part="table-th">${e}</th>\n <td class="ea-descriptions-item_content ea-descriptions-item_cell is-border" colspan="${s}" part="table-td">${t}</td>\n `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getTdTemplate_direction=(e,
|
|
1
|
+
export const getTdTemplate_direction=(t,e,n)=>`\n <td class="ea-descriptions-item_content ea-descriptions-item_cell ${e?"is-border":""}" colspan="${n}" part="table-td">\n ${t}\n </td>\n `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getThTemplate_direction=(e,t)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell ${t?"is-border":""}" colspan="1">\n ${e}${t?"":":"}\n </th>\n `;
|
|
1
|
+
export const getThTemplate_direction=(e,t)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell ${t?"is-border":""}" colspan="1" part="table-th">\n ${e}${t?"":":"}\n </th>\n `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getThTemplate_normal=(
|
|
1
|
+
export const getThTemplate_normal=(t,a,e)=>`\n <td class="ea-descriptions-item" colspan="${e}" part="table-td">\n <span class="ea-descriptions-item_label" part="table-td-label">${t}:</span>\n <span class="ea-descriptions-item_content" part="table-td-content">${a}</span>\n </td>\n `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import{stylesheet}from"./src/stylesheet.js";export class EaDescriptionsItem extends Base{#e;#t;#s;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <td class="ea-descriptions-item_wrap" part="container">\n <span class="ea-descriptions-item_label" part="label-wrap">\n <slot slot="label"></slot>\n </span>\n <span class="ea-descriptions-item_content" part="content-wrap">\n <slot></slot>\n </span>\n </td>\n ',this.#e=e.querySelector(".ea-descriptions-item_wrap"),this.#t=e.querySelector(".ea-descriptions-item_label"),this.#s=e.querySelector('slot[name="label"]'),this.build(e,stylesheet)}get label(){return this.getAttribute("label")||""}set label(e){this.setAttribute("label",e),this.#t.innerHTML=e}get span(){return this.getAttrNumber("span")||1}set span(e){this.setAttribute("span",e)}connectedCallback(){this.label=this.label,this.span=this.span}}customElements.get("ea-descriptions-item")||customElements.define("ea-descriptions-item",EaDescriptionsItem);
|
|
1
|
+
import Base from"../Base.js";import{stylesheet}from"./src/stylesheet.js";export class EaDescriptionsItem extends Base{#e;#t;#s;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <td class="ea-descriptions-item_wrap" part="container">\n <span class="ea-descriptions-item_label" part="label-wrap">\n <slot slot="label"></slot>\n </span>\n <span class="ea-descriptions-item_content" part="content-wrap">\n <slot></slot>\n </span>\n </td>\n ',this.#e=e.querySelector(".ea-descriptions-item_wrap"),this.#t=e.querySelector(".ea-descriptions-item_label"),this.#s=e.querySelector('slot[name="label"]'),this.build(e,stylesheet)}get label(){return this.getAttribute("label")||""}set label(e){e&&(this.setAttribute("label",e),this.#t.innerHTML=e)}get span(){return this.getAttrNumber("span")||1}set span(e){this.setAttribute("span",e)}connectedCallback(){this.label=this.label,this.span=this.span}}customElements.get("ea-descriptions-item")||customElements.define("ea-descriptions-item",EaDescriptionsItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-icon/index.js";import{Validator}from"../../utils/Validator.js";import"../ea-form-item/index.js";import"../ea-button/index.js";export class EaForm extends Base{#e;constructor(){super();this.attachShadow({mode:"open"}).innerHTML="\n <form class='ea-form_wrap' part='container'>\n <slot></slot>\n </form>\n "}get data(){const e={};return this.querySelectorAll("[data-ea-component]").forEach((t=>{e[t.name]=t.value})),e}get rules(){return this.#e||{}}set rules(e){this.#e=e;const t=this.querySelectorAll("ea-form-item");this.querySelectorAll("[data-ea-component]").forEach(((r,a)=>{t[a].rule=e[r.name],t[a].validateEvent(),t[a].isRequired=!!e[r.name]?.required}))}validate(){const e=this.querySelectorAll("ea-form-item"),t=this.querySelectorAll("[data-ea-component]");let r=[];return t.forEach(((t,a)=>{if(this.#e[t.name])for(const o in e[a].rule)if(Validator[o]){if(!Validator[o](t.value,e[a].rule[o])){e[a].isInvalid=!0,t.isInvalid=!0,r.push(t.name);break}e[a].isInvalid=!1,t.isInvalid=!1}})),new Promise(((e,t)=>{r.length>0?t(r):e(!0)}))}reset(){const e=this.querySelectorAll("ea-form-item");this.querySelectorAll("[data-ea-component]").forEach(((t,r)=>{t.value="",t.isInvalid=!1,e[r].isInvalid=!1}))}connectedCallback(){const e=this.querySelectorAll("ea-form-item"),t=Array.from(e).map((e=>e.label.length)),r=Math.max(...t);e.forEach((e=>{e.shadowRoot.querySelector(".ea-form-item_label-wrap").style.width=20*r+"px"}))}}customElements.get("ea-form")||customElements.define("ea-form",EaForm);
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import{Validator}from"../../utils/Validator.js";import{timeout}from"../../utils/timeout.js";import"../ea-form-item/index.js";import"../ea-button/index.js";export class EaForm extends Base{#e;constructor(){super();this.attachShadow({mode:"open"}).innerHTML="\n <form class='ea-form_wrap' part='container'>\n <slot></slot>\n </form>\n "}get data(){const e={};return this.querySelectorAll("[data-ea-component]").forEach((t=>{e[t.name]=t.value})),e}get rules(){return this.#e||{}}set rules(e){this.#e=e;const t=this.querySelectorAll("ea-form-item");this.querySelectorAll("[data-ea-component]").forEach(((r,a)=>{t[a].rule=e[r.name],t[a].validateEvent(),t[a].isRequired=!!e[r.name]?.required}))}validate(){const e=this.querySelectorAll("ea-form-item"),t=this.querySelectorAll("[data-ea-component]");let r=[];return t.forEach(((t,a)=>{if(this.#e[t.name])for(const o in e[a].rule)if(Validator[o]){if(!Validator[o](t.value,e[a].rule[o])){e[a].isInvalid=!0,t.isInvalid=!0,r.push(t.name);break}e[a].isInvalid=!1,t.isInvalid=!1}})),new Promise(((e,t)=>{r.length>0?t(r):e(!0)}))}reset(){const e=this.querySelectorAll("ea-form-item");this.querySelectorAll("[data-ea-component]").forEach(((t,r)=>{t.value="",t.isInvalid=!1,e[r].isInvalid=!1}))}connectedCallback(){timeout((()=>{const e=this.querySelectorAll("ea-form-item"),t=Array.from(e).map((e=>e.label.length)),r=Math.max(...t);e.forEach((e=>{const t=e.shadowRoot.querySelector(".ea-form-item_label-wrap");t&&(t.style.width=20*r+"px")})),this.dispatchEvent(new CustomEvent("ready",{bubbles:!0}))}),50)}}customElements.get("ea-form")||customElements.define("ea-form",EaForm);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const stylesheet='\n.ea-form-item_wrap {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n margin-bottom: 22px;\n}\n.ea-form-item_wrap .ea-form-item_label-wrap {\n text-align: right;\n float: left;\n font-size: 14px;\n color: #606266;\n line-height: 40px;\n padding: 0 12px 0 0;\n box-sizing: border-box;\n}\n.ea-form-item_wrap .ea-form-item_content-wrap {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.ea-form-item_wrap .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n position: absolute;\n bottom: 0;\n left: 0;\n transform-origin: top center;\n transform: translateY(100%) scaleY(0);\n font-size: 12px;\n color: #f56c6c;\n white-space: nowrap;\n}\n.ea-form-item_wrap.is-required-star .ea-form-item_label-wrap::before {\n content: "*";\n color: #f56c6c;\n margin-right: 4px;\n}\n.ea-form-item_wrap.is-required .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n transform: translateY(100%) scaleY(1);\n}\n.ea-form-item_wrap.with-transition .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n transition: transform 0.3s;\n}\n';
|
|
1
|
+
export const stylesheet='\n.ea-form-item_wrap {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n margin-bottom: 22px;\n}\n.ea-form-item_wrap .ea-form-item_label-wrap {\n text-align: right;\n float: left;\n font-size: 14px;\n color: #606266;\n line-height: 40px;\n padding: 0 12px 0 0;\n box-sizing: border-box;\n}\n.ea-form-item_wrap .ea-form-item_content-wrap {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.ea-form-item_wrap .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n position: absolute;\n bottom: 0;\n left: 0;\n transform-origin: top center;\n transform: translateY(100%) scaleY(0);\n font-size: 12px;\n color: #f56c6c;\n white-space: nowrap;\n}\n.ea-form-item_wrap.is-required-star .ea-form-item_label-wrap::before {\n content: "*";\n color: #f56c6c;\n margin-right: 4px;\n}\n.ea-form-item_wrap.is-required .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n transform: translateY(100%) scaleY(1);\n}\n.ea-form-item_wrap.is-required .ea-form-item_label-wrap {\n color: #f56c6c;\n}\n.ea-form-item_wrap.is-required ::slotted(ea-input),\n.ea-form-item_wrap.is-required ::slotted(ea-select),\n.ea-form-item_wrap.is-required ::slotted(ea-textarea),\n.ea-form-item_wrap.is-required ::slotted(ea-time-picker),\n.ea-form-item_wrap.is-required ::slotted(ea-date-picker) {\n border-color: #f56c6c;\n}\n.ea-form-item_wrap ::slotted(ea-input),\n.ea-form-item_wrap ::slotted(ea-select),\n.ea-form-item_wrap ::slotted(ea-textarea),\n.ea-form-item_wrap ::slotted(ea-time-picker),\n.ea-form-item_wrap ::slotted(ea-date-picker) {\n border: 1px solid transparent;\n border-radius: 3px;\n}\n.ea-form-item_wrap.with-transition .ea-form-item_content-wrap .ea-form-item_invalid-wrap {\n transition: transform 0.3s;\n}\n.ea-form-item_wrap.with-transition .ea-form-item_label-wrap {\n transition: color 0.3s;\n}\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class EaIcon extends HTMLElement{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML
|
|
1
|
+
export class EaIcon extends HTMLElement{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easy-component-ui/components/ea-icon/css/animation.css">\n <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easy-component-ui/components/ea-icon/css/fontello.css">\n <i class="ea-icon_wrap" part="container">\n <slot></slot>\n </i>\n ',this.#t=t.querySelector(".ea-icon_wrap")}get icon(){return this.getAttribute("icon")||""}set icon(t){this.setAttribute("icon",t),this.#t.className=`${t}`}get color(){return this.getAttribute("color")||""}set color(t){this.setAttribute("color",t),this.#t.style.color=t}get size(){return this.getAttribute("size")||""}set size(t){this.setAttribute("size",t),this.#t.style.fontSize=`${t}px`}connectedCallback(){this.icon=this.icon,this.color=this.color,this.size=this.size}}window.customElements.get("ea-icon")||window.customElements.define("ea-icon",EaIcon);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import{errorImage}from"./src/assets/errorImage.js";import{stylesheet}from"./src/style/stylesheet.js";import{initImagePreview}from"./src/utils/createPreviewTools.js";export class EaImage extends Base{#t;#e;#i;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-image_wrap' part='container'>\n <img part='image' class='ea-image' />\n <slot name='placeholder'></slot>\n </div>\n ",this.#t=t.querySelector(".ea-image_wrap"),this.#e=t.querySelector(".ea-image"),this.#i=t.querySelector('slot[name="placeholder"]'),this.build(t,stylesheet)}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get width(){return this.getAttribute("width")||"100px"}set width(t){this.setAttribute("width",t),this.#t.style.width=t}get height(){return this.getAttribute("height")||"100px"}set height(t){this.setAttribute("height",t),this.#t.style.height=t}get alt(){return this.getAttribute("alt")||""}set alt(t){this.setAttribute("alt",t),this.#e.alt=t}get fit(){return this.getAttribute("fit")||"cover"}set fit(t){this.setAttribute("fit",t),this.#e.style.objectFit=t}get lazy(){return this.getAttrBoolean("lazy")}set lazy(t){this.setAttribute("lazy",t)}get preview(){return this.getAttrBoolean("preview")}set preview(t){this.setAttribute("preview",t)}#s(){const t=new Image;if(this.lazy){const e=new IntersectionObserver((i=>{i[0].intersectionRatio<=0||(t.src=this.src,e.disconnect())}));e.observe(this.#t)}else t.src=this.src;t.onload=()=>{this.#e.setAttribute("src",this.src),this.#i.remove(),this.dispatchEvent(new CustomEvent("load",{detail:{src:this.src}}))},t.onerror=()=>{this.#t.innerHTML=errorImage,this.#t.classList.add("is-error"),this.#i.remove(),this.dispatchEvent(new CustomEvent("error",{detail:{src:this.src}}))}}connectedCallback(){this.width=this.width,this.height=this.height,this.fit=this.fit,this.alt=this.alt,this.lazy=this.lazy,this.src=this.src,this.preview=this.preview,initImagePreview(this.#t,this.#e,this.preview),this.#s()}}customElements.get("ea-image")||customElements.define("ea-image",EaImage);
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import{errorImage}from"./src/assets/errorImage.js";import{stylesheet}from"./src/style/stylesheet.js";import{initImagePreview}from"./src/utils/createPreviewTools.js";export class EaImage extends Base{#t;#e;#i;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-image_wrap' part='container'>\n <img part='image' class='ea-image' />\n <div class='ea-image_placeholder-wrap' part='placeholder-wrap'>\n <slot name='placeholder'></slot>\n </div>\n </div>\n ",this.#t=t.querySelector(".ea-image_wrap"),this.#e=t.querySelector(".ea-image"),this.#i=t.querySelector('slot[name="placeholder"]'),this.build(t,stylesheet)}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get width(){return this.getAttribute("width")||"100px"}set width(t){this.setAttribute("width",t),this.#t.style.width=t}get height(){return this.getAttribute("height")||"100px"}set height(t){this.setAttribute("height",t),this.#t.style.height=t}get alt(){return this.getAttribute("alt")||""}set alt(t){this.setAttribute("alt",t),this.#e.alt=t}get fit(){return this.getAttribute("fit")||"cover"}set fit(t){this.setAttribute("fit",t),this.#e.style.objectFit=t}get lazy(){return this.getAttrBoolean("lazy")}set lazy(t){t&&this.setAttribute("lazy",t)}get preview(){return this.getAttrBoolean("preview")}set preview(t){t&&this.setAttribute("preview",t)}#s(){const t=new Image;if(this.lazy){const e=new IntersectionObserver((i=>{i[0].intersectionRatio<=0||(t.src=this.src,e.disconnect())}));e.observe(this.#t)}else t.src=this.src;t.onload=()=>{this.#e.setAttribute("src",this.src),this.#i.remove(),this.dispatchEvent(new CustomEvent("load",{detail:{src:this.src}}))},t.onerror=()=>{this.#t.innerHTML=errorImage,this.#t.classList.add("is-error"),this.#i.remove(),this.dispatchEvent(new CustomEvent("error",{detail:{src:this.src}}))}}connectedCallback(){this.width=this.width,this.height=this.height,this.fit=this.fit,this.alt=this.alt,this.lazy=this.lazy,this.src=this.src,this.preview=this.preview,initImagePreview(this.#t,this.#e,this.preview),this.#s()}}customElements.get("ea-image")||customElements.define("ea-image",EaImage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const errorImage='\n <svg id="errorImage" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path fill="#c0c4cc" d="M0 0h100v100H0z" />\n <path fill="#fff" d="M15 20h70v60H15z" />\n <circle r="8" cx="32" cy="35" fill="#c0c4cc" />\n <path d="M60 42.5L39 75h42z" fill="#c0c4cc" />\n <path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />\n </svg>\n';
|
|
1
|
+
export const errorImage='\n <svg id="errorImage" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" part="error-image">\n <path fill="#c0c4cc" d="M0 0h100v100H0z" />\n <path fill="#fff" d="M15 20h70v60H15z" />\n <circle r="8" cx="32" cy="35" fill="#c0c4cc" />\n <path d="M60 42.5L39 75h42z" fill="#c0c4cc" />\n <path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />\n </svg>\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const stylesheet="\n.ea-image_wrap.is-error svg {\n width: 20px;\n height: 20px;\n}\n.ea-image_wrap img {\n position: relative;\n width: 100%;\n height: 100%;\n user-zoom: scale;\n object-fit: cover;\n transition: rotate 0.3s, scale 0.3s;\n}\n.ea-image_wrap .ea-image_preview-wrap {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 999;\n opacity: 0;\n transform: translateY(-1rem);\n transition: opacity 0.3s, transform 0.3s;\n background-color: rgba(0, 0, 0, 0.4);\n}\n.ea-image_wrap .ea-image_preview-wrap.entry {\n opacity: 1;\n transform: translateY(0);\n}\n.ea-image_wrap .ea-image_preview-wrap .ea-icon-close {\n position: absolute;\n right: 40px;\n top: 40px;\n cursor: pointer;\n width: 40px;\n height: 40px;\n font-size: 24px;\n line-height: 36px;\n border-radius: 50%;\n color: #fff;\n background-color: #606266;\n text-align: center;\n}\n.ea-image_wrap .ea-image_preview-wrap img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n.ea-image_wrap .ea-image_preview-tools {\n display: flex;\n align-items: center;\n justify-content: space-around;\n position: absolute;\n bottom: 20px;\n left: 50%;\n padding: 0.5rem 1rem;\n user-select: none;\n border-radius: 999px;\n transform: translateX(-50%);\n background-color: rgba(96, 98, 102, 0.568627451);\n color: #fff;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom,\n.ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {\n width: 2rem;\n text-align: center;\n cursor: pointer;\n margin: 0 1rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom {\n font-size: 2rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom-in {\n font-size: 1.75rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {\n font-size: 1.5rem;\n}\n";
|
|
1
|
+
export const stylesheet="\n.ea-image_wrap {\n align-content: center;\n text-align: center;\n}\n.ea-image_wrap.is-error {\n background-color: #f5f7fa;\n}\n.ea-image_wrap.is-error svg {\n width: 20px;\n height: 20px;\n}\n.ea-image_wrap img {\n position: relative;\n width: 100%;\n height: 100%;\n user-zoom: scale;\n object-fit: cover;\n transition: rotate 0.3s, scale 0.3s;\n}\n.ea-image_wrap .ea-image_preview-wrap {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 999;\n opacity: 0;\n transform: translateY(-1rem);\n transition: opacity 0.3s, transform 0.3s;\n background-color: rgba(0, 0, 0, 0.4);\n}\n.ea-image_wrap .ea-image_preview-wrap.entry {\n opacity: 1;\n transform: translateY(0);\n}\n.ea-image_wrap .ea-image_preview-wrap .ea-icon-close {\n position: absolute;\n right: 40px;\n top: 40px;\n cursor: pointer;\n width: 40px;\n height: 40px;\n font-size: 24px;\n line-height: 36px;\n border-radius: 50%;\n color: #fff;\n background-color: #606266;\n text-align: center;\n}\n.ea-image_wrap .ea-image_preview-wrap img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n.ea-image_wrap .ea-image_preview-tools {\n display: flex;\n align-items: center;\n justify-content: space-around;\n position: absolute;\n bottom: 20px;\n left: 50%;\n padding: 0.5rem 1rem;\n user-select: none;\n border-radius: 999px;\n transform: translateX(-50%);\n background-color: rgba(96, 98, 102, 0.568627451);\n color: #fff;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom,\n.ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {\n width: 2rem;\n text-align: center;\n cursor: pointer;\n margin: 0 1rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom {\n font-size: 2rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-zoom-in {\n font-size: 1.75rem;\n}\n.ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {\n font-size: 1.5rem;\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement}from"../../../../utils/createElement.js";function handlePreviewDisplay(e){e.classList.remove("entry"),e.addEventListener("transitionend",(()=>{e.remove(),document.body.style.overflow="auto"}))}function createCloseBtn(e){const t=createElement("
|
|
1
|
+
import{createElement}from"../../../../utils/createElement.js";function handlePreviewDisplay(e){e.classList.remove("entry"),e.addEventListener("transitionend",(()=>{e.remove(),document.body.style.overflow="auto"}))}function createCloseBtn(e){const t=createElement("ea-icon","ea-icon-close");return t.part="close-btn",t.icon="icon-cancel",t.addEventListener("click",(()=>{handlePreviewDisplay(e)})),t}function handleImageDrag(e,t){let n=0,a=0;function o(e){const{clientX:o,clientY:r}=e;t.style.marginLeft=o-n+"px",t.style.marginTop=r-a+"px"}t.addEventListener("dragstart",(e=>{e.preventDefault()})),t.addEventListener("mousedown",(e=>{n=e.clientX,a=e.clientY,t.addEventListener("mousemove",o),t.addEventListener("mouseup",(()=>{t.removeEventListener("mousemove",o)}))}))}function createPreviewTools(e){const t=createElement("div","ea-image_preview-tools");t.part="tools-wrap",t.innerHTML='\n <span class="ea-icon-zoom ea-icon-zoom-in" part="zoom-in">+</span>\n <span class="ea-icon-zoom ea-icon-zoom-out" part="zoom-out">-</span>\n <span class="ea-icon-rotate ea-icon-rotate-left" part="rotate-left">↺</span>\n <span class="ea-icon-rotate ea-icon-rotate-right" part="rotate-righ">↻</span>\n ';t.querySelector(".ea-icon-zoom-in").addEventListener("click",(()=>{e.style.scale=e.style.scale?Number(e.style.scale)+.2:1.2}));t.querySelector(".ea-icon-zoom-out").addEventListener("click",(()=>{e.style.scale=e.style.scale?Number(e.style.scale)-.2:.8}));t.querySelector(".ea-icon-rotate-left").addEventListener("click",(()=>{e.style.rotate=(e.style.rotate?Number(e.style.rotate.split("deg")[0])-90:-90)+"deg"}));return t.querySelector(".ea-icon-rotate-right").addEventListener("click",(()=>{e.style.rotate=(e.style.rotate?Number(e.style.rotate.split("deg")[0])+90:90)+"deg"})),t}export function initImagePreview(e,t,n){n&&t.addEventListener("click",(()=>{(t=t.cloneNode(!0)).style.objectFit="contain";const n=createElement("div","ea-image_preview-wrap",[t]);n.part="preview-wrap",e.appendChild(n);const a=createCloseBtn(n);n.appendChild(a);const o=createPreviewTools(t,n);n.appendChild(o),setTimeout((()=>{n.classList.add("entry")}),20),handleImageDrag(n,t),document.body.style.overflow="hidden"}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-infinite-scroll-item/index.js";export class EaInfiniteScroll extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-infinite_wrap' part='container'>\n <slot></slot>\n </div>\n <slot name='loading' style=\"display: none;\"></slot>\n <slot name='noMore' style=\"display: none;\"></slot>\n ",this.#t=t.querySelector('slot[name="loading"]'),this.#e=t.querySelector('slot[name="noMore"]')}get delay(){return this.getAttrNumber("delay")||200}set delay(t){this.setAttribute("delay",t)}get loading(){return this.getAttrBoolean("loading")}set loading(t){void 0!==t&&this.setAttribute("loading",t)}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(t){this.setAttribute("disabled",t),t&&(this.#e.style.display="block")}#i(){const t=this.querySelectorAll("ea-infinite-item");return t[t.length-1]}#
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-infinite-scroll-item/index.js";export class EaInfiniteScroll extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-infinite_wrap' part='container'>\n <slot></slot>\n </div>\n <div class='ea-infinite_loading-wrap' part='loading-wrap'>\n <slot name='loading' style=\"display: none;\"></slot>\n </div>\n <div class='ea-infinite_noMore-wrap' part='noMore-wrap'>\n <slot name='noMore' style=\"display: none;\"></slot>\n </div>\n ",this.#t=t.querySelector('slot[name="loading"]'),this.#e=t.querySelector('slot[name="noMore"]')}get delay(){return this.getAttrNumber("delay")||200}set delay(t){this.setAttribute("delay",t)}get loading(){return this.getAttrBoolean("loading")}set loading(t){void 0!==t&&this.setAttribute("loading",t)}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(t){this.setAttribute("disabled",t),t&&(this.#e.style.display="block")}#i(){const t=this.querySelectorAll("ea-infinite-item");return t[t.length-1]}#n(){if(this.disabled)return;let t=this.#i(),e=null;const i=new IntersectionObserver((n=>{const{isIntersecting:o}=n[0];this.disabled?i.disconnect():o&&!e&&(this.loading&&(this.#t.style.display="block"),i.unobserve(t),e=setTimeout((()=>{this.dispatchEvent(new CustomEvent("bottomReached")),clearTimeout(e),e=null,t=this.#i(),i.observe(t),this.#t.style.display="none"}),this.delay||200))}),{root:this.parentNode,rootMargin:"10px",threshold:.1});i.observe(t)}connectedCallback(){this.delay=this.delay,this.#n()}}customElements.get("ea-infinite")||customElements.define("ea-infinite",EaInfiniteScroll);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{createClearableFixIcon,createFixIcon,createShowPasswordIcon}from"./src/components/createFixIcon.js";import{createWordLimitElement}from"./src/components/createWordLimitElement.js";import{createSuggestionBoard}from"./src/components/createSuggestionBoard.js";import{withTransitionTimeOut}from"../../utils/timeout.js";import{dispatchEvent}from"./src/utils/dispatchEvent.js";import{handleSearchResult}from"./src/utils/handleSearchResult.js";import{initTriggerAfterInputEvent,initTriggerOnFocusEvent}from"./src/utils/handleSuggestionBoardTrigger.js";export class EaInput extends Base{#t;#e;#i=[];#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class=\'ea-input_container\' part=\'container\'>\n <div class="ea-input_wrap" part="input-wrap">\n <div class="ea-input_prepend-slot" part="prepend-wrap">\n <slot name="prepend"></slot>\n </div>\n <input class="ea-input_inner" type="text" part="input" autocomplete="off" />\n <div class="ea-input_append-slot" part="append-wrap">\n <slot name="append"></slot>\n </div>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-input_wrap"),this.#e=t.querySelector(".ea-input_inner"),this.build(t,stylesheet)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("type")||"text"}set type(t){this.setAttribute("type",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t),this.#e.value=t}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(t){this.setAttribute("placeholder",t),this.#e.placeholder=t}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#e.disabled=t,this.#e.classList.toggle("disabled",t)}get clearable(){return this.getAttrBoolean("clearable")}set clearable(t){if(!t)return;this.setAttribute("clearable",t);createClearableFixIcon.call(this,this.#t,this.#e,"icon-cancel-circled2")}get showPassword(){return this.getAttrBoolean("show-password")}set showPassword(t){
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{createClearableFixIcon,createFixIcon,createShowPasswordIcon}from"./src/components/createFixIcon.js";import{createWordLimitElement}from"./src/components/createWordLimitElement.js";import{createSuggestionBoard}from"./src/components/createSuggestionBoard.js";import{timeout,withTransitionTimeOut}from"../../utils/timeout.js";import{dispatchEvent}from"./src/utils/dispatchEvent.js";import{handleSearchResult}from"./src/utils/handleSearchResult.js";import{initTriggerAfterInputEvent,initTriggerOnFocusEvent}from"./src/utils/handleSuggestionBoardTrigger.js";export class EaInput extends Base{#t;#e;#i=[];#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class=\'ea-input_container\' part=\'container\'>\n <div class="ea-input_wrap" part="input-wrap">\n <div class="ea-input_prepend-slot" part="prepend-wrap">\n <slot name="prepend"></slot>\n </div>\n <input class="ea-input_inner" type="text" part="input" autocomplete="off" />\n <div class="ea-input_append-slot" part="append-wrap">\n <slot name="append"></slot>\n </div>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-input_wrap"),this.#e=t.querySelector(".ea-input_inner"),this.build(t,stylesheet)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("type")||"text"}set type(t){this.setAttribute("type",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t),this.#e.value=t}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(t){this.setAttribute("placeholder",t),this.#e.placeholder=t}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#e.disabled=t,this.#e.classList.toggle("disabled",t)}get clearable(){return this.getAttrBoolean("clearable")}set clearable(t){if(!t)return;this.setAttribute("clearable",t);createClearableFixIcon.call(this,this.#t,this.#e,"icon-cancel-circled2")}get showPassword(){return this.getAttrBoolean("show-password")}set showPassword(t){t&&(this.setAttribute("show-password",t),this.#e.type="password",createShowPasswordIcon(this.#t,this.#e,"icon-eye"))}get prefixIcon(){return this.getAttribute("prefix-icon")||""}set prefixIcon(t){t&&(this.setAttribute("prefix",t),createFixIcon(this.#t,t,"prefix"))}get surfixIcon(){return this.getAttribute("suffix-icon")||""}set surfixIcon(t){t&&(this.setAttribute("suffix",t),createFixIcon(this.#t,t,"surfix"))}get suggestion(){return this.#i}set suggestion(t){if(!(t&&t instanceof Array))return;this.#i=t;const e=createSuggestionBoard.call(this,this.#t,t);this.#e.addEventListener("input",(t=>{handleSearchResult(e,t.target.value)})),this.triggerAfterInput?initTriggerAfterInputEvent(this.#e,e):initTriggerOnFocusEvent(e,this.#e),handleSearchResult(e,this.#e.value),this.#t.appendChild(e),this.#s=e}get triggerOnFocus(){return this.getAttrBoolean("trigger-on-focus")}set triggerOnFocus(t){t&&this.setAttribute("trigger-on-focus",t)}get triggerAfterInput(){return this.getAttrBoolean("trigger-after-input")}set triggerAfterInput(t){t&&this.setAttribute("trigger-after-input",t)}get remote(){return this.getAttrBoolean("remote")}set remote(t){this.setAttribute("remote",t);const e=createSuggestionBoard.call(this,this.#t,this.#i);e.classList.toggle("loading",t),this.#e.addEventListener("focus",(()=>{e.classList.add("is-open")})),this.#s=e}get maxLength(){return this.getAttribute("max-length")}set maxLength(t){t&&"text"===this.#e.type&&(this.setAttribute("max-length",t),this.#e.maxLength=t,this.showWordLimit&&(this.showWordLimit=!0))}get minLength(){return this.getAttribute("min-length")}set minLength(t){t&&"text"===this.#e.type&&(this.setAttribute("min-length",t),this.#e.minLength=t,this.#e.addEventListener("input",(e=>{this.#e.ariaInvalid=e.target.value.length<t})))}get showWordLimit(){return this.getAttrBoolean("show-word-limit")}set showWordLimit(t){if(!t||"text"!==this.#e.type)return;this.setAttribute("show-word-limit",t);const e=createWordLimitElement.call(this,this.#e);this.#t.classList.toggle("word-limit",t),this.#t.appendChild(e),this.#e.addEventListener("focus",(t=>{this.#t.classList.add("focus")})),this.#e.addEventListener("blur",(t=>{this.#t.classList.remove("focus")}))}get readonly(){return this.getAttrBoolean("readonly")}set readonly(t){t&&(this.setAttribute("readonly",t),this.#e.readOnly=t)}focus(){this.#e.focus()}blur(){this.#e.blur()}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.type=this.type,this.placeholder=this.placeholder,this.value=this.value,this.disabled=this.disabled,this.clearable=this.clearable,this.clearable||(this.showPassword=this.showPassword),this.prefixIcon=this.prefixIcon,this.clearable||this.showPassword||(this.surfixIcon=this.surfixIcon),this.triggerOnFocus=this.triggerOnFocus,this.triggerAfterInput=this.triggerAfterInput,this.remote&&(this.remote=this.remote),this.maxLength=this.maxLength,this.minLength=this.minLength,this.readonly=this.readonly,this.#e.addEventListener("input",(t=>{this.value=t.target.value,dispatchEvent.call(this,t,"change")})),this.#e.addEventListener("focus",(t=>{dispatchEvent.call(this,t,"focus")})),this.#e.addEventListener("blur",(t=>{dispatchEvent.call(this,t,"blur")})),withTransitionTimeOut(this.#t),timeout((()=>{this.dispatchEvent(new CustomEvent("ready",{bubbles:!0}))}),0)}}window.customElements.get("ea-input")||window.customElements.define("ea-input",EaInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function handleSuggestionBoardClose(e){e.classList.remove("is-open")}export function createSuggestionBoard(e,n){const t=this.shadowRoot.querySelector(".ea-input_suggestion-wrap"),a=document.createElement("ul");a.className="ea-input_suggestion-wrap",n.forEach((e=>{const n=document.createElement("li");n.innerText=e.value,n.addEventListener("click",(()=>{this.value=e.value,handleSuggestionBoardClose(a)})),a.appendChild(n)}));const o=document.createElement("ea-icon");return o.className="loading-icon
|
|
1
|
+
function handleSuggestionBoardClose(e){e.classList.remove("is-open")}export function createSuggestionBoard(e,n){const t=this.shadowRoot.querySelector(".ea-input_suggestion-wrap"),a=document.createElement("ul");a.className="ea-input_suggestion-wrap",a.part="suggestion-wrap",n.forEach((e=>{const n=document.createElement("li");n.part="suggestion-item",n.innerText=e.value,n.addEventListener("click",(()=>{this.value=e.value,handleSuggestionBoardClose(a)})),a.appendChild(n)}));const o=document.createElement("ea-icon");return o.className="loading-icon",o.icon="icon-spin6 animate-spin",o.part="loading-icon",a.appendChild(o),window.addEventListener("click",(e=>{this.contains(e.target)||handleSuggestionBoardClose(a)})),t&&(t.remove(),a.classList.add("is-open")),e.appendChild(a),a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function createWordLimitElement(e){const t=document.createElement("span");return t.className="ea-input_word-limit",t.innerText=`${e.value.length}/${this.maxLength}`,e.addEventListener("input",(e=>{t.innerText=`${e.target.value.length}/${this.maxLength}`})),t}
|
|
1
|
+
export function createWordLimitElement(e){const t=document.createElement("span");return t.className="ea-input_word-limit",t.part="word-limit",t.innerText=`${e.value.length}/${this.maxLength}`,e.addEventListener("input",(e=>{t.innerText=`${e.target.value.length}/${this.maxLength}`})),t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const stylesheet="\n.ea-input_container {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n.ea-input_container .ea-input_wrap {\n position: relative;\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner {\n flex: 1;\n box-sizing: border-box;\n box-shadow: none;\n border: 1px solid #dcdfe6;\n outline: 0;\n border-radius: 3px;\n padding: 0.5rem;\n width: 100%;\n line-height: 0.8;\n font-size: 0.8rem;\n scrollbar-width: none;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner:focus {\n border-color: #409eff;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner::placeholder {\n color: #c0c4cc;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner
|
|
1
|
+
export const stylesheet="\n.ea-input_container {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n.ea-input_container .ea-input_wrap {\n position: relative;\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner {\n flex: 1;\n box-sizing: border-box;\n box-shadow: none;\n border: 1px solid #dcdfe6;\n outline: 0;\n border-radius: 3px;\n padding: 0.5rem;\n width: 100%;\n line-height: 0.8;\n font-size: 0.8rem;\n scrollbar-width: none;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner:focus {\n border-color: #409eff;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner::placeholder {\n color: #c0c4cc;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner[aria-invalid=true] {\n border-color: #f56c6c;\n}\n.ea-input_container .ea-input_wrap .ea-input_inner[disabled] {\n background-color: #eeeeee;\n color: #c0c4cc;\n}\n.ea-input_container .ea-input_wrap .fix-icon {\n position: absolute;\n top: 50%;\n font-size: 0.8rem;\n line-height: 0.8rem;\n}\n.ea-input_container .ea-input_wrap.prefix .ea-input_inner {\n padding-left: 1.75rem;\n}\n.ea-input_container .ea-input_wrap.prefix .prefix-icon {\n left: 1rem;\n transform: translate(-50%, -50%);\n}\n.ea-input_container .ea-input_wrap.surfix .ea-input_inner {\n padding-right: 1.75rem;\n}\n.ea-input_container .ea-input_wrap.surfix .surfix-icon {\n right: 1rem;\n transform: translate(50%, -50%);\n}\n.ea-input_container .ea-input_wrap .ea-input_prepend-slot,\n.ea-input_container .ea-input_wrap .ea-input_append-slot {\n height: 100%;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap {\n list-style-type: none;\n padding: 0;\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n padding-inline-start: 0;\n unicode-bidi: unset;\n position: absolute;\n box-sizing: border-box;\n z-index: 3;\n top: calc(100% + 5px);\n left: 0;\n transform-origin: top center;\n transform: scaleY(0);\n padding: 0.5rem 0;\n width: 100%;\n max-height: 10rem;\n overflow-y: auto;\n scrollbar-width: thin;\n background-color: white;\n box-shadow: 0 1px 8px 1px rgba(0, 0, 0, 0.2);\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap li {\n padding: 0.5rem;\n font-size: 0.9rem;\n cursor: pointer;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap li:hover {\n background-color: #f5f7fa;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap .loading-icon {\n display: none;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap.loading {\n height: 5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap.loading li {\n display: none;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap.loading .loading-icon {\n display: block;\n}\n.ea-input_container .ea-input_wrap .ea-input_suggestion-wrap.is-open {\n transform: scaleY(1);\n}\n.ea-input_container .ea-input_wrap.word-limit {\n border: 1px solid;\n border-color: #dcdfe6;\n border-radius: 3px;\n}\n.ea-input_container .ea-input_wrap.word-limit .ea-input_inner {\n border: 0;\n}\n.ea-input_container .ea-input_wrap.word-limit .ea-input_word-limit {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-wrap: wrap;\n padding-right: 0.5rem;\n font-size: 0.75rem;\n text-align: center;\n}\n.ea-input_container .ea-input_wrap.focus {\n border-color: #409eff;\n}\n.ea-input_container .ea-input_wrap.with-transition {\n transition: border 0.3s;\n}\n.ea-input_container .ea-input_wrap.with-transition .ea-input_inner {\n transition: border 0.3s;\n}\n.ea-input_container .ea-input_wrap.with-transition .ea-input_suggestion-wrap {\n transition: transform 0.3s;\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaLink extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaLink extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <a class="ea-link" part="container">\n <slot></slot>\n </a>\n ',this.#t=t.querySelector(".ea-link"),this.build(t,stylesheet)}get LINK_TYPE(){return["primary","success","info","warning","danger"]}get href(){return this.getAttribute("href")}set href(t){t&&(this.setAttribute("href",t),this.#t.href=t)}get type(){const t=this.getAttribute("type");return this.LINK_TYPE.includes(t)?t:null}set type(t){t&&this.LINK_TYPE.includes(t)&&this.#t.classList.add(t)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#t.classList.toggle("disabled",t),this.style.cursor=t?"not-allowed":"pointer"}get underline(){return this.getAttrBoolean("underline")}set underline(t){this.setAttribute("underline",t),this.#t.classList.toggle("underline",t)}get icon(){return this.getAttribute("icon")}set icon(t){if(!t)return;const e=document.createElement("ea-icon");e.icon=t,this.#t.insertBefore(e,this.#t.firstChild)}connectedCallback(){this.style.display="inline-block",this.href=this.href,this.type=this.type,this.disabled=this.disabled,this.underline=this.underline,this.icon=this.icon}}window.customElements.get("ea-link")||window.customElements.define("ea-link",EaLink);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaRadio extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <label class="ea-radio_wrap" part="container">\n <span class="ea-radio-input_wrap" part="input-wrap">\n <span class="ea-radio-input_inner" part="input"></span>\n <input class="ea-radio-input_input" type="radio" />\n </span>\n <span class="ea-radio-label_desc" part="label-wrap">\n <slot></slot>\n </span>\n </label>\n ',this.#t=e.querySelector(".ea-radio_wrap"),this.#e=e.querySelector(".ea-radio-input_input"),this.build(e,stylesheet)}get checked(){return this.getAttrBoolean("checked")}set checked(e){this.setAttribute("checked",e),this.#t.setAttribute("checked",e),this.#e.checked=e,this.#t.classList.toggle("checked",e)}get name(){return this.getAttribute("name")}set name(e){this.#e.setAttribute("name",e)}get value(){return this.getAttribute("value")}set value(e){this.#t.setAttribute("for",e),this.#e.setAttribute("id",e),this.#e.setAttribute("value",e)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){this.#e.disabled=e,this.#t.setAttribute("disabled",e),this.#t.classList.toggle("disabled",e)}get border(){return this.getAttrBoolean("border")}set border(e){this.#t.classList.toggle("border",e)}connectedCallback(){this.checked=this.checked,this.name=this.name,this.value=this.value,this.disabled=this.disabled,this.border=this.border,this.#e.addEventListener("change",(e=>{document.querySelectorAll(`ea-radio[name="${this.name}"]`).forEach((e=>{const t=e.shadowRoot.querySelector("input");e.checked=t===this.#e})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,checked:this.checked}}))}))}}window.customElements.get("ea-radio")||window.customElements.define("ea-radio",EaRadio);
|
|
1
|
+
import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaRadio extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <label class="ea-radio_wrap" part="container">\n <span class="ea-radio-input_wrap" part="input-wrap">\n <span class="ea-radio-input_inner" part="input"></span>\n <input class="ea-radio-input_input" type="radio" />\n </span>\n <span class="ea-radio-label_desc" part="label-wrap">\n <slot></slot>\n </span>\n </label>\n ',this.#t=e.querySelector(".ea-radio_wrap"),this.#e=e.querySelector(".ea-radio-input_input"),this.build(e,stylesheet)}get checked(){return this.getAttrBoolean("checked")}set checked(e){this.setAttribute("checked",e),this.#t.setAttribute("checked",e),this.#e.checked=e,this.#t.classList.toggle("checked",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e),this.#e.setAttribute("name",e)}get value(){return this.getAttribute("value")}set value(e){this.setAttribute("value",e),this.#t.setAttribute("for",e),this.#e.setAttribute("id",e),this.#e.setAttribute("value",e)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){this.#e.disabled=e,this.#t.setAttribute("disabled",e),this.#t.classList.toggle("disabled",e)}get border(){return this.getAttrBoolean("border")}set border(e){this.#t.classList.toggle("border",e)}connectedCallback(){this.checked=this.checked,this.name=this.name,this.value=this.value,this.disabled=this.disabled,this.border=this.border,this.#e.addEventListener("change",(e=>{document.querySelectorAll(`ea-radio[name="${this.name}"]`).forEach((e=>{const t=e.shadowRoot.querySelector("input");e.checked=t===this.#e})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,checked:this.checked}}))}))}}window.customElements.get("ea-radio")||window.customElements.define("ea-radio",EaRadio);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Base from"../Base.js";const stylesheet="\n.ea-radio-group_wrap {\n display: flex;\n}\n";export class EaRadioGroup extends Base{constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-radio-group_wrap" part="container">\n <slot></slot>\n </div>\n ',this.build(e,stylesheet)}get name(){return this.getAttribute("name")}set name(e){this.querySelectorAll("ea-radio").forEach((t=>{t.setAttribute("name",e)}))}get value(){return this.getAttribute("value")||""}set value(e){e&&this.setAttribute("value",e)}#e(e){e.forEach((e=>{e.checked&&(this.value=e.value),e.addEventListener("change",(t=>{this.value=e.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{target:e,value:this.value}}))}))}))}#t(e){const t=Array.from(e).find((e=>e.value===this.value));t&&(t.checked=!0)}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name
|
|
1
|
+
import{timeout}from"../../utils/timeout.js";import Base from"../Base.js";const stylesheet="\n.ea-radio-group_wrap {\n display: flex;\n}\n";export class EaRadioGroup extends Base{constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-radio-group_wrap" part="container">\n <slot></slot>\n </div>\n ',this.build(e,stylesheet)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e),this.querySelectorAll("ea-radio").forEach((t=>{t.setAttribute("name",e)}))}get value(){return this.getAttribute("value")||""}set value(e){e&&this.setAttribute("value",e)}#e(e){e.forEach((e=>{e.checked&&(this.value=e.value),e.addEventListener("change",(t=>{this.value=e.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{target:e,value:this.value}}))}))}))}#t(e){const t=Array.from(e).find((e=>e.value===this.value));t&&(t.checked=!0)}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.value=this.value,timeout((()=>{const e=this.querySelectorAll("ea-radio");this.#e(e),this.#t(e)}),20)}}window.customElements.get("ea-radio-group")||window.customElements.define("ea-radio-group",EaRadioGroup);
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
name: Publish Package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- package
|
|
7
|
-
tags:
|
|
8
|
-
- 'v*.*.*'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
|
|
17
|
-
- name: Set up Node.js
|
|
18
|
-
uses: actions/setup-node@v3
|
|
19
|
-
with:
|
|
20
|
-
node-version: '14'
|
|
21
|
-
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: npm install
|
|
24
|
-
|
|
25
|
-
- name: Publish to npm
|
|
26
|
-
run: npm publish
|
|
27
|
-
env:
|
|
28
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|