@tripetto/block-number
Version:
Number block for Tripetto.
3 lines (2 loc) • 19.4 kB
JavaScript
/*! Tripetto Number Block 8.0.3 - Copyright (C) 2023 Tripetto B.V. - All Rights Reserved */
import{definition as e,affects as i,tripetto as l,pgettext as t,editor as o,ConditionBlock as u,Slots as n,isNumberFinite as a,L10n as r,isString as b,lookupVariable as s,Forms as M,populateVariables as m,mountNamespace as d,unmountNamespace as c,slots as w,conditions as g,NodeBlock as A,Collection as h,isNumber as S,each as D}from"@tripetto/builder";import{Operation as N,calculator as v}from"@tripetto/block-calculator";function f(e,i,l,t){var o,u=arguments.length,n=u<3?i:null===t?t=Object.getOwnPropertyDescriptor(i,l):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,i,l,t);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(u<3?o(n):u>3?o(i,l,n):o(i,l))||n);return u>3&&n&&Object.defineProperty(i,l,n),n}var j="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSI1ODAiIGhlaWdodD0iNTgwIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgaW1hZ2UtcmVuZGVyaW5nPSJvcHRpbWl6ZVF1YWxpdHkiIHZpZXdCb3g9IjAgMCA1ODAwIDU4MDAiPjxwYXRoIGNsYXNzPSJ0cmlwZXR0by1maWxsIiBkPSJNNzAwIDE1MDBoNDQwMGMyMjAgMCA0MDAgMTgwIDQwMCA0MDB2MjAwMGMwIDIyMC0xODAgNDAwLTQwMCA0MDBINzAwYy0yMjAgMC00MDAtMTgwLTQwMC00MDBWMTkwMGMwLTIyMCAxODAtNDAwIDQwMC00MDB6bTMxMDAgMjAwdjI0MDBoMTMwMGMxMTAgMCAyMDAtOTAgMjAwLTI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IDAgMCAuNS0uNXYtMTZhLjUuNSAwIDAgMC0uNS0uNWgtNnoiIGNsYXNzPSJ0cmlwZXR0by1maWxsIi8+PHBhdGggZD0iTTE2LjUgMTBoLTRhLjUuNSAwIDAgMSAwLTFoNGEuNS41IDAgMCAxIDAgMXptMCAyaC00YS41LjUgMCAwIDEgMC0xaDRhLjUuNSAwIDAgMSAwIDF6IiBjbGFzcz0idHJpcGV0dG8tZmlsbCIvPjwvc3ZnPg==";let p=class extends u{constructor(){super(...arguments),this.allowMarkdown=!0,this.mode="equal"}get icon(){var e;return"calculator"===(null===(e=this.slot)||void 0===e?void 0:e.reference)?I:j}get label(){return""}get name(){const e=this.slot;if(e instanceof n.Numeric){const i=this.parse(e,this.value);switch(this.mode){case"between":return`${i} ≤ @${e.id} ≤ ${this.parse(e,this.to)}`;case"not-between":return`@${e.id} < ${i} ${t("block:number","or")} @${e.id} > ${this.parse(e,this.to)}`;case"defined":return`@${e.id} ${t("block:number","not empty")}`;case"undefined":return`@${e.id} ${t("block:number","empty")}`;case"not-equal":return`@${e.id} ≠ ${i}`;case"above":case"below":case"equal":return`@${e.id} ${"above"===this.mode?">":"below"===this.mode?"<":"="} ${i}`}}return this.type.label}get title(){var e;return null===(e=this.node)||void 0===e?void 0:e.label}parse(e,i){var l;return a(i)?e.toString(i,((e,i)=>r.locale.number(e,i,!1))):b(i)&&i&&(null===(l=s(this,i))||void 0===l?void 0:l.label)?"@"+i:"\\_\\_"}defineEditor(){var e;const i="calculator"===(null===(e=this.slot)||void 0===e?void 0:e.reference);this.editor.form({title:t("block:number","Compare mode"),controls:[new M.Radiobutton([{label:t("block:number",i?"Calculation is equal to":"Number is equal to"),value:"equal"},{label:t("block:number",i?"Calculation is not equal to":"Number is not equal to"),value:"not-equal"},{label:t("block:number",i?"Calculation is lower than":"Number is lower than"),value:"below"},{label:t("block:number",i?"Calculation is higher than":"Number is higher than"),value:"above"},{label:t("block:number",i?"Calculation is between":"Number is between"),value:"between"},{label:t("block:number",i?"Calculation is not between":"Number is not between"),value:"not-between"},{label:t("block:number",i?"Calculation is valid":"Number is not empty"),value:"defined"},{label:t("block:number",i?"Calculation is not valid":"Number is empty"),value:"undefined"}],M.Radiobutton.bind(this,"mode","equal")).on((e=>{switch(o.visible("defined"!==e.value&&"undefined"!==e.value),u.visible("between"===e.value||"not-between"===e.value),e.value){case"equal":o.title=t("block:number",i?"If calculation equals":"If number equals");break;case"not-equal":o.title=t("block:number",i?"If calculation not equals":"If number not equals");break;case"below":o.title=t("block:number",i?"If calculation is lower than":"If number is lower than");break;case"above":o.title=t("block:number",i?"If calculation is higher than":"If number is higher than");break;case"between":o.title=t("block:number",i?"If calculation is between":"If number is between");break;case"not-between":o.title=t("block:number",i?"If calculation is not between":"If number is not between")}}))]});const l=(e,i,l)=>{var o;const u=this[e],r=this.slot,s=new M.Numeric(a(u)?u:0).label(t("block:number","Use fixed number")).precision((null==r?void 0:r.precision)||0).digits((null==r?void 0:r.digits)||0).decimalSign((null==r?void 0:r.decimal)||"").thousands(!!(null==r?void 0:r.separator),(null==r?void 0:r.separator)||"").prefix((null==r?void 0:r.prefix)||"").prefixPlural((null==r?void 0:r.prefixPlural)||void 0).suffix((null==r?void 0:r.suffix)||"").suffixPlural((null==r?void 0:r.suffixPlural)||void 0).min(null==r?void 0:r.minimum).max(null==r?void 0:r.maximum).autoFocus("value"===e).escape(this.editor.close).enter((()=>("between"!==this.mode&&"not-between"!==this.mode||"to"===e)&&this.editor.close())).on((i=>{i.isFormVisible&&i.isObservable&&(this[e]=i.value)})),d=m(this,(e=>e instanceof n.Number||e instanceof n.Numeric),b(u)?u:void 0,!1,null===(o=this.slot)||void 0===o?void 0:o.id),c=new M.Dropdown(d,b(u)?u:"").label(t("block:number","Use value of")).width("full").on((i=>{i.isFormVisible&&i.isObservable&&(this[e]=i.value||"")}));return this.editor.form({title:i,controls:[new M.Radiobutton([{label:t("block:number","Number"),value:"number"},{label:t("block:number","Value"),value:"variable",disabled:0===d.length}],b(u)?"variable":"number").on((e=>{s.visible("number"===e.value),c.visible("variable"===e.value),s.isObservable&&s.focus()})),s,c]}).visible(l)},o=l("value",t("block:number",i?"If calculation equals":"If number equals"),"defined"!==this.mode&&"undefined"!==this.mode),u=l("to",t("block:number","And"),"between"===this.mode||"not-between"===this.mode)}};var x;f([e,i("#name")],p.prototype,"mode",void 0),f([e,i("#name")],p.prototype,"value",void 0),f([e,i("#name")],p.prototype,"to",void 0),f([o],p.prototype,"defineEditor",null),p=f([l({type:"condition",legacyBlock:!0,context:"@tripetto/block-number",identifier:"@tripetto/block-number",version:"8.0.3",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0iTTE2LjIzIDMuMzA3Yy0uMzk2LS4yNjgtLjk0OS0uNTA0LTEuNjQzLS43MDJDMTMuMjIxIDIuMjE1IDExLjQxNSAyIDkuNSAycy0zLjcyMi4yMTUtNS4wODcuNjA1Yy0uNjk0LjE5OC0xLjI0Ni40MzQtMS42NDMuNzAyLS42MzcuNDMtLjc3Ljg4Ni0uNzcgMS4xOTNWNWMwIC40MjguMzIxIDEuMTMzLjYzOSAxLjYwOWw0Ljg5MSA3LjMzNmMuMjUxLjM3Ni40NzEgMS4xMDMuNDcxIDEuNTU1djNhLjUuNSAwIDAgMCAuNzI0LjQ0N2wyLTFhLjUuNSAwIDAgMCAuMjc2LS40NDd2LTJjMC0uNDUyLjIyLTEuMTc5LjQ3MS0xLjU1NWw0Ljg5MS03LjMzNmMuMzE3LS40NzYuNjM5LTEuMTgyLjYzOS0xLjYwOXYtLjVjMC0uMzA3LS4xMzQtLjc2My0uNzctMS4xOTN6bS0xMS41NDIuMjZDNS45NjcgMy4yMDIgNy42NzYgMyA5LjUgM3MzLjUzNC4yMDEgNC44MTIuNTY3QzE1LjY5IDMuOTYxIDE2IDQuMzgzIDE2IDQuNXMtLjMxLjU0LTEuNjg4LjkzM0MxMy4wMzMgNS43OTggMTEuMzI0IDYgOS41IDZzLTMuNTM0LS4yMDEtNC44MTItLjU2N0MzLjMxIDUuMDM5IDMgNC42MTcgMyA0LjVzLjMxLS41NCAxLjY4OC0uOTMzem01Ljk1MSA5LjgyNGMtLjM1OC41MzctLjYzOSAxLjQ2NC0uNjM5IDIuMTA5djEuNjkxbC0xIC41VjE1LjVjMC0uNjQ2LS4yODEtMS41NzItLjYzOS0yLjEwOWwtNC44OC03LjMyYy4yNzQuMTE3LjU4NS4yMjYuOTMyLjMyNEM1Ljc3OSA2Ljc4NSA3LjU4NSA3IDkuNSA3czMuNzIyLS4yMTUgNS4wODctLjYwNWMuMzQ2LS4wOTkuNjU4LS4yMDcuOTMyLS4zMjVsLTQuODggNy4zMnoiIGNsYXNzPSJ0cmlwZXR0by1maWxsIi8+PC9zdmc+",get label(){return t("block:number","Verify number")}})],p),d("@tripetto/block-number"),c();let L=x=class extends A{constructor(){super(...arguments),this.startBlank=!1,this.operations=h.of(N,this)}get block(){return this}get firstANS(){return"@"+this.numberSlot.id}defineSlot(){this.numberSlot=this.slots.static({type:n.Numeric,reference:"number",label:x.label,exchange:["required","alias","exportable","precision","digits","decimal","separator","minimum","maximum","prefix","prefixPlural","suffix","suffixPlural"]})}defineEditor(){const e=new M.Numeric(M.Numeric.bind(this.numberSlot,"minimum",void 0)).precision(this.numberSlot.precision||0).digits(this.numberSlot.digits||0).decimalSign(this.numberSlot.decimal||"").thousands(!!this.numberSlot.separator,this.numberSlot.separator||"").prefix(this.numberSlot.prefix||"").prefixPlural(this.numberSlot.prefixPlural||void 0).suffix(this.numberSlot.suffix||"").suffixPlural(this.numberSlot.suffixPlural||void 0).label(t("block:number","Minimum")),i=new M.Numeric(M.Numeric.bind(this.numberSlot,"maximum",void 0)).precision(this.numberSlot.precision||0).digits(this.numberSlot.digits||0).decimalSign(this.numberSlot.decimal||"").thousands(!!this.numberSlot.separator,this.numberSlot.separator||"").prefix(this.numberSlot.prefix||"").prefixPlural(this.numberSlot.prefixPlural||void 0).suffix(this.numberSlot.suffix||"").suffixPlural(this.numberSlot.suffixPlural||void 0).label(t("block:number","Maximum")),l=new M.Numeric(M.Numeric.bind(this,"prefill",void 0)).precision(this.numberSlot.precision||0).digits(this.numberSlot.digits||0).decimalSign(this.numberSlot.decimal||"").thousands(!!this.numberSlot.separator,this.numberSlot.separator||"").prefix(this.numberSlot.prefix||"").prefixPlural(this.numberSlot.prefixPlural||void 0).suffix(this.numberSlot.suffix||"").suffixPlural(this.numberSlot.suffixPlural||void 0).min(this.numberSlot.minimum).max(this.numberSlot.maximum);this.editor.name(),this.editor.description(),this.editor.placeholder(),this.editor.explanation(),this.editor.groups.settings(),this.editor.option({name:t("block:number","Format"),form:{title:t("block:number","Format"),controls:[new M.Dropdown([{optGroup:t("block:number","Decimals")},{label:"#",value:0},{label:"#.#",value:1},{label:"#.##",value:2},{label:"#.###",value:3},{label:"#.####",value:4},{label:"#.#####",value:5},{label:"#.######",value:6},{label:"#.#######",value:7},{label:"#.########",value:8},{optGroup:t("block:number","Digits")},{label:"##",value:-2},{label:"###",value:-3},{label:"####",value:-4},{label:"#####",value:-5},{label:"######",value:-6},{label:"#######",value:-7},{label:"########",value:-8},{label:"#########",value:-9},{label:"##########",value:-10},{label:"###########",value:-11},{label:"############",value:-12},{label:"#############",value:-13},{label:"##############",value:-14},{label:"###############",value:-15},{label:"################",value:-16}],(this.numberSlot.digits?-this.numberSlot.digits:this.numberSlot.precision)||0).on((t=>{this.numberSlot.precision=t.isFeatureEnabled&&S(t.value)&&t.value>=0?t.value:void 0,this.numberSlot.digits=t.isFeatureEnabled&&S(t.value)&&t.value<0?-t.value:void 0,e.precision(this.numberSlot.precision||0),i.precision(this.numberSlot.precision||0),l.precision(this.numberSlot.precision||0),e.digits(this.numberSlot.digits||0),i.digits(this.numberSlot.digits||0),l.digits(this.numberSlot.digits||0),o.disabled(!this.numberSlot.precision),m.disabled((this.numberSlot.digits||0)>0)}))]},activated:S(this.numberSlot.precision)||S(this.numberSlot.digits)});const o=new M.Dropdown([{label:"#.#",value:"."},{label:"#,#",value:","}],M.Dropdown.bind(this.numberSlot,"decimal",void 0)).label(t("block:number","Decimal sign")).disabled(!this.numberSlot.precision).on((()=>{e.decimalSign(o.isFeatureEnabled&&o.value||""),i.decimalSign(o.isFeatureEnabled&&o.value||""),l.decimalSign(o.isFeatureEnabled&&o.value||"")}));this.editor.option({name:t("block:number","Limits"),form:{title:t("block:number","Limits"),controls:[e,i]},activated:S(this.numberSlot.minimum)||S(this.numberSlot.maximum)});const u=new M.Text("singleline",M.Text.bind(this.numberSlot,"prefix",void 0)).sanitize(!1).on((t=>{e.prefix(t.isFeatureEnabled&&t.value||""),i.prefix(t.isFeatureEnabled&&t.value||""),l.prefix(t.isFeatureEnabled&&t.value||"")})),n=new M.Text("singleline",M.Text.bind(this.numberSlot,"prefixPlural",void 0)).indent(32).sanitize(!1).on((t=>{e.prefixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0),i.prefixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0),l.prefixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0)})).placeholder(t("block:number","Prefix when value is plural")).visible(b(this.numberSlot.prefixPlural));this.editor.option({name:t("block:number","Prefix"),form:{title:t("block:number","Prefix"),controls:[u,new M.Checkbox(t("block:number","Specify different prefix for plural values"),b(this.numberSlot.prefixPlural)).on((e=>{u.placeholder(e.isChecked&&t("block:number","Prefix when value is singular")||""),n.visible(e.isChecked)})),n]},activated:b(this.numberSlot.prefix)});const r=new M.Text("singleline",M.Text.bind(this.numberSlot,"suffix",void 0)).sanitize(!1).on((t=>{e.suffix(t.isFeatureEnabled&&t.value||""),i.suffix(t.isFeatureEnabled&&t.value||""),l.suffix(t.isFeatureEnabled&&t.value||"")})),s=new M.Text("singleline",M.Text.bind(this.numberSlot,"suffixPlural",void 0)).indent(32).sanitize(!1).on((t=>{e.suffixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0),i.suffixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0),l.suffixPlural(t.isFeatureEnabled&&t.isObservable&&t.value||void 0)})).placeholder(t("block:number","Suffix when value is plural")).visible(b(this.numberSlot.suffixPlural));this.editor.option({name:t("block:number","Suffix"),form:{title:t("block:number","Suffix"),controls:[r,new M.Checkbox(t("block:number","Specify different suffix for plural values"),b(this.numberSlot.suffixPlural)).on((e=>{r.placeholder(e.isChecked&&t("block:number","Suffix when value is singular")||""),s.visible(e.isChecked)})),s]},activated:b(this.numberSlot.suffix)});const m=this.editor.option({name:t("block:number","Signs"),form:{title:t("block:number","Signs"),controls:[o,new M.Dropdown([{label:t("block:number","None"),value:void 0},{label:"#,###",value:","},{label:"#.###",value:"."}],M.Dropdown.bind(this.numberSlot,"separator",void 0)).label(t("block:number","Thousands separator")).on((t=>{e.thousands(!(!t.isFeatureEnabled||!t.value),t.isFeatureEnabled&&t.value||""),i.thousands(!(!t.isFeatureEnabled||!t.value),t.isFeatureEnabled&&t.value||""),l.thousands(!(!t.isFeatureEnabled||!t.value),t.isFeatureEnabled&&t.value||"")})),new M.Static(t("block:number","**Note:** These signs are used to format the number in de dataset. When the number is displayed in a runner, the appropriate user locale might be applied making it seem like changing these settings has no effect.")).markdown()]},activated:b(this.numberSlot.separator)||b(this.numberSlot.decimal),disabled:(this.numberSlot.digits||0)>0});this.editor.groups.options(),this.editor.option({name:t("block:number","Prefill"),form:{title:t("block:number","Prefill"),controls:[l,new M.Static(t("block:number","This value will be used as initial (or default) value for the number."))]},activated:a(this.prefill)}),this.editor.numeric({target:this,reference:"calculator",label:t("block:number","Calculation"),name:t("block:number","Calculator"),title:t("block:number","Calculator settings"),exportable:!0,pair:this.editor.collection(v(this,t("block:number","Perform a calculation with the number value."),t("block:number","Calculator")))}),this.editor.required(this.numberSlot),this.editor.visibility(),this.editor.alias(this.numberSlot),this.editor.exportable(this.numberSlot)}defineCondition(){const e=this.slots.select("calculator","feature"),i=e?this.conditions.group(this.numberSlot.label||x.label):this.conditions;if(D([{mode:"equal",label:t("block:number","Number is equal to")},{mode:"not-equal",label:t("block:number","Number is not equal to")},{mode:"below",label:t("block:number","Number is lower than")},{mode:"above",label:t("block:number","Number is higher than")},{mode:"between",label:t("block:number","Number is between")},{mode:"not-between",label:t("block:number","Number is not between")},{mode:"defined",label:t("block:number","Number is not empty")},{mode:"undefined",label:t("block:number","Number is empty")}],(e=>{i.template({condition:p,icon:j,label:e.label,autoOpen:"defined"!==e.mode&&"undefined"!==e.mode,props:{slot:this.numberSlot,mode:e.mode}})})),e){const i=this.conditions.group(e.label||t("block:number","Calculation"));D([{mode:"equal",label:t("block:number","Calculation is equal to")},{mode:"not-equal",label:t("block:number","Calculation is not equal to")},{mode:"below",label:t("block:number","Calculation is lower than")},{mode:"above",label:t("block:number","Calculation is higher than")},{mode:"between",label:t("block:number","Calculation is between")},{mode:"not-between",label:t("block:number","Calculation is not between")},{mode:"defined",label:t("block:number","Calculation is valid")},{mode:"undefined",label:t("block:number","Calculation is not valid")}],(l=>{i.template({condition:p,icon:I,label:l.label,autoOpen:"defined"!==l.mode&&"undefined"!==l.mode,props:{slot:e,mode:l.mode}})}))}}};f([e("number","optional")],L.prototype,"prefill",void 0),f([e],L.prototype,"operations",void 0),f([w],L.prototype,"defineSlot",null),f([o],L.prototype,"defineEditor",null),f([g],L.prototype,"defineCondition",null),L=x=f([l({type:"node",legacyBlock:!0,identifier:"@tripetto/block-number",version:"8.0.3",icon:j,get label(){return t("block:number","Number")}})],L);export{L as Number};