@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.
Files changed (57) hide show
  1. package/dist/zd-common.esm.js +398 -65
  2. package/dist/zd-common.umd.js +401 -67
  3. package/package.json +3 -5
  4. package/types/components/zd-code-editor/code-editor.d.ts +2 -0
  5. package/types/components/zd-grid/grid-editable.d.ts +1 -1
  6. package/types/components/zd-select/select.d.ts +2 -0
  7. package/types/components/zd-select-multiple/select-multiple.d.ts +4 -0
  8. package/types/components/zd-select-tree/select-tree.d.ts +7 -1
  9. package/types/components/zd-select-tree-multiple/select-tree-multiple.d.ts +4 -0
  10. package/types/components/zd-tree-grid/interfaces.d.ts +3 -1
  11. package/types/components/zd-tree-grid/tree-grid-editable.d.ts +4 -3
  12. package/types/utils/report/report-type/interfaces.d.ts +7 -2
  13. package/types/utils/report/report-type/xls-report.d.ts +17 -1
  14. package/types/components/zd-apex-chart/apex_chart.d.ts +0 -55
  15. package/types/components/zd-button-group/button_group.d.ts +0 -83
  16. package/types/components/zd-checkbox-multiple/checkbox_multiple.d.ts +0 -42
  17. package/types/components/zd-code-editor/code_editor.d.ts +0 -58
  18. package/types/components/zd-code-editor/prism.d.ts +0 -14
  19. package/types/components/zd-collapse-card/collapse_card.d.ts +0 -56
  20. package/types/components/zd-component/child_not_found.d.ts +0 -6
  21. package/types/components/zd-component/component_render.d.ts +0 -16
  22. package/types/components/zd-component/invalid_accessor.d.ts +0 -6
  23. package/types/components/zd-date/date_range.d.ts +0 -124
  24. package/types/components/zd-grid/errors/not_editing.d.ts +0 -6
  25. package/types/components/zd-grid/errors/row_not_found.d.ts +0 -6
  26. package/types/components/zd-grid/grid_column.d.ts +0 -52
  27. package/types/components/zd-grid/grid_column_editable.d.ts +0 -13
  28. package/types/components/zd-grid/grid_editable.d.ts +0 -162
  29. package/types/components/zd-iterable/column_not_found.d.ts +0 -6
  30. package/types/components/zd-iterable/iterable_columns_button.d.ts +0 -29
  31. package/types/components/zd-iterable/iterable_columns_button_controller.d.ts +0 -6
  32. package/types/components/zd-iterable/iterable_page_component.d.ts +0 -27
  33. package/types/components/zd-iterable/iterable_page_info.d.ts +0 -7
  34. package/types/components/zd-iterable/iterable_page_size.d.ts +0 -62
  35. package/types/components/zd-iterable/iterable_pagination.d.ts +0 -28
  36. package/types/components/zd-list/item_not_found.d.ts +0 -6
  37. package/types/components/zd-list/list_group.d.ts +0 -30
  38. package/types/components/zd-list/list_item.d.ts +0 -49
  39. package/types/components/zd-master-detail/detail_not_found.d.ts +0 -6
  40. package/types/components/zd-master-detail/master_detail.d.ts +0 -20
  41. package/types/components/zd-master-detail/master_not_found.d.ts +0 -6
  42. package/types/components/zd-menu/menu_button.d.ts +0 -28
  43. package/types/components/zd-menu/menu_group.d.ts +0 -53
  44. package/types/components/zd-menu/menu_link.d.ts +0 -46
  45. package/types/components/zd-menu/menu_separator.d.ts +0 -7
  46. package/types/components/zd-modal/modal_close_button.d.ts +0 -28
  47. package/types/components/zd-svg-map/svg_map.d.ts +0 -78
  48. package/types/components/zd-tabs/tab_not_found.d.ts +0 -11
  49. package/types/components/zd-text-input/text_input.d.ts +0 -90
  50. package/types/components/zd-tree-grid/errors/not_editing.d.ts +0 -6
  51. package/types/components/zd-tree-grid/errors/row_not_found.d.ts +0 -6
  52. package/types/components/zd-tree-grid/tree-data-structure.d.ts +0 -144
  53. package/types/components/zd-tree-grid/tree_data_structure.d.ts +0 -144
  54. package/types/components/zd-tree-grid/tree_grid.d.ts +0 -77
  55. package/types/components/zd-tree-grid/tree_grid_column.d.ts +0 -52
  56. package/types/components/zd-tree-grid/tree_grid_column_editable.d.ts +0 -13
  57. package/types/components/zd-tree-grid/tree_grid_editable.d.ts +0 -157
