diff --git a/dist/zinggrid.es5.min.js b/dist/zinggrid.es5.min.js index b0bfc24..dab3e22 100644 --- a/dist/zinggrid.es5.min.js +++ b/dist/zinggrid.es5.min.js @@ -1,2 +1,7 @@ -/*! For license information please see zinggrid.es5.min.js.LICENSE.txt */ -(()=>{var e={26981:(e,t,o)=>{"use strict";o(11983);var n,r=(n=o(40115))&&n.__esModule?n:{default:n};r.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),r.default._babelPolyfill=!0},11983:(e,t,o)=>{"use strict";o(16266),o(10990),o(70911),o(14160),o(6197),o(96728),o(54039),o(93568),o(78051),o(38250),o(15434),o(54952),o(96337),o(35666)},84981:(e,t,o)=>{"use strict";o.d(t,{Z:()=>de});var n=o(87822);o(96766);var r=o(37486);const i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",gray:"#808080",green:"#008000",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",purple:"#800080",powderblue:"#b0e0e6",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd3"};function a(e,t,o){return(t=d(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e){return s="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},s(e)}function l(e,t){for(var o=0;o-1&&(e=t),t&&-1===Object.values(this.modes).indexOf(t)&&this.addInvalidClass(),e}},{key:"getPreviewFromAttr",value:function(){return"disabled"!==this.columnHasPreviewAttr}},{key:"getSpacesFromAttr",value:function(){var e=this.columnHasSpacesAttr;return e&&e===this.spaces.invalid?this.spaces.invalid:e&&e===this.spaces.inherit?this.spaces.inherit:this.spaces.valid}},{key:"formatColor",value:function(){var e,t;this.columnHasModeAttr&&!this.colorMode?(e=this.color,t=!0):(e=this.convertColor(),t=!1);var o=e;if(this.previewTarget){var n=t||this.colorIsTransparent||!this.colorMode?"#ebebeb":"transparent";o='\n
\n \n ').concat(e,"\n
\n ").trim()}return o}},{key:"isColorTransparent",value:function(){if(this.colorRaw===this.transparent)return!0;var e=this.getParts(this.color);return 4===e.length&&"0"===e[3]}},{key:"convertColor",value:function(){var e=this.color;switch(this.modeTarget){case this.hexAlpha:case this.hexLong:case this.hexShort:e=this.convertToHex();break;case this.hsl:case this.hsla:e=this.convertToHsl();break;case this.name:e=this.convertToName();break;case this.rgb:case this.rgba:e=this.convertToRgb()}return e||"--"}},{key:"convertToHex",value:function(e){var t=this.colorMode;switch(e&&(this.modeTarget=e),t){case this.hexAlpha:case this.hexLong:case this.hexShort:return this.convertHexToHex();case this.hsl:case this.hsla:return this.convertHslToHex();case this.rgb:case this.rgba:return this.convertRgbToHex();case this.name:return this.convertNameToHex()}}},{key:"convertToHsl",value:function(){switch(this.colorMode){case this.hexAlpha:case this.hexLong:case this.hexShort:return this.convertHexToHsl();case this.hsl:case this.hsla:return this.convertHslToHsl();case this.rgb:case this.rgba:return this.convertRgbToHsl();case this.name:return this.convertNameToHsl()}}},{key:"convertToName",value:function(){switch(this.colorMode){case this.hexAlpha:case this.hexLong:case this.hexShort:return this.convertHexToName();case this.hsl:case this.hsla:return this.convertHslToName();case this.rgb:case this.rgba:return this.convertRgbToName();case this.name:return this.convertNameToName()}}},{key:"convertToRgb",value:function(){switch(this.colorMode){case this.hexAlpha:case this.hexLong:case this.hexShort:return this.convertHexToRgb();case this.hsl:case this.hsla:return this.convertHslToRgb();case this.rgb:case this.rgba:return this.convertRgbToRgb();case this.name:return this.convertNameToRgb()}}},{key:"convertHexToHex",value:function(){var e=this.color,t=this.color.length,o=this.modeTarget===this.hexAlpha,n=this.modeTarget===this.hexShort,r=this.modeTarget===this.hexLong,i=9===t,a=4===t,s=7===t;if(o){if(i)return e;if(s)return"".concat(e,"ff");if(a)return"".concat(this.getLongHex(e),"ff")}if(r){if(i)return e.substring(0,t-2);if(s)return e;if(a)return this.getLongHex(e)}if(n){if(i)return this.getShortHex(e);if(s)return this.getShortHex(e);if(a)return e}}},{key:"convertHexToHsl",value:function(){var e=this.getAlphaHex(),t=this.separator,o=this.modeTarget===this.hsl,n=this.modeTarget===this.hsla;return function(e){if(!/^#([\da-f]{4}){1,2}$/i.test(e))return"Invalid input color";var r=0,i=0,a=0,s=1;5==e.length?(r="0x"+e[1]+e[1],i="0x"+e[2]+e[2],a="0x"+e[3]+e[3],s="0x"+e[4]+e[4]):9==e.length&&(r="0x"+e[1]+e[2],i="0x"+e[3]+e[4],a="0x"+e[5]+e[6],s="0x"+e[7]+e[8]),r/=255,i/=255,a/=255;var l=Math.min(r,i,a),d=Math.max(r,i,a),c=d-l,u=0,h=0,f=0;return u=0==c?0:d==r?(i-a)/c%6:d==i?(a-r)/c+2:(r-i)/c+4,(u=Math.round(60*u))<0&&(u+=360),f=(d+l)/2,h=+(100*(h=0==c?0:c/(1-Math.abs(2*f-1)))).toFixed(1),f=+(100*f).toFixed(1),s="0"===(s="1"===(s=(s/255).toFixed(2))[0]?1:s)[0]?s.substring(1):s,h="".concat(parseInt(h),"%"),f="".concat(parseInt(f),"%"),n?"hsla(".concat(u).concat(t).concat(h).concat(t).concat(f).concat(t).concat(s,")"):o?"hsl(".concat(u).concat(t).concat(h).concat(t).concat(f,")"):void 0}(e)}},{key:"convertHexToName",value:function(){var e=this.getLongHex(this.color);return this.matchHexToName(e)}},{key:"convertHexToRgb",value:function(){var e,t,o,n=this.getAlphaHex(),r=this.separator,i=this.modeTarget===this.rgb,a=this.modeTarget===this.rgba,s="";return""==n&&(n="000000"),"#"==n[0]&&(n=n.substring(1,n.length)),3==n.length?(e="".concat(n.substring(0,1)).concat(n.substring(0,1)),t="".concat(n.substring(1,2)).concat(n.substring(1,2)),o="".concat(n.substring(2,3)).concat(n.substring(2,3))):(e=n.substring(0,2),t=n.substring(2,4),o=n.substring(4,6)),8==n.length&&(s=(parseInt(n.substring(6,8),16)/255).toFixed(2)),e=parseInt(e,16),t=parseInt(t,16),o=parseInt(o,16),s="0"===(s="1"===s[0]?parseInt(s):s)[0]?s.substring(1):s,i?"rgb(".concat(e).concat(r).concat(t).concat(r).concat(o,")"):a?"rgba(".concat(e).concat(r).concat(t).concat(r).concat(o).concat(r).concat(s,")"):void 0}},{key:"convertHslToHex",value:function(){var e=this.formatParts("hsl",this.color),t=this.convertHslToRgb(e);return this.convertRgbToHex(t)}},{key:"convertHslToHsl",value:function(){this.color;var e=this.formatParts("hsl",this.color),t=(e.H,e.S,e.L,e.A,e.display),o=e.displayAlpha,n=this.modeTarget===this.hsl,r=this.modeTarget===this.hsla;return this.colorMode=this.hsla,this.colorMode=this.hsl,r?o:n?t:void 0}},{key:"convertHslToName",value:function(){if(this.colorIsTransparent)return this.returnTransparent();var e=this.convertHslToHex().display;return this.matchHexToName(e)}},{key:"convertHslToRgb",value:function(e){e&&"object"!==!s(e)||(e=this.formatParts("hsl",this.color));var t=e,o=t.H,n=t.S,r=t.L,i=t.A,a=void 0===i?1:i,l=t.display,d=0,c=0,u=0,f=this.separator;return function(e,t){var i=!1;if(/^hsl\(((((([12]?[1-9]?\d)|[12]0\d|(3[0-5]\d))(\.\d+)?)|(\.\d+))(deg)?|(0|0?\.\d+)turn|(([0-6](\.\d+)?)|(\.\d+))rad)((,\s?(([1-9]?\d(\.\d+)?)|100|(\.\d+))%){2}|(\s(([1-9]?\d(\.\d+)?)|100|(\.\d+))%){2})\)$/i.test(e)){e=e.substr(4).split(")")[0].split(f),i=!0===i,n=e[1].substr(0,e[1].length-1)/100,r=e[2].substr(0,e[2].length-1)/100,o.indexOf("deg")>-1?o=o.substr(0,o.length-3):o.indexOf("rad")>-1?o=Math.round(h.substr(0,o.length-3)/(2*Math.PI)*360):o.indexOf("turn")>-1&&(o=Math.round(360*h.substr(0,o.length-4))),o>=360&&(o%=360);var s=(1-Math.abs(2*r-1))*n,l=s*(1-Math.abs(o/60%2-1)),p=r-s/2;0<=o&&o<60?(d=s,c=l,u=0):60<=o&&o<120?(d=l,c=s,u=0):120<=o&&o<180?(d=0,c=s,u=l):180<=o&&o<240?(d=0,c=l,u=s):240<=o&&o<300?(d=l,c=0,u=s):300<=o&&o<360&&(d=s,c=0,u=l),d=Math.round(255*(d+p)),c=Math.round(255*(c+p)),u=Math.round(255*(u+p)),i&&(d=+(d/255*100).toFixed(1),c=+(c/255*100).toFixed(1),u=+(u/255*100).toFixed(1));var g={R:d,G:c,B:u,A:a,display:"rgb(".concat(d).concat(f).concat(c).concat(f).concat(u,")"),displayAlpha:"rgba(".concat(d).concat(f).concat(c).concat(f).concat(u).concat(f).concat(a,")")},m=t.modeTarget===t.rgb,b=t.modeTarget===t.rgba;return m?g.display:b?g.displayAlpha:g}return"Invalid color"}(l,this)}},{key:"convertNameToHex",value:function(){var e=this.color,t=this.modeTarget===this.hexAlpha,o=this.modeTarget===this.hexShort,n=this.modeTarget===this.hexLong,r=this.colorNames[e.toLowerCase()];return r?t?"".concat(r,"ff"):n?r:o?this.getShortHex(r):void 0:this.setNotConvertedState()}},{key:"convertNameToHsl",value:function(){var e=this.color,t=this.colorNames[e.toLowerCase()];return t?(this.color=t,this.convertHexToHsl()):this.setNotConvertedState()}},{key:"convertNameToName",value:function(){return this.color}},{key:"convertNameToRgb",value:function(){var e=this.color,t=this.colorNames[e.toLowerCase()];return t?(this.color=t,this.convertHexToRgb()):this.setNotConvertedState()}},{key:"convertRgbToHex",value:function(e){e&&"object"!==!s(e)||(e=this.formatParts("rgb",this.color));var t=e,o=t.R,n=t.G,r=t.B,i=t.A,a=void 0===i?1:i,l=(t.display,"rgba(".concat(o,",").concat(n,",").concat(r,",").concat(a,")"));if(this.separator,/^rgba\((((((((1?[1-9]?\d)|10\d|(2[0-4]\d)|25[0-5]),\s?)){3})|(((([1-9]?\d(\.\d+)?)|100|(\.\d+))%,\s?){3}))|(((((1?[1-9]?\d)|10\d|(2[0-4]\d)|25[0-5])\s){3})|(((([1-9]?\d(\.\d+)?)|100|(\.\d+))%\s){3}))\/\s)((0?\.\d+)|[01]|(([1-9]?\d(\.\d+)?)|100|(\.\d+))%)\)$/i.test(l)){for(var d in(l=(l=l.substr(5).split(")")[0]).split(",")).indexOf("/")>-1&&l.splice(3,1),l){var c=l[d];if(c.indexOf("%")>-1){var u=c.substr(0,c.length-1)/100;l[d]=d<3?Math.round(255*u):u}}o=(+l[0]).toString(16),n=(+l[1]).toString(16),r=(+l[2]).toString(16),a=Math.round(255*+l[3]).toString(16),1==o.length&&(o="0"+o),1==n.length&&(n="0"+n),1==r.length&&(r="0"+r),1==a.length&&(a="0"+a);var h=this.getShortHex("#".concat(o).concat(n).concat(r)),f=this.modeTarget===this.hexAlpha,p=this.modeTarget===this.hexShort,g=this.modeTarget===this.hexLong;return f?"#".concat(o).concat(n).concat(r).concat(a):g?"#".concat(o).concat(n).concat(r):p?h:{R:o,G:n,B:r,A:a,display:"#".concat(o).concat(n).concat(r),displayAlpha:"#".concat(o).concat(n).concat(r).concat(a),displayShort:h}}return"Invalid color"}},{key:"convertRgbToHsl",value:function(e){e&&"object"!==!s(e)||(e=this.formatParts("rgb",this.color));var t=e,o=t.R,n=t.G,r=t.B,i=t.A,a=void 0===i?1:i,l=(t.display,t.displayAlpha),d=0,c=0,u=0,h=this.separator;return function(e,t){if(/^rgba\((((((((1?[1-9]?\d)|10\d|(2[0-4]\d)|25[0-5]),\s?)){3})|(((([1-9]?\d(\.\d+)?)|100|(\.\d+))%,\s?){3}))|(((((1?[1-9]?\d)|10\d|(2[0-4]\d)|25[0-5])\s){3})|(((([1-9]?\d(\.\d+)?)|100|(\.\d+))%\s){3}))\/\s)((0?\.\d+)|[01]|(([1-9]?\d(\.\d+)?)|100|(\.\d+))%)\)$/i.test(e)){for(var i in(e=e.substr(5).split(")")[0].split(h)).indexOf("/")>-1&&e.splice(3,1),e){var s=e[i];if(s.indexOf("%")>-1){var l=s.substr(0,s.length-1)/100;i<3&&(e[i]=Math.round(255*l))}}o=e[0]/255,n=e[1]/255,r=e[2]/255,a=e[3];var f=Math.min(o,n,r),p=Math.max(o,n,r),g=p-f;d=0==g?0:p==o?(n-r)/g%6:p==n?(r-o)/g+2:(o-n)/g+4,(d=Math.round(60*d))<0&&(d+=360),u=(p+f)/2,c=+(100*(c=0==g?0:g/(1-Math.abs(2*u-1)))).toFixed(1),u=+(100*u).toFixed(1),c="".concat(parseInt(c),"%"),u="".concat(parseInt(u),"%");var m={H:d,S:c,L:u,A:a,display:"hsl(".concat(d).concat(h).concat(c).concat(h).concat(u,")"),displayAlpha:"hsla(".concat(d).concat(h).concat(c).concat(h).concat(u).concat(h).concat(a,")")},b=t.modeTarget===t.hsl,v=t.modeTarget===t.hsla;return b?m.display:v?m.displayAlpha:m}return"Invalid input color"}(l,this)}},{key:"convertRgbToName",value:function(){if(this.colorIsTransparent)return this.returnTransparent();var e=this.convertRgbToHex().display;return this.matchHexToName(e)}},{key:"convertRgbToRgb",value:function(){this.color;var e=this.formatParts("rgb",this.color),t=(e.R,e.G,e.B,e.A,e.display),o=e.displayAlpha,n=this.modeTarget===this.rgb,r=this.modeTarget===this.rgba;return this.colorMode=this.rgba,this.colorMode=this.rgb,r?o:n?t:void 0}},{key:"addNotConvertedClass",value:function(){this.cell.classList.add(this.notConvertedClass)}},{key:"addInvalidClass",value:function(){this.cell.classList.add(this.notValidClass)}},{key:"convertColorForConversions",value:function(e){return this.columnHasModeAttr&&e===this.transparent?"rgba(0, 0, 0, 0)":e}},{key:"formatParts",value:function(e,t){var o,n=e.toUpperCase(),r=this.getParts(t),i=this.separator,s=r[3]||1,l=n[0],d=n[1],c=n[2];return a(o={},l,r[0]),a(o,d,r[1]),a(o,c,r[2]),a(o,"A",s),a(o,"display","".concat(e,"(").concat(r[0]).concat(i).concat(r[1]).concat(i).concat(r[2],")")),a(o,"displayAlpha","".concat(e,"a(").concat(r[0]).concat(i).concat(r[1]).concat(i).concat(r[2]).concat(i).concat(s,")")),o}},{key:"getAlphaHex",value:function(){var e=this.color;return 4===e.length?"#".concat(e[1]).concat(e[1]).concat(e[2]).concat(e[2]).concat(e[3]).concat(e[3],"ff"):7===e.length?"".concat(e,"ff"):e}},{key:"getAttrFromColumn",value:function(e){return this.column.getAttribute(e)}},{key:"getLongHex",value:function(e){return 4!==e.length?e:"#".concat(e[1]).concat(e[1]).concat(e[2]).concat(e[2]).concat(e[3]).concat(e[3])}},{key:"getModeFromColor",value:function(){var e,t=this.color;return"#"===t[0]?(4===t.length&&(e=this.hexShort),7===t.length&&(e=this.hexLong),9===t.length&&(e=this.hexAlpha)):e=t.includes("".concat(this.hsl,"("))?this.hsl:t.includes("".concat(this.hsla,"("))?this.hsla:t.includes("".concat(this.rgb,"("))?this.rgb:t.includes("".concat(this.rgba,"("))?this.rgba:!!this.isColorNameMatch(t)&&this.name,e}},{key:"getParts",value:function(e){var t=e.replace(/ /g,""),o=t.indexOf("(")+1;return t.substring(o,t.length-1).split(",")}},{key:"getPercentage",value:function(e){var t=parseFloat(e).toFixed(2);return"".concat(Math.round(100*t),"%")}},{key:"getShortHex",value:function(e){var t=this.getShortHexPart("".concat(e[1]).concat(e[2])),o=this.getShortHexPart("".concat(e[3]).concat(e[4])),r=this.getShortHexPart("".concat(e[5]).concat(e[6])),i="#".concat(t).concat(o).concat(r);return 4===i.length?i:this.colorMode===n.Z.columnType.color.modes.name?(this.addNotConvertedClass(),e):this.setNotConvertedState()}},{key:"getShortHexPart",value:function(e){return e[0]===e[1]?e[0]:e}},{key:"isColorNameMatch",value:function(e){return this.colorKeys.filter((function(t){return t===e.toLowerCase()}))[0]}},{key:"isColorNameHexMatch",value:function(e){var t,o=this;return this.colorValues.forEach((function(n,r){return n===e.toLowerCase()?t=o.colorKeys[r]:n})),t}},{key:"matchHexToName",value:function(e){var t=this.isColorNameHexMatch(e);return t||this.setNotConvertedState()}},{key:"returnTransparent",value:function(){return this.colorRaw===this.transparent?this.colorRaw:this.colorIsTransparent?this.setNotConvertedState():void 0}},{key:"setNotConvertedState",value:function(){return this.columnHasModeAttr&&this.addNotConvertedClass(),this.color}},{key:"setNotValidState",value:function(){return this.columnHasModeAttr&&this.addInvalidClass(),this.color}},{key:"setSeparator",value:function(){return this.spacesTarget===this.spaces.invalid?",":this.spacesTarget===this.spaces.inherit?this.color.includes(" ")||this.colorMode===this.modes.name?", ":",":", "}},{key:"init",value:function(){return this.formatColor()}}])&&l(t.prototype,o),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();var u=o(19791);var f=o(1009);var p=o(2568);const g=function(){for(var e=arguments.length,t=new Array(e),o=0;o")}(e,a)})),u};function m(e){return m="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},m(e)}function b(e){return b="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},b(e)}function v(e,t){for(var o=0;o')),p.insertAdjacentHTML("beforeend",s),p})),y.registerRenderer("checkbox",(function(e,t,o){var n="string"==typeof e?e.toLowerCase():e,r=["false",!1,0].indexOf(n)>-1,i=["true",!0,1].indexOf(n)>-1;if(!r&&!i)return e;var a,s=i,l=[0,1].indexOf(e)>-1,d=o._columnConfig.sTypeCheckboxLabel,c=document.createElement("zg-checkbox");if(c.checked=i,c.setAttribute("parent","cell"),d){var u=document.createElement("label");u.setAttribute("style","display:inline-flex;align-items:center;cursor:pointer;line-height:1;");var h=document.createElement("span");h.textContent=d,u.addEventListener("click",f),c.setAttribute("style","margin-right:4px;pointer-events:none;"),u.appendChild(c),u.appendChild(h),a=u}else c.style.cursor="pointer",c.addEventListener("click",f),a=c;return a;function f(e){e.stopPropagation();var t=!s;l&&(t=t?1:0),o.rawData(t)}})),y.registerRenderer("code",(function(){for(var e=arguments.length,t=new Array(e),o=0;o
").concat(a,"
")})),y.registerRenderer("color",(function(){for(var e=arguments.length,t=new Array(e),o=0;o").concat(u,"")})),y.registerRenderer("email",(function(){for(var e=arguments.length,t=new Array(e),o=0;o").concat(a,"")})),y.registerRenderer("icon",(function(){for(var e=arguments.length,t=new Array(e),o=0;o')})),y.registerRenderer("image",g),y.registerRenderer("key",(function(){for(var e=arguments.length,t=new Array(e),o=0;o")})),y.registerRenderer("number",(function(){for(var e=arguments.length,t=new Array(e),o=0;o")),s})),y.registerRenderer("toggle",(function(e,t,o){var n,r=!!o._columnConfig.oDOMZGColumn.renderer,i=!!o._columnConfig.aTypeToggleOptions,a=!!o._columnConfig.bTypeToggleRenderValue,s=o._columnConfig.aTypeToggleOptions||[!1,!0],l=s.length,d=null,c=document.createElement("span");return r&&(d=o.fnRenderer),"object"===m(s[0])?(d=null,n=s.findIndex((function(t){return t.value==e}))):(n=!1===e?0:!0===e?1:s.indexOf(e),s=s.map((function(e,t){return{render:e,value:2!==l||a?e:1===t}}))),u(n),c.addEventListener("click",(function(){var e=(n+1)%l,t=u(e);o.rawData(t),n=e})),c;function u(e){var t,n,r=s[e];if(d){var a=d.scope||o;n=d.method.apply(a,[r.render])||"",t=r.value}else"object"===m(r)?(n=r.render,t=r.value):(n=r,t=i?r:!!e);return c.innerHTML=n,t}})),y.registerRenderer("url",(function(){for(var e=arguments.length,t=new Array(e),o=0;o'):'").concat(l,"")})),y.registerRenderer(n.Z.internalColumn.recordselector,(function(e,t,o){var r,i,a=void 0===o,s=a?this.oDOMZGColumn.widget:o.widget,l=this.sColumnId+s.randomKey;return t&&(r=t.querySelector("zg-checkbox")),i=!r||s.bPreloaded,r||(r=document.createElement("zg-checkbox"),a&&r.setAttribute("header",!0),r.setAttribute(n.Z.attr.internalselector,""),r.setAttribute(n.Z.zgLayout.attr,s.layoutManager.sCurrentType),r.setAttribute("parent",a?"head":"body")),r.setAttribute("name",l),i&&(r.on("statechanged",(function(e,t){if(a)for(var n=document.querySelectorAll('zg-row:not([hidden]) zg-checkbox[name="'.concat(l,'"]')),i=0;i"),a=h.cloneNode(!0);a.value=t?e.value:e,a.addEventListener("change",M.bind(i)),o.appendChild(a),o.insertAdjacentHTML("beforeend",r),c.appendChild(o)})),s.appendChild(c),this.oRadios=c.querySelectorAll('input[type="radio"]')}this.oRadios.forEach((function(e){e.value===i.sStartValue&&(e.checked=!0)}))},onClose:function(e){var t=e.querySelector("input"),o=t&&t.name||null,n=e.querySelector('input[name="'.concat(o,'"]:checked'));return o&&n?n.value:this.sNewValue}};function M(e){e.target.checked&&(this.sNewValue=e.target.value)}const D={init:function(e,t){var o=e._columnConfig.nTypeRangeMin||0,n=e._columnConfig.nTypeRangeMax||100,r=e._columnConfig.nTypeRangeStep||1;this.oDOMInput=z.Z.createInput("number",void 0,e),this.oDOMInput.min=o,this.oDOMInput.max=n,this.oDOMInput.step=r,t.appendChild(this.oDOMInput)},onOpen:z.Z.onOpen,onClose:z.Z.onNumberClose};var T=o(41090);const A={init:function(e,t){this.oDOMInput=z.Z.createInput("url",t,e)},onOpen:z.Z.onOpen,onClose:function(e){return e.querySelector("input").value}};function I(e){return I="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},I(e)}function L(e,t){for(var o=0;on),!r},message:function(e,t,o,n){var r,i=n._columnConfig,a=i.nTypeRangeMin||0,s=i.nTypeRangeMax||100;return isNaN(e)&&(r="'".concat(t,"' field must be set to a valid number.")),!r&&!1!==a&&es&&(r="'".concat(t,"' field must be less than ").concat(s,".")),r}},B={validator:function(e,t){var o=!1;try{var n;n=parseInt(e,10)==e?parseInt(e,10):e;var r=new Date(n);new Intl.DateTimeFormat("en-US").format(r)}catch(e){o=!0}return!o},message:function(e,t,o,n){return"'".concat(t,"' field must be set to a valid date.")}},G={validator:function(e,t){try{if(new URL(e))return!0}catch(e){return!1}},message:function(e,t,o,n){return"'".concat(t,"' field must be set to a valid URL.")}};function H(e){return H="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},H(e)}function j(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},o={editor:P.getEditor("input"),parser:null,renderer:w.getRenderer("text"),validator:null,sorter:V.Z.getSorter("text"),intlSorter:V.Z.getSorter("intl"),filter:oe.getFilter("text")};for(var n in t)o[n]=t[n];this.oRegisteredCellType[e]=o}}],o&&re(t.prototype,o),n&&re(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()),ae={editor:P.getEditor("number"),renderer:w.getRenderer("number"),validator:W.getValidator("number"),sorter:V.Z.getSorter("number"),intlSorter:null,filter:oe.getFilter("number")};ie.registerCellType("element",{renderer:w.getRenderer("element")}),ie.registerCellType("iframe",{renderer:w.getRenderer("iframe"),validator:W.getValidator("url")}),ie.registerCellType("icon",{renderer:w.getRenderer("icon")}),ie.registerCellType("image",{renderer:w.getRenderer("image"),validator:W.getValidator("url")}),ie.registerCellType("image-mask",{renderer:w.getRenderer("image-mask")}),ie.registerCellType("url",{renderer:w.getRenderer("url"),editor:P.getEditor("url"),validator:W.getValidator("url")}),ie.registerCellType("boolean",{editor:P.getEditor("boolean"),renderer:w.getRenderer("boolean"),sorter:V.Z.getSorter("boolean"),intlSorter:null,filter:oe.getFilter("boolean")}),ie.registerCellType("date",{renderer:w.getRenderer("date"),editor:P.getEditor("date"),sorter:V.Z.getSorter("date"),validator:W.getValidator("date"),intlSorter:null}),ie.registerCellType("number",ae),ie.registerCellType("text"),ie.registerCellType("aggregate",{renderer:w.getRenderer("aggregate"),sorter:!1,editor:!1}),ie.registerCellType("button",{renderer:w.getRenderer("button"),editor:!1}),ie.registerCellType("checkbox",{renderer:w.getRenderer("checkbox"),sorter:V.Z.getSorter("boolean"),editor:!1}),ie.registerCellType("code",{renderer:w.getRenderer("code")}),ie.registerCellType("color",{renderer:w.getRenderer("color"),editor:P.getEditor("color")});var se=r.c7.copy(ae);se.renderer=w.getRenderer("currency"),ie.registerCellType("currency",se),ie.registerCellType("email",{validator:W.getValidator("email"),renderer:w.getRenderer("email")}),ie.registerCellType("password",{renderer:w.getRenderer("password")}),ie.registerCellType("gravatar",{renderer:w.getRenderer("image"),editor:!1});var le=r.c7.copy(ae);le.renderer=w.getRenderer("percentage"),ie.registerCellType("percentage",le),ie.registerCellType("radio",{renderer:w.getRenderer("key"),editor:P.getEditor("radio")}),ie.registerCellType("range",{renderer:w.getRenderer("number"),editor:P.getEditor("range"),validator:W.getValidator("range")}),ie.registerCellType("select",{editor:P.getEditor("select"),filter:oe.getFilter("select"),renderer:w.getRenderer("key")}),ie.registerCellType("tel"),ie.registerCellType("toggle",{renderer:w.getRenderer("toggle"),editor:!1}),ie.registerCellType(n.Z.internalColumn.recordeditor,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.recordeditor),sorter:null,intlSorter:null,filter:null}),ie.registerCellType(n.Z.internalColumn.recordremover,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.recordremover),sorter:null,intlSorter:null,filter:null}),ie.registerCellType(n.Z.internalColumn.recordduplicate,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.recordduplicate),sorter:null,intlSorter:null,filter:null}),ie.registerCellType(n.Z.internalColumn.recordselector,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.recordselector),sorter:null,intlSorter:null,filter:null}),ie.registerCellType(n.Z.internalColumn.rownumber,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.rownumber),sorter:null,intlSorter:null,filter:null}),ie.registerCellType(n.Z.internalColumn.rowgroup,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.rowgroup)}),ie.registerCellType(n.Z.internalColumn.recordinfo,{editor:null,renderer:w.getRenderer(n.Z.internalColumn.recordinfo),sorter:null,intlSorter:null,filter:null});const de=ie},52770:(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});const n={onOpen:function(e,t,o){var n=t.querySelector("input");o||(o=t.value||""),n.value=String(o)},onNumberClose:function(e){var t=e.querySelector("input").value,o=window.parseFloat(t);return isNaN(o)&&(o=t),o},createInput:function(e,t,o){var n=document.createElement("input");return n.type=e,n.autoComplete="off",n.ariaInvalid=!1,o&&(n.name=o.sTargetFieldIndex),t&&t.appendChild(n),n}}},41090:(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var n=o(52770);const r={init:function(e,t){var o=e._columnConfig.sEditorType||e.sCellType,r="text";-1!==["tel","email","password","url"].indexOf(o)&&(r=o),this.oDOMInput=n.Z.createInput(r,t,e)},onOpen:n.Z.onOpen,onClose:function(e){return e.querySelector("input").value}}},12905:(e,t,o)=>{"use strict";function n(e){var t=e;return"string"==typeof e&&((t=new Date(e.toString().replace(/-/g,"/")))instanceof Date&&isFinite(t)||(t=new Date(e))),t}o.d(t,{Z:()=>l});const r=Intl.Collator().compare;function i(e){return i="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},i(e)}function a(e,t){for(var o=0;o=t?1:-1})),s.registerSorter("intl",r),s.registerSorter("date",(function(e,t){return n(e)-n(t)})),s.registerSorter("boolean",(function(e,t){return e.toString()>=t.toString()?1:-1}));const l=s},54739:(e,t,o)=>{"use strict";o.d(t,{Z:()=>w});var n=o(37486),r=o(31769),i=o(87822);function a(e){return a="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},a(e)}function s(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return d(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}(Object.getOwnPropertyNames(r.Z.prototype));try{for(y.s();!(b=y.n()).done;){!function(e){v.prototype[e]=function(){for(var t,o=arguments.length,n=new Array(o),i=0;i{"use strict";o.r(t),o.d(t,{default:()=>v});var n=o(54739),r=o(30785),i=o.n(r),a=o(49977),s=o.n(a),l=o(87822);function d(e){return d="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},d(e)}function c(e,t){for(var o=0;o{"use strict";o.r(t),o.d(t,{default:()=>v});var n=o(54739),r=o(39803),i=o.n(r),a=o(93528),s=o.n(a),l=o(87822);function d(e){return d="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},d(e)}function c(e,t){for(var o=0;o{"use strict";o.r(t),o.d(t,{default:()=>S});var n=o(54739),r=o(40662),i=o.n(r),a=o(36932),s=o.n(a),l=o(87822),d=o(19791),c=o(37486),u=o(96766);function h(e){return h="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},h(e)}function f(e,t){for(var o=0;o0;t&&this.setAttribute(l.Z.zgButton.hasTextAttr,"");var o=e===l.Z.zgButton.action.checkbox,n=this.querySelector('[slot="'.concat(l.Z.zgButton.slot.checkbox,'"]')),r=this.querySelector('[slot="'.concat(l.Z.zgButton.slot.icon,'"]')),i=this.querySelector('[slot="'.concat(l.Z.zgButton.slot.label,'"]')),a=!!e&&this.childNodes.length>0;if(this.icon||o||!t||a||n||r||i){this.oIcon.getAttribute("name")||!e&&!this.icon||this.oIcon.setAttribute("name",e||this.icon),this.bInCaption&&e&&this.oIcon.setAttribute(l.Z.attr.internalcaption,"");var s=this.getAttribute(l.Z.attr.type);s&&this.oIcon.setAttribute(l.Z.attr.type,s),a&&(this.oLabel.innerHTML=this._addMarkupToLabel()),this.oCheckbox=n||this.oCheckbox,this.oIcon=r||this.oIcon,this.oLabel=i||this.oLabel,this.oCheckbox.slot=l.Z.zgButton.action.checkbox,this.oIcon.slot=l.Z.zgButton.slot.icon,this.oLabel.slot=l.Z.zgButton.slot.label,this.appendChild(this.oIcon),this.appendChild(this.oCheckbox),this.appendChild(this.oLabel),this._toggleElements(e),this.oDOMRow=c.MV(this,l.Z.zgRow.tagName),this.bInCaption=c.MV(this,l.Z.zgCaption.tagName),(this.bInCaption||c.MV(this,l.Z.zgFooter.tagName))&&this.setTabIndex({allowed:!this.disabled}),this.oDOMRow&&this.setAttribute(l.Z.attr.internalcell,"")}}}},{key:"postRenderOns",value:function(){this.on("mouseenter",this.togglePseudoClass,this,{},!1),this.on("mouseleave",this.togglePseudoClass,this,{},!1),this.on("mousedown",this.togglePseudoClass,this,{},!1),this.on("mouseup",this.togglePseudoClass,this,{},!1),this.on("mousedown",this.onMouseDown,this,{},!1),this.on("focus",this.onFocus,this,{},!1),this.on("blur",this.onBlur,this),this.on("keydown",this.onKeyDown,this,{},!1)}},{key:"onBlur",value:function(e,t){this.classList.remove(l.Z.zgButton.aria.focus),this.bMouseDown=!1}},{key:"onFocus",value:function(e,t){e.stopEvent(),this.bMouseDown||this.classList.add(l.Z.zgButton.aria.focus)}},{key:"onKeyDown",value:function(e,t){e.nCharCode!==e.ENTER&&e.nCharCode!==e.SPACE||(e.preventDefault(),this.bMouseDown=!1,this.click())}},{key:"onMouseDown",value:function(e,t){e.stopEvent(),"fixedmenu"!==this.action&&this.widget.focusManager.unfocusCells(),this.classList.remove(l.Z.zgButton.aria.focus),this.bMouseDown=!0}},{key:"changePagerButton",value:function(e,t){e.includes(t)?this._disable():this._enable()}},{key:"getPageIndex",value:function(){var e=parseInt(this.getAttribute("page-index"),10);return isNaN(e)?(e=parseInt(this.innerText,10),isNaN(e)?null:e-1):e}},{key:"_updatePageIndex",value:function(e){e===this.getPageIndex()?(this.setAttribute(l.Z.zgPager.currentPageAttr,""),this._disable()):(this.removeAttribute(l.Z.zgPager.currentPageAttr),this._enable())}},{key:"notifyWidget",value:function(e,t){var o,n=this.action,r=this.widget,i=r.menuManager.activeCell,a=r.menuManager.activeHeader,s=r.menuManager.activeColumn,d=r.selectorEngineManager,u=null,h=r.selector.se,f=r.batchEditor,p=r.dirtyManager;if(e.preventDefault(),e.stopPropagation(),!this._isDisabled()&&!this.hasAttribute(l.Z.attr.active))switch(r.menuManager.activeMenu&&r.menuManager.closeMenu(),n){case"batchedit":f.activate(!this.bMouseDown);break;case"batcheditcancel":f.cancelBatchEdit(!this.bMouseDown);break;case"batcheditsave":r.batchEditor.save(!this.bMouseDown);break;case"cancelrecord":o=c.MV(this,l.Z.zgCell.tagName),r.recordEditor.cancelOpenEdit(),o&&r.webcomponent.select(o.parentNode.dataRowIndex,o.cellIndex);break;case"checkbox":this.oCheckbox.checked=!this.oCheckbox.checked;break;case"closerowgroup":(o=c.MV(this,l.Z.zgCell.tagName))&&(i=d.$cell(o)).sGroupRecordIndex&&r.groupbyManager.toggleGroup(i,!1);break;case"copycell":i&&r.clipper.onKeyCtrlCDocument(i);break;case"createrecord":void 0!==i&&i||(u=this.bInMenu?r.menuManager.oButton:this),r.editorManager.openInsertEditor(null,i,u);break;case"createrecordstart":this.bInMenu&&(u=r.menuManager.oButton),r.editorManager.openInsertEditor("start",void 0,u);break;case"createrecordend":this.bInMenu&&(u=r.menuManager.oButton),r.editorManager.openInsertEditor("end",void 0,u);break;case"deselect":r.bHasSelectorEnabled&&r.selector.deSelectAll();break;case"duplicaterecord":var g;this.parentCell?g=this.parentCell.sTargetRecordIndex:this.oDOMRow?g=h.row(this.oDOMRow).sTargetRecordIndex:i&&(g=i.toRow().sTargetRecordIndex),g&&r.duplicateRecord(g);break;case"editcell":i&&r.editorManager.openEditor(i);break;case"editrecord":if(this.parentCell)r.editorManager.openEditor(this.parentCell.toRow(),void 0,this.parentCell);else if(this.oDOMRow){var m=h.row(this.oDOMRow);r.editorManager.openEditor(m)}break;case"editrow":r.editorManager.openEditor(i.toRow());break;case"firstpage":r.firstPage();break;case"fixedmenu":r.menuManager&&(r.menuManager.oButton=this,r.menuManager.openFixedMenu(e));break;case"freezecolumnleft":s&&s.oDOMZGColumn.setAttribute("frozen","left");break;case"freezecolumnright":s&&s.oDOMZGColumn.setAttribute("frozen","right");break;case"unfreezecolumn":s&&(s.oDOMZGColumn.frozen=null);break;case"hidecolumn":s&&s.oDOMZGColumn.setAttribute("hidden","");break;case"freezerowtop":i&&r.store.moveRow(i.sTargetRecordIndex,"top");break;case"freezerowbottom":i&&r.store.moveRow(i.sTargetRecordIndex,"bottom");break;case"unfreezerow":i&&r.store.moveRow(i.sTargetRecordIndex,"body");break;case"getselection":break;case"insertrecord":r.insertRow(),r.lastPage();break;case"lastpage":r.lastPage();break;case"layoutrow":case"layoutcard":r.layoutManager.layoutCtrlClick(this);break;case"menu":r.columnMenu&&(this.setAttribute(l.Z.aria.expanded,"true"),r.columnMenu.oButton=this,r.columnMenu.openColumnMenu(e));break;case"openrowgroup":(o=c.MV(this,l.Z.zgCell.tagName))&&(i=d.$cell(o)).sGroupRecordIndex&&r.groupbyManager.toggleGroup(i,!0);break;case"page":var b=this.getPageIndex();null!==b&&r.setCurrPageIdx(b);break;case"nextpage":r.nextPage();break;case"pastecell":r.clipper.onKeyCtrlVDocument();break;case"prevpage":r.prevPage();break;case"undoremoverecord":if(this.parentCell)p.unsetDirtyDelete(this.parentCell.sTargetRecordIndex);else if(this.oDOMRow){var v=h.row(this.oDOMRow);p.unsetDirtyDelete(v.sTargetRecordIndex)}else if(i){var y=i.toRow();p.unsetDirtyDelete(y.sTargetRecordIndex)}break;case"removerecord":if(this.parentCell)r.removeRow(this.parentCell.sTargetRecordIndex);else if(r.aSelectedRows&&Object.keys(r.aSelectedRows).length)r.removeSelectedRows(this);else if(this.oDOMRow){var w=h.row(this.oDOMRow);r.removeRow(w.sTargetRecordIndex)}else if(i){var z=i.toRow();r.removeRow(z.sTargetRecordIndex)}break;case"reload":!r.store.isIncrementalLoad()&&r.oDOMSortedColumn&&r.oDOMSortedColumn._oParsedColumnMapping.oDOMSortHeader&&r.oDOMSortedColumn._oParsedColumnMapping.oDOMSortHeader.clearStyle(!0),r.stateManager.clearState(),r.updateInitialConfig(),r.store.reload();break;case"search":r.search&&r.search.searchBtnClickToggle(e);break;case"selectall":r.bHasSelectorEnabled&&h.selectAll().select();break;case"selectcell":case"selectrow":if(r.bHasSelectorEnabled&&i){var C=i.nStartRowIndex,S=i.nStartColumnIndex;"selectcell"===n?h.cell(C,S):h.initRange(C,0,C,this.widget.aColumnMapping.length-1),h.select()}break;case"sortcolumn":a&&a.onSort();break;case"submitrecord":o=c.MV(this,l.Z.zgCell.tagName),r.recordEditor.onClickSubmit(void 0,h.cell(o));break;case"resetstate":this.widget.stateManager.clearState(!0);break;case"about":var k=r.menuManager&&r.menuManager.bFixed;this.ZG.oDOMDialog.setDialog("zg-version"),k&&this.ZG.oDOMDialog.on("dialogConfirm",(function(){return r.focusManager.focusGrid(!0)}),this)}}},{key:"updateInfo",value:function(e,t){t=t||this.action;var o=(e=e||this.widget).getCurrPageIdx(),n=e.getPageCount(),r=e.getPageSize(),i=e.store.getOriginRecordCount()||e.getRowCount(),a=["firstpage","prevpage"],s=["nextpage","lastpage"],l=e.store&&e.store.oDataFormat.bCursor,d=e.store.oDataFormat.bLoadByPages&&e.store.oDataFormat.bStartAtValue;this._toggleElements(t),(a.includes(t)||s.includes(t)||"page"===t)&&(l?"nextpage"==t?e.store.hasNextData()?this._enable():this._disable():"prevpage"==t&&(e.store.hasPrevData()?this._enable():this._disable()):d?"nextpage"===t?e.store.sStartAtValue?this._enable():this._disable():"prevpage"===t&&(0===o?this._disable():this._enable()):"page"===t?this._updatePageIndex(o):r>=i?this._disable():0===o?this.changePagerButton(a,t):o===n-1?this.changePagerButton(s,t):this._enable())}},{key:"_addMarkupToLabel",value:function(){var e=this.querySelectorAll('[slot="'.concat(l.Z.zgButton.slot.checkbox,'"]')),t=this.querySelectorAll('[slot="'.concat(l.Z.zgButton.slot.icon,'"]'));e.forEach((function(e){return e.remove()})),t.forEach((function(e){return e.remove()}));var o=this.innerHTML;return this.innerHTML="",o}},{key:"_disable",value:function(){this.disabled=!0}},{key:"_enable",value:function(){this.disabled=!1}},{key:"_isDisabled",value:function(){return this.disabled}},{key:"setTabIndex",value:function(e){var t=e.allowed;-1===this.getAttribute(l.Z.attr.tabindex)||this.hasAttribute(l.Z.attr.datafocus)||(t?this.setAttribute(l.Z.attr.tabindex,0):this.removeAttribute(l.Z.attr.tabindex))}},{key:"_toggleElements",value:function(e){e===l.Z.zgButton.action.checkbox?this.oCheckbox.removeAttribute(l.Z.attr.hidden):this.oCheckbox.setAttribute(l.Z.attr.hidden,"")}},{key:"_propertyHandler",value:function(e,t,o){if(o=p(b(a.prototype),"_propertyHandler",this).call(this,e,t,o),this.bReady)switch(e){case"action":o&&(o=o.toLowerCase()),this.oIcon&&this.oIcon.setAttribute("name",o),this.hookupButton(o);break;case"disabled":this.setTabIndex({allowed:!o}),o?this.setAttribute(l.Z.aria.disabled,"true"):this.removeAttribute(l.Z.aria.disabled);break;case"handler":this.setCustomHandler(o);break;case"icon":this.oIcon&&(o?this.oIcon.setAttribute("name",o):this.oIcon.removeAttribute("name"));break;case"pageIndex":var n=this.widget.getCurrPageIdx();this._updatePageIndex(n);break;case"customTooltip":var r=this.setTooltip(this.action,this.widget,o);this.setAria(this.action,r);break;case"customDisabled":this.disabled=this.getDisabledStatus(o,this.widget)}return o}},{key:"_updateBinding",value:function(e,t,o,n){if(this.bReady&&(e&&o&&(this.fnUnSubscribe&&this.fnUnSubscribe(),this.fnUnNotify&&this.fnUnNotify(),this.fnUnCustom&&this.fnUnCustom()),t)){var r=t.sComputedDir;switch(this.updateInfo(t,n),n){case"batchedit":case"batcheditcancel":case"batcheditsave":case"cancel":case"cancelrecord":case"checkbox":case"closerowgroup":case"copycell":case"createrecord":case"createrecordend":case"createrecordstart":case"deselect":case"duplicaterecord":case"editcell":case"editrecord":case"editrow":case"firstpage":case"fixedmenu":case"freezecolumnleft":case"freezecolumnright":case"unfreezecolumn":case"hidecolumn":case"freezerowtop":case"freezerowbottom":case"unfreezerow":case"getselection":case"insertrecord":case"layoutrow":case"layoutcard":case"lastpage":case"menu":case"page":case"nextpage":case"openrowgroup":case"pastecell":case"prevpage":case"reload":case"removerecord":case"undoremoverecord":case"search":case"selectall":case"selectcell":case"selectrow":case"sortcolumn":case"resetstate":case"submitrecord":case"about":this.setAttribute("dir",r),this.fnUnNotify=this.on("click",this.notifyWidget,this,{},!1),this.fnUnSubscribe=t.on(l.Z.event.updated,this.updateInfo,this)}var i=this.setTooltip(n,t,this.customTooltip);this.setAria(n,i)}}},{key:"setAria",value:function(e,t){t&&this.setAttribute(l.Z.aria.label,t),"menu"!==e&&"fixedmenu"!==e||this.setAttribute(l.Z.aria.hasPopup,"true")}},{key:"setTooltip",value:function(e,t,o,n){if(t){var r,i=e,a=this.parentNode.tagName.toLowerCase();if(void 0===n&&(n=t.webcomponent.buttonTooltipDisabled),a!==l.Z.zgMenuItem.tagName&&(r=a===l.Z.zgControlBar.tagName,!this.hasAttribute(l.Z.zgButton.noTooltipAttr))){var s,c,u="tooltip-right",h="tooltip-left";switch("rtl"===t.sComputedDir&&(u="tooltip-left",h="tooltip-right"),e){case"createrecord":case"createrecordstart":case"createrecordend":s="recordCreate";break;case"layoutcard":s="layoutCard";break;case"layoutrow":s="layoutRow";break;case"batchedit":case"batcheditsave":case"batcheditcancel":case"duplicaterecord":case"editrecord":case"firstpage":case"fixedmenu":case"lastpage":case"menu":case"nextpage":case"prevpage":case"reload":case"removerecord":case"undoremoverecord":case"search":case"openrowgroup":case"closerowgroup":s=e}switch(e){case"batchedit":case"batcheditsave":case"batcheditcancel":case"createrecord":case"createrecordstart":case"createrecordend":case"lastpage":case"nextpage":case"page":case"reload":case"openrowgroup":case"closerowgroup":c=u;break;default:c=h}r&&"editrecord"===e&&(c=u);var f=this.parentCell&&this.parentCell.bHasCellTooltip;if(this.parentCell&&0===this.parentCell.nStartColumnIndex&&(c=u),n||!s&&!o||f)this.removeAttribute("tooltip");else{i=o||d.default.get("tooltip.".concat(s),t,{element:this,attribute:"tooltip"}),this.setAttribute("tooltip",i),this.setAttribute(c,"");var p=c===u?h:u;this.removeAttribute(p)}return i}}}},{key:"getDisabledStatus",value:function(e,t){var o,n,r,i=null,a=e,s=this.parentCell?this.parentCell.dom():c.MV(this,l.Z.zgCell.tagName);return null!==e&&(s&&(n=(i=t.selectorEngineManager.$cell(s))._columnConfig,r=i.record,o=n.fnTypeButtonDisabled),o||"string"!=typeof e||(o=u.Z.setUserFunction(null,e),n&&(n.fnTypeButtonDisabled=o)),o&&o.method?a=o.method.apply(o.scope,[r,i])||!1:(""===a?a=!0:i&&(a=t.store.processTemplate(a,null,i)),"true"===a?a=!0:"false"===a&&(a=!1)),a)}},{key:"setCustomHandler",value:function(e){this.fnUnCustom&&this.fnUnCustom(),e?(this.fnHandler=u.Z.setUserFunction(null,e),this.fnUnCustom=this.on("click",this.launchCallback,this,{},!1)):this.fnHandler=null}},{key:"launchCallback",value:function(){if(!this.disabled&&this.handler){var e=this.fnHandler;if(e||(this.fnHandler=e=u.Z.setUserFunction(null,this.handler)),e&&e.method){var t=this.parentCell?this.parentCell.dom():c.MV(this,l.Z.zgCell.tagName),o=[];if(t){var n=this.widget.selectorEngineManager.$cell(t);o=[n.record,t,n]}e.method.apply(e.scope,o)}}}},{key:"uns",value:function(){this.un("mousedown",this.onMouseDown),this.un("focus",this.onFocus),this.un("blur",this.onBlur),this.un("keydown",this.onKeyDown),this.un("mouseenter",this.togglePseudoClass),this.un("mouseleave",this.togglePseudoClass),this.un("mousedown",this.togglePseudoClass),this.un("mouseup",this.togglePseudoClass),this.fnUnSubscribe&&this.fnUnSubscribe(),this.fnUnNotify&&this.fnUnNotify(),this.fnUnCustom&&this.fnUnCustom()}},{key:"disconnectedCallback",value:function(){p(b(a.prototype),"disconnectedCallback",this).call(this),this.oCheckbox=null,this.oIcon=null,this.oLabel=null,this.parentCell=null,this.oDOMRow=null}}])&&f(t.prototype,o),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(n.Z);n.Z._registerElement(v,C);const S=C},27724:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>C});var n=o(54739),r=o(65138),i=o.n(r),a=o(32937),s=o.n(a),l=o(31655),d=o(37486),c=o(87822);function u(e){return u="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},u(e)}function h(e,t){for(var o=0;o