@zeedhi/common 1.36.0 → 1.39.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/dist/zd-common.esm.js +398 -65
- package/dist/zd-common.umd.js +401 -67
- package/package.json +3 -5
- package/types/components/zd-code-editor/code-editor.d.ts +2 -0
- package/types/components/zd-grid/grid-editable.d.ts +1 -1
- package/types/components/zd-select/select.d.ts +2 -0
- package/types/components/zd-select-multiple/select-multiple.d.ts +4 -0
- package/types/components/zd-select-tree/select-tree.d.ts +7 -1
- package/types/components/zd-select-tree-multiple/select-tree-multiple.d.ts +4 -0
- package/types/components/zd-tree-grid/interfaces.d.ts +3 -1
- package/types/components/zd-tree-grid/tree-grid-editable.d.ts +4 -3
- package/types/utils/report/report-type/interfaces.d.ts +7 -2
- package/types/utils/report/report-type/xls-report.d.ts +17 -1
- package/types/components/zd-apex-chart/apex_chart.d.ts +0 -55
- package/types/components/zd-button-group/button_group.d.ts +0 -83
- package/types/components/zd-checkbox-multiple/checkbox_multiple.d.ts +0 -42
- package/types/components/zd-code-editor/code_editor.d.ts +0 -58
- package/types/components/zd-code-editor/prism.d.ts +0 -14
- package/types/components/zd-collapse-card/collapse_card.d.ts +0 -56
- package/types/components/zd-component/child_not_found.d.ts +0 -6
- package/types/components/zd-component/component_render.d.ts +0 -16
- package/types/components/zd-component/invalid_accessor.d.ts +0 -6
- package/types/components/zd-date/date_range.d.ts +0 -124
- package/types/components/zd-grid/errors/not_editing.d.ts +0 -6
- package/types/components/zd-grid/errors/row_not_found.d.ts +0 -6
- package/types/components/zd-grid/grid_column.d.ts +0 -52
- package/types/components/zd-grid/grid_column_editable.d.ts +0 -13
- package/types/components/zd-grid/grid_editable.d.ts +0 -162
- package/types/components/zd-iterable/column_not_found.d.ts +0 -6
- package/types/components/zd-iterable/iterable_columns_button.d.ts +0 -29
- package/types/components/zd-iterable/iterable_columns_button_controller.d.ts +0 -6
- package/types/components/zd-iterable/iterable_page_component.d.ts +0 -27
- package/types/components/zd-iterable/iterable_page_info.d.ts +0 -7
- package/types/components/zd-iterable/iterable_page_size.d.ts +0 -62
- package/types/components/zd-iterable/iterable_pagination.d.ts +0 -28
- package/types/components/zd-list/item_not_found.d.ts +0 -6
- package/types/components/zd-list/list_group.d.ts +0 -30
- package/types/components/zd-list/list_item.d.ts +0 -49
- package/types/components/zd-master-detail/detail_not_found.d.ts +0 -6
- package/types/components/zd-master-detail/master_detail.d.ts +0 -20
- package/types/components/zd-master-detail/master_not_found.d.ts +0 -6
- package/types/components/zd-menu/menu_button.d.ts +0 -28
- package/types/components/zd-menu/menu_group.d.ts +0 -53
- package/types/components/zd-menu/menu_link.d.ts +0 -46
- package/types/components/zd-menu/menu_separator.d.ts +0 -7
- package/types/components/zd-modal/modal_close_button.d.ts +0 -28
- package/types/components/zd-svg-map/svg_map.d.ts +0 -78
- package/types/components/zd-tabs/tab_not_found.d.ts +0 -11
- package/types/components/zd-text-input/text_input.d.ts +0 -90
- package/types/components/zd-tree-grid/errors/not_editing.d.ts +0 -6
- package/types/components/zd-tree-grid/errors/row_not_found.d.ts +0 -6
- package/types/components/zd-tree-grid/tree-data-structure.d.ts +0 -144
- package/types/components/zd-tree-grid/tree_data_structure.d.ts +0 -144
- package/types/components/zd-tree-grid/tree_grid.d.ts +0 -77
- package/types/components/zd-tree-grid/tree_grid_column.d.ts +0 -52
- package/types/components/zd-tree-grid/tree_grid_column_editable.d.ts +0 -13
- package/types/components/zd-tree-grid/tree_grid_editable.d.ts +0 -157
package/dist/zd-common.umd.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.debounce'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.debounce', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.debounce, global.
|
|
5
|
-
})(this, (function (exports, core, debounce,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.debounce'), require('lodash.isundefined'), require('lodash.merge'), require('lodash.set')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.debounce', 'lodash.isundefined', 'lodash.merge', 'lodash.set'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.debounce, global.isUndefined, global.merge, global.set));
|
|
5
|
+
})(this, (function (exports, core, debounce, isUndefined, merge, set) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
9
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
10
|
-
var Prism__default = /*#__PURE__*/_interopDefaultLegacy(Prism$1);
|
|
11
10
|
var isUndefined__default = /*#__PURE__*/_interopDefaultLegacy(isUndefined);
|
|
12
11
|
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
13
12
|
var set__default = /*#__PURE__*/_interopDefaultLegacy(set);
|
|
@@ -1762,26 +1761,6 @@
|
|
|
1762
1761
|
}
|
|
1763
1762
|
}
|
|
1764
1763
|
|
|
1765
|
-
!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter;var s=e.languages.extend("typescript",{});delete s["class-name"],e.languages.typescript["class-name"].inside=s,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),e.languages.ts=e.languages.typescript;}(Prism);
|
|
1766
|
-
|
|
1767
|
-
Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
|
|
1768
|
-
|
|
1769
|
-
Prism.languages.jsonp=Prism.languages.extend("json",{punctuation:/[{}[\]();,.]/}),Prism.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/});
|
|
1770
|
-
|
|
1771
|
-
!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=a.variable[1].inside,o=0;o<s.length;o++)i[s[o]]=e.languages.bash[s[o]];e.languages.shell=e.languages.bash;}(Prism);
|
|
1772
|
-
|
|
1773
|
-
!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n="(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",a={pattern:RegExp(n+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[a,{pattern:RegExp(n+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])"),lookbehind:!0,inside:a.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}});}(Prism);
|
|
1774
|
-
|
|
1775
|
-
!function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"],e.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/("""|''')[\s\S]*?\1/,alias:"string"}}),e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}});var n=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:e.languages.kotlin}},{pattern:/\$\w+/,alias:"variable"}];e.languages.kotlin.string.inside=e.languages.kotlin["raw-string"].inside={interpolation:n},e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin;}(Prism);
|
|
1776
|
-
|
|
1777
|
-
!function(e){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,t="(?:"+r.source+"(?:[ \t]+"+n.source+")?|"+n.source+"(?:[ \t]+"+r.source+")?)",a="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*".replace(/<PLAIN>/g,function(){return "[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"}),d="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function o(e,n){n=(n||"").replace(/m/g,"")+"m";var r="([:\\-,[{]\\s*(?:\\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))".replace(/<<prop>>/g,function(){return t}).replace(/<<value>>/g,function(){return e});return RegExp(r,n)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<<prop>>/g,function(){return t})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\\s*:\\s)".replace(/<<prop>>/g,function(){return t}).replace(/<<key>>/g,function(){return "(?:"+a+"|"+d+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("true|false","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml;}(Prism);
|
|
1778
|
-
|
|
1779
|
-
!function(e){var r="(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)".replace(/<SP_BS>/g,function(){return "\\\\[\r\n](?:\\s|\\\\[\r\n]|#.*(?!.))*(?![\\s#]|\\\\[\r\n])"}),n="\"(?:[^\"\\\\\r\n]|\\\\(?:\r\n|[^]))*\"|'(?:[^'\\\\\r\n]|\\\\(?:\r\n|[^]))*'",t="--[\\w-]+=(?:<STR>|(?![\"'])(?:[^\\s\\\\]|\\\\.)+)".replace(/<STR>/g,function(){return n}),o={pattern:RegExp(n),greedy:!0},i={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function a(e,n){return e=e.replace(/<OPT>/g,function(){return t}).replace(/<SP>/g,function(){return r}),RegExp(e,n)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:a("(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*","i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[o,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:a("(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b","i"),lookbehind:!0,greedy:!0},{pattern:a("(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\\\]+<SP>)AS","i"),lookbehind:!0,greedy:!0},{pattern:a("(^ONBUILD<SP>)\\w+","i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:i,string:o,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:i},e.languages.dockerfile=e.languages.docker;}(Prism);
|
|
1780
|
-
|
|
1781
|
-
Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};
|
|
1782
|
-
|
|
1783
|
-
Prism.languages.groovy=Prism.languages.extend("clike",{string:[{pattern:/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0},{pattern:/(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:/\b(?:as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===t&&(n=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),e.content=e.content.replace(/</g,"<").replace(/&/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring");}}});
|
|
1784
|
-
|
|
1785
1764
|
/**
|
|
1786
1765
|
* The Code Editor component <code>zd-code-editor</code> is used to show code highlighted using one of the
|
|
1787
1766
|
* language supported by <a href=\"http://prismjs.com\" alt=\"Prism JS\" target=\"_blank\">Prism JS</a>
|
|
@@ -1824,6 +1803,9 @@
|
|
|
1824
1803
|
this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
|
|
1825
1804
|
this.createAccessors();
|
|
1826
1805
|
}
|
|
1806
|
+
setViewHighlight(fn) {
|
|
1807
|
+
this.viewHighlight = fn;
|
|
1808
|
+
}
|
|
1827
1809
|
/**
|
|
1828
1810
|
* Code to be shown. When showing JSON code, the JSON object can be passed instead of the string code.
|
|
1829
1811
|
*/
|
|
@@ -1904,7 +1886,10 @@
|
|
|
1904
1886
|
* Get the code highlighted
|
|
1905
1887
|
*/
|
|
1906
1888
|
getHighlightedCode() {
|
|
1907
|
-
|
|
1889
|
+
if (!this.viewHighlight) {
|
|
1890
|
+
throw new core.MethodNotAssignedError('viewHighlight');
|
|
1891
|
+
}
|
|
1892
|
+
return this.viewHighlight(this.code, this.language);
|
|
1908
1893
|
}
|
|
1909
1894
|
/**
|
|
1910
1895
|
* Get the total of lines
|
|
@@ -2517,7 +2502,7 @@
|
|
|
2517
2502
|
*/
|
|
2518
2503
|
this.text = 'Loading';
|
|
2519
2504
|
this.isVisible = false;
|
|
2520
|
-
this.zIndex =
|
|
2505
|
+
this.zIndex = 999;
|
|
2521
2506
|
this.text = this.getInitValue('text', props.text, this.text);
|
|
2522
2507
|
this.zIndex = this.getInitValue('zIndex', props.zIndex, this.zIndex);
|
|
2523
2508
|
this.defaultText = this.text;
|
|
@@ -4339,7 +4324,7 @@
|
|
|
4339
4324
|
const appliedConditions = {};
|
|
4340
4325
|
Object.keys(this.factoredConditions).forEach((condition) => {
|
|
4341
4326
|
const conditionFunction = this.factoredConditions[condition];
|
|
4342
|
-
set__default["default"](appliedConditions, condition, conditionFunction({ row }));
|
|
4327
|
+
set__default["default"](appliedConditions, condition, conditionFunction({ row, column: this }));
|
|
4343
4328
|
});
|
|
4344
4329
|
return appliedConditions;
|
|
4345
4330
|
}
|
|
@@ -4591,7 +4576,7 @@
|
|
|
4591
4576
|
let currentRow = row;
|
|
4592
4577
|
if (dataValue) {
|
|
4593
4578
|
if (!formatterDataText) {
|
|
4594
|
-
currentRow = column.getLookupData(dataValue, value);
|
|
4579
|
+
currentRow = column.getLookupData(dataValue, value[dataValue] || value);
|
|
4595
4580
|
}
|
|
4596
4581
|
else {
|
|
4597
4582
|
const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
|
|
@@ -4607,7 +4592,7 @@
|
|
|
4607
4592
|
}
|
|
4608
4593
|
}
|
|
4609
4594
|
if (!Object.keys(currentRow).length)
|
|
4610
|
-
return value;
|
|
4595
|
+
return typeof value === 'object' ? '' : value;
|
|
4611
4596
|
const textColumn = formatterDataText || dataText;
|
|
4612
4597
|
if (textColumn) {
|
|
4613
4598
|
if (typeof textColumn === 'string') {
|
|
@@ -5090,7 +5075,6 @@
|
|
|
5090
5075
|
if (this.editing)
|
|
5091
5076
|
return;
|
|
5092
5077
|
if (column.editable) {
|
|
5093
|
-
this.selectedRows = [];
|
|
5094
5078
|
this.editing = true;
|
|
5095
5079
|
this.preventRowClick = true;
|
|
5096
5080
|
this.datasource.currentRow = row;
|
|
@@ -5160,7 +5144,7 @@
|
|
|
5160
5144
|
else {
|
|
5161
5145
|
colValue = row[column.name];
|
|
5162
5146
|
}
|
|
5163
|
-
const componentProps = merge__default["default"]({}, column.componentProps, cellProps.componentProps);
|
|
5147
|
+
const componentProps = merge__default["default"]({}, column.componentProps, cellProps === null || cellProps === void 0 ? void 0 : cellProps.componentProps);
|
|
5164
5148
|
let compEvents = {};
|
|
5165
5149
|
if (componentProps && componentProps.events) {
|
|
5166
5150
|
compEvents = core.Event.factory(componentProps.events);
|
|
@@ -5194,7 +5178,8 @@
|
|
|
5194
5178
|
checkLookupData(column, row, componentProps) {
|
|
5195
5179
|
if (row[column.name] && column.lookupData && componentProps.datasource) {
|
|
5196
5180
|
componentProps.datasource.data = componentProps.datasource.data || [];
|
|
5197
|
-
|
|
5181
|
+
const value = typeof row[column.name] === 'object' ? row[column.name][componentProps.dataValue] : row[column.name];
|
|
5182
|
+
componentProps.datasource.data.push(column.lookupData[value]);
|
|
5198
5183
|
}
|
|
5199
5184
|
}
|
|
5200
5185
|
checkCompValidity(component) {
|
|
@@ -5869,7 +5854,7 @@
|
|
|
5869
5854
|
*/
|
|
5870
5855
|
constructor(props) {
|
|
5871
5856
|
var _a, _b;
|
|
5872
|
-
super(props);
|
|
5857
|
+
super(Object.assign(Object.assign({}, props), { value: undefined }));
|
|
5873
5858
|
/**
|
|
5874
5859
|
* Field used to display values
|
|
5875
5860
|
*/
|
|
@@ -5952,6 +5937,7 @@
|
|
|
5952
5937
|
this.cachedData = [];
|
|
5953
5938
|
this.cachedTotal = 0;
|
|
5954
5939
|
this.formatterFn = core.FormatterParserProvider.getFormatter('ZdSelect');
|
|
5940
|
+
this.pushedValue = null;
|
|
5955
5941
|
this.loadMoreQtty = 0;
|
|
5956
5942
|
this.debounceSearch = debounce__default["default"](this.doSearch, 500);
|
|
5957
5943
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'expand');
|
|
@@ -5973,7 +5959,13 @@
|
|
|
5973
5959
|
this.dataText = [this.dataText];
|
|
5974
5960
|
const defaultDatasource = this.getDefaultDatasource(props);
|
|
5975
5961
|
this.datasource = core.DatasourceFactory.factory(defaultDatasource);
|
|
5976
|
-
this.
|
|
5962
|
+
this.overrideGet();
|
|
5963
|
+
let defaultValue = props.value;
|
|
5964
|
+
if (core.Accessor.isAccessorDefinition(props.value)) {
|
|
5965
|
+
defaultValue = this.getAccessorValue(props.value);
|
|
5966
|
+
this.getInitValue('value', props.value, this.value);
|
|
5967
|
+
}
|
|
5968
|
+
this.setDefaultValue(defaultValue, (_b = props.datasource) === null || _b === void 0 ? void 0 : _b.lazyLoad);
|
|
5977
5969
|
this.preventLoadOnFocus = !defaultDatasource.lazyLoad;
|
|
5978
5970
|
this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
|
|
5979
5971
|
this.loadMoreQtty = this.datasource.limit;
|
|
@@ -5982,6 +5974,11 @@
|
|
|
5982
5974
|
this.createAccessors();
|
|
5983
5975
|
this.initialized = true;
|
|
5984
5976
|
}
|
|
5977
|
+
getAccessorValue(accessorName) {
|
|
5978
|
+
const [controller, accessor] = core.Accessor.getAccessor(accessorName);
|
|
5979
|
+
const instance = core.Loader.getInstance(controller);
|
|
5980
|
+
return instance[accessor];
|
|
5981
|
+
}
|
|
5985
5982
|
/**
|
|
5986
5983
|
* Retrieves datasource structure applying infinity scroll
|
|
5987
5984
|
* @param field Field structure
|
|
@@ -5993,6 +5990,16 @@
|
|
|
5993
5990
|
const searchIn = (((_a = field.datasource) === null || _a === void 0 ? void 0 : _a.searchIn) || []).concat(searchInDefault);
|
|
5994
5991
|
return Object.assign(Object.assign({}, field.datasource), { searchIn, lazyLoad: (field.value !== '' && field.value !== undefined) || (field.datasource && field.datasource.lazyLoad) });
|
|
5995
5992
|
}
|
|
5993
|
+
overrideGet() {
|
|
5994
|
+
const oldGet = this.datasource.get;
|
|
5995
|
+
this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
5996
|
+
yield oldGet.call(this.datasource);
|
|
5997
|
+
if (this.indexOf(this.value) !== -1 || this.datasource.search || this.isFocused)
|
|
5998
|
+
return;
|
|
5999
|
+
yield this.setValue(this.value, false);
|
|
6000
|
+
this.removePushedValue();
|
|
6001
|
+
});
|
|
6002
|
+
}
|
|
5996
6003
|
get search() {
|
|
5997
6004
|
return this.searchValue;
|
|
5998
6005
|
}
|
|
@@ -6019,7 +6026,7 @@
|
|
|
6019
6026
|
}
|
|
6020
6027
|
if (this.manualMode)
|
|
6021
6028
|
return;
|
|
6022
|
-
this.cachedData = this.datasource.data;
|
|
6029
|
+
this.cachedData = [...this.datasource.data];
|
|
6023
6030
|
this.cachedTotal = this.datasource.total;
|
|
6024
6031
|
if (pushed) {
|
|
6025
6032
|
this.pushedValue = this.selectedData;
|
|
@@ -6078,10 +6085,14 @@
|
|
|
6078
6085
|
if (!this.pushedValue && this.isFilledObj(this.selectValue) && this.indexOf(this.selectValue) === -1) {
|
|
6079
6086
|
this.pushedValue = this.selectValue;
|
|
6080
6087
|
}
|
|
6081
|
-
|
|
6088
|
+
const index = this.indexOf(this.pushedValue);
|
|
6089
|
+
if (this.isFilledObj(this.pushedValue) && index === -1) {
|
|
6082
6090
|
this.datasource.data.unshift(this.pushedValue);
|
|
6083
6091
|
}
|
|
6084
|
-
|
|
6092
|
+
else if (index !== 0) {
|
|
6093
|
+
this.pushedValue = null;
|
|
6094
|
+
}
|
|
6095
|
+
this.cachedData = [...this.datasource.data];
|
|
6085
6096
|
this.cachedTotal = this.datasource.total;
|
|
6086
6097
|
}
|
|
6087
6098
|
/**
|
|
@@ -6140,6 +6151,7 @@
|
|
|
6140
6151
|
}
|
|
6141
6152
|
if (!searchValue) {
|
|
6142
6153
|
this.setFieldRowValue(null);
|
|
6154
|
+
this.selectValue = this.selectedData;
|
|
6143
6155
|
return false;
|
|
6144
6156
|
}
|
|
6145
6157
|
this.setFieldRowValue(searchValue);
|
|
@@ -6250,7 +6262,7 @@
|
|
|
6250
6262
|
else {
|
|
6251
6263
|
this.removePushedValue();
|
|
6252
6264
|
this.datasource.search = this.searchValue;
|
|
6253
|
-
this.datasource.data = this.cachedData;
|
|
6265
|
+
this.datasource.data = [...this.cachedData];
|
|
6254
6266
|
this.datasource.total = this.cachedTotal;
|
|
6255
6267
|
}
|
|
6256
6268
|
});
|
|
@@ -6263,6 +6275,11 @@
|
|
|
6263
6275
|
yield this.datasource.setLimit(this.datasource.limit + this.loadMoreQtty);
|
|
6264
6276
|
if (!this.datasource.search) {
|
|
6265
6277
|
this.afterLoad();
|
|
6278
|
+
const { dataValue } = this;
|
|
6279
|
+
const isSelected = this.selectValue && this.pushedValue && this.selectValue[dataValue] === this.pushedValue[dataValue];
|
|
6280
|
+
if (isSelected)
|
|
6281
|
+
return;
|
|
6282
|
+
this.removePushedValue();
|
|
6266
6283
|
}
|
|
6267
6284
|
});
|
|
6268
6285
|
}
|
|
@@ -6276,7 +6293,7 @@
|
|
|
6276
6293
|
this.datasource.search = '';
|
|
6277
6294
|
this.dirtySearchValue = '';
|
|
6278
6295
|
if (!this.manualMode) {
|
|
6279
|
-
this.datasource.data = this.cachedData;
|
|
6296
|
+
this.datasource.data = [...this.cachedData];
|
|
6280
6297
|
this.datasource.total = this.cachedTotal;
|
|
6281
6298
|
}
|
|
6282
6299
|
this.checkValueOnBlur();
|
|
@@ -6289,13 +6306,17 @@
|
|
|
6289
6306
|
}
|
|
6290
6307
|
if (this.manualMode)
|
|
6291
6308
|
return;
|
|
6292
|
-
if (this.isFilledObj(this.selectValue)) {
|
|
6293
|
-
if (this.
|
|
6294
|
-
this.
|
|
6295
|
-
this.pushedValue = this.selectValue;
|
|
6309
|
+
if (this.isFilledObj(this.selectValue) && this.indexOf(this.selectValue) === -1) {
|
|
6310
|
+
if (this.pushedValue) {
|
|
6311
|
+
this.removePushedValue();
|
|
6296
6312
|
}
|
|
6313
|
+
this.datasource.data.unshift(this.selectValue);
|
|
6314
|
+
this.pushedValue = this.selectValue;
|
|
6297
6315
|
return;
|
|
6298
6316
|
}
|
|
6317
|
+
const { dataValue } = this;
|
|
6318
|
+
if (this.pushedValue && this.selectValue && this.selectValue[dataValue] === this.pushedValue[dataValue])
|
|
6319
|
+
return;
|
|
6299
6320
|
this.removePushedValue();
|
|
6300
6321
|
}
|
|
6301
6322
|
showLoadMore() {
|
|
@@ -7885,7 +7906,6 @@
|
|
|
7885
7906
|
*/
|
|
7886
7907
|
constructor(props) {
|
|
7887
7908
|
super(props);
|
|
7888
|
-
this.selectedValue = [];
|
|
7889
7909
|
/**
|
|
7890
7910
|
* Selected items that were added to datasource
|
|
7891
7911
|
*/
|
|
@@ -7899,6 +7919,9 @@
|
|
|
7899
7919
|
*/
|
|
7900
7920
|
this.moreChip = 0;
|
|
7901
7921
|
this.showSelectAll = false;
|
|
7922
|
+
if (!this.selectedValue) {
|
|
7923
|
+
this.selectedValue = [];
|
|
7924
|
+
}
|
|
7902
7925
|
this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
|
|
7903
7926
|
this.createAccessors();
|
|
7904
7927
|
}
|
|
@@ -7938,20 +7961,23 @@
|
|
|
7938
7961
|
set selectValue(rows) {
|
|
7939
7962
|
if (!Array.isArray(rows))
|
|
7940
7963
|
return;
|
|
7941
|
-
if (!this.manualMode
|
|
7942
|
-
this.insertsRemoved = [];
|
|
7964
|
+
if (!this.manualMode) {
|
|
7943
7965
|
const values = rows.map((row) => row[this.dataValue]);
|
|
7944
|
-
this.insertedValues
|
|
7945
|
-
|
|
7946
|
-
if (removed) {
|
|
7947
|
-
this.insertsRemoved.push(inserted);
|
|
7948
|
-
}
|
|
7949
|
-
return !removed;
|
|
7950
|
-
});
|
|
7966
|
+
this.cutFromAToB(this.insertedValues, this.insertsRemoved, (value) => !values.includes(value[this.dataValue]));
|
|
7967
|
+
this.cutFromAToB(this.insertsRemoved, this.insertedValues, (value) => values.includes(value[this.dataValue]));
|
|
7951
7968
|
}
|
|
7952
7969
|
this.selectedValue = rows;
|
|
7953
7970
|
this.setFieldValue(this.getValues(rows));
|
|
7954
7971
|
}
|
|
7972
|
+
/**
|
|
7973
|
+
* Removes item from array a and add it to array b if condition is satisfied
|
|
7974
|
+
*/
|
|
7975
|
+
cutFromAToB(a, b, condition) {
|
|
7976
|
+
const indices = a.reduce((result, value, index) => (condition(value) ? [...result, index] : result), []);
|
|
7977
|
+
indices.forEach((index) => {
|
|
7978
|
+
b.push(a.splice(index)[0]);
|
|
7979
|
+
});
|
|
7980
|
+
}
|
|
7955
7981
|
setFieldValue(value) {
|
|
7956
7982
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7957
7983
|
const promises = [];
|
|
@@ -7981,7 +8007,9 @@
|
|
|
7981
8007
|
}));
|
|
7982
8008
|
}
|
|
7983
8009
|
});
|
|
7984
|
-
|
|
8010
|
+
if (promises.length) {
|
|
8011
|
+
yield Promise.all(promises);
|
|
8012
|
+
}
|
|
7985
8013
|
if (searchValues.length > 0) {
|
|
7986
8014
|
this.setFieldRowValue(searchValues);
|
|
7987
8015
|
}
|
|
@@ -8126,7 +8154,7 @@
|
|
|
8126
8154
|
showLoadMore() {
|
|
8127
8155
|
return !!this.datasource.data.length
|
|
8128
8156
|
&& !this.datasource.loadAll
|
|
8129
|
-
&& (this.datasource.data.length - this.insertedValues.length) < this.datasource.total;
|
|
8157
|
+
&& (this.datasource.data.length - this.insertedValues.length - this.insertsRemoved.length) < this.datasource.total;
|
|
8130
8158
|
}
|
|
8131
8159
|
/**
|
|
8132
8160
|
* Load more data
|
|
@@ -8134,10 +8162,16 @@
|
|
|
8134
8162
|
loadMore() {
|
|
8135
8163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8136
8164
|
yield this.datasource.setLimit(this.datasource.limit + this.loadMoreQtty);
|
|
8165
|
+
this.insertsRemoved = this.insertsRemoved.filter((insert) => {
|
|
8166
|
+
const value = insert[this.dataValue];
|
|
8167
|
+
const foundInData = this.datasource.data.find(this.getCondition(value));
|
|
8168
|
+
return !foundInData;
|
|
8169
|
+
});
|
|
8170
|
+
this.insertSelected();
|
|
8137
8171
|
if (!this.datasource.search) {
|
|
8138
8172
|
this.setCache();
|
|
8139
8173
|
}
|
|
8140
|
-
this.
|
|
8174
|
+
this.removePushedValue();
|
|
8141
8175
|
});
|
|
8142
8176
|
}
|
|
8143
8177
|
/**
|
|
@@ -8331,6 +8365,9 @@
|
|
|
8331
8365
|
}
|
|
8332
8366
|
return item;
|
|
8333
8367
|
});
|
|
8368
|
+
if (parent) { // remove all existing children to add new ones
|
|
8369
|
+
this.treeData = this.treeData.filter((item) => item.tree__parent !== parent);
|
|
8370
|
+
}
|
|
8334
8371
|
if (!parent) {
|
|
8335
8372
|
this.treeData = childData;
|
|
8336
8373
|
}
|
|
@@ -8514,7 +8551,7 @@
|
|
|
8514
8551
|
this.treeStructure = {};
|
|
8515
8552
|
const childData = this.originalDatasource.data.map((row) => (Object.assign(Object.assign({}, row), { tree__children: [], tree__opened: false, tree__searched: true, tree__level: 1, tree__parent: undefined })));
|
|
8516
8553
|
this.treeData = childData;
|
|
8517
|
-
this.treeStructure['no-parent'] =
|
|
8554
|
+
this.treeStructure['no-parent'] = childData;
|
|
8518
8555
|
}
|
|
8519
8556
|
/**
|
|
8520
8557
|
* Search value against a memory datasource
|
|
@@ -8649,6 +8686,7 @@
|
|
|
8649
8686
|
* Defines if should wait and not execute GET method when Datasource is created
|
|
8650
8687
|
*/
|
|
8651
8688
|
this.lazyLoad = true;
|
|
8689
|
+
this.selectValue = null;
|
|
8652
8690
|
this.nodes = this.getInitValue('nodes', props.nodes, this.nodes);
|
|
8653
8691
|
this.alwaysOpen = this.getInitValue('alwaysOpen', props.alwaysOpen, this.alwaysOpen);
|
|
8654
8692
|
this.flattenSearchResults = this.getInitValue('flattenSearchResults', props.flattenSearchResults, this.flattenSearchResults);
|
|
@@ -8816,8 +8854,41 @@
|
|
|
8816
8854
|
get searchValue() {
|
|
8817
8855
|
return this.lastInputValue;
|
|
8818
8856
|
}
|
|
8857
|
+
clearRow(row) {
|
|
8858
|
+
const result = Object.assign({}, row);
|
|
8859
|
+
Object.keys(result).forEach((key) => {
|
|
8860
|
+
if (key.indexOf('tree__') === 0) {
|
|
8861
|
+
delete result[key];
|
|
8862
|
+
}
|
|
8863
|
+
});
|
|
8864
|
+
return result;
|
|
8865
|
+
}
|
|
8866
|
+
get value() {
|
|
8867
|
+
if (!this.selectValue)
|
|
8868
|
+
return this.selectValue;
|
|
8869
|
+
if (this.returnObject) {
|
|
8870
|
+
return this.clearRow(this.selectValue.row);
|
|
8871
|
+
}
|
|
8872
|
+
return this.selectValue;
|
|
8873
|
+
}
|
|
8874
|
+
set value(value) {
|
|
8875
|
+
this.selectValue = value;
|
|
8876
|
+
}
|
|
8819
8877
|
setValue(value) {
|
|
8820
|
-
this.
|
|
8878
|
+
if (this.returnObject) {
|
|
8879
|
+
if (typeof value !== 'object') {
|
|
8880
|
+
this.value = { id: value };
|
|
8881
|
+
}
|
|
8882
|
+
else {
|
|
8883
|
+
this.value = { id: value[this.dataValue] };
|
|
8884
|
+
}
|
|
8885
|
+
}
|
|
8886
|
+
else if (typeof value === 'object') {
|
|
8887
|
+
this.value = value[this.dataValue];
|
|
8888
|
+
}
|
|
8889
|
+
else {
|
|
8890
|
+
this.value = value;
|
|
8891
|
+
}
|
|
8821
8892
|
}
|
|
8822
8893
|
}
|
|
8823
8894
|
|
|
@@ -8843,6 +8914,7 @@
|
|
|
8843
8914
|
* Selected Nodes
|
|
8844
8915
|
*/
|
|
8845
8916
|
this.selectedNodes = [];
|
|
8917
|
+
this.selectValue = [];
|
|
8846
8918
|
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
8847
8919
|
this.limit = this.getInitValue('limit', props.limit, this.limit);
|
|
8848
8920
|
this.createAccessors();
|
|
@@ -8859,6 +8931,34 @@
|
|
|
8859
8931
|
deselect(node, element) {
|
|
8860
8932
|
this.callEvent('onDeselect', { element, component: this, node });
|
|
8861
8933
|
}
|
|
8934
|
+
get value() {
|
|
8935
|
+
if (this.returnObject) {
|
|
8936
|
+
return this.selectValue.map((value) => this.clearRow(value.row));
|
|
8937
|
+
}
|
|
8938
|
+
return this.selectValue;
|
|
8939
|
+
}
|
|
8940
|
+
set value(value) {
|
|
8941
|
+
this.selectValue = value;
|
|
8942
|
+
}
|
|
8943
|
+
setValue(value) {
|
|
8944
|
+
const arrValue = Array.isArray(value) ? value : [value];
|
|
8945
|
+
if (this.returnObject) {
|
|
8946
|
+
this.value = arrValue.map((item) => {
|
|
8947
|
+
if (typeof item !== 'object') {
|
|
8948
|
+
return { id: item };
|
|
8949
|
+
}
|
|
8950
|
+
return { id: item[this.dataValue] };
|
|
8951
|
+
});
|
|
8952
|
+
}
|
|
8953
|
+
else {
|
|
8954
|
+
this.value = arrValue.map((item) => {
|
|
8955
|
+
if (typeof item === 'object') {
|
|
8956
|
+
return item[this.dataValue];
|
|
8957
|
+
}
|
|
8958
|
+
return item;
|
|
8959
|
+
});
|
|
8960
|
+
}
|
|
8961
|
+
}
|
|
8862
8962
|
}
|
|
8863
8963
|
|
|
8864
8964
|
/**
|
|
@@ -10128,7 +10228,6 @@
|
|
|
10128
10228
|
if (this.editing)
|
|
10129
10229
|
return;
|
|
10130
10230
|
if (column.editable) {
|
|
10131
|
-
this.selectedRows = [];
|
|
10132
10231
|
this.editing = true;
|
|
10133
10232
|
this.preventRowClick = true;
|
|
10134
10233
|
this.datasource.currentRow = row;
|
|
@@ -11077,17 +11176,37 @@
|
|
|
11077
11176
|
}
|
|
11078
11177
|
|
|
11079
11178
|
class XLSReport extends BaseReport {
|
|
11080
|
-
constructor() {
|
|
11081
|
-
super(
|
|
11179
|
+
constructor(type) {
|
|
11180
|
+
super();
|
|
11082
11181
|
this.route = '/generateXLS';
|
|
11182
|
+
this.expressionZeedhiToXls = {
|
|
11183
|
+
AVG: 'AVERAGE',
|
|
11184
|
+
COUNT: 'COUNTA',
|
|
11185
|
+
MAX: 'MAX',
|
|
11186
|
+
MIN: 'MIN',
|
|
11187
|
+
SUM: 'SUM',
|
|
11188
|
+
};
|
|
11189
|
+
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
11190
|
+
this.type = type || 'xls';
|
|
11083
11191
|
}
|
|
11084
|
-
buildDataset(data, columns) {
|
|
11192
|
+
buildDataset(data, columns, metadata) {
|
|
11193
|
+
let result;
|
|
11194
|
+
if (this.type === 'xls') {
|
|
11195
|
+
result = this.formatRawDataSet(data, columns);
|
|
11196
|
+
}
|
|
11197
|
+
else if (metadata) {
|
|
11198
|
+
result = this.formatDataSet(metadata, data);
|
|
11199
|
+
}
|
|
11200
|
+
return JSON.stringify(result);
|
|
11201
|
+
}
|
|
11202
|
+
// formata o dataset para o formato "cru" xls
|
|
11203
|
+
formatRawDataSet(data, columns) {
|
|
11085
11204
|
const columnNames = columns.map((col) => col.name);
|
|
11086
11205
|
const result = data.reduce((reduced, row) => {
|
|
11087
11206
|
const values = columnNames.map((col) => row[col] || '');
|
|
11088
11207
|
return [...reduced, values];
|
|
11089
11208
|
}, [columnNames]);
|
|
11090
|
-
return
|
|
11209
|
+
return result;
|
|
11091
11210
|
}
|
|
11092
11211
|
buildMetadata(name, title, columns, filter) {
|
|
11093
11212
|
const builtCols = this.buildColumns(columns);
|
|
@@ -11116,9 +11235,215 @@
|
|
|
11116
11235
|
orientation: 'PORTRAIT',
|
|
11117
11236
|
columns: builtCols,
|
|
11118
11237
|
filter: builtFilters,
|
|
11238
|
+
reportXLS: true,
|
|
11239
|
+
xlsMergedCell: [],
|
|
11119
11240
|
};
|
|
11120
11241
|
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11121
11242
|
}
|
|
11243
|
+
isFormat3(format) {
|
|
11244
|
+
return format === 'xls3';
|
|
11245
|
+
}
|
|
11246
|
+
// Ordenar o nome das colunas de acordo com seu index, excluindo o nome das colunas agrupadas
|
|
11247
|
+
getColumnsNameFormat3(columns, metaData) {
|
|
11248
|
+
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11249
|
+
let columnsName = [];
|
|
11250
|
+
Object.entries(columns).forEach((row) => {
|
|
11251
|
+
const columnName = row[0];
|
|
11252
|
+
if (columnsNameGroup.indexOf(columnName) === -1) {
|
|
11253
|
+
const index = row[1].sequence;
|
|
11254
|
+
columnsName[index] = columnName;
|
|
11255
|
+
}
|
|
11256
|
+
});
|
|
11257
|
+
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11258
|
+
return columnsName;
|
|
11259
|
+
}
|
|
11260
|
+
// Ordenar o nome das colunas de acordo com seu index, e sempre deixando as colunas agrupadas nas primeiras posições
|
|
11261
|
+
getColumnsName(columns, metaData, lengthGroup) {
|
|
11262
|
+
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11263
|
+
let columnsName = [];
|
|
11264
|
+
Object.entries(columns).forEach((row) => {
|
|
11265
|
+
const columnName = row[0];
|
|
11266
|
+
const index = row[1].sequence;
|
|
11267
|
+
if (columnsNameGroup.indexOf(columnName) === -1) {
|
|
11268
|
+
columnsName[index + lengthGroup] = columnName;
|
|
11269
|
+
}
|
|
11270
|
+
else {
|
|
11271
|
+
columnsName[index] = columnName;
|
|
11272
|
+
}
|
|
11273
|
+
});
|
|
11274
|
+
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11275
|
+
return columnsName;
|
|
11276
|
+
}
|
|
11277
|
+
// Inicializa alguns valores auxiliares
|
|
11278
|
+
initVars(metaData, type) {
|
|
11279
|
+
metaData.xlsMergedCell = [];
|
|
11280
|
+
const { columns } = metaData;
|
|
11281
|
+
const lengthGroup = metaData.groups.length;
|
|
11282
|
+
const indexLastGroup = lengthGroup - 1;
|
|
11283
|
+
let columnsName = [];
|
|
11284
|
+
if (this.isFormat3(type)) {
|
|
11285
|
+
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11286
|
+
}
|
|
11287
|
+
else {
|
|
11288
|
+
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11289
|
+
}
|
|
11290
|
+
const rowValues = [];
|
|
11291
|
+
const formatedDataSet = [];
|
|
11292
|
+
const groups = [];
|
|
11293
|
+
groups.groupEnd = {};
|
|
11294
|
+
groups.groupEnd.cellsfunc = {};
|
|
11295
|
+
return {
|
|
11296
|
+
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11297
|
+
};
|
|
11298
|
+
}
|
|
11299
|
+
// formata a linha do grupo de acordo com o formato xls3
|
|
11300
|
+
setRowGroupFormat3(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11301
|
+
let rowValues = rowValuesParam;
|
|
11302
|
+
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11303
|
+
const index = row.groupIndex;
|
|
11304
|
+
if (row.groupHeader) {
|
|
11305
|
+
rowValues[index] = label;
|
|
11306
|
+
groups[index] = { init: null, end: null };
|
|
11307
|
+
formatedDataSet.push(rowValues);
|
|
11308
|
+
rowValues = [];
|
|
11309
|
+
}
|
|
11310
|
+
else if (row.groupFooter) {
|
|
11311
|
+
if (!row.groupLabel) {
|
|
11312
|
+
rowValues.push('Total');
|
|
11313
|
+
}
|
|
11314
|
+
else {
|
|
11315
|
+
rowValues.push(`Total (${label})`);
|
|
11316
|
+
}
|
|
11317
|
+
formatedDataSet.push(rowValues);
|
|
11318
|
+
rowValues = [];
|
|
11319
|
+
const funcXls = null;
|
|
11320
|
+
columnsName.forEach((column) => {
|
|
11321
|
+
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11322
|
+
});
|
|
11323
|
+
}
|
|
11324
|
+
return rowValues;
|
|
11325
|
+
}
|
|
11326
|
+
// formata as expressões da linha
|
|
11327
|
+
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11328
|
+
let funcXls = funcXlsParam;
|
|
11329
|
+
if ((row[column] === 0 || row[column]) && index !== undefined) {
|
|
11330
|
+
const letter = this.colunmXLS[rowValues.length];
|
|
11331
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11332
|
+
const cellsfunc = `${letter + groups[index].init}:${letter}${groups[index].end}`;
|
|
11333
|
+
let expression = '';
|
|
11334
|
+
if (indexLastGroup === index) {
|
|
11335
|
+
expression = `=${funcXls}(${cellsfunc})`;
|
|
11336
|
+
}
|
|
11337
|
+
else {
|
|
11338
|
+
expression = `=${funcXls}(${groups[index].cellsfunc[column]})`;
|
|
11339
|
+
if (index === 0) {
|
|
11340
|
+
if (groups.groupEnd.cellsfunc[column]) {
|
|
11341
|
+
groups.groupEnd.cellsfunc[column] += `,${groups[index].cellsfunc[column]}`;
|
|
11342
|
+
}
|
|
11343
|
+
else {
|
|
11344
|
+
groups.groupEnd.cellsfunc[column] = groups[index].cellsfunc[column];
|
|
11345
|
+
}
|
|
11346
|
+
}
|
|
11347
|
+
groups[index].cellsfunc[column] = null;
|
|
11348
|
+
}
|
|
11349
|
+
rowValues.push(expression);
|
|
11350
|
+
groups.forEach((group, indexGroup) => {
|
|
11351
|
+
if (indexGroup !== indexLastGroup) {
|
|
11352
|
+
if (!group.cellsfunc) {
|
|
11353
|
+
group.cellsfunc = {};
|
|
11354
|
+
}
|
|
11355
|
+
if (group.cellsfunc[column]) {
|
|
11356
|
+
group.cellsfunc[column] += `,${cellsfunc}`;
|
|
11357
|
+
}
|
|
11358
|
+
else {
|
|
11359
|
+
group.cellsfunc[column] = cellsfunc;
|
|
11360
|
+
}
|
|
11361
|
+
}
|
|
11362
|
+
});
|
|
11363
|
+
}
|
|
11364
|
+
else {
|
|
11365
|
+
let cell = row[column];
|
|
11366
|
+
if (row.groupSummary) {
|
|
11367
|
+
const groupEndFunc = groups.groupEnd.cellsfunc;
|
|
11368
|
+
if (groupEndFunc[column]) {
|
|
11369
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11370
|
+
cell = `=${funcXls}(${groupEndFunc[column]})`;
|
|
11371
|
+
}
|
|
11372
|
+
}
|
|
11373
|
+
rowValues.push(cell);
|
|
11374
|
+
}
|
|
11375
|
+
}
|
|
11376
|
+
// formata a linha de grupo de acordo com o formato xls2
|
|
11377
|
+
setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11378
|
+
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11379
|
+
const index = row.groupIndex;
|
|
11380
|
+
if (row.groupHeader) {
|
|
11381
|
+
rowValues[index] = label;
|
|
11382
|
+
groups[index] = { init: null, end: null };
|
|
11383
|
+
}
|
|
11384
|
+
else if (row.groupFooter) {
|
|
11385
|
+
if (!row.groupLabel) {
|
|
11386
|
+
rowValues.push('Total');
|
|
11387
|
+
}
|
|
11388
|
+
else {
|
|
11389
|
+
rowValues.push(`Total (${label})`);
|
|
11390
|
+
}
|
|
11391
|
+
const funcXls = null;
|
|
11392
|
+
if (groups[index]) {
|
|
11393
|
+
metaData.xlsMergedCell.push({
|
|
11394
|
+
start_row: groups[index].init,
|
|
11395
|
+
start_col: this.colunmXLS[index],
|
|
11396
|
+
end_row: formatedDataSet.length + 2,
|
|
11397
|
+
end_col: this.colunmXLS[index],
|
|
11398
|
+
});
|
|
11399
|
+
}
|
|
11400
|
+
columnsName.forEach((column, columnIndex) => {
|
|
11401
|
+
if (!(row.groupFooter && columnIndex === 0)) {
|
|
11402
|
+
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11403
|
+
}
|
|
11404
|
+
});
|
|
11405
|
+
}
|
|
11406
|
+
return rowValues;
|
|
11407
|
+
}
|
|
11408
|
+
// Defina o index dos grupos
|
|
11409
|
+
setIndexGroups(groups, formatedDataSet) {
|
|
11410
|
+
groups.forEach((group) => {
|
|
11411
|
+
if (!group.init) {
|
|
11412
|
+
group.init = formatedDataSet.length + 2;
|
|
11413
|
+
}
|
|
11414
|
+
group.end = formatedDataSet.length + 2;
|
|
11415
|
+
});
|
|
11416
|
+
}
|
|
11417
|
+
// Preenche uma linha "normal"
|
|
11418
|
+
setRowNormal(columnsName, rowValues, row) {
|
|
11419
|
+
columnsName.forEach((column) => {
|
|
11420
|
+
rowValues.push(row[column]);
|
|
11421
|
+
});
|
|
11422
|
+
}
|
|
11423
|
+
formatDataSet(metaData, dataSet) {
|
|
11424
|
+
const initVars = this.initVars(metaData, this.type);
|
|
11425
|
+
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11426
|
+
let { rowValues } = initVars;
|
|
11427
|
+
dataSet.forEach((row) => {
|
|
11428
|
+
if (row.group || row.groupFooter) {
|
|
11429
|
+
if (this.isFormat3(this.type)) {
|
|
11430
|
+
rowValues = this.setRowGroupFormat3(row, rowValues, groups, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11431
|
+
}
|
|
11432
|
+
else {
|
|
11433
|
+
rowValues = this.setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11434
|
+
}
|
|
11435
|
+
}
|
|
11436
|
+
else {
|
|
11437
|
+
this.setIndexGroups(groups, formatedDataSet);
|
|
11438
|
+
this.setRowNormal(columnsName, rowValues, row);
|
|
11439
|
+
}
|
|
11440
|
+
if (!row.groupHeader) {
|
|
11441
|
+
formatedDataSet.push(rowValues);
|
|
11442
|
+
}
|
|
11443
|
+
rowValues = [];
|
|
11444
|
+
});
|
|
11445
|
+
return [columnsName].concat(formatedDataSet);
|
|
11446
|
+
}
|
|
11122
11447
|
}
|
|
11123
11448
|
|
|
11124
11449
|
class Report {
|
|
@@ -11154,8 +11479,8 @@
|
|
|
11154
11479
|
if (type === 'pdf') {
|
|
11155
11480
|
return new PDFReport();
|
|
11156
11481
|
}
|
|
11157
|
-
if (type === 'xls') {
|
|
11158
|
-
return new XLSReport();
|
|
11482
|
+
if (type === 'xls' || type === 'xls2' || type === 'xls3') {
|
|
11483
|
+
return new XLSReport(type);
|
|
11159
11484
|
}
|
|
11160
11485
|
throw new Error(`Invalid report type: ${type}`);
|
|
11161
11486
|
}
|
|
@@ -11170,9 +11495,18 @@
|
|
|
11170
11495
|
const reportType = this.getReportType(type);
|
|
11171
11496
|
const { route } = reportType;
|
|
11172
11497
|
const { name, columns, datasource } = this.iterable;
|
|
11498
|
+
const { groupedData } = Object.assign({}, this.iterable);
|
|
11173
11499
|
const formattedColumns = this.removeActionColumns(columns);
|
|
11174
|
-
const dataset = reportType.buildDataset(data, formattedColumns);
|
|
11175
11500
|
const metadataObj = yield reportType.buildMetadata(name, this.title, formattedColumns, datasource.filter, portrait);
|
|
11501
|
+
let dataset;
|
|
11502
|
+
if ((reportType.type === 'xls2' || reportType.type === 'xls3') && groupedData) {
|
|
11503
|
+
const rowMetadata = rowObj.metaData;
|
|
11504
|
+
const metadataObjClone = merge__default["default"](rowMetadata, JSON.parse(metadataObj));
|
|
11505
|
+
dataset = reportType.buildDataset(groupedData, formattedColumns, metadataObjClone);
|
|
11506
|
+
}
|
|
11507
|
+
else {
|
|
11508
|
+
dataset = reportType.buildDataset(data, formattedColumns);
|
|
11509
|
+
}
|
|
11176
11510
|
const filter = '[]';
|
|
11177
11511
|
let row = {};
|
|
11178
11512
|
if (rowObj) {
|