@@ -1,7 +1,5 @@
1
- import { AccessorManager, Event, KeyMap, Metadata, FormatterParserProvider, Validation, Accessor, DatasourceFactory, I18n, Loader, Mask, Config, dayjs, isEqual, Router, MethodNotAssignedError, InstanceNotFoundError, Http, Cookie, normalize, URL as URL$1 } from '@zeedhi/core';
1
+ import { AccessorManager, Event, KeyMap, Metadata, FormatterParserProvider, Validation, Accessor, DatasourceFactory, I18n, MethodNotAssignedError, Loader, Mask, Config, dayjs, isEqual, Router, InstanceNotFoundError, Http, Cookie, normalize, URL as URL$1 } from '@zeedhi/core';
2
2
  import debounce from 'lodash.debounce';
3
- import Prism$1 from 'prismjs';
4
- import 'prismjs/themes/prism.css';
5
3
  import isUndefined from 'lodash.isundefined';
6
4
  import merge from 'lodash.merge';
7
5
  import set from 'lodash.set';
@@ -1756,26 +1754,6 @@ class Chip extends Button {
1756
1754
  }
1757
1755
  }
1758
1756
 
1759
- !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);
1760
-
1761
- 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;
1762
-
1763
- 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*\()/});
1764
-
1765
- !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);
1766
-
1767
- !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);
1768
-
1769
- !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);
1770
-
1771
- !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);
1772
-
1773
- !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);
1774
-
1775
- 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:/[;[\]()`,.]/};
1776
-
1777
- 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(/&lt;/g,"<").replace(/&amp;/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring");}}});
1778
-
1779
1757
  /**
1780
1758
  * The Code Editor component <code>zd-code-editor</code> is used to show code highlighted using one of the
1781
1759
  * language supported by <a href=\"http://prismjs.com\" alt=\"Prism JS\" target=\"_blank\">Prism JS</a>
@@ -1818,6 +1796,9 @@ class CodeEditor extends ComponentRender {
1818
1796
  this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
1819
1797
  this.createAccessors();
1820
1798
  }
1799
+ setViewHighlight(fn) {
1800
+ this.viewHighlight = fn;
1801
+ }
1821
1802
  /**
1822
1803
  * Code to be shown. When showing JSON code, the JSON object can be passed instead of the string code.
1823
1804
  */
@@ -1898,7 +1879,10 @@ class CodeEditor extends ComponentRender {
1898
1879
  * Get the code highlighted
1899
1880
  */
1900
1881
  getHighlightedCode() {
1901
- return Prism$1.highlight(this.code, Prism$1.languages[this.language], this.language);
1882
+ if (!this.viewHighlight) {
1883
+ throw new MethodNotAssignedError('viewHighlight');
1884
+ }
1885
+ return this.viewHighlight(this.code, this.language);
1902
1886
  }
1903
1887
  /**
1904
1888
  * Get the total of lines
@@ -2511,7 +2495,7 @@ class Loading extends Component {
2511
2495
  */
2512
2496
  this.text = 'Loading';
2513
2497
  this.isVisible = false;
2514
- this.zIndex = '100';
2498
+ this.zIndex = 999;
2515
2499
  this.text = this.getInitValue('text', props.text, this.text);
2516
2500
  this.zIndex = this.getInitValue('zIndex', props.zIndex, this.zIndex);
2517
2501
  this.defaultText = this.text;
@@ -4333,7 +4317,7 @@ class Column extends Component {
4333
4317
  const appliedConditions = {};
4334
4318
  Object.keys(this.factoredConditions).forEach((condition) => {
4335
4319
  const conditionFunction = this.factoredConditions[condition];
4336
- set(appliedConditions, condition, conditionFunction({ row }));
4320
+ set(appliedConditions, condition, conditionFunction({ row, column: this }));
4337
4321
  });
4338
4322
  return appliedConditions;
4339
4323
  }
@@ -4585,7 +4569,7 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
4585
4569
  let currentRow = row;
4586
4570
  if (dataValue) {
4587
4571
  if (!formatterDataText) {
4588
- currentRow = column.getLookupData(dataValue, value);
4572
+ currentRow = column.getLookupData(dataValue, value[dataValue] || value);
4589
4573
  }
4590
4574
  else {
4591
4575
  const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
@@ -4601,7 +4585,7 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
4601
4585
  }
4602
4586
  }
4603
4587
  if (!Object.keys(currentRow).length)
4604
- return value;
4588
+ return typeof value === 'object' ? '' : value;
4605
4589
  const textColumn = formatterDataText || dataText;
4606
4590
  if (textColumn) {
4607
4591
  if (typeof textColumn === 'string') {
@@ -5084,7 +5068,6 @@ class GridEditable extends Grid {
5084
5068
  if (this.editing)
5085
5069
  return;
5086
5070
  if (column.editable) {
5087
- this.selectedRows = [];
5088
5071
  this.editing = true;
5089
5072
  this.preventRowClick = true;
5090
5073
  this.datasource.currentRow = row;
@@ -5154,7 +5137,7 @@ class GridEditable extends Grid {
5154
5137
  else {
5155
5138
  colValue = row[column.name];
5156
5139
  }
5157
- const componentProps = merge({}, column.componentProps, cellProps.componentProps);
5140
+ const componentProps = merge({}, column.componentProps, cellProps === null || cellProps === void 0 ? void 0 : cellProps.componentProps);
5158
5141
  let compEvents = {};
5159
5142
  if (componentProps && componentProps.events) {
5160
5143
  compEvents = Event.factory(componentProps.events);
@@ -5188,7 +5171,8 @@ class GridEditable extends Grid {
5188
5171
  checkLookupData(column, row, componentProps) {
5189
5172
  if (row[column.name] && column.lookupData && componentProps.datasource) {
5190
5173
  componentProps.datasource.data = componentProps.datasource.data || [];
5191
- componentProps.datasource.data.push(column.lookupData[row[column.name]]);
5174
+ const value = typeof row[column.name] === 'object' ? row[column.name][componentProps.dataValue] : row[column.name];
5175
+ componentProps.datasource.data.push(column.lookupData[value]);
5192
5176
  }
5193
5177
  }
5194
5178
  checkCompValidity(component) {
@@ -5863,7 +5847,7 @@ class Select extends TextInput {
5863
5847
  */
5864
5848
  constructor(props) {
5865
5849
  var _a, _b;
5866
- super(props);
5850
+ super(Object.assign(Object.assign({}, props), { value: undefined }));
5867
5851
  /**
5868
5852
  * Field used to display values
5869
5853
  */
@@ -5946,6 +5930,7 @@ class Select extends TextInput {
5946
5930
  this.cachedData = [];
5947
5931
  this.cachedTotal = 0;
5948
5932
  this.formatterFn = FormatterParserProvider.getFormatter('ZdSelect');
5933
+ this.pushedValue = null;
5949
5934
  this.loadMoreQtty = 0;
5950
5935
  this.debounceSearch = debounce(this.doSearch, 500);
5951
5936
  this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'expand');
@@ -5967,7 +5952,13 @@ class Select extends TextInput {
5967
5952
  this.dataText = [this.dataText];
5968
5953
  const defaultDatasource = this.getDefaultDatasource(props);
5969
5954
  this.datasource = DatasourceFactory.factory(defaultDatasource);
5970
- this.setDefaultValue(props.value, (_b = props.datasource) === null || _b === void 0 ? void 0 : _b.lazyLoad);
5955
+ this.overrideGet();
5956
+ let defaultValue = props.value;
5957
+ if (Accessor.isAccessorDefinition(props.value)) {
5958
+ defaultValue = this.getAccessorValue(props.value);
5959
+ this.getInitValue('value', props.value, this.value);
5960
+ }
5961
+ this.setDefaultValue(defaultValue, (_b = props.datasource) === null || _b === void 0 ? void 0 : _b.lazyLoad);
5971
5962
  this.preventLoadOnFocus = !defaultDatasource.lazyLoad;
5972
5963
  this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
5973
5964
  this.loadMoreQtty = this.datasource.limit;
@@ -5976,6 +5967,11 @@ class Select extends TextInput {
5976
5967
  this.createAccessors();
5977
5968
  this.initialized = true;
5978
5969
  }
5970
+ getAccessorValue(accessorName) {
5971
+ const [controller, accessor] = Accessor.getAccessor(accessorName);
5972
+ const instance = Loader.getInstance(controller);
5973
+ return instance[accessor];
5974
+ }
5979
5975
  /**
5980
5976
  * Retrieves datasource structure applying infinity scroll
5981
5977
  * @param field Field structure
@@ -5987,6 +5983,16 @@ class Select extends TextInput {
5987
5983
  const searchIn = (((_a = field.datasource) === null || _a === void 0 ? void 0 : _a.searchIn) || []).concat(searchInDefault);
5988
5984
  return Object.assign(Object.assign({}, field.datasource), { searchIn, lazyLoad: (field.value !== '' && field.value !== undefined) || (field.datasource && field.datasource.lazyLoad) });
5989
5985
  }
5986
+ overrideGet() {
5987
+ const oldGet = this.datasource.get;
5988
+ this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
5989
+ yield oldGet.call(this.datasource);
5990
+ if (this.indexOf(this.value) !== -1 || this.datasource.search || this.isFocused)
5991
+ return;
5992
+ yield this.setValue(this.value, false);
5993
+ this.removePushedValue();
5994
+ });
5995
+ }
5990
5996
  get search() {
5991
5997
  return this.searchValue;
5992
5998
  }
@@ -6013,7 +6019,7 @@ class Select extends TextInput {
6013
6019
  }
6014
6020
  if (this.manualMode)
6015
6021
  return;
6016
- this.cachedData = this.datasource.data;
6022
+ this.cachedData = [...this.datasource.data];
6017
6023
  this.cachedTotal = this.datasource.total;
6018
6024
  if (pushed) {
6019
6025
  this.pushedValue = this.selectedData;
@@ -6072,10 +6078,14 @@ class Select extends TextInput {
6072
6078
  if (!this.pushedValue && this.isFilledObj(this.selectValue) && this.indexOf(this.selectValue) === -1) {
6073
6079
  this.pushedValue = this.selectValue;
6074
6080
  }
6075
- if (this.isFilledObj(this.pushedValue) && this.indexOf(this.pushedValue) === -1) {
6081
+ const index = this.indexOf(this.pushedValue);
6082
+ if (this.isFilledObj(this.pushedValue) && index === -1) {
6076
6083
  this.datasource.data.unshift(this.pushedValue);
6077
6084
  }
6078
- this.cachedData = this.datasource.data;
6085
+ else if (index !== 0) {
6086
+ this.pushedValue = null;
6087
+ }
6088
+ this.cachedData = [...this.datasource.data];
6079
6089
  this.cachedTotal = this.datasource.total;
6080
6090
  }
6081
6091
  /**
@@ -6134,6 +6144,7 @@ class Select extends TextInput {
6134
6144
  }
6135
6145
  if (!searchValue) {
6136
6146
  this.setFieldRowValue(null);
6147
+ this.selectValue = this.selectedData;
6137
6148
  return false;
6138
6149
  }
6139
6150
  this.setFieldRowValue(searchValue);
@@ -6244,7 +6255,7 @@ class Select extends TextInput {
6244
6255
  else {
6245
6256
  this.removePushedValue();
6246
6257
  this.datasource.search = this.searchValue;
6247
- this.datasource.data = this.cachedData;
6258
+ this.datasource.data = [...this.cachedData];
6248
6259
  this.datasource.total = this.cachedTotal;
6249
6260
  }
6250
6261
  });
@@ -6257,6 +6268,11 @@ class Select extends TextInput {
6257
6268
  yield this.datasource.setLimit(this.datasource.limit + this.loadMoreQtty);
6258
6269
  if (!this.datasource.search) {
6259
6270
  this.afterLoad();
6271
+ const { dataValue } = this;
6272
+ const isSelected = this.selectValue && this.pushedValue && this.selectValue[dataValue] === this.pushedValue[dataValue];
6273
+ if (isSelected)
6274
+ return;
6275
+ this.removePushedValue();
6260
6276
  }
6261
6277
  });
6262
6278
  }
@@ -6270,7 +6286,7 @@ class Select extends TextInput {
6270
6286
  this.datasource.search = '';
6271
6287
  this.dirtySearchValue = '';
6272
6288
  if (!this.manualMode) {
6273
- this.datasource.data = this.cachedData;
6289
+ this.datasource.data = [...this.cachedData];
6274
6290
  this.datasource.total = this.cachedTotal;
6275
6291
  }
6276
6292
  this.checkValueOnBlur();
@@ -6283,13 +6299,17 @@ class Select extends TextInput {
6283
6299
  }
6284
6300
  if (this.manualMode)
6285
6301
  return;
6286
- if (this.isFilledObj(this.selectValue)) {
6287
- if (this.indexOf(this.selectValue) === -1) {
6288
- this.datasource.data.unshift(this.selectValue);
6289
- this.pushedValue = this.selectValue;
6302
+ if (this.isFilledObj(this.selectValue) && this.indexOf(this.selectValue) === -1) {
6303
+ if (this.pushedValue) {
6304
+ this.removePushedValue();
6290
6305
  }
6306
+ this.datasource.data.unshift(this.selectValue);
6307
+ this.pushedValue = this.selectValue;
6291
6308
  return;
6292
6309
  }
6310
+ const { dataValue } = this;
6311
+ if (this.pushedValue && this.selectValue && this.selectValue[dataValue] === this.pushedValue[dataValue])
6312
+ return;
6293
6313
  this.removePushedValue();
6294
6314
  }
6295
6315
  showLoadMore() {
@@ -7879,7 +7899,6 @@ class SelectMultiple extends Select {
7879
7899
  */
7880
7900
  constructor(props) {
7881
7901
  super(props);
7882
- this.selectedValue = [];
7883
7902
  /**
7884
7903
  * Selected items that were added to datasource
7885
7904
  */
@@ -7893,6 +7912,9 @@ class SelectMultiple extends Select {
7893
7912
  */
7894
7913
  this.moreChip = 0;
7895
7914
  this.showSelectAll = false;
7915
+ if (!this.selectedValue) {
7916
+ this.selectedValue = [];
7917
+ }
7896
7918
  this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
7897
7919
  this.createAccessors();
7898
7920
  }
@@ -7932,20 +7954,23 @@ class SelectMultiple extends Select {
7932
7954
  set selectValue(rows) {
7933
7955
  if (!Array.isArray(rows))
7934
7956
  return;
7935
- if (!this.manualMode && this.insertedValues.length > 0) {
7936
- this.insertsRemoved = [];
7957
+ if (!this.manualMode) {
7937
7958
  const values = rows.map((row) => row[this.dataValue]);
7938
- this.insertedValues = this.insertedValues.filter((inserted) => {
7939
- const removed = !values.includes(inserted[this.dataValue]);
7940
- if (removed) {
7941
- this.insertsRemoved.push(inserted);
7942
- }
7943
- return !removed;
7944
- });
7959
+ this.cutFromAToB(this.insertedValues, this.insertsRemoved, (value) => !values.includes(value[this.dataValue]));
7960
+ this.cutFromAToB(this.insertsRemoved, this.insertedValues, (value) => values.includes(value[this.dataValue]));
7945
7961
  }
7946
7962
  this.selectedValue = rows;
7947
7963
  this.setFieldValue(this.getValues(rows));
7948
7964
  }
7965
+ /**
7966
+ * Removes item from array a and add it to array b if condition is satisfied
7967
+ */
7968
+ cutFromAToB(a, b, condition) {
7969
+ const indices = a.reduce((result, value, index) => (condition(value) ? [...result, index] : result), []);
7970
+ indices.forEach((index) => {
7971
+ b.push(a.splice(index)[0]);
7972
+ });
7973
+ }
7949
7974
  setFieldValue(value) {
7950
7975
  return __awaiter(this, void 0, void 0, function* () {
7951
7976
  const promises = [];
@@ -7975,7 +8000,9 @@ class SelectMultiple extends Select {
7975
8000
  }));
7976
8001
  }
7977
8002
  });
7978
- yield Promise.all(promises);
8003
+ if (promises.length) {
8004
+ yield Promise.all(promises);
8005
+ }
7979
8006
  if (searchValues.length > 0) {
7980
8007
  this.setFieldRowValue(searchValues);
7981
8008
  }
@@ -8120,7 +8147,7 @@ class SelectMultiple extends Select {
8120
8147
  showLoadMore() {
8121
8148
  return !!this.datasource.data.length
8122
8149
  && !this.datasource.loadAll
8123
- && (this.datasource.data.length - this.insertedValues.length) < this.datasource.total;
8150
+ && (this.datasource.data.length - this.insertedValues.length - this.insertsRemoved.length) < this.datasource.total;
8124
8151
  }
8125
8152
  /**
8126
8153
  * Load more data
@@ -8128,10 +8155,16 @@ class SelectMultiple extends Select {
8128
8155
  loadMore() {
8129
8156
  return __awaiter(this, void 0, void 0, function* () {
8130
8157
  yield this.datasource.setLimit(this.datasource.limit + this.loadMoreQtty);
8158
+ this.insertsRemoved = this.insertsRemoved.filter((insert) => {
8159
+ const value = insert[this.dataValue];
8160
+ const foundInData = this.datasource.data.find(this.getCondition(value));
8161
+ return !foundInData;
8162
+ });
8163
+ this.insertSelected();
8131
8164
  if (!this.datasource.search) {
8132
8165
  this.setCache();
8133
8166
  }
8134
- this.insertSelected();
8167
+ this.removePushedValue();
8135
8168
  });
8136
8169
  }
8137
8170
  /**
@@ -8325,6 +8358,9 @@ class TreeDataStructure {
8325
8358
  }
8326
8359
  return item;
8327
8360
  });
8361
+ if (parent) { // remove all existing children to add new ones
8362
+ this.treeData = this.treeData.filter((item) => item.tree__parent !== parent);
8363
+ }
8328
8364
  if (!parent) {
8329
8365
  this.treeData = childData;
8330
8366
  }
@@ -8508,7 +8544,7 @@ class TreeDataStructure {
8508
8544
  this.treeStructure = {};
8509
8545
  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 })));
8510
8546
  this.treeData = childData;
8511
- this.treeStructure['no-parent'] = this.originalDatasource.data;
8547
+ this.treeStructure['no-parent'] = childData;
8512
8548
  }
8513
8549
  /**
8514
8550
  * Search value against a memory datasource
@@ -8643,6 +8679,7 @@ class SelectTree extends TextInput {
8643
8679
  * Defines if should wait and not execute GET method when Datasource is created
8644
8680
  */
8645
8681
  this.lazyLoad = true;
8682
+ this.selectValue = null;
8646
8683
  this.nodes = this.getInitValue('nodes', props.nodes, this.nodes);
8647
8684
  this.alwaysOpen = this.getInitValue('alwaysOpen', props.alwaysOpen, this.alwaysOpen);
8648
8685
  this.flattenSearchResults = this.getInitValue('flattenSearchResults', props.flattenSearchResults, this.flattenSearchResults);
@@ -8810,8 +8847,41 @@ class SelectTree extends TextInput {
8810
8847
  get searchValue() {
8811
8848
  return this.lastInputValue;
8812
8849
  }
8850
+ clearRow(row) {
8851
+ const result = Object.assign({}, row);
8852
+ Object.keys(result).forEach((key) => {
8853
+ if (key.indexOf('tree__') === 0) {
8854
+ delete result[key];
8855
+ }
8856
+ });
8857
+ return result;
8858
+ }
8859
+ get value() {
8860
+ if (!this.selectValue)
8861
+ return this.selectValue;
8862
+ if (this.returnObject) {
8863
+ return this.clearRow(this.selectValue.row);
8864
+ }
8865
+ return this.selectValue;
8866
+ }
8867
+ set value(value) {
8868
+ this.selectValue = value;
8869
+ }
8813
8870
  setValue(value) {
8814
- this.value = value;
8871
+ if (this.returnObject) {
8872
+ if (typeof value !== 'object') {
8873
+ this.value = { id: value };
8874
+ }
8875
+ else {
8876
+ this.value = { id: value[this.dataValue] };
8877
+ }
8878
+ }
8879
+ else if (typeof value === 'object') {
8880
+ this.value = value[this.dataValue];
8881
+ }
8882
+ else {
8883
+ this.value = value;
8884
+ }
8815
8885
  }
8816
8886
  }
8817
8887
 
@@ -8837,6 +8907,7 @@ class SelectTreeMultiple extends SelectTree {
8837
8907
  * Selected Nodes
8838
8908
  */
8839
8909
  this.selectedNodes = [];
8910
+ this.selectValue = [];
8840
8911
  this.flat = this.getInitValue('flat', props.flat, this.flat);
8841
8912
  this.limit = this.getInitValue('limit', props.limit, this.limit);
8842
8913
  this.createAccessors();
@@ -8853,6 +8924,34 @@ class SelectTreeMultiple extends SelectTree {
8853
8924
  deselect(node, element) {
8854
8925
  this.callEvent('onDeselect', { element, component: this, node });
8855
8926
  }
8927
+ get value() {
8928
+ if (this.returnObject) {
8929
+ return this.selectValue.map((value) => this.clearRow(value.row));
8930
+ }
8931
+ return this.selectValue;
8932
+ }
8933
+ set value(value) {
8934
+ this.selectValue = value;
8935
+ }
8936
+ setValue(value) {
8937
+ const arrValue = Array.isArray(value) ? value : [value];
8938
+ if (this.returnObject) {
8939
+ this.value = arrValue.map((item) => {
8940
+ if (typeof item !== 'object') {
8941
+ return { id: item };
8942
+ }
8943
+ return { id: item[this.dataValue] };
8944
+ });
8945
+ }
8946
+ else {
8947
+ this.value = arrValue.map((item) => {
8948
+ if (typeof item === 'object') {
8949
+ return item[this.dataValue];
8950
+ }
8951
+ return item;
8952
+ });
8953
+ }
8954
+ }
8856
8955
  }
8857
8956
 
8858
8957
  /**
@@ -10122,7 +10221,6 @@ class TreeGridEditable extends TreeGrid {
10122
10221
  if (this.editing)
10123
10222
  return;
10124
10223
  if (column.editable) {
10125
- this.selectedRows = [];
10126
10224
  this.editing = true;
10127
10225
  this.preventRowClick = true;
10128
10226
  this.datasource.currentRow = row;
@@ -11071,17 +11169,37 @@ class PDFReport extends BaseReport {
11071
11169
  }
11072
11170
 
11073
11171
  class XLSReport extends BaseReport {
11074
- constructor() {
11075
- super(...arguments);
11172
+ constructor(type) {
11173
+ super();
11076
11174
  this.route = '/generateXLS';
11175
+ this.expressionZeedhiToXls = {
11176
+ AVG: 'AVERAGE',
11177
+ COUNT: 'COUNTA',
11178
+ MAX: 'MAX',
11179
+ MIN: 'MIN',
11180
+ SUM: 'SUM',
11181
+ };
11182
+ this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
11183
+ this.type = type || 'xls';
11077
11184
  }
11078
- buildDataset(data, columns) {
11185
+ buildDataset(data, columns, metadata) {
11186
+ let result;
11187
+ if (this.type === 'xls') {
11188
+ result = this.formatRawDataSet(data, columns);
11189
+ }
11190
+ else if (metadata) {
11191
+ result = this.formatDataSet(metadata, data);
11192
+ }
11193
+ return JSON.stringify(result);
11194
+ }
11195
+ // formata o dataset para o formato "cru" xls
11196
+ formatRawDataSet(data, columns) {
11079
11197
  const columnNames = columns.map((col) => col.name);
11080
11198
  const result = data.reduce((reduced, row) => {
11081
11199
  const values = columnNames.map((col) => row[col] || '');
11082
11200
  return [...reduced, values];
11083
11201
  }, [columnNames]);
11084
- return JSON.stringify(result);
11202
+ return result;
11085
11203
  }
11086
11204
  buildMetadata(name, title, columns, filter) {
11087
11205
  const builtCols = this.buildColumns(columns);
@@ -11110,9 +11228,215 @@ class XLSReport extends BaseReport {
11110
11228
  orientation: 'PORTRAIT',
11111
11229
  columns: builtCols,
11112
11230
  filter: builtFilters,
11231
+ reportXLS: true,
11232
+ xlsMergedCell: [],
11113
11233
  };
11114
11234
  return Promise.resolve(JSON.stringify(metadataObj));
11115
11235
  }
11236
+ isFormat3(format) {
11237
+ return format === 'xls3';
11238
+ }
11239
+ // Ordenar o nome das colunas de acordo com seu index, excluindo o nome das colunas agrupadas
11240
+ getColumnsNameFormat3(columns, metaData) {
11241
+ const columnsNameGroup = metaData.groups.map((row) => row.field);
11242
+ let columnsName = [];
11243
+ Object.entries(columns).forEach((row) => {
11244
+ const columnName = row[0];
11245
+ if (columnsNameGroup.indexOf(columnName) === -1) {
11246
+ const index = row[1].sequence;
11247
+ columnsName[index] = columnName;
11248
+ }
11249
+ });
11250
+ columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
11251
+ return columnsName;
11252
+ }
11253
+ // Ordenar o nome das colunas de acordo com seu index, e sempre deixando as colunas agrupadas nas primeiras posições
11254
+ getColumnsName(columns, metaData, lengthGroup) {
11255
+ const columnsNameGroup = metaData.groups.map((row) => row.field);
11256
+ let columnsName = [];
11257
+ Object.entries(columns).forEach((row) => {
11258
+ const columnName = row[0];
11259
+ const index = row[1].sequence;
11260
+ if (columnsNameGroup.indexOf(columnName) === -1) {
11261
+ columnsName[index + lengthGroup] = columnName;
11262
+ }
11263
+ else {
11264
+ columnsName[index] = columnName;
11265
+ }
11266
+ });
11267
+ columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
11268
+ return columnsName;
11269
+ }
11270
+ // Inicializa alguns valores auxiliares
11271
+ initVars(metaData, type) {
11272
+ metaData.xlsMergedCell = [];
11273
+ const { columns } = metaData;
11274
+ const lengthGroup = metaData.groups.length;
11275
+ const indexLastGroup = lengthGroup - 1;
11276
+ let columnsName = [];
11277
+ if (this.isFormat3(type)) {
11278
+ columnsName = this.getColumnsNameFormat3(columns, metaData);
11279
+ }
11280
+ else {
11281
+ columnsName = this.getColumnsName(columns, metaData, lengthGroup);
11282
+ }
11283
+ const rowValues = [];
11284
+ const formatedDataSet = [];
11285
+ const groups = [];
11286
+ groups.groupEnd = {};
11287
+ groups.groupEnd.cellsfunc = {};
11288
+ return {
11289
+ columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
11290
+ };
11291
+ }
11292
+ // formata a linha do grupo de acordo com o formato xls3
11293
+ setRowGroupFormat3(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
11294
+ let rowValues = rowValuesParam;
11295
+ const label = `${row.groupLabel}:${row.groupValue}`;
11296
+ const index = row.groupIndex;
11297
+ if (row.groupHeader) {
11298
+ rowValues[index] = label;
11299
+ groups[index] = { init: null, end: null };
11300
+ formatedDataSet.push(rowValues);
11301
+ rowValues = [];
11302
+ }
11303
+ else if (row.groupFooter) {
11304
+ if (!row.groupLabel) {
11305
+ rowValues.push('Total');
11306
+ }
11307
+ else {
11308
+ rowValues.push(`Total (${label})`);
11309
+ }
11310
+ formatedDataSet.push(rowValues);
11311
+ rowValues = [];
11312
+ const funcXls = null;
11313
+ columnsName.forEach((column) => {
11314
+ this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
11315
+ });
11316
+ }
11317
+ return rowValues;
11318
+ }
11319
+ // formata as expressões da linha
11320
+ formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
11321
+ let funcXls = funcXlsParam;
11322
+ if ((row[column] === 0 || row[column]) && index !== undefined) {
11323
+ const letter = this.colunmXLS[rowValues.length];
11324
+ funcXls = this.expressionZeedhiToXls[columns[column].expression];
11325
+ const cellsfunc = `${letter + groups[index].init}:${letter}${groups[index].end}`;
11326
+ let expression = '';
11327
+ if (indexLastGroup === index) {
11328
+ expression = `=${funcXls}(${cellsfunc})`;
11329
+ }
11330
+ else {
11331
+ expression = `=${funcXls}(${groups[index].cellsfunc[column]})`;
11332
+ if (index === 0) {
11333
+ if (groups.groupEnd.cellsfunc[column]) {
11334
+ groups.groupEnd.cellsfunc[column] += `,${groups[index].cellsfunc[column]}`;
11335
+ }
11336
+ else {
11337
+ groups.groupEnd.cellsfunc[column] = groups[index].cellsfunc[column];
11338
+ }
11339
+ }
11340
+ groups[index].cellsfunc[column] = null;
11341
+ }
11342
+ rowValues.push(expression);
11343
+ groups.forEach((group, indexGroup) => {
11344
+ if (indexGroup !== indexLastGroup) {
11345
+ if (!group.cellsfunc) {
11346
+ group.cellsfunc = {};
11347
+ }
11348
+ if (group.cellsfunc[column]) {
11349
+ group.cellsfunc[column] += `,${cellsfunc}`;
11350
+ }
11351
+ else {
11352
+ group.cellsfunc[column] = cellsfunc;
11353
+ }
11354
+ }
11355
+ });
11356
+ }
11357
+ else {
11358
+ let cell = row[column];
11359
+ if (row.groupSummary) {
11360
+ const groupEndFunc = groups.groupEnd.cellsfunc;
11361
+ if (groupEndFunc[column]) {
11362
+ funcXls = this.expressionZeedhiToXls[columns[column].expression];
11363
+ cell = `=${funcXls}(${groupEndFunc[column]})`;
11364
+ }
11365
+ }
11366
+ rowValues.push(cell);
11367
+ }
11368
+ }
11369
+ // formata a linha de grupo de acordo com o formato xls2
11370
+ setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup) {
11371
+ const label = `${row.groupLabel}:${row.groupValue}`;
11372
+ const index = row.groupIndex;
11373
+ if (row.groupHeader) {
11374
+ rowValues[index] = label;
11375
+ groups[index] = { init: null, end: null };
11376
+ }
11377
+ else if (row.groupFooter) {
11378
+ if (!row.groupLabel) {
11379
+ rowValues.push('Total');
11380
+ }
11381
+ else {
11382
+ rowValues.push(`Total (${label})`);
11383
+ }
11384
+ const funcXls = null;
11385
+ if (groups[index]) {
11386
+ metaData.xlsMergedCell.push({
11387
+ start_row: groups[index].init,
11388
+ start_col: this.colunmXLS[index],
11389
+ end_row: formatedDataSet.length + 2,
11390
+ end_col: this.colunmXLS[index],
11391
+ });
11392
+ }
11393
+ columnsName.forEach((column, columnIndex) => {
11394
+ if (!(row.groupFooter && columnIndex === 0)) {
11395
+ this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
11396
+ }
11397
+ });
11398
+ }
11399
+ return rowValues;
11400
+ }
11401
+ // Defina o index dos grupos
11402
+ setIndexGroups(groups, formatedDataSet) {
11403
+ groups.forEach((group) => {
11404
+ if (!group.init) {
11405
+ group.init = formatedDataSet.length + 2;
11406
+ }
11407
+ group.end = formatedDataSet.length + 2;
11408
+ });
11409
+ }
11410
+ // Preenche uma linha "normal"
11411
+ setRowNormal(columnsName, rowValues, row) {
11412
+ columnsName.forEach((column) => {
11413
+ rowValues.push(row[column]);
11414
+ });
11415
+ }
11416
+ formatDataSet(metaData, dataSet) {
11417
+ const initVars = this.initVars(metaData, this.type);
11418
+ const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
11419
+ let { rowValues } = initVars;
11420
+ dataSet.forEach((row) => {
11421
+ if (row.group || row.groupFooter) {
11422
+ if (this.isFormat3(this.type)) {
11423
+ rowValues = this.setRowGroupFormat3(row, rowValues, groups, formatedDataSet, columnsName, columns, indexLastGroup);
11424
+ }
11425
+ else {
11426
+ rowValues = this.setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup);
11427
+ }
11428
+ }
11429
+ else {
11430
+ this.setIndexGroups(groups, formatedDataSet);
11431
+ this.setRowNormal(columnsName, rowValues, row);
11432
+ }
11433
+ if (!row.groupHeader) {
11434
+ formatedDataSet.push(rowValues);
11435
+ }
11436
+ rowValues = [];
11437
+ });
11438
+ return [columnsName].concat(formatedDataSet);
11439
+ }
11116
11440
  }
11117
11441
 
11118
11442
  class Report {
@@ -11148,8 +11472,8 @@ class Report {
11148
11472
  if (type === 'pdf') {
11149
11473
  return new PDFReport();
11150
11474
  }
11151
- if (type === 'xls') {
11152
- return new XLSReport();
11475
+ if (type === 'xls' || type === 'xls2' || type === 'xls3') {
11476
+ return new XLSReport(type);
11153
11477
  }
11154
11478
  throw new Error(`Invalid report type: ${type}`);
11155
11479
  }
@@ -11164,9 +11488,18 @@ class Report {
11164
11488
  const reportType = this.getReportType(type);
11165
11489
  const { route } = reportType;
11166
11490
  const { name, columns, datasource } = this.iterable;
11491
+ const { groupedData } = Object.assign({}, this.iterable);
11167
11492
  const formattedColumns = this.removeActionColumns(columns);
11168
- const dataset = reportType.buildDataset(data, formattedColumns);
11169
11493
  const metadataObj = yield reportType.buildMetadata(name, this.title, formattedColumns, datasource.filter, portrait);
11494
+ let dataset;
11495
+ if ((reportType.type === 'xls2' || reportType.type === 'xls3') && groupedData) {
11496
+ const rowMetadata = rowObj.metaData;
11497
+ const metadataObjClone = merge(rowMetadata, JSON.parse(metadataObj));
11498
+ dataset = reportType.buildDataset(groupedData, formattedColumns, metadataObjClone);
11499
+ }
11500
+ else {
11501
+ dataset = reportType.buildDataset(data, formattedColumns);
11502
+ }
11170
11503
  const filter = '[]';
11171
11504
  let row = {};
11172
11505
  if (rowObj) {