@nebula.js/sn-action-button 1.14.0 → 1.15.2

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.
@@ -1,8 +1,7 @@
1
1
  /*
2
- * @nebula.js/sn-action-button v1.14.0
3
- * Copyright (c) 2021 QlikTech International AB
2
+ * @nebula.js/sn-action-button v1.15.2
3
+ * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-action-button"]=t(e.stardust)}(this,(function(e){"use strict";var t={showTitles:!1,title:"",subtitle:"",footnote:"",useEnabledCondition:!1,enabledCondition:1,navigation:{action:"none"},style:{label:"Button",font:{size:.5,useColorExpression:!1,color:{index:-1,color:null},colorExpression:"",style:{bold:!0,italic:!1,underline:!1},align:"center"},background:{useColorExpression:!1,color:{index:-1,color:null},colorExpression:"",useImage:!1,url:{qStaticContentUrlDef:{qUrl:""}},size:"auto",position:"centerCenter"},border:{useBorder:!1,radius:0,width:0,useColorExpression:!1,color:{index:-1,color:null},colorExpression:""},icon:{useIcon:!1,iconType:"",position:"left"}},actions:[]},n={targets:[]};function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)}))}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(){var e=i(regeneratorRuntime.mark((function e(t,n,r){var o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.split(";"),!r){e.next=8;break}return a="",o.forEach((function(e){a+="Num('".concat(e,"')&';'&")})),e.next=6,t.evaluate(a.slice(0,-5));case 6:i=e.sent,o=i.split(";");case 8:return e.abrupt("return",o.map((function(e){return Number.isNaN(+e)?{qText:e}:{qIsNumeric:!0,qNumber:Number(e)}})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),s=[{value:"applyBookmark",translation:"Object.ActionButton.ApplyBookmark",group:"bookmark",getActionCall:function(e){var t=e.app,n=e.bookmark;return i(regeneratorRuntime.mark((function e(){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getBookmarkList();case 2:if(r=e.sent,o=r.find((function(e){return e.qData.title===n})),e.t0=n,!e.t0){e.next=8;break}return e.next=8,t.applyBookmark(o&&o.qInfo&&o.qInfo.qId||n);case 8:case"end":return e.stop()}}),e)})))},requiredInput:["bookmark"]},{value:"back",translation:"Object.ActionButton.MoveBackward",group:"selection",getActionCall:function(e){var t=e.app;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.back();case 2:case"end":return e.stop()}}),e)})))},requiredInput:[]},{value:"forward",translation:"Object.ActionButton.MoveForward",group:"selection",getActionCall:function(e){var t=e.app;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forward();case 2:case"end":return e.stop()}}),e)})))},requiredInput:[]},{value:"clearAll",translation:"Object.ActionButton.ClearAll",group:"selection",getActionCall:function(e){var t=e.app,n=e.softLock;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.clearAll(n);case 2:case"end":return e.stop()}}),e)})))},requiredInput:["softLock"]},{value:"clearAllButThis",translation:"Object.ActionButton.ClearAllButThis",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.softLock;return i(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return a=e.sent,e.next=6,a.clearAllButThis(o);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","softLock"]},{value:"clearField",translation:"Object.ActionButton.ClearSelectionInField",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field;return i(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return o=e.sent,e.next=6,o.clear();case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field"]},{value:"selectAll",translation:"Object.ActionButton.SelectAllInField",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.softLock;return i(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return a=e.sent,e.next=6,a.selectAll(o);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","softLock"]},{value:"selectValues",translation:"Object.ActionButton.SelectValuesInField",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.value,a=e.softLock;return i(regeneratorRuntime.mark((function e(){var i,l,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||!o){e.next=12;break}return e.next=3,t.getField(r,n);case 3:return i=e.sent,e.next=6,t.getFieldDescription(r);case 6:return l=e.sent,e.next=9,c(t,o,l.qTags.includes("$date"));case 9:return s=e.sent,e.next=12,i.selectValues(s,!1,a);case 12:case"end":return e.stop()}}),e)})))},requiredInput:["field","value","softLock"]},{value:"selectMatchingValues",translation:"Object.ActionButton.SelectMatchingValues",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.value,a=e.softLock;return i(regeneratorRuntime.mark((function e(){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||!o){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return i=e.sent,e.next=6,i.select(o,!1,a);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","value","softLock"]},{value:"selectAlternative",translation:"Object.ActionButton.SelectAlternatives",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.softLock;return i(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return a=e.sent,e.next=6,a.selectAlternative(o);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","softLock"]},{value:"selectExcluded",translation:"Object.ActionButton.SelectExcluded",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.softLock;return i(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return a=e.sent,e.next=6,a.selectExcluded(o);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","softLock"]},{value:"selectPossible",translation:"Object.ActionButton.SelectPossibleValues",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.softLock;return i(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return a=e.sent,e.next=6,a.selectPossible(o);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","softLock"]},{value:"toggleSelect",translation:"Object.ActionButton.ToggleFieldSelection",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field,o=e.value,a=e.softLock;return i(regeneratorRuntime.mark((function e(){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||!o){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return i=e.sent,e.next=6,i.toggleSelect(o,a);case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field","value","softLock"]},{value:"lockAll",translation:"Object.ActionButton.LockAllSelections",group:"selection",getActionCall:function(e){var t=e.app;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.lockAll();case 2:case"end":return e.stop()}}),e)})))},requiredInput:[]},{value:"lockField",translation:"Object.ActionButton.LockField",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field;return i(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return o=e.sent,e.next=6,o.lock();case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field"]},{value:"unlockAll",translation:"Object.ActionButton.UnlockAllSelections",group:"selection",getActionCall:function(e){var t=e.app;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.unlockAll();case 2:case"end":return e.stop()}}),e)})))},requiredInput:[]},{value:"unlockField",translation:"Object.ActionButton.UnlockAField",group:"selection",getActionCall:function(e){var t=e.app,n=e.qStateName,r=e.field;return i(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getField(r,n);case 3:return o=e.sent,e.next=6,o.unlock();case 6:case"end":return e.stop()}}),e)})))},requiredInput:["field"]},{value:"setVariable",translation:"Object.ActionButton.SetVariable",group:"variables",getActionCall:function(e){var t=e.app,n=e.variable,r=e.value;return i(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!r){e.next=11;break}return e.prev=1,e.next=4,t.getVariableByName(n);case 4:return o=e.sent,e.next=7,o.setStringValue(r);case 7:e.next=11;break;case 9:e.prev=9,e.t0=e.catch(1);case 11:case"end":return e.stop()}}),e,null,[[1,9]])})))},requiredInput:["variable","value"]},{value:"doReload",translation:"Object.ActionButton.DoReload",group:"reload",getActionCall:function(e){var t=e.app,n=e.partial;return i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.doReload(0,!!n,!1);case 2:if(!e.sent){e.next=6;break}return e.next=6,t.doSave();case 6:case"end":return e.stop()}}),e)})))},requiredInput:["partial"]},{translation:"Object.ActionButton.ExecuteAutomation",value:"executeAutomation",getActionCall:function(e){var t=e.app,n=e.automation,r=e.automationPostData;return i(regeneratorRuntime.mark((function e(){var o,a,i,l,c,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===n){e.next=26;break}return e.prev=1,n=encodeURIComponent(n),e.next=5,fetch("../api/v1/items/".concat(n)).then((function(e){return e.json()}));case 5:return o=e.sent,e.next=8,fetch("../api/v1/automations/".concat(o.resourceId)).then((function(e){return e.json()}));case 8:if(a=e.sent,i="../api/v1/automations/".concat(a.guid,"/actions/execute?X-Execution-Token=").concat(a.execution_token),!r||!a.hasinputs){e.next=20;break}return e.next=13,fetch("../api/v1/automations/".concat(o.resourceId,"/blocks")).then((function(e){return e.json()})).then((function(e){for(var t,n=0;n<e.blocks.length;n++)if("Inputs"===e.blocks[n].displayName){t=e.blocks[n];break}return t.form[0].label.toLowerCase()}));case 13:return l=e.sent,c=new Date,s={qProp:{qInfo:{qId:"automation_".concat(t.id,"_").concat(n,"_").concat(c.getTime()),qType:"bookmark"},qMetaDef:{title:"Generated automation bookmark on ".concat(c.toISOString()),description:"Generated to provide target automation with bookmark to get current selection state",_createdBy:"sn-action-button",_createdFor:"automation",_createdOn:"".concat(c.toISOString()),_id:"automation_".concat(encodeURIComponent(t.id),"_").concat(n,"_").concat(c.getTime())}}},e.next=18,t.createBookmark(s).then((function(e){return e.getLayout()})).then((function(e){return e.qInfo.qId}));case 18:u=e.sent,i="".concat(i,"&").concat(l,"=").concat(u);case 20:return e.next=22,fetch(i).then((function(e){return e.json()}));case 22:e.next=26;break;case 24:e.prev=24,e.t0=e.catch(1);case 26:case"end":return e.stop()}}),e,null,[[1,24]])})))},requiredInput:["automation"]}];function u(e,t){var n=s.find((function(t){return e.actionType===t.value}));return n&&n.requiredInput&&-1!==n.requiredInput.indexOf(t)}var p,b,d,g,f,m,v,h,y={evaluateCondition:function(e){if(e&&e.length>=2&&"/"===e[0]&&"/"===e[1])return!0;var t=e?+e:-1;return Number.isNaN(+t)?"true"===e.toLowerCase():0!==t}},k=function(){try{return window.self!==window.top}catch(e){return!0}},w=function(){var e=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getSheetList();case 2:return n=e.sent,r=n.filter((function(e){return y.evaluateCondition(e.qData.showCondition)})),e.abrupt("return",r.sort((function(e,t){return e.qData.rank-t.qData.rank})));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=[{translation:"Object.ActionButton.NoNavigation",value:"none"},{translation:"Object.ActionButton.GoToNextSheet",value:"nextSheet",navigationCall:(h=i(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.senseNavigation,e.next=3,n.nextSheet();case 3:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)}),requiredInput:[]},{translation:"Object.ActionButton.GoToPreviousSheet",value:"prevSheet",navigationCall:(v=i(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.senseNavigation,e.next=3,n.prevSheet();case 3:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)}),requiredInput:[]},{translation:"Object.ActionButton.GoToLastSheet",value:"lastSheet",navigationCall:(m=i(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.app,r=t.senseNavigation,e.next=3,w(n);case 3:return o=e.sent,e.next=6,r.goToSheet(o[o.length-1].qInfo.qId);case 6:case"end":return e.stop()}}),e)}))),function(e){return m.apply(this,arguments)}),requiredInput:[]},{translation:"Object.ActionButton.GoToFirstSheet",value:"firstSheet",navigationCall:(f=i(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.app,r=t.senseNavigation,e.next=3,w(n);case 3:return o=e.sent,e.next=6,r.goToSheet(o[0].qInfo.qId);case 6:case"end":return e.stop()}}),e)}))),function(e){return f.apply(this,arguments)}),requiredInput:[]},{translation:"Object.ActionButton.GoToASheet",value:"goToSheet",navigationCall:(g=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.senseNavigation,r=t.sheet,e.t0=r,!e.t0){e.next=5;break}return e.next=5,n.goToSheet(r);case 5:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)}),requiredInput:["sheet"]},{translation:"Object.ActionButton.GoToSheetById",value:"goToSheetById",navigationCall:(d=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.senseNavigation,r=t.sheet,e.t0=r,!e.t0){e.next=5;break}return e.next=5,n.goToSheet(r);case 5:case"end":return e.stop()}}),e)}))),function(e){return d.apply(this,arguments)}),requiredInput:["sheetId"]},{translation:"Object.ActionButton.GoToStory",value:"goToStory",navigationCall:(b=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.senseNavigation,r=t.story,e.t0=r,!e.t0){e.next=5;break}return e.next=5,n.goToStory(r);case 5:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)}),requiredInput:["story"]},{translation:"Object.ActionButton.OpenWebsiteEmail",value:"openWebsite",navigationCall:(p=i(regeneratorRuntime.mark((function e(t){var n,r,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.websiteUrl,r=t.sameWindow;try{n&&(o=n.match(/^(https?:\/\/|mailto:)/)?n:"http://".concat(n),a="",r&&(a=k()?"_parent":"_self"),window.open(o,a))}catch(e){}case 2:case"end":return e.stop()}}),e)}))),function(e){return p.apply(this,arguments)}),requiredInput:["websiteUrl"]}],S=function(e,t){var n=x.find((function(t){return e.navigation.action===t.value}));return n&&n.requiredInput&&-1!==n.requiredInput.indexOf(t)};var A={getValue:function(e,t,n){var r,o=t.split(".");if(void 0===e)return n;for(r=0;r<o.length;++r){if(void 0===e[o[r]])return n;e=e[o[r]]}return e}};function C(e){switch(e){case"gotoSheet":return"goToSheet";case"gotoSheetById":return"goToSheetById";case"gotoStory":return"goToStory";case"switchToEdit":return"none";default:return e}}var I=function(e,t){var n={qChildren:[]},r=o({actions:[],props:{useEnabledCondition:null,fullWidth:"auto"},qLayoutExclude:{disabled:{}}},t);return e&&"qlik-button-for-navigation"===e.properties.visualization&&Object.keys(e.properties).forEach((function(t){var n;switch(t){case"props":n=e.properties[t],r.style.label=n.buttonLabel,r.style.icon.useIcon=n.buttonShowIcon,r.style.icon.iconType=n.buttonIconLui,r.style.font.align=n.buttonTextAlign,r.useEnabledCondition=n.useEnabledCondition,r.enabledCondition=n.enabledCondition,n.actionItems&&n.actionItems.forEach((function(e){!function(e,t){var n={actionType:e.actionType,bookmark:e.selectedBookmark,field:e.selectedField,variable:e.variable,value:e.value,softLock:e.softLock,cId:e.cId};switch(e.actionType){case"clearOther":n.actionType="clearAllButThis";break;case"unlockAllAndClearAll":n.actionType="clearAll",n.softLock=!0;break;case"selectField":n.actionType="selectMatchingValues";break;case"selectAndLockField":t.actions.push(o(o({},n),{},{cId:null,actionType:"selectMatchingValues"})),n.actionType="lockField"}t.actions.push(n)}(e,r)})),r.navigation={action:C(n.navigationAction),sheet:"gotoSheetById"===n.navigationAction?n.sheetId:n.selectedSheet,story:n.selectedStory,websiteUrl:n.websiteUrl,sameWindow:n.sameWindow};break;case"qStateName":case"showTitles":case"title":case"subtitle":case"footnote":r[t]=e.properties[t]}})),n.qProperty=r,n},q=[{value:"image",icon:"image",label:"Image"},{value:"back",icon:"back",label:"Back"},{value:"forward",icon:"forward",label:"Forward"},{value:"history",icon:"history",label:"History"},{value:"help",icon:"help",label:"Help"},{value:"info",icon:"info",label:"Info"},{value:"text",icon:"text",label:"Text"},{value:"group",icon:"group",label:"Group"},{value:"search",icon:"search",label:"Search"},{value:"zoom-in",icon:"zoom-in",label:"Zoom in"},{value:"zoom-out",icon:"zoom-out",label:"Zoom out"},{value:"export",icon:"export",label:"Export"},{value:"import",icon:"import",label:"Import"},{value:"field",icon:"field",label:"Field"},{value:"lock",icon:"lock",label:"Lock"},{value:"unlock",icon:"unlock",label:"Unlock"},{value:"database",icon:"database",label:"Database"},{value:"calendar",icon:"calendar",label:"Calendar"},{value:"bookmark",icon:"bookmark",label:"Bookmark"},{value:"library",icon:"library",label:"Library"},{value:"star",icon:"star",label:"Star"},{value:"print",icon:"print",label:"Print"},{value:"remove",icon:"remove",label:"Remove"},{value:"handle",icon:"handle",label:"Handle"},{value:"handle-horizontal",icon:"handle-horizontal",label:"Handle horizontal"},{value:"menu",icon:"menu",label:"Menu"},{value:"list",icon:"list",label:"List"},{value:"unordered-list",icon:"unordered-list",label:"Unordered list"},{value:"clock",icon:"clock",label:"Clock"},{value:"puzzle",icon:"puzzle",label:"Puzzle"},{value:"filterpane",icon:"filterpane",label:"Filterpane"},{value:"plus",icon:"plus",label:"Plus"},{value:"minus",icon:"minus",label:"Minus"},{value:"triangle-top",icon:"triangle-top",label:"Triangle top"},{value:"triangle-bottom",icon:"triangle-bottom",label:"Triangle bottom"},{value:"triangle-left",icon:"triangle-left",label:"Triangle left"},{value:"triangle-right",icon:"triangle-right",label:"Triangle right"},{value:"tick",icon:"tick",label:"Tick"},{value:"cogwheel",icon:"cogwheel",label:"Cogwheel"},{value:"settings",icon:"settings",label:"Settings"},{value:"cut",icon:"cut",label:"Cut"},{value:"copy",icon:"copy",label:"Copy"},{value:"paste",icon:"paste",label:"Paste"},{value:"camera",icon:"camera",label:"Camera"},{value:"slide-show",icon:"slide-show",label:"Slide show"},{value:"palette",icon:"palette",label:"Palette"},{value:"shapes",icon:"shapes",label:"Shapes"},{value:"effects",icon:"effects",label:"Effects"},{value:"file",icon:"file",label:"File"},{value:"expand",icon:"expand",label:"Expand"},{value:"collapse",icon:"collapse",label:"Collapse"},{value:"bin",icon:"bin",label:"Bin"},{value:"link",icon:"link",label:"Link"},{value:"pivot",icon:"pivot",label:"Pivot"},{value:"reload",icon:"reload",label:"Reload"},{value:"add",icon:"add",label:"Add"},{value:"edit",icon:"edit",label:"Edit"},{value:"key",icon:"key",label:"Key"},{value:"box",icon:"box",label:"Box"},{value:"home",icon:"home",label:"Home"},{value:"person",icon:"person",label:"Person"},{value:"grid",icon:"grid",label:"Grid"},{value:"cloud",icon:"cloud",label:"Cloud"},{value:"more",icon:"more",label:"More"},{value:"folder",icon:"folder",label:"Folder"},{value:"drop",icon:"drop",label:"Drop"},{value:"play",icon:"play",label:"Play"},{value:"tag",icon:"tag",label:"Tag"},{value:"close",icon:"close",label:"Close"},{value:"warning",icon:"warning",label:"Warning"},{value:"warning-triangle",icon:"warning-triangle",label:"Warning triangle"},{value:"share",icon:"share",label:"Share"},{value:"top",icon:"top",label:"Top"},{value:"low-resolution",icon:"low-resolution",label:"Low resolution"},{value:"high-resolution",icon:"high-resolution",label:"High resolution"},{value:"view",icon:"view",label:"View"},{value:"control",icon:"control",label:"Control"},{value:"code",icon:"code",label:"Code"},{value:"upload",icon:"upload",label:"Upload"},{value:"repair",icon:"repair",label:"Repair"},{value:"split",icon:"split",label:"Split"},{value:"up-down",icon:"up-down",label:"Up down"},{value:"disconnect",icon:"disconnect",label:"Disconnect"},{value:"photo-library",icon:"photo-library",label:"Photo library"},{value:"application",icon:"application",label:"Application"},{value:"new-tab",icon:"new-tab",label:"New tab"},{value:"ascending",icon:"ascending",label:"Ascending"},{value:"descending",icon:"descending",label:"Descending"},{value:"arrow-up",icon:"arrow-up",label:"Arrow up"},{value:"arrow-down",icon:"arrow-down",label:"Arrow down"},{value:"arrow-right",icon:"arrow-right",label:"Arrow right"},{value:"arrow-left",icon:"arrow-left",label:"Arrow left"},{value:"sync",icon:"sync",label:"Sync"},{value:"draggable",icon:"draggable",label:"Draggable"},{value:"book",icon:"book",label:"Book"},{value:"measure",icon:"measure",label:"Measure"},{value:"download",icon:"download",label:"Download"},{value:"more-rounded",icon:"more-rounded",label:"More rounded"},{value:"align-object-left",icon:"align-object-left",label:"Align object-left"},{value:"align-object-center",icon:"align-object-center",label:"Align object-center"},{value:"align-object-right",icon:"align-object-right",label:"Align object-right"},{value:"submit",icon:"submit",label:"Submit"},{value:"operators",icon:"operators",label:"Operators"},{value:"general-data-class",icon:"general-data-class",label:"General data-class"},{value:"building",icon:"building",label:"Building"},{value:"bell",icon:"bell",label:"Bell"},{value:"unlink",icon:"unlink",label:"Unlink"},{value:"lightbulb",icon:"lightbulb",label:"Lightbulb"},{value:"log-in",icon:"log-in",label:"Log in"},{value:"log-out",icon:"log-out",label:"Log out"},{value:"previous",icon:"previous",label:"Previous"},{value:"goto",icon:"goto",label:"Goto"},{value:"save",icon:"save",label:"Save"},{value:"pause",icon:"pause",label:"Pause"},{value:"stop",icon:"stop",label:"Stop"},{value:"step-in",icon:"step-in",label:"Step in"},{value:"comment",icon:"comment",label:"Comment"},{value:"indent",icon:"indent",label:"Indent"},{value:"undent",icon:"undent",label:"Undent"},{value:"filter",icon:"filter",label:"Filter"},{value:"clear-filter",icon:"clear-filter",label:"Clear filter"},{value:"insert",icon:"insert",label:"Insert"},{value:"direction-left",icon:"direction-left",label:"Direction left"},{value:"swap",icon:"swap",label:"Swap"},{value:"bubbles",icon:"bubbles",label:"Bubbles"},{value:"sheet",icon:"sheet",label:"Sheet"},{value:"object",icon:"object",label:"Object"},{value:"clear-selections",icon:"clear-selections",label:"Clear selections"},{value:"selections-tool",icon:"selections-tool",label:"Selections tool"},{value:"selections-reload",icon:"selections-reload",label:"Selections reload"},{value:"selections-back",icon:"selections-back",label:"Selections back"},{value:"selections-forward",icon:"selections-forward",label:"Selections forward"},{value:"expression",icon:"expression",label:"Expression"},{value:"select-alternative",icon:"select-alternative",label:"Select alternative"},{value:"select-possible",icon:"select-possible",label:"Select possible"},{value:"select-excluded",icon:"select-excluded",label:"Select excluded"},{value:"select-all",icon:"select-all",label:"Select all"},{value:"bar-chart",icon:"bar-chart",label:"Bar chart"},{value:"bar-chart-horizontal",icon:"bar-chart-horizontal",label:"Bar chart-horizontal"},{value:"line-chart",icon:"line-chart",label:"Line chart"},{value:"pie-chart",icon:"pie-chart",label:"Pie chart"},{value:"gauge-chart",icon:"gauge-chart",label:"Gauge chart"},{value:"kpi",icon:"kpi",label:"Kpi"},{value:"scatter-chart",icon:"scatter-chart",label:"Scatter chart"},{value:"map",icon:"map",label:"Map"},{value:"table",icon:"table",label:"Table"},{value:"pivot-table",icon:"pivot-table",label:"Pivot table"},{value:"treemap",icon:"treemap",label:"Treemap"},{value:"combo-chart",icon:"combo-chart",label:"Combo chart"},{value:"boxplot",icon:"boxplot",label:"Boxplot"},{value:"distributionplot",icon:"distributionplot",label:"Distributionplot"},{value:"histogram",icon:"histogram",label:"Histogram"},{value:"direct-discovery",icon:"direct-discovery",label:"Direct discovery"},{value:"data-model",icon:"data-model",label:"Data model"},{value:"script",icon:"script",label:"Script"},{value:"script-ok",icon:"script-ok",label:"Script ok"},{value:"debug",icon:"debug",label:"Debug"},{value:"auto-layout",icon:"auto-layout",label:"Auto layout"}],R=[{value:!1,translation:"properties.colorMode.primary"},{value:!0,translation:"properties.colorMode.byExpression"}],B=[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}];function O(e){var t,n,r,o,a,l,c=e.translator,p=e.automationsEnabled;return{definition:{type:"items",component:"accordion",items:{actions:{type:"items",translation:"Object.ActionButton.ActionsAndNavigation",grouped:!0,items:{actions:{type:"array",translation:"Object.ActionButton.Actions",ref:"actions",itemTitleRef:function(e){if(e.actionLabel)return e.actionLabel;var t=e.actionType?"Object.ActionButton.InvalidAction":"Object.ActionButton.NewAction",n=s.find((function(t){return e.actionType===t.value}));return c.get(n&&n.translation||t)},allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"Object.ActionButton.AddAction",items:{label:{component:"string",ref:"actionLabel",translation:"Common.Label",expression:"optional",defaultValue:""},actionType:{type:"string",ref:"actionType",component:"expression-with-dropdown",translation:"Object.ActionButton.Action",defaultValue:"",options:s.filter((function(e){return"executeAutomation"!==e.value||p})),dropdownOnly:!0},bookmark:{type:"string",ref:"bookmark",component:"expression-with-dropdown",translation:"ExpressionEditor.SetExpresions.Bookmark",defaultValue:"",dropdownOnly:!0,options:(l=i(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.app.getBookmarkList();case 2:return r=e.sent,e.abrupt("return",r.map((function(e){return{label:e.qData.title,value:e.qInfo.qId}})));case 4:case"end":return e.stop()}}),e)}))),function(e,t){return l.apply(this,arguments)}),show:function(e){return u(e,"bookmark")}},field:{type:"string",ref:"field",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:(a=i(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.app.getFieldList();case 2:return r=e.sent,e.abrupt("return",r.map((function(e){return{label:e.qName,value:e.qName}})));case 4:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)}),show:function(e){return u(e,"field")}},variable:{type:"string",ref:"variable",component:"expression-with-dropdown",translation:"Common.Variable",defaultValue:"",expressionType:"StringExpression",options:(o=i(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.app.getVariableList();case 2:return r=e.sent,e.abrupt("return",r.filter((function(e){return!e.qIsReserved||e.qIsReserved&&t.showSystemVariables})).map((function(e){return{label:e.qName,value:e.qName}})));case 4:case"end":return e.stop()}}),e)}))),function(e,t){return o.apply(this,arguments)}),show:function(e){return u(e,"variable")}},showSystemVariables:{type:"boolean",ref:"showSystemVariables",translation:"ExpressionEditor.SystemVariables",defaultValue:!1,show:function(e){return u(e,"variable")}},softLock:{type:"boolean",ref:"softLock",translation:"Object.ActionButton.Softlock",defaultValue:!1,show:function(e){return u(e,"softLock")}},value:{type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(e){return u(e,"value")}},partial:{type:"boolean",ref:"partial",translation:"Object.ActionButton.Partial",defaultValue:!1,show:function(e){return u(e,"partial")}},automation:{type:"string",component:"dropdown",translation:"Object.ActionButton.Automation",ref:"automation",options:(r=i(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("../api/v1/items?resourceType=automation").then((function(e){return e.json()}));case 2:return t=e.sent,e.abrupt("return",t.data.map((function(e){return{value:e.id,label:e.name}})));case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),show:function(e){return u(e,"automation")}},automationPostData:{type:"boolean",ref:"automationPostData",translation:"Object.ActionButton.Automation.SendSelections",show:function(e){return u(e,"automation")},defaultValue:!1}}},navigation:{translation:"Object.ActionButton.Navigation",type:"items",items:{action:{ref:"navigation.action",translation:"Object.ActionButton.Navigation",component:"expression-with-dropdown",defaultValue:null,options:x,dropdownOnly:!0},sheetId:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",expression:"optional",show:function(e){return S(e,"sheetId")}},sheet:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",component:"expression-with-dropdown",expressionType:"StringExpression",show:function(e){return S(e,"sheet")},options:(n=i(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.app.getSheetList();case 2:return r=e.sent,e.abrupt("return",r.map((function(e){return{value:e.qInfo.qId,label:e.qMeta.title,showCondition:e.qData.showCondition}})));case 4:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},story:{type:"string",ref:"navigation.story",translation:"properties.story",component:"expression-with-dropdown",expressionType:"StringExpression",show:function(e){return S(e,"story")},options:(t=i(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.app.getStoryList();case 2:return r=e.sent,e.abrupt("return",r.map((function(e){return{value:e.qInfo.qId,label:e.qMeta.title}})));case 4:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},websiteUrl:{type:"string",expression:"optional",ref:"navigation.websiteUrl",translation:"properties.website",show:function(e){return S(e,"websiteUrl")}},sameWindow:{type:"boolean",ref:"navigation.sameWindow",translation:"properties.sameWindow",show:function(e){return S(e,"websiteUrl")},defaultValue:!1}}}}},enableCondition:{type:"items",translation:"properties.enableConditionSection",items:{useCondition:{type:"boolean",component:"switch",translation:"properties.enableToggle",ref:"useEnabledCondition",options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},condition:{ref:"enabledCondition",translation:"properties.enableCondition",type:"integer",expression:"optional",show:function(e){return e.useEnabledCondition}}}},settings:{component:"expandable-items",translation:"Common.Appearance",uses:"settings",items:{general:{type:"items",translation:"properties.general",items:{showTitles:{},details:{show:!1},label:{component:"string",ref:"style.label",translation:"Common.Label",expression:"optional"}}},font:{grouped:!0,type:"items",translation:"properties.font",items:{sizeAndColor:{type:"items",items:{fontSize:{component:"slider",type:"number",ref:"style.font.size",translation:"properties.fontSize",min:.2,max:1,step:.01},useFontColorExpression:{ref:"style.font.useColorExpression",type:"boolean",translation:"properties.fontColor",component:"dropdown",options:R},colorPicker:{component:"color-picker",type:"object",ref:"style.font.color",translation:"properties.color",dualOutput:!0,show:function(e){return!A.getValue(e,"style.font.useColorExpression")}},colorExpression:{component:"string",type:"string",ref:"style.font.colorExpression",translation:"Common.Expression",expression:"optional",show:function(e){return A.getValue(e,"style.font.useColorExpression")}}}},stylingAndAlign:{type:"items",items:{fontStyling:{component:"item-selection-list",type:"string",ref:"style.font.style",translation:"properties.textStyle",horizontal:!0,multipleSelect:!0,items:[{component:"icon-item",icon:"bold",value:"bold",translation:"Common.bold",labelPlacement:"bottom"},{component:"icon-item",icon:"italic",value:"italic",translation:"Common.italic",labelPlacement:"bottom"},{component:"icon-item",icon:"underline",value:"underline",translation:"Common.underline",labelPlacement:"bottom"}]},textAlign:{component:"item-selection-list",type:"string",ref:"style.font.align",translation:"properties.Alignment",horizontal:!0,items:[{component:"icon-item",icon:"align_left",value:"left",translation:"properties.dock.left",labelPlacement:"bottom"},{component:"icon-item",icon:"align_center",value:"center",translation:"Common.Center",labelPlacement:"bottom"},{component:"icon-item",icon:"align_right",value:"right",translation:"properties.dock.right",labelPlacement:"bottom"}]}}}}},background:{grouped:!0,type:"items",translation:"properties.background",items:{backgroundColor:{type:"items",items:{useColorExpression:{ref:"style.background.useColorExpression",type:"boolean",translation:"AppDetails.SheetBackgroundColor",component:"dropdown",options:R},colorPicker:{component:"color-picker",type:"object",ref:"style.background.color",translation:"properties.color",dualOutput:!0,show:function(e){return!A.getValue(e,"style.background.useColorExpression")}},colorExpression:{component:"string",type:"string",ref:"style.background.colorExpression",translation:"Common.Expression",expression:"optional",show:function(e){return A.getValue(e,"style.background.useColorExpression")}}}},backgroundImage:{type:"items",items:{useBackgroundImage:{ref:"style.background.useImage",type:"boolean",translation:"properties.backgroundImage.use",component:"switch",options:B},backgroundUrl:{ref:"style.background.url.qStaticContentUrlDef.qUrl",layoutRef:"style.background.url.qStaticContentUrl.qUrl",schemaIgnore:!0,translation:"Common.Image",tooltip:{select:"properties.media.select",remove:"properties.media.removeBackground"},type:"string",component:"media",show:function(e){return A.getValue(e,"style.background.useImage")}},backgroundSize:{ref:"style.background.size",translation:"properties.backgroundImage.size",type:"string",component:"dropdown",options:[{value:"auto",translation:"properties.backgroundImage.originalSize"},{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"alwaysFill",translation:"properties.backgroundImage.sizeAlwaysFill"}],show:function(e){return A.getValue(e,"style.background.useImage")&&!!A.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")}},backgroundPosition:{ref:"style.background.position",translation:"Common.Position",type:"string",component:"align-matrix",show:function(e){return A.getValue(e,"style.background.useImage")&&A.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")&&"fill"!==A.getValue(e,"style.background.size")},currentSize:function(e){return A.getValue(e,"style.background.size")}}}}}},border:{type:"items",grouped:!0,translation:"properties.border",items:{borderSettings:{type:"items",items:{useBorder:{ref:"style.border.useBorder",type:"boolean",translation:"properties.border.use",component:"switch",options:B},borderRadius:{component:"slider",show:function(e){return A.getValue(e,"style.border.useBorder")},translation:"properties.border.radius",type:"number",ref:"style.border.radius",min:0,max:1,step:.01},borderWidth:{component:"slider",show:function(e){return A.getValue(e,"style.border.useBorder")},type:"number",ref:"style.border.width",translation:"properties.border.width",min:0,max:.5,step:.005},colorDropdown:{type:"string",show:function(e){return A.getValue(e,"style.border.useBorder")},component:"dropdown",translation:"properties.border.color",ref:"style.border.useColorExpression",options:R},colorPicker:{component:"color-picker",type:"object",ref:"style.border.color",translation:"properties.color",dualOutput:!0,show:function(e){return A.getValue(e,"style.border.useBorder")&&!A.getValue(e,"style.border.useColorExpression")}},colorExpression:{component:"string",type:"string",ref:"style.border.colorExpression",translation:"Common.Expression",show:function(e){return A.getValue(e,"style.border.useBorder")&&A.getValue(e,"style.border.useColorExpression")},expression:"optional"}}}}},icon:{type:"items",grouped:!0,translation:"properties.icon",items:{iconSettings:{type:"items",items:{useIcon:{ref:"style.icon.useIcon",type:"boolean",translation:"properties.icon.use",component:"switch",options:B},iconType:{ref:"style.icon.iconType",component:"expression-with-dropdown",translation:"properties.icon",defaultValue:"",options:q,expressionType:"StringExpression",show:function(e){return A.getValue(e,"style.icon.useIcon")}},iconPosition:{ref:"style.icon.position",component:"dropdown",translation:"Common.Position",options:[{translation:"properties.dock.left",value:"left"},{translation:"properties.dock.right",value:"right"}],show:function(e){return A.getValue(e,"style.icon.useIcon")}}}}}}}}}},importProperties:I,exportProperties:null,support:{export:!1,exportData:!1,snapshot:!1,viewData:!1,quickMobile:!0}}}var T={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},j=function(e){var t=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e);if(t)return"rgb(".concat(t[1],",").concat(t[2],",").concat(t[3],")");if(t=/^argb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e)){var n=Math.round(t[1]/255*100)/100;return"rgba(".concat(t[2],",").concat(t[3],",").concat(t[4],",").concat(n,")")}if(t=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(e))return e;var r=e&&T[e.toLowerCase()];if(r){var o=void 0!==r.a?r.a:1;return"rgba(".concat(r.r,",").concat(r.g,",").concat(r.b,",").concat(o,")")}return"none"},E=function(e){var t,n,r,o,a=.15;if(e.length>7){var i=-1!==(t=e.split(","))[0].indexOf("a");return n=i?parseInt(t[0].slice(5),10):parseInt(t[0].slice(4),10),o=parseInt(t[1],10),r=parseInt(t[2],10),"".concat((i?"rgba(":"rgb(")+(Math.round((0-n)*a)+n),",").concat(Math.round((0-o)*a)+o,",").concat(Math.round((0-r)*a)+r).concat(i?",".concat(t[3]):")")}return n=(t=parseInt(e.slice(1),16))>>16,o=t>>8&255,r=255&t,"#".concat((16777216+65536*(Math.round((0-n)*a)+n)+256*(Math.round((0-o)*a)+o)+(Math.round((0-r)*a)+r)).toString(16).slice(1))},L=function(e){e.replace(/^\.\.\//i,"/"),e=(e=e.replace(/"/g,'\\"')).replace(/'/g,"\\'");var t=document.createElement("a");return t.href="../",e=t.href+("/"===e[0]?e.substr(1):e)},z={auto:"auto auto",alwaysFit:"contain",fitWidth:"100% auto",fitHeight:"auto 100%",fill:"100% 100%",alwaysFill:"cover"},V={topLeft:"0% 0%",centerLeft:"50% 0%",bottomLeft:"100% 0%",topCenter:"0% 50%",centerCenter:"50% 50%",bottomCenter:"100% 50%",topRight:"0% 100%",centerRight:"50% 100%",bottomRight:"100% 100%"},N=function(e,t){return"".concat(e,": ").concat(t,";")},P=function(e,t,n){var r,o=e.useColorExpression,a=e.colorExpression,i=e.color;return o?r=j(a):"string"==typeof i?r=i:i&&(r=n.getColorPickerColor(i)),r&&"none"!==r?r:t},F=function(e){var t=e.style,n=e.disabled,r=e.theme,o=e.element,a="width: 100%;height: 100%;transition: transform .1s ease-in-out;position: absolute;",i=t.font,l=t.background,c=t.border,s=r.getDataColorSpecials().primary;a+=n?N("opacity",.4):N("cursor","pointer"),a+=N("color",P(i,"#ffffff",r)),i.style.bold&&(a+=N("font-weight","bold")),i.style.italic&&(a+=N("font-style","italic"));var u=P(l,s,r);if(a+=N("background-color",u),l.useImage&&l.url.qStaticContentUrl){var p=l.url.qStaticContentUrl.qUrl;p&&(p=L(p),a+=N("background-image","url('".concat(p,"')")),a+=N("background-size",z[l.size]),a+=N("background-position",V[l.position]),a+=N("background-repeat","no-repeat"))}if(c.useBorder){var b=Math.min(o.offsetWidth,o.offsetHeight),d=P(c,E(u),r),g=c.width*b/2;a+=N("border","".concat(g,"px solid ").concat(d)),a+=N("border-radius","".concat(c.radius*b/2,"px"))}else a+="border: none;";return a},D=function(e){var t=e.button,n=e.theme,r=e.style,o=e.isSense,a=r.icon,i=r.font,l=r.label,c=document.createElement("text");c.style.whiteSpace="nowrap",c.style.fontFamily=n.getStyle("","","fontFamily");var s=document.createElement("span");s.textContent=l,s.style.whiteSpace="nowrap",s.style.textOverflow="ellipsis",s.style.overflow="visible",i.style.underline&&(s.style.textDecoration="underline"),c.appendChild(s);var u=o&&a.useIcon&&""!==a.iconType;if(u){var p=document.createElement("span"),b=q.find((function(e){return e.label===a.iconType||e.value===a.iconType}));p.style.textDecoration="none",p.style.fontSize="inherit",p.setAttribute("class","lui-icon lui-icon--".concat(b?b.value:"")),"left"===a.position?c.insertBefore(p,s):c.appendChild(p)}t.innerHTML="",t.appendChild(c),c.style.fontSize="".concat(t.clientHeight,"px");var d=t.clientHeight/c.offsetHeight*t.clientHeight;c.style.fontSize="".concat(d,"px"),c.offsetWidth>t.clientWidth&&(d*=t.clientWidth/c.offsetWidth),i.style.italic?u?(c.style.fontSize="".concat(Math.max(d*i.size*.84,8),"px"),c.children[0].style.marginRight="".concat(.04*c.offsetWidth,"px"),c.children[1].style.marginRight="".concat(.04*c.offsetWidth,"px")):(c.style.fontSize="".concat(Math.max(d*i.size*.9,8),"px"),c.children[0].style.marginRight="".concat(.02*c.offsetWidth,"px")):u?(c.style.fontSize="".concat(Math.max(d*i.size*.88,8),"px"),c.children[0].style.marginRight="".concat(.04*c.offsetWidth,"px")):c.style.fontSize="".concat(Math.max(d*i.size*.92,8),"px"),"8px"===c.style.fontSize&&c.children.forEach((function(e){e.style.overflow="hidden"})),c.style.margin="0 3%",c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="left"===i.align?"flex-start":"right"===i.align?"flex-end":"center"},M=function(){var e=i(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<t.length)){e.next=7;break}return e.next=4,t[n]();case 4:n++,e.next=1;break;case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return function(r){var a=r.sense,l=r.translator,c=r.flags.isEnabled,u=a&&a.navigation,p=c("ACTION_BUTTON_AUTOMATIONS");return t.style.label=a?l.get("Object.ActionButton"):"Button",{qae:{properties:t,data:n},component:function(){var t=e.useElement(),n=e.useTheme();e.useMemo((function(){var e=document.createElement("button");e.appendChild(document.createElement("text")),t.appendChild(e)}),[]);var r=e.useStaleLayout(),a=e.useApp(),l=e.useConstraints(),c=function(e){var t=e.layout,n=e.theme,r=e.app,a=e.constraints,l=e.senseNavigation,c=e.element,u=!!l,p=c.firstElementChild,b=t.style,d=t.qStateName,g=t.useEnabledCondition&&0===t.enabledCondition,f=!g&&!a.active,m=F({style:b,disabled:g,theme:n,element:c});p.setAttribute("style",m),D({button:p,theme:n,style:b,isSense:u}),p.onclick=i(regeneratorRuntime.mark((function e(){var n,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f){e.next=14;break}return n=[],t.actions.forEach((function(e){var t=s.find((function(t){return t.value===e.actionType}));t&&n.push(t.getActionCall(o({app:r,qStateName:d},e)))})),p.setAttribute("disabled",!0),e.next=7,M(n);case 7:if(!l||l.getCurrentStoryId()){e.next=13;break}if(a=t.navigation,i=a&&x.find((function(e){return e.value===a.action})),!l||!i||"function"!=typeof i.navigationCall){e.next=13;break}return e.next=13,i.navigationCall(o({app:r,senseNavigation:l},a));case 13:p.removeAttribute("disabled");case 14:case"end":return e.stop()}}),e)})));var v=function(){if(f){var e=p.offsetWidth,t=p.offsetHeight;p.style.transform=t>e?"scale(".concat(.98,", ",1-e/t*.02,")"):"scale(".concat(1-t/e*.02,", ",.98,")")}},h=function(){var e=p.style.transform;f&&""!==e&&"scale(1)"!==e&&(p.style.transform="scale(1)")};return p.onmousedown=function(e){0===e.button&&v()},p.onmouseup=h,p.onmouseleave=h,p.ontouchstart=v,p.ontouchend=h,p.ontouchcancel=h,function(){p.onclick=void 0,p.onmousedown=void 0,p.onmouseup=void 0,p.onmouseleave=void 0,p.ontouchstart=void 0,p.ontouchend=void 0,p.ontouchcancel=void 0}}({element:t,layout:r,constraints:l,theme:n,app:a,senseNavigation:u,automationsEnabled:p});e.useEffect((function(){return function(){c()}}),[t]),e.useImperativeHandle((function(){return{focus:function(){t.firstElementChild.onclick()}}}),[t])},ext:O({translator:l,automationsEnabled:p})}}}));
8
- //# sourceMappingURL=sn-action-button.js.map
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-action-button"]=t(e.stardust)}(this,(function(e){"use strict";var t={LABEL:"Button",FONT_SIZE:.5,COLOR:{index:-1,color:null},FONT_STYLE:{bold:!0,italic:!1,underline:!1},TEXT_ALIGN:"center",BACKGROUND_SIZE:"auto",BACKGROUND_POSITION:"centerCenter",BORDER_RADIUS:0,BORDER_WIDTH:0,ICON_POSITION:"left"};const o={version:"1.15.2",showTitles:!0,title:"",subtitle:"",footnote:"",useEnabledCondition:!1,enabledCondition:1,actions:[],navigation:{action:"none"},style:{label:t.LABEL,font:{useColorExpression:!1,color:t.COLOR,colorExpression:"",size:t.FONT_SIZE,style:t.FONT_STYLE,align:t.TEXT_ALIGN},background:{useColorExpression:!1,color:t.COLOR,colorExpression:"",useImage:!1,url:{qStaticContentUrlDef:{qUrl:""}},size:t.BACKGROUND_SIZE,position:t.BACKGROUND_POSITION},border:{useColorExpression:!1,color:t.COLOR,colorExpression:"",useBorder:!1,radius:t.BORDER_RADIUS,width:t.BORDER_WIDTH},icon:{useIcon:!1,iconType:"",position:t.ICON_POSITION}}};var a={targets:[]};const n=[{value:"applyBookmark",translation:"Object.ActionButton.ApplyBookmark",group:"bookmark",getActionCall:({app:e,bookmark:t})=>async()=>{const o=(await e.getBookmarkList()).find((e=>e.qData.title===t));t&&await e.applyBookmark(o&&o.qInfo&&o.qInfo.qId||t)},requiredInput:["bookmark"]},{value:"back",translation:"Object.ActionButton.MoveBackward",group:"selection",getActionCall:({app:e})=>async()=>{await e.back()},requiredInput:[]},{value:"forward",translation:"Object.ActionButton.MoveForward",group:"selection",getActionCall:({app:e})=>async()=>{await e.forward()},requiredInput:[]},{value:"clearAll",translation:"Object.ActionButton.ClearAll",group:"selection",getActionCall:({app:e,softLock:t})=>async()=>{await e.clearAll(t)},requiredInput:["softLock"]},{value:"clearAllButThis",translation:"Object.ActionButton.ClearAllButThis",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.clearAllButThis(a)}},requiredInput:["field","softLock"]},{value:"clearField",translation:"Object.ActionButton.ClearSelectionInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.clear()}},requiredInput:["field"]},{value:"selectAll",translation:"Object.ActionButton.SelectAllInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectAll(a)}},requiredInput:["field","softLock"]},{value:"selectValues",translation:"Object.ActionButton.SelectValuesInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t),i=await e.getFieldDescription(o),r=await(async(e,t,o)=>{let a=t.split(";");if(o){let t="";a.forEach((e=>{t+=`Num('${e}')&';'&`})),a=(await e.evaluate(t.slice(0,-5))).split(";")}return a.map((e=>Number.isNaN(+e)?{qText:e}:{qIsNumeric:!0,qNumber:Number(e)}))})(e,a,i.qTags.includes("$date"));await l.selectValues(r,!1,n)}},requiredInput:["field","value","softLock"]},{value:"selectMatchingValues",translation:"Object.ActionButton.SelectMatchingValues",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t);await l.select(a,!1,n)}},requiredInput:["field","value","softLock"]},{value:"selectAlternative",translation:"Object.ActionButton.SelectAlternatives",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectAlternative(a)}},requiredInput:["field","softLock"]},{value:"selectExcluded",translation:"Object.ActionButton.SelectExcluded",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectExcluded(a)}},requiredInput:["field","softLock"]},{value:"selectPossible",translation:"Object.ActionButton.SelectPossibleValues",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectPossible(a)}},requiredInput:["field","softLock"]},{value:"toggleSelect",translation:"Object.ActionButton.ToggleFieldSelection",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t);await l.toggleSelect(a,n)}},requiredInput:["field","value","softLock"]},{value:"lockAll",translation:"Object.ActionButton.LockAllSelections",group:"selection",getActionCall:({app:e})=>async()=>{await e.lockAll()},requiredInput:[]},{value:"lockField",translation:"Object.ActionButton.LockField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.lock()}},requiredInput:["field"]},{value:"unlockAll",translation:"Object.ActionButton.UnlockAllSelections",group:"selection",getActionCall:({app:e})=>async()=>{await e.unlockAll()},requiredInput:[]},{value:"unlockField",translation:"Object.ActionButton.UnlockAField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.unlock()}},requiredInput:["field"]},{value:"setVariable",translation:"Object.ActionButton.SetVariable",group:"variables",getActionCall:({app:e,variable:t,value:o})=>async()=>{if(t&&o)try{const a=await e.getVariableByName(t);await a.setStringValue(o)}catch(e){}},requiredInput:["variable","value"]},{value:"doReload",translation:"Object.ActionButton.DoReload",group:"reload",getActionCall:({app:e,partial:t})=>async()=>{await e.doReload(0,!!t,!1)&&await e.doSave()},requiredInput:["partial"]},{translation:"Object.ActionButton.ExecuteAutomation",value:"executeAutomation",getActionCall:({app:e,automation:t,automationPostData:o})=>async()=>{if(void 0!==t)try{t=encodeURIComponent(t);const a=await fetch(`../api/v1/items/${t}`).then((e=>e.json())),n=await fetch(`../api/v1/automations/${a.resourceId}`).then((e=>e.json()));let l=`../api/v1/automations/${n.guid}/actions/execute?X-Execution-Token=${n.execution_token}`;if(o&&n.hasinputs){const o=await fetch(`../api/v1/automations/${a.resourceId}/blocks`).then((e=>e.json())).then((e=>{let t;for(let o=0;o<e.blocks.length;o++)if("Inputs"===e.blocks[o].displayName){t=e.blocks[o].form;break}return t})),n=new Date,i={qProp:{qInfo:{qId:`automation_${e.id}_${t}_${n.getTime()}`,qType:"bookmark"},qMetaDef:{title:`Generated automation bookmark on ${n.toISOString()}`,description:"Generated to provide target automation with bookmark to get current selection state",_createdBy:"sn-action-button",_createdFor:"automation",_createdOn:`${n.toISOString()}`,_id:`automation_${encodeURIComponent(e.id)}_${t}_${n.getTime()}`}}},r=await e.createBookmark(i).then((e=>e.getLayout())).then((e=>e.qInfo.qId));await e.saveObjects(),l=`${l}&${o[0].label.toLowerCase()}=${encodeURIComponent(e.id)}&${o[1].label.toLowerCase()}=${r}`}await fetch(l).then((e=>e.json()))}catch(e){}},requiredInput:["automation"]}];function l(e,t){const o=n.find((t=>e.actionType===t.value));return o&&o.requiredInput&&-1!==o.requiredInput.indexOf(t)}var i={evaluateCondition:function(e){if(e&&e.length>=2&&"/"===e[0]&&"/"===e[1])return!0;const t=e?+e:-1;return Number.isNaN(+t)?"true"===e.toLowerCase():0!==t}};const r=async e=>(await e.getSheetList()).filter((e=>i.evaluateCondition(e.qData.showCondition))).sort(((e,t)=>e.qData.rank-t.qData.rank)),s=[{translation:"Object.ActionButton.NoNavigation",value:"none"},{translation:"Object.ActionButton.GoToNextSheet",value:"nextSheet",navigationCall:async({senseNavigation:e})=>{await e.nextSheet()},requiredInput:[]},{translation:"Object.ActionButton.GoToPreviousSheet",value:"prevSheet",navigationCall:async({senseNavigation:e})=>{await e.prevSheet()},requiredInput:[]},{translation:"Object.ActionButton.GoToLastSheet",value:"lastSheet",navigationCall:async({app:e,senseNavigation:t})=>{const o=await r(e);await t.goToSheet(o[o.length-1].qInfo.qId)},requiredInput:[]},{translation:"Object.ActionButton.GoToFirstSheet",value:"firstSheet",navigationCall:async({app:e,senseNavigation:t})=>{const o=await r(e);await t.goToSheet(o[0].qInfo.qId)},requiredInput:[]},{translation:"Object.ActionButton.GoToASheet",value:"goToSheet",navigationCall:async({senseNavigation:e,sheet:t})=>{t&&await e.goToSheet(t)},requiredInput:["sheet"]},{translation:"Object.ActionButton.GoToSheetById",value:"goToSheetById",navigationCall:async({senseNavigation:e,sheet:t})=>{t&&await e.goToSheet(t)},requiredInput:["sheetId"]},{translation:"Object.ActionButton.GoToStory",value:"goToStory",navigationCall:async({senseNavigation:e,story:t})=>{t&&await e.goToStory(t)},requiredInput:["story"]},{translation:"Object.ActionButton.OpenWebsiteEmail",value:"openWebsite",navigationCall:async({websiteUrl:e,sameWindow:t})=>{try{if(e){const o=e.match(/^(https?:\/\/|mailto:)/)?e:`http://${e}`;let a="";t&&(a=(()=>{try{return window.self!==window.top}catch(e){return!0}})()?"_parent":"_self"),window.open(o,a)}}catch(e){}},requiredInput:["websiteUrl"]}],c=(e,t)=>{const o=s.find((t=>e.navigation.action===t.value));return o&&o.requiredInput&&-1!==o.requiredInput.indexOf(t)};var u={getValue:function(e,t,o){const a=t.split(".");let n;if(void 0===e)return o;for(n=0;n<a.length;++n){if(void 0===e[a[n]])return o;e=e[a[n]]}return e}};function p(e){switch(e){case"gotoSheet":return"goToSheet";case"gotoSheetById":return"goToSheetById";case"gotoStory":return"goToStory";case"switchToEdit":return"none";default:return e}}const b=(e,t)=>{const o={qChildren:[]},a={actions:[],props:{useEnabledCondition:null,fullWidth:"auto"},qLayoutExclude:{disabled:{}},...t};return e&&"qlik-button-for-navigation"===e.properties.visualization&&Object.keys(e.properties).forEach((t=>{let o;switch(t){case"props":o=e.properties[t],a.style.label=o.buttonLabel,a.style.icon.useIcon=o.buttonShowIcon,a.style.icon.iconType=o.buttonIconLui,a.style.font.align=o.buttonTextAlign,a.useEnabledCondition=o.useEnabledCondition,a.enabledCondition=o.enabledCondition,o.actionItems&&o.actionItems.forEach((e=>{!function(e,t){const o={actionType:e.actionType,bookmark:e.selectedBookmark,field:e.selectedField,variable:e.variable,value:e.value,softLock:e.softLock,cId:e.cId};switch(e.actionType){case"clearOther":o.actionType="clearAllButThis";break;case"unlockAllAndClearAll":o.actionType="clearAll",o.softLock=!0;break;case"selectField":o.actionType="selectMatchingValues";break;case"selectAndLockField":t.actions.push({...o,cId:null,actionType:"selectMatchingValues"}),o.actionType="lockField"}t.actions.push(o)}(e,a)})),a.navigation={action:p(o.navigationAction),sheet:"gotoSheetById"===o.navigationAction?o.sheetId:o.selectedSheet,story:o.selectedStory,websiteUrl:o.websiteUrl,sameWindow:o.sameWindow};break;case"qStateName":case"showTitles":case"title":case"subtitle":case"footnote":a[t]=e.properties[t]}})),o.qProperty=a,o};var d=[{value:"image",icon:"image",label:"Image"},{value:"back",icon:"back",label:"Back"},{value:"forward",icon:"forward",label:"Forward"},{value:"history",icon:"history",label:"History"},{value:"help",icon:"help",label:"Help"},{value:"info",icon:"info",label:"Info"},{value:"text",icon:"text",label:"Text"},{value:"group",icon:"group",label:"Group"},{value:"search",icon:"search",label:"Search"},{value:"zoom-in",icon:"zoom-in",label:"Zoom in"},{value:"zoom-out",icon:"zoom-out",label:"Zoom out"},{value:"export",icon:"export",label:"Export"},{value:"import",icon:"import",label:"Import"},{value:"field",icon:"field",label:"Field"},{value:"lock",icon:"lock",label:"Lock"},{value:"unlock",icon:"unlock",label:"Unlock"},{value:"database",icon:"database",label:"Database"},{value:"calendar",icon:"calendar",label:"Calendar"},{value:"bookmark",icon:"bookmark",label:"Bookmark"},{value:"library",icon:"library",label:"Library"},{value:"star",icon:"star",label:"Star"},{value:"print",icon:"print",label:"Print"},{value:"remove",icon:"remove",label:"Remove"},{value:"handle",icon:"handle",label:"Handle"},{value:"handle-horizontal",icon:"handle-horizontal",label:"Handle horizontal"},{value:"menu",icon:"menu",label:"Menu"},{value:"list",icon:"list",label:"List"},{value:"unordered-list",icon:"unordered-list",label:"Unordered list"},{value:"clock",icon:"clock",label:"Clock"},{value:"puzzle",icon:"puzzle",label:"Puzzle"},{value:"filterpane",icon:"filterpane",label:"Filterpane"},{value:"plus",icon:"plus",label:"Plus"},{value:"minus",icon:"minus",label:"Minus"},{value:"triangle-top",icon:"triangle-top",label:"Triangle top"},{value:"triangle-bottom",icon:"triangle-bottom",label:"Triangle bottom"},{value:"triangle-left",icon:"triangle-left",label:"Triangle left"},{value:"triangle-right",icon:"triangle-right",label:"Triangle right"},{value:"tick",icon:"tick",label:"Tick"},{value:"cogwheel",icon:"cogwheel",label:"Cogwheel"},{value:"settings",icon:"settings",label:"Settings"},{value:"cut",icon:"cut",label:"Cut"},{value:"copy",icon:"copy",label:"Copy"},{value:"paste",icon:"paste",label:"Paste"},{value:"camera",icon:"camera",label:"Camera"},{value:"slide-show",icon:"slide-show",label:"Slide show"},{value:"palette",icon:"palette",label:"Palette"},{value:"shapes",icon:"shapes",label:"Shapes"},{value:"effects",icon:"effects",label:"Effects"},{value:"file",icon:"file",label:"File"},{value:"expand",icon:"expand",label:"Expand"},{value:"collapse",icon:"collapse",label:"Collapse"},{value:"bin",icon:"bin",label:"Bin"},{value:"link",icon:"link",label:"Link"},{value:"pivot",icon:"pivot",label:"Pivot"},{value:"reload",icon:"reload",label:"Reload"},{value:"add",icon:"add",label:"Add"},{value:"edit",icon:"edit",label:"Edit"},{value:"key",icon:"key",label:"Key"},{value:"box",icon:"box",label:"Box"},{value:"home",icon:"home",label:"Home"},{value:"person",icon:"person",label:"Person"},{value:"grid",icon:"grid",label:"Grid"},{value:"cloud",icon:"cloud",label:"Cloud"},{value:"more",icon:"more",label:"More"},{value:"folder",icon:"folder",label:"Folder"},{value:"drop",icon:"drop",label:"Drop"},{value:"play",icon:"play",label:"Play"},{value:"tag",icon:"tag",label:"Tag"},{value:"close",icon:"close",label:"Close"},{value:"warning",icon:"warning",label:"Warning"},{value:"warning-triangle",icon:"warning-triangle",label:"Warning triangle"},{value:"share",icon:"share",label:"Share"},{value:"top",icon:"top",label:"Top"},{value:"low-resolution",icon:"low-resolution",label:"Low resolution"},{value:"high-resolution",icon:"high-resolution",label:"High resolution"},{value:"view",icon:"view",label:"View"},{value:"control",icon:"control",label:"Control"},{value:"code",icon:"code",label:"Code"},{value:"upload",icon:"upload",label:"Upload"},{value:"repair",icon:"repair",label:"Repair"},{value:"split",icon:"split",label:"Split"},{value:"up-down",icon:"up-down",label:"Up down"},{value:"disconnect",icon:"disconnect",label:"Disconnect"},{value:"photo-library",icon:"photo-library",label:"Photo library"},{value:"application",icon:"application",label:"Application"},{value:"new-tab",icon:"new-tab",label:"New tab"},{value:"ascending",icon:"ascending",label:"Ascending"},{value:"descending",icon:"descending",label:"Descending"},{value:"arrow-up",icon:"arrow-up",label:"Arrow up"},{value:"arrow-down",icon:"arrow-down",label:"Arrow down"},{value:"arrow-right",icon:"arrow-right",label:"Arrow right"},{value:"arrow-left",icon:"arrow-left",label:"Arrow left"},{value:"sync",icon:"sync",label:"Sync"},{value:"draggable",icon:"draggable",label:"Draggable"},{value:"book",icon:"book",label:"Book"},{value:"measure",icon:"measure",label:"Measure"},{value:"download",icon:"download",label:"Download"},{value:"more-rounded",icon:"more-rounded",label:"More rounded"},{value:"align-object-left",icon:"align-object-left",label:"Align object-left"},{value:"align-object-center",icon:"align-object-center",label:"Align object-center"},{value:"align-object-right",icon:"align-object-right",label:"Align object-right"},{value:"submit",icon:"submit",label:"Submit"},{value:"operators",icon:"operators",label:"Operators"},{value:"general-data-class",icon:"general-data-class",label:"General data-class"},{value:"building",icon:"building",label:"Building"},{value:"bell",icon:"bell",label:"Bell"},{value:"unlink",icon:"unlink",label:"Unlink"},{value:"lightbulb",icon:"lightbulb",label:"Lightbulb"},{value:"log-in",icon:"log-in",label:"Log in"},{value:"log-out",icon:"log-out",label:"Log out"},{value:"previous",icon:"previous",label:"Previous"},{value:"goto",icon:"goto",label:"Goto"},{value:"save",icon:"save",label:"Save"},{value:"pause",icon:"pause",label:"Pause"},{value:"stop",icon:"stop",label:"Stop"},{value:"step-in",icon:"step-in",label:"Step in"},{value:"comment",icon:"comment",label:"Comment"},{value:"indent",icon:"indent",label:"Indent"},{value:"undent",icon:"undent",label:"Undent"},{value:"filter",icon:"filter",label:"Filter"},{value:"clear-filter",icon:"clear-filter",label:"Clear filter"},{value:"insert",icon:"insert",label:"Insert"},{value:"direction-left",icon:"direction-left",label:"Direction left"},{value:"swap",icon:"swap",label:"Swap"},{value:"bubbles",icon:"bubbles",label:"Bubbles"},{value:"sheet",icon:"sheet",label:"Sheet"},{value:"object",icon:"object",label:"Object"},{value:"clear-selections",icon:"clear-selections",label:"Clear selections"},{value:"selections-tool",icon:"selections-tool",label:"Selections tool"},{value:"selections-reload",icon:"selections-reload",label:"Selections reload"},{value:"selections-back",icon:"selections-back",label:"Selections back"},{value:"selections-forward",icon:"selections-forward",label:"Selections forward"},{value:"expression",icon:"expression",label:"Expression"},{value:"select-alternative",icon:"select-alternative",label:"Select alternative"},{value:"select-possible",icon:"select-possible",label:"Select possible"},{value:"select-excluded",icon:"select-excluded",label:"Select excluded"},{value:"select-all",icon:"select-all",label:"Select all"},{value:"bar-chart",icon:"bar-chart",label:"Bar chart"},{value:"bar-chart-horizontal",icon:"bar-chart-horizontal",label:"Bar chart-horizontal"},{value:"line-chart",icon:"line-chart",label:"Line chart"},{value:"pie-chart",icon:"pie-chart",label:"Pie chart"},{value:"gauge-chart",icon:"gauge-chart",label:"Gauge chart"},{value:"kpi",icon:"kpi",label:"Kpi"},{value:"scatter-chart",icon:"scatter-chart",label:"Scatter chart"},{value:"map",icon:"map",label:"Map"},{value:"table",icon:"table",label:"Table"},{value:"pivot-table",icon:"pivot-table",label:"Pivot table"},{value:"treemap",icon:"treemap",label:"Treemap"},{value:"combo-chart",icon:"combo-chart",label:"Combo chart"},{value:"boxplot",icon:"boxplot",label:"Boxplot"},{value:"distributionplot",icon:"distributionplot",label:"Distributionplot"},{value:"histogram",icon:"histogram",label:"Histogram"},{value:"direct-discovery",icon:"direct-discovery",label:"Direct discovery"},{value:"data-model",icon:"data-model",label:"Data model"},{value:"script",icon:"script",label:"Script"},{value:"script-ok",icon:"script-ok",label:"Script ok"},{value:"debug",icon:"debug",label:"Debug"},{value:"auto-layout",icon:"auto-layout",label:"Auto layout"}];const g=[{value:!1,translation:"properties.colorMode.primary"},{value:!0,translation:"properties.colorMode.byExpression"}],m=[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}];function v({translator:e,automationsEnabled:t}){return{definition:{type:"items",component:"accordion",items:{actions:{type:"items",translation:"Object.ActionButton.ActionsAndNavigation",grouped:!0,items:{actions:{type:"array",translation:"Object.ActionButton.Actions",ref:"actions",itemTitleRef:t=>{if(t.actionLabel)return t.actionLabel;const o=t.actionType?"Object.ActionButton.InvalidAction":"Object.ActionButton.NewAction",a=n.find((e=>t.actionType===e.value));return e.get(a&&a.translation||o)},allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"Object.ActionButton.AddAction",items:{label:{component:"string",ref:"actionLabel",translation:"Common.Label",expression:"optional",defaultValue:""},actionType:{type:"string",ref:"actionType",component:"expression-with-dropdown",translation:"Object.ActionButton.Action",defaultValue:"",options:n.filter((e=>"executeAutomation"!==e.value||t)),dropdownOnly:!0},bookmark:{type:"string",ref:"bookmark",component:"expression-with-dropdown",translation:"ExpressionEditor.SetExpresions.Bookmark",defaultValue:"",dropdownOnly:!0,options:async(e,t)=>(await t.app.getBookmarkList()).map((e=>({label:e.qData.title,value:e.qInfo.qId}))),show:e=>l(e,"bookmark")},field:{type:"string",ref:"field",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:async(e,t)=>(await t.app.getFieldList()).map((e=>({label:e.qName,value:e.qName}))),show:e=>l(e,"field")},variable:{type:"string",ref:"variable",component:"expression-with-dropdown",translation:"Common.Variable",defaultValue:"",expressionType:"StringExpression",options:async(e,t)=>(await t.app.getVariableList()).filter((t=>!t.qIsReserved||t.qIsReserved&&e.showSystemVariables)).map((e=>({label:e.qName,value:e.qName}))),show:e=>l(e,"variable")},showSystemVariables:{type:"boolean",ref:"showSystemVariables",translation:"ExpressionEditor.SystemVariables",defaultValue:!1,show:e=>l(e,"variable")},softLock:{type:"boolean",ref:"softLock",translation:"Object.ActionButton.Softlock",defaultValue:!1,show:e=>l(e,"softLock")},value:{type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:e=>l(e,"value")},partial:{type:"boolean",ref:"partial",translation:"Object.ActionButton.Partial",defaultValue:!1,show:e=>l(e,"partial")},automation:{type:"string",component:"expression-with-dropdown",translation:"Object.ActionButton.Automation",ref:"automation",dropdownOnly:!0,options:async()=>(await fetch("../api/v1/items?resourceType=automation&limit=100").then((e=>e.json()))).data.map((e=>({value:e.id,label:e.name}))),show:e=>l(e,"automation")},automationPostData:{type:"boolean",ref:"automationPostData",translation:"Object.ActionButton.Automation.SendSelections",show:e=>l(e,"automation"),defaultValue:!1}}},navigation:{translation:"Object.ActionButton.Navigation",type:"items",items:{action:{ref:"navigation.action",translation:"Object.ActionButton.Navigation",component:"expression-with-dropdown",defaultValue:null,options:s,dropdownOnly:!0},sheetId:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",expression:"optional",show:e=>c(e,"sheetId")},sheet:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",component:"expression-with-dropdown",expressionType:"StringExpression",show:e=>c(e,"sheet"),options:async(e,t)=>(await t.app.getSheetList()).map((e=>({value:e.qInfo.qId,label:e.qMeta.title,showCondition:e.qData.showCondition})))},story:{type:"string",ref:"navigation.story",translation:"properties.story",component:"expression-with-dropdown",expressionType:"StringExpression",show:e=>c(e,"story"),options:async(e,t)=>(await t.app.getStoryList()).map((e=>({value:e.qInfo.qId,label:e.qMeta.title})))},websiteUrl:{type:"string",expression:"optional",ref:"navigation.websiteUrl",translation:"properties.website",show:e=>c(e,"websiteUrl")},sameWindow:{type:"boolean",ref:"navigation.sameWindow",translation:"properties.sameWindow",show:e=>c(e,"websiteUrl"),defaultValue:!1}}}}},enableCondition:{type:"items",translation:"properties.enableConditionSection",items:{useCondition:{type:"boolean",component:"switch",translation:"properties.enableToggle",ref:"useEnabledCondition",options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},condition:{ref:"enabledCondition",translation:"properties.enableCondition",type:"integer",expression:"optional",show:e=>e.useEnabledCondition}}},settings:{component:"expandable-items",translation:"Common.Appearance",uses:"settings",items:{general:{type:"items",translation:"properties.general",items:{showTitles:{},details:{show:!1},label:{component:"string",ref:"style.label",translation:"Common.Label",expression:"optional"}}},font:{grouped:!0,type:"items",translation:"properties.font",items:{sizeAndColor:{type:"items",items:{fontSize:{component:"slider",type:"number",ref:"style.font.size",translation:"properties.fontSize",min:.2,max:1,step:.01},useFontColorExpression:{ref:"style.font.useColorExpression",type:"boolean",translation:"properties.fontColor",component:"dropdown",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.font.color",translation:"properties.color",dualOutput:!0,show:e=>!u.getValue(e,"style.font.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.font.colorExpression",translation:"Common.Expression",expression:"optional",show:e=>u.getValue(e,"style.font.useColorExpression")}}},stylingAndAlign:{type:"items",items:{fontStyling:{component:"item-selection-list",type:"string",ref:"style.font.style",translation:"properties.textStyle",horizontal:!0,multipleSelect:!0,items:[{component:"icon-item",icon:"bold",value:"bold",translation:"Common.bold",labelPlacement:"bottom"},{component:"icon-item",icon:"italic",value:"italic",translation:"Common.italic",labelPlacement:"bottom"},{component:"icon-item",icon:"underline",value:"underline",translation:"Common.underline",labelPlacement:"bottom"}]},textAlign:{component:"item-selection-list",type:"string",ref:"style.font.align",translation:"properties.Alignment",horizontal:!0,items:[{component:"icon-item",icon:"align_left",value:"left",translation:"properties.dock.left",labelPlacement:"bottom"},{component:"icon-item",icon:"align_center",value:"center",translation:"Common.Center",labelPlacement:"bottom"},{component:"icon-item",icon:"align_right",value:"right",translation:"properties.dock.right",labelPlacement:"bottom"}]}}}}},background:{grouped:!0,type:"items",translation:"properties.background",items:{backgroundColor:{type:"items",items:{useColorExpression:{ref:"style.background.useColorExpression",type:"boolean",translation:"AppDetails.SheetBackgroundColor",component:"dropdown",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.background.color",translation:"properties.color",dualOutput:!0,show:e=>!u.getValue(e,"style.background.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.background.colorExpression",translation:"Common.Expression",expression:"optional",show:e=>u.getValue(e,"style.background.useColorExpression")}}},backgroundImage:{type:"items",items:{useBackgroundImage:{ref:"style.background.useImage",type:"boolean",translation:"properties.backgroundImage.use",component:"switch",options:m},backgroundUrl:{ref:"style.background.url.qStaticContentUrlDef.qUrl",layoutRef:"style.background.url.qStaticContentUrl.qUrl",schemaIgnore:!0,translation:"Common.Image",tooltip:{select:"properties.media.select",remove:"properties.media.removeBackground"},type:"string",component:"media",show:e=>u.getValue(e,"style.background.useImage")},backgroundSize:{ref:"style.background.size",translation:"properties.backgroundImage.size",type:"string",component:"dropdown",options:[{value:"auto",translation:"properties.backgroundImage.originalSize"},{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"alwaysFill",translation:"properties.backgroundImage.sizeAlwaysFill"}],show:e=>u.getValue(e,"style.background.useImage")&&!!u.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")},backgroundPosition:{ref:"style.background.position",translation:"Common.Position",type:"string",component:"align-matrix",show:e=>u.getValue(e,"style.background.useImage")&&u.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")&&"fill"!==u.getValue(e,"style.background.size"),currentSize:e=>u.getValue(e,"style.background.size")}}}}},border:{type:"items",grouped:!0,translation:"properties.border",items:{borderSettings:{type:"items",items:{useBorder:{ref:"style.border.useBorder",type:"boolean",translation:"properties.border.use",component:"switch",options:m},borderRadius:{component:"slider",show:e=>u.getValue(e,"style.border.useBorder"),translation:"properties.border.radius",type:"number",ref:"style.border.radius",min:0,max:1,step:.01},borderWidth:{component:"slider",show:e=>u.getValue(e,"style.border.useBorder"),type:"number",ref:"style.border.width",translation:"properties.border.width",min:0,max:.5,step:.005},colorDropdown:{type:"string",show:e=>u.getValue(e,"style.border.useBorder"),component:"dropdown",translation:"properties.border.color",ref:"style.border.useColorExpression",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.border.color",translation:"properties.color",dualOutput:!0,show:e=>u.getValue(e,"style.border.useBorder")&&!u.getValue(e,"style.border.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.border.colorExpression",translation:"Common.Expression",show:e=>u.getValue(e,"style.border.useBorder")&&u.getValue(e,"style.border.useColorExpression"),expression:"optional"}}}}},icon:{type:"items",grouped:!0,translation:"properties.icon",items:{iconSettings:{type:"items",items:{useIcon:{ref:"style.icon.useIcon",type:"boolean",translation:"properties.icon.use",component:"switch",options:m},iconType:{ref:"style.icon.iconType",component:"expression-with-dropdown",translation:"properties.icon",defaultValue:"",options:d,expressionType:"StringExpression",show:e=>u.getValue(e,"style.icon.useIcon")},iconPosition:{ref:"style.icon.position",component:"dropdown",translation:"Common.Position",options:[{translation:"properties.dock.left",value:"left"},{translation:"properties.dock.right",value:"right"}],show:e=>u.getValue(e,"style.icon.useIcon")}}}}}}}}},importProperties:b,exportProperties:null,support:{export:!1,exportData:!1,snapshot:!1,viewData:!1,quickMobile:!0}}}const f={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},h={resolveExpression:e=>{let t=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e);if(t)return`rgb(${t[1]},${t[2]},${t[3]})`;if(t=/^argb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e),t){const e=Math.round(t[1]/255*100)/100;return`rgba(${t[2]},${t[3]},${t[4]},${e})`}if(t=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(e),t)return e;const o=e&&f[e.toLowerCase()];if(o){const e=void 0!==o.a?o.a:1;return`rgba(${o.r},${o.g},${o.b},${e})`}return"none"},getFadedColor(e){const t=.15;let o,a,n,l;if(e.length>7){o=e.split(",");const i=-1!==o[0].indexOf("a");return a=i?parseInt(o[0].slice(5),10):parseInt(o[0].slice(4),10),l=parseInt(o[1],10),n=parseInt(o[2],10),`${(i?"rgba(":"rgb(")+(Math.round((0-a)*t)+a)},${Math.round((0-l)*t)+l},${Math.round((0-n)*t)+n}${i?`,${o[3]}`:")"}`}return o=parseInt(e.slice(1),16),a=o>>16,l=o>>8&255,n=255&o,`#${(16777216+65536*(Math.round((0-a)*t)+a)+256*(Math.round((0-l)*t)+l)+(Math.round((0-n)*t)+n)).toString(16).slice(1)}`}};var y=e=>{e.replace(/^\.\.\//i,"/"),e=(e=e.replace(/"/g,'\\"')).replace(/'/g,"\\'");const t=document.createElement("a");t.href="../";return e=t.href+("/"===e[0]?e.substr(1):e)};const w={auto:"auto auto",alwaysFit:"contain",fitWidth:"100% auto",fitHeight:"auto 100%",fill:"100% 100%",alwaysFill:"cover"},k={topLeft:"0% 0%",centerLeft:"50% 0%",bottomLeft:"100% 0%",topCenter:"0% 50%",centerCenter:"50% 50%",bottomCenter:"100% 50%",topRight:"0% 100%",centerRight:"50% 100%",bottomRight:"100% 100%"},S=(e,t)=>`${e}: ${t};`,A=({useColorExpression:e=!1,colorExpression:o="",color:a=t.COLOR},n,l)=>{let i;return e?i=h.resolveExpression(o):"string"==typeof a?i=a:a&&(i=l.getColorPickerColor(a)),i&&"none"!==i?i:n};var C={getStyles({style:e={},disabled:o,theme:a,element:n}){let l="width: 100%;height: 100%;transition: transform .1s ease-in-out;position: absolute;";const{font:i={},background:r={},border:s={}}=e,c=a.getDataColorSpecials().primary;l+=o?S("opacity",.4):S("cursor","pointer"),l+=S("color",A(i,"#ffffff",a));const u=i.style||t.FONT_STYLE;u.bold&&(l+=S("font-weight","bold")),u.italic&&(l+=S("font-style","italic"));const p=A(r,c,a);if(l+=S("background-color",p),r.useImage&&r.url.qStaticContentUrl){let e=r.url.qStaticContentUrl.qUrl;e&&(e=y(e),l+=S("background-image",`url('${e}')`),l+=S("background-size",w[r.size||t.BACKGROUND_SIZE]),l+=S("background-position",k[r.position||t.BACKGROUND_POSITION]),l+=S("background-repeat","no-repeat"))}if(s.useBorder){const e=Math.min(n.offsetWidth,n.offsetHeight),o=A(s,h.getFadedColor(p),a),i=(s.width||t.BORDER_WIDTH)*e/2;l+=S("border",`${i}px solid ${o}`),l+=S("border-radius",(s.radius||t.BORDER_RADIUS)*e/2+"px")}else l+="border: none;";return l},createLabelAndIcon({button:e,theme:o,style:a={},isSense:n}){const{icon:l={},font:i={},label:r=t.LABEL}=a,s=document.createElement("text");s.style.whiteSpace="nowrap",s.style.fontFamily=o.getStyle("","","fontFamily");const c=document.createElement("span");c.textContent=r,c.style.whiteSpace="nowrap",c.style.textOverflow="ellipsis",c.style.overflow="visible",i.style&&i.style.underline&&(c.style.textDecoration="underline"),s.appendChild(c);const u=n&&l.useIcon&&""!==l.iconType;if(u){const e=document.createElement("span"),t=d.find((e=>e.label===l.iconType||e.value===l.iconType));e.style.textDecoration="none",e.style.fontSize="inherit",e.setAttribute("class",`lui-icon lui-icon--${t?t.value:""}`),"right"===l.position?s.appendChild(e):s.insertBefore(e,c)}e.innerHTML="",e.appendChild(s),s.style.fontSize=`${e.clientHeight}px`;let p=e.clientHeight/s.offsetHeight*e.clientHeight;s.style.fontSize=`${p}px`,s.offsetWidth>e.clientWidth&&(p*=e.clientWidth/s.offsetWidth);const b=i.size||t.FONT_SIZE;i.style&&i.style.italic?u?(s.style.fontSize=`${Math.max(p*b*.84,8)}px`,s.children[0].style.marginRight=.04*s.offsetWidth+"px",s.children[1].style.marginRight=.04*s.offsetWidth+"px"):(s.style.fontSize=`${Math.max(p*b*.9,8)}px`,s.children[0].style.marginRight=.02*s.offsetWidth+"px"):u?(s.style.fontSize=`${Math.max(p*b*.88,8)}px`,s.children[0].style.marginRight=.04*s.offsetWidth+"px"):s.style.fontSize=`${Math.max(p*b*.92,8)}px`,"8px"===s.style.fontSize&&s.children.forEach((e=>{e.style.overflow="hidden"})),s.style.margin="0 3%",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="left"===i.align?"flex-start":"right"===i.align?"flex-end":"center"}};return function(t){const{sense:l,translator:i,flags:{isEnabled:r}}=t,c=l&&l.navigation,u=r("ACTION_BUTTON_AUTOMATIONS");return o.style.label=l?i.get("Object.ActionButton"):"Button",{qae:{properties:o,data:a},component(){const t=e.useElement(),o=e.useTheme();e.useMemo((()=>{const e=document.createElement("button");e.appendChild(document.createElement("text")),t.appendChild(e)}),[]);const a=e.useStaleLayout(),l=e.useApp(),i=e.useConstraints(),r=(({layout:e,theme:t,app:o,constraints:a,senseNavigation:l,element:i})=>{const r=!!l,c=i.firstElementChild,{style:u,qStateName:p}=e,b=e.useEnabledCondition&&0===e.enabledCondition,d=!b&&!a.active,g=C.getStyles({style:u,disabled:b,theme:t,element:i});c.setAttribute("style",g),c.setAttribute("tabindex","-1"),C.createLabelAndIcon({button:c,theme:t,style:u,isSense:r}),c.onclick=async()=>{if(d){const t=[],{actions:a}=e;if(a.forEach((e=>{const a=n.find((t=>t.value===e.actionType));a&&t.push(a.getActionCall({app:o,qStateName:p,...e}))})),c.setAttribute("disabled",!0),await(async e=>{for(let t=0;t<e.length;t++)await e[t]()})(t),l&&!l.getCurrentStoryId()){const{navigation:t}=e,a=t&&s.find((e=>e.value===t.action));l&&a&&"function"==typeof a.navigationCall&&await a.navigationCall({app:o,senseNavigation:l,...t})}c.removeAttribute("disabled")}};const m=()=>{if(d){const{offsetWidth:e,offsetHeight:t}=c;c.style.transform=t>e?`scale(0.98, ${1-e/t*.02})`:`scale(${1-t/e*.02}, 0.98)`}},v=()=>{const{transform:e}=c.style;d&&""!==e&&"scale(1)"!==e&&(c.style.transform="scale(1)")};return c.onmousedown=e=>{0===e.button&&m()},c.onmouseup=v,c.onmouseleave=v,c.ontouchstart=m,c.ontouchend=v,c.ontouchcancel=v,()=>{c.onclick=void 0,c.onmousedown=void 0,c.onmouseup=void 0,c.onmouseleave=void 0,c.ontouchstart=void 0,c.ontouchend=void 0,c.ontouchcancel=void 0}})({element:t,layout:a,constraints:i,theme:o,app:l,senseNavigation:c,automationsEnabled:u});e.useEffect((()=>()=>{r()}),[t]),e.useImperativeHandle((()=>({focus(){t.firstElementChild.onclick()}})),[t])},ext:v({translator:i,automationsEnabled:u})}}}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebula.js/sn-action-button",
3
- "version": "1.14.0",
4
- "description": "Supernova action button",
3
+ "version": "1.15.2",
4
+ "description": "Action button supernova",
5
5
  "license": "MIT",
6
6
  "author": "QlikTech International AB",
7
7
  "keywords": [
@@ -12,62 +12,66 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "bugs": {
16
- "url": "https://github.com/qlik-oss/sn-action-button/issues"
17
- },
18
15
  "repository": {
19
16
  "type": "git",
20
17
  "url": "https://github.com/qlik-oss/sn-action-button.git"
21
18
  },
22
19
  "files": [
23
20
  "dist",
24
- "sn-action-button.js",
25
- "sn-action-button.qext"
21
+ "api-specifications",
22
+ "core",
23
+ "sn-action-button-ext"
26
24
  ],
27
25
  "engines": {
28
- "node": ">=8"
26
+ "node": ">=16"
29
27
  },
30
28
  "main": "dist/sn-action-button.js",
31
- "module": "dist/sn-action-button.esm.js",
32
29
  "scripts": {
33
- "build": "nebula build",
30
+ "build": "node ./tools/build.js --core --ext",
31
+ "build:dev": "node ./tools/build.js --core --ext --mode development",
32
+ "build:watch": "node ./tools/build.js --ext --mode development -w",
34
33
  "lint": "eslint src",
35
34
  "start": "nebula serve",
36
35
  "sense": "nebula sense",
37
- "test:unit": "aw -c aw.config.js",
36
+ "test:unit": "jest",
38
37
  "test:integration": "aw puppet --glob 'test/integration/**/*.spec.js'",
