@stlite/desktop 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/build/asset-manifest.json +93 -93
- package/build/electron/main.js +60 -10
- package/build/index.html +1 -1
- package/build/static/css/{6.03f87ee7.chunk.css → 6.69790b96.chunk.css} +1 -1
- package/build/static/css/{main.b6e9910c.chunk.css → main.7bc75681.chunk.css} +1 -1
- package/build/static/js/{0.db2b8db1.chunk.js → 0.14aa4233.chunk.js} +1 -1
- package/build/static/js/{1.d8a95919.chunk.js → 1.176aded5.chunk.js} +1 -1
- package/build/static/js/{10.dae52f04.chunk.js → 10.e5ea6d64.chunk.js} +1 -1
- package/build/static/js/{11.9fe45850.chunk.js → 11.5e15526e.chunk.js} +2 -2
- package/build/static/js/{11.9fe45850.chunk.js.LICENSE.txt → 11.5e15526e.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{12.209a1965.chunk.js → 12.8105987b.chunk.js} +2 -2
- package/build/static/js/{12.209a1965.chunk.js.LICENSE.txt → 12.8105987b.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{13.a3dda2ea.chunk.js → 13.6f270c1f.chunk.js} +2 -2
- package/build/static/js/{13.a3dda2ea.chunk.js.LICENSE.txt → 13.6f270c1f.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{14.86cd17bd.chunk.js → 14.3da5e7a9.chunk.js} +1 -1
- package/build/static/js/{15.1bdac30d.chunk.js → 15.91a85aa0.chunk.js} +2 -2
- package/build/static/js/{15.1bdac30d.chunk.js.LICENSE.txt → 15.91a85aa0.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{16.be849095.chunk.js → 16.650490ee.chunk.js} +2 -2
- package/build/static/js/{16.be849095.chunk.js.LICENSE.txt → 16.650490ee.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{17.cc750fa1.chunk.js → 17.4c6481b3.chunk.js} +1 -1
- package/build/static/js/{18.5007c118.chunk.js → 18.e3d4364d.chunk.js} +2 -2
- package/build/static/js/{18.5007c118.chunk.js.LICENSE.txt → 18.e3d4364d.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{19.1d97adb1.chunk.js → 19.9004a138.chunk.js} +3 -3
- package/build/static/js/{19.1d97adb1.chunk.js.LICENSE.txt → 19.9004a138.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{2.42f468c9.chunk.js → 2.26deed5e.chunk.js} +2 -2
- package/build/static/js/{2.42f468c9.chunk.js.LICENSE.txt → 2.26deed5e.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{20.d86738b4.chunk.js → 20.1e287e6d.chunk.js} +1 -1
- package/build/static/js/{21.8fca1019.chunk.js → 21.cc58bd99.chunk.js} +1 -1
- package/build/static/js/{22.d22eb326.chunk.js → 22.fe58abe1.chunk.js} +2 -2
- package/build/static/js/{22.d22eb326.chunk.js.LICENSE.txt → 22.fe58abe1.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{23.703a0005.chunk.js → 23.ee721415.chunk.js} +3 -3
- package/build/static/js/{23.703a0005.chunk.js.LICENSE.txt → 23.ee721415.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{24.bbdd8ad5.chunk.js → 24.36b10d26.chunk.js} +2 -2
- package/build/static/js/{24.bbdd8ad5.chunk.js.LICENSE.txt → 24.36b10d26.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{25.7a13965c.chunk.js → 25.edf85627.chunk.js} +2 -2
- package/build/static/js/{25.7a13965c.chunk.js.LICENSE.txt → 25.edf85627.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{26.5d02767c.chunk.js → 26.99f3cc19.chunk.js} +2 -2
- package/build/static/js/{26.5d02767c.chunk.js.LICENSE.txt → 26.99f3cc19.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{27.a1975825.chunk.js → 27.d7aacc94.chunk.js} +2 -2
- package/build/static/js/{27.a1975825.chunk.js.LICENSE.txt → 27.d7aacc94.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{28.8fe6cf95.chunk.js → 28.d24eb9cf.chunk.js} +3 -3
- package/build/static/js/{28.8fe6cf95.chunk.js.LICENSE.txt → 28.d24eb9cf.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{29.2a3ece9e.chunk.js → 29.fbb528d8.chunk.js} +2 -2
- package/build/static/js/{29.2a3ece9e.chunk.js.LICENSE.txt → 29.fbb528d8.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{3.82223a8f.chunk.js → 3.f4fb8871.chunk.js} +1 -1
- package/build/static/js/{30.99b51097.chunk.js → 30.32ab2cb4.chunk.js} +2 -2
- package/build/static/js/{30.99b51097.chunk.js.LICENSE.txt → 30.32ab2cb4.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{31.ff33aa2d.chunk.js → 31.9c06312e.chunk.js} +2 -2
- package/build/static/js/{31.ff33aa2d.chunk.js.LICENSE.txt → 31.9c06312e.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{32.a0448bd6.chunk.js → 32.a1f2009d.chunk.js} +2 -2
- package/build/static/js/{32.a0448bd6.chunk.js.LICENSE.txt → 32.a1f2009d.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{33.4e785a88.chunk.js → 33.1d5fce1c.chunk.js} +2 -2
- package/build/static/js/{33.4e785a88.chunk.js.LICENSE.txt → 33.1d5fce1c.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{34.a91bbe12.chunk.js → 34.edb9c338.chunk.js} +2 -2
- package/build/static/js/{34.a91bbe12.chunk.js.LICENSE.txt → 34.edb9c338.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{35.d2720d0c.chunk.js → 35.6bd7c1ed.chunk.js} +2 -2
- package/build/static/js/{35.d2720d0c.chunk.js.LICENSE.txt → 35.6bd7c1ed.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{36.19b6ded6.chunk.js → 36.be12d12e.chunk.js} +2 -2
- package/build/static/js/{36.19b6ded6.chunk.js.LICENSE.txt → 36.be12d12e.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{37.c8ade714.chunk.js → 37.b845d4ba.chunk.js} +2 -2
- package/build/static/js/{37.c8ade714.chunk.js.LICENSE.txt → 37.b845d4ba.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{38.a8e76ebd.chunk.js → 38.0e8cfb78.chunk.js} +2 -2
- package/build/static/js/{38.a8e76ebd.chunk.js.LICENSE.txt → 38.0e8cfb78.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{39.815183b5.chunk.js → 39.73c851be.chunk.js} +2 -2
- package/build/static/js/{39.815183b5.chunk.js.LICENSE.txt → 39.73c851be.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{40.5e639584.chunk.js → 40.1fc38a50.chunk.js} +2 -2
- package/build/static/js/{40.5e639584.chunk.js.LICENSE.txt → 40.1fc38a50.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{41.1811bda2.chunk.js → 41.4ddf36bc.chunk.js} +2 -2
- package/build/static/js/{41.1811bda2.chunk.js.LICENSE.txt → 41.4ddf36bc.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{42.ccc87d41.chunk.js → 42.e5620440.chunk.js} +2 -2
- package/build/static/js/{42.ccc87d41.chunk.js.LICENSE.txt → 42.e5620440.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{43.dd888752.chunk.js → 43.44eb58de.chunk.js} +2 -2
- package/build/static/js/{43.dd888752.chunk.js.LICENSE.txt → 43.44eb58de.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{44.14f2e50d.chunk.js → 44.35b43369.chunk.js} +2 -2
- package/build/static/js/{44.14f2e50d.chunk.js.LICENSE.txt → 44.35b43369.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{45.61ea1afe.chunk.js → 45.91664b3c.chunk.js} +2 -2
- package/build/static/js/{45.61ea1afe.chunk.js.LICENSE.txt → 45.91664b3c.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{46.3201e0ba.chunk.js → 46.e9639103.chunk.js} +2 -2
- package/build/static/js/{46.3201e0ba.chunk.js.LICENSE.txt → 46.e9639103.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{47.f6442eb9.chunk.js → 47.77b33a34.chunk.js} +2 -2
- package/build/static/js/{47.f6442eb9.chunk.js.LICENSE.txt → 47.77b33a34.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/6.8496e815.chunk.js +2 -0
- package/build/static/js/{6.cfeb0558.chunk.js.LICENSE.txt → 6.8496e815.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{7.e179a232.chunk.js → 7.54bbd037.chunk.js} +2 -2
- package/build/static/js/{7.e179a232.chunk.js.LICENSE.txt → 7.54bbd037.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{8.89ddb52f.chunk.js → 8.934b1bbd.chunk.js} +2 -2
- package/build/static/js/{8.89ddb52f.chunk.js.LICENSE.txt → 8.934b1bbd.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{9.ea63c205.chunk.js → 9.8ff376a2.chunk.js} +1 -1
- package/build/static/js/main.118127a6.chunk.js +28 -0
- package/build/static/js/{main.984ac8f5.chunk.js.LICENSE.txt → main.118127a6.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/runtime-main.fe933feb.js +1 -0
- package/package.json +7 -5
- package/build/static/js/6.cfeb0558.chunk.js +0 -2
- package/build/static/js/main.984ac8f5.chunk.js +0 -28
- package/build/static/js/runtime-main.bae92e60.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! For license information please see 19.
|
|
2
|
-
(this["webpackJsonp@stlite/desktop"]=this["webpackJsonp@stlite/desktop"]||[]).push([[19],{
|
|
1
|
+
/*! For license information please see 19.9004a138.chunk.js.LICENSE.txt */
|
|
2
|
+
(this["webpackJsonp@stlite/desktop"]=this["webpackJsonp@stlite/desktop"]||[]).push([[19],{1275:function(e,t,r){"use strict";r(0);var n=r(33),i=r(113),o=r(5);const s=r(40).c`
|
|
3
3
|
50% {
|
|
4
4
|
color: rgba(0, 0, 0, 0);
|
|
5
5
|
}
|
|
6
|
-
`,a=Object(o.a)("span",{target:"e1m4n6jn0"})((({includeDot:e,shouldBlink:t,theme:r})=>({...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:r.colors.gray,margin:"0 5px"}}:{},...t?{color:r.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),"");var c=r(1);t.a=({dirty:e,value:t,maxLength:r,className:o,type:s="single"})=>{const l=[],u=(e,t=!1)=>{l.push(Object(c.jsx)(a,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return e&&("multiline"===s?Object(n.f)()?u("Press \u2318+Enter to apply"):u("Press Ctrl+Enter to apply"):u("Press Enter to apply")),r&&u(`${t.length}/${r}`,e&&t.length>=r),Object(c.jsx)(i.a,{className:o,children:l})}},1371:function(e,t,r){"use strict";var n=r(0),i=r(11),o=r(1304),s=r(1377),a=r(1243),c=r(78);function l(e){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(c){i=!0,o=c}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=w(e);if(t){var i=w(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){return!t||"object"!==l(t)&&"function"!==typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(g,e);var t,r,l,d=y(g);function g(){var e;f(this,g);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return j(v(e=d.call.apply(d,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),j(v(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),j(v(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=g,(r=[{key:"render",value:function(){var e=this.props,t=e.startEnhancer,r=e.endEnhancer,l=e.overrides,d=l.Root,f=l.StartEnhancer,m=l.EndEnhancer,b=h(l,["Root","StartEnhancer","EndEnhancer"]),y=h(e,["startEnhancer","endEnhancer","overrides"]),g=p(Object(i.c)(d,a.d),2),v=g[0],w=g[1],j=p(Object(i.c)(f,a.c),2),x=j[0],S=j[1],k=p(Object(i.c)(m,a.c),2),V=k[0],E=k[1],F=Object(o.a)(this.props,this.state);return n.createElement(v,u({"data-baseweb":"input"},F,w,{$adjoined:O(t,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),t&&n.createElement(x,u({},F,S,{$position:c.c.start}),"function"===typeof t?t(F):t),n.createElement(s.a,u({},y,{overrides:b,adjoined:O(t,r),onFocus:this.onFocus,onBlur:this.onBlur})),r&&n.createElement(V,u({},F,E,{$position:c.c.end}),"function"===typeof r?r(F):r))}}])&&m(t.prototype,r),l&&m(t,l),g}(n.Component);function O(e,t){return e&&t?c.a.both:e?c.a.left:t?c.a.right:c.a.none}j(x,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",error:!1,onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:c.d.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text"}),t.a=x},1372:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return a(l(e),arguments)}function s(e,t){return o.apply(null,[e].concat(t||[]))}function a(e,t){var r,n,s,a,c,l,u,p,d,h=1,f=e.length,m="";for(n=0;n<f;n++)if("string"===typeof e[n])m+=e[n];else if("object"===typeof e[n]){if((a=e[n]).keys)for(r=t[h],s=0;s<a.keys.length;s++){if(void 0==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[s],a.keys[s-1]));r=r[a.keys[s]]}else r=a.param_no?t[a.param_no]:t[h++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(a.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(i.number.test(a.type)&&(p=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?m+=r:(!i.number.test(a.type)||p&&!a.sign?d="":(d=p?"+":"-",r=r.toString().replace(i.sign,"")),l=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(d+r).length,c=a.width&&u>0?l.repeat(u):"",m+=a.align?d+r+c:"0"===l?d+c+r:c+d+r)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,r=e,n=[],o=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],a=t[2],l=[];if(null===(l=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(a=a.substring(l[0].length));)if(null!==(l=i.key_access.exec(a)))s.push(l[1]);else{if(null===(l=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return c[e]=n}t.sprintf=o,t.vsprintf=s,"undefined"!==typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(n=function(){return{sprintf:o,vsprintf:s}}.call(t,r,t,e))||(e.exports=n))}()},1780:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return F}));var n=r(0),i=r.n(n),o=r(82),s=r.n(o),a=r(34),c=n.forwardRef((function(e,t){return n.createElement(a.a,s()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),n.createElement("path",{d:"M0 3v2h8V3H0z"}))}));c.displayName="Minus";var l=n.forwardRef((function(e,t){return n.createElement(a.a,s()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),n.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))}));l.displayName="Plus";var u=r(1372),p=r(190),d=r(19),h=r(15),f=r(112),m=r(50),b=r(41),y=r(1371),g=r(1270),v=r(111),w=r(33),j=r(5);const x=Object(j.a)("div",{target:"e1jwn65y3"})((({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",border:"1px solid transparent",transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.md,"&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}})),""),O=Object(j.a)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),S=Object(j.a)("button",{target:"e1jwn65y1"})((({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}})),""),k=Object(j.a)("div",{target:"e1jwn65y0"})((({theme:e})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:"64px"})),"");var V=r(1);class E extends i.a.PureComponent{constructor(e){super(e),this.formClearHelper=new p.b,this.inputRef=i.a.createRef(),this.formatValue=e=>{const t=function(e){return null==e||""===e?void 0:e}(this.props.element.format);if(null==t)return e.toString();try{return Object(u.sprintf)(t,e)}catch(r){return Object(d.d)(`Error in sprintf(${t}, ${e}): ${r}`),String(e)}},this.isIntData=()=>this.props.element.dataType===h.p.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:e}=this.props.element;return e||(this.isIntData()?1:.01)},this.commitWidgetValue=e=>{const{value:t}=this.state,{element:r,widgetMgr:n}=this.props,i=this.props.element,o=this.getMin(),s=this.getMax();if(o>t||t>s){const e=this.inputRef.current;e&&e.reportValidity()}else{const o=t||0===t?t:i.default;this.isIntData()?n.setIntValue(r,o,e):n.setDoubleValue(r,o,e),this.setState({dirty:!1,value:o,formattedValue:this.formatValue(o)})}},this.onFormCleared=()=>{this.setState({value:this.props.element.default},(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=e=>{const{value:t}=e.target;let r;r=this.isIntData()?parseInt(t,10):parseFloat(t),this.setState({dirty:!0,value:r,formattedValue:t})},this.onKeyDown=e=>{const{key:t}=e;switch(t){case"ArrowUp":e.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":e.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=e=>{"Enter"===e.key&&this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.modifyValueUsingStep=e=>()=>{const{value:t}=this.state,r=this.getStep();switch(e){case"increment":this.canIncrement&&this.setState({dirty:!0,value:t+r},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:t-r},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1}}get initialValue(){const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e,formattedValue:this.formatValue(e)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return this.state.value+this.getStep()<=this.getMax()}render(){var e;const{element:t,width:r,disabled:n,widgetMgr:i}=this.props,{formattedValue:o,dirty:s,isFocused:a}=this.state,u={width:r},p=!this.canDecrement||n,d=!this.canIncrement||n;return this.formClearHelper.manageFormClearListener(i,t.formId,this.onFormCleared),Object(V.jsxs)("div",{className:"stNumberInput",style:u,children:[Object(V.jsx)(v.d,{label:t.label,disabled:n,labelVisibility:Object(w.j)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&Object(V.jsx)(v.b,{children:Object(V.jsx)(f.a,{content:t.help,placement:m.b.TOP_RIGHT})})}),Object(V.jsxs)(x,{className:a?"focused":"",children:[Object(V.jsx)(y.a,{type:"number",inputRef:this.inputRef,value:o,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:n,"aria-label":t.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),Object(V.jsxs)(O,{children:[Object(V.jsx)(S,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:p,children:Object(V.jsx)(b.b,{content:c,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),Object(V.jsx)(S,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:d,children:Object(V.jsx)(b.b,{content:l,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),Object(V.jsx)(k,{children:Object(V.jsx)(g.a,{dirty:s,value:o,className:"input-instructions"})})]})}}var F=E}}]);
|
|
6
|
+
`,a=Object(o.a)("span",{target:"e1m4n6jn0"})((({includeDot:e,shouldBlink:t,theme:r})=>({...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:r.colors.gray,margin:"0 5px"}}:{},...t?{color:r.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),"");var c=r(1);t.a=({dirty:e,value:t,maxLength:r,className:o,type:s="single"})=>{const l=[],u=(e,t=!1)=>{l.push(Object(c.jsx)(a,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return e&&("multiline"===s?Object(n.f)()?u("Press \u2318+Enter to apply"):u("Press Ctrl+Enter to apply"):u("Press Enter to apply")),r&&u(`${t.length}/${r}`,e&&t.length>=r),Object(c.jsx)(i.a,{className:o,children:l})}},1376:function(e,t,r){"use strict";var n=r(0),i=r(11),o=r(1309),s=r(1382),a=r(1248),c=r(78);function l(e){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(c){i=!0,o=c}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=w(e);if(t){var i=w(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){return!t||"object"!==l(t)&&"function"!==typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(g,e);var t,r,l,d=y(g);function g(){var e;f(this,g);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return j(v(e=d.call.apply(d,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),j(v(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),j(v(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=g,(r=[{key:"render",value:function(){var e=this.props,t=e.startEnhancer,r=e.endEnhancer,l=e.overrides,d=l.Root,f=l.StartEnhancer,m=l.EndEnhancer,b=h(l,["Root","StartEnhancer","EndEnhancer"]),y=h(e,["startEnhancer","endEnhancer","overrides"]),g=p(Object(i.c)(d,a.d),2),v=g[0],w=g[1],j=p(Object(i.c)(f,a.c),2),x=j[0],S=j[1],k=p(Object(i.c)(m,a.c),2),V=k[0],E=k[1],F=Object(o.a)(this.props,this.state);return n.createElement(v,u({"data-baseweb":"input"},F,w,{$adjoined:O(t,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),t&&n.createElement(x,u({},F,S,{$position:c.c.start}),"function"===typeof t?t(F):t),n.createElement(s.a,u({},y,{overrides:b,adjoined:O(t,r),onFocus:this.onFocus,onBlur:this.onBlur})),r&&n.createElement(V,u({},F,E,{$position:c.c.end}),"function"===typeof r?r(F):r))}}])&&m(t.prototype,r),l&&m(t,l),g}(n.Component);function O(e,t){return e&&t?c.a.both:e?c.a.left:t?c.a.right:c.a.none}j(x,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",error:!1,onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:c.d.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text"}),t.a=x},1377:function(e,t,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return a(l(e),arguments)}function s(e,t){return o.apply(null,[e].concat(t||[]))}function a(e,t){var r,n,s,a,c,l,u,p,d,h=1,f=e.length,m="";for(n=0;n<f;n++)if("string"===typeof e[n])m+=e[n];else if("object"===typeof e[n]){if((a=e[n]).keys)for(r=t[h],s=0;s<a.keys.length;s++){if(void 0==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[s],a.keys[s-1]));r=r[a.keys[s]]}else r=a.param_no?t[a.param_no]:t[h++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(a.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(i.number.test(a.type)&&(p=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?m+=r:(!i.number.test(a.type)||p&&!a.sign?d="":(d=p?"+":"-",r=r.toString().replace(i.sign,"")),l=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(d+r).length,c=a.width&&u>0?l.repeat(u):"",m+=a.align?d+r+c:"0"===l?d+c+r:c+d+r)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,r=e,n=[],o=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],a=t[2],l=[];if(null===(l=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(a=a.substring(l[0].length));)if(null!==(l=i.key_access.exec(a)))s.push(l[1]);else{if(null===(l=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return c[e]=n}t.sprintf=o,t.vsprintf=s,"undefined"!==typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(n=function(){return{sprintf:o,vsprintf:s}}.call(t,r,t,e))||(e.exports=n))}()},1785:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return F}));var n=r(0),i=r.n(n),o=r(82),s=r.n(o),a=r(34),c=n.forwardRef((function(e,t){return n.createElement(a.a,s()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),n.createElement("path",{d:"M0 3v2h8V3H0z"}))}));c.displayName="Minus";var l=n.forwardRef((function(e,t){return n.createElement(a.a,s()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),n.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))}));l.displayName="Plus";var u=r(1377),p=r(193),d=r(19),h=r(15),f=r(114),m=r(50),b=r(41),y=r(1376),g=r(1275),v=r(113),w=r(33),j=r(5);const x=Object(j.a)("div",{target:"e1jwn65y3"})((({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",border:"1px solid transparent",transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.md,"&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}})),""),O=Object(j.a)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),S=Object(j.a)("button",{target:"e1jwn65y1"})((({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}})),""),k=Object(j.a)("div",{target:"e1jwn65y0"})((({theme:e})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:"64px"})),"");var V=r(1);class E extends i.a.PureComponent{constructor(e){super(e),this.formClearHelper=new p.b,this.inputRef=i.a.createRef(),this.formatValue=e=>{const t=function(e){return null==e||""===e?void 0:e}(this.props.element.format);if(null==t)return e.toString();try{return Object(u.sprintf)(t,e)}catch(r){return Object(d.d)(`Error in sprintf(${t}, ${e}): ${r}`),String(e)}},this.isIntData=()=>this.props.element.dataType===h.p.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:e}=this.props.element;return e||(this.isIntData()?1:.01)},this.commitWidgetValue=e=>{const{value:t}=this.state,{element:r,widgetMgr:n}=this.props,i=this.props.element,o=this.getMin(),s=this.getMax();if(o>t||t>s){const e=this.inputRef.current;e&&e.reportValidity()}else{const o=t||0===t?t:i.default;this.isIntData()?n.setIntValue(r,o,e):n.setDoubleValue(r,o,e),this.setState({dirty:!1,value:o,formattedValue:this.formatValue(o)})}},this.onFormCleared=()=>{this.setState({value:this.props.element.default},(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=e=>{const{value:t}=e.target;let r;r=this.isIntData()?parseInt(t,10):parseFloat(t),this.setState({dirty:!0,value:r,formattedValue:t})},this.onKeyDown=e=>{const{key:t}=e;switch(t){case"ArrowUp":e.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":e.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=e=>{"Enter"===e.key&&this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.modifyValueUsingStep=e=>()=>{const{value:t}=this.state,r=this.getStep();switch(e){case"increment":this.canIncrement&&this.setState({dirty:!0,value:t+r},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:t-r},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1}}get initialValue(){const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e,formattedValue:this.formatValue(e)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return this.state.value+this.getStep()<=this.getMax()}render(){var e;const{element:t,width:r,disabled:n,widgetMgr:i}=this.props,{formattedValue:o,dirty:s,isFocused:a}=this.state,u={width:r},p=!this.canDecrement||n,d=!this.canIncrement||n;return this.formClearHelper.manageFormClearListener(i,t.formId,this.onFormCleared),Object(V.jsxs)("div",{className:"stNumberInput",style:u,children:[Object(V.jsx)(v.d,{label:t.label,disabled:n,labelVisibility:Object(w.j)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&Object(V.jsx)(v.b,{children:Object(V.jsx)(f.a,{content:t.help,placement:m.b.TOP_RIGHT})})}),Object(V.jsxs)(x,{className:a?"focused":"",children:[Object(V.jsx)(y.a,{type:"number",inputRef:this.inputRef,value:o,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:n,"aria-label":t.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),Object(V.jsxs)(O,{children:[Object(V.jsx)(S,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:p,children:Object(V.jsx)(b.b,{content:c,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),Object(V.jsx)(S,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:d,children:Object(V.jsx)(b.b,{content:l,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),Object(V.jsx)(k,{children:Object(V.jsx)(g.a,{dirty:s,value:o,className:"input-instructions"})})]})}}var F=E}}]);
|
package/build/static/js/{19.1d97adb1.chunk.js.LICENSE.txt → 19.9004a138.chunk.js.LICENSE.txt}
RENAMED
|
File without changes
|