🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@keyiis/formula-editor

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keyiis/formula-editor - npm Package Compare versions

Comparing version
0.0.8
to
0.0.9
+3
-5
index.es.js

@@ -374,5 +374,3 @@ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .item[data-v-f3a47261]{background:#606266;color:#fff}.set-formula-frame .formula-pannel .formula .formula-item .item.use-formula[data-v-f3a47261]{background:#409EFF}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();

run() {
let args = {
depItemIds: []
}, func = eval(`(args)=>{ ${this.script} }`), result = func(args);
let func = eval(`()=>{ ${this.script} }`), result = func();
console.log(result);

@@ -527,3 +525,3 @@ }

let l = /* @__PURE__ */ new Set();
const n = r.replace(itemPattern, (I, N) => (l.add(N), E(1, 100).toString()));
const n = r.replace(itemPattern, (N, I) => (l.add(I), E(1, 100).toString()));
new TestScriptRunner(n).run(), p.value = !0, t("update:script", r), t("update:itemIds", Array.from(l));

@@ -569,3 +567,3 @@ } catch (l) {

class: "sitem",
onDblclick: (I) => g(n)
onDblclick: (N) => g(n)
}, [

@@ -572,0 +570,0 @@ createElementVNode(

@@ -12,3 +12,3 @@ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .item[data-v-f3a47261]{background:#606266;color:#fff}.set-formula-frame .formula-pannel .formula .formula-item .item.use-formula[data-v-f3a47261]{background:#409EFF}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();

</el-icon></template>\r
</el-input> `)])):vue.createCommentVNode("v-if",!0)])]}),_:1},8,["modelValue"])):vue.createCommentVNode("v-if",!0),vue.createVNode(vue.unref(draggable),{class:"operators",modelValue:operators.value,"onUpdate:modelValue":t[5]||(t[5]=o=>operators.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"name"},{item:vue.withCtx(({element:o})=>[o.name=="input"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"input",onDblclick:t[4]||(t[4]=a=>addInput())},vue.toDisplayString(o.val),33)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator",onDblclick:a=>addOperator(o)},vue.toDisplayString(o.name),41,_hoisted_24))]),_:1},8,["modelValue"])])]))}}),EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang="",_export_sfc=(e,t)=>{const o=e.__vccOpts||e;for(const[a,s]of t)o[a]=s;return o},EditFormula=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f3a47261"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]);class TestScriptRunner{constructor(e){this.script=e}special4AttendanceAndTax(){return 0}run(){let args={depItemIds:[]},func=eval(`(args)=>{ ${this.script} }`),result=func(args);console.log(result)}}const _withScopeId=e=>(vue.pushScopeId("data-v-d455b305"),e=e(),vue.popScopeId(),e),_hoisted_1={class:"set-formula-frame"},_hoisted_2={class:"items-pannel"},_hoisted_3={class:"search-ipt"},_hoisted_4={class:"sitems"},_hoisted_5=["onDblclick"],_hoisted_6={class:"item-name"},_hoisted_7={key:0,class:"formula-tip"},_hoisted_8={class:"formula-pannel"},_hoisted_9={class:"formula-hedaer"},_hoisted_10={key:0,style:{color:"#67C23A"}},_hoisted_11={key:1,style:{color:"#F56C6C"}},_hoisted_12={class:"formula-hedaer-btns"},_hoisted_13=_withScopeId(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_14=[_hoisted_13],_hoisted_15=_withScopeId(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_16=_withScopeId(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_17=[_hoisted_15,_hoisted_16],_hoisted_18={class:"script-content"},defaultScript=`//请在这里编写脚本并return结果
</el-input> `)])):vue.createCommentVNode("v-if",!0)])]}),_:1},8,["modelValue"])):vue.createCommentVNode("v-if",!0),vue.createVNode(vue.unref(draggable),{class:"operators",modelValue:operators.value,"onUpdate:modelValue":t[5]||(t[5]=o=>operators.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"name"},{item:vue.withCtx(({element:o})=>[o.name=="input"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"input",onDblclick:t[4]||(t[4]=a=>addInput())},vue.toDisplayString(o.val),33)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator",onDblclick:a=>addOperator(o)},vue.toDisplayString(o.name),41,_hoisted_24))]),_:1},8,["modelValue"])])]))}}),EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang="",_export_sfc=(e,t)=>{const o=e.__vccOpts||e;for(const[a,s]of t)o[a]=s;return o},EditFormula=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f3a47261"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]);class TestScriptRunner{constructor(e){this.script=e}special4AttendanceAndTax(){return 0}run(){let func=eval(`()=>{ ${this.script} }`),result=func();console.log(result)}}const _withScopeId=e=>(vue.pushScopeId("data-v-d455b305"),e=e(),vue.popScopeId(),e),_hoisted_1={class:"set-formula-frame"},_hoisted_2={class:"items-pannel"},_hoisted_3={class:"search-ipt"},_hoisted_4={class:"sitems"},_hoisted_5=["onDblclick"],_hoisted_6={class:"item-name"},_hoisted_7={key:0,class:"formula-tip"},_hoisted_8={class:"formula-pannel"},_hoisted_9={class:"formula-hedaer"},_hoisted_10={key:0,style:{color:"#67C23A"}},_hoisted_11={key:1,style:{color:"#F56C6C"}},_hoisted_12={class:"formula-hedaer-btns"},_hoisted_13=_withScopeId(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_14=[_hoisted_13],_hoisted_15=_withScopeId(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_16=_withScopeId(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_17=[_hoisted_15,_hoisted_16],_hoisted_18={class:"script-content"},defaultScript=`//请在这里编写脚本并return结果
`,itemPattern=/\${(.*?)}/g,_sfc_main=vue.defineComponent({__name:"EditScript",props:{originItems:{type:Array,required:!0,default:[]},itemIds:{type:Array,required:!0,default:[]},script:{type:String,required:!0,default:defaultScript}},emits:["update:script","update:itemIds"],setup(e,{emit:t}){const o=e,a=vue.ref([]),s=vue.ref(),i=vue.ref("");class u extends view.WidgetType{constructor(r){super(),this.itemId=r}eq(r){return this.itemId==r.itemId}toDOM(){var n;let r=document.createElement("span");return r.style.cssText=`

@@ -15,0 +15,0 @@ border: 1px solid blue;

{
"name": "@keyiis/formula-editor",
"version": "0.0.8",
"version": "0.0.9",
"description": "A formula-editor",

@@ -5,0 +5,0 @@ "types": "index.es.d.ts",