39
- "prepublishOnly": "rm -rf dist && npm run build",
40
- "prepare": "husky install"
41
- },
42
- "lint-staged": {
43
- "*.{js, jsx}": [
44
- "eslint --cache --fix"
45
- ]
38
+ "test:rendering": "aw puppet --testExt '*.spec.js' --glob 'test/rendering/**/*.spec.js' --mocha.bail false --mocha.timeout 30000",
39
+ "prepublishOnly": "NODE_ENV=production yarn run build && yarn spec",
40
+ "prepack": "./tools/prepare-sn-pack.js",
41
+ "spec": "scriptappy-from-jsdoc -c ./spec-configs/props.conf.js",
42
+ "preversion": "yarn build",
43
+ "version": "yarn spec && git add api-specifications"
46
44
  },
47
45
  "peerDependencies": {
48
- "@nebula.js/stardust": ">=1.7.0"
46
+ "@nebula.js/stardust": ">=2.2.0"
49
47
  },
50
48
  "devDependencies": {
51
49
  "@after-work.js/aw": "6.0.14",
52
- "@babel/cli": "7.15.7",
53
- "@babel/core": "7.15.5",
54
- "@babel/helper-define-map": "7.15.4",
55
- "@babel/preset-env": "7.15.6",
50
+ "@babel/cli": "7.16.0",
51
+ "@babel/core": "7.16.0",
52
+ "@babel/helper-define-map": "7.16.0",
53
+ "@babel/preset-env": "7.16.4",
56
54
  "@commitlint/cli": "12.1.4",
57
55
  "@commitlint/config-conventional": "12.1.4",
58
- "@nebula.js/cli": "1.7.0",
59
- "@nebula.js/cli-build": "1.7.0",
60
- "@nebula.js/cli-sense": "1.7.0",
61
- "@nebula.js/cli-serve": "1.7.0",
62
- "@nebula.js/stardust": "1.7.0",
56
+ "@nebula.js/cli": "2.3.0",
57
+ "@nebula.js/cli-build": "2.3.0",
58
+ "@nebula.js/cli-sense": "2.3.0",
59
+ "@nebula.js/cli-serve": "2.3.0",
60
+ "@nebula.js/stardust": "2.3.0",
63
61
  "@nebula.js/test-utils": "0.6.0",
64
- "babel-plugin-istanbul": "6.0.0",
62
+ "babel-plugin-istanbul": "6.1.1",
65
63
  "eslint": "7.32.0",
66
- "eslint-config-airbnb-base": "14.2.1",
67
- "eslint-plugin-import": "2.24.2",
64
+ "eslint-config-airbnb-base": "15.0.0",
65
+ "eslint-plugin-import": "2.25.3",
68
66
  "eslint-plugin-mocha": "9.0.0",
69
- "husky": "7.0.2",
70
- "lint-staged": "11.1.2",
71
- "mocha-junit-reporter": "2.0.0"
67
+ "fs-extra": "^10.0.0",
68
+ "husky": "7.0.4",
69
+ "jest": "^27.3.1",
70
+ "jest-junit": "^13.0.0",
71
+ "lint-staged": "11.2.6",
72
+ "mocha-junit-reporter": "2.0.2",
73
+ "shx": "^0.3.3",
74
+ "yargs": "^17.2.1",
75
+ "scriptappy-from-jsdoc": "0.7.0"
72
76
  }
73
- }
77
+ }
@@ -0,0 +1,7 @@
1
+ /*
2
+ * @nebula.js/sn-action-button v1.15.2
3
+ * Copyright (c) 2022 QlikTech International AB
4
+ * Released under the MIT license.
5
+ */
6
+
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-action-button"]=t(e.stardust)}(this,(function(e){"use strict";var t={LABEL:"Button",FONT_SIZE:.5,COLOR:{index:-1,color:null},FONT_STYLE:{bold:!0,italic:!1,underline:!1},TEXT_ALIGN:"center",BACKGROUND_SIZE:"auto",BACKGROUND_POSITION:"centerCenter",BORDER_RADIUS:0,BORDER_WIDTH:0,ICON_POSITION:"left"};const o={version:"1.15.2",showTitles:!0,title:"",subtitle:"",footnote:"",useEnabledCondition:!1,enabledCondition:1,actions:[],navigation:{action:"none"},style:{label:t.LABEL,font:{useColorExpression:!1,color:t.COLOR,colorExpression:"",size:t.FONT_SIZE,style:t.FONT_STYLE,align:t.TEXT_ALIGN},background:{useColorExpression:!1,color:t.COLOR,colorExpression:"",useImage:!1,url:{qStaticContentUrlDef:{qUrl:""}},size:t.BACKGROUND_SIZE,position:t.BACKGROUND_POSITION},border:{useColorExpression:!1,color:t.COLOR,colorExpression:"",useBorder:!1,radius:t.BORDER_RADIUS,width:t.BORDER_WIDTH},icon:{useIcon:!1,iconType:"",position:t.ICON_POSITION}}};var a={targets:[]};const n=[{value:"applyBookmark",translation:"Object.ActionButton.ApplyBookmark",group:"bookmark",getActionCall:({app:e,bookmark:t})=>async()=>{const o=(await e.getBookmarkList()).find((e=>e.qData.title===t));t&&await e.applyBookmark(o&&o.qInfo&&o.qInfo.qId||t)},requiredInput:["bookmark"]},{value:"back",translation:"Object.ActionButton.MoveBackward",group:"selection",getActionCall:({app:e})=>async()=>{await e.back()},requiredInput:[]},{value:"forward",translation:"Object.ActionButton.MoveForward",group:"selection",getActionCall:({app:e})=>async()=>{await e.forward()},requiredInput:[]},{value:"clearAll",translation:"Object.ActionButton.ClearAll",group:"selection",getActionCall:({app:e,softLock:t})=>async()=>{await e.clearAll(t)},requiredInput:["softLock"]},{value:"clearAllButThis",translation:"Object.ActionButton.ClearAllButThis",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.clearAllButThis(a)}},requiredInput:["field","softLock"]},{value:"clearField",translation:"Object.ActionButton.ClearSelectionInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.clear()}},requiredInput:["field"]},{value:"selectAll",translation:"Object.ActionButton.SelectAllInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectAll(a)}},requiredInput:["field","softLock"]},{value:"selectValues",translation:"Object.ActionButton.SelectValuesInField",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t),i=await e.getFieldDescription(o),r=await(async(e,t,o)=>{let a=t.split(";");if(o){let t="";a.forEach((e=>{t+=`Num('${e}')&';'&`})),a=(await e.evaluate(t.slice(0,-5))).split(";")}return a.map((e=>Number.isNaN(+e)?{qText:e}:{qIsNumeric:!0,qNumber:Number(e)}))})(e,a,i.qTags.includes("$date"));await l.selectValues(r,!1,n)}},requiredInput:["field","value","softLock"]},{value:"selectMatchingValues",translation:"Object.ActionButton.SelectMatchingValues",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t);await l.select(a,!1,n)}},requiredInput:["field","value","softLock"]},{value:"selectAlternative",translation:"Object.ActionButton.SelectAlternatives",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectAlternative(a)}},requiredInput:["field","softLock"]},{value:"selectExcluded",translation:"Object.ActionButton.SelectExcluded",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectExcluded(a)}},requiredInput:["field","softLock"]},{value:"selectPossible",translation:"Object.ActionButton.SelectPossibleValues",group:"selection",getActionCall:({app:e,qStateName:t,field:o,softLock:a})=>async()=>{if(o){const n=await e.getField(o,t);await n.selectPossible(a)}},requiredInput:["field","softLock"]},{value:"toggleSelect",translation:"Object.ActionButton.ToggleFieldSelection",group:"selection",getActionCall:({app:e,qStateName:t,field:o,value:a,softLock:n})=>async()=>{if(o&&a){const l=await e.getField(o,t);await l.toggleSelect(a,n)}},requiredInput:["field","value","softLock"]},{value:"lockAll",translation:"Object.ActionButton.LockAllSelections",group:"selection",getActionCall:({app:e})=>async()=>{await e.lockAll()},requiredInput:[]},{value:"lockField",translation:"Object.ActionButton.LockField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.lock()}},requiredInput:["field"]},{value:"unlockAll",translation:"Object.ActionButton.UnlockAllSelections",group:"selection",getActionCall:({app:e})=>async()=>{await e.unlockAll()},requiredInput:[]},{value:"unlockField",translation:"Object.ActionButton.UnlockAField",group:"selection",getActionCall:({app:e,qStateName:t,field:o})=>async()=>{if(o){const a=await e.getField(o,t);await a.unlock()}},requiredInput:["field"]},{value:"setVariable",translation:"Object.ActionButton.SetVariable",group:"variables",getActionCall:({app:e,variable:t,value:o})=>async()=>{if(t&&o)try{const a=await e.getVariableByName(t);await a.setStringValue(o)}catch(e){}},requiredInput:["variable","value"]},{value:"doReload",translation:"Object.ActionButton.DoReload",group:"reload",getActionCall:({app:e,partial:t})=>async()=>{await e.doReload(0,!!t,!1)&&await e.doSave()},requiredInput:["partial"]},{translation:"Object.ActionButton.ExecuteAutomation",value:"executeAutomation",getActionCall:({app:e,automation:t,automationPostData:o})=>async()=>{if(void 0!==t)try{t=encodeURIComponent(t);const a=await fetch(`../api/v1/items/${t}`).then((e=>e.json())),n=await fetch(`../api/v1/automations/${a.resourceId}`).then((e=>e.json()));let l=`../api/v1/automations/${n.guid}/actions/execute?X-Execution-Token=${n.execution_token}`;if(o&&n.hasinputs){const o=await fetch(`../api/v1/automations/${a.resourceId}/blocks`).then((e=>e.json())).then((e=>{let t;for(let o=0;o<e.blocks.length;o++)if("Inputs"===e.blocks[o].displayName){t=e.blocks[o].form;break}return t})),n=new Date,i={qProp:{qInfo:{qId:`automation_${e.id}_${t}_${n.getTime()}`,qType:"bookmark"},qMetaDef:{title:`Generated automation bookmark on ${n.toISOString()}`,description:"Generated to provide target automation with bookmark to get current selection state",_createdBy:"sn-action-button",_createdFor:"automation",_createdOn:`${n.toISOString()}`,_id:`automation_${encodeURIComponent(e.id)}_${t}_${n.getTime()}`}}},r=await e.createBookmark(i).then((e=>e.getLayout())).then((e=>e.qInfo.qId));await e.saveObjects(),l=`${l}&${o[0].label.toLowerCase()}=${encodeURIComponent(e.id)}&${o[1].label.toLowerCase()}=${r}`}await fetch(l).then((e=>e.json()))}catch(e){}},requiredInput:["automation"]}];function l(e,t){const o=n.find((t=>e.actionType===t.value));return o&&o.requiredInput&&-1!==o.requiredInput.indexOf(t)}var i={evaluateCondition:function(e){if(e&&e.length>=2&&"/"===e[0]&&"/"===e[1])return!0;const t=e?+e:-1;return Number.isNaN(+t)?"true"===e.toLowerCase():0!==t}};const r=async e=>(await e.getSheetList()).filter((e=>i.evaluateCondition(e.qData.showCondition))).sort(((e,t)=>e.qData.rank-t.qData.rank)),s=[{translation:"Object.ActionButton.NoNavigation",value:"none"},{translation:"Object.ActionButton.GoToNextSheet",value:"nextSheet",navigationCall:async({senseNavigation:e})=>{await e.nextSheet()},requiredInput:[]},{translation:"Object.ActionButton.GoToPreviousSheet",value:"prevSheet",navigationCall:async({senseNavigation:e})=>{await e.prevSheet()},requiredInput:[]},{translation:"Object.ActionButton.GoToLastSheet",value:"lastSheet",navigationCall:async({app:e,senseNavigation:t})=>{const o=await r(e);await t.goToSheet(o[o.length-1].qInfo.qId)},requiredInput:[]},{translation:"Object.ActionButton.GoToFirstSheet",value:"firstSheet",navigationCall:async({app:e,senseNavigation:t})=>{const o=await r(e);await t.goToSheet(o[0].qInfo.qId)},requiredInput:[]},{translation:"Object.ActionButton.GoToASheet",value:"goToSheet",navigationCall:async({senseNavigation:e,sheet:t})=>{t&&await e.goToSheet(t)},requiredInput:["sheet"]},{translation:"Object.ActionButton.GoToSheetById",value:"goToSheetById",navigationCall:async({senseNavigation:e,sheet:t})=>{t&&await e.goToSheet(t)},requiredInput:["sheetId"]},{translation:"Object.ActionButton.GoToStory",value:"goToStory",navigationCall:async({senseNavigation:e,story:t})=>{t&&await e.goToStory(t)},requiredInput:["story"]},{translation:"Object.ActionButton.OpenWebsiteEmail",value:"openWebsite",navigationCall:async({websiteUrl:e,sameWindow:t})=>{try{if(e){const o=e.match(/^(https?:\/\/|mailto:)/)?e:`http://${e}`;let a="";t&&(a=(()=>{try{return window.self!==window.top}catch(e){return!0}})()?"_parent":"_self"),window.open(o,a)}}catch(e){}},requiredInput:["websiteUrl"]}],c=(e,t)=>{const o=s.find((t=>e.navigation.action===t.value));return o&&o.requiredInput&&-1!==o.requiredInput.indexOf(t)};var u={getValue:function(e,t,o){const a=t.split(".");let n;if(void 0===e)return o;for(n=0;n<a.length;++n){if(void 0===e[a[n]])return o;e=e[a[n]]}return e}};function p(e){switch(e){case"gotoSheet":return"goToSheet";case"gotoSheetById":return"goToSheetById";case"gotoStory":return"goToStory";case"switchToEdit":return"none";default:return e}}const b=(e,t)=>{const o={qChildren:[]},a={actions:[],props:{useEnabledCondition:null,fullWidth:"auto"},qLayoutExclude:{disabled:{}},...t};return e&&"qlik-button-for-navigation"===e.properties.visualization&&Object.keys(e.properties).forEach((t=>{let o;switch(t){case"props":o=e.properties[t],a.style.label=o.buttonLabel,a.style.icon.useIcon=o.buttonShowIcon,a.style.icon.iconType=o.buttonIconLui,a.style.font.align=o.buttonTextAlign,a.useEnabledCondition=o.useEnabledCondition,a.enabledCondition=o.enabledCondition,o.actionItems&&o.actionItems.forEach((e=>{!function(e,t){const o={actionType:e.actionType,bookmark:e.selectedBookmark,field:e.selectedField,variable:e.variable,value:e.value,softLock:e.softLock,cId:e.cId};switch(e.actionType){case"clearOther":o.actionType="clearAllButThis";break;case"unlockAllAndClearAll":o.actionType="clearAll",o.softLock=!0;break;case"selectField":o.actionType="selectMatchingValues";break;case"selectAndLockField":t.actions.push({...o,cId:null,actionType:"selectMatchingValues"}),o.actionType="lockField"}t.actions.push(o)}(e,a)})),a.navigation={action:p(o.navigationAction),sheet:"gotoSheetById"===o.navigationAction?o.sheetId:o.selectedSheet,story:o.selectedStory,websiteUrl:o.websiteUrl,sameWindow:o.sameWindow};break;case"qStateName":case"showTitles":case"title":case"subtitle":case"footnote":a[t]=e.properties[t]}})),o.qProperty=a,o};var d=[{value:"image",icon:"image",label:"Image"},{value:"back",icon:"back",label:"Back"},{value:"forward",icon:"forward",label:"Forward"},{value:"history",icon:"history",label:"History"},{value:"help",icon:"help",label:"Help"},{value:"info",icon:"info",label:"Info"},{value:"text",icon:"text",label:"Text"},{value:"group",icon:"group",label:"Group"},{value:"search",icon:"search",label:"Search"},{value:"zoom-in",icon:"zoom-in",label:"Zoom in"},{value:"zoom-out",icon:"zoom-out",label:"Zoom out"},{value:"export",icon:"export",label:"Export"},{value:"import",icon:"import",label:"Import"},{value:"field",icon:"field",label:"Field"},{value:"lock",icon:"lock",label:"Lock"},{value:"unlock",icon:"unlock",label:"Unlock"},{value:"database",icon:"database",label:"Database"},{value:"calendar",icon:"calendar",label:"Calendar"},{value:"bookmark",icon:"bookmark",label:"Bookmark"},{value:"library",icon:"library",label:"Library"},{value:"star",icon:"star",label:"Star"},{value:"print",icon:"print",label:"Print"},{value:"remove",icon:"remove",label:"Remove"},{value:"handle",icon:"handle",label:"Handle"},{value:"handle-horizontal",icon:"handle-horizontal",label:"Handle horizontal"},{value:"menu",icon:"menu",label:"Menu"},{value:"list",icon:"list",label:"List"},{value:"unordered-list",icon:"unordered-list",label:"Unordered list"},{value:"clock",icon:"clock",label:"Clock"},{value:"puzzle",icon:"puzzle",label:"Puzzle"},{value:"filterpane",icon:"filterpane",label:"Filterpane"},{value:"plus",icon:"plus",label:"Plus"},{value:"minus",icon:"minus",label:"Minus"},{value:"triangle-top",icon:"triangle-top",label:"Triangle top"},{value:"triangle-bottom",icon:"triangle-bottom",label:"Triangle bottom"},{value:"triangle-left",icon:"triangle-left",label:"Triangle left"},{value:"triangle-right",icon:"triangle-right",label:"Triangle right"},{value:"tick",icon:"tick",label:"Tick"},{value:"cogwheel",icon:"cogwheel",label:"Cogwheel"},{value:"settings",icon:"settings",label:"Settings"},{value:"cut",icon:"cut",label:"Cut"},{value:"copy",icon:"copy",label:"Copy"},{value:"paste",icon:"paste",label:"Paste"},{value:"camera",icon:"camera",label:"Camera"},{value:"slide-show",icon:"slide-show",label:"Slide show"},{value:"palette",icon:"palette",label:"Palette"},{value:"shapes",icon:"shapes",label:"Shapes"},{value:"effects",icon:"effects",label:"Effects"},{value:"file",icon:"file",label:"File"},{value:"expand",icon:"expand",label:"Expand"},{value:"collapse",icon:"collapse",label:"Collapse"},{value:"bin",icon:"bin",label:"Bin"},{value:"link",icon:"link",label:"Link"},{value:"pivot",icon:"pivot",label:"Pivot"},{value:"reload",icon:"reload",label:"Reload"},{value:"add",icon:"add",label:"Add"},{value:"edit",icon:"edit",label:"Edit"},{value:"key",icon:"key",label:"Key"},{value:"box",icon:"box",label:"Box"},{value:"home",icon:"home",label:"Home"},{value:"person",icon:"person",label:"Person"},{value:"grid",icon:"grid",label:"Grid"},{value:"cloud",icon:"cloud",label:"Cloud"},{value:"more",icon:"more",label:"More"},{value:"folder",icon:"folder",label:"Folder"},{value:"drop",icon:"drop",label:"Drop"},{value:"play",icon:"play",label:"Play"},{value:"tag",icon:"tag",label:"Tag"},{value:"close",icon:"close",label:"Close"},{value:"warning",icon:"warning",label:"Warning"},{value:"warning-triangle",icon:"warning-triangle",label:"Warning triangle"},{value:"share",icon:"share",label:"Share"},{value:"top",icon:"top",label:"Top"},{value:"low-resolution",icon:"low-resolution",label:"Low resolution"},{value:"high-resolution",icon:"high-resolution",label:"High resolution"},{value:"view",icon:"view",label:"View"},{value:"control",icon:"control",label:"Control"},{value:"code",icon:"code",label:"Code"},{value:"upload",icon:"upload",label:"Upload"},{value:"repair",icon:"repair",label:"Repair"},{value:"split",icon:"split",label:"Split"},{value:"up-down",icon:"up-down",label:"Up down"},{value:"disconnect",icon:"disconnect",label:"Disconnect"},{value:"photo-library",icon:"photo-library",label:"Photo library"},{value:"application",icon:"application",label:"Application"},{value:"new-tab",icon:"new-tab",label:"New tab"},{value:"ascending",icon:"ascending",label:"Ascending"},{value:"descending",icon:"descending",label:"Descending"},{value:"arrow-up",icon:"arrow-up",label:"Arrow up"},{value:"arrow-down",icon:"arrow-down",label:"Arrow down"},{value:"arrow-right",icon:"arrow-right",label:"Arrow right"},{value:"arrow-left",icon:"arrow-left",label:"Arrow left"},{value:"sync",icon:"sync",label:"Sync"},{value:"draggable",icon:"draggable",label:"Draggable"},{value:"book",icon:"book",label:"Book"},{value:"measure",icon:"measure",label:"Measure"},{value:"download",icon:"download",label:"Download"},{value:"more-rounded",icon:"more-rounded",label:"More rounded"},{value:"align-object-left",icon:"align-object-left",label:"Align object-left"},{value:"align-object-center",icon:"align-object-center",label:"Align object-center"},{value:"align-object-right",icon:"align-object-right",label:"Align object-right"},{value:"submit",icon:"submit",label:"Submit"},{value:"operators",icon:"operators",label:"Operators"},{value:"general-data-class",icon:"general-data-class",label:"General data-class"},{value:"building",icon:"building",label:"Building"},{value:"bell",icon:"bell",label:"Bell"},{value:"unlink",icon:"unlink",label:"Unlink"},{value:"lightbulb",icon:"lightbulb",label:"Lightbulb"},{value:"log-in",icon:"log-in",label:"Log in"},{value:"log-out",icon:"log-out",label:"Log out"},{value:"previous",icon:"previous",label:"Previous"},{value:"goto",icon:"goto",label:"Goto"},{value:"save",icon:"save",label:"Save"},{value:"pause",icon:"pause",label:"Pause"},{value:"stop",icon:"stop",label:"Stop"},{value:"step-in",icon:"step-in",label:"Step in"},{value:"comment",icon:"comment",label:"Comment"},{value:"indent",icon:"indent",label:"Indent"},{value:"undent",icon:"undent",label:"Undent"},{value:"filter",icon:"filter",label:"Filter"},{value:"clear-filter",icon:"clear-filter",label:"Clear filter"},{value:"insert",icon:"insert",label:"Insert"},{value:"direction-left",icon:"direction-left",label:"Direction left"},{value:"swap",icon:"swap",label:"Swap"},{value:"bubbles",icon:"bubbles",label:"Bubbles"},{value:"sheet",icon:"sheet",label:"Sheet"},{value:"object",icon:"object",label:"Object"},{value:"clear-selections",icon:"clear-selections",label:"Clear selections"},{value:"selections-tool",icon:"selections-tool",label:"Selections tool"},{value:"selections-reload",icon:"selections-reload",label:"Selections reload"},{value:"selections-back",icon:"selections-back",label:"Selections back"},{value:"selections-forward",icon:"selections-forward",label:"Selections forward"},{value:"expression",icon:"expression",label:"Expression"},{value:"select-alternative",icon:"select-alternative",label:"Select alternative"},{value:"select-possible",icon:"select-possible",label:"Select possible"},{value:"select-excluded",icon:"select-excluded",label:"Select excluded"},{value:"select-all",icon:"select-all",label:"Select all"},{value:"bar-chart",icon:"bar-chart",label:"Bar chart"},{value:"bar-chart-horizontal",icon:"bar-chart-horizontal",label:"Bar chart-horizontal"},{value:"line-chart",icon:"line-chart",label:"Line chart"},{value:"pie-chart",icon:"pie-chart",label:"Pie chart"},{value:"gauge-chart",icon:"gauge-chart",label:"Gauge chart"},{value:"kpi",icon:"kpi",label:"Kpi"},{value:"scatter-chart",icon:"scatter-chart",label:"Scatter chart"},{value:"map",icon:"map",label:"Map"},{value:"table",icon:"table",label:"Table"},{value:"pivot-table",icon:"pivot-table",label:"Pivot table"},{value:"treemap",icon:"treemap",label:"Treemap"},{value:"combo-chart",icon:"combo-chart",label:"Combo chart"},{value:"boxplot",icon:"boxplot",label:"Boxplot"},{value:"distributionplot",icon:"distributionplot",label:"Distributionplot"},{value:"histogram",icon:"histogram",label:"Histogram"},{value:"direct-discovery",icon:"direct-discovery",label:"Direct discovery"},{value:"data-model",icon:"data-model",label:"Data model"},{value:"script",icon:"script",label:"Script"},{value:"script-ok",icon:"script-ok",label:"Script ok"},{value:"debug",icon:"debug",label:"Debug"},{value:"auto-layout",icon:"auto-layout",label:"Auto layout"}];const g=[{value:!1,translation:"properties.colorMode.primary"},{value:!0,translation:"properties.colorMode.byExpression"}],m=[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}];function v({translator:e,automationsEnabled:t}){return{definition:{type:"items",component:"accordion",items:{actions:{type:"items",translation:"Object.ActionButton.ActionsAndNavigation",grouped:!0,items:{actions:{type:"array",translation:"Object.ActionButton.Actions",ref:"actions",itemTitleRef:t=>{if(t.actionLabel)return t.actionLabel;const o=t.actionType?"Object.ActionButton.InvalidAction":"Object.ActionButton.NewAction",a=n.find((e=>t.actionType===e.value));return e.get(a&&a.translation||o)},allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"Object.ActionButton.AddAction",items:{label:{component:"string",ref:"actionLabel",translation:"Common.Label",expression:"optional",defaultValue:""},actionType:{type:"string",ref:"actionType",component:"expression-with-dropdown",translation:"Object.ActionButton.Action",defaultValue:"",options:n.filter((e=>"executeAutomation"!==e.value||t)),dropdownOnly:!0},bookmark:{type:"string",ref:"bookmark",component:"expression-with-dropdown",translation:"ExpressionEditor.SetExpresions.Bookmark",defaultValue:"",dropdownOnly:!0,options:async(e,t)=>(await t.app.getBookmarkList()).map((e=>({label:e.qData.title,value:e.qInfo.qId}))),show:e=>l(e,"bookmark")},field:{type:"string",ref:"field",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:async(e,t)=>(await t.app.getFieldList()).map((e=>({label:e.qName,value:e.qName}))),show:e=>l(e,"field")},variable:{type:"string",ref:"variable",component:"expression-with-dropdown",translation:"Common.Variable",defaultValue:"",expressionType:"StringExpression",options:async(e,t)=>(await t.app.getVariableList()).filter((t=>!t.qIsReserved||t.qIsReserved&&e.showSystemVariables)).map((e=>({label:e.qName,value:e.qName}))),show:e=>l(e,"variable")},showSystemVariables:{type:"boolean",ref:"showSystemVariables",translation:"ExpressionEditor.SystemVariables",defaultValue:!1,show:e=>l(e,"variable")},softLock:{type:"boolean",ref:"softLock",translation:"Object.ActionButton.Softlock",defaultValue:!1,show:e=>l(e,"softLock")},value:{type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:e=>l(e,"value")},partial:{type:"boolean",ref:"partial",translation:"Object.ActionButton.Partial",defaultValue:!1,show:e=>l(e,"partial")},automation:{type:"string",component:"expression-with-dropdown",translation:"Object.ActionButton.Automation",ref:"automation",dropdownOnly:!0,options:async()=>(await fetch("../api/v1/items?resourceType=automation&limit=100").then((e=>e.json()))).data.map((e=>({value:e.id,label:e.name}))),show:e=>l(e,"automation")},automationPostData:{type:"boolean",ref:"automationPostData",translation:"Object.ActionButton.Automation.SendSelections",show:e=>l(e,"automation"),defaultValue:!1}}},navigation:{translation:"Object.ActionButton.Navigation",type:"items",items:{action:{ref:"navigation.action",translation:"Object.ActionButton.Navigation",component:"expression-with-dropdown",defaultValue:null,options:s,dropdownOnly:!0},sheetId:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",expression:"optional",show:e=>c(e,"sheetId")},sheet:{type:"string",ref:"navigation.sheet",translation:"properties.sheet",component:"expression-with-dropdown",expressionType:"StringExpression",show:e=>c(e,"sheet"),options:async(e,t)=>(await t.app.getSheetList()).map((e=>({value:e.qInfo.qId,label:e.qMeta.title,showCondition:e.qData.showCondition})))},story:{type:"string",ref:"navigation.story",translation:"properties.story",component:"expression-with-dropdown",expressionType:"StringExpression",show:e=>c(e,"story"),options:async(e,t)=>(await t.app.getStoryList()).map((e=>({value:e.qInfo.qId,label:e.qMeta.title})))},websiteUrl:{type:"string",expression:"optional",ref:"navigation.websiteUrl",translation:"properties.website",show:e=>c(e,"websiteUrl")},sameWindow:{type:"boolean",ref:"navigation.sameWindow",translation:"properties.sameWindow",show:e=>c(e,"websiteUrl"),defaultValue:!1}}}}},enableCondition:{type:"items",translation:"properties.enableConditionSection",items:{useCondition:{type:"boolean",component:"switch",translation:"properties.enableToggle",ref:"useEnabledCondition",options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},condition:{ref:"enabledCondition",translation:"properties.enableCondition",type:"integer",expression:"optional",show:e=>e.useEnabledCondition}}},settings:{component:"expandable-items",translation:"Common.Appearance",uses:"settings",items:{general:{type:"items",translation:"properties.general",items:{showTitles:{},details:{show:!1},label:{component:"string",ref:"style.label",translation:"Common.Label",expression:"optional"}}},font:{grouped:!0,type:"items",translation:"properties.font",items:{sizeAndColor:{type:"items",items:{fontSize:{component:"slider",type:"number",ref:"style.font.size",translation:"properties.fontSize",min:.2,max:1,step:.01},useFontColorExpression:{ref:"style.font.useColorExpression",type:"boolean",translation:"properties.fontColor",component:"dropdown",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.font.color",translation:"properties.color",dualOutput:!0,show:e=>!u.getValue(e,"style.font.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.font.colorExpression",translation:"Common.Expression",expression:"optional",show:e=>u.getValue(e,"style.font.useColorExpression")}}},stylingAndAlign:{type:"items",items:{fontStyling:{component:"item-selection-list",type:"string",ref:"style.font.style",translation:"properties.textStyle",horizontal:!0,multipleSelect:!0,items:[{component:"icon-item",icon:"bold",value:"bold",translation:"Common.bold",labelPlacement:"bottom"},{component:"icon-item",icon:"italic",value:"italic",translation:"Common.italic",labelPlacement:"bottom"},{component:"icon-item",icon:"underline",value:"underline",translation:"Common.underline",labelPlacement:"bottom"}]},textAlign:{component:"item-selection-list",type:"string",ref:"style.font.align",translation:"properties.Alignment",horizontal:!0,items:[{component:"icon-item",icon:"align_left",value:"left",translation:"properties.dock.left",labelPlacement:"bottom"},{component:"icon-item",icon:"align_center",value:"center",translation:"Common.Center",labelPlacement:"bottom"},{component:"icon-item",icon:"align_right",value:"right",translation:"properties.dock.right",labelPlacement:"bottom"}]}}}}},background:{grouped:!0,type:"items",translation:"properties.background",items:{backgroundColor:{type:"items",items:{useColorExpression:{ref:"style.background.useColorExpression",type:"boolean",translation:"AppDetails.SheetBackgroundColor",component:"dropdown",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.background.color",translation:"properties.color",dualOutput:!0,show:e=>!u.getValue(e,"style.background.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.background.colorExpression",translation:"Common.Expression",expression:"optional",show:e=>u.getValue(e,"style.background.useColorExpression")}}},backgroundImage:{type:"items",items:{useBackgroundImage:{ref:"style.background.useImage",type:"boolean",translation:"properties.backgroundImage.use",component:"switch",options:m},backgroundUrl:{ref:"style.background.url.qStaticContentUrlDef.qUrl",layoutRef:"style.background.url.qStaticContentUrl.qUrl",schemaIgnore:!0,translation:"Common.Image",tooltip:{select:"properties.media.select",remove:"properties.media.removeBackground"},type:"string",component:"media",show:e=>u.getValue(e,"style.background.useImage")},backgroundSize:{ref:"style.background.size",translation:"properties.backgroundImage.size",type:"string",component:"dropdown",options:[{value:"auto",translation:"properties.backgroundImage.originalSize"},{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"alwaysFill",translation:"properties.backgroundImage.sizeAlwaysFill"}],show:e=>u.getValue(e,"style.background.useImage")&&!!u.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")},backgroundPosition:{ref:"style.background.position",translation:"Common.Position",type:"string",component:"align-matrix",show:e=>u.getValue(e,"style.background.useImage")&&u.getValue(e,"style.background.url.qStaticContentUrlDef.qUrl")&&"fill"!==u.getValue(e,"style.background.size"),currentSize:e=>u.getValue(e,"style.background.size")}}}}},border:{type:"items",grouped:!0,translation:"properties.border",items:{borderSettings:{type:"items",items:{useBorder:{ref:"style.border.useBorder",type:"boolean",translation:"properties.border.use",component:"switch",options:m},borderRadius:{component:"slider",show:e=>u.getValue(e,"style.border.useBorder"),translation:"properties.border.radius",type:"number",ref:"style.border.radius",min:0,max:1,step:.01},borderWidth:{component:"slider",show:e=>u.getValue(e,"style.border.useBorder"),type:"number",ref:"style.border.width",translation:"properties.border.width",min:0,max:.5,step:.005},colorDropdown:{type:"string",show:e=>u.getValue(e,"style.border.useBorder"),component:"dropdown",translation:"properties.border.color",ref:"style.border.useColorExpression",options:g},colorPicker:{component:"color-picker",type:"object",ref:"style.border.color",translation:"properties.color",dualOutput:!0,show:e=>u.getValue(e,"style.border.useBorder")&&!u.getValue(e,"style.border.useColorExpression")},colorExpression:{component:"string",type:"string",ref:"style.border.colorExpression",translation:"Common.Expression",show:e=>u.getValue(e,"style.border.useBorder")&&u.getValue(e,"style.border.useColorExpression"),expression:"optional"}}}}},icon:{type:"items",grouped:!0,translation:"properties.icon",items:{iconSettings:{type:"items",items:{useIcon:{ref:"style.icon.useIcon",type:"boolean",translation:"properties.icon.use",component:"switch",options:m},iconType:{ref:"style.icon.iconType",component:"expression-with-dropdown",translation:"properties.icon",defaultValue:"",options:d,expressionType:"StringExpression",show:e=>u.getValue(e,"style.icon.useIcon")},iconPosition:{ref:"style.icon.position",component:"dropdown",translation:"Common.Position",options:[{translation:"properties.dock.left",value:"left"},{translation:"properties.dock.right",value:"right"}],show:e=>u.getValue(e,"style.icon.useIcon")}}}}}}}}},importProperties:b,exportProperties:null,support:{export:!1,exportData:!1,snapshot:!1,viewData:!1,quickMobile:!0}}}const f={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},h={resolveExpression:e=>{let t=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e);if(t)return`rgb(${t[1]},${t[2]},${t[3]})`;if(t=/^argb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e),t){const e=Math.round(t[1]/255*100)/100;return`rgba(${t[2]},${t[3]},${t[4]},${e})`}if(t=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(e),t)return e;const o=e&&f[e.toLowerCase()];if(o){const e=void 0!==o.a?o.a:1;return`rgba(${o.r},${o.g},${o.b},${e})`}return"none"},getFadedColor(e){const t=.15;let o,a,n,l;if(e.length>7){o=e.split(",");const i=-1!==o[0].indexOf("a");return a=i?parseInt(o[0].slice(5),10):parseInt(o[0].slice(4),10),l=parseInt(o[1],10),n=parseInt(o[2],10),`${(i?"rgba(":"rgb(")+(Math.round((0-a)*t)+a)},${Math.round((0-l)*t)+l},${Math.round((0-n)*t)+n}${i?`,${o[3]}`:")"}`}return o=parseInt(e.slice(1),16),a=o>>16,l=o>>8&255,n=255&o,`#${(16777216+65536*(Math.round((0-a)*t)+a)+256*(Math.round((0-l)*t)+l)+(Math.round((0-n)*t)+n)).toString(16).slice(1)}`}};var y=e=>{e.replace(/^\.\.\//i,"/"),e=(e=e.replace(/"/g,'\\"')).replace(/'/g,"\\'");const t=document.createElement("a");t.href="../";return e=t.href+("/"===e[0]?e.substr(1):e)};const w={auto:"auto auto",alwaysFit:"contain",fitWidth:"100% auto",fitHeight:"auto 100%",fill:"100% 100%",alwaysFill:"cover"},k={topLeft:"0% 0%",centerLeft:"50% 0%",bottomLeft:"100% 0%",topCenter:"0% 50%",centerCenter:"50% 50%",bottomCenter:"100% 50%",topRight:"0% 100%",centerRight:"50% 100%",bottomRight:"100% 100%"},S=(e,t)=>`${e}: ${t};`,A=({useColorExpression:e=!1,colorExpression:o="",color:a=t.COLOR},n,l)=>{let i;return e?i=h.resolveExpression(o):"string"==typeof a?i=a:a&&(i=l.getColorPickerColor(a)),i&&"none"!==i?i:n};var C={getStyles({style:e={},disabled:o,theme:a,element:n}){let l="width: 100%;height: 100%;transition: transform .1s ease-in-out;position: absolute;";const{font:i={},background:r={},border:s={}}=e,c=a.getDataColorSpecials().primary;l+=o?S("opacity",.4):S("cursor","pointer"),l+=S("color",A(i,"#ffffff",a));const u=i.style||t.FONT_STYLE;u.bold&&(l+=S("font-weight","bold")),u.italic&&(l+=S("font-style","italic"));const p=A(r,c,a);if(l+=S("background-color",p),r.useImage&&r.url.qStaticContentUrl){let e=r.url.qStaticContentUrl.qUrl;e&&(e=y(e),l+=S("background-image",`url('${e}')`),l+=S("background-size",w[r.size||t.BACKGROUND_SIZE]),l+=S("background-position",k[r.position||t.BACKGROUND_POSITION]),l+=S("background-repeat","no-repeat"))}if(s.useBorder){const e=Math.min(n.offsetWidth,n.offsetHeight),o=A(s,h.getFadedColor(p),a),i=(s.width||t.BORDER_WIDTH)*e/2;l+=S("border",`${i}px solid ${o}`),l+=S("border-radius",(s.radius||t.BORDER_RADIUS)*e/2+"px")}else l+="border: none;";return l},createLabelAndIcon({button:e,theme:o,style:a={},isSense:n}){const{icon:l={},font:i={},label:r=t.LABEL}=a,s=document.createElement("text");s.style.whiteSpace="nowrap",s.style.fontFamily=o.getStyle("","","fontFamily");const c=document.createElement("span");c.textContent=r,c.style.whiteSpace="nowrap",c.style.textOverflow="ellipsis",c.style.overflow="visible",i.style&&i.style.underline&&(c.style.textDecoration="underline"),s.appendChild(c);const u=n&&l.useIcon&&""!==l.iconType;if(u){const e=document.createElement("span"),t=d.find((e=>e.label===l.iconType||e.value===l.iconType));e.style.textDecoration="none",e.style.fontSize="inherit",e.setAttribute("class",`lui-icon lui-icon--${t?t.value:""}`),"right"===l.position?s.appendChild(e):s.insertBefore(e,c)}e.innerHTML="",e.appendChild(s),s.style.fontSize=`${e.clientHeight}px`;let p=e.clientHeight/s.offsetHeight*e.clientHeight;s.style.fontSize=`${p}px`,s.offsetWidth>e.clientWidth&&(p*=e.clientWidth/s.offsetWidth);const b=i.size||t.FONT_SIZE;i.style&&i.style.italic?u?(s.style.fontSize=`${Math.max(p*b*.84,8)}px`,s.children[0].style.marginRight=.04*s.offsetWidth+"px",s.children[1].style.marginRight=.04*s.offsetWidth+"px"):(s.style.fontSize=`${Math.max(p*b*.9,8)}px`,s.children[0].style.marginRight=.02*s.offsetWidth+"px"):u?(s.style.fontSize=`${Math.max(p*b*.88,8)}px`,s.children[0].style.marginRight=.04*s.offsetWidth+"px"):s.style.fontSize=`${Math.max(p*b*.92,8)}px`,"8px"===s.style.fontSize&&s.children.forEach((e=>{e.style.overflow="hidden"})),s.style.margin="0 3%",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="left"===i.align?"flex-start":"right"===i.align?"flex-end":"center"}};return function(t){const{sense:l,translator:i,flags:{isEnabled:r}}=t,c=l&&l.navigation,u=r("ACTION_BUTTON_AUTOMATIONS");return o.style.label=l?i.get("Object.ActionButton"):"Button",{qae:{properties:o,data:a},component(){const t=e.useElement(),o=e.useTheme();e.useMemo((()=>{const e=document.createElement("button");e.appendChild(document.createElement("text")),t.appendChild(e)}),[]);const a=e.useStaleLayout(),l=e.useApp(),i=e.useConstraints(),r=(({layout:e,theme:t,app:o,constraints:a,senseNavigation:l,element:i})=>{const r=!!l,c=i.firstElementChild,{style:u,qStateName:p}=e,b=e.useEnabledCondition&&0===e.enabledCondition,d=!b&&!a.active,g=C.getStyles({style:u,disabled:b,theme:t,element:i});c.setAttribute("style",g),c.setAttribute("tabindex","-1"),C.createLabelAndIcon({button:c,theme:t,style:u,isSense:r}),c.onclick=async()=>{if(d){const t=[],{actions:a}=e;if(a.forEach((e=>{const a=n.find((t=>t.value===e.actionType));a&&t.push(a.getActionCall({app:o,qStateName:p,...e}))})),c.setAttribute("disabled",!0),await(async e=>{for(let t=0;t<e.length;t++)await e[t]()})(t),l&&!l.getCurrentStoryId()){const{navigation:t}=e,a=t&&s.find((e=>e.value===t.action));l&&a&&"function"==typeof a.navigationCall&&await a.navigationCall({app:o,senseNavigation:l,...t})}c.removeAttribute("disabled")}};const m=()=>{if(d){const{offsetWidth:e,offsetHeight:t}=c;c.style.transform=t>e?`scale(0.98, ${1-e/t*.02})`:`scale(${1-t/e*.02}, 0.98)`}},v=()=>{const{transform:e}=c.style;d&&""!==e&&"scale(1)"!==e&&(c.style.transform="scale(1)")};return c.onmousedown=e=>{0===e.button&&m()},c.onmouseup=v,c.onmouseleave=v,c.ontouchstart=m,c.ontouchend=v,c.ontouchcancel=v,()=>{c.onclick=void 0,c.onmousedown=void 0,c.onmouseup=void 0,c.onmouseleave=void 0,c.ontouchstart=void 0,c.ontouchend=void 0,c.ontouchcancel=void 0}})({element:t,layout:a,constraints:i,theme:o,app:l,senseNavigation:c,automationsEnabled:u});e.useEffect((()=>()=>{r()}),[t]),e.useImperativeHandle((()=>({focus(){t.firstElementChild.onclick()}})),[t])},ext:v({translator:i,automationsEnabled:u})}}}));
@@ -0,0 +1 @@
1
+ define(['./dist/sn-action-button'], (supernova) => supernova);
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "sn-action-button",
3
+ "version": "1.15.2",
4
+ "description": "Action button supernova",
5
+ "author": "QlikTech International AB",
6
+ "icon": "extension",
7
+ "type": "visualization",
8
+ "supernova": true
9
+ }