From: Kilian Date: Sat, 4 Mar 2023 07:47:25 +0000 (+0100) Subject: v20230303 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;p=ledf_lu.git v20230303 --- diff --git a/.gitignore b/.gitignore index b41cef1..839b836 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -app/lib/perl5/* -website/lib/vendor/* \ No newline at end of file +OLD/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 5eff6b1..65841a6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,16 @@ { - "intelephense.environment.includePaths": ["D:/Workspace/ledf_lu/website/lib/vendor"] +"es6-css-minify.minifyOnSave": "no", +"git.ignoreLimitWarning": true, +"tidyHtml.formatOnSave": false, +"tidyHtml.optionsTidy": { + "indent-attributes": falss, + "tab-size":2, + "indent":true, + "show-body-only":false, + "fix-uri": false, + "newline":"LF", + "drop-empty-elements": false, + "hide-comments": false, +} + } \ No newline at end of file diff --git a/.vscode/sftp.json b/.vscode/sftp.json new file mode 100644 index 0000000..c8d37af --- /dev/null +++ b/.vscode/sftp.json @@ -0,0 +1,14 @@ + +[ + { + "name": "ledf-sftp", + "protocol": "sftp", + "port": 22, + "secure": true, + "context": "public_html/", + "host": "dedi1781.your-server.de", + "username": "ledfxg", + "password": "3H0HTd8B88iKZ2WU", + "remotePath": "/public_html/" +} +] diff --git a/app/.htaccess b/app/.htaccess deleted file mode 100644 index c5a9e14..0000000 --- a/app/.htaccess +++ /dev/null @@ -1,9 +0,0 @@ -RewriteEngine on - -DirectoryIndex index.cgi index.html -AddHandler cgi-script .cgi -#RewriteBase / -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d - -RewriteRule "^(.*)$" "index.cgi" [NC,L,QSA] \ No newline at end of file diff --git a/app/app.cgi b/app/app.cgi deleted file mode 100644 index 2941e4d..0000000 --- a/app/app.cgi +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -use lib ($RealBin.'/lib/perl5'); -use lib ($RealBin.'/lib'); -use lib ($RealBin.'/backoffice/lib/perl5'); -use lib ($RealBin.'/backoffice/lib'); -use CGI; -use CGI::Cookie; -#use CGI::Carp qw/fatalsToBrowser/; -use File::Basename; -use JSON::PP; - -use dksconfig qw/$sitecfg/; -use dksdb; - -use session; -use sendemail; -my $cgi = new CGI(); -my $scriptpath = $cgi->url(-absolute => 1); -my $p = (); -my @params = $cgi->param(); -foreach my $pe (@params){ - $p->{$pe} = $cgi->param($pe); -} -my $html->{result} = (); -$p->{sid} = $cgi->cookie($sitecfg->{cookiename}); -my $se = session->new(); -my $sess = $se->getsession($p->{sid}); -print $cgi->header(-type=>"application/json", -charset => "utf-8"); -if ($sess == undef){ - $html->{error} = "No Authorisation"; - print JSON::PP::encode_json($html); - exit(0); -} -# $html->{p} = $p; -# $html->{sess} =$sess; -#my $datapath = $ENV{"DOCUMENT_ROOT"}.dirname(dirname($scriptpath)).'/data/'; -if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ - - my @params = $cgi->param(); - foreach my $pp (@params){ - $p->{$pp} = $cgi->param($pp); - } - - if (exists($p->{fn})){ - - my $db = dksdb->new(); - if ($p->{fn} eq "savefield"){ - # $html->{p} = $p; - $html->{result}->{ident} = $p->{ident}; - delete $p->{ident}; - delete $p->{fn}; - delete $p->{sid}; - my $dd = (); - my $retid=undef; - my $type = "upd"; - foreach my $px (keys(%{$p})){ - $html->{result}->{datafield} = $px; - - if (($px =~ /\_id$/) && ($p->{$px} eq "")){ - $type = "ins"; - } - } - my @sql = (); - if ($type eq "ins"){ - @sql = $db->create_ddl_insert($p); - } - else { - @sql = $db->create_ddl_update($p); - } - #$html->{result}->{sql} = \@sql; - foreach my $s (@sql){ - $retid= $db->dbquerysorted($s); - } - $html->{result}->{id} = $retid->{0}; - #$p->{table},#$p->{field},$p->{value},$p->{id},$p->{type} - } - - elsif ($p->{fn} eq "saveform"){ - # - $html->{p} = $p; - $html->{result}->{ident} = $p->{ident}; - delete $p->{ident}; - delete $p->{fn}; - delete $p->{sid}; - my $retid=undef; - my $type = "upd"; - foreach my $px (keys(%{$p})){ - $html->{result}->{datafield} = $px; - if (($px =~ /\_id$/) && ($p->{$px} eq "")){ - $type = "ins"; - delete $p->{$px}; - } - - } - my @sql = (); - if ($type eq "ins"){ - @sql = $db->create_ddl_insert($p); - } - else { - @sql = $db->create_ddl_update($p); - } - #$html->{sql} = \@sql; - foreach my $s (@sql){ - #if ($type eq "ins"){ - $retid= $db->dbquerysorted($s); - #}else { - - #} - - } - $html->{result} = $retid->{0}; - #$p->{table},#$p->{field},$p->{value},$p->{id},$p->{type} - } - elsif($p->{fn} eq "deleterow"){ - delete $p->{fn}; - delete $p->{sid}; - my $retid = undef; - my @sql = $db->create_ddl_delete($p); - foreach my $s (@sql){ - $retid= $db->dbexec($s); - } - $html->{result}->{id} = $retid->{0}; - } - elsif($p->{fn} eq "savepassword"){ - if ((length($p->{pwd}) > 7) && ($p->{pwd} =~ /\d/) && ($p->{pwd} =~ /[a-z]/) && ($p->{pwd} =~ /[A-Z]/) ){ - $se->savepassword($sess->{id},$p->{pwd}); - $html->{result} = "OK"; - }else { - $html->{result} = "NOT OK"; - } - - } - elsif ($p->{fn} eq "sendmailvcode"){ - my $vcode = $se->randomstring(6); - $vcode = lc($vcode); - $db->dbexec("UPDATE users set vcode='".$vcode."' where id=".$sess->{id}.";"); - my $eml = sendemail->new(); - my $mret = $eml->sendemail('user_verification',$sess->{id},$p->{mail},{vcode => $vcode},undef); - if ($mret == 0){ - $html->{result}->{vcode} = $vcode; - } else { - $html->{result}->{vcode} = $vcode; - $html->{result}->{error} = $mret; - } - } - elsif ($p->{fn} eq "savenewemail"){ - $db->dbexec("update users set username='".$p->{email}."' where id=".$sess->{id}." and vcode='".$p->{vcode}."';"); - $html->{result} = "OK"; - } - elsif($p->{fn} eq "getsitemedia"){ - my $path = dirname(dirname($0)).'/img'; - } - } - -} -print JSON::PP::encode_json($html); diff --git a/app/db.cgi b/app/db.cgi deleted file mode 100644 index c6599f6..0000000 --- a/app/db.cgi +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -use lib ($RealBin.'/lib/perl5'); -use lib ($RealBin.'/lib'); -use lib ($RealBin.'/backoffice/lib/perl5'); -use lib ($RealBin.'/backoffice/lib'); -use CGI; -use CGI::Cookie; -# use CGI::Carp qw/fatalsToBrowser/; -use File::Basename; -use JSON::PP; - -use dksconfig qw/$sitecfg/; -use dksdb; - -use session; -#use sendemail; -my $cgi = new CGI(); -my $scriptpath = $cgi->url(-absolute => 1); -my $p = (); -my @params = $cgi->param(); -foreach my $pe (@params){ - $p->{$pe} = $cgi->param($pe); -} -my $html->{result} = (); -$p->{sid} = $cgi->cookie($sitecfg->{cookiename}); -my $se = session->new(); -my $sess = $se->getsession($p->{sid}); -print $cgi->header(-type=>"application/json", -charset => "utf-8"); -if ($sess == undef){ - $html->{error} = "No Authorisation"; - print JSON::PP::encode_json($html); - exit(0); -} -# $html->{p} = $p; -# $html->{sess} =$sess; -#my $datapath = $ENV{"DOCUMENT_ROOT"}.dirname(dirname($scriptpath)).'/data/'; -if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ - - my @params = $cgi->param(); - foreach my $pp (@params){ - $p->{$pp} = $cgi->param($pp); - } - my $db = dksdb->new(); - if (exists($p->{get})){ - my $sql = "select * from vw_".$p->{get}; - if (exists($p->{fields}) ){ - $sql = "select ".$p->{fields}." from vw_".$p->{get}; - } - if (exists($p->{filter})){ - $sql .= " WHERE ".$p->{filter}.";"; - } - $html->{result}->{sqldata} = $db->dbqueryarray($sql); - } - elsif (exists($p->{set})){ - my $type = "ins"; - foreach my $x (keys(%{$p})){ - if (($x =~ /^ident_/) && ($p->{$x} ne "")){ - $type = "upd"; - last; - } - } - my $x = $p; - delete $x->{sid}; - delete $x->{set}; - my @sql = (); - #$html->{result}->{params} = $x; - if ($type eq "ins"){ - @sql = $db->create_ddl_insert($x); - }else { - @sql = $db->create_ddl_update($x); - } - if (scalar(@sql) > 0 ){ - my $rid = $db->dbquerysorted($sql[0]); - if (keys(%{$rid}) > 0 ){ - $html->{result} = $rid->{0}; - } - } - #$html->{result}->{sql} = $sql[0]; - } - elsif (exists($p->{fn})){ - my $x = $p; - my $fn = $p->{fn}; - my $sql = "select * from ".$p->{fn}.'('.$p->{params}.');'; - # open FILE,">>tmp/sql.log"; - # print FILE "\n=db.cgi fn=\n$sql\n==\n"; - # close FILE; - $html->{result} = $db->dbquerysorted($sql); - # $html->{result}->{sql} = $sql; - } - elsif (exists($p->{del})){ - my $x = $p; - delete $x->{sid}; - delete $x->{del}; - my @sql = $db->create_ddl_delete($x); - if (scalar(@sql) > 0 ){ - my $rid = $db->dbexec($sql[0]); - if (keys(%{$rid}) > 0 ){ - $html->{result} = $rid->{0}; - } - } - } -} -print JSON::PP::encode_json($html); -# for my $e ( keys %ENV ) { -# print "$e: $ENV{$e}
"; -# } \ No newline at end of file diff --git a/app/file.cgi b/app/file.cgi deleted file mode 100644 index af305f0..0000000 --- a/app/file.cgi +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -use lib ($RealBin.'/lib/perl5'); -use lib ($RealBin.'/lib'); -use lib ($RealBin.'/backoffice/lib/perl5'); -use lib ($RealBin.'/backoffice/lib'); -use CGI; -use CGI::Cookie; -# use CGI::Carp qw/fatalsToBrowser/; -use File::Basename; -use File::Path qw/make_path/; -use JSON::PP; -use Image::Size; -use dksconfig qw/$sitecfg/; -use dksdb; - -use session; -#use sendemail; -my $cgi = new CGI(); -my $scriptpath = $cgi->url(-absolute => 1); -my $p = (); -my @params = $cgi->param(); -foreach my $pe (@params){ - $p->{$pe} = $cgi->param($pe); -} -# if ($sitecfg->{basepath} ne "/"){ -#$sitecfg->{docroot} = $sitecfg->{docroot}.substr($sitecfg->{basepath},0,index($sitecfg->{basepath},'backoffice')-1); -# } -my $html->{result} = (); -$p->{sid} = $cgi->cookie($sitecfg->{cookiename}); -my $se = session->new(); -my $sess = $se->getsession($p->{sid}); - -if ($sess == undef){ - print $cgi->header(-status => 404, -type=>"text/html", -charset => "utf-8"); - print "

Du bass nët Authentifizéiert

"; - exit(0); -} -#$html->{docroot} = $sitecfg->{docroot}; -# $html->{basepath} = $sitecfg->{basepath}; -if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ - if (exists($p->{file}) && $p->{file} ne ""){ - my $db = dksdb->new(); - my $filedata = $db->dbquerysorted("select * from documents where id='".$p->{file}."';"); - if (keys(%{$filedata}) > 0){ - if ($filedata->{0}->{filedata} ne ""){ - print $cgi->header( - -type => $filedata->{0}->{mimetype}, - -target => $filedata->{0}->{filename}, - -attachment => $filedata->{0}->{filename} - ); - my $rawdata = MIME::Base64::decode_base64($filedata->{0}->{filedata}); - print $rawdata; - } - else { - print $cgi->header(-status => 404, -type=>"text/html", -charset => "utf-8"); - print "

Deen gefroten Fichier existéiert nët!

"; - } - - exit(0); - } - } else { - print $cgi->header(-status => 404, -type=>"text/html", -charset => "utf-8"); - print "

Deen gefroten Fichier existéiert nët!

"; - exit(0) - } - # if (exists($p->{list}) && -d ){ - # if (exists($p->{folder})){ - - # $p->{folder} =~ s/\.\.\///g; - # my $cpath = $sitecfg->{docroot}.'/'.$p->{folder}; - # my @items = (); - # my $up = (); - # # if (index($p->{folder},'/') > 0){ - # # $up->{type} = "dir"; - # # $up->{name} = ".."; - # # $up->{sitepath} = $p->{folder}; - # # $up->{path} = $p->{folder}; - # # $up->{mimtype} = 'directory'; - # # $up->{size} = ''; - # # $up->{dimension}; - # # $up->{thumb} = ''; - # # push (@items,$up); - # # } - # opendir(DIR,$cpath); - - # while (my $d = readdir(DIR)){ - # if ($d =~ /^\./){ next; } - # if ($d eq "thb"){ next; } - # my $e = (); - # if (-d $cpath.'/'.$d){ - # $e->{type} = "dir"; - # $e->{name} = $d; - # $e->{sitepath} = $p->{folder}.'/'.$d; - # $e->{path} = $p->{folder}.'/'.$d; - # $e->{mimtype} = 'directory'; - # $e->{size} = ''; - - # my $cmd = 'find "'.$cpath.'/'.$d.'" -type f | grep -v \'/thb/\' | wc -l'; - # my $dim = `$cmd`; - # chomp($dim); - # $e->{dimension} = $dim; - - # $e->{thumb} = ''; - # } - # if (-f $cpath.'/'.$d){ - # my $cmd = 'file -i "'.$cpath.'/'.$d.'" | awk -F": " \'{ print $2 }\' | awk -F";" \'{ print $1 }\''; - # my $mt = `$cmd`; - # chomp($mt); - # #if (($mt !~ /^image/ ) || ($mt !~ /^application\/pdf/ )) { next; } - # if (($mt =~ /^image/ ) || ($mt !~ /^application\/pdf/ )) { - # if (! -f $cpath.'/thb/'.$d.'.thb.png'){ - # if (! -d $cpath.'/thb'){ - # make_path($cpath.'/thb'); - # } - # system('convert -thumbnail x96 -background white -alpha remove "'.$cpath.'/'.$d.'" "'.$cpath.'/thb/'.$d.'.thb.png"'); - # } - # if ($mt =~ /^image/ ){ - # my ($ix, $iy) = imgsize($cpath.'/'.$d); - # $e->{dimension} = $ix."x".$iy; - # } - # } - # my @st = stat($cpath.'/'.$d); - # $e->{type} = "file"; - # $e->{mimetype} = $mt; - # my $s = $st[7]; - # my $hrs =""; - # if ($s > 1000000024){ - # $s = $s/1024; - # $s = $s/1024; - # $s = $s/1024; - # ($hrs) = $s =~ m/^(\d+\.\d\d).*/; - # $hrs = $hrs." GB"; - # } elsif ($s > 1000024){ - # $s = $s/1024; - # $s = $s/1024; - # ($hrs) = $s =~ m/^(\d+\.\d\d).*/; - # $hrs = $hrs." MB"; - # } elsif ($s > 1024){ - # $s = $s/1024; - # ($hrs) = $s =~ m/^(\d+\.\d\d).*/; - # $hrs = $hrs." KB"; - # } else { - # $hrs = $s." B"; - # } - # $e->{hrsize} = $hrs; - # $e->{size} = $st[7]; - # $e->{name} = $d; - # $e->{sitepath} = $p->{folder}.'/'.$d; - # $e->{thumb} = ''; - # $e->{path} = '../../../'.$p->{folder}.'/'.$d; - # } - # push (@items,$e); - # } - # closedir(DIR); - # $html->{result} = \@items; - - # } - # } - -} - diff --git a/app/index.cgi b/app/index.cgi deleted file mode 100644 index b735fcd..0000000 --- a/app/index.cgi +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -use lib ($RealBin.'/lib/perl5'); -use lib ($RealBin.'/lib'); -use lib ($RealBin.'/backoffice/lib/perl5'); -use lib ($RealBin.'/backoffice/lib'); -use File::Basename qw/dirname basename/; -use Template; -# use Template::Constants qw( :debug ); -use CGI; -#use CGI::Carp qw(fatalsToBrowser); -use CGI::Cookie; -use Data::Dumper; -use JSON::PP; - -use dksconfig qw/$sitecfg/; -use session; - -my $skl = "index.tt"; -my $cgi = new CGI(); -my $p=(); -my $cookie; -my $vars = $sitecfg; -$vars->{page} = "index.html"; -$vars->{filepath} = substr($cgi->url({-absolute=>1}),length($vars->{basepath})+1); -# $vars->{baseurl} = $cgi->url({-base=>1}).$vars->{basepath}; -if ($vars->{filepath} eq ""){ - $vars->{filepath} = "index.html"; -} -if ($vars->{basepath} eq "/"){ - $vars->{siteurl} = $cgi->url({-base=>1}); -}else { - $vars->{siteurl} = $cgi->url({-base=>1}).dirname($vars->{basepath}); - #$vars->{docroot} = $vars->{docroot}.dirname($vars->{basepath}); - #$vars->{sitepath} = dirname($vars->{basepath}); -} - - -if ($vars->{filepath} ne ""){ - $vars->{suffix} = substr($vars->{filepath},rindex($vars->{filepath},'.')); - $vars->{page} = $vars->{filepath}; - $vars->{page} =~ s/html$/tt/; -} -$vars->{abspath} = ""; - -my $sess = (); -my $se = session->new(); -$p->{sid} = $cgi->cookie($vars->{cookiename}); -# if ($cgi->request_method() eq "GET"){ -# my @params = $cgi->param(); -# foreach my $pp (@params){ -# $p->{$pp} = $cgi->param($pp); -# } - -# } - -if ($cgi->request_method() eq "POST"){ - - my @params = $cgi->param(); - foreach my $pp (@params){ - $p->{$pp} = $cgi->param($pp); - } - $vars->{hasposts} = $p; - if (exists($p->{'btnlogin'})){ - my $ret = $se->checklogin($p->{login},$p->{password}); - if ($ret->{sid} ne ""){ - $p->{sid} = $ret->{sid}; - $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>$p->{sid},-httponly => 1); - }else { - $vars->{message} = $ret->{message}; - $vars->{messagetype} = $ret->{messagetype}; - $vars->{page} = "message.tt"; - } - } - if (exists($p->{'btnregister'})){ - - my $ret = $se->registeruser($p); - - $vars->{message} = $ret->{message}; - $vars->{messagetype} = $ret->{messagetype}; - $vars->{page} = $ret->{page}; - } - if (exists($p->{'btnforgotpassword'})){ - my $ret = $se->passwordforgotten($p->{email}); - $vars->{message} = $ret->{message}; - $vars->{messagetype} = $ret->{messagetype}; - $vars->{page} = "message.tt"; - } - if (exists($p->{'btnvalidateemail'})){ - my $ret = $se->validateaccount($p); - $vars->{message} = $ret->{message}; - $vars->{messagetype} = $ret->{messagetype}; - $vars->{page} = "message.tt"; - } - if (exists($p->{'btnresendcode'})){ - my $ret = $se->resendcode($p->{email}); - $vars->{message} = $ret->{message}; - $vars->{messagetype} = $ret->{messagetype}; - $vars->{page} = "message.tt"; - } - - if (exists($p->{logout})){ - $se->deletesession($p->{sid}); - $p->{sid} = ""; - $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>"",-httponly => 1); - } - # if (exists($p->{btndeleteprofile})){ - # my $ret = $se->deleteprofile($p->{deleteprofile}); - # $vars->{message} = $ret->{message}; - # $vars->{messagetype} = $ret->{messagetype}; - # $vars->{page} = "message.tt"; - # if (exists($ret->{sid})){ - # $p->{sid} = ""; - # } - # $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>"",-httponly => 1); - # } -} - -if ($p->{sid} ne ""){ - $sess = $se->getsession($p->{sid}); -} - - -#$vars->{beforex} = $vars->{page}; -if (!exists($sess->{id}) || (!exists($p->{sid})) || $p->{sid} eq ""){ - $skl = "login.tt"; -} -# if ($vars->{page} eq "deleteprofile.tt") { -# $skl = "skeleton/login.tt"; -# } -# my ($appname) = $ENV{REQUEST_URI} =~ /.*\/module\/(\w+)\/.*/; -if ($p->{sid} ne ""){ - $vars->{session} = $sess; -} -#SESSION - End -# #BEGIN - Browser Blocking -# if (($ENV{HTTP_USER_AGENT} !~ /Chrome/) || ($ENV{HTTP_USER_AGENT} =~ /Edge/) || ($ENV{HTTP_USER_AGENT} =~ /Firefox/)){ -# $skl = "skeleton/browser.tt"; -# } -# #END - Browser Blocking -my $ctype = 'text/html'; -if ($vars->{suffix} eq ".js"){ - $ctype= "text/javascript"; -} elsif ($vars->{suffix} eq ".css"){ - $ctype = "text/css"; -} -print $cgi->header(-type=>$ctype, -charset=>"utf-8",-cookie => $cookie); -# print dirname($ENV{"SCRIPT_FILENAME"}); - -my $template = Template->new({INCLUDE_PATH => [$sitecfg->{tmplpath}]}); -#} - -my @lv = split(/\//,$vars->{filepath}); -my $absnum = scalar(@lv)-1; - -for (my $i=0;$i<$absnum;$i++){ - $vars->{abspath} .= "../"; -} -if (($skl eq "index.tt") && ($vars->{page} eq "login.tt")){ - $vars->{page} = "index.tt"; -} -# $vars->{page} = $vars->{page}; -if (-e $sitecfg->{tmplpath}.'/module/'.$vars->{page}){ - $vars->{page} = 'module/'.$vars->{page}; -} -$vars->{pagename} = basename($vars->{page}); -$vars->{pagename} =~ s/\.tt$//; -# my ($appname) = $ENV{REQUEST_URI} =~ /.*\/apps\/(\w+)\/.*/; -#$vars->{requri} = $ENV{REQUEST_URI}; - -if ($vars->{suffix} ne ".html"){ - $skl = "file.tt"; -} -$vars->{params}= $p; -$vars->{skl} = $skl; -$vars->{lang} = "fr"; - - $template->process($skl,$vars) || die "Template process failed: ", $template->error(), "\n"; - - if ($vars->{page} =~ /\.tt/){ - print '
'.Dumper($vars)."
";
- } 
-
-
diff --git a/app/lib/dksconfig.pm b/app/lib/dksconfig.pm
deleted file mode 100644
index ea67c2a..0000000
--- a/app/lib/dksconfig.pm
+++ /dev/null
@@ -1,32 +0,0 @@
-package dksconfig;
-
-use strict;
-use lib ('./lib/perl5');
-use lib ('./lib');
-use lib ('./');
-use File::Basename;
-use Exporter 'import';
-our @EXPORT_OK = qw($sitecfg);
-
-our $sitecfg ={
-  cookiename => 'ledf',
-  dbtype => 'PgPP',
-  #dsn => 'DBI:PgPP:dbname=leedflu_db;host=DKS-LAPTOP.fritz.box',
-  dsn => 'DBI:PgPP:dbname=ledf_db;host=sql12.your-server.de',
-  dbuser => 'ledf_user',
-  dbpassword => 'znWA9s3cgjEsRsWZ',
-  page => 'index.tt',
-  pagename => 'index',
-  basepath => substr(dirname($0),length($ENV{"DOCUMENT_ROOT"})),
-  datapath => dirname($0).'/data/',
-  # docroot => $ENV{"DOCUMENT_ROOT"},
-  registration_enabled => '0',
-  default_group => 'users',
-  sitename => 'LEDF',
-  season => '2020-2021',
-  season_id => 2,
-  staticpath => 'static/',
-  tmplpath => dirname($0).'/tmpl'
-};
-
-1;
\ No newline at end of file
diff --git a/app/lib/dksdb.pm b/app/lib/dksdb.pm
deleted file mode 100644
index 2234a01..0000000
--- a/app/lib/dksdb.pm
+++ /dev/null
@@ -1,409 +0,0 @@
-package dksdb;
-
-use strict;
-use lib ('./lib/perl5');
-use lib ('./lib');
-use lib ('./');
-BEGIN { $ENV{DBI_PUREPERL} = 2 }
-use DBI;
-use File::Basename;
-
-use Digest::SHA::PurePerl qw(sha256_hex);
-use DBD::PgPP;
-use URI::Encode qw(uri_encode uri_decode);
-use Encode;
-use dksconfig qw($sitecfg);
-use Text::Unidecode;
-
-
-sub new {
-    my $class = shift;
-    my $p = shift;
-    my $self = bless {}, $class;
-    return $self;
-}
-
-sub securetext(){
-	my $self = shift;
-	my $text = shift;
-	$text =~ s/'/''/g;
-	return $text;
-}
-
-sub dbquery(){
-	my $self = shift;
-    my $stat = shift;
-    # my $vw_info = shift;
-    my $retdata = undef;
-    my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1})  or return $retdata->{error} = "dbquery Connection Error!".$!;
-    $stat = encode("utf8", $stat);
-    # open FILE,">>tmp/sql.log";
-    #  print FILE "$stat\n";
-    #  close FILE;
-    my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquery".$dbh->errstr. "- SQL: ".$stat;;
-
-		
-   $sth->execute() or return $retdata->{error} = "dbquery: ".$sth->errstr;
-   
-   my $data = $sth->fetchrow_hashref();
-   foreach my $k (keys %{$data}){
-      $retdata->{$k} = decode("utf-8",$data->{$k});
-   }
-   
-   $sth->finish();
-   $dbh->disconnect();
-	 
-   return $retdata;
-}
-
-sub dbquerybykey(){
-    my $self = shift;
-    my $key = shift;
-    my $stat = shift;
-    #my $retempty = shift;
-    my $retdata =();
-    my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1})  or return $retdata->{error} = "dbquery Connection Error!".$!;
-    # $stat = encode("utf8", $stat);
-
-    # open FILE,">>sql.log";
-    # print FILE "$stat\n";
-    # close FILE;
-    my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquery: ".$stat;
-   $sth->execute() or return $retdata->{error} = "dbquery: ".$stat;
-   while(my $data = $sth->fetchrow_hashref())
-   {
-     if (exists $data->{$key}){
-        foreach my $k (keys %{$data}){
-            #if ($k ne $key){
-
-                $retdata->{$data->{$key}}{$k} =decode("utf-8",$data->{$k});
-            #}
-        }
-     }
-   }
-   if (keys(%{$retdata}) == 0){
-    $retdata =();
-   }
-   $sth->finish();
-   $dbh->disconnect();
-   return $retdata;
-}
-
-sub dbquerysorted(){
-    my $self = shift;
-    my $stat = shift;
-    # my $vw_info = shift;
-    my $retdata;
-    my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1})  or return $retdata->{error} = "dbquery Connection Error!".$!;
-    #  $stat = encode("utf8", $stat);
-    # open FILE,">>tmp/sql.log";
-    # print FILE "\n==\n$stat\n==\n";
-    # close FILE;
-    my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquerysorted ".$dbh->errstr. "- SQL: ".$stat;;
-
-		
-   $sth->execute() or return $retdata->{error} = "dbquerysorted: ".$sth->errstr;
-   my $count = 0;
-
-   while(my $data = $sth->fetchrow_hashref())
-   {
-        #$retdata->{$count} = $data;
-				foreach my $k (keys %{$data}){
-          $retdata->{$count}->{$k} = decode("utf-8",$data->{$k});
-        }
-     $count++;
-   }
-	 
-#    my $qstruct = ();
-#    my $num_fields = $sth->{NUM_OF_FIELDS};
-
-#     for ( my $i=0; $i< $num_fields; $i++ ) {
-#         $qstruct->{$i}->{name} = $sth->{NAME}->[$i]; 
-#         #$qstruct->{$i}->{type} = $sth->{COMMENT}->[$i];
-#       	#$qstruct->{$i}->{precision} = $sth->{PRECISION}->[$i];
-#     }
-   
-   $sth->finish();
-   $dbh->disconnect();
-	 
-   return $retdata;
-}
-
-sub dbexec(){
-    my $self = shift;
-    my $stat = shift;
-    my $retdata;
-    my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1})  or return $retdata->{error} =  "dbquery Connection Error!".$!;
-    #  $stat = decode("UTF-8", $stat);
-    # open FILE,">>tmp/sql.log";
-    # print FILE "\n==\n$stat\n==\n";
-    # close FILE;
-    my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbexec ".$dbh->errstr. "- SQL: ".$stat;;
-   $retdata->{success}  = $dbh->do($stat) or return $retdata->{error} = "dbexec ".$dbh->errstr. "- SQL: ".$stat;
-   $dbh->disconnect();
-   return $retdata;
-}
-
-sub dbqueryarray(){
-   my $self = shift;
-   my $stat = shift;
-   my @retdata = ();
-    my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1})  or return ({"error" => "dbqueryarray Connection Error!".$!});
-   #$stat = encode("utf8", $stat);
-   #open FILE,">>/tmp/sql.log";
-   #print  "$stat\n";
-   # close FILE;
-   my $sth = $dbh->prepare($stat);
-
-  $sth->execute() or print "dbqueryarray: ".$sth->errstr;
-  my $count = 0;
-  
-  while(my $data = $sth->fetchrow_hashref())
-  {
-  	my $row = ();
-		foreach my $k (keys %{$data}){
-      $row->{$k} = decode("utf-8",$data->{$k});
-    }
-		push @retdata,$row;
-  }
-
-  $sth->finish();
-  $dbh->disconnect();
-  #%retdata = sort {$a <=> $b} keys %retdata;
-  return \@retdata;
-}
-
-
-sub create_ddl_insert(){
-	my $self = shift;
-	my $data = shift;
-	my $fields = ();
-	my @ddl = ();
-
-	foreach my $f (keys(%{$data})){
-		 	if (($f =~ /\_/) && ($f !~ /^ident_/)){
-		 		my $t = substr($f,0,index($f,"_"));
-		 		my $c = substr($f,length($t)+1);
-		 		#my ($t,$c) = $f =~ m/(.+)\_(.+)/;
-		 		$fields->{$t}->{$c} = $data->{$f};
-		 	} elsif ($f =~ /^ident_/){
-        my $f2 = $f; 
-        $f2 =~ s/^ident_//;
-
-        my $t = substr($f2,0,index($f2,"_"));
-		 		my $c = substr($f2,length($t)+1);
-		 		$fields->{$t}->{$c} = $data->{$f};     
-      }
-
-		 }
-
-	foreach my $tb (keys(%{$fields})){
-		my @sqlcol = ();
-		my @sqlval = ();
-		foreach my $c (keys(%{$fields->{$tb}})){
-			my $v = $fields->{$tb}->{$c};
-			$v =~ s/'/''/g;
-			push (@sqlcol,$c);
-			if ($v eq ''){
-				$v = 'null';
-			} else {
-				$v = "'".$v."'";
-			}
-			push (@sqlval,$v);
-		}
-		push(@ddl,"INSERT INTO public.".$tb." (".join(",",@sqlcol).") VALUES (".join(",",@sqlval).") returning id;");
-	}
-	return @ddl;
-}
-
-sub create_ddl_insert_json(){
-	my $self = shift;
-	my $schema = shift;
-	my $table = shift;
-	my $columns = shift;
-	my $data = shift;
-	my @ddl = ();
-	my @sqlcol = ();
-	my @sqlval = ();
-	foreach my $c (keys(%{$data})){
-		#if (exists($columns->{$c})){
-			push (@sqlcol,'"'.$c.'"');
-			my $v = $data->{$c};
-			
-			if ($v eq ''){
-				$v = 'null';
-			}elsif ($v =~ /^data:.+;base64,/){
-				$v =~ s/'/''/g;
-				$v = "'".$v."'";
-			} 
-			else {
-				$v= uri_decode($v);
-				$v =~ s/'/''/g;
-				if ($columns->{$c}->{data_type} eq "ARRAY"){
-					if (ref($data->{$c}) eq "ARRAY"){
-						$v = "{\"".join("\",\"",@{$data->{$c}})."\"}";	
-					}
-					else {
-						$v = 'null';	
-					}
-					$v =~ s/""/null/g;	
-				}elsif ($columns->{$c}->{data_type} =~ /^timestamp/ ){
-					
-				}elsif($columns->{$c}->{data_type} eq "date"){
-					
-				}elsif($columns->{$c}->{data_type} eq "time"){
-					
-				}
-				$v = "'".$v."'";
-			}			
-		push (@sqlval,$v);
-		#}			
-	}
-	return "INSERT INTO public.".$schema.".\"".$table."\" (".join(",",@sqlcol).") VALUES (".join(",",@sqlval).");";
-}
-
-sub create_ddl_update(){
-	my $self = shift;
-	my $data = shift;
-	my $fields = ();
-	my @ddl = ();
-	foreach my $f (keys(%{$data})){
-		 	if ($f =~ /^ident_/){
-		 		my $fx = substr($f,6);
-		 		my $t = substr($fx,0,index($fx,"_"));
-		 		my $c = substr($fx,length($t)+1);
-		 		#my ($t,$c) = $f =~ m/^ident_(.+)\_([a-z0-9|\_]+)/;
-		 		$fields->{$t}->{cond}->{$c} = $data->{$f};
-		 	} elsif ( ($f !~ /^ident/) && ($f =~ /.+\_.+/) ){
-		 		my $t = substr($f,0,index($f,"_"));
-		 		my $c = substr($f,length($t)+1);
-		 		#my ($t,$c) = $f =~ m/^(.+)\_([a-z0-9|\_]+)/;
-		 		$fields->{$t}->{fields}->{$c} = $data->{$f};
-		 	}
-		 }
-	foreach my $tb (keys(%{$fields})){
-		my @sqlupd = ();
-		my @sqlcond = ();
-			foreach my $c (keys(%{$fields->{$tb}->{fields}})){
-				
-				my $v = $fields->{$tb}->{fields}->{$c};
-				$v =~ s/'/''/g;
-				
-        if ($c =~ /-/){
-          my @jp = split('-',$c);
-          if ($v eq ''){
-					  $v = 'null';
-				  } else {
-					  $v = '"'.$v.'"';
-				  }
-          $c = 'jsonb_set(to_jsonb('.$jp[0].'),\'{"'.$jp[1].'"}\',\''.$v.'\')::json';
-          push (@sqlupd,$jp[0]."=".$c);  
-        }else {
-          if ($v eq ''){
-					  $v = 'null';
-				  } else {
-					  $v = "'".$v."'";
-				  }
-          push (@sqlupd,$c."=".$v);
-        }
-				
-			}
-			foreach my $c (keys(%{$fields->{$tb}->{cond}})){
-				my $v = $fields->{$tb}->{cond}->{$c};
-				$v =~ s/'/''/g;
-				if ($v eq ''){
-					$v = 'null';
-				} else {
-					$v = "'".$v."'";
-				}
-				push (@sqlcond,$c."=".$v);
-			}
-		push(@ddl,"UPDATE public.".$tb." SET ".join(",",@sqlupd)." WHERE ".join(" AND ",@sqlcond).";");
-	} 
-	
-	return @ddl; 
-}
-
-sub create_cnt_statement(){
-	my $self = shift;
-	my $data = shift;
-	my $fields = ();
-	my @ddl = ();
-	foreach my $f (keys(%{$data})){
-		 	if ($f =~ /^ident_/){
-		 		my $fx = substr($f,6);
-		 		my $t = substr($fx,0,index($fx,"_"));
-		 		my $c = substr($fx,length($t)+1);
-		 		#my ($t,$c) = $f =~ m/^ident_(.+)\_([a-z0-9|\_]+)/;
-		 		$fields->{$t}->{cond}->{$c} = $data->{$f};
-		 	} 
-		 }
-	foreach my $tb (keys(%{$fields})){
-		my @sqlcond = ();
-			foreach my $c (keys(%{$fields->{$tb}->{cond}})){
-				my $v = $fields->{$tb}->{cond}->{$c};
-				$v =~ s/'/''/g;
-				if ($v eq ''){
-					$v = 'null';
-				} else {
-					$v = "'".$v."'";
-				}
-				push (@sqlcond,$c."=".$v);
-			}
-		push(@ddl,"SELECT count(*) as cnt from ".$tb." WHERE ".join(" AND ",@sqlcond).";");
-	} 
-	# open FILE,">>tmp/sql.log";
-  #   print FILE "\n==\n".join("\n",@ddl)."\n==\n";
-  #   close FILE;
-	return @ddl; 
-}
-
-sub create_ddl_delete(){
-	my $self = shift;
-	my $data = shift;
-	my $fields = ();
-	my @ddl = ();
-	my @refcols = ();
-	my $refdata = ();
-	foreach my $f (keys(%{$data})){
-		 	if ($f =~ /^ident_/){
-		 		my ($t,$c) = $f =~ m/ident_(.+)\_(.+)/;
-		 		
-		 		$fields->{$t}->{cond}->{$c} = $data->{$f};
-		 		push(@refcols,"'".$c.'_'.$t."'");
-		 		$refdata->{$c.'_'.$t} = $data->{$f};
-		 	} 
-		 }
-	
-# 	my $ref = $self->dbquerysorted("select TABLE_NAME,COLUMN_NAME from information_schema.KEY_COLUMN_USAGE where COLUMN_NAME in (".join(",",@refcols).") and CONSTRAINT_SCHEMA='".$self->{dbname}."';");
-# 	foreach my $r (keys(%{$ref})){
-# 		my $refv = $refdata->{$ref->{$r}->{COLUMN_NAME}};
-# 		if ($refv eq ''){
-# 			$refv = ' is null';
-# 		} else {
-# 			$refv =~ s/'/''/g;
-# 			$refv = "='".$refv."'";
-# 		}
-# 		push(@ddl,"DELETE from ".$ref->{$r}->{TABLE_NAME}." where ".$ref->{$r}->{COLUMN_NAME}.$refv.";");
-# 	}
-	foreach my $tb (keys(%{$fields})){
-		my @sqlcond = ();
-		foreach my $c (keys(%{$fields->{$tb}->{cond}})){
-			my $v = $fields->{$tb}->{cond}->{$c};
-			$v =~ s/'/''/g;
-			push (@sqlcond,$c."='".$v."'");
-		}
-		push(@ddl,"DELETE FROM public.".$tb." WHERE ".join(" AND ",@sqlcond).";");
-	} 
-	return @ddl;
-}
-
-sub textunidecode(){
-  my $self = shift;
-  my $text = shift;
-  $text = lc(unidecode(decode("utf-8",$text)));
-  $text =~ s/^[a-z0-9]//g;
-  return $text;
-} 
-
-1;
diff --git a/app/lib/dkssavefile.pm b/app/lib/dkssavefile.pm
deleted file mode 100644
index 55c260f..0000000
--- a/app/lib/dkssavefile.pm
+++ /dev/null
@@ -1,49 +0,0 @@
-package dkssavefile;
-
-
-use strict;
-use lib ('./lib/perl5');
-use lib ('./lib');
-use lib ('./');
-use MIME::Base64;
-use MIME::Types;
-use URI;
-use Data::Dumper;
-use File::Path qw(make_path);
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-    return $self;
-}
-
-sub saveb64toFile(){
-  my $self = shift;
-  # my $fd = shift;
-  my $filename = shift;
-  my $sitepath = shift;
-  my $filepath = shift;
-  my $data = shift;
-  my $ds = URI->new($data);
-  my $mimetype= $ds->media_type();
-  my $mt = MIME::Types->new();
-  my $sfx = $mt->type($mimetype);
-  my $ext = $sfx->{MT_extensions};
-  my $nfsfx = "";
-  if (scalar(@$ext) > 0){
-     $nfsfx = @$ext[0];
-  }
-  if (! -d $sitepath.'/'.$filepath){
-    make_path($sitepath.'/'.$filepath);
-  }
-  open (NF,">".$sitepath.'/'.$filepath.'/'.$filename.'.'.$nfsfx);
-  binmode(1);
-  print NF $ds->data();
-  close(NF);
-  if (-e $sitepath.'/'.$filepath.'/'.$filename.'.'.$nfsfx){
-    return $filepath.'/'.$filename.'.'.$nfsfx;
-  } 
-  return "";
-}
-
-1;
\ No newline at end of file
diff --git a/app/lib/parsexlsx.pm b/app/lib/parsexlsx.pm
deleted file mode 100644
index e5fab2d..0000000
--- a/app/lib/parsexlsx.pm
+++ /dev/null
@@ -1,60 +0,0 @@
-package parsexlsx;
-
-use strict;
-use lib ('./lib/perl5');
-use lib ('./lib');
-use lib ('./');
-use Data::Dumper;
-use File::Basename qw/dirname basename/;
-use Spreadsheet::XLSX;
-use Encode;
-use dksdb;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-
-    return $self;
-}
-
-sub sheetdata(){
-  my $self = shift;
-  my $xlsxfile = shift;
-  my $sheetname = shift;
-  my @sheetdata = ();
-  my $excel = Spreadsheet::XLSX -> new ($xlsxfile);
-  foreach my $sheet (@{$excel -> {Worksheet}}) {
-    #print $sheet->{Name}."\n";
-    if (lc($sheet->{Name}) eq lc($sheetname)){
-      $sheet -> {MaxRow} ||= $sheet -> {MinRow};
-      foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) {
-        $sheet -> {MaxCol} ||= $sheet -> {MinCol};
-        my $rowdata = ();       
-        foreach my $col ($sheet -> {MinCol} ..  $sheet -> {MaxCol}) {
-          my $cell = $sheet -> {Cells} [$row] [$col];
-          
-          if ($cell) {
-            
-            $rowdata->{$col} = decode("utf-8",$cell->{Val});
-          }
-        }
-        #print Dumper($rowdata);
-        push @sheetdata,$rowdata;
-      }
-    }
-  }
-  return @sheetdata;
-}
-
-sub sheets(){
-  my $self = shift;
-  my $xlsxfile = shift;
-  my @sheetnames = ();
-  my $excel = Spreadsheet::XLSX -> new ($xlsxfile);
-  foreach my $sheet (@{$excel -> {Worksheet}}) {
-    push(@sheetnames,$sheet->{Name});
-  }
-  return @sheetnames;
-}
-
-1;
\ No newline at end of file
diff --git a/app/lib/sendemail.pm b/app/lib/sendemail.pm
deleted file mode 100644
index 0ea951f..0000000
--- a/app/lib/sendemail.pm
+++ /dev/null
@@ -1,130 +0,0 @@
-package sendemail;
-
-use strict;
-use lib ('./lib/perl5');
-use lib ('./lib');
-use lib ('./');
-use Data::Dumper;
-use File::Basename qw/dirname basename/;
-use dksdb;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-    $self->{server} = "mail.your-server.de";
-    $self->{port} = "587";
-    $self->{user} = 'kilian.saffran@fld.lu';
-    $self->{password} = "Y6cWvXR6D2";
-    $self->{from} = 'webmaster@fld.lu';
-    return $self;
-}
-
-sub sendemail(){
-  my $self = shift;
-  my $template = shift;
-  my $iduser = shift;
-  my $sendto = shift;
-  my $data = shift;
-  my $attach = shift;
-  my $body = "";
-  my $subject = "";
-  my $maildata = ();
-  my $db = dksdb->new();
-  my $send = -1;
-  my $tmpl = $db->dbquerysorted("select *,ml.mailtemplate from mailtemplates mt join maillayouts ml on (mt.id_maillayout=ml.id) where templatename='".$template."';");
-  if (keys(%{$tmpl}) > 0){
-    $tmpl = $tmpl->{0};
-  }
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG $ENV{SCRIPT_FILENAME};
-  # print LOG "SEND EMAIL:".Dumper($data)."\n";
-  # close(LOG);
-  my $datasql = $tmpl->{'emaildatasql'};
-  $data->{id} = $iduser;
-  foreach my $key (keys(%{$data})){
-    my $srch = '%%'.lc($key).'%%';
-    my $repl = $data->{$key};
-    $datasql =~ s/$srch/$repl/g;
-  }
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG "TEMPLATE DATA:".$datasql."\n";
-  # close(LOG);
-  $maildata = $db->dbquerysorted($datasql);
-  
-  $body = $tmpl->{'emailtext'};
-  $subject = $tmpl->{'mailsubject'};
-  foreach my $key (keys(%{$maildata->{0}})){
-    $data->{$key} = $maildata->{0}->{$key};   
-  }
-  foreach my $key (keys(%{$data})){
-    my $srch = '%%'.lc($key).'%%';
-    my $repl = $data->{$key};
-    $body =~ s/$srch/$repl/g;
-    $subject =~ s/$srch/$repl/g;
-  }
-  my $bodytmpl = $tmpl->{mailtemplate};
-  $bodytmpl =~ s/%%BODYCONTENT%%/$body/;
-  my $siteurl = $ENV{'REQUEST_SCHEME'}.'://'.$ENV{"HTTP_HOST"};
-  $bodytmpl =~ s/%%siteurl%%/$siteurl/g;
-  $bodytmpl =~ s/%%SITEURL%%/$siteurl/g;
-  $bodytmpl =~ s/\r//g;
-  #$bodytmpl =~ s/"/\\\"/g;
-  #PROD REPLACE all not replaced DATA       
-  #$bodytmpl =~ s/%%\w+%%//g;
-  #$sendto = 'ksaffran@dks.lu';
-  # open (LOG,">>tmp/sendmail.log");
-  # print LOG "SUBJECT:".$subject."\n";
-  # print LOG "BODY TEXT:".$bodytmpl."\n";
-  # close(LOG);
-  if (($bodytmpl ne "") && ($subject ne "") && ($sendto =~ /.+\@.+\..+/)){
-
-    
-    my $binsemail = dirname($ENV{'SCRIPT_FILENAME'}).'/sendEmail';
-    my $f = dirname($ENV{SCRIPT_FILENAME}).'/tmp/mailbody_'.$sendto.'.txt';
-    $f =~ s/\@/_/g;
-    if (! -e  $binsemail){
-      $binsemail = dirname($ENV{'SCRIPT_FILENAME'}).'/api/sendEmail';
-      $f = dirname($ENV{SCRIPT_FILENAME}).'/api/tmp/mailbody_'.$sendto.'.txt';
-    $f =~ s/\@/_/g;
-      if (! -e $binsemail){
-        return 256;
-      }
-    }
-    
-    my $cmd= 'perl "'.$binsemail.'" -f '.$tmpl->{mailfrom}.' ';
-    $cmd .= ' -s "'.$self->{server}.':'.$self->{port}.'" -xu "'.$self->{user}.'" -xp "'.$self->{password}.'" -q ';
-    $cmd .= '-o tls=auto ';
-    $cmd .= '-o message-content-type=html ';
-    $cmd .= '-o message-charset=ISO-8859-1 ';
-    $cmd .= '-o message-file='.$f.' ';
-    $cmd .= '-t "'.$sendto.'" ';
-    $cmd .= '-u "'.$subject.'" ';
-  #    open (LOG,">>sendmail.log");
-  #  print LOG $cmd."\n";
-  # # print LOG "BODY TEXT:".$bodytmpl."\n";
-  #  close(LOG);
-    open(EML,">".$f);
-    print EML $bodytmpl;
-    close(EML);
-    # $cmd .= '-m "'.$bodytmpl.'" ';
-    if ($attach != undef){
-      $cmd .= " -a";
-      
-      foreach my $a (@{$attach}){
-        $cmd .= " ".$a." ";
-      }
-    }
-    # open (LOG,">>tmp/sendmail.log");
-    # print LOG "SEND EMAIL CMD:".$cmd."\n";
-    # close(LOG);
-    # $cmd =~ s/'/''/g; 
-    $send = system($cmd);
-    # open (LOG,">>tmp/sendmail.log");
-    # print LOG "CMD RETURN NUM:".$send."\n";
-    # close(LOG);
-    unlink($f);
-  }    
-  return $send;
-}
-
-1;
\ No newline at end of file
diff --git a/app/lib/session.pm b/app/lib/session.pm
deleted file mode 100644
index 9392753..0000000
--- a/app/lib/session.pm
+++ /dev/null
@@ -1,237 +0,0 @@
-package session;
-
-use strict;
-use FindBin qw($RealBin);
-use lib ($RealBin.'/backoffice/');
-use lib ($RealBin.'/backoffice/lib/');
-use lib ('./lib/perl5');
-use lib ('./lib');
-
-use lib ('./');
-use File::Basename;
-use Digest::SHA qw(sha256_hex);
-
-use dksdb;
-use sendemail;
-# use Data::Dumper;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, $class;
-    $self->{db} = dksdb->new();
-    return $self;
-}
-
-sub checklogin(){
-  my $self = shift;
-  my $login = shift;
-  my $password = shift;
-  # open FILE,">>tmp/sql.log";
-  # print FILE "pwd: $password\n";
-  # close(FILE);
-  my $pwd = sha256_hex($password);
-  my $ret->{messagetype} ='red';
-  # my $newsid = undef;
-  $login = lc($login);
-  $login =~ s/^\s+//;
-  $login =~ s/\s+$//;
-
-  $ret->{message} = "Passwuert oder Login onbekannt!";
-  $ret->{messagetype} = "red";
-  $ret->{sid} = undef;
-  $ret->{sid} = undef;
-  my $siddata = $self->{db}->querysorted("select * from checklogin('".$self->{db}->securetext($login)."','".$pwd."','".$ENV{REMOTE_ADDR}."','".$ENV{HTTP_USER_AGENT}."');");
- 
-  if (keys(%{$siddata}) > 0){
-  #    open FILE,">>tmp/sql.log";
-  #  print FILE Dumper($siddata);
-  #  close(FILE);
-    $ret->{sid} = $siddata->{0}->{checklogin};
-  }
-  return $ret;
-}
-
-sub savepassword(){
-  my $self = shift;
-  my $iduser = shift;
-  my $newpwd = shift;
-  my $pwd = sha256_hex($newpwd);
-  $self->{db}->dbexec("UPDATE users SET userpassword = '".$pwd."' WHERE id=".$iduser.";");
-  return 1;
-}
-
-sub passwordforgotten(){
-  my $self = shift;
-  my $email = shift;
-  $email =~ s/^\s+//;
-  $email =~ s/\s+$//;
-  my $ret->{messagetype} ='red';
-  $ret->{message} = "Onbekannt E-mail!";
-  my $sql = "select id,userpassword from users where username='".$self->{db}->securetext($email)."';";
-  my $ex = $self->{db}->dbquerysorted($sql);
-  if (keys(%{$ex}) > 0){
-    my $newpwd = $self->randomstring(12);
-    my $pwd = sha256_hex($newpwd);
-    $self->{db}->dbexec("UPDATE users SET userpassword = '".$pwd."' WHERE id=".$ex->{0}->{id}.";");
-    my $data->{newpassword} = $newpwd; 
-    my $eml = sendemail->new();
-    my $mret = $eml->sendemail('user_forgotpasswd',$ex->{0}->{id},$email,$data,undef);
-    if ($mret != 0){
-      $ret->{messagetype} ='red';
-      $ret->{message} = "Den Moment ass et leider nët méglech d'Passwuert autmatesch zreckzesetzen, 
wend dech w.e.g. via E-Mail un webmaster\@fld.lu!"; - return $ret; - } - $ret->{message} = "Mir hun dir eng E-Mail, matt engem neien Passwuert gescheckt!"; - $ret->{messagetype} = "green"; - } - return $ret; -} - -# sub registeruser(){ -# my $self = shift; -# my $data = shift; -# my $ret->{messagetype} ='red'; -# $ret->{message} = "Een Fehler ass passéiert, probéier et spéier nach eemol!"; -# $ret->{page} = "message.tt"; -# if (!exists($data->{license}) || !exists($data->{regcode}) || !exists($data->{email}) || !exists($data->{terms})){ -# $ret->{message} = "W.e.g. All Felder ausfëllen!"; -# $ret->{page} = "register.tt"; -# return $ret; -# } -# foreach my $d (%{$data}){ -# $data->{$d} = $self->{db}->securetext($data->{$d}); -# } - -# my $user = $self->{db}->dbquerysorted("select id from users where username='".$data->{email}."';"); -# if (keys(%{$user}) > 0){ -# $ret->{page} = "register.tt"; -# $ret->{message} = "Een Benotzer matt der selwechter E-Mail existéiert schon!"; -# return $ret; -# } -# my $license = $self->{db}->dbquerysorted("select us.id as id_user,lic.license,mb.id as id_member,us.username,us.vcode,us.regcode from members mb join licenses lic on (lic.id_member=mb.id) join users us on (mb.id_user=us.id) where us.regcode='".$data->{regcode}."' and lic.license='".$data->{license}."' limit 1"); -# if (keys(%{$license}) == 0){ -# $ret->{message} = "Falsch Lizenz-Nummer oder falschen Régistréierungs-Code!"; -# return $ret; -# } -# my $regcode = $license->{0}->{regcode}; -# my $newcode = $self->randomstring(6); -# #my $usergroup = $self->{db}->dbquerysorted("select id from usergroups where usergroup ='avocat';"); -# my $newuserid = $self->{db}->dbquerysorted("UPDATE users set username='".$data->{email}."',vcode='".$newcode."' where id=".$license->{0}->{id_user}." ;"); -# my $maildata->{vcode} = $newcode; -# my $eml = sendemail->new(); -# my $mret = $eml->sendemail('user_verification',$license->{0}->{id_user},$data->{email},$maildata,undef); -# if ($mret == 0){ -# $ret->{message} = "Merci,
Mir hun dir elo eng E-Mail gescheckt, matt engem Code fir deng E-Mail ze verifizéieren!
Gëff desen Code w.e.g. an daat Feld hei drënner an!
Bei Problemer wend dech w.e.g. via E-Mail un webmaster\@fld.lu"; -# $ret->{messagetype} = "green"; -# $ret->{page} = "validationcode.tt"; -# } else { -# $self->{db}->dbexec("UPDATE users set username='".$data->{email}."',vcode=null where id=".$license->{0}->{id_user}." ;"); -# $ret->{message} = "Aus iergend engem Grond konnten mir dir keng E-Mail un '".$data->{email}."' schecken! Falls dess E-Mail-Address net existéiert, versich et nach eng Kéier matt enger E-Mail-Address, déi existéiert!
Bei Problemer wend dech w.e.g. via E-Mail un webmaster\@fld.lu"; -# $ret->{messagetype} = "red"; -# $ret->{page} = "register.tt"; -# } -# #$self->{db}->dbexec("insert into appaccess (id_user) values (".$newuserid->{0}->{id}.");"); -# # $ret->{messagetype} = "green"; - -# return $ret; -# } - -# sub validateaccount(){ -# my $self = shift; -# my $data = shift; -# foreach my $d (%{$data}){ -# $data->{$d} = $self->{db}->securetext($data->{$d}); -# } - -# my $ret->{messagetype} ='red'; -# my $vcodedata = $self->{db}->dbquerysorted("select id,vcode,username from users where vcode='".$data->{vcode}."';"); -# if (keys(%{$vcodedata}) == 0){ -# $ret->{message} = "Benotzer onbekannt oder Code falsch!"; -# $ret->{page} = "validationcode.tt"; -# } -# my $newpwd = $self->randomstring(12); -# my $pwd = sha256_hex($newpwd); -# my $maildata->{password} = $newpwd; -# my $eml = sendemail->new(); -# my $newuserid = $self->{db}->dbquerysorted("UPDATE users set userpassword='".$pwd."',vcode=null,regcode=null where id=".$vcodedata->{0}->{id}." returning id,username;"); -# my $mret = $eml->sendemail('user_registration',$vcodedata->{0}->{id},$vcodedata->{0}->{username},$maildata,undef); -# if ($mret == 0){ -# $ret->{message} = "Merci,
Mir hun dir elo eng E-Mail gescheckt, matt all deenen néidegen Donnéeen fir dech anzeloggen!
Bei Problemer wend dech w.e.g. via E-Mail un webmaster\@fld.lu"; -# $ret->{messagetype} = "green"; -# $ret->{page} = "message.tt"; -# } else { -# $ret->{message} = "Aus iergend engem Grond konnten mir dir keng E-Mail un '".$newuserid->{0}->{username}."' schecken! Falls dess E-Mail-Address net existéiert, versich et nach eng Kéier matt enger E-Mail-Address, déi existéiert!
Bei Problemer wend dech w.e.g. via E-Mail un webmaster\@fld.lu"; -# $ret->{page} = "message.tt"; -# } -# return $ret; -# } - -sub getsession($){ - my $self = shift; - my $sid = shift; - my $sql ="select * from public.getsession('".$self->{db}->securetext($sid)."','".$ENV{REMOTE_ADDR}."','".$ENV{HTTP_USER_AGENT}."');"; - my $res= $self->{db}->querysorted($sql); - my $ret = undef; - # open FILE,">>tmp/sql.log"; - # print FILE "GET DB Session\n"; - # print FILE Dumper($res->{0}); - # close(FILE); - if (keys(%{$res}) > 0){ - - return $res->{0}; - } - return $ret; -} - -sub deletesession(){ - my $self = shift; - my $sid = shift; - $self->{db}->dbexec("UPDATE sessions set idsession= 'LO-' || idsession where idsession='".$self->{db}->securetext($sid)."';"); -} - -# sub randomstring(){ -# my $self = shift; -# my $num = shift; -# my @alphanumeric = ('a'..'z', 'A'..'Z', 0..9); -# my $randstring = join '', map $alphanumeric[rand @alphanumeric], 0..$num; -# return $randstring; -# } - - -# sub deleteprofile(){ -# my $self = shift; -# my $data = shift; -# my $ret->{message} = "mot de passe ou profile inconnue!"; -# $ret->{messagetype} = "danger"; -# if ($data->{id_user} eq ''){ -# $ret->{sid} = undef; -# return $ret; -# } -# my $pwd = sha256_hex($data->{password}); -# my $user = $self->{db}->dbquerysorted("select id from users where id= '".$data->{id_user}."' and userpassword = '".$pwd."';"); -# if (keys(%{$user}) > 0){ -# $self->admindeleteuser($data->{id_user}); -# my $ret->{'message'} = "Votre profile a été supprimé!"; -# $ret->{'messagetype'} = "info"; -# $ret->{sid} = undef; -# } -# return $ret; - -# } - -# sub admindeleteuser(){ -# my $self = shift; -# my $id_user = shift; -# my @dl = ("DELETE FROM public.useringroups WHERE id_uset=".$id_user.";", -# "DELETE FROM public.userclients WHERE id_user=".$id_user.";", -# "DELETE FROM public.appaccess WHERE id_user=".$id_user.";", -# "DELETE FROM public.modulepreferences WHERE id_user=".$id_user.";",, -# "DELETE FROM public.sessions WHERE id_user=".$id_user.";", -# "delete from users where id=".$id_user.";"); -# foreach my $s (@dl){ -# $self->{db}->dbexec($s); -# } -# return 1; -# } - -1; \ No newline at end of file diff --git a/app/sendEmail b/app/sendEmail deleted file mode 100644 index c639439..0000000 --- a/app/sendEmail +++ /dev/null @@ -1,2235 +0,0 @@ -#!/usr/bin/perl -w -############################################################################## -## sendEmail -## Written by: Brandon Zehm -## -## License: -## sendEmail (hereafter referred to as "program") is free software; -## you can redistribute it and/or modify it under the terms of the GNU General -## Public License as published by the Free Software Foundation; either version -## 2 of the License, or (at your option) any later version. -## When redistributing modified versions of this source code it is recommended -## that that this disclaimer and the above coder's names are included in the -## modified code. -## -## Disclaimer: -## This program is provided with no warranty of any kind, either expressed or -## implied. It is the responsibility of the user (you) to fully research and -## comprehend the usage of this program. As with any tool, it can be misused, -## either intentionally (you're a vandal) or unintentionally (you're a moron). -## THE AUTHOR(S) IS(ARE) NOT RESPONSIBLE FOR ANYTHING YOU DO WITH THIS PROGRAM -## or anything that happens because of your use (or misuse) of this program, -## including but not limited to anything you, your lawyers, or anyone else -## can dream up. And now, a relevant quote directly from the GPL: -## -## NO WARRANTY -## -## 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -## FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -## OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -## PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -## OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -## TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -## PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -## REPAIR OR CORRECTION. -## -############################################################################## -use strict; -use IO::Socket; - - -######################## -## Global Variables ## -######################## - -my %conf = ( - ## General - "programName" => $0, ## The name of this program - "version" => '1.56', ## The version of this program - "authorName" => 'Brandon Zehm', ## Author's Name - "authorEmail" => 'caspian@dotconf.net', ## Author's Email Address - "timezone" => '+0000', ## We always use +0000 for the time zone - "hostname" => 'changeme', ## Used in printmsg() for all output (is updated later in the script). - "debug" => 0, ## Default debug level - "error" => '', ## Error messages will often be stored here - - ## Logging - "stdout" => 1, - "logging" => 0, ## If this is true the printmsg function prints to the log file - "logFile" => '', ## If this is specified (form the command line via -l) this file will be used for logging. - - ## Network - "server" => 'localhost', ## Default SMTP server - "port" => 25, ## Default port - "bindaddr" => '', ## Default local bind address - "alarm" => '', ## Default timeout for connects and reads, this gets set from $opt{'timeout'} - "tls_client" => 0, ## If TLS is supported by the client (us) - "tls_server" => 0, ## If TLS is supported by the remote SMTP server - - ## Email - "delimiter" => "----MIME delimiter for sendEmail-" ## MIME Delimiter - . rand(1000000), ## Add some randomness to the delimiter - "Message-ID" => rand(1000000) . "-sendEmail", ## Message-ID for email header - -); - - -## This hash stores the options passed on the command line via the -o option. -my %opt = ( - ## Addressing - "reply-to" => '', ## Reply-To field - - ## Message - "message-file" => '', ## File to read message body from - "message-header" => '', ## Additional email header line(s) - "message-format" => 'normal', ## If "raw" is specified the message is sent unmodified - "message-charset" => 'iso-8859-1', ## Message character-set - "message-content-type" => 'auto', ## auto, text, html or an actual string to put into the content-type header. - - ## Network - "timeout" => 60, ## Default timeout for connects and reads, this is copied to $conf{'alarm'} later. - "fqdn" => 'changeme', ## FQDN of this machine, used during SMTP communication (is updated later in the script). - - ## eSMTP - "username" => '', ## Username used in SMTP Auth - "password" => '', ## Password used in SMTP Auth - "tls" => 'auto', ## Enable or disable TLS support. Options: auto, yes, no - -); - -## More variables used later in the program -my $SERVER; -my $CRLF = "\015\012"; -my $subject = ''; -my $header = ''; -my $message = ''; -my $from = ''; -my @to = (); -my @cc = (); -my @bcc = (); -my @attachments = (); -my @attachments_names = (); - -## For printing colors to the console -my ${colorRed} = "\033[31;1m"; -my ${colorGreen} = "\033[32;1m"; -my ${colorCyan} = "\033[36;1m"; -my ${colorWhite} = "\033[37;1m"; -my ${colorNormal} = "\033[m"; -my ${colorBold} = "\033[1m"; -my ${colorNoBold} = "\033[0m"; - -## Don't use shell escape codes on Windows systems -if ($^O =~ /win/i) { - ${colorRed} = ${colorGreen} = ${colorCyan} = ${colorWhite} = ${colorNormal} = ${colorBold} = ${colorNoBold} = ""; -} - -## Load IO::Socket::SSL if it's available -eval { require IO::Socket::SSL; }; -if ($@) { $conf{'tls_client'} = 0; } -else { $conf{'tls_client'} = 1; } - - - - - - -############################# -## ## -## FUNCTIONS ## -## ## -############################# - - - - - -############################################################################################### -## Function: initialize () -## -## Does all the script startup jibberish. -## -############################################################################################### -sub initialize { - - ## Set STDOUT to flush immediatly after each print - $| = 1; - - ## Intercept signals - $SIG{'QUIT'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - $SIG{'INT'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - $SIG{'KILL'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - $SIG{'TERM'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - - ## ALARM and HUP signals are not supported in Win32 - unless ($^O =~ /win/i) { - $SIG{'HUP'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - $SIG{'ALRM'} = sub { quit("EXITING: Received SIG$_[0]", 1); }; - } - - ## Fixup $conf{'programName'} - $conf{'programName'} =~ s/(.)*[\/,\\]//; - $0 = $conf{'programName'} . " " . join(" ", @ARGV); - - ## Fixup $conf{'hostname'} and $opt{'fqdn'} - if ($opt{'fqdn'} eq 'changeme') { $opt{'fqdn'} = get_hostname(1); } - if ($conf{'hostname'} eq 'changeme') { $conf{'hostname'} = $opt{'fqdn'}; $conf{'hostname'} =~ s/\..*//; } - - return(1); -} - - - - - - - - - - - - - - - -############################################################################################### -## Function: processCommandLine () -## -## Processes command line storing important data in global vars (usually %conf) -## -############################################################################################### -sub processCommandLine { - - - ############################ - ## Process command line ## - ############################ - - my @ARGS = @ARGV; ## This is so later we can re-parse the command line args later if we need to - my $numargv = @ARGS; - help() unless ($numargv); - my $counter = 0; - - for ($counter = 0; $counter < $numargv; $counter++) { - - if ($ARGS[$counter] =~ /^-h$/i) { ## Help ## - help(); - } - - elsif ($ARGS[$counter] eq "") { ## Ignore null arguments - ## Do nothing - } - - elsif ($ARGS[$counter] =~ /^--help/) { ## Topical Help ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - helpTopic($ARGS[$counter]); - } - else { - help(); - } - } - - elsif ($ARGS[$counter] =~ /^-o$/i) { ## Options specified with -o ## - $counter++; - ## Loop through each option passed after the -o - while ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - - if ($ARGS[$counter] !~ /(\S+)=(\S.*)/) { - printmsg("WARNING => Name/Value pair [$ARGS[$counter]] is not properly formatted", 0); - printmsg("WARNING => Arguments proceeding -o should be in the form of \"name=value\"", 0); - } - else { - if (exists($opt{$1})) { - if ($1 eq 'message-header') { - $opt{$1} .= $2 . $CRLF; - } - else { - $opt{$1} = $2; - } - printmsg("DEBUG => Assigned \$opt{} key/value: $1 => $2", 3); - } - else { - printmsg("WARNING => Name/Value pair [$ARGS[$counter]] will be ignored: unknown key [$1]", 0); - printmsg("HINT => Try the --help option to find valid command line arguments", 1); - } - } - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-f$/) { ## From ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { $from = $ARGS[$counter]; } - else { printmsg("WARNING => The argument after -f was not an email address!", 0); $counter--; } - } - - elsif ($ARGS[$counter] =~ /^-t$/) { ## To ## - $counter++; - while ($ARGS[$counter] && ($ARGS[$counter] !~ /^-/)) { - if ($ARGS[$counter] =~ /[;,]/) { - push (@to, split(/[;,]/, $ARGS[$counter])); - } - else { - push (@to,$ARGS[$counter]); - } - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-cc$/) { ## Cc ## - $counter++; - while ($ARGS[$counter] && ($ARGS[$counter] !~ /^-/)) { - if ($ARGS[$counter] =~ /[;,]/) { - push (@cc, split(/[;,]/, $ARGS[$counter])); - } - else { - push (@cc,$ARGS[$counter]); - } - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-bcc$/) { ## Bcc ## - $counter++; - while ($ARGS[$counter] && ($ARGS[$counter] !~ /^-/)) { - if ($ARGS[$counter] =~ /[;,]/) { - push (@bcc, split(/[;,]/, $ARGS[$counter])); - } - else { - push (@bcc,$ARGS[$counter]); - } - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-m$/) { ## Message ## - $counter++; - $message = ""; - while ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - if ($message) { $message .= " "; } - $message .= $ARGS[$counter]; - $counter++; - } $counter--; - - ## Replace '\n' with $CRLF. - ## This allows newlines with messages sent on the command line - $message =~ s/\\n/$CRLF/g; - } - - elsif ($ARGS[$counter] =~ /^-u$/) { ## Subject ## - $counter++; - $subject = ""; - while ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - if ($subject) { $subject .= " "; } - $subject .= $ARGS[$counter]; - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-s$/) { ## Server ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - $conf{'server'} = $ARGS[$counter]; - if ($conf{'server'} =~ /:/) { ## Port ## - ($conf{'server'},$conf{'port'}) = split(":",$conf{'server'}); - } - } - else { printmsg("WARNING - The argument after -s was not the server!", 0); $counter--; } - } - - elsif ($ARGS[$counter] =~ /^-b$/) { ## Bind Address ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - $conf{'bindaddr'} = $ARGS[$counter]; - } - else { printmsg("WARNING - The argument after -b was not the bindaddr!", 0); $counter--; } - } - - elsif ($ARGS[$counter] =~ /^-a$/) { ## Attachments ## - $counter++; - while ($ARGS[$counter] && ($ARGS[$counter] !~ /^-/)) { - push (@attachments,$ARGS[$counter]); - $counter++; - } $counter--; - } - - elsif ($ARGS[$counter] =~ /^-xu$/) { ## AuthSMTP Username ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - $opt{'username'} = $ARGS[$counter]; - } - else { - printmsg("WARNING => The argument after -xu was not valid username!", 0); - $counter--; - } - } - - elsif ($ARGS[$counter] =~ /^-xp$/) { ## AuthSMTP Password ## - $counter++; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { - $opt{'password'} = $ARGS[$counter]; - } - else { - printmsg("WARNING => The argument after -xp was not valid password!", 0); - $counter--; - } - } - - elsif ($ARGS[$counter] =~ /^-l$/) { ## Logging ## - $counter++; - $conf{'logging'} = 1; - if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) { $conf{'logFile'} = $ARGS[$counter]; } - else { printmsg("WARNING - The argument after -l was not the log file!", 0); $counter--; } - } - - elsif ($ARGS[$counter] =~ s/^-v+//i) { ## Verbosity ## - my $tmp = (length($&) - 1); - $conf{'debug'} += $tmp; - } - - elsif ($ARGS[$counter] =~ /^-q$/) { ## Quiet ## - $conf{'stdout'} = 0; - } - - else { - printmsg("Error: \"$ARGS[$counter]\" is not a recognized option!", 0); - help(); - } - - } - - - - - - - - - ################################################### - ## Verify required variables are set correctly ## - ################################################### - - ## Make sure we have something in $conf{hostname} and $opt{fqdn} - if ($opt{'fqdn'} =~ /\./) { - $conf{'hostname'} = $opt{'fqdn'}; - $conf{'hostname'} =~ s/\..*//; - } - - if (!$conf{'server'}) { $conf{'server'} = 'localhost'; } - if (!$conf{'port'}) { $conf{'port'} = 25; } - if (!$from) { - quit("ERROR => You must specify a 'from' field! Try --help.", 1); - } - if ( ((scalar(@to)) + (scalar(@cc)) + (scalar(@bcc))) <= 0) { - quit("ERROR => You must specify at least one recipient via -t, -cc, or -bcc", 1); - } - - ## Make sure email addresses look OK. - foreach my $addr (@to, @cc, @bcc, $from, $opt{'reply-to'}) { - if ($addr) { - if (!returnAddressParts($addr)) { - printmsg("ERROR => Can't use improperly formatted email address: $addr", 0); - printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1); - quit("", 1); - } - } - } - - ## Make sure all attachments exist. - foreach my $file (@attachments) { - if ( (! -f $file) or (! -r $file) ) { - printmsg("ERROR => The attachment [$file] doesn't exist!", 0); - printmsg("HINT => Try specifying the full path to the file or reading extended help with \"--help message\"", 1); - quit("", 1); - } - } - - if ($conf{'logging'} and (!$conf{'logFile'})) { - quit("ERROR => You used -l to enable logging but didn't specify a log file!", 1); - } - - if ( $opt{'username'} ) { - if (!$opt{'password'}) { - ## Prompt for a password since one wasn't specified with the -xp option. - $SIG{'ALRM'} = sub { quit("ERROR => Timeout waiting for password inpupt", 1); }; - alarm(60) if ($^O !~ /win/i); ## alarm() doesn't work in win32 - print "Password: "; - $opt{'password'} = ; chomp $opt{'password'}; - if (!$opt{'password'}) { - quit("ERROR => A username for SMTP authentication was specified, but no password!", 1); - } - } - } - - ## Validate the TLS setting - $opt{'tls'} = lc($opt{'tls'}); - if ($opt{'tls'} !~ /^(auto|yes|no)$/) { - quit("ERROR => Invalid TLS setting ($opt{'tls'}). Must be one of auto, yes, or no.", 1); - } - - ## If TLS is set to "yes", make sure sendEmail loaded the libraries needed. - if ($opt{'tls'} eq 'yes' and $conf{'tls_client'} == 0) { - quit("ERROR => No TLS support! SendEmail can't load required libraries. (try installing Net::SSLeay and IO::Socket::SSL)", 1); - } - - ## Return 0 errors - return(0); -} - - - - - - - - - - - - - - - - -## getline($socketRef) -sub getline { - my ($socketRef) = @_; - local ($/) = "\r\n"; - return $$socketRef->getline; -} - - - - -## Receive a (multiline?) SMTP response from ($socketRef) -sub getResponse { - my ($socketRef) = @_; - my ($tmp, $reply); - local ($/) = "\r\n"; - return undef unless defined($tmp = getline($socketRef)); - return("getResponse() socket is not open") unless ($$socketRef->opened); - ## Keep reading lines if it's a multi-line response - while ($tmp =~ /^\d{3}-/o) { - $reply .= $tmp; - return undef unless defined($tmp = getline($socketRef)); - } - $reply .= $tmp; - $reply =~ s/\r?\n$//o; - return $reply; -} - - - - -############################################################################################### -## Function: SMTPchat ( [string $command] ) -## -## Description: Sends $command to the SMTP server (on SERVER) and awaits a successful -## reply form the server. If the server returns an error, or does not reply -## within $conf{'alarm'} seconds an error is generated. -## NOTE: $command is optional, if no command is specified then nothing will -## be sent to the server, but a valid response is still required from the server. -## -## Input: [$command] A (optional) valid SMTP command (ex. "HELO") -## -## -## Output: Returns zero on success, or non-zero on error. -## Error messages will be stored in $conf{'error'} -## A copy of the last SMTP response is stored in the global variable -## $conf{'SMTPchat_response'} -## -## -## Example: SMTPchat ("HELO mail.isp.net"); -############################################################################################### -sub SMTPchat { - my ($command) = @_; - - printmsg("INFO => Sending: \t$command", 1) if ($command); - - ## Send our command - print $SERVER "$command$CRLF" if ($command); - - ## Read a response from the server - $SIG{'ALRM'} = sub { $conf{'error'} = "alarm"; $SERVER->close(); }; - alarm($conf{'alarm'}) if ($^O !~ /win/i); ## alarm() doesn't work in win32; - my $result = $conf{'SMTPchat_response'} = getResponse(\$SERVER); - alarm(0) if ($^O !~ /win/i); ## alarm() doesn't work in win32; - - ## Generate an alert if we timed out - if ($conf{'error'} eq "alarm") { - $conf{'error'} = "ERROR => Timeout while reading from $conf{'server'}:$conf{'port'} There was no response after $conf{'alarm'} seconds."; - return(1); - } - - ## Make sure the server actually responded - if (!$result) { - $conf{'error'} = "ERROR => $conf{'server'}:$conf{'port'} returned a zero byte response to our query."; - return(2); - } - - ## Validate the response - if (evalSMTPresponse($result)) { - ## conf{'error'} will already be set here - return(2); - } - - ## Print the success messsage - printmsg($conf{'error'}, 1); - - ## Return Success - return(0); -} - - - - - - - - - - - - -############################################################################################### -## Function: evalSMTPresponse (string $message ) -## -## Description: Searches $message for either an SMTP success or error code, and returns -## 0 on success, and the actual error code on error. -## -## -## Input: $message Data received from a SMTP server (ex. "220 -## -## -## Output: Returns zero on success, or non-zero on error. -## Error messages will be stored in $conf{'error'} -## -## -## Example: SMTPchat ("HELO mail.isp.net"); -############################################################################################### -sub evalSMTPresponse { - my ($message) = @_; - - ## Validate input - if (!$message) { - $conf{'error'} = "ERROR => No message was passed to evalSMTPresponse(). What happened?"; - return(1) - } - - printmsg("DEBUG => evalSMTPresponse() - Checking for SMTP success or error status in the message: $message ", 3); - - ## Look for a SMTP success code - if ($message =~ /^([23]\d\d)/) { - printmsg("DEBUG => evalSMTPresponse() - Found SMTP success code: $1", 2); - $conf{'error'} = "SUCCESS => Received: \t$message"; - return(0); - } - - ## Look for a SMTP error code - if ($message =~ /^([45]\d\d)/) { - printmsg("DEBUG => evalSMTPresponse() - Found SMTP error code: $1", 2); - $conf{'error'} = "ERROR => Received: \t$message"; - return($1); - } - - ## If no SMTP codes were found return an error of 1 - $conf{'error'} = "ERROR => Received a message with no success or error code. The message received was: $message"; - return(2); - -} - - - - - - - - - - -######################################################### -# SUB: &return_month(0,1,etc) -# returns the name of the month that corrosponds -# with the number. returns 0 on error. -######################################################### -sub return_month { - my $x = $_[0]; - if ($x == 0) { return 'Jan'; } - if ($x == 1) { return 'Feb'; } - if ($x == 2) { return 'Mar'; } - if ($x == 3) { return 'Apr'; } - if ($x == 4) { return 'May'; } - if ($x == 5) { return 'Jun'; } - if ($x == 6) { return 'Jul'; } - if ($x == 7) { return 'Aug'; } - if ($x == 8) { return 'Sep'; } - if ($x == 9) { return 'Oct'; } - if ($x == 10) { return 'Nov'; } - if ($x == 11) { return 'Dec'; } - return (0); -} - - - - - - - - - - - - - - - - -######################################################### -# SUB: &return_day(0,1,etc) -# returns the name of the day that corrosponds -# with the number. returns 0 on error. -######################################################### -sub return_day { - my $x = $_[0]; - if ($x == 0) { return 'Sun'; } - if ($x == 1) { return 'Mon'; } - if ($x == 2) { return 'Tue'; } - if ($x == 3) { return 'Wed'; } - if ($x == 4) { return 'Thu'; } - if ($x == 5) { return 'Fri'; } - if ($x == 6) { return 'Sat'; } - return (0); -} - - - - - - - - - - - - - - - - -############################################################################################### -## Function: returnAddressParts(string $address) -## -## Description: Returns a two element array containing the "Name" and "Address" parts of -## an email address. -## -## Example: "Brandon Zehm " -## would return: ("Brandon Zehm", "caspian@dotconf.net"); -## -## "caspian@dotconf.net" -## would return: ("caspian@dotconf.net", "caspian@dotconf.net") -############################################################################################### -sub returnAddressParts { - my $input = $_[0]; - my $name = ""; - my $address = ""; - - ## Make sure to fail if it looks totally invalid - if ($input !~ /(\S+\@\S+)/) { - $conf{'error'} = "ERROR => The address [$input] doesn't look like a valid email address, ignoring it"; - return(undef()); - } - - ## Check 1, should find addresses like: "Brandon Zehm " - elsif ($input =~ /^\s*(\S(.*\S)?)\s*<(\S+\@\S+)>/o) { - ($name, $address) = ($1, $3); - } - - ## Otherwise if that failed, just get the address: - elsif ($input =~ /<(\S+\@\S+)>/o) { - $name = $address = $1; - } - - ## Or maybe it was formatted this way: caspian@dotconf.net - elsif ($input =~ /(\S+\@\S+)/o) { - $name = $address = $1; - } - - ## Something stupid happened, just return an error. - unless ($name and $address) { - printmsg("ERROR => Couldn't parse the address: $input", 0); - printmsg("HINT => If you think this should work, consider reporting this as a bug to $conf{'authorEmail'}", 1); - return(undef()); - } - - ## Make sure there aren't invalid characters in the address, and return it. - my $ctrl = '\000-\037'; - my $nonASCII = '\x80-\xff'; - if ($address =~ /[<> ,;:"'\[\]\\$ctrl$nonASCII]/) { - printmsg("WARNING => The address [$address] seems to contain invalid characters: continuing anyway", 0); - } - return($name, $address); -} - - - - - - - - - - - - - - - - -############################################################################################### -## Function: base64_encode(string $data, bool $chunk) -## -## Description: Returns $data as a base64 encoded string. -## If $chunk is true, the encoded data is returned in 76 character long lines -## with the final \CR\LF removed. -## -## Note: This is only used from the smtp auth section of code. -## At some point it would be nice to merge the code that encodes attachments and this. -############################################################################################### -sub base64_encode { - my $data = $_[0]; - my $chunk = $_[1]; - my $tmp = ''; - my $base64 = ''; - my $CRLF = "\r\n"; - - ################################### - ## Convert binary data to base64 ## - ################################### - while ($data =~ s/(.{45})//s) { ## Get 45 bytes from the binary string - $tmp = substr(pack('u', $&), 1); ## Convert the binary to uuencoded text - chop($tmp); - $tmp =~ tr|` -_|AA-Za-z0-9+/|; ## Translate from uuencode to base64 - $base64 .= $tmp; - } - - ########################## - ## Encode the leftovers ## - ########################## - my $padding = ""; - if ( ($data) and (length($data) > 0) ) { - $padding = (3 - length($data) % 3) % 3; ## Set flag if binary data isn't divisible by 3 - $tmp = substr(pack('u', $data), 1); ## Convert the binary to uuencoded text - chop($tmp); - $tmp =~ tr|` -_|AA-Za-z0-9+/|; ## Translate from uuencode to base64 - $base64 .= $tmp; - } - - ############################ - ## Fix padding at the end ## - ############################ - $data = ''; - $base64 =~ s/.{$padding}$/'=' x $padding/e if $padding; ## Fix the end padding if flag (from above) is set - if ($chunk) { - while ($base64 =~ s/(.{1,76})//s) { ## Put $CRLF after each 76 characters - $data .= "$1$CRLF"; - } - } - else { - $data = $base64; - } - - ## Remove any trailing CRLF's - $data =~ s/(\r|\n)*$//s; - return($data); -} - - - - - - - - - -######################################################### -# SUB: send_attachment("/path/filename") -# Sends the mime headers and base64 encoded file -# to the email server. -######################################################### -sub send_attachment { - my ($filename) = @_; ## Get filename passed - my (@fields, $y, $filename_name, $encoding, ## Local variables - @attachlines, $content_type); - my $bin = 1; - - @fields = split(/\/|\\/, $filename); ## Get the actual filename without the path - $filename_name = pop(@fields); - push @attachments_names, $filename_name; ## FIXME: This is only used later for putting in the log file - - ########################## - ## Autodetect Mime Type ## - ########################## - - @fields = split(/\./, $filename_name); - $encoding = $fields[$#fields]; - - if ($encoding =~ /txt|text|log|conf|^c$|cpp|^h$|inc|m3u/i) { $content_type = 'text/plain'; } - elsif ($encoding =~ /html|htm|shtml|shtm|asp|php|cfm/i) { $content_type = 'text/html'; } - elsif ($encoding =~ /sh$/i) { $content_type = 'application/x-sh'; } - elsif ($encoding =~ /tcl/i) { $content_type = 'application/x-tcl'; } - elsif ($encoding =~ /pl$/i) { $content_type = 'application/x-perl'; } - elsif ($encoding =~ /js$/i) { $content_type = 'application/x-javascript'; } - elsif ($encoding =~ /man/i) { $content_type = 'application/x-troff-man'; } - elsif ($encoding =~ /gif/i) { $content_type = 'image/gif'; } - elsif ($encoding =~ /jpg|jpeg|jpe|jfif|pjpeg|pjp/i) { $content_type = 'image/jpeg'; } - elsif ($encoding =~ /tif|tiff/i) { $content_type = 'image/tiff'; } - elsif ($encoding =~ /xpm/i) { $content_type = 'image/x-xpixmap'; } - elsif ($encoding =~ /bmp/i) { $content_type = 'image/x-MS-bmp'; } - elsif ($encoding =~ /pcd/i) { $content_type = 'image/x-photo-cd'; } - elsif ($encoding =~ /png/i) { $content_type = 'image/png'; } - elsif ($encoding =~ /aif|aiff/i) { $content_type = 'audio/x-aiff'; } - elsif ($encoding =~ /wav/i) { $content_type = 'audio/x-wav'; } - elsif ($encoding =~ /mp2|mp3|mpa/i) { $content_type = 'audio/x-mpeg'; } - elsif ($encoding =~ /ra$|ram/i) { $content_type = 'audio/x-pn-realaudio'; } - elsif ($encoding =~ /mpeg|mpg/i) { $content_type = 'video/mpeg'; } - elsif ($encoding =~ /mov|qt$/i) { $content_type = 'video/quicktime'; } - elsif ($encoding =~ /avi/i) { $content_type = 'video/x-msvideo'; } - elsif ($encoding =~ /zip/i) { $content_type = 'application/x-zip-compressed'; } - elsif ($encoding =~ /tar/i) { $content_type = 'application/x-tar'; } - elsif ($encoding =~ /jar/i) { $content_type = 'application/java-archive'; } - elsif ($encoding =~ /exe|bin/i) { $content_type = 'application/octet-stream'; } - elsif ($encoding =~ /ppt|pot|ppa|pps|pwz/i) { $content_type = 'application/vnd.ms-powerpoint'; } - elsif ($encoding =~ /mdb|mda|mde/i) { $content_type = 'application/vnd.ms-access'; } - elsif ($encoding =~ /xls|xlt|xlm|xld|xla|xlc|xlw|xll/i) { $content_type = 'application/vnd.ms-excel'; } - elsif ($encoding =~ /doc|dot/i) { $content_type = 'application/msword'; } - elsif ($encoding =~ /rtf/i) { $content_type = 'application/rtf'; } - elsif ($encoding =~ /pdf/i) { $content_type = 'application/pdf'; } - elsif ($encoding =~ /tex/i) { $content_type = 'application/x-tex'; } - elsif ($encoding =~ /latex/i) { $content_type = 'application/x-latex'; } - elsif ($encoding =~ /vcf/i) { $content_type = 'application/x-vcard'; } - else { $content_type = 'application/octet-stream'; } - - - ############################ - ## Process the attachment ## - ############################ - - ##################################### - ## Generate and print MIME headers ## - ##################################### - - $y = "$CRLF--$conf{'delimiter'}$CRLF"; - $y .= "Content-Type: $content_type;$CRLF"; - $y .= " name=\"$filename_name\"$CRLF"; - $y .= "Content-Transfer-Encoding: base64$CRLF"; - $y .= "Content-Disposition: attachment; filename=\"$filename_name\"$CRLF"; - $y .= "$CRLF"; - print $SERVER $y; - - - ########################################################### - ## Convert the file to base64 and print it to the server ## - ########################################################### - - open (FILETOATTACH, $filename) || do { - printmsg("ERROR => Opening the file [$filename] for attachment failed with the error: $!", 0); - return(1); - }; - binmode(FILETOATTACH); ## Hack to make Win32 work - - my $res = ""; - my $tmp = ""; - my $base64 = ""; - while () { ## Read a line from the (binary) file - $res .= $_; - - ################################### - ## Convert binary data to base64 ## - ################################### - while ($res =~ s/(.{45})//s) { ## Get 45 bytes from the binary string - $tmp = substr(pack('u', $&), 1); ## Convert the binary to uuencoded text - chop($tmp); - $tmp =~ tr|` -_|AA-Za-z0-9+/|; ## Translate from uuencode to base64 - $base64 .= $tmp; - } - - ################################ - ## Print chunks to the server ## - ################################ - while ($base64 =~ s/(.{76})//s) { - print $SERVER "$1$CRLF"; - } - - } - - ################################### - ## Encode and send the leftovers ## - ################################### - my $padding = ""; - if ( ($res) and (length($res) >= 1) ) { - $padding = (3 - length($res) % 3) % 3; ## Set flag if binary data isn't divisible by 3 - $res = substr(pack('u', $res), 1); ## Convert the binary to uuencoded text - chop($res); - $res =~ tr|` -_|AA-Za-z0-9+/|; ## Translate from uuencode to base64 - } - - ############################ - ## Fix padding at the end ## - ############################ - $res = $base64 . $res; ## Get left overs from above - $res =~ s/.{$padding}$/'=' x $padding/e if $padding; ## Fix the end padding if flag (from above) is set - if ($res) { - while ($res =~ s/(.{1,76})//s) { ## Send it to the email server. - print $SERVER "$1$CRLF"; - } - } - - close (FILETOATTACH) || do { - printmsg("ERROR - Closing the filehandle for file [$filename] failed with the error: $!", 0); - return(2); - }; - - ## Return 0 errors - return(0); - -} - - - - - - - - - -############################################################################################### -## Function: $string = get_hostname (boot $fqdn) -## -## Description: Tries really hard to returns the short (or FQDN) hostname of the current -## system. Uses techniques and code from the Sys-Hostname module. -## -## Input: $fqdn A true value (1) will cause this function to return a FQDN hostname -## rather than a short hostname. -## -## Output: Returns a string -############################################################################################### -sub get_hostname { - ## Assign incoming parameters to variables - my ( $fqdn ) = @_; - my $hostname = ""; - - ## STEP 1: Get short hostname - - ## Load Sys::Hostname if it's available - eval { require Sys::Hostname; }; - unless ($@) { - $hostname = Sys::Hostname::hostname(); - } - - ## If that didn't get us a hostname, try a few other things - else { - ## Windows systems - if ($^O !~ /win/i) { - if ($ENV{'COMPUTERNAME'}) { $hostname = $ENV{'COMPUTERNAME'}; } - if (!$hostname) { $hostname = gethostbyname('localhost'); } - if (!$hostname) { chomp($hostname = `hostname 2> NUL`) }; - } - - ## Unix systems - else { - local $ENV{PATH} = '/usr/bin:/bin:/usr/sbin:/sbin'; ## Paranoia - - ## Try the environment first (Help! What other variables could/should I be checking here?) - if ($ENV{'HOSTNAME'}) { $hostname = $ENV{'HOSTNAME'}; } - - ## Try the hostname command - eval { local $SIG{__DIE__}; local $SIG{CHLD}; $hostname = `hostname 2>/dev/null`; chomp($hostname); } || - - ## Try POSIX::uname(), which strictly can't be expected to be correct - eval { local $SIG{__DIE__}; require POSIX; $hostname = (POSIX::uname())[1]; } || - - ## Try the uname command - eval { local $SIG{__DIE__}; $hostname = `uname -n 2>/dev/null`; chomp($hostname); }; - - } - - ## If we can't find anything else, return "" - if (!$hostname) { - print "WARNING => No hostname could be determined, please specify one with -o fqdn=FQDN option!\n"; - return("unknown"); - } - } - - ## Return the short hostname - unless ($fqdn) { - $hostname =~ s/\..*//; - return(lc($hostname)); - } - - ## STEP 2: Determine the FQDN - - ## First, if we already have one return it. - if ($hostname =~ /\w\.\w/) { return(lc($hostname)); } - - ## Next try using - eval { $fqdn = (gethostbyname($hostname))[0]; }; - if ($fqdn) { return(lc($fqdn)); } - return(lc($hostname)); -} - - - - - - - - -############################################################################################### -## Function: printmsg (string $message, int $level) -## -## Description: Handles all messages - printing them to the screen only if the messages -## $level is >= the global debug level. If $conf{'logFile'} is defined it -## will also log the message to that file. -## -## Input: $message A message to be printed, logged, etc. -## $level The debug level of the message. If -## not defined 0 will be assumed. 0 is -## considered a normal message, 1 and -## higher is considered a debug message. -## -## Output: Prints to STDOUT -## -## Assumptions: $conf{'hostname'} should be the name of the computer we're running on. -## $conf{'stdout'} should be set to 1 if you want to print to stdout -## $conf{'logFile'} should be a full path to a log file if you want that -## $conf{'debug'} should be an integer between 0 and 10. -## -## Example: printmsg("WARNING: We believe in generic error messages... NOT!", 0); -############################################################################################### -sub printmsg { - ## Assign incoming parameters to variables - my ( $message, $level ) = @_; - - ## Make sure input is sane - $level = 0 if (!defined($level)); - $message =~ s/\s+$//sgo; - $message =~ s/\r?\n/, /sgo; - - ## Continue only if the debug level of the program is >= message debug level. - if ($conf{'debug'} >= $level) { - - ## Get the date in the format: Dec 3 11:14:04 - my ($sec, $min, $hour, $mday, $mon) = localtime(); - $mon = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')[$mon]; - my $date = sprintf("%s %02d %02d:%02d:%02d", $mon, $mday, $hour, $min, $sec); - - ## Print to STDOUT always if debugging is enabled, or if conf{stdout} is true. - if ( ($conf{'debug'} >= 1) or ($conf{'stdout'} == 1) ) { - print "$date $conf{'hostname'} $conf{'programName'}\[$$\]: $message\n"; - } - - ## Print to the log file if $conf{'logging'} is true - if ($conf{'logFile'}) { - if (openLogFile($conf{'logFile'})) { $conf{'logFile'} = ""; printmsg("ERROR => Opening the file [$conf{'logFile'}] for appending returned the error: $!", 1); } - print LOGFILE "$date $conf{'hostname'} $conf{'programName'}\[$$\]: $message\n"; - } - - } - - ## Return 0 errors - return(0); -} - - - - - - - - - - - - -############################################################################################### -## FUNCTION: -## openLogFile ( $filename ) -## -## -## DESCRIPTION: -## Opens the file $filename and attaches it to the filehandle "LOGFILE". Returns 0 on success -## and non-zero on failure. Error codes are listed below, and the error message gets set in -## global variable $!. -## -## -## Example: -## openFile ("/var/log/sendEmail.log"); -## -############################################################################################### -sub openLogFile { - ## Get the incoming filename - my $filename = $_[0]; - - ## Make sure our file exists, and if the file doesn't exist then create it - if ( ! -f $filename ) { - print STDERR "NOTICE: The log file [$filename] does not exist. Creating it now with mode [0600].\n" if ($conf{'stdout'}); - open (LOGFILE, ">>$filename"); - close LOGFILE; - chmod (0600, $filename); - } - - ## Now open the file and attach it to a filehandle - open (LOGFILE,">>$filename") or return (1); - - ## Put the file into non-buffering mode - select LOGFILE; - $| = 1; - select STDOUT; - - ## Return success - return(0); -} - - - - - - - - -############################################################################################### -## Function: read_file (string $filename) -## -## Description: Reads the contents of a file and returns a two part array: -## ($status, $file-contents) -## $status is 0 on success, non-zero on error. -## -## Example: ($status, $file) = read_file("/etc/passwd"); -############################################################################################### -sub read_file { - my ( $filename ) = @_; - - ## If the value specified is a file, load the file's contents - if ( (-e $filename and -r $filename) ) { - my $FILE; - if(!open($FILE, ' ' . $filename)) { - return((1, "")); - } - my $file = ''; - while (<$FILE>) { - $file .= $_; - } - ## Strip an ending \r\n - $file =~ s/\r?\n$//os; - } - return((1, "")); -} - - - - - - - - - -############################################################################################### -## Function: quit (string $message, int $errorLevel) -## -## Description: Exits the program, optionally printing $message. It -## returns an exit error level of $errorLevel to the -## system (0 means no errors, and is assumed if empty.) -## -## Example: quit("Exiting program normally", 0); -############################################################################################### -sub quit { - my ( $message, $errorLevel ) = @_; - $errorLevel = 0 if (!defined($errorLevel)); - - ## Print exit message - if ($message) { - printmsg($message, 0); - } - - ## Exit - exit($errorLevel); -} - - - - - - - - - - - - -############################################################################################### -## Function: help () -## -## Description: For all those newbies ;) -## Prints a help message and exits the program. -## -############################################################################################### -sub help { -exit(1) if (!$conf{'stdout'}); -print <${colorNoBold} - -Synopsis: $conf{'programName'} -f ADDRESS [options] - - ${colorRed}Required:${colorNormal} - -f ADDRESS from (sender) email address - * At least one recipient required via -t, -cc, or -bcc - * Message body required via -m, STDIN, or -o message-file=FILE - - ${colorGreen}Common:${colorNormal} - -t ADDRESS [ADDR ...] to email address(es) - -u SUBJECT message subject - -m MESSAGE message body - -s SERVER[:PORT] smtp mail relay, default is $conf{'server'}:$conf{'port'} - - ${colorGreen}Optional:${colorNormal} - -a FILE [FILE ...] file attachment(s) - -cc ADDRESS [ADDR ...] cc email address(es) - -bcc ADDRESS [ADDR ...] bcc email address(es) - -xu USERNAME username for SMTP authentication - -xp PASSWORD password for SMTP authentication - - ${colorGreen}Paranormal:${colorNormal} - -b BINDADDR[:PORT] local host bind address - -l LOGFILE log to the specified file - -v verbosity, use multiple times for greater effect - -q be quiet (i.e. no STDOUT output) - -o NAME=VALUE advanced options, for details try: --help misc - -o message-content-type= - -o message-file=FILE -o message-format=raw - -o message-header=HEADER -o message-charset=CHARSET - -o reply-to=ADDRESS -o timeout=SECONDS - -o username=USERNAME -o password=PASSWORD - -o tls= -o fqdn=FQDN - - - ${colorGreen}Help:${colorNormal} - --help the helpful overview you're reading now - --help addressing explain addressing and related options - --help message explain message body input and related options - --help networking explain -s, -b, etc - --help output explain logging and other output options - --help misc explain -o options, TLS, SMTP auth, and more - -EOM -exit(1); -} - - - - - - - - - -############################################################################################### -## Function: helpTopic ($topic) -## -## Description: For all those newbies ;) -## Prints a help message and exits the program. -## -############################################################################################### -sub helpTopic { - exit(1) if (!$conf{'stdout'}); - my ($topic) = @_; - - CASE: { - - - - -## ADDRESSING - ($topic eq 'addressing') && do { - print <" - Just Address: "john.doe\@gmail.com" - -The "Full Name" method is useful if you want a name, rather than a plain -email address, to be displayed in the recipient's From, To, or Cc fields -when they view the message. - - -${colorGreen}Multiple Recipients${colorNormal} -The -t, -cc, and -bcc options each accept multiple addresses. They may be -specified by separating them by either a white space, comma, or semi-colon -separated list. You may also specify the -t, -cc, and -bcc options multiple -times, each occurance will append the new recipients to the respective list. - -Examples: -(I used "-t" in these examples, but it can be "-cc" or "-bcc" as well) - - * Space separated list: - -t jane.doe\@yahoo.com "John Doe " - - * Semi-colon separated list: - -t "jane.doe\@yahoo.com; John Doe " - - * Comma separated list: - -t "jane.doe\@yahoo.com, John Doe " - - * Multiple -t, -cc, or -bcc options: - -t "jane.doe\@yahoo.com" -t "John Doe " - - -EOM - last CASE; - }; - - - - - - -## MESSAGE - ($topic eq 'message') && do { - print < - -o message-header=EMAIL HEADER - -o message-charset=CHARSET - -o message-format=raw - --u SUBJECT - This option allows you to specify the subject for your email message. - It is not required (anymore) that the subject be quoted, although it - is recommended. The subject will be read until an argument starting - with a hyphen (-) is found. - Examples: - -u "Contact information while on vacation" - -u New Microsoft vulnerability discovered - --m MESSAGE - This option is one of three methods that allow you to specify the message - body for your email. The message may be specified on the command line - with this -m option, read from a file with the -o message-file=FILE - option, or read from STDIN if neither of these options are present. - - It is not required (anymore) that the message be quoted, although it is - recommended. The message will be read until an argument starting with a - hyphen (-) is found. - Examples: - -m "See you in South Beach, Hawaii. -Todd" - -m Please ensure that you upgrade your systems right away - - Multi-line message bodies may be specified with the -m option by putting - a "\\n" into the message. Example: - -m "This is line 1.\\nAnd this is line 2." - - HTML messages are supported, simply begin your message with "" and - sendEmail will properly label the mime header so MUAs properly render - the message. It is currently not possible without "-o message-format=raw" - to send a message with both text and html parts with sendEmail. - --o message-file=FILE - This option is one of three methods that allow you to specify the message - body for your email. To use this option simply specify a text file - containing the body of your email message. Examples: - -o message-file=/root/message.txt - -o message-file="C:\\Program Files\\output.txt" - --o message-content-type= - This option allows you to specify the content-type of the email. If your - email message is an html message but is being displayed as a text message - just add "-o message-content-type=html" to the command line to force it - to display as an html message. This actually just changes the Content-Type: - header. Advanced users will be happy to know that if you specify anything - other than the three options listed above it will use that as the vaule - for the Content-Type header. - --o message-header=EMAIL HEADER - This option allows you to specify additional email headers to be included. - To add more than one message header simply use this option on the command - line more than once. If you specify a message header that sendEmail would - normally generate the one you specified will be used in it's place. - Do not use this unless you know what you are doing! - Example: - To scare a Microsoft Outlook user you may want to try this: - -o message-header="X-Message-Flag: Message contains illegal content" - Example: - To request a read-receipt try this: - -o message-header="Disposition-Notification-To: " - Example: - To set the message priority try this: - -o message-header="X-Priority: 1" - Priority reference: 1=highest, 2=high, 3=normal, 4=low, 5=lowest - --o message-charset=CHARSET - This option allows you to specify the character-set for the message body. - The default is iso-8859-1. - --o message-format=raw - This option instructs sendEmail to assume the message (specified with -m, - read from STDIN, or read from the file specified in -o message-file=FILE) - is already a *complete* email message. SendEmail will not generate any - headers and will transmit the message as-is to the remote SMTP server. - Due to the nature of this option the following command line options will - be ignored when this one is used: - -u SUBJECT - -o message-header=EMAIL HEADER - -o message-charset=CHARSET - -a ATTACHMENT - - -${colorGreen}The Message Body${colorNormal} -The email message body may be specified in one of three ways: - 1) Via the -m MESSAGE command line option. - Example: - -m "This is the message body" - - 2) By putting the message body in a file and using the -o message-file=FILE - command line option. - Example: - -o message-file=/root/message.txt - - 3) By piping the message body to sendEmail when nither of the above command - line options were specified. - Example: - grep "ERROR" /var/log/messages | sendEmail -t you\@domain.com ... - -If the message body begins with "" then the message will be treated as -an HTML message and the MIME headers will be written so that a HTML capable -email client will display the message in it's HTML form. -Any of the above methods may be used with the -o message-format=raw option -to deliver an already complete email message. - - -EOM - last CASE; - }; - - - - - - -## MISC - ($topic eq 'misc') && do { - print < - -o timeout=SECONDS - -o fqdn=FQDN - --a ATTACHMENT [ATTACHMENT ...] - This option allows you to attach any number of files to your email message. - To specify more than one attachment, simply separate each filename with a - space. Example: -a file1.txt file2.txt file3.txt - --xu USERNAME - Alias for -o username=USERNAME - --xp PASSWORD - Alias for -o password=PASSWORD - --o username=USERNAME (synonym for -xu) - These options allow specification of a username to be used with SMTP - servers that require authentication. If a username is specified but a - password is not, you will be prompted to enter one at runtime. - --o password=PASSWORD (synonym for -xp) - These options allow specification of a password to be used with SMTP - servers that require authentication. If a username is specified but a - password is not, you will be prompted to enter one at runtime. - --o tls= - This option allows you to specify if TLS (SSL for SMTP) should be enabled - or disabled. The default, auto, will use TLS automatically if your perl - installation has the IO::Socket::SSL and Net::SSLeay modules available, - and if the remote SMTP server supports TLS. To require TLS for message - delivery set this to yes. To disable TLS support set this to no. A debug - level of one or higher will reveal details about the status of TLS. - --o timeout=SECONDS - This option sets the timeout value in seconds used for all network reads, - writes, and a few other things. - --o fqdn=FQDN - This option sets the Fully Qualified Domain Name used during the initial - SMTP greeting. Normally this is automatically detected, but in case you - need to manually set it for some reason or get a warning about detection - failing, you can use this to override the default. - - -EOM - last CASE; - }; - - - - - - -## NETWORKING - ($topic eq 'networking') && do { - print < - -o timeout=SECONDS - --s SERVER[:PORT] - This option allows you to specify the SMTP server sendEmail should - connect to to deliver your email message to. If this option is not - specified sendEmail will try to connect to localhost:25 to deliver - the message. THIS IS MOST LIKELY NOT WHAT YOU WANT, AND WILL LIKELY - FAIL unless you have a email server (commonly known as an MTA) running - on your computer! - Typically you will need to specify your company or ISP's email server. - For example, if you use CableOne you will need to specify: - -s mail.cableone.net - If you have your own email server running on port 300 you would - probably use an option like this: - -s myserver.mydomain.com:300 - If you're a GMail user try: - -s smtp.gmail.com:587 -xu me\@gmail.com -xp PASSWD - --b BINDADDR[:PORT] - This option allows you to specify the local IP address (and optional - tcp port number) for sendEmail to bind to when connecting to the remote - SMTP server. This useful for people who need to send an email from a - specific network interface or source address and are running sendEmail on - a firewall or other host with several network interfaces. - --o tls= - This option allows you to specify if TLS (SSL for SMTP) should be enabled - or disabled. The default, auto, will use TLS automatically if your perl - installation has the IO::Socket::SSL and Net::SSLeay modules available, - and if the remote SMTP server supports TLS. To require TLS for message - delivery set this to yes. To disable TLS support set this to no. A debug - level of one or higher will reveal details about the status of TLS. - --o timeout=SECONDS - This option sets the timeout value in seconds used for all network reads, - writes, and a few other things. - - -EOM - last CASE; - }; - - - - - - -## OUTPUT - ($topic eq 'output') && do { - print < The help topic specified is not valid!", 1); - }; - -exit(1); -} - - - - - - - - - - - - - - - - - - - - - - -############################# -## ## -## MAIN PROGRAM ## -## ## -############################# - - -## Initialize -initialize(); - -## Process Command Line -processCommandLine(); -$conf{'alarm'} = $opt{'timeout'}; - -## Abort program after $conf{'alarm'} seconds to avoid infinite hangs -alarm($conf{'alarm'}) if ($^O !~ /win/i); ## alarm() doesn't work in win32 - - - - -################################################### -## Read $message from STDIN if -m was not used ## -################################################### - -if (!($message)) { - ## Read message body from a file specified with -o message-file= - if ($opt{'message-file'}) { - if (! -e $opt{'message-file'}) { - printmsg("ERROR => Message body file specified [$opt{'message-file'}] does not exist!", 0); - printmsg("HINT => 1) check spelling of your file; 2) fully qualify the path; 3) doubble quote it", 1); - quit("", 1); - } - if (! -r $opt{'message-file'}) { - printmsg("ERROR => Message body file specified can not be read due to restricted permissions!", 0); - printmsg("HINT => Check permissions on file specified to ensure it can be read", 1); - quit("", 1); - } - if (!open(MFILE, "< " . $opt{'message-file'})) { - printmsg("ERROR => Error opening message body file [$opt{'message-file'}]: $!", 0); - quit("", 1); - } - while () { - $message .= $_; - } - close(MFILE); - } - - ## Read message body from STDIN - else { - alarm($conf{'alarm'}) if ($^O !~ /win/i); ## alarm() doesn't work in win32 - if ($conf{'stdout'}) { - print "Reading message body from STDIN because the '-m' option was not used.\n"; - print "If you are manually typing in a message:\n"; - print " - First line must be received within $conf{'alarm'} seconds.\n" if ($^O !~ /win/i); - print " - End manual input with a CTRL-D on its own line.\n\n" if ($^O !~ /win/i); - print " - End manual input with a CTRL-Z on its own line.\n\n" if ($^O =~ /win/i); - } - while () { ## Read STDIN into $message - $message .= $_; - alarm(0) if ($^O !~ /win/i); ## Disable the alarm since at least one line was received - } - printmsg("Message input complete.", 0); - } -} - -## Replace bare LF's with CRLF's (\012 should always have \015 with it) -$message =~ s/(\015)?(\012|$)/\015\012/g; - -## Replace bare CR's with CRLF's (\015 should always have \012 with it) -$message =~ s/(\015)(\012|$)?/\015\012/g; - -## Check message for bare periods and encode them -$message =~ s/(^|$CRLF)(\.{1})($CRLF|$)/$1.$2$3/g; - -## Get the current date for the email header -my ($sec,$min,$hour,$mday,$mon,$year,$day) = gmtime(); -$year += 1900; $mon = return_month($mon); $day = return_day($day); -my $date = sprintf("%s, %s %s %d %.2d:%.2d:%.2d %s",$day, $mday, $mon, $year, $hour, $min, $sec, $conf{'timezone'}); - - - - -################################## -## Connect to the SMTP server ## -################################## -printmsg("DEBUG => Connecting to $conf{'server'}:$conf{'port'}", 1); -$SIG{'ALRM'} = sub { - printmsg("ERROR => Timeout while connecting to $conf{'server'}:$conf{'port'} There was no response after $conf{'alarm'} seconds.", 0); - printmsg("HINT => Try specifying a different mail relay with the -s option.", 1); - quit("", 1); -}; -alarm($conf{'alarm'}) if ($^O !~ /win/i); ## alarm() doesn't work in win32; -$SERVER = IO::Socket::INET->new( PeerAddr => $conf{'server'}, - PeerPort => $conf{'port'}, - LocalAddr => $conf{'bindaddr'}, - Proto => 'tcp', - Autoflush => 1, - timeout => $conf{'alarm'}, -); -alarm(0) if ($^O !~ /win/i); ## alarm() doesn't work in win32; - -## Make sure we got connected -if ( (!$SERVER) or (!$SERVER->opened()) ) { - printmsg("ERROR => Connection attempt to $conf{'server'}:$conf{'port'} failed: $@", 0); - printmsg("HINT => Try specifying a different mail relay with the -s option.", 1); - quit("", 1); -} - -## Save our IP address for later -$conf{'ip'} = $SERVER->sockhost(); -printmsg("DEBUG => My IP address is: $conf{'ip'}", 1); - - - - - - - -######################### -## Do the SMTP Dance ## -######################### - -## Read initial greeting to make sure we're talking to a live SMTP server -if (SMTPchat()) { quit($conf{'error'}, 1); } - -## We're about to use $opt{'fqdn'}, make sure it isn't empty -if (!$opt{'fqdn'}) { - ## Ok, that means we couldn't get a hostname, how about using the IP address for the HELO instead - $opt{'fqdn'} = "[" . $conf{'ip'} . "]"; -} - -## EHLO -if (SMTPchat('EHLO ' . $opt{'fqdn'})) { - printmsg($conf{'error'}, 0); - printmsg("NOTICE => EHLO command failed, attempting HELO instead"); - if (SMTPchat('HELO ' . $opt{'fqdn'})) { quit($conf{'error'}, 1); } - if ( $opt{'username'} and $opt{'password'} ) { - printmsg("WARNING => The mail server does not support SMTP authentication!", 0); - } -} -else { - - ## Determin if the server supports TLS - if ($conf{'SMTPchat_response'} =~ /STARTTLS/) { - $conf{'tls_server'} = 1; - printmsg("DEBUG => The remote SMTP server supports TLS :)", 2); - } - else { - $conf{'tls_server'} = 0; - printmsg("DEBUG => The remote SMTP server does NOT support TLS :(", 2); - } - - ## Start TLS if possible - if ($conf{'tls_server'} == 1 and $conf{'tls_client'} == 1 and $opt{'tls'} =~ /^(yes|auto)$/) { - printmsg("DEBUG => Starting TLS", 2); - if (SMTPchat('STARTTLS')) { quit($conf{'error'}, 1); } - if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'SSLv23:!SSLv3:!SSLv2', , SSL_verify_mode => 0)) { - quit("ERROR => TLS setup failed: " . IO::Socket::SSL::errstr(), 1); - } - printmsg("DEBUG => TLS: Using cipher: ". $SERVER->get_cipher(), 3); - printmsg("DEBUG => TLS session initialized :)", 1); - - ## Restart our SMTP session - if (SMTPchat('EHLO ' . $opt{'fqdn'})) { quit($conf{'error'}, 1); } - } - elsif ($opt{'tls'} eq 'yes' and $conf{'tls_server'} == 0) { - quit("ERROR => TLS not possible! Remote SMTP server, $conf{'server'}, does not support it.", 1); - } - - - ## Do SMTP Auth if required - if ( $opt{'username'} and $opt{'password'} ) { - if ($conf{'SMTPchat_response'} !~ /AUTH\s/) { - printmsg("NOTICE => Authentication not supported by the remote SMTP server!", 0); - } - else { - my $auth_succeeded = 0; - my $mutual_method = 0; - - # ## SASL CRAM-MD5 authentication method - # if ($conf{'SMTPchat_response'} =~ /\bCRAM-MD5\b/i) { - # printmsg("DEBUG => SMTP-AUTH: Using CRAM-MD5 authentication method", 1); - # if (SMTPchat('AUTH CRAM-MD5')) { quit($conf{'error'}, 1); } - # - # ## FIXME!! - # - # printmsg("DEBUG => User authentication was successful", 1); - # } - - ## SASL LOGIN authentication method - if ($auth_succeeded == 0 and $conf{'SMTPchat_response'} =~ /\bLOGIN\b/i) { - $mutual_method = 1; - printmsg("DEBUG => SMTP-AUTH: Using LOGIN authentication method", 1); - if (!SMTPchat('AUTH LOGIN')) { - if (!SMTPchat(base64_encode($opt{'username'}))) { - if (!SMTPchat(base64_encode($opt{'password'}))) { - $auth_succeeded = 1; - printmsg("DEBUG => User authentication was successful (Method: LOGIN)", 1); - } - } - } - if ($auth_succeeded == 0) { - printmsg("DEBUG => SMTP-AUTH: LOGIN authenticaion failed.", 1); - } - } - - ## SASL PLAIN authentication method - if ($auth_succeeded == 0 and $conf{'SMTPchat_response'} =~ /\bPLAIN\b/i) { - $mutual_method = 1; - printmsg("DEBUG => SMTP-AUTH: Using PLAIN authentication method", 1); - if (SMTPchat('AUTH PLAIN ' . base64_encode("$opt{'username'}\0$opt{'username'}\0$opt{'password'}"))) { - printmsg("DEBUG => SMTP-AUTH: PLAIN authenticaion failed.", 1); - } - else { - $auth_succeeded = 1; - printmsg("DEBUG => User authentication was successful (Method: PLAIN)", 1); - } - } - - ## If none of the authentication methods supported by sendEmail were supported by the server, let the user know - if ($mutual_method == 0) { - printmsg("WARNING => SMTP-AUTH: No mutually supported authentication methods available", 0); - } - - ## If we didn't get authenticated, log an error message and exit - if ($auth_succeeded == 0) { - quit("ERROR => ERROR => SMTP-AUTH: Authentication to $conf{'server'}:$conf{'port'} failed.", 1); - } - } - } -} - -## MAIL FROM -if (SMTPchat('MAIL FROM:<' .(returnAddressParts($from))[1]. '>')) { quit($conf{'error'}, 1); } - -## RCPT TO -my $oneRcptAccepted = 0; -foreach my $rcpt (@to, @cc, @bcc) { - my ($name, $address) = returnAddressParts($rcpt); - if (SMTPchat('RCPT TO:<' . $address . '>')) { - printmsg("WARNING => The recipient <$address> was rejected by the mail server, error follows:", 0); - $conf{'error'} =~ s/^ERROR/WARNING/o; - printmsg($conf{'error'}, 0); - } - elsif ($oneRcptAccepted == 0) { - $oneRcptAccepted = 1; - } -} -## If no recipients were accepted we need to exit with an error. -if ($oneRcptAccepted == 0) { - quit("ERROR => Exiting. No recipients were accepted for delivery by the mail server.", 1); -} - -## DATA -if (SMTPchat('DATA')) { quit($conf{'error'}, 1); } - - -############################### -## Build and send the body ## -############################### -printmsg("INFO => Sending message body",1); - -## If the message-format is raw just send the message as-is. -if ($opt{'message-format'} =~ /^raw$/i) { - print $SERVER $message; -} - -## If the message-format isn't raw, then build and send the message, -else { - - ## Message-ID: - if ($opt{'message-header'} !~ /^Message-ID:/iom) { - $header .= 'Message-ID: <' . $conf{'Message-ID'} . '@' . $conf{'hostname'} . '>' . $CRLF; - } - - ## From: "Name" (the pointless test below is just to keep scoping correct) - if ($from and $opt{'message-header'} !~ /^From:/iom) { - my ($name, $address) = returnAddressParts($from); - $header .= 'From: "' . $name . '" <' . $address . '>' . $CRLF; - } - - ## Reply-To: - if ($opt{'reply-to'} and $opt{'message-header'} !~ /^Reply-To:/iom) { - my ($name, $address) = returnAddressParts($opt{'reply-to'}); - $header .= 'Reply-To: "' . $name . '" <' . $address . '>' . $CRLF; - } - - ## To: "Name" - if ($opt{'message-header'} =~ /^To:/iom) { - ## The user put the To: header in via -o message-header - dont do anything - } - elsif (scalar(@to) > 0) { - $header .= "To:"; - for (my $a = 0; $a < scalar(@to); $a++) { - my $msg = ""; - - my ($name, $address) = returnAddressParts($to[$a]); - $msg = " \"$name\" <$address>"; - - ## If we're not on the last address add a comma to the end of the line. - if (($a + 1) != scalar(@to)) { - $msg .= ","; - } - - $header .= $msg . $CRLF; - } - } - ## We always want a To: line so if the only recipients were bcc'd they don't see who it was sent to - else { - $header .= "To: \"Undisclosed Recipients\" <>$CRLF"; - } - - if (scalar(@cc) > 0 and $opt{'message-header'} !~ /^Cc:/iom) { - $header .= "Cc:"; - for (my $a = 0; $a < scalar(@cc); $a++) { - my $msg = ""; - - my ($name, $address) = returnAddressParts($cc[$a]); - $msg = " \"$name\" <$address>"; - - ## If we're not on the last address add a comma to the end of the line. - if (($a + 1) != scalar(@cc)) { - $msg .= ","; - } - - $header .= $msg . $CRLF; - } - } - - if ($opt{'message-header'} !~ /^Subject:/iom) { - $header .= 'Subject: ' . $subject . $CRLF; ## Subject - } - if ($opt{'message-header'} !~ /^Date:/iom) { - $header .= 'Date: ' . $date . $CRLF; ## Date - } - if ($opt{'message-header'} !~ /^X-Mailer:/iom) { - $header .= 'X-Mailer: sendEmail-'.$conf{'version'}.$CRLF; ## X-Mailer - } - ## I wonder if I should put this in by default? - # if ($opt{'message-header'} !~ /^X-Originating-IP:/iom) { - # $header .= 'X-Originating-IP: ['.$conf{'ip'}.']'.$CRLF; ## X-Originating-IP - # } - - ## Encode all messages with MIME. - if ($opt{'message-header'} !~ /^MIME-Version:/iom) { - $header .= "MIME-Version: 1.0$CRLF"; - } - if ($opt{'message-header'} !~ /^Content-Type:/iom) { - my $content_type = 'multipart/mixed'; - if (scalar(@attachments) == 0) { $content_type = 'multipart/related'; } - $header .= "Content-Type: $content_type; boundary=\"$conf{'delimiter'}\"$CRLF"; - } - - ## Send additional message header line(s) if specified - if ($opt{'message-header'}) { - $header .= $opt{'message-header'}; - } - - ## Send the message header to the server - print $SERVER $header . $CRLF; - - ## Start sending the message body to the server - print $SERVER "This is a multi-part message in MIME format. To properly display this message you need a MIME-Version 1.0 compliant Email program.$CRLF"; - print $SERVER "$CRLF"; - - - ## Send message body - print $SERVER "--$conf{'delimiter'}$CRLF"; - ## Send a message content-type header: - ## If the message contains HTML... - if ($opt{'message-content-type'} eq 'html' or ($opt{'message-content-type'} eq 'auto' and $message =~ /^\s*( 0) { - ## Disable the alarm so people on modems can send big attachments - alarm(0) if ($^O !~ /win/i); ## alarm() doesn't work in win32 - - ## Send the attachments - foreach my $filename (@attachments) { - ## This is check 2, we already checked this above, but just in case... - if ( ! -f $filename ) { - printmsg("ERROR => The file [$filename] doesn't exist! Email will be sent, but without that attachment.", 0); - } - elsif ( ! -r $filename ) { - printmsg("ERROR => Couldn't open the file [$filename] for reading: $! Email will be sent, but without that attachment.", 0); - } - else { - printmsg("DEBUG => Sending the attachment [$filename]", 1); - send_attachment($filename); - } - } - } - - - ## End the mime encoded message - print $SERVER "$CRLF--$conf{'delimiter'}--$CRLF"; -} - - -## Tell the server we are done sending the email -print $SERVER "$CRLF.$CRLF"; -if (SMTPchat()) { quit($conf{'error'}, 1); } - - - -#################### -# We are done!!! # -#################### - -## Disconnect from the server (don't SMTPchat(), it breaks when using TLS) -print $SERVER "QUIT$CRLF"; -close $SERVER; - - - - - - -####################################### -## Generate exit message/log entry ## -####################################### - -if ($conf{'debug'} or $conf{'logging'}) { - printmsg("Generating a detailed exit message", 3); - - ## Put the message together - my $output = "Email was sent successfully! From: <" . (returnAddressParts($from))[1] . "> "; - - if (scalar(@to) > 0) { - $output .= "To: "; - for ($a = 0; $a < scalar(@to); $a++) { - $output .= "<" . (returnAddressParts($to[$a]))[1] . "> "; - } - } - if (scalar(@cc) > 0) { - $output .= "Cc: "; - for ($a = 0; $a < scalar(@cc); $a++) { - $output .= "<" . (returnAddressParts($cc[$a]))[1] . "> "; - } - } - if (scalar(@bcc) > 0) { - $output .= "Bcc: "; - for ($a = 0; $a < scalar(@bcc); $a++) { - $output .= "<" . (returnAddressParts($bcc[$a]))[1] . "> "; - } - } - $output .= "Subject: [$subject] " if ($subject); - if (scalar(@attachments_names) > 0) { - $output .= "Attachment(s): "; - foreach(@attachments_names) { - $output .= "[$_] "; - } - } - $output .= "Server: [$conf{'server'}:$conf{'port'}]"; - - -###################### -# Exit the program # -###################### - - ## Print / Log the detailed message - quit($output, 0); -} -else { - ## Or the standard message - quit("Email was sent successfully!", 0); -} - diff --git a/app/static/css/fonts/fld.svg b/app/static/css/fonts/fld.svg deleted file mode 100644 index 3cfec0d..0000000 --- a/app/static/css/fonts/fld.svg +++ /dev/null @@ -1,134 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/css/fonts/fld.ttf b/app/static/css/fonts/fld.ttf deleted file mode 100644 index 4821c6f..0000000 Binary files a/app/static/css/fonts/fld.ttf and /dev/null differ diff --git a/app/static/css/fonts/fld.woff b/app/static/css/fonts/fld.woff deleted file mode 100644 index ff7a282..0000000 Binary files a/app/static/css/fonts/fld.woff and /dev/null differ diff --git a/app/static/css/icons.css b/app/static/css/icons.css deleted file mode 100644 index d4e2b69..0000000 --- a/app/static/css/icons.css +++ /dev/null @@ -1,423 +0,0 @@ -@font-face { - font-family: 'fld'; - src: - url('fonts/fld.ttf?lwva39') format('truetype'), - url('fonts/fld.woff?lwva39') format('woff'), - url('fonts/fld.svg?lwva39#fld') format('svg'); - font-weight: normal; - font-style: normal; - font-display: block; -} - -[class^="icon-"], [class*=" icon-"] { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'fld' !important; - speak: never; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Enable Ligatures ================ */ - letter-spacing: 0; - -webkit-font-feature-settings: "liga"; - -moz-font-feature-settings: "liga=1"; - -moz-font-feature-settings: "liga"; - -ms-font-feature-settings: "liga" 1; - font-feature-settings: "liga"; - -webkit-font-variant-ligatures: discretionary-ligatures; - font-variant-ligatures: discretionary-ligatures; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -<<<<<<< HEAD -.icon-send:before { - content: "\e96b"; -} -.icon-sportresult:before { - content: "\e96a"; -} -.icon-lictransfer:before { - content: "\e95e"; -} -.icon-licplus:before { - content: "\e95f"; -} -.icon-licinfo:before { - content: "\e960"; -} -.icon-liclock:before { - content: "\e961"; -} -.icon-licrenew:before { - content: "\e962"; -} -.icon-darts2:before { - content: "\e963"; -} -.icon-calweek:before { - content: "\e964"; -} -.icon-addcard:before { - content: "\e965"; -} -.icon-info1:before { - content: "\e966"; -} -.icon-print1:before { - content: "\e967"; -} -.icon-phone1:before { - content: "\e968"; -} -.icon-register:before { - content: "\e969"; -} -.icon-licenses:before { - content: "\e95d"; -} -.icon-folderfind:before { - content: "\e930"; -} -======= -.icon-folderfind:before { - content: "\e930"; -} ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -.icon-access:before { - content: "\e931"; -} -.icon-add:before { - content: "\e910"; -} -.icon-address:before { - content: "\e901"; -} -.icon-adobepdf:before { - content: "\e933"; -} -.icon-agreement:before { - content: "\e91b"; -} -.icon-apps:before { - content: "\e917"; -} -.icon-apps1:before { - content: "\e91c"; -} -.icon-archive:before { - content: "\e91d"; -} -.icon-back:before { - content: "\e918"; -} -.icon-backup:before { - content: "\e919"; -} -.icon-bill:before { - content: "\e91e"; -} -.icon-calendar:before { - content: "\e91f"; -} -.icon-close:before { - content: "\e91a"; -} -.icon-club:before { - content: "\e937"; -} -.icon-clubs:before { - content: "\e938"; -} -.icon-code:before { - content: "\e902"; -} -.icon-contract:before { - content: "\e934"; -} -.icon-copy:before { - content: "\e920"; -} -.icon-cube:before { - content: "\e923"; -} -.icon-cubelight:before { - content: "\e924"; -} -.icon-dashboard1:before { - content: "\e925"; -} -.icon-date:before { - content: "\e90b"; -} -.icon-documents:before { - content: "\e903"; -} -.icon-documentsave:before { - content: "\e926"; -} -.icon-download4:before { - content: "\e921"; -<<<<<<< HEAD -} -.icon-download:before { - content: "\e9c7"; -} -.icon-drawer:before { - content: "\e95c"; -======= ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -} -.icon-duplicate:before { - content: "\e922"; -} -.icon-edit:before { - content: "\e927"; -} -.icon-email:before { - content: "\e928"; -} -.icon-excel:before { - content: "\e905"; -} -.icon-exit:before { - content: "\e929"; -} -.icon-file:before { - content: "\e92a"; -} -.icon-filter:before { - content: "\e939"; -} -.icon-find:before { - content: "\e904"; -} -.icon-folder:before { - content: "\e92c"; -} -.icon-folderadd:before { - content: "\e92d"; -} -.icon-foldercube:before { - content: "\e92e"; -} -.icon-folderdelete:before { - content: "\e92f"; -} -.icon-globe:before { - content: "\e93d"; -} -.icon-group:before { - content: "\e932"; -} -.icon-help:before { - content: "\e93a"; -} -.icon-history:before { - content: "\e93b"; -} -.icon-home:before { - content: "\e93c"; -} -.icon-image:before { - content: "\e906"; -} -.icon-inbox:before { - content: "\e93f"; -} -.icon-info:before { - content: "\e93e"; -} -.icon-library:before { - content: "\e907"; -} -.icon-star2:before { - content: "\e935"; -} -.icon-list:before { - content: "\e936"; -} -.icon-location:before { - content: "\e941"; -} -.icon-log:before { - content: "\e909"; -} -.icon-logout:before { - content: "\e90a"; -<<<<<<< HEAD -} -.icon-map:before { - content: "\e95a"; -======= ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -} -.icon-menu:before { - content: "\e942"; -} -.icon-newspaper:before { - content: "\e943"; -} -.icon-next:before { - content: "\e944"; -} -.icon-numberlist:before { - content: "\e90c"; -} -.icon-package:before { - content: "\e90d"; -} -.icon-pdf:before { - content: "\e945"; -} -.icon-pdf1:before { - content: "\e90e"; -} -.icon-pdfexport:before { - content: "\e90f"; -} -.icon-phone:before { - content: "\e946"; -} -.icon-pictures:before { - content: "\e947"; -} -.icon-plus:before { - content: "\e911"; -} -.icon-preview:before { - content: "\e948"; -} -.icon-print:before { - content: "\e949"; -} -<<<<<<< HEAD -.icon-profile:before { - content: "\e95b"; -} -======= ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -.icon-projects:before { - content: "\e912"; -} -.icon-refresh:before { - content: "\e94a"; -} -.icon-refresh1:before { - content: "\e94b"; -} -.icon-remove:before { - content: "\e913"; -} -.icon-rename:before { - content: "\e914"; -} -.icon-save:before { - content: "\e92b"; -} -.icon-save2:before { - content: "\e940"; -} -.icon-season:before { - content: "\e900"; -} -.icon-settings:before { - content: "\e94c"; -} -.icon-sort:before { - content: "\e94d"; -} -.icon-squares:before { - content: "\e94e"; -} -.icon-star:before { - content: "\e908"; -} -.icon-sync:before { - content: "\e94f"; -} -.icon-table:before { - content: "\e915"; -} -.icon-target:before { - content: "\e950"; -<<<<<<< HEAD -} -.icon-time:before { - content: "\e951"; -} -.icon-transfer:before { - content: "\e952"; -} -.icon-trash:before { - content: "\e953"; -} -.icon-upload5:before { - content: "\e954"; -} -.icon-uploadfile:before { - content: "\e916"; -} -.icon-upload:before { - content: "\e9c8"; -} -.icon-user:before { - content: "\e971"; -======= -} -.icon-time:before { - content: "\e951"; -} -.icon-transfer:before { - content: "\e952"; -} -.icon-trash:before { - content: "\e953"; -} -.icon-upload5:before { - content: "\e954"; -} -.icon-uploadfile:before { - content: "\e916"; ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -} -.icon-user2:before { - content: "\e955"; -} -.icon-usergroup:before { - content: "\e956"; -} -.icon-viewpdf:before { - content: "\e957"; -} -.icon-warning:before { - content: "\e958"; -} -.icon-website:before { - content: "\e959"; -<<<<<<< HEAD -======= -} -.icon-download:before { - content: "\e9c7"; -} -.icon-drawer:before { - content: "\e95c"; -} -.icon-map:before { - content: "\e95a"; -} -.icon-profile:before { - content: "\e95b"; -} -.icon-upload:before { - content: "\e9c8"; -} -.icon-user:before { - content: "\e971"; ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -} diff --git a/app/static/css/theme.css b/app/static/css/theme.css deleted file mode 100644 index 3a5859a..0000000 --- a/app/static/css/theme.css +++ /dev/null @@ -1,1015 +0,0 @@ -/* W3PRO.CSS 4.13 June 2019 by Jan Egil and Borge Refsnes */ -html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} -/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ -html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} -html,body {-webkit-user-select: none;-ms-user-select: none;user-select: none;-moz-user-select:none;} -article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item} -audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} -audio:not([controls]){display:none;height:0}[hidden],template{display:none} -a{background-color:transparent}a:active,a:hover{outline-width:0} -abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} -b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000} -small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none} -code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible} -button,input,select,textarea,optgroup{font:inherit;margin:0}optgroup{font-weight:bold} -button,input{overflow:visible}button,select{text-transform:none} -button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button} -button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0} -button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} -[type=checkbox],[type=radio]{padding:0} -[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} -[type=search]{-webkit-appearance:textfield;outline-offset:-2px} -[type=search]::-webkit-search-decoration{-webkit-appearance:none} -::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} -/* End extract */ -/* html,body { - background-color: #52638e; -} */ -html,body{font-family:Verdana,sans-serif;font-size:10pt;line-height:1.5}html{overflow-x:hidden} -h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.serif{font-family:serif} -h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin: 0}.wide{letter-spacing:4px} -hr{border:0;border-top:1px solid #eee;margin:20px 0} -.img{max-width:100%;height:auto; vertical-align:middle}a{color:inherit} -.table,.table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.table-all{border:1px solid #ccc} -.bordered tr,.table-all tr{border-bottom:1px solid #ddd}.striped tbody tr:nth-child(even){background-color:#f1f1f1} -.table-all tr:nth-child(odd){background-color:#fff}.table-all tr:nth-child(even){background-color:#f1f1f1} -.hoverable tbody tr:hover,.ul.hoverable li:hover{background-color:#ccc}.centered tr th,.centered tr td{text-align:center} -.table td,.table th,.table-all td,.table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} -.table th:first-child,.table td:first-child,.table-all th:first-child,.table-all td:first-child{padding-left:16px} -.btn,.button{border:none;display:inline-block;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap} -.btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} -.btn,.button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.disabled,.btn:disabled,.button:disabled{cursor:not-allowed;background-color: #e6e6e6}.disabled *,:disabled *{pointer-events:none} -.btn.disabled:hover,.btn:disabled:hover{box-shadow:none} -.badge,.tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.badge{border-radius:50%} -.ul{list-style-type:none;padding:0;margin:0}.ul li{padding:8px 16px;border-bottom:1px solid #ddd}.ul li:last-child{border-bottom:none} -.tooltip,.display-container{position:relative}.tooltip .text{display:none}.tooltip:hover .text{display:inline-block} -.ripple:active{opacity:0.5}.ripple{transition:opacity 0s} -.input{padding:6px;display:block;border: 1px solid #ccc;width:100%;background-color: #fff; }/*#e8f0fe*/ -.select{padding:2px 0; display:block;width:100%;border:1px solid #ccc;background-color: #fff;} -.dropdown-click,.dropdown-hover{position:relative;display:inline-block;cursor:pointer} -.dropdown-hover:hover .dropdown-content{display:block; } -.dropdown-hover:first-child,.dropdown-click:hover{background-color:#ccc;color:#000} -.dropdown-hover:hover > .button:first-child,.dropdown-click:hover > .button:first-child{background-color:#ccc;color:#000} -.dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0;z-index:1} -.check,.radio{width:24px;height:24px;position:relative;top:6px} -.sidebar{height:100%;width:160px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} -.bar-block .dropdown-hover,.bar-block .dropdown-click{width:100%} -.bar-block .dropdown-hover .dropdown-content,.bar-block .dropdown-click .dropdown-content{min-width:100%} -.bar-block .dropdown-hover .button,.bar-block .dropdown-click .button{width:100%;text-align:left;padding:8px 16px} -.main,#main{transition:margin-left .4s} -.modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} -.modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} -.bar{width:100%}.center .bar{display:inline-block;width:auto} -.bar .bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0} -.bar .dropdown-hover,.bar .dropdown-click{position:static;float:left} -.bar .button{white-space:normal} -.bar-block .bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0} -.bar-block.center .bar-item{text-align:center}.block{display:block;width:100%} -.responsive{display:block;overflow-x:auto} -.container:after,.container:before,.datapanel:after,.datapanel:before,.row:after,.row:before,.row-padding:after,.row-padding:before, -.cell-row:before,.cell-row:after,.clear:after,.clear:before,.bar:before,.bar:after{content:"";display:table;clear:both} -.col,.half,.third,.twothird,.threequarter,.quarter,.fifth,.twofifth,.threefifth,.fourfifth{float:left;width:100%} -.col.s1{width:8.33333%}.col.s2{width:16.66666%}.col.s3{width:24.99999%}.col.s4{width:33.33333%} -.col.s5{width:41.66666%}.col.s6{width:49.99999%}.col.s7{width:58.33333%}.col.s8{width:66.66666%} -.col.s9{width:74.99999%}.col.s10{width:83.33333%}.col.s11{width:91.66666%}.col.s12{width:99.99999%} -@media (min-width:601px){.col.m1{width:8.33333%}.col.m2{width:16.66666%}.col.m3,.quarter{width:24.99999%}.col.m4,.third{width:33.33333%}.fifth{width:20%;min-width:100px} -.col.m5{width:41.66666%}.col.m6,.half{width:49.99999%}.col.m7{width:58.33333%}.col.m8,.twothird{width:66.66666%} -.col.m9,.threequarter{width:74.99999%}.col.m10{width:83.33333%}.col.m11{width:91.66666%}.col.m12{width:99.99999%}.twofifth{width:40%}.threefifth{width:60%}.fourfifth{width:80%}} -@media (min-width:993px){.col.l1{width:8.33333%}.col.l2{width:16.66666%}.col.l3{width:24.99999%}.col.l4{width:33.33333%} -.col.l5{width:41.66666%}.col.l6{width:49.99999%}.col.l7{width:58.33333%}.col.l8{width:66.66666%} -.col.l9{width:74.99999%}.col.l10{width:83.33333%}.col.l11{width:91.66666%}.col.l12{width:99.99999%}} -.rest{overflow:hidden}.stretch{margin-left:-16px;margin-right:-16px} -.content,.auto{margin-left:auto;margin-right:auto}.content{max-width:980px}.auto{max-width:1140px} -.cell-row{display:table;width:100%}.cell{display:table-cell} -.cell-top{vertical-align:top}.cell-middle{vertical-align:middle}.cell-bottom{vertical-align:bottom} -.hide{display:none!important}.show-block,.show{display:block!important}.show-inline-block{display:inline-block!important} -@media (max-width:1205px){.auto{max-width:95%}} -@media (max-width:600px){.modal-content{margin:0 10px;width:auto!important}.modal{padding-top:30px} -.dropdown-hover.mobile .dropdown-content,.dropdown-click.mobile .dropdown-content{position:relative} -.hide-small{display:none!important}.mobile{display:block;width:100%!important}.bar-item.mobile,.dropdown-hover.mobile,.dropdown-click.mobile{text-align:left} -.dropdown-hover.mobile,.dropdown-hover.mobile .btn,.dropdown-hover.mobile .button,.dropdown-click.mobile,.dropdown-click.mobile .btn,.dropdown-click.mobile .button{width:100%}} -@media (max-width:768px){.modal-content{width:500px}.modal{padding-top:50px}} -@media (min-width:993px){.modal-content{width:900px}.hide-large{display:none!important}.sidebar.collapse{display:block!important}} -@media (max-width:992px) and (min-width:601px){.hide-medium{display:none!important}} -@media (max-width:992px){.sidebar.collapse{display:none}.main{margin-left:0!important;margin-right:0!important}.auto{max-width:100%}} -.top,.bottom{position:fixed;width:100%;z-index:1}.top{top:0}.bottom{bottom:0} -.overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} -.display-topleft{position:absolute;left:0;top:0}.display-topright{position:absolute;right:0;top:0} -.display-bottomleft{position:absolute;left:0;bottom:0}.display-bottomright{position:absolute;right:0;bottom:0} -.display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} -.display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} -.display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} -.display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-container:hover .display-hover{display:block}.display-container:hover span.display-hover{display:inline-block}.display-hover{display:none} -.display-position{position:absolute} -.circle{border-radius:50%} -.round-small{border-radius:2px}.round,.round-medium{border-radius:4px}.round-large{border-radius:8px}.round-xlarge{border-radius:16px}.round-xxlarge{border-radius:32px} -.row-padding,.row-padding>.half,.row-padding>.third,.row-padding>.twothird,.row-padding>.threequarter,.row-padding>.quarter,.row-padding>.col{padding:0 8px} -.container,.datapanel{padding:0.01em 8px}.datapanel{margin-top:8px;margin-bottom:8px} -.code,.codespan{font-family:Consolas,"courier new";font-size:16px} -.code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} -.codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} -.card,.card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16)} -.card-4,.hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)} -.spin{animation:spin 2s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} -.animate-fading{animation:fading 2s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -.animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}} -.animate-top{position:relative;animation:animatetop 1s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -.animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -.animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -.animate-bottom{position:relative;animation:animatebottom 1s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} -.animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} -.animate-input{transition:width 0.4s ease-in-out}.animate-input:focus{width:100%!important} -.opacity,.hover-opacity:hover{opacity:0.60}.opacity-off,.hover-opacity-off:hover{opacity:1} -.opacity-max{opacity:0.25}.opacity-min{opacity:0.75} -.greyscale-max,.grayscale-max,.hover-greyscale:hover,.hover-grayscale:hover{filter:grayscale(100%)} -.greyscale,.grayscale{filter:grayscale(75%)}.greyscale-min,.grayscale-min{filter:grayscale(50%)} -.sepia{filter:sepia(75%)}.sepia-max,.hover-sepia:hover{filter:sepia(100%)}.sepia-min{filter:sepia(50%)} -.tiny{font-size:10px!important}.small{font-size:12px!important}.medium{font-size:15px!important}.large{font-size:18px!important} -.xlarge{font-size:24px!important}.xxlarge{font-size:36px!important}.xxxlarge{font-size:48px!important}.jumbo{font-size:64px!important} -.left-align{text-align:left!important}.right-align{text-align:right!important}.justify{text-align:justify!important}.center{text-align:center!important} -.border-0{border:0!important}.border{border:1px solid #ccc!important} -.border-top{border-top:1px solid #ccc!important}.border-bottom{border-bottom:1px solid #ccc!important} -.border-left{border-left:1px solid #ccc!important}.border-right{border-right:1px solid #ccc!important} -.topbar{border-top:6px solid #ccc!important}.bottombar{border-bottom:6px solid #ccc!important} -.leftbar{border-left:6px solid #ccc!important}.rightbar{border-right:6px solid #ccc!important} -.section,.code{margin-top:16px!important;margin-bottom:16px!important} -.margin{margin:16px!important}.margin-top{margin-top:16px!important}.margin-bottom{margin-bottom:16px!important} -.margin-left{margin-left:16px!important}.margin-right{margin-right:16px!important} -.padding-small{padding:4px 8px!important}.padding{padding:8px 16px!important}.padding-large{padding:12px 24px!important} -.padding-16{padding-top:16px!important;padding-bottom:16px!important}.padding-24{padding-top:24px!important;padding-bottom:24px!important} -.padding-32{padding-top:32px!important;padding-bottom:32px!important}.padding-48{padding-top:48px!important;padding-bottom:48px!important} -.padding-64{padding-top:64px!important;padding-bottom:64px!important} -.left{float:left!important}.right{float:right!important} -.button:hover{color:#fff!important;background-color:#343434!important} -.transparent,.hover-none:hover{background-color:transparent!important} -.hover-none:hover{box-shadow:none!important} -/* DEFAULT COLORS */ -.amber,.hover-amber:hover{color:#000!important;background-color:#ffc107!important} -.aqua,.hover-aqua:hover{color:#000!important;background-color:#00ffff!important} -.blue,.hover-blue:hover{color:#fff!important;background-color:#2196F3!important} -.light-blue,.hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} -.brown,.hover-brown:hover{color:#fff!important;background-color:#795548!important} -.cyan,.hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} -.blue-grey,.hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important} -.green,.hover-green:hover{color:#fff!important;background-color:#4CAF50!important} -.light-green,.hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} -.indigo,.hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} -.khaki,.hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} -.lime,.hover-lime:hover{color:#000!important;background-color:#cddc39!important} -.orange,.hover-orange:hover{color:#000!important;background-color:#ff9800!important} -.deep-orange,.hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} -.pink,.hover-pink:hover{color:#fff!important;background-color:#e91e63!important} -.purple,.hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} -.deep-purple,.hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} -.red,.hover-red:hover{color:#fff!important;background-color:#f44336!important} -.sand,.hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} -.teal,.hover-teal:hover{color:#fff!important;background-color:#009688!important} -.yellow,.hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} -.white,.hover-white:hover{color:#000!important;background-color:#fff!important} -.black,.hover-black:hover{color:#fff!important;background-color:#000!important} -.grey,.hover-grey:hover{color:#000!important;background-color:#9e9e9e!important} -.light-grey,.hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important} -.dark-grey,.hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} -.pale-red,.hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.pale-green,.hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} -.pale-yellow,.hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.pale-blue,.hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} -.text-align-right { text-align: right;} -.text-amber,.hover-text-amber:hover{color:#ffc107!important} -.text-aqua,.hover-text-aqua:hover{color:#00ffff!important} -.text-blue,.hover-text-blue:hover{color:#2196F3!important} -.text-light-blue,.hover-text-light-blue:hover{color:#87CEEB!important} -.text-brown,.hover-text-brown:hover{color:#795548!important} -.text-cyan,.hover-text-cyan:hover{color:#00bcd4!important} -.text-blue-grey,.hover-text-blue-grey:hover{color:#607d8b!important} -.text-green,.hover-text-green:hover{color:#4CAF50!important} -.text-light-green,.hover-text-light-green:hover{color:#8bc34a!important} -.text-indigo,.hover-text-indigo:hover{color:#3f51b5!important} -.text-khaki,.hover-text-khaki:hover{color:#b4aa50!important} -.text-lime,.hover-text-lime:hover{color:#cddc39!important} -.text-orange,.hover-text-orange:hover{color:#ff9800!important} -.text-deep-orange,.hover-text-deep-orange:hover{color:#ff5722!important} -.text-pink,.hover-text-pink:hover{color:#e91e63!important} -.text-purple,.hover-text-purple:hover{color:#9c27b0!important} -.text-deep-purple,.hover-text-deep-purple:hover{color:#673ab7!important} -.text-red,.hover-text-red:hover{color:#f44336!important} -.text-sand,.hover-text-sand:hover{color:#fdf5e6!important} -.text-teal,.hover-text-teal:hover{color:#009688!important} -.text-yellow,.hover-text-yellow:hover{color:#d2be0e!important} -.text-white,.hover-text-white:hover{color:#fff!important} -.text-black,.hover-text-black:hover{color:#000!important} -.text-grey,.hover-text-grey:hover{color:#757575!important} -.text-light-grey,.hover-text-light-grey:hover{color:#f1f1f1!important} -.text-dark-grey,.hover-text-dark-grey:hover{color:#3a3a3a!important} -.border-amber,.hover-border-amber:hover{border-color:#ffc107!important} -.border-aqua,.hover-border-aqua:hover{border-color:#00ffff!important} -.border-blue,.hover-border-blue:hover{border-color:#2196F3!important} -.border-light-blue,.hover-border-light-blue:hover{border-color:#87CEEB!important} -.border-brown,.hover-border-brown:hover{border-color:#795548!important} -.border-cyan,.hover-border-cyan:hover{border-color:#00bcd4!important} -.border-blue-grey,.hover-blue-grey:hover{border-color:#607d8b!important} -.border-green,.hover-border-green:hover{border-color:#4CAF50!important} -.border-light-green,.hover-border-light-green:hover{border-color:#8bc34a!important} -.border-indigo,.hover-border-indigo:hover{border-color:#3f51b5!important} -.border-khaki,.hover-border-khaki:hover{border-color:#f0e68c!important} -.border-lime,.hover-border-lime:hover{border-color:#cddc39!important} -.border-orange,.hover-border-orange:hover{border-color:#ff9800!important} -.border-deep-orange,.hover-border-deep-orange:hover{border-color:#ff5722!important} -.border-pink,.hover-border-pink:hover{border-color:#e91e63!important} -.border-purple,.hover-border-purple:hover{border-color:#9c27b0!important} -.border-deep-purple,.hover-border-deep-purple:hover{border-color:#673ab7!important} -.border-red,.hover-border-red:hover{border-color:#f44336!important} -.border-sand,.hover-border-sand:hover{border-color:#fdf5e6!important} -.border-teal,.hover-border-teal:hover{border-color:#009688!important} -.border-yellow,.hover-border-yellow:hover{border-color:#ffeb3b!important} -.border-white,.hover-border-white:hover{border-color:#fff!important} -.border-black,.hover-border-black:hover{border-color:#000!important} -.border-grey,.hover-border-grey:hover{border-color:#9e9e9e!important} -.border-light-grey,.hover-border-light-grey:hover{border-color:#f1f1f1!important} -.border-dark-grey,.hover-border-dark-grey:hover{border-color:#616161!important} -.border-pale-red,.hover-border-pale-red:hover{border-color:#ffe7e7!important}.border-pale-green,.hover-border-pale-green:hover{border-color:#e7ffe7!important} -.border-pale-yellow,.hover-border-pale-yellow:hover{border-color:#ffffd7!important}.border-pale-blue,.hover-border-pale-blue:hover{border-color:#e7ffff!important} -/* DEFAULT THEME */ -.theme-l5 {color:#000 !important; background-color:#f6f8fc !important} -.theme-l4 {color:#000 !important; background-color:#e1e9f6 !important} -.theme-l3 {color:#000 !important; background-color:#c3d3ed !important} -.theme-l2 {color:#000 !important; background-color:#a5bee4 !important} -.theme-l1 {color:#fff !important; background-color:#88a8db !important} -.theme-d1 {color:#fff !important; background-color:#5180cb !important} -.theme-d2 {color:#fff !important; background-color:#3a6fc3 !important} -.theme-d3 {color:#fff !important; background-color:#3361aa !important} -.theme-d4 {color:#fff !important; background-color:#2c5392 !important} -.theme-d5 {color:#fff !important; background-color:#24457a !important} - -.theme-light {color:#000 !important; background-color:#f6f8fc !important} -.theme-dark {color:#fff !important; background-color:#24457a !important} -.theme-action {color:#fff !important; background-color:#24457a !important} - -.theme {color:#fff !important; background-color:#6a92d3 !important} -.text-theme {color:#6a92d3 !important} -.border-theme {border-color:#6a92d3 !important} - -.hover-theme:hover {color:#fff !important; background-color:#6a92d3 !important} -.hover-text-theme:hover {color:#6a92d3 !important} -.hover-border-theme:hover {border-color:#6a92d3 !important} - -/* .label { color: #000; font-size: 8pt;} */ -/* #main {margin-left: 210px;} */ -/* @media (max-width:768px){ - #sidebar { display: none;} - #main { margin-left: 0px;} -} */ - - - -.table { - table-layout: fixed; -} - -.text-line-through { text-decoration: line-through; } - -#snackbar { - visibility: hidden; - min-width: 250px; - margin-left: -125px; - background-color: #333; - color: #fff; - text-align: center; - - padding: 16px; - position: fixed; - z-index: 1; - left: 50%; - bottom: 30px; - font-size: 17px; -} - -#snackbar.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; -} - -@-webkit-keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@-webkit-keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -@keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -.tabulator-header-filter > input { - background-color: #fff; - border: 1px solid #ccc; - font-weight: normal; -} - -.readonly { - pointer-events:none; - color: #000!important; - background-color: #d3d3d3!important; -} - - - -.right-side-bg { - background: url("../img/bg1.jpg"); - background-size: cover; - min-height: 100vh; -} - - - - -/* .mceContentBody { - background: #fff; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - - -button -{ - background-color: #f4f4f4; - border: 1pt solid #cccccc; - font-size: 10pt; - color: #000; - line-height: 1line; - text-align: center; -} -button:hover -{ - background-color: #343434; -} -button:pressed -{ - background-color: #343434; -} -button:focus -{ - background-color: #343434; -} - - - - -header -{ - background-color: #fff; - box-sizing: border-box; -} - - -.actionbtn { - background-color: #293146; - color: #fff; -} - -::-webkit-input-placeholder -{ - color: rgba(60.3922%,60.3922%,60.3922%,1); -} - - -textarea -{ - background-color: #fff; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-size: 11pt; - color: #000; - line-height: 1line; - text-align: left; - /* margin-top: 0.88em; - margin-right: 0.75em; - margin-bottom: 0.63em; - margin-left: 0.75em; - top: 0pt; - right: 30pt; - bottom: 0pt; - left: 0pt; - position: absolute; - box-sizing: border-box; */ -} -textarea:focus -{ - border-top-color: rgba(0%,43.9216%,81.1765%,1); - border-right-color: rgba(0%,43.9216%,81.1765%,1); - border-bottom-color: rgba(0%,43.9216%,81.1765%,1); - border-left-color: rgba(0%,43.9216%,81.1765%,1); -} -textarea:placeholder -{ - color: rgba(80%,80%,80%,1); -} -/* textarea .text -{ - -} */ -textarea .scrollbar_track -{ - width: 30pt; - top: 0pt; - right: 0pt; - bottom: 0pt; - position: absolute; - box-sizing: border-box; -} - - -footer -{ - background-color: #fff; - box-sizing: border-box; -} - - -div.group_container -{ - background-color: #e3e3e3; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - padding-top: 4px; - padding-bottom: 8px; -} - -/* Custom Styles */ -.ListView_Default -{ - - background-color: rgba(0%,0%,0%,0); - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - - color: #000; - text-align: left; - margin-top: 2pt; - margin-right: 2pt; - margin-bottom: 2pt; - margin-left: 2pt; -} - - -button.btnNavigation -{ - - background-color: rgba(0%,0%,0%,0); - - font-family: -fm-font-family(Arial,Arial-BoldMT); - font-weight: bold; - font-size: 10pt; - color: #fff; - padding-top: 0pt; - padding-right: 0pt; - padding-bottom: 0pt; - padding-left: 0pt; -} - -div.PageListHeader -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - color: #fff; - -fm-text-vertical-align: center; -} -div.PageListHeader .inner_border -{ - padding-top: 5pt; - padding-right: 5pt; - padding-bottom: 5pt; - padding-left: 5pt; -} - -.moduletoolbar -{ - background-color: #293146; - color: #fff; -} - -div.BodySectionHeader -{ - font-family: -fm-font-family(Arial,Arial-BoldMT); - font-weight: bold; -} - - -div.PageHeadTitle -{ - font-size: 18pt; - color: #fff; -} - -div.SubHeadTitle -{ - font-size: 13pt; - color: #fff; -} - -<<<<<<< HEAD -div.SectionHeader -======= - - -div.ListView_SectionHeader ->>>>>>> 509afc930052596f387a5621613c8257684e5df4 -{ - - background-color: rgba(22.3529%,26.6667%,38.4314%,1); - -} - -button.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - background-color: rgba(0%,0%,0%,0); - color: #fff; -} -button.toolbarbtn:hover -{ - - background-color: #343434; - color: #fff; -} -button.toolbarbtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -button.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -a.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - background-color: rgba(0%,0%,0%,0); - color: #fff; - text-align: center; - text-decoration: unset; -} -a.toolbarbtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -a.toolbarbtn:pressed -{ - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -a.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - -button.bodybtn -{ - border: 0.5px solid #c6c6c6; - - background-color: rgba(0%,0%,0%,0); - - color: #000; -} -button.bodybtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -button.bodybtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -button.bodybtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -a.bodybtn -{ - border: 0.5px solid #c6c6c6; - - background-color: rgba(0%,0%,0%,0); - - color: #000; - text-align: center; - text-decoration: unset; -} -a.bodybtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -a.bodybtn:pressed -{ - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - color: #fff; -} -a.bodybtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -div.ListView_Header -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-weight: normal; - color: #fff; - -fm-text-vertical-align: center; -} -div.ListView_Header .inner_border -{ - padding-top: 2pt; - padding-right: 2pt; - padding-bottom: 2pt; - padding-left: 2pt; -} - -div.toolbar -{ - - background-color: rgba(32.1569%,38.8235%,55.6863%,1); - -} - -div.sectiontoolbar -{ - margin-top: 8px; - margin-bottom: 8px; - background-color: rgb(97, 98, 100); - -} - -div.FooterLabel -{ - color: #fff; -} - -button.Buttom_BodyNav:hover -{ - - background-color: rgb(141, 141, 141); - - /* color: #fff; */ -} - - -::-webkit-scrollbar { --webkit-appearance: none; -width: 10px; -} - -::-webkit-scrollbar-track { - background-color: rgba(80%, 80%, 80%, .5); -} - -::-webkit-scrollbar-thumb { -border-radius: 0px; -background-color: rgba(0, 0, 0, .5); --webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5); -} - -div.portaltextheader { - padding: 2px; - border: 1px solid white; -} - - - - - -select { - /* -webkit-appearance: none; */ - display: block; - color: #000; - line-height: 1line; - text-align: left; - padding: 3.5px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 1px solid #cccccc; - /* box-shadow: 0 1px 0 1px rgba(0,0,0,.04); */ - border-radius: 0px; - font-weight: normal; - font-size: 11pt; - background-color: #fff; - /* background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right .7em top 50%, 0 0; - background-size: .65em auto, 100%; */ -} - - -/* option { - appearance: none; - border: 1px solid 0070cf; - padding: 2px; -} */ -select:focus -{ - border: 1px solid #3a6fc3; - border-radius: unset; -} - - -::-webkit-select-placeholder -{ - color: #9a9a9a; -} - -div.DataFooter{ - background: #384462; -} -.input-sum{padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D; } - - -.currency-sum {padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D;} - -.currency-sum,.currency-sum:read-only { - display: block; - color: #fff; - padding: 2px; - padding-right: 12px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 1px solid #ccc; - border-radius: unset; - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: #4D4D4D; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20fill=%22white%22%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%3C/svg%3E'); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - - - -/* input[type=date]::-webkit-inner-spin-button, -input[type=date]::-webkit-outer-spin-button { - display: none; -} */ - -:focus { - outline: unset; -} - -input -{ - background-color: #ffffff; - border: 1px solid #cccccc; - font-weight: normal; - font-size: 11pt; - color: #000000; - line-height: 1line; - text-align: left; - width:100%; - padding:2px; - display:block; - border-radius: unset; -} -/* input:focus -{ - border: #0070cf; -} */ - -input:focus { - border: 1px solid #3a6fc3; - border-radius: unset; -} - -input[readonly=true]{ - color: #000!important; - background-color: #d3d3d3!important; -} - -input[type=number]::-webkit-inner-spin-button, -input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} -/* input[type=checkbox]{ - appearance: none; - display:inline-block; - font-size: 24px!important; - border: 1px solid green; -} */ - -input[class=currency] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - -input[class=currency]:read-only { - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #d3d3d3 0%,#d3d3d3 100%); -} - -input[class=percent] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22256%22%20height=%22232%22%20version=%221.0%22%3E%3Cg%20transform=%22translate(-112.3674,-128.3649)%22%3E%3Cpath%20style=%22fill:black;fill-opacity:1;stroke:none%22%20d=%22M%20317.1674,257.53698%20C%20308.53463,257.53708%20301.73774,261.20839%20296.77671,268.55094%20C%20291.91449,275.89365%20289.48349,286.1138%20289.48368,299.2114%20C%20289.48349,312.11067%20291.91449,322.2812%20296.77671,329.72303%20C%20301.73774,337.06568%20308.53463,340.737%20317.1674,340.73698%20C%20325.60128,340.737%20332.24934,337.06568%20337.11159,329.72303%20C%20342.07258,322.2812%20344.5532,312.11067%20344.55345,299.2114%20C%20344.5532,286.21302%20342.07258,276.04249%20337.11159,268.69977%20C%20332.24934,261.25801%20325.60128,257.53708%20317.1674,257.53698%20M%20317.1674,238.63466%20C%20332.84469,238.63477%20345.29739,244.09213%20354.52554,255.00675%20C%20363.75318,265.92157%20368.36713,280.65644%20368.3674,299.2114%20C%20368.36713,317.76648%20363.70357,332.50135%20354.37671,343.41605%20C%20345.14855,354.23156%20332.74546,359.6393%20317.1674,359.63931%20C%20301.29123,359.6393%20288.7393,354.23156%20279.51159,343.41605%20C%20270.28351,332.50135%20265.66956,317.76648%20265.66973,299.2114%20C%20265.66956,280.55721%20270.28351,265.82234%20279.51159,255.00675%20C%20288.83853,244.09213%20301.39045,238.63477%20317.1674,238.63466%20M%20163.5674,147.9928%20C%20155.03401,147.993%20148.28673,151.71393%20143.32554,159.15559%20C%20138.46349,166.49841%20136.03248,176.61933%20136.03252,189.51838%20C%20136.03248,202.61621%20138.46349,212.83635%20143.32554,220.17884%20C%20148.18751,227.52161%20154.93479,231.19292%20163.5674,231.1928%20C%20172.19989,231.19292%20178.94717,227.52161%20183.80926,220.17884%20C%20188.77041,212.83635%20191.25103,202.61621%20191.25113,189.51838%20C%20191.25103,176.71856%20188.77041,166.59764%20183.80926,159.15559%20C%20178.84794,151.71393%20172.10066,147.993%20163.5674,147.9928%20M%20297.9674,129.09047%20L%20321.78136,129.09047%20L%20182.7674,359.63931%20L%20158.95345,359.63931%20L%20297.9674,129.09047%20M%20163.5674,129.09047%20C%20179.24484,129.0907%20191.74715,134.54806%20201.07438,145.46256%20C%20210.4014,156.27827%20215.06496,170.96352%20215.06508,189.51838%20C%20215.06496,208.27201%20210.4014,223.05649%20201.07438,233.87187%20C%20191.84638,244.68748%20179.34406,250.09523%20163.5674,250.09512%20C%20147.79061,250.09523%20135.28829,244.68748%20126.06043,233.87187%20C%20116.93172,222.95727%20112.36739,208.17279%20112.3674,189.51838%20C%20112.36739,171.06275%20116.98134,156.37749%20126.20926,145.46256%20C%20135.43713,134.54806%20147.88983,129.0907%20163.5674,129.09047%22%20/%3E%3C/g%3E%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - -label { - height: 12.8px!important; - color: #000; - font-size: 8pt; -} - - - -input[type="checkbox"] { - display: block; - -webkit-appearance:none;/* Hides the default checkbox style */ - height:29.66px; - width:29.66px; - cursor:pointer; - position:relative; - -webkit-transition: .15s; - border-radius: unset; - border: 1px solid #cccccc; - background-color:#fff; - } - - input[type="checkbox"]:checked { - background-color:#9ABCEA; - } - - input[type="checkbox"]:before, input[type="checkbox"]:checked:before { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - line-height:2em; - text-align:center; - color:#000; - content: ''; - } - - input[type="checkbox"]:checked:before { - font-size: 11pt; - content: '✔'; - } - - input[type="checkbox"]:hover:before { - background:rgba(255,255,255,0.3); - } - - - body.mceContentBody { - background:#e8f0fe; - color:#000; -} - -/* .mceContentBody { - background: #e8f0fe; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - -:focus { - outline: 1px solid #607d8b; -} - -.modal-content > header { - background-color: #293146; - color: #fff; - padding:8px!important; - margin-bottom: 10px; -} - -.modal-content > header > h2 { - font-size: 13pt; -} - -.modal-content > footer { - - /* padding:0.01em 8px; */ - text-align:right!important; - color:#000!important; - background-color:#c6c6c6!important; - margin-top: 6px; - padding-top:8px!important; - padding-bottom:8px!important; -} - -.modal-content > header:after,.modal-content > header:before,.modal-content > footer:after,.modal-content > footer:before { - content:"";display:table;clear:both -} - -span[class^="icon"]::after { - content: "\A"; - white-space: pre; -} - -@media (max-width:600px){ - div.PageHeadTitle{font-size: 12pt;} - button {font-size: 8pt;} -} diff --git a/app/static/css/theme.old.css b/app/static/css/theme.old.css deleted file mode 100644 index e5378a2..0000000 --- a/app/static/css/theme.old.css +++ /dev/null @@ -1,939 +0,0 @@ -/* W3PRO.CSS 4.13 June 2019 by Jan Egil and Borge Refsnes */ -html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} -/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ -html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} -html,body {-webkit-user-select: none;-ms-user-select: none;user-select: none;-moz-user-select:none;} -article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item} -audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} -audio:not([controls]){display:none;height:0}[hidden],template{display:none} -a{background-color:transparent}a:active,a:hover{outline-width:0} -abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} -b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000} -small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none} -code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible} -button,input,select,textarea,optgroup{font:inherit;margin:0}optgroup{font-weight:bold} -button,input{overflow:visible}button,select{text-transform:none} -button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button} -button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0} -button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} -[type=checkbox],[type=radio]{padding:0} -[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} -[type=search]{-webkit-appearance:textfield;outline-offset:-2px} -[type=search]::-webkit-search-decoration{-webkit-appearance:none} -::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} -/* End extract */ -/* html,body { - background-color: #52638e; -} */ -html,body{font-family:Verdana,sans-serif;font-size:9pt;line-height:1.5}html{overflow-x:hidden} -h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.serif{font-family:serif} -h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin: 0}.wide{letter-spacing:4px} -hr{border:0;border-top:1px solid #eee;margin:20px 0} -.img{max-width:100%;height:auto; vertical-align:middle}a{color:inherit} -.table,.table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.table-all{border:1px solid #ccc} -.bordered tr,.table-all tr{border-bottom:1px solid #ddd}.striped tbody tr:nth-child(even){background-color:#f1f1f1} -.table-all tr:nth-child(odd){background-color:#fff}.table-all tr:nth-child(even){background-color:#f1f1f1} -.hoverable tbody tr:hover,.ul.hoverable li:hover{background-color:#ccc}.centered tr th,.centered tr td{text-align:center} -.table td,.table th,.table-all td,.table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} -.table th:first-child,.table td:first-child,.table-all th:first-child,.table-all td:first-child{padding-left:16px} -.btn,.button{border:none;display:inline-block;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap} -.btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} -.btn,.button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.disabled,.btn:disabled,.button:disabled{cursor:not-allowed;opacity:0.3}.disabled *,:disabled *{pointer-events:none} -.btn.disabled:hover,.btn:disabled:hover{box-shadow:none} -.badge,.tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.badge{border-radius:50%} -.ul{list-style-type:none;padding:0;margin:0}.ul li{padding:8px 16px;border-bottom:1px solid #ddd}.ul li:last-child{border-bottom:none} -.tooltip,.display-container{position:relative}.tooltip .text{display:none}.tooltip:hover .text{display:inline-block} -.ripple:active{opacity:0.5}.ripple{transition:opacity 0s} -.input{padding:6px;display:block;border: 1px solid #ccc;width:100%;background-color: #fff; }/*#e8f0fe*/ -.select{padding:2px 0; display:block;width:100%;border:1px solid #ccc;background-color: #fff;} -.dropdown-click,.dropdown-hover{position:relative;display:inline-block;cursor:pointer} -.dropdown-hover:hover .dropdown-content{display:block; } -.dropdown-hover:first-child,.dropdown-click:hover{background-color:#ccc;color:#000} -.dropdown-hover:hover > .button:first-child,.dropdown-click:hover > .button:first-child{background-color:#ccc;color:#000} -.dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0;z-index:1} -.check,.radio{width:24px;height:24px;position:relative;top:6px} -.sidebar{height:100%;width:160px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} -.bar-block .dropdown-hover,.bar-block .dropdown-click{width:100%} -.bar-block .dropdown-hover .dropdown-content,.bar-block .dropdown-click .dropdown-content{min-width:100%} -.bar-block .dropdown-hover .button,.bar-block .dropdown-click .button{width:100%;text-align:left;padding:8px 16px} -.main,#main{transition:margin-left .4s} -.modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} -.modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} -.bar{width:100%;overflow:hidden}.center .bar{display:inline-block;width:auto} -.bar .bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0} -.bar .dropdown-hover,.bar .dropdown-click{position:static;float:left} -.bar .button{white-space:normal} -.bar-block .bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0} -.bar-block.center .bar-item{text-align:center}.block{display:block;width:100%} -.responsive{display:block;overflow-x:auto} -.container:after,.container:before,.datapanel:after,.datapanel:before,.row:after,.row:before,.row-padding:after,.row-padding:before, -.cell-row:before,.cell-row:after,.clear:after,.clear:before,.bar:before,.bar:after{content:"";display:table;clear:both} -.col,.half,.third,.twothird,.threequarter,.quarter,.fifth,.twofifth,.threefifth,.fourfifth{float:left;width:100%} -.col.s1{width:8.33333%}.col.s2{width:16.66666%}.col.s3{width:24.99999%}.col.s4{width:33.33333%} -.col.s5{width:41.66666%}.col.s6{width:49.99999%}.col.s7{width:58.33333%}.col.s8{width:66.66666%} -.col.s9{width:74.99999%}.col.s10{width:83.33333%}.col.s11{width:91.66666%}.col.s12{width:99.99999%} -@media (min-width:601px){.col.m1{width:8.33333%}.col.m2{width:16.66666%}.col.m3,.quarter{width:24.99999%}.col.m4,.third{width:33.33333%}.fifth{width:20%;min-width:100px} -.col.m5{width:41.66666%}.col.m6,.half{width:49.99999%}.col.m7{width:58.33333%}.col.m8,.twothird{width:66.66666%} -.col.m9,.threequarter{width:74.99999%}.col.m10{width:83.33333%}.col.m11{width:91.66666%}.col.m12{width:99.99999%}.twofifth{width:40%}.threefifth{width:60%}.fourfifth{width:80%}} -@media (min-width:993px){.col.l1{width:8.33333%}.col.l2{width:16.66666%}.col.l3{width:24.99999%}.col.l4{width:33.33333%} -.col.l5{width:41.66666%}.col.l6{width:49.99999%}.col.l7{width:58.33333%}.col.l8{width:66.66666%} -.col.l9{width:74.99999%}.col.l10{width:83.33333%}.col.l11{width:91.66666%}.col.l12{width:99.99999%}} -.rest{overflow:hidden}.stretch{margin-left:-16px;margin-right:-16px} -.content,.auto{margin-left:auto;margin-right:auto}.content{max-width:980px}.auto{max-width:1140px} -.cell-row{display:table;width:100%}.cell{display:table-cell} -.cell-top{vertical-align:top}.cell-middle{vertical-align:middle}.cell-bottom{vertical-align:bottom} -.hide{display:none!important}.show-block,.show{display:block!important}.show-inline-block{display:inline-block!important} -@media (max-width:1205px){.auto{max-width:95%}} -@media (max-width:600px){.modal-content{margin:0 10px;width:auto!important}.modal{padding-top:30px} -.dropdown-hover.mobile .dropdown-content,.dropdown-click.mobile .dropdown-content{position:relative} -.hide-small{display:none!important}.mobile{display:block;width:100%!important}.bar-item.mobile,.dropdown-hover.mobile,.dropdown-click.mobile{text-align:center} -.dropdown-hover.mobile,.dropdown-hover.mobile .btn,.dropdown-hover.mobile .button,.dropdown-click.mobile,.dropdown-click.mobile .btn,.dropdown-click.mobile .button{width:100%}} -@media (max-width:768px){.modal-content{width:500px}.modal{padding-top:50px}} -@media (min-width:993px){.modal-content{width:900px}.hide-large{display:none!important}.sidebar.collapse{display:block!important}} -@media (max-width:992px) and (min-width:601px){.hide-medium{display:none!important}} -@media (max-width:992px){.sidebar.collapse{display:none}.main{margin-left:0!important;margin-right:0!important}.auto{max-width:100%}} -.top,.bottom{position:fixed;width:100%;z-index:1}.top{top:0}.bottom{bottom:0} -.overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} -.display-topleft{position:absolute;left:0;top:0}.display-topright{position:absolute;right:0;top:0} -.display-bottomleft{position:absolute;left:0;bottom:0}.display-bottomright{position:absolute;right:0;bottom:0} -.display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} -.display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} -.display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} -.display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-container:hover .display-hover{display:block}.display-container:hover span.display-hover{display:inline-block}.display-hover{display:none} -.display-position{position:absolute} -.circle{border-radius:50%} -.round-small{border-radius:2px}.round,.round-medium{border-radius:4px}.round-large{border-radius:8px}.round-xlarge{border-radius:16px}.round-xxlarge{border-radius:32px} -.row-padding,.row-padding>.half,.row-padding>.third,.row-padding>.twothird,.row-padding>.threequarter,.row-padding>.quarter,.row-padding>.col{padding:0 8px} -.container,.datapanel{padding:0.01em 8px}.datapanel{margin-top:8px;margin-bottom:8px} -.code,.codespan{font-family:Consolas,"courier new";font-size:16px} -.code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} -.codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} -.card,.card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16)} -.card-4,.hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)} -.spin{animation:spin 2s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} -.animate-fading{animation:fading 2s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -.animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}} -.animate-top{position:relative;animation:animatetop 1s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -.animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -.animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -.animate-bottom{position:relative;animation:animatebottom 1s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} -.animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} -.animate-input{transition:width 0.4s ease-in-out}.animate-input:focus{width:100%!important} -.opacity,.hover-opacity:hover{opacity:0.60}.opacity-off,.hover-opacity-off:hover{opacity:1} -.opacity-max{opacity:0.25}.opacity-min{opacity:0.75} -.greyscale-max,.grayscale-max,.hover-greyscale:hover,.hover-grayscale:hover{filter:grayscale(100%)} -.greyscale,.grayscale{filter:grayscale(75%)}.greyscale-min,.grayscale-min{filter:grayscale(50%)} -.sepia{filter:sepia(75%)}.sepia-max,.hover-sepia:hover{filter:sepia(100%)}.sepia-min{filter:sepia(50%)} -.tiny{font-size:10px!important}.small{font-size:12px!important}.medium{font-size:15px!important}.large{font-size:18px!important} -.xlarge{font-size:24px!important}.xxlarge{font-size:36px!important}.xxxlarge{font-size:48px!important}.jumbo{font-size:64px!important} -.left-align{text-align:left!important}.right-align{text-align:right!important}.justify{text-align:justify!important}.center{text-align:center!important} -.border-0{border:0!important}.border{border:1px solid #ccc!important} -.border-top{border-top:1px solid #ccc!important}.border-bottom{border-bottom:1px solid #ccc!important} -.border-left{border-left:1px solid #ccc!important}.border-right{border-right:1px solid #ccc!important} -.topbar{border-top:6px solid #ccc!important}.bottombar{border-bottom:6px solid #ccc!important} -.leftbar{border-left:6px solid #ccc!important}.rightbar{border-right:6px solid #ccc!important} -.section,.code{margin-top:16px!important;margin-bottom:16px!important} -.margin{margin:16px!important}.margin-top{margin-top:16px!important}.margin-bottom{margin-bottom:16px!important} -.margin-left{margin-left:16px!important}.margin-right{margin-right:16px!important} -.padding-small{padding:4px 8px!important}.padding{padding:8px 16px!important}.padding-large{padding:12px 24px!important} -.padding-16{padding-top:16px!important;padding-bottom:16px!important}.padding-24{padding-top:24px!important;padding-bottom:24px!important} -.padding-32{padding-top:32px!important;padding-bottom:32px!important}.padding-48{padding-top:48px!important;padding-bottom:48px!important} -.padding-64{padding-top:64px!important;padding-bottom:64px!important} -.left{float:left!important}.right{float:right!important} -.button:hover{color:#000!important;background-color:#ccc!important} -.transparent,.hover-none:hover{background-color:transparent!important} -.hover-none:hover{box-shadow:none!important} -/* DEFAULT COLORS */ -.amber,.hover-amber:hover{color:#000!important;background-color:#ffc107!important} -.aqua,.hover-aqua:hover{color:#000!important;background-color:#00ffff!important} -.blue,.hover-blue:hover{color:#fff!important;background-color:#2196F3!important} -.light-blue,.hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} -.brown,.hover-brown:hover{color:#fff!important;background-color:#795548!important} -.cyan,.hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} -.blue-grey,.hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important} -.green,.hover-green:hover{color:#fff!important;background-color:#4CAF50!important} -.light-green,.hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} -.indigo,.hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} -.khaki,.hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} -.lime,.hover-lime:hover{color:#000!important;background-color:#cddc39!important} -.orange,.hover-orange:hover{color:#000!important;background-color:#ff9800!important} -.deep-orange,.hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} -.pink,.hover-pink:hover{color:#fff!important;background-color:#e91e63!important} -.purple,.hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} -.deep-purple,.hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} -.red,.hover-red:hover{color:#fff!important;background-color:#f44336!important} -.sand,.hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} -.teal,.hover-teal:hover{color:#fff!important;background-color:#009688!important} -.yellow,.hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} -.white,.hover-white:hover{color:#000!important;background-color:#fff!important} -.black,.hover-black:hover{color:#fff!important;background-color:#000!important} -.grey,.hover-grey:hover{color:#000!important;background-color:#9e9e9e!important} -.light-grey,.hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important} -.dark-grey,.hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} -.pale-red,.hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.pale-green,.hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} -.pale-yellow,.hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.pale-blue,.hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} -.text-align-right { text-align: right;} -.text-amber,.hover-text-amber:hover{color:#ffc107!important} -.text-aqua,.hover-text-aqua:hover{color:#00ffff!important} -.text-blue,.hover-text-blue:hover{color:#2196F3!important} -.text-light-blue,.hover-text-light-blue:hover{color:#87CEEB!important} -.text-brown,.hover-text-brown:hover{color:#795548!important} -.text-cyan,.hover-text-cyan:hover{color:#00bcd4!important} -.text-blue-grey,.hover-text-blue-grey:hover{color:#607d8b!important} -.text-green,.hover-text-green:hover{color:#4CAF50!important} -.text-light-green,.hover-text-light-green:hover{color:#8bc34a!important} -.text-indigo,.hover-text-indigo:hover{color:#3f51b5!important} -.text-khaki,.hover-text-khaki:hover{color:#b4aa50!important} -.text-lime,.hover-text-lime:hover{color:#cddc39!important} -.text-orange,.hover-text-orange:hover{color:#ff9800!important} -.text-deep-orange,.hover-text-deep-orange:hover{color:#ff5722!important} -.text-pink,.hover-text-pink:hover{color:#e91e63!important} -.text-purple,.hover-text-purple:hover{color:#9c27b0!important} -.text-deep-purple,.hover-text-deep-purple:hover{color:#673ab7!important} -.text-red,.hover-text-red:hover{color:#f44336!important} -.text-sand,.hover-text-sand:hover{color:#fdf5e6!important} -.text-teal,.hover-text-teal:hover{color:#009688!important} -.text-yellow,.hover-text-yellow:hover{color:#d2be0e!important} -.text-white,.hover-text-white:hover{color:#fff!important} -.text-black,.hover-text-black:hover{color:#000!important} -.text-grey,.hover-text-grey:hover{color:#757575!important} -.text-light-grey,.hover-text-light-grey:hover{color:#f1f1f1!important} -.text-dark-grey,.hover-text-dark-grey:hover{color:#3a3a3a!important} -.border-amber,.hover-border-amber:hover{border-color:#ffc107!important} -.border-aqua,.hover-border-aqua:hover{border-color:#00ffff!important} -.border-blue,.hover-border-blue:hover{border-color:#2196F3!important} -.border-light-blue,.hover-border-light-blue:hover{border-color:#87CEEB!important} -.border-brown,.hover-border-brown:hover{border-color:#795548!important} -.border-cyan,.hover-border-cyan:hover{border-color:#00bcd4!important} -.border-blue-grey,.hover-blue-grey:hover{border-color:#607d8b!important} -.border-green,.hover-border-green:hover{border-color:#4CAF50!important} -.border-light-green,.hover-border-light-green:hover{border-color:#8bc34a!important} -.border-indigo,.hover-border-indigo:hover{border-color:#3f51b5!important} -.border-khaki,.hover-border-khaki:hover{border-color:#f0e68c!important} -.border-lime,.hover-border-lime:hover{border-color:#cddc39!important} -.border-orange,.hover-border-orange:hover{border-color:#ff9800!important} -.border-deep-orange,.hover-border-deep-orange:hover{border-color:#ff5722!important} -.border-pink,.hover-border-pink:hover{border-color:#e91e63!important} -.border-purple,.hover-border-purple:hover{border-color:#9c27b0!important} -.border-deep-purple,.hover-border-deep-purple:hover{border-color:#673ab7!important} -.border-red,.hover-border-red:hover{border-color:#f44336!important} -.border-sand,.hover-border-sand:hover{border-color:#fdf5e6!important} -.border-teal,.hover-border-teal:hover{border-color:#009688!important} -.border-yellow,.hover-border-yellow:hover{border-color:#ffeb3b!important} -.border-white,.hover-border-white:hover{border-color:#fff!important} -.border-black,.hover-border-black:hover{border-color:#000!important} -.border-grey,.hover-border-grey:hover{border-color:#9e9e9e!important} -.border-light-grey,.hover-border-light-grey:hover{border-color:#f1f1f1!important} -.border-dark-grey,.hover-border-dark-grey:hover{border-color:#616161!important} -.border-pale-red,.hover-border-pale-red:hover{border-color:#ffe7e7!important}.border-pale-green,.hover-border-pale-green:hover{border-color:#e7ffe7!important} -.border-pale-yellow,.hover-border-pale-yellow:hover{border-color:#ffffd7!important}.border-pale-blue,.hover-border-pale-blue:hover{border-color:#e7ffff!important} -/* DEFAULT THEME */ -.theme-l5 {color:#000 !important; background-color:#f6f8fc !important} -.theme-l4 {color:#000 !important; background-color:#e1e9f6 !important} -.theme-l3 {color:#000 !important; background-color:#c3d3ed !important} -.theme-l2 {color:#000 !important; background-color:#a5bee4 !important} -.theme-l1 {color:#fff !important; background-color:#88a8db !important} -.theme-d1 {color:#fff !important; background-color:#5180cb !important} -.theme-d2 {color:#fff !important; background-color:#3a6fc3 !important} -.theme-d3 {color:#fff !important; background-color:#3361aa !important} -.theme-d4 {color:#fff !important; background-color:#2c5392 !important} -.theme-d5 {color:#fff !important; background-color:#24457a !important} - -.theme-light {color:#000 !important; background-color:#f6f8fc !important} -.theme-dark {color:#fff !important; background-color:#24457a !important} -.theme-action {color:#fff !important; background-color:#24457a !important} - -.theme {color:#fff !important; background-color:#6a92d3 !important} -.text-theme {color:#6a92d3 !important} -.border-theme {border-color:#6a92d3 !important} - -.hover-theme:hover {color:#fff !important; background-color:#6a92d3 !important} -.hover-text-theme:hover {color:#6a92d3 !important} -.hover-border-theme:hover {border-color:#6a92d3 !important} - -/* .label { color: #000; font-size: 8pt;} */ -/* #main {margin-left: 210px;} */ -/* @media (max-width:768px){ - #sidebar { display: none;} - #main { margin-left: 0px;} -} */ - - - -.table { - table-layout: fixed; -} - -.text-line-through { text-decoration: line-through; } - -#snackbar { - visibility: hidden; - min-width: 250px; - margin-left: -125px; - background-color: #333; - color: #fff; - text-align: center; - - padding: 16px; - position: fixed; - z-index: 1; - left: 50%; - bottom: 30px; - font-size: 17px; -} - -#snackbar.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; -} - -@-webkit-keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@-webkit-keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -@keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -.tabulator-header-filter > input { - background-color: #fff; - border: 1px solid #ccc; - font-weight: normal; -} - -.readonly { - pointer-events:none; - color: #000!important; - background-color: #d3d3d3!important; -} - - - -.right-side-bg { - background: url("../img/bg1.jpg"); - background-size: cover; - min-height: 100vh; -} - - - - -/* .mceContentBody { - background: #fff; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - - -button -{ - background-color: #f4f4f4; - border: 1pt solid #cccccc; - font-size: 10pt; - color: #000; - line-height: 1line; - text-align: center; -} -button:hover -{ - background-color: #343434; -} -button:pressed -{ - background-color: #343434; -} -button:focus -{ - background-color: #343434; -} - - - - -header -{ - background-color: #fff; - box-sizing: border-box; -} - - - - -::-webkit-input-placeholder -{ - color: rgba(60.3922%,60.3922%,60.3922%,1); -} - - -textarea -{ - background-color: #fff; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-size: 11pt; - color: #000; - line-height: 1line; - text-align: left; - /* margin-top: 0.88em; - margin-right: 0.75em; - margin-bottom: 0.63em; - margin-left: 0.75em; - top: 0pt; - right: 30pt; - bottom: 0pt; - left: 0pt; - position: absolute; - box-sizing: border-box; */ -} -textarea:focus -{ - border-top-color: rgba(0%,43.9216%,81.1765%,1); - border-right-color: rgba(0%,43.9216%,81.1765%,1); - border-bottom-color: rgba(0%,43.9216%,81.1765%,1); - border-left-color: rgba(0%,43.9216%,81.1765%,1); -} -textarea:placeholder -{ - color: rgba(80%,80%,80%,1); -} -/* textarea .text -{ - -} */ -textarea .scrollbar_track -{ - width: 30pt; - top: 0pt; - right: 0pt; - bottom: 0pt; - position: absolute; - box-sizing: border-box; -} - - -footer -{ - background-color: #fff; - box-sizing: border-box; -} - - -div.group_container -{ - background-color: #e3e3e3; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - padding-top: 4px; - padding-bottom: 8px; -} - -/* Custom Styles */ -.ListView_Default -{ - - background-color: rgba(0%,0%,0%,0); - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - - color: #000; - text-align: left; - margin-top: 2pt; - margin-right: 2pt; - margin-bottom: 2pt; - margin-left: 2pt; -} - - -button.btnNavigation -{ - - background-color: rgba(0%,0%,0%,0); - - font-family: -fm-font-family(Arial,Arial-BoldMT); - font-weight: bold; - font-size: 10pt; - color: #fff; - padding-top: 0pt; - padding-right: 0pt; - padding-bottom: 0pt; - padding-left: 0pt; -} - -div.PageListHeader -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - color: #fff; - -fm-text-vertical-align: center; -} -div.PageListHeader .inner_border -{ - padding-top: 5pt; - padding-right: 5pt; - padding-bottom: 5pt; - padding-left: 5pt; -} - -.moduletoolbar -{ - background-color: #293146; - color: #fff; -} - -div.BodySectionHeader -{ - font-family: -fm-font-family(Arial,Arial-BoldMT); - font-weight: bold; -} - -button.Button_ImgPlacer -{ - - background-color: rgba(0%,0%,0%,0); - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - - font-family: -fm-font-family(Arial,Arial-BoldMT); - font-weight: bold; - font-size: 10pt; - color: #fff; -} -button.Button_ImgPlacer .inner_border -{ - padding-top: 0pt; - padding-right: 0pt; - padding-bottom: 0pt; - padding-left: 0pt; -} - - -div.PageHeadTitle -{ - font-size: 18pt; - color: #fff; -} - -div.SectionHeadTitle -{ - font-size: 13pt; - color: #fff; -} - -div.SectionHeader -{ - - background-color: rgba(22.3529%,26.6667%,38.4314%,1); - -} - -button.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - - background-color: rgba(0%,0%,0%,0); - - color: #fff; -} -button.toolbarbtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -button.toolbarbtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -button.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -a.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - - background-color: rgba(0%,0%,0%,0); - - color: #fff; - text-align: center; - text-decoration: unset; -} -a.toolbarbtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -a.toolbarbtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -butaton.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -div.ListView_Header -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-weight: normal; - color: #fff; - -fm-text-vertical-align: center; -} -div.ListView_Header .inner_border -{ - padding-top: 2pt; - padding-right: 2pt; - padding-bottom: 2pt; - padding-left: 2pt; -} - -div.toolbar -{ - - background-color: rgba(32.1569%,38.8235%,55.6863%,1); - -} - -div.sectiontoolbar -{ - margin-top: 8px; - margin-bottom: 8px; - background-color: rgb(97, 98, 100); - -} - -div.FooterLabel -{ - color: #fff; -} - -button.Buttom_BodyNav:hover -{ - - background-color: rgb(141, 141, 141); - - /* color: #fff; */ -} - - -::-webkit-scrollbar { --webkit-appearance: none; -width: 10px; -} - -::-webkit-scrollbar-track { - background-color: rgba(80%, 80%, 80%, .5); -} - -::-webkit-scrollbar-thumb { -border-radius: 0px; -background-color: rgba(0, 0, 0, .5); --webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5); -} - -div.portaltextheader { - padding: 2px; - border: 1px solid white; -} - - - - - -select { - /* -webkit-appearance: none; */ - display: block; - color: #000; - line-height: 1line; - text-align: left; - padding: 3.5px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 1px solid #cccccc; - /* box-shadow: 0 1px 0 1px rgba(0,0,0,.04); */ - border-radius: 0px; - font-weight: normal; - font-size: 11pt; - background-color: #fff; - /* background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right .7em top 50%, 0 0; - background-size: .65em auto, 100%; */ -} - - -/* option { - appearance: none; - border: 1px solid 0070cf; - padding: 2px; -} */ -select:focus -{ - border: 1px solid #3a6fc3; - border-radius: unset; -} - - -::-webkit-select-placeholder -{ - color: #9a9a9a; -} - -div.DataFooter{ - background: #384462; -} -.input-sum{padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D; } - - -.currency-sum {padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D;} - -.currency-sum,.currency-sum:read-only { - display: block; - color: #fff; - padding: 2px; - padding-right: 12px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 1px solid #ccc; - border-radius: unset; - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: #4D4D4D; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20fill=%22white%22%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%3C/svg%3E'); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - - - -/* input[type=date]::-webkit-inner-spin-button, -input[type=date]::-webkit-outer-spin-button { - display: none; -} */ - -:focus { - outline: unset; -} - -input -{ - background-color: #ffffff; - border: 1px solid #cccccc; - font-weight: normal; - font-size: 11pt; - color: #000000; - line-height: 1line; - text-align: left; - width:100%; - padding:2px; - display:block; - border-radius: unset; -} -/* input:focus -{ - border: #0070cf; -} */ - -input:focus { - border: 1px solid #3a6fc3; - border-radius: unset; -} - -input[readonly=true]{ - color: #000!important; - background-color: #d3d3d3!important; -} - -input[type=number]::-webkit-inner-spin-button, -input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} -/* input[type=checkbox]{ - appearance: none; - display:inline-block; - font-size: 24px!important; - border: 1px solid green; -} */ - -input[class=currency] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - -input[class=currency]:read-only { - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #d3d3d3 0%,#d3d3d3 100%); -} - -input[class=percent] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22256%22%20height=%22232%22%20version=%221.0%22%3E%3Cg%20transform=%22translate(-112.3674,-128.3649)%22%3E%3Cpath%20style=%22fill:black;fill-opacity:1;stroke:none%22%20d=%22M%20317.1674,257.53698%20C%20308.53463,257.53708%20301.73774,261.20839%20296.77671,268.55094%20C%20291.91449,275.89365%20289.48349,286.1138%20289.48368,299.2114%20C%20289.48349,312.11067%20291.91449,322.2812%20296.77671,329.72303%20C%20301.73774,337.06568%20308.53463,340.737%20317.1674,340.73698%20C%20325.60128,340.737%20332.24934,337.06568%20337.11159,329.72303%20C%20342.07258,322.2812%20344.5532,312.11067%20344.55345,299.2114%20C%20344.5532,286.21302%20342.07258,276.04249%20337.11159,268.69977%20C%20332.24934,261.25801%20325.60128,257.53708%20317.1674,257.53698%20M%20317.1674,238.63466%20C%20332.84469,238.63477%20345.29739,244.09213%20354.52554,255.00675%20C%20363.75318,265.92157%20368.36713,280.65644%20368.3674,299.2114%20C%20368.36713,317.76648%20363.70357,332.50135%20354.37671,343.41605%20C%20345.14855,354.23156%20332.74546,359.6393%20317.1674,359.63931%20C%20301.29123,359.6393%20288.7393,354.23156%20279.51159,343.41605%20C%20270.28351,332.50135%20265.66956,317.76648%20265.66973,299.2114%20C%20265.66956,280.55721%20270.28351,265.82234%20279.51159,255.00675%20C%20288.83853,244.09213%20301.39045,238.63477%20317.1674,238.63466%20M%20163.5674,147.9928%20C%20155.03401,147.993%20148.28673,151.71393%20143.32554,159.15559%20C%20138.46349,166.49841%20136.03248,176.61933%20136.03252,189.51838%20C%20136.03248,202.61621%20138.46349,212.83635%20143.32554,220.17884%20C%20148.18751,227.52161%20154.93479,231.19292%20163.5674,231.1928%20C%20172.19989,231.19292%20178.94717,227.52161%20183.80926,220.17884%20C%20188.77041,212.83635%20191.25103,202.61621%20191.25113,189.51838%20C%20191.25103,176.71856%20188.77041,166.59764%20183.80926,159.15559%20C%20178.84794,151.71393%20172.10066,147.993%20163.5674,147.9928%20M%20297.9674,129.09047%20L%20321.78136,129.09047%20L%20182.7674,359.63931%20L%20158.95345,359.63931%20L%20297.9674,129.09047%20M%20163.5674,129.09047%20C%20179.24484,129.0907%20191.74715,134.54806%20201.07438,145.46256%20C%20210.4014,156.27827%20215.06496,170.96352%20215.06508,189.51838%20C%20215.06496,208.27201%20210.4014,223.05649%20201.07438,233.87187%20C%20191.84638,244.68748%20179.34406,250.09523%20163.5674,250.09512%20C%20147.79061,250.09523%20135.28829,244.68748%20126.06043,233.87187%20C%20116.93172,222.95727%20112.36739,208.17279%20112.3674,189.51838%20C%20112.36739,171.06275%20116.98134,156.37749%20126.20926,145.46256%20C%20135.43713,134.54806%20147.88983,129.0907%20163.5674,129.09047%22%20/%3E%3C/g%3E%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - -label { - height: 12.8px!important; - color: #000; - font-size: 8pt; -} - - - -input[type="checkbox"] { - display: block; - -webkit-appearance:none;/* Hides the default checkbox style */ - height:29.66px; - width:29.66px; - cursor:pointer; - position:relative; - -webkit-transition: .15s; - border-radius: unset; - border: 1px solid #cccccc; - background-color:#fff; - } - - input[type="checkbox"]:checked { - background-color:green; - } - - input[type="checkbox"]:before, input[type="checkbox"]:checked:before { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - line-height:2em; - text-align:center; - color:#fff; - content: ''; - } - - input[type="checkbox"]:checked:before { - font-size: 11pt; - content: '✔'; - } - - input[type="checkbox"]:hover:before { - background:rgba(255,255,255,0.3); - } - - - body.mceContentBody { - background:#e8f0fe; - color:#000; -} - -/* .mceContentBody { - background: #e8f0fe; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - -:focus { - outline: 1px solid #607d8b; -} \ No newline at end of file diff --git a/app/static/css/w3pro.css b/app/static/css/w3pro.css deleted file mode 100644 index ce009b2..0000000 --- a/app/static/css/w3pro.css +++ /dev/null @@ -1,386 +0,0 @@ -/* W3PRO.CSS 4.13 June 2019 by Jan Egil and Borge Refsnes */ -html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} -/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ -html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} -article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item} -audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} -audio:not([controls]){display:none;height:0}[hidden],template{display:none} -a{background-color:transparent}a:active,a:hover{outline-width:0} -abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} -b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000} -small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none} -code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible} -button,input,select,textarea,optgroup{font:inherit;margin:0}optgroup{font-weight:bold} -button,input{overflow:visible}button,select{text-transform:none} -button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button} -button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0} -button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} -[type=checkbox],[type=radio]{padding:0} -[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} -[type=search]{-webkit-appearance:textfield;outline-offset:-2px} -[type=search]::-webkit-search-decoration{-webkit-appearance:none} -::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} -/* End extract */ -html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden} -h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.serif{font-family:serif} -h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin: 0}.wide{letter-spacing:4px} -hr{border:0;border-top:1px solid #eee;margin:20px 0} -.image{max-width:100%;height:auto}img{vertical-align:middle}a{color:inherit} -.table,.table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.table-all{border:1px solid #ccc} -.bordered tr,.table-all tr{border-bottom:1px solid #ddd}.striped tbody tr:nth-child(even){background-color:#f1f1f1} -.table-all tr:nth-child(odd){background-color:#fff}.table-all tr:nth-child(even){background-color:#f1f1f1} -.hoverable tbody tr:hover,.ul.hoverable li:hover{background-color:#ccc}.centered tr th,.centered tr td{text-align:center} -.table td,.table th,.table-all td,.table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} -.table th:first-child,.table td:first-child,.table-all th:first-child,.table-all td:first-child{padding-left:16px} -.btn,.button{border:none;display:inline-block;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap} -.btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} -.btn,.button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.disabled,.btn:disabled,.button:disabled{cursor:not-allowed;opacity:0.3}.disabled *,:disabled *{pointer-events:none} -.btn.disabled:hover,.btn:disabled:hover{box-shadow:none} -.badge,.tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.badge{border-radius:50%} -.ul{list-style-type:none;padding:0;margin:0}.ul li{padding:8px 16px;border-bottom:1px solid #ddd}.ul li:last-child{border-bottom:none} -.tooltip,.display-container{position:relative}.tooltip .text{display:none}.tooltip:hover .text{display:inline-block} -.ripple:active{opacity:0.5}.ripple{transition:opacity 0s} -.input{padding:8px;display:block;border:1px solid #ccc;width:100%;background-color: #e8f0fe; } -.select{padding:9px 0; display:block;width:100%;border:1px solid #ccc;background-color: #e8f0fe;} -.dropdown-click,.dropdown-hover{position:relative;display:inline-block;cursor:pointer} -.dropdown-hover:hover .dropdown-content{display:block; } -.dropdown-hover:first-child,.dropdown-click:hover{background-color:#ccc;color:#000} -.dropdown-hover:hover > .button:first-child,.dropdown-click:hover > .button:first-child{background-color:#ccc;color:#000} -.dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0;z-index:1} -.check,.radio{width:24px;height:24px;position:relative;top:6px} -.sidebar{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} -.bar-block .dropdown-hover,.bar-block .dropdown-click{width:100%} -.bar-block .dropdown-hover .dropdown-content,.bar-block .dropdown-click .dropdown-content{min-width:100%} -.bar-block .dropdown-hover .button,.bar-block .dropdown-click .button{width:100%;text-align:left;padding:8px 16px} -.main,#main{transition:margin-left .4s} -.modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} -.modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} -.bar{width:100%;overflow:hidden}.center .bar{display:inline-block;width:auto} -.bar .bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0} -.bar .dropdown-hover,.bar .dropdown-click{position:static;float:left} -.bar .button{white-space:normal} -.bar-block .bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0} -.bar-block.center .bar-item{text-align:center}.block{display:block;width:100%} -.responsive{display:block;overflow-x:auto} -.container:after,.container:before,.panel:after,.panel:before,.row:after,.row:before,.row-padding:after,.row-padding:before, -.cell-row:before,.cell-row:after,.clear:after,.clear:before,.bar:before,.bar:after{content:"";display:table;clear:both} -.col,.half,.third,.twothird,.threequarter,.quarter{float:left;width:100%} -.col.s1{width:8.33333%}.col.s2{width:16.66666%}.col.s3{width:24.99999%}.col.s4{width:33.33333%} -.col.s5{width:41.66666%}.col.s6{width:49.99999%}.col.s7{width:58.33333%}.col.s8{width:66.66666%} -.col.s9{width:74.99999%}.col.s10{width:83.33333%}.col.s11{width:91.66666%}.col.s12{width:99.99999%} -@media (min-width:601px){.col.m1{width:8.33333%}.col.m2{width:16.66666%}.col.m3,.quarter{width:24.99999%}.col.m4,.third{width:33.33333%} -.col.m5{width:41.66666%}.col.m6,.half{width:49.99999%}.col.m7{width:58.33333%}.col.m8,.twothird{width:66.66666%} -.col.m9,.threequarter{width:74.99999%}.col.m10{width:83.33333%}.col.m11{width:91.66666%}.col.m12{width:99.99999%}} -@media (min-width:993px){.col.l1{width:8.33333%}.col.l2{width:16.66666%}.col.l3{width:24.99999%}.col.l4{width:33.33333%} -.col.l5{width:41.66666%}.col.l6{width:49.99999%}.col.l7{width:58.33333%}.col.l8{width:66.66666%} -.col.l9{width:74.99999%}.col.l10{width:83.33333%}.col.l11{width:91.66666%}.col.l12{width:99.99999%}} -.rest{overflow:hidden}.stretch{margin-left:-16px;margin-right:-16px} -.content,.auto{margin-left:auto;margin-right:auto}.content{max-width:980px}.auto{max-width:1140px} -.cell-row{display:table;width:100%}.cell{display:table-cell} -.cell-top{vertical-align:top}.cell-middle{vertical-align:middle}.cell-bottom{vertical-align:bottom} -.hide{display:none!important}.show-block,.show{display:block!important}.show-inline-block{display:inline-block!important} -@media (max-width:1205px){.auto{max-width:95%}} -@media (max-width:600px){.modal-content{margin:0 10px;width:auto!important}.modal{padding-top:30px} -.dropdown-hover.mobile .dropdown-content,.dropdown-click.mobile .dropdown-content{position:relative} -.hide-small{display:none!important}.mobile{display:block;width:100%!important}.bar-item.mobile,.dropdown-hover.mobile,.dropdown-click.mobile{text-align:center} -.dropdown-hover.mobile,.dropdown-hover.mobile .btn,.dropdown-hover.mobile .button,.dropdown-click.mobile,.dropdown-click.mobile .btn,.dropdown-click.mobile .button{width:100%}} -@media (max-width:768px){.modal-content{width:500px}.modal{padding-top:50px}} -@media (min-width:993px){.modal-content{width:900px}.hide-large{display:none!important}.sidebar.collapse{display:block!important}#main{margin:0px}#modulename{margin-left:0px}} -@media (max-width:992px) and (min-width:601px){.hide-medium{display:none!important}} -@media (max-width:992px){.sidebar.collapse{display:none}.main{margin-left:0!important;margin-right:0!important}.auto{max-width:100%}#main{margin:0px}#modulename{margin-left:0px}} -.top,.bottom{position:fixed;width:100%;z-index:1}.top{top:0}.bottom{bottom:0} -.overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} -.display-topleft{position:absolute;left:0;top:0}.display-topright{position:absolute;right:0;top:0} -.display-bottomleft{position:absolute;left:0;bottom:0}.display-bottomright{position:absolute;right:0;bottom:0} -.display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} -.display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} -.display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} -.display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-container:hover .display-hover{display:block}.display-container:hover span.display-hover{display:inline-block}.display-hover{display:none} -.display-position{position:absolute} -.circle{border-radius:50%} -.round-small{border-radius:2px}.round,.round-medium{border-radius:4px}.round-large{border-radius:8px}.round-xlarge{border-radius:16px}.round-xxlarge{border-radius:32px} -.row-padding,.row-padding>.half,.row-padding>.third,.row-padding>.twothird,.row-padding>.threequarter,.row-padding>.quarter,.row-padding>.col{padding:0 8px} -.container,.panel{padding:0.01em 16px}.panel{margin-top:16px;margin-bottom:16px} -.code,.codespan{font-family:Consolas,"courier new";font-size:16px} -.code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} -.codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} -.card,.card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16)} -.card-4,.hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)} -.spin{animation:spin 2s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} -.animate-fading{animation:fading 10s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -.animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}} -.animate-top{position:relative;animation:animatetop 0.4s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -.animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -.animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -.animate-bottom{position:relative;animation:animatebottom 0.4s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} -.animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} -.animate-input{transition:width 0.4s ease-in-out}.animate-input:focus{width:100%!important} -.opacity,.hover-opacity:hover{opacity:0.60}.opacity-off,.hover-opacity-off:hover{opacity:1} -.opacity-max{opacity:0.25}.opacity-min{opacity:0.75} -.greyscale-max,.grayscale-max,.hover-greyscale:hover,.hover-grayscale:hover{filter:grayscale(100%)} -.greyscale,.grayscale{filter:grayscale(75%)}.greyscale-min,.grayscale-min{filter:grayscale(50%)} -.sepia{filter:sepia(75%)}.sepia-max,.hover-sepia:hover{filter:sepia(100%)}.sepia-min{filter:sepia(50%)} -.tiny{font-size:10px!important}.small{font-size:12px!important}.medium{font-size:15px!important}.large{font-size:18px!important} -.xlarge{font-size:24px!important}.xxlarge{font-size:36px!important}.xxxlarge{font-size:48px!important}.jumbo{font-size:64px!important} -.left-align{text-align:left!important}.right-align{text-align:right!important}.justify{text-align:justify!important}.center{text-align:center!important} -.border-0{border:0!important}.border{border:1px solid #ccc!important} -.border-top{border-top:1px solid #ccc!important}.border-bottom{border-bottom:1px solid #ccc!important} -.border-left{border-left:1px solid #ccc!important}.border-right{border-right:1px solid #ccc!important} -.topbar{border-top:6px solid #ccc!important}.bottombar{border-bottom:6px solid #ccc!important} -.leftbar{border-left:6px solid #ccc!important}.rightbar{border-right:6px solid #ccc!important} -.section,.code{margin-top:16px!important;margin-bottom:16px!important} -.margin{margin:16px!important}.margin-top{margin-top:16px!important}.margin-bottom{margin-bottom:16px!important} -.margin-left{margin-left:16px!important}.margin-right{margin-right:16px!important} -.padding-small{padding:4px 8px!important}.padding{padding:8px 16px!important}.padding-large{padding:12px 24px!important} -.padding-16{padding-top:16px!important;padding-bottom:16px!important}.padding-24{padding-top:24px!important;padding-bottom:24px!important} -.padding-32{padding-top:32px!important;padding-bottom:32px!important}.padding-48{padding-top:48px!important;padding-bottom:48px!important} -.padding-64{padding-top:64px!important;padding-bottom:64px!important} -.left{float:left!important}.right{float:right!important} -.button:hover{color:#000!important;background-color:#ccc!important} -.transparent,.hover-none:hover{background-color:transparent!important} -.hover-none:hover{box-shadow:none!important} -/* DEFAULT COLORS */ -.amber,.hover-amber:hover{color:#000!important;background-color:#ffc107!important} -.aqua,.hover-aqua:hover{color:#000!important;background-color:#00ffff!important} -.blue,.hover-blue:hover{color:#fff!important;background-color:#2196F3!important} -.light-blue,.hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} -.brown,.hover-brown:hover{color:#fff!important;background-color:#795548!important} -.cyan,.hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} -.blue-grey,.hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important} -.green,.hover-green:hover{color:#fff!important;background-color:#4CAF50!important} -.light-green,.hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} -.indigo,.hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} -.khaki,.hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} -.lime,.hover-lime:hover{color:#000!important;background-color:#cddc39!important} -.orange,.hover-orange:hover{color:#000!important;background-color:#ff9800!important} -.deep-orange,.hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} -.pink,.hover-pink:hover{color:#fff!important;background-color:#e91e63!important} -.purple,.hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} -.deep-purple,.hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} -.red,.hover-red:hover{color:#fff!important;background-color:#f44336!important} -.sand,.hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} -.teal,.hover-teal:hover{color:#fff!important;background-color:#009688!important} -.yellow,.hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} -.white,.hover-white:hover{color:#000!important;background-color:#fff!important} -.black,.hover-black:hover{color:#fff!important;background-color:#000!important} -.grey,.hover-grey:hover{color:#000!important;background-color:#9e9e9e!important} -.light-grey,.hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important} -.dark-grey,.hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} -.pale-red,.hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.pale-green,.hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} -.pale-yellow,.hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.pale-blue,.hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} -.text-amber,.hover-text-amber:hover{color:#ffc107!important} -.text-aqua,.hover-text-aqua:hover{color:#00ffff!important} -.text-blue,.hover-text-blue:hover{color:#2196F3!important} -.text-light-blue,.hover-text-light-blue:hover{color:#87CEEB!important} -.text-brown,.hover-text-brown:hover{color:#795548!important} -.text-cyan,.hover-text-cyan:hover{color:#00bcd4!important} -.text-blue-grey,.hover-text-blue-grey:hover{color:#607d8b!important} -.text-green,.hover-text-green:hover{color:#4CAF50!important} -.text-light-green,.hover-text-light-green:hover{color:#8bc34a!important} -.text-indigo,.hover-text-indigo:hover{color:#3f51b5!important} -.text-khaki,.hover-text-khaki:hover{color:#b4aa50!important} -.text-lime,.hover-text-lime:hover{color:#cddc39!important} -.text-orange,.hover-text-orange:hover{color:#ff9800!important} -.text-deep-orange,.hover-text-deep-orange:hover{color:#ff5722!important} -.text-pink,.hover-text-pink:hover{color:#e91e63!important} -.text-purple,.hover-text-purple:hover{color:#9c27b0!important} -.text-deep-purple,.hover-text-deep-purple:hover{color:#673ab7!important} -.text-red,.hover-text-red:hover{color:#f44336!important} -.text-sand,.hover-text-sand:hover{color:#fdf5e6!important} -.text-teal,.hover-text-teal:hover{color:#009688!important} -.text-yellow,.hover-text-yellow:hover{color:#d2be0e!important} -.text-white,.hover-text-white:hover{color:#fff!important} -.text-black,.hover-text-black:hover{color:#000!important} -.text-grey,.hover-text-grey:hover{color:#757575!important} -.text-light-grey,.hover-text-light-grey:hover{color:#f1f1f1!important} -.text-dark-grey,.hover-text-dark-grey:hover{color:#3a3a3a!important} -.border-amber,.hover-border-amber:hover{border-color:#ffc107!important} -.border-aqua,.hover-border-aqua:hover{border-color:#00ffff!important} -.border-blue,.hover-border-blue:hover{border-color:#2196F3!important} -.border-light-blue,.hover-border-light-blue:hover{border-color:#87CEEB!important} -.border-brown,.hover-border-brown:hover{border-color:#795548!important} -.border-cyan,.hover-border-cyan:hover{border-color:#00bcd4!important} -.border-blue-grey,.hover-blue-grey:hover{border-color:#607d8b!important} -.border-green,.hover-border-green:hover{border-color:#4CAF50!important} -.border-light-green,.hover-border-light-green:hover{border-color:#8bc34a!important} -.border-indigo,.hover-border-indigo:hover{border-color:#3f51b5!important} -.border-khaki,.hover-border-khaki:hover{border-color:#f0e68c!important} -.border-lime,.hover-border-lime:hover{border-color:#cddc39!important} -.border-orange,.hover-border-orange:hover{border-color:#ff9800!important} -.border-deep-orange,.hover-border-deep-orange:hover{border-color:#ff5722!important} -.border-pink,.hover-border-pink:hover{border-color:#e91e63!important} -.border-purple,.hover-border-purple:hover{border-color:#9c27b0!important} -.border-deep-purple,.hover-border-deep-purple:hover{border-color:#673ab7!important} -.border-red,.hover-border-red:hover{border-color:#f44336!important} -.border-sand,.hover-border-sand:hover{border-color:#fdf5e6!important} -.border-teal,.hover-border-teal:hover{border-color:#009688!important} -.border-yellow,.hover-border-yellow:hover{border-color:#ffeb3b!important} -.border-white,.hover-border-white:hover{border-color:#fff!important} -.border-black,.hover-border-black:hover{border-color:#000!important} -.border-grey,.hover-border-grey:hover{border-color:#9e9e9e!important} -.border-light-grey,.hover-border-light-grey:hover{border-color:#f1f1f1!important} -.border-dark-grey,.hover-border-dark-grey:hover{border-color:#616161!important} -.border-pale-red,.hover-border-pale-red:hover{border-color:#ffe7e7!important}.border-pale-green,.hover-border-pale-green:hover{border-color:#e7ffe7!important} -.border-pale-yellow,.hover-border-pale-yellow:hover{border-color:#ffffd7!important}.border-pale-blue,.hover-border-pale-blue:hover{border-color:#e7ffff!important} -/* DEFAULT THEME */ -.theme-l5 {color:#000 !important; background-color:#f6f8fc !important} -.theme-l4 {color:#000 !important; background-color:#e1e9f6 !important} -.theme-l3 {color:#000 !important; background-color:#c3d3ed !important} -.theme-l2 {color:#000 !important; background-color:#a5bee4 !important} -.theme-l1 {color:#fff !important; background-color:#88a8db !important} -.theme-d1 {color:#fff !important; background-color:#5180cb !important} -.theme-d2 {color:#fff !important; background-color:#3a6fc3 !important} -.theme-d3 {color:#fff !important; background-color:#3361aa !important} -.theme-d4 {color:#fff !important; background-color:#2c5392 !important} -.theme-d5 {color:#fff !important; background-color:#24457a !important} - -.theme-light {color:#000 !important; background-color:#f6f8fc !important} -.theme-dark {color:#fff !important; background-color:#24457a !important} -.theme-action {color:#fff !important; background-color:#24457a !important} - -.theme {color:#fff !important; background-color:#6a92d3 !important} -.text-theme {color:#6a92d3 !important} -.border-theme {border-color:#6a92d3 !important} - -.hover-theme:hover {color:#fff !important; background-color:#6a92d3 !important} -.hover-text-theme:hover {color:#6a92d3 !important} -.hover-border-theme:hover {border-color:#6a92d3 !important} - -.label { color: rgb(153, 150, 150);} -/* #main {margin-left: 210px;} */ -@media (max-width:768px){ - /* #sidebar { display: none;} - #main { margin-left: 0px;} */ -} - -.select { - display: block; - font-size: 16px; - font-family: sans-serif; - font-weight: normal; - color: #444; - line-height: 1.3; - padding: .6em 1.4em .5em .8em; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border-bottom: 1px solid #aaa; - box-shadow: 0 1px 0 1px rgba(0,0,0,.04); - /* border-radius: .5em; */ - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: #e8f0fe; - background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), - linear-gradient(to bottom, #e8f0fe 0%,#e8f0fe 100%); - background-repeat: no-repeat, repeat; - background-position: right .7em top 50%, 0 0; - background-size: .65em auto, 100%; -} -.select::-ms-expand { - display: none; -} -.select:hover { - border-color: #888; -} -.select:focus { - border-color: #aaa; - box-shadow: 0 0 1px 1px #6a92d3; - box-shadow: 0 0 0 1px -moz-mac-focusring; - color: #222; - outline: none; -} - - -.select option { - font-weight:normal; -} - -.table { - table-layout: fixed; -} - -.text-line-through { text-decoration: line-through; } - -#snackbar { - visibility: hidden; - min-width: 250px; - margin-left: -125px; - background-color: #333; - color: #fff; - text-align: center; - border-radius: 2px; - padding: 16px; - position: fixed; - z-index: 1; - left: 50%; - bottom: 30px; - font-size: 17px; -} - -#snackbar.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; -} - -@-webkit-keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@-webkit-keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -@keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -.tabulator-header-filter > input { - background-color: #e8f0fe; - border: 1px solid #ccc; - font-weight: normal; -} - -.readonly { - pointer-events:none; - padding:8px;display:block;border:0px;width:100%;background-color: #fff; -} - -.right-side-bg { - background: url("../img/bg1.jpg"); - background-size: cover; - min-height: 100vh; -} -body.mceContentBody { - background:#e8f0fe; - color:#000; -} - -/* .mceContentBody { - background: #e8f0fe; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - -:focus { - outline: 1px solid #607d8b; -} \ No newline at end of file diff --git a/app/static/img/bg1.jpg b/app/static/img/bg1.jpg deleted file mode 100644 index 3123259..0000000 Binary files a/app/static/img/bg1.jpg and /dev/null differ diff --git a/app/static/img/dartsxx.jpg b/app/static/img/dartsxx.jpg deleted file mode 100644 index 1c212bb..0000000 Binary files a/app/static/img/dartsxx.jpg and /dev/null differ diff --git a/app/static/img/favicon/android-icon-144x144.png b/app/static/img/favicon/android-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/app/static/img/favicon/android-icon-144x144.png and /dev/null differ diff --git a/app/static/img/favicon/android-icon-192x192.png b/app/static/img/favicon/android-icon-192x192.png deleted file mode 100644 index c156ad7..0000000 Binary files a/app/static/img/favicon/android-icon-192x192.png and /dev/null differ diff --git a/app/static/img/favicon/android-icon-36x36.png b/app/static/img/favicon/android-icon-36x36.png deleted file mode 100644 index 747aa84..0000000 Binary files a/app/static/img/favicon/android-icon-36x36.png and /dev/null differ diff --git a/app/static/img/favicon/android-icon-48x48.png b/app/static/img/favicon/android-icon-48x48.png deleted file mode 100644 index 8db5eec..0000000 Binary files a/app/static/img/favicon/android-icon-48x48.png and /dev/null differ diff --git a/app/static/img/favicon/android-icon-72x72.png b/app/static/img/favicon/android-icon-72x72.png deleted file mode 100644 index 15bcb2e..0000000 Binary files a/app/static/img/favicon/android-icon-72x72.png and /dev/null differ diff --git a/app/static/img/favicon/android-icon-96x96.png b/app/static/img/favicon/android-icon-96x96.png deleted file mode 100644 index f100597..0000000 Binary files a/app/static/img/favicon/android-icon-96x96.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-114x114.png b/app/static/img/favicon/apple-icon-114x114.png deleted file mode 100644 index 0750044..0000000 Binary files a/app/static/img/favicon/apple-icon-114x114.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-120x120.png b/app/static/img/favicon/apple-icon-120x120.png deleted file mode 100644 index 3877b6b..0000000 Binary files a/app/static/img/favicon/apple-icon-120x120.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-144x144.png b/app/static/img/favicon/apple-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/app/static/img/favicon/apple-icon-144x144.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-152x152.png b/app/static/img/favicon/apple-icon-152x152.png deleted file mode 100644 index 4a86c7a..0000000 Binary files a/app/static/img/favicon/apple-icon-152x152.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-180x180.png b/app/static/img/favicon/apple-icon-180x180.png deleted file mode 100644 index dbb3bba..0000000 Binary files a/app/static/img/favicon/apple-icon-180x180.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-57x57.png b/app/static/img/favicon/apple-icon-57x57.png deleted file mode 100644 index 951ada5..0000000 Binary files a/app/static/img/favicon/apple-icon-57x57.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-60x60.png b/app/static/img/favicon/apple-icon-60x60.png deleted file mode 100644 index bcc7174..0000000 Binary files a/app/static/img/favicon/apple-icon-60x60.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-72x72.png b/app/static/img/favicon/apple-icon-72x72.png deleted file mode 100644 index 15bcb2e..0000000 Binary files a/app/static/img/favicon/apple-icon-72x72.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-76x76.png b/app/static/img/favicon/apple-icon-76x76.png deleted file mode 100644 index b9b0895..0000000 Binary files a/app/static/img/favicon/apple-icon-76x76.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon-precomposed.png b/app/static/img/favicon/apple-icon-precomposed.png deleted file mode 100644 index f64a9a7..0000000 Binary files a/app/static/img/favicon/apple-icon-precomposed.png and /dev/null differ diff --git a/app/static/img/favicon/apple-icon.png b/app/static/img/favicon/apple-icon.png deleted file mode 100644 index f64a9a7..0000000 Binary files a/app/static/img/favicon/apple-icon.png and /dev/null differ diff --git a/app/static/img/favicon/browserconfig.xml b/app/static/img/favicon/browserconfig.xml deleted file mode 100644 index c554148..0000000 --- a/app/static/img/favicon/browserconfig.xml +++ /dev/null @@ -1,2 +0,0 @@ - -#ffffff \ No newline at end of file diff --git a/app/static/img/favicon/favicon-16x16.png b/app/static/img/favicon/favicon-16x16.png deleted file mode 100644 index 0281448..0000000 Binary files a/app/static/img/favicon/favicon-16x16.png and /dev/null differ diff --git a/app/static/img/favicon/favicon-32x32.png b/app/static/img/favicon/favicon-32x32.png deleted file mode 100644 index 9eb08e9..0000000 Binary files a/app/static/img/favicon/favicon-32x32.png and /dev/null differ diff --git a/app/static/img/favicon/favicon-96x96.png b/app/static/img/favicon/favicon-96x96.png deleted file mode 100644 index f100597..0000000 Binary files a/app/static/img/favicon/favicon-96x96.png and /dev/null differ diff --git a/app/static/img/favicon/favicon.ico b/app/static/img/favicon/favicon.ico deleted file mode 100644 index efacd69..0000000 Binary files a/app/static/img/favicon/favicon.ico and /dev/null differ diff --git a/app/static/img/favicon/manifest.json b/app/static/img/favicon/manifest.json deleted file mode 100644 index 013d4a6..0000000 --- a/app/static/img/favicon/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "App", - "icons": [ - { - "src": "\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -} \ No newline at end of file diff --git a/app/static/img/favicon/ms-icon-144x144.png b/app/static/img/favicon/ms-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/app/static/img/favicon/ms-icon-144x144.png and /dev/null differ diff --git a/app/static/img/favicon/ms-icon-150x150.png b/app/static/img/favicon/ms-icon-150x150.png deleted file mode 100644 index d81670d..0000000 Binary files a/app/static/img/favicon/ms-icon-150x150.png and /dev/null differ diff --git a/app/static/img/favicon/ms-icon-310x310.png b/app/static/img/favicon/ms-icon-310x310.png deleted file mode 100644 index 3693385..0000000 Binary files a/app/static/img/favicon/ms-icon-310x310.png and /dev/null differ diff --git a/app/static/img/favicon/ms-icon-70x70.png b/app/static/img/favicon/ms-icon-70x70.png deleted file mode 100644 index 54d9f3e..0000000 Binary files a/app/static/img/favicon/ms-icon-70x70.png and /dev/null differ diff --git a/app/static/img/fldicon.png b/app/static/img/fldicon.png deleted file mode 100644 index 68b6de2..0000000 Binary files a/app/static/img/fldicon.png and /dev/null differ diff --git a/app/static/img/fldicon.svg b/app/static/img/fldicon.svg deleted file mode 100644 index a49b4ae..0000000 --- a/app/static/img/fldicon.svg +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/static/img/hiclipart.com.png b/app/static/img/hiclipart.com.png deleted file mode 100644 index 99370af..0000000 Binary files a/app/static/img/hiclipart.com.png and /dev/null differ diff --git a/app/static/img/logo.png b/app/static/img/logo.png deleted file mode 100644 index 605f989..0000000 Binary files a/app/static/img/logo.png and /dev/null differ diff --git a/app/static/img/no-image-icon.png b/app/static/img/no-image-icon.png deleted file mode 100644 index 1849ae7..0000000 Binary files a/app/static/img/no-image-icon.png and /dev/null differ diff --git a/app/static/img/no-news-img.png b/app/static/img/no-news-img.png deleted file mode 100644 index 3411fda..0000000 Binary files a/app/static/img/no-news-img.png and /dev/null differ diff --git a/app/static/img/toplogo.svg b/app/static/img/toplogo.svg deleted file mode 100644 index 9e2ec89..0000000 --- a/app/static/img/toplogo.svg +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/static/js/app.js b/app/static/js/app.js deleted file mode 100644 index 0ab6635..0000000 --- a/app/static/js/app.js +++ /dev/null @@ -1,79 +0,0 @@ -var app = { - loadpage: function(modulepage,modulename){ - location.href=modulepage; - //console.log(modulename); - //console.log("Load module:" + modulepage); - // if (modulename){ - // document.getElementById("modulename").innerHTML = modulename; - // } - // document.getElementById("moduleframe").setAttribute('src',modulepage); - - // if (document.getElementById("sidebar").style.display == 'none'){ - // document.getElementById("main").style.margin = "0 0 0 0"; - // document.getElementById("modulename").style.setProperty("margin-left","0px"); - // } - // else { - // document.getElementById("main").style.setProperty("margin-left","210px"); - // document.getElementById("modulename").style.setProperty("margin-left","150px"); - // } - }, - // sidebarclick: function(modulepage,modulename){ - // app.loadpage(modulepage,modulename); - // }, - logout: function(){ - req.reqdata("POST",location.href,{"logout":"1"},app.reloadpage); - - }, - - reloadpage(page){ - location.href=location.href; - - }, - viewpanel: function(pnlname){ - let panels = document.getElementsByClassName("panel"); - //let toolbars = document.getElementsByClassName("paneltoolbar"); - currentview = pnlname; - for (let p=0;p 0) { - flds[field.getAttribute("name")] = vals; - } else { - flds[field.getAttribute("name")] = ""; - } - } - else { - flds[field.getAttribute("name")] = field.value; - } - } - } - return flds; -}, -cleanform: function(frmname){ - var frm = document.getElementById("frm_" + frmname); - for (var f in frm){ - if (frm[f] && frm[f].id){ - if (frm[f].tagName == 'INPUT'){ - if (frm[f].type == "checkbox"){ - frm[f].checked = false; - } else if (frm[f].classList.contains("datefield")){ - if (frm[f]._flatpickr){ frm[f]._flatpickr.clear(); } - } else if (frm[f].classList.contains("choices__input")){ - if (choice[frmname][frm[f].id]){ - choice[frmname][frm[f].id].removeActiveItems(); - } - } else { - frm[f].value = ""; - } - } - if (frm[f].tagName == 'SELECT'){ - if (frm[f].multiple == true){ - if (frm[f].classList.contains("choices__input")){ - choice[frmname][frm[f].id].removeActiveItems(); - } - } else { - frm[f].value = ""; - } - - } - if (frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("richeditarea")){ - tinymce.get(frm[f].id).setContent(""); - } else { - frm[f].innerHTML = ""; - } - } - } - } - return false; -}, -cleanform2: function(frmname,choices){ - var frm = document.getElementById("frm_" + frmname); - for (var f in frm){ - if (frm[f] && frm[f].id){ - if (frm[f].tagName == 'INPUT'){ - if (frm[f].type == "checkbox"){ - frm[f].checked = false; - } else if (frm[f].classList.contains("datefield")){ - if (frm[f]._flatpickr){ frm[f]._flatpickr.clear(); } - } else if (frm[f].classList.contains("choices__input")){ - if (choices[frm[f].id]){ - choices[frm[f].id].removeActiveItems(); - } - } else { - frm[f].value = ""; - } - } - if (frm[f].tagName == 'SELECT'){ - if (frm[f].multiple == true){ - if (frm[f].classList.contains("choices__input")){ - choices[frm[f].id].removeActiveItems(); - } - } else { - frm[f].value = ""; - } - - } - if (frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("richeditarea")){ - tinymce.get(frm[f].id).setContent(""); - } else { - frm[f].innerHTML = ""; - } - } - } - } - return false; -}, -fillformbydataclass2: function(dataclass,choices,data,onblur){ - var frm = document.querySelectorAll('.data_'+ dataclass); - //console.log("Data to fill"); - //console.log(data); - if (data){ - for (var f in frm){ - //console.log(frm[f].id); - if (frm[f].id){ - frm[f].dataset.id=data['id']; - } - if (data[frm[f].id]){ - //console.log("=>"); - //console.log(data[frm[f].id]); - // if (onblur){ - // frm[f].addEventListener('blur',onblur); - // } - - //frm[f].dataset.id=data['id']; - if (frm[f].tagName == 'INPUT'){ - if (frm[f].type == "checkbox"){ - if (data[frm[f].id] == "1"){ - frm[f].checked = true; - } else { - frm[f].checked = false; - } - } - else if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data[frm[f].id]); - } else if (frm[f].classList.contains("timefield")){ - frm[f]._flatpickr.setDate(data[frm[f].id]); - } - else if (frm[f].classList.contains("choices__input")){ - if ((data[frm[f].id] != null) && (data[frm[f].id] != '[""]')){ - if (data[frm[f].id].startsWith('["')){ - choices[frm[f].id].setValue(JSON.parse(data[frm[f].id])); - } - else { - choices[frm[f].id].setChoiceByValue(data[frm[f].id]); - } - } - } else { - frm[f].value=data[frm[f].id]; - } - } - if (frm[f].tagName == 'SELECT'){ - if (frm[f].classList.contains("choices__input")){ - if (frm[f].multiple == true){ - choices[frm[f].id].setChoiceByValue(JSON.parse(data[frm[f].id])); - }else { - choices[frm[f].id].setChoiceByValue(data[frm[f].id]); - } - } else { - frm[f].value=data[frm[f].id]; - } - } - } - } - } -}, -fillselectlist: function(obj,data,vidcol,vvalcol,defval){ - var sellist = []; - //obj.clearStore(); - if (data){ - for (var i in data){ - sellist.push({value:data[i][vidcol],text:data[i][vvalcol]}); - } - } - - obj.setData(sellist); - if (defval){ - obj.set(defval); - } - return false; -}, -// fillsimpleselectlist: function(objid,data,vidcol,vvalcol){ -// var sellist = document.getElementById(objid); -// sellist.innerHTML = ''; -// if (data){ -// for (var i in data){ -// sellist.append(''); -// } -// } -// //obj.setChoices(sellist, 'value', 'label', true); -// return false; -// }, -savefield: function(obj){ - fdata = obj.dataset; - fdata["save"] = "field"; - - if (obj.tagName == 'INPUT' || obj.tagName == 'SELECT' || obj.tagName == 'TEXTAREA'){ - if (obj.type == 'checkbox' || obj.type == 'radio'){ - if (obj.checked == true){ - fdata["value"] = obj.value; - } else { - fdata["value"] = null; - } - }else { - fdata["value"] = obj.value; - } - } - console.log(fdata); - //req.reqdata("POST","db.cgi",fdata,record.saveresult); -} - -} \ No newline at end of file diff --git a/app/static/js/formsave.js b/app/static/js/formsave.js deleted file mode 100644 index 648fc1f..0000000 --- a/app/static/js/formsave.js +++ /dev/null @@ -1,90 +0,0 @@ -function saveform(frmid,aftercallback){ - var flds=getformcontent(frmid,null); - flds["fn"] ="saveform"; - - //console.log(flds); - if (aftercallback){ - req.reqdata("POST","index.cgi",flds,aftercallback); - formsaved({}); - } - else { - req.reqdata("POST","index.cgi",flds,formsaved); - } - return false; -} - -function formsaved(data){ - var sb = document.getElementById("snackbar"); - sb.className="show green"; - sb.innerHTML = 'Donnéen goufen gespaichert!'; - setTimeout(function(){ sb.className = sb.className.replace("show green", ""); }, 3000); - return false; -} - -function showsnackbar(xclass,xmessage){ - var sb = document.getElementById("snackbar"); - sb.className="show " + xclass; - sb.innerHTML = xmessage; - setTimeout(function(){ sb.className = sb.className.replace(sb.className, ""); }, 3000); - return false; -} - -function getformcontent(frmid,dataflds){ - var frm = document.getElementById("frm_" + frmid); - var flds = []; - if (dataflds){ - flds = dataflds; - } - - for (var i = 0; i < frm.elements.length; i++) { - var field = frm.elements[i]; - //console.log("field:" + field.id + " Name:" + field.getAttribute("name")); - if (field.tagName == "INPUT" || field.tagName == "SELECT" || field.tagName == "TEXTAREA"){ - if (field.classList.contains("tagedit")){ - var fvalue=field.value.trim(); - var ndata = null; - if (fvalue != ""){ - ndata = fvalue.split(","); - } - - flds[field.getAttribute("name")] = ndata; - }else if (field.tagName == "TEXTAREA" ){ - if (field.classList.contains("richeditarea")){ - flds[field.getAttribute("name")] = tinymce.get(field.id).getContent(); - } else { - flds[field.getAttribute("name")] = field.innerHTML; - } - - }else if (field.type == "checkbox" ){ - if (field.checked){ - flds[field.getAttribute("name")] = "1"; - } else { - flds[field.getAttribute("name")] = ""; - } - - } - else { - if (field.tagName == "SELECT" && field.multiple == true){ - var opts = field.selectedOptions; - var vals = []; - for (var o in opts){ - if (opts[o].value){ - vals.push(opts[o].value); - } - } - if (vals.length > 0) { - flds[field.getAttribute("name")] = vals; - } else { - flds[field.getAttribute("name")] = ""; - } - - } else { - flds[field.getAttribute("name")] = field.value; - } - - } - - } - } - return flds; -} \ No newline at end of file diff --git a/app/static/js/module_global.js b/app/static/js/module_global.js deleted file mode 100644 index 1a13d38..0000000 --- a/app/static/js/module_global.js +++ /dev/null @@ -1,37 +0,0 @@ -// document.addEventListener("DOMContentLoaded", function() { -// //console.log( "Iframe "+ location.pathname.substring(location.pathname.lastIndexOf("/")) +" ready!" ); -// initpage(); -// }); - - -function table_setbounds(tblmodule){ - // var cols = $("#tbl_"+tblmodule+" > tbody > tr:first-child").children(); - // var colnum = cols.length -1; - // console.log("childnum:" + colnum); - // for (var i=1;i<=colnum;i++){ - // wx = $("#tbl_"+tblmodule+" > tbody > tr:first-child > td:nth-child("+ i +")").width(); - // // wx = wx +3; - // $("#tbl_"+tblmodule+"_head > thead > tr > th:nth-child("+ i +")").width(wx); - // } -} - -function sectionload(sectionid,callback){ - var sec = document.querySelectorAll('section'); - for (var i in sec){ - sec[i].style.display = 'none'; - } - if (callback){ - callback; - } - document.getElementById(sectionid).style.display = 'block'; -} - - -function emptyform(id){ - // $("#" + id + "> input,select,textarea").each( - // function(){ - // console.log("Set Empty Value On" + $(this).id); - // } - - // ); -} \ No newline at end of file diff --git a/app/static/js/record.js b/app/static/js/record.js deleted file mode 100644 index 0831ee5..0000000 --- a/app/static/js/record.js +++ /dev/null @@ -1,125 +0,0 @@ -var record = { - redirectpage:null, - table:null, - form: null, - dialog: null, - data: null, - parentid: null, - add: function(page,tbl,datafields,idparent){ - if (datafields){ - record.data = {}; - var adf = datafields.split(','); - for (var df in adf){ - //console.log("dfid:" + adf[df]); - var cdf = document.getElementById(adf[df]); - record.data[cdf.dataset.column + "_" + cdf.dataset.table] = cdf.value; - } - } - if (idparent){ - record.parentid = idparent; - } - record.redirectpage = page; - //form.cleanform(tbl); - var dd = {"ins":tbl}; - if (record.data){ - dd["data"]= record.data; - } - req.reqdata("POST","db.cgi",dd,record.afterrequest); - }, - confirmremove: function(page,tbl,idparent){ - if (table.selection){ - record.redirectpage = page; - record.table = tbl; - record.parentid = idparent; - document.getElementById("dlgdeleterow").style.display = 'block'; - } - }, - remove: function(page){ - req.reqdata("POST","db.cgi",{"del":record.table,"id":table.selection},record.afterrequest); - table.selection = null, - document.getElementById("dlgdeleterow").style.display = 'none'; - }, - edit: function(page,tbl,reffield){ - console.log(page); - if (table.selection){ - //record.redirectpage = page; - if (page.startsWith("dlg")){ - record.dialog= page; - record.form = tbl; - form.cleanform(tbl); - req.reqdata("POST","db.cgi",{"get":tbl,"id":table.selection},record.loaddialog); - - } else { - var refid = table.selection; - if (reffield){ - refid = document.getElementById(reffield).value; - } - app.getpage(page,{"id":refid}); - } - } - - }, - duplicate: function(page,tbl,excl,idparent){ - if (table.selection){ - record.redirectpage = page; - record.parentid=idparent; - req.reqdata("POST","db.cgi",{"dupl":tbl,id:table.selection,"exclude":excl},record.afterrequest); - } - }, - loaddialog(data){ - fillform(record.form,data,table.selection); - document.getElementById(record.dialog).style.display = 'block'; - }, - afterrequest: function(data){ - console.log("redirect:" + record.redirectpage + "Parent:" + record.parentid); - // if (record.redirectpage.startsWith("dlg")){ - - // }else { - - if (record.parentid){ - data["id"] = record.parentid; - //record.idparent = null; - } - console.log("redirectpage:" + record.redirectpage + " -- " + JSON.stringify(data)); - app.getpage(record.redirectpage,data); - // } - - }, - setValue: function(obj,newvalue){ - if (obj.tagName == 'INPUT' || obj.tagName == 'SELECT'){ - if (obj.type == 'checkbox' || obj.type == 'radio'){ - obj.checked = true; - }else { - obj.value=newvalue; - } - } - if (obj.tagName == 'TEXTAREA'){ - obj.innerHTML = newvalue; - } - record.savefield(obj); - }, - savefield: function(obj,callback){ - - fdata = obj.dataset; - fdata["save"] = "field"; - fdata["schemata"] = schemata; - if (obj.tagName == 'INPUT' || obj.tagName == 'SELECT' || obj.tagName == 'TEXTAREA'){ - if (obj.type == 'checkbox' || obj.type == 'radio'){ - if (obj.checked == true){ - fdata["value"] = obj.value; - } else { - fdata["value"] = null; - } - }else { - fdata["value"] = obj.value; - } - } - req.reqdata("POST","db.cgi",fdata,callback); - }, - - save: function(tbl){ - - console.log(data); - } - -} \ No newline at end of file diff --git a/app/static/js/request.js b/app/static/js/request.js deleted file mode 100644 index 8564efd..0000000 --- a/app/static/js/request.js +++ /dev/null @@ -1,128 +0,0 @@ -var api = location.origin + location.pathname.substring(0,location.pathname.lastIndexOf('/backoffice/')) + "/backoffice/"; -// if (location.pathname.indexOf('module') > 0){ -// api = location.origin + location.pathname.substring(0, location.pathname.indexOf('module')) + 'api/'; -// } -console.log("API:" + api); -var req = { - multipartform: function(url,frmdata,callback=null){ - var ret = null; - var rdata = null; - var async = false; - if (callback){ - async=true; - } - - var request = new XMLHttpRequest(); - - //console.log(frmdata); - var sendurl = api + url; - //console.log("sending URL: " + "POST" + " => " +sendurl); - request.open("POST", sendurl, true); - request.onload = function(){ - if (request.status >= 200 && request.status <= 400){ - //console.log("Status returned: " + request.status + "resp:" + request.getResponseHeader("Content-Type")); - if (request.getResponseHeader("Content-Type").indexOf('application/json') == 0){ - var xparse = JSON.parse(request.responseText); - ret = xparse.result; - //console.log(ret); - } - else { - ret = request.responseText; - } - if (async){ - callback(ret); - } - } else { - alert("ServerERROR:" + request.status + "\n" + request.responseText); - } - }; - request.onerror = function(){ - alert("Connection ERROR!\n" + url); - }; - - request.setRequestHeader('Content-Type','multipart/form-data; charset=UTF-8'); - request.send(frmdata); - return ret; - }, - reqdata: function(method,url,data,callback=null){ - - var ret = null; - var rdata = null; - //var async = true; - // if (callback){ - // async=true; - // } - if (!callback){ - callback=req.asyncNoEvent; - } - var request = new XMLHttpRequest(); - - if (typeof data == 'object'){ - var xdata = []; - for (var i in data){ - var value = ''; - if (data[i] == null){ - value=''; - } else if (typeof(data[i]) == 'object'){ - value = encodeURIComponent(JSON.stringify(data[i])); - } else { - value = encodeURIComponent(data[i]); - } - xdata.push(i + "=" + value); - } - rdata = xdata.join("&"); - }else { - rdata = data; - } - //console.log("Data to send: " + decodeURIComponent(rdata)); - var sendurl = api + url; - // if (method.toUpperCase() == 'GET'){ - // sendurl = sendurl + '?' + rdata; - // } - console.log("sending URL: " + method + " => " +sendurl + '?' + rdata); - request.open(method.toUpperCase(), sendurl, true); - request.onload = function(){ - if (request.status >= 200 && request.status <= 400){ - // console.log("Status returned: " + request.status + "resp:" + request.getResponseHeader("Content-Type")); - if (request.getResponseHeader("Content-Type").indexOf('application/json') == 0){ - if (request.responseText){ - var xparse = JSON.parse(request.responseText); - ret = xparse.result; - } else { - ret = null; - } - - }else { - ret = request.responseText; - //console.log(ret); - } - ////console.log("data returned: " + request.responseText); - //if (async){ - callback(ret); - //} - - } else { - //console.log("ServerERROR: " + request.status + "\n" + request.responseText); - alert("ServerERROR:" + request.status + "\n" + request.responseText); - } - }; - request.onerror = function(){ - //console.log("ERROR: connection ERROR\n" + url); - alert("Connection ERROR!\n" + url); - }; - // if (method.toUpperCase() == 'POST'){ - request.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - request.send(rdata); - // } else { - //request.withCredentials = true; - // request.send(); - // } - return ret; - }, - asyncNoEvent: function(data){ - //console.log("query done"); - //console.log(data); - //console.log("done"); - } - -} \ No newline at end of file diff --git a/app/static/vendors/flatpickr/flatpickr.css b/app/static/vendors/flatpickr/flatpickr.css deleted file mode 100644 index 64eb467..0000000 --- a/app/static/vendors/flatpickr/flatpickr.css +++ /dev/null @@ -1,784 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - background: #fff; - -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid #e6e6e6; -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: #e6e6e6; -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #fff; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: #e6e6e6; -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #fff; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - background: transparent; - color: rgba(0,0,0,0.9); - fill: rgba(0,0,0,0.9); - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: rgba(0,0,0,0.9); - fill: rgba(0,0,0,0.9); -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #959ea9; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(57,57,57,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(57,57,57,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(57,57,57,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(0,0,0,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: rgba(0,0,0,0.9); -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: rgba(0,0,0,0.9); -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(0,0,0,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: transparent; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: transparent; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: transparent; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: transparent; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 #e6e6e6; - box-shadow: -1px 0 0 #e6e6e6; -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #393939; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e6e6e6; - border-color: #e6e6e6; -} -.flatpickr-day.today { - border-color: #959ea9; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #959ea9; - background: #959ea9; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #569ff7; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #569ff7; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #569ff7; - box-shadow: -10px 0 0 #569ff7; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(57,57,57,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(57,57,57,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7; - box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - -webkit-box-shadow: 1px 0 0 #e6e6e6; - box-shadow: 1px 0 0 #e6e6e6; -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(57,57,57,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #393939; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #393939; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #393939; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #393939; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eee; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/flatpickr.js b/app/static/vendors/flatpickr/flatpickr.js deleted file mode 100644 index c989306..0000000 --- a/app/static/vendors/flatpickr/flatpickr.js +++ /dev/null @@ -1,2596 +0,0 @@ -/* flatpickr v4.6.2, @license MIT */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.flatpickr = factory()); -}(this, function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - var HOOKS = [ - "onChange", - "onClose", - "onDayCreate", - "onDestroy", - "onKeyDown", - "onMonthChange", - "onOpen", - "onParseConfig", - "onReady", - "onValueUpdate", - "onYearChange", - "onPreCalendarPosition", - ]; - var defaults = { - _disable: [], - _enable: [], - allowInput: false, - altFormat: "F j, Y", - altInput: false, - altInputClass: "form-control input", - animate: typeof window === "object" && - window.navigator.userAgent.indexOf("MSIE") === -1, - ariaDateFormat: "F j, Y", - clickOpens: true, - closeOnSelect: true, - conjunction: ", ", - dateFormat: "Y-m-d", - defaultHour: 12, - defaultMinute: 0, - defaultSeconds: 0, - disable: [], - disableMobile: false, - enable: [], - enableSeconds: false, - enableTime: false, - errorHandler: function (err) { - return typeof console !== "undefined" && console.warn(err); - }, - getWeek: function (givenDate) { - var date = new Date(givenDate.getTime()); - date.setHours(0, 0, 0, 0); - // Thursday in current week decides the year. - date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7)); - // January 4 is always in week 1. - var week1 = new Date(date.getFullYear(), 0, 4); - // Adjust to Thursday in week 1 and count number of weeks from date to week1. - return (1 + - Math.round(((date.getTime() - week1.getTime()) / 86400000 - - 3 + - ((week1.getDay() + 6) % 7)) / - 7)); - }, - hourIncrement: 1, - ignoredFocusElements: [], - inline: false, - locale: "default", - minuteIncrement: 5, - mode: "single", - monthSelectorType: "dropdown", - nextArrow: "", - noCalendar: false, - now: new Date(), - onChange: [], - onClose: [], - onDayCreate: [], - onDestroy: [], - onKeyDown: [], - onMonthChange: [], - onOpen: [], - onParseConfig: [], - onReady: [], - onValueUpdate: [], - onYearChange: [], - onPreCalendarPosition: [], - plugins: [], - position: "auto", - positionElement: undefined, - prevArrow: "", - shorthandCurrentMonth: false, - showMonths: 1, - static: false, - time_24hr: false, - weekNumbers: false, - wrap: false - }; - - var english = { - weekdays: { - shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - longhand: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - ] - }, - months: { - shorthand: [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", - ], - longhand: [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ] - }, - daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - firstDayOfWeek: 0, - ordinal: function (nth) { - var s = nth % 100; - if (s > 3 && s < 21) - return "th"; - switch (s % 10) { - case 1: - return "st"; - case 2: - return "nd"; - case 3: - return "rd"; - default: - return "th"; - } - }, - rangeSeparator: " to ", - weekAbbreviation: "Wk", - scrollTitle: "Scroll to increment", - toggleTitle: "Click to toggle", - amPM: ["AM", "PM"], - yearAriaLabel: "Year", - hourAriaLabel: "Hour", - minuteAriaLabel: "Minute", - time_24hr: false - }; - - var pad = function (number) { return ("0" + number).slice(-2); }; - var int = function (bool) { return (bool === true ? 1 : 0); }; - /* istanbul ignore next */ - function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var context = this, args = arguments; - timeout !== null && clearTimeout(timeout); - timeout = window.setTimeout(function () { - timeout = null; - if (!immediate) - func.apply(context, args); - }, wait); - if (immediate && !timeout) - func.apply(context, args); - }; - } - var arrayify = function (obj) { - return obj instanceof Array ? obj : [obj]; - }; - - function toggleClass(elem, className, bool) { - if (bool === true) - return elem.classList.add(className); - elem.classList.remove(className); - } - function createElement(tag, className, content) { - var e = window.document.createElement(tag); - className = className || ""; - content = content || ""; - e.className = className; - if (content !== undefined) - e.textContent = content; - return e; - } - function clearNode(node) { - while (node.firstChild) - node.removeChild(node.firstChild); - } - function findParent(node, condition) { - if (condition(node)) - return node; - else if (node.parentNode) - return findParent(node.parentNode, condition); - return undefined; // nothing found - } - function createNumberInput(inputClassName, opts) { - var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); - if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { - numInput.type = "number"; - } - else { - numInput.type = "text"; - numInput.pattern = "\\d*"; - } - if (opts !== undefined) - for (var key in opts) - numInput.setAttribute(key, opts[key]); - wrapper.appendChild(numInput); - wrapper.appendChild(arrowUp); - wrapper.appendChild(arrowDown); - return wrapper; - } - function getEventTarget(event) { - if (typeof event.composedPath === "function") { - var path = event.composedPath(); - return path[0]; - } - return event.target; - } - - var doNothing = function () { return undefined; }; - var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; - var revFormat = { - D: doNothing, - F: function (dateObj, monthName, locale) { - dateObj.setMonth(locale.months.longhand.indexOf(monthName)); - }, - G: function (dateObj, hour) { - dateObj.setHours(parseFloat(hour)); - }, - H: function (dateObj, hour) { - dateObj.setHours(parseFloat(hour)); - }, - J: function (dateObj, day) { - dateObj.setDate(parseFloat(day)); - }, - K: function (dateObj, amPM, locale) { - dateObj.setHours((dateObj.getHours() % 12) + - 12 * int(new RegExp(locale.amPM[1], "i").test(amPM))); - }, - M: function (dateObj, shortMonth, locale) { - dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); - }, - S: function (dateObj, seconds) { - dateObj.setSeconds(parseFloat(seconds)); - }, - U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); }, - W: function (dateObj, weekNum, locale) { - var weekNumber = parseInt(weekNum); - var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); - date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); - return date; - }, - Y: function (dateObj, year) { - dateObj.setFullYear(parseFloat(year)); - }, - Z: function (_, ISODate) { return new Date(ISODate); }, - d: function (dateObj, day) { - dateObj.setDate(parseFloat(day)); - }, - h: function (dateObj, hour) { - dateObj.setHours(parseFloat(hour)); - }, - i: function (dateObj, minutes) { - dateObj.setMinutes(parseFloat(minutes)); - }, - j: function (dateObj, day) { - dateObj.setDate(parseFloat(day)); - }, - l: doNothing, - m: function (dateObj, month) { - dateObj.setMonth(parseFloat(month) - 1); - }, - n: function (dateObj, month) { - dateObj.setMonth(parseFloat(month) - 1); - }, - s: function (dateObj, seconds) { - dateObj.setSeconds(parseFloat(seconds)); - }, - u: function (_, unixMillSeconds) { - return new Date(parseFloat(unixMillSeconds)); - }, - w: doNothing, - y: function (dateObj, year) { - dateObj.setFullYear(2000 + parseFloat(year)); - } - }; - var tokenRegex = { - D: "(\\w+)", - F: "(\\w+)", - G: "(\\d\\d|\\d)", - H: "(\\d\\d|\\d)", - J: "(\\d\\d|\\d)\\w+", - K: "", - M: "(\\w+)", - S: "(\\d\\d|\\d)", - U: "(.+)", - W: "(\\d\\d|\\d)", - Y: "(\\d{4})", - Z: "(.+)", - d: "(\\d\\d|\\d)", - h: "(\\d\\d|\\d)", - i: "(\\d\\d|\\d)", - j: "(\\d\\d|\\d)", - l: "(\\w+)", - m: "(\\d\\d|\\d)", - n: "(\\d\\d|\\d)", - s: "(\\d\\d|\\d)", - u: "(.+)", - w: "(\\d\\d|\\d)", - y: "(\\d{2})" - }; - var formats = { - // get the date in UTC - Z: function (date) { return date.toISOString(); }, - // weekday name, short, e.g. Thu - D: function (date, locale, options) { - return locale.weekdays.shorthand[formats.w(date, locale, options)]; - }, - // full month name e.g. January - F: function (date, locale, options) { - return monthToStr(formats.n(date, locale, options) - 1, false, locale); - }, - // padded hour 1-12 - G: function (date, locale, options) { - return pad(formats.h(date, locale, options)); - }, - // hours with leading zero e.g. 03 - H: function (date) { return pad(date.getHours()); }, - // day (1-30) with ordinal suffix e.g. 1st, 2nd - J: function (date, locale) { - return locale.ordinal !== undefined - ? date.getDate() + locale.ordinal(date.getDate()) - : date.getDate(); - }, - // AM/PM - K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; }, - // shorthand month e.g. Jan, Sep, Oct, etc - M: function (date, locale) { - return monthToStr(date.getMonth(), true, locale); - }, - // seconds 00-59 - S: function (date) { return pad(date.getSeconds()); }, - // unix timestamp - U: function (date) { return date.getTime() / 1000; }, - W: function (date, _, options) { - return options.getWeek(date); - }, - // full year e.g. 2016 - Y: function (date) { return date.getFullYear(); }, - // day in month, padded (01-30) - d: function (date) { return pad(date.getDate()); }, - // hour from 1-12 (am/pm) - h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); }, - // minutes, padded with leading zero e.g. 09 - i: function (date) { return pad(date.getMinutes()); }, - // day in month (1-30) - j: function (date) { return date.getDate(); }, - // weekday name, full, e.g. Thursday - l: function (date, locale) { - return locale.weekdays.longhand[date.getDay()]; - }, - // padded month number (01-12) - m: function (date) { return pad(date.getMonth() + 1); }, - // the month number (1-12) - n: function (date) { return date.getMonth() + 1; }, - // seconds 0-59 - s: function (date) { return date.getSeconds(); }, - // Unix Milliseconds - u: function (date) { return date.getTime(); }, - // number of the day of the week - w: function (date) { return date.getDay(); }, - // last two digits of year e.g. 16 for 2016 - y: function (date) { return String(date.getFullYear()).substring(2); } - }; - - var createDateFormatter = function (_a) { - var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; - return function (dateObj, frmt, overrideLocale) { - var locale = overrideLocale || l10n; - if (config.formatDate !== undefined) { - return config.formatDate(dateObj, frmt, locale); - } - return frmt - .split("") - .map(function (c, i, arr) { - return formats[c] && arr[i - 1] !== "\\" - ? formats[c](dateObj, locale, config) - : c !== "\\" - ? c - : ""; - }) - .join(""); - }; - }; - var createDateParser = function (_a) { - var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; - return function (date, givenFormat, timeless, customLocale) { - if (date !== 0 && !date) - return undefined; - var locale = customLocale || l10n; - var parsedDate; - var dateOrig = date; - if (date instanceof Date) - parsedDate = new Date(date.getTime()); - else if (typeof date !== "string" && - date.toFixed !== undefined // timestamp - ) - // create a copy - parsedDate = new Date(date); - else if (typeof date === "string") { - // date string - var format = givenFormat || (config || defaults).dateFormat; - var datestr = String(date).trim(); - if (datestr === "today") { - parsedDate = new Date(); - timeless = true; - } - else if (/Z$/.test(datestr) || - /GMT$/.test(datestr) // datestrings w/ timezone - ) - parsedDate = new Date(date); - else if (config && config.parseDate) - parsedDate = config.parseDate(date, format); - else { - parsedDate = - !config || !config.noCalendar - ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) - : new Date(new Date().setHours(0, 0, 0, 0)); - var matched = void 0, ops = []; - for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { - var token_1 = format[i]; - var isBackSlash = token_1 === "\\"; - var escaped = format[i - 1] === "\\" || isBackSlash; - if (tokenRegex[token_1] && !escaped) { - regexStr += tokenRegex[token_1]; - var match = new RegExp(regexStr).exec(date); - if (match && (matched = true)) { - ops[token_1 !== "Y" ? "push" : "unshift"]({ - fn: revFormat[token_1], - val: match[++matchIndex] - }); - } - } - else if (!isBackSlash) - regexStr += "."; // don't really care - ops.forEach(function (_a) { - var fn = _a.fn, val = _a.val; - return (parsedDate = fn(parsedDate, val, locale) || parsedDate); - }); - } - parsedDate = matched ? parsedDate : undefined; - } - } - /* istanbul ignore next */ - if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { - config.errorHandler(new Error("Invalid date provided: " + dateOrig)); - return undefined; - } - if (timeless === true) - parsedDate.setHours(0, 0, 0, 0); - return parsedDate; - }; - }; - /** - * Compute the difference in dates, measured in ms - */ - function compareDates(date1, date2, timeless) { - if (timeless === void 0) { timeless = true; } - if (timeless !== false) { - return (new Date(date1.getTime()).setHours(0, 0, 0, 0) - - new Date(date2.getTime()).setHours(0, 0, 0, 0)); - } - return date1.getTime() - date2.getTime(); - } - var isBetween = function (ts, ts1, ts2) { - return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); - }; - var duration = { - DAY: 86400000 - }; - - if (typeof Object.assign !== "function") { - Object.assign = function (target) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (!target) { - throw TypeError("Cannot convert undefined or null to object"); - } - var _loop_1 = function (source) { - if (source) { - Object.keys(source).forEach(function (key) { return (target[key] = source[key]); }); - } - }; - for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { - var source = args_1[_a]; - _loop_1(source); - } - return target; - }; - } - - var DEBOUNCED_CHANGE_MS = 300; - function FlatpickrInstance(element, instanceConfig) { - var self = { - config: __assign({}, defaults, flatpickr.defaultConfig), - l10n: english - }; - self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); - self._handlers = []; - self.pluginElements = []; - self.loadedPlugins = []; - self._bind = bind; - self._setHoursFromDate = setHoursFromDate; - self._positionCalendar = positionCalendar; - self.changeMonth = changeMonth; - self.changeYear = changeYear; - self.clear = clear; - self.close = close; - self._createElement = createElement; - self.destroy = destroy; - self.isEnabled = isEnabled; - self.jumpToDate = jumpToDate; - self.open = open; - self.redraw = redraw; - self.set = set; - self.setDate = setDate; - self.toggle = toggle; - function setupHelperFunctions() { - self.utils = { - getDaysInMonth: function (month, yr) { - if (month === void 0) { month = self.currentMonth; } - if (yr === void 0) { yr = self.currentYear; } - if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0)) - return 29; - return self.l10n.daysInMonth[month]; - } - }; - } - function init() { - self.element = self.input = element; - self.isOpen = false; - parseConfig(); - setupLocale(); - setupInputs(); - setupDates(); - setupHelperFunctions(); - if (!self.isMobile) - build(); - bindEvents(); - if (self.selectedDates.length || self.config.noCalendar) { - if (self.config.enableTime) { - setHoursFromDate(self.config.noCalendar - ? self.latestSelectedDateObj || self.config.minDate - : undefined); - } - updateValue(false); - } - setCalendarWidth(); - self.showTimeInput = - self.selectedDates.length > 0 || self.config.noCalendar; - var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); - /* TODO: investigate this further - - Currently, there is weird positioning behavior in safari causing pages - to scroll up. https://github.com/chmln/flatpickr/issues/563 - - However, most browsers are not Safari and positioning is expensive when used - in scale. https://github.com/chmln/flatpickr/issues/1096 - */ - if (!self.isMobile && isSafari) { - positionCalendar(); - } - triggerEvent("onReady"); - } - function bindToInstance(fn) { - return fn.bind(self); - } - function setCalendarWidth() { - var config = self.config; - if (config.weekNumbers === false && config.showMonths === 1) - return; - else if (config.noCalendar !== true) { - window.requestAnimationFrame(function () { - if (self.calendarContainer !== undefined) { - self.calendarContainer.style.visibility = "hidden"; - self.calendarContainer.style.display = "block"; - } - if (self.daysContainer !== undefined) { - var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; - self.daysContainer.style.width = daysWidth + "px"; - self.calendarContainer.style.width = - daysWidth + - (self.weekWrapper !== undefined - ? self.weekWrapper.offsetWidth - : 0) + - "px"; - self.calendarContainer.style.removeProperty("visibility"); - self.calendarContainer.style.removeProperty("display"); - } - }); - } - } - /** - * The handler for all events targeting the time inputs - */ - function updateTime(e) { - if (self.selectedDates.length === 0) { - setDefaultTime(); - } - if (e !== undefined && e.type !== "blur") { - timeWrapper(e); - } - var prevValue = self._input.value; - setHoursFromInputs(); - updateValue(); - if (self._input.value !== prevValue) { - self._debouncedChange(); - } - } - function ampm2military(hour, amPM) { - return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]); - } - function military2ampm(hour) { - switch (hour % 24) { - case 0: - case 12: - return 12; - default: - return hour % 12; - } - } - /** - * Syncs the selected date object time with user's time input - */ - function setHoursFromInputs() { - if (self.hourElement === undefined || self.minuteElement === undefined) - return; - var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined - ? (parseInt(self.secondElement.value, 10) || 0) % 60 - : 0; - if (self.amPM !== undefined) { - hours = ampm2military(hours, self.amPM.textContent); - } - var limitMinHours = self.config.minTime !== undefined || - (self.config.minDate && - self.minDateHasTime && - self.latestSelectedDateObj && - compareDates(self.latestSelectedDateObj, self.config.minDate, true) === - 0); - var limitMaxHours = self.config.maxTime !== undefined || - (self.config.maxDate && - self.maxDateHasTime && - self.latestSelectedDateObj && - compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === - 0); - if (limitMaxHours) { - var maxTime = self.config.maxTime !== undefined - ? self.config.maxTime - : self.config.maxDate; - hours = Math.min(hours, maxTime.getHours()); - if (hours === maxTime.getHours()) - minutes = Math.min(minutes, maxTime.getMinutes()); - if (minutes === maxTime.getMinutes()) - seconds = Math.min(seconds, maxTime.getSeconds()); - } - if (limitMinHours) { - var minTime = self.config.minTime !== undefined - ? self.config.minTime - : self.config.minDate; - hours = Math.max(hours, minTime.getHours()); - if (hours === minTime.getHours()) - minutes = Math.max(minutes, minTime.getMinutes()); - if (minutes === minTime.getMinutes()) - seconds = Math.max(seconds, minTime.getSeconds()); - } - setHours(hours, minutes, seconds); - } - /** - * Syncs time input values with a date - */ - function setHoursFromDate(dateObj) { - var date = dateObj || self.latestSelectedDateObj; - if (date) - setHours(date.getHours(), date.getMinutes(), date.getSeconds()); - } - function setDefaultHours() { - var hours = self.config.defaultHour; - var minutes = self.config.defaultMinute; - var seconds = self.config.defaultSeconds; - if (self.config.minDate !== undefined) { - var minHr = self.config.minDate.getHours(); - var minMinutes = self.config.minDate.getMinutes(); - hours = Math.max(hours, minHr); - if (hours === minHr) - minutes = Math.max(minMinutes, minutes); - if (hours === minHr && minutes === minMinutes) - seconds = self.config.minDate.getSeconds(); - } - if (self.config.maxDate !== undefined) { - var maxHr = self.config.maxDate.getHours(); - var maxMinutes = self.config.maxDate.getMinutes(); - hours = Math.min(hours, maxHr); - if (hours === maxHr) - minutes = Math.min(maxMinutes, minutes); - if (hours === maxHr && minutes === maxMinutes) - seconds = self.config.maxDate.getSeconds(); - } - setHours(hours, minutes, seconds); - } - /** - * Sets the hours, minutes, and optionally seconds - * of the latest selected date object and the - * corresponding time inputs - * @param {Number} hours the hour. whether its military - * or am-pm gets inferred from config - * @param {Number} minutes the minutes - * @param {Number} seconds the seconds (optional) - */ - function setHours(hours, minutes, seconds) { - if (self.latestSelectedDateObj !== undefined) { - self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); - } - if (!self.hourElement || !self.minuteElement || self.isMobile) - return; - self.hourElement.value = pad(!self.config.time_24hr - ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0) - : hours); - self.minuteElement.value = pad(minutes); - if (self.amPM !== undefined) - self.amPM.textContent = self.l10n.amPM[int(hours >= 12)]; - if (self.secondElement !== undefined) - self.secondElement.value = pad(seconds); - } - /** - * Handles the year input and incrementing events - * @param {Event} event the keyup or increment event - */ - function onYearInput(event) { - var year = parseInt(event.target.value) + (event.delta || 0); - if (year / 1000 > 1 || - (event.key === "Enter" && !/[^\d]/.test(year.toString()))) { - changeYear(year); - } - } - /** - * Essentially addEventListener + tracking - * @param {Element} element the element to addEventListener to - * @param {String} event the event name - * @param {Function} handler the event handler - */ - function bind(element, event, handler, options) { - if (event instanceof Array) - return event.forEach(function (ev) { return bind(element, ev, handler, options); }); - if (element instanceof Array) - return element.forEach(function (el) { return bind(el, event, handler, options); }); - element.addEventListener(event, handler, options); - self._handlers.push({ - element: element, - event: event, - handler: handler, - options: options - }); - } - /** - * A mousedown handler which mimics click. - * Minimizes latency, since we don't need to wait for mouseup in most cases. - * Also, avoids handling right clicks. - * - * @param {Function} handler the event handler - */ - function onClick(handler) { - return function (evt) { - evt.which === 1 && handler(evt); - }; - } - function triggerChange() { - triggerEvent("onChange"); - } - /** - * Adds all the necessary event listeners - */ - function bindEvents() { - if (self.config.wrap) { - ["open", "close", "toggle", "clear"].forEach(function (evt) { - Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { - return bind(el, "click", self[evt]); - }); - }); - } - if (self.isMobile) { - setupMobile(); - return; - } - var debouncedResize = debounce(onResize, 50); - self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS); - if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) - bind(self.daysContainer, "mouseover", function (e) { - if (self.config.mode === "range") - onMouseOver(e.target); - }); - bind(window.document.body, "keydown", onKeyDown); - if (!self.config.inline && !self.config.static) - bind(window, "resize", debouncedResize); - if (window.ontouchstart !== undefined) - bind(window.document, "touchstart", documentClick); - else - bind(window.document, "mousedown", onClick(documentClick)); - bind(window.document, "focus", documentClick, { capture: true }); - if (self.config.clickOpens === true) { - bind(self._input, "focus", self.open); - bind(self._input, "mousedown", onClick(self.open)); - } - if (self.daysContainer !== undefined) { - bind(self.monthNav, "mousedown", onClick(onMonthNavClick)); - bind(self.monthNav, ["keyup", "increment"], onYearInput); - bind(self.daysContainer, "mousedown", onClick(selectDate)); - } - if (self.timeContainer !== undefined && - self.minuteElement !== undefined && - self.hourElement !== undefined) { - var selText = function (e) { - return e.target.select(); - }; - bind(self.timeContainer, ["increment"], updateTime); - bind(self.timeContainer, "blur", updateTime, { capture: true }); - bind(self.timeContainer, "mousedown", onClick(timeIncrement)); - bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); - if (self.secondElement !== undefined) - bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); }); - if (self.amPM !== undefined) { - bind(self.amPM, "mousedown", onClick(function (e) { - updateTime(e); - triggerChange(); - })); - } - } - } - /** - * Set the calendar view to a particular date. - * @param {Date} jumpDate the date to set the view to - * @param {boolean} triggerChange if change events should be triggered - */ - function jumpToDate(jumpDate, triggerChange) { - var jumpTo = jumpDate !== undefined - ? self.parseDate(jumpDate) - : self.latestSelectedDateObj || - (self.config.minDate && self.config.minDate > self.now - ? self.config.minDate - : self.config.maxDate && self.config.maxDate < self.now - ? self.config.maxDate - : self.now); - var oldYear = self.currentYear; - var oldMonth = self.currentMonth; - try { - if (jumpTo !== undefined) { - self.currentYear = jumpTo.getFullYear(); - self.currentMonth = jumpTo.getMonth(); - } - } - catch (e) { - /* istanbul ignore next */ - e.message = "Invalid date supplied: " + jumpTo; - self.config.errorHandler(e); - } - if (triggerChange && self.currentYear !== oldYear) { - triggerEvent("onYearChange"); - buildMonthSwitch(); - } - if (triggerChange && - (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) { - triggerEvent("onMonthChange"); - } - self.redraw(); - } - /** - * The up/down arrow handler for time inputs - * @param {Event} e the click event - */ - function timeIncrement(e) { - if (~e.target.className.indexOf("arrow")) - incrementNumInput(e, e.target.classList.contains("arrowUp") ? 1 : -1); - } - /** - * Increments/decrements the value of input associ- - * ated with the up/down arrow by dispatching an - * "increment" event on the input. - * - * @param {Event} e the click event - * @param {Number} delta the diff (usually 1 or -1) - * @param {Element} inputElem the input element - */ - function incrementNumInput(e, delta, inputElem) { - var target = e && e.target; - var input = inputElem || - (target && target.parentNode && target.parentNode.firstChild); - var event = createEvent("increment"); - event.delta = delta; - input && input.dispatchEvent(event); - } - function build() { - var fragment = window.document.createDocumentFragment(); - self.calendarContainer = createElement("div", "flatpickr-calendar"); - self.calendarContainer.tabIndex = -1; - if (!self.config.noCalendar) { - fragment.appendChild(buildMonthNav()); - self.innerContainer = createElement("div", "flatpickr-innerContainer"); - if (self.config.weekNumbers) { - var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; - self.innerContainer.appendChild(weekWrapper); - self.weekNumbers = weekNumbers; - self.weekWrapper = weekWrapper; - } - self.rContainer = createElement("div", "flatpickr-rContainer"); - self.rContainer.appendChild(buildWeekdays()); - if (!self.daysContainer) { - self.daysContainer = createElement("div", "flatpickr-days"); - self.daysContainer.tabIndex = -1; - } - buildDays(); - self.rContainer.appendChild(self.daysContainer); - self.innerContainer.appendChild(self.rContainer); - fragment.appendChild(self.innerContainer); - } - if (self.config.enableTime) { - fragment.appendChild(buildTime()); - } - toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range"); - toggleClass(self.calendarContainer, "animate", self.config.animate === true); - toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1); - self.calendarContainer.appendChild(fragment); - var customAppend = self.config.appendTo !== undefined && - self.config.appendTo.nodeType !== undefined; - if (self.config.inline || self.config.static) { - self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); - if (self.config.inline) { - if (!customAppend && self.element.parentNode) - self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling); - else if (self.config.appendTo !== undefined) - self.config.appendTo.appendChild(self.calendarContainer); - } - if (self.config.static) { - var wrapper = createElement("div", "flatpickr-wrapper"); - if (self.element.parentNode) - self.element.parentNode.insertBefore(wrapper, self.element); - wrapper.appendChild(self.element); - if (self.altInput) - wrapper.appendChild(self.altInput); - wrapper.appendChild(self.calendarContainer); - } - } - if (!self.config.static && !self.config.inline) - (self.config.appendTo !== undefined - ? self.config.appendTo - : window.document.body).appendChild(self.calendarContainer); - } - function createDay(className, date, dayNumber, i) { - var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", "flatpickr-day " + className, date.getDate().toString()); - dayElement.dateObj = date; - dayElement.$i = i; - dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); - if (className.indexOf("hidden") === -1 && - compareDates(date, self.now) === 0) { - self.todayDateElem = dayElement; - dayElement.classList.add("today"); - dayElement.setAttribute("aria-current", "date"); - } - if (dateIsEnabled) { - dayElement.tabIndex = -1; - if (isDateSelected(date)) { - dayElement.classList.add("selected"); - self.selectedDateElem = dayElement; - if (self.config.mode === "range") { - toggleClass(dayElement, "startRange", self.selectedDates[0] && - compareDates(date, self.selectedDates[0], true) === 0); - toggleClass(dayElement, "endRange", self.selectedDates[1] && - compareDates(date, self.selectedDates[1], true) === 0); - if (className === "nextMonthDay") - dayElement.classList.add("inRange"); - } - } - } - else { - dayElement.classList.add("flatpickr-disabled"); - } - if (self.config.mode === "range") { - if (isDateInRange(date) && !isDateSelected(date)) - dayElement.classList.add("inRange"); - } - if (self.weekNumbers && - self.config.showMonths === 1 && - className !== "prevMonthDay" && - dayNumber % 7 === 1) { - self.weekNumbers.insertAdjacentHTML("beforeend", "" + self.config.getWeek(date) + ""); - } - triggerEvent("onDayCreate", dayElement); - return dayElement; - } - function focusOnDayElem(targetNode) { - targetNode.focus(); - if (self.config.mode === "range") - onMouseOver(targetNode); - } - function getFirstAvailableDay(delta) { - var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; - var endMonth = delta > 0 ? self.config.showMonths : -1; - for (var m = startMonth; m != endMonth; m += delta) { - var month = self.daysContainer.children[m]; - var startIndex = delta > 0 ? 0 : month.children.length - 1; - var endIndex = delta > 0 ? month.children.length : -1; - for (var i = startIndex; i != endIndex; i += delta) { - var c = month.children[i]; - if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) - return c; - } - } - return undefined; - } - function getNextAvailableDay(current, delta) { - var givenMonth = current.className.indexOf("Month") === -1 - ? current.dateObj.getMonth() - : self.currentMonth; - var endMonth = delta > 0 ? self.config.showMonths : -1; - var loopDelta = delta > 0 ? 1 : -1; - for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { - var month = self.daysContainer.children[m]; - var startIndex = givenMonth - self.currentMonth === m - ? current.$i + delta - : delta < 0 - ? month.children.length - 1 - : 0; - var numMonthDays = month.children.length; - for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { - var c = month.children[i]; - if (c.className.indexOf("hidden") === -1 && - isEnabled(c.dateObj) && - Math.abs(current.$i - i) >= Math.abs(delta)) - return focusOnDayElem(c); - } - } - self.changeMonth(loopDelta); - focusOnDay(getFirstAvailableDay(loopDelta), 0); - return undefined; - } - function focusOnDay(current, offset) { - var dayFocused = isInView(document.activeElement || document.body); - var startElem = current !== undefined - ? current - : dayFocused - ? document.activeElement - : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) - ? self.selectedDateElem - : self.todayDateElem !== undefined && isInView(self.todayDateElem) - ? self.todayDateElem - : getFirstAvailableDay(offset > 0 ? 1 : -1); - if (startElem === undefined) - return self._input.focus(); - if (!dayFocused) - return focusOnDayElem(startElem); - getNextAvailableDay(startElem, offset); - } - function buildMonthDays(year, month) { - var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; - var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12); - var daysInMonth = self.utils.getDaysInMonth(month), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay"; - var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; - // prepend days from the ending of previous month - for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { - days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); - } - // Start at 1 since there is no 0th day - for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { - days.appendChild(createDay("", new Date(year, month, dayNumber), dayNumber, dayIndex)); - } - // append days from the next month - for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && - (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { - days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); - } - //updateNavigationCurrentMonth(); - var dayContainer = createElement("div", "dayContainer"); - dayContainer.appendChild(days); - return dayContainer; - } - function buildDays() { - if (self.daysContainer === undefined) { - return; - } - clearNode(self.daysContainer); - // TODO: week numbers for each month - if (self.weekNumbers) - clearNode(self.weekNumbers); - var frag = document.createDocumentFragment(); - for (var i = 0; i < self.config.showMonths; i++) { - var d = new Date(self.currentYear, self.currentMonth, 1); - d.setMonth(self.currentMonth + i); - frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); - } - self.daysContainer.appendChild(frag); - self.days = self.daysContainer.firstChild; - if (self.config.mode === "range" && self.selectedDates.length === 1) { - onMouseOver(); - } - } - function buildMonthSwitch() { - if (self.config.showMonths > 1 || - self.config.monthSelectorType !== "dropdown") - return; - var shouldBuildMonth = function (month) { - if (self.config.minDate !== undefined && - self.currentYear === self.config.minDate.getFullYear() && - month < self.config.minDate.getMonth()) { - return false; - } - return !(self.config.maxDate !== undefined && - self.currentYear === self.config.maxDate.getFullYear() && - month > self.config.maxDate.getMonth()); - }; - self.monthsDropdownContainer.tabIndex = -1; - self.monthsDropdownContainer.innerHTML = ""; - for (var i = 0; i < 12; i++) { - if (!shouldBuildMonth(i)) - continue; - var month = createElement("option", "flatpickr-monthDropdown-month"); - month.value = new Date(self.currentYear, i).getMonth().toString(); - month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n); - month.tabIndex = -1; - if (self.currentMonth === i) { - month.selected = true; - } - self.monthsDropdownContainer.appendChild(month); - } - } - function buildMonth() { - var container = createElement("div", "flatpickr-month"); - var monthNavFragment = window.document.createDocumentFragment(); - var monthElement; - if (self.config.showMonths > 1 || - self.config.monthSelectorType === "static") { - monthElement = createElement("span", "cur-month"); - } - else { - self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months"); - bind(self.monthsDropdownContainer, "change", function (e) { - var target = e.target; - var selectedMonth = parseInt(target.value, 10); - self.changeMonth(selectedMonth - self.currentMonth); - triggerEvent("onMonthChange"); - }); - buildMonthSwitch(); - monthElement = self.monthsDropdownContainer; - } - var yearInput = createNumberInput("cur-year", { tabindex: "-1" }); - var yearElement = yearInput.getElementsByTagName("input")[0]; - yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); - if (self.config.minDate) { - yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()); - } - if (self.config.maxDate) { - yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()); - yearElement.disabled = - !!self.config.minDate && - self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); - } - var currentMonth = createElement("div", "flatpickr-current-month"); - currentMonth.appendChild(monthElement); - currentMonth.appendChild(yearInput); - monthNavFragment.appendChild(currentMonth); - container.appendChild(monthNavFragment); - return { - container: container, - yearElement: yearElement, - monthElement: monthElement - }; - } - function buildMonths() { - clearNode(self.monthNav); - self.monthNav.appendChild(self.prevMonthNav); - if (self.config.showMonths) { - self.yearElements = []; - self.monthElements = []; - } - for (var m = self.config.showMonths; m--;) { - var month = buildMonth(); - self.yearElements.push(month.yearElement); - self.monthElements.push(month.monthElement); - self.monthNav.appendChild(month.container); - } - self.monthNav.appendChild(self.nextMonthNav); - } - function buildMonthNav() { - self.monthNav = createElement("div", "flatpickr-months"); - self.yearElements = []; - self.monthElements = []; - self.prevMonthNav = createElement("span", "flatpickr-prev-month"); - self.prevMonthNav.innerHTML = self.config.prevArrow; - self.nextMonthNav = createElement("span", "flatpickr-next-month"); - self.nextMonthNav.innerHTML = self.config.nextArrow; - buildMonths(); - Object.defineProperty(self, "_hidePrevMonthArrow", { - get: function () { return self.__hidePrevMonthArrow; }, - set: function (bool) { - if (self.__hidePrevMonthArrow !== bool) { - toggleClass(self.prevMonthNav, "flatpickr-disabled", bool); - self.__hidePrevMonthArrow = bool; - } - } - }); - Object.defineProperty(self, "_hideNextMonthArrow", { - get: function () { return self.__hideNextMonthArrow; }, - set: function (bool) { - if (self.__hideNextMonthArrow !== bool) { - toggleClass(self.nextMonthNav, "flatpickr-disabled", bool); - self.__hideNextMonthArrow = bool; - } - } - }); - self.currentYearElement = self.yearElements[0]; - updateNavigationCurrentMonth(); - return self.monthNav; - } - function buildTime() { - self.calendarContainer.classList.add("hasTime"); - if (self.config.noCalendar) - self.calendarContainer.classList.add("noCalendar"); - self.timeContainer = createElement("div", "flatpickr-time"); - self.timeContainer.tabIndex = -1; - var separator = createElement("span", "flatpickr-time-separator", ":"); - var hourInput = createNumberInput("flatpickr-hour", { - "aria-label": self.l10n.hourAriaLabel - }); - self.hourElement = hourInput.getElementsByTagName("input")[0]; - var minuteInput = createNumberInput("flatpickr-minute", { - "aria-label": self.l10n.minuteAriaLabel - }); - self.minuteElement = minuteInput.getElementsByTagName("input")[0]; - self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; - self.hourElement.value = pad(self.latestSelectedDateObj - ? self.latestSelectedDateObj.getHours() - : self.config.time_24hr - ? self.config.defaultHour - : military2ampm(self.config.defaultHour)); - self.minuteElement.value = pad(self.latestSelectedDateObj - ? self.latestSelectedDateObj.getMinutes() - : self.config.defaultMinute); - self.hourElement.setAttribute("step", self.config.hourIncrement.toString()); - self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()); - self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"); - self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"); - self.minuteElement.setAttribute("min", "0"); - self.minuteElement.setAttribute("max", "59"); - self.timeContainer.appendChild(hourInput); - self.timeContainer.appendChild(separator); - self.timeContainer.appendChild(minuteInput); - if (self.config.time_24hr) - self.timeContainer.classList.add("time24hr"); - if (self.config.enableSeconds) { - self.timeContainer.classList.add("hasSeconds"); - var secondInput = createNumberInput("flatpickr-second"); - self.secondElement = secondInput.getElementsByTagName("input")[0]; - self.secondElement.value = pad(self.latestSelectedDateObj - ? self.latestSelectedDateObj.getSeconds() - : self.config.defaultSeconds); - self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")); - self.secondElement.setAttribute("min", "0"); - self.secondElement.setAttribute("max", "59"); - self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")); - self.timeContainer.appendChild(secondInput); - } - if (!self.config.time_24hr) { - // add self.amPM if appropriate - self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj - ? self.hourElement.value - : self.config.defaultHour) > 11)]); - self.amPM.title = self.l10n.toggleTitle; - self.amPM.tabIndex = -1; - self.timeContainer.appendChild(self.amPM); - } - return self.timeContainer; - } - function buildWeekdays() { - if (!self.weekdayContainer) - self.weekdayContainer = createElement("div", "flatpickr-weekdays"); - else - clearNode(self.weekdayContainer); - for (var i = self.config.showMonths; i--;) { - var container = createElement("div", "flatpickr-weekdaycontainer"); - self.weekdayContainer.appendChild(container); - } - updateWeekdays(); - return self.weekdayContainer; - } - function updateWeekdays() { - var firstDayOfWeek = self.l10n.firstDayOfWeek; - var weekdays = self.l10n.weekdays.shorthand.slice(); - if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { - weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek)); - } - for (var i = self.config.showMonths; i--;) { - self.weekdayContainer.children[i].innerHTML = "\n \n " + weekdays.join("") + "\n \n "; - } - } - /* istanbul ignore next */ - function buildWeeks() { - self.calendarContainer.classList.add("hasWeeks"); - var weekWrapper = createElement("div", "flatpickr-weekwrapper"); - weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); - var weekNumbers = createElement("div", "flatpickr-weeks"); - weekWrapper.appendChild(weekNumbers); - return { - weekWrapper: weekWrapper, - weekNumbers: weekNumbers - }; - } - function changeMonth(value, isOffset) { - if (isOffset === void 0) { isOffset = true; } - var delta = isOffset ? value : value - self.currentMonth; - if ((delta < 0 && self._hidePrevMonthArrow === true) || - (delta > 0 && self._hideNextMonthArrow === true)) - return; - self.currentMonth += delta; - if (self.currentMonth < 0 || self.currentMonth > 11) { - self.currentYear += self.currentMonth > 11 ? 1 : -1; - self.currentMonth = (self.currentMonth + 12) % 12; - triggerEvent("onYearChange"); - buildMonthSwitch(); - } - buildDays(); - triggerEvent("onMonthChange"); - updateNavigationCurrentMonth(); - } - function clear(triggerChangeEvent, toInitial) { - if (triggerChangeEvent === void 0) { triggerChangeEvent = true; } - if (toInitial === void 0) { toInitial = true; } - self.input.value = ""; - if (self.altInput !== undefined) - self.altInput.value = ""; - if (self.mobileInput !== undefined) - self.mobileInput.value = ""; - self.selectedDates = []; - self.latestSelectedDateObj = undefined; - if (toInitial === true) { - self.currentYear = self._initialDate.getFullYear(); - self.currentMonth = self._initialDate.getMonth(); - } - self.showTimeInput = false; - if (self.config.enableTime === true) { - setDefaultHours(); - } - self.redraw(); - if (triggerChangeEvent) - // triggerChangeEvent is true (default) or an Event - triggerEvent("onChange"); - } - function close() { - self.isOpen = false; - if (!self.isMobile) { - if (self.calendarContainer !== undefined) { - self.calendarContainer.classList.remove("open"); - } - if (self._input !== undefined) { - self._input.classList.remove("active"); - } - } - triggerEvent("onClose"); - } - function destroy() { - if (self.config !== undefined) - triggerEvent("onDestroy"); - for (var i = self._handlers.length; i--;) { - var h = self._handlers[i]; - h.element.removeEventListener(h.event, h.handler, h.options); - } - self._handlers = []; - if (self.mobileInput) { - if (self.mobileInput.parentNode) - self.mobileInput.parentNode.removeChild(self.mobileInput); - self.mobileInput = undefined; - } - else if (self.calendarContainer && self.calendarContainer.parentNode) { - if (self.config.static && self.calendarContainer.parentNode) { - var wrapper = self.calendarContainer.parentNode; - wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); - if (wrapper.parentNode) { - while (wrapper.firstChild) - wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); - wrapper.parentNode.removeChild(wrapper); - } - } - else - self.calendarContainer.parentNode.removeChild(self.calendarContainer); - } - if (self.altInput) { - self.input.type = "text"; - if (self.altInput.parentNode) - self.altInput.parentNode.removeChild(self.altInput); - delete self.altInput; - } - if (self.input) { - self.input.type = self.input._type; - self.input.classList.remove("flatpickr-input"); - self.input.removeAttribute("readonly"); - self.input.value = ""; - } - [ - "_showTimeInput", - "latestSelectedDateObj", - "_hideNextMonthArrow", - "_hidePrevMonthArrow", - "__hideNextMonthArrow", - "__hidePrevMonthArrow", - "isMobile", - "isOpen", - "selectedDateElem", - "minDateHasTime", - "maxDateHasTime", - "days", - "daysContainer", - "_input", - "_positionElement", - "innerContainer", - "rContainer", - "monthNav", - "todayDateElem", - "calendarContainer", - "weekdayContainer", - "prevMonthNav", - "nextMonthNav", - "monthsDropdownContainer", - "currentMonthElement", - "currentYearElement", - "navigationCurrentMonth", - "selectedDateElem", - "config", - ].forEach(function (k) { - try { - delete self[k]; - } - catch (_) { } - }); - } - function isCalendarElem(elem) { - if (self.config.appendTo && self.config.appendTo.contains(elem)) - return true; - return self.calendarContainer.contains(elem); - } - function documentClick(e) { - if (self.isOpen && !self.config.inline) { - var eventTarget_1 = getEventTarget(e); - var isCalendarElement = isCalendarElem(eventTarget_1); - var isInput = eventTarget_1 === self.input || - eventTarget_1 === self.altInput || - self.element.contains(eventTarget_1) || - // web components - // e.path is not present in all browsers. circumventing typechecks - (e.path && - e.path.indexOf && - (~e.path.indexOf(self.input) || - ~e.path.indexOf(self.altInput))); - var lostFocus = e.type === "blur" - ? isInput && - e.relatedTarget && - !isCalendarElem(e.relatedTarget) - : !isInput && - !isCalendarElement && - !isCalendarElem(e.relatedTarget); - var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { - return elem.contains(eventTarget_1); - }); - if (lostFocus && isIgnored) { - self.close(); - if (self.config.mode === "range" && self.selectedDates.length === 1) { - self.clear(false); - self.redraw(); - } - } - } - } - function changeYear(newYear) { - if (!newYear || - (self.config.minDate && newYear < self.config.minDate.getFullYear()) || - (self.config.maxDate && newYear > self.config.maxDate.getFullYear())) - return; - var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; - self.currentYear = newYearNum || self.currentYear; - if (self.config.maxDate && - self.currentYear === self.config.maxDate.getFullYear()) { - self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); - } - else if (self.config.minDate && - self.currentYear === self.config.minDate.getFullYear()) { - self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); - } - if (isNewYear) { - self.redraw(); - triggerEvent("onYearChange"); - buildMonthSwitch(); - } - } - function isEnabled(date, timeless) { - if (timeless === void 0) { timeless = true; } - var dateToCheck = self.parseDate(date, undefined, timeless); // timeless - if ((self.config.minDate && - dateToCheck && - compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) || - (self.config.maxDate && - dateToCheck && - compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0)) - return false; - if (self.config.enable.length === 0 && self.config.disable.length === 0) - return true; - if (dateToCheck === undefined) - return false; - var bool = self.config.enable.length > 0, array = bool ? self.config.enable : self.config.disable; - for (var i = 0, d = void 0; i < array.length; i++) { - d = array[i]; - if (typeof d === "function" && - d(dateToCheck) // disabled by function - ) - return bool; - else if (d instanceof Date && - dateToCheck !== undefined && - d.getTime() === dateToCheck.getTime()) - // disabled by date - return bool; - else if (typeof d === "string" && dateToCheck !== undefined) { - // disabled by date string - var parsed = self.parseDate(d, undefined, true); - return parsed && parsed.getTime() === dateToCheck.getTime() - ? bool - : !bool; - } - else if ( - // disabled by range - typeof d === "object" && - dateToCheck !== undefined && - d.from && - d.to && - dateToCheck.getTime() >= d.from.getTime() && - dateToCheck.getTime() <= d.to.getTime()) - return bool; - } - return !bool; - } - function isInView(elem) { - if (self.daysContainer !== undefined) - return (elem.className.indexOf("hidden") === -1 && - self.daysContainer.contains(elem)); - return false; - } - function onKeyDown(e) { - // e.key e.keyCode - // "Backspace" 8 - // "Tab" 9 - // "Enter" 13 - // "Escape" (IE "Esc") 27 - // "ArrowLeft" (IE "Left") 37 - // "ArrowUp" (IE "Up") 38 - // "ArrowRight" (IE "Right") 39 - // "ArrowDown" (IE "Down") 40 - // "Delete" (IE "Del") 46 - var isInput = e.target === self._input; - var allowInput = self.config.allowInput; - var allowKeydown = self.isOpen && (!allowInput || !isInput); - var allowInlineKeydown = self.config.inline && isInput && !allowInput; - if (e.keyCode === 13 && isInput) { - if (allowInput) { - self.setDate(self._input.value, true, e.target === self.altInput - ? self.config.altFormat - : self.config.dateFormat); - return e.target.blur(); - } - else { - self.open(); - } - } - else if (isCalendarElem(e.target) || - allowKeydown || - allowInlineKeydown) { - var isTimeObj = !!self.timeContainer && - self.timeContainer.contains(e.target); - switch (e.keyCode) { - case 13: - if (isTimeObj) { - e.preventDefault(); - updateTime(); - focusAndClose(); - } - else - selectDate(e); - break; - case 27: // escape - e.preventDefault(); - focusAndClose(); - break; - case 8: - case 46: - if (isInput && !self.config.allowInput) { - e.preventDefault(); - self.clear(); - } - break; - case 37: - case 39: - if (!isTimeObj && !isInput) { - e.preventDefault(); - if (self.daysContainer !== undefined && - (allowInput === false || - (document.activeElement && isInView(document.activeElement)))) { - var delta_1 = e.keyCode === 39 ? 1 : -1; - if (!e.ctrlKey) - focusOnDay(undefined, delta_1); - else { - e.stopPropagation(); - changeMonth(delta_1); - focusOnDay(getFirstAvailableDay(1), 0); - } - } - } - else if (self.hourElement) - self.hourElement.focus(); - break; - case 38: - case 40: - e.preventDefault(); - var delta = e.keyCode === 40 ? 1 : -1; - if ((self.daysContainer && e.target.$i !== undefined) || - e.target === self.input) { - if (e.ctrlKey) { - e.stopPropagation(); - changeYear(self.currentYear - delta); - focusOnDay(getFirstAvailableDay(1), 0); - } - else if (!isTimeObj) - focusOnDay(undefined, delta * 7); - } - else if (e.target === self.currentYearElement) { - changeYear(self.currentYear - delta); - } - else if (self.config.enableTime) { - if (!isTimeObj && self.hourElement) - self.hourElement.focus(); - updateTime(e); - self._debouncedChange(); - } - break; - case 9: - if (isTimeObj) { - var elems = [ - self.hourElement, - self.minuteElement, - self.secondElement, - self.amPM, - ] - .concat(self.pluginElements) - .filter(function (x) { return x; }); - var i = elems.indexOf(e.target); - if (i !== -1) { - var target = elems[i + (e.shiftKey ? -1 : 1)]; - e.preventDefault(); - (target || self._input).focus(); - } - } - else if (!self.config.noCalendar && - self.daysContainer && - self.daysContainer.contains(e.target) && - e.shiftKey) { - e.preventDefault(); - self._input.focus(); - } - break; - default: - break; - } - } - if (self.amPM !== undefined && e.target === self.amPM) { - switch (e.key) { - case self.l10n.amPM[0].charAt(0): - case self.l10n.amPM[0].charAt(0).toLowerCase(): - self.amPM.textContent = self.l10n.amPM[0]; - setHoursFromInputs(); - updateValue(); - break; - case self.l10n.amPM[1].charAt(0): - case self.l10n.amPM[1].charAt(0).toLowerCase(): - self.amPM.textContent = self.l10n.amPM[1]; - setHoursFromInputs(); - updateValue(); - break; - } - } - if (isInput || isCalendarElem(e.target)) { - triggerEvent("onKeyDown", e); - } - } - function onMouseOver(elem) { - if (self.selectedDates.length !== 1 || - (elem && - (!elem.classList.contains("flatpickr-day") || - elem.classList.contains("flatpickr-disabled")))) - return; - var hoverDate = elem - ? elem.dateObj.getTime() - : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()); - var containsDisabled = false; - var minRange = 0, maxRange = 0; - for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) { - if (!isEnabled(new Date(t), true)) { - containsDisabled = - containsDisabled || (t > rangeStartDate && t < rangeEndDate); - if (t < initialDate && (!minRange || t > minRange)) - minRange = t; - else if (t > initialDate && (!maxRange || t < maxRange)) - maxRange = t; - } - } - for (var m = 0; m < self.config.showMonths; m++) { - var month = self.daysContainer.children[m]; - var _loop_1 = function (i, l) { - var dayElem = month.children[i], date = dayElem.dateObj; - var timestamp = date.getTime(); - var outOfRange = (minRange > 0 && timestamp < minRange) || - (maxRange > 0 && timestamp > maxRange); - if (outOfRange) { - dayElem.classList.add("notAllowed"); - ["inRange", "startRange", "endRange"].forEach(function (c) { - dayElem.classList.remove(c); - }); - return "continue"; - } - else if (containsDisabled && !outOfRange) - return "continue"; - ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { - dayElem.classList.remove(c); - }); - if (elem !== undefined) { - elem.classList.add(hoverDate <= self.selectedDates[0].getTime() - ? "startRange" - : "endRange"); - if (initialDate < hoverDate && timestamp === initialDate) - dayElem.classList.add("startRange"); - else if (initialDate > hoverDate && timestamp === initialDate) - dayElem.classList.add("endRange"); - if (timestamp >= minRange && - (maxRange === 0 || timestamp <= maxRange) && - isBetween(timestamp, initialDate, hoverDate)) - dayElem.classList.add("inRange"); - } - }; - for (var i = 0, l = month.children.length; i < l; i++) { - _loop_1(i, l); - } - } - } - function onResize() { - if (self.isOpen && !self.config.static && !self.config.inline) - positionCalendar(); - } - function setDefaultTime() { - self.setDate(self.config.minDate !== undefined - ? new Date(self.config.minDate.getTime()) - : new Date(), true); - setDefaultHours(); - updateValue(); - } - function open(e, positionElement) { - if (positionElement === void 0) { positionElement = self._positionElement; } - if (self.isMobile === true) { - if (e) { - e.preventDefault(); - e.target && e.target.blur(); - } - if (self.mobileInput !== undefined) { - self.mobileInput.focus(); - self.mobileInput.click(); - } - triggerEvent("onOpen"); - return; - } - if (self._input.disabled || self.config.inline) - return; - var wasOpen = self.isOpen; - self.isOpen = true; - if (!wasOpen) { - self.calendarContainer.classList.add("open"); - self._input.classList.add("active"); - triggerEvent("onOpen"); - positionCalendar(positionElement); - } - if (self.config.enableTime === true && self.config.noCalendar === true) { - if (self.selectedDates.length === 0) { - setDefaultTime(); - } - if (self.config.allowInput === false && - (e === undefined || - !self.timeContainer.contains(e.relatedTarget))) { - setTimeout(function () { return self.hourElement.select(); }, 50); - } - } - } - function minMaxDateSetter(type) { - return function (date) { - var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat)); - var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; - if (dateObj !== undefined) { - self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = - dateObj.getHours() > 0 || - dateObj.getMinutes() > 0 || - dateObj.getSeconds() > 0; - } - if (self.selectedDates) { - self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); }); - if (!self.selectedDates.length && type === "min") - setHoursFromDate(dateObj); - updateValue(); - } - if (self.daysContainer) { - redraw(); - if (dateObj !== undefined) - self.currentYearElement[type] = dateObj.getFullYear().toString(); - else - self.currentYearElement.removeAttribute(type); - self.currentYearElement.disabled = - !!inverseDateObj && - dateObj !== undefined && - inverseDateObj.getFullYear() === dateObj.getFullYear(); - } - }; - } - function parseConfig() { - var boolOpts = [ - "wrap", - "weekNumbers", - "allowInput", - "clickOpens", - "time_24hr", - "enableTime", - "noCalendar", - "altInput", - "shorthandCurrentMonth", - "inline", - "static", - "enableSeconds", - "disableMobile", - ]; - var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {}))); - var formats = {}; - self.config.parseDate = userConfig.parseDate; - self.config.formatDate = userConfig.formatDate; - Object.defineProperty(self.config, "enable", { - get: function () { return self.config._enable; }, - set: function (dates) { - self.config._enable = parseDateRules(dates); - } - }); - Object.defineProperty(self.config, "disable", { - get: function () { return self.config._disable; }, - set: function (dates) { - self.config._disable = parseDateRules(dates); - } - }); - var timeMode = userConfig.mode === "time"; - if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { - var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat; - formats.dateFormat = - userConfig.noCalendar || timeMode - ? "H:i" + (userConfig.enableSeconds ? ":S" : "") - : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); - } - if (userConfig.altInput && - (userConfig.enableTime || timeMode) && - !userConfig.altFormat) { - var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat; - formats.altFormat = - userConfig.noCalendar || timeMode - ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") - : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); - } - if (!userConfig.altInputClass) { - self.config.altInputClass = - self.input.className + " " + self.config.altInputClass; - } - Object.defineProperty(self.config, "minDate", { - get: function () { return self.config._minDate; }, - set: minMaxDateSetter("min") - }); - Object.defineProperty(self.config, "maxDate", { - get: function () { return self.config._maxDate; }, - set: minMaxDateSetter("max") - }); - var minMaxTimeSetter = function (type) { return function (val) { - self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i"); - }; }; - Object.defineProperty(self.config, "minTime", { - get: function () { return self.config._minTime; }, - set: minMaxTimeSetter("min") - }); - Object.defineProperty(self.config, "maxTime", { - get: function () { return self.config._maxTime; }, - set: minMaxTimeSetter("max") - }); - if (userConfig.mode === "time") { - self.config.noCalendar = true; - self.config.enableTime = true; - } - Object.assign(self.config, formats, userConfig); - for (var i = 0; i < boolOpts.length; i++) - self.config[boolOpts[i]] = - self.config[boolOpts[i]] === true || - self.config[boolOpts[i]] === "true"; - HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) { - self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); - }); - self.isMobile = - !self.config.disableMobile && - !self.config.inline && - self.config.mode === "single" && - !self.config.disable.length && - !self.config.enable.length && - !self.config.weekNumbers && - /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); - for (var i = 0; i < self.config.plugins.length; i++) { - var pluginConf = self.config.plugins[i](self) || {}; - for (var key in pluginConf) { - if (HOOKS.indexOf(key) > -1) { - self.config[key] = arrayify(pluginConf[key]) - .map(bindToInstance) - .concat(self.config[key]); - } - else if (typeof userConfig[key] === "undefined") - self.config[key] = pluginConf[key]; - } - } - triggerEvent("onParseConfig"); - } - function setupLocale() { - if (typeof self.config.locale !== "object" && - typeof flatpickr.l10ns[self.config.locale] === "undefined") - self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); - self.l10n = __assign({}, flatpickr.l10ns["default"], (typeof self.config.locale === "object" - ? self.config.locale - : self.config.locale !== "default" - ? flatpickr.l10ns[self.config.locale] - : undefined)); - tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; - var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {}))); - if (userConfig.time_24hr === undefined && - flatpickr.defaultConfig.time_24hr === undefined) { - self.config.time_24hr = self.l10n.time_24hr; - } - self.formatDate = createDateFormatter(self); - self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); - } - function positionCalendar(customPositionElement) { - if (self.calendarContainer === undefined) - return; - triggerEvent("onPreCalendarPosition"); - var positionElement = customPositionElement || self._positionElement; - var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" || - (configPosVertical !== "below" && - distanceFromBottom < calendarHeight && - inputBounds.top > calendarHeight); - var top = window.pageYOffset + - inputBounds.top + - (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); - toggleClass(self.calendarContainer, "arrowTop", !showOnTop); - toggleClass(self.calendarContainer, "arrowBottom", showOnTop); - if (self.config.inline) - return; - var left = window.pageXOffset + - inputBounds.left - - (configPosHorizontal != null && configPosHorizontal === "center" - ? (calendarWidth - inputBounds.width) / 2 - : 0); - var right = window.document.body.offsetWidth - inputBounds.right; - var rightMost = left + calendarWidth > window.document.body.offsetWidth; - var centerMost = right + calendarWidth > window.document.body.offsetWidth; - toggleClass(self.calendarContainer, "rightMost", rightMost); - if (self.config.static) - return; - self.calendarContainer.style.top = top + "px"; - if (!rightMost) { - self.calendarContainer.style.left = left + "px"; - self.calendarContainer.style.right = "auto"; - } - else if (!centerMost) { - self.calendarContainer.style.left = "auto"; - self.calendarContainer.style.right = right + "px"; - } - else { - var doc = document.styleSheets[0]; - // some testing environments don't have css support - if (doc === undefined) - return; - var bodyWidth = window.document.body.offsetWidth; - var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2); - var centerBefore = ".flatpickr-calendar.centerMost:before"; - var centerAfter = ".flatpickr-calendar.centerMost:after"; - var centerIndex = doc.cssRules.length; - var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; - toggleClass(self.calendarContainer, "rightMost", false); - toggleClass(self.calendarContainer, "centerMost", true); - doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex); - self.calendarContainer.style.left = centerLeft + "px"; - self.calendarContainer.style.right = "auto"; - } - } - function redraw() { - if (self.config.noCalendar || self.isMobile) - return; - updateNavigationCurrentMonth(); - buildDays(); - } - function focusAndClose() { - self._input.focus(); - if (window.navigator.userAgent.indexOf("MSIE") !== -1 || - navigator.msMaxTouchPoints !== undefined) { - // hack - bugs in the way IE handles focus keeps the calendar open - setTimeout(self.close, 0); - } - else { - self.close(); - } - } - function selectDate(e) { - e.preventDefault(); - e.stopPropagation(); - var isSelectable = function (day) { - return day.classList && - day.classList.contains("flatpickr-day") && - !day.classList.contains("flatpickr-disabled") && - !day.classList.contains("notAllowed"); - }; - var t = findParent(e.target, isSelectable); - if (t === undefined) - return; - var target = t; - var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime())); - var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || - selectedDate.getMonth() > - self.currentMonth + self.config.showMonths - 1) && - self.config.mode !== "range"; - self.selectedDateElem = target; - if (self.config.mode === "single") - self.selectedDates = [selectedDate]; - else if (self.config.mode === "multiple") { - var selectedIndex = isDateSelected(selectedDate); - if (selectedIndex) - self.selectedDates.splice(parseInt(selectedIndex), 1); - else - self.selectedDates.push(selectedDate); - } - else if (self.config.mode === "range") { - if (self.selectedDates.length === 2) { - self.clear(false, false); - } - self.latestSelectedDateObj = selectedDate; - self.selectedDates.push(selectedDate); - // unless selecting same date twice, sort ascendingly - if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) - self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); - } - setHoursFromInputs(); - if (shouldChangeMonth) { - var isNewYear = self.currentYear !== selectedDate.getFullYear(); - self.currentYear = selectedDate.getFullYear(); - self.currentMonth = selectedDate.getMonth(); - if (isNewYear) { - triggerEvent("onYearChange"); - buildMonthSwitch(); - } - triggerEvent("onMonthChange"); - } - updateNavigationCurrentMonth(); - buildDays(); - updateValue(); - if (self.config.enableTime) - setTimeout(function () { return (self.showTimeInput = true); }, 50); - // maintain focus - if (!shouldChangeMonth && - self.config.mode !== "range" && - self.config.showMonths === 1) - focusOnDayElem(target); - else if (self.selectedDateElem !== undefined && - self.hourElement === undefined) { - self.selectedDateElem && self.selectedDateElem.focus(); - } - if (self.hourElement !== undefined) - self.hourElement !== undefined && self.hourElement.focus(); - if (self.config.closeOnSelect) { - var single = self.config.mode === "single" && !self.config.enableTime; - var range = self.config.mode === "range" && - self.selectedDates.length === 2 && - !self.config.enableTime; - if (single || range) { - focusAndClose(); - } - } - triggerChange(); - } - var CALLBACKS = { - locale: [setupLocale, updateWeekdays], - showMonths: [buildMonths, setCalendarWidth, buildWeekdays], - minDate: [jumpToDate], - maxDate: [jumpToDate] - }; - function set(option, value) { - if (option !== null && typeof option === "object") { - Object.assign(self.config, option); - for (var key in option) { - if (CALLBACKS[key] !== undefined) - CALLBACKS[key].forEach(function (x) { return x(); }); - } - } - else { - self.config[option] = value; - if (CALLBACKS[option] !== undefined) - CALLBACKS[option].forEach(function (x) { return x(); }); - else if (HOOKS.indexOf(option) > -1) - self.config[option] = arrayify(value); - } - self.redraw(); - updateValue(false); - } - function setSelectedDate(inputDate, format) { - var dates = []; - if (inputDate instanceof Array) - dates = inputDate.map(function (d) { return self.parseDate(d, format); }); - else if (inputDate instanceof Date || typeof inputDate === "number") - dates = [self.parseDate(inputDate, format)]; - else if (typeof inputDate === "string") { - switch (self.config.mode) { - case "single": - case "time": - dates = [self.parseDate(inputDate, format)]; - break; - case "multiple": - dates = inputDate - .split(self.config.conjunction) - .map(function (date) { return self.parseDate(date, format); }); - break; - case "range": - dates = inputDate - .split(self.l10n.rangeSeparator) - .map(function (date) { return self.parseDate(date, format); }); - break; - default: - break; - } - } - else - self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); - self.selectedDates = dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }); - if (self.config.mode === "range") - self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); - } - function setDate(date, triggerChange, format) { - if (triggerChange === void 0) { triggerChange = false; } - if (format === void 0) { format = self.config.dateFormat; } - if ((date !== 0 && !date) || (date instanceof Array && date.length === 0)) - return self.clear(triggerChange); - setSelectedDate(date, format); - self.showTimeInput = self.selectedDates.length > 0; - self.latestSelectedDateObj = - self.selectedDates[self.selectedDates.length - 1]; - self.redraw(); - jumpToDate(); - setHoursFromDate(); - if (self.selectedDates.length === 0) { - self.clear(false); - } - updateValue(triggerChange); - if (triggerChange) - triggerEvent("onChange"); - } - function parseDateRules(arr) { - return arr - .slice() - .map(function (rule) { - if (typeof rule === "string" || - typeof rule === "number" || - rule instanceof Date) { - return self.parseDate(rule, undefined, true); - } - else if (rule && - typeof rule === "object" && - rule.from && - rule.to) - return { - from: self.parseDate(rule.from, undefined), - to: self.parseDate(rule.to, undefined) - }; - return rule; - }) - .filter(function (x) { return x; }); // remove falsy values - } - function setupDates() { - self.selectedDates = []; - self.now = self.parseDate(self.config.now) || new Date(); - // Workaround IE11 setting placeholder as the input's value - var preloadedDate = self.config.defaultDate || - ((self.input.nodeName === "INPUT" || - self.input.nodeName === "TEXTAREA") && - self.input.placeholder && - self.input.value === self.input.placeholder - ? null - : self.input.value); - if (preloadedDate) - setSelectedDate(preloadedDate, self.config.dateFormat); - self._initialDate = - self.selectedDates.length > 0 - ? self.selectedDates[0] - : self.config.minDate && - self.config.minDate.getTime() > self.now.getTime() - ? self.config.minDate - : self.config.maxDate && - self.config.maxDate.getTime() < self.now.getTime() - ? self.config.maxDate - : self.now; - self.currentYear = self._initialDate.getFullYear(); - self.currentMonth = self._initialDate.getMonth(); - if (self.selectedDates.length > 0) - self.latestSelectedDateObj = self.selectedDates[0]; - if (self.config.minTime !== undefined) - self.config.minTime = self.parseDate(self.config.minTime, "H:i"); - if (self.config.maxTime !== undefined) - self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); - self.minDateHasTime = - !!self.config.minDate && - (self.config.minDate.getHours() > 0 || - self.config.minDate.getMinutes() > 0 || - self.config.minDate.getSeconds() > 0); - self.maxDateHasTime = - !!self.config.maxDate && - (self.config.maxDate.getHours() > 0 || - self.config.maxDate.getMinutes() > 0 || - self.config.maxDate.getSeconds() > 0); - Object.defineProperty(self, "showTimeInput", { - get: function () { return self._showTimeInput; }, - set: function (bool) { - self._showTimeInput = bool; - if (self.calendarContainer) - toggleClass(self.calendarContainer, "showTimeInput", bool); - self.isOpen && positionCalendar(); - } - }); - } - function setupInputs() { - self.input = self.config.wrap - ? element.querySelector("[data-input]") - : element; - /* istanbul ignore next */ - if (!self.input) { - self.config.errorHandler(new Error("Invalid input element specified")); - return; - } - // hack: store previous type to restore it after destroy() - self.input._type = self.input.type; - self.input.type = "text"; - self.input.classList.add("flatpickr-input"); - self._input = self.input; - if (self.config.altInput) { - // replicate self.element - self.altInput = createElement(self.input.nodeName, self.config.altInputClass); - self._input = self.altInput; - self.altInput.placeholder = self.input.placeholder; - self.altInput.disabled = self.input.disabled; - self.altInput.required = self.input.required; - self.altInput.tabIndex = self.input.tabIndex; - self.altInput.type = "text"; - self.input.setAttribute("type", "hidden"); - if (!self.config.static && self.input.parentNode) - self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); - } - if (!self.config.allowInput) - self._input.setAttribute("readonly", "readonly"); - self._positionElement = self.config.positionElement || self._input; - } - function setupMobile() { - var inputType = self.config.enableTime - ? self.config.noCalendar - ? "time" - : "datetime-local" - : "date"; - self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"); - self.mobileInput.step = self.input.getAttribute("step") || "any"; - self.mobileInput.tabIndex = 1; - self.mobileInput.type = inputType; - self.mobileInput.disabled = self.input.disabled; - self.mobileInput.required = self.input.required; - self.mobileInput.placeholder = self.input.placeholder; - self.mobileFormatStr = - inputType === "datetime-local" - ? "Y-m-d\\TH:i:S" - : inputType === "date" - ? "Y-m-d" - : "H:i:S"; - if (self.selectedDates.length > 0) { - self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); - } - if (self.config.minDate) - self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); - if (self.config.maxDate) - self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); - self.input.type = "hidden"; - if (self.altInput !== undefined) - self.altInput.type = "hidden"; - try { - if (self.input.parentNode) - self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); - } - catch (_a) { } - bind(self.mobileInput, "change", function (e) { - self.setDate(e.target.value, false, self.mobileFormatStr); - triggerEvent("onChange"); - triggerEvent("onClose"); - }); - } - function toggle(e) { - if (self.isOpen === true) - return self.close(); - self.open(e); - } - function triggerEvent(event, data) { - // If the instance has been destroyed already, all hooks have been removed - if (self.config === undefined) - return; - var hooks = self.config[event]; - if (hooks !== undefined && hooks.length > 0) { - for (var i = 0; hooks[i] && i < hooks.length; i++) - hooks[i](self.selectedDates, self.input.value, self, data); - } - if (event === "onChange") { - self.input.dispatchEvent(createEvent("change")); - // many front-end frameworks bind to the input event - self.input.dispatchEvent(createEvent("input")); - } - } - function createEvent(name) { - var e = document.createEvent("Event"); - e.initEvent(name, true, true); - return e; - } - function isDateSelected(date) { - for (var i = 0; i < self.selectedDates.length; i++) { - if (compareDates(self.selectedDates[i], date) === 0) - return "" + i; - } - return false; - } - function isDateInRange(date) { - if (self.config.mode !== "range" || self.selectedDates.length < 2) - return false; - return (compareDates(date, self.selectedDates[0]) >= 0 && - compareDates(date, self.selectedDates[1]) <= 0); - } - function updateNavigationCurrentMonth() { - if (self.config.noCalendar || self.isMobile || !self.monthNav) - return; - self.yearElements.forEach(function (yearElement, i) { - var d = new Date(self.currentYear, self.currentMonth, 1); - d.setMonth(self.currentMonth + i); - if (self.config.showMonths > 1 || - self.config.monthSelectorType === "static") { - self.monthElements[i].textContent = - monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; - } - else { - self.monthsDropdownContainer.value = d.getMonth().toString(); - } - yearElement.value = d.getFullYear().toString(); - }); - self._hidePrevMonthArrow = - self.config.minDate !== undefined && - (self.currentYear === self.config.minDate.getFullYear() - ? self.currentMonth <= self.config.minDate.getMonth() - : self.currentYear < self.config.minDate.getFullYear()); - self._hideNextMonthArrow = - self.config.maxDate !== undefined && - (self.currentYear === self.config.maxDate.getFullYear() - ? self.currentMonth + 1 > self.config.maxDate.getMonth() - : self.currentYear > self.config.maxDate.getFullYear()); - } - function getDateStr(format) { - return self.selectedDates - .map(function (dObj) { return self.formatDate(dObj, format); }) - .filter(function (d, i, arr) { - return self.config.mode !== "range" || - self.config.enableTime || - arr.indexOf(d) === i; - }) - .join(self.config.mode !== "range" - ? self.config.conjunction - : self.l10n.rangeSeparator); - } - /** - * Updates the values of inputs associated with the calendar - */ - function updateValue(triggerChange) { - if (triggerChange === void 0) { triggerChange = true; } - if (self.mobileInput !== undefined && self.mobileFormatStr) { - self.mobileInput.value = - self.latestSelectedDateObj !== undefined - ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) - : ""; - } - self.input.value = getDateStr(self.config.dateFormat); - if (self.altInput !== undefined) { - self.altInput.value = getDateStr(self.config.altFormat); - } - if (triggerChange !== false) - triggerEvent("onValueUpdate"); - } - function onMonthNavClick(e) { - var isPrevMonth = self.prevMonthNav.contains(e.target); - var isNextMonth = self.nextMonthNav.contains(e.target); - if (isPrevMonth || isNextMonth) { - changeMonth(isPrevMonth ? -1 : 1); - } - else if (self.yearElements.indexOf(e.target) >= 0) { - e.target.select(); - } - else if (e.target.classList.contains("arrowUp")) { - self.changeYear(self.currentYear + 1); - } - else if (e.target.classList.contains("arrowDown")) { - self.changeYear(self.currentYear - 1); - } - } - function timeWrapper(e) { - e.preventDefault(); - var isKeyDown = e.type === "keydown", input = e.target; - if (self.amPM !== undefined && e.target === self.amPM) { - self.amPM.textContent = - self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; - } - var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || - (isKeyDown ? (e.which === 38 ? 1 : -1) : 0); - var newValue = curValue + step * delta; - if (typeof input.value !== "undefined" && input.value.length === 2) { - var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; - if (newValue < min) { - newValue = - max + - newValue + - int(!isHourElem) + - (int(isHourElem) && int(!self.amPM)); - if (isMinuteElem) - incrementNumInput(undefined, -1, self.hourElement); - } - else if (newValue > max) { - newValue = - input === self.hourElement ? newValue - max - int(!self.amPM) : min; - if (isMinuteElem) - incrementNumInput(undefined, 1, self.hourElement); - } - if (self.amPM && - isHourElem && - (step === 1 - ? newValue + curValue === 23 - : Math.abs(newValue - curValue) > step)) { - self.amPM.textContent = - self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]; - } - input.value = pad(newValue); - } - } - init(); - return self; - } - /* istanbul ignore next */ - function _flatpickr(nodeList, config) { - // static list - var nodes = Array.prototype.slice - .call(nodeList) - .filter(function (x) { return x instanceof HTMLElement; }); - var instances = []; - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - try { - if (node.getAttribute("data-fp-omit") !== null) - continue; - if (node._flatpickr !== undefined) { - node._flatpickr.destroy(); - node._flatpickr = undefined; - } - node._flatpickr = FlatpickrInstance(node, config || {}); - instances.push(node._flatpickr); - } - catch (e) { - console.error(e); - } - } - return instances.length === 1 ? instances[0] : instances; - } - /* istanbul ignore next */ - if (typeof HTMLElement !== "undefined" && - typeof HTMLCollection !== "undefined" && - typeof NodeList !== "undefined") { - // browser env - HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { - return _flatpickr(this, config); - }; - HTMLElement.prototype.flatpickr = function (config) { - return _flatpickr([this], config); - }; - } - /* istanbul ignore next */ - var flatpickr = function (selector, config) { - if (typeof selector === "string") { - return _flatpickr(window.document.querySelectorAll(selector), config); - } - else if (selector instanceof Node) { - return _flatpickr([selector], config); - } - else { - return _flatpickr(selector, config); - } - }; - /* istanbul ignore next */ - flatpickr.defaultConfig = {}; - flatpickr.l10ns = { - en: __assign({}, english), - "default": __assign({}, english) - }; - flatpickr.localize = function (l10n) { - flatpickr.l10ns["default"] = __assign({}, flatpickr.l10ns["default"], l10n); - }; - flatpickr.setDefaults = function (config) { - flatpickr.defaultConfig = __assign({}, flatpickr.defaultConfig, config); - }; - flatpickr.parseDate = createDateParser({}); - flatpickr.formatDate = createDateFormatter({}); - flatpickr.compareDates = compareDates; - /* istanbul ignore next */ - if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") { - jQuery.fn.flatpickr = function (config) { - return _flatpickr(this, config); - }; - } - // eslint-disable-next-line @typescript-eslint/camelcase - Date.prototype.fp_incr = function (days) { - return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); - }; - if (typeof window !== "undefined") { - window.flatpickr = flatpickr; - } - - return flatpickr; - -})); diff --git a/app/static/vendors/flatpickr/flatpickr.min.css b/app/static/vendors/flatpickr/flatpickr.min.css deleted file mode 100644 index 46c57b7..0000000 --- a/app/static/vendors/flatpickr/flatpickr.min.css +++ /dev/null @@ -1,13 +0,0 @@ -.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px);}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.rightMost:after{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{/* - /*rtl:begin:ignore*/left:0;/* - /*rtl:end:ignore*/}/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{/* - /*rtl:begin:ignore*/right:0;/* - /*rtl:end:ignore*/}/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9;}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px;}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto;}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%;}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box;}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0;}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%;}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto;}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05);}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0;}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block;}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto;}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px;}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;}.dayContainer + .dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9;}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left;}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left;}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}} \ No newline at end of file diff --git a/app/static/vendors/flatpickr/flatpickr.min.js b/app/static/vendors/flatpickr/flatpickr.min.js deleted file mode 100644 index 9418133..0000000 --- a/app/static/vendors/flatpickr/flatpickr.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* flatpickr v4.6.2,, @license MIT */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).flatpickr=t()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},a={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function r(e,t,n){var a;return void 0===n&&(n=!1),function(){var i=this,o=arguments;null!==a&&clearTimeout(a),a=window.setTimeout(function(){a=null,n||e.apply(i,o)},t),n&&!a&&e.apply(i,o)}}var l=function(e){return e instanceof Array?e:[e]};function c(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function d(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e,t){var n=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}var f=function(){},m=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={D:f,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:f,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:f,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},p={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},h={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[h.w(e,t,n)]},F:function(e,t,n){return m(h.n(e,t,n)-1,!1,t)},G:function(e,t,n){return i(h.h(e,t,n))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return m(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,n){var a=n||r;return void 0!==i.formatDate?i.formatDate(e,t,a):t.split("").map(function(t,n,o){return h[t]&&"\\"!==o[n-1]?h[t](e,a,i):"\\"!==t?t:""}).join("")}},D=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,d=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var s=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else if(i&&i.parseDate)l=i.parseDate(e,s);else{l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var f=void 0,m=[],h=0,v=0,D="";hMath.min(t,n)&&er&&(s=n===h.hourElement?s-r-o(!h.amPM):a,f&&j(void 0,1,h.hourElement)),h.amPM&&u&&(1===l?s+c===23:Math.abs(s-c)>l)&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]),n.value=i(s)}}(e);var t=h._input.value;k(),we(),h._input.value!==t&&h._debouncedChange()}function k(){if(void 0!==h.hourElement&&void 0!==h.minuteElement){var e,t,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(h.minuteElement.value,10)||0)%60,i=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(e=n,t=h.amPM.textContent,n=e%12+12*o(t===h.l10n.amPM[1]));var r=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.minDate,!0);if(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.maxDate,!0)){var l=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate;(n=Math.min(n,l.getHours()))===l.getHours()&&(a=Math.min(a,l.getMinutes())),a===l.getMinutes()&&(i=Math.min(i,l.getSeconds()))}if(r){var c=void 0!==h.config.minTime?h.config.minTime:h.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}O(n,a,i)}}function I(e){var t=e||h.latestSelectedDateObj;t&&O(t.getHours(),t.getMinutes(),t.getSeconds())}function S(){var e=h.config.defaultHour,t=h.config.defaultMinute,n=h.config.defaultSeconds;if(void 0!==h.config.minDate){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=h.config.minDate.getSeconds())}if(void 0!==h.config.maxDate){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=h.config.maxDate.getSeconds())}O(e,t,n)}function O(e,t,n){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(e%24,t,n||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(e>=12)]),void 0!==h.secondElement&&(h.secondElement.value=i(n)))}function _(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&Q(t)}function F(e,t,n,a){return t instanceof Array?t.forEach(function(t){return F(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,a)}):(e.addEventListener(t,n,a),void h._handlers.push({element:e,event:t,handler:n,options:a}))}function N(e){return function(t){1===t.which&&e(t)}}function Y(){ge("onChange")}function A(e,t){var n=void 0!==e?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate=0&&w(e,h.selectedDates[1])<=0}(t)&&!he(t)&&o.classList.add("inRange"),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend",""+h.config.getWeek(t)+""),ge("onDayCreate",o),o}function L(e){e.focus(),"range"===h.config.mode&&ne(e)}function W(e){for(var t=e>0?0:h.config.showMonths-1,n=e>0?h.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=h.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&X(c.dateObj))return c}}function R(e,t){var n=ee(document.activeElement||document.body),a=void 0!==e?e:n?document.activeElement:void 0!==h.selectedDateElem&&ee(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&ee(h.todayDateElem)?h.todayDateElem:W(t>0?1:-1);return void 0===a?h._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=t>0?h.config.showMonths:-1,i=t>0?1:-1,o=n-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],l=n-h.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,c=r.children.length,d=l;d>=0&&d0?c:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&X(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return L(s)}h.changeMonth(i),R(W(i),0)}(a,t):L(a)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((t-1+12)%12),i=h.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=h.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(H(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(H("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===h.config.showMonths||u%7!=0);f++,u++)o.appendChild(H(c,new Date(e,t+1,f%i),f,u));var m=d("div","dayContainer");return m.appendChild(o),m}function J(){if(void 0!==h.daysContainer){s(h.daysContainer),h.weekNumbers&&s(h.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==h.config.monthSelectorType)){var e=function(e){return!(void 0!==h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&eh.config.maxDate.getMonth())};h.monthsDropdownContainer.tabIndex=-1,h.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=d("option","flatpickr-monthDropdown-month");n.value=new Date(h.currentYear,t).getMonth().toString(),n.textContent=m(t,h.config.shorthandCurrentMonth,h.l10n),n.tabIndex=-1,h.currentMonth===t&&(n.selected=!0),h.monthsDropdownContainer.appendChild(n)}}}function U(){var e,t=d("div","flatpickr-month"),n=window.document.createDocumentFragment();h.config.showMonths>1||"static"===h.config.monthSelectorType?e=d("span","cur-month"):(h.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),F(h.monthsDropdownContainer,"change",function(e){var t=e.target,n=parseInt(t.value,10);h.changeMonth(n-h.currentMonth),ge("onMonthChange")}),K(),e=h.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),n.appendChild(o),t.appendChild(n),{container:t,yearElement:i,monthElement:e}}function q(){s(h.monthNav),h.monthNav.appendChild(h.prevMonthNav),h.config.showMonths&&(h.yearElements=[],h.monthElements=[]);for(var e=h.config.showMonths;e--;){var t=U();h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container)}h.monthNav.appendChild(h.nextMonthNav)}function $(){h.weekdayContainer?s(h.weekdayContainer):h.weekdayContainer=d("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var t=d("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(t)}return z(),h.weekdayContainer}function z(){var e=h.l10n.firstDayOfWeek,t=h.l10n.weekdays.shorthand.slice();e>0&&e\n "+t.join("")+"\n \n "}function G(e,t){void 0===t&&(t=!0);var n=t?e:e-h.currentMonth;n<0&&!0===h._hidePrevMonthArrow||n>0&&!0===h._hideNextMonthArrow||(h.currentMonth+=n,(h.currentMonth<0||h.currentMonth>11)&&(h.currentYear+=h.currentMonth>11?1:-1,h.currentMonth=(h.currentMonth+12)%12,ge("onYearChange"),K()),J(),ge("onMonthChange"),ve())}function V(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function Z(e){if(h.isOpen&&!h.config.inline){var t="function"==typeof(r=e).composedPath?r.composedPath()[0]:r.target,n=V(t),a=t===h.input||t===h.altInput||h.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(h.input)||~e.path.indexOf(h.altInput)),i="blur"===e.type?a&&e.relatedTarget&&!V(e.relatedTarget):!a&&!n&&!V(e.relatedTarget),o=!h.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&o&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}var r}function Q(e){if(!(!e||h.config.minDate&&eh.config.maxDate.getFullYear())){var t=e,n=h.currentYear!==t;h.currentYear=t||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),n&&(h.redraw(),ge("onYearChange"),K())}}function X(e,t){void 0===t&&(t=!0);var n=h.parseDate(e,void 0,t);if(h.config.minDate&&n&&w(n,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&n&&w(n,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime)>0)return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===n)return!1;for(var a=h.config.enable.length>0,i=a?h.config.enable:h.config.disable,o=0,r=void 0;o=r.from.getTime()&&n.getTime()<=r.to.getTime())return a}return!a}function ee(e){return void 0!==h.daysContainer&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function te(e){var t=e.target===h._input,n=h.config.allowInput,a=h.isOpen&&(!n||!t),i=h.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(V(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?(e.preventDefault(),T(),de()):se(e);break;case 27:e.preventDefault(),de();break;case 8:case 46:t&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o||t)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),void 0!==h.daysContainer&&(!1===n||document.activeElement&&ee(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),G(r),R(W(1),0)):R(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;h.daysContainer&&void 0!==e.target.$i||e.target===h.input?e.ctrlKey?(e.stopPropagation(),Q(h.currentYear-l),R(W(1),0)):o||R(void 0,7*l):e.target===h.currentYearElement?Q(h.currentYear-l):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),T(e),h._debouncedChange());break;case 9:if(o){var c=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].concat(h.pluginElements).filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var s=c[d+(e.shiftKey?-1:1)];e.preventDefault(),(s||h._input).focus()}}else!h.config.noCalendar&&h.daysContainer&&h.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),h._input.focus())}}if(void 0!==h.amPM&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],k(),we();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],k(),we()}(t||V(e.target))&&ge("onKeyDown",e)}function ne(e){if(1===h.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),n=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,h.selectedDates[0].getTime()),i=Math.max(t,h.selectedDates[0].getTime()),o=!1,r=0,l=0,c=a;ca&&cr)?r=c:c>n&&(!l||c0&&d0&&d>l;return u?(c.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){c.classList.remove(e)}),"continue"):o&&!u?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){c.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t<=h.selectedDates[0].getTime()?"startRange":"endRange"),nt&&d===n&&c.classList.add("endRange"),d>=r&&(0===l||d<=l)&&b(d,n,t)&&c.classList.add("inRange"))))},f=0,m=s.children.length;f0||n.getMinutes()>0||n.getSeconds()>0),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return X(e)}),h.selectedDates.length||"min"!==e||I(n),we()),h.daysContainer&&(ce(),void 0!==n?h.currentYearElement[e]=n.getFullYear().toString():h.currentYearElement.removeAttribute(e),h.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function re(){"object"!=typeof h.config.locale&&void 0===E.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=e({},E.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?E.l10ns[h.config.locale]:void 0),p.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",void 0===e({},g,JSON.parse(JSON.stringify(f.dataset||{}))).time_24hr&&void 0===E.defaultConfig.time_24hr&&(h.config.time_24hr=h.l10n.time_24hr),h.formatDate=v(h),h.parseDate=D({config:h.config,l10n:h.l10n})}function le(e){if(void 0!==h.calendarContainer){ge("onPreCalendarPosition");var t=e||h._positionElement,n=Array.prototype.reduce.call(h.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&dn,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(c(h.calendarContainer,"arrowTop",!s),c(h.calendarContainer,"arrowBottom",s),!h.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-l.right,g=f+a>window.document.body.offsetWidth,p=m+a>window.document.body.offsetWidth;if(c(h.calendarContainer,"rightMost",g),!h.config.static)if(h.calendarContainer.style.top=u+"px",g)if(p){var v=document.styleSheets[0];if(void 0===v)return;var D=window.document.body.offsetWidth,w=Math.max(0,D/2-a/2),b=v.cssRules.length,C="{left:"+l.left+"px;right:auto;}";c(h.calendarContainer,"rightMost",!1),c(h.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,b),h.calendarContainer.style.left=w+"px",h.calendarContainer.style.right="auto"}else h.calendarContainer.style.left="auto",h.calendarContainer.style.right=m+"px";else h.calendarContainer.style.left=f+"px",h.calendarContainer.style.right="auto"}}}function ce(){h.config.noCalendar||h.isMobile||(ve(),J())}function de(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function se(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=h.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=n,"single"===h.config.mode)h.selectedDates=[a];else if("multiple"===h.config.mode){var o=he(a);o?h.selectedDates.splice(parseInt(o),1):h.selectedDates.push(a)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1,!1),h.latestSelectedDateObj=a,h.selectedDates.push(a),0!==w(a,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(k(),i){var r=h.currentYear!==a.getFullYear();h.currentYear=a.getFullYear(),h.currentMonth=a.getMonth(),r&&(ge("onYearChange"),K()),ge("onMonthChange")}if(ve(),J(),we(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),i||"range"===h.config.mode||1!==h.config.showMonths?void 0!==h.selectedDateElem&&void 0===h.hourElement&&h.selectedDateElem&&h.selectedDateElem.focus():L(n),void 0!==h.hourElement&&void 0!==h.hourElement&&h.hourElement.focus(),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&de()}Y()}}h.parseDate=D({config:h.config,l10n:h.l10n}),h._handlers=[],h.pluginElements=[],h.loadedPlugins=[],h._bind=F,h._setHoursFromDate=I,h._positionCalendar=le,h.changeMonth=G,h.changeYear=Q,h.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);h.input.value="",void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=void 0,!0===t&&(h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth());h.showTimeInput=!1,!0===h.config.enableTime&&S();h.redraw(),e&&ge("onChange")},h.close=function(){h.isOpen=!1,h.isMobile||(void 0!==h.calendarContainer&&h.calendarContainer.classList.remove("open"),void 0!==h._input&&h._input.classList.remove("active"));ge("onClose")},h._createElement=d,h.destroy=function(){void 0!==h.config&&ge("onDestroy");for(var e=h._handlers.length;e--;){var t=h._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){var n=h.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(e){}})},h.isEnabled=X,h.jumpToDate=A,h.open=function(e,t){void 0===t&&(t=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void ge("onOpen");if(h._input.disabled||h.config.inline)return;var n=h.isOpen;h.isOpen=!0,n||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),ge("onOpen"),le(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&ie(),!1!==h.config.allowInput||void 0!==e&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=ce,h.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(h.config,e),e)void 0!==ue[a]&&ue[a].forEach(function(e){return e()});else h.config[e]=n,void 0!==ue[e]?ue[e].forEach(function(e){return e()}):t.indexOf(e)>-1&&(h.config[e]=l(n));h.redraw(),we(!1)},h.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(t);fe(e,n),h.showTimeInput=h.selectedDates.length>0,h.latestSelectedDateObj=h.selectedDates[h.selectedDates.length-1],h.redraw(),A(),I(),0===h.selectedDates.length&&h.clear(!1);we(t),t&&ge("onChange")},h.toggle=function(e){if(!0===h.isOpen)return h.close();h.open(e)};var ue={locale:[re,z],showMonths:[q,x,$],minDate:[A],maxDate:[A]};function fe(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return h.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[h.parseDate(e,t)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":n=[h.parseDate(e,t)];break;case"multiple":n=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,t)});break;case"range":n=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=n.filter(function(e){return e instanceof Date&&X(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function me(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,void 0),to:h.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(e,t){if(void 0!==h.config){var n=h.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a1||"static"===h.config.monthSelectorType?h.monthElements[t].textContent=m(n.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ":h.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYearh.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function De(e){return h.selectedDates.map(function(t){return h.formatDate(t,e)}).filter(function(e,t,n){return"range"!==h.config.mode||h.config.enableTime||n.indexOf(e)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function we(e){void 0===e&&(e=!0),void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):""),h.input.value=De(h.config.dateFormat),void 0!==h.altInput&&(h.altInput.value=De(h.config.altFormat)),!1!==e&&ge("onValueUpdate")}function be(e){var t=h.prevMonthNav.contains(e.target),n=h.nextMonthNav.contains(e.target);t||n?G(t?-1:1):h.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function(){h.element=h.input=f,h.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},g,JSON.parse(JSON.stringify(f.dataset||{}))),o={};h.config.parseDate=i.parseDate,h.config.formatDate=i.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=me(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=me(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var c=E.defaultConfig.dateFormat||n.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):c+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var d=E.defaultConfig.altFormat||n.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):d+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(h.config.altInputClass=h.input.className+" "+h.config.altInputClass),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:oe("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:oe("max")});var s=function(e){return function(t){h.config["min"===e?"_minTime":"_maxTime"]=h.parseDate(t,"H:i")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:s("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:s("max")}),"time"===i.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,o,i);for(var u=0;u-1?h.config[p]=l(m[p]).map(y).concat(h.config[p]):void 0===i[p]&&(h.config[p]=m[p])}ge("onParseConfig")}(),re(),h.input=h.config.wrap?f.querySelector("[data-input]"):f,h.input?(h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=d(h.input.nodeName,h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling)),h.config.allowInput||h._input.setAttribute("readonly","readonly"),h._positionElement=h.config.positionElement||h._input):h.config.errorHandler(new Error("Invalid input element specified")),function(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&fe(e,h.config.dateFormat),h._initialDate=h.selectedDates.length>0?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()0&&(h.latestSelectedDateObj=h.selectedDates[0]),void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i")),void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i")),h.minDateHasTime=!!h.config.minDate&&(h.config.minDate.getHours()>0||h.config.minDate.getMinutes()>0||h.config.minDate.getSeconds()>0),h.maxDateHasTime=!!h.config.maxDate&&(h.config.maxDate.getHours()>0||h.config.maxDate.getMinutes()>0||h.config.maxDate.getSeconds()>0),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&c(h.calendarContainer,"showTimeInput",e),h.isOpen&&le()}})}(),h.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=h.currentMonth),void 0===t&&(t=h.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[e]}},h.isMobile||function(){var e=window.document.createDocumentFragment();if(h.calendarContainer=d("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild((h.monthNav=d("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=d("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=d("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,q(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(c(h.prevMonthNav,"flatpickr-disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(c(h.nextMonthNav,"flatpickr-disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],ve(),h.monthNav)),h.innerContainer=d("div","flatpickr-innerContainer"),h.config.weekNumbers){var t=function(){h.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",h.l10n.weekAbbreviation));var t=d("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;h.innerContainer.appendChild(n),h.weekNumbers=a,h.weekWrapper=n}h.rContainer=d("div","flatpickr-rContainer"),h.rContainer.appendChild($()),h.daysContainer||(h.daysContainer=d("div","flatpickr-days"),h.daysContainer.tabIndex=-1),J(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=d("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=d("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":h.l10n.hourAriaLabel});h.hourElement=t.getElementsByTagName("input")[0];var n=u("flatpickr-minute",{"aria-label":h.l10n.minuteAriaLabel});if(h.minuteElement=n.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("min","0"),h.minuteElement.setAttribute("max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(n),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=u("flatpickr-second");h.secondElement=a.getElementsByTagName("input")[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("step",h.minuteElement.getAttribute("step")),h.secondElement.setAttribute("min","0"),h.secondElement.setAttribute("max","59"),h.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}return h.config.time_24hr||(h.amPM=d("span","flatpickr-am-pm",h.l10n.amPM[o((h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour)>11)]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}()),c(h.calendarContainer,"rangeMode","range"===h.config.mode),c(h.calendarContainer,"animate",!0===h.config.animate),c(h.calendarContainer,"multiMonth",h.config.showMonths>1),h.calendarContainer.appendChild(e);var r=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;if((h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!r&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)){var l=d("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(l,h.element),l.appendChild(h.element),h.altInput&&l.appendChild(h.altInput),l.appendChild(h.calendarContainer)}h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",h[e])})}),h.isMobile)!function(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=d("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",h.selectedDates.length>0&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr)),h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d")),h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d")),h.input.type="hidden",void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(e){}F(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),ge("onChange"),ge("onClose")})}();else{var e=r(ae,50);h._debouncedChange=r(Y,M),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&ne(e.target)}),F(window.document.body,"keydown",te),h.config.inline||h.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",Z):F(window.document,"mousedown",N(Z)),F(window.document,"focus",Z,{capture:!0}),!0===h.config.clickOpens&&(F(h._input,"focus",h.open),F(h._input,"mousedown",N(h.open))),void 0!==h.daysContainer&&(F(h.monthNav,"mousedown",N(be)),F(h.monthNav,["keyup","increment"],_),F(h.daysContainer,"mousedown",N(se))),void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(F(h.timeContainer,["increment"],T),F(h.timeContainer,"blur",T,{capture:!0}),F(h.timeContainer,"mousedown",N(P)),F([h.hourElement,h.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==h.secondElement&&F(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&F(h.amPM,"mousedown",N(function(e){T(e),Y()})))}}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&I(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),we(!1)),x(),h.showTimeInput=h.selectedDates.length>0||h.config.noCalendar;var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&a&&le(),ge("onReady")}(),h}function x(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i 3 && s < 21) - return "th"; - switch (s % 10) { - case 1: - return "st"; - case 2: - return "nd"; - case 3: - return "rd"; - default: - return "th"; - } - }, - rangeSeparator: " to ", - weekAbbreviation: "Wk", - scrollTitle: "Scroll to increment", - toggleTitle: "Click to toggle", - amPM: ["AM", "PM"], - yearAriaLabel: "Year", - hourAriaLabel: "Hour", - minuteAriaLabel: "Minute", - time_24hr: false - }; - - exports.default = english; - exports.english = english; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/app/static/vendors/flatpickr/l10n/fr.d.ts b/app/static/vendors/flatpickr/l10n/fr.d.ts deleted file mode 100644 index 7b51e27..0000000 --- a/app/static/vendors/flatpickr/l10n/fr.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { CustomLocale } from "../types/locale"; -export declare const French: CustomLocale; -declare const _default: { - default?: CustomLocale | undefined; - hr?: CustomLocale | undefined; - th?: CustomLocale | undefined; - tr?: CustomLocale | undefined; - ar?: CustomLocale | undefined; - at?: CustomLocale | undefined; - az?: CustomLocale | undefined; - be?: CustomLocale | undefined; - bg?: CustomLocale | undefined; - bn?: CustomLocale | undefined; - bs?: CustomLocale | undefined; - cat?: CustomLocale | undefined; - cs?: CustomLocale | undefined; - cy?: CustomLocale | undefined; - da?: CustomLocale | undefined; - de?: CustomLocale | undefined; - en?: CustomLocale | undefined; - eo?: CustomLocale | undefined; - es?: CustomLocale | undefined; - et?: CustomLocale | undefined; - fa?: CustomLocale | undefined; - fi?: CustomLocale | undefined; - fo?: CustomLocale | undefined; - fr?: CustomLocale | undefined; - gr?: CustomLocale | undefined; - he?: CustomLocale | undefined; - hi?: CustomLocale | undefined; - hu?: CustomLocale | undefined; - id?: CustomLocale | undefined; - is?: CustomLocale | undefined; - it?: CustomLocale | undefined; - ja?: CustomLocale | undefined; - ka?: CustomLocale | undefined; - ko?: CustomLocale | undefined; - km?: CustomLocale | undefined; - kz?: CustomLocale | undefined; - lt?: CustomLocale | undefined; - lv?: CustomLocale | undefined; - mk?: CustomLocale | undefined; - mn?: CustomLocale | undefined; - ms?: CustomLocale | undefined; - my?: CustomLocale | undefined; - nl?: CustomLocale | undefined; - no?: CustomLocale | undefined; - pa?: CustomLocale | undefined; - pl?: CustomLocale | undefined; - pt?: CustomLocale | undefined; - ro?: CustomLocale | undefined; - ru?: CustomLocale | undefined; - si?: CustomLocale | undefined; - sk?: CustomLocale | undefined; - sl?: CustomLocale | undefined; - sq?: CustomLocale | undefined; - sr?: CustomLocale | undefined; - sv?: CustomLocale | undefined; - uk?: CustomLocale | undefined; - vn?: CustomLocale | undefined; - zh?: CustomLocale | undefined; - zh_tw?: CustomLocale | undefined; -} & { - default: import("../types/locale").Locale; -}; -export default _default; diff --git a/app/static/vendors/flatpickr/l10n/fr.js b/app/static/vendors/flatpickr/l10n/fr.js deleted file mode 100644 index 5804a19..0000000 --- a/app/static/vendors/flatpickr/l10n/fr.js +++ /dev/null @@ -1,75 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.fr = {})); -}(this, function (exports) { 'use strict'; - - var fp = typeof window !== "undefined" && window.flatpickr !== undefined - ? window.flatpickr - : { - l10ns: {} - }; - var French = { - firstDayOfWeek: 1, - weekdays: { - shorthand: ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"], - longhand: [ - "dimanche", - "lundi", - "mardi", - "mercredi", - "jeudi", - "vendredi", - "samedi", - ] - }, - months: { - shorthand: [ - "janv", - "févr", - "mars", - "avr", - "mai", - "juin", - "juil", - "août", - "sept", - "oct", - "nov", - "déc", - ], - longhand: [ - "janvier", - "février", - "mars", - "avril", - "mai", - "juin", - "juillet", - "août", - "septembre", - "octobre", - "novembre", - "décembre", - ] - }, - ordinal: function (nth) { - if (nth > 1) - return ""; - return "er"; - }, - rangeSeparator: " au ", - weekAbbreviation: "Sem", - scrollTitle: "Défiler pour augmenter la valeur", - toggleTitle: "Cliquer pour basculer", - time_24hr: true - }; - fp.l10ns.fr = French; - var fr = fp.l10ns; - - exports.French = French; - exports.default = fr; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/app/static/vendors/flatpickr/l10n/lu.d.ts b/app/static/vendors/flatpickr/l10n/lu.d.ts deleted file mode 100644 index 148e6d1..0000000 --- a/app/static/vendors/flatpickr/l10n/lu.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { CustomLocale } from "../types/locale"; -export declare const Luxembourgish: CustomLocale; -declare const _default: { - default?: CustomLocale | undefined; - hr?: CustomLocale | undefined; - th?: CustomLocale | undefined; - tr?: CustomLocale | undefined; - ar?: CustomLocale | undefined; - at?: CustomLocale | undefined; - az?: CustomLocale | undefined; - be?: CustomLocale | undefined; - bg?: CustomLocale | undefined; - bn?: CustomLocale | undefined; - bs?: CustomLocale | undefined; - cat?: CustomLocale | undefined; - cs?: CustomLocale | undefined; - cy?: CustomLocale | undefined; - da?: CustomLocale | undefined; - de?: CustomLocale | undefined; - en?: CustomLocale | undefined; - eo?: CustomLocale | undefined; - es?: CustomLocale | undefined; - et?: CustomLocale | undefined; - fa?: CustomLocale | undefined; - fi?: CustomLocale | undefined; - fo?: CustomLocale | undefined; - fr?: CustomLocale | undefined; - gr?: CustomLocale | undefined; - he?: CustomLocale | undefined; - hi?: CustomLocale | undefined; - hu?: CustomLocale | undefined; - id?: CustomLocale | undefined; - is?: CustomLocale | undefined; - it?: CustomLocale | undefined; - ja?: CustomLocale | undefined; - ka?: CustomLocale | undefined; - ko?: CustomLocale | undefined; - km?: CustomLocale | undefined; - kz?: CustomLocale | undefined; - lt?: CustomLocale | undefined; - lv?: CustomLocale | undefined; - lu?: CustomLocale | undefined; - mk?: CustomLocale | undefined; - mn?: CustomLocale | undefined; - ms?: CustomLocale | undefined; - my?: CustomLocale | undefined; - nl?: CustomLocale | undefined; - no?: CustomLocale | undefined; - pa?: CustomLocale | undefined; - pl?: CustomLocale | undefined; - pt?: CustomLocale | undefined; - ro?: CustomLocale | undefined; - ru?: CustomLocale | undefined; - si?: CustomLocale | undefined; - sk?: CustomLocale | undefined; - sl?: CustomLocale | undefined; - sq?: CustomLocale | undefined; - sr?: CustomLocale | undefined; - sv?: CustomLocale | undefined; - uk?: CustomLocale | undefined; - vn?: CustomLocale | undefined; - zh?: CustomLocale | undefined; - zh_tw?: CustomLocale | undefined; -} & { - default: import("../types/locale").Locale; -}; -export default _default; diff --git a/app/static/vendors/flatpickr/l10n/lu.js b/app/static/vendors/flatpickr/l10n/lu.js deleted file mode 100644 index c366ea8..0000000 --- a/app/static/vendors/flatpickr/l10n/lu.js +++ /dev/null @@ -1,71 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.lu = {})); -}(this, function (exports) { 'use strict'; - - var fp = typeof window !== "undefined" && window.flatpickr !== undefined - ? window.flatpickr - : { - l10ns: {} - }; - var Luxembourgish = { - firstDayOfWeek: 1, - weekdays: { - shorthand: ["So", "Me", "De", "Me", "Do", "Fr", "Sa"], - longhand: [ - "Sonndeg", - "Méindeg", - "Dënsdeg", - "Mëttwoch", - "Donneschdeg", - "Freideg", - "Samsdeg", - ] - }, - months: { - shorthand: [ - "Jan", - "Feb", - "Mär", - "Abr", - "Mee", - "Jun", - "Jul", - "Aug", - "Sep", - "Okt", - "Nov", - "Dez", - ], - longhand: [ - "Januar", - "Februar", - "März", - "Abrëll", - "Mee", - "Juni", - "Juli", - "August", - "September", - "Oktober", - "November", - "Dezember", - ] - }, - - weekAbbreviation: "KW", - rangeSeparator: " bis ", - scrollTitle: "fir ze ännerne scrollen", - toggleTitle: "Zum Ëmschalten klicken", - time_24hr: true - }; - fp.l10ns.lu = Luxembourgish; - var lu = fp.l10ns; - - exports.Luxembourgish = Luxembourgish; - exports.default = lu; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.css b/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.css deleted file mode 100644 index 9508ea9..0000000 --- a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.css +++ /dev/null @@ -1,24 +0,0 @@ -.flatpickr-confirm { - height: 40px; - max-height: 0px; - visibility: hidden; - display: flex; - justify-content: center; - align-items: center; - cursor: pointer; - background: rgba(0,0,0,0.06) -} - -.flatpickr-confirm svg path { - fill: inherit; -} - -.flatpickr-confirm.darkTheme { - color: white; - fill: white; -} - -.flatpickr-confirm.visible { - max-height: 40px; - visibility: visible -} diff --git a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.d.ts b/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.d.ts deleted file mode 100644 index a4ddf39..0000000 --- a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Plugin } from "../../types/options"; -export interface Config { - confirmIcon?: string; - confirmText?: string; - showAlways?: boolean; - theme?: string; -} -declare function confirmDatePlugin(pluginConfig: Config): Plugin; -export default confirmDatePlugin; diff --git a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.js b/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.js deleted file mode 100644 index c1fc0ac..0000000 --- a/app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.js +++ /dev/null @@ -1,84 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.confirmDatePlugin = factory()); -}(this, function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - var defaultConfig = { - confirmIcon: " ", - confirmText: "OK ", - showAlways: false, - theme: "light" - }; - function confirmDatePlugin(pluginConfig) { - var config = __assign({}, defaultConfig, pluginConfig); - var confirmContainer; - var confirmButtonCSSClass = "flatpickr-confirm"; - return function (fp) { - if (fp.config.noCalendar || fp.isMobile) - return {}; - return __assign({ onKeyDown: function (_, __, ___, e) { - if (fp.config.enableTime && e.key === "Tab" && e.target === fp.amPM) { - e.preventDefault(); - confirmContainer.focus(); - } - else if (e.key === "Enter" && e.target === confirmContainer) - fp.close(); - }, - onReady: function () { - confirmContainer = fp._createElement("div", confirmButtonCSSClass + " " + (config.showAlways ? "visible" : "") + " " + config.theme + "Theme", config.confirmText); - confirmContainer.tabIndex = -1; - confirmContainer.innerHTML += config.confirmIcon; - confirmContainer.addEventListener("click", fp.close); - fp.calendarContainer.appendChild(confirmContainer); - fp.loadedPlugins.push("confirmDate"); - } }, (!config.showAlways - ? { - onChange: function (_, dateStr) { - var showCondition = fp.config.enableTime || - fp.config.mode === "multiple" || - fp.loadedPlugins.indexOf("monthSelect") !== -1; - var localConfirmContainer = fp.calendarContainer.querySelector("." + confirmButtonCSSClass); - if (!localConfirmContainer) - return; - if (dateStr && - !fp.config.inline && - showCondition && - localConfirmContainer) - return localConfirmContainer.classList.add("visible"); - localConfirmContainer.classList.remove("visible"); - } - } - : {})); - }; - } - - return confirmDatePlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.d.ts b/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.d.ts deleted file mode 100644 index 1a9cbce..0000000 --- a/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Plugin } from "../../types/options"; -declare function labelPlugin(): Plugin; -export default labelPlugin; diff --git a/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.js b/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.js deleted file mode 100644 index ddad2bc..0000000 --- a/app/static/vendors/flatpickr/plugins/labelPlugin/labelPlugin.js +++ /dev/null @@ -1,31 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.labelPlugin = factory()); -}(this, function () { 'use strict'; - - function labelPlugin() { - return function (fp) { - return { - onReady: function () { - var id = fp.input.id; - if (!id) { - return; - } - if (fp.mobileInput) { - fp.input.removeAttribute("id"); - fp.mobileInput.id = id; - } - else if (fp.altInput) { - fp.input.removeAttribute("id"); - fp.altInput.id = id; - } - fp.loadedPlugins.push("labelPlugin"); - } - }; - }; - } - - return labelPlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.d.ts b/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.d.ts deleted file mode 100644 index 4fe2e5c..0000000 --- a/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Plugin } from "../types/options"; -export interface MinMaxTime { - minTime?: string; - maxTime?: string; -} -export interface Config { - table?: Record; - getTimeLimits?: (date: Date) => MinMaxTime; - tableDateFormat?: string; -} -export interface State { - formatDate: (date: Date, f: string) => string; - tableDateFormat: string; - defaults: MinMaxTime; -} -declare function minMaxTimePlugin(config?: Config): Plugin; -export default minMaxTimePlugin; diff --git a/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.js b/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.js deleted file mode 100644 index 291ac25..0000000 --- a/app/static/vendors/flatpickr/plugins/minMaxTimePlugin.js +++ /dev/null @@ -1,326 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.minMaxTimePlugin = factory()); -}(this, function () { 'use strict'; - - var pad = function (number) { return ("0" + number).slice(-2); }; - var int = function (bool) { return (bool === true ? 1 : 0); }; - - var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; - var formats = { - // get the date in UTC - Z: function (date) { return date.toISOString(); }, - // weekday name, short, e.g. Thu - D: function (date, locale, options) { - return locale.weekdays.shorthand[formats.w(date, locale, options)]; - }, - // full month name e.g. January - F: function (date, locale, options) { - return monthToStr(formats.n(date, locale, options) - 1, false, locale); - }, - // padded hour 1-12 - G: function (date, locale, options) { - return pad(formats.h(date, locale, options)); - }, - // hours with leading zero e.g. 03 - H: function (date) { return pad(date.getHours()); }, - // day (1-30) with ordinal suffix e.g. 1st, 2nd - J: function (date, locale) { - return locale.ordinal !== undefined - ? date.getDate() + locale.ordinal(date.getDate()) - : date.getDate(); - }, - // AM/PM - K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; }, - // shorthand month e.g. Jan, Sep, Oct, etc - M: function (date, locale) { - return monthToStr(date.getMonth(), true, locale); - }, - // seconds 00-59 - S: function (date) { return pad(date.getSeconds()); }, - // unix timestamp - U: function (date) { return date.getTime() / 1000; }, - W: function (date, _, options) { - return options.getWeek(date); - }, - // full year e.g. 2016 - Y: function (date) { return date.getFullYear(); }, - // day in month, padded (01-30) - d: function (date) { return pad(date.getDate()); }, - // hour from 1-12 (am/pm) - h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); }, - // minutes, padded with leading zero e.g. 09 - i: function (date) { return pad(date.getMinutes()); }, - // day in month (1-30) - j: function (date) { return date.getDate(); }, - // weekday name, full, e.g. Thursday - l: function (date, locale) { - return locale.weekdays.longhand[date.getDay()]; - }, - // padded month number (01-12) - m: function (date) { return pad(date.getMonth() + 1); }, - // the month number (1-12) - n: function (date) { return date.getMonth() + 1; }, - // seconds 0-59 - s: function (date) { return date.getSeconds(); }, - // Unix Milliseconds - u: function (date) { return date.getTime(); }, - // number of the day of the week - w: function (date) { return date.getDay(); }, - // last two digits of year e.g. 16 for 2016 - y: function (date) { return String(date.getFullYear()).substring(2); } - }; - - var defaults = { - _disable: [], - _enable: [], - allowInput: false, - altFormat: "F j, Y", - altInput: false, - altInputClass: "form-control input", - animate: typeof window === "object" && - window.navigator.userAgent.indexOf("MSIE") === -1, - ariaDateFormat: "F j, Y", - clickOpens: true, - closeOnSelect: true, - conjunction: ", ", - dateFormat: "Y-m-d", - defaultHour: 12, - defaultMinute: 0, - defaultSeconds: 0, - disable: [], - disableMobile: false, - enable: [], - enableSeconds: false, - enableTime: false, - errorHandler: function (err) { - return typeof console !== "undefined" && console.warn(err); - }, - getWeek: function (givenDate) { - var date = new Date(givenDate.getTime()); - date.setHours(0, 0, 0, 0); - // Thursday in current week decides the year. - date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7)); - // January 4 is always in week 1. - var week1 = new Date(date.getFullYear(), 0, 4); - // Adjust to Thursday in week 1 and count number of weeks from date to week1. - return (1 + - Math.round(((date.getTime() - week1.getTime()) / 86400000 - - 3 + - ((week1.getDay() + 6) % 7)) / - 7)); - }, - hourIncrement: 1, - ignoredFocusElements: [], - inline: false, - locale: "default", - minuteIncrement: 5, - mode: "single", - monthSelectorType: "dropdown", - nextArrow: "", - noCalendar: false, - now: new Date(), - onChange: [], - onClose: [], - onDayCreate: [], - onDestroy: [], - onKeyDown: [], - onMonthChange: [], - onOpen: [], - onParseConfig: [], - onReady: [], - onValueUpdate: [], - onYearChange: [], - onPreCalendarPosition: [], - plugins: [], - position: "auto", - positionElement: undefined, - prevArrow: "", - shorthandCurrentMonth: false, - showMonths: 1, - static: false, - time_24hr: false, - weekNumbers: false, - wrap: false - }; - - var english = { - weekdays: { - shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - longhand: [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - ] - }, - months: { - shorthand: [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", - ], - longhand: [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ] - }, - daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - firstDayOfWeek: 0, - ordinal: function (nth) { - var s = nth % 100; - if (s > 3 && s < 21) - return "th"; - switch (s % 10) { - case 1: - return "st"; - case 2: - return "nd"; - case 3: - return "rd"; - default: - return "th"; - } - }, - rangeSeparator: " to ", - weekAbbreviation: "Wk", - scrollTitle: "Scroll to increment", - toggleTitle: "Click to toggle", - amPM: ["AM", "PM"], - yearAriaLabel: "Year", - hourAriaLabel: "Hour", - minuteAriaLabel: "Minute", - time_24hr: false - }; - - var createDateFormatter = function (_a) { - var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; - return function (dateObj, frmt, overrideLocale) { - var locale = overrideLocale || l10n; - if (config.formatDate !== undefined) { - return config.formatDate(dateObj, frmt, locale); - } - return frmt - .split("") - .map(function (c, i, arr) { - return formats[c] && arr[i - 1] !== "\\" - ? formats[c](dateObj, locale, config) - : c !== "\\" - ? c - : ""; - }) - .join(""); - }; - }; - /** - * Compute the difference in dates, measured in ms - */ - function compareDates(date1, date2, timeless) { - if (timeless === void 0) { timeless = true; } - if (timeless !== false) { - return (new Date(date1.getTime()).setHours(0, 0, 0, 0) - - new Date(date2.getTime()).setHours(0, 0, 0, 0)); - } - return date1.getTime() - date2.getTime(); - } - /** - * Compute the difference in times, measured in ms - */ - function compareTimes(date1, date2) { - return (3600 * (date1.getHours() - date2.getHours()) + - 60 * (date1.getMinutes() - date2.getMinutes()) + - date1.getSeconds() - - date2.getSeconds()); - } - - function minMaxTimePlugin(config) { - if (config === void 0) { config = {}; } - var state = { - formatDate: createDateFormatter({}), - tableDateFormat: config.tableDateFormat || "Y-m-d", - defaults: { - minTime: undefined, - maxTime: undefined - } - }; - function findDateTimeLimit(date) { - if (config.table !== undefined) { - return config.table[state.formatDate(date, state.tableDateFormat)]; - } - return config.getTimeLimits && config.getTimeLimits(date); - } - return function (fp) { - return { - onReady: function () { - state.formatDate = this.formatDate; - state.defaults = { - minTime: this.config.minTime && state.formatDate(this.config.minTime, "H:i"), - maxTime: this.config.maxTime && state.formatDate(this.config.maxTime, "H:i") - }; - fp.loadedPlugins.push("minMaxTime"); - }, - onChange: function () { - var latest = this.latestSelectedDateObj; - var matchingTimeLimit = latest && findDateTimeLimit(latest); - if (latest && matchingTimeLimit !== undefined) { - this.set(matchingTimeLimit); - fp.config.minTime.setFullYear(latest.getFullYear()); - fp.config.maxTime.setFullYear(latest.getFullYear()); - fp.config.minTime.setMonth(latest.getMonth()); - fp.config.maxTime.setMonth(latest.getMonth()); - fp.config.minTime.setDate(latest.getDate()); - fp.config.maxTime.setDate(latest.getDate()); - if (compareDates(latest, fp.config.maxTime, false) > 0) { - fp.setDate(new Date(latest.getTime()).setHours(fp.config.maxTime.getHours(), fp.config.maxTime.getMinutes(), fp.config.maxTime.getSeconds(), fp.config.maxTime.getMilliseconds()), false); - } - else if (compareDates(latest, fp.config.minTime, false) < 0) - fp.setDate(new Date(latest.getTime()).setHours(fp.config.minTime.getHours(), fp.config.minTime.getMinutes(), fp.config.minTime.getSeconds(), fp.config.minTime.getMilliseconds()), false); - } - else { - var newMinMax = state.defaults || { - minTime: undefined, - maxTime: undefined - }; - this.set(newMinMax); - if (!latest) - return; - var _a = fp.config, minTime = _a.minTime, maxTime = _a.maxTime; - if (minTime && compareTimes(latest, minTime) < 0) { - fp.setDate(new Date(latest.getTime()).setHours(minTime.getHours(), minTime.getMinutes(), minTime.getSeconds(), minTime.getMilliseconds()), false); - } - else if (maxTime && compareTimes(latest, maxTime) > 0) { - fp.setDate(new Date(latest.getTime()).setHours(maxTime.getHours(), maxTime.getMinutes(), maxTime.getSeconds(), maxTime.getMilliseconds())); - } - // - } - } - }; - }; - } - - return minMaxTimePlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/monthSelect/index.d.ts b/app/static/vendors/flatpickr/plugins/monthSelect/index.d.ts deleted file mode 100644 index d3864fc..0000000 --- a/app/static/vendors/flatpickr/plugins/monthSelect/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Plugin } from "../../types/options"; -export interface Config { - shorthand: boolean; - dateFormat: string; - altFormat: string; - theme: string; -} -export declare type MonthElement = HTMLSpanElement & { - dateObj: Date; - $i: number; -}; -declare function monthSelectPlugin(pluginConfig?: Partial): Plugin; -export default monthSelectPlugin; diff --git a/app/static/vendors/flatpickr/plugins/monthSelect/index.js b/app/static/vendors/flatpickr/plugins/monthSelect/index.js deleted file mode 100644 index 7fd66e7..0000000 --- a/app/static/vendors/flatpickr/plugins/monthSelect/index.js +++ /dev/null @@ -1,174 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.monthSelectPlugin = factory()); -}(this, function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - - var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; - - var defaultConfig = { - shorthand: false, - dateFormat: "F Y", - altFormat: "F Y", - theme: "light" - }; - function monthSelectPlugin(pluginConfig) { - var config = __assign({}, defaultConfig, pluginConfig); - return function (fp) { - fp.config.dateFormat = config.dateFormat; - fp.config.altFormat = config.altFormat; - var self = { monthsContainer: null }; - function clearUnnecessaryDOMElements() { - if (!fp.rContainer || !fp.daysContainer || !fp.weekdayContainer) - return; - fp.rContainer.removeChild(fp.daysContainer); - fp.rContainer.removeChild(fp.weekdayContainer); - for (var index = 0; index < fp.monthElements.length; index++) { - var element = fp.monthElements[index]; - if (!element.parentNode) - continue; - element.parentNode.removeChild(element); - } - } - function addListeners() { - fp._bind(fp.prevMonthNav, "click", function () { - fp.currentYear -= 1; - selectYear(); - }); - fp._bind(fp.nextMonthNav, "mousedown", function () { - fp.currentYear += 1; - selectYear(); - }); - } - function addMonths() { - if (!fp.rContainer) - return; - self.monthsContainer = fp._createElement("div", "flatpickr-monthSelect-months"); - self.monthsContainer.tabIndex = -1; - fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-" + config.theme); - for (var i = 0; i < 12; i++) { - var month = fp._createElement("span", "flatpickr-monthSelect-month"); - month.dateObj = new Date(fp.currentYear, i); - month.$i = i; - month.textContent = monthToStr(i, config.shorthand, fp.l10n); - month.tabIndex = -1; - month.addEventListener("click", selectMonth); - self.monthsContainer.appendChild(month); - } - fp.rContainer.appendChild(self.monthsContainer); - } - function setCurrentlySelected() { - if (!fp.rContainer) - return; - var currentlySelected = fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected"); - for (var index = 0; index < currentlySelected.length; index++) { - currentlySelected[index].classList.remove("selected"); - } - var month = fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child(" + (fp.currentMonth + 1) + ")"); - if (month) { - month.classList.add("selected"); - } - } - function selectYear() { - var selectedDate = fp.selectedDates[0]; - selectedDate.setFullYear(fp.currentYear); - fp.setDate(selectedDate, true); - } - function selectMonth(e) { - e.preventDefault(); - e.stopPropagation(); - setMonth(e.target.dateObj); - } - function setMonth(date) { - var selectedDate = new Date(date); - selectedDate.setFullYear(fp.currentYear); - fp.currentMonth = selectedDate.getMonth(); - fp.setDate(selectedDate, true); - setCurrentlySelected(); - } - var shifts = { - 37: -1, - 39: 1, - 40: 3, - 38: -3 - }; - function onKeyDown(_, __, ___, e) { - var shouldMove = shifts[e.keyCode] !== undefined; - if (!shouldMove && e.keyCode !== 13) { - return; - } - if (!fp.rContainer || !self.monthsContainer) - return; - var currentlySelected = fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected"); - var index = Array.prototype.indexOf.call(self.monthsContainer.children, document.activeElement); - if (index === -1) { - var target = currentlySelected || self.monthsContainer.firstElementChild; - target.focus(); - index = target.$i; - } - if (shouldMove) { - self.monthsContainer.children[(12 + index + shifts[e.keyCode]) % 12].focus(); - } - else if (e.keyCode === 13 && - self.monthsContainer.contains(document.activeElement)) { - setMonth(document.activeElement.dateObj); - } - } - function destroyPluginInstance() { - if (self.monthsContainer !== null) { - var months = self.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month"); - for (var index = 0; index < months.length; index++) { - months[index].removeEventListener("click", selectMonth); - } - } - } - return { - onParseConfig: function () { - fp.config.mode = "single"; - fp.config.enableTime = false; - }, - onValueUpdate: setCurrentlySelected, - onKeyDown: onKeyDown, - onReady: [ - clearUnnecessaryDOMElements, - addListeners, - addMonths, - setCurrentlySelected, - function () { - fp.loadedPlugins.push("monthSelect"); - }, - ], - onDestroy: destroyPluginInstance - }; - }; - } - - return monthSelectPlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/monthSelect/style.css b/app/static/vendors/flatpickr/plugins/monthSelect/style.css deleted file mode 100644 index cacbafc..0000000 --- a/app/static/vendors/flatpickr/plugins/monthSelect/style.css +++ /dev/null @@ -1,69 +0,0 @@ -.flatpickr-monthSelect-months { - margin: 10px 1px 3px 1px; - flex-wrap: wrap; -} - -.flatpickr-monthSelect-month { - background: none; - border: 0; - border-radius: 2px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #393939; - cursor: pointer; - display: inline-block; - font-weight: 400; - margin: 0.5px; - justify-content: center; - padding: 10px; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - text-align: center; - width: 33%; -} - -.flatpickr-monthSelect-theme-dark { - background: #3f4458; -} - -.flatpickr-monthSelect-theme-dark .flatpickr-current-month input.cur-year { - color: #fff; -} - -.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-prev-month, -.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-next-month { - color: #fff; - fill: #fff; -} - -.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month { - color: rgba(255, 255, 255, 0.95); -} - -.flatpickr-monthSelect-month:hover, -.flatpickr-monthSelect-month:focus { - background: #e6e6e6; - cursor: pointer; - outline: 0; -} - -.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:hover, -.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:focus { - background: #646c8c; - border-color: #646c8c; -} - -.flatpickr-monthSelect-month.selected { - background-color: #569ff7; - color: #fff; -} - -.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.selected { - background: #80cbc4; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #80cbc4; -} diff --git a/app/static/vendors/flatpickr/plugins/monthSelect/tests.spec.d.ts b/app/static/vendors/flatpickr/plugins/monthSelect/tests.spec.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/app/static/vendors/flatpickr/plugins/monthSelect/tests.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/app/static/vendors/flatpickr/plugins/rangePlugin.d.ts b/app/static/vendors/flatpickr/plugins/rangePlugin.d.ts deleted file mode 100644 index 960a834..0000000 --- a/app/static/vendors/flatpickr/plugins/rangePlugin.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Plugin } from "../types/options"; -export interface Config { - input?: string | HTMLInputElement; - position?: "left"; -} -declare global { - interface Window { - rangePlugin: (config?: Config) => void; - } -} -declare function rangePlugin(config?: Config): Plugin; -export default rangePlugin; diff --git a/app/static/vendors/flatpickr/plugins/rangePlugin.js b/app/static/vendors/flatpickr/plugins/rangePlugin.js deleted file mode 100644 index 407e388..0000000 --- a/app/static/vendors/flatpickr/plugins/rangePlugin.js +++ /dev/null @@ -1,146 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.rangePlugin = factory()); -}(this, function () { 'use strict'; - - function rangePlugin(config) { - if (config === void 0) { config = {}; } - return function (fp) { - var dateFormat = "", secondInput, _secondInputFocused, _prevDates; - var createSecondInput = function () { - if (config.input) { - secondInput = - config.input instanceof Element - ? config.input - : window.document.querySelector(config.input); - if (!secondInput) { - fp.config.errorHandler(new Error("Invalid input element specified")); - return; - } - if (fp.config.wrap) { - secondInput = secondInput.querySelector("[data-input]"); - } - } - else { - secondInput = fp._input.cloneNode(); - secondInput.removeAttribute("id"); - secondInput._flatpickr = undefined; - } - if (secondInput.value) { - var parsedDate = fp.parseDate(secondInput.value); - if (parsedDate) - fp.selectedDates.push(parsedDate); - } - secondInput.setAttribute("data-fp-omit", ""); - fp._bind(secondInput, ["focus", "click"], function () { - if (fp.selectedDates[1]) { - fp.latestSelectedDateObj = fp.selectedDates[1]; - fp._setHoursFromDate(fp.selectedDates[1]); - fp.jumpToDate(fp.selectedDates[1]); - } - _secondInputFocused = true; - fp.isOpen = false; - fp.open(undefined, config.position === "left" ? fp._input : secondInput); - }); - fp._bind(fp._input, ["focus", "click"], function (e) { - e.preventDefault(); - fp.isOpen = false; - fp.open(); - }); - if (fp.config.allowInput) - fp._bind(secondInput, "keydown", function (e) { - if (e.key === "Enter") { - fp.setDate([fp.selectedDates[0], secondInput.value], true, dateFormat); - secondInput.click(); - } - }); - if (!config.input) - fp._input.parentNode && - fp._input.parentNode.insertBefore(secondInput, fp._input.nextSibling); - }; - var plugin = { - onParseConfig: function () { - fp.config.mode = "range"; - dateFormat = fp.config.altInput - ? fp.config.altFormat - : fp.config.dateFormat; - }, - onReady: function () { - createSecondInput(); - fp.config.ignoredFocusElements.push(secondInput); - if (fp.config.allowInput) { - fp._input.removeAttribute("readonly"); - secondInput.removeAttribute("readonly"); - } - else { - secondInput.setAttribute("readonly", "readonly"); - } - fp._bind(fp._input, "focus", function () { - fp.latestSelectedDateObj = fp.selectedDates[0]; - fp._setHoursFromDate(fp.selectedDates[0]); - _secondInputFocused = false; - fp.jumpToDate(fp.selectedDates[0]); - }); - if (fp.config.allowInput) - fp._bind(fp._input, "keydown", function (e) { - if (e.key === "Enter") - fp.setDate([fp._input.value, fp.selectedDates[1]], true, dateFormat); - }); - fp.setDate(fp.selectedDates, false); - plugin.onValueUpdate(fp.selectedDates); - fp.loadedPlugins.push("range"); - }, - onPreCalendarPosition: function () { - if (_secondInputFocused) { - fp._positionElement = secondInput; - setTimeout(function () { - fp._positionElement = fp._input; - }, 0); - } - }, - onChange: function () { - if (!fp.selectedDates.length) { - setTimeout(function () { - if (fp.selectedDates.length) - return; - secondInput.value = ""; - _prevDates = []; - }, 10); - } - if (_secondInputFocused) { - setTimeout(function () { - secondInput.focus(); - }, 0); - } - }, - onDestroy: function () { - if (!config.input) - secondInput.parentNode && - secondInput.parentNode.removeChild(secondInput); - }, - onValueUpdate: function (selDates) { - var _a, _b, _c; - if (!secondInput) - return; - _prevDates = - !_prevDates || selDates.length >= _prevDates.length - ? selDates.slice() : _prevDates; - if (_prevDates.length > selDates.length) { - var newSelectedDate = selDates[0]; - var newDates = _secondInputFocused - ? [_prevDates[0], newSelectedDate] - : [newSelectedDate, _prevDates[1]]; - fp.setDate(newDates, false); - _prevDates = newDates.slice(); - } - _a = fp.selectedDates.map(function (d) { return fp.formatDate(d, dateFormat); }), _b = _a[0], fp._input.value = _b === void 0 ? "" : _b, _c = _a[1], secondInput.value = _c === void 0 ? "" : _c; - } - }; - return plugin; - }; - } - - return rangePlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/scrollPlugin.d.ts b/app/static/vendors/flatpickr/plugins/scrollPlugin.d.ts deleted file mode 100644 index a367428..0000000 --- a/app/static/vendors/flatpickr/plugins/scrollPlugin.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Plugin } from "../types/options"; -declare function scrollPlugin(): Plugin; -export default scrollPlugin; diff --git a/app/static/vendors/flatpickr/plugins/scrollPlugin.js b/app/static/vendors/flatpickr/plugins/scrollPlugin.js deleted file mode 100644 index 3a5ad99..0000000 --- a/app/static/vendors/flatpickr/plugins/scrollPlugin.js +++ /dev/null @@ -1,58 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.scrollPlugin = factory()); -}(this, function () { 'use strict'; - - function delta(e) { - return Math.max(-1, Math.min(1, e.wheelDelta || -e.deltaY)); - } - var scroll = function (e) { - e.preventDefault(); - var ev = new CustomEvent("increment", { - bubbles: true - }); - ev.delta = delta(e); - e.target.dispatchEvent(ev); - }; - function scrollMonth(fp) { - return function (e) { - e.preventDefault(); - var mDelta = delta(e); - fp.changeMonth(mDelta); - }; - } - function scrollPlugin() { - return function (fp) { - var monthScroller = scrollMonth(fp); - return { - onReady: function () { - if (fp.timeContainer) { - fp.timeContainer.addEventListener("wheel", scroll); - } - fp.yearElements.forEach(function (yearElem) { - return yearElem.addEventListener("wheel", scroll); - }); - fp.monthElements.forEach(function (monthElem) { - return monthElem.addEventListener("wheel", monthScroller); - }); - fp.loadedPlugins.push("scroll"); - }, - onDestroy: function () { - if (fp.timeContainer) { - fp.timeContainer.removeEventListener("wheel", scroll); - } - fp.yearElements.forEach(function (yearElem) { - return yearElem.removeEventListener("wheel", scroll); - }); - fp.monthElements.forEach(function (monthElem) { - return monthElem.removeEventListener("wheel", monthScroller); - }); - } - }; - }; - } - - return scrollPlugin; - -})); diff --git a/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.d.ts b/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.d.ts deleted file mode 100644 index 88cc964..0000000 --- a/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Plugin } from "../../types/options"; -export declare type PlusWeeks = { - weekStartDay: Date; - weekEndDay: Date; -}; -declare function weekSelectPlugin(): Plugin; -export default weekSelectPlugin; diff --git a/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.js b/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.js deleted file mode 100644 index e8792ed..0000000 --- a/app/static/vendors/flatpickr/plugins/weekSelect/weekSelect.js +++ /dev/null @@ -1,86 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.weekSelect = factory()); -}(this, function () { 'use strict'; - - function weekSelectPlugin() { - return function (fp) { - function onDayHover(event) { - var day = event.target; - if (!day.classList.contains("flatpickr-day")) - return; - var days = fp.days.childNodes; - var dayIndex = day.$i; - var dayIndSeven = dayIndex / 7; - var weekStartDay = days[7 * Math.floor(dayIndSeven)] - .dateObj; - var weekEndDay = days[7 * Math.ceil(dayIndSeven + 0.01) - 1].dateObj; - for (var i = days.length; i--;) { - var day_1 = days[i]; - var date = day_1.dateObj; - if (date > weekEndDay || date < weekStartDay) - day_1.classList.remove("inRange"); - else - day_1.classList.add("inRange"); - } - } - function highlightWeek() { - var selDate = fp.latestSelectedDateObj; - if (selDate !== undefined && - selDate.getMonth() === fp.currentMonth && - selDate.getFullYear() === fp.currentYear) { - fp.weekStartDay = fp.days.childNodes[7 * Math.floor(fp.selectedDateElem.$i / 7)].dateObj; - fp.weekEndDay = fp.days.childNodes[7 * Math.ceil(fp.selectedDateElem.$i / 7 + 0.01) - 1].dateObj; - } - var days = fp.days.childNodes; - for (var i = days.length; i--;) { - var date = days[i].dateObj; - if (date >= fp.weekStartDay && date <= fp.weekEndDay) - days[i].classList.add("week", "selected"); - } - } - function clearHover() { - var days = fp.days.childNodes; - for (var i = days.length; i--;) - days[i].classList.remove("inRange"); - } - function onReady() { - if (fp.daysContainer !== undefined) - fp.daysContainer.addEventListener("mouseover", onDayHover); - } - function onDestroy() { - if (fp.daysContainer !== undefined) - fp.daysContainer.removeEventListener("mouseover", onDayHover); - } - return { - onValueUpdate: highlightWeek, - onMonthChange: highlightWeek, - onYearChange: highlightWeek, - onOpen: highlightWeek, - onClose: clearHover, - onParseConfig: function () { - fp.config.mode = "single"; - fp.config.enableTime = false; - fp.config.dateFormat = fp.config.dateFormat - ? fp.config.dateFormat - : "\\W\\e\\e\\k #W, Y"; - fp.config.altFormat = fp.config.altFormat - ? fp.config.altFormat - : "\\W\\e\\e\\k #W, Y"; - }, - onReady: [ - onReady, - highlightWeek, - function () { - fp.loadedPlugins.push("weekSelect"); - }, - ], - onDestroy: onDestroy - }; - }; - } - - return weekSelectPlugin; - -})); diff --git a/app/static/vendors/flatpickr/themes/airbnb.css b/app/static/vendors/flatpickr/themes/airbnb.css deleted file mode 100644 index c47c711..0000000 --- a/app/static/vendors/flatpickr/themes/airbnb.css +++ /dev/null @@ -1,872 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - background: #fff; - -webkit-box-shadow: 1px 0 0 #eee, -1px 0 0 #eee, 0 1px 0 #eee, 0 -1px 0 #eee, 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 1px 0 0 #eee, -1px 0 0 #eee, 0 1px 0 #eee, 0 -1px 0 #eee, 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid #eee; -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: #eee; -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #fff; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: #eee; -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #fff; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - background: transparent; - color: #3c3f40; - fill: #3c3f40; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #3c3f40; - fill: #3c3f40; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #f64747; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(64,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(64,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(64,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(60,63,64,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #3c3f40; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #3c3f40; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(60,63,64,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: transparent; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: transparent; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: transparent; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: transparent; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 #eee; - box-shadow: -1px 0 0 #eee; -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #404848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e9e9e9; - border-color: #e9e9e9; -} -.flatpickr-day.today { - border-color: #f64747; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #f64747; - background: #f64747; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #4f99ff; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #4f99ff; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #4f99ff; - box-shadow: -10px 0 0 #4f99ff; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e9e9e9, 5px 0 0 #e9e9e9; - box-shadow: -5px 0 0 #e9e9e9, 5px 0 0 #e9e9e9; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(64,72,72,0.3); - background: transparent; - border-color: #e9e9e9; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(64,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #4f99ff, 5px 0 0 #4f99ff; - box-shadow: -5px 0 0 #4f99ff, 5px 0 0 #4f99ff; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - -webkit-box-shadow: 1px 0 0 #eee; - box-shadow: 1px 0 0 #eee; -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(64,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #404848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #404848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #404848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #404848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #f1f1f1; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -.flatpickr-calendar { - width: 307.875px; -} -.dayContainer { - padding: 0; - border-right: 0; -} -span.flatpickr-day, -span.flatpickr-day.prevMonthDay, -span.flatpickr-day.nextMonthDay { - border-radius: 0 !important; - border: 1px solid #e9e9e9; - max-width: none; - border-right-color: transparent; -} -span.flatpickr-day:nth-child(n+8), -span.flatpickr-day.prevMonthDay:nth-child(n+8), -span.flatpickr-day.nextMonthDay:nth-child(n+8) { - border-top-color: transparent; -} -span.flatpickr-day:nth-child(7n-6), -span.flatpickr-day.prevMonthDay:nth-child(7n-6), -span.flatpickr-day.nextMonthDay:nth-child(7n-6) { - border-left: 0; -} -span.flatpickr-day:nth-child(n+36), -span.flatpickr-day.prevMonthDay:nth-child(n+36), -span.flatpickr-day.nextMonthDay:nth-child(n+36) { - border-bottom: 0; -} -span.flatpickr-day:nth-child(-n+7), -span.flatpickr-day.prevMonthDay:nth-child(-n+7), -span.flatpickr-day.nextMonthDay:nth-child(-n+7) { - margin-top: 0; -} -span.flatpickr-day.today:not(.selected), -span.flatpickr-day.prevMonthDay.today:not(.selected), -span.flatpickr-day.nextMonthDay.today:not(.selected) { - border-color: #e9e9e9; - border-right-color: transparent; - border-top-color: transparent; - border-bottom-color: #f64747; -} -span.flatpickr-day.today:not(.selected):hover, -span.flatpickr-day.prevMonthDay.today:not(.selected):hover, -span.flatpickr-day.nextMonthDay.today:not(.selected):hover { - border: 1px solid #f64747; -} -span.flatpickr-day.startRange, -span.flatpickr-day.prevMonthDay.startRange, -span.flatpickr-day.nextMonthDay.startRange, -span.flatpickr-day.endRange, -span.flatpickr-day.prevMonthDay.endRange, -span.flatpickr-day.nextMonthDay.endRange { - border-color: #4f99ff; -} -span.flatpickr-day.today, -span.flatpickr-day.prevMonthDay.today, -span.flatpickr-day.nextMonthDay.today, -span.flatpickr-day.selected, -span.flatpickr-day.prevMonthDay.selected, -span.flatpickr-day.nextMonthDay.selected { - z-index: 2; -} -.rangeMode .flatpickr-day { - margin-top: -1px; -} -.flatpickr-weekwrapper .flatpickr-weeks { - -webkit-box-shadow: none; - box-shadow: none; -} -.flatpickr-weekwrapper span.flatpickr-day { - border: 0; - margin: -1px 0 0 -1px; -} -.hasWeeks .flatpickr-days { - border-right: 0; -} - - @media screen and (min-width:0\0) and (min-resolution: +72dpi) { - span.flatpickr-day { - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1 0 auto; - -ms-flex: 1 0 auto; - flex: 1 0 auto; - } - } diff --git a/app/static/vendors/flatpickr/themes/confetti.css b/app/static/vendors/flatpickr/themes/confetti.css deleted file mode 100644 index d663ae3..0000000 --- a/app/static/vendors/flatpickr/themes/confetti.css +++ /dev/null @@ -1,795 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid rgba(72,72,72,0.1); -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid rgba(72,72,72,0.1); -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: rgba(72,72,72,0.1); -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #ffb866; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: rgba(72,72,72,0.1); -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #ffb866; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #ffb866; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #ffb866; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #ffb866; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #ffb866; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #ffb866; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid rgba(72,72,72,0.1); - border-right: 1px solid rgba(72,72,72,0.1); -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 rgba(72,72,72,0.1); - box-shadow: -1px 0 0 rgba(72,72,72,0.1); -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #ffb866; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #ffb866; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #ffb866; - box-shadow: -10px 0 0 #ffb866; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #ffb866, 5px 0 0 #ffb866; - box-shadow: -5px 0 0 #ffb866, 5px 0 0 #ffb866; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid rgba(72,72,72,0.1); -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid rgba(72,72,72,0.1); -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/themes/dark.css b/app/static/vendors/flatpickr/themes/dark.css deleted file mode 100644 index e3518cc..0000000 --- a/app/static/vendors/flatpickr/themes/dark.css +++ /dev/null @@ -1,784 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - background: #3f4458; - -webkit-box-shadow: 1px 0 0 #20222c, -1px 0 0 #20222c, 0 1px 0 #20222c, 0 -1px 0 #20222c, 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 1px 0 0 #20222c, -1px 0 0 #20222c, 0 1px 0 #20222c, 0 -1px 0 #20222c, 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid #20222c; -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: #20222c; -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #3f4458; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: #20222c; -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #3f4458; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - background: #3f4458; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #eee; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(255,255,255,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(192,187,167,0.1); -} -.numInputWrapper span:active { - background: rgba(192,187,167,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(255,255,255,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(255,255,255,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(192,187,167,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(192,187,167,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #3f4458; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(192,187,167,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #3f4458; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: transparent; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #3f4458; - color: #fff; - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 #20222c; - box-shadow: -1px 0 0 #20222c; -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: rgba(255,255,255,0.95); - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #646c8c; - border-color: #646c8c; -} -.flatpickr-day.today { - border-color: #eee; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #eee; - background: #eee; - color: #3f4458; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #80cbc4; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #80cbc4; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #80cbc4; - box-shadow: -10px 0 0 #80cbc4; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #646c8c, 5px 0 0 #646c8c; - box-shadow: -5px 0 0 #646c8c, 5px 0 0 #646c8c; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(255,255,255,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(255,255,255,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #80cbc4, 5px 0 0 #80cbc4; - box-shadow: -5px 0 0 #80cbc4, 5px 0 0 #80cbc4; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - -webkit-box-shadow: 1px 0 0 #20222c; - box-shadow: 1px 0 0 #20222c; -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(255,255,255,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: rgba(255,255,255,0.95); -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: rgba(255,255,255,0.95); -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: rgba(255,255,255,0.95); - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: rgba(255,255,255,0.95); - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #6a7395; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/themes/light.css b/app/static/vendors/flatpickr/themes/light.css deleted file mode 100644 index da9e4a8..0000000 --- a/app/static/vendors/flatpickr/themes/light.css +++ /dev/null @@ -1,798 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid #eceef1; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid #eceef1; -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: #eceef1; -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #eceef1; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: #eceef1; -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #eceef1; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #eceef1; - color: #5a6171; - fill: #5a6171; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #5a6171; - fill: #5a6171; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(90,97,113,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #5a6171; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #5a6171; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(90,97,113,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #eceef1; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #eceef1; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #eceef1; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #eceef1; - color: #5a6171; - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid #eceef1; - border-right: 1px solid #eceef1; -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 #eceef1; - box-shadow: -1px 0 0 #eceef1; -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #ff5a5f; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #ff5a5f; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #ff5a5f; - box-shadow: -10px 0 0 #ff5a5f; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #ff5a5f, 5px 0 0 #ff5a5f; - box-shadow: -5px 0 0 #ff5a5f, 5px 0 0 #ff5a5f; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid #eceef1; -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid #eceef1; -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -span.flatpickr-day.selected { - font-weight: bold; -} diff --git a/app/static/vendors/flatpickr/themes/material_blue.css b/app/static/vendors/flatpickr/themes/material_blue.css deleted file mode 100644 index 5368deb..0000000 --- a/app/static/vendors/flatpickr/themes/material_blue.css +++ /dev/null @@ -1,795 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #42a5f5; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #42a5f5; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #42a5f5; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #42a5f5; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #42a5f5; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #42a5f5; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #42a5f5; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid rgba(72,72,72,0.2); - border-right: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 rgba(72,72,72,0.2); - box-shadow: -1px 0 0 rgba(72,72,72,0.2); -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #42a5f5; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #42a5f5; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #42a5f5; - box-shadow: -10px 0 0 #42a5f5; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #42a5f5, 5px 0 0 #42a5f5; - box-shadow: -5px 0 0 #42a5f5, 5px 0 0 #42a5f5; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/themes/material_green.css b/app/static/vendors/flatpickr/themes/material_green.css deleted file mode 100644 index f4719f2..0000000 --- a/app/static/vendors/flatpickr/themes/material_green.css +++ /dev/null @@ -1,795 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #1bbc9b; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #1bbc9b; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #1bbc9b; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #1bbc9b; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #1bbc9b; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #1bbc9b; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #1bbc9b; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid rgba(72,72,72,0.2); - border-right: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 rgba(72,72,72,0.2); - box-shadow: -1px 0 0 rgba(72,72,72,0.2); -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #1bbc9b; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #1bbc9b; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #1bbc9b; - box-shadow: -10px 0 0 #1bbc9b; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #1bbc9b, 5px 0 0 #1bbc9b; - box-shadow: -5px 0 0 #1bbc9b, 5px 0 0 #1bbc9b; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/themes/material_orange.css b/app/static/vendors/flatpickr/themes/material_orange.css deleted file mode 100644 index 8ee7d2b..0000000 --- a/app/static/vendors/flatpickr/themes/material_orange.css +++ /dev/null @@ -1,795 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #ff8a65; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #ff8a65; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #ff8a65; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #ff8a65; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #ff8a65; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #ff8a65; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #ff8a65; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid rgba(72,72,72,0.2); - border-right: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 rgba(72,72,72,0.2); - box-shadow: -1px 0 0 rgba(72,72,72,0.2); -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #ff8a65; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #ff8a65; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #ff8a65; - box-shadow: -10px 0 0 #ff8a65; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #ff8a65, 5px 0 0 #ff8a65; - box-shadow: -5px 0 0 #ff8a65, 5px 0 0 #ff8a65; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/themes/material_red.css b/app/static/vendors/flatpickr/themes/material_red.css deleted file mode 100644 index 159c6a6..0000000 --- a/app/static/vendors/flatpickr/themes/material_red.css +++ /dev/null @@ -1,795 +0,0 @@ -.flatpickr-calendar { - background: transparent; - opacity: 0; - display: none; - text-align: center; - visibility: hidden; - padding: 0; - -webkit-animation: none; - animation: none; - direction: ltr; - border: 0; - font-size: 14px; - line-height: 24px; - border-radius: 5px; - position: absolute; - width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -ms-touch-action: manipulation; - touch-action: manipulation; - -webkit-box-shadow: 0 3px 13px rgba(0,0,0,0.08); - box-shadow: 0 3px 13px rgba(0,0,0,0.08); -} -.flatpickr-calendar.open, -.flatpickr-calendar.inline { - opacity: 1; - max-height: 640px; - visibility: visible; -} -.flatpickr-calendar.open { - display: inline-block; - z-index: 99999; -} -.flatpickr-calendar.animate.open { - -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); - animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1); -} -.flatpickr-calendar.inline { - display: block; - position: relative; - top: 2px; -} -.flatpickr-calendar.static { - position: absolute; - top: calc(100% + 2px); -} -.flatpickr-calendar.static.open { - z-index: 999; - display: block; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) { - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) { - -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; - box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; -} -.flatpickr-calendar .hasWeeks .dayContainer, -.flatpickr-calendar .hasTime .dayContainer { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.flatpickr-calendar .hasWeeks .dayContainer { - border-left: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - height: 40px; - border-top: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer { - border-bottom: 0; -} -.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time { - border: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-calendar.noCalendar.hasTime .flatpickr-time { - height: auto; -} -.flatpickr-calendar:before, -.flatpickr-calendar:after { - position: absolute; - display: block; - pointer-events: none; - border: solid transparent; - content: ''; - height: 0; - width: 0; - left: 22px; -} -.flatpickr-calendar.rightMost:before, -.flatpickr-calendar.rightMost:after { - left: auto; - right: 22px; -} -.flatpickr-calendar:before { - border-width: 5px; - margin: 0 -5px; -} -.flatpickr-calendar:after { - border-width: 4px; - margin: 0 -4px; -} -.flatpickr-calendar.arrowTop:before, -.flatpickr-calendar.arrowTop:after { - bottom: 100%; -} -.flatpickr-calendar.arrowTop:before { - border-bottom-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowTop:after { - border-bottom-color: #ef5350; -} -.flatpickr-calendar.arrowBottom:before, -.flatpickr-calendar.arrowBottom:after { - top: 100%; -} -.flatpickr-calendar.arrowBottom:before { - border-top-color: rgba(72,72,72,0.2); -} -.flatpickr-calendar.arrowBottom:after { - border-top-color: #ef5350; -} -.flatpickr-calendar:focus { - outline: 0; -} -.flatpickr-wrapper { - position: relative; - display: inline-block; -} -.flatpickr-months { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} -.flatpickr-months .flatpickr-month { - border-radius: 5px 5px 0 0; - background: #ef5350; - color: #fff; - fill: #fff; - height: 34px; - line-height: 1; - text-align: center; - position: relative; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flatpickr-months .flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month { - text-decoration: none; - cursor: pointer; - position: absolute; - top: 0; - height: 34px; - padding: 10px; - z-index: 3; - color: #fff; - fill: #fff; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-disabled, -.flatpickr-months .flatpickr-next-month.flatpickr-disabled { - display: none; -} -.flatpickr-months .flatpickr-prev-month i, -.flatpickr-months .flatpickr-next-month i { - position: relative; -} -.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, -.flatpickr-months .flatpickr-next-month.flatpickr-prev-month { -/* - /*rtl:begin:ignore*/ -/* - */ - left: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, -.flatpickr-months .flatpickr-next-month.flatpickr-next-month { -/* - /*rtl:begin:ignore*/ -/* - */ - right: 0; -/* - /*rtl:end:ignore*/ -/* - */ -} -/* - /*rtl:begin:ignore*/ -/* - /*rtl:end:ignore*/ -.flatpickr-months .flatpickr-prev-month:hover, -.flatpickr-months .flatpickr-next-month:hover { - color: #bbb; -} -.flatpickr-months .flatpickr-prev-month:hover svg, -.flatpickr-months .flatpickr-next-month:hover svg { - fill: #f64747; -} -.flatpickr-months .flatpickr-prev-month svg, -.flatpickr-months .flatpickr-next-month svg { - width: 14px; - height: 14px; -} -.flatpickr-months .flatpickr-prev-month svg path, -.flatpickr-months .flatpickr-next-month svg path { - -webkit-transition: fill 0.1s; - transition: fill 0.1s; - fill: inherit; -} -.numInputWrapper { - position: relative; - height: auto; -} -.numInputWrapper input, -.numInputWrapper span { - display: inline-block; -} -.numInputWrapper input { - width: 100%; -} -.numInputWrapper input::-ms-clear { - display: none; -} -.numInputWrapper input::-webkit-outer-spin-button, -.numInputWrapper input::-webkit-inner-spin-button { - margin: 0; - -webkit-appearance: none; -} -.numInputWrapper span { - position: absolute; - right: 0; - width: 14px; - padding: 0 4px 0 2px; - height: 50%; - line-height: 50%; - opacity: 0; - cursor: pointer; - border: 1px solid rgba(72,72,72,0.15); - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.numInputWrapper span:hover { - background: rgba(0,0,0,0.1); -} -.numInputWrapper span:active { - background: rgba(0,0,0,0.2); -} -.numInputWrapper span:after { - display: block; - content: ""; - position: absolute; -} -.numInputWrapper span.arrowUp { - top: 0; - border-bottom: 0; -} -.numInputWrapper span.arrowUp:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 4px solid rgba(72,72,72,0.6); - top: 26%; -} -.numInputWrapper span.arrowDown { - top: 50%; -} -.numInputWrapper span.arrowDown:after { - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid rgba(72,72,72,0.6); - top: 40%; -} -.numInputWrapper span svg { - width: inherit; - height: auto; -} -.numInputWrapper span svg path { - fill: rgba(255,255,255,0.5); -} -.numInputWrapper:hover { - background: rgba(0,0,0,0.05); -} -.numInputWrapper:hover span { - opacity: 1; -} -.flatpickr-current-month { - font-size: 135%; - line-height: inherit; - font-weight: 300; - color: inherit; - position: absolute; - width: 75%; - left: 12.5%; - padding: 7.48px 0 0 0; - line-height: 1; - height: 34px; - display: inline-block; - text-align: center; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); -} -.flatpickr-current-month span.cur-month { - font-family: inherit; - font-weight: 700; - color: inherit; - display: inline-block; - margin-left: 0.5ch; - padding: 0; -} -.flatpickr-current-month span.cur-month:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .numInputWrapper { - width: 6ch; - width: 7ch\0; - display: inline-block; -} -.flatpickr-current-month .numInputWrapper span.arrowUp:after { - border-bottom-color: #fff; -} -.flatpickr-current-month .numInputWrapper span.arrowDown:after { - border-top-color: #fff; -} -.flatpickr-current-month input.cur-year { - background: transparent; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: inherit; - cursor: text; - padding: 0 0 0 0.5ch; - margin: 0; - display: inline-block; - font-size: inherit; - font-family: inherit; - font-weight: 300; - line-height: inherit; - height: auto; - border: 0; - border-radius: 0; - vertical-align: initial; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-current-month input.cur-year:focus { - outline: 0; -} -.flatpickr-current-month input.cur-year[disabled], -.flatpickr-current-month input.cur-year[disabled]:hover { - font-size: 100%; - color: rgba(255,255,255,0.5); - background: transparent; - pointer-events: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months { - appearance: menulist; - background: #ef5350; - border: none; - border-radius: 0; - box-sizing: border-box; - color: inherit; - cursor: pointer; - font-size: inherit; - font-family: inherit; - font-weight: 300; - height: auto; - line-height: inherit; - margin: -1px 0 0 0; - outline: none; - padding: 0 0 0 0.5ch; - position: relative; - vertical-align: initial; - -webkit-box-sizing: border-box; - -webkit-appearance: menulist; - -moz-appearance: menulist; - width: auto; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:focus, -.flatpickr-current-month .flatpickr-monthDropdown-months:active { - outline: none; -} -.flatpickr-current-month .flatpickr-monthDropdown-months:hover { - background: rgba(0,0,0,0.05); -} -.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { - background-color: #ef5350; - outline: none; - padding: 0; -} -.flatpickr-weekdays { - background: #ef5350; - text-align: center; - overflow: hidden; - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - height: 28px; -} -.flatpickr-weekdays .flatpickr-weekdaycontainer { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -span.flatpickr-weekday { - cursor: default; - font-size: 90%; - background: #ef5350; - color: rgba(0,0,0,0.54); - line-height: 1; - margin: 0; - text-align: center; - display: block; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-weight: bolder; -} -.dayContainer, -.flatpickr-weeks { - padding: 1px 0 0 0; -} -.flatpickr-days { - position: relative; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-align: start; - -webkit-align-items: flex-start; - -ms-flex-align: start; - align-items: flex-start; - width: 307.875px; - border-left: 1px solid rgba(72,72,72,0.2); - border-right: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-days:focus { - outline: 0; -} -.dayContainer { - padding: 0; - outline: 0; - text-align: left; - width: 307.875px; - min-width: 307.875px; - max-width: 307.875px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - display: inline-block; - display: -ms-flexbox; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - -ms-flex-wrap: wrap; - -ms-flex-pack: justify; - -webkit-justify-content: space-around; - justify-content: space-around; - -webkit-transform: translate3d(0px, 0px, 0px); - transform: translate3d(0px, 0px, 0px); - opacity: 1; -} -.dayContainer + .dayContainer { - -webkit-box-shadow: -1px 0 0 rgba(72,72,72,0.2); - box-shadow: -1px 0 0 rgba(72,72,72,0.2); -} -.flatpickr-day { - background: none; - border: 1px solid transparent; - border-radius: 150px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: #484848; - cursor: pointer; - font-weight: 400; - width: 14.2857143%; - -webkit-flex-basis: 14.2857143%; - -ms-flex-preferred-size: 14.2857143%; - flex-basis: 14.2857143%; - max-width: 39px; - height: 39px; - line-height: 39px; - margin: 0; - display: inline-block; - position: relative; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; -} -.flatpickr-day.inRange, -.flatpickr-day.prevMonthDay.inRange, -.flatpickr-day.nextMonthDay.inRange, -.flatpickr-day.today.inRange, -.flatpickr-day.prevMonthDay.today.inRange, -.flatpickr-day.nextMonthDay.today.inRange, -.flatpickr-day:hover, -.flatpickr-day.prevMonthDay:hover, -.flatpickr-day.nextMonthDay:hover, -.flatpickr-day:focus, -.flatpickr-day.prevMonthDay:focus, -.flatpickr-day.nextMonthDay:focus { - cursor: pointer; - outline: 0; - background: #e2e2e2; - border-color: #e2e2e2; -} -.flatpickr-day.today { - border-color: #bbb; -} -.flatpickr-day.today:hover, -.flatpickr-day.today:focus { - border-color: #bbb; - background: #bbb; - color: #fff; -} -.flatpickr-day.selected, -.flatpickr-day.startRange, -.flatpickr-day.endRange, -.flatpickr-day.selected.inRange, -.flatpickr-day.startRange.inRange, -.flatpickr-day.endRange.inRange, -.flatpickr-day.selected:focus, -.flatpickr-day.startRange:focus, -.flatpickr-day.endRange:focus, -.flatpickr-day.selected:hover, -.flatpickr-day.startRange:hover, -.flatpickr-day.endRange:hover, -.flatpickr-day.selected.prevMonthDay, -.flatpickr-day.startRange.prevMonthDay, -.flatpickr-day.endRange.prevMonthDay, -.flatpickr-day.selected.nextMonthDay, -.flatpickr-day.startRange.nextMonthDay, -.flatpickr-day.endRange.nextMonthDay { - background: #ef5350; - -webkit-box-shadow: none; - box-shadow: none; - color: #fff; - border-color: #ef5350; -} -.flatpickr-day.selected.startRange, -.flatpickr-day.startRange.startRange, -.flatpickr-day.endRange.startRange { - border-radius: 50px 0 0 50px; -} -.flatpickr-day.selected.endRange, -.flatpickr-day.startRange.endRange, -.flatpickr-day.endRange.endRange { - border-radius: 0 50px 50px 0; -} -.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), -.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { - -webkit-box-shadow: -10px 0 0 #ef5350; - box-shadow: -10px 0 0 #ef5350; -} -.flatpickr-day.selected.startRange.endRange, -.flatpickr-day.startRange.startRange.endRange, -.flatpickr-day.endRange.startRange.endRange { - border-radius: 50px; -} -.flatpickr-day.inRange { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; - box-shadow: -5px 0 0 #e2e2e2, 5px 0 0 #e2e2e2; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover, -.flatpickr-day.prevMonthDay, -.flatpickr-day.nextMonthDay, -.flatpickr-day.notAllowed, -.flatpickr-day.notAllowed.prevMonthDay, -.flatpickr-day.notAllowed.nextMonthDay { - color: rgba(72,72,72,0.3); - background: transparent; - border-color: transparent; - cursor: default; -} -.flatpickr-day.flatpickr-disabled, -.flatpickr-day.flatpickr-disabled:hover { - cursor: not-allowed; - color: rgba(72,72,72,0.1); -} -.flatpickr-day.week.selected { - border-radius: 0; - -webkit-box-shadow: -5px 0 0 #ef5350, 5px 0 0 #ef5350; - box-shadow: -5px 0 0 #ef5350, 5px 0 0 #ef5350; -} -.flatpickr-day.hidden { - visibility: hidden; -} -.rangeMode .flatpickr-day { - margin-top: 1px; -} -.flatpickr-weekwrapper { - float: left; -} -.flatpickr-weekwrapper .flatpickr-weeks { - padding: 0 12px; - border-left: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-weekwrapper .flatpickr-weekday { - float: none; - width: 100%; - line-height: 28px; -} -.flatpickr-weekwrapper span.flatpickr-day, -.flatpickr-weekwrapper span.flatpickr-day:hover { - display: block; - width: 100%; - max-width: none; - color: rgba(72,72,72,0.3); - background: transparent; - cursor: default; - border: none; -} -.flatpickr-innerContainer { - display: block; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - background: #fff; - border-bottom: 1px solid rgba(72,72,72,0.2); -} -.flatpickr-rContainer { - display: inline-block; - padding: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.flatpickr-time { - text-align: center; - outline: 0; - display: block; - height: 0; - line-height: 40px; - max-height: 40px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: #fff; - border-radius: 0 0 5px 5px; -} -.flatpickr-time:after { - content: ""; - display: table; - clear: both; -} -.flatpickr-time .numInputWrapper { - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 40%; - height: 40px; - float: left; -} -.flatpickr-time .numInputWrapper span.arrowUp:after { - border-bottom-color: #484848; -} -.flatpickr-time .numInputWrapper span.arrowDown:after { - border-top-color: #484848; -} -.flatpickr-time.hasSeconds .numInputWrapper { - width: 26%; -} -.flatpickr-time.time24hr .numInputWrapper { - width: 49%; -} -.flatpickr-time input { - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: 0; - border-radius: 0; - text-align: center; - margin: 0; - padding: 0; - height: inherit; - line-height: inherit; - color: #484848; - font-size: 14px; - position: relative; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -webkit-appearance: textfield; - -moz-appearance: textfield; - appearance: textfield; -} -.flatpickr-time input.flatpickr-hour { - font-weight: bold; -} -.flatpickr-time input.flatpickr-minute, -.flatpickr-time input.flatpickr-second { - font-weight: 400; -} -.flatpickr-time input:focus { - outline: 0; - border: 0; -} -.flatpickr-time .flatpickr-time-separator, -.flatpickr-time .flatpickr-am-pm { - height: inherit; - float: left; - line-height: inherit; - color: #484848; - font-weight: bold; - width: 2%; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; -} -.flatpickr-time .flatpickr-am-pm { - outline: 0; - width: 18%; - cursor: pointer; - text-align: center; - font-weight: 400; -} -.flatpickr-time input:hover, -.flatpickr-time .flatpickr-am-pm:hover, -.flatpickr-time input:focus, -.flatpickr-time .flatpickr-am-pm:focus { - background: #eaeaea; -} -.flatpickr-input[readonly] { - cursor: pointer; -} -@-webkit-keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -@keyframes fpFadeInDown { - from { - opacity: 0; - -webkit-transform: translate3d(0, -20px, 0); - transform: translate3d(0, -20px, 0); - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} diff --git a/app/static/vendors/flatpickr/types/globals.d.ts b/app/static/vendors/flatpickr/types/globals.d.ts deleted file mode 100644 index a36e45b..0000000 --- a/app/static/vendors/flatpickr/types/globals.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Options } from "./options"; -import { Instance, FlatpickrFn } from "./instance"; -declare global { - interface HTMLElement { - flatpickr: (config?: Options) => Instance; - _flatpickr?: Instance; - } - interface NodeList { - flatpickr: (config?: Options) => Instance | Instance[]; - } - interface HTMLCollection { - flatpickr: (config?: Options) => Instance | Instance[]; - } - interface Window { - flatpickr: FlatpickrFn; - } - interface Date { - fp_incr: (n: number) => Date; - } -} diff --git a/app/static/vendors/flatpickr/types/instance.d.ts b/app/static/vendors/flatpickr/types/instance.d.ts deleted file mode 100644 index 2a93500..0000000 --- a/app/static/vendors/flatpickr/types/instance.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { DateOption, Options, ParsedOptions } from "./options"; -import { Locale, CustomLocale, key as LocaleKey } from "./locale"; -import { RevFormat, Formats, TokenRegex } from "../utils/formatting"; -export interface Elements { - element: HTMLElement; - input: HTMLInputElement; - altInput?: HTMLInputElement; - _input: HTMLInputElement; - mobileInput?: HTMLInputElement; - mobileFormatStr?: string; - selectedDateElem?: DayElement; - todayDateElem?: DayElement; - _positionElement: HTMLElement; - weekdayContainer: HTMLDivElement; - calendarContainer: HTMLDivElement; - innerContainer?: HTMLDivElement; - rContainer?: HTMLDivElement; - daysContainer?: HTMLDivElement; - days: HTMLDivElement; - weekWrapper?: HTMLDivElement; - weekNumbers?: HTMLDivElement; - monthNav: HTMLDivElement; - monthsDropdownContainer: HTMLSelectElement; - yearElements: HTMLInputElement[]; - monthElements: HTMLSpanElement[]; - currentYearElement: HTMLInputElement; - currentMonthElement: HTMLSpanElement; - _hidePrevMonthArrow: boolean; - _hideNextMonthArrow: boolean; - prevMonthNav: HTMLElement; - nextMonthNav: HTMLElement; - timeContainer?: HTMLDivElement; - hourElement?: HTMLInputElement; - minuteElement?: HTMLInputElement; - secondElement?: HTMLInputElement; - amPM?: HTMLSpanElement; - pluginElements: Node[]; -} -export interface Formatting { - revFormat: RevFormat; - formats: Formats; - tokenRegex: TokenRegex; -} -export declare type Instance = Elements & Formatting & { - minRangeDate?: Date; - maxRangeDate?: Date; - now: Date; - latestSelectedDateObj?: Date; - _selectedDateObj?: Date; - selectedDates: Date[]; - _initialDate: Date; - config: ParsedOptions; - loadedPlugins: string[]; - l10n: Locale; - currentYear: number; - currentMonth: number; - isOpen: boolean; - isMobile: boolean; - minDateHasTime: boolean; - maxDateHasTime: boolean; - showTimeInput: boolean; - _showTimeInput: boolean; - changeMonth: (value: number, isOffset?: boolean, fromKeyboard?: boolean) => void; - changeYear: (year: number) => void; - clear: (emitChangeEvent?: boolean, toInitial?: boolean) => void; - close: () => void; - destroy: () => void; - isEnabled: (date: DateOption, timeless?: boolean) => boolean; - jumpToDate: (date?: DateOption, triggerChange?: boolean) => void; - open: (e?: FocusEvent | MouseEvent, positionElement?: HTMLElement) => void; - redraw: () => void; - set: (option: keyof Options | { - [k in keyof Options]?: Options[k]; - }, value?: any) => void; - setDate: (date: DateOption | DateOption[], triggerChange?: boolean, format?: string) => void; - toggle: () => void; - pad: (num: string | number) => string; - parseDate: (date: Date | string | number, givenFormat?: string, timeless?: boolean) => Date | undefined; - formatDate: (dateObj: Date, frmt: string) => string; - _handlers: { - event: string; - element: Element; - handler: (e?: Event) => void; - options?: { - capture?: boolean; - }; - }[]; - _bind: (element: E | E[], event: string | string[], handler: (e?: any) => void) => void; - _createElement: (tag: keyof HTMLElementTagNameMap, className: string, content?: string) => E; - _setHoursFromDate: (date: Date) => void; - _debouncedChange: () => void; - __hideNextMonthArrow: boolean; - __hidePrevMonthArrow: boolean; - _positionCalendar: (customPositionElement?: HTMLElement) => void; - utils: { - getDaysInMonth: (month?: number, year?: number) => number; - }; -}; -export interface FlatpickrFn { - (selector: Node, config?: Options): Instance; - (selector: ArrayLike, config?: Options): Instance[]; - (selector: string, config?: Options): Instance | Instance[]; - defaultConfig: Partial; - l10ns: { - [k in LocaleKey]?: CustomLocale; - } & { - default: Locale; - }; - localize: (l10n: CustomLocale) => void; - setDefaults: (config: Options) => void; - parseDate: (date: DateOption, format?: string, timeless?: boolean) => Date | undefined; - formatDate: (date: Date, format: string) => string; - compareDates: (date1: Date, date2: Date, timeless?: boolean) => number; -} -export declare type DayElement = HTMLSpanElement & { - dateObj: Date; - $i: number; -}; diff --git a/app/static/vendors/flatpickr/types/locale.d.ts b/app/static/vendors/flatpickr/types/locale.d.ts deleted file mode 100644 index 75a6606..0000000 --- a/app/static/vendors/flatpickr/types/locale.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -export declare type Locale = { - weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; - months: { - shorthand: [string, string, string, string, string, string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string, string, string, string, string, string]; - }; - daysInMonth: [number, number, number, number, number, number, number, number, number, number, number, number]; - firstDayOfWeek: number; - ordinal: (nth: number) => string; - rangeSeparator: string; - weekAbbreviation: string; - scrollTitle: string; - toggleTitle: string; - amPM: [string, string]; - yearAriaLabel: string; - hourAriaLabel: string; - minuteAriaLabel: string; - time_24hr: boolean; -}; -export declare type CustomLocale = { - ordinal?: Locale["ordinal"]; - daysInMonth?: Locale["daysInMonth"]; - firstDayOfWeek?: Locale["firstDayOfWeek"]; - rangeSeparator?: Locale["rangeSeparator"]; - weekAbbreviation?: Locale["weekAbbreviation"]; - toggleTitle?: Locale["toggleTitle"]; - scrollTitle?: Locale["scrollTitle"]; - yearAriaLabel?: string; - hourAriaLabel?: string; - minuteAriaLabel?: string; - amPM?: Locale["amPM"]; - time_24hr?: Locale["time_24hr"]; - weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; - months: { - shorthand: [string, string, string, string, string, string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string, string, string, string, string, string]; - }; -}; -export declare type key = "ar" | "at" | "az" | "be" | "bg" | "bn" | "bs" | "cat" | "cs" | "cy" | "da" | "de" | "default" | "en" | "eo" | "es" | "et" | "fa" | "fi" | "fo" | "fr" | "gr" | "he" | "hi" | "hr" | "hu" | "id" | "is" | "it" | "ja" | "ka" | "ko" | "km" | "kz" | "lt" | "lv" | "mk" | "mn" | "ms" | "my" | "nl" | "no" | "pa" | "pl" | "pt" | "ro" | "ru" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "th" | "tr" | "uk" | "vn" | "zh" | "zh_tw" | "lu"; diff --git a/app/static/vendors/flatpickr/types/options.d.ts b/app/static/vendors/flatpickr/types/options.d.ts deleted file mode 100644 index 45f52dc..0000000 --- a/app/static/vendors/flatpickr/types/options.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { Instance } from "./instance"; -import { CustomLocale, key as LocaleKey, Locale } from "./locale"; -export declare type DateOption = Date | string | number; -export declare type DateRangeLimit = { - from: D; - to: D; -}; -export declare type DateLimit = D | DateRangeLimit | ((date: Date) => boolean); -export declare type Hook = (dates: Date[], currentDateString: string, self: Instance, data?: any) => void; -export declare type HookKey = "onChange" | "onClose" | "onDayCreate" | "onDestroy" | "onKeyDown" | "onMonthChange" | "onOpen" | "onParseConfig" | "onReady" | "onValueUpdate" | "onYearChange" | "onPreCalendarPosition"; -export declare const HOOKS: HookKey[]; -export declare type Plugin = (fp: Instance & E) => Options; -export interface BaseOptions { - allowInput: boolean; - altFormat: string; - altInput: boolean; - altInputClass: string; - animate: boolean; - appendTo: HTMLElement; - ariaDateFormat: string; - clickOpens: boolean; - closeOnSelect: boolean; - conjunction: string; - dateFormat: string; - defaultDate: DateOption | DateOption[]; - defaultHour: number; - defaultMinute: number; - defaultSeconds: number; - disable: DateLimit[]; - disableMobile: boolean; - enable: DateLimit[]; - enableSeconds: boolean; - enableTime: boolean; - errorHandler: (e: Error) => void; - formatDate: (date: Date, format: string, locale: Locale) => string; - getWeek: (date: Date) => string | number; - hourIncrement: number; - ignoredFocusElements: HTMLElement[]; - inline: boolean; - locale: LocaleKey | CustomLocale; - maxDate: DateOption; - maxTime: DateOption; - minDate: DateOption; - minTime: DateOption; - minuteIncrement: number; - mode: "single" | "multiple" | "range" | "time"; - monthSelectorType: "dropdown" | "static"; - nextArrow: string; - noCalendar: boolean; - now?: DateOption; - onChange: Hook | Hook[]; - onClose: Hook | Hook[]; - onDayCreate: Hook | Hook[]; - onDestroy: Hook | Hook[]; - onKeyDown: Hook | Hook[]; - onMonthChange: Hook | Hook[]; - onOpen: Hook | Hook[]; - onParseConfig: Hook | Hook[]; - onReady: Hook | Hook[]; - onValueUpdate: Hook | Hook[]; - onYearChange: Hook | Hook[]; - onPreCalendarPosition: Hook | Hook[]; - parseDate: (date: string, format: string) => Date; - plugins: Plugin[]; - position: "auto" | "above" | "below"; - positionElement: Element; - prevArrow: string; - shorthandCurrentMonth: boolean; - static: boolean; - showMonths?: number; - time_24hr: boolean; - weekNumbers: boolean; - wrap: boolean; -} -export declare type Options = Partial; -export interface ParsedOptions { - _disable: DateLimit[]; - _enable: DateLimit[]; - _maxDate?: Date; - _maxTime?: Date; - _minDate?: Date; - _minTime?: Date; - allowInput: boolean; - altFormat: string; - altInput: boolean; - altInputClass: string; - animate: boolean; - appendTo?: HTMLElement; - ariaDateFormat: string; - clickOpens: boolean; - closeOnSelect: boolean; - conjunction: string; - dateFormat: string; - defaultDate?: Date | Date[]; - defaultHour: number; - defaultMinute: number; - defaultSeconds: number; - disable: DateLimit[]; - disableMobile: boolean; - enable: DateLimit[]; - enableSeconds: boolean; - enableTime: boolean; - errorHandler: (err: Error) => void; - formatDate?: Options["formatDate"]; - getWeek: (date: Date) => string | number; - hourIncrement: number; - ignoredFocusElements: HTMLElement[]; - inline: boolean; - locale: LocaleKey | CustomLocale; - maxDate?: Date; - maxTime?: Date; - minDate?: Date; - minTime?: Date; - minuteIncrement: number; - mode: BaseOptions["mode"]; - monthSelectorType: string; - nextArrow: string; - noCalendar: boolean; - now: Date; - onChange: Hook[]; - onClose: Hook[]; - onDayCreate: Hook[]; - onDestroy: Hook[]; - onKeyDown: Hook[]; - onMonthChange: Hook[]; - onOpen: Hook[]; - onParseConfig: Hook[]; - onReady: Hook[]; - onValueUpdate: Hook[]; - onYearChange: Hook[]; - onPreCalendarPosition: Hook[]; - parseDate?: BaseOptions["parseDate"]; - plugins: Plugin[]; - position: BaseOptions["position"]; - positionElement?: HTMLElement; - prevArrow: string; - shorthandCurrentMonth: boolean; - showMonths: number; - static: boolean; - time_24hr: boolean; - weekNumbers: boolean; - wrap: boolean; -} -export declare const defaults: ParsedOptions; diff --git a/app/static/vendors/flatpickr/typings.d.ts b/app/static/vendors/flatpickr/typings.d.ts deleted file mode 100644 index fb32d88..0000000 --- a/app/static/vendors/flatpickr/typings.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { FlatpickrFn } from "./types/instance"; -import { Instance as _Instance } from "./types/instance"; -import { - Options as _Options, - Hook as _Hook, - HookKey as _HookKey, - ParsedOptions as _ParsedOptions, - DateLimit as _DateLimit, - DateOption as _DateOption, - DateRangeLimit as _DateRangeLimit, - Plugin as _Plugin, -} from "./types/options"; - -import { - Locale as _Locale, - CustomLocale as _CustomLocale, -} from "./types/locale"; - -declare var flatpickr: FlatpickrFn; - -declare namespace flatpickr { - export type Instance = _Instance; - export type CustomLocale = _CustomLocale; - export type Locale = _Locale; - - export namespace Options { - export type Options = _Options; - export type Hook = _Hook; - export type HookKey = _HookKey; - export type ParsedOptions = _ParsedOptions; - export type DateLimit = _DateLimit; - export type DateOption = _DateOption; - export type DateRangeLimit = _DateRangeLimit; - export type Plugin = _Plugin; - } -} - -export default flatpickr; diff --git a/app/static/vendors/flatpickr/utils/dates.d.ts b/app/static/vendors/flatpickr/utils/dates.d.ts deleted file mode 100644 index 962ff6c..0000000 --- a/app/static/vendors/flatpickr/utils/dates.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Locale } from "../types/locale"; -import { ParsedOptions } from "../types/options"; -export interface FormatterArgs { - config?: ParsedOptions; - l10n?: Locale; -} -export declare const createDateFormatter: ({ config, l10n, }: FormatterArgs) => (dateObj: Date, frmt: string, overrideLocale?: Locale | undefined) => string; -export declare const createDateParser: ({ config, l10n }: { - config?: ParsedOptions | undefined; - l10n?: Locale | undefined; -}) => (date: string | number | Date, givenFormat?: string | undefined, timeless?: boolean | undefined, customLocale?: Locale | undefined) => Date | undefined; -export declare function compareDates(date1: Date, date2: Date, timeless?: boolean): number; -export declare function compareTimes(date1: Date, date2: Date): number; -export declare const isBetween: (ts: number, ts1: number, ts2: number) => boolean; -export declare const duration: { - DAY: number; -}; diff --git a/app/static/vendors/flatpickr/utils/dom.d.ts b/app/static/vendors/flatpickr/utils/dom.d.ts deleted file mode 100644 index b15f309..0000000 --- a/app/static/vendors/flatpickr/utils/dom.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function toggleClass(elem: HTMLElement, className: string, bool: boolean): void; -export declare function createElement(tag: keyof HTMLElementTagNameMap, className: string, content?: string): T; -export declare function clearNode(node: HTMLElement): void; -export declare function findParent(node: Element, condition: (n: Element) => boolean): Element | undefined; -export declare function createNumberInput(inputClassName: string, opts?: Record): HTMLDivElement; -export declare function getEventTarget(event: Event): EventTarget | null; diff --git a/app/static/vendors/flatpickr/utils/formatting.d.ts b/app/static/vendors/flatpickr/utils/formatting.d.ts deleted file mode 100644 index b430324..0000000 --- a/app/static/vendors/flatpickr/utils/formatting.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Locale } from "../types/locale"; -import { ParsedOptions } from "../types/options"; -export declare type token = "D" | "F" | "G" | "H" | "J" | "K" | "M" | "S" | "U" | "W" | "Y" | "Z" | "d" | "h" | "i" | "j" | "l" | "m" | "n" | "s" | "u" | "w" | "y"; -export declare const monthToStr: (monthNumber: number, shorthand: boolean, locale: Locale) => string; -export declare type RevFormatFn = (date: Date, data: string, locale: Locale) => Date | void | undefined; -export declare type RevFormat = Record; -export declare const revFormat: RevFormat; -export declare type TokenRegex = { - [k in token]: string; -}; -export declare const tokenRegex: TokenRegex; -export declare type Formats = Record string | number>; -export declare const formats: Formats; diff --git a/app/static/vendors/flatpickr/utils/index.d.ts b/app/static/vendors/flatpickr/utils/index.d.ts deleted file mode 100644 index 91adb42..0000000 --- a/app/static/vendors/flatpickr/utils/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const pad: (number: string | number) => string; -export declare const int: (bool: boolean) => 1 | 0; -export declare function debounce(func: F, wait: number, immediate?: boolean): (this: Function) => void; -export declare const arrayify: (obj: T | T[]) => T[]; -export declare type IncrementEvent = MouseEvent & { - delta: number; - type: "increment"; -}; diff --git a/app/static/vendors/flatpickr/utils/polyfills.d.ts b/app/static/vendors/flatpickr/utils/polyfills.d.ts deleted file mode 100644 index e69de29..0000000 diff --git a/app/static/vendors/moment/moment-with-locales.min.js b/app/static/vendors/moment/moment-with-locales.min.js deleted file mode 100644 index 02cd72b..0000000 --- a/app/static/vendors/moment/moment-with-locales.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):e.moment=a()}(this,function(){"use strict";var e,n;function l(){return e.apply(null,arguments)}function _(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e){return void 0===e}function m(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function M(e,a){var t,s=[];for(t=0;t>>0,s=0;sTe(e)?(d=e+1,_-Te(e)):(d=e,_),{year:d,dayOfYear:r}}function Ie(e,a,t){var s,n,d=Ne(e.year(),a,t),r=Math.floor((e.dayOfYear()-d-1)/7)+1;return r<1?s=r+Ce(n=e.year()-1,a,t):r>Ce(e.year(),a,t)?(s=r-Ce(e.year(),a,t),n=e.year()+1):(n=e.year(),s=r),{week:s,year:n}}function Ce(e,a,t){var s=Ne(e,a,t),n=Ne(e+1,a,t);return(Te(e)-s+n)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),A("week",5),A("isoWeek",5),ie("w",B),ie("ww",B,V),ie("W",B),ie("WW",B,V),Me(["w","ww","W","WW"],function(e,a,t,s){a[s.substr(0,1)]=g(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ie("d",B),ie("e",B),ie("E",B),ie("dd",function(e,a){return a.weekdaysMinRegex(e)}),ie("ddd",function(e,a){return a.weekdaysShortRegex(e)}),ie("dddd",function(e,a){return a.weekdaysRegex(e)}),Me(["dd","ddd","dddd"],function(e,a,t,s){var n=t._locale.weekdaysParse(e,s,t._strict);null!=n?a.d=n:Y(t).invalidWeekday=e}),Me(["d","e","E"],function(e,a,t,s){a[s]=g(e)});var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ue="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ve="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var Ke=re;var $e=re;var Ze=re;function Be(){function e(e,a){return a.length-e.length}var a,t,s,n,d,r=[],_=[],i=[],o=[];for(a=0;a<7;a++)t=c([2e3,1]).day(a),s=this.weekdaysMin(t,""),n=this.weekdaysShort(t,""),d=this.weekdays(t,""),r.push(s),_.push(n),i.push(d),o.push(s),o.push(n),o.push(d);for(r.sort(e),_.sort(e),i.sort(e),o.sort(e),a=0;a<7;a++)_[a]=me(_[a]),i[a]=me(i[a]),o[a]=me(o[a]);this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+_.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function qe(){return this.hours()%12||12}function Qe(e,a){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}function Xe(e,a){return a._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+qe.apply(this)+F(this.minutes(),2)}),I("hmmss",0,0,function(){return""+qe.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+F(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)}),Qe("a",!0),Qe("A",!1),P("hour","h"),A("hour",13),ie("a",Xe),ie("A",Xe),ie("H",B),ie("h",B),ie("k",B),ie("HH",B,V),ie("hh",B,V),ie("kk",B,V),ie("hmm",q),ie("hmmss",Q),ie("Hmm",q),ie("Hmmss",Q),le(["H","HH"],Ye),le(["k","kk"],function(e,a,t){var s=g(e);a[Ye]=24===s?0:s}),le(["a","A"],function(e,a,t){t._isPm=t._locale.isPM(e),t._meridiem=e}),le(["h","hh"],function(e,a,t){a[Ye]=g(e),Y(t).bigHour=!0}),le("hmm",function(e,a,t){var s=e.length-2;a[Ye]=g(e.substr(0,s)),a[ye]=g(e.substr(s)),Y(t).bigHour=!0}),le("hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[Ye]=g(e.substr(0,s)),a[ye]=g(e.substr(s,2)),a[fe]=g(e.substr(n)),Y(t).bigHour=!0}),le("Hmm",function(e,a,t){var s=e.length-2;a[Ye]=g(e.substr(0,s)),a[ye]=g(e.substr(s))}),le("Hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[Ye]=g(e.substr(0,s)),a[ye]=g(e.substr(s,2)),a[fe]=g(e.substr(n))});var ea,aa=He("Hours",!0),ta={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Pe,monthsShort:Oe,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Ve,weekdaysShort:Ue,meridiemParse:/[ap]\.?m?\.?/i},sa={},na={};function da(e){return e?e.toLowerCase().replace("_","-"):e}function ra(e){var a=null;if(!sa[e]&&"undefined"!=typeof module&&module&&module.exports)try{a=ea._abbr,require("./locale/"+e),_a(a)}catch(e){}return sa[e]}function _a(e,a){var t;return e&&((t=o(a)?oa(e):ia(e,a))?ea=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ea._abbr}function ia(e,a){if(null===a)return delete sa[e],null;var t,s=ta;if(a.abbr=e,null!=sa[e])H("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=sa[e]._config;else if(null!=a.parentLocale)if(null!=sa[a.parentLocale])s=sa[a.parentLocale]._config;else{if(null==(t=ra(a.parentLocale)))return na[a.parentLocale]||(na[a.parentLocale]=[]),na[a.parentLocale].push({name:e,config:a}),null;s=t._config}return sa[e]=new j(b(s,a)),na[e]&&na[e].forEach(function(e){ia(e.name,e.config)}),_a(e),sa[e]}function oa(e){var a;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ea;if(!_(e)){if(a=ra(e))return a;e=[e]}return function(e){for(var a,t,s,n,d=0;d=a&&r(n,t,!0)>=a-1)break;a--}d++}return ea}(e)}function ma(e){var a,t=e._a;return t&&-2===Y(e).overflow&&(a=t[Le]<0||11je(t[he],t[Le])?ce:t[Ye]<0||24Ce(t,d,r)?Y(e)._overflowWeeks=!0:null!=i?Y(e)._overflowWeekday=!0:(_=Re(t,s,n,d,r),e._a[he]=_.year,e._dayOfYear=_.dayOfYear)}(e),null!=e._dayOfYear&&(d=ua(e._a[he],s[he]),(e._dayOfYear>Te(d)||0===e._dayOfYear)&&(Y(e)._overflowDayOfYear=!0),t=Je(d,0,e._dayOfYear),e._a[Le]=t.getUTCMonth(),e._a[ce]=t.getUTCDate()),a=0;a<3&&null==e._a[a];++a)e._a[a]=r[a]=s[a];for(;a<7;a++)e._a[a]=r[a]=null==e._a[a]?2===a?1:0:e._a[a];24===e._a[Ye]&&0===e._a[ye]&&0===e._a[fe]&&0===e._a[ke]&&(e._nextDay=!0,e._a[Ye]=0),e._d=(e._useUTC?Je:function(e,a,t,s,n,d,r){var _=new Date(e,a,t,s,n,d,r);return e<100&&0<=e&&isFinite(_.getFullYear())&&_.setFullYear(e),_}).apply(null,r),n=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ye]=24),e._w&&void 0!==e._w.d&&e._w.d!==n&&(Y(e).weekdayMismatch=!0)}}var Ma=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ha=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,La=/Z|[+-]\d\d(?::?\d\d)?/,ca=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ya=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ya=/^\/?Date\((\-?\d+)/i;function fa(e){var a,t,s,n,d,r,_=e._i,i=Ma.exec(_)||ha.exec(_);if(i){for(Y(e).iso=!0,a=0,t=ca.length;at.valueOf():t.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},it.isLocal=function(){return!!this.isValid()&&!this._isUTC},it.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},it.isUtc=Na,it.isUTC=Na,it.zoneAbbr=function(){return this._isUTC?"UTC":""},it.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},it.dates=t("dates accessor is deprecated. Use date instead.",tt),it.months=t("months accessor is deprecated. Use month instead",Ee),it.years=t("years accessor is deprecated. Use year instead",ve),it.zone=t("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,a){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,a),this):-this.utcOffset()}),it.isDSTShifted=t("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e={};if(k(e,this),(e=wa(e))._a){var a=e._isUTC?c(e._a):Ha(e._a);this._isDSTShifted=this.isValid()&&0>>0,s=0;sDe(e)?(r=e+1,o-De(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null===t)return delete st[e],null;var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11Pe(n[me],n[_e])?ye:n[ge]<0||24Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;tn.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0 cBottom) { - container.scrollTop += (eBottom - cBottom); - } -} -exports.ensureElementInView = ensureElementInView; -function putContent(el, currentPosition, isOpen) { - var height = el.offsetHeight; - var rect = el.getBoundingClientRect(); - var elemTop = (isOpen ? rect.top : rect.top - height); - var elemBottom = (isOpen ? rect.bottom : rect.bottom + height); - if (elemTop <= 0) { - return 'below'; - } - if (elemBottom >= window.innerHeight) { - return 'above'; - } - return (isOpen ? currentPosition : 'below'); -} -exports.putContent = putContent; -function debounce(func, wait, immediate) { - if (wait === void 0) { wait = 100; } - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var context = self; - var later = function () { - timeout = null; - if (!immediate) { - func.apply(context, args); - } - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) { - func.apply(context, args); - } - }; -} -exports.debounce = debounce; -function isValueInArrayOfObjects(selected, key, value) { - if (!Array.isArray(selected)) { - return selected[key] === value; - } - for (var _i = 0, selected_1 = selected; _i < selected_1.length; _i++) { - var s = selected_1[_i]; - if (s && s[key] && s[key] === value) { - return true; - } - } - return false; -} -exports.isValueInArrayOfObjects = isValueInArrayOfObjects; -function highlight(str, search, className) { - var completedString = str; - var regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*" + originalTextFoundByRegex + ""); - return completedString; -} -exports.highlight = highlight; -function kebabCase(str) { - var result = str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, function (match) { return '-' + match.toLowerCase(); }); - return (str[0] === str[0].toUpperCase()) - ? result.substring(1) - : result; -} -exports.kebabCase = kebabCase; -(function () { - var w = window; - if (typeof w.CustomEvent === 'function') { - return; - } - function CustomEvent(event, params) { - params = params || { bubbles: false, cancelable: false, detail: undefined }; - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - } - CustomEvent.prototype = w.Event.prototype; - w.CustomEvent = CustomEvent; -})(); - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var Data = (function () { - function Data(info) { - this.contentOpen = false; - this.contentPosition = 'below'; - this.isOnChangeEnabled = true; - this.main = info.main; - this.searchValue = ''; - this.data = []; - this.filtered = null; - this.parseSelectData(); - this.setSelectedFromSelect(); - } - Data.prototype.newOption = function (info) { - return { - id: (info.id ? info.id : String(Math.floor(Math.random() * 100000000))), - value: (info.value ? info.value : ''), - text: (info.text ? info.text : ''), - innerHTML: (info.innerHTML ? info.innerHTML : ''), - selected: (info.selected ? info.selected : false), - display: (info.display !== undefined ? info.display : true), - disabled: (info.disabled ? info.disabled : false), - placeholder: (info.placeholder ? info.placeholder : false), - "class": (info["class"] ? info["class"] : undefined), - data: (info.data ? info.data : {}), - mandatory: (info.mandatory ? info.mandatory : false) - }; - }; - Data.prototype.add = function (data) { - this.data.push({ - id: String(Math.floor(Math.random() * 100000000)), - value: data.value, - text: data.text, - innerHTML: '', - selected: false, - display: true, - disabled: false, - placeholder: false, - "class": undefined, - mandatory: data.mandatory, - data: {} - }); - }; - Data.prototype.parseSelectData = function () { - this.data = []; - var nodes = this.main.select.element.childNodes; - for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { - var n = nodes_1[_i]; - if (n.nodeName === 'OPTGROUP') { - var node = n; - var optgroup = { - label: node.label, - options: [] - }; - var options = n.childNodes; - for (var _a = 0, options_1 = options; _a < options_1.length; _a++) { - var o = options_1[_a]; - if (o.nodeName === 'OPTION') { - var option = this.pullOptionData(o); - optgroup.options.push(option); - if (option.placeholder && option.text.trim() !== '') { - this.main.config.placeholderText = option.text; - } - } - } - this.data.push(optgroup); - } - else if (n.nodeName === 'OPTION') { - var option = this.pullOptionData(n); - this.data.push(option); - if (option.placeholder && option.text.trim() !== '') { - this.main.config.placeholderText = option.text; - } - } - } - }; - Data.prototype.pullOptionData = function (option) { - return { - id: (option.dataset ? option.dataset.id : false) || String(Math.floor(Math.random() * 100000000)), - value: option.value, - text: option.text, - innerHTML: option.innerHTML, - selected: option.selected, - disabled: option.disabled, - placeholder: option.dataset.placeholder === 'true', - "class": option.className, - style: option.style.cssText, - data: option.dataset, - mandatory: (option.dataset ? option.dataset.mandatory === 'true' : false) - }; - }; - Data.prototype.setSelectedFromSelect = function () { - if (this.main.config.isMultiple) { - var options = this.main.select.element.options; - var newSelected = []; - for (var _i = 0, options_2 = options; _i < options_2.length; _i++) { - var o = options_2[_i]; - if (o.selected) { - var newOption = this.getObjectFromData(o.value, 'value'); - if (newOption && newOption.id) { - newSelected.push(newOption.id); - } - } - } - this.setSelected(newSelected, 'id'); - } - else { - var element = this.main.select.element; - if (element.selectedIndex !== -1) { - var option = element.options[element.selectedIndex]; - var value = option.value; - this.setSelected(value, 'value'); - } - } - }; - Data.prototype.setSelected = function (value, type) { - if (type === void 0) { type = 'id'; } - for (var _i = 0, _a = this.data; _i < _a.length; _i++) { - var d = _a[_i]; - if (d.hasOwnProperty('label')) { - if (d.hasOwnProperty('options')) { - var options = d.options; - if (options) { - for (var _b = 0, options_3 = options; _b < options_3.length; _b++) { - var o = options_3[_b]; - if (o.placeholder) { - continue; - } - o.selected = this.shouldBeSelected(o, value, type); - } - } - } - } - else { - d.selected = this.shouldBeSelected(d, value, type); - } - } - }; - Data.prototype.shouldBeSelected = function (option, value, type) { - if (type === void 0) { type = 'id'; } - if (Array.isArray(value)) { - for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { - var v = value_1[_i]; - if (type in option && String(option[type]) === String(v)) { - return true; - } - } - } - else { - if (type in option && String(option[type]) === String(value)) { - return true; - } - } - return false; - }; - Data.prototype.getSelected = function () { - var value = { text: '', placeholder: this.main.config.placeholderText }; - var values = []; - for (var _i = 0, _a = this.data; _i < _a.length; _i++) { - var d = _a[_i]; - if (d.hasOwnProperty('label')) { - if (d.hasOwnProperty('options')) { - var options = d.options; - if (options) { - for (var _b = 0, options_4 = options; _b < options_4.length; _b++) { - var o = options_4[_b]; - if (o.selected) { - if (!this.main.config.isMultiple) { - value = o; - } - else { - values.push(o); - } - } - } - } - } - } - else { - if (d.selected) { - if (!this.main.config.isMultiple) { - value = d; - } - else { - values.push(d); - } - } - } - } - if (this.main.config.isMultiple) { - return values; - } - return value; - }; - Data.prototype.addToSelected = function (value, type) { - if (type === void 0) { type = 'id'; } - if (this.main.config.isMultiple) { - var values = []; - var selected = this.getSelected(); - if (Array.isArray(selected)) { - for (var _i = 0, selected_1 = selected; _i < selected_1.length; _i++) { - var s = selected_1[_i]; - values.push(s[type]); - } - } - values.push(value); - this.setSelected(values, type); - } - }; - Data.prototype.removeFromSelected = function (value, type) { - if (type === void 0) { type = 'id'; } - if (this.main.config.isMultiple) { - var values = []; - var selected = this.getSelected(); - for (var _i = 0, selected_2 = selected; _i < selected_2.length; _i++) { - var s = selected_2[_i]; - if (String(s[type]) !== String(value)) { - values.push(s[type]); - } - } - this.setSelected(values, type); - } - }; - Data.prototype.onDataChange = function () { - if (this.main.onChange && this.isOnChangeEnabled) { - this.main.onChange(JSON.parse(JSON.stringify(this.getSelected()))); - } - }; - Data.prototype.getObjectFromData = function (value, type) { - if (type === void 0) { type = 'id'; } - for (var _i = 0, _a = this.data; _i < _a.length; _i++) { - var d = _a[_i]; - if (type in d && String(d[type]) === String(value)) { - return d; - } - if (d.hasOwnProperty('options')) { - var optgroupObject = d; - if (optgroupObject.options) { - for (var _b = 0, _c = optgroupObject.options; _b < _c.length; _b++) { - var oo = _c[_b]; - if (String(oo[type]) === String(value)) { - return oo; - } - } - } - } - } - return null; - }; - Data.prototype.search = function (search) { - this.searchValue = search; - if (search.trim() === '') { - this.filtered = null; - return; - } - var searchFilter = this.main.config.searchFilter; - var valuesArray = this.data.slice(0); - search = search.trim(); - var filtered = valuesArray.map(function (obj) { - if (obj.hasOwnProperty('options')) { - var optgroupObj = obj; - var options = []; - if (optgroupObj.options) { - options = optgroupObj.options.filter(function (opt) { - return searchFilter(opt, search); - }); - } - if (options.length !== 0) { - var optgroup = Object.assign({}, optgroupObj); - optgroup.options = options; - return optgroup; - } - } - if (obj.hasOwnProperty('text')) { - var optionObj = obj; - if (searchFilter(optionObj, search)) { - return obj; - } - } - return null; - }); - this.filtered = filtered.filter(function (info) { return info; }); - }; - return Data; -}()); -exports.Data = Data; -function validateData(data) { - if (!data) { - console.error('Data must be an array of objects'); - return false; - } - var isValid = false; - var errorCount = 0; - for (var _i = 0, data_1 = data; _i < data_1.length; _i++) { - var d = data_1[_i]; - if (d.hasOwnProperty('label')) { - if (d.hasOwnProperty('options')) { - var optgroup = d; - var options = optgroup.options; - if (options) { - for (var _a = 0, options_5 = options; _a < options_5.length; _a++) { - var o = options_5[_a]; - isValid = validateOption(o); - if (!isValid) { - errorCount++; - } - } - } - } - } - else { - var option = d; - isValid = validateOption(option); - if (!isValid) { - errorCount++; - } - } - } - return errorCount === 0; -} -exports.validateData = validateData; -function validateOption(option) { - if (option.text === undefined) { - console.error('Data object option must have at least have a text value. Check object: ' + JSON.stringify(option)); - return false; - } - return true; -} -exports.validateOption = validateOption; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var config_1 = __webpack_require__(3); -var select_1 = __webpack_require__(4); -var slim_1 = __webpack_require__(5); -var data_1 = __webpack_require__(1); -var helper_1 = __webpack_require__(0); -var SlimSelect = (function () { - function SlimSelect(info) { - var _this = this; - this.ajax = null; - this.addable = null; - this.beforeOnChange = null; - this.onChange = null; - this.beforeOpen = null; - this.afterOpen = null; - this.beforeClose = null; - this.afterClose = null; - var selectElement = this.validate(info); - if (selectElement.dataset.ssid) { - this.destroy(selectElement.dataset.ssid); - } - if (info.ajax) { - this.ajax = info.ajax; - } - if (info.addable) { - this.addable = info.addable; - } - this.config = new config_1.Config({ - select: selectElement, - isAjax: (info.ajax ? true : false), - showSearch: info.showSearch, - searchPlaceholder: info.searchPlaceholder, - searchText: info.searchText, - searchingText: info.searchingText, - searchFocus: info.searchFocus, - searchHighlight: info.searchHighlight, - searchFilter: info.searchFilter, - closeOnSelect: info.closeOnSelect, - showContent: info.showContent, - placeholderText: info.placeholder, - allowDeselect: info.allowDeselect, - allowDeselectOption: info.allowDeselectOption, - hideSelectedOption: info.hideSelectedOption, - deselectLabel: info.deselectLabel, - isEnabled: info.isEnabled, - valuesUseText: info.valuesUseText, - showOptionTooltips: info.showOptionTooltips, - selectByGroup: info.selectByGroup, - limit: info.limit, - timeoutDelay: info.timeoutDelay, - addToBody: info.addToBody - }); - this.select = new select_1.Select({ - select: selectElement, - main: this - }); - this.data = new data_1.Data({ main: this }); - this.slim = new slim_1.Slim({ main: this }); - if (this.select.element.parentNode) { - this.select.element.parentNode.insertBefore(this.slim.container, this.select.element.nextSibling); - } - if (info.data) { - this.setData(info.data); - } - else { - this.render(); - } - document.addEventListener('click', function (e) { - if (e.target && !helper_1.hasClassInTree(e.target, _this.config.id)) { - _this.close(); - } - }); - if (this.config.showContent === 'auto') { - window.addEventListener('scroll', helper_1.debounce(function (e) { - if (_this.data.contentOpen) { - if (helper_1.putContent(_this.slim.content, _this.data.contentPosition, _this.data.contentOpen) === 'above') { - _this.moveContentAbove(); - } - else { - _this.moveContentBelow(); - } - } - }), false); - } - if (info.beforeOnChange) { - this.beforeOnChange = info.beforeOnChange; - } - if (info.onChange) { - this.onChange = info.onChange; - } - if (info.beforeOpen) { - this.beforeOpen = info.beforeOpen; - } - if (info.afterOpen) { - this.afterOpen = info.afterOpen; - } - if (info.beforeClose) { - this.beforeClose = info.beforeClose; - } - if (info.afterClose) { - this.afterClose = info.afterClose; - } - if (!this.config.isEnabled) { - this.disable(); - } - } - SlimSelect.prototype.validate = function (info) { - var select = (typeof info.select === 'string' ? document.querySelector(info.select) : info.select); - if (!select) { - throw new Error('Could not find select element'); - } - if (select.tagName !== 'SELECT') { - throw new Error('Element isnt of type select'); - } - return select; - }; - SlimSelect.prototype.selected = function () { - if (this.config.isMultiple) { - var selected = this.data.getSelected(); - var outputSelected = []; - for (var _i = 0, selected_1 = selected; _i < selected_1.length; _i++) { - var s = selected_1[_i]; - outputSelected.push(s.value); - } - return outputSelected; - } - else { - var selected = this.data.getSelected(); - return (selected ? selected.value : ''); - } - }; - SlimSelect.prototype.set = function (value, type, close, render) { - if (type === void 0) { type = 'value'; } - if (close === void 0) { close = true; } - if (render === void 0) { render = true; } - if (this.config.isMultiple && !Array.isArray(value)) { - this.data.addToSelected(value, type); - } - else { - this.data.setSelected(value, type); - } - this.select.setValue(); - this.data.onDataChange(); - this.render(); - if (close) { - this.close(); - } - }; - SlimSelect.prototype.setSelected = function (value, type, close, render) { - if (type === void 0) { type = 'value'; } - if (close === void 0) { close = true; } - if (render === void 0) { render = true; } - this.set(value, type, close, render); - }; - SlimSelect.prototype.setData = function (data) { - var isValid = data_1.validateData(data); - if (!isValid) { - console.error('Validation problem on: #' + this.select.element.id); - return; - } - var newData = JSON.parse(JSON.stringify(data)); - var selected = this.data.getSelected(); - if (this.config.isAjax && selected) { - if (this.config.isMultiple) { - var reverseSelected = selected.reverse(); - for (var _i = 0, reverseSelected_1 = reverseSelected; _i < reverseSelected_1.length; _i++) { - var r = reverseSelected_1[_i]; - newData.unshift(r); - } - } - else { - newData.unshift(this.data.getSelected()); - newData.unshift({ text: '', placeholder: true }); - } - } - this.select.create(newData); - this.data.parseSelectData(); - this.data.setSelectedFromSelect(); - }; - SlimSelect.prototype.addData = function (data) { - var isValid = data_1.validateData([data]); - if (!isValid) { - console.error('Validation problem on: #' + this.select.element.id); - return; - } - this.data.add(this.data.newOption(data)); - this.select.create(this.data.data); - this.data.parseSelectData(); - this.data.setSelectedFromSelect(); - this.render(); - }; - SlimSelect.prototype.open = function () { - var _this = this; - if (!this.config.isEnabled) { - return; - } - if (this.data.contentOpen) { - return; - } - if (this.beforeOpen) { - this.beforeOpen(); - } - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.plus.classList.add('ss-cross'); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.arrowIcon.arrow.classList.remove('arrow-down'); - this.slim.singleSelected.arrowIcon.arrow.classList.add('arrow-up'); - } - this.slim[(this.config.isMultiple ? 'multiSelected' : 'singleSelected')].container.classList.add((this.data.contentPosition === 'above' ? this.config.openAbove : this.config.openBelow)); - if (this.config.addToBody) { - var containerRect = this.slim.container.getBoundingClientRect(); - this.slim.content.style.top = (containerRect.top + containerRect.height + window.scrollY) + 'px'; - this.slim.content.style.left = (containerRect.left + window.scrollX) + 'px'; - this.slim.content.style.width = containerRect.width + 'px'; - } - this.slim.content.classList.add(this.config.open); - if (this.config.showContent.toLowerCase() === 'up') { - this.moveContentAbove(); - } - else if (this.config.showContent.toLowerCase() === 'down') { - this.moveContentBelow(); - } - else { - if (helper_1.putContent(this.slim.content, this.data.contentPosition, this.data.contentOpen) === 'above') { - this.moveContentAbove(); - } - else { - this.moveContentBelow(); - } - } - if (!this.config.isMultiple) { - var selected = this.data.getSelected(); - if (selected) { - var selectedId = selected.id; - var selectedOption = this.slim.list.querySelector('[data-id="' + selectedId + '"]'); - if (selectedOption) { - helper_1.ensureElementInView(this.slim.list, selectedOption); - } - } - } - setTimeout(function () { - _this.data.contentOpen = true; - if (_this.config.searchFocus) { - _this.slim.search.input.focus(); - } - if (_this.afterOpen) { - _this.afterOpen(); - } - }, this.config.timeoutDelay); - }; - SlimSelect.prototype.close = function () { - var _this = this; - if (!this.data.contentOpen) { - return; - } - if (this.beforeClose) { - this.beforeClose(); - } - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.container.classList.remove(this.config.openAbove); - this.slim.multiSelected.container.classList.remove(this.config.openBelow); - this.slim.multiSelected.plus.classList.remove('ss-cross'); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.container.classList.remove(this.config.openAbove); - this.slim.singleSelected.container.classList.remove(this.config.openBelow); - this.slim.singleSelected.arrowIcon.arrow.classList.add('arrow-down'); - this.slim.singleSelected.arrowIcon.arrow.classList.remove('arrow-up'); - } - this.slim.content.classList.remove(this.config.open); - this.data.contentOpen = false; - this.search(''); - setTimeout(function () { - _this.slim.content.removeAttribute('style'); - _this.data.contentPosition = 'below'; - if (_this.config.isMultiple && _this.slim.multiSelected) { - _this.slim.multiSelected.container.classList.remove(_this.config.openAbove); - _this.slim.multiSelected.container.classList.remove(_this.config.openBelow); - } - else if (_this.slim.singleSelected) { - _this.slim.singleSelected.container.classList.remove(_this.config.openAbove); - _this.slim.singleSelected.container.classList.remove(_this.config.openBelow); - } - _this.slim.search.input.blur(); - if (_this.afterClose) { - _this.afterClose(); - } - }, this.config.timeoutDelay); - }; - SlimSelect.prototype.moveContentAbove = function () { - var selectHeight = 0; - if (this.config.isMultiple && this.slim.multiSelected) { - selectHeight = this.slim.multiSelected.container.offsetHeight; - } - else if (this.slim.singleSelected) { - selectHeight = this.slim.singleSelected.container.offsetHeight; - } - var contentHeight = this.slim.content.offsetHeight; - var height = selectHeight + contentHeight - 1; - this.slim.content.style.margin = '-' + height + 'px 0 0 0'; - this.slim.content.style.height = (height - selectHeight + 1) + 'px'; - this.slim.content.style.transformOrigin = 'center bottom'; - this.data.contentPosition = 'above'; - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.container.classList.remove(this.config.openBelow); - this.slim.multiSelected.container.classList.add(this.config.openAbove); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.container.classList.remove(this.config.openBelow); - this.slim.singleSelected.container.classList.add(this.config.openAbove); - } - }; - SlimSelect.prototype.moveContentBelow = function () { - this.data.contentPosition = 'below'; - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.container.classList.remove(this.config.openAbove); - this.slim.multiSelected.container.classList.add(this.config.openBelow); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.container.classList.remove(this.config.openAbove); - this.slim.singleSelected.container.classList.add(this.config.openBelow); - } - }; - SlimSelect.prototype.enable = function () { - this.config.isEnabled = true; - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.container.classList.remove(this.config.disabled); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.container.classList.remove(this.config.disabled); - } - this.select.triggerMutationObserver = false; - this.select.element.disabled = false; - this.slim.search.input.disabled = false; - this.select.triggerMutationObserver = true; - }; - SlimSelect.prototype.disable = function () { - this.config.isEnabled = false; - if (this.config.isMultiple && this.slim.multiSelected) { - this.slim.multiSelected.container.classList.add(this.config.disabled); - } - else if (this.slim.singleSelected) { - this.slim.singleSelected.container.classList.add(this.config.disabled); - } - this.select.triggerMutationObserver = false; - this.select.element.disabled = true; - this.slim.search.input.disabled = true; - this.select.triggerMutationObserver = true; - }; - SlimSelect.prototype.search = function (value) { - if (this.data.searchValue !== value) { - this.slim.search.input.value = value; - if (this.config.isAjax) { - var master_1 = this; - this.config.isSearching = true; - this.render(); - if (this.ajax) { - this.ajax(value, function (info) { - master_1.config.isSearching = false; - if (Array.isArray(info)) { - info.unshift({ text: '', placeholder: true }); - master_1.setData(info); - master_1.data.search(value); - master_1.render(); - } - else if (typeof info === 'string') { - master_1.slim.options(info); - } - else { - master_1.render(); - } - }); - } - } - else { - this.data.search(value); - this.render(); - } - } - }; - SlimSelect.prototype.setSearchText = function (text) { - this.config.searchText = text; - }; - SlimSelect.prototype.render = function () { - if (this.config.isMultiple) { - this.slim.values(); - } - else { - this.slim.placeholder(); - this.slim.deselect(); - } - this.slim.options(); - }; - SlimSelect.prototype.destroy = function (id) { - if (id === void 0) { id = null; } - var slim = (id ? document.querySelector('.' + id + '.ss-main') : this.slim.container); - var select = (id ? document.querySelector("[data-ssid=" + id + "]") : this.select.element); - if (!slim || !select) { - return; - } - select.style.display = ''; - delete select.dataset.ssid; - var el = select; - el.slim = null; - if (slim.parentElement) { - slim.parentElement.removeChild(slim); - } - if (this.config.addToBody) { - var slimContent = (id ? document.querySelector('.' + id + '.ss-content') : this.slim.content); - if (!slimContent) { - return; - } - document.body.removeChild(slimContent); - } - }; - return SlimSelect; -}()); -exports["default"] = SlimSelect; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var Config = (function () { - function Config(info) { - this.id = ''; - this.isMultiple = false; - this.isAjax = false; - this.isSearching = false; - this.showSearch = true; - this.searchFocus = true; - this.searchHighlight = false; - this.closeOnSelect = true; - this.showContent = 'auto'; - this.searchPlaceholder = 'Search'; - this.searchText = 'No Results'; - this.searchingText = 'Searching...'; - this.placeholderText = 'Select Value'; - this.allowDeselect = false; - this.allowDeselectOption = false; - this.hideSelectedOption = false; - this.deselectLabel = 'x'; - this.isEnabled = true; - this.valuesUseText = false; - this.showOptionTooltips = false; - this.selectByGroup = false; - this.limit = 0; - this.timeoutDelay = 200; - this.addToBody = false; - this.main = 'ss-main'; - this.singleSelected = 'ss-single-selected'; - this.arrow = 'ss-arrow'; - this.multiSelected = 'ss-multi-selected'; - this.add = 'ss-add'; - this.plus = 'ss-plus'; - this.values = 'ss-values'; - this.value = 'ss-value'; - this.valueText = 'ss-value-text'; - this.valueDelete = 'ss-value-delete'; - this.content = 'ss-content'; - this.open = 'ss-open'; - this.openAbove = 'ss-open-above'; - this.openBelow = 'ss-open-below'; - this.search = 'ss-search'; - this.searchHighlighter = 'ss-search-highlight'; - this.addable = 'ss-addable'; - this.list = 'ss-list'; - this.optgroup = 'ss-optgroup'; - this.optgroupLabel = 'ss-optgroup-label'; - this.optgroupLabelSelectable = 'ss-optgroup-label-selectable'; - this.option = 'ss-option'; - this.optionSelected = 'ss-option-selected'; - this.highlighted = 'ss-highlighted'; - this.disabled = 'ss-disabled'; - this.hide = 'ss-hide'; - this.id = 'ss-' + Math.floor(Math.random() * 100000); - this.style = info.select.style.cssText; - this["class"] = info.select.className.split(' '); - this.isMultiple = info.select.multiple; - this.isAjax = info.isAjax; - this.showSearch = (info.showSearch === false ? false : true); - this.searchFocus = (info.searchFocus === false ? false : true); - this.searchHighlight = (info.searchHighlight === true ? true : false); - this.closeOnSelect = (info.closeOnSelect === false ? false : true); - if (info.showContent) { - this.showContent = info.showContent; - } - this.isEnabled = (info.isEnabled === false ? false : true); - if (info.searchPlaceholder) { - this.searchPlaceholder = info.searchPlaceholder; - } - if (info.searchText) { - this.searchText = info.searchText; - } - if (info.searchingText) { - this.searchingText = info.searchingText; - } - if (info.placeholderText) { - this.placeholderText = info.placeholderText; - } - this.allowDeselect = (info.allowDeselect === true ? true : false); - this.allowDeselectOption = (info.allowDeselectOption === true ? true : false); - this.hideSelectedOption = (info.hideSelectedOption === true ? true : false); - if (info.deselectLabel) { - this.deselectLabel = info.deselectLabel; - } - if (info.valuesUseText) { - this.valuesUseText = info.valuesUseText; - } - if (info.showOptionTooltips) { - this.showOptionTooltips = info.showOptionTooltips; - } - if (info.selectByGroup) { - this.selectByGroup = info.selectByGroup; - } - if (info.limit) { - this.limit = info.limit; - } - if (info.searchFilter) { - this.searchFilter = info.searchFilter; - } - if (info.timeoutDelay != null) { - this.timeoutDelay = info.timeoutDelay; - } - this.addToBody = (info.addToBody === true ? true : false); - } - Config.prototype.searchFilter = function (opt, search) { - return opt.text.toLowerCase().indexOf(search.toLowerCase()) !== -1; - }; - return Config; -}()); -exports.Config = Config; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var helper_1 = __webpack_require__(0); -var Select = (function () { - function Select(info) { - this.triggerMutationObserver = true; - this.element = info.select; - this.main = info.main; - if (this.element.disabled) { - this.main.config.isEnabled = false; - } - this.addAttributes(); - this.addEventListeners(); - this.mutationObserver = null; - this.addMutationObserver(); - var el = this.element; - el.slim = info.main; - } - Select.prototype.setValue = function () { - if (!this.main.data.getSelected()) { - return; - } - if (this.main.config.isMultiple) { - var selected = this.main.data.getSelected(); - var options = this.element.options; - for (var _i = 0, options_1 = options; _i < options_1.length; _i++) { - var o = options_1[_i]; - o.selected = false; - for (var _a = 0, selected_1 = selected; _a < selected_1.length; _a++) { - var s = selected_1[_a]; - if (s.value === o.value) { - o.selected = true; - } - } - } - } - else { - var selected = this.main.data.getSelected(); - this.element.value = (selected ? selected.value : ''); - } - this.main.data.isOnChangeEnabled = false; - this.element.dispatchEvent(new CustomEvent('change', { bubbles: true })); - this.main.data.isOnChangeEnabled = true; - }; - Select.prototype.addAttributes = function () { - this.element.tabIndex = -1; - this.element.style.display = 'none'; - this.element.dataset.ssid = this.main.config.id; - }; - Select.prototype.addEventListeners = function () { - var _this = this; - this.element.addEventListener('change', function (e) { - _this.main.data.setSelectedFromSelect(); - _this.main.render(); - }); - }; - Select.prototype.addMutationObserver = function () { - var _this = this; - if (this.main.config.isAjax) { - return; - } - this.mutationObserver = new MutationObserver(function (mutations) { - if (!_this.triggerMutationObserver) { - return; - } - _this.main.data.parseSelectData(); - _this.main.data.setSelectedFromSelect(); - _this.main.render(); - mutations.forEach(function (mutation) { - if (mutation.attributeName === 'class') { - _this.main.slim.updateContainerDivClass(_this.main.slim.container); - } - }); - }); - this.observeMutationObserver(); - }; - Select.prototype.observeMutationObserver = function () { - if (!this.mutationObserver) { - return; - } - this.mutationObserver.observe(this.element, { - attributes: true, - childList: true, - characterData: true - }); - }; - Select.prototype.disconnectMutationObserver = function () { - if (this.mutationObserver) { - this.mutationObserver.disconnect(); - } - }; - Select.prototype.create = function (data) { - this.element.innerHTML = ''; - for (var _i = 0, data_1 = data; _i < data_1.length; _i++) { - var d = data_1[_i]; - if (d.hasOwnProperty('options')) { - var optgroupObject = d; - var optgroupEl = document.createElement('optgroup'); - optgroupEl.label = optgroupObject.label; - if (optgroupObject.options) { - for (var _a = 0, _b = optgroupObject.options; _a < _b.length; _a++) { - var oo = _b[_a]; - optgroupEl.appendChild(this.createOption(oo)); - } - } - this.element.appendChild(optgroupEl); - } - else { - this.element.appendChild(this.createOption(d)); - } - } - }; - Select.prototype.createOption = function (info) { - var optionEl = document.createElement('option'); - optionEl.value = info.value !== '' ? info.value : info.text; - optionEl.innerHTML = info.innerHTML || info.text; - if (info.selected) { - optionEl.selected = info.selected; - } - if (info.display === false) { - optionEl.style.display = 'none'; - } - if (info.disabled) { - optionEl.disabled = true; - } - if (info.placeholder) { - optionEl.setAttribute('data-placeholder', 'true'); - } - if (info.mandatory) { - optionEl.setAttribute('data-mandatory', 'true'); - } - if (info["class"]) { - info["class"].split(' ').forEach(function (optionClass) { - optionEl.classList.add(optionClass); - }); - } - if (info.data && typeof info.data === 'object') { - Object.keys(info.data).forEach(function (key) { - optionEl.setAttribute('data-' + helper_1.kebabCase(key), info.data[key]); - }); - } - return optionEl; - }; - return Select; -}()); -exports.Select = Select; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -exports.__esModule = true; -var helper_1 = __webpack_require__(0); -var data_1 = __webpack_require__(1); -var Slim = (function () { - function Slim(info) { - this.main = info.main; - this.container = this.containerDiv(); - this.content = this.contentDiv(); - this.search = this.searchDiv(); - this.list = this.listDiv(); - this.options(); - this.singleSelected = null; - this.multiSelected = null; - if (this.main.config.isMultiple) { - this.multiSelected = this.multiSelectedDiv(); - if (this.multiSelected) { - this.container.appendChild(this.multiSelected.container); - } - } - else { - this.singleSelected = this.singleSelectedDiv(); - this.container.appendChild(this.singleSelected.container); - } - if (this.main.config.addToBody) { - this.content.classList.add(this.main.config.id); - document.body.appendChild(this.content); - } - else { - this.container.appendChild(this.content); - } - this.content.appendChild(this.search.container); - this.content.appendChild(this.list); - } - Slim.prototype.containerDiv = function () { - var container = document.createElement('div'); - container.style.cssText = this.main.config.style; - this.updateContainerDivClass(container); - return container; - }; - Slim.prototype.updateContainerDivClass = function (container) { - this.main.config["class"] = this.main.select.element.className.split(' '); - container.className = ''; - container.classList.add(this.main.config.id); - container.classList.add(this.main.config.main); - for (var _i = 0, _a = this.main.config["class"]; _i < _a.length; _i++) { - var c = _a[_i]; - if (c.trim() !== '') { - container.classList.add(c); - } - } - }; - Slim.prototype.singleSelectedDiv = function () { - var _this = this; - var container = document.createElement('div'); - container.classList.add(this.main.config.singleSelected); - var placeholder = document.createElement('span'); - placeholder.classList.add('placeholder'); - container.appendChild(placeholder); - var deselect = document.createElement('span'); - deselect.innerHTML = this.main.config.deselectLabel; - deselect.classList.add('ss-deselect'); - deselect.onclick = function (e) { - e.stopPropagation(); - if (!_this.main.config.isEnabled) { - return; - } - _this.main.set(''); - }; - container.appendChild(deselect); - var arrowContainer = document.createElement('span'); - arrowContainer.classList.add(this.main.config.arrow); - var arrowIcon = document.createElement('span'); - arrowIcon.classList.add('arrow-down'); - arrowContainer.appendChild(arrowIcon); - container.appendChild(arrowContainer); - container.onclick = function () { - if (!_this.main.config.isEnabled) { - return; - } - _this.main.data.contentOpen ? _this.main.close() : _this.main.open(); - }; - return { - container: container, - placeholder: placeholder, - deselect: deselect, - arrowIcon: { - container: arrowContainer, - arrow: arrowIcon - } - }; - }; - Slim.prototype.placeholder = function () { - var selected = this.main.data.getSelected(); - if (selected === null || (selected && selected.placeholder)) { - var placeholder = document.createElement('span'); - placeholder.classList.add(this.main.config.disabled); - placeholder.innerHTML = this.main.config.placeholderText; - if (this.singleSelected) { - this.singleSelected.placeholder.innerHTML = placeholder.outerHTML; - } - } - else { - var selectedValue = ''; - if (selected) { - selectedValue = selected.innerHTML && this.main.config.valuesUseText !== true ? selected.innerHTML : selected.text; - } - if (this.singleSelected) { - this.singleSelected.placeholder.innerHTML = (selected ? selectedValue : ''); - } - } - }; - Slim.prototype.deselect = function () { - if (this.singleSelected) { - if (!this.main.config.allowDeselect) { - this.singleSelected.deselect.classList.add('ss-hide'); - return; - } - if (this.main.selected() === '') { - this.singleSelected.deselect.classList.add('ss-hide'); - } - else { - this.singleSelected.deselect.classList.remove('ss-hide'); - } - } - }; - Slim.prototype.multiSelectedDiv = function () { - var _this = this; - var container = document.createElement('div'); - container.classList.add(this.main.config.multiSelected); - var values = document.createElement('div'); - values.classList.add(this.main.config.values); - container.appendChild(values); - var add = document.createElement('div'); - add.classList.add(this.main.config.add); - var plus = document.createElement('span'); - plus.classList.add(this.main.config.plus); - plus.onclick = function (e) { - if (_this.main.data.contentOpen) { - _this.main.close(); - e.stopPropagation(); - } - }; - add.appendChild(plus); - container.appendChild(add); - container.onclick = function (e) { - if (!_this.main.config.isEnabled) { - return; - } - var target = e.target; - if (!target.classList.contains(_this.main.config.valueDelete)) { - _this.main.data.contentOpen ? _this.main.close() : _this.main.open(); - } - }; - return { - container: container, - values: values, - add: add, - plus: plus - }; - }; - Slim.prototype.values = function () { - if (!this.multiSelected) { - return; - } - var currentNodes = this.multiSelected.values.childNodes; - var selected = this.main.data.getSelected(); - var exists; - var nodesToRemove = []; - for (var _i = 0, currentNodes_1 = currentNodes; _i < currentNodes_1.length; _i++) { - var c = currentNodes_1[_i]; - exists = true; - for (var _a = 0, selected_1 = selected; _a < selected_1.length; _a++) { - var s = selected_1[_a]; - if (String(s.id) === String(c.dataset.id)) { - exists = false; - } - } - if (exists) { - nodesToRemove.push(c); - } - } - for (var _b = 0, nodesToRemove_1 = nodesToRemove; _b < nodesToRemove_1.length; _b++) { - var n = nodesToRemove_1[_b]; - n.classList.add('ss-out'); - this.multiSelected.values.removeChild(n); - } - currentNodes = this.multiSelected.values.childNodes; - for (var s = 0; s < selected.length; s++) { - exists = false; - for (var _c = 0, currentNodes_2 = currentNodes; _c < currentNodes_2.length; _c++) { - var c = currentNodes_2[_c]; - if (String(selected[s].id) === String(c.dataset.id)) { - exists = true; - } - } - if (!exists) { - if (currentNodes.length === 0 || !HTMLElement.prototype.insertAdjacentElement) { - this.multiSelected.values.appendChild(this.valueDiv(selected[s])); - } - else if (s === 0) { - this.multiSelected.values.insertBefore(this.valueDiv(selected[s]), currentNodes[s]); - } - else { - currentNodes[s - 1].insertAdjacentElement('afterend', this.valueDiv(selected[s])); - } - } - } - if (selected.length === 0) { - var placeholder = document.createElement('span'); - placeholder.classList.add(this.main.config.disabled); - placeholder.innerHTML = this.main.config.placeholderText; - this.multiSelected.values.innerHTML = placeholder.outerHTML; - } - }; - Slim.prototype.valueDiv = function (optionObj) { - var _this = this; - var value = document.createElement('div'); - value.classList.add(this.main.config.value); - value.dataset.id = optionObj.id; - var text = document.createElement('span'); - text.classList.add(this.main.config.valueText); - text.innerHTML = (optionObj.innerHTML && this.main.config.valuesUseText !== true ? optionObj.innerHTML : optionObj.text); - value.appendChild(text); - if (!optionObj.mandatory) { - var deleteSpan = document.createElement('span'); - deleteSpan.classList.add(this.main.config.valueDelete); - deleteSpan.innerHTML = this.main.config.deselectLabel; - deleteSpan.onclick = function (e) { - e.preventDefault(); - e.stopPropagation(); - var shouldUpdate = false; - if (!_this.main.beforeOnChange) { - shouldUpdate = true; - } - if (_this.main.beforeOnChange) { - var selected = _this.main.data.getSelected(); - var currentValues = JSON.parse(JSON.stringify(selected)); - for (var i = 0; i < currentValues.length; i++) { - if (currentValues[i].id === optionObj.id) { - currentValues.splice(i, 1); - } - } - var beforeOnchange = _this.main.beforeOnChange(currentValues); - if (beforeOnchange !== false) { - shouldUpdate = true; - } - } - if (shouldUpdate) { - _this.main.data.removeFromSelected(optionObj.id, 'id'); - _this.main.render(); - _this.main.select.setValue(); - _this.main.data.onDataChange(); - } - }; - value.appendChild(deleteSpan); - } - return value; - }; - Slim.prototype.contentDiv = function () { - var container = document.createElement('div'); - container.classList.add(this.main.config.content); - return container; - }; - Slim.prototype.searchDiv = function () { - var _this = this; - var container = document.createElement('div'); - var input = document.createElement('input'); - var addable = document.createElement('div'); - container.classList.add(this.main.config.search); - var searchReturn = { - container: container, - input: input - }; - if (!this.main.config.showSearch) { - container.classList.add(this.main.config.hide); - input.readOnly = true; - } - input.type = 'search'; - input.placeholder = this.main.config.searchPlaceholder; - input.tabIndex = 0; - input.setAttribute('aria-label', this.main.config.searchPlaceholder); - input.setAttribute('autocapitalize', 'off'); - input.setAttribute('autocomplete', 'off'); - input.setAttribute('autocorrect', 'off'); - input.onclick = function (e) { - setTimeout(function () { - var target = e.target; - if (target.value === '') { - _this.main.search(''); - } - }, 10); - }; - input.onkeydown = function (e) { - if (e.key === 'ArrowUp') { - _this.main.open(); - _this.highlightUp(); - e.preventDefault(); - } - else if (e.key === 'ArrowDown') { - _this.main.open(); - _this.highlightDown(); - e.preventDefault(); - } - else if (e.key === 'Tab') { - if (!_this.main.data.contentOpen) { - setTimeout(function () { _this.main.close(); }, _this.main.config.timeoutDelay); - } - else { - _this.main.close(); - } - } - else if (e.key === 'Enter') { - e.preventDefault(); - } - }; - input.onkeyup = function (e) { - var target = e.target; - if (e.key === 'Enter') { - if (_this.main.addable && e.ctrlKey) { - addable.click(); - e.preventDefault(); - e.stopPropagation(); - return; - } - var highlighted = _this.list.querySelector('.' + _this.main.config.highlighted); - if (highlighted) { - highlighted.click(); - } - } - else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') { - } - else if (e.key === 'Escape') { - _this.main.close(); - } - else { - if (_this.main.config.showSearch && _this.main.data.contentOpen) { - _this.main.search(target.value); - } - else { - input.value = ''; - } - } - e.preventDefault(); - e.stopPropagation(); - }; - input.onfocus = function () { _this.main.open(); }; - container.appendChild(input); - if (this.main.addable) { - addable.classList.add(this.main.config.addable); - addable.innerHTML = '+'; - addable.onclick = function (e) { - if (_this.main.addable) { - e.preventDefault(); - e.stopPropagation(); - var inputValue = _this.search.input.value; - if (inputValue.trim() === '') { - _this.search.input.focus(); - return; - } - var addableValue = _this.main.addable(inputValue); - var addableValueStr_1 = ''; - if (!addableValue) { - return; - } - if (typeof addableValue === 'object') { - var validValue = data_1.validateOption(addableValue); - if (validValue) { - _this.main.addData(addableValue); - addableValueStr_1 = (addableValue.value ? addableValue.value : addableValue.text); - } - } - else { - _this.main.addData(_this.main.data.newOption({ - text: addableValue, - value: addableValue - })); - addableValueStr_1 = addableValue; - } - _this.main.search(''); - setTimeout(function () { - _this.main.set(addableValueStr_1, 'value', false, false); - }, 100); - if (_this.main.config.closeOnSelect) { - setTimeout(function () { - _this.main.close(); - }, 100); - } - } - }; - container.appendChild(addable); - searchReturn.addable = addable; - } - return searchReturn; - }; - Slim.prototype.highlightUp = function () { - var highlighted = this.list.querySelector('.' + this.main.config.highlighted); - var prev = null; - if (highlighted) { - prev = highlighted.previousSibling; - while (prev !== null) { - if (prev.classList.contains(this.main.config.disabled)) { - prev = prev.previousSibling; - continue; - } - else { - break; - } - } - } - else { - var allOptions = this.list.querySelectorAll('.' + this.main.config.option + ':not(.' + this.main.config.disabled + ')'); - prev = allOptions[allOptions.length - 1]; - } - if (prev && prev.classList.contains(this.main.config.optgroupLabel)) { - prev = null; - } - if (prev === null) { - var parent_1 = highlighted.parentNode; - if (parent_1.classList.contains(this.main.config.optgroup)) { - if (parent_1.previousSibling) { - var prevNodes = parent_1.previousSibling.querySelectorAll('.' + this.main.config.option + ':not(.' + this.main.config.disabled + ')'); - if (prevNodes.length) { - prev = prevNodes[prevNodes.length - 1]; - } - } - } - } - if (prev) { - if (highlighted) { - highlighted.classList.remove(this.main.config.highlighted); - } - prev.classList.add(this.main.config.highlighted); - helper_1.ensureElementInView(this.list, prev); - } - }; - Slim.prototype.highlightDown = function () { - var highlighted = this.list.querySelector('.' + this.main.config.highlighted); - var next = null; - if (highlighted) { - next = highlighted.nextSibling; - while (next !== null) { - if (next.classList.contains(this.main.config.disabled)) { - next = next.nextSibling; - continue; - } - else { - break; - } - } - } - else { - next = this.list.querySelector('.' + this.main.config.option + ':not(.' + this.main.config.disabled + ')'); - } - if (next === null && highlighted !== null) { - var parent_2 = highlighted.parentNode; - if (parent_2.classList.contains(this.main.config.optgroup)) { - if (parent_2.nextSibling) { - var sibling = parent_2.nextSibling; - next = sibling.querySelector('.' + this.main.config.option + ':not(.' + this.main.config.disabled + ')'); - } - } - } - if (next) { - if (highlighted) { - highlighted.classList.remove(this.main.config.highlighted); - } - next.classList.add(this.main.config.highlighted); - helper_1.ensureElementInView(this.list, next); - } - }; - Slim.prototype.listDiv = function () { - var list = document.createElement('div'); - list.classList.add(this.main.config.list); - return list; - }; - Slim.prototype.options = function (content) { - if (content === void 0) { content = ''; } - var data = this.main.data.filtered || this.main.data.data; - this.list.innerHTML = ''; - if (content !== '') { - var searching = document.createElement('div'); - searching.classList.add(this.main.config.option); - searching.classList.add(this.main.config.disabled); - searching.innerHTML = content; - this.list.appendChild(searching); - return; - } - if (this.main.config.isAjax && this.main.config.isSearching) { - var searching = document.createElement('div'); - searching.classList.add(this.main.config.option); - searching.classList.add(this.main.config.disabled); - searching.innerHTML = this.main.config.searchingText; - this.list.appendChild(searching); - return; - } - if (data.length === 0) { - var noResults = document.createElement('div'); - noResults.classList.add(this.main.config.option); - noResults.classList.add(this.main.config.disabled); - noResults.innerHTML = this.main.config.searchText; - this.list.appendChild(noResults); - return; - } - var _loop_1 = function (d) { - if (d.hasOwnProperty('label')) { - var item = d; - var optgroupEl_1 = document.createElement('div'); - optgroupEl_1.classList.add(this_1.main.config.optgroup); - var optgroupLabel = document.createElement('div'); - optgroupLabel.classList.add(this_1.main.config.optgroupLabel); - if (this_1.main.config.selectByGroup && this_1.main.config.isMultiple) { - optgroupLabel.classList.add(this_1.main.config.optgroupLabelSelectable); - } - optgroupLabel.innerHTML = item.label; - optgroupEl_1.appendChild(optgroupLabel); - var options = item.options; - if (options) { - for (var _i = 0, options_1 = options; _i < options_1.length; _i++) { - var o = options_1[_i]; - optgroupEl_1.appendChild(this_1.option(o)); - } - if (this_1.main.config.selectByGroup && this_1.main.config.isMultiple) { - var master_1 = this_1; - optgroupLabel.addEventListener('click', function (e) { - e.preventDefault(); - e.stopPropagation(); - for (var _i = 0, _a = optgroupEl_1.children; _i < _a.length; _i++) { - var childEl = _a[_i]; - if (childEl.className.indexOf(master_1.main.config.option) !== -1) { - childEl.click(); - } - } - }); - } - } - this_1.list.appendChild(optgroupEl_1); - } - else { - this_1.list.appendChild(this_1.option(d)); - } - }; - var this_1 = this; - for (var _i = 0, data_2 = data; _i < data_2.length; _i++) { - var d = data_2[_i]; - _loop_1(d); - } - }; - Slim.prototype.option = function (data) { - if (data.placeholder) { - var placeholder = document.createElement('div'); - placeholder.classList.add(this.main.config.option); - placeholder.classList.add(this.main.config.hide); - return placeholder; - } - var optionEl = document.createElement('div'); - optionEl.classList.add(this.main.config.option); - if (data["class"]) { - data["class"].split(' ').forEach(function (dataClass) { - optionEl.classList.add(dataClass); - }); - } - if (data.style) { - optionEl.style.cssText = data.style; - } - var selected = this.main.data.getSelected(); - optionEl.dataset.id = data.id; - if (this.main.config.searchHighlight && this.main.slim && data.innerHTML && this.main.slim.search.input.value.trim() !== '') { - optionEl.innerHTML = helper_1.highlight(data.innerHTML, this.main.slim.search.input.value, this.main.config.searchHighlighter); - } - else if (data.innerHTML) { - optionEl.innerHTML = data.innerHTML; - } - if (this.main.config.showOptionTooltips && optionEl.textContent) { - optionEl.setAttribute('title', optionEl.textContent); - } - var master = this; - optionEl.addEventListener('click', function (e) { - e.preventDefault(); - e.stopPropagation(); - var element = this; - var elementID = element.dataset.id; - if (data.selected === true && master.main.config.allowDeselectOption) { - var shouldUpdate = false; - if (!master.main.beforeOnChange || !master.main.config.isMultiple) { - shouldUpdate = true; - } - if (master.main.beforeOnChange && master.main.config.isMultiple) { - var selectedValues = master.main.data.getSelected(); - var currentValues = JSON.parse(JSON.stringify(selectedValues)); - for (var i = 0; i < currentValues.length; i++) { - if (currentValues[i].id === elementID) { - currentValues.splice(i, 1); - } - } - var beforeOnchange = master.main.beforeOnChange(currentValues); - if (beforeOnchange !== false) { - shouldUpdate = true; - } - } - if (shouldUpdate) { - if (master.main.config.isMultiple) { - master.main.data.removeFromSelected(elementID, 'id'); - master.main.render(); - master.main.select.setValue(); - master.main.data.onDataChange(); - } - else { - master.main.set(''); - } - } - } - else { - if (data.disabled || data.selected) { - return; - } - if (master.main.config.limit && Array.isArray(selected) && master.main.config.limit <= selected.length) { - return; - } - if (master.main.beforeOnChange) { - var value = void 0; - var objectInfo = JSON.parse(JSON.stringify(master.main.data.getObjectFromData(elementID))); - objectInfo.selected = true; - if (master.main.config.isMultiple) { - value = JSON.parse(JSON.stringify(selected)); - value.push(objectInfo); - } - else { - value = JSON.parse(JSON.stringify(objectInfo)); - } - var beforeOnchange = master.main.beforeOnChange(value); - if (beforeOnchange !== false) { - master.main.set(elementID, 'id', master.main.config.closeOnSelect); - } - } - else { - master.main.set(elementID, 'id', master.main.config.closeOnSelect); - } - } - }); - var isSelected = selected && helper_1.isValueInArrayOfObjects(selected, 'id', data.id); - if (data.disabled || isSelected) { - optionEl.onclick = null; - if (!master.main.config.allowDeselectOption) { - optionEl.classList.add(this.main.config.disabled); - } - if (master.main.config.hideSelectedOption) { - optionEl.classList.add(this.main.config.hide); - } - } - if (isSelected) { - optionEl.classList.add(this.main.config.optionSelected); - } - else { - optionEl.classList.remove(this.main.config.optionSelected); - } - return optionEl; - }; - return Slim; -}()); -exports.Slim = Slim; - - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/app/static/vendors/slimselect/slimselect.min.css b/app/static/vendors/slimselect/slimselect.min.css deleted file mode 100644 index 753635a..0000000 --- a/app/static/vendors/slimselect/slimselect.min.css +++ /dev/null @@ -1 +0,0 @@ -.ss-main{position:relative;display:inline-block;user-select:none;color:#666;width:100%}.ss-main .ss-single-selected{display:flex;cursor:pointer;width:100%;height:30px;padding:6px;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;box-sizing:border-box;transition:background-color .2s}.ss-main .ss-single-selected.ss-disabled{background-color:#dcdee2;cursor:not-allowed}.ss-main .ss-single-selected.ss-open-above{border-top-left-radius:0;border-top-right-radius:0}.ss-main .ss-single-selected.ss-open-below{border-bottom-left-radius:0;border-bottom-right-radius:0}.ss-main .ss-single-selected .placeholder{display:flex;flex:1 1 100%;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;width:calc(100% - 30px);line-height:1em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ss-main .ss-single-selected .placeholder *{display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:auto}.ss-main .ss-single-selected .placeholder .ss-disabled{color:#dedede}.ss-main .ss-single-selected .ss-deselect{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;margin:0 6px 0 6px;font-weight:700}.ss-main .ss-single-selected .ss-deselect.ss-hide{display:none}.ss-main .ss-single-selected .ss-arrow{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;margin:0 6px 0 6px}.ss-main .ss-single-selected .ss-arrow span{border:solid #666;border-width:0 2px 2px 0;display:inline-block;padding:3px;transition:transform .2s,margin .2s}.ss-main .ss-single-selected .ss-arrow span.arrow-up{transform:rotate(-135deg);margin:3px 0 0 0}.ss-main .ss-single-selected .ss-arrow span.arrow-down{transform:rotate(45deg);margin:-3px 0 0 0}.ss-main .ss-multi-selected{display:flex;flex-direction:row;cursor:pointer;min-height:30px;width:100%;padding:0 0 0 3px;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;box-sizing:border-box;transition:background-color .2s}.ss-main .ss-multi-selected.ss-disabled{background-color:#dcdee2;cursor:not-allowed}.ss-main .ss-multi-selected.ss-disabled .ss-values .ss-disabled{color:#666}.ss-main .ss-multi-selected.ss-disabled .ss-values .ss-value .ss-value-delete{cursor:not-allowed}.ss-main .ss-multi-selected.ss-open-above{border-top-left-radius:0;border-top-right-radius:0}.ss-main .ss-multi-selected.ss-open-below{border-bottom-left-radius:0;border-bottom-right-radius:0}.ss-main .ss-multi-selected .ss-values{display:flex;flex-wrap:wrap;justify-content:flex-start;flex:1 1 100%;width:calc(100% - 30px)}.ss-main .ss-multi-selected .ss-values .ss-disabled{display:flex;padding:4px 5px;margin:2px 0;line-height:1em;align-items:center;width:100%;color:#dedede;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes scaleIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes scaleOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.ss-main .ss-multi-selected .ss-values .ss-value{display:flex;user-select:none;align-items:center;font-size:12px;padding:3px 5px;margin:3px 5px 3px 0;color:#fff;background-color:#5897fb;border-radius:4px;animation-name:scaleIn;animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:both}.ss-main .ss-multi-selected .ss-values .ss-value.ss-out{animation-name:scaleOut;animation-duration:.2s;animation-timing-function:ease-out}.ss-main .ss-multi-selected .ss-values .ss-value .ss-value-delete{margin:0 0 0 5px;cursor:pointer}.ss-main .ss-multi-selected .ss-add{display:flex;flex:0 1 3px;margin:9px 12px 0 5px}.ss-main .ss-multi-selected .ss-add .ss-plus{display:flex;justify-content:center;align-items:center;background:#666;position:relative;height:10px;width:2px;transition:transform .2s}.ss-main .ss-multi-selected .ss-add .ss-plus:after{background:#666;content:"";position:absolute;height:2px;width:10px;left:-4px;top:4px}.ss-main .ss-multi-selected .ss-add .ss-plus.ss-cross{transform:rotate(45deg)}.ss-content{position:absolute;width:100%;margin:-1px 0 0 0;box-sizing:border-box;border:solid 1px #dcdee2;z-index:1010;background-color:#fff;transform-origin:center top;transition:transform .2s,opacity .2s;opacity:0;transform:scaleY(0)}.ss-content.ss-open{display:block;opacity:1;transform:scaleY(1)}.ss-content .ss-search{display:flex;flex-direction:row;padding:8px 8px 6px 8px}.ss-content .ss-search.ss-hide{height:0;opacity:0;padding:0;margin:0}.ss-content .ss-search.ss-hide input{height:0;opacity:0;padding:0;margin:0}.ss-content .ss-search input{display:inline-flex;font-size:inherit;line-height:inherit;flex:1 1 auto;width:100%;min-width:0;height:30px;padding:6px 8px;margin:0;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;text-align:left;box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-appearance:textfield}.ss-content .ss-search input::placeholder{color:#8a8a8a;vertical-align:middle}.ss-content .ss-search input:focus{box-shadow:0 0 5px #5897fb}.ss-content .ss-search .ss-addable{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;font-size:22px;font-weight:700;flex:0 0 30px;height:30px;margin:0 0 0 8px;border:1px solid #dcdee2;border-radius:4px;box-sizing:border-box}.ss-content .ss-addable{padding-top:0}.ss-content .ss-list{max-height:200px;overflow-x:hidden;overflow-y:auto;text-align:left}.ss-content .ss-list .ss-optgroup .ss-optgroup-label{padding:6px 10px 6px 10px;font-weight:700}.ss-content .ss-list .ss-optgroup .ss-option{padding:6px 6px 6px 25px}.ss-content .ss-list .ss-optgroup-label-selectable{cursor:pointer}.ss-content .ss-list .ss-optgroup-label-selectable:hover{color:#fff;background-color:#5897fb}.ss-content .ss-list .ss-option{padding:6px 10px 6px 10px;cursor:pointer;user-select:none}.ss-content .ss-list .ss-option *{display:inline-block}.ss-content .ss-list .ss-option.ss-highlighted,.ss-content .ss-list .ss-option:hover{color:#fff;background-color:#5897fb}.ss-content .ss-list .ss-option.ss-disabled{cursor:not-allowed;color:#dedede;background-color:#fff}.ss-content .ss-list .ss-option:not(.ss-disabled).ss-option-selected{color:#666;background-color:rgba(88,151,251,.1)}.ss-content .ss-list .ss-option.ss-hide{display:none}.ss-content .ss-list .ss-option .ss-search-highlight{background-color:#fffb8c} \ No newline at end of file diff --git a/app/static/vendors/slimselect/slimselect.min.js b/app/static/vendors/slimselect/slimselect.min.js deleted file mode 100644 index 8638634..0000000 --- a/app/static/vendors/slimselect/slimselect.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SlimSelect=t():e.SlimSelect=t()}(window,function(){return s={},n.m=i=[function(e,t,i){"use strict";function s(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}var n;t.__esModule=!0,t.hasClassInTree=function(e,t){function s(e,t){return t&&e&&e.classList&&e.classList.contains(t)?e:null}return s(e,t)||function e(t,i){return t&&t!==document?s(t,i)?t:e(t.parentNode,i):null}(e,t)},t.ensureElementInView=function(e,t){var i=e.scrollTop+e.offsetTop,s=i+e.clientHeight,n=t.offsetTop,a=n+t.clientHeight;n=window.innerHeight?"above":i?t:"below"},t.debounce=function(n,a,o){var l;return void 0===a&&(a=100),void 0===o&&(o=!1),function(){for(var e=[],t=0;t[^<>]*'+l+"")},t.kebabCase=function(e){var t=e.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,function(e){return"-"+e.toLowerCase()});return e[0]===e[0].toUpperCase()?t.substring(1):t},"function"!=typeof(n=window).CustomEvent&&(s.prototype=n.Event.prototype,n.CustomEvent=s)},function(e,t,i){"use strict";t.__esModule=!0;var s=(n.prototype.newOption=function(e){return{id:e.id?e.id:String(Math.floor(1e8*Math.random())),value:e.value?e.value:"",text:e.text?e.text:"",innerHTML:e.innerHTML?e.innerHTML:"",selected:!!e.selected&&e.selected,display:void 0===e.display||e.display,disabled:!!e.disabled&&e.disabled,placeholder:!!e.placeholder&&e.placeholder,class:e.class?e.class:void 0,data:e.data?e.data:{},mandatory:!!e.mandatory&&e.mandatory}},n.prototype.add=function(e){this.data.push({id:String(Math.floor(1e8*Math.random())),value:e.value,text:e.text,innerHTML:"",selected:!1,display:!0,disabled:!1,placeholder:!1,class:void 0,mandatory:e.mandatory,data:{}})},n.prototype.parseSelectData=function(){this.data=[];for(var e=0,t=this.main.select.element.childNodes;e *:not(.tabulator-print-fullscreen) { - display: none !important; -} - -.tabulator-print-table { - border-collapse: collapse; -} - -.tabulator-print-table .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #aaa; - border-bottom: 2px solid #aaa; -} - -.tabulator-print-table .tabulator-print-table-group { - box-sizing: border-box; - border-bottom: 1px solid #999; - border-right: 1px solid #aaa; - border-top: 1px solid #999; - padding: 5px; - padding-left: 10px; - background: #ccc; - font-weight: bold; - min-width: 100%; -} - -.tabulator-print-table .tabulator-print-table-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #666; - border-bottom: 0; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td { - padding-left: 30px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td { - padding-left: 50px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td { - padding-left: 70px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td { - padding-left: 90px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td { - padding-left: 110px !important; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #666; - vertical-align: middle; -} - -.tabulator-print-table .tabulator-print-table-group span { - margin-left: 10px; - color: #d00; -} - -.tabulator-print-table .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-print-table .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} diff --git a/app/static/vendors/tabulator/css.old/tabulator.min.css b/app/static/vendors/tabulator/css.old/tabulator.min.css deleted file mode 100644 index bafd6c7..0000000 --- a/app/static/vendors/tabulator/css.old/tabulator.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator{position:relative;border:1px solid #999;background-color:#888;font-size:14px;text-align:left;overflow:hidden;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#e6e6e6;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:#e6e6e6;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#cdcdcd;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#cdcdcd}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#f3f3f3!important;border-top:1px solid #aaa;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableHolder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableHolder:focus{outline:none}.tabulator .tabulator-tableHolder .tabulator-placeholder{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#ccc;font-weight:700;font-size:20px}.tabulator .tabulator-tableHolder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#e2e2e2!important}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-footer{padding:5px 10px;border-top:1px solid #999;background-color:#e6e6e6;text-align:right;color:#555;font-weight:700;white-space:nowrap;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-5px -10px 5px;text-align:left;background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer .tabulator-paginator{color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-loader{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:22px;background-color:#fff}.tabulator-row.tabulator-row-even{background-color:#efefef}.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #aaa;border-bottom:1px solid #aaa;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #aaa;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{padding:5px 10px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#efefef}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;background:#fff;border:1px solid #aaa;font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#333}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#333;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #aaa;padding:4px;padding-top:6px;color:#333;font-weight:700}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333} -/*# sourceMappingURL=tabulator.min.css.map */ diff --git a/app/static/vendors/tabulator/css.old/tabulator.min.css.map b/app/static/vendors/tabulator/css.old/tabulator.min.css.map deleted file mode 100644 index 47a4c5c..0000000 --- a/app/static/vendors/tabulator/css.old/tabulator.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tabulator.scss"],"names":[],"mappings":"AA0CA,WACC,kBAAkB,AAElB,sBAxCgB,AA0ChB,sBA3CqB,AA6CrB,eA3Ca,AA4Cb,gBAAgB,AAChB,gBAAe,AAMf,uBAAwB,CAwfxB,AAvgBD,iFAoBI,cAAc,CACd,AArBJ,0CA0BE,oBAAqB,CACrB,AA3BF,kCA8BE,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CACjB,AA/BF,6BAmCE,kBAAiB,AACjB,sBAAsB,AAEtB,WAAU,AAEV,6BAtEwB,AAuExB,yBA1E4B,AA2E5B,WA1EmB,AA2EnB,gBAAgB,AAEhB,mBAAmB,AACnB,gBAAe,AAEf,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAmPpB,AAtSF,qDAsDG,YAAY,CACZ,AAvDH,4CA2DG,qBAAoB,AACpB,kBAAiB,AACjB,sBAAqB,AACrB,4BA7FoB,AA8FpB,mBAhG2B,AAiG3B,gBAAe,AACf,sBAAsB,AACtB,eAAgB,CAqLhB,AAvPH,6DAqEI,kBAAkB,AAClB,sBApGsB,AAqGtB,mBAA8C,AAC9C,mBAAoB,CACpB,AAzEJ,mEA6EI,sBAAqB,AACrB,kBAAkB,AAClB,WAAW,CAgDX,AA/HJ,iGAmFK,aAAc,CAMd,AAzFL,uGAsFM,eAAe,AACf,UAAW,CACX,AAxFN,wFA6FK,sBAAqB,AACrB,WAAW,AAEX,mBAAmB,AACnB,gBAAgB,AAChB,uBAAuB,AACvB,qBAAqB,CAarB,AAhHL,gHAuGM,sBAAsB,AACtB,WAAW,AAEX,sBAAqB,AAErB,YAAW,AAEX,eAAgB,CAChB,AA/GN,oFAoHK,qBAAqB,AACrB,kBAAkB,AAClB,QAAO,AACP,UAAS,AACT,QAAQ,AACR,SAAS,AACT,kCAAkC,AAClC,mCAAmC,AACnC,4BArJmB,CAsJnB,AA7HL,0FAsIK,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AAEb,0BAxKkB,AAyKlB,gBAAgB,AAEhB,iBAAiB,CACjB,AA7IL,0FAmJK,YAAa,CACb,AApJL,qEAyJI,kBAAkB,AAClB,sBAAsB,AACtB,eAAc,AACd,WAAU,AACV,iBAAkB,CAiBlB,AA9KJ,8EAiKK,qBAAsB,CACtB,AAlKL,yEAqKK,cAAe,CACf,AAtKL,sFA0KM,QAAS,AACT,QAAS,CACT,AA5KN,oFAmLK,kBAAkB,CAClB,AApLL,qEAuLK,eAAc,AACd,wBAAoD,CACpD,AAzLL,uHA6LM,gBAAgB,AAChB,4BAvNkB,CAwNlB,AA/LN,sHAoMM,gBAAgB,AAChB,4BA/NgB,CAgOhB,AAtMN,uHA2MM,0BArOgB,AAsOhB,kBAAmB,CACnB,AA7MN,+GAqNM,uBAAyB,AAAzB,yBAAyB,AACzB,uBAAuB,AAEvB,oBAAY,AAAZ,aAAY,AACZ,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,sBAAsB,CACtB,AA3NN,oHAgOM,wBAAyB,CACzB,AAjON,2GAsOM,gBAAe,AACf,gBAAgB,CAChB,AAxON,uIA4OO,gBAAe,AACf,mBAAmB,CACnB,AA9OP,uGAmPM,qBAAqB,CACrB,AApPN,+CA0PG,qBAAqB,AACrB,kBAAkB,AAIlB,UAAW,CASX,AAxQH,qEAkQI,2BAtRgB,CAuRhB,AAnQJ,sEAsQI,0BA1RgB,CA2RhB,AAvQJ,qDA4QG,sBAAqB,AACrB,eAAc,AAEd,6BAAyD,AAUzD,0BA7SiB,AA8SjB,6BAzToB,AA2TpB,eAAgB,CAChB,AA7RH,oEAkRI,4BAAyD,CAKzD,AAvRJ,iGAqRK,YAAa,CACb,AAtRL,2DAgSG,cAAc,CAKd,AArSH,iEAmSI,YAAa,CACb,AApSJ,kCA0SE,kBAAiB,AACjB,WAAU,AACV,mBAAmB,AACnB,cAAa,AACb,gCAAiC,CAyDjC,AAvWF,wCAiTG,YAAa,CACb,AAlTH,yDAsTG,sBAAqB,AACrB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAOlB,UAAU,CAYV,AA3UH,wFA2TI,gBAAe,AACf,cAAc,CACd,AA7TJ,8DAkUI,qBAAqB,AAErB,cAAa,AACb,aAAY,AAEZ,WAAU,AACV,gBAAiB,AACjB,cAAe,CACf,AA1UJ,mDA+UG,kBAAiB,AACjB,qBAAoB,AACpB,sBAvWqB,AAwWrB,mBAAmB,AACnB,iBAAgB,AAChB,UAvWe,CAyXf,AAtWH,kFAyVK,gBAAiB,AACjB,4BAAwD,CASxD,AAnWL,sGA6VM,4BAjXc,CAkXd,AA9VN,yGAiWM,yBArXc,CAsXd,AAlWN,6BA6WE,iBAAgB,AAChB,0BApXwB,AAqXxB,yBAxX4B,AAyX5B,iBAAiB,AACjB,WAzXmB,AA0XnB,gBAAgB,AAChB,mBAAkB,AAClB,qBAAgB,AAAhB,iBAAgB,AAEhB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAgFpB,AAzcF,qDA4XG,sBAAqB,AACrB,wBAAuB,AACvB,sBAA2B,AAE3B,gBAAgB,AAEhB,6BAAyD,AAUzD,6BAhaiB,AAiajB,0BAjaiB,AAmajB,eAAgB,CAMhB,AArZH,oEAqYI,4BAAyD,CAKzD,AA1YJ,iGAwYK,YAAa,CACb,AAzYL,gEAkZI,mBAAkB,AAClB,kBAAkB,CAClB,AApZJ,kDAwZG,WAhakB,AAialB,oBAAmB,AACnB,oBAAmB,AACnB,iBAAiB,CACjB,AA5ZH,kDAgaG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA5aoB,AA6apB,iBAAiB,CACjB,AAvaH,8CA0aG,YAAY,CACZ,AA3aH,6CA+aG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA3boB,AA4bpB,kBAAiB,AAEjB,6BAA+B,CAiB/B,AAxcH,oDA0bI,UA/bmB,CAgcnB,AA3bJ,sDA8bI,UAAU,CACV,AA/bJ,kEAmcK,eAAc,AACd,0BAAyB,AACzB,UAAU,CACV,AAtcL,wCA6cE,kBAAiB,AACjB,QAAO,AACP,MAAK,AACL,SAAQ,AACR,SAAS,CAUT,AA3dF,6CAodG,OAAM,AACN,UAAU,CACV,AAtdH,8CAydG,gBAAgB,CAChB,AA1dH,6BAgeE,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAElB,MAAK,AACL,OAAM,AACN,YAAW,AAEX,YAAW,AACX,WAAU,AACV,0BAAyB,AACzB,iBAAiB,CA2BjB,AAtgBF,mDA+eG,qBAAoB,AAEpB,cAAa,AACb,kBAAiB,AAEjB,mBAAkB,AAElB,gBAAe,AACf,gBAAgB,AAChB,cAAc,CAad,AArgBH,qEA4fI,sBAAqB,AACrB,UAAU,CACV,AA9fJ,mEAkgBI,sBAAqB,AACrB,aAAa,CACb,AAMJ,eACC,kBAAkB,AAClB,sBAAsB,AACtB,gBAA0C,AAC1C,qBApiBuB,CAo5BvB,AApXD,kCAQE,wBAviB4B,CAwiB5B,AATF,0CAYE,sBAxiBsB,AAyiBtB,cAAe,CACf,AAdF,kCAiBE,wBA3iB6B,CA4iB7B,AAlBF,wCAqBE,yBA9iBkC,AA+iBlC,cAAe,CACf,AAvBF,oCA0BE,sBAAqB,AACrB,eAAe,CACf,AA5BF,gCA+BE,kBAAkB,AAElB,0BA/jBkB,AAgkBlB,6BAhkBkB,AAkkBlB,oBAAoB,AACpB,UAAU,CACV,AAtCF,4CA0CE,kBAAiB,AACjB,QAAO,AACP,SAAQ,AACR,OAAM,AACN,UAAU,CAUV,AAxDF,iDAiDG,MAAK,AACL,WAAW,CACX,AAnDH,kDAsDG,gBAAgB,CAChB,AAvDH,iCA2DE,qBAAqB,AACrB,kBAAkB,AAElB,yBAAyB,AAEzB,UAAW,CASX,AAzEF,uDAmEG,2BAjmBiB,CAkmBjB,AApEH,wDAuEG,0BArmBiB,CAsmBjB,AAxEH,8CA4EE,sBAAqB,AAErB,YAAW,AAEX,0BA9mBkB,AA+mBlB,4BA/mBkB,CAkoBlB,AApGF,oDAoFG,YAAY,CACZ,AArFH,oDAwFG,cAtoBW,CAipBX,AAnGH,0DA4FK,iBAAkB,CAKlB,AAjGL,wEA+FM,kBAAkB,CAClB,AAhGN,+BAwGE,qBAAoB,AACpB,kBAAkB,AAClB,sBAAqB,AACrB,YAAW,AACX,4BA1oBkB,AA2oBlB,sBAAqB,AACrB,mBAAkB,AAClB,gBAAe,AACf,sBAAsB,CAyLtB,AAzSF,iDAmHG,yBA1oBkB,AA2oBlB,SAAU,CAMV,AA1HH,+GAuHI,WAAU,AACV,sBAAsB,CACtB,AAzHJ,yDA6HG,qBAnpBgB,CA0pBhB,AApIH,+HA+HI,WAAU,AACV,uBAAsB,AAEtB,UAxpBe,CAypBf,AAnIJ,6EAyII,YAAa,CACb,AA1IJ,oDA+IG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAcpB,AApKH,8EA0JI,SAAS,CAST,AAnKJ,wGA8JK,WAAU,AACV,WAAU,AACV,eAAc,AACd,eAAe,CACf,AAlKL,2DAuKG,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BAhtBiB,AAitBjB,4BAjtBiB,CAktBjB,AApLH,4DAwLG,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBA/tBe,AAguBf,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAmDf,AAzPH,kEAyMI,eAAc,AACd,yBAA4B,CAC5B,AA3MJ,kGA8MI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAjOJ,wGAuNK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA5vBa,CA6vBb,AAhOL,gGAoOI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAvwBc,CAoxBd,AAvPJ,sGA6OK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAlxBa,CAmxBb,AAtPL,qEA4PG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,YAAW,AACX,WAAU,AAEV,mBAAkB,AAClB,gBAAe,AAEf,WA3yBqB,AA4yBrB,gBAAgB,AAChB,eAAe,CAmBf,AAhSH,2EAgRI,UAAU,CACV,AAjRJ,sHAqRK,eAAe,CACf,AAtRL,sOA8RI,YAAY,CACZ,AA/RJ,wDAmSG,qBAAqB,AACrB,YAAW,AACX,WAAU,AAEV,kBAAkB,CAClB,AAxSH,+BA6SE,sBAAqB,AACrB,6BAA4B,AAC5B,4BA70BkB,AA80BlB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,gBAAe,AACf,gBAAgB,AAEhB,cAAe,CA4Df,AAlXF,qCAyTG,eAAc,AACd,+BAA+B,CAC/B,AA3TH,wEAgUI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BAv2BkB,AAw2BlB,eAAgB,CAChB,AArUJ,uDA0UG,iBAAiB,CACjB,AA3UH,uDA8UG,iBAAiB,CACjB,AA/UH,uDAkVG,iBAAiB,CACjB,AAnVH,uDAsVG,iBAAiB,CACjB,AAvVH,uDA0VG,kBAAkB,CAClB,AA3VH,uDA8VG,oBAAqB,CACrB,AA/VH,gDAmWG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BA94BmB,AA+4BnB,qBAAqB,CACrB,AA5WH,oCA+WG,iBAAgB,AAChB,UAAU,CACV,AAKH,gBACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,gBA35BuB,AA45BvB,sBA15BmB,AA25BnB,oCAAuC,AAEvC,eA76Ba,AA+6Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CAqBd,AAnCD,qCAkBE,iBAAgB,AAEhB,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CAUjB,AA9BF,kEAuBG,UAAW,CACX,AAxBH,8EA2BG,eAAe,AACf,kBAj7B2B,CAk7B3B,AA7BH,0CAiCE,yBAr7BkB,CAs7BlB,AAGF,4BACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,iBAAgB,AAEhB,gBAl8BuB,AAm8BvB,sBAj8BmB,AAm8BnB,eAn9Ba,AAq9Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CA4Cd,AA3DD,6DAkBE,YAAW,AAEX,UA58BgB,CAi+BhB,AAzCF,oEAuBG,WAl9BqB,AAm9BrB,kBA18BkB,CA+8BlB,AA7BH,4EA2BI,oCAt9BoB,CAu9BpB,AA5BJ,qEAgCG,yBAl9BkB,CAm9BlB,AAjCH,mEAoCG,eAAc,AAEd,WAj+BqB,AAk+BrB,kBAz9BkB,CA09BlB,AAxCH,+DA4CE,YAAW,AAEX,WAt+BgB,AAu+BhB,iBAAkB,CAClB,AAhDF,8DAmDE,6BA5+BkB,AA8+BlB,YAAW,AACX,gBAAe,AAEf,WAh/BgB,AAi/BhB,eAAgB,CAChB,AAKF,4BACC,kBAAkB,AAClB,MAAK,AACL,SAAQ,AACR,OAAM,AACN,QAAO,AAEP,aAAc,CACd,AAED,uEACC,sBAAuB,CACvB,AAED,uBACC,wBAAyB,CAwKzB,AAzKD,mDAIE,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BArhCkB,AAshClB,4BAthCkB,CAuhClB,AAjBF,oDAqBE,sBAAqB,AACrB,6BAA4B,AAC5B,4BA7hCkB,AA8hClB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,gBAAe,AACf,gBAAgB,AAEhB,cAAe,CAsEf,AApGF,0DAiCG,eAAc,AACd,+BAA+B,CAC/B,AAnCH,6FAwCI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BAvjCkB,AAwjClB,eAAgB,CAChB,AA7CJ,+EAmDI,2BAA4B,CAC5B,AApDJ,+EAyDI,2BAA4B,CAC5B,AA1DJ,+EA+DI,2BAA4B,CAC5B,AAhEJ,+EAqEI,2BAA4B,CAC5B,AAtEJ,+EA2EI,4BAA6B,CAC7B,AA5EJ,4EAgFG,oBAAqB,CACrB,AAjFH,qEAqFG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BAxmCmB,AAymCnB,qBAAqB,CACrB,AA9FH,yDAiGG,iBAAgB,AAChB,UAAU,CACV,AAnGH,oDAwGE,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBAvnCgB,AAwnChB,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAkDf,AAxKF,0DAyHG,eAAc,AACd,yBAA4B,CAC5B,AA3HH,0FA8HG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAjJH,gGAuII,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAppCc,CAqpCd,AAhJJ,wFAoJG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eA/pCe,CA4qCf,AAvKH,8FA6JI,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA1qCc,CA2qCd","file":"tabulator.min.css","sourcesContent":["/* Tabulator v4.7.0 (c) Oliver Folkerd */\n\n\r\n//Main Theme Variables\r\n$backgroundColor: #888 !default; //background color of tabulator\r\n$borderColor:#999 !default; //border to tabulator\r\n$textSize:14px !default; //table text size\r\n\r\n//header themeing\r\n$headerBackgroundColor:#e6e6e6 !default; //border to tabulator\r\n$headerTextColor:#555 !default; //header text colour\r\n$headerBorderColor:#aaa !default; //header border color\r\n$headerSeperatorColor:#999 !default; //header bottom seperator color\r\n$headerMargin:4px !default; //padding round header\r\n\r\n//column header arrows\r\n$sortArrowActive: #666 !default;\r\n$sortArrowInactive: #bbb !default;\r\n\r\n//row themeing\r\n$rowBackgroundColor:#fff !default; //table row background color\r\n$rowAltBackgroundColor:#EFEFEF !default; //table row background color\r\n$rowBorderColor:#aaa !default; //table border color\r\n$rowTextColor:#333 !default; //table text color\r\n$rowHoverBackground:#bbb !default; //row background color on hover\r\n\r\n$rowSelectedBackground: #9ABCEA !default; //row background color when selected\r\n$rowSelectedBackgroundHover: #769BCC !default;//row background color when selected and hovered\r\n\r\n$editBoxColor:#1D68CD !default; //border color for edit boxes\r\n$errorColor:#dd0000 !default; //error indication\r\n\r\n//footer themeing\r\n$footerBackgroundColor:#e6e6e6 !default; //border to tabulator\r\n$footerTextColor:#555 !default; //footer text colour\r\n$footerBorderColor:#aaa !default; //footer border color\r\n$footerSeperatorColor:#999 !default; //footer bottom seperator color\r\n$footerActiveColor:#d00 !default; //footer bottom active text color\r\n\r\n\r\n\r\n//Tabulator Containing Element\r\n.tabulator{\r\n\tposition: relative;\r\n\r\n\tborder: 1px solid $borderColor;\r\n\r\n\tbackground-color: $backgroundColor;\r\n\r\n\tfont-size:$textSize;\r\n\ttext-align: left;\r\n\toverflow:hidden;\r\n\r\n\t-webkit-transform: translatez(0);\r\n\t-moz-transform: translatez(0);\r\n\t-ms-transform: translatez(0);\r\n\t-o-transform: translatez(0);\r\n\ttransform: translatez(0);\r\n\r\n\t&[tabulator-layout=\"fitDataFill\"]{\r\n\t\t.tabulator-tableHolder{\r\n\t\t\t.tabulator-table{\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitDataTable\"]{\r\n\t\tdisplay: inline-block;\r\n\t}\r\n\r\n\t&.tabulator-block-select{\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t//column header containing element\r\n\t.tabulator-header{\r\n\t\tposition:relative;\r\n\t\tbox-sizing: border-box;\r\n\r\n\t\twidth:100%;\r\n\r\n\t\tborder-bottom:1px solid $headerSeperatorColor;\r\n\t\tbackground-color: $headerBackgroundColor;\r\n\t\tcolor: $headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:hidden;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t&.tabulator-header-hidden{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\t//individual column header element\r\n\t\t.tabulator-col{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition:relative;\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tborder-right:1px solid $headerBorderColor;\r\n\t\t\tbackground:$headerBackgroundColor;\r\n\t\t\ttext-align:left;\r\n\t\t\tvertical-align: bottom;\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&.tabulator-moving{\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tborder:1px solid $headerSeperatorColor;\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%);\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\r\n\t\t\t//hold content of column header\r\n\t\t\t.tabulator-col-content{\r\n\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding:4px;\r\n\r\n\t\t\t\t//header menu button\r\n\t\t\t\t.tabulator-header-menu-button{\r\n\t\t\t\t\tpadding: 0 8px;\r\n\r\n\t\t\t\t\t&:hover{\r\n\t\t\t\t\t\tcursor: pointer;\r\n\t\t\t\t\t\topacity: .6;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//hold title of column header\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\twhite-space: nowrap;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttext-overflow: ellipsis;\r\n\t\t\t\t\tvertical-align:bottom;\r\n\r\n\t\t\t\t\t//element to hold title editor\r\n\t\t\t\t\t.tabulator-title-editor{\r\n\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\t\tborder:1px solid #999;\r\n\r\n\t\t\t\t\t\tpadding:1px;\r\n\r\n\t\t\t\t\t\tbackground: #fff;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//column sorter arrow\r\n\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\tdisplay: inline-block;\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\ttop:9px;\r\n\t\t\t\t\tright:8px;\r\n\t\t\t\t\twidth: 0;\r\n\t\t\t\t\theight: 0;\r\n\t\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//complex header column group\r\n\t\t\t&.tabulator-col-group{\r\n\r\n\t\t\t\t//gelement to hold sub columns in column group\r\n\t\t\t\t.tabulator-col-group-cols{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tdisplay: flex;\r\n\r\n\t\t\t\t\tborder-top:1px solid $headerBorderColor;\r\n\t\t\t\t\toverflow: hidden;\r\n\r\n\t\t\t\t\tmargin-right:-1px;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//hide left resize handle on first column\r\n\t\t\t&:first-child{\r\n\t\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//header filter containing element\r\n\t\t\t.tabulator-header-filter{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\tmargin-top:2px;\r\n\t\t\t\twidth:100%;\r\n\t\t\t\ttext-align: center;\r\n\r\n\t\t\t\t//styling adjustment for inbuilt editors\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\theight:auto !important;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsvg{\r\n\t\t\t\t\tmargin-top: 3px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput{\r\n\t\t\t\t\t&::-ms-clear {\r\n\t\t\t\t\t\twidth : 0;\r\n\t\t\t\t\t\theight: 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//styling child elements for sortable columns\r\n\t\t\t&.tabulator-sortable{\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tpadding-right:25px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"none\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"asc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowActive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"desc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\t\t\tborder-bottom: none;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t&.tabulator-col-vertical{\r\n\t\t\t\t.tabulator-col-content{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\twriting-mode: vertical-rl;\r\n\t\t\t\t\t\ttext-orientation: mixed;\r\n\r\n\t\t\t\t\t\tdisplay:flex;\r\n\t\t\t\t\t\talign-items:center;\r\n\t\t\t\t\t\tjustify-content:center;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\ttransform: rotate(180deg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-sortable{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\tpadding-top:20px;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\t\tpadding-bottom:20px;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\t\tright:calc(50% - 6px);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tposition: absolute;\r\n\r\n\t\t\t// background-color: inherit;\r\n\r\n\t\t\tz-index: 10;\r\n\r\n\t\t\t&.tabulator-frozen-left{\r\n\t\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-frozen-right{\r\n\t\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\tbackground:lighten($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:lighten($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\t\t\tborder-bottom:1px solid $headerBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen-rows-holder{\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\t&:empty{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//scrolling element to hold table\r\n\t.tabulator-tableHolder{\r\n\t\tposition:relative;\r\n\t\twidth:100%;\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:auto;\r\n\t\t-webkit-overflow-scrolling: touch;\r\n\r\n\t\t&:focus{\r\n\t\t\toutline: none;\r\n\t\t}\r\n\r\n\t\t//default placeholder element\r\n\t\t.tabulator-placeholder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t&[tabulator-render-mode=\"virtual\"]{\r\n\t\t\t\tmin-height:100%;\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\r\n\t\t\twidth:100%;\r\n\r\n\t\t\tspan{\r\n\t\t\t\tdisplay: inline-block;\r\n\r\n\t\t\t\tmargin:0 auto;\r\n\t\t\t\tpadding:10px;\r\n\r\n\t\t\t\tcolor:#ccc;\r\n\t\t\t\tfont-weight: bold;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//element to hold table rows\r\n\t\t.tabulator-table{\r\n\t\t\tposition:relative;\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tbackground-color:$rowBackgroundColor;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\toverflow:visible;\r\n\t\t\tcolor:$rowTextColor;\r\n\r\n\t\t\t//row element\r\n\t\t\t.tabulator-row{\r\n\t\t\t\t&.tabulator-calcs{\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t\tbackground:darken($rowAltBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t\t&.tabulator-calcs-top{\r\n\t\t\t\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-calcs-bottom{\r\n\t\t\t\t\t\tborder-top:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t//footer element\r\n\t.tabulator-footer{\r\n\t\tpadding:5px 10px;\r\n\t\tborder-top:1px solid $footerSeperatorColor;\r\n\t\tbackground-color: $footerBackgroundColor;\r\n\t\ttext-align: right;\r\n\t\tcolor: $footerTextColor;\r\n\t\tfont-weight:bold;\r\n\t\twhite-space:nowrap;\r\n\t\tuser-select:none;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\twidth:calc(100% + 20px);\r\n\t\t\tmargin:-5px -10px 5px -10px;\r\n\r\n\t\t\ttext-align: left;\r\n\r\n\t\t\tbackground:lighten($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:lighten($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-bottom:1px solid $rowBorderColor;\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&:only-child{\r\n\t\t\t\tmargin-bottom:-5px;\r\n\t\t\t\tborder-bottom:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-paginator{\r\n\t\t\tcolor: $footerTextColor;\r\n\t\t\tfont-family:inherit;\r\n\t\t\tfont-weight:inherit;\r\n\t\t\tfont-size:inherit;\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-page-size{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 5px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\t\t}\r\n\r\n\t\t.tabulator-pages{\r\n\t\t\tmargin:0 7px;\r\n\t\t}\r\n\r\n\t\t//pagination button\r\n\t\t.tabulator-page{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 2px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\r\n\t\t\tbackground:rgba(255,255,255,.2);\r\n\r\n\t\t\t&.active{\r\n\t\t\t\tcolor:$footerActiveColor;\r\n\t\t\t}\r\n\r\n\t\t\t&:disabled{\r\n\t\t\t\topacity:.5;\r\n\t\t\t}\r\n\r\n\t\t\t&:not(.disabled){\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground:rgba(0,0,0,.2);\r\n\t\t\t\t\tcolor:#fff;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//column resize handles\r\n\t.tabulator-col-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\ttop:0;\r\n\t\tbottom:0;\r\n\t\twidth:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\tleft:0;\r\n\t\t\tright:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ew-resize;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//holding div that contains loader and covers tabulator element to prevent interaction\r\n\t.tabulator-loader{\r\n\t\tposition:absolute;\r\n\t\tdisplay: flex;\r\n\t\talign-items:center;\r\n\r\n\t\ttop:0;\r\n\t\tleft:0;\r\n\t\tz-index:100;\r\n\r\n\t\theight:100%;\r\n\t\twidth:100%;\r\n\t\tbackground:rgba(0,0,0,.4);\r\n\t\ttext-align:center;\r\n\r\n\t\t//loading message element\r\n\t\t.tabulator-loader-msg{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 auto;\r\n\t\t\tpadding:10px 20px;\r\n\r\n\t\t\tborder-radius:10px;\r\n\r\n\t\t\tbackground:#fff;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:16px;\r\n\r\n\t\t\t//loading message\r\n\t\t\t&.tabulator-loading{\r\n\t\t\t\tborder:4px solid #333;\r\n\t\t\t\tcolor:#000;\r\n\t\t\t}\r\n\r\n\t\t\t//error message\r\n\t\t\t&.tabulator-error{\r\n\t\t\t\tborder:4px solid #D00;\r\n\t\t\t\tcolor:#590000;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//row element\r\n.tabulator-row{\r\n\tposition: relative;\r\n\tbox-sizing: border-box;\r\n\tmin-height:$textSize + ($headerMargin * 2);\r\n\tbackground-color: $rowBackgroundColor;\r\n\r\n\r\n\t&.tabulator-row-even{\r\n\t\tbackground-color: $rowAltBackgroundColor;\r\n\t}\r\n\r\n\t&.tabulator-selectable:hover{\r\n\t\tbackground-color:$rowHoverBackground;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-selected{\r\n\t\tbackground-color:$rowSelectedBackground;\r\n\t}\r\n\r\n\t&.tabulator-selected:hover{\r\n\t\tbackground-color:$rowSelectedBackgroundHover;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-row-moving{\r\n\t\tborder:1px solid #000;\r\n\t\tbackground:#fff;\r\n\t}\r\n\r\n\t&.tabulator-moving{\r\n\t\tposition: absolute;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpointer-events: none;\r\n\t\tz-index:15;\r\n\t}\r\n\r\n\t//row resize handles\r\n\t.tabulator-row-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\tbottom:0;\r\n\t\tleft:0;\r\n\t\theight:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\ttop:0;\r\n\t\t\tbottom:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ns-resize;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-frozen{\r\n\t\tdisplay: inline-block;\r\n\t\tposition: absolute;\r\n\r\n\t\tbackground-color: inherit;\r\n\r\n\t\tz-index: 10;\r\n\r\n\t\t&.tabulator-frozen-left{\r\n\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t&.tabulator-frozen-right{\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-responsive-collapse{\r\n\t\tbox-sizing:border-box;\r\n\r\n\t\tpadding:5px;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t&:empty{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\ttable{\r\n\t\t\tfont-size:$textSize;\r\n\r\n\t\t\ttr{\r\n\t\t\t\ttd{\r\n\t\t\t\t\tposition: relative;\r\n\r\n\t\t\t\t\t&:first-of-type{\r\n\t\t\t\t\t\tpadding-right:10px;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//cell element\r\n\t.tabulator-cell{\r\n\t\tdisplay:inline-block;\r\n\t\tposition: relative;\r\n\t\tbox-sizing:border-box;\r\n\t\tpadding:4px;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tvertical-align:middle;\r\n\t\twhite-space:nowrap;\r\n\t\toverflow:hidden;\r\n\t\ttext-overflow:ellipsis;\r\n\r\n\t\t&.tabulator-editing{\r\n\t\t\tborder:1px solid $editBoxColor;\r\n\t\t\tpadding: 0;\r\n\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-validation-fail{\r\n\t\t\tborder:1px solid $errorColor;\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\r\n\t\t\t\tcolor: $errorColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//hide left resize handle on first column\r\n\t\t&:first-child{\r\n\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//movable row handle\r\n\t\t&.tabulator-row-handle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\t//handle holder\r\n\t\t\t.tabulator-row-handle-box{\r\n\t\t\t\twidth:80%;\r\n\r\n\t\t\t\t//Hamburger element\r\n\t\t\t\t.tabulator-row-handle-bar{\r\n\t\t\t\t\twidth:100%;\r\n\t\t\t\t\theight:3px;\r\n\t\t\t\t\tmargin-top:2px;\r\n\t\t\t\t\tbackground:#666;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-branch{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:9px;\r\n\t\t\twidth:7px;\r\n\r\n\t\t\tmargin-top:-9px;\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control{\r\n\r\n\t\t\tdisplay:inline-flex;\r\n\t\t\tjustify-content:center;\r\n\t\t\talign-items:center;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:11px;\r\n\t\t\twidth:11px;\r\n\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder:1px solid $rowTextColor;\r\n\t\t\tborder-radius:2px;\r\n\t\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\t\toverflow:hidden;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\tcursor:pointer;\r\n\t\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: transparent;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-expand{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-responsive-collapse-toggle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\theight:15px;\r\n\t\t\twidth:15px;\r\n\r\n\t\t\tborder-radius:20px;\r\n\t\t\tbackground:#666;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:1.1em;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\topacity:.7;\r\n\t\t\t}\r\n\r\n\t\t\t&.open{\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\t\tdisplay:initial;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-open{\r\n\t\t\t\t\tdisplay:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-traffic-light{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\theight:14px;\r\n\t\t\twidth:14px;\r\n\r\n\t\t\tborder-radius:14px;\r\n\t\t}\r\n\t}\r\n\r\n\t//row grouping element\r\n\t&.tabulator-group{\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#ccc;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\tpadding-left:30px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\tpadding-left:50px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\tpadding-left:70px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\tpadding-left:90px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\tpadding-left:110px;\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#d00;\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n.tabulator-menu{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\tbox-shadow: 0 0 5px 0 rgba(0, 0, 0, .2);\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-menu-item{\r\n\r\n\t\tpadding:5px 10px;\r\n\r\n\t\tuser-select: none;\r\n\r\n\t\t&.tabulator-menu-item-disabled{\r\n\t\t\topacity: .5;\r\n\t\t}\r\n\r\n\t\t&:not(.tabulator-menu-item-disabled):hover{\r\n\t\t\tcursor: pointer;\r\n\t\t\tbackground: $rowAltBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-menu-separator{\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t}\r\n}\r\n\r\n.tabulator-edit-select-list{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tmax-height:200px;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-edit-select-list-item{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\r\n\t\t&.active{\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\r\n\t\t\t&.focused{\r\n\t\t\t\toutline:1px solid rgba($rowBackgroundColor, .5);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.focused{\r\n\t\t\toutline:1px solid $editBoxColor;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-notice{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\ttext-align: center;\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-group{\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpadding:4px;\r\n\t\tpadding-top:6px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\tfont-weight:bold;\r\n\t}\r\n}\r\n\r\n// Table print styling\r\n\r\n.tabulator-print-fullscreen{\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tbottom:0;\r\n\tleft:0;\r\n\tright:0;\r\n\r\n\tz-index: 10000;\r\n}\r\n\r\nbody.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){\r\n\tdisplay:none !important;\r\n}\r\n\r\n.tabulator-print-table{\r\n\tborder-collapse: collapse;\r\n\r\n\t.tabulator-data-tree-branch{\r\n\t\tdisplay:inline-block;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:9px;\r\n\t\twidth:7px;\r\n\r\n\t\tmargin-top:-9px;\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\tborder-left:2px solid $rowBorderColor;\r\n\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t}\r\n\r\n\t//row grouping element\r\n\t.tabulator-print-table-group{\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#ccc;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:30px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:50px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:70px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:90px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:110px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#d00;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-data-tree-control{\r\n\r\n\t\tdisplay:inline-flex;\r\n\t\tjustify-content:center;\r\n\t\talign-items:center;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:11px;\r\n\t\twidth:11px;\r\n\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder:1px solid $rowTextColor;\r\n\t\tborder-radius:2px;\r\n\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\toverflow:hidden;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: transparent;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-expand{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/app/static/vendors/tabulator/css/tabulator_midnight.css b/app/static/vendors/tabulator/css/tabulator_midnight.css deleted file mode 100644 index bc9796c..0000000 --- a/app/static/vendors/tabulator/css/tabulator_midnight.css +++ /dev/null @@ -1,999 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator { - position: relative; - border: 1px solid #293146; - background-color: #222; - overflow: hidden; - font-size: 14px; - text-align: left; - -ms-transform: translatez(0); - transform: translatez(0); -} - -.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table { - min-width: 100%; -} - -.tabulator[tabulator-layout="fitDataTable"] { - display: inline-block; -} - -.tabulator.tabulator-block-select { - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator .tabulator-header { - position: relative; - box-sizing: border-box; - width: 100%; - border-bottom: 1px solid #999; - background-color: #293146; - color: #fff; - font-weight: bold; - white-space: nowrap; - overflow: hidden; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-header.tabulator-header-hidden { - display: none; -} - -.tabulator .tabulator-header .tabulator-col { - display: inline-block; - position: relative; - box-sizing: border-box; - border-right: 1px solid #aaa; - background-color: #293146; - text-align: left; - vertical-align: bottom; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-moving { - position: absolute; - border: 1px solid #999; - background: #1a1a1a; - pointer-events: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content { - box-sizing: border-box; - position: relative; - padding: 4px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button { - padding: 0 8px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover { - cursor: pointer; - opacity: .6; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { - box-sizing: border-box; - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: bottom; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor { - box-sizing: border-box; - width: 100%; - border: 1px solid #999; - padding: 1px; - background: #444; - color: #fff; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow { - display: inline-block; - position: absolute; - top: 9px; - right: 8px; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { - position: relative; - display: -ms-flexbox; - display: flex; - border-top: 1px solid #aaa; - overflow: hidden; - margin-right: -1px; -} - -.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { - position: relative; - box-sizing: border-box; - margin-top: 2px; - width: 100%; - text-align: center; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea { - height: auto !important; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg { - margin-top: 3px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input, .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select { - border: 1px solid #999; - background: #444; - color: #fff; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear { - width: 0; - height: 0; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title { - padding-right: 25px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { - cursor: pointer; - background-color: #1a1a1a; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #666; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow { - border-top: 6px solid #666; - border-bottom: none; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title { - -ms-writing-mode: tb-rl; - writing-mode: vertical-rl; - text-orientation: mixed; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title { - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title { - padding-right: 0; - padding-top: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title { - padding-right: 0; - padding-bottom: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow { - right: calc(50% - 6px); -} - -.tabulator .tabulator-header .tabulator-frozen { - display: inline-block; - position: absolute; - z-index: 10; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #888; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #888; -} - -.tabulator .tabulator-header .tabulator-calcs-holder { - box-sizing: border-box; - min-width: 600%; - background: #1a1a1a !important; - border-top: 1px solid #888; - border-bottom: 1px solid #aaa; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row { - background: #1a1a1a !important; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder { - min-width: 600%; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty { - display: none; -} - -.tabulator .tabulator-tableHolder { - position: relative; - width: 100%; - white-space: nowrap; - overflow: auto; - -webkit-overflow-scrolling: touch; -} - -.tabulator .tabulator-tableHolder:focus { - outline: none; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder { - box-sizing: border-box; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode="virtual"] { - min-height: 100%; - min-width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder span { - display: inline-block; - margin: 0 auto; - padding: 10px; - color: #eee; - font-weight: bold; - font-size: 20px; -} - -.tabulator .tabulator-tableHolder .tabulator-table { - position: relative; - display: inline-block; - background-color: #666; - white-space: nowrap; - overflow: visible; - color: #fff; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs { - font-weight: bold; - background: #373737 !important; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top { - border-bottom: 2px solid #888; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom { - border-top: 2px solid #888; -} - -.tabulator .tabulator-col-resize-handle { - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 5px; -} - -.tabulator .tabulator-col-resize-handle.prev { - left: 0; - right: auto; -} - -.tabulator .tabulator-col-resize-handle:hover { - cursor: ew-resize; -} - -.tabulator .tabulator-footer { - padding: 5px 10px; - border-top: 1px solid #999; - background-color: #293146; - text-align: right; - color: #293146; - font-weight: bold; - white-space: nowrap; - -ms-user-select: none; - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder { - box-sizing: border-box; - width: calc(100% + 20px); - margin: -5px -10px 5px -10px; - text-align: left; - background: #262626 !important; - border-bottom: 1px solid #888; - border-top: 1px solid #888; - overflow: hidden; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { - background: #262626 !important; - color: #fff; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder:only-child { - margin-bottom: -5px; - border-bottom: none; -} - -.tabulator .tabulator-footer .tabulator-paginator label { - color: #fff; -} - -.tabulator .tabulator-footer .tabulator-page-size { - display: inline-block; - margin: 0 5px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; -} - -.tabulator .tabulator-footer .tabulator-pages { - margin: 0 7px; -} - -.tabulator .tabulator-footer .tabulator-page { - display: inline-block; - margin: 0 2px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; - background: rgba(255, 255, 255, 0.2); - color: #293146; - font-family: inherit; - font-weight: inherit; - font-size: inherit; -} - -.tabulator .tabulator-footer .tabulator-page.active { - color: #fff; -} - -.tabulator .tabulator-footer .tabulator-page:disabled { - opacity: .5; -} - -.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); - color: #fff; -} - -.tabulator .tabulator-loader { - position: absolute; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - top: 0; - left: 0; - z-index: 100; - height: 100%; - width: 100%; - background: rgba(0, 0, 0, 0.4); - text-align: center; -} - -.tabulator .tabulator-loader .tabulator-loader-msg { - display: inline-block; - margin: 0 auto; - padding: 10px 20px; - border-radius: 10px; - background: #fff; - font-weight: bold; - font-size: 16px; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading { - border: 4px solid #293146; - color: #000; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error { - border: 4px solid #D00; - color: #590000; -} - -.tabulator-row { - position: relative; - box-sizing: border-box; - min-height: 22px; - background-color: #666; -} - -.tabulator-row:nth-child(even) { - background-color: #444; -} - -.tabulator-row.tabulator-selectable:hover { - background-color: #999; - cursor: pointer; -} - -.tabulator-row.tabulator-selected { - background-color: #000; -} - -.tabulator-row.tabulator-selected:hover { - background-color: #888; - cursor: pointer; -} - -.tabulator-row.tabulator-moving { - position: absolute; - border-top: 1px solid #888; - border-bottom: 1px solid #888; - pointer-events: none !important; - z-index: 15; -} - -.tabulator-row .tabulator-row-resize-handle { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height: 5px; -} - -.tabulator-row .tabulator-row-resize-handle.prev { - top: 0; - bottom: auto; -} - -.tabulator-row .tabulator-row-resize-handle:hover { - cursor: ns-resize; -} - -.tabulator-row .tabulator-frozen { - display: inline-block; - position: absolute; - background-color: inherit; - z-index: 10; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #888; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #888; -} - -.tabulator-row .tabulator-responsive-collapse { - box-sizing: border-box; - padding: 5px; - border-top: 1px solid #888; - border-bottom: 1px solid #888; -} - -.tabulator-row .tabulator-responsive-collapse:empty { - display: none; -} - -.tabulator-row .tabulator-responsive-collapse table { - font-size: 14px; -} - -.tabulator-row .tabulator-responsive-collapse table tr td { - position: relative; -} - -.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type { - padding-right: 10px; -} - -.tabulator-row .tabulator-cell { - display: inline-block; - position: relative; - box-sizing: border-box; - padding: 4px; - border-right: 1px solid #888; - vertical-align: middle; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.tabulator-row .tabulator-cell.tabulator-editing { - border: 1px solid #999; - padding: 0; -} - -.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select { - border: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail { - border: 1px solid #dd0000; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select { - border: 1px; - background: transparent; - color: #dd0000; -} - -.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box { - width: 80%; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar { - width: 100%; - height: 3px; - margin-top: 2px; - background: #666; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #888; - border-bottom: 2px solid #888; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #fff; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #fff; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #fff; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #fff; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - height: 15px; - width: 15px; - border-radius: 20px; - background: #fff; - color: #666; - font-weight: bold; - font-size: 1.1em; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover { - opacity: .7; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close { - display: initial; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-traffic-light { - display: inline-block; - height: 14px; - width: 14px; - border-radius: 14px; -} - -.tabulator-row.tabulator-group { - box-sizing: border-box; - border-bottom: 1px solid #999; - border-right: 1px solid #888; - border-top: 1px solid #999; - padding: 5px; - padding-left: 10px; - background: #ccc; - font-weight: bold; - color: #293146; - min-width: 100%; -} - -.tabulator-row.tabulator-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #666; - border-bottom: 0; -} - -.tabulator-row.tabulator-group.tabulator-group-level-1 { - padding-left: 30px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-2 { - padding-left: 50px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-3 { - padding-left: 70px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-4 { - padding-left: 90px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-5 { - padding-left: 110px; -} - -.tabulator-row.tabulator-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-row.tabulator-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #666; - vertical-align: middle; -} - -.tabulator-row.tabulator-group span { - margin-left: 10px; - color: #666; -} - -.tabulator-menu { - position: absolute; - display: inline-block; - box-sizing: border-box; - background: #666; - border: 1px solid #888; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2); - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-menu .tabulator-menu-item { - padding: 5px 10px; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled { - opacity: .5; -} - -.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover { - cursor: pointer; - background: #444; -} - -.tabulator-menu .tabulator-menu-separator { - border-top: 1px solid #888; -} - -.tabulator-edit-select-list { - position: absolute; - display: inline-block; - box-sizing: border-box; - max-height: 200px; - background: #fff; - border: 1px solid #888; - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item { - padding: 4px; - color: #666; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active { - color: #999; - background: #444; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused { - outline: 1px solid rgba(153, 153, 153, 0.5); -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.focused { - outline: 1px solid #444; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item:hover { - cursor: pointer; - color: #999; - background: #666; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-notice { - padding: 4px; - color: #fff; - text-align: center; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-group { - border-bottom: 1px solid #888; - padding: 4px; - padding-top: 6px; - color: #fff; - font-weight: bold; -} - -.tabulator-print-fullscreen { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 10000; -} - -body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) { - display: none !important; -} - -.tabulator-print-table { - border-collapse: collapse; -} - -.tabulator-print-table .tabulator-print-table-group { - box-sizing: border-box; - border-bottom: 1px solid #999; - border-right: 1px solid #888; - border-top: 1px solid #999; - padding: 5px; - padding-left: 10px; - background: #ccc; - font-weight: bold; - color: #293146; - min-width: 100%; -} - -.tabulator-print-table .tabulator-print-table-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #666; - border-bottom: 0; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td { - padding-left: 30px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td { - padding-left: 50px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td { - padding-left: 70px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td { - padding-left: 90px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td { - padding-left: 110px !important; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #666; - vertical-align: middle; -} - -.tabulator-print-table .tabulator-print-table-group span { - margin-left: 10px; - color: #666; -} - -.tabulator-print-table .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #888; - border-bottom: 2px solid #888; -} - -.tabulator-print-table .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #fff; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-print-table .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #fff; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #fff; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #fff; -} diff --git a/app/static/vendors/tabulator/css/tabulator_midnight.min.css b/app/static/vendors/tabulator/css/tabulator_midnight.min.css deleted file mode 100644 index a9ea0de..0000000 --- a/app/static/vendors/tabulator/css/tabulator_midnight.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator{position:relative;border:1px solid #333;background-color:#222;overflow:hidden;font-size:14px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#333;color:#fff;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background-color:#333;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#1a1a1a;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#444;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select{border:1px solid #999;background:#444;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#1a1a1a}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #888}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #888}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#1a1a1a!important;border-top:1px solid #888;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#1a1a1a!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableHolder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableHolder:focus{outline:none}.tabulator .tabulator-tableHolder .tabulator-placeholder{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#eee;font-weight:700;font-size:20px}.tabulator .tabulator-tableHolder .tabulator-table{position:relative;display:inline-block;background-color:#666;white-space:nowrap;overflow:visible;color:#fff}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#373737!important}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #888}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #888}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-footer{padding:5px 10px;border-top:1px solid #999;background-color:#333;text-align:right;color:#333;font-weight:700;white-space:nowrap;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-5px -10px 5px;text-align:left;background:#262626!important;border-bottom:1px solid #888;border-top:1px solid #888;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#262626!important;color:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer .tabulator-paginator label{color:#fff}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:hsla(0,0%,100%,.2);color:#333;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page.active{color:#fff}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-loader{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:22px;background-color:#666}.tabulator-row:nth-child(2n){background-color:#444}.tabulator-row.tabulator-selectable:hover{background-color:#999;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#000}.tabulator-row.tabulator-selected:hover{background-color:#888;cursor:pointer}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #888;border-bottom:1px solid #888;pointer-events:none!important;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #888}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #888}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #888;border-bottom:1px solid #888}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #888;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #999;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #888;border-bottom:2px solid #888}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #fff;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#fff}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#fff}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#fff;color:#666;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #888;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:700;color:#333;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#666}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#666;border:1px solid #888;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{padding:5px 10px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#444}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #888}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;background:#fff;border:1px solid #888;font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#666}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#999;background:#444}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,60%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #444}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;color:#999;background:#666}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#fff;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #888;padding:4px;padding-top:6px;color:#fff;font-weight:700}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #888;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:700;color:#333;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#666}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #888;border-bottom:2px solid #888}.tabulator-print-table .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #fff;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#fff}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#fff}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#fff} -/*# sourceMappingURL=tabulator_midnight.min.css.map */ diff --git a/app/static/vendors/tabulator/css/tabulator_midnight.min.css.map b/app/static/vendors/tabulator/css/tabulator_midnight.min.css.map deleted file mode 100644 index 0a41946..0000000 --- a/app/static/vendors/tabulator/css/tabulator_midnight.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tabulator_midnight.scss"],"names":[],"mappings":"AAyCA,WACC,kBAAkB,AAClB,sBAtCgB,AAuChB,sBAxCqB,AAyCrB,gBAAe,AACf,eAxCa,AAyCb,gBAAgB,AAMhB,uBAAwB,CAqgBxB,AAjhBD,iFAiBI,cAAc,CACd,AAlBJ,0CAuBE,oBAAqB,CACrB,AAxBF,kCA2BE,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CACjB,AA5BF,6BAgCE,kBAAiB,AACjB,sBAAsB,AAEtB,WAAU,AAEV,6BAlEwB,AAmExB,sBAtEyB,AAuEzB,WAtEmB,AAuEnB,gBAAgB,AAEhB,mBAAmB,AACnB,gBAAe,AAEf,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CA6PpB,AA7SF,qDAmDG,YAAY,CACZ,AApDH,4CAwDG,qBAAoB,AACpB,kBAAiB,AACjB,sBAAqB,AACrB,4BAzFoB,AA0FpB,sBA5FwB,AA6FxB,gBAAe,AACf,sBAAsB,AACtB,eAAgB,CA8LhB,AA7PH,6DAkEI,kBAAkB,AAClB,sBAhGsB,AAiGtB,mBAA8C,AAC9C,mBAAoB,CACpB,AAtEJ,mEA0EI,sBAAqB,AACrB,kBAAkB,AAClB,WAAW,CAkDX,AA9HJ,iGAgFK,aAAc,CAMd,AAtFL,uGAmFM,eAAe,AACf,UAAW,CACX,AArFN,wFA0FK,sBAAqB,AACrB,WAAW,AAEX,mBAAmB,AACnB,gBAAgB,AAChB,uBAAuB,AACvB,qBAAqB,CAerB,AA/GL,gHAoGM,sBAAsB,AACtB,WAAW,AAEX,sBAAqB,AAErB,YAAW,AAEX,gBAAgB,AAChB,UAAW,CACX,AA7GN,oFAmHK,qBAAqB,AACrB,kBAAkB,AAClB,QAAO,AACP,UAAS,AACT,QAAQ,AACR,SAAS,AACT,kCAAkC,AAClC,mCAAmC,AACnC,4BAnJmB,CAoJnB,AA5HL,0FAqIK,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AAEb,0BAtKkB,AAuKlB,gBAAgB,AAEhB,iBAAiB,CACjB,AA5IL,0FAkJK,YAAa,CACb,AAnJL,qEAwJI,kBAAkB,AAClB,sBAAsB,AACtB,eAAc,AACd,WAAU,AACV,iBAAkB,CAuBlB,AAnLJ,8EAgKK,qBAAsB,CACtB,AAjKL,yEAoKK,cAAe,CACf,AArKL,uJAwKK,sBAAqB,AACrB,gBAAgB,AAChB,UAAW,CACX,AA3KL,sFA+KM,QAAS,AACT,QAAS,CACT,AAjLN,oFAwLK,kBAAkB,CAClB,AAzLL,qEA4LK,eAAc,AACd,wBAAoD,CACpD,AA9LL,uHAmMM,gBAAgB,AAChB,4BA5NkB,CA6NlB,AArMN,sHA0MM,gBAAgB,AAChB,4BApOgB,CAqOhB,AA5MN,uHAiNM,0BA1OgB,AA2OhB,kBAAmB,CACnB,AAnNN,+GA0NM,uBAAyB,AAAzB,yBAAyB,AACzB,uBAAuB,AAEvB,oBAAY,AAAZ,aAAY,AACZ,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,sBAAsB,CACtB,AAhON,oHAqOM,wBAAyB,CACzB,AAtON,2GA2OM,gBAAe,AACf,gBAAgB,CAChB,AA7ON,uIAiPO,gBAAe,AACf,mBAAmB,CACnB,AAnPP,uGAwPM,qBAAqB,CACrB,AAzPN,+CAgQG,qBAAqB,AACrB,kBAAkB,AAIlB,UAAW,CASX,AA9QH,qEAwQI,2BA3RgB,CA4RhB,AAzQJ,sEA4QI,0BA/RgB,CAgShB,AA7QJ,qDAkRG,sBAAqB,AACrB,eAAc,AAEd,6BAAyD,AAUzD,0BAlTiB,AAmTjB,6BA9ToB,AAgUpB,eAAgB,CAChB,AAnSH,oEAwRI,4BAAyD,CAKzD,AA7RJ,iGA2RK,YAAa,CACb,AA5RL,2DAsSG,cAAc,CAKd,AA3SH,iEAySI,YAAa,CACb,AA1SJ,kCAiTE,kBAAiB,AACjB,WAAU,AACV,mBAAmB,AACnB,cAAa,AACb,gCAAiC,CAuDjC,AA5WF,wCAwTG,YAAa,CACb,AAzTH,yDA6TG,sBAAqB,AACrB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAOlB,UAAU,CAYV,AAlVH,wFAkUI,gBAAe,AACf,cAAc,CACd,AApUJ,8DAyUI,qBAAqB,AAErB,cAAa,AACb,aAAY,AAEZ,WAAU,AACV,gBAAiB,AACjB,cAAe,CACf,AAjVJ,mDAsVG,kBAAiB,AACjB,qBAAoB,AACpB,sBA7WqB,AA8WrB,mBAAmB,AACnB,iBAAgB,AAChB,UA7We,CA6Xf,AA3WH,kFA+VK,gBAAiB,AACjB,4BAAwD,CASxD,AAzWL,sGAmWM,4BAtXc,CAuXd,AApWN,yGAuWM,yBA1Xc,CA2Xd,AAxWN,wCAgXE,kBAAiB,AACjB,QAAO,AACP,MAAK,AACL,SAAQ,AACR,SAAS,CAUT,AA9XF,6CAuXG,OAAM,AACN,UAAU,CACV,AAzXH,8CA4XG,gBAAgB,CAChB,AA7XH,6BAmYE,iBAAgB,AAChB,0BAzYwB,AA0YxB,sBA7YyB,AA8YzB,iBAAgB,AAChB,WA9YmB,AA+YnB,gBAAgB,AAChB,mBAAkB,AAClB,qBAAgB,AAAhB,iBAAgB,AAEhB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAuFpB,AAteF,qDAkZG,sBAAqB,AACrB,wBAAuB,AACvB,sBAA2B,AAE3B,gBAAgB,AAEhB,6BAAwD,AAWxD,6BAtbiB,AAubjB,0BAvbiB,AAybjB,eAAgB,CAMhB,AA5aH,oEA2ZI,6BAAwD,AACxD,UA3biB,CAgcjB,AAjaJ,iGA+ZK,YAAa,CACb,AAhaL,gEAyaI,mBAAkB,AAClB,kBAAkB,CAClB,AA3aJ,wDAibI,UAAU,CACV,AAlbJ,kDAubG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBAlcoB,AAmcpB,iBAAiB,CACjB,AA9bH,8CAkcG,YAAY,CACZ,AAncH,6CAucG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBAldoB,AAmdpB,kBAAiB,AAEjB,8BAA+B,AAE/B,WAxdkB,AAydlB,oBAAmB,AACnB,oBAAmB,AACnB,iBAAiB,CAiBjB,AAreH,oDAudI,UA3dmB,CA4dnB,AAxdJ,sDA2dI,UAAU,CACV,AA5dJ,kEAgeK,eAAc,AACd,0BAAyB,AACzB,UAAU,CACV,AAneL,6BA0eE,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAElB,MAAK,AACL,OAAM,AACN,YAAW,AAEX,YAAW,AACX,WAAU,AACV,0BAAyB,AACzB,iBAAiB,CA2BjB,AAhhBF,mDAyfG,qBAAoB,AAEpB,cAAa,AACb,kBAAiB,AAEjB,mBAAkB,AAElB,gBAAe,AACf,gBAAgB,AAChB,cAAc,CAad,AA/gBH,qEAsgBI,sBAAqB,AACrB,UAAU,CACV,AAxgBJ,mEA4gBI,sBAAqB,AACrB,aAAa,CACb,AAMJ,eACC,kBAAkB,AAClB,sBAAsB,AAEtB,gBAA0C,AAC1C,qBA9iBuB,CA05BvB,AAjXD,6BAQE,qBAhjByB,CAijBzB,AATF,0CAYE,sBAjjBsB,AAkjBtB,cAAe,CACf,AAdF,kCAiBE,qBApjB0B,CAqjB1B,AAlBF,wCAqBE,sBAvjB+B,AAwjB/B,cAAe,CACf,AAvBF,gCA0BE,kBAAkB,AAElB,0BAnkBkB,AAokBlB,6BApkBkB,AAskBlB,8BAA+B,AAC/B,UAAU,CACV,AAjCF,4CAqCE,kBAAiB,AACjB,QAAO,AACP,SAAQ,AACR,OAAM,AACN,UAAU,CAUV,AAnDF,iDA4CG,MAAK,AACL,WAAW,CACX,AA9CH,kDAiDG,gBAAgB,CAChB,AAlDH,iCAsDE,qBAAqB,AACrB,kBAAkB,AAElB,yBAAyB,AAEzB,UAAW,CASX,AApEF,uDA8DG,2BArmBiB,CAsmBjB,AA/DH,wDAkEG,0BAzmBiB,CA0mBjB,AAnEH,8CAuEE,sBAAqB,AAErB,YAAW,AAEX,0BAlnBkB,AAmnBlB,4BAnnBkB,CAsoBlB,AA/FF,oDA+EG,YAAY,CACZ,AAhFH,oDAmFG,cA1oBW,CAqpBX,AA9FH,0DAuFK,iBAAkB,CAKlB,AA5FL,wEA0FM,kBAAkB,CAClB,AA3FN,+BAoGE,qBAAoB,AACpB,kBAAkB,AAClB,sBAAqB,AACrB,YAAW,AACX,4BA/oBkB,AAgpBlB,sBAAqB,AACrB,mBAAkB,AAClB,gBAAe,AACf,sBAAsB,CA0LtB,AAtSF,iDAgHG,sBAhpBe,AAipBf,SAAU,CAMV,AAvHH,+GAoHI,WAAU,AACV,sBAAsB,CACtB,AAtHJ,yDA0HG,qBAzpBgB,CAgqBhB,AAjIH,+HA4HI,WAAU,AACV,uBAAsB,AAEtB,UA9pBe,CA+pBf,AAhIJ,6EAsII,YAAa,CACb,AAvIJ,oDA6IG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAElB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAcpB,AAjKH,8EAuJI,SAAS,CAST,AAhKJ,wGA2JK,WAAU,AACV,WAAU,AACV,eAAc,AACd,eAAe,CACf,AA/JL,2DAoKG,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BAttBiB,AAutBjB,4BAvtBiB,CAwtBjB,AAjLH,4DAqLG,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBAruBe,AAsuBf,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAmDf,AAtPH,kEAsMI,eAAc,AACd,yBAA4B,CAC5B,AAxMJ,kGA2MI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AA9NJ,wGAoNK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAlwBa,CAmwBb,AA7NL,gGAiOI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eA7wBc,CA0xBd,AApPJ,sGA0OK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAxxBa,CAyxBb,AAnPL,qEAyPG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,YAAW,AACX,WAAU,AAEV,mBAAkB,AAClB,gBAAe,AAEf,WAjzBqB,AAkzBrB,gBAAgB,AAChB,eAAe,CAmBf,AA7RH,2EA6QI,UAAU,CACV,AA9QJ,sHAkRK,eAAe,CACf,AAnRL,sOA2RI,YAAY,CACZ,AA5RJ,wDAgSG,qBAAqB,AACrB,YAAW,AACX,WAAU,AAEV,kBAAkB,CAClB,AArSH,+BA4SE,sBAAqB,AACrB,6BAA4B,AAC5B,4BAr1BkB,AAs1BlB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,gBAAe,AACf,gBAAgB,AAChB,WAAU,AAEV,cAAe,CA0Df,AAhXF,qCAyTG,eAAc,AACd,+BAA+B,CAC/B,AA3TH,wEA+TI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BA/2BkB,AAg3BlB,eAAgB,CAChB,AApUJ,uDAwUG,iBAAiB,CACjB,AAzUH,uDA4UG,iBAAiB,CACjB,AA7UH,uDAgVG,iBAAiB,CACjB,AAjVH,uDAoVG,iBAAiB,CACjB,AArVH,uDAwVG,kBAAkB,CAClB,AAzVH,uDA4VG,oBAAqB,CACrB,AA7VH,gDAiWG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BAr5BmB,AAs5BnB,qBAAqB,CACrB,AA1WH,oCA6WG,iBAAgB,AAChB,UAAU,CACV,AAIH,gBACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,gBAj6BuB,AAk6BvB,sBAh6BmB,AAi6BnB,oCAAuC,AAEvC,eAn7Ba,AAq7Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CAqBd,AAnCD,qCAkBE,iBAAgB,AAEhB,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CAUjB,AA9BF,kEAuBG,UAAW,CACX,AAxBH,8EA2BG,eAAe,AACf,eAv7BwB,CAw7BxB,AA7BH,0CAiCE,yBA37BkB,CA47BlB,AAGF,4BACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,iBAAgB,AAEhB,gBAr8BiB,AAs8BjB,sBAv8BmB,AAy8BnB,eAz9Ba,AA29Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CA6Cd,AA5DD,6DAkBE,YAAW,AAEX,UAr9BsB,CA2+BtB,AA1CF,oEAuBG,WA/8Be,AAg9Bf,eAx9BwB,CA69BxB,AA7BH,4EA2BI,mCAn9Bc,CAo9Bd,AA5BJ,qEAgCG,sBAh+BwB,CAi+BxB,AAjCH,mEAqCG,eAAc,AAEd,WA/9Be,AAg+Bf,eAz+BqB,CA0+BrB,AAzCH,+DA6CE,YAAW,AAEX,WA7+BgB,AA8+BhB,iBAAkB,CAClB,AAjDF,8DAoDE,6BAn/BkB,AAq/BlB,YAAW,AACX,gBAAe,AAEf,WAv/BgB,AAw/BhB,eAAgB,CAChB,AAKF,4BACC,kBAAkB,AAClB,MAAK,AACL,SAAQ,AACR,OAAM,AACN,QAAO,AAEP,aAAc,CACd,AAED,uEACC,sBAAuB,CACvB,AAED,uBACC,wBAAyB,CAwKzB,AAzKD,oDAME,sBAAqB,AACrB,6BAA4B,AAC5B,4BArhCkB,AAshClB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,gBAAe,AACf,gBAAgB,AAChB,WAAU,AAEV,cAAe,CAoEf,AApFF,0DAmBG,eAAc,AACd,+BAA+B,CAC/B,AArBH,6FAyBI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BA/iCkB,AAgjClB,eAAgB,CAChB,AA9BJ,+EAmCI,2BAA4B,CAC5B,AApCJ,+EAyCI,2BAA4B,CAC5B,AA1CJ,+EA+CI,2BAA4B,CAC5B,AAhDJ,+EAqDI,2BAA4B,CAC5B,AAtDJ,+EA2DI,4BAA6B,CAC7B,AA5DJ,4EAgEG,oBAAqB,CACrB,AAjEH,qEAqEG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BA/lCmB,AAgmCnB,qBAAqB,CACrB,AA9EH,yDAiFG,iBAAgB,AAChB,UAAU,CACV,AAnFH,mDAuFE,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BA/mCkB,AAgnClB,4BAhnCkB,CAinClB,AApGF,oDAwGE,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBA9nCgB,AA+nChB,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAkDf,AAxKF,0DAyHG,eAAc,AACd,yBAA4B,CAC5B,AA3HH,0FA8HG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAjJH,gGAuII,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA3pCc,CA4pCd,AAhJJ,wFAoJG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAtqCe,CAmrCf,AAvKH,8FA6JI,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAjrCc,CAkrCd","file":"tabulator_midnight.min.css","sourcesContent":["/* Tabulator v4.7.0 (c) Oliver Folkerd */\n\n\r\n//Main Theme Variables\r\n$backgroundColor: #222 !default; //background color of tabulator\r\n$borderColor:#333 !default; //border to tabulator\r\n$textSize:14px !default; //table text size\r\n\r\n//header themeing\r\n$headerBackgroundColor:#333 !default; //border to tabulator\r\n$headerTextColor:#fff !default; //header text colour\r\n$headerBorderColor:#aaa !default; //header border color\r\n$headerSeperatorColor:#999 !default; //header bottom seperator color\r\n$headerMargin:4px !default; //padding round header\r\n\r\n//column header arrows\r\n$sortArrowActive: #666 !default;\r\n$sortArrowInactive: #bbb !default;\r\n\r\n//row themeing\r\n$rowBackgroundColor:#666 !default; //table row background color\r\n$rowAltBackgroundColor:#444 !default; //table row background color\r\n$rowBorderColor:#888 !default; //table border color\r\n$rowTextColor:#fff !default; //table text color\r\n$rowHoverBackground:#999 !default; //row background color on hover\r\n\r\n$rowSelectedBackground: #000 !default; //row background color when selected\r\n$rowSelectedBackgroundHover: #888 !default;//row background color when selected and hovered\r\n\r\n$editBoxColor:#999 !default; //border color for edit boxes\r\n$errorColor:#dd0000 !default; //error indication\r\n\r\n//footer themeing\r\n$footerBackgroundColor:#333 !default; //border to tabulator\r\n$footerTextColor:#333 !default; //footer text colour\r\n$footerBorderColor:#aaa !default; //footer border color\r\n$footerSeperatorColor:#999 !default; //footer bottom seperator color\r\n$footerActiveColor:#fff !default; //footer bottom active text color\r\n\r\n\r\n//Tabulator Containing Element\r\n.tabulator{\r\n\tposition: relative;\r\n\tborder: 1px solid $borderColor;\r\n\tbackground-color: $backgroundColor;\r\n\toverflow:hidden;\r\n\tfont-size:$textSize;\r\n\ttext-align: left;\r\n\r\n\t-webkit-transform: translatez(0);\r\n\t-moz-transform: translatez(0);\r\n\t-ms-transform: translatez(0);\r\n\t-o-transform: translatez(0);\r\n\ttransform: translatez(0);\r\n\r\n\t&[tabulator-layout=\"fitDataFill\"]{\r\n\t\t.tabulator-tableHolder{\r\n\t\t\t.tabulator-table{\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitDataTable\"]{\r\n\t\tdisplay: inline-block;\r\n\t}\r\n\r\n\t&.tabulator-block-select{\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t//column header containing element\r\n\t.tabulator-header{\r\n\t\tposition:relative;\r\n\t\tbox-sizing: border-box;\r\n\r\n\t\twidth:100%;\r\n\r\n\t\tborder-bottom:1px solid $headerSeperatorColor;\r\n\t\tbackground-color: $headerBackgroundColor;\r\n\t\tcolor: $headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:hidden;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t&.tabulator-header-hidden{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\t//individual column header element\r\n\t\t.tabulator-col{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition:relative;\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tborder-right:1px solid $headerBorderColor;\r\n\t\t\tbackground-color: $headerBackgroundColor;\r\n\t\t\ttext-align:left;\r\n\t\t\tvertical-align: bottom;\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&.tabulator-moving{\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tborder:1px solid $headerSeperatorColor;\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%);\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\r\n\t\t\t//hold content of column header\r\n\t\t\t.tabulator-col-content{\r\n\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding:4px;\r\n\r\n\t\t\t\t//header menu button\r\n\t\t\t\t.tabulator-header-menu-button{\r\n\t\t\t\t\tpadding: 0 8px;\r\n\r\n\t\t\t\t\t&:hover{\r\n\t\t\t\t\t\tcursor: pointer;\r\n\t\t\t\t\t\topacity: .6;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//hold title of column header\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\twhite-space: nowrap;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttext-overflow: ellipsis;\r\n\t\t\t\t\tvertical-align:bottom;\r\n\r\n\t\t\t\t\t//element to hold title editor\r\n\t\t\t\t\t.tabulator-title-editor{\r\n\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\t\tborder:1px solid #999;\r\n\r\n\t\t\t\t\t\tpadding:1px;\r\n\r\n\t\t\t\t\t\tbackground: #444;\r\n\t\t\t\t\t\tcolor: #fff;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//column sorter arrow\r\n\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\tdisplay: inline-block;\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\ttop:9px;\r\n\t\t\t\t\tright:8px;\r\n\t\t\t\t\twidth: 0;\r\n\t\t\t\t\theight: 0;\r\n\t\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//complex header column group\r\n\t\t\t&.tabulator-col-group{\r\n\r\n\t\t\t\t//gelement to hold sub columns in column group\r\n\t\t\t\t.tabulator-col-group-cols{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tdisplay: flex;\r\n\r\n\t\t\t\t\tborder-top:1px solid $headerBorderColor;\r\n\t\t\t\t\toverflow: hidden;\r\n\r\n\t\t\t\t\tmargin-right:-1px;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//hide left resize handle on first column\r\n\t\t\t&:first-child{\r\n\t\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//header filter containing element\r\n\t\t\t.tabulator-header-filter{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\tmargin-top:2px;\r\n\t\t\t\twidth:100%;\r\n\t\t\t\ttext-align: center;\r\n\r\n\t\t\t\t//styling adjustment for inbuilt editors\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\theight:auto !important;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsvg{\r\n\t\t\t\t\tmargin-top: 3px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput, select{\r\n\t\t\t\t\tborder:1px solid #999;\r\n\t\t\t\t\tbackground: #444;\r\n\t\t\t\t\tcolor: #fff;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput{\r\n\t\t\t\t\t&::-ms-clear {\r\n\t\t\t\t\t\twidth : 0;\r\n\t\t\t\t\t\theight: 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//styling child elements for sortable columns\r\n\t\t\t&.tabulator-sortable{\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tpadding-right:25px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t&[aria-sort=\"none\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"asc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowActive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"desc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\t\t\tborder-bottom: none;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-col-vertical{\r\n\t\t\t\t.tabulator-col-content{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\twriting-mode: vertical-rl;\r\n\t\t\t\t\t\ttext-orientation: mixed;\r\n\r\n\t\t\t\t\t\tdisplay:flex;\r\n\t\t\t\t\t\talign-items:center;\r\n\t\t\t\t\t\tjustify-content:center;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\ttransform: rotate(180deg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-sortable{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\tpadding-top:20px;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\t\tpadding-bottom:20px;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\t\tright:calc(50% - 6px);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tposition: absolute;\r\n\r\n\t\t\t// background-color: inherit;\r\n\r\n\t\t\tz-index: 10;\r\n\r\n\t\t\t&.tabulator-frozen-left{\r\n\t\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-frozen-right{\r\n\t\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\tbackground:darken($headerBackgroundColor, 10%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\t\t\tborder-bottom:1px solid $headerBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen-rows-holder{\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\t&:empty{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//scrolling element to hold table\r\n\t.tabulator-tableHolder{\r\n\t\tposition:relative;\r\n\t\twidth:100%;\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:auto;\r\n\t\t-webkit-overflow-scrolling: touch;\r\n\r\n\t\t&:focus{\r\n\t\t\toutline: none;\r\n\t\t}\r\n\r\n\t\t//default placeholder element\r\n\t\t.tabulator-placeholder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t&[tabulator-render-mode=\"virtual\"]{\r\n\t\t\t\tmin-height:100%;\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\r\n\t\t\twidth:100%;\r\n\r\n\t\t\tspan{\r\n\t\t\t\tdisplay: inline-block;\r\n\r\n\t\t\t\tmargin:0 auto;\r\n\t\t\t\tpadding:10px;\r\n\r\n\t\t\t\tcolor:#eee;\r\n\t\t\t\tfont-weight: bold;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//element to hold table rows\r\n\t\t.tabulator-table{\r\n\t\t\tposition:relative;\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tbackground-color:$rowBackgroundColor;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\toverflow:visible;\r\n\t\t\tcolor:$rowTextColor;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\t&.tabulator-calcs{\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t\tbackground:darken($rowAltBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t\t&.tabulator-calcs-top{\r\n\t\t\t\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-calcs-bottom{\r\n\t\t\t\t\t\tborder-top:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//column resize handles\r\n\t.tabulator-col-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\ttop:0;\r\n\t\tbottom:0;\r\n\t\twidth:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\tleft:0;\r\n\t\t\tright:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ew-resize;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//footer element\r\n\t.tabulator-footer{\r\n\t\tpadding:5px 10px;\r\n\t\tborder-top:1px solid $footerSeperatorColor;\r\n\t\tbackground-color: $footerBackgroundColor;\r\n\t\ttext-align:right;\r\n\t\tcolor: $footerTextColor;\r\n\t\tfont-weight:bold;\r\n\t\twhite-space:nowrap;\r\n\t\tuser-select:none;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\twidth:calc(100% + 20px);\r\n\t\t\tmargin:-5px -10px 5px -10px;\r\n\r\n\t\t\ttext-align: left;\r\n\r\n\t\t\tbackground:darken($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:darken($footerBackgroundColor, 5%) !important;\r\n\t\t\t\tcolor:$headerTextColor;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-bottom:1px solid $rowBorderColor;\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&:only-child{\r\n\t\t\t\tmargin-bottom:-5px;\r\n\t\t\t\tborder-bottom:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-paginator{\r\n\t\t\tlabel{\r\n\t\t\t\tcolor:#fff;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//page size select element\r\n\t\t.tabulator-page-size{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 5px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-pages{\r\n\t\t\tmargin:0 7px;\r\n\t\t}\r\n\r\n\t\t//pagination button\r\n\t\t.tabulator-page{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 2px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\r\n\t\t\tbackground:rgba(255,255,255,.2);\r\n\r\n\t\t\tcolor: $footerTextColor;\r\n\t\t\tfont-family:inherit;\r\n\t\t\tfont-weight:inherit;\r\n\t\t\tfont-size:inherit;\r\n\r\n\t\t\t&.active{\r\n\t\t\t\tcolor:$footerActiveColor;\r\n\t\t\t}\r\n\r\n\t\t\t&:disabled{\r\n\t\t\t\topacity:.5;\r\n\t\t\t}\r\n\r\n\t\t\t&:not(.disabled){\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground:rgba(0,0,0,.2);\r\n\t\t\t\t\tcolor:#fff;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//holding div that contains loader and covers tabulator element to prevent interaction\r\n\t.tabulator-loader{\r\n\t\tposition:absolute;\r\n\t\tdisplay: flex;\r\n\t\talign-items:center;\r\n\r\n\t\ttop:0;\r\n\t\tleft:0;\r\n\t\tz-index:100;\r\n\r\n\t\theight:100%;\r\n\t\twidth:100%;\r\n\t\tbackground:rgba(0,0,0,.4);\r\n\t\ttext-align:center;\r\n\r\n\t\t//loading message element\r\n\t\t.tabulator-loader-msg{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 auto;\r\n\t\t\tpadding:10px 20px;\r\n\r\n\t\t\tborder-radius:10px;\r\n\r\n\t\t\tbackground:#fff;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:16px;\r\n\r\n\t\t\t//loading message\r\n\t\t\t&.tabulator-loading{\r\n\t\t\t\tborder:4px solid #333;\r\n\t\t\t\tcolor:#000;\r\n\t\t\t}\r\n\r\n\t\t\t//error message\r\n\t\t\t&.tabulator-error{\r\n\t\t\t\tborder:4px solid #D00;\r\n\t\t\t\tcolor:#590000;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//row element\r\n.tabulator-row{\r\n\tposition: relative;\r\n\tbox-sizing: border-box;\r\n\r\n\tmin-height:$textSize + ($headerMargin * 2);\r\n\tbackground-color: $rowBackgroundColor;\r\n\r\n\t&:nth-child(even){\r\n\t\tbackground-color: $rowAltBackgroundColor;\r\n\t}\r\n\r\n\t&.tabulator-selectable:hover{\r\n\t\tbackground-color:$rowHoverBackground;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-selected{\r\n\t\tbackground-color:$rowSelectedBackground;\r\n\t}\r\n\r\n\t&.tabulator-selected:hover{\r\n\t\tbackground-color:$rowSelectedBackgroundHover;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-moving{\r\n\t\tposition: absolute;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpointer-events: none !important;\r\n\t\tz-index:15;\r\n\t}\r\n\r\n\t//row resize handles\r\n\t.tabulator-row-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\tbottom:0;\r\n\t\tleft:0;\r\n\t\theight:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\ttop:0;\r\n\t\t\tbottom:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ns-resize;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-frozen{\r\n\t\tdisplay: inline-block;\r\n\t\tposition: absolute;\r\n\r\n\t\tbackground-color: inherit;\r\n\r\n\t\tz-index: 10;\r\n\r\n\t\t&.tabulator-frozen-left{\r\n\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t&.tabulator-frozen-right{\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-responsive-collapse{\r\n\t\tbox-sizing:border-box;\r\n\r\n\t\tpadding:5px;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t&:empty{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\ttable{\r\n\t\t\tfont-size:$textSize;\r\n\r\n\t\t\ttr{\r\n\t\t\t\ttd{\r\n\t\t\t\t\tposition: relative;\r\n\r\n\t\t\t\t\t&:first-of-type{\r\n\t\t\t\t\t\tpadding-right:10px;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//cell element\r\n\t.tabulator-cell{\r\n\t\tdisplay:inline-block;\r\n\t\tposition: relative;\r\n\t\tbox-sizing:border-box;\r\n\t\tpadding:4px;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tvertical-align:middle;\r\n\t\twhite-space:nowrap;\r\n\t\toverflow:hidden;\r\n\t\ttext-overflow:ellipsis;\r\n\r\n\r\n\t\t&.tabulator-editing{\r\n\t\t\tborder:1px solid $editBoxColor;\r\n\t\t\tpadding: 0;\r\n\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-validation-fail{\r\n\t\t\tborder:1px solid $errorColor;\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\r\n\t\t\t\tcolor: $errorColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//hide left resize handle on first column\r\n\t\t&:first-child{\r\n\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//movable row handle\r\n\t\t&.tabulator-row-handle{\r\n\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\t//handle holder\r\n\t\t\t.tabulator-row-handle-box{\r\n\t\t\t\twidth:80%;\r\n\r\n\t\t\t\t//Hamburger element\r\n\t\t\t\t.tabulator-row-handle-bar{\r\n\t\t\t\t\twidth:100%;\r\n\t\t\t\t\theight:3px;\r\n\t\t\t\t\tmargin-top:2px;\r\n\t\t\t\t\tbackground:#666;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-branch{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:9px;\r\n\t\t\twidth:7px;\r\n\r\n\t\t\tmargin-top:-9px;\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control{\r\n\r\n\t\t\tdisplay:inline-flex;\r\n\t\t\tjustify-content:center;\r\n\t\t\talign-items:center;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:11px;\r\n\t\t\twidth:11px;\r\n\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder:1px solid $rowTextColor;\r\n\t\t\tborder-radius:2px;\r\n\t\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\t\toverflow:hidden;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\tcursor:pointer;\r\n\t\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: transparent;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-expand{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-responsive-collapse-toggle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\theight:15px;\r\n\t\t\twidth:15px;\r\n\r\n\t\t\tborder-radius:20px;\r\n\t\t\tbackground:#fff;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:1.1em;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\topacity:.7;\r\n\t\t\t}\r\n\r\n\t\t\t&.open{\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\t\tdisplay:initial;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-open{\r\n\t\t\t\t\tdisplay:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-traffic-light{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\theight:14px;\r\n\t\t\twidth:14px;\r\n\r\n\t\t\tborder-radius:14px;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//row grouping element\r\n\t&.tabulator-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#ccc;\r\n\t\tfont-weight:bold;\r\n\t\tcolor:#333;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\tpadding-left:30px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\tpadding-left:50px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\tpadding-left:70px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\tpadding-left:90px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\tpadding-left:110px;\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#666;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n.tabulator-menu{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\tbox-shadow: 0 0 5px 0 rgba(0, 0, 0, .2);\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-menu-item{\r\n\r\n\t\tpadding:5px 10px;\r\n\r\n\t\tuser-select: none;\r\n\r\n\t\t&.tabulator-menu-item-disabled{\r\n\t\t\topacity: .5;\r\n\t\t}\r\n\r\n\t\t&:not(.tabulator-menu-item-disabled):hover{\r\n\t\t\tcursor: pointer;\r\n\t\t\tbackground: $rowAltBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-menu-separator{\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t}\r\n}\r\n\r\n.tabulator-edit-select-list{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tmax-height:200px;\r\n\r\n\tbackground:$rowTextColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-edit-select-list-item{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowBackgroundColor;\r\n\r\n\t\t&.active{\r\n\t\t\tcolor:$editBoxColor;\r\n\t\t\tbackground:$rowAltBackgroundColor;\r\n\r\n\t\t\t&.focused{\r\n\t\t\t\toutline:1px solid rgba($editBoxColor, .5);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.focused{\r\n\t\t\toutline:1px solid $rowAltBackgroundColor;\r\n\t\t}\r\n\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\r\n\t\t\tcolor:$editBoxColor;\r\n\t\t\tbackground:$rowBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-notice{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\ttext-align: center;\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-group{\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpadding:4px;\r\n\t\tpadding-top:6px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\tfont-weight:bold;\r\n\t}\r\n}\r\n\r\n// Table print styling\r\n\r\n.tabulator-print-fullscreen{\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tbottom:0;\r\n\tleft:0;\r\n\tright:0;\r\n\r\n\tz-index: 10000;\r\n}\r\n\r\nbody.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){\r\n\tdisplay:none !important;\r\n}\r\n\r\n.tabulator-print-table{\r\n\tborder-collapse: collapse;\r\n\r\n\t//row grouping element\r\n\t.tabulator-print-table-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#ccc;\r\n\t\tfont-weight:bold;\r\n\t\tcolor:#333;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:30px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:50px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:70px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:90px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:110px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#666;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-data-tree-branch{\r\n\t\tdisplay:inline-block;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:9px;\r\n\t\twidth:7px;\r\n\r\n\t\tmargin-top:-9px;\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\tborder-left:2px solid $rowBorderColor;\r\n\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t}\r\n\r\n\t.tabulator-data-tree-control{\r\n\r\n\t\tdisplay:inline-flex;\r\n\t\tjustify-content:center;\r\n\t\talign-items:center;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:11px;\r\n\t\twidth:11px;\r\n\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder:1px solid $rowTextColor;\r\n\t\tborder-radius:2px;\r\n\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\toverflow:hidden;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: transparent;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-expand{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/app/static/vendors/tabulator/css/tabulator_modern.css b/app/static/vendors/tabulator/css/tabulator_modern.css deleted file mode 100644 index 90defa5..0000000 --- a/app/static/vendors/tabulator/css/tabulator_modern.css +++ /dev/null @@ -1,1032 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator { - position: relative; - border: 1px solid #fff; - background-color: #fff; - overflow: hidden; - font-size: 16px; - text-align: left; - -ms-transform: translatez(0); - transform: translatez(0); -} - -.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table { - min-width: 100%; -} - -.tabulator[tabulator-layout="fitDataTable"] { - display: inline-block; -} - -.tabulator.tabulator-block-select { - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator .tabulator-header { - position: relative; - box-sizing: border-box; - width: 100%; - border-bottom: 3px solid #3759D7; - margin-bottom: 4px; - background-color: #fff; - color: #3759D7; - font-weight: bold; - white-space: nowrap; - overflow: hidden; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - padding-left: 10px; - font-size: 1.1em; -} - -.tabulator .tabulator-header.tabulator-header-hidden { - display: none; -} - -.tabulator .tabulator-header .tabulator-col { - display: inline-block; - position: relative; - box-sizing: border-box; - border-right: 2px solid #fff; - background-color: #fff; - text-align: left; - vertical-align: bottom; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-moving { - position: absolute; - border: 1px solid #3759D7; - background: #e6e6e6; - pointer-events: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content { - box-sizing: border-box; - position: relative; - padding: 4px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button { - padding: 0 8px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover { - cursor: pointer; - opacity: .6; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { - box-sizing: border-box; - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: bottom; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor { - box-sizing: border-box; - width: 100%; - border: 1px solid #3759D7; - padding: 1px; - background: #fff; - font-size: 1em; - color: #3759D7; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow { - display: inline-block; - position: absolute; - top: 9px; - right: 8px; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #b7c3f1; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { - position: relative; - display: -ms-flexbox; - display: flex; - border-top: 2px solid #3759D7; - overflow: hidden; - margin-right: -1px; -} - -.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { - position: relative; - box-sizing: border-box; - margin-top: 2px; - width: 100%; - text-align: center; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea { - height: auto !important; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg { - margin-top: 3px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear { - width: 0; - height: 0; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title { - padding-right: 25px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { - cursor: pointer; - background-color: #e6e6e6; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #b7c3f1; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #3759D7; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow { - border-top: 6px solid #3759D7; - border-bottom: none; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title { - -ms-writing-mode: tb-rl; - writing-mode: vertical-rl; - text-orientation: mixed; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title { - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title { - padding-right: 0; - padding-top: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title { - padding-right: 0; - padding-bottom: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow { - right: calc(50% - 6px); -} - -.tabulator .tabulator-header .tabulator-frozen { - display: inline-block; - position: absolute; - z-index: 10; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left { - padding-left: 10px; - border-right: 2px solid #fff; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #fff; -} - -.tabulator .tabulator-header .tabulator-calcs-holder { - box-sizing: border-box; - min-width: 600%; - border-top: 2px solid #3759D7 !important; - background: white !important; - border-top: 1px solid #fff; - border-bottom: 1px solid #fff; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row { - padding-left: 0 !important; - background: white !important; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell { - background: none; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder { - min-width: 600%; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty { - display: none; -} - -.tabulator .tabulator-tableHolder { - position: relative; - width: 100%; - white-space: nowrap; - overflow: auto; - -webkit-overflow-scrolling: touch; -} - -.tabulator .tabulator-tableHolder:focus { - outline: none; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder { - box-sizing: border-box; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode="virtual"] { - min-height: 100%; - min-width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder span { - display: inline-block; - margin: 0 auto; - padding: 10px; - color: #3759D7; - font-weight: bold; - font-size: 20px; -} - -.tabulator .tabulator-tableHolder .tabulator-table { - position: relative; - display: inline-block; - background-color: #f3f3f3; - white-space: nowrap; - overflow: visible; - color: #333; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs { - font-weight: bold; - background: #f2f2f2 !important; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top { - border-bottom: 2px solid #3759D7; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom { - border-top: 2px solid #3759D7; -} - -.tabulator .tabulator-col-resize-handle { - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 5px; -} - -.tabulator .tabulator-col-resize-handle.prev { - left: 0; - right: auto; -} - -.tabulator .tabulator-col-resize-handle:hover { - cursor: ew-resize; -} - -.tabulator .tabulator-footer { - padding: 5px 10px; - border-top: 1px solid #999; - background-color: #fff; - text-align: right; - color: #3759D7; - font-weight: bold; - white-space: nowrap; - -ms-user-select: none; - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder { - box-sizing: border-box; - width: calc(100% + 20px); - margin: -5px -10px 5px -10px; - text-align: left; - background: white !important; - border-top: 3px solid #3759D7 !important; - border-bottom: 2px solid #3759D7 !important; - border-bottom: 1px solid #fff; - border-top: 1px solid #fff; - overflow: hidden; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { - background: white !important; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell { - background: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell:first-child { - border-left: 10px solid transparent; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder:only-child { - margin-bottom: -5px; - border-bottom: none; - border-bottom: none !important; -} - -.tabulator .tabulator-footer .tabulator-paginator { - color: #3759D7; - font-family: inherit; - font-weight: inherit; - font-size: inherit; -} - -.tabulator .tabulator-footer .tabulator-page-size { - display: inline-block; - margin: 0 5px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; -} - -.tabulator .tabulator-footer .tabulator-pages { - margin: 0 7px; -} - -.tabulator .tabulator-footer .tabulator-page { - display: inline-block; - margin: 0 2px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; - background: rgba(255, 255, 255, 0.2); -} - -.tabulator .tabulator-footer .tabulator-page.active { - color: #3759D7; -} - -.tabulator .tabulator-footer .tabulator-page:disabled { - opacity: .5; -} - -.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); - color: #fff; -} - -.tabulator .tabulator-loader { - position: absolute; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - top: 0; - left: 0; - z-index: 100; - height: 100%; - width: 100%; - background: rgba(0, 0, 0, 0.4); - text-align: center; -} - -.tabulator .tabulator-loader .tabulator-loader-msg { - display: inline-block; - margin: 0 auto; - padding: 10px 20px; - border-radius: 10px; - background: #fff; - font-weight: bold; - font-size: 16px; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading { - border: 4px solid #333; - color: #000; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error { - border: 4px solid #D00; - color: #590000; -} - -.tabulator-row { - position: relative; - box-sizing: border-box; - box-sizing: border-box; - min-height: 24px; - margin-bottom: 2px; -} - -.tabulator-row .tabulator-cell:first-child { - border-left: 10px solid #3759D7; -} - -.tabulator-row:nth-child(even) { - background-color: #627ce0; -} - -.tabulator-row:nth-child(even) .tabulator-cell { - background-color: #fff; -} - -.tabulator-row:nth-child(even) .tabulator-cell:first-child { - border-left: 10px solid #627ce0; -} - -.tabulator-row.tabulator-selectable:hover { - cursor: pointer; -} - -.tabulator-row.tabulator-selectable:hover .tabulator-cell { - background-color: #bbb; -} - -.tabulator-row.tabulator-selected .tabulator-cell { - background-color: #9ABCEA; -} - -.tabulator-row.tabulator-selected:hover .tabulator-cell { - background-color: #769BCC; - cursor: pointer; -} - -.tabulator-row.tabulator-moving { - position: absolute; - border-top: 1px solid #fff; - border-bottom: 1px solid #fff; - pointer-events: none !important; - z-index: 15; -} - -.tabulator-row .tabulator-row-resize-handle { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height: 5px; -} - -.tabulator-row .tabulator-row-resize-handle.prev { - top: 0; - bottom: auto; -} - -.tabulator-row .tabulator-row-resize-handle:hover { - cursor: ns-resize; -} - -.tabulator-row .tabulator-frozen { - display: inline-block; - position: absolute; - background-color: inherit; - z-index: 10; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #fff; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #fff; -} - -.tabulator-row .tabulator-responsive-collapse { - box-sizing: border-box; - padding: 5px; - border-top: 1px solid #fff; - border-bottom: 1px solid #fff; -} - -.tabulator-row .tabulator-responsive-collapse:empty { - display: none; -} - -.tabulator-row .tabulator-responsive-collapse table { - font-size: 16px; -} - -.tabulator-row .tabulator-responsive-collapse table tr td { - position: relative; -} - -.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type { - padding-right: 10px; -} - -.tabulator-row .tabulator-cell { - display: inline-block; - position: relative; - box-sizing: border-box; - padding: 6px 4px; - border-right: 2px solid #fff; - vertical-align: middle; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - background-color: #f3f3f3; -} - -.tabulator-row .tabulator-cell.tabulator-editing { - border: 1px solid #1D68CD; - padding: 0; -} - -.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select { - border: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail { - border: 1px solid #dd0000; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select { - border: 1px; - background: transparent; - color: #dd0000; -} - -.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box { - width: 80%; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar { - width: 100%; - height: 3px; - margin-top: 2px; - background: #666; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #fff; - border-bottom: 2px solid #fff; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - height: 15px; - width: 15px; - border-radius: 20px; - background: #666; - color: #f3f3f3; - font-weight: bold; - font-size: 1.1em; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover { - opacity: .7; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close { - display: initial; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-traffic-light { - display: inline-block; - height: 14px; - width: 14px; - border-radius: 14px; -} - -.tabulator-row.tabulator-group { - box-sizing: border-box; - border-bottom: 2px solid #3759D7; - border-top: 2px solid #3759D7; - padding: 5px; - padding-left: 10px; - background: #8ca0e8; - font-weight: bold; - color: fff; - margin-bottom: 2px; - min-width: 100%; -} - -.tabulator-row.tabulator-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #3759D7; - border-bottom: 0; -} - -.tabulator-row.tabulator-group.tabulator-group-level-1 { - padding-left: 30px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-2 { - padding-left: 50px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-3 { - padding-left: 70px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-4 { - padding-left: 90px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-5 { - padding-left: 110px; -} - -.tabulator-row.tabulator-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-row.tabulator-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #3759D7; - vertical-align: middle; -} - -.tabulator-row.tabulator-group span { - margin-left: 10px; - color: #3759D7; -} - -.tabulator-menu { - position: absolute; - display: inline-block; - box-sizing: border-box; - background: #f3f3f3; - border: 1px solid #fff; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2); - font-size: 16px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-menu .tabulator-menu-item { - padding: 5px 10px; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled { - opacity: .5; -} - -.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover { - cursor: pointer; - background: #fff; -} - -.tabulator-menu .tabulator-menu-separator { - border-top: 1px solid #fff; -} - -.tabulator-edit-select-list { - position: absolute; - display: inline-block; - box-sizing: border-box; - max-height: 200px; - background: #f3f3f3; - border: 1px solid #1D68CD; - font-size: 16px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item { - padding: 4px; - color: #333; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active { - color: #f3f3f3; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused { - outline: 1px solid rgba(243, 243, 243, 0.5); -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.focused { - outline: 1px solid #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item:hover { - cursor: pointer; - color: #f3f3f3; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-notice { - padding: 4px; - color: #333; - text-align: center; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-group { - border-bottom: 1px solid #fff; - padding: 4px; - padding-top: 6px; - color: #333; - font-weight: bold; -} - -.tabulator-print-fullscreen { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 10000; -} - -body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) { - display: none !important; -} - -.tabulator-print-table { - border-collapse: collapse; -} - -.tabulator-print-table .tabulator-print-table-group { - box-sizing: border-box; - border-bottom: 2px solid #3759D7; - border-top: 2px solid #3759D7; - padding: 5px; - padding-left: 10px; - background: #8ca0e8; - font-weight: bold; - color: fff; - margin-bottom: 2px; - min-width: 100%; -} - -.tabulator-print-table .tabulator-print-table-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #3759D7; - border-bottom: 0; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td { - padding-left: 30px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td { - padding-left: 50px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td { - padding-left: 70px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td { - padding-left: 90px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td { - padding-left: 110px !important; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #3759D7; - vertical-align: middle; -} - -.tabulator-print-table .tabulator-print-table-group span { - margin-left: 10px; - color: #3759D7; -} - -.tabulator-print-table .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #fff; - border-bottom: 2px solid #fff; -} - -.tabulator-print-table .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-print-table .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} diff --git a/app/static/vendors/tabulator/css/tabulator_modern.min.css b/app/static/vendors/tabulator/css/tabulator_modern.min.css deleted file mode 100644 index df7a81a..0000000 --- a/app/static/vendors/tabulator/css/tabulator_modern.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator{position:relative;border:1px solid #fff;background-color:#fff;overflow:hidden;font-size:16px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:3px solid #3759d7;margin-bottom:4px;background-color:#fff;color:#3759d7;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;padding-left:10px;font-size:1.1em}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:2px solid #fff;background-color:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #3759d7;background:#e6e6e6;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #3759d7;padding:1px;background:#fff;font-size:1em;color:#3759d7}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #b7c3f1}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:2px solid #3759d7;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #b7c3f1}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #3759d7}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #3759d7;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{padding-left:10px;border-right:2px solid #fff}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #fff}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;border-top:2px solid #3759d7!important;background:#fff!important;border-top:1px solid #fff;border-bottom:1px solid #fff;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{padding-left:0!important;background:#fff!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell{background:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableHolder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableHolder:focus{outline:none}.tabulator .tabulator-tableHolder .tabulator-placeholder{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#3759d7;font-weight:700;font-size:20px}.tabulator .tabulator-tableHolder .tabulator-table{position:relative;display:inline-block;background-color:#f3f3f3;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#f2f2f2!important}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #3759d7}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #3759d7}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-footer{padding:5px 10px;border-top:1px solid #999;background-color:#fff;text-align:right;color:#3759d7;font-weight:700;white-space:nowrap;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-5px -10px 5px;text-align:left;background:#fff!important;border-top:3px solid #3759d7!important;border-bottom:2px solid #3759d7!important;border-bottom:1px solid #fff;border-top:1px solid #fff;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#fff!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell{background:none}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell:first-child{border-left:10px solid transparent}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none;border-bottom:none!important}.tabulator .tabulator-footer .tabulator-paginator{color:#3759d7;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#3759d7}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-loader{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;margin-bottom:2px}.tabulator-row .tabulator-cell:first-child{border-left:10px solid #3759d7}.tabulator-row:nth-child(2n){background-color:#627ce0}.tabulator-row:nth-child(2n) .tabulator-cell{background-color:#fff}.tabulator-row:nth-child(2n) .tabulator-cell:first-child{border-left:10px solid #627ce0}.tabulator-row.tabulator-selectable:hover{cursor:pointer}.tabulator-row.tabulator-selectable:hover .tabulator-cell{background-color:#bbb}.tabulator-row.tabulator-selected .tabulator-cell{background-color:#9abcea}.tabulator-row.tabulator-selected:hover .tabulator-cell{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #fff;border-bottom:1px solid #fff;pointer-events:none!important;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #fff}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #fff}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #fff;border-bottom:1px solid #fff}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:6px 4px;border-right:2px solid #fff;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:#f3f3f3}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #fff;border-bottom:2px solid #fff}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#f3f3f3;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:2px solid #3759d7;border-top:2px solid #3759d7;padding:5px;padding-left:10px;background:#8ca0e8;font-weight:700;color:fff;margin-bottom:2px;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #3759d7;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #3759d7;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#3759d7}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#f3f3f3;border:1px solid #fff;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{padding:5px 10px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#fff}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #fff}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;background:#f3f3f3;border:1px solid #1d68cd;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#333}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#f3f3f3;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,95%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;color:#f3f3f3;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#333;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #fff;padding:4px;padding-top:6px;color:#333;font-weight:700}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:2px solid #3759d7;border-top:2px solid #3759d7;padding:5px;padding-left:10px;background:#8ca0e8;font-weight:700;color:fff;margin-bottom:2px;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #3759d7;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #3759d7;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#3759d7}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #fff;border-bottom:2px solid #fff}.tabulator-print-table .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333} -/*# sourceMappingURL=tabulator_modern.min.css.map */ diff --git a/app/static/vendors/tabulator/css/tabulator_modern.min.css.map b/app/static/vendors/tabulator/css/tabulator_modern.min.css.map deleted file mode 100644 index 5f594c8..0000000 --- a/app/static/vendors/tabulator/css/tabulator_modern.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tabulator_modern.scss"],"names":[],"mappings":"AA+CA,WACC,kBAAkB,AAClB,sBA1CgB,AA2ChB,sBA5CqB,AA6CrB,gBAAe,AACf,eA5Ca,AA6Cb,gBAAgB,AAMhB,uBAAwB,CAuhBxB,AAniBD,iFAiBI,cAAc,CACd,AAlBJ,0CAuBE,oBAAqB,CACrB,AAxBF,kCA2BE,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CACjB,AA5BF,6BAgCE,kBAAiB,AACjB,sBAAsB,AAEtB,WAAU,AAEV,gCAjFe,AAkFf,kBAAiB,AACjB,sBA3EyB,AA4EzB,cApFe,AAqFf,gBAAgB,AAEhB,mBAAmB,AACnB,gBAAe,AAEf,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,kBAzDe,AA2Df,eAAgB,CAkQhB,AAvTF,qDAwDG,YAAY,CACZ,AAzDH,4CA6DG,qBAAoB,AACpB,kBAAiB,AACjB,sBAAqB,AACrB,4BAlGoB,AAmGpB,sBArGwB,AAsGxB,gBAAe,AACf,sBAAsB,AACtB,eAAgB,CA2LhB,AA/PH,6DAuEI,kBAAkB,AAClB,yBApHa,AAqHb,mBAA8C,AAC9C,mBAAoB,CACpB,AA3EJ,mEA+EI,sBAAqB,AACrB,kBAAkB,AAClB,WAAW,CAmDX,AApIJ,iGAqFK,aAAc,CAMd,AA3FL,uGAwFM,eAAe,AACf,UAAW,CACX,AA1FN,wFA+FK,sBAAqB,AACrB,WAAW,AAEX,mBAAmB,AACnB,gBAAgB,AAChB,uBAAuB,AACvB,qBAAqB,CAgBrB,AArHL,gHAyGM,sBAAsB,AACtB,WAAW,AAEX,yBAxJW,AA0JX,YAAW,AAEX,gBAAgB,AAEhB,cAAc,AACd,aA/JW,CAgKX,AApHN,oFAyHK,qBAAqB,AACrB,kBAAkB,AAClB,QAAO,AACP,UAAS,AACT,QAAQ,AACR,SAAS,AACT,kCAAkC,AAClC,mCAAmC,AACnC,+BA7JqC,CA8JrC,AAlIL,0FA2IK,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AAEb,6BA1LY,AA2LZ,gBAAgB,AAEhB,iBAAiB,CACjB,AAlJL,0FAyJK,YAAa,CACb,AA1JL,qEAgKI,kBAAkB,AAClB,sBAAsB,AACtB,eAAc,AACd,WAAU,AACV,iBAAkB,CAiBlB,AArLJ,8EAwKK,qBAAsB,CACtB,AAzKL,yEA4KK,cAAe,CACf,AA7KL,sFAiLM,QAAS,AACT,QAAS,CACT,AAnLN,oFA0LK,kBAAkB,CAClB,AA3LL,qEA8LK,eAAc,AACd,wBAAoD,CACpD,AAhML,uHAqMM,gBAAgB,AAChB,+BAlOoC,CAmOpC,AAvMN,sHA4MM,gBAAgB,AAChB,+BAzPW,CA0PX,AA9MN,uHAmNM,6BA/PW,AAgQX,kBAAmB,CACnB,AArNN,+GA4NM,uBAAyB,AAAzB,yBAAyB,AACzB,uBAAuB,AAEvB,oBAAY,AAAZ,aAAY,AACZ,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,sBAAsB,CACtB,AAlON,oHAuOM,wBAAyB,CACzB,AAxON,2GA6OM,gBAAe,AACf,gBAAgB,CAChB,AA/ON,uIAmPO,gBAAe,AACf,mBAAmB,CACnB,AArPP,uGA0PM,qBAAqB,CACrB,AA3PN,+CAkQG,qBAAqB,AACrB,kBAAkB,AAIlB,UAAW,CAWX,AAlRH,qEA0QI,kBAhRa,AAkRb,2BAnSgB,CAoShB,AA7QJ,sEAgRI,0BAvSgB,CAwShB,AAjRJ,qDAqRG,sBAAqB,AACrB,eAAc,AAEd,uCAAqD,AAErD,0BAAyD,AAgBzD,0BAjUiB,AAkUjB,6BA7UoB,AA+UpB,eAAgB,CAChB,AA9SH,oEA6RI,yBAA0B,AAE1B,yBAAyD,CASzD,AAxSJ,iGAkSK,YAAa,CACb,AAnSL,oFAsSK,eAAe,CACf,AAvSL,2DAiTG,cAAc,CAKd,AAtTH,iEAoTI,YAAa,CACb,AArTJ,kCA2TE,kBAAiB,AACjB,WAAU,AACV,mBAAmB,AACnB,cAAa,AACb,gCAAiC,CAuDjC,AAtXF,wCAkUG,YAAa,CACb,AAnUH,yDAuUG,sBAAqB,AACrB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAOlB,UAAU,CAYV,AA5VH,wFA4UI,gBAAe,AACf,cAAc,CACd,AA9UJ,8DAmVI,qBAAqB,AAErB,cAAa,AACb,aAAY,AAEZ,cApYa,AAqYb,gBAAiB,AACjB,cAAe,CACf,AA3VJ,mDAgWG,kBAAiB,AACjB,qBAAoB,AACpB,yBA3XwB,AA4XxB,mBAAmB,AACnB,iBAAgB,AAChB,UA3Xe,CA2Yf,AArXH,kFAyWK,gBAAiB,AACjB,4BAAwD,CASxD,AAnXL,sGA6WM,+BAzZW,CA0ZX,AA9WN,yGAiXM,4BA7ZW,CA8ZX,AAlXN,wCA2XE,kBAAiB,AACjB,QAAO,AACP,MAAK,AACL,SAAQ,AACR,SAAS,CAUT,AAzYF,6CAkYG,OAAM,AACN,UAAU,CACV,AApYH,8CAuYG,gBAAgB,CAChB,AAxYH,6BA8YE,iBAAgB,AAChB,0BAxZwB,AAyZxB,sBA5ZyB,AA6ZzB,iBAAgB,AAChB,cA9be,AA+bf,gBAAgB,AAChB,mBAAkB,AAClB,qBAAgB,AAAhB,iBAAgB,AAEhB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CA8FpB,AAxfF,qDA6ZG,sBAAqB,AACrB,wBAAuB,AACvB,sBAA2B,AAE3B,gBAAgB,AAEhB,0BAAyD,AAEzD,uCAAqD,AACrD,0CAAwD,AAkBxD,6BA/ciB,AAgdjB,0BAhdiB,AAkdjB,eAAgB,CAOhB,AAlcH,oEAyaI,yBAAyD,CAazD,AAtbJ,iGA4aK,YAAa,CACb,AA7aL,oFAgbK,eAAe,CAKf,AArbL,gGAmbM,kCAA2C,CAC3C,AApbN,gEA8bI,mBAAkB,AAClB,mBAAkB,AAClB,4BAA6B,CAC7B,AAjcJ,kDAscG,cAlfc,AAmfd,oBAAmB,AACnB,oBAAmB,AACnB,iBAAiB,CACjB,AA1cH,kDA8cG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA7doB,AA8dpB,iBAAiB,CACjB,AArdH,8CAydG,YAAY,CACZ,AA1dH,6CA8dG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA7eoB,AA8epB,kBAAiB,AAEjB,6BAA+B,CAiB/B,AAvfH,oDAyeI,aArhBa,CAshBb,AA1eJ,sDA6eI,UAAU,CACV,AA9eJ,kEAkfK,eAAc,AACd,0BAAyB,AACzB,UAAU,CACV,AArfL,6BA4fE,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAElB,MAAK,AACL,OAAM,AACN,YAAW,AAEX,YAAW,AACX,WAAU,AACV,0BAAyB,AACzB,iBAAiB,CA2BjB,AAliBF,mDA2gBG,qBAAoB,AAEpB,cAAa,AACb,kBAAiB,AAEjB,mBAAkB,AAElB,gBAAe,AACf,gBAAgB,AAChB,cAAc,CAad,AAjiBH,qEAwhBI,sBAAqB,AACrB,UAAU,CACV,AA1hBJ,mEA8hBI,sBAAqB,AACrB,aAAa,CACb,AAMJ,eACC,kBAAkB,AAGlB,sBAAsB,AACtB,gBAA0C,AAM1C,iBAAkB,CAqYlB,AAhZD,2CAeG,8BAjmBc,CAkmBd,AAhBH,6BAqBE,wBA/jBqC,CAwkBrC,AA9BF,6CAwBG,qBAtlBwB,CA2lBxB,AA7BH,yDA2BI,8BArkBmC,CAskBnC,AA5BJ,0CAiCE,cAAe,CAKf,AAtCF,0DAoCG,qBA/lBqB,CAgmBrB,AArCH,kDA0CG,wBAnmB4B,CAomB5B,AA3CH,wDAgDG,yBAxmBiC,AAymBjC,cAAe,CACf,AAlDH,gCAsDE,kBAAkB,AAElB,0BArnBkB,AAsnBlB,6BAtnBkB,AAwnBlB,8BAA+B,AAC/B,UAAU,CACV,AA7DF,4CAiEE,kBAAiB,AACjB,QAAO,AACP,SAAQ,AACR,OAAM,AACN,UAAU,CAUV,AA/EF,iDAwEG,MAAK,AACL,WAAW,CACX,AA1EH,kDA6EG,gBAAgB,CAChB,AA9EH,iCAkFE,qBAAqB,AACrB,kBAAkB,AAElB,yBAAyB,AAEzB,UAAW,CAUX,AAjGF,uDA2FG,2BAxpBiB,CAypBjB,AA5FH,wDA+FG,0BA5pBiB,CA6pBjB,AAhGH,8CAoGE,sBAAqB,AAErB,YAAW,AAEX,0BArqBkB,AAsqBlB,4BAtqBkB,CAyrBlB,AA5HF,oDA4GG,YAAY,CACZ,AA7GH,oDAgHG,cA7rBW,CAwsBX,AA3HH,0DAoHK,iBAAkB,CAKlB,AAzHL,wEAuHM,kBAAkB,CAClB,AAxHN,+BAgIE,qBAAoB,AACpB,kBAAkB,AAClB,sBAAqB,AACrB,gBAAe,AACf,4BAjsBkB,AAksBlB,sBAAqB,AACrB,mBAAkB,AAClB,gBAAe,AACf,uBAAsB,AAEtB,wBAzsByB,CAm4BzB,AApUF,iDA6IG,yBAnsBkB,AAosBlB,SAAU,CAMV,AApJH,+GAiJI,WAAU,AACV,sBAAsB,CACtB,AAnJJ,yDAuJG,qBA5sBgB,CAmtBhB,AA9JH,+HAyJI,WAAU,AACV,uBAAsB,AAEtB,UAjtBe,CAktBf,AA7JJ,6EAmKI,YAAa,CACb,AApKJ,oDA0KG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAuB,AAAvB,uBAAuB,AAEvB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAcpB,AA/LH,8EAqLI,SAAS,CAST,AA9LJ,wGAyLK,WAAU,AACV,WAAU,AACV,eAAc,AACd,eAAe,CACf,AA7LL,2DAkMG,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BA1wBiB,AA2wBjB,4BA3wBiB,CA4wBjB,AA/MH,4DAmNG,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBAzxBe,AA0xBf,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAmDf,AApRH,kEAoOI,eAAc,AACd,yBAA4B,CAC5B,AAtOJ,kGAyOI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AA5PJ,wGAkPK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAtzBa,CAuzBb,AA3PL,gGA+PI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAj0Bc,CA80Bd,AAlRJ,sGAwQK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA50Ba,CA60Bb,AAjRL,qEAuRG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,YAAW,AACX,WAAU,AAEV,mBAAkB,AAClB,gBAAe,AAEf,cAr2BwB,AAs2BxB,gBAAgB,AAChB,eAAe,CAmBf,AA3TH,2EA2SI,UAAU,CACV,AA5SJ,sHAgTK,eAAe,CACf,AAjTL,sOAyTI,YAAY,CACZ,AA1TJ,wDA8TG,qBAAqB,AACrB,YAAW,AACX,WAAU,AAEV,kBAAkB,CAClB,AAnUH,+BAyUE,sBAAqB,AACrB,gCA55Be,AA65Bf,6BA75Be,AA85Bf,YAAW,AACX,kBAAiB,AACjB,mBAAiC,AACjC,gBAAgB,AAChB,UAAS,AACT,kBAAkB,AAElB,cAAe,CA4Df,AA/YF,qCAsVG,eAAc,AACd,+BAA+B,CAC/B,AAxVH,wEA6VI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,6BAl7Ba,AAm7Bb,eAAgB,CAChB,AAlWJ,uDAsWG,iBAAiB,CACjB,AAvWH,uDA0WG,iBAAiB,CACjB,AA3WH,uDA8WG,iBAAiB,CACjB,AA/WH,uDAkXG,iBAAiB,CACjB,AAnXH,uDAsXG,kBAAkB,CAClB,AAvXH,uDA0XG,oBAAqB,CACrB,AA3XH,gDAgYG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,8BAz9Bc,AA09Bd,qBAAqB,CACrB,AAzYH,oCA4YG,iBAAgB,AAChB,aA/9Bc,CAg+Bd,AAIH,gBACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,mBAt9B0B,AAu9B1B,sBAr9BmB,AAs9BnB,oCAAuC,AAEvC,eAx+Ba,AA0+Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CAqBd,AAnCD,qCAkBE,iBAAgB,AAEhB,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CAUjB,AA9BF,kEAuBG,UAAW,CACX,AAxBH,8EA2BG,eAAe,AACf,eA5+BwB,CA6+BxB,AA7BH,0CAiCE,yBAh/BkB,CAi/BlB,AAGF,4BACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,iBAAgB,AAEhB,mBA7/B0B,AA8/B1B,yBAr/BoB,AAu/BpB,eA9gCa,AAghCb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CA6Cd,AA5DD,6DAkBE,YAAW,AAEX,UAvgCgB,CA6hChB,AA1CF,oEAuBG,cA7gCwB,AA8gCxB,kBArgCkB,CA0gClB,AA7BH,4EA2BI,mCAjhCuB,CAkhCvB,AA5BJ,qEAgCG,yBA7gCkB,CA8gClB,AAjCH,mEAqCG,eAAc,AAEd,cA7hCwB,AA8hCxB,kBArhCkB,CAshClB,AAzCH,+DA6CE,YAAW,AAEX,WAliCgB,AAmiChB,iBAAkB,CAClB,AAjDF,8DAoDE,6BAxiCkB,AA0iClB,YAAW,AACX,gBAAe,AAEf,WA5iCgB,AA6iChB,eAAgB,CAChB,AAKF,4BACC,kBAAkB,AAClB,MAAK,AACL,SAAQ,AACR,OAAM,AACN,QAAO,AAEP,aAAc,CACd,AAED,uEACC,sBAAuB,CACvB,AAED,uBACC,wBAAyB,CAyKzB,AA1KD,oDAME,sBAAqB,AACrB,gCA9lCe,AA+lCf,6BA/lCe,AAgmCf,YAAW,AACX,kBAAiB,AACjB,mBAAiC,AACjC,gBAAgB,AAChB,UAAS,AACT,kBAAkB,AAElB,cAAe,CAqEf,AArFF,0DAmBG,eAAc,AACd,+BAA+B,CAC/B,AArBH,6FA0BI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,6BApnCa,AAqnCb,eAAgB,CAChB,AA/BJ,+EAoCI,2BAA4B,CAC5B,AArCJ,+EA0CI,2BAA4B,CAC5B,AA3CJ,+EAgDI,2BAA4B,CAC5B,AAjDJ,+EAsDI,2BAA4B,CAC5B,AAvDJ,+EA4DI,4BAA6B,CAC7B,AA7DJ,4EAiEG,oBAAqB,CACrB,AAlEH,qEAsEG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,8BApqCc,AAqqCd,qBAAqB,CACrB,AA/EH,yDAkFG,iBAAgB,AAChB,aA1qCc,CA2qCd,AApFH,mDAwFE,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BArqCkB,AAsqClB,4BAtqCkB,CAuqClB,AArGF,oDAyGE,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBAprCgB,AAqrChB,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAkDf,AAzKF,0DA0HG,eAAc,AACd,yBAA4B,CAC5B,AA5HH,0FA+HG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAlJH,gGAwII,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAjtCc,CAktCd,AAjJJ,wFAqJG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eA5tCe,CAyuCf,AAxKH,8FA8JI,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAvuCc,CAwuCd","file":"tabulator_modern.min.css","sourcesContent":["/* Tabulator v4.7.0 (c) Oliver Folkerd */\n\n\r\n$primary: #3759D7 !default; //the base text color from which the rest of the theme derives\r\n\r\n//Main Theme Variables\r\n$backgroundColor: #fff !default; //background color of tabulator\r\n$borderColor:#fff !default; //border to tabulator\r\n$textSize:16px !default; //table text size\r\n\r\n//header themeing\r\n$headerBackgroundColor:#fff !default; //border to tabulator\r\n$headerTextColor:$primary !default; //header text colour\r\n$headerBorderColor:#fff !default; //header border color\r\n$headerSeperatorColor:$primary !default; //header bottom seperator color\r\n$headerMargin:4px !default; //padding round header\r\n\r\n//column header arrows\r\n$sortArrowActive: $primary !default;\r\n$sortArrowInactive: lighten($primary, 30%) !default;\r\n\r\n//row themeing\r\n$rowBackgroundColor:#f3f3f3 !default; //table row background color\r\n$rowAltBackgroundColor:#fff !default; //table row background color\r\n$rowBorderColor:#fff !default; //table border color\r\n$rowTextColor:#333 !default; //table text color\r\n$rowHoverBackground:#bbb !default; //row background color on hover\r\n\r\n$rowSelectedBackground: #9ABCEA !default; //row background color when selected\r\n$rowSelectedBackgroundHover: #769BCC !default;//row background color when selected and hovered\r\n\r\n$editBoxColor:#1D68CD !default; //border color for edit boxes\r\n$errorColor:#dd0000 !default; //error indication\r\n\r\n//footer themeing\r\n$footerBackgroundColor:#fff !default; //border to tabulator\r\n$footerTextColor:$primary !default; //footer text colour\r\n$footerBorderColor:#aaa !default; //footer border color\r\n$footerSeperatorColor:#999 !default; //footer bottom seperator color\r\n$footerActiveColor:$primary !default; //footer bottom active text color\r\n\r\n$handleWidth:10px !default; //width of the row handle\r\n$handleColor: $primary !default; //color for odd numbered rows\r\n$handleColorAlt: lighten($primary, 10%) !default; //color for even numbered rows\r\n\r\n\r\n//Tabulator Containing Element\r\n.tabulator{\r\n\tposition: relative;\r\n\tborder: 1px solid $borderColor;\r\n\tbackground-color: $backgroundColor;\r\n\toverflow:hidden;\r\n\tfont-size:$textSize;\r\n\ttext-align: left;\r\n\r\n\t-webkit-transform: translatez(0);\r\n\t-moz-transform: translatez(0);\r\n\t-ms-transform: translatez(0);\r\n\t-o-transform: translatez(0);\r\n\ttransform: translatez(0);\r\n\r\n\t&[tabulator-layout=\"fitDataFill\"]{\r\n\t\t.tabulator-tableHolder{\r\n\t\t\t.tabulator-table{\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitDataTable\"]{\r\n\t\tdisplay: inline-block;\r\n\t}\r\n\r\n\t&.tabulator-block-select{\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t//column header containing element\r\n\t.tabulator-header{\r\n\t\tposition:relative;\r\n\t\tbox-sizing: border-box;\r\n\r\n\t\twidth:100%;\r\n\r\n\t\tborder-bottom:3px solid $headerSeperatorColor;\r\n\t\tmargin-bottom:4px;\r\n\t\tbackground-color: $headerBackgroundColor;\r\n\t\tcolor: $headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:hidden;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\tpadding-left:$handleWidth;\r\n\r\n\t\tfont-size: 1.1em;\r\n\r\n\t\t&.tabulator-header-hidden{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\t//individual column header element\r\n\t\t.tabulator-col{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition:relative;\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tborder-right:2px solid $headerBorderColor;\r\n\t\t\tbackground-color: $headerBackgroundColor;\r\n\t\t\ttext-align:left;\r\n\t\t\tvertical-align: bottom;\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&.tabulator-moving{\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tborder:1px solid $headerSeperatorColor;\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%);\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\r\n\t\t\t//hold content of column header\r\n\t\t\t.tabulator-col-content{\r\n\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding:4px;\r\n\r\n\t\t\t\t//header menu button\r\n\t\t\t\t.tabulator-header-menu-button{\r\n\t\t\t\t\tpadding: 0 8px;\r\n\r\n\t\t\t\t\t&:hover{\r\n\t\t\t\t\t\tcursor: pointer;\r\n\t\t\t\t\t\topacity: .6;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//hold title of column header\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\twhite-space: nowrap;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttext-overflow: ellipsis;\r\n\t\t\t\t\tvertical-align:bottom;\r\n\r\n\t\t\t\t\t//element to hold title editor\r\n\t\t\t\t\t.tabulator-title-editor{\r\n\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\t\tborder:1px solid $primary;\r\n\r\n\t\t\t\t\t\tpadding:1px;\r\n\r\n\t\t\t\t\t\tbackground: #fff;\r\n\r\n\t\t\t\t\t\tfont-size: 1em;\r\n\t\t\t\t\t\tcolor: $primary;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//column sorter arrow\r\n\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\tdisplay: inline-block;\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\ttop:9px;\r\n\t\t\t\t\tright:8px;\r\n\t\t\t\t\twidth: 0;\r\n\t\t\t\t\theight: 0;\r\n\t\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//complex header column group\r\n\t\t\t&.tabulator-col-group{\r\n\r\n\t\t\t\t//gelement to hold sub columns in column group\r\n\t\t\t\t.tabulator-col-group-cols{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tdisplay: flex;\r\n\r\n\t\t\t\t\tborder-top:2px solid $headerSeperatorColor;\r\n\t\t\t\t\toverflow: hidden;\r\n\r\n\t\t\t\t\tmargin-right:-1px;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//hide left resize handle on first column\r\n\t\t\t&:first-child{\r\n\t\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//header filter containing element\r\n\t\t\t.tabulator-header-filter{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\tmargin-top:2px;\r\n\t\t\t\twidth:100%;\r\n\t\t\t\ttext-align: center;\r\n\r\n\t\t\t\t//styling adjustment for inbuilt editors\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\theight:auto !important;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsvg{\r\n\t\t\t\t\tmargin-top: 3px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput{\r\n\t\t\t\t\t&::-ms-clear {\r\n\t\t\t\t\t\twidth : 0;\r\n\t\t\t\t\t\theight: 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//styling child elements for sortable columns\r\n\t\t\t&.tabulator-sortable{\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tpadding-right:25px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t&[aria-sort=\"none\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"asc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowActive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"desc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\t\t\tborder-bottom: none;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-col-vertical{\r\n\t\t\t\t.tabulator-col-content{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\twriting-mode: vertical-rl;\r\n\t\t\t\t\t\ttext-orientation: mixed;\r\n\r\n\t\t\t\t\t\tdisplay:flex;\r\n\t\t\t\t\t\talign-items:center;\r\n\t\t\t\t\t\tjustify-content:center;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\ttransform: rotate(180deg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-sortable{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\tpadding-top:20px;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\t\tpadding-bottom:20px;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\t\tright:calc(50% - 6px);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tposition: absolute;\r\n\r\n\t\t\t// background-color: inherit;\r\n\r\n\t\t\tz-index: 10;\r\n\r\n\t\t\t&.tabulator-frozen-left{\r\n\t\t\t\tpadding-left: $handleWidth;\r\n\r\n\t\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-frozen-right{\r\n\t\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\tborder-top:2px solid $headerSeperatorColor !important;\r\n\r\n\t\t\tbackground:lighten($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tpadding-left: 0 !important;\r\n\r\n\t\t\t\tbackground:lighten($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-cell{\r\n\t\t\t\t\tbackground:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\t\t\tborder-bottom:1px solid $headerBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen-rows-holder{\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\t&:empty{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//scrolling element to hold table\r\n\t.tabulator-tableHolder{\r\n\t\tposition:relative;\r\n\t\twidth:100%;\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:auto;\r\n\t\t-webkit-overflow-scrolling: touch;\r\n\r\n\t\t&:focus{\r\n\t\t\toutline: none;\r\n\t\t}\r\n\r\n\t\t//default placeholder element\r\n\t\t.tabulator-placeholder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t&[tabulator-render-mode=\"virtual\"]{\r\n\t\t\t\tmin-height:100%;\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\r\n\t\t\twidth:100%;\r\n\r\n\t\t\tspan{\r\n\t\t\t\tdisplay: inline-block;\r\n\r\n\t\t\t\tmargin:0 auto;\r\n\t\t\t\tpadding:10px;\r\n\r\n\t\t\t\tcolor:$primary;\r\n\t\t\t\tfont-weight: bold;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//element to hold table rows\r\n\t\t.tabulator-table{\r\n\t\t\tposition:relative;\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tbackground-color:$rowBackgroundColor;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\toverflow:visible;\r\n\t\t\tcolor:$rowTextColor;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\t&.tabulator-calcs{\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t\tbackground:darken($rowAltBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t\t&.tabulator-calcs-top{\r\n\t\t\t\t\t\tborder-bottom:2px solid $headerSeperatorColor;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-calcs-bottom{\r\n\t\t\t\t\t\tborder-top:2px solid $headerSeperatorColor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//column resize handles\r\n\t.tabulator-col-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\ttop:0;\r\n\t\tbottom:0;\r\n\t\twidth:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\tleft:0;\r\n\t\t\tright:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ew-resize;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//footer element\r\n\t.tabulator-footer{\r\n\t\tpadding:5px 10px;\r\n\t\tborder-top:1px solid $footerSeperatorColor;\r\n\t\tbackground-color: $footerBackgroundColor;\r\n\t\ttext-align:right;\r\n\t\tcolor: $footerTextColor;\r\n\t\tfont-weight:bold;\r\n\t\twhite-space:nowrap;\r\n\t\tuser-select:none;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\twidth:calc(100% + 20px);\r\n\t\t\tmargin:-5px -10px 5px -10px;\r\n\r\n\t\t\ttext-align: left;\r\n\r\n\t\t\tbackground:lighten($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\tborder-top:3px solid $headerSeperatorColor !important;\r\n\t\t\tborder-bottom:2px solid $headerSeperatorColor !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:lighten($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-cell{\r\n\t\t\t\t\tbackground:none;\r\n\r\n\t\t\t\t\t&:first-child{\r\n\t\t\t\t\t\tborder-left: $handleWidth solid transparent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-bottom:1px solid $rowBorderColor;\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&:only-child{\r\n\t\t\t\tmargin-bottom:-5px;\r\n\t\t\t\tborder-bottom:none;\r\n\t\t\t\tborder-bottom:none !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-paginator{\r\n\t\t\tcolor: $footerTextColor;\r\n\t\t\tfont-family:inherit;\r\n\t\t\tfont-weight:inherit;\r\n\t\t\tfont-size:inherit;\r\n\t\t}\r\n\r\n\t\t//page size select element\r\n\t\t.tabulator-page-size{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 5px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-pages{\r\n\t\t\tmargin:0 7px;\r\n\t\t}\r\n\r\n\t\t//pagination button\r\n\t\t.tabulator-page{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 2px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\r\n\t\t\tbackground:rgba(255,255,255,.2);\r\n\r\n\t\t\t&.active{\r\n\t\t\t\tcolor:$footerActiveColor;\r\n\t\t\t}\r\n\r\n\t\t\t&:disabled{\r\n\t\t\t\topacity:.5;\r\n\t\t\t}\r\n\r\n\t\t\t&:not(.disabled){\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground:rgba(0,0,0,.2);\r\n\t\t\t\t\tcolor:#fff;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//holding div that contains loader and covers tabulator element to prevent interaction\r\n\t.tabulator-loader{\r\n\t\tposition:absolute;\r\n\t\tdisplay: flex;\r\n\t\talign-items:center;\r\n\r\n\t\ttop:0;\r\n\t\tleft:0;\r\n\t\tz-index:100;\r\n\r\n\t\theight:100%;\r\n\t\twidth:100%;\r\n\t\tbackground:rgba(0,0,0,.4);\r\n\t\ttext-align:center;\r\n\r\n\t\t//loading message element\r\n\t\t.tabulator-loader-msg{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 auto;\r\n\t\t\tpadding:10px 20px;\r\n\r\n\t\t\tborder-radius:10px;\r\n\r\n\t\t\tbackground:#fff;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:16px;\r\n\r\n\t\t\t//loading message\r\n\t\t\t&.tabulator-loading{\r\n\t\t\t\tborder:4px solid #333;\r\n\t\t\t\tcolor:#000;\r\n\t\t\t}\r\n\r\n\t\t\t//error message\r\n\t\t\t&.tabulator-error{\r\n\t\t\t\tborder:4px solid #D00;\r\n\t\t\t\tcolor:#590000;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//row element\r\n.tabulator-row{\r\n\tposition: relative;\r\n\tbox-sizing: border-box;\r\n\r\n\tbox-sizing: border-box;\r\n\tmin-height:$textSize + ($headerMargin * 2);\r\n\r\n\t// background-color: $handleColor;\r\n\r\n\t// padding-left: $handleWidth !important;\r\n\r\n\tmargin-bottom: 2px;\r\n\r\n\t.tabulator-cell{\r\n\t\t&:first-child{\r\n\t\t\tborder-left: $handleWidth solid $handleColor;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t&:nth-child(even){\r\n\t\tbackground-color: $handleColorAlt;\r\n\r\n\t\t.tabulator-cell{\r\n\t\t\tbackground-color: $rowAltBackgroundColor;\r\n\r\n\t\t\t&:first-child{\r\n\t\t\t\tborder-left: $handleWidth solid $handleColorAlt;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&.tabulator-selectable:hover{\r\n\t\tcursor: pointer;\r\n\r\n\t\t.tabulator-cell{\r\n\t\t\tbackground-color:$rowHoverBackground;\r\n\t\t}\r\n\t}\r\n\r\n\t&.tabulator-selected{\r\n\t\t.tabulator-cell{\r\n\t\t\tbackground-color:$rowSelectedBackground;\r\n\t\t}\r\n\t}\r\n\r\n\t&.tabulator-selected:hover{\r\n\t\t.tabulator-cell{\r\n\t\t\tbackground-color:$rowSelectedBackgroundHover;\r\n\t\t\tcursor: pointer;\r\n\t\t}\r\n\t}\r\n\r\n\t&.tabulator-moving{\r\n\t\tposition: absolute;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpointer-events: none !important;\r\n\t\tz-index:15;\r\n\t}\r\n\r\n\t//row resize handles\r\n\t.tabulator-row-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\tbottom:0;\r\n\t\tleft:0;\r\n\t\theight:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\ttop:0;\r\n\t\t\tbottom:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ns-resize;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-frozen{\r\n\t\tdisplay: inline-block;\r\n\t\tposition: absolute;\r\n\r\n\t\tbackground-color: inherit;\r\n\r\n\t\tz-index: 10;\r\n\r\n\t\t&.tabulator-frozen-left{\r\n\t\t\t// padding-left: $handleWidth;\r\n\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t&.tabulator-frozen-right{\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-responsive-collapse{\r\n\t\tbox-sizing:border-box;\r\n\r\n\t\tpadding:5px;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t&:empty{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\ttable{\r\n\t\t\tfont-size:$textSize;\r\n\r\n\t\t\ttr{\r\n\t\t\t\ttd{\r\n\t\t\t\t\tposition: relative;\r\n\r\n\t\t\t\t\t&:first-of-type{\r\n\t\t\t\t\t\tpadding-right:10px;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//cell element\r\n\t.tabulator-cell{\r\n\t\tdisplay:inline-block;\r\n\t\tposition: relative;\r\n\t\tbox-sizing:border-box;\r\n\t\tpadding:6px 4px;\r\n\t\tborder-right:2px solid $rowBorderColor;\r\n\t\tvertical-align:middle;\r\n\t\twhite-space:nowrap;\r\n\t\toverflow:hidden;\r\n\t\ttext-overflow:ellipsis;\r\n\r\n\t\tbackground-color: $rowBackgroundColor;\r\n\r\n\t\t&.tabulator-editing{\r\n\t\t\tborder:1px solid $editBoxColor;\r\n\t\t\tpadding: 0;\r\n\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-validation-fail{\r\n\t\t\tborder:1px solid $errorColor;\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\r\n\t\t\t\tcolor: $errorColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//hide left resize handle on first column\r\n\t\t&:first-child{\r\n\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//movable row handle\r\n\t\t&.tabulator-row-handle{\r\n\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content: center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\t//handle holder\r\n\t\t\t.tabulator-row-handle-box{\r\n\t\t\t\twidth:80%;\r\n\r\n\t\t\t\t//Hamburger element\r\n\t\t\t\t.tabulator-row-handle-bar{\r\n\t\t\t\t\twidth:100%;\r\n\t\t\t\t\theight:3px;\r\n\t\t\t\t\tmargin-top:2px;\r\n\t\t\t\t\tbackground:#666;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-branch{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:9px;\r\n\t\t\twidth:7px;\r\n\r\n\t\t\tmargin-top:-9px;\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control{\r\n\r\n\t\t\tdisplay:inline-flex;\r\n\t\t\tjustify-content:center;\r\n\t\t\talign-items:center;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:11px;\r\n\t\t\twidth:11px;\r\n\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder:1px solid $rowTextColor;\r\n\t\t\tborder-radius:2px;\r\n\t\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\t\toverflow:hidden;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\tcursor:pointer;\r\n\t\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: transparent;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-expand{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-responsive-collapse-toggle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\theight:15px;\r\n\t\t\twidth:15px;\r\n\r\n\t\t\tborder-radius:20px;\r\n\t\t\tbackground:#666;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:1.1em;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\topacity:.7;\r\n\t\t\t}\r\n\r\n\t\t\t&.open{\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\t\tdisplay:initial;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-open{\r\n\t\t\t\t\tdisplay:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-traffic-light{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\theight:14px;\r\n\t\t\twidth:14px;\r\n\r\n\t\t\tborder-radius:14px;\r\n\t\t}\r\n\t}\r\n\r\n\t//row grouping element\r\n\t&.tabulator-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:2px solid $primary;\r\n\t\tborder-top:2px solid $primary;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:lighten($primary, 20%);\r\n\t\tfont-weight:bold;\r\n\t\tcolor:fff;\r\n\t\tmargin-bottom: 2px;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\tpadding-left:30px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\tpadding-left:50px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\tpadding-left:70px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\tpadding-left:90px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\tpadding-left:110px;\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:$primary;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n.tabulator-menu{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\tbox-shadow: 0 0 5px 0 rgba(0, 0, 0, .2);\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-menu-item{\r\n\r\n\t\tpadding:5px 10px;\r\n\r\n\t\tuser-select: none;\r\n\r\n\t\t&.tabulator-menu-item-disabled{\r\n\t\t\topacity: .5;\r\n\t\t}\r\n\r\n\t\t&:not(.tabulator-menu-item-disabled):hover{\r\n\t\t\tcursor: pointer;\r\n\t\t\tbackground: $rowAltBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-menu-separator{\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t}\r\n}\r\n\r\n.tabulator-edit-select-list{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tmax-height:200px;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $editBoxColor;\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-edit-select-list-item{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\r\n\t\t&.active{\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\r\n\t\t\t&.focused{\r\n\t\t\t\toutline:1px solid rgba($rowBackgroundColor, .5);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.focused{\r\n\t\t\toutline:1px solid $editBoxColor;\r\n\t\t}\r\n\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-notice{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\ttext-align: center;\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-group{\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpadding:4px;\r\n\t\tpadding-top:6px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\tfont-weight:bold;\r\n\t}\r\n}\r\n\r\n// Table print styling\r\n\r\n.tabulator-print-fullscreen{\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tbottom:0;\r\n\tleft:0;\r\n\tright:0;\r\n\r\n\tz-index: 10000;\r\n}\r\n\r\nbody.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){\r\n\tdisplay:none !important;\r\n}\r\n\r\n.tabulator-print-table{\r\n\tborder-collapse: collapse;\r\n\r\n\t//row grouping element\r\n\t.tabulator-print-table-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:2px solid $primary;\r\n\t\tborder-top:2px solid $primary;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:lighten($primary, 20%);\r\n\t\tfont-weight:bold;\r\n\t\tcolor:fff;\r\n\t\tmargin-bottom: 2px;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:30px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:50px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:70px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:90px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:110px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:$primary;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-data-tree-branch{\r\n\t\tdisplay:inline-block;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:9px;\r\n\t\twidth:7px;\r\n\r\n\t\tmargin-top:-9px;\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\tborder-left:2px solid $rowBorderColor;\r\n\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t}\r\n\r\n\t.tabulator-data-tree-control{\r\n\r\n\t\tdisplay:inline-flex;\r\n\t\tjustify-content:center;\r\n\t\talign-items:center;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:11px;\r\n\t\twidth:11px;\r\n\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder:1px solid $rowTextColor;\r\n\t\tborder-radius:2px;\r\n\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\toverflow:hidden;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: transparent;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-expand{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/app/static/vendors/tabulator/css/tabulator_simple.css b/app/static/vendors/tabulator/css/tabulator_simple.css deleted file mode 100644 index fb660a9..0000000 --- a/app/static/vendors/tabulator/css/tabulator_simple.css +++ /dev/null @@ -1,992 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator { - position: relative; - background-color: #fff; - overflow: hidden; - font-size: 14px; - text-align: left; - -ms-transform: translatez(0); - transform: translatez(0); -} - -.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table { - min-width: 100%; -} - -.tabulator[tabulator-layout="fitDataTable"] { - display: inline-block; -} - -.tabulator.tabulator-block-select { - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator .tabulator-header { - position: relative; - box-sizing: border-box; - width: 100%; - border-bottom: 1px solid #999; - background-color: #fff; - color: #555; - font-weight: bold; - white-space: nowrap; - overflow: hidden; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-header.tabulator-header-hidden { - display: none; -} - -.tabulator .tabulator-header .tabulator-col { - display: inline-block; - position: relative; - box-sizing: border-box; - border-right: 1px solid #ddd; - background-color: #fff; - text-align: left; - vertical-align: bottom; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-moving { - position: absolute; - border: 1px solid #999; - background: #e6e6e6; - pointer-events: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content { - box-sizing: border-box; - position: relative; - padding: 4px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button { - padding: 0 8px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover { - cursor: pointer; - opacity: .6; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { - box-sizing: border-box; - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: bottom; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor { - box-sizing: border-box; - width: 100%; - border: 1px solid #999; - padding: 1px; - background: #fff; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow { - display: inline-block; - position: absolute; - top: 9px; - right: 8px; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { - position: relative; - display: -ms-flexbox; - display: flex; - border-top: 1px solid #ddd; - overflow: hidden; - margin-right: -1px; -} - -.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { - position: relative; - box-sizing: border-box; - margin-top: 2px; - width: 100%; - text-align: center; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea { - height: auto !important; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg { - margin-top: 3px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear { - width: 0; - height: 0; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title { - padding-right: 25px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { - cursor: pointer; - background-color: #e6e6e6; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #666; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow { - border-top: 6px solid #666; - border-bottom: none; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title { - -ms-writing-mode: tb-rl; - writing-mode: vertical-rl; - text-orientation: mixed; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title { - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title { - padding-right: 0; - padding-top: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title { - padding-right: 0; - padding-bottom: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow { - right: calc(50% - 6px); -} - -.tabulator .tabulator-header .tabulator-frozen { - display: inline-block; - position: absolute; - z-index: 10; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #ddd; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #ddd; -} - -.tabulator .tabulator-header .tabulator-calcs-holder { - box-sizing: border-box; - min-width: 600%; - background: #f2f2f2 !important; - border-top: 1px solid #ddd; - border-bottom: 1px solid #999; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row { - background: #f2f2f2 !important; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder { - min-width: 600%; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty { - display: none; -} - -.tabulator .tabulator-tableHolder { - position: relative; - width: 100%; - white-space: nowrap; - overflow: auto; - -webkit-overflow-scrolling: touch; -} - -.tabulator .tabulator-tableHolder:focus { - outline: none; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder { - box-sizing: border-box; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode="virtual"] { - min-height: 100%; - min-width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder span { - display: inline-block; - margin: 0 auto; - padding: 10px; - color: #000; - font-weight: bold; - font-size: 20px; -} - -.tabulator .tabulator-tableHolder .tabulator-table { - position: relative; - display: inline-block; - background-color: #fff; - white-space: nowrap; - overflow: visible; - color: #333; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs { - font-weight: bold; - background: #f2f2f2 !important; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top { - border-bottom: 2px solid #ddd; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom { - border-top: 2px solid #ddd; -} - -.tabulator .tabulator-col-resize-handle { - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 5px; -} - -.tabulator .tabulator-col-resize-handle.prev { - left: 0; - right: auto; -} - -.tabulator .tabulator-col-resize-handle:hover { - cursor: ew-resize; -} - -.tabulator .tabulator-footer { - padding: 5px 10px; - border-top: 1px solid #999; - background-color: #fff; - text-align: right; - color: #555; - font-weight: bold; - white-space: nowrap; - -ms-user-select: none; - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder { - box-sizing: border-box; - width: calc(100% + 20px); - margin: -5px -10px 5px -10px; - text-align: left; - background: #f2f2f2 !important; - border-bottom: 1px solid #fff; - border-top: 1px solid #ddd; - overflow: hidden; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { - background: #f2f2f2 !important; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder:only-child { - margin-bottom: -5px; - border-bottom: none; -} - -.tabulator .tabulator-footer .tabulator-paginator { - color: #555; - font-family: inherit; - font-weight: inherit; - font-size: inherit; -} - -.tabulator .tabulator-footer .tabulator-page-size { - display: inline-block; - margin: 0 5px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; -} - -.tabulator .tabulator-footer .tabulator-pages { - margin: 0 7px; -} - -.tabulator .tabulator-footer .tabulator-page { - display: inline-block; - margin: 0 2px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; - background: rgba(255, 255, 255, 0.2); -} - -.tabulator .tabulator-footer .tabulator-page.active { - color: #d00; -} - -.tabulator .tabulator-footer .tabulator-page:disabled { - opacity: .5; -} - -.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); - color: #fff; -} - -.tabulator .tabulator-loader { - position: absolute; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - top: 0; - left: 0; - z-index: 100; - height: 100%; - width: 100%; - background: rgba(0, 0, 0, 0.4); - text-align: center; -} - -.tabulator .tabulator-loader .tabulator-loader-msg { - display: inline-block; - margin: 0 auto; - padding: 10px 20px; - border-radius: 10px; - background: #fff; - font-weight: bold; - font-size: 16px; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading { - border: 4px solid #333; - color: #000; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error { - border: 4px solid #D00; - color: #590000; -} - -.tabulator-row { - position: relative; - box-sizing: border-box; - min-height: 22px; - background-color: #fff; - border-bottom: 1px solid #ddd; -} - -.tabulator-row:nth-child(even) { - background-color: #fff; -} - -.tabulator-row.tabulator-selectable:hover { - background-color: #bbb; - cursor: pointer; -} - -.tabulator-row.tabulator-selected { - background-color: #9ABCEA; -} - -.tabulator-row.tabulator-selected:hover { - background-color: #769BCC; - cursor: pointer; -} - -.tabulator-row.tabulator-moving { - position: absolute; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - pointer-events: none !important; - z-index: 15; -} - -.tabulator-row .tabulator-row-resize-handle { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height: 5px; -} - -.tabulator-row .tabulator-row-resize-handle.prev { - top: 0; - bottom: auto; -} - -.tabulator-row .tabulator-row-resize-handle:hover { - cursor: ns-resize; -} - -.tabulator-row .tabulator-frozen { - display: inline-block; - position: absolute; - background-color: inherit; - z-index: 10; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #ddd; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #ddd; -} - -.tabulator-row .tabulator-responsive-collapse { - box-sizing: border-box; - padding: 5px; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; -} - -.tabulator-row .tabulator-responsive-collapse:empty { - display: none; -} - -.tabulator-row .tabulator-responsive-collapse table { - font-size: 14px; -} - -.tabulator-row .tabulator-responsive-collapse table tr td { - position: relative; -} - -.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type { - padding-right: 10px; -} - -.tabulator-row .tabulator-cell { - display: inline-block; - position: relative; - box-sizing: border-box; - padding: 4px; - border-right: 1px solid #ddd; - vertical-align: middle; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.tabulator-row .tabulator-cell:last-of-type { - border-right: none; -} - -.tabulator-row .tabulator-cell.tabulator-editing { - border: 1px solid #1D68CD; - padding: 0; -} - -.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select { - border: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail { - border: 1px solid #dd0000; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select { - border: 1px; - background: transparent; - color: #dd0000; -} - -.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box { - width: 80%; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar { - width: 100%; - height: 3px; - margin-top: 2px; - background: #666; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #ddd; - border-bottom: 2px solid #ddd; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - height: 15px; - width: 15px; - border-radius: 20px; - background: #666; - color: #fff; - font-weight: bold; - font-size: 1.1em; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover { - opacity: .7; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close { - display: initial; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-traffic-light { - display: inline-block; - height: 14px; - width: 14px; - border-radius: 14px; -} - -.tabulator-row.tabulator-group { - box-sizing: border-box; - border-bottom: 1px solid #999; - border-right: 1px solid #ddd; - border-top: 1px solid #999; - padding: 5px; - padding-left: 10px; - background: #fafafa; - font-weight: bold; - min-width: 100%; -} - -.tabulator-row.tabulator-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #666; - border-bottom: 0; -} - -.tabulator-row.tabulator-group.tabulator-group-level-1 { - padding-left: 30px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-2 { - padding-left: 50px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-3 { - padding-left: 70px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-4 { - padding-left: 90px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-5 { - padding-left: 110px; -} - -.tabulator-row.tabulator-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-row.tabulator-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #666; - vertical-align: middle; -} - -.tabulator-row.tabulator-group span { - margin-left: 10px; - color: #666; -} - -.tabulator-menu { - position: absolute; - display: inline-block; - box-sizing: border-box; - background: #fff; - border: 1px solid #ddd; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2); - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-menu .tabulator-menu-item { - padding: 5px 10px; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled { - opacity: .5; -} - -.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover { - cursor: pointer; - background: #fff; -} - -.tabulator-menu .tabulator-menu-separator { - border-top: 1px solid #ddd; -} - -.tabulator-edit-select-list { - position: absolute; - display: inline-block; - box-sizing: border-box; - max-height: 200px; - background: #fff; - border: 1px solid #ddd; - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item { - padding: 4px; - color: #333; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active { - color: #fff; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused { - outline: 1px solid rgba(255, 255, 255, 0.5); -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.focused { - outline: 1px solid #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item:hover { - cursor: pointer; - color: #fff; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-notice { - padding: 4px; - color: #333; - text-align: center; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-group { - border-bottom: 1px solid #ddd; - padding: 4px; - padding-top: 6px; - color: #333; - font-weight: bold; -} - -.tabulator-print-fullscreen { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 10000; -} - -body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) { - display: none !important; -} - -.tabulator-print-table { - border-collapse: collapse; -} - -.tabulator-print-table .tabulator-print-table-group { - box-sizing: border-box; - border-bottom: 1px solid #999; - border-right: 1px solid #ddd; - border-top: 1px solid #999; - padding: 5px; - padding-left: 10px; - background: #fafafa; - font-weight: bold; - min-width: 100%; -} - -.tabulator-print-table .tabulator-print-table-group:hover { - cursor: pointer; - background-color: rgba(0, 0, 0, 0.1); -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #666; - border-bottom: 0; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td { - padding-left: 30px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td { - padding-left: 50px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td { - padding-left: 70px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td { - padding-left: 90px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td { - padding-left: 110px !important; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #666; - vertical-align: middle; -} - -.tabulator-print-table .tabulator-print-table-group span { - margin-left: 10px; - color: #666; -} - -.tabulator-print-table .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #ddd; - border-bottom: 2px solid #ddd; -} - -.tabulator-print-table .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-print-table .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} diff --git a/app/static/vendors/tabulator/css/tabulator_simple.min.css b/app/static/vendors/tabulator/css/tabulator_simple.min.css deleted file mode 100644 index c4148e8..0000000 --- a/app/static/vendors/tabulator/css/tabulator_simple.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator{position:relative;background-color:#fff;overflow:hidden;font-size:14px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#fff;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #ddd;background-color:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#e6e6e6;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:1px solid #ddd;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #ddd}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #ddd}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#f2f2f2!important;border-top:1px solid #ddd;border-bottom:1px solid #999;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f2f2f2!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableHolder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableHolder:focus{outline:none}.tabulator .tabulator-tableHolder .tabulator-placeholder{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#000;font-weight:700;font-size:20px}.tabulator .tabulator-tableHolder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#f2f2f2!important}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #ddd}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #ddd}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-footer{padding:5px 10px;border-top:1px solid #999;background-color:#fff;text-align:right;color:#555;font-weight:700;white-space:nowrap;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-5px -10px 5px;text-align:left;background:#f2f2f2!important;border-bottom:1px solid #fff;border-top:1px solid #ddd;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f2f2f2!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer .tabulator-paginator{color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-loader{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:22px;border-bottom:1px solid #ddd}.tabulator-row,.tabulator-row:nth-child(2n){background-color:#fff}.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #ddd;border-bottom:1px solid #ddd;pointer-events:none!important;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #ddd}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #ddd}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #ddd;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #ddd;border-bottom:2px solid #ddd}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #ddd;border-top:1px solid #999;padding:5px;padding-left:10px;background:#fafafa;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#666}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#fff;border:1px solid #ddd;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{padding:5px 10px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#fff}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #ddd}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;background:#fff;border:1px solid #ddd;font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#333}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#333;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #ddd;padding:4px;padding-top:6px;color:#333;font-weight:700}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #ddd;border-top:1px solid #999;padding:5px;padding-left:10px;background:#fafafa;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#666}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #ddd;border-bottom:2px solid #ddd}.tabulator-print-table .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333} -/*# sourceMappingURL=tabulator_simple.min.css.map */ diff --git a/app/static/vendors/tabulator/css/tabulator_simple.min.css.map b/app/static/vendors/tabulator/css/tabulator_simple.min.css.map deleted file mode 100644 index 0a0672f..0000000 --- a/app/static/vendors/tabulator/css/tabulator_simple.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tabulator_simple.scss"],"names":[],"mappings":"AA0CA,WACC,kBAAkB,AAClB,sBAxCqB,AAyCrB,gBAAe,AACf,eAxCa,AAyCb,gBAAgB,AAMhB,uBAAwB,CA2fxB,AAtgBD,iFAgBI,cAAc,CACd,AAjBJ,0CAsBE,oBAAqB,CACrB,AAvBF,kCA0BE,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CACjB,AA3BF,6BA+BE,kBAAiB,AACjB,sBAAsB,AAEtB,WAAU,AAEV,6BAlEwB,AAmExB,sBAtEyB,AAuEzB,WAtEmB,AAuEnB,gBAAgB,AAEhB,mBAAmB,AACnB,gBAAe,AAEf,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAqPpB,AApSF,qDAkDG,YAAY,CACZ,AAnDH,4CAuDG,qBAAoB,AACpB,kBAAiB,AACjB,sBAAqB,AACrB,4BAzFoB,AA0FpB,sBA5FwB,AA6FxB,gBAAe,AACf,sBAAsB,AACtB,eAAgB,CAwLhB,AAtPH,6DAiEI,kBAAkB,AAClB,sBAhGsB,AAiGtB,mBAA8C,AAC9C,mBAAoB,CACpB,AArEJ,mEAyEI,sBAAqB,AACrB,kBAAkB,AAClB,WAAW,CAgDX,AA3HJ,iGA+EK,aAAc,CAMd,AArFL,uGAkFM,eAAe,AACf,UAAW,CACX,AApFN,wFAyFK,sBAAqB,AACrB,WAAW,AAEX,mBAAmB,AACnB,gBAAgB,AAChB,uBAAuB,AACvB,qBAAqB,CAarB,AA5GL,gHAmGM,sBAAsB,AACtB,WAAW,AAEX,sBAAqB,AAErB,YAAW,AAEX,eAAgB,CAChB,AA3GN,oFAgHK,qBAAqB,AACrB,kBAAkB,AAClB,QAAO,AACP,UAAS,AACT,QAAQ,AACR,SAAS,AACT,kCAAkC,AAClC,mCAAmC,AACnC,4BAjJmB,CAkJnB,AAzHL,0FAkIK,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AAEb,0BApKkB,AAqKlB,gBAAgB,AAEhB,iBAAiB,CACjB,AAzIL,0FAgJK,YAAa,CACb,AAjJL,qEAsJI,kBAAkB,AAClB,sBAAsB,AACtB,eAAc,AACd,WAAU,AACV,iBAAkB,CAiBlB,AA3KJ,8EA8JK,qBAAsB,CACtB,AA/JL,yEAkKK,cAAe,CACf,AAnKL,sFAuKO,QAAS,AACT,QAAS,CACV,AAzKN,oFAiLK,kBAAkB,CAClB,AAlLL,qEAqLK,eAAc,AACd,wBAAoD,CACpD,AAvLL,uHA4LM,gBAAgB,AAChB,4BAtNkB,CAuNlB,AA9LN,sHAmMM,gBAAgB,AAChB,4BA9NgB,CA+NhB,AArMN,uHA0MM,0BApOgB,AAqOhB,kBAAmB,CACnB,AA5MN,+GAmNM,uBAAyB,AAAzB,yBAAyB,AACzB,uBAAuB,AAEvB,oBAAY,AAAZ,aAAY,AACZ,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,sBAAsB,CACtB,AAzNN,oHA8NM,wBAAyB,CACzB,AA/NN,2GAoOM,gBAAe,AACf,gBAAgB,CAChB,AAtON,uIA0OO,gBAAe,AACf,mBAAmB,CACnB,AA5OP,uGAiPM,qBAAqB,CACrB,AAlPN,+CAyPG,qBAAqB,AACrB,kBAAkB,AAIlB,UAAW,CASX,AAvQH,qEAiQI,2BArRgB,CAsRhB,AAlQJ,sEAqQI,0BAzRgB,CA0RhB,AAtQJ,qDA0QG,sBAAqB,AACrB,eAAc,AAEd,6BAAwD,AAUxD,0BA3SiB,AA4SjB,6BAtTuB,AAwTvB,eAAgB,CAChB,AA3RH,oEAgRI,4BAAwD,CAKxD,AArRJ,iGAmRK,YAAa,CACb,AApRL,2DA8RG,cAAc,CAKd,AAnSH,iEAiSI,YAAa,CACb,AAlSJ,kCA0SE,kBAAiB,AACjB,WAAU,AACV,mBAAmB,AACnB,cAAa,AACb,gCAAiC,CAwDjC,AAtWF,wCAiTG,YAAa,CACb,AAlTH,yDAsTG,sBAAqB,AACrB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAOlB,UAAU,CAYV,AA3UH,wFA2TI,gBAAe,AACf,cAAc,CACd,AA7TJ,8DAkUI,qBAAqB,AAErB,cAAa,AACb,aAAY,AAEZ,WAAU,AACV,gBAAiB,AACjB,cAAe,CACf,AA1UJ,mDA+UG,kBAAiB,AACjB,qBAAoB,AACpB,sBAvWqB,AAwWrB,mBAAmB,AACnB,iBAAgB,AAChB,UAvWe,CAwXf,AArWH,kFAwVK,gBAAiB,AACjB,4BAAwD,CASxD,AAlWL,sGA4VM,4BAhXc,CAiXd,AA7VN,yGAgWM,yBApXc,CAqXd,AAjWN,wCA0WE,kBAAiB,AACjB,QAAO,AACP,MAAK,AACL,SAAQ,AACR,SAAS,CAUT,AAxXF,6CAiXG,OAAM,AACN,UAAU,CACV,AAnXH,8CAsXG,gBAAgB,CAChB,AAvXH,6BA6XE,iBAAgB,AAChB,0BAnYwB,AAoYxB,sBAvYyB,AAwYzB,iBAAgB,AAChB,WAxYmB,AAyYnB,gBAAgB,AAChB,mBAAkB,AAClB,qBAAgB,AAAhB,iBAAgB,AAEhB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAkFpB,AA3dF,qDA4YG,sBAAqB,AACrB,wBAAuB,AACvB,sBAA2B,AAE3B,gBAAgB,AAEhB,6BAAwD,AAUxD,6BApawB,AAqaxB,0BAjbiB,AAmbjB,eAAgB,CAMhB,AAraH,oEAqZI,4BAAwD,CAKxD,AA1ZJ,iGAwZK,YAAa,CACb,AAzZL,gEAkaI,mBAAkB,AAClB,kBAAkB,CAClB,AApaJ,kDAyaG,WAhbkB,AAiblB,oBAAmB,AACnB,oBAAmB,AACnB,iBAAiB,CACjB,AA7aH,kDAibG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA5boB,AA6bpB,iBAAiB,CACjB,AAxbH,8CA4bG,YAAY,CACZ,AA7bH,6CAicG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA5coB,AA6cpB,kBAAiB,AAEjB,6BAA+B,CAiB/B,AA1dH,oDA4cI,UAhdmB,CAidnB,AA7cJ,sDAgdI,UAAU,CACV,AAjdJ,kEAqdK,eAAc,AACd,0BAAyB,AACzB,UAAU,CACV,AAxdL,6BA+dE,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAElB,MAAK,AACL,OAAM,AACN,YAAW,AAEX,YAAW,AACX,WAAU,AACV,0BAAyB,AACzB,iBAAiB,CA2BjB,AArgBF,mDA8eG,qBAAoB,AAEpB,cAAa,AACb,kBAAiB,AAEjB,mBAAkB,AAElB,gBAAe,AACf,gBAAgB,AAChB,cAAc,CAad,AApgBH,qEA2fI,sBAAqB,AACrB,UAAU,CACV,AA7fJ,mEAigBI,sBAAqB,AACrB,aAAa,CACb,AAMJ,eACC,kBAAkB,AAClB,sBAAsB,AAEtB,gBAA0C,AAE1C,4BAniBmB,CA+4BnB,AAlXD,4CAKC,qBApiBuB,CAyiBtB,AAVF,0CAaE,sBAxiBsB,AAyiBtB,cAAe,CACf,AAfF,kCAkBE,wBA3iB6B,CA4iB7B,AAnBF,wCAsBE,yBA9iBkC,AA+iBlC,cAAe,CACf,AAxBF,gCA2BE,kBAAkB,AAElB,0BA1jBkB,AA2jBlB,6BA3jBkB,AA6jBlB,8BAA+B,AAC/B,UAAU,CACV,AAlCF,4CAsCE,kBAAiB,AACjB,QAAO,AACP,SAAQ,AACR,OAAM,AACN,UAAU,CAUV,AApDF,iDA6CG,MAAK,AACL,WAAW,CACX,AA/CH,kDAkDG,gBAAgB,CAChB,AAnDH,iCAuDE,qBAAqB,AACrB,kBAAkB,AAElB,yBAAyB,AAEzB,UAAW,CASX,AArEF,uDA+DG,2BA5lBiB,CA6lBjB,AAhEH,wDAmEG,0BAhmBiB,CAimBjB,AApEH,8CAwEE,sBAAqB,AAErB,YAAW,AAEX,0BAzmBkB,AA0mBlB,4BA1mBkB,CA6nBlB,AAhGF,oDAgFG,YAAY,CACZ,AAjFH,oDAoFG,cAjoBW,CA4oBX,AA/FH,0DAwFK,iBAAkB,CAKlB,AA7FL,wEA2FM,kBAAkB,CAClB,AA5FN,+BAoGE,qBAAoB,AACpB,kBAAkB,AAClB,sBAAqB,AACrB,YAAW,AACX,4BAroBkB,AAsoBlB,sBAAqB,AACrB,mBAAkB,AAClB,gBAAe,AACf,sBAAsB,CA6LtB,AAzSF,4CA+GG,iBAAkB,CAClB,AAhHH,iDAmHG,yBAxoBkB,AAyoBlB,SAAU,CAMV,AA1HH,+GAuHI,WAAU,AACV,sBAAsB,CACtB,AAzHJ,yDA6HG,qBAjpBgB,CAwpBhB,AApIH,+HA+HI,WAAU,AACV,uBAAsB,AAEtB,UAtpBe,CAupBf,AAnIJ,6EAyII,YAAa,CACb,AA1IJ,oDAgJG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAElB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAcpB,AApKH,8EA0JI,SAAS,CAST,AAnKJ,wGA8JK,WAAU,AACV,WAAU,AACV,eAAc,AACd,eAAe,CACf,AAlKL,2DAuKG,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BA/sBiB,AAgtBjB,4BAhtBiB,CAitBjB,AApLH,4DAwLG,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBA9tBe,AA+tBf,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAmDf,AAzPH,kEAyMI,eAAc,AACd,yBAA4B,CAC5B,AA3MJ,kGA8MI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAjOJ,wGAuNK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA3vBa,CA4vBb,AAhOL,gGAoOI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAtwBc,CAmxBd,AAvPJ,sGA6OK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAjxBa,CAkxBb,AAtPL,qEA4PG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,YAAW,AACX,WAAU,AAEV,mBAAkB,AAClB,gBAAe,AAEf,WA1yBqB,AA2yBrB,gBAAgB,AAChB,eAAe,CAmBf,AAhSH,2EAgRI,UAAU,CACV,AAjRJ,sHAqRK,eAAe,CACf,AAtRL,sOA8RI,YAAY,CACZ,AA/RJ,wDAmSG,qBAAqB,AACrB,YAAW,AACX,WAAU,AAEV,kBAAkB,CAClB,AAxSH,+BA8SE,sBAAqB,AACrB,6BAA4B,AAC5B,4BA70BkB,AA80BlB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,mBAAkB,AAClB,gBAAgB,AAEhB,cAAe,CA0Df,AAjXF,qCA0TG,eAAc,AACd,+BAA+B,CAC/B,AA5TH,wEAgUI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BAt2BkB,AAu2BlB,eAAgB,CAChB,AArUJ,uDAyUG,iBAAiB,CACjB,AA1UH,uDA6UG,iBAAiB,CACjB,AA9UH,uDAiVG,iBAAiB,CACjB,AAlVH,uDAqVG,iBAAiB,CACjB,AAtVH,uDAyVG,kBAAkB,CAClB,AA1VH,uDA6VG,oBAAqB,CACrB,AA9VH,gDAkWG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BA54BmB,AA64BnB,qBAAqB,CACrB,AA3WH,oCA8WG,iBAAgB,AAChB,UAAU,CACV,AAIH,gBACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,gBAx5BuB,AAy5BvB,sBAv5BmB,AAw5BnB,oCAAuC,AAEvC,eA16Ba,AA46Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CAqBd,AAnCD,qCAkBE,iBAAgB,AAEhB,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CAUjB,AA9BF,kEAuBG,UAAW,CACX,AAxBH,8EA2BG,eAAe,AACf,eA96BwB,CA+6BxB,AA7BH,0CAiCE,yBAl7BkB,CAm7BlB,AAGF,4BACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,iBAAgB,AAEhB,gBA/7BuB,AAg8BvB,sBA97BmB,AAg8BnB,eAh9Ba,AAk9Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CA6Cd,AA5DD,6DAkBE,YAAW,AAEX,UAz8BgB,CA+9BhB,AA1CF,oEAuBG,WA/8BqB,AAg9BrB,kBAt8BkB,CA28BlB,AA7BH,4EA2BI,oCAn9BoB,CAo9BpB,AA5BJ,qEAgCG,yBA98BkB,CA+8BlB,AAjCH,mEAqCG,eAAc,AAEd,WA/9BqB,AAg+BrB,kBAt9BkB,CAu9BlB,AAzCH,+DA6CE,YAAW,AAEX,WAp+BgB,AAq+BhB,iBAAkB,CAClB,AAjDF,8DAoDE,6BA1+BkB,AA4+BlB,YAAW,AACX,gBAAe,AAEf,WA9+BgB,AA++BhB,eAAgB,CAChB,AAKF,4BACC,kBAAkB,AAClB,MAAK,AACL,SAAQ,AACR,OAAM,AACN,QAAO,AAEP,aAAc,CACd,AAED,uEACC,sBAAuB,CACvB,AAED,uBACC,wBAAyB,CAuKzB,AAxKD,oDAME,sBAAqB,AACrB,6BAA4B,AAC5B,4BA5gCkB,AA6gClB,0BAAyB,AACzB,YAAW,AACX,kBAAiB,AACjB,mBAAkB,AAClB,gBAAgB,AAEhB,cAAe,CAoEf,AAnFF,0DAkBG,eAAc,AACd,+BAA+B,CAC/B,AApBH,6FAwBI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,0BAriCkB,AAsiClB,eAAgB,CAChB,AA7BJ,+EAkCI,2BAA4B,CAC5B,AAnCJ,+EAwCI,2BAA4B,CAC5B,AAzCJ,+EA8CI,2BAA4B,CAC5B,AA/CJ,+EAoDI,2BAA4B,CAC5B,AArDJ,+EA0DI,4BAA6B,CAC7B,AA3DJ,4EA+DG,oBAAqB,CACrB,AAhEH,qEAoEG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,2BArlCmB,AAslCnB,qBAAqB,CACrB,AA7EH,yDAgFG,iBAAgB,AAChB,UAAU,CACV,AAlFH,mDAsFE,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BArmCkB,AAsmClB,4BAtmCkB,CAumClB,AAnGF,oDAuGE,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBApnCgB,AAqnChB,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAkDf,AAvKF,0DAwHG,eAAc,AACd,yBAA4B,CAC5B,AA1HH,0FA6HG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAhJH,gGAsII,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAjpCc,CAkpCd,AA/IJ,wFAmJG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eA5pCe,CAyqCf,AAtKH,8FA4JI,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAvqCc,CAwqCd","file":"tabulator_simple.min.css","sourcesContent":["/* Tabulator v4.7.0 (c) Oliver Folkerd */\n\n\r\n//Main Theme Variables\r\n$backgroundColor: #fff !default; //background color of tabulator\r\n$borderColor:#999 !default; //border to tabulator\r\n$textSize:14px !default; //table text size\r\n\r\n//header themeing\r\n$headerBackgroundColor:#fff !default; //border to tabulator\r\n$headerTextColor:#555 !default; //header text colour\r\n$headerBorderColor:#ddd !default; //header border color\r\n$headerSeperatorColor:#999 !default; //header bottom seperator color\r\n$headerMargin:4px !default; //padding round header\r\n\r\n//column header arrows\r\n$sortArrowActive: #666 !default;\r\n$sortArrowInactive: #bbb !default;\r\n\r\n//row themeing\r\n$rowBackgroundColor:#fff !default; //table row background color\r\n$rowAltBackgroundColor:#fff !default; //table row background color\r\n$rowBorderColor:#ddd !default; //table border color\r\n$rowTextColor:#333 !default; //table text color\r\n$rowHoverBackground:#bbb !default; //row background color on hover\r\n\r\n$rowSelectedBackground: #9ABCEA !default; //row background color when selected\r\n$rowSelectedBackgroundHover: #769BCC !default;//row background color when selected and hovered\r\n\r\n\r\n$editBoxColor:#1D68CD !default; //border color for edit boxes\r\n$errorColor:#dd0000 !default; //error indication\r\n\r\n//footer themeing\r\n$footerBackgroundColor:#fff !default; //border to tabulator\r\n$footerTextColor:#555 !default; //footer text colour\r\n$footerBorderColor:#aaa !default; //footer border color\r\n$footerSeperatorColor:#999 !default; //footer bottom seperator color\r\n$footerActiveColor:#d00 !default; //footer bottom active text color\r\n\r\n\r\n//Tabulator Containing Element\r\n.tabulator{\r\n\tposition: relative;\r\n\tbackground-color: $backgroundColor;\r\n\toverflow:hidden;\r\n\tfont-size:$textSize;\r\n\ttext-align: left;\r\n\r\n\t-webkit-transform: translatez(0);\r\n\t-moz-transform: translatez(0);\r\n\t-ms-transform: translatez(0);\r\n\t-o-transform: translatez(0);\r\n\ttransform: translatez(0);\r\n\r\n\t&[tabulator-layout=\"fitDataFill\"]{\r\n\t\t.tabulator-tableHolder{\r\n\t\t\t.tabulator-table{\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitDataTable\"]{\r\n\t\tdisplay: inline-block;\r\n\t}\r\n\r\n\t&.tabulator-block-select{\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t//column header containing element\r\n\t.tabulator-header{\r\n\t\tposition:relative;\r\n\t\tbox-sizing: border-box;\r\n\r\n\t\twidth:100%;\r\n\r\n\t\tborder-bottom:1px solid $headerSeperatorColor;\r\n\t\tbackground-color: $headerBackgroundColor;\r\n\t\tcolor: $headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:hidden;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t&.tabulator-header-hidden{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\t//individual column header element\r\n\t\t.tabulator-col{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition:relative;\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tborder-right:1px solid $headerBorderColor;\r\n\t\t\tbackground-color: $headerBackgroundColor;\r\n\t\t\ttext-align:left;\r\n\t\t\tvertical-align: bottom;\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&.tabulator-moving{\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tborder:1px solid $headerSeperatorColor;\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%);\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\r\n\t\t\t//hold content of column header\r\n\t\t\t.tabulator-col-content{\r\n\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding:4px;\r\n\r\n\t\t\t\t//header menu button\r\n\t\t\t\t.tabulator-header-menu-button{\r\n\t\t\t\t\tpadding: 0 8px;\r\n\r\n\t\t\t\t\t&:hover{\r\n\t\t\t\t\t\tcursor: pointer;\r\n\t\t\t\t\t\topacity: .6;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//hold title of column header\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\twhite-space: nowrap;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttext-overflow: ellipsis;\r\n\t\t\t\t\tvertical-align:bottom;\r\n\r\n\t\t\t\t\t//element to hold title editor\r\n\t\t\t\t\t.tabulator-title-editor{\r\n\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\t\tborder:1px solid #999;\r\n\r\n\t\t\t\t\t\tpadding:1px;\r\n\r\n\t\t\t\t\t\tbackground: #fff;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//column sorter arrow\r\n\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\tdisplay: inline-block;\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\ttop:9px;\r\n\t\t\t\t\tright:8px;\r\n\t\t\t\t\twidth: 0;\r\n\t\t\t\t\theight: 0;\r\n\t\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//complex header column group\r\n\t\t\t&.tabulator-col-group{\r\n\r\n\t\t\t\t//gelement to hold sub columns in column group\r\n\t\t\t\t.tabulator-col-group-cols{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tdisplay: flex;\r\n\r\n\t\t\t\t\tborder-top:1px solid $headerBorderColor;\r\n\t\t\t\t\toverflow: hidden;\r\n\r\n\t\t\t\t\tmargin-right:-1px;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//hide left resize handle on first column\r\n\t\t\t&:first-child{\r\n\t\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//header filter containing element\r\n\t\t\t.tabulator-header-filter{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\tmargin-top:2px;\r\n\t\t\t\twidth:100%;\r\n\t\t\t\ttext-align: center;\r\n\r\n\t\t\t\t//styling adjustment for inbuilt editors\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\theight:auto !important;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsvg{\r\n\t\t\t\t\tmargin-top: 3px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput{\r\n\t\t\t\t\t&::-ms-clear {\r\n\t\t\t\t\t width : 0;\r\n\t\t\t\t\t height: 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//styling child elements for sortable columns\r\n\t\t\t&.tabulator-sortable{\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tpadding-right:25px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t&[aria-sort=\"none\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"asc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowActive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"desc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\t\t\tborder-bottom: none;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-col-vertical{\r\n\t\t\t\t.tabulator-col-content{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\twriting-mode: vertical-rl;\r\n\t\t\t\t\t\ttext-orientation: mixed;\r\n\r\n\t\t\t\t\t\tdisplay:flex;\r\n\t\t\t\t\t\talign-items:center;\r\n\t\t\t\t\t\tjustify-content:center;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\ttransform: rotate(180deg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-sortable{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\tpadding-top:20px;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\t\tpadding-bottom:20px;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\t\tright:calc(50% - 6px);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tposition: absolute;\r\n\r\n\t\t\t// background-color: inherit;\r\n\r\n\t\t\tz-index: 10;\r\n\r\n\t\t\t&.tabulator-frozen-left{\r\n\t\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-frozen-right{\r\n\t\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\tbackground:darken($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\t\t\tborder-bottom:1px solid $headerSeperatorColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen-rows-holder{\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\t&:empty{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t//scrolling element to hold table\r\n\t.tabulator-tableHolder{\r\n\t\tposition:relative;\r\n\t\twidth:100%;\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:auto;\r\n\t\t-webkit-overflow-scrolling: touch;\r\n\r\n\t\t&:focus{\r\n\t\t\toutline: none;\r\n\t\t}\r\n\r\n\t\t//default placeholder element\r\n\t\t.tabulator-placeholder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t&[tabulator-render-mode=\"virtual\"]{\r\n\t\t\t\tmin-height:100%;\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\r\n\t\t\twidth:100%;\r\n\r\n\t\t\tspan{\r\n\t\t\t\tdisplay: inline-block;\r\n\r\n\t\t\t\tmargin:0 auto;\r\n\t\t\t\tpadding:10px;\r\n\r\n\t\t\t\tcolor:#000;\r\n\t\t\t\tfont-weight: bold;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//element to hold table rows\r\n\t\t.tabulator-table{\r\n\t\t\tposition:relative;\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tbackground-color:$rowBackgroundColor;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\toverflow:visible;\r\n\t\t\tcolor:$rowTextColor;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\t&.tabulator-calcs{\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t\tbackground:darken($rowAltBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t\t&.tabulator-calcs-top{\r\n\t\t\t\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-calcs-bottom{\r\n\t\t\t\t\t\tborder-top:2px solid $rowBorderColor;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//column resize handles\r\n\t.tabulator-col-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\ttop:0;\r\n\t\tbottom:0;\r\n\t\twidth:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\tleft:0;\r\n\t\t\tright:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ew-resize;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//footer element\r\n\t.tabulator-footer{\r\n\t\tpadding:5px 10px;\r\n\t\tborder-top:1px solid $footerSeperatorColor;\r\n\t\tbackground-color: $footerBackgroundColor;\r\n\t\ttext-align:right;\r\n\t\tcolor: $footerTextColor;\r\n\t\tfont-weight:bold;\r\n\t\twhite-space:nowrap;\r\n\t\tuser-select:none;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\twidth:calc(100% + 20px);\r\n\t\t\tmargin:-5px -10px 5px -10px;\r\n\r\n\t\t\ttext-align: left;\r\n\r\n\t\t\tbackground:darken($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:darken($footerBackgroundColor, 5%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-bottom:1px solid $footerBackgroundColor;\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&:only-child{\r\n\t\t\t\tmargin-bottom:-5px;\r\n\t\t\t\tborder-bottom:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-paginator{\r\n\t\t\tcolor: $footerTextColor;\r\n\t\t\tfont-family:inherit;\r\n\t\t\tfont-weight:inherit;\r\n\t\t\tfont-size:inherit;\r\n\t\t}\r\n\r\n\t\t//page size select element\r\n\t\t.tabulator-page-size{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 5px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-pages{\r\n\t\t\tmargin:0 7px;\r\n\t\t}\r\n\r\n\t\t//pagination button\r\n\t\t.tabulator-page{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 2px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\r\n\t\t\tbackground:rgba(255,255,255,.2);\r\n\r\n\t\t\t&.active{\r\n\t\t\t\tcolor:$footerActiveColor;\r\n\t\t\t}\r\n\r\n\t\t\t&:disabled{\r\n\t\t\t\topacity:.5;\r\n\t\t\t}\r\n\r\n\t\t\t&:not(.disabled){\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground:rgba(0,0,0,.2);\r\n\t\t\t\t\tcolor:#fff;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//holding div that contains loader and covers tabulator element to prevent interaction\r\n\t.tabulator-loader{\r\n\t\tposition:absolute;\r\n\t\tdisplay: flex;\r\n\t\talign-items:center;\r\n\r\n\t\ttop:0;\r\n\t\tleft:0;\r\n\t\tz-index:100;\r\n\r\n\t\theight:100%;\r\n\t\twidth:100%;\r\n\t\tbackground:rgba(0,0,0,.4);\r\n\t\ttext-align:center;\r\n\r\n\t\t//loading message element\r\n\t\t.tabulator-loader-msg{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 auto;\r\n\t\t\tpadding:10px 20px;\r\n\r\n\t\t\tborder-radius:10px;\r\n\r\n\t\t\tbackground:#fff;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:16px;\r\n\r\n\t\t\t//loading message\r\n\t\t\t&.tabulator-loading{\r\n\t\t\t\tborder:4px solid #333;\r\n\t\t\t\tcolor:#000;\r\n\t\t\t}\r\n\r\n\t\t\t//error message\r\n\t\t\t&.tabulator-error{\r\n\t\t\t\tborder:4px solid #D00;\r\n\t\t\t\tcolor:#590000;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//row element\r\n.tabulator-row{\r\n\tposition: relative;\r\n\tbox-sizing: border-box;\r\n\r\n\tmin-height:$textSize + ($headerMargin * 2);\r\n\tbackground-color: $rowBackgroundColor;\r\n\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t&:nth-child(even){\r\n\t\tbackground-color: $rowAltBackgroundColor;\r\n\t}\r\n\r\n\t&.tabulator-selectable:hover{\r\n\t\tbackground-color:$rowHoverBackground;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-selected{\r\n\t\tbackground-color:$rowSelectedBackground;\r\n\t}\r\n\r\n\t&.tabulator-selected:hover{\r\n\t\tbackground-color:$rowSelectedBackgroundHover;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-moving{\r\n\t\tposition: absolute;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpointer-events: none !important;\r\n\t\tz-index:15;\r\n\t}\r\n\r\n\t//row resize handles\r\n\t.tabulator-row-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\tbottom:0;\r\n\t\tleft:0;\r\n\t\theight:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\ttop:0;\r\n\t\t\tbottom:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ns-resize;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-frozen{\r\n\t\tdisplay: inline-block;\r\n\t\tposition: absolute;\r\n\r\n\t\tbackground-color: inherit;\r\n\r\n\t\tz-index: 10;\r\n\r\n\t\t&.tabulator-frozen-left{\r\n\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t&.tabulator-frozen-right{\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-responsive-collapse{\r\n\t\tbox-sizing:border-box;\r\n\r\n\t\tpadding:5px;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t&:empty{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\ttable{\r\n\t\t\tfont-size:$textSize;\r\n\r\n\t\t\ttr{\r\n\t\t\t\ttd{\r\n\t\t\t\t\tposition: relative;\r\n\r\n\t\t\t\t\t&:first-of-type{\r\n\t\t\t\t\t\tpadding-right:10px;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//cell element\r\n\t.tabulator-cell{\r\n\t\tdisplay:inline-block;\r\n\t\tposition: relative;\r\n\t\tbox-sizing:border-box;\r\n\t\tpadding:4px;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tvertical-align:middle;\r\n\t\twhite-space:nowrap;\r\n\t\toverflow:hidden;\r\n\t\ttext-overflow:ellipsis;\r\n\r\n\t\t&:last-of-type{\r\n\t\t\tborder-right: none;\r\n\t\t}\r\n\r\n\t\t&.tabulator-editing{\r\n\t\t\tborder:1px solid $editBoxColor;\r\n\t\t\tpadding: 0;\r\n\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-validation-fail{\r\n\t\t\tborder:1px solid $errorColor;\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\r\n\t\t\t\tcolor: $errorColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//hide left resize handle on first column\r\n\t\t&:first-child{\r\n\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//movable row handle\r\n\t\t&.tabulator-row-handle{\r\n\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\t//handle holder\r\n\t\t\t.tabulator-row-handle-box{\r\n\t\t\t\twidth:80%;\r\n\r\n\t\t\t\t//Hamburger element\r\n\t\t\t\t.tabulator-row-handle-bar{\r\n\t\t\t\t\twidth:100%;\r\n\t\t\t\t\theight:3px;\r\n\t\t\t\t\tmargin-top:2px;\r\n\t\t\t\t\tbackground:#666;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-branch{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:9px;\r\n\t\t\twidth:7px;\r\n\r\n\t\t\tmargin-top:-9px;\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control{\r\n\r\n\t\t\tdisplay:inline-flex;\r\n\t\t\tjustify-content:center;\r\n\t\t\talign-items:center;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:11px;\r\n\t\t\twidth:11px;\r\n\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder:1px solid $rowTextColor;\r\n\t\t\tborder-radius:2px;\r\n\t\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\t\toverflow:hidden;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\tcursor:pointer;\r\n\t\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: transparent;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-expand{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-responsive-collapse-toggle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\theight:15px;\r\n\t\t\twidth:15px;\r\n\r\n\t\t\tborder-radius:20px;\r\n\t\t\tbackground:#666;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:1.1em;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\topacity:.7;\r\n\t\t\t}\r\n\r\n\t\t\t&.open{\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\t\tdisplay:initial;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-open{\r\n\t\t\t\t\tdisplay:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-traffic-light{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\theight:14px;\r\n\t\t\twidth:14px;\r\n\r\n\t\t\tborder-radius:14px;\r\n\t\t}\r\n\t}\r\n\r\n\t//row grouping element\r\n\t&.tabulator-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#fafafa;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\tpadding-left:30px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\tpadding-left:50px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\tpadding-left:70px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\tpadding-left:90px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\tpadding-left:110px;\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#666;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n.tabulator-menu{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\tbox-shadow: 0 0 5px 0 rgba(0, 0, 0, .2);\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-menu-item{\r\n\r\n\t\tpadding:5px 10px;\r\n\r\n\t\tuser-select: none;\r\n\r\n\t\t&.tabulator-menu-item-disabled{\r\n\t\t\topacity: .5;\r\n\t\t}\r\n\r\n\t\t&:not(.tabulator-menu-item-disabled):hover{\r\n\t\t\tcursor: pointer;\r\n\t\t\tbackground: $rowAltBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-menu-separator{\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t}\r\n}\r\n\r\n.tabulator-edit-select-list{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tmax-height:200px;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-edit-select-list-item{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\r\n\t\t&.active{\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\r\n\t\t\t&.focused{\r\n\t\t\t\toutline:1px solid rgba($rowBackgroundColor, .5);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.focused{\r\n\t\t\toutline:1px solid $editBoxColor;\r\n\t\t}\r\n\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-notice{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\ttext-align: center;\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-group{\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpadding:4px;\r\n\t\tpadding-top:6px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\tfont-weight:bold;\r\n\t}\r\n}\r\n\r\n// Table print styling\r\n\r\n.tabulator-print-fullscreen{\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tbottom:0;\r\n\tleft:0;\r\n\tright:0;\r\n\r\n\tz-index: 10000;\r\n}\r\n\r\nbody.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){\r\n\tdisplay:none !important;\r\n}\r\n\r\n.tabulator-print-table{\r\n\tborder-collapse: collapse;\r\n\r\n\t//row grouping element\r\n\t.tabulator-print-table-group{\r\n\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-bottom:1px solid #999;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #999;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:#fafafa;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:rgba(0,0,0,.1);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:30px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:50px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:70px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:90px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:110px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:#666;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-data-tree-branch{\r\n\t\tdisplay:inline-block;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:9px;\r\n\t\twidth:7px;\r\n\r\n\t\tmargin-top:-9px;\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\tborder-left:2px solid $rowBorderColor;\r\n\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t}\r\n\r\n\t.tabulator-data-tree-control{\r\n\r\n\t\tdisplay:inline-flex;\r\n\t\tjustify-content:center;\r\n\t\talign-items:center;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:11px;\r\n\t\twidth:11px;\r\n\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder:1px solid $rowTextColor;\r\n\t\tborder-radius:2px;\r\n\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\toverflow:hidden;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: transparent;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-expand{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/app/static/vendors/tabulator/css/tabulator_site.css b/app/static/vendors/tabulator/css/tabulator_site.css deleted file mode 100644 index 7139757..0000000 --- a/app/static/vendors/tabulator/css/tabulator_site.css +++ /dev/null @@ -1,993 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator { - position: relative; - border-bottom: 5px solid #293146; - background-color: #fff; - font-size: 14px; - text-align: left; - overflow: hidden; - -ms-transform: translatez(0); - transform: translatez(0); -} - -.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table { - min-width: 100%; -} - -.tabulator[tabulator-layout="fitDataTable"] { - display: inline-block; -} - -.tabulator[tabulator-layout="fitColumns"] .tabulator-row .tabulator-cell:last-of-type { - border-right: none; -} - -.tabulator.tabulator-block-select { - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator .tabulator-header { - position: relative; - box-sizing: border-box; - width: 100%; - /* border-bottom: 3px solid #003268; */ - background-color: #293146; - color: #fff; - font-weight: bold; - white-space: nowrap; - overflow: hidden; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-header.tabulator-header-hidden { - display: none; -} - -.tabulator .tabulator-header .tabulator-col { - display: inline-block; - position: relative; - box-sizing: border-box; - border-right: 1px solid #aaa; - background-color: #293146; - text-align: left; - vertical-align: bottom; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-moving { - position: absolute; - /* border: 1px solid #3FB449; */ - background: #090909; - pointer-events: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content { - box-sizing: border-box; - position: relative; - padding: 8px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button { - padding: 0 8px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover { - cursor: pointer; - opacity: .6; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { - box-sizing: border-box; - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: bottom; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor { - box-sizing: border-box; - width: 100%; - border: 1px solid #999; - padding: 1px; - background: #fff; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow { - display: inline-block; - position: absolute; - top: 14px; - right: 8px; - width: 0; - height: 0; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { - position: relative; - display: -ms-flexbox; - display: flex; - border-top: 1px solid #aaa; - overflow: hidden; - margin-right: -1px; -} - -.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { - position: relative; - box-sizing: border-box; - margin-top: 2px; - width: 100%; - text-align: center; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea { - height: auto !important; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg { - margin-top: 3px; -} - -.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear { - width: 0; - height: 0; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title { - padding-right: 25px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { - cursor: pointer; - background-color: #090909; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow { - border-top: none; - border-bottom: 6px solid #bbb; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow { - border-top: none; - /* border-bottom: 6px solid #3FB449; */ -} - -.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow { - border-top: 6px solid #3FB449; - border-bottom: none; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title { - -ms-writing-mode: tb-rl; - writing-mode: vertical-rl; - text-orientation: mixed; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title { - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title { - padding-right: 0; - padding-top: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title { - padding-right: 0; - padding-bottom: 20px; -} - -.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow { - right: calc(50% - 6px); -} - -.tabulator .tabulator-header .tabulator-frozen { - display: inline-block; - position: absolute; - z-index: 10; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #aaa; -} - -.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #aaa; -} - -.tabulator .tabulator-header .tabulator-calcs-holder { - box-sizing: border-box; - min-width: 600%; - background: #3c3c3c !important; - border-top: 1px solid #aaa; - overflow: hidden; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row { - background: #3c3c3c !important; -} - -.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder { - min-width: 600%; -} - -.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty { - display: none; -} - -.tabulator .tabulator-tableHolder { - position: relative; - width: 100%; - white-space: nowrap; - overflow: auto; - -webkit-overflow-scrolling: touch; -} - -.tabulator .tabulator-tableHolder:focus { - outline: none; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder { - box-sizing: border-box; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode="virtual"] { - min-height: 100%; - min-width: 100%; -} - -.tabulator .tabulator-tableHolder .tabulator-placeholder span { - display: inline-block; - margin: 0 auto; - padding: 10px; - color: #3FB449; - font-weight: bold; - font-size: 20px; -} - -.tabulator .tabulator-tableHolder .tabulator-table { - position: relative; - display: inline-block; - background-color: #fff; - white-space: nowrap; - overflow: visible; - color: #333; -} - -.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs { - font-weight: bold; - background: #484848 !important; - color: #fff; -} - -.tabulator .tabulator-footer { - padding: 5px 10px; - padding-top: 8px; - /* border-top: 3px solid #3FB449; */ - background-color: #293146; - text-align: right; - color: #293146; - font-weight: bold; - white-space: nowrap; - -ms-user-select: none; - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder { - box-sizing: border-box; - width: calc(100% + 20px); - margin: -8px -10px 8px -10px; - text-align: left; - background: #3c3c3c !important; - border-bottom: 1px solid #aaa; - overflow: hidden; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { - background: #3c3c3c !important; - color: #fff !important; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle { - display: none; -} - -.tabulator .tabulator-footer .tabulator-calcs-holder:only-child { - margin-bottom: -5px; - border-bottom: none; -} - -.tabulator .tabulator-footer .tabulator-paginator label { - color: #fff; -} - -.tabulator .tabulator-footer .tabulator-page-size { - display: inline-block; - margin: 0 5px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; -} - -.tabulator .tabulator-footer .tabulator-pages { - margin: 0 7px; -} - -.tabulator .tabulator-footer .tabulator-page { - display: inline-block; - margin: 0 2px; - padding: 2px 5px; - border: 1px solid #aaa; - border-radius: 3px; - background: #fff; - color: #293146; - font-family: inherit; - font-weight: inherit; - font-size: inherit; -} - -.tabulator .tabulator-footer .tabulator-page.active { - /* color: #3FB449; */ -} - -.tabulator .tabulator-footer .tabulator-page:disabled { - opacity: .5; -} - -.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); - color: #fff; -} - -.tabulator .tabulator-col-resize-handle { - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 5px; -} - -.tabulator .tabulator-col-resize-handle.prev { - left: 0; - right: auto; -} - -.tabulator .tabulator-col-resize-handle:hover { - cursor: ew-resize; -} - -.tabulator .tabulator-loader { - position: absolute; - display: -ms-flexbox; - display: flex; - -ms-flex-align: center; - align-items: center; - top: 0; - left: 0; - z-index: 100; - height: 100%; - width: 100%; - background: rgba(0, 0, 0, 0.4); - text-align: center; -} - -.tabulator .tabulator-loader .tabulator-loader-msg { - display: inline-block; - margin: 0 auto; - padding: 10px 20px; - border-radius: 10px; - background: #fff; - font-weight: bold; - font-size: 16px; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading { - border: 4px solid #333; - color: #000; -} - -.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error { - border: 4px solid #D00; - color: #590000; -} - -.tabulator-row { - position: relative; - box-sizing: border-box; - min-height: 22px; - background-color: #fff; -} - -.tabulator-row.tabulator-row-even { - background-color: #EFEFEF; -} - -.tabulator-row.tabulator-selectable:hover { - background-color: #bbb; - cursor: pointer; -} - -.tabulator-row.tabulator-selected { - background-color: #9ABCEA; -} - -.tabulator-row.tabulator-selected:hover { - background-color: #769BCC; - cursor: pointer; -} - -.tabulator-row.tabulator-row-moving { - border: 1px solid #000; - background: #fff; -} - -.tabulator-row.tabulator-moving { - position: absolute; - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - pointer-events: none !important; - z-index: 15; -} - -.tabulator-row .tabulator-row-resize-handle { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height: 5px; -} - -.tabulator-row .tabulator-row-resize-handle.prev { - top: 0; - bottom: auto; -} - -.tabulator-row .tabulator-row-resize-handle:hover { - cursor: ns-resize; -} - -.tabulator-row .tabulator-frozen { - display: inline-block; - position: absolute; - background-color: inherit; - z-index: 10; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-left { - border-right: 2px solid #aaa; -} - -.tabulator-row .tabulator-frozen.tabulator-frozen-right { - border-left: 2px solid #aaa; -} - -.tabulator-row .tabulator-responsive-collapse { - box-sizing: border-box; - padding: 5px; - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} - -.tabulator-row .tabulator-responsive-collapse:empty { - display: none; -} - -.tabulator-row .tabulator-responsive-collapse table { - font-size: 14px; -} - -.tabulator-row .tabulator-responsive-collapse table tr td { - position: relative; -} - -.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type { - padding-right: 10px; -} - -.tabulator-row .tabulator-cell { - display: inline-block; - position: relative; - box-sizing: border-box; - padding: 6px; - border-right: 1px solid #aaa; - vertical-align: middle; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.tabulator-row .tabulator-cell.tabulator-editing { - border: 1px solid #1D68CD; - padding: 0; -} - -.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select { - border: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail { - border: 1px solid #dd0000; -} - -.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select { - border: 1px; - background: transparent; - color: #dd0000; -} - -.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev { - display: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box { - width: 80%; -} - -.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar { - width: 100%; - height: 3px; - margin-top: 2px; - background: #3FB449; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #aaa; - border-bottom: 2px solid #aaa; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - height: 15px; - width: 15px; - border-radius: 20px; - background: #666; - color: #fff; - font-weight: bold; - font-size: 1.1em; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover { - opacity: .7; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close { - display: initial; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close { - display: none; -} - -.tabulator-row .tabulator-cell .tabulator-traffic-light { - display: inline-block; - height: 14px; - width: 14px; - border-radius: 14px; -} - -.tabulator-row.tabulator-group { - box-sizing: border-box; - border-right: 1px solid #aaa; - border-top: 1px solid #000; - /* border-bottom: 2px solid #3FB449; */ - padding: 5px; - padding-left: 10px; - background: #293146; - color: #fff; - font-weight: bold; - min-width: 100%; -} - -.tabulator-row.tabulator-group:hover { - cursor: pointer; - background-color: #090909; -} - -.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #bbb; - border-bottom: 0; -} - -.tabulator-row.tabulator-group.tabulator-group-level-1 { - padding-left: 30px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-2 { - padding-left: 50px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-3 { - padding-left: 70px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-4 { - padding-left: 90px; -} - -.tabulator-row.tabulator-group.tabulator-group-level-5 { - padding-left: 110px; -} - -.tabulator-row.tabulator-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-row.tabulator-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #bbb; - vertical-align: middle; -} - -.tabulator-row.tabulator-group span { - margin-left: 10px; - color: #bbb; -} - -.tabulator-menu { - position: absolute; - display: inline-block; - box-sizing: border-box; - background: #fff; - border: 1px solid #aaa; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2); - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-menu .tabulator-menu-item { - padding: 5px 10px; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled { - opacity: .5; -} - -.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover { - cursor: pointer; - background: #EFEFEF; -} - -.tabulator-menu .tabulator-menu-separator { - border-top: 1px solid #aaa; -} - -.tabulator-edit-select-list { - position: absolute; - display: inline-block; - box-sizing: border-box; - max-height: 200px; - background: #fff; - border: 1px solid #aaa; - font-size: 14px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 10000; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item { - padding: 4px; - color: #333; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active { - color: #fff; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused { - outline: 1px solid rgba(255, 255, 255, 0.5); -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item.focused { - outline: 1px solid #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-item:hover { - cursor: pointer; - color: #fff; - background: #1D68CD; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-notice { - padding: 4px; - color: #333; - text-align: center; -} - -.tabulator-edit-select-list .tabulator-edit-select-list-group { - border-bottom: 1px solid #aaa; - padding: 4px; - padding-top: 6px; - color: #333; - font-weight: bold; -} - -.tabulator-print-fullscreen { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 10000; -} - -body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) { - display: none !important; -} - -.tabulator-print-table { - border-collapse: collapse; -} - -.tabulator-print-table .tabulator-print-table-group { - box-sizing: border-box; - border-right: 1px solid #aaa; - border-top: 1px solid #000; - border-bottom: 2px solid #3FB449; - padding: 5px; - padding-left: 10px; - background: #293146; - color: #fff; - font-weight: bold; - min-width: 100%; -} - -.tabulator-print-table .tabulator-print-table-group:hover { - cursor: pointer; - background-color: #090909; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow { - margin-right: 10px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 6px solid #3FB449; - border-bottom: 0; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td { - padding-left: 30px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td { - padding-left: 50px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td { - padding-left: 70px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td { - padding-left: 90px !important; -} - -.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td { - padding-left: 110px !important; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle { - display: inline-block; -} - -.tabulator-print-table .tabulator-print-table-group .tabulator-arrow { - display: inline-block; - width: 0; - height: 0; - margin-right: 16px; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-right: 0; - border-left: 6px solid #3FB449; - vertical-align: middle; -} - -.tabulator-print-table .tabulator-print-table-group span { - margin-left: 10px; - color: #3FB449; -} - -.tabulator-print-table .tabulator-data-tree-branch { - display: inline-block; - vertical-align: middle; - height: 9px; - width: 7px; - margin-top: -9px; - margin-right: 5px; - border-bottom-left-radius: 1px; - border-left: 2px solid #aaa; - border-bottom: 2px solid #aaa; -} - -.tabulator-print-table .tabulator-data-tree-control { - display: -ms-inline-flexbox; - display: inline-flex; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-align: center; - align-items: center; - vertical-align: middle; - height: 11px; - width: 11px; - margin-right: 5px; - border: 1px solid #333; - border-radius: 2px; - background: rgba(0, 0, 0, 0.1); - overflow: hidden; -} - -.tabulator-print-table .tabulator-data-tree-control:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.2); -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: transparent; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand { - display: inline-block; - position: relative; - height: 7px; - width: 1px; - background: #333; -} - -.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { - position: absolute; - content: ""; - left: -3px; - top: 3px; - height: 1px; - width: 7px; - background: #333; -} diff --git a/app/static/vendors/tabulator/css/tabulator_site.min.css b/app/static/vendors/tabulator/css/tabulator_site.min.css deleted file mode 100644 index 2fc522d..0000000 --- a/app/static/vendors/tabulator/css/tabulator_site.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -.tabulator{position:relative;border-bottom:5px solid #222;background-color:#fff;font-size:14px;text-align:left;overflow:hidden;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator[tabulator-layout=fitColumns] .tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:3px solid #3fb449;background-color:#222;color:#fff;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background-color:#222;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #3fb449;background:#090909;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:14px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#090909}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #3fb449}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #3fb449;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#3c3c3c!important;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#3c3c3c!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableHolder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableHolder:focus{outline:none}.tabulator .tabulator-tableHolder .tabulator-placeholder{box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableHolder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#3fb449;font-weight:700;font-size:20px}.tabulator .tabulator-tableHolder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#484848!important;color:#fff}.tabulator .tabulator-footer{padding:5px 10px;padding-top:8px;border-top:3px solid #3fb449;background-color:#222;text-align:right;color:#222;font-weight:700;white-space:nowrap;-ms-user-select:none;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-8px -10px 8px;text-align:left;background:#3c3c3c!important;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#3c3c3c!important;color:#fff!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer .tabulator-paginator label{color:#fff}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:#fff;color:#222;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page.active{color:#3fb449}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-loader{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:22px;background-color:#fff}.tabulator-row.tabulator-row-even{background-color:#efefef}.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #aaa;border-bottom:1px solid #aaa;pointer-events:none!important;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:6px;border-right:1px solid #aaa;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#3fb449}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-right:1px solid #aaa;border-top:1px solid #000;border-bottom:2px solid #3fb449;padding:5px;padding-left:10px;background:#222;color:#fff;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:#090909}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #3fb449;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #3fb449;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#3fb449}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{padding:5px 10px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#efefef}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;background:#fff;border:1px solid #aaa;font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#333}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;color:#fff;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#333;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #aaa;padding:4px;padding-top:6px;color:#333;font-weight:700}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-right:1px solid #aaa;border-top:1px solid #000;border-bottom:2px solid #3fb449;padding:5px;padding-left:10px;background:#222;color:#fff;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:#090909}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #3fb449;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #3fb449;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#3fb449}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-print-table .tabulator-data-tree-control{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333} -/*# sourceMappingURL=tabulator_site.min.css.map */ diff --git a/app/static/vendors/tabulator/css/tabulator_site.min.css.map b/app/static/vendors/tabulator/css/tabulator_site.min.css.map deleted file mode 100644 index 6970f0b..0000000 --- a/app/static/vendors/tabulator/css/tabulator_site.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tabulator_site.scss"],"names":[],"mappings":"AAyCA,WACC,kBAAkB,AAElB,6BAvCgB,AAyChB,sBA1CqB,AA4CrB,eA1Ca,AA2Cb,gBAAgB,AAChB,gBAAe,AAMf,uBAAwB,CAigBxB,AAhhBD,iFAoBI,cAAc,CACd,AArBJ,0CA0BE,oBAAqB,CACrB,AA3BF,oFAiCK,iBAAkB,CAClB,AAlCL,kCAyCE,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CACjB,AA1CF,6BA8CE,kBAAiB,AACjB,sBAAsB,AAEtB,WAAU,AAEV,gCAhF2B,AAiF3B,sBApFyB,AAqFzB,WApFmB,AAqFnB,gBAAgB,AAEhB,mBAAmB,AACnB,gBAAe,AAEf,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAmPpB,AAjTF,qDAiEG,YAAY,CACZ,AAlEH,4CAsEG,qBAAoB,AAEpB,kBAAiB,AACjB,sBAAqB,AACrB,4BAxGoB,AAyGpB,sBA3GwB,AA4GxB,gBAAe,AACf,sBAAsB,AACtB,eAAgB,CAqLhB,AAnQH,6DAiFI,kBAAkB,AAClB,yBA/GyB,AAgHzB,mBAA8C,AAC9C,mBAAoB,CACpB,AArFJ,mEAyFI,sBAAqB,AACrB,kBAAkB,AAClB,WAAW,CAgDX,AA3IJ,iGA+FK,aAAc,CAMd,AArGL,uGAkGM,eAAe,AACf,UAAW,CACX,AApGN,wFAyGK,sBAAqB,AACrB,WAAW,AAEX,mBAAmB,AACnB,gBAAgB,AAChB,uBAAuB,AACvB,qBAAqB,CAarB,AA5HL,gHAmHM,sBAAsB,AACtB,WAAW,AAEX,sBAAqB,AAErB,YAAW,AAEX,eAAgB,CAChB,AA3HN,oFAgIK,qBAAqB,AACrB,kBAAkB,AAClB,SAAQ,AACR,UAAS,AACT,QAAQ,AACR,SAAS,AACT,kCAAkC,AAClC,mCAAmC,AACnC,4BAhKmB,CAiKnB,AAzIL,0FAkJK,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AAEb,0BAnLkB,AAoLlB,gBAAgB,AAEhB,iBAAiB,CACjB,AAzJL,0FA+JK,YAAa,CACb,AAhKL,qEAqKI,kBAAkB,AAClB,sBAAsB,AACtB,eAAc,AACd,WAAU,AACV,iBAAkB,CAiBlB,AA1LJ,8EA6KK,qBAAsB,CACtB,AA9KL,yEAiLK,cAAe,CACf,AAlLL,sFAsLO,QAAS,AACT,QAAS,CACV,AAxLN,oFA+LK,kBAAkB,CAClB,AAhML,qEAmMK,eAAc,AACd,wBAAoD,CACpD,AArML,uHAyMM,gBAAgB,AAChB,4BAlOkB,CAmOlB,AA3MN,sHAgNM,gBAAgB,AAChB,+BA1OmB,CA2OnB,AAlNN,uHAuNM,6BAhPmB,AAiPnB,kBAAmB,CACnB,AAzNN,+GAgOM,uBAAyB,AAAzB,yBAAyB,AACzB,uBAAuB,AAEvB,oBAAY,AAAZ,aAAY,AACZ,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,sBAAsB,CACtB,AAtON,oHA2OM,wBAAyB,CACzB,AA5ON,2GAiPM,gBAAe,AACf,gBAAgB,CAChB,AAnPN,uIAuPO,gBAAe,AACf,mBAAmB,CACnB,AAzPP,uGA8PM,qBAAqB,CACrB,AA/PN,+CAsQG,qBAAqB,AACrB,kBAAkB,AAIlB,UAAW,CASX,AApRH,qEA8QI,2BAjSgB,CAkShB,AA/QJ,sEAkRI,0BArSgB,CAsShB,AAnRJ,qDAuRG,sBAAqB,AACrB,eAAc,AAEd,6BAA0D,AAU1D,0BAvTiB,AA0TjB,eAAgB,CAChB,AAxSH,oEA6RI,4BAA0D,CAK1D,AAlSJ,iGAgSK,YAAa,CACb,AAjSL,2DA2SG,cAAc,CAKd,AAhTH,iEA8SI,YAAa,CACb,AA/SJ,kCAqTE,kBAAiB,AACjB,WAAU,AACV,mBAAmB,AACnB,cAAa,AACb,gCAAiC,CAgDjC,AAzWF,wCA4TG,YAAa,CACb,AA7TH,yDAiUG,sBAAqB,AACrB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAOlB,UAAU,CAYV,AAtVH,wFAsUI,gBAAe,AACf,cAAc,CACd,AAxUJ,8DA6UI,qBAAqB,AAErB,cAAa,AACb,aAAY,AAEZ,cA/WyB,AAgXzB,gBAAiB,AACjB,cAAe,CACf,AArVJ,mDA0VG,kBAAiB,AACjB,qBAAoB,AACpB,sBAjXqB,AAkXrB,mBAAmB,AACnB,iBAAgB,AAChB,UAjXe,CA0Xf,AAxWH,kFAmWK,gBAAiB,AACjB,6BAA0D,AAC1D,UApYgB,CAqYhB,AAtWL,6BA8WE,iBAAgB,AAChB,gBAAe,AACf,6BArX2B,AAsX3B,sBAzXyB,AA0XzB,iBAAgB,AAChB,WA1XmB,AA2XnB,gBAAgB,AAChB,mBAAkB,AAClB,qBAAgB,AAAhB,iBAAgB,AAEhB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAuFpB,AAldF,qDA8XG,sBAAqB,AACrB,wBAAuB,AACvB,sBAA2B,AAE3B,gBAAgB,AAEhB,6BAA0D,AAY1D,6BAnaiB,AAqajB,eAAgB,CAMhB,AAxZH,oEAuYI,6BAA0D,AAC1D,oBAAiC,CAKjC,AA7YJ,iGA2YK,YAAa,CACb,AA5YL,gEAqZI,mBAAkB,AAClB,kBAAkB,CAClB,AAvZJ,wDA6ZI,UAAU,CACV,AA9ZJ,kDAmaG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA9aoB,AA+apB,iBAAiB,CACjB,AA1aH,8CA8aG,YAAY,CACZ,AA/aH,6CAmbG,qBAAoB,AAEpB,aAAY,AACZ,gBAAe,AAEf,sBA9boB,AA+bpB,kBAAiB,AAEjB,gBAAe,AAEf,WApckB,AAqclB,oBAAmB,AACnB,oBAAmB,AACnB,iBAAiB,CAiBjB,AAjdH,oDAmcI,aAxcyB,CAyczB,AApcJ,sDAucI,UAAU,CACV,AAxcJ,kEA4cK,eAAc,AACd,0BAAyB,AACzB,UAAU,CACV,AA/cL,wCAsdE,kBAAiB,AACjB,QAAO,AACP,MAAK,AACL,SAAQ,AACR,SAAS,CAUT,AApeF,6CA6dG,OAAM,AACN,UAAU,CACV,AA/dH,8CAkeG,gBAAgB,CAChB,AAneH,6BAyeE,kBAAiB,AACjB,oBAAa,AAAb,aAAa,AACb,sBAAkB,AAAlB,mBAAkB,AAElB,MAAK,AACL,OAAM,AACN,YAAW,AAEX,YAAW,AACX,WAAU,AACV,0BAAyB,AACzB,iBAAiB,CA2BjB,AA/gBF,mDAwfG,qBAAoB,AAEpB,cAAa,AACb,kBAAiB,AAEjB,mBAAkB,AAElB,gBAAe,AACf,gBAAgB,AAChB,cAAc,CAad,AA9gBH,qEAqgBI,sBAAqB,AACrB,UAAU,CACV,AAvgBJ,mEA2gBI,sBAAqB,AACrB,aAAa,CACb,AAMJ,eACC,kBAAkB,AAClB,sBAAsB,AACtB,gBAA0C,AAC1C,qBA5iBuB,CA45BvB,AApXD,kCAQE,wBA/iB4B,CAgjB5B,AATF,0CAYE,sBAhjBsB,AAijBtB,cAAe,CACf,AAdF,kCAiBE,wBAnjB6B,CAojB7B,AAlBF,wCAqBE,yBAtjBkC,AAujBlC,cAAe,CACf,AAvBF,oCA0BE,sBAAqB,AACrB,eAAe,CACf,AA5BF,gCA+BE,kBAAkB,AAElB,0BAvkBkB,AAwkBlB,6BAxkBkB,AA0kBlB,8BAA+B,AAC/B,UAAU,CACV,AAtCF,4CA0CE,kBAAiB,AACjB,QAAO,AACP,SAAQ,AACR,OAAM,AACN,UAAU,CAUV,AAxDF,iDAiDG,MAAK,AACL,WAAW,CACX,AAnDH,kDAsDG,gBAAgB,CAChB,AAvDH,iCA2DE,qBAAqB,AACrB,kBAAkB,AAElB,yBAAyB,AAEzB,UAAW,CASX,AAzEF,uDAmEG,2BAzmBiB,CA0mBjB,AApEH,wDAuEG,0BA7mBiB,CA8mBjB,AAxEH,8CA4EE,sBAAqB,AAErB,YAAW,AAEX,0BAtnBkB,AAunBlB,4BAvnBkB,CA0oBlB,AApGF,oDAoFG,YAAY,CACZ,AArFH,oDAwFG,cA9oBW,CAypBX,AAnGH,0DA4FK,iBAAkB,CAKlB,AAjGL,wEA+FM,kBAAkB,CAClB,AAhGN,+BAwGE,qBAAoB,AACpB,kBAAkB,AAClB,sBAAqB,AACrB,YAAW,AACX,4BAlpBkB,AAmpBlB,sBAAqB,AACrB,mBAAkB,AAClB,gBAAe,AACf,sBAAsB,CA0LtB,AA1SF,iDAoHG,yBAnpBkB,AAopBlB,SAAU,CAMV,AA3HH,+GAwHI,WAAU,AACV,sBAAsB,CACtB,AA1HJ,yDA8HG,qBA5pBgB,CAmqBhB,AArIH,+HAgII,WAAU,AACV,uBAAsB,AAEtB,UAjqBe,CAkqBf,AApIJ,6EA0II,YAAa,CACb,AA3IJ,oDAiJG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAElB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,mBAAoB,CAcpB,AArKH,8EA2JI,SAAS,CAST,AApKJ,wGA+JK,WAAU,AACV,WAAU,AACV,eAAc,AACd,kBA9sBoB,CA+sBpB,AAnKL,2DAwKG,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BAztBiB,AA0tBjB,4BA1tBiB,CA2tBjB,AArLH,4DAyLG,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBAxuBe,AAyuBf,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAmDf,AA1PH,kEA0MI,eAAc,AACd,yBAA4B,CAC5B,AA5MJ,kGA+MI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AAlOJ,wGAwNK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eArwBa,CAswBb,AAjOL,gGAqOI,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAhxBc,CA6xBd,AAxPJ,sGA8OK,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA3xBa,CA4xBb,AAvPL,qEA6PG,2BAAoB,AAApB,oBAAoB,AACpB,sBAAkB,AAAlB,mBAAkB,AAClB,qBAAsB,AAAtB,uBAAsB,AAEtB,sBAAsB,AACtB,wBAAwB,AACxB,yBAAyB,AACzB,oBAAoB,AAEpB,YAAW,AACX,WAAU,AAEV,mBAAkB,AAClB,gBAAe,AAEf,WApzBqB,AAqzBrB,gBAAgB,AAChB,eAAe,CAmBf,AAjSH,2EAiRI,UAAU,CACV,AAlRJ,sHAsRK,eAAe,CACf,AAvRL,sOA+RI,YAAY,CACZ,AAhSJ,wDAoSG,qBAAqB,AACrB,YAAW,AACX,WAAU,AAEV,kBAAkB,CAClB,AAzSH,+BA8SE,sBAAqB,AACrB,4BAr1BkB,AAs1BlB,0BAAyB,AACzB,gCAj2B2B,AAk2B3B,YAAW,AACX,kBAAiB,AACjB,gBAv2ByB,AAw2BzB,WAv2BmB,AAw2BnB,gBAAgB,AAEhB,cAAe,CA0Df,AAlXF,qCA2TG,eAAc,AACd,wBAAoD,CACpD,AA7TH,wEAiUI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,6BAh3BqB,AAi3BrB,eAAgB,CAChB,AAtUJ,uDA0UG,iBAAiB,CACjB,AA3UH,uDA8UG,iBAAiB,CACjB,AA/UH,uDAkVG,iBAAiB,CACjB,AAnVH,uDAsVG,iBAAiB,CACjB,AAvVH,uDA0VG,kBAAkB,CAClB,AA3VH,uDA8VG,oBAAqB,CACrB,AA/VH,gDAmWG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,8BAt5BsB,AAu5BtB,qBAAqB,CACrB,AA5WH,oCA+WG,iBAAgB,AAChB,aAh6B0B,CAi6B1B,AAKH,gBACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,gBAn6BuB,AAo6BvB,sBAl6BmB,AAm6BnB,oCAAuC,AAEvC,eAr7Ba,AAu7Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CAqBd,AAnCD,qCAkBE,iBAAgB,AAEhB,yBAAiB,AAAjB,qBAAiB,AAAjB,gBAAiB,CAUjB,AA9BF,kEAuBG,UAAW,CACX,AAxBH,8EA2BG,eAAe,AACf,kBAz7B2B,CA07B3B,AA7BH,0CAiCE,yBA77BkB,CA87BlB,AAGF,4BACC,kBAAkB,AAClB,qBAAoB,AACpB,sBAAqB,AAErB,iBAAgB,AAEhB,gBA18BuB,AA28BvB,sBAz8BmB,AA28BnB,eA39Ba,AA69Bb,gBAAe,AACf,iCAAiC,AAEjC,aAAc,CA6Cd,AA5DD,6DAkBE,YAAW,AAEX,UAp9BgB,CA0+BhB,AA1CF,oEAuBG,WA19BqB,AA29BrB,kBAl9BkB,CAu9BlB,AA7BH,4EA2BI,oCA99BoB,CA+9BpB,AA5BJ,qEAgCG,yBA19BkB,CA29BlB,AAjCH,mEAqCG,eAAc,AAEd,WA1+BqB,AA2+BrB,kBAl+BkB,CAm+BlB,AAzCH,+DA6CE,YAAW,AAEX,WA/+BgB,AAg/BhB,iBAAkB,CAClB,AAjDF,8DAoDE,6BAr/BkB,AAu/BlB,YAAW,AACX,gBAAe,AAEf,WAz/BgB,AA0/BhB,eAAgB,CAChB,AAKF,4BACC,kBAAkB,AAClB,MAAK,AACL,SAAQ,AACR,OAAM,AACN,QAAO,AAEP,aAAc,CACd,AAED,uEACC,sBAAuB,CACvB,AAED,uBACC,wBAAyB,CAsKzB,AAvKD,oDAKE,sBAAqB,AACrB,4BArhCkB,AAshClB,0BAAyB,AACzB,gCAjiC2B,AAkiC3B,YAAW,AACX,kBAAiB,AACjB,gBAviCyB,AAwiCzB,WAviCmB,AAwiCnB,gBAAgB,AAEhB,cAAe,CAmEf,AAlFF,0DAkBG,eAAc,AACd,wBAAoD,CACpD,AApBH,6FAwBI,kBAAiB,AACjB,kCAAkC,AAClC,mCAAmC,AACnC,6BAhjCqB,AAijCrB,eAAgB,CAChB,AA7BJ,+EAkCI,2BAA4B,CAC5B,AAnCJ,+EAwCI,2BAA4B,CAC5B,AAzCJ,+EA8CI,2BAA4B,CAC5B,AA/CJ,+EAoDI,2BAA4B,CAC5B,AArDJ,+EA0DI,4BAA6B,CAC7B,AA3DJ,4EA8DG,oBAAqB,CACrB,AA/DH,qEAmEG,qBAAqB,AACrB,QAAQ,AACR,SAAS,AACT,kBAAiB,AACjB,iCAAiC,AACjC,oCAAoC,AACpC,eAAe,AACf,8BA/lCsB,AAgmCtB,qBAAqB,CACrB,AA5EH,yDA+EG,iBAAgB,AAChB,aAzmC0B,CA0mC1B,AAjFH,mDAqFE,qBAAoB,AACpB,sBAAqB,AAErB,WAAU,AACV,UAAS,AAET,gBAAe,AACf,iBAAgB,AAEhB,8BAA6B,AAE7B,2BA/mCkB,AAgnClB,4BAhnCkB,CAinClB,AAlGF,oDAsGE,2BAAmB,AAAnB,oBAAmB,AACnB,qBAAsB,AAAtB,uBAAsB,AACtB,sBAAkB,AAAlB,mBAAkB,AAClB,sBAAqB,AAErB,YAAW,AACX,WAAU,AAEV,iBAAgB,AAEhB,sBA9nCgB,AA+nChB,kBAAiB,AACjB,0BAA4B,AAE5B,eAAe,CAkDf,AAtKF,0DAuHG,eAAc,AACd,yBAA4B,CAC5B,AAzHH,0FA4HG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,sBAAuB,CAavB,AA/IH,gGAqII,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eA3pCc,CA4pCd,AA9IJ,wFAkJG,qBAAoB,AACpB,kBAAkB,AAElB,WAAW,AACX,UAAU,AAEV,eAtqCe,CAmrCf,AArKH,8FA2JI,kBAAkB,AAClB,WAAW,AACX,UAAU,AACV,QAAQ,AAER,WAAW,AACX,UAAU,AAEV,eAjrCc,CAkrCd","file":"tabulator_site.min.css","sourcesContent":["/* Tabulator v4.7.0 (c) Oliver Folkerd */\n\n\r\n//Main Theme Variables\r\n$backgroundColor: #fff !default; //background color of tabulator\r\n$borderColor:#222 !default; //border to tabulator\r\n$textSize:14px !default; //table text size\r\n\r\n//header themeing\r\n$headerBackgroundColor:#222 !default; //border to tabulator\r\n$headerTextColor:#fff !default; //header text colour\r\n$headerBorderColor:#aaa !default; //header border color\r\n$headerSeperatorColor:#3FB449 !default; //header bottom seperator color\r\n$headerMargin:4px !default; //padding round header\r\n\r\n//column header arrows\r\n$sortArrowActive: #3FB449 !default;\r\n$sortArrowInactive: #bbb !default;\r\n\r\n//row themeing\r\n$rowBackgroundColor:#fff !default; //table row background color\r\n$rowAltBackgroundColor:#EFEFEF !default; //table row background color\r\n$rowBorderColor:#aaa !default; //table border color\r\n$rowTextColor:#333 !default; //table text color\r\n$rowHoverBackground:#bbb !default; //row background color on hover\r\n\r\n$rowSelectedBackground: #9ABCEA !default; //row background color when selected\r\n$rowSelectedBackgroundHover: #769BCC !default;//row background color when selected and hovered\r\n\r\n$editBoxColor:#1D68CD !default; //border color for edit boxes\r\n$errorColor:#dd0000 !default; //error indication\r\n\r\n//footer themeing\r\n$footerBackgroundColor:#222 !default; //border to tabulator\r\n$footerTextColor:#222 !default; //footer text colour\r\n$footerBorderColor:#aaa !default; //footer border color\r\n$footerSeperatorColor:#3FB449 !default; //footer bottom seperator color\r\n$footerActiveColor:$footerSeperatorColor !default; //footer bottom active text color\r\n\r\n\r\n//Tabulator Containing Element\r\n.tabulator{\r\n\tposition: relative;\r\n\r\n\tborder-bottom: 5px solid $borderColor;\r\n\r\n\tbackground-color: $backgroundColor;\r\n\r\n\tfont-size:$textSize;\r\n\ttext-align: left;\r\n\toverflow:hidden;\r\n\r\n\t-webkit-transform: translatez(0);\r\n\t-moz-transform: translatez(0);\r\n\t-ms-transform: translatez(0);\r\n\t-o-transform: translatez(0);\r\n\ttransform: translatez(0);\r\n\r\n\t&[tabulator-layout=\"fitDataFill\"]{\r\n\t\t.tabulator-tableHolder{\r\n\t\t\t.tabulator-table{\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitDataTable\"]{\r\n\t\tdisplay: inline-block;\r\n\t}\r\n\r\n\t&[tabulator-layout=\"fitColumns\"]{\r\n\t\t.tabulator-row{\r\n\t\t\t.tabulator-cell{\r\n\t\t\t\t&:last-of-type{\r\n\t\t\t\t\tborder-right: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t&.tabulator-block-select{\r\n\t\tuser-select: none;\r\n\t}\r\n\r\n\t//column header containing element\r\n\t.tabulator-header{\r\n\t\tposition:relative;\r\n\t\tbox-sizing: border-box;\r\n\r\n\t\twidth:100%;\r\n\r\n\t\tborder-bottom:3px solid $headerSeperatorColor;\r\n\t\tbackground-color: $headerBackgroundColor;\r\n\t\tcolor: $headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:hidden;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t&.tabulator-header-hidden{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\t//individual column header element\r\n\t\t.tabulator-col{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tposition:relative;\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tborder-right:1px solid $headerBorderColor;\r\n\t\t\tbackground-color: $headerBackgroundColor;\r\n\t\t\ttext-align:left;\r\n\t\t\tvertical-align: bottom;\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&.tabulator-moving{\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tborder:1px solid $headerSeperatorColor;\r\n\t\t\t\tbackground:darken($headerBackgroundColor, 10%);\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\r\n\t\t\t//hold content of column header\r\n\t\t\t.tabulator-col-content{\r\n\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding:8px;\r\n\r\n\t\t\t\t//header menu button\r\n\t\t\t\t.tabulator-header-menu-button{\r\n\t\t\t\t\tpadding: 0 8px;\r\n\r\n\t\t\t\t\t&:hover{\r\n\t\t\t\t\t\tcursor: pointer;\r\n\t\t\t\t\t\topacity: .6;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//hold title of column header\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tbox-sizing:border-box;\r\n\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\twhite-space: nowrap;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttext-overflow: ellipsis;\r\n\t\t\t\t\tvertical-align:bottom;\r\n\r\n\t\t\t\t\t//element to hold title editor\r\n\t\t\t\t\t.tabulator-title-editor{\r\n\t\t\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\t\t\twidth: 100%;\r\n\r\n\t\t\t\t\t\tborder:1px solid #999;\r\n\r\n\t\t\t\t\t\tpadding:1px;\r\n\r\n\t\t\t\t\t\tbackground: #fff;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//column sorter arrow\r\n\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\tdisplay: inline-block;\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\ttop:14px;\r\n\t\t\t\t\tright:8px;\r\n\t\t\t\t\twidth: 0;\r\n\t\t\t\t\theight: 0;\r\n\t\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//complex header column group\r\n\t\t\t&.tabulator-col-group{\r\n\r\n\t\t\t\t//gelement to hold sub columns in column group\r\n\t\t\t\t.tabulator-col-group-cols{\r\n\t\t\t\t\tposition:relative;\r\n\t\t\t\t\tdisplay: flex;\r\n\r\n\t\t\t\t\tborder-top:1px solid $headerBorderColor;\r\n\t\t\t\t\toverflow: hidden;\r\n\r\n\t\t\t\t\tmargin-right:-1px;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//hide left resize handle on first column\r\n\t\t\t&:first-child{\r\n\t\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//header filter containing element\r\n\t\t\t.tabulator-header-filter{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tbox-sizing: border-box;\r\n\t\t\t\tmargin-top:2px;\r\n\t\t\t\twidth:100%;\r\n\t\t\t\ttext-align: center;\r\n\r\n\t\t\t\t//styling adjustment for inbuilt editors\r\n\t\t\t\ttextarea{\r\n\t\t\t\t\theight:auto !important;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsvg{\r\n\t\t\t\t\tmargin-top: 3px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tinput{\r\n\t\t\t\t\t&::-ms-clear {\r\n\t\t\t\t\t width : 0;\r\n\t\t\t\t\t height: 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//styling child elements for sortable columns\r\n\t\t\t&.tabulator-sortable{\r\n\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\tpadding-right:25px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"none\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowInactive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"asc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: none;\r\n\t\t\t\t\t\tborder-bottom: 6px solid $sortArrowActive;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&[aria-sort=\"desc\"]{\r\n\t\t\t\t\t.tabulator-col-content .tabulator-arrow{\r\n\t\t\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\t\t\tborder-bottom: none;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-col-vertical{\r\n\t\t\t\t.tabulator-col-content{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\twriting-mode: vertical-rl;\r\n\t\t\t\t\t\ttext-orientation: mixed;\r\n\r\n\t\t\t\t\t\tdisplay:flex;\r\n\t\t\t\t\t\talign-items:center;\r\n\t\t\t\t\t\tjustify-content:center;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\ttransform: rotate(180deg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t&.tabulator-sortable{\r\n\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\tpadding-top:20px;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&.tabulator-col-vertical-flip{\r\n\t\t\t\t\t\t.tabulator-col-title{\r\n\t\t\t\t\t\t\tpadding-right:0;\r\n\t\t\t\t\t\t\tpadding-bottom:20px;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t.tabulator-arrow{\r\n\t\t\t\t\t\tright:calc(50% - 6px);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\tposition: absolute;\r\n\r\n\t\t\t// background-color: inherit;\r\n\r\n\t\t\tz-index: 10;\r\n\r\n\t\t\t&.tabulator-frozen-left{\r\n\t\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\r\n\t\t\t&.tabulator-frozen-right{\r\n\t\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\tbackground:lighten($headerBackgroundColor, 10%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:lighten($headerBackgroundColor, 10%) !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborder-top:1px solid $rowBorderColor;\r\n\t\t\t// border-bottom:1px solid $headerBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\t\t}\r\n\r\n\t\t.tabulator-frozen-rows-holder{\r\n\t\t\tmin-width:600%;\r\n\r\n\t\t\t&:empty{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//scrolling element to hold table\r\n\t.tabulator-tableHolder{\r\n\t\tposition:relative;\r\n\t\twidth:100%;\r\n\t\twhite-space: nowrap;\r\n\t\toverflow:auto;\r\n\t\t-webkit-overflow-scrolling: touch;\r\n\r\n\t\t&:focus{\r\n\t\t\toutline: none;\r\n\t\t}\r\n\r\n\t\t//default placeholder element\r\n\t\t.tabulator-placeholder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t&[tabulator-render-mode=\"virtual\"]{\r\n\t\t\t\tmin-height:100%;\r\n\t\t\t\tmin-width:100%;\r\n\t\t\t}\r\n\r\n\t\t\twidth:100%;\r\n\r\n\t\t\tspan{\r\n\t\t\t\tdisplay: inline-block;\r\n\r\n\t\t\t\tmargin:0 auto;\r\n\t\t\t\tpadding:10px;\r\n\r\n\t\t\t\tcolor:$headerSeperatorColor;\r\n\t\t\t\tfont-weight: bold;\r\n\t\t\t\tfont-size: 20px;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//element to hold table rows\r\n\t\t.tabulator-table{\r\n\t\t\tposition:relative;\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tbackground-color:$rowBackgroundColor;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\toverflow:visible;\r\n\t\t\tcolor:$rowTextColor;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\t&.tabulator-calcs{\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t\tbackground:lighten($headerBackgroundColor, 15%) !important;\r\n\t\t\t\t\tcolor:$headerTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//footer element\r\n\t.tabulator-footer{\r\n\t\tpadding:5px 10px;\r\n\t\tpadding-top:8px;\r\n\t\tborder-top:3px solid $footerSeperatorColor;\r\n\t\tbackground-color: $footerBackgroundColor;\r\n\t\ttext-align:right;\r\n\t\tcolor: $footerTextColor;\r\n\t\tfont-weight:bold;\r\n\t\twhite-space:nowrap;\r\n\t\tuser-select:none;\r\n\r\n\t\t-moz-user-select: none;\r\n\t\t-khtml-user-select: none;\r\n\t\t-webkit-user-select: none;\r\n\t\t-o-user-select: none;\r\n\r\n\t\t.tabulator-calcs-holder{\r\n\t\t\tbox-sizing:border-box;\r\n\t\t\twidth:calc(100% + 20px);\r\n\t\t\tmargin:-8px -10px 8px -10px;\r\n\r\n\t\t\ttext-align: left;\r\n\r\n\t\t\tbackground:lighten($footerBackgroundColor, 10%) !important;\r\n\r\n\t\t\t.tabulator-row{\r\n\t\t\t\tbackground:lighten($footerBackgroundColor, 10%) !important;\r\n\t\t\t\tcolor:$headerTextColor !important;\r\n\r\n\t\t\t\t.tabulator-col-resize-handle{\r\n\t\t\t\t\tdisplay: none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// border-top:1px solid $rowBorderColor;\r\n\t\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t\toverflow: hidden;\r\n\r\n\t\t\t&:only-child{\r\n\t\t\t\tmargin-bottom:-5px;\r\n\t\t\t\tborder-bottom:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-paginator{\r\n\t\t\tlabel{\r\n\t\t\t\tcolor:#fff;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//page size select element\r\n\t\t.tabulator-page-size{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 5px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\t\t}\r\n\r\n\t\t//pagination container element\r\n\t\t.tabulator-pages{\r\n\t\t\tmargin:0 7px;\r\n\t\t}\r\n\r\n\t\t//pagination button\r\n\t\t.tabulator-page{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 2px;\r\n\t\t\tpadding:2px 5px;\r\n\r\n\t\t\tborder:1px solid $footerBorderColor;\r\n\t\t\tborder-radius:3px;\r\n\r\n\t\t\tbackground:#fff;\r\n\r\n\t\t\tcolor: $footerTextColor;\r\n\t\t\tfont-family:inherit;\r\n\t\t\tfont-weight:inherit;\r\n\t\t\tfont-size:inherit;\r\n\r\n\t\t\t&.active{\r\n\t\t\t\tcolor:$footerActiveColor;\r\n\t\t\t}\r\n\r\n\t\t\t&:disabled{\r\n\t\t\t\topacity:.5;\r\n\t\t\t}\r\n\r\n\t\t\t&:not(.disabled){\r\n\t\t\t\t&:hover{\r\n\t\t\t\t\tcursor:pointer;\r\n\t\t\t\t\tbackground:rgba(0,0,0,.2);\r\n\t\t\t\t\tcolor:#fff;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//column resize handles\r\n\t.tabulator-col-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\ttop:0;\r\n\t\tbottom:0;\r\n\t\twidth:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\tleft:0;\r\n\t\t\tright:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ew-resize;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//holding div that contains loader and covers tabulator element to prevent interaction\r\n\t.tabulator-loader{\r\n\t\tposition:absolute;\r\n\t\tdisplay: flex;\r\n\t\talign-items:center;\r\n\r\n\t\ttop:0;\r\n\t\tleft:0;\r\n\t\tz-index:100;\r\n\r\n\t\theight:100%;\r\n\t\twidth:100%;\r\n\t\tbackground:rgba(0,0,0,.4);\r\n\t\ttext-align:center;\r\n\r\n\t\t//loading message element\r\n\t\t.tabulator-loader-msg{\r\n\t\t\tdisplay:inline-block;\r\n\r\n\t\t\tmargin:0 auto;\r\n\t\t\tpadding:10px 20px;\r\n\r\n\t\t\tborder-radius:10px;\r\n\r\n\t\t\tbackground:#fff;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:16px;\r\n\r\n\t\t\t//loading message\r\n\t\t\t&.tabulator-loading{\r\n\t\t\t\tborder:4px solid #333;\r\n\t\t\t\tcolor:#000;\r\n\t\t\t}\r\n\r\n\t\t\t//error message\r\n\t\t\t&.tabulator-error{\r\n\t\t\t\tborder:4px solid #D00;\r\n\t\t\t\tcolor:#590000;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n//row element\r\n.tabulator-row{\r\n\tposition: relative;\r\n\tbox-sizing: border-box;\r\n\tmin-height:$textSize + ($headerMargin * 2);\r\n\tbackground-color: $rowBackgroundColor;\r\n\r\n\r\n\t&.tabulator-row-even{\r\n\t\tbackground-color: $rowAltBackgroundColor;\r\n\t}\r\n\r\n\t&.tabulator-selectable:hover{\r\n\t\tbackground-color:$rowHoverBackground;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-selected{\r\n\t\tbackground-color:$rowSelectedBackground;\r\n\t}\r\n\r\n\t&.tabulator-selected:hover{\r\n\t\tbackground-color:$rowSelectedBackgroundHover;\r\n\t\tcursor: pointer;\r\n\t}\r\n\r\n\t&.tabulator-row-moving{\r\n\t\tborder:1px solid #000;\r\n\t\tbackground:#fff;\r\n\t}\r\n\r\n\t&.tabulator-moving{\r\n\t\tposition: absolute;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpointer-events: none !important;\r\n\t\tz-index:15;\r\n\t}\r\n\r\n\t//row resize handles\r\n\t.tabulator-row-resize-handle{\r\n\t\tposition:absolute;\r\n\t\tright:0;\r\n\t\tbottom:0;\r\n\t\tleft:0;\r\n\t\theight:5px;\r\n\r\n\t\t&.prev{\r\n\t\t\ttop:0;\r\n\t\t\tbottom:auto;\r\n\t\t}\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:ns-resize;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-frozen{\r\n\t\tdisplay: inline-block;\r\n\t\tposition: absolute;\r\n\r\n\t\tbackground-color: inherit;\r\n\r\n\t\tz-index: 10;\r\n\r\n\t\t&.tabulator-frozen-left{\r\n\t\t\tborder-right:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t&.tabulator-frozen-right{\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-responsive-collapse{\r\n\t\tbox-sizing:border-box;\r\n\r\n\t\tpadding:5px;\r\n\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\t&:empty{\r\n\t\t\tdisplay:none;\r\n\t\t}\r\n\r\n\t\ttable{\r\n\t\t\tfont-size:$textSize;\r\n\r\n\t\t\ttr{\r\n\t\t\t\ttd{\r\n\t\t\t\t\tposition: relative;\r\n\r\n\t\t\t\t\t&:first-of-type{\r\n\t\t\t\t\t\tpadding-right:10px;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//cell element\r\n\t.tabulator-cell{\r\n\t\tdisplay:inline-block;\r\n\t\tposition: relative;\r\n\t\tbox-sizing:border-box;\r\n\t\tpadding:6px;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tvertical-align:middle;\r\n\t\twhite-space:nowrap;\r\n\t\toverflow:hidden;\r\n\t\ttext-overflow:ellipsis;\r\n\r\n\r\n\t\t&.tabulator-editing{\r\n\t\t\tborder:1px solid $editBoxColor;\r\n\t\t\tpadding: 0;\r\n\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-validation-fail{\r\n\t\t\tborder:1px solid $errorColor;\r\n\t\t\tinput, select{\r\n\t\t\t\tborder:1px;\r\n\t\t\t\tbackground:transparent;\r\n\r\n\t\t\t\tcolor: $errorColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//hide left resize handle on first column\r\n\t\t&:first-child{\r\n\t\t\t.tabulator-col-resize-handle.prev{\r\n\t\t\t\tdisplay: none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//movable row handle\r\n\t\t&.tabulator-row-handle{\r\n\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\t//handle holder\r\n\t\t\t.tabulator-row-handle-box{\r\n\t\t\t\twidth:80%;\r\n\r\n\t\t\t\t//Hamburger element\r\n\t\t\t\t.tabulator-row-handle-bar{\r\n\t\t\t\t\twidth:100%;\r\n\t\t\t\t\theight:3px;\r\n\t\t\t\t\tmargin-top:2px;\r\n\t\t\t\t\tbackground:$sortArrowActive;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-branch{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:9px;\r\n\t\t\twidth:7px;\r\n\r\n\t\t\tmargin-top:-9px;\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\t\tborder-left:2px solid $rowBorderColor;\r\n\t\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control{\r\n\r\n\t\t\tdisplay:inline-flex;\r\n\t\t\tjustify-content:center;\r\n\t\t\talign-items:center;\r\n\t\t\tvertical-align:middle;\r\n\r\n\t\t\theight:11px;\r\n\t\t\twidth:11px;\r\n\r\n\t\t\tmargin-right:5px;\r\n\r\n\t\t\tborder:1px solid $rowTextColor;\r\n\t\t\tborder-radius:2px;\r\n\t\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\t\toverflow:hidden;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\tcursor:pointer;\r\n\t\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: transparent;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-data-tree-control-expand{\r\n\t\t\t\tdisplay:inline-block;\r\n\t\t\t\tposition: relative;\r\n\r\n\t\t\t\theight: 7px;\r\n\t\t\t\twidth: 1px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t\t&:after {\r\n\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\tcontent: \"\";\r\n\t\t\t\t\tleft: -3px;\r\n\t\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\t\theight: 1px;\r\n\t\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t.tabulator-responsive-collapse-toggle{\r\n\t\t\tdisplay: inline-flex;\r\n\t\t\talign-items:center;\r\n\t\t\tjustify-content:center;\r\n\r\n\t\t\t-moz-user-select: none;\r\n\t\t\t-khtml-user-select: none;\r\n\t\t\t-webkit-user-select: none;\r\n\t\t\t-o-user-select: none;\r\n\r\n\t\t\theight:15px;\r\n\t\t\twidth:15px;\r\n\r\n\t\t\tborder-radius:20px;\r\n\t\t\tbackground:#666;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tfont-weight:bold;\r\n\t\t\tfont-size:1.1em;\r\n\r\n\t\t\t&:hover{\r\n\t\t\t\topacity:.7;\r\n\t\t\t}\r\n\r\n\t\t\t&.open{\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\t\tdisplay:initial;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t.tabulator-responsive-collapse-toggle-open{\r\n\t\t\t\t\tdisplay:none;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t.tabulator-responsive-collapse-toggle-close{\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-traffic-light{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\theight:14px;\r\n\t\t\twidth:14px;\r\n\r\n\t\t\tborder-radius:14px;\r\n\t\t}\r\n\t}\r\n\r\n\t//row grouping element\r\n\t&.tabulator-group{\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #000;\r\n\t\tborder-bottom:2px solid $headerSeperatorColor;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:$headerBackgroundColor;\r\n\t\tcolor:$headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\tpadding-left:30px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\tpadding-left:50px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\tpadding-left:70px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\tpadding-left:90px;\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\tpadding-left:110px;\r\n\t\t}\r\n\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:$headerSeperatorColor;\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\n.tabulator-menu{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\tbox-shadow: 0 0 5px 0 rgba(0, 0, 0, .2);\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-menu-item{\r\n\r\n\t\tpadding:5px 10px;\r\n\r\n\t\tuser-select: none;\r\n\r\n\t\t&.tabulator-menu-item-disabled{\r\n\t\t\topacity: .5;\r\n\t\t}\r\n\r\n\t\t&:not(.tabulator-menu-item-disabled):hover{\r\n\t\t\tcursor: pointer;\r\n\t\t\tbackground: $rowAltBackgroundColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-menu-separator{\r\n\t\tborder-top:1px solid $rowBorderColor;\r\n\t}\r\n}\r\n\r\n.tabulator-edit-select-list{\r\n\tposition: absolute;\r\n\tdisplay:inline-block;\r\n\tbox-sizing:border-box;\r\n\r\n\tmax-height:200px;\r\n\r\n\tbackground:$rowBackgroundColor;\r\n\tborder:1px solid $rowBorderColor;\r\n\r\n\tfont-size:$textSize;\r\n\r\n\toverflow-y:auto;\r\n\t-webkit-overflow-scrolling: touch;\r\n\r\n\tz-index: 10000;\r\n\r\n\t.tabulator-edit-select-list-item{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\r\n\t\t&.active{\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\r\n\t\t\t&.focused{\r\n\t\t\t\toutline:1px solid rgba($rowBackgroundColor, .5);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.focused{\r\n\t\t\toutline:1px solid $editBoxColor;\r\n\t\t}\r\n\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\r\n\t\t\tcolor:$rowBackgroundColor;\r\n\t\t\tbackground:$editBoxColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-notice{\r\n\t\tpadding:4px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\ttext-align: center;\r\n\t}\r\n\r\n\t.tabulator-edit-select-list-group{\r\n\t\tborder-bottom:1px solid $rowBorderColor;\r\n\r\n\t\tpadding:4px;\r\n\t\tpadding-top:6px;\r\n\r\n\t\tcolor:$rowTextColor;\r\n\t\tfont-weight:bold;\r\n\t}\r\n}\r\n\r\n// Table print styling\r\n\r\n.tabulator-print-fullscreen{\r\n\tposition: absolute;\r\n\ttop:0;\r\n\tbottom:0;\r\n\tleft:0;\r\n\tright:0;\r\n\r\n\tz-index: 10000;\r\n}\r\n\r\nbody.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){\r\n\tdisplay:none !important;\r\n}\r\n\r\n.tabulator-print-table{\r\n\tborder-collapse: collapse;\r\n\r\n\t//row grouping element\r\n\t.tabulator-print-table-group{\r\n\t\tbox-sizing:border-box;\r\n\t\tborder-right:1px solid $rowBorderColor;\r\n\t\tborder-top:1px solid #000;\r\n\t\tborder-bottom:2px solid $headerSeperatorColor;\r\n\t\tpadding:5px;\r\n\t\tpadding-left:10px;\r\n\t\tbackground:$headerBackgroundColor;\r\n\t\tcolor:$headerTextColor;\r\n\t\tfont-weight:bold;\r\n\r\n\t\tmin-width: 100%;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground-color:darken($headerBackgroundColor, 10%);\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-visible{\r\n\t\t\t.tabulator-arrow{\r\n\t\t\t\tmargin-right:10px;\r\n\t\t\t\tborder-left: 6px solid transparent;\r\n\t\t\t\tborder-right: 6px solid transparent;\r\n\t\t\t\tborder-top: 6px solid $sortArrowActive;\r\n\t\t\t\tborder-bottom: 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-1{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:30px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-2{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:50px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-3{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:70px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-4{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:90px !important;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&.tabulator-group-level-5{\r\n\t\t\ttd{\r\n\t\t\t\tpadding-left:110px !important;\r\n\t\t\t}\r\n\t\t}\r\n\t\t.tabulator-group-toggle{\r\n\t\t\tdisplay: inline-block;\r\n\t\t}\r\n\r\n\t\t//sorting arrow\r\n\t\t.tabulator-arrow{\r\n\t\t\tdisplay: inline-block;\r\n\t\t\twidth: 0;\r\n\t\t\theight: 0;\r\n\t\t\tmargin-right:16px;\r\n\t\t\tborder-top: 6px solid transparent;\r\n\t\t\tborder-bottom: 6px solid transparent;\r\n\t\t\tborder-right: 0;\r\n\t\t\tborder-left: 6px solid $sortArrowActive;\r\n\t\t\tvertical-align:middle;\r\n\t\t}\r\n\r\n\t\tspan{\r\n\t\t\tmargin-left:10px;\r\n\t\t\tcolor:$headerSeperatorColor;\r\n\t\t}\r\n\t}\r\n\r\n\t.tabulator-data-tree-branch{\r\n\t\tdisplay:inline-block;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:9px;\r\n\t\twidth:7px;\r\n\r\n\t\tmargin-top:-9px;\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder-bottom-left-radius:1px;\r\n\r\n\t\tborder-left:2px solid $rowBorderColor;\r\n\t\tborder-bottom:2px solid $rowBorderColor;\r\n\t}\r\n\r\n\t.tabulator-data-tree-control{\r\n\r\n\t\tdisplay:inline-flex;\r\n\t\tjustify-content:center;\r\n\t\talign-items:center;\r\n\t\tvertical-align:middle;\r\n\r\n\t\theight:11px;\r\n\t\twidth:11px;\r\n\r\n\t\tmargin-right:5px;\r\n\r\n\t\tborder:1px solid $rowTextColor;\r\n\t\tborder-radius:2px;\r\n\t\tbackground:rgba(0, 0, 0, .1);\r\n\r\n\t\toverflow:hidden;\r\n\r\n\t\t&:hover{\r\n\t\t\tcursor:pointer;\r\n\t\t\tbackground:rgba(0, 0, 0, .2);\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-collapse{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: transparent;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t.tabulator-data-tree-control-expand{\r\n\t\t\tdisplay:inline-block;\r\n\t\t\tposition: relative;\r\n\r\n\t\t\theight: 7px;\r\n\t\t\twidth: 1px;\r\n\r\n\t\t\tbackground: $rowTextColor;\r\n\r\n\t\t\t&:after {\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\tcontent: \"\";\r\n\t\t\t\tleft: -3px;\r\n\t\t\t\ttop: 3px;\r\n\r\n\t\t\t\theight: 1px;\r\n\t\t\t\twidth: 7px;\r\n\r\n\t\t\t\tbackground: $rowTextColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/accessor.js b/app/static/vendors/tabulator/js.old/modules/accessor.js deleted file mode 100644 index 33c6008..0000000 --- a/app/static/vendors/tabulator/js.old/modules/accessor.js +++ /dev/null @@ -1,93 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Accessor = function Accessor(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"]; //list of accessor types -}; - -//initialize column accessor -Accessor.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)), - accessor; - - if (column.definition[key]) { - accessor = self.lookupAccessor(column.definition[key]); - - if (accessor) { - match = true; - - config[key] = { - accessor: accessor, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.accessor = config; - } -}; - -Accessor.prototype.lookupAccessor = function (value) { - var accessor = false; - - //set column accessor - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - if (this.accessors[value]) { - accessor = this.accessors[value]; - } else { - console.warn("Accessor Error - No such accessor found, ignoring: ", value); - } - break; - - case "function": - accessor = value; - break; - } - - return accessor; -}; - -//apply accessor to row -Accessor.prototype.transformRow = function (dataIn, type) { - var self = this, - key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)); - - //clone data object with deep copy to isolate internal data from returned result - var data = Tabulator.prototype.helpers.deepClone(dataIn || {}); - - self.table.columnManager.traverse(function (column) { - var value, accessor, params, component; - - if (column.modules.accessor) { - - accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false; - - if (accessor) { - value = column.getFieldValue(data); - - if (value != "undefined") { - component = column.getComponent(); - params = typeof accessor.params === "function" ? accessor.params(value, data, type, component) : accessor.params; - column.setFieldValue(data, accessor.accessor(value, data, type, params, component)); - } - } - } - }); - - return data; -}, - -//default accessors -Accessor.prototype.accessors = {}; - -Tabulator.prototype.registerModule("accessor", Accessor); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/accessor.min.js b/app/static/vendors/tabulator/js.old/modules/accessor.min.js deleted file mode 100644 index 670da5f..0000000 --- a/app/static/vendors/tabulator/js.old/modules/accessor.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Accessor=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};Accessor.prototype.initializeColumn=function(o){var e=this,s=!1,r={};this.allowedTypes.forEach(function(t){var c,a="accessor"+(t.charAt(0).toUpperCase()+t.slice(1));o.definition[a]&&(c=e.lookupAccessor(o.definition[a]))&&(s=!0,r[a]={accessor:c,params:o.definition[a+"Params"]||{}})}),s&&(o.modules.accessor=r)},Accessor.prototype.lookupAccessor=function(o){var e=!1;switch(void 0===o?"undefined":_typeof(o)){case"string":this.accessors[o]?e=this.accessors[o]:console.warn("Accessor Error - No such accessor found, ignoring: ",o);break;case"function":e=o}return e},Accessor.prototype.transformRow=function(o,e){var s=this,r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),t=Tabulator.prototype.helpers.deepClone(o||{});return s.table.columnManager.traverse(function(o){var s,c,a,n;o.modules.accessor&&(c=o.modules.accessor[r]||o.modules.accessor.accessor||!1)&&"undefined"!=(s=o.getFieldValue(t))&&(n=o.getComponent(),a="function"==typeof c.params?c.params(s,t,e,n):c.params,o.setFieldValue(t,c.accessor(s,t,e,a,n)))}),t},Accessor.prototype.accessors={},Tabulator.prototype.registerModule("accessor",Accessor); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/ajax.js b/app/static/vendors/tabulator/js.old/modules/ajax.js deleted file mode 100644 index 9abd307..0000000 --- a/app/static/vendors/tabulator/js.old/modules/ajax.js +++ /dev/null @@ -1,465 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Ajax = function Ajax(table) { - - this.table = table; //hold Tabulator object - this.config = false; //hold config object for ajax request - this.url = ""; //request URL - this.urlGenerator = false; - this.params = false; //request parameters - - this.loaderElement = this.createLoaderElement(); //loader message div - this.msgElement = this.createMsgElement(); //message element - this.loadingElement = false; - this.errorElement = false; - this.loaderPromise = false; - - this.progressiveLoad = false; - this.loading = false; - - this.requestOrder = 0; //prevent requests comming out of sequence if overridden by another load request -}; - -//initialize setup options -Ajax.prototype.initialize = function () { - var template; - - this.loaderElement.appendChild(this.msgElement); - - if (this.table.options.ajaxLoaderLoading) { - if (typeof this.table.options.ajaxLoaderLoading == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderLoading.trim(); - this.loadingElement = template.content.firstChild; - } else { - this.loadingElement = this.table.options.ajaxLoaderLoading; - } - } - - this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise; - - this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator; - - if (this.table.options.ajaxLoaderError) { - if (typeof this.table.options.ajaxLoaderError == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderError.trim(); - this.errorElement = template.content.firstChild; - } else { - this.errorElement = this.table.options.ajaxLoaderError; - } - } - - if (this.table.options.ajaxParams) { - this.setParams(this.table.options.ajaxParams); - } - - if (this.table.options.ajaxConfig) { - this.setConfig(this.table.options.ajaxConfig); - } - - if (this.table.options.ajaxURL) { - this.setUrl(this.table.options.ajaxURL); - } - - if (this.table.options.ajaxProgressiveLoad) { - if (this.table.options.pagination) { - this.progressiveLoad = false; - console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"); - } else { - if (this.table.modExists("page")) { - this.progressiveLoad = this.table.options.ajaxProgressiveLoad; - this.table.modules.page.initializeProgressive(this.progressiveLoad); - } else { - console.error("Pagination plugin is required for progressive ajax loading"); - } - } - } -}; - -Ajax.prototype.createLoaderElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-loader"); - return el; -}; - -Ajax.prototype.createMsgElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-loader-msg"); - el.setAttribute("role", "alert"); - - return el; -}; - -//set ajax params -Ajax.prototype.setParams = function (params, update) { - if (update) { - this.params = this.params || {}; - - for (var key in params) { - this.params[key] = params[key]; - } - } else { - this.params = params; - } -}; - -Ajax.prototype.getParams = function () { - return this.params || {}; -}; - -//load config object -Ajax.prototype.setConfig = function (config) { - this._loadDefaultConfig(); - - if (typeof config == "string") { - this.config.method = config; - } else { - for (var key in config) { - this.config[key] = config[key]; - } - } -}; - -//create config object from default -Ajax.prototype._loadDefaultConfig = function (force) { - var self = this; - if (!self.config || force) { - - self.config = {}; - - //load base config from defaults - for (var key in self.defaultConfig) { - self.config[key] = self.defaultConfig[key]; - } - } -}; - -//set request url -Ajax.prototype.setUrl = function (url) { - this.url = url; -}; - -//get request url -Ajax.prototype.getUrl = function () { - return this.url; -}; - -//lstandard loading function -Ajax.prototype.loadData = function (inPosition, columnsChanged) { - var self = this; - - if (this.progressiveLoad) { - return this._loadDataProgressive(); - } else { - return this._loadDataStandard(inPosition, columnsChanged); - } -}; - -Ajax.prototype.nextPage = function (diff) { - var margin; - - if (!this.loading) { - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.getElement().clientHeight * 2; - - if (diff < margin) { - this.table.modules.page.nextPage().then(function () {}).catch(function () {}); - } - } -}; - -Ajax.prototype.blockActiveRequest = function () { - this.requestOrder++; -}; - -Ajax.prototype._loadDataProgressive = function () { - this.table.rowManager.setData([]); - return this.table.modules.page.setPage(1); -}; - -Ajax.prototype._loadDataStandard = function (inPosition, columnsChanged) { - var _this = this; - - return new Promise(function (resolve, reject) { - _this.sendRequest(inPosition).then(function (data) { - _this.table.rowManager.setData(data, inPosition, columnsChanged).then(function () { - resolve(); - }).catch(function (e) { - reject(e); - }); - }).catch(function (e) { - reject(e); - }); - }); -}; - -Ajax.prototype.generateParamsList = function (data, prefix) { - var self = this, - output = []; - - prefix = prefix || ""; - - if (Array.isArray(data)) { - data.forEach(function (item, i) { - output = output.concat(self.generateParamsList(item, prefix ? prefix + "[" + i + "]" : i)); - }); - } else if ((typeof data === "undefined" ? "undefined" : _typeof(data)) === "object") { - for (var key in data) { - output = output.concat(self.generateParamsList(data[key], prefix ? prefix + "[" + key + "]" : key)); - } - } else { - output.push({ key: prefix, value: data }); - } - - return output; -}; - -Ajax.prototype.serializeParams = function (params) { - var output = this.generateParamsList(params), - encoded = []; - - output.forEach(function (item) { - encoded.push(encodeURIComponent(item.key) + "=" + encodeURIComponent(item.value)); - }); - - return encoded.join("&"); -}; - -//send ajax request -Ajax.prototype.sendRequest = function (silent) { - var _this2 = this; - - var self = this, - url = self.url, - requestNo, - esc, - query; - - self.requestOrder++; - requestNo = self.requestOrder; - - self._loadDefaultConfig(); - - return new Promise(function (resolve, reject) { - if (self.table.options.ajaxRequesting.call(_this2.table, self.url, self.params) !== false) { - - self.loading = true; - - if (!silent) { - self.showLoader(); - } - - _this2.loaderPromise(url, self.config, self.params).then(function (data) { - if (requestNo === self.requestOrder) { - if (self.table.options.ajaxResponse) { - data = self.table.options.ajaxResponse.call(self.table, self.url, self.params, data); - } - resolve(data); - - self.hideLoader(); - self.loading = false; - } else { - console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"); - } - }).catch(function (error) { - console.error("Ajax Load Error: ", error); - self.table.options.ajaxError.call(self.table, error); - - self.showError(); - - setTimeout(function () { - self.hideLoader(); - }, 3000); - - self.loading = false; - - reject(); - }); - } else { - reject(); - } - }); -}; - -Ajax.prototype.showLoader = function () { - var shouldLoad = typeof this.table.options.ajaxLoader === "function" ? this.table.options.ajaxLoader() : this.table.options.ajaxLoader; - - if (shouldLoad) { - - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-error"); - this.msgElement.classList.add("tabulator-loading"); - - if (this.loadingElement) { - this.msgElement.appendChild(this.loadingElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|loading"); - } - - this.table.element.appendChild(this.loaderElement); - } -}; - -Ajax.prototype.showError = function () { - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-loading"); - this.msgElement.classList.add("tabulator-error"); - - if (this.errorElement) { - this.msgElement.appendChild(this.errorElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|error"); - } - - this.table.element.appendChild(this.loaderElement); -}; - -Ajax.prototype.hideLoader = function () { - if (this.loaderElement.parentNode) { - this.loaderElement.parentNode.removeChild(this.loaderElement); - } -}; - -//default ajax config object -Ajax.prototype.defaultConfig = { - method: "GET" -}; - -Ajax.prototype.defaultURLGenerator = function (url, config, params) { - - if (url) { - if (params && Object.keys(params).length) { - if (!config.method || config.method.toLowerCase() == "get") { - config.method = "get"; - - url += (url.includes("?") ? "&" : "?") + this.serializeParams(params); - } - } - } - - return url; -}; - -Ajax.prototype.defaultLoaderPromise = function (url, config, params) { - var self = this, - contentType; - - return new Promise(function (resolve, reject) { - - //set url - url = self.urlGenerator(url, config, params); - - //set body content if not GET request - if (config.method.toUpperCase() != "GET") { - contentType = _typeof(self.table.options.ajaxContentType) === "object" ? self.table.options.ajaxContentType : self.contentTypeFormatters[self.table.options.ajaxContentType]; - if (contentType) { - - for (var key in contentType.headers) { - if (!config.headers) { - config.headers = {}; - } - - if (typeof config.headers[key] === "undefined") { - config.headers[key] = contentType.headers[key]; - } - } - - config.body = contentType.body.call(self, url, config, params); - } else { - console.warn("Ajax Error - Invalid ajaxContentType value:", self.table.options.ajaxContentType); - } - } - - if (url) { - - //configure headers - if (typeof config.headers === "undefined") { - config.headers = {}; - } - - if (typeof config.headers.Accept === "undefined") { - config.headers.Accept = "application/json"; - } - - if (typeof config.headers["X-Requested-With"] === "undefined") { - config.headers["X-Requested-With"] = "XMLHttpRequest"; - } - - if (typeof config.mode === "undefined") { - config.mode = "cors"; - } - - if (config.mode == "cors") { - - if (typeof config.headers["Access-Control-Allow-Origin"] === "undefined") { - config.headers["Access-Control-Allow-Origin"] = window.location.origin; - } - - if (typeof config.credentials === "undefined") { - config.credentials = 'same-origin'; - } - } else { - if (typeof config.credentials === "undefined") { - config.credentials = 'include'; - } - } - - //send request - fetch(url, config).then(function (response) { - if (response.ok) { - response.json().then(function (data) { - resolve(data); - }).catch(function (error) { - reject(error); - console.warn("Ajax Load Error - Invalid JSON returned", error); - }); - } else { - console.error("Ajax Load Error - Connection Error: " + response.status, response.statusText); - reject(response); - } - }).catch(function (error) { - console.error("Ajax Load Error - Connection Error: ", error); - reject(error); - }); - } else { - console.warn("Ajax Load Error - No URL Set"); - resolve([]); - } - }); -}; - -Ajax.prototype.contentTypeFormatters = { - "json": { - headers: { - 'Content-Type': 'application/json' - }, - body: function body(url, config, params) { - return JSON.stringify(params); - } - }, - "form": { - headers: {}, - body: function body(url, config, params) { - var output = this.generateParamsList(params), - form = new FormData(); - - output.forEach(function (item) { - form.append(item.key, item.value); - }); - - return form; - } - } -}; - -Tabulator.prototype.registerModule("ajax", Ajax); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/ajax.min.js b/app/static/vendors/tabulator/js.old/modules/ajax.min.js deleted file mode 100644 index eec9e11..0000000 --- a/app/static/vendors/tabulator/js.old/modules/ajax.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ajax=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};Ajax.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},Ajax.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},Ajax.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},Ajax.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},Ajax.prototype.getParams=function(){return this.params||{}},Ajax.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},Ajax.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},Ajax.prototype.setUrl=function(e){this.url=e},Ajax.prototype.getUrl=function(){return this.url},Ajax.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},Ajax.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,e output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "min": function min(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value < output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "sum": function sum(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - if (values.length) { - values.forEach(function (value) { - value = Number(value); - - output += !isNaN(value) ? Number(value) : 0; - }); - } - - return precision !== false ? output.toFixed(precision) : output; - }, - "concat": function concat(values, data, calcParams) { - var output = 0; - - if (values.length) { - output = values.reduce(function (sum, value) { - return String(sum) + String(value); - }); - } - - return output; - }, - "count": function count(values, data, calcParams) { - var output = 0; - - if (values.length) { - values.forEach(function (value) { - if (value) { - output++; - } - }); - } - - return output; - } -}; - -Tabulator.prototype.registerModule("columnCalcs", ColumnCalcs); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/calculation_colums.min.js b/app/static/vendors/tabulator/js.old/modules/calculation_colums.min.js deleted file mode 100644 index 3174e0f..0000000 --- a/app/static/vendors/tabulator/js.old/modules/calculation_colums.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ColumnCalcs=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};ColumnCalcs.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},ColumnCalcs.prototype.initialize=function(){this.genColumn=new Column({field:"value"},this)},ColumnCalcs.prototype.registerColumnField=function(){},ColumnCalcs.prototype.initializeColumn=function(t){var o=t.definition,e={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(_typeof(o.topCalc)){case"string":this.calculations[o.topCalc]?e.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":e.topCalc=o.topCalc}e.topCalc&&(t.modules.columnCalcs=e,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(o.bottomCalc){switch(_typeof(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?e.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":e.botCalc=o.bottomCalc}e.botCalc&&(t.modules.columnCalcs=e,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},ColumnCalcs.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},ColumnCalcs.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},ColumnCalcs.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},ColumnCalcs.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},ColumnCalcs.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},ColumnCalcs.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},ColumnCalcs.prototype.recalcAll=function(){var t=this;if((this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalc(this.table.rowManager.activeRows),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs)){table.modules.groupRows.getChildGroups().forEach(function(o){t.recalcGroup(o)})}},ColumnCalcs.prototype.recalcGroup=function(t){var o,e;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),e=this.generateRowData("bottom",o),t.calcs.bottom.updateData(e),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),e=this.generateRowData("top",o),t.calcs.top.updateData(e),t.calcs.top.reinitialize()))},ColumnCalcs.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},ColumnCalcs.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},ColumnCalcs.prototype.rowsToData=function(t){var o=this,e=[];return t.forEach(function(t){if(e.push(t.getData()),o.table.options.dataTree&&o.table.options.dataTreeChildColumnCalcs&&t.modules.dataTree.open){var l=o.rowsToData(o.table.modules.dataTree.getFilteredTreeChildren(t));e=e.concat(l)}}),e},ColumnCalcs.prototype.generateRow=function(t,o){var e,l=this,i=this.generateRowData(t,o);return l.table.modExists("mutator")&&l.table.modules.mutator.disable(),e=new Row(i,this,"calc"),l.table.modExists("mutator")&&l.table.modules.mutator.enable(),e.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),e.generateCells=function(){var o=[];l.table.columnManager.columnsByIndex.forEach(function(i){l.genColumn.setField(i.getField()),l.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&l.table.modExists("format")?l.genColumn.modules.format={formatter:l.table.modules.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]}:l.genColumn.modules.format={formatter:l.table.modules.format.getFormatter("plaintext"),params:{}},l.genColumn.definition.cssClass=i.definition.cssClass;var a=new Cell(l.genColumn,e);a.column=i,a.setWidth(),i.cells.push(a),o.push(a),i.visible||a.hide()}),this.cells=o},e},ColumnCalcs.prototype.generateRowData=function(t,o){var e,l,i={},a="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return a.forEach(function(t){var a=[];t.modules.columnCalcs&&t.modules.columnCalcs[n]&&(o.forEach(function(o){a.push(t.getFieldValue(o))}),l=n+"Params",e="function"==typeof t.modules.columnCalcs[l]?t.modules.columnCalcs[l](a,o):t.modules.columnCalcs[l],t.setFieldValue(i,t.modules.columnCalcs[n](a,o,e)))}),i},ColumnCalcs.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},ColumnCalcs.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},ColumnCalcs.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},ColumnCalcs.prototype.getResults=function(){var t,o=this,e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(function(t){e[t.getKey()]=o.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e},ColumnCalcs.prototype.getGroupResults=function(t){var o=this,e=t._getSelf(),l=t.getSubGroups(),i={};return l.forEach(function(t){i[t.getKey()]=o.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:i}},ColumnCalcs.prototype.calculations={avg:function(t,o,e){var l=0,i=void 0!==e.precision?e.precision:2;return t.length&&(l=t.reduce(function(t,o){return o=Number(o),t+o}),l/=t.length,l=!1!==i?l.toFixed(i):l),parseFloat(l).toString()},max:function(t,o,e){var l=null,i=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))>l||null===l)&&(l=t)}),null!==l?!1!==i?l.toFixed(i):l:""},min:function(t,o,e){var l=null,i=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))"),a.dataTreeExpandElement?"string"==typeof a.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=a.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=a.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),_typeof(a.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return a.dataTreeStartExpanded};break;case"function":this.startOpen=a.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return a.dataTreeStartExpanded[t]}}},DataTree.prototype.initializeRow=function(e){var t=e.getData()[this.field],a=Array.isArray(t),r=a||!a&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!r&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!r&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!r&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!r)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!r)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:r}},DataTree.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],a=t.getElement(),r=e.modules.dataTree;r.branchEl&&(r.branchEl.parentNode&&r.branchEl.parentNode.removeChild(r.branchEl),r.branchEl=!1),r.controlEl&&(r.controlEl.parentNode&&r.controlEl.parentNode.removeChild(r.controlEl),r.controlEl=!1),this.generateControlElement(e,a),e.element.classList.add("tabulator-tree-level-"+r.index),r.index&&(this.branchEl?(r.branchEl=this.branchEl.cloneNode(!0),a.insertBefore(r.branchEl,a.firstChild),r.branchEl.style.marginLeft=(r.branchEl.offsetWidth+r.branchEl.style.marginRight)*(r.index-1)+r.index*this.indent+"px"):a.style.paddingLeft=parseInt(window.getComputedStyle(a,null).getPropertyValue("padding-left"))+r.index*this.indent+"px")},DataTree.prototype.generateControlElement=function(e,t){var a=this,r=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=r.controlEl;!1!==r.children&&(r.open?(r.controlEl=this.collapseEl.cloneNode(!0),r.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.collapseRow(e)})):(r.controlEl=this.expandEl.cloneNode(!0),r.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.expandRow(e)})),r.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(r.controlEl,n):t.insertBefore(r.controlEl,t.firstChild))},DataTree.prototype.setDisplayIndex=function(e){this.displayIndex=e},DataTree.prototype.getDisplayIndex=function(){return this.displayIndex},DataTree.prototype.getRows=function(e){var t=this,a=[];return e.forEach(function(e,r){var n,l;a.push(e),e instanceof Row&&(n=e.modules.dataTree.children,n.index||!1===n.children||(l=t.getChildren(e),l.forEach(function(e){a.push(e)})))}),a},DataTree.prototype.getChildren=function(e){var t=this,a=e.modules.dataTree,r=[],n=[];return!1!==a.children&&a.open&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),r=this.table.modExists("filter")?this.table.modules.filter.filter(a.children):a.children,this.table.modExists("sort")&&this.table.modules.sort.sort(r),r.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n},DataTree.prototype.generateChildren=function(e){var t=this,a=[],r=e.getData()[this.field];return Array.isArray(r)||(r=[r]),r.forEach(function(r){var n=new Row(r||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),a.push(n)}),a},DataTree.prototype.expandRow=function(e,t){var a=e.modules.dataTree;!1!==a.children&&(a.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},DataTree.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},DataTree.prototype.getFilteredTreeChildren=function(e){var t,a=e.modules.dataTree,r=[];return a.children&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(a.children):a.children,t.forEach(function(e){e instanceof Row&&r.push(e)})),r},DataTree.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,a=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof Row&&a.push(e.getComponent())})),a},DataTree.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},DataTree.prototype.getChildField=function(){return this.field},DataTree.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},Tabulator.prototype.registerModule("dataTree",DataTree); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/download.js b/app/static/vendors/tabulator/js.old/modules/download.js deleted file mode 100644 index cf576be..0000000 --- a/app/static/vendors/tabulator/js.old/modules/download.js +++ /dev/null @@ -1,949 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Download = function Download(table) { - this.table = table; //hold Tabulator object - this.fields = {}; //hold filed multi dimension arrays - this.columnsByIndex = []; //hold columns in their order in the table - this.columnsByField = {}; //hold columns with lookup by field name - this.config = {}; - this.active = false; -}; - -//trigger file download -Download.prototype.download = function (type, filename, options, active, interceptCallback) { - var self = this, - downloadFunc = false; - this.processConfig(); - this.active = active; - - function buildLink(data, mime) { - if (interceptCallback) { - if (interceptCallback === true) { - self.triggerDownload(data, mime, type, filename, true); - } else { - interceptCallback(data); - } - } else { - self.triggerDownload(data, mime, type, filename); - } - } - - if (typeof type == "function") { - downloadFunc = type; - } else { - if (self.downloaders[type]) { - downloadFunc = self.downloaders[type]; - } else { - console.warn("Download Error - No such download type found: ", type); - } - } - - this.processColumns(); - - if (downloadFunc) { - downloadFunc.call(this, self.processDefinitions(), self.processData(active || "active"), options || {}, buildLink, this.config); - } -}; - -Download.prototype.processConfig = function () { - var config = { //download config - columnGroups: true, - rowGroups: true, - columnCalcs: true, - dataTree: true - }; - - if (this.table.options.downloadConfig) { - for (var key in this.table.options.downloadConfig) { - config[key] = this.table.options.downloadConfig[key]; - } - } - - this.config.rowGroups = config.rowGroups && this.table.options.groupBy && this.table.modExists("groupRows"); - - if (config.columnGroups && this.table.columnManager.columns.length != this.table.columnManager.columnsByIndex.length) { - this.config.columnGroups = true; - } - - if (config.columnCalcs && this.table.modExists("columnCalcs")) { - this.config.columnCalcs = true; - } - - if (config.dataTree && this.table.options.dataTree && this.table.modExists("dataTree")) { - this.config.dataTree = true; - } -}; - -Download.prototype.processColumns = function () { - var self = this; - - self.columnsByIndex = []; - self.columnsByField = {}; - - self.table.columnManager.columnsByIndex.forEach(function (column) { - - if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) { - self.columnsByIndex.push(column); - self.columnsByField[column.field] = column; - } - }); -}; - -Download.prototype.processDefinitions = function () { - var self = this, - processedDefinitions = []; - - if (this.config.columnGroups) { - self.table.columnManager.columns.forEach(function (column) { - var colData = self.processColumnGroup(column); - - if (colData) { - processedDefinitions.push(colData); - } - }); - } else { - self.columnsByIndex.forEach(function (column) { - if (column.download !== false) { - //isolate definiton from defintion object - processedDefinitions.push(self.processDefinition(column)); - } - }); - } - - return processedDefinitions; -}; - -Download.prototype.processColumnGroup = function (column) { - var _this = this; - - var subGroups = column.columns, - maxDepth = 0; - var processedColumn = this.processDefinition(column); - var groupData = { - type: "group", - title: processedColumn.title, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this.processColumnGroup(subGroup); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) { - groupData.width = 1; - groupData.definition = processedColumn; - } else { - return false; - } - } - - return groupData; -}; - -Download.prototype.processDefinition = function (column) { - var def = {}; - - for (var key in column.definition) { - def[key] = column.definition[key]; - } - - if (typeof column.definition.downloadTitle != "undefined") { - def.title = column.definition.downloadTitle; - } - - return def; -}; - -Download.prototype.processData = function (active) { - var _this2 = this; - - var self = this, - data = [], - groups = [], - rows = false, - calcs = {}; - - if (this.config.rowGroups) { - - if (active == "visible") { - - rows = self.table.rowManager.getRows(active); - - rows.forEach(function (row) { - if (row.type == "row") { - var group = row.getGroup(); - - if (groups.indexOf(group) === -1) { - groups.push(group); - } - } - }); - } else { - groups = this.table.modules.groupRows.getGroups(); - } - - groups.forEach(function (group) { - data.push(_this2.processGroupData(group, rows)); - }); - } else { - if (this.config.dataTree) { - active = active = "active" ? "display" : active; - } - data = self.table.rowManager.getData(active, "download"); - } - - if (this.config.columnCalcs) { - calcs = this.table.getCalcResults(); - - data = { - calcs: calcs, - data: data - }; - } - - //bulk data processing - if (typeof self.table.options.downloadDataFormatter == "function") { - data = self.table.options.downloadDataFormatter(data); - } - - return data; -}; - -Download.prototype.processGroupData = function (group, visRows) { - var _this3 = this; - - var subGroups = group.getSubGroups(); - - var groupData = { - type: "group", - key: group.key - }; - - if (subGroups.length) { - groupData.subGroups = []; - - subGroups.forEach(function (subGroup) { - groupData.subGroups.push(_this3.processGroupData(subGroup, visRows)); - }); - } else { - if (visRows) { - groupData.rows = []; - - group.rows.forEach(function (row) { - if (visRows.indexOf(row) > -1) { - groupData.rows.push(row.getData("download")); - } - }); - } else { - groupData.rows = group.getData(true, "download"); - } - } - - return groupData; -}; - -Download.prototype.triggerDownload = function (data, mime, type, filename, newTab) { - var element = document.createElement('a'), - blob = new Blob([data], { type: mime }), - filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type); - - blob = this.table.options.downloadReady.call(this.table, data, blob); - - if (blob) { - - if (newTab) { - window.open(window.URL.createObjectURL(blob)); - } else { - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveOrOpenBlob(blob, filename); - } else { - element.setAttribute('href', window.URL.createObjectURL(blob)); - - //set file title - element.setAttribute('download', filename); - - //trigger download - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - - //remove temporary link element - document.body.removeChild(element); - } - } - - if (this.table.options.downloadComplete) { - this.table.options.downloadComplete(); - } - } -}; - -//nested field lookup -Download.prototype.getFieldValue = function (field, data) { - var column = this.columnsByField[field]; - - if (column) { - return column.getFieldValue(data); - } - - return false; -}; - -Download.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "intercept": - this.download(data.type, "", data.options, data.active, data.intercept); - break; - } -}; - -//downloaders -Download.prototype.downloaders = { - csv: function csv(columns, data, options, setFileContents, config) { - var self = this, - titles = [], - fields = [], - delimiter = options && options.delimiter ? options.delimiter : ",", - fileContents, - output; - - //build column headers - function parseSimpleTitles() { - columns.forEach(function (column) { - titles.push('"' + String(column.title).split('"').join('""') + '"'); - fields.push(column.field); - }); - } - - function parseColumnGroup(column, level) { - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } else { - titles.push('"' + String(column.title).split('"').join('""') + '"'); - fields.push(column.definition.field); - } - } - - if (config.columnGroups) { - console.warn("Download Warning - CSV downloader cannot process column groups"); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - } else { - parseSimpleTitles(); - } - - //generate header row - fileContents = [titles.join(delimiter)]; - - function parseRows(data) { - //generate each row of the table - data.forEach(function (row) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - - //escape quotation marks - rowData.push('"' + String(value).split('"').join('""') + '"'); - }); - - fileContents.push(rowData.join(delimiter)); - }); - } - - function parseGroup(group) { - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup); - }); - } else { - parseRows(group.rows); - } - } - - if (config.columnCalcs) { - console.warn("Download Warning - CSV downloader cannot process column calculations"); - data = data.data; - } - - if (config.rowGroups) { - console.warn("Download Warning - CSV downloader cannot process row groups"); - - data.forEach(function (group) { - parseGroup(group); - }); - } else { - parseRows(data); - } - - output = fileContents.join("\n"); - - if (options.bom) { - output = "\uFEFF" + output; - } - - setFileContents(output, "text/csv"); - }, - - json: function json(columns, data, options, setFileContents, config) { - var fileContents; - - if (config.columnCalcs) { - console.warn("Download Warning - CSV downloader cannot process column calculations"); - data = data.data; - } - - fileContents = JSON.stringify(data, null, '\t'); - - setFileContents(fileContents, "application/json"); - }, - - pdf: function pdf(columns, data, options, setFileContents, config) { - var self = this, - fields = [], - header = [], - body = [], - calcs = {}, - headerDepth = 1, - table = "", - autoTableParams = {}, - rowGroupStyles = options.rowGroupStyles || { - fontStyle: "bold", - fontSize: 12, - cellPadding: 6, - fillColor: 220 - }, - rowCalcStyles = options.rowCalcStyles || { - fontStyle: "bold", - fontSize: 10, - cellPadding: 4, - fillColor: 232 - }, - jsPDFParams = options.jsPDF || {}, - title = options && options.title ? options.title : ""; - - if (config.columnCalcs) { - calcs = data.calcs; - data = data.data; - } - - if (!jsPDFParams.orientation) { - jsPDFParams.orientation = options.orientation || "landscape"; - } - - if (!jsPDFParams.unit) { - jsPDFParams.unit = "pt"; - } - - //build column headers - function parseSimpleTitles() { - columns.forEach(function (column) { - if (column.field) { - header.push(column.title || ""); - fields.push(column.field); - } - }); - - header = [header]; - } - - function parseColumnGroup(column, level) { - var colSpan = column.width, - rowSpan = 1, - col = { - content: column.title || "" - }; - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - rowSpan = 1; - } else { - fields.push(column.definition.field); - rowSpan = headerDepth - level; - } - - col.rowSpan = rowSpan; - // col.colSpan = colSpan; - - header[level].push(col); - - colSpan--; - - if (rowSpan > 1) { - for (var i = level + 1; i < headerDepth; i++) { - header[i].push(""); - } - } - - for (var i = 0; i < colSpan; i++) { - header[level].push(""); - } - } - - if (config.columnGroups) { - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - for (var i = 0; i < headerDepth; i++) { - header.push([]); - } - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - } else { - parseSimpleTitles(); - } - - function parseValue(value) { - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - - return value; - } - - function parseRows(data) { - //build table rows - data.forEach(function (row) { - body.push(parseRow(row)); - }); - } - - function parseRow(row, styles) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - value = parseValue(value); - - if (styles) { - rowData.push({ - content: value, - styles: styles - }); - } else { - rowData.push(value); - } - }); - - return rowData; - } - - function parseGroup(group, calcObj) { - var groupData = []; - - groupData.push({ content: parseValue(group.key), colSpan: fields.length, styles: rowGroupStyles }); - - body.push(groupData); - - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {}); - }); - } else { - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "top"); - } - - parseRows(group.rows); - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "bottom"); - } - } - } - - function addCalcRow(calcs, selector, pos) { - var calcData = calcs[selector]; - - if (calcData) { - if (pos) { - calcData = calcData[pos]; - } - - if (Object.keys(calcData).length) { - body.push(parseRow(calcData, rowCalcStyles)); - } - } - } - - if (config.rowGroups) { - data.forEach(function (group) { - parseGroup(group, calcs); - }); - } else { - if (config.columnCalcs) { - addCalcRow(calcs, "top"); - } - - parseRows(data); - - if (config.columnCalcs) { - addCalcRow(calcs, "bottom"); - } - } - - var doc = new jsPDF(jsPDFParams); //set document to landscape, better for most tables - - if (options && options.autoTable) { - if (typeof options.autoTable === "function") { - autoTableParams = options.autoTable(doc) || {}; - } else { - autoTableParams = options.autoTable; - } - } - - if (title) { - autoTableParams.addPageContent = function (data) { - doc.text(title, 40, 30); - }; - } - - autoTableParams.head = header; - autoTableParams.body = body; - - doc.autoTable(autoTableParams); - - if (options && options.documentProcessing) { - options.documentProcessing(doc); - } - - setFileContents(doc.output("arraybuffer"), "application/pdf"); - }, - - xlsx: function xlsx(columns, data, options, setFileContents, config) { - var self = this, - sheetName = options.sheetName || "Sheet1", - workbook = XLSX.utils.book_new(), - calcs = {}, - groupRowIndexs = [], - groupColumnIndexs = [], - calcRowIndexs = [], - output; - - workbook.SheetNames = []; - workbook.Sheets = {}; - - if (config.columnCalcs) { - calcs = data.calcs; - data = data.data; - } - - function generateSheet() { - var titles = [], - fields = [], - rows = [], - worksheet; - - //convert rows to worksheet - function rowsToSheet() { - var sheet = {}; - var range = { s: { c: 0, r: 0 }, e: { c: fields.length, r: rows.length } }; - - XLSX.utils.sheet_add_aoa(sheet, rows); - - sheet['!ref'] = XLSX.utils.encode_range(range); - - var merges = generateMerges(); - - if (merges.length) { - sheet["!merges"] = merges; - } - - return sheet; - } - - function parseSimpleTitles() { - //get field lists - columns.forEach(function (column) { - titles.push(column.title); - fields.push(column.field); - }); - - rows.push(titles); - } - - function parseColumnGroup(column, level) { - - if (typeof titles[level] === "undefined") { - titles[level] = []; - } - - if (typeof groupColumnIndexs[level] === "undefined") { - groupColumnIndexs[level] = []; - } - - if (column.width > 1) { - - groupColumnIndexs[level].push({ - type: "hoz", - start: titles[level].length, - end: titles[level].length + column.width - 1 - }); - } - - titles[level].push(column.title); - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } else { - fields.push(column.definition.field); - padColumnTitles(fields.length - 1, level); - - groupColumnIndexs[level].push({ - type: "vert", - start: fields.length - 1 - }); - } - } - - function padColumnTitles() { - var max = 0; - - titles.forEach(function (title) { - var len = title.length; - if (len > max) { - max = len; - } - }); - - titles.forEach(function (title) { - var len = title.length; - if (len < max) { - for (var i = len; i < max; i++) { - title.push(""); - } - } - }); - } - - if (config.columnGroups) { - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - titles.forEach(function (title) { - rows.push(title); - }); - } else { - parseSimpleTitles(); - } - - function generateMerges() { - var output = []; - - groupRowIndexs.forEach(function (index) { - output.push({ s: { r: index, c: 0 }, e: { r: index, c: fields.length - 1 } }); - }); - - groupColumnIndexs.forEach(function (merges, level) { - merges.forEach(function (merge) { - if (merge.type === "hoz") { - output.push({ s: { r: level, c: merge.start }, e: { r: level, c: merge.end } }); - } else { - if (level != titles.length - 1) { - output.push({ s: { r: level, c: merge.start }, e: { r: titles.length - 1, c: merge.start } }); - } - } - }); - }); - - return output; - } - - //generate each row of the table - function parseRows(data) { - data.forEach(function (row) { - rows.push(parseRow(row)); - }); - } - - function parseRow(row) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - rowData.push(!(value instanceof Date) && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? JSON.stringify(value) : value); - }); - - return rowData; - } - - function addCalcRow(calcs, selector, pos) { - var calcData = calcs[selector]; - - if (calcData) { - if (pos) { - calcData = calcData[pos]; - } - - if (Object.keys(calcData).length) { - calcRowIndexs.push(rows.length); - rows.push(parseRow(calcData)); - } - } - } - - function parseGroup(group, calcObj) { - var groupData = []; - - groupData.push(group.key); - - groupRowIndexs.push(rows.length); - - rows.push(groupData); - - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {}); - }); - } else { - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "top"); - } - - parseRows(group.rows); - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "bottom"); - } - } - } - - if (config.rowGroups) { - data.forEach(function (group) { - parseGroup(group, calcs); - }); - } else { - if (config.columnCalcs) { - addCalcRow(calcs, "top"); - } - - parseRows(data); - - if (config.columnCalcs) { - addCalcRow(calcs, "bottom"); - } - } - - worksheet = rowsToSheet(); - - return worksheet; - } - - if (options.sheetOnly) { - setFileContents(generateSheet()); - return; - } - - if (options.sheets) { - for (var sheet in options.sheets) { - - if (options.sheets[sheet] === true) { - workbook.SheetNames.push(sheet); - workbook.Sheets[sheet] = generateSheet(); - } else { - - workbook.SheetNames.push(sheet); - - this.table.modules.comms.send(options.sheets[sheet], "download", "intercept", { - type: "xlsx", - options: { sheetOnly: true }, - active: self.active, - intercept: function intercept(data) { - workbook.Sheets[sheet] = data; - } - }); - } - } - } else { - workbook.SheetNames.push(sheetName); - workbook.Sheets[sheetName] = generateSheet(); - } - - if (options.documentProcessing) { - workbook = options.documentProcessing(workbook); - } - - //convert workbook to binary array - function s2ab(s) { - var buf = new ArrayBuffer(s.length); - var view = new Uint8Array(buf); - for (var i = 0; i != s.length; ++i) { - view[i] = s.charCodeAt(i) & 0xFF; - }return buf; - } - - output = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'binary' }); - - setFileContents(s2ab(output), "application/octet-stream"); - }, - - html: function html(columns, data, options, setFileContents, config) { - if (this.table.modExists("export", true)) { - setFileContents(this.table.modules.export.getHtml(true, options.style, config), "text/html"); - } - } - -}; - -Tabulator.prototype.registerModule("download", Download); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/download.min.js b/app/static/vendors/tabulator/js.old/modules/download.min.js deleted file mode 100644 index 76357da..0000000 --- a/app/static/vendors/tabulator/js.old/modules/download.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Download=function(o){this.table=o,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={},this.active=!1};Download.prototype.download=function(o,t,n,e,i){function s(n,e){i?!0===i?a.triggerDownload(n,e,o,t,!0):i(n):a.triggerDownload(n,e,o,t)}var a=this,r=!1;this.processConfig(),this.active=e,"function"==typeof o?r=o:a.downloaders[o]?r=a.downloaders[o]:console.warn("Download Error - No such download type found: ",o),this.processColumns(),r&&r.call(this,a.processDefinitions(),a.processData(e||"active"),n||{},s,this.config)},Download.prototype.processConfig=function(){var o={columnGroups:!0,rowGroups:!0,columnCalcs:!0,dataTree:!0};if(this.table.options.downloadConfig)for(var t in this.table.options.downloadConfig)o[t]=this.table.options.downloadConfig[t];this.config.rowGroups=o.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows"),o.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0),o.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0),o.dataTree&&this.table.options.dataTree&&this.table.modExists("dataTree")&&(this.config.dataTree=!0)},Download.prototype.processColumns=function(){var o=this;o.columnsByIndex=[],o.columnsByField={},o.table.columnManager.columnsByIndex.forEach(function(t){t.field&&!1!==t.definition.download&&(t.visible||!t.visible&&t.definition.download)&&(o.columnsByIndex.push(t),o.columnsByField[t.field]=t)})},Download.prototype.processDefinitions=function(){var o=this,t=[];return this.config.columnGroups?o.table.columnManager.columns.forEach(function(n){var e=o.processColumnGroup(n);e&&t.push(e)}):o.columnsByIndex.forEach(function(n){!1!==n.download&&t.push(o.processDefinition(n))}),t},Download.prototype.processColumnGroup=function(o){var t=this,n=o.columns,e=0,i=this.processDefinition(o),s={type:"group",title:i.title,depth:1};if(n.length){if(s.subGroups=[],s.width=0,n.forEach(function(o){var n=t.processColumnGroup(o);n.depth>e&&(e=n.depth),n&&(s.width+=n.width,s.subGroups.push(n))}),s.depth+=e,!s.width)return!1}else{if(!o.field||!1===o.definition.download||!(o.visible||!o.visible&&o.definition.download))return!1;s.width=1,s.definition=i}return s},Download.prototype.processDefinition=function(o){var t={};for(var n in o.definition)t[n]=o.definition[n];return void 0!==o.definition.downloadTitle&&(t.title=o.definition.downloadTitle),t},Download.prototype.processData=function(o){var t=this,n=this,e=[],i=[],s=!1,a={};return this.config.rowGroups?("visible"==o?(s=n.table.rowManager.getRows(o),s.forEach(function(o){if("row"==o.type){var t=o.getGroup();-1===i.indexOf(t)&&i.push(t)}})):i=this.table.modules.groupRows.getGroups(),i.forEach(function(o){e.push(t.processGroupData(o,s))})):(this.config.dataTree&&(o=o="display"),e=n.table.rowManager.getData(o,"download")),this.config.columnCalcs&&(a=this.table.getCalcResults(),e={calcs:a,data:e}),"function"==typeof n.table.options.downloadDataFormatter&&(e=n.table.options.downloadDataFormatter(e)),e},Download.prototype.processGroupData=function(o,t){var n=this,e=o.getSubGroups(),i={type:"group",key:o.key};return e.length?(i.subGroups=[],e.forEach(function(o){i.subGroups.push(n.processGroupData(o,t))})):t?(i.rows=[],o.rows.forEach(function(o){t.indexOf(o)>-1&&i.rows.push(o.getData("download"))})):i.rows=o.getData(!0,"download"),i},Download.prototype.triggerDownload=function(o,t,n,e,i){var s=document.createElement("a"),a=new Blob([o],{type:t}),e=e||"Tabulator."+("function"==typeof n?"txt":n);(a=this.table.options.downloadReady.call(this.table,o,a))&&(i?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,e):(s.setAttribute("href",window.URL.createObjectURL(a)),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},Download.prototype.getFieldValue=function(o,t){var n=this.columnsByField[o];return!!n&&n.getFieldValue(t)},Download.prototype.commsReceived=function(o,t,n){switch(t){case"intercept":this.download(n.type,"",n.options,n.active,n.intercept)}},Download.prototype.downloaders={csv:function(o,t,n,e,i){function s(o,t){o.subGroups?o.subGroups.forEach(function(o){s(o,t+1)}):(f.push('"'+String(o.title).split('"').join('""')+'"'),p.push(o.definition.field))}function a(o){o.forEach(function(o){var t=[];p.forEach(function(n){var e=c.getFieldValue(n,o);switch(void 0===e?"undefined":_typeof(e)){case"object":e=JSON.stringify(e);break;case"undefined":case"null":e="";break;default:e=e}t.push('"'+String(e).split('"').join('""')+'"')}),u.push(t.join(d))})}function r(o){o.subGroups?o.subGroups.forEach(function(o){r(o)}):a(o.rows)}var u,l,c=this,f=[],p=[],d=n&&n.delimiter?n.delimiter:",";i.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),o.forEach(function(o){s(o,0)})):function(){o.forEach(function(o){f.push('"'+String(o.title).split('"').join('""')+'"'),p.push(o.field)})}(),u=[f.join(d)],i.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),i.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),t.forEach(function(o){r(o)})):a(t),l=u.join("\n"),n.bom&&(l="\ufeff"+l),e(l,"text/csv")},json:function(o,t,n,e,i){var s;i.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),s=JSON.stringify(t,null,"\t"),e(s,"application/json")},pdf:function(o,t,n,e,i){function s(o,t){var n=o.width,e=1,i={content:o.title||""};if(o.subGroups?(o.subGroups.forEach(function(o){s(o,t+1)}),e=1):(p.push(o.definition.field),e=m-t),i.rowSpan=e,d[t].push(i),n--,e>1)for(var a=t+1;am&&(m=o.depth)});for(var S=0;S1&&p[t].push({type:"hoz",start:w[t].length,end:w[t].length+o.width-1}),w[t].push(o.title),o.subGroups?o.subGroups.forEach(function(o){n(o,t+1)}):(m.push(o.definition.field),e(m.length),p[t].push({type:"vert",start:m.length-1}))}function e(){var o=0;w.forEach(function(t){var n=t.length;n>o&&(o=n)}),w.forEach(function(t){var n=t.length;if(n bottomEdge) { - this.table.rowManager.element.scrollTop += rowEl.offsetTop + rowEl.offsetHeight - bottomEdge; - } - } - } -}; - -Edit.prototype.edit = function (cell, e, forceEdit) { - var self = this, - allowEdit = true, - rendered = function rendered() {}, - element = cell.getElement(), - cellEditor, - component, - params; - - //prevent editing if another cell is refusing to leave focus (eg. validation fail) - if (this.currentCell) { - if (!this.invalidEdit) { - this.cancelEdit(); - } - return; - } - - //handle successfull value change - function success(value) { - if (self.currentCell === cell) { - var valid = true; - - if (cell.column.modules.validate && self.table.modExists("validate")) { - valid = self.table.modules.validate.validate(cell.column.modules.validate, cell.getComponent(), value); - } - - if (valid === true) { - self.clearEditor(); - cell.setValue(value, true); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - - return true; - } else { - self.invalidEdit = true; - element.classList.add("tabulator-validation-fail"); - self.focusCellNoEvent(cell, true); - rendered(); - self.table.options.validationFailed.call(self.table, cell.getComponent(), value, valid); - - return false; - } - } else { - // console.warn("Edit Success Error - cannot call success on a cell that is no longer being edited"); - } - } - - //handle aborted edit - function cancel() { - if (self.currentCell === cell) { - self.cancelEdit(); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - } else { - // console.warn("Edit Success Error - cannot call cancel on a cell that is no longer being edited"); - } - } - - function onRendered(callback) { - rendered = callback; - } - - if (!cell.column.modules.edit.blocked) { - if (e) { - e.stopPropagation(); - } - - switch (_typeof(cell.column.modules.edit.check)) { - case "function": - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - break; - - case "boolean": - allowEdit = cell.column.modules.edit.check; - break; - } - - if (allowEdit || forceEdit) { - - self.cancelEdit(); - - self.currentCell = cell; - - this.focusScrollAdjust(cell); - - component = cell.getComponent(); - - if (this.mouseClick) { - this.mouseClick = false; - - if (cell.column.cellEvents.cellClick) { - cell.column.cellEvents.cellClick.call(this.table, e, component); - } - } - - if (cell.column.cellEvents.cellEditing) { - cell.column.cellEvents.cellEditing.call(this.table, component); - } - - self.table.options.cellEditing.call(this.table, component); - - params = typeof cell.column.modules.edit.params === "function" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params; - - cellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params); - - //if editor returned, add to DOM, if false, abort edit - if (cellEditor !== false) { - - if (cellEditor instanceof Node) { - element.classList.add("tabulator-editing"); - cell.row.getElement().classList.add("tabulator-row-editing"); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.appendChild(cellEditor); - - //trigger onRendered Callback - rendered(); - - //prevent editing from triggering rowClick event - var children = element.children; - - for (var i = 0; i < children.length; i++) { - children[i].addEventListener("click", function (e) { - e.stopPropagation(); - }); - } - } else { - console.warn("Edit Error - Editor should return an instance of Node, the editor returned:", cellEditor); - element.blur(); - return false; - } - } else { - element.blur(); - return false; - } - - return true; - } else { - this.mouseClick = false; - element.blur(); - return false; - } - } else { - this.mouseClick = false; - element.blur(); - return false; - } -}; - -Edit.prototype.maskInput = function (el, options) { - var mask = options.mask, - maskLetter = typeof options.maskLetterChar !== "undefined" ? options.maskLetterChar : "A", - maskNumber = typeof options.maskNumberChar !== "undefined" ? options.maskNumberChar : "9", - maskWildcard = typeof options.maskWildcardChar !== "undefined" ? options.maskWildcardChar : "*", - success = false; - - function fillSymbols(index) { - var symbol = mask[index]; - if (typeof symbol !== "undefined" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber) { - el.value = el.value + "" + symbol; - fillSymbols(index + 1); - } - } - - el.addEventListener("keydown", function (e) { - var index = el.value.length, - char = e.key; - - if (e.keyCode > 46) { - if (index >= mask.length) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } else { - switch (mask[index]) { - case maskLetter: - if (char.toUpperCase() == char.toLowerCase()) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskNumber: - if (isNaN(char)) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskWildcard: - break; - - default: - if (char !== mask[index]) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - } - } - - success = true; - } - - return; - }); - - el.addEventListener("keyup", function (e) { - if (e.keyCode > 46) { - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - } - }); - - if (!el.placeholder) { - el.placeholder = mask; - } - - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } -}; - -//default data editors -Edit.prototype.editors = { - - //input element - input: function input(cell, onRendered, success, cancel, editorParams) { - - //create and style input - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", editorParams.search ? "search" : "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof cellValue !== "undefined" ? cellValue : ""; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - // case 9: - case 13: - onChange(e); - break; - - case 27: - cancel(); - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //resizable text area element - textarea: function textarea(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "hybrid", - value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""), - count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1, - input = document.createElement("textarea"), - scrollHeight = 0; - - //create and style input - input.style.display = "block"; - input.style.padding = "2px"; - input.style.height = "100%"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.whiteSpace = "pre-wrap"; - input.style.resize = "none"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - - setTimeout(function () { - cell.getRow().normalizeHeight(); - }, 300); - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - input.addEventListener("keyup", function () { - - input.style.height = ""; - - var heightNow = input.scrollHeight; - - input.style.height = heightNow + "px"; - - if (heightNow != scrollHeight) { - scrollHeight = heightNow; - cell.getRow().normalizeHeight(); - } - }); - - input.addEventListener("keydown", function (e) { - - switch (e.keyCode) { - case 27: - cancel(); - break; - - case 38: - //up arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - - break; - - case 40: - //down arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart !== input.value.length) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - number: function number(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - input = document.createElement("input"); - - input.setAttribute("type", "number"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - var blurFunc = function blurFunc(e) { - onChange(); - }; - - onRendered(function () { - //submit new value on blur - input.removeEventListener("blur", blurFunc); - - input.focus({ preventScroll: true }); - input.style.height = "100%"; - - //submit new value on blur - input.addEventListener("blur", blurFunc); - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value !== cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - - case 38: //up arrow - case 40: - //down arrow - if (vertNav == "editor") { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - range: function range(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", "range"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value != cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur - input.addEventListener("blur", function (e) { - onChange(); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - case 9: - onChange(); - break; - - case 27: - cancel(); - break; - } - }); - - return input; - }, - - //select - select: function select(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - dataItems = [], - displayItems = [], - currentItem = {}, - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - if (Array.isArray(editorParams) || !Array.isArray(editorParams) && (typeof editorParams === "undefined" ? "undefined" : _typeof(editorParams)) === "object" && !editorParams.values) { - console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); - editorParams = { values: editorParams }; - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create select lookup list:", field); - } - - return output; - } - - function parseItems(inputValues, curentValue) { - var dataList = []; - var displayList = []; - - function processComplexListItem(item) { - var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label) : item.label, - value: item.value, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - - return item; - } - - if (typeof inputValues == "function") { - inputValues = inputValues(cell); - } - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item; - - if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "object") { - - if (value.options) { - item = { - label: value.label, - group: true, - element: false - }; - - displayList.push(item); - - value.options.forEach(function (item) { - processComplexListItem(item); - }); - } else { - processComplexListItem(value); - } - } else { - - item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, - value: value, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - } - }); - } else { - for (var key in inputValues) { - var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - } - } - - dataItems = dataList; - displayItems = displayList; - - fillList(); - } - - function fillList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - - if (item.group) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-group"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - } else { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - - el.addEventListener("click", function () { - setCurrentItem(item); - chooseItem(); - }); - - if (item === currentItem) { - el.classList.add("active"); - } - } - - el.addEventListener("mousedown", function () { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - } - - listEl.appendChild(el); - }); - } - - function setCurrentItem(item) { - - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - input.value = item.label === " " ? "" : item.label; - - if (item.element) { - item.element.classList.add("active"); - } - } - - function chooseItem() { - hideList(); - - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - success(currentItem.value); - } else { - cancel(); - } - } - - function cancelItem() { - hideList(); - cancel(); - } - - function showList() { - if (!listEl.parentNode) { - - if (editorParams.values === true) { - parseItems(getUniqueColumnValues(), initialDisplayValue); - } else if (typeof editorParams.values === "string") { - parseItems(getUniqueColumnValues(editorParams.values), initialDisplayValue); - } else { - parseItems(editorParams.values || [], initialDisplayValue); - } - - var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - document.body.appendChild(listEl); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //style input - input.setAttribute("type", "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.cursor = "default"; - input.readOnly = this.currentCell != false; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof initialValue !== "undefined" || initialValue === null ? initialValue : ""; - - // if(editorParams.values === true){ - // parseItems(getUniqueColumnValues(), initialValue); - // }else if(typeof editorParams.values === "string"){ - // parseItems(getUniqueColumnValues(editorParams.values), initialValue); - // }else{ - // parseItems(editorParams.values || [], initialValue); - // } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(dataItems[index - 1]); - } - } - break; - - case 40: - //down arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < dataItems.length - 1) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < dataItems.length - 1) { - if (index == -1) { - setCurrentItem(dataItems[0]); - } else { - setCurrentItem(dataItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - } - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - cancelItem(); - } - }); - - input.addEventListener("focus", function (e) { - showList(); - }); - - //style list element - listEl = document.createElement("div"); - listEl.classList.add("tabulator-edit-select-list"); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - return input; - }, - - //autocomplete - autocomplete: function autocomplete(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - allItems = [], - displayItems = [], - values = [], - currentItem = false, - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - //style input - input.setAttribute("type", "search"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style list element - listEl.classList.add("tabulator-edit-select-list"); - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create autocomplete lookup list:", field); - } - - return output; - } - - function filterList(term, intialLoad) { - var matches = [], - values, - items, - searchEl; - - //lookup base values list - if (editorParams.values === true) { - values = getUniqueColumnValues(); - } else if (typeof editorParams.values === "string") { - values = getUniqueColumnValues(editorParams.values); - } else { - values = editorParams.values || []; - } - - if (editorParams.searchFunc) { - matches = editorParams.searchFunc(term, values); - - if (matches instanceof Promise) { - - addNotice(typeof editorParams.searchingPlaceholder !== "undefined" ? editorParams.searchingPlaceholder : "Searching..."); - - matches.then(function (result) { - fillListIfNotEmpty(parseItems(result), intialLoad); - }).catch(function (err) { - console.err("error in autocomplete search promise:", err); - }); - } else { - fillListIfNotEmpty(parseItems(matches), intialLoad); - } - } else { - items = parseItems(values); - - if (term === "") { - if (editorParams.showListOnEmpty) { - matches = items; - } - } else { - items.forEach(function (item) { - if (item.value !== null || typeof item.value !== "undefined") { - if (String(item.value).toLowerCase().indexOf(String(term).toLowerCase()) > -1 || String(item.title).toLowerCase().indexOf(String(term).toLowerCase()) > -1) { - matches.push(item); - } - } - }); - } - - fillListIfNotEmpty(matches, intialLoad); - } - } - - function addNotice(notice) { - var searchEl = document.createElement("div"); - - clearList(); - - if (notice !== false) { - searchEl.classList.add("tabulator-edit-select-list-notice"); - searchEl.tabIndex = 0; - - if (notice instanceof Node) { - searchEl.appendChild(notice); - } else { - searchEl.innerHTML = notice; - } - - listEl.appendChild(searchEl); - } - } - - function parseItems(inputValues) { - var itemList = []; - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, - value: value - }; - - itemList.push(item); - }); - } else { - for (var key in inputValues) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key - }; - - itemList.push(item); - } - } - - return itemList; - } - - function clearList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - } - } - - function fillListIfNotEmpty(items, intialLoad) { - if (items.length) { - fillList(items, intialLoad); - } else { - if (editorParams.emptyPlaceholder) { - addNotice(editorParams.emptyPlaceholder); - } - } - } - - function fillList(items, intialLoad) { - var current = false; - - clearList(); - - displayItems = items; - - displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.title; - - el.addEventListener("click", function (e) { - setCurrentItem(item); - chooseItem(); - }); - - el.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - - if (intialLoad && item.value == initialValue) { - input.value = item.title; - item.element.classList.add("active"); - current = true; - } - - if (item === currentItem) { - item.element.classList.add("active"); - current = true; - } - } - - listEl.appendChild(el); - }); - - if (!current) { - setCurrentItem(false); - } - } - - function chooseItem() { - hideList(); - - if (currentItem) { - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - input.value = currentItem.title; - success(currentItem.value); - } else { - cancel(); - } - } else { - if (editorParams.freetext) { - initialValue = input.value; - success(input.value); - } else { - if (editorParams.allowEmpty && input.value === "") { - initialValue = input.value; - success(input.value); - } else { - cancel(); - } - } - } - } - - function showList() { - if (!listEl.parentNode) { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - document.body.appendChild(listEl); - } - } - - function setCurrentItem(item, showInputValue) { - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - - if (item && item.element) { - item.element.classList.add("active"); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(displayItems[index - 1]); - } else { - setCurrentItem(false); - } - } - break; - - case 40: - //down arrow - - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < displayItems.length - 1) { - - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < displayItems.length - 1) { - if (index == -1) { - setCurrentItem(displayItems[0]); - } else { - setCurrentItem(displayItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - - case 36: //home - case 35: - //end - //prevent table navigation while using input element - e.stopImmediatePropagation(); - break; - } - }); - - input.addEventListener("keyup", function (e) { - - switch (e.keyCode) { - case 38: //up arrow - case 37: //left arrow - case 39: //up arrow - case 40: //right arrow - case 13: //enter - case 27: - //escape - break; - - default: - filterList(input.value); - } - }); - - input.addEventListener("search", function (e) { - filterList(input.value); - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - chooseItem(); - } - }); - - input.addEventListener("focus", function (e) { - var value = initialDisplayValue; - showList(); - input.value = value; - filterList(value, true); - }); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //start rating - star: function star(cell, onRendered, success, cancel, editorParams) { - var self = this, - element = cell.getElement(), - value = cell.getValue(), - maxStars = element.getElementsByTagName("svg").length || 5, - size = element.getElementsByTagName("svg")[0] ? element.getElementsByTagName("svg")[0].getAttribute("width") : 14, - stars = [], - starsHolder = document.createElement("div"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"); - - //change star type - function starChange(val) { - stars.forEach(function (star, i) { - if (i < val) { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-active"); - } else { - star.classList.replace("tabulator-star-inactive", "tabulator-star-active"); - } - - star.innerHTML = ''; - } else { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-inactive"); - } else { - star.classList.replace("tabulator-star-active", "tabulator-star-inactive"); - } - - star.innerHTML = ''; - } - }); - } - - //build stars - function buildStar(i) { - - var starHolder = document.createElement("span"); - var nextStar = star.cloneNode(true); - - stars.push(nextStar); - - starHolder.addEventListener("mouseenter", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - starChange(i); - }); - - starHolder.addEventListener("mousemove", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - }); - - starHolder.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - success(i); - }); - - starHolder.appendChild(nextStar); - starsHolder.appendChild(starHolder); - } - - //handle keyboard navigation value change - function changeValue(val) { - value = val; - starChange(val); - } - - //style cell - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - //style holding element - starsHolder.style.verticalAlign = "middle"; - starsHolder.style.display = "inline-block"; - starsHolder.style.padding = "4px"; - - //style star - star.setAttribute("width", size); - star.setAttribute("height", size); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - starsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - starsHolder.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //create correct number of stars - for (var i = 1; i <= maxStars; i++) { - buildStar(i); - } - - //ensure value does not exceed number of stars - value = Math.min(parseInt(value), maxStars); - - // set initial styling of stars - starChange(value); - - starsHolder.addEventListener("mousemove", function (e) { - starChange(0); - }); - - starsHolder.addEventListener("click", function (e) { - success(0); - }); - - element.addEventListener("blur", function (e) { - cancel(); - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - changeValue(value + 1); - break; - - case 37: - //left arrow - changeValue(value - 1); - break; - - case 13: - //enter - success(value); - break; - - case 27: - //escape - cancel(); - break; - } - }); - - return starsHolder; - }, - - //draggable progress bar - progress: function progress(cell, onRendered, success, cancel, editorParams) { - var element = cell.getElement(), - max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max, - min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min, - percent = (max - min) / 100, - value = cell.getValue() || 0, - handle = document.createElement("div"), - bar = document.createElement("div"), - mouseDrag, - mouseDragWidth; - - //set new value - function updateValue() { - var calcVal = percent * Math.round(bar.offsetWidth / (element.clientWidth / 100)) + min; - success(calcVal); - element.setAttribute("aria-valuenow", calcVal); - element.setAttribute("aria-label", value); - } - - //style handle - handle.style.position = "absolute"; - handle.style.right = "0"; - handle.style.top = "0"; - handle.style.bottom = "0"; - handle.style.width = "5px"; - handle.classList.add("tabulator-progress-handle"); - - //style bar - bar.style.display = "inline-block"; - bar.style.position = "relative"; - // bar.style.top = "8px"; - // bar.style.bottom = "8px"; - // bar.style.left = "4px"; - // bar.style.marginRight = "4px"; - bar.style.height = "100%"; - bar.style.backgroundColor = "#488CE9"; - bar.style.maxWidth = "100%"; - bar.style.minWidth = "0%"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - bar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - bar.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style cell - element.style.padding = "4px 4px"; - - //make sure value is in range - value = Math.min(parseFloat(value), max); - value = Math.max(parseFloat(value), min); - - //workout percentage - value = Math.round((value - min) / percent); - // bar.style.right = value + "%"; - bar.style.width = value + "%"; - - element.setAttribute("aria-valuemin", min); - element.setAttribute("aria-valuemax", max); - - bar.appendChild(handle); - - handle.addEventListener("mousedown", function (e) { - mouseDrag = e.screenX; - mouseDragWidth = bar.offsetWidth; - }); - - handle.addEventListener("mouseover", function () { - handle.style.cursor = "ew-resize"; - }); - - element.addEventListener("mousemove", function (e) { - if (mouseDrag) { - bar.style.width = mouseDragWidth + e.screenX - mouseDrag + "px"; - } - }); - - element.addEventListener("mouseup", function (e) { - if (mouseDrag) { - e.stopPropagation(); - e.stopImmediatePropagation(); - - mouseDrag = false; - mouseDragWidth = false; - - updateValue(); - } - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - e.preventDefault(); - bar.style.width = bar.clientWidth + element.clientWidth / 100 + "px"; - break; - - case 37: - //left arrow - e.preventDefault(); - bar.style.width = bar.clientWidth - element.clientWidth / 100 + "px"; - break; - - case 9: //tab - case 13: - //enter - updateValue(); - break; - - case 27: - //escape - cancel(); - break; - - } - }); - - element.addEventListener("blur", function () { - cancel(); - }); - - return bar; - }, - - //checkbox - tickCross: function tickCross(cell, onRendered, success, cancel, editorParams) { - var value = cell.getValue(), - input = document.createElement("input"), - tristate = editorParams.tristate, - indetermValue = typeof editorParams.indeterminateValue === "undefined" ? null : editorParams.indeterminateValue, - indetermState = false; - - input.setAttribute("type", "checkbox"); - input.style.marginTop = "5px"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - if (tristate && (typeof value === "undefined" || value === indetermValue || value === "")) { - indetermState = true; - input.indeterminate = true; - } - - if (this.table.browser != "firefox") { - //prevent blur issue on mac firefox - onRendered(function () { - input.focus({ preventScroll: true }); - }); - } - - input.checked = value === true || value === "true" || value === "True" || value === 1; - - function setValue(blur) { - if (tristate) { - if (!blur) { - if (input.checked && !indetermState) { - input.checked = false; - input.indeterminate = true; - indetermState = true; - return indetermValue; - } else { - indetermState = false; - return input.checked; - } - } else { - if (indetermState) { - return indetermValue; - } else { - return input.checked; - } - } - } else { - return input.checked; - } - } - - //submit new value on blur - input.addEventListener("change", function (e) { - success(setValue()); - }); - - input.addEventListener("blur", function (e) { - success(setValue(true)); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - if (e.keyCode == 13) { - success(setValue()); - } - if (e.keyCode == 27) { - cancel(); - } - }); - - return input; - } -}; - -Tabulator.prototype.registerModule("edit", Edit); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/edit.min.js b/app/static/vendors/tabulator/js.old/modules/edit.min.js deleted file mode 100644 index 06a11a9..0000000 --- a/app/static/vendors/tabulator/js.old/modules/edit.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(){var e,t=this.currentCell;if(this.invalidEdit=!1,t){for(this.currentCell=!1,e=t.getElement(),e.classList.remove("tabulator-validation-fail"),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);t.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i)}},Edit.prototype.edit=function(e,t,i){function n(t){if(u.currentCell===e){var i=!0;return e.column.modules.validate&&u.table.modExists("validate")&&(i=u.table.modules.validate.validate(e.column.modules.validate,e.getComponent(),t)),!0===i?(u.clearEditor(),e.setValue(t,!0),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e),!0):(u.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),u.focusCellNoEvent(e,!0),c(),u.table.options.validationFailed.call(u.table,e.getComponent(),t,i),!1)}}function a(){u.currentCell===e&&(u.cancelEdit(),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e))}function o(e){c=e}var r,l,s,u=this,d=!0,c=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":d=e.column.modules.edit.check(e.getComponent());break;case"boolean":d=e.column.modules.edit.check}if(d||i){if(u.cancelEdit(),u.currentCell=e,this.focusScrollAdjust(e),l=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,l)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,l),u.table.options.cellEditing.call(this.table,l),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(l):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(u,l,o,n,a,s)))return m.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(r),c();for(var f=m.children,p=0;p46){if(i>=n.length)return t.preventDefault(),t.stopPropagation(),l=!1,!1;switch(n[i]){case a:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case o:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case r:break;default:if(s!==n[i])return t.preventDefault(),t.stopPropagation(),l=!1,!1}l=!0}}),e.addEventListener("keyup",function(n){n.keyCode>46&&t.maskAutoFill&&i(e.value.length)}),e.placeholder||(e.placeholder=n),t.maskAutoFill&&i(e.value.length)},Edit.prototype.editors={input:function(e,t,i,n,a){function o(e){(null===r||void 0===r)&&""!==l.value||l.value!==r?i(l.value)&&(r=l.value):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type",a.search?"search":"text"),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var s in a.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+a.elementAttributes["+"+s])):l.setAttribute(s,a.elementAttributes[s]);return l.value=void 0!==r?r:"",t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("change",o),l.addEventListener("blur",o),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:o(e);break;case 27:n()}}),a.mask&&this.table.modules.edit.maskInput(l,a),l},textarea:function(e,t,i,n,a){function o(t){(null===r||void 0===r)&&""!==u.value||u.value!==r?(i(u.value)&&(r=u.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var r=e.getValue(),l=a.verticalNavigation||"hybrid",s=String(null!==r&&void 0!==r?r:""),u=(s.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),d=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var c in a.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),u.setAttribute(c,u.getAttribute(c)+a.elementAttributes["+"+c])):u.setAttribute(c,a.elementAttributes[c]);return u.value=s,t(function(){u.focus({preventScroll:!0}),u.style.height="100%"}),u.addEventListener("change",o),u.addEventListener("blur",o),u.addEventListener("keyup",function(){u.style.height="";var t=u.scrollHeight;u.style.height=t+"px",t!=d&&(d=t,e.getRow().normalizeHeight())}),u.addEventListener("keydown",function(e){switch(e.keyCode){case 27:n();break;case 38:("editor"==l||"hybrid"==l&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==l||"hybrid"==l&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),a.mask&&this.table.modules.edit.maskInput(u,a),u},number:function(e,t,i,n,a){function o(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!==r?i(e)&&(r=e):n()}var r=e.getValue(),l=a.verticalNavigation||"editor",s=document.createElement("input");if(s.setAttribute("type","number"),void 0!==a.max&&s.setAttribute("max",a.max),void 0!==a.min&&s.setAttribute("min",a.min),void 0!==a.step&&s.setAttribute("step",a.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var u in a.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),s.setAttribute(u,s.getAttribute(u)+a.elementAttributes["+"+u])):s.setAttribute(u,a.elementAttributes[u]);s.value=r;var d=function(e){o()};return t(function(){s.removeEventListener("blur",d),s.focus({preventScroll:!0}),s.style.height="100%",s.addEventListener("blur",d)}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 13:o();break;case 27:n();break;case 38:case 40:"editor"==l&&(e.stopImmediatePropagation(),e.stopPropagation())}}),a.mask&&this.table.modules.edit.maskInput(s,a),s},range:function(e,t,i,n,a){function o(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!=r?i(e)&&(r=e):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type","range"),void 0!==a.max&&l.setAttribute("max",a.max),void 0!==a.min&&l.setAttribute("min",a.min),void 0!==a.step&&l.setAttribute("step",a.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var s in a.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+a.elementAttributes["+"+s])):l.setAttribute(s,a.elementAttributes[s]);return l.value=r,t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("blur",function(e){o()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:o();break;case 27:n()}}),l},select:function(e,t,i,n,a){function o(t){var i,n={},o=p.table.getData();return i=t?p.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),i?(o.forEach(function(e){var t=i.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(n[t]=!0)}),n=a.sortValuesList?"asc"==a.sortValuesList?Object.keys(n).sort():Object.keys(n).sort().reverse():Object.keys(n)):console.warn("unable to find matching column to create select lookup list:",t),n}function r(t,i){function n(e){var e={label:a.listItemFormatter?a.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return e.value!==i&&(isNaN(parseFloat(e.value))||isNaN(parseFloat(e.value))||parseFloat(e.value)!==parseFloat(i))||s(e),o.push(e),r.push(e),e}var o=[],r=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},r.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:a.listItemFormatter?a.listItemFormatter(e,e):e,value:e,element:!1},t.value!==i&&(isNaN(parseFloat(t.value))||isNaN(parseFloat(t.value))||parseFloat(t.value)!==parseFloat(i))||s(t),o.push(t),r.push(t))});else for(var u in t){var d={label:a.listItemFormatter?a.listItemFormatter(u,t[u]):t[u],value:u,element:!1};d.value!==i&&(isNaN(parseFloat(d.value))||isNaN(parseFloat(d.value))||parseFloat(d.value)!==parseFloat(i))||s(d),o.push(d),r.push(d)}k=o,A=r,l()}function l(){for(;E.firstChild;)E.removeChild(E.firstChild);A.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){s(e),u()}),e===C&&t.classList.add("active")),t.addEventListener("mousedown",function(){w=!1,setTimeout(function(){w=!0},10)}),e.element=t),E.appendChild(t)})}function s(e){C&&C.element&&C.element.classList.remove("active"),C=e,y.value=" "===e.label?"":e.label,e.element&&e.element.classList.add("active")}function u(){m(),b!==C.value?(b=C.value,i(C.value)):n()}function d(){m(),n()}function c(){if(!E.parentNode){!0===a.values?r(o(),g):"string"==typeof a.values?r(o(a.values),g):r(a.values||[],g);var e=Tabulator.prototype.helpers.elOffset(v);E.style.minWidth=v.offsetWidth+"px",E.style.top=e.top+v.offsetHeight+"px",E.style.left=e.left+"px",E.addEventListener("mousedown",function(e){w=!1,setTimeout(function(){w=!0},10)}),document.body.appendChild(E)}}function m(){E.parentNode&&E.parentNode.removeChild(E),f()}function f(){p.table.rowManager.element.removeEventListener("scroll",d)}var p=this,v=e.getElement(),b=e.getValue(),h=a.verticalNavigation||"editor",g=void 0!==b||null===b?b:void 0!==a.defaultValue?a.defaultValue:"",y=document.createElement("input"),E=document.createElement("div"),k=[],A=[],C={},w=!0;if(this.table.rowManager.element.addEventListener("scroll",d),(Array.isArray(a)||!Array.isArray(a)&&"object"===(void 0===a?"undefined":_typeof(a))&&!a.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),a={values:a}),y.setAttribute("type","text"),y.style.padding="4px",y.style.width="100%",y.style.boxSizing="border-box",y.style.cursor="default",y.readOnly=0!=this.currentCell,a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var L in a.elementAttributes)"+"==L.charAt(0)?(L=L.slice(1),y.setAttribute(L,y.getAttribute(L)+a.elementAttributes["+"+L])):y.setAttribute(L,a.elementAttributes[L]);return y.value=void 0!==b||null===b?b:"",y.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=k.indexOf(C),("editor"==h||"hybrid"==h&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&s(k[t-1]));break;case 40:t=k.indexOf(C),("editor"==h||"hybrid"==h&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&r.push(t)}),d(r,t))}function l(e){var t=document.createElement("div");u(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,w.appendChild(t))}function s(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var i={title:a.listItemFormatter?a.listItemFormatter(e,e):e,value:e};t.push(i)});else for(var i in e){var n={title:a.listItemFormatter?a.listItemFormatter(i,e[i]):e[i],value:i};t.push(n)}return t}function u(){for(;w.firstChild;)w.removeChild(w.firstChild)}function d(e,t){e.length?c(e,t):a.emptyPlaceholder&&l(a.emptyPlaceholder)}function c(e,t){var i=!1;u(),L=e,L.forEach(function(e){var n=e.element;n||(n=document.createElement("div"),n.classList.add("tabulator-edit-select-list-item"),n.tabIndex=0,n.innerHTML=e.title,n.addEventListener("click",function(t){p(e),m()}),n.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),e.element=n,t&&e.value==E&&(C.value=e.title,e.element.classList.add("active"),i=!0),e===x&&(e.element.classList.add("active"),i=!0)),w.appendChild(n)}),i||p(!1)}function m(){v(),x?E!==x.value?(E=x.value,C.value=x.title,i(x.value)):n():a.freetext?(E=C.value,i(C.value)):a.allowEmpty&&""===C.value?(E=C.value,i(C.value)):n()}function f(){if(!w.parentNode){for(;w.firstChild;)w.removeChild(w.firstChild);var e=Tabulator.prototype.helpers.elOffset(y);w.style.minWidth=y.offsetWidth+"px",w.style.top=e.top+y.offsetHeight+"px",w.style.left=e.left+"px",document.body.appendChild(w)}}function p(e,t){x&&x.element&&x.element.classList.remove("active"),x=e,e&&e.element&&e.element.classList.add("active")}function v(){w.parentNode&&w.parentNode.removeChild(w),h()}function b(){v(),n()}function h(){g.table.rowManager.element.removeEventListener("scroll",b)}var g=this,y=e.getElement(),E=e.getValue(),k=a.verticalNavigation||"editor",A=void 0!==E||null===E?E:void 0!==a.defaultValue?a.defaultValue:"",C=document.createElement("input"),w=document.createElement("div"),L=[],x=!1,N=!0;if(this.table.rowManager.element.addEventListener("scroll",b),C.setAttribute("type","search"),C.style.padding="4px",C.style.width="100%",C.style.boxSizing="border-box",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var P in a.elementAttributes)"+"==P.charAt(0)?(P=P.slice(1),C.setAttribute(P,C.getAttribute(P)+a.elementAttributes["+"+P])):C.setAttribute(P,a.elementAttributes[P]);return w.classList.add("tabulator-edit-select-list"),w.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),C.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=L.indexOf(x),("editor"==k||"hybrid"==k&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),p(t>0?L[t-1]:!1));break;case 40:t=L.indexOf(x),("editor"==k||"hybrid"==k&&t'):("ie"==l.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){u=e,o(e)}var l=this,s=e.getElement(),u=e.getValue(),d=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),f.setAttribute(v,f.getAttribute(v)+a.elementAttributes["+"+v])):f.setAttribute(v,a.elementAttributes[v]);for(var b=1;b<=d;b++)!function(e){var t=document.createElement("span"),n=p.cloneNode(!0);m.push(n),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e)}),t.appendChild(n),f.appendChild(t)}(b);return u=Math.min(parseInt(u),d),o(u),f.addEventListener("mousemove",function(e){o(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(u+1);break;case 37:r(u-1);break;case 13:i(u);break;case 27:n()}}),f},progress:function(e,t,i,n,a){function o(){var e=c*Math.round(p.offsetWidth/(s.clientWidth/100))+d;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var r,l,s=e.getElement(),u=void 0===a.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:a.max,d=void 0===a.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:a.min,c=(u-d)/100,m=e.getValue()||0,f=document.createElement("div"),p=document.createElement("div");if(f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),p.setAttribute(v,p.getAttribute(v)+a.elementAttributes["+"+v])):p.setAttribute(v,a.elementAttributes[v]);return s.style.padding="4px 4px",m=Math.min(parseFloat(m),u),m=Math.max(parseFloat(m),d),m=Math.round((m-d)/c),p.style.width=m+"%",s.setAttribute("aria-valuemin",d),s.setAttribute("aria-valuemax",u),p.appendChild(f),f.addEventListener("mousedown",function(e){r=e.screenX,l=p.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){r&&(p.style.width=l+e.screenX-r+"px")}),s.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,l=!1,o())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+s.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-s.clientWidth/100+"px";break;case 9:case 13:o();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),p},tickCross:function(e,t,i,n,a){function o(e){return s?e?d?u:l.checked:l.checked&&!d?(l.checked=!1,l.indeterminate=!0,d=!0,u):(d=!1,l.checked):l.checked}var r=e.getValue(),l=document.createElement("input"),s=a.tristate,u=void 0===a.indeterminateValue?null:a.indeterminateValue,d=!1;if(l.setAttribute("type","checkbox"),l.style.marginTop="5px",l.style.boxSizing="border-box",a.elementAttributes&&"object"==_typeof(a.elementAttributes))for(var c in a.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+a.elementAttributes["+"+c])):l.setAttribute(c,a.elementAttributes[c]);return l.value=r,!s||void 0!==r&&r!==u&&""!==r||(d=!0,l.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){l.focus({preventScroll:!0})}),l.checked=!0===r||"true"===r||"True"===r||1===r,l.addEventListener("change",function(e){i(o())}),l.addEventListener("blur",function(e){i(o(!0))}),l.addEventListener("keydown",function(e){13==e.keyCode&&i(o()),27==e.keyCode&&n()}),l}},Tabulator.prototype.registerModule("edit",Edit); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/export.js b/app/static/vendors/tabulator/js.old/modules/export.js deleted file mode 100644 index b0184de..0000000 --- a/app/static/vendors/tabulator/js.old/modules/export.js +++ /dev/null @@ -1,471 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Export = function Export(table) { - this.table = table; //hold Tabulator object - this.config = {}; - this.cloneTableStyle = true; - this.colVisProp = ""; -}; - -Export.prototype.genereateTable = function (config, style, range, colVisProp) { - this.cloneTableStyle = style; - this.config = config || {}; - this.colVisProp = colVisProp; - - var table = document.createElement("table"); - table.classList.add("tabulator-print-table"); - - if (this.config.columnHeaders !== false) { - table.appendChild(this.generateHeaderElements()); - } - - table.appendChild(this.generateBodyElements(this.rowLookup(range))); - - this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]); - - return table; -}; - -Export.prototype.rowLookup = function (range) { - var _this = this; - - var rows = []; - - if (typeof range == "function") { - range.call(this.table).forEach(function (row) { - row = _this.table.rowManager.findRow(row); - - if (row) { - rows.push(row); - } - }); - } else { - switch (range) { - case true: - case "visible": - rows = this.table.rowManager.getVisibleRows(true); - break; - - case "all": - rows = this.table.rowManager.rows; - break; - - case "selected": - rows = this.table.modules.selectRow.selectedRows; - break; - - case "active": - default: - rows = this.table.rowManager.getDisplayRows(); - } - } - - return Object.assign([], rows); -}; - -Export.prototype.generateColumnGroupHeaders = function () { - var _this2 = this; - - var output = []; - - var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex; - - columns.forEach(function (column) { - var colData = _this2.processColumnGroup(column); - - if (colData) { - output.push(colData); - } - }); - - return output; -}; - -Export.prototype.processColumnGroup = function (column) { - var _this3 = this; - - var subGroups = column.columns, - maxDepth = 0; - - var groupData = { - title: column.definition.title, - column: column, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this3.processColumnGroup(subGroup); - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (this.columnVisCheck(column)) { - groupData.width = 1; - } else { - return false; - } - } - - return groupData; -}; - -Export.prototype.groupHeadersToRows = function (columns) { - - var headers = [], - headerDepth = 0; - - function parseColumnGroup(column, level) { - - var depth = headerDepth - level; - - if (typeof headers[level] === "undefined") { - headers[level] = []; - } - - column.height = column.subGroups ? 1 : depth - column.depth + 1; - - headers[level].push(column); - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } - } - - //calculate maximum header debth - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - return headers; -}; - -Export.prototype.generateHeaderElements = function () { - var _this4 = this; - - var headerEl = document.createElement("thead"); - - var rows = this.groupHeadersToRows(this.generateColumnGroupHeaders()); - - rows.forEach(function (row) { - var rowEl = document.createElement("tr"); - - _this4.mapElementStyles(_this4.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - - row.forEach(function (column) { - var cellEl = document.createElement("th"); - var classNames = column.column.definition.cssClass ? column.column.definition.cssClass.split(" ") : []; - - cellEl.colSpan = column.width; - cellEl.rowSpan = column.height; - - cellEl.innerHTML = column.column.definition.title; - - if (_this4.cloneTableStyle) { - cellEl.style.boxSizing = "border-box"; - } - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - _this4.mapElementStyles(column.column.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - _this4.mapElementStyles(column.column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - if (column.column.visible) { - _this4.mapElementStyles(column.column.getElement(), cellEl, ["width"]); - } else { - if (column.column.definition.width) { - cellEl.style.width = column.column.definition.width + "px"; - } - } - - if (column.column.parent) { - _this4.mapElementStyles(column.column.parent.groupElement, cellEl, ["border-top"]); - } - - rowEl.appendChild(cellEl); - }); - - headerEl.appendChild(rowEl); - }); - - return headerEl; -}; - -Export.prototype.generateBodyElements = function (rows) {}; - -Export.prototype.generateBodyElements = function (rows) { - var _this5 = this; - - var oddRow, evenRow, calcRow, firstRow, firstCell, firstGroup, lastCell, styleCells, styleRow, treeElementField, rowFormatter; - - //assign row formatter - rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))]; - rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter; - - //lookup row styles - if (this.cloneTableStyle && window.getComputedStyle) { - oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"); - evenRow = this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"); - calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs"); - firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"); - firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0]; - - if (firstRow) { - styleCells = firstRow.getElementsByClassName("tabulator-cell"); - firstCell = styleCells[0]; - lastCell = styleCells[styleCells.length - 1]; - } - } - - var bodyEl = document.createElement("tbody"); - - var columns = []; - - if (this.config.columnCalcs !== false && this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized) { - rows.unshift(this.table.modules.columnCalcs.topRow); - } - - if (this.table.modules.columnCalcs.botInitialized) { - rows.push(this.table.modules.columnCalcs.botRow); - } - } - - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (_this5.columnVisCheck(column)) { - columns.push(column); - } - }); - - if (this.table.options.dataTree && this.config.dataTree !== false && this.table.modExists("columnCalcs")) { - treeElementField = this.table.modules.dataTree.elementField; - } - - rows = rows.filter(function (row) { - switch (row.type) { - case "group": - return _this5.config.rowGroups !== false; - break; - - case "calc": - return _this5.config.columnCalcs !== false; - break; - } - - return true; - }); - - if (rows.length > 1000) { - console.warn("It may take a long time to render an HTML table with more than 1000 rows"); - } - - rows.forEach(function (row, i) { - var rowData = row.getData(_this5.colVisProp); - - var rowEl = document.createElement("tr"); - rowEl.classList.add("tabulator-print-table-row"); - - switch (row.type) { - case "group": - var cellEl = document.createElement("td"); - cellEl.colSpan = columns.length; - cellEl.innerHTML = row.key; - - rowEl.classList.add("tabulator-print-table-group"); - - _this5.mapElementStyles(firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - _this5.mapElementStyles(firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - rowEl.appendChild(cellEl); - break; - - case "calc": - rowEl.classList.add("tabulator-print-table-calcs"); - - case "row": - - if (_this5.table.options.dataTree && _this5.config.dataTree === false && row.modules.dataTree.parent) { - return; - } - - columns.forEach(function (column, i) { - var cellEl = document.createElement("td"); - - var value = column.getFieldValue(rowData); - - var cellWrapper = { - modules: {}, - getValue: function getValue() { - return value; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return cellEl; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getData: function getData() { - return rowData; - }, - getRow: function getRow() { - return row.getComponent(); - }, - getComponent: function getComponent() { - return cellWrapper; - }, - column: column - }; - - var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : []; - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - if (_this5.table.modExists("format") && _this5.config.formatCells !== false) { - value = _this5.table.modules.format.formatExportValue(cellWrapper, _this5.colVisProp); - } else { - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - } - - if (value instanceof Node) { - cellEl.appendChild(value); - } else { - cellEl.innerHTML = value; - } - - if (firstCell) { - _this5.mapElementStyles(firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size"]); - - if (column.definition.align) { - cellEl.style.textAlign = column.definition.align; - } - } - - if (_this5.table.options.dataTree && _this5.config.dataTree !== false) { - if (treeElementField && treeElementField == column.field || !treeElementField && i == 0) { - if (row.modules.dataTree.controlEl) { - cellEl.insertBefore(row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild); - } - if (row.modules.dataTree.branchEl) { - cellEl.insertBefore(row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild); - } - } - } - - rowEl.appendChild(cellEl); - - if (cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback) { - cellWrapper.modules.format.renderedCallback(); - } - }); - - styleRow = row.type == "calc" ? calcRow : i % 2 && evenRow ? evenRow : oddRow; - - _this5.mapElementStyles(styleRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - - if (rowFormatter && _this5.config.formatCells !== false) { - var rowComponent = row.getComponent(); - - rowComponent.getElement = function () { - return rowEl; - }; - - rowFormatter(rowComponent); - } - - break; - } - - bodyEl.appendChild(rowEl); - }); - - return bodyEl; -}; - -Export.prototype.columnVisCheck = function (column) { - return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]); -}; - -Export.prototype.getHtml = function (visible, style, config, colVisProp) { - var holder = document.createElement("div"); - - holder.appendChild(this.genereateTable(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput")); - - return holder.innerHTML; -}; - -Export.prototype.mapElementStyles = function (from, to, props) { - if (this.cloneTableStyle && from && to) { - - var lookup = { - "background-color": "backgroundColor", - "color": "fontColor", - "width": "width", - "font-weight": "fontWeight", - "font-family": "fontFamily", - "font-size": "fontSize", - "text-align": "textAlign", - "border-top": "borderTop", - "border-left": "borderLeft", - "border-right": "borderRight", - "border-bottom": "borderBottom", - "padding-top": "paddingTop", - "padding-left": "paddingLeft", - "padding-right": "paddingRight", - "padding-bottom": "paddingBottom" - }; - - if (window.getComputedStyle) { - var fromStyle = window.getComputedStyle(from); - - props.forEach(function (prop) { - to.style[lookup[prop]] = fromStyle.getPropertyValue(prop); - }); - } - } -}; - -Tabulator.prototype.registerModule("export", Export); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/export.min.js b/app/static/vendors/tabulator/js.old/modules/export.min.js deleted file mode 100644 index 246d149..0000000 --- a/app/static/vendors/tabulator/js.old/modules/export.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Export=function(t){this.table=t,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};Export.prototype.genereateTable=function(t,e,o,n){this.cloneTableStyle=e,this.config=t||{},this.colVisProp=n;var r=document.createElement("table");return r.classList.add("tabulator-print-table"),!1!==this.config.columnHeaders&&r.appendChild(this.generateHeaderElements()),r.appendChild(this.generateBodyElements(this.rowLookup(o))),this.mapElementStyles(this.table.element,r,["border-top","border-left","border-right","border-bottom"]),r},Export.prototype.rowLookup=function(t){var e=this,o=[];if("function"==typeof t)t.call(this.table).forEach(function(t){(t=e.table.rowManager.findRow(t))&&o.push(t)});else switch(t){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},Export.prototype.generateColumnGroupHeaders=function(){var t=this,e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var n=t.processColumnGroup(o);n&&e.push(n)}),e},Export.prototype.processColumnGroup=function(t){var e=this,o=t.columns,n=0,r={title:t.definition.title,column:t,depth:1};if(o.length){if(r.subGroups=[],r.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(r.width+=o.width,r.subGroups.push(o),o.depth>n&&(n=o.depth))}),r.depth+=n,!r.width)return!1}else{if(!this.columnVisCheck(t))return!1;r.width=1}return r},Export.prototype.groupHeadersToRows=function(t){function e(t,r){var l=n-r;void 0===o[r]&&(o[r]=[]),t.height=t.subGroups?1:l-t.depth+1,o[r].push(t),t.subGroups&&t.subGroups.forEach(function(t){e(t,r+1)})}var o=[],n=0;return t.forEach(function(t){t.depth>n&&(n=t.depth)}),t.forEach(function(t){e(t,0)}),o},Export.prototype.generateHeaderElements=function(){var t=this,e=document.createElement("thead");return this.groupHeadersToRows(this.generateColumnGroupHeaders()).forEach(function(o){var n=document.createElement("tr");t.mapElementStyles(t.table.columnManager.getHeadersElement(),e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.forEach(function(e){var o=document.createElement("th"),r=e.column.definition.cssClass?e.column.definition.cssClass.split(" "):[];o.colSpan=e.width,o.rowSpan=e.height,o.innerHTML=e.column.definition.title,t.cloneTableStyle&&(o.style.boxSizing="border-box"),r.forEach(function(t){o.classList.add(t)}),t.mapElementStyles(e.column.getElement(),o,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.mapElementStyles(e.column.contentElement,o,["padding-top","padding-left","padding-right","padding-bottom"]),e.column.visible?t.mapElementStyles(e.column.getElement(),o,["width"]):e.column.definition.width&&(o.style.width=e.column.definition.width+"px"),e.column.parent&&t.mapElementStyles(e.column.parent.groupElement,o,["border-top"]),n.appendChild(o)}),e.appendChild(n)}),e},Export.prototype.generateBodyElements=function(t){},Export.prototype.generateBodyElements=function(t){var e,o,n,r,l,a,i,s,d,c,u=this;c=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],c=null!==c?c:this.table.options.rowFormatter,this.cloneTableStyle&&window.getComputedStyle&&(e=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),o=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),n=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),r=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),a=this.table.element.getElementsByClassName("tabulator-group")[0],r&&(i=r.getElementsByClassName("tabulator-cell"),l=i[0],i[i.length-1]));var p=document.createElement("tbody"),m=[];return!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),this.table.columnManager.columnsByIndex.forEach(function(t){u.columnVisCheck(t)&&m.push(t)}),this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(d=this.table.modules.dataTree.elementField),t=t.filter(function(t){switch(t.type){case"group":return!1!==u.config.rowGroups;case"calc":return!1!==u.config.columnCalcs}return!0}),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach(function(t,r){var i=t.getData(u.colVisProp),f=document.createElement("tr");switch(f.classList.add("tabulator-print-table-row"),t.type){case"group":var h=document.createElement("td");h.colSpan=m.length,h.innerHTML=t.key,f.classList.add("tabulator-print-table-group"),u.mapElementStyles(a,f,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),u.mapElementStyles(a,h,["padding-top","padding-left","padding-right","padding-bottom"]),f.appendChild(h);break;case"calc":f.classList.add("tabulator-print-table-calcs");case"row":if(u.table.options.dataTree&&!1===u.config.dataTree&&t.modules.dataTree.parent)return;if(m.forEach(function(e,o){var n=document.createElement("td"),r=e.getFieldValue(i),a={modules:{},getValue:function(){return r},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getData:function(){return i},getRow:function(){return t.getComponent()},getComponent:function(){return a},column:e};if((e.definition.cssClass?e.definition.cssClass.split(" "):[]).forEach(function(t){n.classList.add(t)}),u.table.modExists("format")&&!1!==u.config.formatCells)r=u.table.modules.format.formatExportValue(a,u.colVisProp);else switch(void 0===r?"undefined":_typeof(r)){case"object":r=JSON.stringify(r);break;case"undefined":case"null":r="";break;default:r=r}r instanceof Node?n.appendChild(r):n.innerHTML=r,l&&(u.mapElementStyles(l,n,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),e.definition.align&&(n.style.textAlign=e.definition.align)),u.table.options.dataTree&&!1!==u.config.dataTree&&(d&&d==e.field||!d&&0==o)&&(t.modules.dataTree.controlEl&&n.insertBefore(t.modules.dataTree.controlEl.cloneNode(!0),n.firstChild),t.modules.dataTree.branchEl&&n.insertBefore(t.modules.dataTree.branchEl.cloneNode(!0),n.firstChild)),f.appendChild(n),a.modules.format&&a.modules.format.renderedCallback&&a.modules.format.renderedCallback()}),s="calc"==t.type?n:r%2&&o?o:e,u.mapElementStyles(s,f,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),c&&!1!==u.config.formatCells){var b=t.getComponent();b.getElement=function(){return f},c(b)}}p.appendChild(f)}),p},Export.prototype.columnVisCheck=function(t){return!1!==t.definition[this.colVisProp]&&(t.visible||!t.visible&&t.definition[this.colVisProp])},Export.prototype.getHtml=function(t,e,o,n){var r=document.createElement("div");return r.appendChild(this.genereateTable(o||this.table.options.htmlOutputConfig,e,t,n||"htmlOutput")),r.innerHTML},Export.prototype.mapElementStyles=function(t,e,o){if(this.cloneTableStyle&&t&&e){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var r=window.getComputedStyle(t);o.forEach(function(t){e.style[n[t]]=r.getPropertyValue(t)})}}},Tabulator.prototype.registerModule("export",Export); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/filter.js b/app/static/vendors/tabulator/js.old/modules/filter.js deleted file mode 100644 index acb5ba5..0000000 --- a/app/static/vendors/tabulator/js.old/modules/filter.js +++ /dev/null @@ -1,766 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Filter = function Filter(table) { - - this.table = table; //hold Tabulator object - - this.filterList = []; //hold filter list - this.headerFilters = {}; //hold column filters - this.headerFilterColumns = []; //hold columns that use header filters - - this.prevHeaderFilterChangeCheck = ""; - this.prevHeaderFilterChangeCheck = "{}"; - - this.changed = false; //has filtering changed since last render -}; - -//initialize column header filter -Filter.prototype.initializeColumn = function (column, value) { - var self = this, - field = column.getField(), - params; - - //handle successfull value change - function success(value) { - var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match", - type = "", - filterChangeCheck = "", - filterFunc; - - if (typeof column.modules.filter.prevSuccess === "undefined" || column.modules.filter.prevSuccess !== value) { - - column.modules.filter.prevSuccess = value; - - if (!column.modules.filter.emptyFunc(value)) { - column.modules.filter.value = value; - - switch (_typeof(column.definition.headerFilterFunc)) { - case "string": - if (self.filters[column.definition.headerFilterFunc]) { - type = column.definition.headerFilterFunc; - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return self.filters[column.definition.headerFilterFunc](value, fieldVal, data, params); - }; - } else { - console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc); - } - break; - - case "function": - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return column.definition.headerFilterFunc(value, fieldVal, data, params); - }; - - type = filterFunc; - break; - } - - if (!filterFunc) { - switch (filterType) { - case "partial": - filterFunc = function filterFunc(data) { - var colVal = column.getFieldValue(data); - - if (typeof colVal !== 'undefined' && colVal !== null) { - return String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1; - } else { - return false; - } - }; - type = "like"; - break; - - default: - filterFunc = function filterFunc(data) { - return column.getFieldValue(data) == value; - }; - type = "="; - } - } - - self.headerFilters[field] = { value: value, func: filterFunc, type: type }; - } else { - delete self.headerFilters[field]; - } - - filterChangeCheck = JSON.stringify(self.headerFilters); - - if (self.prevHeaderFilterChangeCheck !== filterChangeCheck) { - self.prevHeaderFilterChangeCheck = filterChangeCheck; - - self.changed = true; - self.table.rowManager.filterRefresh(); - } - } - - return true; - } - - column.modules.filter = { - success: success, - attrType: false, - tagType: false, - emptyFunc: false - }; - - this.generateHeaderFilterElement(column); -}; - -Filter.prototype.generateHeaderFilterElement = function (column, initialValue, reinitialize) { - var _this = this; - - var self = this, - success = column.modules.filter.success, - field = column.getField(), - filterElement, - editor, - editorElement, - cellWrapper, - typingTimer, - searchTrigger, - params; - - //handle aborted edit - function cancel() {} - - if (column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode) { - column.contentElement.removeChild(column.modules.filter.headerElement.parentNode); - } - - if (field) { - - //set empty value function - column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) { - return !value && value !== "0"; - }; - - filterElement = document.createElement("div"); - filterElement.classList.add("tabulator-header-filter"); - - //set column editor - switch (_typeof(column.definition.headerFilter)) { - case "string": - if (self.table.modules.edit.editors[column.definition.headerFilter]) { - editor = self.table.modules.edit.editors[column.definition.headerFilter]; - - if ((column.definition.headerFilter === "tick" || column.definition.headerFilter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - console.warn("Filter Error - Cannot build header filter, No such editor found: ", column.definition.editor); - } - break; - - case "function": - editor = column.definition.headerFilter; - break; - - case "boolean": - if (column.modules.edit && column.modules.edit.editor) { - editor = column.modules.edit.editor; - } else { - if (column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]) { - editor = self.table.modules.edit.editors[column.definition.formatter]; - - if ((column.definition.formatter === "tick" || column.definition.formatter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - editor = self.table.modules.edit.editors["input"]; - } - } - break; - } - - if (editor) { - - cellWrapper = { - getValue: function getValue() { - return typeof initialValue !== "undefined" ? initialValue : ""; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return filterElement; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getRow: function getRow() { - return { - normalizeHeight: function normalizeHeight() {} - }; - } - }; - - params = column.definition.headerFilterParams || {}; - - params = typeof params === "function" ? params.call(self.table) : params; - - editorElement = editor.call(this.table.modules.edit, cellWrapper, function () {}, success, cancel, params); - - if (!editorElement) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor returned a value of false"); - return; - } - - if (!(editorElement instanceof Node)) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor should return an instance of Node, the editor returned:", editorElement); - return; - } - - //set Placeholder Text - if (field) { - self.table.modules.localize.bind("headerFilters|columns|" + column.definition.field, function (value) { - editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.table.modules.localize.getText("headerFilters|default")); - }); - } else { - self.table.modules.localize.bind("headerFilters|default", function (value) { - editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value); - }); - } - - //focus on element on click - editorElement.addEventListener("click", function (e) { - e.stopPropagation(); - editorElement.focus(); - }); - - editorElement.addEventListener("focus", function (e) { - var left = _this.table.columnManager.element.scrollLeft; - - if (left !== _this.table.rowManager.element.scrollLeft) { - _this.table.rowManager.scrollHorizontal(left); - _this.table.columnManager.scrollHorizontal(left); - } - }); - - //live update filters as user types - typingTimer = false; - - searchTrigger = function searchTrigger(e) { - if (typingTimer) { - clearTimeout(typingTimer); - } - - typingTimer = setTimeout(function () { - success(editorElement.value); - }, self.table.options.headerFilterLiveFilterDelay); - }; - - column.modules.filter.headerElement = editorElement; - column.modules.filter.attrType = editorElement.hasAttribute("type") ? editorElement.getAttribute("type").toLowerCase() : ""; - column.modules.filter.tagType = editorElement.tagName.toLowerCase(); - - if (column.definition.headerFilterLiveFilter !== false) { - - if (!(column.definition.headerFilter === 'autocomplete' || column.definition.headerFilter === 'tickCross' || (column.definition.editor === 'autocomplete' || column.definition.editor === 'tickCross') && column.definition.headerFilter === true)) { - editorElement.addEventListener("keyup", searchTrigger); - editorElement.addEventListener("search", searchTrigger); - - //update number filtered columns on change - if (column.modules.filter.attrType == "number") { - editorElement.addEventListener("change", function (e) { - success(editorElement.value); - }); - } - - //change text inputs to search inputs to allow for clearing of field - if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") { - editorElement.setAttribute("type", "search"); - // editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click - } - } - - //prevent input and select elements from propegating click to column sorters etc - if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") { - editorElement.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - } - } - - filterElement.appendChild(editorElement); - - column.contentElement.appendChild(filterElement); - - if (!reinitialize) { - self.headerFilterColumns.push(column); - } - } - } else { - console.warn("Filter Error - Cannot add header filter, column has no field set:", column.definition.title); - } -}; - -//hide all header filter elements (used to ensure correct column widths in "fitData" layout mode) -Filter.prototype.hideHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = 'none'; - } - }); -}; - -//show all header filter elements (used to ensure correct column widths in "fitData" layout mode) -Filter.prototype.showHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = ''; - } - }); -}; - -//programatically set focus of header filter -Filter.prototype.setHeaderFilterFocus = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.focus(); - } else { - console.warn("Column Filter Focus Error - No header filter set on column:", column.getField()); - } -}; - -//programmatically get value of header filter -Filter.prototype.getHeaderFilterValue = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - return column.modules.filter.headerElement.value; - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } -}; - -//programatically set value of header filter -Filter.prototype.setHeaderFilterValue = function (column, value) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, value, true); - column.modules.filter.success(value); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } -}; - -Filter.prototype.reloadHeaderFilter = function (column) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, column.modules.filter.value, true); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } -}; - -//check if the filters has changed since last use -Filter.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; -}; - -//set standard filters -Filter.prototype.setFilter = function (field, type, value) { - var self = this; - - self.filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - self.addFilter(field); -}; - -//add filter to array -Filter.prototype.addFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - - filter = self.findFilter(filter); - - if (filter) { - self.filterList.push(filter); - - self.changed = true; - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -Filter.prototype.findFilter = function (filter) { - var self = this, - column; - - if (Array.isArray(filter)) { - return this.findSubFilters(filter); - } - - var filterFunc = false; - - if (typeof filter.field == "function") { - filterFunc = function filterFunc(data) { - return filter.field(data, filter.type || {}); // pass params to custom filter function - }; - } else { - - if (self.filters[filter.type]) { - - column = self.table.columnManager.getColumnByField(filter.field); - - if (column) { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, column.getFieldValue(data)); - }; - } else { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, data[filter.field]); - }; - } - } else { - console.warn("Filter Error - No such filter type found, ignoring: ", filter.type); - } - } - - filter.func = filterFunc; - - return filter.func ? filter : false; -}; - -Filter.prototype.findSubFilters = function (filters) { - var self = this, - output = []; - - filters.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - output.push(filter); - } - }); - - return output.length ? output : false; -}; - -//get all filters -Filter.prototype.getFilters = function (all, ajax) { - var output = []; - - if (all) { - output = this.getHeaderFilters(); - } - - if (ajax) { - output.forEach(function (item) { - if (typeof item.type == "function") { - item.type = "function"; - } - }); - } - - output = output.concat(this.filtersToArray(this.filterList, ajax)); - - return output; -}; - -//filter to Object -Filter.prototype.filtersToArray = function (filterList, ajax) { - var _this2 = this; - - var output = []; - - filterList.forEach(function (filter) { - var item; - - if (Array.isArray(filter)) { - output.push(_this2.filtersToArray(filter, ajax)); - } else { - item = { field: filter.field, type: filter.type, value: filter.value }; - - if (ajax) { - if (typeof item.type == "function") { - item.type = "function"; - } - } - - output.push(item); - } - }); - - return output; -}; - -//get all filters -Filter.prototype.getHeaderFilters = function () { - var self = this, - output = []; - - for (var key in this.headerFilters) { - output.push({ field: key, type: this.headerFilters[key].type, value: this.headerFilters[key].value }); - } - - return output; -}; - -//remove filter from array -Filter.prototype.removeFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - var index = -1; - - if (_typeof(filter.field) == "object") { - index = self.filterList.findIndex(function (element) { - return filter === element; - }); - } else { - index = self.filterList.findIndex(function (element) { - return filter.field === element.field && filter.type === element.type && filter.value === element.value; - }); - } - - if (index > -1) { - self.filterList.splice(index, 1); - self.changed = true; - } else { - console.warn("Filter Error - No matching filter type found, ignoring: ", filter.type); - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -//clear filters -Filter.prototype.clearFilter = function (all) { - this.filterList = []; - - if (all) { - this.clearHeaderFilter(); - } - - this.changed = true; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -//clear header filters -Filter.prototype.clearHeaderFilter = function () { - var self = this; - - this.headerFilters = {}; - self.prevHeaderFilterChangeCheck = "{}"; - - this.headerFilterColumns.forEach(function (column) { - column.modules.filter.value = null; - column.modules.filter.prevSuccess = undefined; - self.reloadHeaderFilter(column); - }); - - this.changed = true; -}; - -//search data and return matching rows -Filter.prototype.search = function (searchType, field, type, value) { - var self = this, - activeRows = [], - filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - filterList.push(filter); - } - }); - - this.table.rowManager.rows.forEach(function (row) { - var match = true; - - filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, row.getData())) { - match = false; - } - }); - - if (match) { - activeRows.push(searchType === "data" ? row.getData("data") : row.getComponent()); - } - }); - - return activeRows; -}; - -//filter row array -Filter.prototype.filter = function (rowList, filters) { - var self = this, - activeRows = [], - activeRowComponents = []; - - if (self.table.options.dataFiltering) { - self.table.options.dataFiltering.call(self.table, self.getFilters()); - } - - if (!self.table.options.ajaxFiltering && (self.filterList.length || Object.keys(self.headerFilters).length)) { - - rowList.forEach(function (row) { - if (self.filterRow(row)) { - activeRows.push(row); - } - }); - } else { - activeRows = rowList.slice(0); - } - - if (self.table.options.dataFiltered) { - - activeRows.forEach(function (row) { - activeRowComponents.push(row.getComponent()); - }); - - self.table.options.dataFiltered.call(self.table, self.getFilters(), activeRowComponents); - } - - return activeRows; -}; - -//filter individual row -Filter.prototype.filterRow = function (row, filters) { - var self = this, - match = true, - data = row.getData(); - - self.filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, data)) { - match = false; - } - }); - - for (var field in self.headerFilters) { - if (!self.headerFilters[field].func(data)) { - match = false; - } - } - - return match; -}; - -Filter.prototype.filterRecurse = function (filter, data) { - var self = this, - match = false; - - if (Array.isArray(filter)) { - filter.forEach(function (subFilter) { - if (self.filterRecurse(subFilter, data)) { - match = true; - } - }); - } else { - match = filter.func(data); - } - - return match; -}; - -//list of available filters -Filter.prototype.filters = { - - //equal to - "=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal == filterVal ? true : false; - }, - - //less than - "<": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal < filterVal ? true : false; - }, - - //less than or equal to - "<=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal <= filterVal ? true : false; - }, - - //greater than - ">": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal > filterVal ? true : false; - }, - - //greater than or equal to - ">=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal >= filterVal ? true : false; - }, - - //not equal to - "!=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal != filterVal ? true : false; - }, - - "regex": function regex(filterVal, rowVal, rowData, filterParams) { - - if (typeof filterVal == "string") { - filterVal = new RegExp(filterVal); - } - - return filterVal.test(rowVal); - }, - - //contains the string - "like": function like(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1; - } else { - return false; - } - } - }, - - //in array - "in": function _in(filterVal, rowVal, rowData, filterParams) { - if (Array.isArray(filterVal)) { - return filterVal.indexOf(rowVal) > -1; - } else { - console.warn("Filter Error - filter value is not an array:", filterVal); - return false; - } - } -}; - -Tabulator.prototype.registerModule("filter", Filter); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/filter.min.js b/app/static/vendors/tabulator/js.old/modules/filter.min.js deleted file mode 100644 index ba522dd..0000000 --- a/app/static/vendors/tabulator/js.old/modules/filter.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Filter=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};Filter.prototype.initializeColumn=function(e,t){function r(t){var r,l="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",o="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[n];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":i.filters[e.definition.headerFilterFunc]?(o=e.definition.headerFilterFunc,r=function(r){var n=e.definition.headerFilterFuncParams||{},l=e.getFieldValue(r);return n="function"==typeof n?n(t,l,r):n,i.filters[e.definition.headerFilterFunc](t,l,r,n)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=function(r){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(r);return i="function"==typeof i?i(t,n,r):i,e.definition.headerFilterFunc(t,n,r,i)},o=r}if(!r)switch(l){case"partial":r=function(r){var i=e.getFieldValue(r);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},o="like";break;default:r=function(r){return e.getFieldValue(r)==t},o="="}i.headerFilters[n]={value:t,func:r,type:o}}a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.changed=!0,i.table.rowManager.filterRefresh())}return!0}var i=this,n=e.getField();e.modules.filter={success:r,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},Filter.prototype.generateHeaderFilterElement=function(e,t,r){function i(){}var n,l,o,a,s,d,u,f=this,c=this,h=e.modules.filter.success,p=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),p){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":c.table.modules.edit.editors[e.definition.headerFilter]?(l=c.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":l=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?l=e.modules.edit.editor:e.definition.formatter&&c.table.modules.edit.editors[e.definition.formatter]?(l=c.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):l=c.table.modules.edit.editors.input}if(l){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(c.table):u,!(o=l.call(this.table.modules.edit,a,function(){},h,i,u)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);p?c.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){o.setAttribute("placeholder",void 0!==e&&e?e:c.table.modules.localize.getText("headerFilters|default"))}):c.table.modules.localize.bind("headerFilters|default",function(e){o.setAttribute("placeholder",void 0!==c.column.definition.headerFilterPlaceholder&&c.column.definition.headerFilterPlaceholder?c.column.definition.headerFilterPlaceholder:e)}),o.addEventListener("click",function(e){e.stopPropagation(),o.focus()}),o.addEventListener("focus",function(e){var t=f.table.columnManager.element.scrollLeft;t!==f.table.rowManager.element.scrollLeft&&(f.table.rowManager.scrollHorizontal(t),f.table.columnManager.scrollHorizontal(t))}),s=!1,d=function(e){s&&clearTimeout(s),s=setTimeout(function(){h(o.value)},c.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=o,e.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=o.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(o.addEventListener("keyup",d),o.addEventListener("search",d),"number"==e.modules.filter.attrType&&o.addEventListener("change",function(e){h(o.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||o.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(o),e.contentElement.appendChild(n),r||c.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},Filter.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},Filter.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},Filter.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},Filter.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},Filter.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},Filter.prototype.setFilter=function(e,t,r){var i=this;i.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:r}]),i.addFilter(e)},Filter.prototype.addFilter=function(e,t,r){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:r}]),e.forEach(function(e){(e=i.findFilter(e))&&(i.filterList.push(e),i.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.findFilter=function(e){var t,r=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:r.filters[e.type]?(t=r.table.columnManager.getColumnByField(e.field),i=t?function(i){return r.filters[e.type](e.value,t.getFieldValue(i))}:function(t){return r.filters[e.type](e.value,t[e.field])}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},Filter.prototype.findSubFilters=function(e){var t=this,r=[];return e.forEach(function(e){(e=t.findFilter(e))&&r.push(e)}),!!r.length&&r},Filter.prototype.getFilters=function(e,t){var r=[];return e&&(r=this.getHeaderFilters()),t&&r.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),r=r.concat(this.filtersToArray(this.filterList,t))},Filter.prototype.filtersToArray=function(e,t){var r=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(r.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},Filter.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},Filter.prototype.removeFilter=function(e,t,r){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:r}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.clearFilter=function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},Filter.prototype.search=function(e,t,r,i){var n=this,l=[],o=[];return Array.isArray(t)||(t=[{field:t,type:r,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&o.push(e)}),this.table.rowManager.rows.forEach(function(t){var r=!0;o.forEach(function(e){n.filterRecurse(e,t.getData())||(r=!1)}),r&&l.push("data"===e?t.getData("data"):t.getComponent())}),l},Filter.prototype.filter=function(e,t){var r=this,i=[],n=[];return r.table.options.dataFiltering&&r.table.options.dataFiltering.call(r.table,r.getFilters()),r.table.options.ajaxFiltering||!r.filterList.length&&!Object.keys(r.headerFilters).length?i=e.slice(0):e.forEach(function(e){r.filterRow(e)&&i.push(e)}),r.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),r.table.options.dataFiltered.call(r.table,r.getFilters(),n)),i},Filter.prototype.filterRow=function(e,t){var r=this,i=!0,n=e.getData();r.filterList.forEach(function(e){r.filterRecurse(e,n)||(i=!1)});for(var l in r.headerFilters)r.headerFilters[l].func(n)||(i=!1);return i},Filter.prototype.filterRecurse=function(e,t){var r=this,i=!1;return Array.isArray(e)?e.forEach(function(e){r.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},Filter.prototype.filters={"=":function(e,t,r,i){return t==e},"<":function(e,t,r,i){return t":function(e,t,r,i){return t>e},">=":function(e,t,r,i){return t>=e},"!=":function(e,t,r,i){return t!=e},regex:function(e,t,r,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,r,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},in:function(e,t,r,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},Tabulator.prototype.registerModule("filter",Filter); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/format.js b/app/static/vendors/tabulator/js.old/modules/format.js deleted file mode 100644 index 07247a4..0000000 --- a/app/static/vendors/tabulator/js.old/modules/format.js +++ /dev/null @@ -1,725 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Format = function Format(table) { - this.table = table; //hold Tabulator object -}; - -//initialize column formatter -Format.prototype.initializeColumn = function (column) { - column.modules.format = this.lookupFormatter(column, ""); - - if (typeof column.definition.formatterPrint !== "undefined") { - column.modules.format.print = this.lookupFormatter(column, "Print"); - } - - if (typeof column.definition.formatterClipboard !== "undefined") { - column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard"); - } - - if (typeof column.definition.formatterHtmlOutput !== "undefined") { - column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput"); - } -}; - -Format.prototype.lookupFormatter = function (column, type) { - var config = { params: column.definition["formatter" + type + "Params"] || {} }, - formatter = column.definition["formatter" + type]; - - //set column formatter - switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) { - case "string": - - if (formatter === "tick") { - formatter = "tickCross"; - - if (typeof config.params.crossElement == "undefined") { - config.params.crossElement = false; - } - - console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false"); - } - - if (this.formatters[formatter]) { - config.formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - config.formatter = this.formatters.plaintext; - } - break; - - case "function": - config.formatter = formatter; - break; - - default: - config.formatter = this.formatters.plaintext; - break; - } - - return config; -}; - -Format.prototype.cellRendered = function (cell) { - if (cell.modules.format && cell.modules.format.renderedCallback) { - cell.modules.format.renderedCallback(); - } -}; - -//return a formatted value for a cell -Format.prototype.formatValue = function (cell) { - var component = cell.getComponent(), - params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params; - - function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - } - - return cell.column.modules.format.formatter.call(this, component, params, onRendered); -}; - -Format.prototype.formatExportValue = function (cell, type) { - var formatter = cell.column.modules.format[type], - params; - - if (formatter) { - var onRendered = function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - }; - - params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params; - - return formatter.formatter.call(this, cell.getComponent(), params, onRendered); - } else { - return this.formatValue(cell); - } -}; - -Format.prototype.sanitizeHTML = function (value) { - if (value) { - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - return String(value).replace(/[&<>"'`=\/]/g, function (s) { - return entityMap[s]; - }); - } else { - return value; - } -}; - -Format.prototype.emptyToSpace = function (value) { - return value === null || typeof value === "undefined" || value === "" ? " " : value; -}; - -//get formatter for cell -Format.prototype.getFormatter = function (formatter) { - var formatter; - - switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) { - case "string": - if (this.formatters[formatter]) { - formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - formatter = this.formatters.plaintext; - } - break; - - case "function": - formatter = formatter; - break; - - default: - formatter = this.formatters.plaintext; - break; - } - - return formatter; -}; - -//default data formatters -Format.prototype.formatters = { - //plain text value - plaintext: function plaintext(cell, formatterParams, onRendered) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //html text value - html: function html(cell, formatterParams, onRendered) { - return cell.getValue(); - }, - - //multiline text area - textarea: function textarea(cell, formatterParams, onRendered) { - cell.getElement().style.whiteSpace = "pre-wrap"; - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //currency formatting - money: function money(cell, formatterParams, onRendered) { - var floatVal = parseFloat(cell.getValue()), - number, - integer, - decimal, - rgx; - - var decimalSym = formatterParams.decimal || "."; - var thousandSym = formatterParams.thousand || ","; - var symbol = formatterParams.symbol || ""; - var after = !!formatterParams.symbolAfter; - var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2; - - if (isNaN(floatVal)) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - } - - number = precision !== false ? floatVal.toFixed(precision) : floatVal; - number = String(number).split("."); - - integer = number[0]; - decimal = number.length > 1 ? decimalSym + number[1] : ""; - - rgx = /(\d+)(\d{3})/; - - while (rgx.test(integer)) { - integer = integer.replace(rgx, "$1" + thousandSym + "$2"); - } - - return after ? integer + decimal + symbol : symbol + integer + decimal; - }, - - //clickable anchor tag - link: function link(cell, formatterParams, onRendered) { - var value = cell.getValue(), - urlPrefix = formatterParams.urlPrefix || "", - download = formatterParams.download, - label = value, - el = document.createElement("a"), - data; - - if (formatterParams.labelField) { - data = cell.getData(); - label = data[formatterParams.labelField]; - } - - if (formatterParams.label) { - switch (_typeof(formatterParams.label)) { - case "string": - label = formatterParams.label; - break; - - case "function": - label = formatterParams.label(cell); - break; - } - } - - if (label) { - if (formatterParams.urlField) { - data = cell.getData(); - value = data[formatterParams.urlField]; - } - - if (formatterParams.url) { - switch (_typeof(formatterParams.url)) { - case "string": - value = formatterParams.url; - break; - - case "function": - value = formatterParams.url(cell); - break; - } - } - - el.setAttribute("href", urlPrefix + value); - - if (formatterParams.target) { - el.setAttribute("target", formatterParams.target); - } - - if (formatterParams.download) { - - if (typeof download == "function") { - download = download(cell); - } else { - download = download === true ? "" : download; - } - - el.setAttribute("download", download); - } - - el.innerHTML = this.emptyToSpace(this.sanitizeHTML(label)); - - return el; - } else { - return " "; - } - }, - - //image element - image: function image(cell, formatterParams, onRendered) { - var el = document.createElement("img"); - el.setAttribute("src", cell.getValue()); - - switch (_typeof(formatterParams.height)) { - case "number": - el.style.height = formatterParams.height + "px"; - break; - - case "string": - el.style.height = formatterParams.height; - break; - } - - switch (_typeof(formatterParams.width)) { - case "number": - el.style.width = formatterParams.width + "px"; - break; - - case "string": - el.style.width = formatterParams.width; - break; - } - - el.addEventListener("load", function () { - cell.getRow().normalizeHeight(); - }); - - return el; - }, - - //tick or cross - tickCross: function tickCross(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - empty = formatterParams.allowEmpty, - truthy = formatterParams.allowTruthy, - tick = typeof formatterParams.tickElement !== "undefined" ? formatterParams.tickElement : '', - cross = typeof formatterParams.crossElement !== "undefined" ? formatterParams.crossElement : ''; - - if (truthy && value || value === true || value === "true" || value === "True" || value === 1 || value === "1") { - element.setAttribute("aria-checked", true); - return tick || ""; - } else { - if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) { - element.setAttribute("aria-checked", "mixed"); - return ""; - } else { - element.setAttribute("aria-checked", false); - return cross || ""; - } - } - }, - - datetime: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var outputFormat = formatterParams.outputFormat || "DD/MM/YYYY hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - return newDatetime.format(outputFormat); - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - datetimediff: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var suffix = typeof formatterParams.suffix !== "undefined" ? formatterParams.suffix : false; - var unit = typeof formatterParams.unit !== "undefined" ? formatterParams.unit : undefined; - var humanize = typeof formatterParams.humanize !== "undefined" ? formatterParams.humanize : false; - var date = typeof formatterParams.date !== "undefined" ? formatterParams.date : moment(); - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - if (humanize) { - return moment.duration(newDatetime.diff(date)).humanize(suffix); - } else { - return newDatetime.diff(date, unit) + (suffix ? " " + suffix : ""); - } - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - //select - lookup: function lookup(cell, formatterParams, onRendered) { - var value = cell.getValue(); - - if (typeof formatterParams[value] === "undefined") { - console.warn('Missing display value for ' + value); - return value; - } - - return formatterParams[value]; - }, - - //star rating - star: function star(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - maxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5, - stars = document.createElement("span"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"), - starActive = '', - starInactive = ''; - - //style stars holder - stars.style.verticalAlign = "middle"; - - //style star - star.setAttribute("width", "14"); - star.setAttribute("height", "14"); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - value = value && !isNaN(value) ? parseInt(value) : 0; - - value = Math.max(0, Math.min(value, maxStars)); - - for (var i = 1; i <= maxStars; i++) { - var nextStar = star.cloneNode(true); - nextStar.innerHTML = i <= value ? starActive : starInactive; - - stars.appendChild(nextStar); - } - - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - element.setAttribute("aria-label", value); - - return stars; - }, - - traffic: function traffic(cell, formatterParams, onRendered) { - var value = this.sanitizeHTML(cell.getValue()) || 0, - el = document.createElement("span"), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - colors = formatterParams && typeof formatterParams.color !== "undefined" ? formatterParams.color : ["red", "orange", "green"], - color = "#666666", - percent, - percentValue; - - if (isNaN(value) || typeof cell.getValue() === "undefined") { - return; - } - - el.classList.add("tabulator-traffic-light"); - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set color - switch (typeof colors === "undefined" ? "undefined" : _typeof(colors)) { - case "string": - color = colors; - break; - case "function": - color = colors(value); - break; - case "object": - if (Array.isArray(colors)) { - var unit = 100 / colors.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, colors.length - 1); - index = Math.max(index, 0); - color = colors[index]; - break; - } - } - - el.style.backgroundColor = color; - - return el; - }, - - //progress bar - progress: function progress(cell, formatterParams, onRendered) { - //progress bar - var value = this.sanitizeHTML(cell.getValue()) || 0, - element = cell.getElement(), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center", - percent, - percentValue, - color, - legend, - legendColor, - top, - left, - right, - bottom; - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set bar color - switch (_typeof(formatterParams.color)) { - case "string": - color = formatterParams.color; - break; - case "function": - color = formatterParams.color(value); - break; - case "object": - if (Array.isArray(formatterParams.color)) { - var unit = 100 / formatterParams.color.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.color.length - 1); - index = Math.max(index, 0); - color = formatterParams.color[index]; - break; - } - default: - color = "#2DC214"; - } - - //generate legend - switch (_typeof(formatterParams.legend)) { - case "string": - legend = formatterParams.legend; - break; - case "function": - legend = formatterParams.legend(value); - break; - case "boolean": - legend = value; - break; - default: - legend = false; - } - - //set legend color - switch (_typeof(formatterParams.legendColor)) { - case "string": - legendColor = formatterParams.legendColor; - break; - case "function": - legendColor = formatterParams.legendColor(value); - break; - case "object": - if (Array.isArray(formatterParams.legendColor)) { - var unit = 100 / formatterParams.legendColor.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.legendColor.length - 1); - index = Math.max(index, 0); - legendColor = formatterParams.legendColor[index]; - } - break; - default: - legendColor = "#000"; - } - - element.style.minWidth = "30px"; - element.style.position = "relative"; - - element.setAttribute("aria-label", percentValue); - - var barEl = document.createElement("div"); - barEl.style.display = "inline-block"; - barEl.style.position = "relative"; - barEl.style.width = percentValue + "%"; - barEl.style.backgroundColor = color; - barEl.style.height = "100%"; - - barEl.setAttribute('data-max', max); - barEl.setAttribute('data-min', min); - - if (legend) { - var legendEl = document.createElement("div"); - legendEl.style.position = "absolute"; - legendEl.style.top = "4px"; - legendEl.style.left = 0; - legendEl.style.textAlign = legendAlign; - legendEl.style.width = "100%"; - legendEl.style.color = legendColor; - legendEl.innerHTML = legend; - } - - onRendered(function () { - - //handle custom element needed if formatter is to be included in printed/downloaded output - if (!(cell instanceof CellComponent)) { - var holderEl = document.createElement("div"); - holderEl.style.position = "absolute"; - holderEl.style.top = "4px"; - holderEl.style.bottom = "4px"; - holderEl.style.left = "4px"; - holderEl.style.right = "4px"; - - element.appendChild(holderEl); - - element = holderEl; - } - - element.appendChild(barEl); - - if (legend) { - element.appendChild(legendEl); - } - }); - - return ""; - }, - - //background color - color: function color(cell, formatterParams, onRendered) { - cell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue()); - return ""; - }, - - //tick icon - buttonTick: function buttonTick(cell, formatterParams, onRendered) { - return ''; - }, - - //cross icon - buttonCross: function buttonCross(cell, formatterParams, onRendered) { - return ''; - }, - - //current row number - rownum: function rownum(cell, formatterParams, onRendered) { - return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1; - }, - - //row handle - handle: function handle(cell, formatterParams, onRendered) { - cell.getElement().classList.add("tabulator-row-handle"); - return "
"; - }, - - responsiveCollapse: function responsiveCollapse(cell, formatterParams, onRendered) { - var self = this, - open = false, - el = document.createElement("div"), - config = cell.getRow()._row.modules.responsiveLayout; - - el.classList.add("tabulator-responsive-collapse-toggle"); - el.innerHTML = "+-"; - - cell.getElement().classList.add("tabulator-row-handle"); - - function toggleList(isOpen) { - var collapseEl = config.element; - - config.open = isOpen; - - if (collapseEl) { - - if (config.open) { - el.classList.add("open"); - collapseEl.style.display = ''; - } else { - el.classList.remove("open"); - collapseEl.style.display = 'none'; - } - } - } - - el.addEventListener("click", function (e) { - e.stopImmediatePropagation(); - toggleList(!config.open); - }); - - toggleList(config.open); - - return el; - }, - - rowSelection: function rowSelection(cell) { - var _this = this; - - var checkbox = document.createElement("input"); - - checkbox.type = 'checkbox'; - - if (this.table.modExists("selectRow", true)) { - - checkbox.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - if (typeof cell.getRow == 'function') { - var row = cell.getRow(); - - checkbox.addEventListener("change", function (e) { - row.toggleSelect(); - }); - - checkbox.checked = row.isSelected(); - this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox); - } else { - checkbox.addEventListener("change", function (e) { - if (_this.table.modules.selectRow.selectedRows.length) { - _this.table.deselectRow(); - } else { - _this.table.selectRow(); - } - }); - - this.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox); - } - } - return checkbox; - } -}; - -Tabulator.prototype.registerModule("format", Format); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/format.min.js b/app/static/vendors/tabulator/js.old/modules/format.min.js deleted file mode 100644 index f43eab5..0000000 --- a/app/static/vendors/tabulator/js.old/modules/format.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Format=function(e){this.table=e};Format.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},Format.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},r=e.definition["formatter"+t];switch(void 0===r?"undefined":_typeof(r)){case"string":"tick"===r&&(r="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[r]?o.formatter=this.formatters[r]:(console.warn("Formatter Error - No such formatter found: ",r),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=r;break;default:o.formatter=this.formatters.plaintext}return o},Format.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),r="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,r,t)},Format.prototype.formatExportValue=function(e,t){var o,r=e.column.modules.format[t];if(r){var a=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof r.params?r.params(component):r.params,r.formatter.call(this,e.getComponent(),o,a)}return this.formatValue(e)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var r,a,l,n,i=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(r=!1!==m?i.toFixed(m):i,r=String(r).split("."),a=r[0],l=r.length>1?s+r[1]:"",n=/(\d+)(\d{3})/;n.test(a);)a=a.replace(n,"$1"+c+"$2");return d?a+l+u:u+a+l},link:function(e,t,o){var r,a=e.getValue(),l=t.urlPrefix||"",n=t.download,i=a,s=document.createElement("a");if(t.labelField&&(r=e.getData(),i=r[t.labelField]),t.label)switch(_typeof(t.label)){case"string":i=t.label;break;case"function":i=t.label(e)}if(i){if(t.urlField&&(r=e.getData(),a=r[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return s.setAttribute("href",l+a),t.target&&s.setAttribute("target",t.target),t.download&&(n="function"==typeof n?n(e):!0===n?"":n,s.setAttribute("download",n)),s.innerHTML=this.emptyToSpace(this.sanitizeHTML(i)),s}return" "},image:function(e,t,o){var r=document.createElement("img");switch(r.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":r.style.height=t.height+"px";break;case"string":r.style.height=t.height}switch(_typeof(t.width)){case"number":r.style.width=t.width+"px";break;case"string":r.style.width=t.width}return r.addEventListener("load",function(){e.getRow().normalizeHeight()}),r},tickCross:function(e,t,o){var r=e.getValue(),a=e.getElement(),l=t.allowEmpty,n=t.allowTruthy,i=void 0!==t.tickElement?t.tickElement:'',s=void 0!==t.crossElement?t.crossElement:'';return n&&r||!0===r||"true"===r||"True"===r||1===r||"1"===r?(a.setAttribute("aria-checked",!0),i||""):!l||"null"!==r&&""!==r&&null!==r&&void 0!==r?(a.setAttribute("aria-checked",!1),s||""):(a.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=t.outputFormat||"DD/MM/YYYY hh:mm:ss",l=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",n=e.getValue(),i=moment(n,r);return i.isValid()?i.format(a):!0===l?n:"function"==typeof l?l(n):l},datetimediff:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=void 0!==t.suffix&&t.suffix,n=void 0!==t.unit?t.unit:void 0,i=void 0!==t.humanize&&t.humanize,s=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,r);return u.isValid()?i?moment.duration(u.diff(s)).humanize(l):u.diff(s,n)+(l?" "+l:""):!0===a?c:"function"==typeof a?a(c):a},lookup:function(e,t,o){var r=e.getValue();return void 0===t[r]?(console.warn("Missing display value for "+r),r):t[r]},star:function(e,t,o){var r=e.getValue(),a=e.getElement(),l=t&&t.stars?t.stars:5,n=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.verticalAlign="middle",i.setAttribute("width","14"),i.setAttribute("height","14"),i.setAttribute("viewBox","0 0 512 512"),i.setAttribute("xml:space","preserve"),i.style.padding="0 1px",r=r&&!isNaN(r)?parseInt(r):0,r=Math.max(0,Math.min(r,l));for(var s=1;s<=l;s++){var c=i.cloneNode(!0);c.innerHTML=s<=r?'':'',n.appendChild(c)}return a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.setAttribute("aria-label",r),n},traffic:function(e,t,o){var r,a,l=this.sanitizeHTML(e.getValue())||0,n=document.createElement("span"),i=t&&t.max?t.max:100,s=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(l)&&void 0!==e.getValue()){switch(n.classList.add("tabulator-traffic-light"),a=parseFloat(l)<=i?parseFloat(l):i,a=parseFloat(a)>=s?parseFloat(a):s,r=(i-s)/100,a=Math.round((a-s)/r),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(l);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),m=Math.max(m,0),u=c[m];break}}return n.style.backgroundColor=u,n}},progress:function(e,t,o){var r,a,l,n,i,s=this.sanitizeHTML(e.getValue())||0,c=e.getElement(),u=t&&t.max?t.max:100,d=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(a=parseFloat(s)<=u?parseFloat(s):u,a=parseFloat(a)>=d?parseFloat(a):d,r=(u-d)/100,a=Math.round((a-d)/r),_typeof(t.color)){case"string":l=t.color;break;case"function":l=t.color(s);break;case"object":if(Array.isArray(t.color)){var p=100/t.color.length,f=Math.floor(a/p);f=Math.min(f,t.color.length-1),f=Math.max(f,0),l=t.color[f];break}default:l="#2DC214"}switch(_typeof(t.legend)){case"string":n=t.legend;break;case"function":n=t.legend(s);break;case"boolean":n=s;break;default:n=!1}switch(_typeof(t.legendColor)){case"string":i=t.legendColor;break;case"function":i=t.legendColor(s);break;case"object":if(Array.isArray(t.legendColor)){var p=100/t.legendColor.length,f=Math.floor(a/p);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),i=t.legendColor[f]}break;default:i="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a);var h=document.createElement("div");if(h.style.display="inline-block",h.style.position="relative",h.style.width=a+"%",h.style.backgroundColor=l,h.style.height="100%",h.setAttribute("data-max",u),h.setAttribute("data-min",d),n){var g=document.createElement("div");g.style.position="absolute",g.style.top="4px",g.style.left=0,g.style.textAlign=m,g.style.width="100%",g.style.color=i,g.innerHTML=n}return o(function(){if(!(e instanceof CellComponent)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",c.appendChild(t),c=t}c.appendChild(h),n&&c.appendChild(g)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function r(e){var t=l.element;l.open=e,t&&(l.open?(a.classList.add("open"),t.style.display=""):(a.classList.remove("open"),t.style.display="none"))}var a=document.createElement("div"),l=e.getRow()._row.modules.responsiveLayout;return a.classList.add("tabulator-responsive-collapse-toggle"),a.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),a.addEventListener("click",function(e){e.stopImmediatePropagation(),r(!l.open)}),r(l.open),a},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var r=e.getRow();o.addEventListener("change",function(e){r.toggleSelect()}),o.checked=r.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(r,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Tabulator.prototype.registerModule("format",Format); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/frozen_columns.js b/app/static/vendors/tabulator/js.old/modules/frozen_columns.js deleted file mode 100644 index 9e081d0..0000000 --- a/app/static/vendors/tabulator/js.old/modules/frozen_columns.js +++ /dev/null @@ -1,275 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var FrozenColumns = function FrozenColumns(table) { - this.table = table; //hold Tabulator object - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightPadding = 0; - this.initializationMode = "left"; - this.active = false; - this.scrollEndTimer = false; -}; - -//reset initial state -FrozenColumns.prototype.reset = function () { - this.initializationMode = "left"; - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightMargin = 0; - this.active = false; - - this.table.columnManager.headersElement.style.marginLeft = 0; - this.table.columnManager.element.style.paddingRight = 0; -}; - -//initialize specific column -FrozenColumns.prototype.initializeColumn = function (column) { - var config = { margin: 0, edge: false }; - - if (!column.isGroup) { - - if (this.frozenCheck(column)) { - - config.position = this.initializationMode; - - if (this.initializationMode == "left") { - this.leftColumns.push(column); - } else { - this.rightColumns.unshift(column); - } - - this.active = true; - - column.modules.frozen = config; - } else { - this.initializationMode = "right"; - } - } -}; - -FrozenColumns.prototype.frozenCheck = function (column) { - var frozen = false; - - if (column.parent.isGroup && column.definition.frozen) { - console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"); - } - - if (column.parent.isGroup) { - return this.frozenCheck(column.parent); - } else { - return column.definition.frozen; - } - - return frozen; -}; - -//quick layout to smooth horizontal scrolling -FrozenColumns.prototype.scrollHorizontal = function () { - var _this = this; - - var rows; - - if (this.active) { - clearTimeout(this.scrollEndTimer); - - //layout all rows after scroll is complete - this.scrollEndTimer = setTimeout(function () { - _this.layout(); - }, 100); - - rows = this.table.rowManager.getVisibleRows(); - - this.calcMargins(); - - this.layoutColumnPosition(); - - this.layoutCalcRows(); - - rows.forEach(function (row) { - if (row.type === "row") { - _this.layoutRow(row); - } - }); - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } -}; - -//calculate margins for rows -FrozenColumns.prototype.calcMargins = function () { - this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px"; - this.table.columnManager.headersElement.style.marginLeft = this.leftMargin; - - this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px"; - this.table.columnManager.element.style.paddingRight = this.rightMargin; - - //calculate right frozen columns - this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft; -}; - -//layout calculation rows -FrozenColumns.prototype.layoutCalcRows = function () { - if (this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow) { - this.layoutRow(this.table.modules.columnCalcs.topRow); - } - if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) { - this.layoutRow(this.table.modules.columnCalcs.botRow); - } - } -}; - -//calculate column positions and layout headers -FrozenColumns.prototype.layoutColumnPosition = function (allCells) { - var _this2 = this; - - var leftParents = []; - - this.leftColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this2._calcSpace(_this2.leftColumns, i) + _this2.table.columnManager.scrollLeft + "px"; - - if (i == _this2.leftColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - var parentEl = _this2.getColGroupParentElement(column); - if (!leftParents.includes(parentEl)) { - _this2.layoutElement(parentEl, column); - leftParents.push(parentEl); - } - - if (column.modules.frozen.edge) { - parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } else { - _this2.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this2.layoutElement(cell.getElement(), column); - }); - } - }); - - this.rightColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this2.rightPadding - _this2._calcSpace(_this2.rightColumns, i + 1) + "px"; - - if (i == _this2.rightColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - _this2.layoutElement(_this2.getColGroupParentElement(column), column); - } else { - _this2.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this2.layoutElement(cell.getElement(), column); - }); - } - }); -}; - -FrozenColumns.prototype.getColGroupParentElement = function (column) { - return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement(); -}; - -//layout columns appropropriatly -FrozenColumns.prototype.layout = function () { - var self = this, - rightMargin = 0; - - if (self.active) { - - //calculate row padding - this.calcMargins(); - - // self.table.rowManager.activeRows.forEach(function(row){ - // self.layoutRow(row); - // }); - - // if(self.table.options.dataTree){ - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row") { - self.layoutRow(row); - } - }); - // } - - this.layoutCalcRows(); - - //calculate left columns - this.layoutColumnPosition(true); - - // if(tableHolder.scrollHeight > tableHolder.clientHeight){ - // rightMargin -= tableHolder.offsetWidth - tableHolder.clientWidth; - // } - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } -}; - -FrozenColumns.prototype.layoutRow = function (row) { - var _this3 = this; - - var rowEl = row.getElement(); - - rowEl.style.paddingLeft = this.leftMargin; - // rowEl.style.paddingRight = this.rightMargin + "px"; - - this.leftColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this3.layoutElement(cell.getElement(), column); - } - }); - - this.rightColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this3.layoutElement(cell.getElement(), column); - } - }); -}; - -FrozenColumns.prototype.layoutElement = function (element, column) { - - if (column.modules.frozen) { - element.style.position = "absolute"; - element.style.left = column.modules.frozen.margin; - - element.classList.add("tabulator-frozen"); - - if (column.modules.frozen.edge) { - element.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } -}; - -FrozenColumns.prototype._calcSpace = function (columns, index) { - var width = 0; - - for (var i = 0; i < index; i++) { - if (columns[i].visible) { - width += columns[i].getWidth(); - } - } - - return width; -}; - -Tabulator.prototype.registerModule("frozenColumns", FrozenColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/frozen_columns.min.js b/app/static/vendors/tabulator/js.old/modules/frozen_columns.min.js deleted file mode 100644 index 9195faa..0000000 --- a/app/static/vendors/tabulator/js.old/modules/frozen_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var FrozenColumns=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};FrozenColumns.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0},FrozenColumns.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")},FrozenColumns.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen},FrozenColumns.prototype.scrollHorizontal=function(){var t,e=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){e.layout()},100),t=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),t.forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},FrozenColumns.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))},FrozenColumns.prototype.layoutColumnPosition=function(t){var e=this,o=[];this.leftColumns.forEach(function(n,l){if(n.modules.frozen.margin=e._calcSpace(e.leftColumns,l)+e.table.columnManager.scrollLeft+"px",l==e.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var i=e.getColGroupParentElement(n);o.includes(i)||(e.layoutElement(i,n),o.push(i)),n.modules.frozen.edge&&i.classList.add("tabulator-frozen-"+n.modules.frozen.position)}else e.layoutElement(n.getElement(),n);t&&n.cells.forEach(function(t){e.layoutElement(t.getElement(),n)})}),this.rightColumns.forEach(function(o,n){o.modules.frozen.margin=e.rightPadding-e._calcSpace(e.rightColumns,n+1)+"px",n==e.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?e.layoutElement(e.getColGroupParentElement(o),o):e.layoutElement(o.getElement(),o),t&&o.cells.forEach(function(t){e.layoutElement(t.getElement(),o)})})},FrozenColumns.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()},FrozenColumns.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.layoutRow=function(t){var e=this;t.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)}),this.rightColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)})},FrozenColumns.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},FrozenColumns.prototype._calcSpace=function(t,e){for(var o=0,n=0;n -1) { - output.splice(index, 1); - } - }); - - return output; -}; - -FrozenRows.prototype.freezeRow = function (row) { - if (!row.modules.frozen) { - row.modules.frozen = true; - this.topElement.appendChild(row.getElement()); - row.initialize(); - row.normalizeHeight(); - this.table.rowManager.adjustTableSize(); - - this.rows.push(row); - - this.table.rowManager.refreshActiveData("display"); - - this.styleRows(); - } else { - console.warn("Freeze Error - Row is already frozen"); - } -}; - -FrozenRows.prototype.unfreezeRow = function (row) { - var index = this.rows.indexOf(row); - - if (row.modules.frozen) { - - row.modules.frozen = false; - - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.table.rowManager.adjustTableSize(); - - this.rows.splice(index, 1); - - this.table.rowManager.refreshActiveData("display"); - - if (this.rows.length) { - this.styleRows(); - } - } else { - console.warn("Freeze Error - Row is already unfrozen"); - } -}; - -FrozenRows.prototype.styleRows = function (row) { - var self = this; - - this.rows.forEach(function (row, i) { - self.table.rowManager.styleRow(row, i); - }); -}; - -Tabulator.prototype.registerModule("frozenRows", FrozenRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/frozen_rows.min.js b/app/static/vendors/tabulator/js.old/modules/frozen_rows.min.js deleted file mode 100644 index 2c61d7b..0000000 --- a/app/static/vendors/tabulator/js.old/modules/frozen_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var FrozenRows=function(e){this.table=e,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};FrozenRows.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)},FrozenRows.prototype.setDisplayIndex=function(e){this.displayIndex=e},FrozenRows.prototype.getDisplayIndex=function(){return this.displayIndex},FrozenRows.prototype.isFrozen=function(){return!!this.rows.length},FrozenRows.prototype.getRows=function(e){var o=e.slice(0);return this.rows.forEach(function(e){var t=o.indexOf(e);t>-1&&o.splice(t,1)}),o},FrozenRows.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},FrozenRows.prototype.unfreezeRow=function(e){var o=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var t=e.getElement();t.parentNode.removeChild(t),this.table.rowManager.adjustTableSize(),this.rows.splice(o,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},FrozenRows.prototype.styleRows=function(e){var o=this;this.rows.forEach(function(e,t){o.table.rowManager.styleRow(e,t)})},Tabulator.prototype.registerModule("frozenRows",FrozenRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/group_rows.js b/app/static/vendors/tabulator/js.old/modules/group_rows.js deleted file mode 100644 index d5ad938..0000000 --- a/app/static/vendors/tabulator/js.old/modules/group_rows.js +++ /dev/null @@ -1,1072 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -//public group object -var GroupComponent = function GroupComponent(group) { - this._group = group; - this.type = "GroupComponent"; -}; - -GroupComponent.prototype.getKey = function () { - return this._group.key; -}; - -GroupComponent.prototype.getField = function () { - return this._group.field; -}; - -GroupComponent.prototype.getElement = function () { - return this._group.element; -}; - -GroupComponent.prototype.getRows = function () { - return this._group.getRows(true); -}; - -GroupComponent.prototype.getSubGroups = function () { - return this._group.getSubGroups(true); -}; - -GroupComponent.prototype.getParentGroup = function () { - return this._group.parent ? this._group.parent.getComponent() : false; -}; - -GroupComponent.prototype.getVisibility = function () { - return this._group.visible; -}; - -GroupComponent.prototype.show = function () { - this._group.show(); -}; - -GroupComponent.prototype.hide = function () { - this._group.hide(); -}; - -GroupComponent.prototype.toggle = function () { - this._group.toggleVisibility(); -}; - -GroupComponent.prototype._getSelf = function () { - return this._group; -}; - -GroupComponent.prototype.getTable = function () { - return this._group.groupManager.table; -}; - -////////////////////////////////////////////////// -//////////////// Group Functions ///////////////// -////////////////////////////////////////////////// - -var Group = function Group(groupManager, parent, level, key, field, generator, oldGroup) { - - this.groupManager = groupManager; - this.parent = parent; - this.key = key; - this.level = level; - this.field = field; - this.hasSubGroups = level < groupManager.groupIDLookups.length - 1; - this.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow; - this.type = "group"; //type of element - this.old = oldGroup; - this.rows = []; - this.groups = []; - this.groupList = []; - this.generator = generator; - this.elementContents = false; - this.height = 0; - this.outerHeight = 0; - this.initialized = false; - this.calcs = {}; - this.initialized = false; - this.modules = {}; - this.arrowElement = false; - - this.visible = oldGroup ? oldGroup.visible : typeof groupManager.startOpen[level] !== "undefined" ? groupManager.startOpen[level] : groupManager.startOpen[0]; - - this.createElements(); - this.addBindings(); - - this.createValueGroups(); -}; - -Group.prototype.wipe = function () { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - group.wipe(); - }); - } else { - this.element = false; - this.arrowElement = false; - this.elementContents = false; - } -}; - -Group.prototype.createElements = function () { - var arrow = document.createElement("div"); - arrow.classList.add("tabulator-arrow"); - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-row"); - this.element.classList.add("tabulator-group"); - this.element.classList.add("tabulator-group-level-" + this.level); - this.element.setAttribute("role", "rowgroup"); - - this.arrowElement = document.createElement("div"); - this.arrowElement.classList.add("tabulator-group-toggle"); - this.arrowElement.appendChild(arrow); - - //setup movable rows - if (this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists("moveRow")) { - this.groupManager.table.modules.moveRow.initializeGroupHeader(this); - } -}; - -Group.prototype.createValueGroups = function () { - var _this = this; - - var level = this.level + 1; - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - this.groupManager.allowedValues[level].forEach(function (value) { - _this._createGroup(value, level); - }); - } -}; - -Group.prototype.addBindings = function () { - var self = this, - dblTap, - tapHold, - tap, - toggleElement; - - //handle group click events - if (self.groupManager.table.options.groupClick) { - self.element.addEventListener("click", function (e) { - self.groupManager.table.options.groupClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.groupManager.table.options.groupDblClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContext) { - self.element.addEventListener("contextmenu", function (e) { - self.groupManager.table.options.groupContext.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.groupManager.table.options.groupTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.groupManager.table.options.groupDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.groupManager.table.options.groupDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.groupManager.table.options.groupTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.groupManager.table.options.groupTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - if (self.groupManager.table.options.groupToggleElement) { - toggleElement = self.groupManager.table.options.groupToggleElement == "arrow" ? self.arrowElement : self.element; - - toggleElement.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - self.toggleVisibility(); - }); - } -}; - -Group.prototype._createGroup = function (groupID, level) { - var groupKey = level + "_" + groupID; - var group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false); - - this.groups[groupKey] = group; - this.groupList.push(group); -}; - -Group.prototype._addRowToGroup = function (row) { - - var level = this.level + 1; - - if (this.hasSubGroups) { - var groupID = this.groupManager.groupIDLookups[level].func(row.getData()), - groupKey = level + "_" + groupID; - - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - } else { - if (!this.groups[groupKey]) { - this._createGroup(groupID, level); - } - - this.groups[groupKey].addRow(row); - } - } -}; - -Group.prototype._addRow = function (row) { - this.rows.push(row); - row.modules.group = this; -}; - -Group.prototype.insertRow = function (row, to, after) { - var data = this.conformRowData({}); - - row.updateData(data); - - var toIndex = this.rows.indexOf(to); - - if (toIndex > -1) { - if (after) { - this.rows.splice(toIndex + 1, 0, row); - } else { - this.rows.splice(toIndex, 0, row); - } - } else { - if (after) { - this.rows.push(row); - } else { - this.rows.unshift(row); - } - } - - row.modules.group = this; - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - - this.groupManager.updateGroupRows(true); -}; - -Group.prototype.scrollHeader = function (left) { - this.arrowElement.style.marginLeft = left; - - this.groupList.forEach(function (child) { - child.scrollHeader(left); - }); -}; - -Group.prototype.getRowIndex = function (row) {}; - -//update row data to match grouping contraints -Group.prototype.conformRowData = function (data) { - if (this.field) { - data[this.field] = this.key; - } else { - console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"); - } - - if (this.parent) { - data = this.parent.conformRowData(data); - } - - return data; -}; - -Group.prototype.removeRow = function (row) { - var index = this.rows.indexOf(row); - var el = row.getElement(); - - if (index > -1) { - this.rows.splice(index, 1); - } - - if (!this.groupManager.table.options.groupValues && !this.rows.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - - this.groupManager.updateGroupRows(true); - } else { - - if (el.parentNode) { - el.parentNode.removeChild(el); - } - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - } -}; - -Group.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - - if (!this.groupList.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - } - } -}; - -Group.prototype.getHeadersAndRows = function (noCalc) { - var output = []; - - output.push(this); - - this._visSet(); - - if (this.visible) { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows(noCalc)); - }); - } else { - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - - output = output.concat(this.rows); - - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } else { - if (!this.groupList.length && this.groupManager.table.options.columnCalcs != "table") { - - if (this.groupManager.table.modExists("columnCalcs")) { - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - } - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } - } - } - - return output; -}; - -Group.prototype.getData = function (visible, transform) { - var self = this, - output = []; - - this._visSet(); - - if (!visible || visible && this.visible) { - this.rows.forEach(function (row) { - output.push(row.getData(transform || "data")); - }); - } - - return output; -}; - -// Group.prototype.getRows = function(){ -// this._visSet(); - -// return this.visible ? this.rows : []; -// }; - -Group.prototype.getRowCount = function () { - var count = 0; - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - count += group.getRowCount(); - }); - } else { - count = this.rows.length; - } - return count; -}; - -Group.prototype.toggleVisibility = function () { - if (this.visible) { - this.hide(); - } else { - this.show(); - } -}; - -Group.prototype.hide = function () { - this.visible = false; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.remove("tabulator-group-visible"); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - row.detachElement(); - }); - }); - } else { - this.rows.forEach(function (row) { - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), false); -}; - -Group.prototype.show = function () { - var self = this; - - self.visible = true; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.add("tabulator-group-visible"); - - var prev = self.getElement(); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - }); - } else { - self.rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), true); -}; - -Group.prototype._visSet = function () { - var data = []; - - if (typeof this.visible == "function") { - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent()); - } -}; - -Group.prototype.getRowGroup = function (row) { - var match = false; - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - } else { - if (this.rows.find(function (item) { - return item === row; - })) { - match = this; - } - } - - return match; -}; - -Group.prototype.getSubGroups = function (component) { - var output = []; - - this.groupList.forEach(function (child) { - output.push(component ? child.getComponent() : child); - }); - - return output; -}; - -Group.prototype.getRows = function (compoment) { - var output = []; - - this.rows.forEach(function (row) { - output.push(compoment ? row.getComponent() : row); - }); - - return output; -}; - -Group.prototype.generateGroupHeaderContents = function () { - var data = []; - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent()); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }if (typeof this.elementContents === "string") { - this.element.innerHTML = this.elementContents; - } else { - this.element.appendChild(this.elementContents); - } - - this.element.insertBefore(this.arrowElement, this.element.firstChild); -}; - -////////////// Standard Row Functions ////////////// - -Group.prototype.getElement = function () { - this.addBindingsd = false; - - this._visSet(); - - if (this.visible) { - this.element.classList.add("tabulator-group-visible"); - } else { - this.element.classList.remove("tabulator-group-visible"); - } - - for (var i = 0; i < this.element.childNodes.length; ++i) { - this.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]); - } - - this.generateGroupHeaderContents(); - - // this.addBindings(); - - return this.element; -}; - -Group.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -//normalize the height of elements in the row -Group.prototype.normalizeHeight = function () { - this.setHeight(this.element.clientHeight); -}; - -Group.prototype.initialize = function (force) { - if (!this.initialized || force) { - this.normalizeHeight(); - this.initialized = true; - } -}; - -Group.prototype.reinitialize = function () { - this.initialized = false; - this.height = 0; - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - this.initialize(true); - } -}; - -Group.prototype.setHeight = function (height) { - if (this.height != height) { - this.height = height; - this.outerHeight = this.element.offsetHeight; - } -}; - -//return rows outer height -Group.prototype.getHeight = function () { - return this.outerHeight; -}; - -Group.prototype.getGroup = function () { - return this; -}; - -Group.prototype.reinitializeHeight = function () {}; -Group.prototype.calcHeight = function () {}; -Group.prototype.setCellHeight = function () {}; -Group.prototype.clearCellHeight = function () {}; - -//////////////// Object Generation ///////////////// -Group.prototype.getComponent = function () { - return new GroupComponent(this); -}; - -////////////////////////////////////////////////// -////////////// Group Row Extension /////////////// -////////////////////////////////////////////////// - -var GroupRows = function GroupRows(table) { - - this.table = table; //hold Tabulator object - - this.groupIDLookups = false; //enable table grouping and set field to group by - this.startOpen = [function () { - return false; - }]; //starting state of group - this.headerGenerator = [function () { - return ""; - }]; - this.groupList = []; //ordered list of groups - this.allowedValues = false; - this.groups = {}; //hold row groups - this.displayIndex = 0; //index in display pipeline -}; - -//initialize group configuration -GroupRows.prototype.initialize = function () { - var self = this, - groupBy = self.table.options.groupBy, - startOpen = self.table.options.groupStartOpen, - groupHeader = self.table.options.groupHeader; - - this.allowedValues = self.table.options.groupValues; - - if (Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length) { - console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"); - } - - self.headerGenerator = [function () { - return ""; - }]; - this.startOpen = [function () { - return false; - }]; //starting state of group - - self.table.modules.localize.bind("groups|item", function (langValue, lang) { - self.headerGenerator[0] = function (value, count, data) { - //header layout function - return (typeof value === "undefined" ? "" : value) + "(" + count + " " + (count === 1 ? langValue : lang.groups.items) + ")"; - }; - }); - - this.groupIDLookups = []; - - if (Array.isArray(groupBy) || groupBy) { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both") { - this.table.modules.columnCalcs.removeCalcs(); - } - } else { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group") { - - var cols = this.table.columnManager.getRealColumns(); - - cols.forEach(function (col) { - if (col.definition.topCalc) { - self.table.modules.columnCalcs.initializeTopRow(); - } - - if (col.definition.bottomCalc) { - self.table.modules.columnCalcs.initializeBottomRow(); - } - }); - } - } - - if (!Array.isArray(groupBy)) { - groupBy = [groupBy]; - } - - groupBy.forEach(function (group, i) { - var lookupFunc, column; - - if (typeof group == "function") { - lookupFunc = group; - } else { - column = self.table.columnManager.getColumnByField(group); - - if (column) { - lookupFunc = function lookupFunc(data) { - return column.getFieldValue(data); - }; - } else { - lookupFunc = function lookupFunc(data) { - return data[group]; - }; - } - } - - self.groupIDLookups.push({ - field: typeof group === "function" ? false : group, - func: lookupFunc, - values: self.allowedValues ? self.allowedValues[i] : false - }); - }); - - if (startOpen) { - - if (!Array.isArray(startOpen)) { - startOpen = [startOpen]; - } - - startOpen.forEach(function (level) { - level = typeof level == "function" ? level : function () { - return true; - }; - }); - - self.startOpen = startOpen; - } - - if (groupHeader) { - self.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader]; - } - - this.initialized = true; -}; - -GroupRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; -}; - -GroupRows.prototype.getDisplayIndex = function () { - return this.displayIndex; -}; - -//return appropriate rows with group headers -GroupRows.prototype.getRows = function (rows) { - if (this.groupIDLookups.length) { - - this.table.options.dataGrouping.call(this.table); - - this.generateGroups(rows); - - if (this.table.options.dataGrouped) { - this.table.options.dataGrouped.call(this.table, this.getGroups(true)); - } - - return this.updateGroupRows(); - } else { - return rows.slice(0); - } -}; - -GroupRows.prototype.getGroups = function (compoment) { - var groupComponents = []; - - this.groupList.forEach(function (group) { - groupComponents.push(compoment ? group.getComponent() : group); - }); - - return groupComponents; -}; - -GroupRows.prototype.getChildGroups = function (group) { - var _this2 = this; - - var groupComponents = []; - - if (!group) { - group = this; - } - - group.groupList.forEach(function (child) { - if (child.groupList.length) { - groupComponents = groupComponents.concat(_this2.getChildGroups(child)); - } else { - groupComponents.push(child); - } - }); - - return groupComponents; -}; - -GroupRows.prototype.wipe = function () { - this.groupList.forEach(function (group) { - group.wipe(); - }); -}; - -GroupRows.prototype.pullGroupListData = function (groupList) { - var self = this; - var groupListData = []; - - groupList.forEach(function (group) { - var groupHeader = {}; - groupHeader.level = 0; - groupHeader.rowCount = 0; - groupHeader.headerContent = ""; - var childData = []; - - if (group.hasSubGroups) { - childData = self.pullGroupListData(group.groupList); - - groupHeader.level = group.level; - groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers - groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group); - - groupListData.push(groupHeader); - groupListData = groupListData.concat(childData); - } else { - groupHeader.level = group.level; - groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group); - groupHeader.rowCount = group.getRows().length; - - groupListData.push(groupHeader); - - group.getRows().forEach(function (row) { - groupListData.push(row.getData("data")); - }); - } - }); - - return groupListData; -}; - -GroupRows.prototype.getGroupedData = function () { - - return this.pullGroupListData(this.groupList); -}; - -GroupRows.prototype.getRowGroup = function (row) { - var match = false; - - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - - return match; -}; - -GroupRows.prototype.countGroups = function () { - return this.groupList.length; -}; - -GroupRows.prototype.generateGroups = function (rows) { - var self = this, - oldGroups = self.groups; - - self.groups = {}; - self.groupList = []; - - if (this.allowedValues && this.allowedValues[0]) { - this.allowedValues[0].forEach(function (value) { - self.createGroup(value, 0, oldGroups); - }); - - rows.forEach(function (row) { - self.assignRowToExistingGroup(row, oldGroups); - }); - } else { - rows.forEach(function (row) { - self.assignRowToGroup(row, oldGroups); - }); - } -}; - -GroupRows.prototype.createGroup = function (groupID, level, oldGroups) { - var groupKey = level + "_" + groupID, - group; - - oldGroups = oldGroups || []; - - group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]); - - this.groups[groupKey] = group; - this.groupList.push(group); -}; - -// GroupRows.prototype.assignRowToGroup = function(row, oldGroups){ -// var groupID = this.groupIDLookups[0].func(row.getData()), -// groupKey = "0_" + groupID; - -// if(!this.groups[groupKey]){ -// this.createGroup(groupID, 0, oldGroups); -// } - -// this.groups[groupKey].addRow(row); -// }; - -GroupRows.prototype.assignRowToExistingGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - groupKey = "0_" + groupID; - - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } -}; - -GroupRows.prototype.assignRowToGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - newGroupNeeded = !this.groups["0_" + groupID]; - - if (newGroupNeeded) { - this.createGroup(groupID, 0, oldGroups); - } - - this.groups["0_" + groupID].addRow(row); - - return !newGroupNeeded; -}; - -GroupRows.prototype.updateGroupRows = function (force) { - var self = this, - output = [], - oldRowCount; - - self.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows()); - }); - - //force update of table display - if (force) { - - var displayIndex = self.table.rowManager.setDisplayRows(output, this.getDisplayIndex()); - - if (displayIndex !== true) { - this.setDisplayIndex(displayIndex); - } - - self.table.rowManager.refreshActiveData("group", true, true); - } - - return output; -}; - -GroupRows.prototype.scrollHeaders = function (left) { - left = left + "px"; - - this.groupList.forEach(function (group) { - group.scrollHeader(left); - }); -}; - -GroupRows.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - } -}; - -Tabulator.prototype.registerModule("groupRows", GroupRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/group_rows.min.js b/app/static/vendors/tabulator/js.old/modules/group_rows.min.js deleted file mode 100644 index 5ae3daf..0000000 --- a/app/static/vendors/tabulator/js.old/modules/group_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getField=function(){return this._group.field},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.groupManager.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e-1?e?this.rows.splice(i+1,0,t):this.rows.splice(i,0,t):e?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},Group.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})},Group.prototype.getRowIndex=function(t){},Group.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},Group.prototype.removeRow=function(t){var o=this.rows.indexOf(t),e=t.getElement();o>-1&&this.rows.splice(o,1),this.groupManager.table.options.groupValues||this.rows.length?(e.parentNode&&e.parentNode.removeChild(e),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},Group.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],o=this.groupList.indexOf(t),o>-1&&this.groupList.splice(o,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},Group.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows(t))}):(!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top)),o=o.concat(this.rows),!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top))),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom)))),o},Group.prototype.getData=function(t,o){var e=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){e.push(t.getData(o||"data"))}),e},Group.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t},Group.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},Group.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){t.detachElement()})}):this.rows.forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},Group.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var o=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e})}):t.rows.forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},Group.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},Group.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}):this.rows.find(function(o){return o===t})&&(o=this),o},Group.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},Group.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;tr.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(o,e){t.headerGenerator[0]=function(t,r,i){return(void 0===t?"":t)+"("+r+" "+(1===r?o:e.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(o)||o)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var i=this.table.columnManager.getRealColumns();i.forEach(function(o){o.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),o.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(o,e){var r,i;"function"==typeof o?r=o:(i=t.table.columnManager.getColumnByField(o),r=i?function(t){return i.getFieldValue(t)}:function(t){return t[o]}),t.groupIDLookups.push({field:"function"!=typeof o&&o,func:r,values:!!t.allowedValues&&t.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=e),r&&(t.headerGenerator=Array.isArray(r)?r:[r]),this.initialized=!0},GroupRows.prototype.setDisplayIndex=function(t){this.displayIndex=t},GroupRows.prototype.getDisplayIndex=function(){return this.displayIndex},GroupRows.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},GroupRows.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},GroupRows.prototype.getChildGroups=function(t){var o=this,e=[];return t||(t=this),t.groupList.forEach(function(t){t.groupList.length?e=e.concat(o.getChildGroups(t)):e.push(t)}),e},GroupRows.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})},GroupRows.prototype.pullGroupListData=function(t){var o=this,e=[];return t.forEach(function(t){var r={};r.level=0,r.rowCount=0,r.headerContent="";var i=[];t.hasSubGroups?(i=o.pullGroupListData(t.groupList),r.level=t.level,r.rowCount=i.length-t.groupList.length,r.headerContent=t.generator(t.key,r.rowCount,t.rows,t),e.push(r),e=e.concat(i)):(r.level=t.level,r.headerContent=t.generator(t.key,t.rows.length,t.rows,t),r.rowCount=t.getRows().length,e.push(r),t.getRows().forEach(function(t){e.push(t.getData("data"))}))}),e},GroupRows.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},GroupRows.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}),o},GroupRows.prototype.countGroups=function(){return this.groupList.length},GroupRows.prototype.generateGroups=function(t){var o=this,e=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){o.createGroup(t,0,e)}),t.forEach(function(t){o.assignRowToExistingGroup(t,e)})):t.forEach(function(t){o.assignRowToGroup(t,e)})},GroupRows.prototype.createGroup=function(t,o,e){var r,i=o+"_"+t;e=e||[],r=new Group(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[i]),this.groups[i]=r,this.groupList.push(r)},GroupRows.prototype.assignRowToExistingGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]&&this.groups[r].addRow(t)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r=!this.groups["0_"+e];return r&&this.createGroup(e,0,o),this.groups["0_"+e].addRow(t),!r},GroupRows.prototype.updateGroupRows=function(t){var o=this,e=[];if(o.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var r=o.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==r&&this.setDisplayIndex(r),o.table.rowManager.refreshActiveData("group",!0,!0)}return e},GroupRows.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(o){o.scrollHeader(t)})},GroupRows.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],(o=this.groupList.indexOf(t))>-1&&this.groupList.splice(o,1))},Tabulator.prototype.registerModule("groupRows",GroupRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/history.js b/app/static/vendors/tabulator/js.old/modules/history.js deleted file mode 100644 index 879e006..0000000 --- a/app/static/vendors/tabulator/js.old/modules/history.js +++ /dev/null @@ -1,141 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var History = function History(table) { - this.table = table; //hold Tabulator object - - this.history = []; - this.index = -1; -}; - -History.prototype.clear = function () { - this.history = []; - this.index = -1; -}; - -History.prototype.action = function (type, component, data) { - - this.history = this.history.slice(0, this.index + 1); - - this.history.push({ - type: type, - component: component, - data: data - }); - - this.index++; -}; - -History.prototype.getHistoryUndoSize = function () { - return this.index + 1; -}; - -History.prototype.getHistoryRedoSize = function () { - return this.history.length - (this.index + 1); -}; - -History.prototype.undo = function () { - - if (this.index > -1) { - var action = this.history[this.index]; - - this.undoers[action.type].call(this, action); - - this.index--; - - this.table.options.historyUndo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Undo Error - No more history to undo"); - return false; - } -}; - -History.prototype.redo = function () { - if (this.history.length - 1 > this.index) { - - this.index++; - - var action = this.history[this.index]; - - this.redoers[action.type].call(this, action); - - this.table.options.historyRedo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Redo Error - No more history to redo"); - return false; - } -}; - -History.prototype.undoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.oldValue); - }, - - rowAdd: function rowAdd(action) { - action.component.deleteActual(); - }, - - rowDelete: function rowDelete(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after); - this.table.rowManager.redraw(); - } -}; - -History.prototype.redoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.newValue); - }, - - rowAdd: function rowAdd(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowDelete: function rowDelete(action) { - action.component.deleteActual(); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after); - this.table.rowManager.redraw(); - } -}; - -//rebind rows to new element after deletion -History.prototype._rebindRow = function (oldRow, newRow) { - this.history.forEach(function (action) { - if (action.component instanceof Row) { - if (action.component === oldRow) { - action.component = newRow; - } - } else if (action.component instanceof Cell) { - if (action.component.row === oldRow) { - var field = action.component.column.getField(); - - if (field) { - action.component = newRow.getCell(field); - } - } - } - }); -}; - -Tabulator.prototype.registerModule("history", History); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/history.min.js b/app/static/vendors/tabulator/js.old/modules/history.min.js deleted file mode 100644 index 68512ed..0000000 --- a/app/static/vendors/tabulator/js.old/modules/history.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var History=function(t){this.table=t,this.history=[],this.index=-1};History.prototype.clear=function(){this.history=[],this.index=-1},History.prototype.action=function(t,o,e){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:e}),this.index++},History.prototype.getHistoryUndoSize=function(){return this.index+1},History.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},History.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},History.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},History.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posFrom],!t.data.after),this.table.rowManager.redraw()}},History.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posTo],t.data.after),this.table.rowManager.redraw()}},History.prototype._rebindRow=function(t,o){this.history.forEach(function(e){if(e.component instanceof Row)e.component===t&&(e.component=o);else if(e.component instanceof Cell&&e.component.row===t){var i=e.component.column.getField();i&&(e.component=o.getCell(i))}})},Tabulator.prototype.registerModule("history",History); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/html_table_import.js b/app/static/vendors/tabulator/js.old/modules/html_table_import.js deleted file mode 100644 index c2e2eb2..0000000 --- a/app/static/vendors/tabulator/js.old/modules/html_table_import.js +++ /dev/null @@ -1,191 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var HtmlTableImport = function HtmlTableImport(table) { - this.table = table; //hold Tabulator object - this.fieldIndex = []; - this.hasIndex = false; -}; - -HtmlTableImport.prototype.parseTable = function () { - var self = this, - element = self.table.element, - options = self.table.options, - columns = options.columns, - headers = element.getElementsByTagName("th"), - rows = element.getElementsByTagName("tbody")[0], - data = [], - newTable; - - self.hasIndex = false; - - self.table.options.htmlImporting.call(this.table); - - rows = rows ? rows.getElementsByTagName("tr") : []; - - //check for tablator inline options - self._extractOptions(element, options); - - if (headers.length) { - self._extractHeaders(headers, rows); - } else { - self._generateBlankHeaders(headers, rows); - } - - //iterate through table rows and build data set - for (var index = 0; index < rows.length; index++) { - var row = rows[index], - cells = row.getElementsByTagName("td"), - item = {}; - - //create index if the dont exist in table - if (!self.hasIndex) { - item[options.index] = index; - } - - for (var i = 0; i < cells.length; i++) { - var cell = cells[i]; - if (typeof this.fieldIndex[i] !== "undefined") { - item[this.fieldIndex[i]] = cell.innerHTML; - } - } - - //add row data to item - data.push(item); - } - - //create new element - var newElement = document.createElement("div"); - - //transfer attributes to new element - var attributes = element.attributes; - - // loop through attributes and apply them on div - - for (var i in attributes) { - if (_typeof(attributes[i]) == "object") { - newElement.setAttribute(attributes[i].name, attributes[i].value); - } - } - - // replace table with div element - element.parentNode.replaceChild(newElement, element); - - options.data = data; - - self.table.options.htmlImported.call(this.table); - - // // newElement.tabulator(options); - - this.table.element = newElement; -}; - -//extract tabulator attribute options -HtmlTableImport.prototype._extractOptions = function (element, options, defaultOptions) { - var attributes = element.attributes; - var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options); - var optionsList = {}; - - optionsArr.forEach(function (item) { - optionsList[item.toLowerCase()] = item; - }); - - for (var index in attributes) { - var attrib = attributes[index]; - var name; - - if (attrib && (typeof attrib === "undefined" ? "undefined" : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { - name = attrib.name.replace("tabulator-", ""); - - if (typeof optionsList[name] !== "undefined") { - options[optionsList[name]] = this._attribValue(attrib.value); - } - } - } -}; - -//get value of attribute -HtmlTableImport.prototype._attribValue = function (value) { - if (value === "true") { - return true; - } - - if (value === "false") { - return false; - } - - return value; -}; - -//find column if it has already been defined -HtmlTableImport.prototype._findCol = function (title) { - var match = this.table.options.columns.find(function (column) { - return column.title === title; - }); - - return match || false; -}; - -//extract column from headers -HtmlTableImport.prototype._extractHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - exists = false, - col = this._findCol(header.textContent), - width, - attributes; - - if (col) { - exists = true; - } else { - col = { title: header.textContent.trim() }; - } - - if (!col.field) { - col.field = header.textContent.trim().toLowerCase().replace(" ", "_"); - } - - width = header.getAttribute("width"); - - if (width && !col.width) { - col.width = width; - } - - //check for tablator inline options - attributes = header.attributes; - - // //check for tablator inline options - this._extractOptions(header, col, Column.prototype.defaultOptionList); - - this.fieldIndex[index] = col.field; - - if (col.field == this.table.options.index) { - this.hasIndex = true; - } - - if (!exists) { - this.table.options.columns.push(col); - } - } -}; - -//generate blank headers -HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - col = { title: "", field: "col" + index }; - - this.fieldIndex[index] = col.field; - - var width = header.getAttribute("width"); - - if (width) { - col.width = width; - } - - this.table.options.columns.push(col); - } -}; - -Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/html_table_import.min.js b/app/static/vendors/tabulator/js.old/modules/html_table_import.min.js deleted file mode 100644 index 0f62235..0000000 --- a/app/static/vendors/tabulator/js.old/modules/html_table_import.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HtmlTableImport=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};HtmlTableImport.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,a=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],l=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),a.length?t._extractHeaders(a,n):t._generateBlankHeaders(a,n);for(var r=0;r -1) { - self.pressedKeys.splice(index, 1); - } - } - }; - - this.table.element.addEventListener("keydown", this.keyupBinding); - - this.table.element.addEventListener("keyup", this.keydownBinding); -}; - -Keybindings.prototype.clearBindings = function () { - if (this.keyupBinding) { - this.table.element.removeEventListener("keydown", this.keyupBinding); - } - - if (this.keydownBinding) { - this.table.element.removeEventListener("keyup", this.keydownBinding); - } -}; - -Keybindings.prototype.checkBinding = function (e, binding) { - var self = this, - match = true; - - if (e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta) { - binding.keys.forEach(function (key) { - var index = self.pressedKeys.indexOf(key); - - if (index == -1) { - match = false; - } - }); - - if (match) { - binding.action.call(self, e); - } - - return true; - } - - return false; -}; - -//default bindings -Keybindings.prototype.bindings = { - navPrev: "shift + 9", - navNext: 9, - navUp: 38, - navDown: 40, - scrollPageUp: 33, - scrollPageDown: 34, - scrollToStart: 36, - scrollToEnd: 35, - undo: "ctrl + 90", - redo: "ctrl + 89", - copyToClipboard: "ctrl + 67" -}; - -//default actions -Keybindings.prototype.actions = { - keyBlock: function keyBlock(e) { - e.stopPropagation(); - e.preventDefault(); - }, - scrollPageUp: function scrollPageUp(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop - rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos >= 0) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - } - - this.table.element.focus(); - }, - scrollPageDown: function scrollPageDown(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop + rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos <= scrollMax) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - } - - this.table.element.focus(); - }, - scrollToStart: function scrollToStart(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - - this.table.element.focus(); - }, - scrollToEnd: function scrollToEnd(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - - this.table.element.focus(); - }, - navPrev: function navPrev(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().prev(); - } - } - }, - - navNext: function navNext(e) { - var cell = false; - var newRow = this.table.options.tabEndNewRow; - var nav; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - - nav = cell.nav(); - - if (!nav.next()) { - if (newRow) { - - cell.getElement().firstChild.blur(); - - if (newRow === true) { - newRow = this.table.addRow({}); - } else { - if (typeof newRow == "function") { - newRow = this.table.addRow(newRow(cell.row.getComponent())); - } else { - newRow = this.table.addRow(newRow); - } - } - - newRow.then(function () { - setTimeout(function () { - nav.next(); - }); - }); - } - } - } - } - }, - - navLeft: function navLeft(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().left(); - } - } - }, - - navRight: function navRight(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().right(); - } - } - }, - - navUp: function navUp(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().up(); - } - } - }, - - navDown: function navDown(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().down(); - } - } - }, - - undo: function undo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.undo(); - } - } - }, - - redo: function redo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.redo(); - } - } - }, - - copyToClipboard: function copyToClipboard(e) { - if (!this.table.modules.edit.currentCell) { - if (this.table.modExists("clipboard", true)) { - this.table.modules.clipboard.copy(false, true); - } - } - } -}; - -Tabulator.prototype.registerModule("keybindings", Keybindings); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/keybindings.min.js b/app/static/vendors/tabulator/js.old/modules/keybindings.min.js deleted file mode 100644 index 606f349..0000000 --- a/app/static/vendors/tabulator/js.old/modules/keybindings.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Keybindings=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};Keybindings.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var i in this.bindings)e[i]=this.bindings[i];if(Object.keys(t).length)for(var n in t)e[n]=t[n];this.mapBindings(e),this.bindEvents()}},Keybindings.prototype.mapBindings=function(t){var e=this,i=this;for(var n in t)!function(n){e.actions[n]?t[n]&&("object"!==_typeof(t[n])&&(t[n]=[t[n]]),t[n].forEach(function(t){i.mapBinding(n,t)})):console.warn("Key Binding Error - no such action:",n)}(n)},Keybindings.prototype.mapBinding=function(t,e){var i=this,n={action:this.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":n.ctrl=!0;break;case"shift":n.shift=!0;break;case"meta":n.meta=!0;break;default:t=parseInt(t),n.keys.push(t),i.watchKeys[t]||(i.watchKeys[t]=[]),i.watchKeys[t].push(n)}})},Keybindings.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var i=e.keyCode,n=t.watchKeys[i];n&&(t.pressedKeys.push(i),n.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=e.keyCode;if(t.watchKeys[i]){var n=t.pressedKeys.indexOf(i);n>-1&&t.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},Keybindings.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},Keybindings.prototype.checkBinding=function(t,e){var i=this,n=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(function(t){-1==i.pressedKeys.indexOf(t)&&(n=!1)}),n&&e.action.call(i,t),!0)},Keybindings.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},Keybindings.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.height,n=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=n?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e,i=!1,n=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(i=this.table.modules.edit.currentCell)&&(t.preventDefault(),e=i.nav(),e.next()||n&&(i.getElement().firstChild.blur(),n=!0===n?this.table.addRow({}):"function"==typeof n?this.table.addRow(n(i.row.getComponent())):this.table.addRow(n),n.then(function(){setTimeout(function(){e.next()})})))},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},Tabulator.prototype.registerModule("keybindings",Keybindings); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/menu.js b/app/static/vendors/tabulator/js.old/modules/menu.js deleted file mode 100644 index 7c33edc..0000000 --- a/app/static/vendors/tabulator/js.old/modules/menu.js +++ /dev/null @@ -1,161 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Menu = function Menu(table) { - this.table = table; //hold Tabulator object - this.menuEl = false; - this.blurEvent = this.hideMenu.bind(this); -}; - -Menu.prototype.initializeColumnHeader = function (column) { - var _this = this; - - var headerMenuEl; - - if (column.definition.headerContextMenu) { - column.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof column.definition.headerContextMenu == "function" ? column.definition.headerContextMenu(column.getComponent()) : column.definition.headerContextMenu; - - e.preventDefault(); - - _this.loadMenu(e, column, menu); - }); - } - - if (column.definition.headerMenu) { - - headerMenuEl = document.createElement("span"); - headerMenuEl.classList.add("tabulator-header-menu-button"); - headerMenuEl.innerHTML = "⋮"; - - headerMenuEl.addEventListener("click", function (e) { - var menu = typeof column.definition.headerMenu == "function" ? column.definition.headerMenu(column.getComponent()) : column.definition.headerMenu; - e.stopPropagation(); - e.preventDefault(); - - _this.loadMenu(e, column, menu); - }); - - column.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild); - } -}; - -Menu.prototype.initializeCell = function (cell) { - var _this2 = this; - - cell.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof cell.column.definition.contextMenu == "function" ? cell.column.definition.contextMenu(cell.getComponent()) : cell.column.definition.contextMenu; - - e.preventDefault(); - - _this2.loadMenu(e, cell, menu); - }); -}; - -Menu.prototype.initializeRow = function (row) { - var _this3 = this; - - row.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this3.table.options.rowContextMenu == "function" ? _this3.table.options.rowContextMenu(row.getComponent()) : _this3.table.options.rowContextMenu; - - e.preventDefault(); - - _this3.loadMenu(e, row, menu); - }); -}; - -Menu.prototype.loadMenu = function (e, component, menu) { - var _this4 = this; - - var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); - - //abort if no menu set - if (!menu || !menu.length) { - return; - } - - this.hideMenu(); - - this.menuEl = document.createElement("div"); - this.menuEl.classList.add("tabulator-menu"); - - menu.forEach(function (item) { - var itemEl = document.createElement("div"); - var label = item.label; - var disabled = item.disabled; - - if (item.separator) { - itemEl.classList.add("tabulator-menu-separator"); - } else { - itemEl.classList.add("tabulator-menu-item"); - - if (typeof label == "function") { - label = label(component.getComponent()); - } - - if (label instanceof Node) { - itemEl.appendChild(label); - } else { - itemEl.innerHTML = label; - } - - if (typeof disabled == "function") { - disabled = disabled(component.getComponent()); - } - - if (disabled) { - itemEl.classList.add("tabulator-menu-item-disabled"); - itemEl.addEventListener("click", function (e) { - e.stopPropagation(); - }); - } else { - itemEl.addEventListener("click", function (e) { - _this4.hideMenu(); - item.action(e, component.getComponent()); - }); - } - } - - _this4.menuEl.appendChild(itemEl); - }); - - this.menuEl.style.top = e.pageY + "px"; - this.menuEl.style.left = e.pageX + "px"; - - document.body.addEventListener("click", this.blurEvent); - this.table.rowManager.element.addEventListener("scroll", this.blurEvent); - - setTimeout(function () { - document.body.addEventListener("contextmenu", _this4.blurEvent); - }, 100); - - document.body.appendChild(this.menuEl); - - //move menu to start on right edge if it is too close to the edge of the screen - if (e.pageX + this.menuEl.offsetWidth >= document.body.offsetWidth) { - this.menuEl.style.left = ""; - this.menuEl.style.right = document.body.offsetWidth - e.pageX + "px"; - } - - //move menu to start on bottom edge if it is too close to the edge of the screen - if (e.pageY + this.menuEl.offsetHeight >= docHeight) { - this.menuEl.style.top = ""; - this.menuEl.style.bottom = docHeight - e.pageY + "px"; - } -}; - -Menu.prototype.hideMenu = function () { - if (this.menuEl.parentNode) { - this.menuEl.parentNode.removeChild(this.menuEl); - } - - if (this.blurEvent) { - document.body.removeEventListener("click", this.blurEvent); - document.body.removeEventListener("contextmenu", this.blurEvent); - this.table.rowManager.element.removeEventListener("scroll", this.blurEvent); - } -}; - -//default accessors -Menu.prototype.menus = {}; - -Tabulator.prototype.registerModule("menu", Menu); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/menu.min.js b/app/static/vendors/tabulator/js.old/modules/menu.min.js deleted file mode 100644 index dbb2bc1..0000000 --- a/app/static/vendors/tabulator/js.old/modules/menu.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var Menu=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};Menu.prototype.initializeColumnHeader=function(e){var t,n=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),n.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),n.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},Menu.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.loadMenu=function(e,t,n){var i=this,o=Math.max(document.body.offsetHeight,window.innerHeight);n&&n.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),n.forEach(function(e){var n=document.createElement("div"),o=e.label,u=e.disabled;e.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof o&&(o=o(t.getComponent())),o instanceof Node?n.appendChild(o):n.innerHTML=o,"function"==typeof u&&(u=u(t.getComponent())),u?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",function(e){e.stopPropagation()})):n.addEventListener("click",function(n){i.hideMenu(),e.action(n,t.getComponent())})),i.menuEl.appendChild(n)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=o&&(this.menuEl.style.top="",this.menuEl.style.bottom=o-e.pageY+"px"))},Menu.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},Menu.prototype.menus={},Tabulator.prototype.registerModule("menu",Menu); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/moveable_columns.js b/app/static/vendors/tabulator/js.old/modules/moveable_columns.js deleted file mode 100644 index 081ba8e..0000000 --- a/app/static/vendors/tabulator/js.old/modules/moveable_columns.js +++ /dev/null @@ -1,289 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var MoveColumns = function MoveColumns(table) { - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating column header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving column - this.toCol = false; //destination column - this.toColAfter = false; //position of moving column relative to the desitnation column - this.startX = 0; //starting position within header element - this.autoScrollMargin = 40; //auto scroll on edge when within margin - this.autoScrollStep = 5; //auto scroll distance in pixels - this.autoScrollTimeout = false; //auto scroll timeout - this.touchMove = false; - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); -}; - -MoveColumns.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.classList.add("tabulator-col-placeholder"); - - return el; -}; - -MoveColumns.prototype.initializeColumn = function (column) { - var self = this, - config = {}, - colEl; - - if (!column.modules.frozen) { - - colEl = column.getElement(); - - config.mousemove = function (e) { - if (column.parent === self.moving.parent) { - if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) { - if (self.toCol !== column || !self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling); - self.moveColumn(column, true); - } - } else { - if (self.toCol !== column || self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl); - self.moveColumn(column, false); - } - } - } - }.bind(self); - - colEl.addEventListener("mousedown", function (e) { - self.touchMove = false; - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, column); - }, self.checkPeriod); - } - }); - - colEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - self.bindTouchEvents(column); - } - - column.modules.moveColumn = config; -}; - -MoveColumns.prototype.bindTouchEvents = function (column) { - var self = this, - colEl = column.getElement(), - startXMove = false, - //shifting center position of the cell - dir = false, - currentCol, - nextCol, - prevCol, - nextColWidth, - prevColWidth, - nextColWidthLast, - prevColWidthLast; - - colEl.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentCol = column; - nextCol = column.nextColumn(); - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = column.prevColumn(); - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - nextColWidthLast = 0; - prevColWidthLast = 0; - startXMove = false; - - self.startMove(e, column); - }, self.checkPeriod); - }, { passive: true }); - - colEl.addEventListener("touchmove", function (e) { - var halfCol, diff, moveToCol; - - if (self.moving) { - self.moveHover(e); - - if (!startXMove) { - startXMove = e.touches[0].pageX; - } - - diff = e.touches[0].pageX - startXMove; - - if (diff > 0) { - if (nextCol && diff - nextColWidthLast > nextColWidth) { - moveToCol = nextCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement().nextSibling); - self.moveColumn(moveToCol, true); - } - } - } else { - if (prevCol && -diff - prevColWidthLast > prevColWidth) { - moveToCol = prevCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement()); - self.moveColumn(moveToCol, false); - } - } - } - - if (moveToCol) { - currentCol = moveToCol; - nextCol = moveToCol.nextColumn(); - nextColWidthLast = nextColWidth; - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = moveToCol.prevColumn(); - prevColWidthLast = prevColWidth; - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - } - } - }, { passive: true }); - - colEl.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - } - }); -}; - -MoveColumns.prototype.startMove = function (e, column) { - var element = column.getElement(); - - this.moving = column; - this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(element).left; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = column.getWidth() + "px"; - this.placeholderElement.style.height = column.getHeight() + "px"; - - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - this.table.columnManager.getElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.bottom = "0"; - - if (!this.touchMove) { - this._bindMouseMove(); - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - } - - this.moveHover(e); -}; - -MoveColumns.prototype._bindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().addEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); -}; - -MoveColumns.prototype._unbindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().removeEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); -}; - -MoveColumns.prototype.moveColumn = function (column, after) { - var movingCells = this.moving.getCells(); - - this.toCol = column; - this.toColAfter = after; - - if (after) { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling); - }); - } else { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl); - }); - } -}; - -MoveColumns.prototype.endMove = function (e) { - if (e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toCol) { - this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter); - } - - this.moving = false; - this.toCol = false; - this.toColAfter = false; - - if (!this.touchMove) { - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - } - } -}; - -MoveColumns.prototype.moveHover = function (e) { - var self = this, - columnHolder = self.table.columnManager.getElement(), - scrollLeft = columnHolder.scrollLeft, - xPos = (self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(columnHolder).left + scrollLeft, - scrollPos; - - self.hoverElement.style.left = xPos - self.startX + "px"; - - if (xPos - scrollLeft < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.max(0, scrollLeft - 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - - if (scrollLeft + columnHolder.clientWidth - xPos < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.min(columnHolder.clientWidth, scrollLeft + 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } -}; - -Tabulator.prototype.registerModule("moveColumn", MoveColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/moveable_columns.min.js b/app/static/vendors/tabulator/js.old/modules/moveable_columns.min.js deleted file mode 100644 index a742cf9..0000000 --- a/app/static/vendors/tabulator/js.old/modules/moveable_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var MoveColumns=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};MoveColumns.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},MoveColumns.prototype.initializeColumn=function(e){var t,o=this,n={};e.modules.frozen||(t=e.getElement(),n.mousemove=function(n){e.parent===o.moving.parent&&((o.touchMove?n.touches[0].pageX:n.pageX)-Tabulator.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=n},MoveColumns.prototype.bindTouchEvents=function(e){var t,o,n,l,i,s,m,r=this,u=e.getElement(),h=!1;u.addEventListener("touchstart",function(u){r.checkTimeout=setTimeout(function(){r.touchMove=!0,t=e,o=e.nextColumn(),l=o?o.getWidth()/2:0,n=e.prevColumn(),i=n?n.getWidth()/2:0,s=0,m=0,h=!1,r.startMove(u,e)},r.checkPeriod)},{passive:!0}),u.addEventListener("touchmove",function(u){var a,c;r.moving&&(r.moveHover(u),h||(h=u.touches[0].pageX),a=u.touches[0].pageX-h,a>0?o&&a-s>l&&(c=o)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement().nextSibling),r.moveColumn(c,!0)):n&&-a-m>i&&(c=n)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement()),r.moveColumn(c,!1)),c&&(t=c,o=c.nextColumn(),s=l,l=o?o.getWidth()/2:0,n=c.prevColumn(),m=i,i=n?n.getWidth()/2:0))},{passive:!0}),u.addEventListener("touchend",function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)})},MoveColumns.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)},MoveColumns.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n.nextSibling)}):e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n)})},MoveColumns.prototype.endMove=function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},MoveColumns.prototype.moveHover=function(e){var t,o=this,n=o.table.columnManager.getElement(),l=n.scrollLeft,i=(o.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(n).left+l;o.hoverElement.style.left=i-o.startX+"px",i-l group.getHeight() / 2) { - if (self.toRow !== group || !self.toRowAfter) { - var rowEl = group.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(group, true); - } - } else { - if (self.toRow !== group || self.toRowAfter) { - var rowEl = group.getElement(); - if (rowEl.previousSibling) { - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(group, false); - } - } - } - }.bind(self); - - group.modules.moveRow = config; -}; - -MoveRows.prototype.initializeRow = function (row) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(row.element).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) { - if (self.toRow !== row || !self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(row, true); - } - } else { - if (self.toRow !== row || self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(row, false); - } - } - }.bind(self); - - if (!this.hasHandle) { - - rowEl = row.getElement(); - - rowEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, row); - }, self.checkPeriod); - } - }); - - rowEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(row, row.getElement()); - } - - row.modules.moveRow = config; -}; - -MoveRows.prototype.initializeCell = function (cell) { - var self = this, - cellEl = cell.getElement(); - - cellEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, cell.row); - }, self.checkPeriod); - } - }); - - cellEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(cell.row, cell.getElement()); -}; - -MoveRows.prototype.bindTouchEvents = function (row, element) { - var self = this, - startYMove = false, - //shifting center position of the cell - dir = false, - currentRow, - nextRow, - prevRow, - nextRowHeight, - prevRowHeight, - nextRowHeightLast, - prevRowHeightLast; - - element.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentRow = row; - nextRow = row.nextRow(); - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = row.prevRow(); - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - nextRowHeightLast = 0; - prevRowHeightLast = 0; - startYMove = false; - - self.startMove(e, row); - }, self.checkPeriod); - }, { passive: true }); - this.moving, this.toRow, this.toRowAfter; - element.addEventListener("touchmove", function (e) { - - var halfCol, diff, moveToRow; - - if (self.moving) { - e.preventDefault(); - - self.moveHover(e); - - if (!startYMove) { - startYMove = e.touches[0].pageY; - } - - diff = e.touches[0].pageY - startYMove; - - if (diff > 0) { - if (nextRow && diff - nextRowHeightLast > nextRowHeight) { - moveToRow = nextRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement().nextSibling); - self.moveRow(moveToRow, true); - } - } - } else { - if (prevRow && -diff - prevRowHeightLast > prevRowHeight) { - moveToRow = prevRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement()); - self.moveRow(moveToRow, false); - } - } - } - - if (moveToRow) { - currentRow = moveToRow; - nextRow = moveToRow.nextRow(); - nextRowHeightLast = nextRowHeight; - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = moveToRow.prevRow(); - prevRowHeightLast = prevRowHeight; - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - } - } - }); - - element.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - self.touchMove = false; - } - }); -}; - -MoveRows.prototype._bindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().addEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); -}; - -MoveRows.prototype._unbindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().removeEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); -}; - -MoveRows.prototype.startMove = function (e, row) { - var element = row.getElement(); - - this.setStartPosition(e, row); - - this.moving = row; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = row.getWidth() + "px"; - this.placeholderElement.style.height = row.getHeight() + "px"; - - if (!this.connection) { - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - } else { - this.table.element.classList.add("tabulator-movingrow-sending"); - this.connectToTables(row); - } - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - if (this.connection) { - document.body.appendChild(this.hoverElement); - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - this.hoverElement.style.width = this.table.element.clientWidth + "px"; - this.hoverElement.style.whiteSpace = "nowrap"; - this.hoverElement.style.overflow = "hidden"; - this.hoverElement.style.pointerEvents = "none"; - } else { - this.table.rowManager.getTableElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - - this._bindMouseMove(); - } - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - - this.moveHover(e); -}; - -MoveRows.prototype.setStartPosition = function (e, row) { - var pageX = this.touchMove ? e.touches[0].pageX : e.pageX, - pageY = this.touchMove ? e.touches[0].pageY : e.pageY, - element, - position; - - element = row.getElement(); - if (this.connection) { - position = element.getBoundingClientRect(); - - this.startX = position.left - pageX + window.pageXOffset; - this.startY = position.top - pageY + window.pageYOffset; - } else { - this.startY = pageY - element.getBoundingClientRect().top; - } -}; - -MoveRows.prototype.endMove = function (e) { - if (!e || e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - if (!this.connection) { - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - } - - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toRow) { - this.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter); - } - - this.moving = false; - this.toRow = false; - this.toRowAfter = false; - - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - - if (this.connection) { - this.table.element.classList.remove("tabulator-movingrow-sending"); - this.disconnectFromTables(); - } - } -}; - -MoveRows.prototype.moveRow = function (row, after) { - this.toRow = row; - this.toRowAfter = after; -}; - -MoveRows.prototype.moveHover = function (e) { - if (this.connection) { - this.moveHoverConnections.call(this, e); - } else { - this.moveHoverTable.call(this, e); - } -}; - -MoveRows.prototype.moveHoverTable = function (e) { - var rowHolder = this.table.rowManager.getElement(), - scrollTop = rowHolder.scrollTop, - yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop, - scrollPos; - - this.hoverElement.style.top = yPos - this.startY + "px"; -}; - -MoveRows.prototype.moveHoverConnections = function (e) { - this.hoverElement.style.left = this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX) + "px"; - this.hoverElement.style.top = this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY) + "px"; -}; - -//establish connection with other tables -MoveRows.prototype.connectToTables = function (row) { - var self = this, - connections = this.table.modules.comms.getConnections(this.connection); - - this.table.options.movableRowsSendingStart.call(this.table, connections); - - this.table.modules.comms.send(this.connection, "moveRow", "connect", { - row: row - }); -}; - -//disconnect from other tables -MoveRows.prototype.disconnectFromTables = function () { - var self = this, - connections = this.table.modules.comms.getConnections(this.connection); - - this.table.options.movableRowsSendingStop.call(this.table, connections); - - this.table.modules.comms.send(this.connection, "moveRow", "disconnect"); -}; - -//accept incomming connection -MoveRows.prototype.connect = function (table, row) { - var self = this; - if (!this.connectedTable) { - this.connectedTable = table; - this.connectedRow = row; - - this.table.element.classList.add("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.tableRowDropEvent = self.tableRowDrop.bind(self); - - self.table.element.addEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStart.call(this.table, row, table); - - return true; - } else { - console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable); - return false; - } -}; - -//close incomming connection -MoveRows.prototype.disconnect = function (table) { - var self = this; - if (table === this.connectedTable) { - this.connectedTable = false; - this.connectedRow = false; - - this.table.element.classList.remove("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().removeEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.table.element.removeEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStop.call(this.table, table); - } else { - console.warn("Move Row Error - trying to disconnect from non connected table"); - } -}; - -MoveRows.prototype.dropComplete = function (table, row, success) { - var sender = false; - - if (success) { - - switch (_typeof(this.table.options.movableRowsSender)) { - case "string": - sender = this.senders[this.table.options.movableRowsSender]; - break; - - case "function": - sender = this.table.options.movableRowsSender; - break; - } - - if (sender) { - sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - if (this.table.options.movableRowsSender) { - console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender); - } - } - - this.table.options.movableRowsSent.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - this.table.options.movableRowsSentFailed.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } - - this.endMove(); -}; - -MoveRows.prototype.tableRowDrop = function (e, row) { - var receiver = false, - success = false; - - e.stopImmediatePropagation(); - - switch (_typeof(this.table.options.movableRowsReceiver)) { - case "string": - receiver = this.receivers[this.table.options.movableRowsReceiver]; - break; - - case "function": - receiver = this.table.options.movableRowsReceiver; - break; - } - - if (receiver) { - success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver); - } - - if (success) { - this.table.options.movableRowsReceived.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - this.table.options.movableRowsReceivedFailed.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } - - this.table.modules.comms.send(this.connectedTable, "moveRow", "dropcomplete", { - row: row, - success: success - }); -}; - -MoveRows.prototype.receivers = { - insert: function insert(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData(), undefined, toRow); - return true; - }, - - add: function add(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData()); - return true; - }, - - update: function update(fromRow, toRow, fromTable) { - if (toRow) { - toRow.update(fromRow.getData()); - return true; - } - - return false; - }, - - replace: function replace(fromRow, toRow, fromTable) { - if (toRow) { - this.table.addRow(fromRow.getData(), undefined, toRow); - toRow.delete(); - return true; - } - - return false; - } -}; - -MoveRows.prototype.senders = { - delete: function _delete(fromRow, toRow, toTable) { - fromRow.delete(); - } -}; - -MoveRows.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "connect": - return this.connect(table, data.row); - break; - - case "disconnect": - return this.disconnect(table); - break; - - case "dropcomplete": - return this.dropComplete(table, data.row, data.success); - break; - } -}; - -Tabulator.prototype.registerModule("moveRow", MoveRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/moveable_rows.min.js b/app/static/vendors/tabulator/js.old/modules/moveable_rows.min.js deleted file mode 100644 index 8a80e50..0000000 --- a/app/static/vendors/tabulator/js.old/modules/moveable_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MoveRows=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connections=[],this.connectedTable=!1,this.connectedRow=!1};MoveRows.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e},MoveRows.prototype.initialize=function(e){this.connection=this.table.options.movableRowsConnectedTables},MoveRows.prototype.setHandle=function(e){this.hasHandle=e},MoveRows.prototype.initializeGroupHeader=function(e){var t=this,o={};o.mouseup=function(e){t.tableRowDrop(e,row)}.bind(t),o.mousemove=function(o){if(o.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var n=e.getElement();n.previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},MoveRows.prototype.initializeRow=function(e){var t,o=this,n={};n.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),n.mousemove=function(t){if(t.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n},MoveRows.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},MoveRows.prototype.bindTouchEvents=function(e,t){var o,n,i,s,l,r,a,c=this,h=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,n=e.nextRow(),s=n?n.getHeight()/2:0,i=e.prevRow(),l=i?i.getHeight()/2:0,r=0,a=0,h=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var m,v;c.moving&&(t.preventDefault(),c.moveHover(t),h||(h=t.touches[0].pageY),m=t.touches[0].pageY-h,m>0?n&&m-r>s&&(v=n)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(c.placeholderElement,v.getElement().nextSibling),c.moveRow(v,!0)):i&&-m-a>l&&(v=i)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(c.placeholderElement,v.getElement()),c.moveRow(v,!1)),v&&(o=v,n=v.nextRow(),r=s,s=n?n.getHeight()/2:0,i=v.prevRow(),a=l,l=i?i.getHeight()/2:0))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},MoveRows.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},MoveRows.prototype.setStartPosition=function(e,t){var o,n,i=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(n=o.getBoundingClientRect(),this.startX=n.left-i+window.pageXOffset,this.startY=n.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},MoveRows.prototype.endMove=function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},MoveRows.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},MoveRows.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},MoveRows.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=n-this.startY+"px"},MoveRows.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},MoveRows.prototype.connectToTables=function(e){var t=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connection,"moveRow","connect",{row:e})},MoveRows.prototype.disconnectFromTables=function(){var e=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connection,"moveRow","disconnect")},MoveRows.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},MoveRows.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},MoveRows.prototype.dropComplete=function(e,t,o){var n=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":n=this.senders[this.table.options.movableRowsSender];break;case"function":n=this.table.options.movableRowsSender}n?n.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},MoveRows.prototype.tableRowDrop=function(e,t){var o=!1,n=!1;switch(e.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?n=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),n?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:n})},MoveRows.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},MoveRows.prototype.senders={delete:function(e,t,o){e.delete()}},MoveRows.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},Tabulator.prototype.registerModule("moveRow",MoveRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/mutator.js b/app/static/vendors/tabulator/js.old/modules/mutator.js deleted file mode 100644 index b2f7a39..0000000 --- a/app/static/vendors/tabulator/js.old/modules/mutator.js +++ /dev/null @@ -1,116 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Mutator = function Mutator(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types - this.enabled = true; -}; - -//initialize column mutator -Mutator.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - mutator; - - if (column.definition[key]) { - mutator = self.lookupMutator(column.definition[key]); - - if (mutator) { - match = true; - - config[key] = { - mutator: mutator, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.mutate = config; - } -}; - -Mutator.prototype.lookupMutator = function (value) { - var mutator = false; - - //set column mutator - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - if (this.mutators[value]) { - mutator = this.mutators[value]; - } else { - console.warn("Mutator Error - No such mutator found, ignoring: ", value); - } - break; - - case "function": - mutator = value; - break; - } - - return mutator; -}; - -//apply mutator to row -Mutator.prototype.transformRow = function (data, type, updatedData) { - var self = this, - key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - value; - - if (this.enabled) { - - self.table.columnManager.traverse(function (column) { - var mutator, params, component; - - if (column.modules.mutate) { - mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; - - if (mutator) { - value = column.getFieldValue(typeof updatedData !== "undefined" ? updatedData : data); - - if (type == "data" || typeof value !== "undefined") { - component = column.getComponent(); - params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; - column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); - } - } - } - }); - } - - return data; -}; - -//apply mutator to new cell value -Mutator.prototype.transformCell = function (cell, value) { - var mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false, - tempData = {}; - - if (mutator) { - tempData = Object.assign(tempData, cell.row.getData()); - cell.column.setFieldValue(tempData, value); - return mutator.mutator(value, tempData, "edit", mutator.params, cell.getComponent()); - } else { - return value; - } -}; - -Mutator.prototype.enable = function () { - this.enabled = true; -}; - -Mutator.prototype.disable = function () { - this.enabled = false; -}; - -//default mutators -Mutator.prototype.mutators = {}; - -Tabulator.prototype.registerModule("mutator", Mutator); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/mutator.min.js b/app/static/vendors/tabulator/js.old/modules/mutator.min.js deleted file mode 100644 index fa6b50a..0000000 --- a/app/static/vendors/tabulator/js.old/modules/mutator.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mutator=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};Mutator.prototype.initializeColumn=function(t){var o=this,e=!1,a={};this.allowedTypes.forEach(function(r){var u,n="mutator"+(r.charAt(0).toUpperCase()+r.slice(1));t.definition[n]&&(u=o.lookupMutator(t.definition[n]))&&(e=!0,a[n]={mutator:u,params:t.definition[n+"Params"]||{}})}),e&&(t.modules.mutate=a)},Mutator.prototype.lookupMutator=function(t){var o=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t}return o},Mutator.prototype.transformRow=function(t,o,e){var a,r=this,u="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));return this.enabled&&r.table.columnManager.traverse(function(r){var n,i,s;r.modules.mutate&&(n=r.modules.mutate[u]||r.modules.mutate.mutator||!1)&&(a=r.getFieldValue(void 0!==e?e:t),"data"!=o&&void 0===a||(s=r.getComponent(),i="function"==typeof n.params?n.params(a,t,o,s):n.params,r.setFieldValue(t,n.mutator(a,t,o,i,s))))}),t},Mutator.prototype.transformCell=function(t,o){var e=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,a={};return e?(a=Object.assign(a,t.row.getData()),t.column.setFieldValue(a,o),e.mutator(o,a,"edit",e.params,t.getComponent())):o},Mutator.prototype.enable=function(){this.enabled=!0},Mutator.prototype.disable=function(){this.enabled=!1},Mutator.prototype.mutators={},Tabulator.prototype.registerModule("mutator",Mutator); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/page.js b/app/static/vendors/tabulator/js.old/modules/page.js deleted file mode 100644 index 52ee487..0000000 --- a/app/static/vendors/tabulator/js.old/modules/page.js +++ /dev/null @@ -1,693 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Page = function Page(table) { - - this.table = table; //hold Tabulator object - - this.mode = "local"; - this.progressiveLoad = false; - - this.size = 0; - this.page = 1; - this.count = 5; - this.max = 1; - - this.displayIndex = 0; //index in display pipeline - - this.initialLoad = true; - - this.pageSizes = []; - - this.dataReceivedNames = {}; - this.dataSentNames = {}; - - this.createElements(); -}; - -Page.prototype.createElements = function () { - - var button; - - this.element = document.createElement("span"); - this.element.classList.add("tabulator-paginator"); - - this.pagesElement = document.createElement("span"); - this.pagesElement.classList.add("tabulator-pages"); - - button = document.createElement("button"); - button.classList.add("tabulator-page"); - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", ""); - button.setAttribute("title", ""); - - this.firstBut = button.cloneNode(true); - this.firstBut.setAttribute("data-page", "first"); - - this.prevBut = button.cloneNode(true); - this.prevBut.setAttribute("data-page", "prev"); - - this.nextBut = button.cloneNode(true); - this.nextBut.setAttribute("data-page", "next"); - - this.lastBut = button.cloneNode(true); - this.lastBut.setAttribute("data-page", "last"); - - if (this.table.options.paginationSizeSelector) { - this.pageSizeSelect = document.createElement("select"); - this.pageSizeSelect.classList.add("tabulator-page-size"); - } -}; - -Page.prototype.generatePageSizeSelectList = function () { - var _this = this; - - var pageSizes = []; - - if (this.pageSizeSelect) { - - if (Array.isArray(this.table.options.paginationSizeSelector)) { - pageSizes = this.table.options.paginationSizeSelector; - this.pageSizes = pageSizes; - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes.unshift(this.size); - } - } else { - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes = []; - - for (var i = 1; i < 5; i++) { - pageSizes.push(this.size * i); - } - - this.pageSizes = pageSizes; - } else { - pageSizes = this.pageSizes; - } - } - - while (this.pageSizeSelect.firstChild) { - this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild); - }pageSizes.forEach(function (item) { - var itemEl = document.createElement("option"); - itemEl.value = item; - itemEl.innerHTML = item; - - _this.pageSizeSelect.appendChild(itemEl); - }); - - this.pageSizeSelect.value = this.size; - } -}; - -//setup pageination -Page.prototype.initialize = function (hidden) { - var self = this, - pageSelectLabel, - testElRow, - testElCell; - - //update param names - this.dataSentNames = Object.assign({}, this.paginationDataSentNames); - this.dataSentNames = Object.assign(this.dataSentNames, this.table.options.paginationDataSent); - - this.dataReceivedNames = Object.assign({}, this.paginationDataReceivedNames); - this.dataReceivedNames = Object.assign(this.dataReceivedNames, this.table.options.paginationDataReceived); - - //build pagination element - - //bind localizations - self.table.modules.localize.bind("pagination|first", function (value) { - self.firstBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|first_title", function (value) { - self.firstBut.setAttribute("aria-label", value); - self.firstBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|prev", function (value) { - self.prevBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|prev_title", function (value) { - self.prevBut.setAttribute("aria-label", value); - self.prevBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|next", function (value) { - self.nextBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|next_title", function (value) { - self.nextBut.setAttribute("aria-label", value); - self.nextBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|last", function (value) { - self.lastBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|last_title", function (value) { - self.lastBut.setAttribute("aria-label", value); - self.lastBut.setAttribute("title", value); - }); - - //click bindings - self.firstBut.addEventListener("click", function () { - self.setPage(1); - }); - - self.prevBut.addEventListener("click", function () { - self.previousPage(); - }); - - self.nextBut.addEventListener("click", function () { - self.nextPage().then(function () {}).catch(function () {}); - }); - - self.lastBut.addEventListener("click", function () { - self.setPage(self.max); - }); - - if (self.table.options.paginationElement) { - self.element = self.table.options.paginationElement; - } - - if (this.pageSizeSelect) { - pageSelectLabel = document.createElement("label"); - - self.table.modules.localize.bind("pagination|page_size", function (value) { - self.pageSizeSelect.setAttribute("aria-label", value); - self.pageSizeSelect.setAttribute("title", value); - pageSelectLabel.innerHTML = value; - }); - - self.element.appendChild(pageSelectLabel); - self.element.appendChild(self.pageSizeSelect); - - self.pageSizeSelect.addEventListener("change", function (e) { - self.setPageSize(self.pageSizeSelect.value); - self.setPage(1).then(function () {}).catch(function () {}); - }); - } - - //append to DOM - self.element.appendChild(self.firstBut); - self.element.appendChild(self.prevBut); - self.element.appendChild(self.pagesElement); - self.element.appendChild(self.nextBut); - self.element.appendChild(self.lastBut); - - if (!self.table.options.paginationElement && !hidden) { - self.table.footerManager.append(self.element, self); - } - - //set default values - self.mode = self.table.options.pagination; - - if (self.table.options.paginationSize) { - self.size = self.table.options.paginationSize; - } else { - testElRow = document.createElement("div"); - testElRow.classList.add("tabulator-row"); - testElRow.style.visibility = hidden; - - testElCell = document.createElement("div"); - testElCell.classList.add("tabulator-cell"); - testElCell.innerHTML = "Page Row Test"; - - testElRow.appendChild(testElCell); - - self.table.rowManager.getTableElement().appendChild(testElRow); - - self.size = Math.floor(self.table.rowManager.getElement().clientHeight / testElRow.offsetHeight); - - self.table.rowManager.getTableElement().removeChild(testElRow); - } - - // self.page = self.table.options.paginationInitialPage || 1; - self.count = self.table.options.paginationButtonCount; - - self.generatePageSizeSelectList(); -}; - -Page.prototype.initializeProgressive = function (mode) { - this.initialize(true); - this.mode = "progressive_" + mode; - this.progressiveLoad = true; -}; - -Page.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; -}; - -Page.prototype.getDisplayIndex = function () { - return this.displayIndex; -}; - -//calculate maximum page from number of rows -Page.prototype.setMaxRows = function (rowCount) { - if (!rowCount) { - this.max = 1; - } else { - this.max = Math.ceil(rowCount / this.size); - } - - if (this.page > this.max) { - this.page = this.max; - } -}; - -//reset to first page without triggering action -Page.prototype.reset = function (force, columnsChanged) { - if (this.mode == "local" || force) { - this.page = 1; - } - - if (columnsChanged) { - this.initialLoad = true; - } - - return true; -}; - -//set the maxmum page -Page.prototype.setMaxPage = function (max) { - - max = parseInt(max); - - this.max = max || 1; - - if (this.page > this.max) { - this.page = this.max; - this.trigger(); - } -}; - -//set current page number -Page.prototype.setPage = function (page) { - var _this2 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - - page = parseInt(page); - - if (page > 0 && page <= _this2.max) { - _this2.page = page; - _this2.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.page) { - self.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Requested page is out of range of 1 - " + _this2.max + ":", page); - reject(); - } - }); -}; - -Page.prototype.setPageToRow = function (row) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var rows = _this3.table.rowManager.getDisplayRows(_this3.displayIndex - 1); - var index = rows.indexOf(row); - - if (index > -1) { - var page = Math.ceil((index + 1) / _this3.size); - - _this3.setPage(page).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - console.warn("Pagination Error - Requested row is not visible"); - reject(); - } - }); -}; - -Page.prototype.setPageSize = function (size) { - size = parseInt(size); - - if (size > 0) { - this.size = size; - } - - if (this.pageSizeSelect) { - // this.pageSizeSelect.value = size; - this.generatePageSizeSelectList(); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.page) { - this.table.modules.persistence.save("page"); - } -}; - -//setup the pagination buttons -Page.prototype._setPageButtons = function () { - var self = this; - - var leftSize = Math.floor((this.count - 1) / 2); - var rightSize = Math.ceil((this.count - 1) / 2); - var min = this.max - this.page + leftSize + 1 < this.count ? this.max - this.count + 1 : Math.max(this.page - leftSize, 1); - var max = this.page <= rightSize ? Math.min(this.count, this.max) : Math.min(this.page + rightSize, this.max); - - while (self.pagesElement.firstChild) { - self.pagesElement.removeChild(self.pagesElement.firstChild); - }if (self.page == 1) { - self.firstBut.disabled = true; - self.prevBut.disabled = true; - } else { - self.firstBut.disabled = false; - self.prevBut.disabled = false; - } - - if (self.page == self.max) { - self.lastBut.disabled = true; - self.nextBut.disabled = true; - } else { - self.lastBut.disabled = false; - self.nextBut.disabled = false; - } - - for (var i = min; i <= max; i++) { - if (i > 0 && i <= self.max) { - self.pagesElement.appendChild(self._generatePageButton(i)); - } - } - - this.footerRedraw(); -}; - -Page.prototype._generatePageButton = function (page) { - var self = this, - button = document.createElement("button"); - - button.classList.add("tabulator-page"); - if (page == self.page) { - button.classList.add("active"); - } - - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", "Show Page " + page); - button.setAttribute("title", "Show Page " + page); - button.setAttribute("data-page", page); - button.textContent = page; - - button.addEventListener("click", function (e) { - self.setPage(page); - }); - - return button; -}; - -//previous page -Page.prototype.previousPage = function () { - var _this4 = this; - - return new Promise(function (resolve, reject) { - if (_this4.page > 1) { - _this4.page--; - _this4.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this4.table.options.persistence && _this4.table.modExists("persistence", true) && _this4.table.modules.persistence.config.page) { - _this4.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Previous page would be less than page 1:", 0); - reject(); - } - }); -}; - -//next page -Page.prototype.nextPage = function () { - var _this5 = this; - - return new Promise(function (resolve, reject) { - if (_this5.page < _this5.max) { - _this5.page++; - _this5.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this5.table.options.persistence && _this5.table.modExists("persistence", true) && _this5.table.modules.persistence.config.page) { - _this5.table.modules.persistence.save("page"); - } - } else { - if (!_this5.progressiveLoad) { - console.warn("Pagination Error - Next page would be greater than maximum page of " + _this5.max + ":", _this5.max + 1); - } - reject(); - } - }); -}; - -//return current page number -Page.prototype.getPage = function () { - return this.page; -}; - -//return max page number -Page.prototype.getPageMax = function () { - return this.max; -}; - -Page.prototype.getPageSize = function (size) { - return this.size; -}; - -Page.prototype.getMode = function () { - return this.mode; -}; - -//return appropriate rows for current page -Page.prototype.getRows = function (data) { - var output, start, end; - - if (this.mode == "local") { - output = []; - start = this.size * (this.page - 1); - end = start + parseInt(this.size); - - this._setPageButtons(); - - for (var i = start; i < end; i++) { - if (data[i]) { - output.push(data[i]); - } - } - - return output; - } else { - - this._setPageButtons(); - - return data.slice(0); - } -}; - -Page.prototype.trigger = function () { - var _this6 = this; - - var left; - - return new Promise(function (resolve, reject) { - - switch (_this6.mode) { - case "local": - left = _this6.table.rowManager.scrollLeft; - - _this6.table.rowManager.refreshActiveData("page"); - _this6.table.rowManager.scrollHorizontal(left); - - _this6.table.options.pageLoaded.call(_this6.table, _this6.getPage()); - resolve(); - break; - - case "remote": - case "progressive_load": - case "progressive_scroll": - _this6.table.modules.ajax.blockActiveRequest(); - _this6._getRemotePage().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - break; - - default: - console.warn("Pagination Error - no such pagination mode:", _this6.mode); - reject(); - } - }); -}; - -Page.prototype._getRemotePage = function () { - var _this7 = this; - - var self = this, - oldParams, - pageParams; - - return new Promise(function (resolve, reject) { - - if (!self.table.modExists("ajax", true)) { - reject(); - } - - //record old params and restore after request has been made - oldParams = Tabulator.prototype.helpers.deepClone(self.table.modules.ajax.getParams() || {}); - pageParams = self.table.modules.ajax.getParams(); - - //configure request params - pageParams[_this7.dataSentNames.page] = self.page; - - //set page size if defined - if (_this7.size) { - pageParams[_this7.dataSentNames.size] = _this7.size; - } - - //set sort data if defined - if (_this7.table.options.ajaxSorting && _this7.table.modExists("sort")) { - var sorters = self.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - pageParams[_this7.dataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (_this7.table.options.ajaxFiltering && _this7.table.modExists("filter")) { - var filters = self.table.modules.filter.getFilters(true, true); - pageParams[_this7.dataSentNames.filters] = filters; - } - - self.table.modules.ajax.setParams(pageParams); - - self.table.modules.ajax.sendRequest(_this7.progressiveLoad).then(function (data) { - self._parseRemoteData(data); - resolve(); - }).catch(function (e) { - reject(); - }); - - self.table.modules.ajax.setParams(oldParams); - }); -}; - -Page.prototype._parseRemoteData = function (data) { - var self = this, - left, - data, - margin; - - if (typeof data[this.dataReceivedNames.last_page] === "undefined") { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property"); - } - - if (data[this.dataReceivedNames.data]) { - this.max = parseInt(data[this.dataReceivedNames.last_page]) || 1; - - if (this.progressiveLoad) { - switch (this.mode) { - case "progressive_load": - - if (this.page == 1) { - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - } else { - this.table.rowManager.addRows(data[this.dataReceivedNames.data]); - } - - if (this.page < this.max) { - setTimeout(function () { - self.nextPage().then(function () {}).catch(function () {}); - }, self.table.options.ajaxProgressiveLoadDelay); - } - break; - - case "progressive_scroll": - data = this.table.rowManager.getData().concat(data[this.dataReceivedNames.data]); - - this.table.rowManager.setData(data, true, this.initialLoad && this.page == 1); - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2; - - if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) { - self.nextPage().then(function () {}).catch(function () {}); - } - break; - } - } else { - left = this.table.rowManager.scrollLeft; - - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - - this.table.rowManager.scrollHorizontal(left); - - this.table.columnManager.scrollHorizontal(left); - - this.table.options.pageLoaded.call(this.table, this.getPage()); - } - - this.initialLoad = false; - } else { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property"); - } -}; - -//handle the footer element being redrawn -Page.prototype.footerRedraw = function () { - var footer = this.table.footerManager.element; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } else { - this.pagesElement.style.display = ''; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } - } -}; - -//set the paramter names for pagination requests -Page.prototype.paginationDataSentNames = { - "page": "page", - "size": "size", - "sorters": "sorters", - // "sort_dir":"sort_dir", - "filters": "filters" - // "filter_value":"filter_value", - // "filter_type":"filter_type", -}; - -//set the property names for pagination responses -Page.prototype.paginationDataReceivedNames = { - "current_page": "current_page", - "last_page": "last_page", - "data": "data" -}; - -Tabulator.prototype.registerModule("page", Page); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/page.min.js b/app/static/vendors/tabulator/js.old/modules/page.min.js deleted file mode 100644 index 300eb4f..0000000 --- a/app/static/vendors/tabulator/js.old/modules/page.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var Page=function(e){this.table=e,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};Page.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},Page.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var a=1;a<5;a++)t.push(this.size*a);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var a=document.createElement("option");a.value=t,a.innerHTML=t,e.pageSizeSelect.appendChild(a)}),this.pageSizeSelect.value=this.size}},Page.prototype.initialize=function(e){var t,a,i,s=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),s.table.modules.localize.bind("pagination|first",function(e){s.firstBut.innerHTML=e}),s.table.modules.localize.bind("pagination|first_title",function(e){s.firstBut.setAttribute("aria-label",e),s.firstBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|prev",function(e){s.prevBut.innerHTML=e}),s.table.modules.localize.bind("pagination|prev_title",function(e){s.prevBut.setAttribute("aria-label",e),s.prevBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|next",function(e){s.nextBut.innerHTML=e}),s.table.modules.localize.bind("pagination|next_title",function(e){s.nextBut.setAttribute("aria-label",e),s.nextBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|last",function(e){s.lastBut.innerHTML=e}),s.table.modules.localize.bind("pagination|last_title",function(e){s.lastBut.setAttribute("aria-label",e),s.lastBut.setAttribute("title",e)}),s.firstBut.addEventListener("click",function(){s.setPage(1)}),s.prevBut.addEventListener("click",function(){s.previousPage()}),s.nextBut.addEventListener("click",function(){s.nextPage().then(function(){}).catch(function(){})}),s.lastBut.addEventListener("click",function(){s.setPage(s.max)}),s.table.options.paginationElement&&(s.element=s.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),s.table.modules.localize.bind("pagination|page_size",function(e){s.pageSizeSelect.setAttribute("aria-label",e),s.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),s.element.appendChild(t),s.element.appendChild(s.pageSizeSelect),s.pageSizeSelect.addEventListener("change",function(e){s.setPageSize(s.pageSizeSelect.value),s.setPage(1).then(function(){}).catch(function(){})})),s.element.appendChild(s.firstBut),s.element.appendChild(s.prevBut),s.element.appendChild(s.pagesElement),s.element.appendChild(s.nextBut),s.element.appendChild(s.lastBut),s.table.options.paginationElement||e||s.table.footerManager.append(s.element,s),s.mode=s.table.options.pagination,s.table.options.paginationSize?s.size=s.table.options.paginationSize:(a=document.createElement("div"),a.classList.add("tabulator-row"),a.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",a.appendChild(i),s.table.rowManager.getTableElement().appendChild(a),s.size=Math.floor(s.table.rowManager.getElement().clientHeight/a.offsetHeight),s.table.rowManager.getTableElement().removeChild(a)),s.count=s.table.options.paginationButtonCount,s.generatePageSizeSelectList()},Page.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},Page.prototype.setDisplayIndex=function(e){this.displayIndex=e},Page.prototype.getDisplayIndex=function(){return this.displayIndex},Page.prototype.setMaxRows=function(e){this.max=e?Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},Page.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},Page.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},Page.prototype.setPage=function(e){var t=this,a=this;return new Promise(function(i,s){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then(function(){i()}).catch(function(){s()}),a.table.options.persistence&&a.table.modExists("persistence",!0)&&a.table.modules.persistence.config.page&&a.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),s())})},Page.prototype.setPageToRow=function(e){var t=this;return new Promise(function(a,i){var s=t.table.rowManager.getDisplayRows(t.displayIndex-1),n=s.indexOf(e);if(n>-1){var o=Math.ceil((n+1)/t.size);t.setPage(o).then(function(){a()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},Page.prototype.setPageSize=function(e){e=parseInt(e),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},Page.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),a=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&n<=e.max&&e.pagesElement.appendChild(e._generatePageButton(n));this.footerRedraw()},Page.prototype._generatePageButton=function(e){var t=this,a=document.createElement("button");return a.classList.add("tabulator-page"),e==t.page&&a.classList.add("active"),a.setAttribute("type","button"),a.setAttribute("role","button"),a.setAttribute("aria-label","Show Page "+e),a.setAttribute("title","Show Page "+e),a.setAttribute("data-page",e),a.textContent=e,a.addEventListener("click",function(a){t.setPage(e)}),a},Page.prototype.previousPage=function(){var e=this;return new Promise(function(t,a){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){a()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),a())})},Page.prototype.nextPage=function(){var e=this;return new Promise(function(t,a){e.page i) { - output.splice(i, 0, column); - } else { - output.push(column); - } - } - }); - - return output; -}; - -//find matching columns -Persistence.prototype._findColumn = function (columns, subject) { - var type = subject.columns ? "group" : subject.field ? "field" : "object"; - - return columns.find(function (col) { - switch (type) { - case "group": - return col.title === subject.title && col.columns.length === subject.columns.length; - break; - - case "field": - return col.field === subject.field; - break; - - case "object": - return col === subject; - break; - } - }); -}; - -//save data -Persistence.prototype.save = function (type) { - var data = {}; - - switch (type) { - case "columns": - data = this.parseColumns(this.table.columnManager.getColumns()); - break; - - case "filter": - data = this.table.modules.filter.getFilters(); - break; - - case "sort": - data = this.validateSorters(this.table.modules.sort.getSort()); - break; - - case "group": - data = this.getGroupConfig(); - break; - - case "page": - data = this.getPageConfig(); - break; - } - - if (this.writeFunc) { - this.writeFunc(this.id, type, data); - } -}; - -//ensure sorters contain no function data -Persistence.prototype.validateSorters = function (data) { - data.forEach(function (item) { - item.column = item.field; - delete item.field; - }); - - return data; -}; - -Persistence.prototype.getGroupConfig = function () { - if (this.config.group) { - if (this.config.group === true || this.config.group.groupBy) { - data.groupBy = this.table.options.groupBy; - } - - if (this.config.group === true || this.config.group.groupStartOpen) { - data.groupStartOpen = this.table.options.groupStartOpen; - } - - if (this.config.group === true || this.config.group.groupHeader) { - data.groupHeader = this.table.options.groupHeader; - } - } - - return data; -}; - -Persistence.prototype.getPageConfig = function () { - var data = {}; - - if (this.config.page) { - if (this.config.page === true || this.config.page.size) { - data.paginationSize = this.table.modules.page.getPageSize(); - } - - if (this.config.page === true || this.config.page.page) { - data.paginationInitialPage = this.table.modules.page.getPage(); - } - } - - return data; -}; - -//parse columns for data to store -Persistence.prototype.parseColumns = function (columns) { - var self = this, - definitions = []; - - columns.forEach(function (column) { - var defStore = {}, - colDef = column.getDefinition(), - keys; - - if (column.isGroup) { - defStore.title = colDef.title; - defStore.columns = self.parseColumns(column.getColumns()); - } else { - defStore.field = column.getField(); - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(colDef); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - - switch (key) { - case "width": - defStore.width = column.getWidth(); - break; - case "visible": - defStore.visible = column.visible; - break; - - default: - defStore[key] = colDef[key]; - } - }); - } - - definitions.push(defStore); - }); - - return definitions; -}; - -// read peristence information from storage -Persistence.prototype.readers = { - local: function local(id, type) { - var data = localStorage.getItem(id + "-" + type); - - return data ? JSON.parse(data) : false; - }, - cookie: function cookie(id, type) { - var cookie = document.cookie, - key = id + "-" + type, - cookiePos = cookie.indexOf(key + "="), - end, - data; - - //if cookie exists, decode and load column data into tabulator - if (cookiePos > -1) { - cookie = cookie.substr(cookiePos); - - end = cookie.indexOf(";"); - - if (end > -1) { - cookie = cookie.substr(0, end); - } - - data = cookie.replace(key + "=", ""); - } - - return data ? JSON.parse(data) : false; - } -}; - -//write persistence information to storage -Persistence.prototype.writers = { - local: function local(id, type, data) { - localStorage.setItem(id + "-" + type, JSON.stringify(data)); - }, - cookie: function cookie(id, type, data) { - var expireDate = new Date(); - - expireDate.setDate(expireDate.getDate() + 10000); - - document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString(); - } -}; - -Tabulator.prototype.registerModule("persistence", Persistence); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/persistence.min.js b/app/static/vendors/tabulator/js.old/modules/persistence.min.js deleted file mode 100644 index 4dd8319..0000000 --- a/app/static/vendors/tabulator/js.old/modules/persistence.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var Persistence=function(e){this.table=e,this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1};Persistence.prototype.localStorageTest=function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}},Persistence.prototype.initialize=function(){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:this.readers[this.table.options.persistenceReaderFunc]?this.readFunc=this.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):this.readers[this.mode]?this.readFunc=this.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:this.readers[this.table.options.persistenceWriterFunc]?this.writeFunc=this.readers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):this.writers[this.mode]?this.writeFunc=this.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader))},Persistence.prototype.initializeColumn=function(e){var t,i,s=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),i=!0===this.config.columns?Object.keys(t):this.config.columns,i.forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e),o=t[e];i&&Object.defineProperty(t,e,{set:function(e){o=e,s.defWatcherBlock||s.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),o}})}),this.defWatcherBlock=!1)},Persistence.prototype.load=function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i},Persistence.prototype.retreiveData=function(e){return!!this.readFunc&&this.readFunc(this.id,e)},Persistence.prototype.mergeDefinition=function(e,t){var i=this,s=[];return t=t||[],t.forEach(function(t,o){var n,r=i._findColumn(e,t);r&&(!0===i.config.columns||void 0==i.config.columns?(n=Object.keys(r),n.push("width")):n=i.config.columns,n.forEach(function(e){void 0!==t[e]&&(r[e]=t[e])}),r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),s.push(r))}),e.forEach(function(e,o){i._findColumn(t,e)||(s.length>o?s.splice(o,0,e):s.push(e))}),s},Persistence.prototype._findColumn=function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},Persistence.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},Persistence.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},Persistence.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},Persistence.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},Persistence.prototype.parseColumns=function(e){var t=this,i=[];return e.forEach(function(e){var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=t.parseColumns(e.getColumns())):(o.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(s=Object.keys(n),s.push("width")):s=t.config.columns,s.forEach(function(t){switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:o[t]=n[t]}})),i.push(o)}),i},Persistence.prototype.readers={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&(o=o.substr(r),i=o.indexOf(";"),i>-1&&(o=o.substr(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},Persistence.prototype.writers={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}},Tabulator.prototype.registerModule("persistence",Persistence); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/print.js b/app/static/vendors/tabulator/js.old/modules/print.js deleted file mode 100644 index 7588094..0000000 --- a/app/static/vendors/tabulator/js.old/modules/print.js +++ /dev/null @@ -1,96 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Print = function Print(table) { - this.table = table; //hold Tabulator object - this.element = false; - this.manualBlock = false; -}; - -Print.prototype.initialize = function () { - window.addEventListener("beforeprint", this.replaceTable.bind(this)); - window.addEventListener("afterprint", this.cleanup.bind(this)); -}; - -Print.prototype.replaceTable = function () { - if (!this.manualBlock) { - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-table"); - - this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print")); - - this.table.element.style.display = "none"; - - this.table.element.parentNode.insertBefore(this.element, this.table.element); - } -}; - -Print.prototype.cleanup = function () { - document.body.classList.remove("tabulator-print-fullscreen-hide"); - - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - this.table.element.style.display = ""; - } -}; - -Print.prototype.printFullscreen = function (visible, style, config) { - var scrollX = window.scrollX, - scrollY = window.scrollY, - headerEl = document.createElement("div"), - footerEl = document.createElement("div"), - tableEl = this.table.modules.export.genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible, "print"), - headerContent, - footerContent; - - this.manualBlock = true; - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-fullscreen"); - - if (this.table.options.printHeader) { - headerEl.classList.add("tabulator-print-header"); - - headerContent = typeof this.table.options.printHeader == "function" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader; - - if (typeof headerContent == "string") { - headerEl.innerHTML = headerContent; - } else { - headerEl.appendChild(headerContent); - } - - this.element.appendChild(headerEl); - } - - this.element.appendChild(tableEl); - - if (this.table.options.printFooter) { - footerEl.classList.add("tabulator-print-footer"); - - footerContent = typeof this.table.options.printFooter == "function" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter; - - if (typeof footerContent == "string") { - footerEl.innerHTML = footerContent; - } else { - footerEl.appendChild(footerContent); - } - - this.element.appendChild(footerEl); - } - - document.body.classList.add("tabulator-print-fullscreen-hide"); - document.body.appendChild(this.element); - - if (this.table.options.printFormatter) { - this.table.options.printFormatter(this.element, tableEl); - } - - window.print(); - - this.cleanup(); - - window.scrollTo(scrollX, scrollY); - - this.manualBlock = false; -}; - -Tabulator.prototype.registerModule("print", Print); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/print.min.js b/app/static/vendors/tabulator/js.old/modules/print.min.js deleted file mode 100644 index fda1db2..0000000 --- a/app/static/vendors/tabulator/js.old/modules/print.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var Print=function(t){this.table=t,this.element=!1,this.manualBlock=!1};Print.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},Print.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))},Print.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")},Print.prototype.printFullscreen=function(t,e,i){var n,l,o=window.scrollX,a=window.scrollY,s=document.createElement("div"),r=document.createElement("div"),p=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(s.classList.add("tabulator-print-header"),n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof n?s.innerHTML=n:s.appendChild(n),this.element.appendChild(s)),this.element.appendChild(p),this.table.options.printFooter&&(r.classList.add("tabulator-print-footer"),l="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof l?r.innerHTML=l:r.appendChild(l),this.element.appendChild(r)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,p),window.print(),this.cleanup(),window.scrollTo(o,a),this.manualBlock=!1},Tabulator.prototype.registerModule("print",Print); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/reactive_data.js b/app/static/vendors/tabulator/js.old/modules/reactive_data.js deleted file mode 100644 index e173aa9..0000000 --- a/app/static/vendors/tabulator/js.old/modules/reactive_data.js +++ /dev/null @@ -1,235 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var ReactiveData = function ReactiveData(table) { - this.table = table; //hold Tabulator object - this.data = false; - this.blocked = false; //block reactivity while performing update - this.origFuncs = {}; // hold original data array functions to allow replacement after data is done with - this.currentVersion = 0; -}; - -ReactiveData.prototype.watchData = function (data) { - var self = this, - pushFunc, - version; - - this.currentVersion++; - - version = this.currentVersion; - - self.unwatchData(); - - self.data = data; - - //override array push function - self.origFuncs.push = data.push; - - Object.defineProperty(self.data, "push", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, false); - }); - } - - return self.origFuncs.push.apply(data, arguments); - } - }); - - //override array unshift function - self.origFuncs.unshift = data.unshift; - - Object.defineProperty(self.data, "unshift", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, true); - }); - } - - return self.origFuncs.unshift.apply(data, arguments); - } - }); - - //override array shift function - self.origFuncs.shift = data.shift; - - Object.defineProperty(self.data, "shift", { - enumerable: false, - configurable: true, - value: function value() { - var row; - - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[0]); - - if (row) { - row.deleteActual(); - } - } - } - - return self.origFuncs.shift.call(data); - } - }); - - //override array pop function - self.origFuncs.pop = data.pop; - - Object.defineProperty(self.data, "pop", { - enumerable: false, - configurable: true, - value: function value() { - var row; - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]); - - if (row) { - row.deleteActual(); - } - } - } - return self.origFuncs.pop.call(data); - } - }); - - //override array splice function - self.origFuncs.splice = data.splice; - - Object.defineProperty(self.data, "splice", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments), - start = args[0] < 0 ? data.length + args[0] : args[0], - end = args[1], - newRows = args[2] ? args.slice(2) : false, - startRow; - - if (!self.blocked && version === self.currentVersion) { - - //add new rows - if (newRows) { - startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false; - - if (startRow) { - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, startRow, true); - }); - } else { - newRows = newRows.slice().reverse(); - - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, false, true); - }); - } - } - - //delete removed rows - if (end !== 0) { - var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end); - - oldRows.forEach(function (rowData, i) { - var row = self.table.rowManager.getRowFromDataObject(rowData); - - if (row) { - row.deleteActual(i !== oldRows.length - 1); - } - }); - } - - if (newRows || end !== 0) { - self.table.rowManager.reRenderInPosition(); - } - } - - return self.origFuncs.splice.apply(data, arguments); - } - }); -}; - -ReactiveData.prototype.unwatchData = function () { - if (this.data !== false) { - for (var key in this.origFuncs) { - Object.defineProperty(this.data, key, { - enumerable: true, - configurable: true, - writable: true, - value: this.origFuncs.key - }); - } - } -}; - -ReactiveData.prototype.watchRow = function (row) { - var self = this, - data = row.getData(); - - this.blocked = true; - - for (var key in data) { - this.watchKey(row, data, key); - } - - this.blocked = false; -}; - -ReactiveData.prototype.watchKey = function (row, data, key) { - var self = this, - props = Object.getOwnPropertyDescriptor(data, key), - value = data[key], - version = this.currentVersion; - - Object.defineProperty(data, key, { - set: function set(newValue) { - value = newValue; - if (!self.blocked && version === self.currentVersion) { - var update = {}; - update[key] = newValue; - row.updateData(update); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - - if (props.get) { - props.get(); - } - - return value; - } - }); -}; - -ReactiveData.prototype.unwatchRow = function (row) { - var data = row.getData(); - - for (var key in data) { - Object.defineProperty(data, key, { - value: data[key] - }); - } -}; - -ReactiveData.prototype.block = function () { - this.blocked = true; -}; - -ReactiveData.prototype.unblock = function () { - this.blocked = false; -}; - -Tabulator.prototype.registerModule("reactiveData", ReactiveData); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/reactive_data.min.js b/app/static/vendors/tabulator/js.old/modules/reactive_data.min.js deleted file mode 100644 index dd4e33b..0000000 --- a/app/static/vendors/tabulator/js.old/modules/reactive_data.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var ReactiveData=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};ReactiveData.prototype.watchData=function(e){var t,a=this;this.currentVersion++,t=this.currentVersion,a.unwatchData(),a.data=e,a.origFuncs.push=e.push,Object.defineProperty(a.data,"push",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!1)}),a.origFuncs.push.apply(e,arguments)}}),a.origFuncs.unshift=e.unshift,Object.defineProperty(a.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!0)}),a.origFuncs.unshift.apply(e,arguments)}}),a.origFuncs.shift=e.shift,Object.defineProperty(a.data,"shift",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[0]))&&r.deleteActual(),a.origFuncs.shift.call(e)}}),a.origFuncs.pop=e.pop,Object.defineProperty(a.data,"pop",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[a.data.length-1]))&&r.deleteActual(),a.origFuncs.pop.call(e)}}),a.origFuncs.splice=e.splice,Object.defineProperty(a.data,"splice",{enumerable:!1,configurable:!0,value:function(){var r,o=Array.from(arguments),n=o[0]<0?e.length+o[0]:o[0],c=o[1],i=!!o[2]&&o.slice(2);if(!a.blocked&&t===a.currentVersion){if(i&&(r=!!e[n]&&a.table.rowManager.getRowFromDataObject(e[n]),r?i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,r,!0)}):(i=i.slice().reverse(),i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==c){var u=e.slice(n,void 0===o[1]?o[1]:n+c);u.forEach(function(e,t){var r=a.table.rowManager.getRowFromDataObject(e);r&&r.deleteActual(t!==u.length-1)})}(i||0!==c)&&a.table.rowManager.reRenderInPosition()}return a.origFuncs.splice.apply(e,arguments)}})},ReactiveData.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},ReactiveData.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var a in t)this.watchKey(e,t,a);this.blocked=!1},ReactiveData.prototype.watchKey=function(e,t,a){var r=this,o=Object.getOwnPropertyDescriptor(t,a),n=t[a],c=this.currentVersion;Object.defineProperty(t,a,{set:function(t){if(n=t,!r.blocked&&c===r.currentVersion){var i={};i[a]=t,e.updateData(i)}o.set&&o.set(t)},get:function(){return o.get&&o.get(),n}})},ReactiveData.prototype.unwatchRow=function(e){var t=e.getData();for(var a in t)Object.defineProperty(t,a,{value:t[a]})},ReactiveData.prototype.block=function(){this.blocked=!0},ReactiveData.prototype.unblock=function(){this.blocked=!1},Tabulator.prototype.registerModule("reactiveData",ReactiveData); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_columns.js b/app/static/vendors/tabulator/js.old/modules/resize_columns.js deleted file mode 100644 index 69bcf04..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_columns.js +++ /dev/null @@ -1,163 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var ResizeColumns = function ResizeColumns(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startX = false; - this.startWidth = false; - this.handle = null; - this.prevHandle = null; -}; - -ResizeColumns.prototype.initializeColumn = function (type, column, element) { - var self = this, - variableHeight = false, - mode = this.table.options.resizableColumns; - - //set column resize mode - if (type === "header") { - variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight; - column.modules.resize = { variableHeight: variableHeight }; - } - - if (mode === true || mode == type) { - - var handle = document.createElement('div'); - handle.className = "tabulator-col-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-col-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - var nearestColumn = column.getLastColumn(); - - if (nearestColumn && self._checkResizability(nearestColumn)) { - self.startColumn = column; - self._mouseDown(e, nearestColumn, handle); - } - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - //reszie column on double click - handle.addEventListener("dblclick", function (e) { - var col = column.getLastColumn(); - - if (col && self._checkResizability(col)) { - e.stopPropagation(); - col.reinitializeWidth(true); - } - }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - self.startColumn = column; - self._mouseDown(e, prevColumn, prevHandle); - } - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - //resize column on double click - prevHandle.addEventListener("dblclick", function (e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - e.stopPropagation(); - prevColumn.reinitializeWidth(true); - } - } - }); - - element.appendChild(handle); - element.appendChild(prevHandle); - } -}; - -ResizeColumns.prototype._checkResizability = function (column) { - return typeof column.definition.resizable != "undefined" ? column.definition.resizable : this.table.options.resizableColumns; -}; - -ResizeColumns.prototype._mouseDown = function (e, column, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - // self.table.columnManager.tempScrollBlock(); - - column.setWidth(self.startWidth + ((typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX) - self.startX)); - - if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - } - - function mouseUp(e) { - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = false; - } - - if (self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - - document.body.removeEventListener("mouseup", mouseUp); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.save("columns"); - } - - self.table.options.columnResized.call(self.table, column.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = true; - } - - self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX; - self.startWidth = column.getWidth(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); -}; - -Tabulator.prototype.registerModule("resizeColumns", ResizeColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_columns.min.js b/app/static/vendors/tabulator/js.old/modules/resize_columns.min.js deleted file mode 100644 index 5927aed..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var ResizeColumns=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};ResizeColumns.prototype.initializeColumn=function(e,t,n){var o=this,i=!1,s=this.table.options.resizableColumns;if("header"===e&&(i="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:i}),!0===s||s==e){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var l=document.createElement("div");l.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(e){e.stopPropagation()});var r=function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(o.startColumn=t,o._mouseDown(e,n,a))};a.addEventListener("mousedown",r),a.addEventListener("touchstart",r,{passive:!0}),a.addEventListener("dblclick",function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(e.stopPropagation(),n.reinitializeWidth(!0))}),l.addEventListener("click",function(e){e.stopPropagation()});var d=function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(o.startColumn=t,o._mouseDown(e,s,l)))};l.addEventListener("mousedown",d),l.addEventListener("touchstart",d,{passive:!0}),l.addEventListener("dblclick",function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),n.appendChild(a),n.appendChild(l)}},ResizeColumns.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},ResizeColumns.prototype._mouseDown=function(e,t,n){function o(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function i(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),n.removeEventListener("touchend",i),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",i),n.addEventListener("touchmove",o,{passive:!0}),n.addEventListener("touchend",i)},Tabulator.prototype.registerModule("resizeColumns",ResizeColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_rows.js b/app/static/vendors/tabulator/js.old/modules/resize_rows.js deleted file mode 100644 index 8cb1de2..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_rows.js +++ /dev/null @@ -1,98 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var ResizeRows = function ResizeRows(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startY = false; - this.startHeight = false; - this.handle = null; - this.prevHandle = null; -}; - -ResizeRows.prototype.initializeRow = function (row) { - var self = this, - rowEl = row.getElement(); - - var handle = document.createElement('div'); - handle.className = "tabulator-row-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-row-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - self.startRow = row; - self._mouseDown(e, row, handle); - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var prevRow = self.table.rowManager.prevDisplayRow(row); - - if (prevRow) { - self.startRow = prevRow; - self._mouseDown(e, prevRow, prevHandle); - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - rowEl.appendChild(handle); - rowEl.appendChild(prevHandle); -}; - -ResizeRows.prototype._mouseDown = function (e, row, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - row.setHeight(self.startHeight + ((typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY) - self.startY)); - } - - function mouseUp(e) { - - // //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = false; - // } - - document.body.removeEventListener("mouseup", mouseMove); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - self.table.options.rowResized.call(this.table, row.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = true; - // } - - self.startY = typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY; - self.startHeight = row.getHeight(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); -}; - -Tabulator.prototype.registerModule("resizeRows", ResizeRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_rows.min.js b/app/static/vendors/tabulator/js.old/modules/resize_rows.min.js deleted file mode 100644 index e8304e2..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var ResizeRows=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};ResizeRows.prototype.initializeRow=function(e){var t=this,o=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(e){e.stopPropagation()});var a=function(o){t.startRow=e,t._mouseDown(o,e,s)};s.addEventListener("mousedown",a),s.addEventListener("touchstart",a,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(o,s,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(s),o.appendChild(n)},ResizeRows.prototype._mouseDown=function(e,t,o){function s(e){t.setHeight(a.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-a.startY))}function n(e){document.body.removeEventListener("mouseup",s),document.body.removeEventListener("mousemove",s),o.removeEventListener("touchmove",s),o.removeEventListener("touchend",n),a.table.element.classList.remove("tabulator-block-select"),a.table.options.rowResized.call(this.table,t.getComponent())}var a=this;a.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),a.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,a.startHeight=t.getHeight(),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",s,{passive:!0}),o.addEventListener("touchend",n)},Tabulator.prototype.registerModule("resizeRows",ResizeRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_table.js b/app/static/vendors/tabulator/js.old/modules/resize_table.js deleted file mode 100644 index a2a899e..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_table.js +++ /dev/null @@ -1,107 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var ResizeTable = function ResizeTable(table) { - this.table = table; //hold Tabulator object - this.binding = false; - this.observer = false; - this.containerObserver = false; - - this.tableHeight = 0; - this.tableWidth = 0; - this.containerHeight = 0; - this.containerWidth = 0; - - this.autoResize = false; -}; - -ResizeTable.prototype.initialize = function (row) { - var _this = this; - - var table = this.table, - tableStyle; - - this.tableHeight = table.element.clientHeight; - this.tableWidth = table.element.clientWidth; - - if (table.element.parentNode) { - this.containerHeight = table.element.parentNode.clientHeight; - this.containerWidth = table.element.parentNode.clientWidth; - } - - if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") { - - this.autoResize = true; - - this.observer = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this.tableHeight != nodeHeight || _this.tableWidth != nodeWidth) { - _this.tableHeight = nodeHeight; - _this.tableWidth = nodeWidth; - - if (table.element.parentNode) { - _this.containerHeight = table.element.parentNode.clientHeight; - _this.containerWidth = table.element.parentNode.clientWidth; - } - - table.redraw(); - } - } - }); - - this.observer.observe(table.element); - - tableStyle = window.getComputedStyle(table.element); - - if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) { - - this.containerObserver = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this.containerHeight != nodeHeight || _this.containerWidth != nodeWidth) { - _this.containerHeight = nodeHeight; - _this.containerWidth = nodeWidth; - _this.tableHeight = table.element.clientHeight; - _this.tableWidth = table.element.clientWidth; - - table.redraw(); - } - - table.redraw(); - } - }); - - this.containerObserver.observe(this.table.element.parentNode); - } - } else { - this.binding = function () { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - table.redraw(); - } - }; - - window.addEventListener("resize", this.binding); - } -}; - -ResizeTable.prototype.clearBindings = function (row) { - if (this.binding) { - window.removeEventListener("resize", this.binding); - } - - if (this.observer) { - this.observer.unobserve(this.table.element); - } - - if (this.containerObserver) { - this.containerObserver.unobserve(this.table.element.parentNode); - } -}; - -Tabulator.prototype.registerModule("resizeTable", ResizeTable); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/resize_table.min.js b/app/static/vendors/tabulator/js.old/modules/resize_table.min.js deleted file mode 100644 index 8d1be93..0000000 --- a/app/static/vendors/tabulator/js.old/modules/resize_table.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var ResizeTable=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};ResizeTable.prototype.initialize=function(e){var t,i=this,n=this.table;this.tableHeight=n.element.clientHeight,this.tableWidth=n.element.clientWidth,n.element.parentNode&&(this.containerHeight=n.element.parentNode.clientHeight,this.containerWidth=n.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===n.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.tableHeight==t&&i.tableWidth==r||(i.tableHeight=t,i.tableWidth=r,n.element.parentNode&&(i.containerHeight=n.element.parentNode.clientHeight,i.containerWidth=n.element.parentNode.clientWidth),n.redraw())}}),this.observer.observe(n.element),t=window.getComputedStyle(n.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.containerHeight==t&&i.containerWidth==r||(i.containerHeight=t,i.containerWidth=r,i.tableHeight=n.element.clientHeight,i.tableWidth=n.element.clientWidth,n.redraw()),n.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell)&&n.redraw()},window.addEventListener("resize",this.binding))},ResizeTable.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},Tabulator.prototype.registerModule("resizeTable",ResizeTable); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/responsive_layout.js b/app/static/vendors/tabulator/js.old/modules/responsive_layout.js deleted file mode 100644 index 99f1ff4..0000000 --- a/app/static/vendors/tabulator/js.old/modules/responsive_layout.js +++ /dev/null @@ -1,301 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var ResponsiveLayout = function ResponsiveLayout(table) { - this.table = table; //hold Tabulator object - this.columns = []; - this.hiddenColumns = []; - this.mode = ""; - this.index = 0; - this.collapseFormatter = []; - this.collapseStartOpen = true; - this.collapseHandleColumn = false; -}; - -//generate resposive columns list -ResponsiveLayout.prototype.initialize = function () { - var self = this, - columns = []; - - this.mode = this.table.options.responsiveLayout; - this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData; - this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen; - this.hiddenColumns = []; - - //detemine level of responsivity for each column - this.table.columnManager.columnsByIndex.forEach(function (column, i) { - if (column.modules.responsive) { - if (column.modules.responsive.order && column.modules.responsive.visible) { - column.modules.responsive.index = i; - columns.push(column); - - if (!column.visible && self.mode === "collapse") { - self.hiddenColumns.push(column); - } - } - } - }); - - //sort list by responsivity - columns = columns.reverse(); - columns = columns.sort(function (a, b) { - var diff = b.modules.responsive.order - a.modules.responsive.order; - return diff || b.modules.responsive.index - a.modules.responsive.index; - }); - - this.columns = columns; - - if (this.mode === "collapse") { - this.generateCollapsedContent(); - } - - //assign collapse column - for (var _iterator = this.table.columnManager.columnsByIndex, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var col = _ref; - - if (col.definition.formatter == "responsiveCollapse") { - this.collapseHandleColumn = col; - break; - } - } - - if (this.collapseHandleColumn) { - if (this.hiddenColumns.length) { - this.collapseHandleColumn.show(); - } else { - this.collapseHandleColumn.hide(); - } - } -}; - -//define layout information -ResponsiveLayout.prototype.initializeColumn = function (column) { - var def = column.getDefinition(); - - column.modules.responsive = { order: typeof def.responsive === "undefined" ? 1 : def.responsive, visible: def.visible === false ? false : true }; -}; - -ResponsiveLayout.prototype.initializeRow = function (row) { - var el; - - if (row.type !== "calc") { - el = document.createElement("div"); - el.classList.add("tabulator-responsive-collapse"); - - row.modules.responsiveLayout = { - element: el, - open: this.collapseStartOpen - }; - - if (!this.collapseStartOpen) { - el.style.display = 'none'; - } - } -}; - -ResponsiveLayout.prototype.layoutRow = function (row) { - var rowEl = row.getElement(); - - if (row.modules.responsiveLayout) { - rowEl.appendChild(row.modules.responsiveLayout.element); - this.generateCollapsedRowContent(row); - } -}; - -//update column visibility -ResponsiveLayout.prototype.updateColumnVisibility = function (column, visible) { - var index; - if (column.modules.responsive) { - column.modules.responsive.visible = visible; - this.initialize(); - } -}; - -ResponsiveLayout.prototype.hideColumn = function (column) { - var colCount = this.hiddenColumns.length; - - column.hide(false, true); - - if (this.mode === "collapse") { - this.hiddenColumns.unshift(column); - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !colCount) { - this.collapseHandleColumn.show(); - } - } -}; - -ResponsiveLayout.prototype.showColumn = function (column) { - var index; - - column.show(false, true); - //set column width to prevent calculation loops on uninitialized columns - column.setWidth(column.getWidth()); - - if (this.mode === "collapse") { - index = this.hiddenColumns.indexOf(column); - - if (index > -1) { - this.hiddenColumns.splice(index, 1); - } - - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !this.hiddenColumns.length) { - this.collapseHandleColumn.hide(); - } - } -}; - -//redraw columns to fit space -ResponsiveLayout.prototype.update = function () { - var self = this, - working = true; - - while (working) { - - var width = self.table.modules.layout.getMode() == "fitColumns" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth(); - - var diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width; - - if (diff < 0) { - //table is too wide - var column = self.columns[self.index]; - - if (column) { - self.hideColumn(column); - self.index++; - } else { - working = false; - } - } else { - - //table has spare space - var _column = self.columns[self.index - 1]; - - if (_column) { - if (diff > 0) { - if (diff >= _column.getWidth()) { - self.showColumn(_column); - self.index--; - } else { - working = false; - } - } else { - working = false; - } - } else { - working = false; - } - } - - if (!self.table.rowManager.activeRowsCount) { - self.table.rowManager.renderEmptyScroll(); - } - } -}; - -ResponsiveLayout.prototype.generateCollapsedContent = function () { - var self = this, - rows = this.table.rowManager.getDisplayRows(); - - rows.forEach(function (row) { - self.generateCollapsedRowContent(row); - }); -}; - -ResponsiveLayout.prototype.generateCollapsedRowContent = function (row) { - var el, contents; - - if (row.modules.responsiveLayout) { - el = row.modules.responsiveLayout.element; - - while (el.firstChild) { - el.removeChild(el.firstChild); - }contents = this.collapseFormatter(this.generateCollapsedRowData(row)); - if (contents) { - el.appendChild(contents); - } - } -}; - -ResponsiveLayout.prototype.generateCollapsedRowData = function (row) { - var self = this, - data = row.getData(), - output = [], - mockCellComponent; - - this.hiddenColumns.forEach(function (column) { - var value = column.getFieldValue(data); - - if (column.definition.title && column.field) { - if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) { - - mockCellComponent = { - value: false, - data: {}, - getValue: function getValue() { - return value; - }, - getData: function getData() { - return data; - }, - getElement: function getElement() { - return document.createElement("div"); - }, - getRow: function getRow() { - return row.getComponent(); - }, - getColumn: function getColumn() { - return column.getComponent(); - } - }; - - output.push({ - title: column.definition.title, - value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params) - }); - } else { - output.push({ - title: column.definition.title, - value: value - }); - } - } - }); - - return output; -}; - -ResponsiveLayout.prototype.formatCollapsedData = function (data) { - var list = document.createElement("table"), - listContents = ""; - - data.forEach(function (item) { - var div = document.createElement("div"); - - if (item.value instanceof Node) { - div.appendChild(item.value); - item.value = div.innerHTML; - } - - listContents += "" + item.title + "" + item.value + ""; - }); - - list.innerHTML = listContents; - - return Object.keys(data).length ? list : ""; -}; - -Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/responsive_layout.min.js b/app/static/vendors/tabulator/js.old/modules/responsive_layout.min.js deleted file mode 100644 index 427b1e9..0000000 --- a/app/static/vendors/tabulator/js.old/modules/responsive_layout.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var ResponsiveLayout=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};ResponsiveLayout.prototype.initialize=function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,n){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=n,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();for(var o=this.table.columnManager.columnsByIndex,n=Array.isArray(o),s=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(s>=o.length)break;i=o[s++]}else{if(s=o.next(),s.done)break;i=s.value}var l=i;if("responsiveCollapse"==l.definition.formatter){this.collapseHandleColumn=l;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},ResponsiveLayout.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},ResponsiveLayout.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},ResponsiveLayout.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},ResponsiveLayout.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},ResponsiveLayout.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(n<0){var s=e.columns[e.index];s?(e.hideColumn(s),e.index++):t=!1}else{var i=e.columns[e.index-1];i&&n>0&&n>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},ResponsiveLayout.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},ResponsiveLayout.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},ResponsiveLayout.prototype.generateCollapsedRowData=function(e){var t,o=this,n=e.getData(),s=[];return this.hiddenColumns.forEach(function(i){var l=i.getFieldValue(n);i.definition.title&&i.field&&(i.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return l},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return i.getComponent()}},s.push({title:i.definition.title,value:i.modules.format.formatter.call(o.table.modules.format,t,i.modules.format.params)})):s.push({title:i.definition.title,value:l}))}),s},ResponsiveLayout.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},Tabulator.prototype.registerModule("responsiveLayout",ResponsiveLayout); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/select_row.js b/app/static/vendors/tabulator/js.old/modules/select_row.js deleted file mode 100644 index 6da6884..0000000 --- a/app/static/vendors/tabulator/js.old/modules/select_row.js +++ /dev/null @@ -1,417 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var SelectRow = function SelectRow(table) { - this.table = table; //hold Tabulator object - this.selecting = false; //flag selecting in progress - this.lastClickedRow = false; //last clicked row - this.selectPrev = []; //hold previously selected element for drag drop selection - this.selectedRows = []; //hold selected rows - this.headerCheckboxElement = null; // hold header select element -}; - -SelectRow.prototype.clearSelectionData = function (silent) { - this.selecting = false; - this.lastClickedRow = false; - this.selectPrev = []; - this.selectedRows = []; - - if (!silent) { - this._rowSelectionChanged(); - } -}; - -SelectRow.prototype.initializeRow = function (row) { - var self = this, - element = row.getElement(); - - // trigger end of row selection - var endSelect = function endSelect() { - - setTimeout(function () { - self.selecting = false; - }, 50); - - document.body.removeEventListener("mouseup", endSelect); - }; - - row.modules.select = { selected: false }; - - //set row selection class - if (self.table.options.selectableCheck.call(this.table, row.getComponent())) { - element.classList.add("tabulator-selectable"); - element.classList.remove("tabulator-unselectable"); - - if (self.table.options.selectable && self.table.options.selectable != "highlight") { - if (self.table.options.selectableRangeMode === "click") { - element.addEventListener("click", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - self.lastClickedRow = self.lastClickedRow || row; - - var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow); - var rowIdx = self.table.rowManager.getDisplayRowIndex(row); - - var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx; - var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx; - - var rows = self.table.rowManager.getDisplayRows().slice(0); - var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1); - - if (e.ctrlKey || e.metaKey) { - toggledRows.forEach(function (toggledRow) { - if (toggledRow !== self.lastClickedRow) { - - if (self.table.options.selectable !== true && !self.isRowSelected(row)) { - if (self.selectedRows.length < self.table.options.selectable) { - self.toggleRow(toggledRow); - } - } else { - self.toggleRow(toggledRow); - } - } - }); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - - if (self.table.options.selectable !== true) { - if (toggledRows.length > self.table.options.selectable) { - toggledRows = toggledRows.slice(0, self.table.options.selectable); - } - } - - self.selectRows(toggledRows); - } - self.table._clearSelection(); - } else if (e.ctrlKey || e.metaKey) { - self.toggleRow(row); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - self.selectRows(row); - self.lastClickedRow = row; - } - }); - } else { - element.addEventListener("click", function (e) { - if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) { - self.table._clearSelection(); - } - - if (!self.selecting) { - self.toggleRow(row); - } - }); - - element.addEventListener("mousedown", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - - self.selecting = true; - - self.selectPrev = []; - - document.body.addEventListener("mouseup", endSelect); - document.body.addEventListener("keyup", endSelect); - - self.toggleRow(row); - - return false; - } - }); - - element.addEventListener("mouseenter", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.toggleRow(row); - - if (self.selectPrev[1] == row) { - self.toggleRow(self.selectPrev[0]); - } - } - }); - - element.addEventListener("mouseout", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.selectPrev.unshift(row); - } - }); - } - } - } else { - element.classList.add("tabulator-unselectable"); - element.classList.remove("tabulator-selectable"); - } -}; - -//toggle row selection -SelectRow.prototype.toggleRow = function (row) { - if (this.table.options.selectableCheck.call(this.table, row.getComponent())) { - if (row.modules.select && row.modules.select.selected) { - this._deselectRow(row); - } else { - this._selectRow(row); - } - } -}; - -//select a number of rows -SelectRow.prototype.selectRows = function (rows) { - var _this = this; - - var rowMatch; - - switch (typeof rows === "undefined" ? "undefined" : _typeof(rows)) { - case "undefined": - this.table.rowManager.rows.forEach(function (row) { - _this._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - break; - - case "string": - - rowMatch = this.table.rowManager.findRow(rows); - - if (rowMatch) { - this._selectRow(rowMatch, true, true); - } else { - this.table.rowManager.getRows(rows).forEach(function (row) { - _this._selectRow(row, true, true); - }); - } - - this._rowSelectionChanged(); - break; - - default: - if (Array.isArray(rows)) { - rows.forEach(function (row) { - _this._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - } else { - this._selectRow(rows, false, true); - } - break; - } -}; - -//select an individual row -SelectRow.prototype._selectRow = function (rowInfo, silent, force) { - var index; - - //handle max row count - if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) { - if (this.selectedRows.length >= this.table.options.selectable) { - if (this.table.options.selectableRollingSelection) { - this._deselectRow(this.selectedRows[0]); - } else { - return false; - } - } - } - - var row = this.table.rowManager.findRow(rowInfo); - - if (row) { - if (this.selectedRows.indexOf(row) == -1) { - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = true; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = true; - } - row.getElement().classList.add("tabulator-selected"); - - this.selectedRows.push(row); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, true); - } - - if (!silent) { - this.table.options.rowSelected.call(this.table, row.getComponent()); - } - - this._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo); - } - } -}; - -SelectRow.prototype.isRowSelected = function (row) { - return this.selectedRows.indexOf(row) !== -1; -}; - -//deselect a number of rows -SelectRow.prototype.deselectRows = function (rows, silent) { - var self = this, - rowCount; - - if (typeof rows == "undefined") { - - rowCount = self.selectedRows.length; - - for (var i = 0; i < rowCount; i++) { - self._deselectRow(self.selectedRows[0], true); - } - - self._rowSelectionChanged(silent); - } else { - if (Array.isArray(rows)) { - rows.forEach(function (row) { - self._deselectRow(row, true); - }); - - self._rowSelectionChanged(silent); - } else { - self._deselectRow(rows, silent); - } - } -}; - -//deselect an individual row -SelectRow.prototype._deselectRow = function (rowInfo, silent) { - var self = this, - row = self.table.rowManager.findRow(rowInfo), - index; - - if (row) { - index = self.selectedRows.findIndex(function (selectedRow) { - return selectedRow == row; - }); - - if (index > -1) { - - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = false; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = false; - } - row.getElement().classList.remove("tabulator-selected"); - self.selectedRows.splice(index, 1); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, false); - } - - if (!silent) { - self.table.options.rowDeselected.call(this.table, row.getComponent()); - } - - self._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo); - } - } -}; - -SelectRow.prototype.getSelectedData = function () { - var data = []; - - this.selectedRows.forEach(function (row) { - data.push(row.getData()); - }); - - return data; -}; - -SelectRow.prototype.getSelectedRows = function () { - - var rows = []; - - this.selectedRows.forEach(function (row) { - rows.push(row.getComponent()); - }); - - return rows; -}; - -SelectRow.prototype._rowSelectionChanged = function (silent) { - if (this.headerCheckboxElement) { - if (this.selectedRows.length === 0) { - this.headerCheckboxElement.checked = false; - this.headerCheckboxElement.indeterminate = false; - } else if (this.table.rowManager.rows.length === this.selectedRows.length) { - this.headerCheckboxElement.checked = true; - this.headerCheckboxElement.indeterminate = false; - } else { - this.headerCheckboxElement.indeterminate = true; - this.headerCheckboxElement.checked = false; - } - } - - if (!silent) { - this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows()); - } -}; - -SelectRow.prototype.registerRowSelectCheckbox = function (row, element) { - if (!row._row.modules.select) { - row._row.modules.select = {}; - } - - row._row.modules.select.checkboxEl = element; -}; - -SelectRow.prototype.registerHeaderSelectCheckbox = function (element) { - this.headerCheckboxElement = element; -}; - -SelectRow.prototype.childRowSelection = function (row, select) { - var children = this.table.modules.dataTree.getChildren(row); - - if (select) { - for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var child = _ref; - - this._selectRow(child, true); - } - } else { - for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var _child = _ref2; - - this._deselectRow(_child, true); - } - } -}; - -Tabulator.prototype.registerModule("selectRow", SelectRow); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/select_row.min.js b/app/static/vendors/tabulator/js.old/modules/select_row.min.js deleted file mode 100644 index 1b115da..0000000 --- a/app/static/vendors/tabulator/js.old/modules/select_row.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SelectRow=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};SelectRow.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},SelectRow.prototype.initializeRow=function(e){var t=this,o=e.getElement(),l=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var l=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),s=t.table.rowManager.getDisplayRowIndex(e),c=l<=s?l:s,i=l>=s?l:s,n=t.table.rowManager.getDisplayRows().slice(0),a=n.splice(c,i-c+1);o.ctrlKey||o.metaKey?(a.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(a=a.slice(0,t.table.options.selectable)),t.selectRows(a)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",l),document.body.addEventListener("keyup",l),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},SelectRow.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},SelectRow.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},SelectRow.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var l=this.table.rowManager.findRow(e);l?-1==this.selectedRows.indexOf(l)&&(l.modules.select||(l.modules.select={}),l.modules.select.selected=!0,l.modules.select.checkboxEl&&(l.modules.select.checkboxEl.checked=!0),l.getElement().classList.add("tabulator-selected"),this.selectedRows.push(l),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(l,!0),t||this.table.options.rowSelected.call(this.table,l.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},SelectRow.prototype.deselectRows=function(e,t){var o,l=this;if(void 0===e){o=l.selectedRows.length;for(var s=0;s-1&&(s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),s.getElement().classList.remove("tabulator-selected"),l.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),t||l.table.options.rowDeselected.call(this.table,s.getComponent()),l._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},SelectRow.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},SelectRow.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},SelectRow.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},SelectRow.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},SelectRow.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)for(var l=o,s=Array.isArray(l),c=0,l=s?l:l[Symbol.iterator]();;){var i;if(s){if(c>=l.length)break;i=l[c++]}else{if(c=l.next(),c.done)break;i=c.value}var n=i;this._selectRow(n,!0)}else for(var a=o,r=Array.isArray(a),d=0,a=r?a:a[Symbol.iterator]();;){var h;if(r){if(d>=a.length)break;h=a[d++]}else{if(d=a.next(),d.done)break;h=d.value}var w=h;this._deselectRow(w,!0)}},Tabulator.prototype.registerModule("selectRow",SelectRow); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/sort.js b/app/static/vendors/tabulator/js.old/modules/sort.js deleted file mode 100644 index bd38387..0000000 --- a/app/static/vendors/tabulator/js.old/modules/sort.js +++ /dev/null @@ -1,566 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Sort = function Sort(table) { - this.table = table; //hold Tabulator object - this.sortList = []; //holder current sort - this.changed = false; //has the sort changed since last render -}; - -//initialize column header for sorting -Sort.prototype.initializeColumn = function (column, content) { - var self = this, - sorter = false, - colEl, - arrowEl; - - switch (_typeof(column.definition.sorter)) { - case "string": - if (self.sorters[column.definition.sorter]) { - sorter = self.sorters[column.definition.sorter]; - } else { - console.warn("Sort Error - No such sorter found: ", column.definition.sorter); - } - break; - - case "function": - sorter = column.definition.sorter; - break; - } - - column.modules.sort = { - sorter: sorter, dir: "none", - params: column.definition.sorterParams || {}, - startingDir: column.definition.headerSortStartingDir || "asc", - tristate: typeof column.definition.headerSortTristate !== "undefined" ? column.definition.headerSortTristate : this.table.options.headerSortTristate - }; - - if (typeof column.definition.headerSort === "undefined" ? this.table.options.headerSort !== false : column.definition.headerSort !== false) { - - colEl = column.getElement(); - - colEl.classList.add("tabulator-sortable"); - - arrowEl = document.createElement("div"); - arrowEl.classList.add("tabulator-arrow"); - //create sorter arrow - content.appendChild(arrowEl); - - //sort on click - colEl.addEventListener("click", function (e) { - var dir = "", - sorters = [], - match = false; - - if (column.modules.sort) { - if (column.modules.sort.tristate) { - if (column.modules.sort.dir == "none") { - dir = column.modules.sort.startingDir; - } else { - if (column.modules.sort.dir == column.modules.sort.startingDir) { - dir = column.modules.sort.dir == "asc" ? "desc" : "asc"; - } else { - dir = "none"; - } - } - } else { - switch (column.modules.sort.dir) { - case "asc": - dir = "desc"; - break; - - case "desc": - dir = "asc"; - break; - - default: - dir = column.modules.sort.startingDir; - } - } - - if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) { - sorters = self.getSort(); - - match = sorters.findIndex(function (sorter) { - return sorter.field === column.getField(); - }); - - if (match > -1) { - sorters[match].dir = dir; - - if (match != sorters.length - 1) { - match = sorters.splice(match, 1)[0]; - if (dir != "none") { - sorters.push(match); - } - } - } else { - if (dir != "none") { - sorters.push({ column: column, dir: dir }); - } - } - - //add to existing sort - self.setSort(sorters); - } else { - if (dir == "none") { - self.clear(); - } else { - //sort by column only - self.setSort(column, dir); - } - } - - self.table.rowManager.sorterRefresh(!self.sortList.length); - } - }); - } -}; - -//check if the sorters have changed since last use -Sort.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; -}; - -//return current sorters -Sort.prototype.getSort = function () { - var self = this, - sorters = []; - - self.sortList.forEach(function (item) { - if (item.column) { - sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir }); - } - }); - - return sorters; -}; - -//change sort list and trigger sort -Sort.prototype.setSort = function (sortList, dir) { - var self = this, - newSortList = []; - - if (!Array.isArray(sortList)) { - sortList = [{ column: sortList, dir: dir }]; - } - - sortList.forEach(function (item) { - var column; - - column = self.table.columnManager.findColumn(item.column); - - if (column) { - item.column = column; - newSortList.push(item); - self.changed = true; - } else { - console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column); - } - }); - - self.sortList = newSortList; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.sort) { - this.table.modules.persistence.save("sort"); - } -}; - -//clear sorters -Sort.prototype.clear = function () { - this.setSort([]); -}; - -//find appropriate sorter for column -Sort.prototype.findSorter = function (column) { - var row = this.table.rowManager.activeRows[0], - sorter = "string", - field, - value; - - if (row) { - row = row.getData(); - field = column.getField(); - - if (field) { - - value = column.getFieldValue(row); - - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "undefined": - sorter = "string"; - break; - - case "boolean": - sorter = "boolean"; - break; - - default: - if (!isNaN(value) && value !== "") { - sorter = "number"; - } else { - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - sorter = "alphanum"; - } - } - break; - } - } - } - - return this.sorters[sorter]; -}; - -//work through sort list sorting data -Sort.prototype.sort = function (data) { - var self = this, - sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList, - sortListActual = [], - lastSort; - - if (self.table.options.dataSorting) { - self.table.options.dataSorting.call(self.table, self.getSort()); - } - - self.clearColumnHeaders(); - - if (!self.table.options.ajaxSorting) { - - //build list of valid sorters and trigger column specific callbacks before sort begins - sortList.forEach(function (item, i) { - var sortObj = item.column.modules.sort; - - if (item.column && sortObj) { - - //if no sorter has been defined, take a guess - if (!sortObj.sorter) { - sortObj.sorter = self.findSorter(item.column); - } - - item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params; - - sortListActual.push(item); - } - - self.setColumnHeader(item.column, item.dir); - }); - - //sort data - if (sortListActual.length) { - self._sortItems(data, sortListActual); - } - } else { - sortList.forEach(function (item, i) { - self.setColumnHeader(item.column, item.dir); - }); - } - - if (self.table.options.dataSorted) { - self.table.options.dataSorted.call(self.table, self.getSort(), self.table.rowManager.getComponents("active")); - } -}; - -//clear sort arrows on columns -Sort.prototype.clearColumnHeaders = function () { - this.table.columnManager.getRealColumns().forEach(function (column) { - if (column.modules.sort) { - column.modules.sort.dir = "none"; - column.getElement().setAttribute("aria-sort", "none"); - } - }); -}; - -//set the column header sort direction -Sort.prototype.setColumnHeader = function (column, dir) { - column.modules.sort.dir = dir; - column.getElement().setAttribute("aria-sort", dir); -}; - -//sort each item in sort list -Sort.prototype._sortItems = function (data, sortList) { - var _this = this; - - var sorterCount = sortList.length - 1; - - data.sort(function (a, b) { - var result; - - for (var i = sorterCount; i >= 0; i--) { - var sortItem = sortList[i]; - - result = _this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); - - if (result !== 0) { - break; - } - } - - return result; - }); -}; - -//process individual rows for a sort function on active data -Sort.prototype._sortRow = function (a, b, column, dir, params) { - var el1Comp, el2Comp, colComp; - - //switch elements depending on search direction - var el1 = dir == "asc" ? a : b; - var el2 = dir == "asc" ? b : a; - - a = column.getFieldValue(el1.getData()); - b = column.getFieldValue(el2.getData()); - - a = typeof a !== "undefined" ? a : ""; - b = typeof b !== "undefined" ? b : ""; - - el1Comp = el1.getComponent(); - el2Comp = el2.getComponent(); - - return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params); -}; - -//default data sorters -Sort.prototype.sorters = { - - //sort numbers - number: function number(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var decimal = params.decimalSeparator || "."; - var thousand = params.thousandSeparator || ","; - var emptyAlign = 0; - - a = parseFloat(String(a).split(thousand).join("").split(decimal).join(".")); - b = parseFloat(String(b).split(thousand).join("").split(decimal).join(".")); - - //handle non numeric values - if (isNaN(a)) { - emptyAlign = isNaN(b) ? 0 : -1; - } else if (isNaN(b)) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort strings - string: function string(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - var locale; - - //handle empty values - if (!a) { - emptyAlign = !b ? 0 : -1; - } else if (!b) { - emptyAlign = 1; - } else { - //compare valid values - switch (_typeof(params.locale)) { - case "boolean": - if (params.locale) { - locale = this.table.modules.localize.getLocale(); - } - break; - case "string": - locale = params.locale; - break; - } - - return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale); - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort date - date: function date(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "DD/MM/YYYY"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort hh:mm formatted times - time: function time(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "hh:mm"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort datetime - datetime: function datetime(a, b, aRow, bRow, column, dir, params) { - var format = params.format || "DD/MM/YYYY hh:mm:ss", - alignEmptyValues = params.alignEmptyValues, - emptyAlign = 0; - - if (typeof moment != "undefined") { - a = moment(a, format); - b = moment(b, format); - - if (!a.isValid()) { - emptyAlign = !b.isValid() ? 0 : -1; - } else if (!b.isValid()) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } else { - console.error("Sort Error - 'datetime' sorter is dependant on moment.js"); - } - }, - - //sort booleans - boolean: function boolean(a, b, aRow, bRow, column, dir, params) { - var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0; - var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0; - - return el1 - el2; - }, - - //sort if element contains any data - array: function array(a, b, aRow, bRow, column, dir, params) { - var el1 = 0; - var el2 = 0; - var type = params.type || "length"; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - function calc(value) { - - switch (type) { - case "length": - return value.length; - break; - - case "sum": - return value.reduce(function (c, d) { - return c + d; - }); - break; - - case "max": - return Math.max.apply(null, value); - break; - - case "min": - return Math.min.apply(null, value); - break; - - case "avg": - return value.reduce(function (c, d) { - return c + d; - }) / value.length; - break; - } - } - - //handle non array values - if (!Array.isArray(a)) { - alignEmptyValues = !Array.isArray(b) ? 0 : -1; - } else if (!Array.isArray(b)) { - alignEmptyValues = 1; - } else { - - //compare valid values - el1 = a ? calc(a) : 0; - el2 = b ? calc(b) : 0; - - return el1 - el2; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort if element contains any data - exists: function exists(a, b, aRow, bRow, column, dir, params) { - var el1 = typeof a == "undefined" ? 0 : 1; - var el2 = typeof b == "undefined" ? 0 : 1; - - return el1 - el2; - }, - - //sort alpha numeric strings - alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) { - var a, - b, - a1, - b1, - i = 0, - L, - rx = /(\d+)|(\D+)/g, - rd = /\d/; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - //handle empty values - if (!as && as !== 0) { - emptyAlign = !bs && bs !== 0 ? 0 : -1; - } else if (!bs && bs !== 0) { - emptyAlign = 1; - } else { - - if (isFinite(as) && isFinite(bs)) return as - bs; - a = String(as).toLowerCase(); - b = String(bs).toLowerCase(); - if (a === b) return 0; - if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1; - a = a.match(rx); - b = b.match(rx); - L = a.length > b.length ? b.length : a.length; - while (i < L) { - a1 = a[i]; - b1 = b[i++]; - if (a1 !== b1) { - if (isFinite(a1) && isFinite(b1)) { - if (a1.charAt(0) === "0") a1 = "." + a1; - if (b1.charAt(0) === "0") b1 = "." + b1; - return a1 - b1; - } else return a1 > b1 ? 1 : -1; - } - } - - return a.length > b.length; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } -}; - -Tabulator.prototype.registerModule("sort", Sort); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/sort.min.js b/app/static/vendors/tabulator/js.old/modules/sort.min.js deleted file mode 100644 index 1e9855d..0000000 --- a/app/static/vendors/tabulator/js.old/modules/sort.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sort=function(t){this.table=t,this.sortList=[],this.changed=!1};Sort.prototype.initializeColumn=function(t,e){var r,o,n=this,i=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?i=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":i=t.definition.sorter}t.modules.sort={sorter:i,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:void 0!==t.definition.headerSortTristate?t.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===t.definition.headerSort?!1!==this.table.options.headerSort:!1!==t.definition.headerSort)&&(r=t.getElement(),r.classList.add("tabulator-sortable"),o=document.createElement("div"),o.classList.add("tabulator-arrow"),e.appendChild(o),r.addEventListener("click",function(e){var r="",o=[],i=!1;if(t.modules.sort){if(t.modules.sort.tristate)r="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":r="desc";break;case"desc":r="asc";break;default:r=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(o=n.getSort(),i=o.findIndex(function(e){return e.field===t.getField()}),i>-1?(o[i].dir=r,i!=o.length-1&&(i=o.splice(i,1)[0],"none"!=r&&o.push(i))):"none"!=r&&o.push({column:t,dir:r}),n.setSort(o)):"none"==r?n.clear():n.setSort(t,r),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},Sort.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},Sort.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},Sort.prototype.setSort=function(t,e){var r=this,o=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=r.table.columnManager.findColumn(t.column),e?(t.column=e,o.push(t),r.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),r.sortList=o,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},Sort.prototype.clear=function(){this.setSort([])},Sort.prototype.findSorter=function(t){var e,r=this.table.rowManager.activeRows[0],o="string";if(r&&(r=r.getData(),t.getField()))switch(e=t.getFieldValue(r),void 0===e?"undefined":_typeof(e)){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return this.sorters[o]},Sort.prototype.sort=function(t){var e=this,r=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,o=[];e.table.options.dataSorting&&e.table.options.dataSorting.call(e.table,e.getSort()),e.clearColumnHeaders(),e.table.options.ajaxSorting?r.forEach(function(t,r){e.setColumnHeader(t.column,t.dir)}):(r.forEach(function(t,r){var n=t.column.modules.sort;t.column&&n&&(n.sorter||(n.sorter=e.findSorter(t.column)),t.params="function"==typeof n.params?n.params(t.column.getComponent(),t.dir):n.params,o.push(t)),e.setColumnHeader(t.column,t.dir)}),o.length&&e._sortItems(t,o)),e.table.options.dataSorted&&e.table.options.dataSorted.call(e.table,e.getSort(),e.table.rowManager.getComponents("active"))},Sort.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},Sort.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},Sort.prototype._sortItems=function(t,e){var r=this,o=e.length-1;t.sort(function(t,n){for(var i,s=o;s>=0;s--){var a=e[s];if(0!==(i=r._sortRow(t,n,a.column,a.dir,a.params)))break}return i})},Sort.prototype._sortRow=function(t,e,r,o,n){var i,s,a="asc"==o?t:e,l="asc"==o?e:t;return t=r.getFieldValue(a.getData()),e=r.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",i=a.getComponent(),s=l.getComponent(),r.modules.sort.sorter.call(this,t,e,i,s,r.getComponent(),o,n)},Sort.prototype.sorters={number:function(t,e,r,o,n,i,s){var a=s.alignEmptyValues,l=s.decimalSeparator||".",u=s.thousandSeparator||",",c=0;if(t=parseFloat(String(t).split(u).join("").split(l).join(".")),e=parseFloat(String(e).split(u).join("").split(l).join(".")),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===a&&"desc"===i||"bottom"===a&&"asc"===i)&&(c*=-1),c},string:function(t,e,r,o,n,i,s){var a,l=s.alignEmptyValues,u=0;if(t){if(e){switch(_typeof(s.locale)){case"boolean":s.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=s.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}u=1}else u=e?-1:0;return("top"===l&&"desc"===i||"bottom"===l&&"asc"===i)&&(u*=-1),u},date:function(t,e,r,o,n,i,s){return s.format||(s.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,r,o,n,i,s)},time:function(t,e,r,o,n,i,s){return s.format||(s.format="hh:mm"),this.sorters.datetime.call(this,t,e,r,o,n,i,s)},datetime:function(t,e,r,o,n,i,s){var a=s.format||"DD/MM/YYYY hh:mm:ss",l=s.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(t=moment(t,a),e=moment(e,a),t.isValid()){if(e.isValid())return t-e;u=1}else u=e.isValid()?-1:0;return("top"===l&&"desc"===i||"bottom"===l&&"asc"===i)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,r,o,n,i,s){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,r,o,n,i,s){function a(t){switch(c){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,u=0,c=s.type||"length",d=s.alignEmptyValues,m=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?a(t):0,u=e?a(e):0,l-u;d=1}else d=Array.isArray(e)?-1:0;return("top"===d&&"desc"===i||"bottom"===d&&"asc"===i)&&(m*=-1),m},exists:function(t,e,r,o,n,i,s){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,r,o,n,i,s){var a,l,u,c,d,m=0,f=/(\d+)|(\D+)/g,p=/\d/,h=s.alignEmptyValues,g=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(a=String(t).toLowerCase(),l=String(e).toLowerCase(),a===l)return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(f),l=l.match(f),d=a.length>l.length?l.length:a.length;mc?1:-1;return a.length>l.length}g=1}else g=e||0===e?-1:0;return("top"===h&&"desc"===i||"bottom"===h&&"asc"===i)&&(g*=-1),g}},Tabulator.prototype.registerModule("sort",Sort); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/validate.js b/app/static/vendors/tabulator/js.old/modules/validate.js deleted file mode 100644 index e4e6521..0000000 --- a/app/static/vendors/tabulator/js.old/modules/validate.js +++ /dev/null @@ -1,217 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -var Validate = function Validate(table) { - this.table = table; -}; - -//validate -Validate.prototype.initializeColumn = function (column) { - var self = this, - config = [], - validator; - - if (column.definition.validator) { - - if (Array.isArray(column.definition.validator)) { - column.definition.validator.forEach(function (item) { - validator = self._extractValidator(item); - - if (validator) { - config.push(validator); - } - }); - } else { - validator = this._extractValidator(column.definition.validator); - - if (validator) { - config.push(validator); - } - } - - column.modules.validate = config.length ? config : false; - } -}; - -Validate.prototype._extractValidator = function (value) { - var type, params, pos; - - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - pos = value.indexOf(':'); - - if (pos > -1) { - type = value.substring(0, pos); - params = value.substring(pos + 1); - } else { - type = value; - } - - return this._buildValidator(type, params); - break; - - case "function": - return this._buildValidator(value); - break; - - case "object": - return this._buildValidator(value.type, value.parameters); - break; - } -}; - -Validate.prototype._buildValidator = function (type, params) { - - var func = typeof type == "function" ? type : this.validators[type]; - - if (!func) { - console.warn("Validator Setup Error - No matching validator found:", type); - return false; - } else { - return { - type: typeof type == "function" ? "function" : type, - func: func, - params: params - }; - } -}; - -Validate.prototype.validate = function (validators, cell, value) { - var self = this, - valid = []; - - if (validators) { - validators.forEach(function (item) { - if (!item.func.call(self, cell, value, item.params)) { - valid.push({ - type: item.type, - parameters: item.params - }); - } - }); - } - - return valid.length ? valid : true; -}; - -Validate.prototype.validators = { - - //is integer - integer: function integer(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; - }, - - //is float - float: function float(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && value % 1 !== 0; - }, - - //must be a number - numeric: function numeric(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return !isNaN(value); - }, - - //must be a string - string: function string(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return isNaN(value); - }, - - //maximum value - max: function max(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) <= parameters; - }, - - //minimum value - min: function min(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) >= parameters; - }, - - //minimum string length - minLength: function minLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length >= parameters; - }, - - //maximum string length - maxLength: function maxLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length <= parameters; - }, - - //in provided value list - in: function _in(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - if (typeof parameters == "string") { - parameters = parameters.split("|"); - } - - return value === "" || parameters.indexOf(value) > -1; - }, - - //must match provided regex - regex: function regex(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var reg = new RegExp(parameters); - - return reg.test(value); - }, - - //value must be unique in this column - unique: function unique(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var unique = true; - - var cellData = cell.getData(); - var column = cell.getColumn()._getSelf(); - - this.table.rowManager.rows.forEach(function (row) { - var data = row.getData(); - - if (data !== cellData) { - if (value == column.getFieldValue(data)) { - unique = false; - } - } - }); - - return unique; - }, - - //must have a value - required: function required(cell, value, parameters) { - return value !== "" && value !== null && typeof value !== "undefined"; - } -}; - -Tabulator.prototype.registerModule("validate", Validate); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/modules/validate.min.js b/app/static/vendors/tabulator/js.old/modules/validate.min.js deleted file mode 100644 index 466b853..0000000 --- a/app/static/vendors/tabulator/js.old/modules/validate.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Validate=function(t){this.table=t};Validate.prototype.initializeColumn=function(t){var n,i=this,r=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(n=i._extractValidator(t))&&r.push(n)}):(n=this._extractValidator(t.definition.validator))&&r.push(n),t.modules.validate=!!r.length&&r)},Validate.prototype._extractValidator=function(t){var n,i,r;switch(void 0===t?"undefined":_typeof(t)){case"string":return r=t.indexOf(":"),r>-1?(n=t.substring(0,r),i=t.substring(r+1)):n=t,this._buildValidator(n,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},Validate.prototype._buildValidator=function(t,n){var i="function"==typeof t?t:this.validators[t];return i?{type:"function"==typeof t?"function":t,func:i,params:n}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},Validate.prototype.validate=function(t,n,i){var r=this,o=[];return t&&t.forEach(function(t){t.func.call(r,n,i,t.params)||o.push({type:t.type,parameters:t.params})}),!o.length||o},Validate.prototype.validators={integer:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&Math.floor(n)===n},float:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&n%1!=0},numeric:function(t,n,i){return""===n||null===n||void 0===n||!isNaN(n)},string:function(t,n,i){return""===n||null===n||void 0===n||isNaN(n)},max:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)<=i},min:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)>=i},minLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length>=i},maxLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length<=i},in:function(t,n,i){return""===n||null===n||void 0===n||("string"==typeof i&&(i=i.split("|")),""===n||i.indexOf(n)>-1)},regex:function(t,n,i){return""===n||null===n||void 0===n||new RegExp(i).test(n)},unique:function(t,n,i){if(""===n||null===n||void 0===n)return!0;var r=!0,o=t.getData(),e=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var i=t.getData();i!==o&&n==e.getFieldValue(i)&&(r=!1)}),r},required:function(t,n,i){return""!==n&&null!==n&&void 0!==n}},Tabulator.prototype.registerModule("validate",Validate); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/tabulator.js b/app/static/vendors/tabulator/js.old/tabulator.js deleted file mode 100644 index b915007..0000000 --- a/app/static/vendors/tabulator/js.old/tabulator.js +++ /dev/null @@ -1,24238 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -;(function (global, factory) { - if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define(factory); - } else { - global.Tabulator = factory(); - } -})(this, function () { - - 'use strict'; - - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - - - if (!Array.prototype.findIndex) { - - Object.defineProperty(Array.prototype, 'findIndex', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - - var k = 0; - - // 6. Repeat, while k < len - - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - - // b. Let kValue be ? Get(O, Pk). - - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - - // d. If testResult is true, return k. - - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return k; - } - - // e. Increase k by 1. - - - k++; - } - - // 7. Return -1. - - - return -1; - } - - }); - } - - // https://tc39.github.io/ecma262/#sec-array.prototype.find - - - if (!Array.prototype.find) { - - Object.defineProperty(Array.prototype, 'find', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - - var k = 0; - - // 6. Repeat, while k < len - - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - - // b. Let kValue be ? Get(O, Pk). - - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - - // d. If testResult is true, return kValue. - - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return kValue; - } - - // e. Increase k by 1. - - - k++; - } - - // 7. Return undefined. - - - return undefined; - } - - }); - } - - var ColumnManager = function ColumnManager(table) { - - this.table = table; //hold parent table - - - this.blockHozScrollEvent = false; - - this.headersElement = this.createHeadersElement(); - - this.element = this.createHeaderElement(); //containing element - - - this.rowManager = null; //hold row manager object - - - this.columns = []; // column definition object - - - this.columnsByIndex = []; //columns by index - - - this.columnsByField = {}; //columns by field - - - this.scrollLeft = 0; - - this.element.insertBefore(this.headersElement, this.element.firstChild); - }; - - ////////////// Setup Functions ///////////////// - - - ColumnManager.prototype.createHeadersElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-headers"); - - return el; - }; - - ColumnManager.prototype.createHeaderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-header"); - - if (!this.table.options.headerVisible) { - - el.classList.add("tabulator-header-hidden"); - } - - return el; - }; - - ColumnManager.prototype.initialize = function () { - - var self = this; - - //scroll body along with header - - - // self.element.addEventListener("scroll", function(e){ - - - // if(!self.blockHozScrollEvent){ - - - // self.table.rowManager.scrollHorizontal(self.element.scrollLeft); - - - // } - - - // }); - - }; - - //link to row manager - - - ColumnManager.prototype.setRowManager = function (manager) { - - this.rowManager = manager; - }; - - //return containing element - - - ColumnManager.prototype.getElement = function () { - - return this.element; - }; - - //return header containing element - - - ColumnManager.prototype.getHeadersElement = function () { - - return this.headersElement; - }; - - // ColumnManager.prototype.tempScrollBlock = function(){ - - - // clearTimeout(this.blockHozScrollEvent); - - - // this.blockHozScrollEvent = setTimeout(() => {this.blockHozScrollEvent = false;}, 50); - - - // } - - - //scroll horizontally to match table body - - - ColumnManager.prototype.scrollHorizontal = function (left) { - - var hozAdjust = 0, - scrollWidth = this.element.scrollWidth - this.table.element.clientWidth; - - // this.tempScrollBlock(); - - - this.element.scrollLeft = left; - - //adjust for vertical scrollbar moving table when present - - - if (left > scrollWidth) { - - hozAdjust = left - scrollWidth; - - this.element.style.marginLeft = -hozAdjust + "px"; - } else { - - this.element.style.marginLeft = 0; - } - - //keep frozen columns fixed in position - - - //this._calcFrozenColumnsPos(hozAdjust + 3); - - - this.scrollLeft = left; - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.scrollHorizontal(); - } - }; - - ///////////// Column Setup Functions ///////////// - - - ColumnManager.prototype.generateColumnsFromRowData = function (data) { - - var cols = [], - row, - sorter; - - if (data && data.length) { - - row = data[0]; - - for (var key in row) { - - var col = { - - field: key, - - title: key - - }; - - var value = row[key]; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - - case "undefined": - - sorter = "string"; - - break; - - case "boolean": - - sorter = "boolean"; - - break; - - case "object": - - if (Array.isArray(value)) { - - sorter = "array"; - } else { - - sorter = "string"; - } - - break; - - default: - - if (!isNaN(value) && value !== "") { - - sorter = "number"; - } else { - - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - - sorter = "alphanum"; - } else { - - sorter = "string"; - } - } - - break; - - } - - col.sorter = sorter; - - cols.push(col); - } - - this.table.options.columns = cols; - - this.setColumns(this.table.options.columns); - } - }; - - ColumnManager.prototype.setColumns = function (cols, row) { - - var self = this; - - while (self.headersElement.firstChild) { - self.headersElement.removeChild(self.headersElement.firstChild); - }self.columns = []; - - self.columnsByIndex = []; - - self.columnsByField = {}; - - //reset frozen columns - - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.reset(); - } - - cols.forEach(function (def, i) { - - self._addColumn(def); - }); - - self._reIndexColumns(); - - if (self.table.options.responsiveLayout && self.table.modExists("responsiveLayout", true)) { - - self.table.modules.responsiveLayout.initialize(); - } - - self.redraw(true); - }; - - ColumnManager.prototype._addColumn = function (definition, before, nextToColumn) { - - var column = new Column(definition, this), - colEl = column.getElement(), - index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn; - - if (nextToColumn && index > -1) { - - var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn()); - - var nextEl = nextToColumn.getElement(); - - if (before) { - - this.columns.splice(parentIndex, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl); - } else { - - this.columns.splice(parentIndex + 1, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl.nextSibling); - } - } else { - - if (before) { - - this.columns.unshift(column); - - this.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild); - } else { - - this.columns.push(column); - - this.headersElement.appendChild(column.getElement()); - } - - column.columnRendered(); - } - - return column; - }; - - ColumnManager.prototype.registerColumnField = function (col) { - - if (col.definition.field) { - - this.columnsByField[col.definition.field] = col; - } - }; - - ColumnManager.prototype.registerColumnPosition = function (col) { - - this.columnsByIndex.push(col); - }; - - ColumnManager.prototype._reIndexColumns = function () { - - this.columnsByIndex = []; - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); - }; - - //ensure column headers take up the correct amount of space in column groups - - - ColumnManager.prototype._verticalAlignHeaders = function () { - - var self = this, - minHeight = 0; - - self.columns.forEach(function (column) { - - var height; - - column.clearVerticalAlign(); - - height = column.getHeight(); - - if (height > minHeight) { - - minHeight = height; - } - }); - - self.columns.forEach(function (column) { - - column.verticalAlign(self.table.options.columnHeaderVertAlign, minHeight); - }); - - self.rowManager.adjustTableSize(); - }; - - //////////////// Column Details ///////////////// - - - ColumnManager.prototype.findColumn = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Column) { - - //subject is column element - - - return subject; - } else if (subject instanceof ColumnComponent) { - - //subject is public column component - - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the column header - - - var match = self.columns.find(function (column) { - - return column.element === subject; - }); - - return match || false; - } - } else { - - //subject should be treated as the field name of the column - - - return this.columnsByField[subject] || false; - } - - //catch all for any other type of input - - - return false; - }; - - ColumnManager.prototype.getColumnByField = function (field) { - - return this.columnsByField[field]; - }; - - ColumnManager.prototype.getColumnsByFieldRoot = function (root) { - var _this = this; - - var matches = []; - - Object.keys(this.columnsByField).forEach(function (field) { - - var fieldRoot = field.split(".")[0]; - - if (fieldRoot === root) { - - matches.push(_this.columnsByField[field]); - } - }); - - return matches; - }; - - ColumnManager.prototype.getColumnByIndex = function (index) { - - return this.columnsByIndex[index]; - }; - - ColumnManager.prototype.getFirstVisibileColumn = function (index) { - - var index = this.columnsByIndex.findIndex(function (col) { - - return col.visible; - }); - - return index > -1 ? this.columnsByIndex[index] : false; - }; - - ColumnManager.prototype.getColumns = function () { - - return this.columns; - }; - - ColumnManager.prototype.findColumnIndex = function (column) { - - return this.columnsByIndex.findIndex(function (col) { - - return column === col; - }); - }; - - //return all columns that are not groups - - - ColumnManager.prototype.getRealColumns = function () { - - return this.columnsByIndex; - }; - - //travers across columns and call action - - - ColumnManager.prototype.traverse = function (callback) { - - var self = this; - - self.columnsByIndex.forEach(function (column, i) { - - callback(column, i); - }); - }; - - //get defintions of actual columns - - - ColumnManager.prototype.getDefinitions = function (active) { - - var self = this, - output = []; - - self.columnsByIndex.forEach(function (column) { - - if (!active || active && column.visible) { - - output.push(column.getDefinition()); - } - }); - - return output; - }; - - //get full nested definition tree - - - ColumnManager.prototype.getDefinitionTree = function () { - - var self = this, - output = []; - - self.columns.forEach(function (column) { - - output.push(column.getDefinition(true)); - }); - - return output; - }; - - ColumnManager.prototype.getComponents = function (structured) { - - var self = this, - output = [], - columns = structured ? self.columns : self.columnsByIndex; - - columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - - return output; - }; - - ColumnManager.prototype.getWidth = function () { - - var width = 0; - - this.columnsByIndex.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - - return width; - }; - - ColumnManager.prototype.moveColumn = function (from, to, after) { - - this.moveColumnActual(from, to, after); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - to.element.parentNode.insertBefore(from.element, to.element); - - if (after) { - - to.element.parentNode.insertBefore(to.element, from.element); - } - - this._verticalAlignHeaders(); - - this.table.rowManager.reinitialize(); - }; - - ColumnManager.prototype.moveColumnActual = function (from, to, after) { - - if (from.parent.isGroup) { - - this._moveColumnInArray(from.parent.columns, from, to, after); - } else { - - this._moveColumnInArray(this.columns, from, to, after); - } - - this._moveColumnInArray(this.columnsByIndex, from, to, after, true); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.options.columnMoved) { - - this.table.options.columnMoved.call(this.table, from.getComponent(), this.table.columnManager.getComponents()); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - }; - - ColumnManager.prototype._moveColumnInArray = function (columns, from, to, after, updateRows) { - - var fromIndex = columns.indexOf(from), - toIndex; - - if (fromIndex > -1) { - - columns.splice(fromIndex, 1); - - toIndex = columns.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - toIndex = toIndex + 1; - } - } else { - - toIndex = fromIndex; - } - - columns.splice(toIndex, 0, from); - - if (updateRows) { - - this.table.rowManager.rows.forEach(function (row) { - - if (row.cells.length) { - - var cell = row.cells.splice(fromIndex, 1)[0]; - - row.cells.splice(toIndex, 0, cell); - } - }); - } - } - }; - - ColumnManager.prototype.scrollToColumn = function (column, position, ifVisible) { - var _this2 = this; - - var left = 0, - offset = 0, - adjust = 0, - colEl = column.getElement(); - - return new Promise(function (resolve, reject) { - - if (typeof position === "undefined") { - - position = _this2.table.options.scrollToColumnPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this2.table.options.scrollToColumnIfVisible; - } - - if (column.visible) { - - //align to correct position - - - switch (position) { - - case "middle": - - case "center": - - adjust = -_this2.element.clientWidth / 2; - - break; - - case "right": - - adjust = colEl.clientWidth - _this2.headersElement.clientWidth; - - break; - - } - - //check column visibility - - - if (!ifVisible) { - - offset = colEl.offsetLeft; - - if (offset > 0 && offset + colEl.offsetWidth < _this2.element.clientWidth) { - - return false; - } - } - - //calculate scroll position - - - left = colEl.offsetLeft + _this2.element.scrollLeft + adjust; - - left = Math.max(Math.min(left, _this2.table.rowManager.element.scrollWidth - _this2.table.rowManager.element.clientWidth), 0); - - _this2.table.rowManager.scrollHorizontal(left); - - _this2.scrollHorizontal(left); - - resolve(); - } else { - - console.warn("Scroll Error - Column not visible"); - - reject("Scroll Error - Column not visible"); - } - }); - }; - - //////////////// Cell Management ///////////////// - - - ColumnManager.prototype.generateCells = function (row) { - - var self = this; - - var cells = []; - - self.columnsByIndex.forEach(function (column) { - - cells.push(column.generateCell(row)); - }); - - return cells; - }; - - //////////////// Column Management ///////////////// - - - ColumnManager.prototype.getFlexBaseWidth = function () { - - var self = this, - totalWidth = self.table.element.clientWidth, - //table element width - - - fixedWidth = 0; - - //adjust for vertical scrollbar if present - - - if (self.rowManager.element.scrollHeight > self.rowManager.element.clientHeight) { - - totalWidth -= self.rowManager.element.offsetWidth - self.rowManager.element.clientWidth; - } - - this.columnsByIndex.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width || 0; - - minWidth = typeof column.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(column.minWidth); - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - } - }); - - return fixedWidth; - }; - - ColumnManager.prototype.addColumn = function (definition, before, nextToColumn) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var column = _this3._addColumn(definition, before, nextToColumn); - - _this3._reIndexColumns(); - - if (_this3.table.options.responsiveLayout && _this3.table.modExists("responsiveLayout", true)) { - - _this3.table.modules.responsiveLayout.initialize(); - } - - if (_this3.table.modExists("columnCalcs")) { - - _this3.table.modules.columnCalcs.recalc(_this3.table.rowManager.activeRows); - } - - _this3.redraw(); - - if (_this3.table.modules.layout.getMode() != "fitColumns") { - - column.reinitializeWidth(); - } - - _this3._verticalAlignHeaders(); - - _this3.table.rowManager.reinitialize(); - - resolve(column); - }); - }; - - //remove column from system - - - ColumnManager.prototype.deregisterColumn = function (column) { - - var field = column.getField(), - index; - - //remove from field list - - - if (field) { - - delete this.columnsByField[field]; - } - - //remove from index list - - - index = this.columnsByIndex.indexOf(column); - - if (index > -1) { - - this.columnsByIndex.splice(index, 1); - } - - //remove from column list - - - index = this.columns.indexOf(column); - - if (index > -1) { - - this.columns.splice(index, 1); - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - this.redraw(); - }; - - //redraw columns - - - ColumnManager.prototype.redraw = function (force) { - - if (force) { - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - - this._verticalAlignHeaders(); - } - - this.table.rowManager.resetScroll(); - - this.table.rowManager.reinitialize(); - } - - if (["fitColumns", "fitDataStretch"].indexOf(this.table.modules.layout.getMode()) > -1) { - - this.table.modules.layout.layout(); - } else { - - if (force) { - - this.table.modules.layout.layout(); - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (force) { - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.redraw(); - } - } - - this.table.footerManager.redraw(); - }; - - //public column object - - var ColumnComponent = function ColumnComponent(column) { - - this._column = column; - - this.type = "ColumnComponent"; - }; - - ColumnComponent.prototype.getElement = function () { - - return this._column.getElement(); - }; - - ColumnComponent.prototype.getDefinition = function () { - - return this._column.getDefinition(); - }; - - ColumnComponent.prototype.getField = function () { - - return this._column.getField(); - }; - - ColumnComponent.prototype.getCells = function () { - - var cells = []; - - this._column.cells.forEach(function (cell) { - - cells.push(cell.getComponent()); - }); - - return cells; - }; - - ColumnComponent.prototype.getVisibility = function () { - - return this._column.visible; - }; - - ColumnComponent.prototype.show = function () { - - if (this._column.isGroup) { - - this._column.columns.forEach(function (column) { - - column.show(); - }); - } else { - - this._column.show(); - } - }; - - ColumnComponent.prototype.hide = function () { - - if (this._column.isGroup) { - - this._column.columns.forEach(function (column) { - - column.hide(); - }); - } else { - - this._column.hide(); - } - }; - - ColumnComponent.prototype.toggle = function () { - - if (this._column.visible) { - - this.hide(); - } else { - - this.show(); - } - }; - - ColumnComponent.prototype.delete = function () { - - return this._column.delete(); - }; - - ColumnComponent.prototype.getSubColumns = function () { - - var output = []; - - if (this._column.columns.length) { - - this._column.columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - } - - return output; - }; - - ColumnComponent.prototype.getParentColumn = function () { - - return this._column.parent instanceof Column ? this._column.parent.getComponent() : false; - }; - - ColumnComponent.prototype._getSelf = function () { - - return this._column; - }; - - ColumnComponent.prototype.scrollTo = function () { - - return this._column.table.columnManager.scrollToColumn(this._column); - }; - - ColumnComponent.prototype.getTable = function () { - - return this._column.table; - }; - - ColumnComponent.prototype.headerFilterFocus = function () { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.setHeaderFilterFocus(this._column); - } - }; - - ColumnComponent.prototype.reloadHeaderFilter = function () { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.reloadHeaderFilter(this._column); - } - }; - - ColumnComponent.prototype.getHeaderFilterValue = function () { - - if (this._column.table.modExists("filter", true)) { - - return this._column.table.modules.filter.getHeaderFilterValue(this._column); - } - }; - - ColumnComponent.prototype.setHeaderFilterValue = function (value) { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.setHeaderFilterValue(this._column, value); - } - }; - - ColumnComponent.prototype.move = function (to, after) { - - var toColumn = this._column.table.columnManager.findColumn(to); - - if (toColumn) { - - this._column.table.columnManager.moveColumn(this._column, toColumn, after); - } else { - - console.warn("Move Error - No matching column found:", toColumn); - } - }; - - ColumnComponent.prototype.getNextColumn = function () { - - var nextCol = this._column.nextColumn(); - - return nextCol ? nextCol.getComponent() : false; - }; - - ColumnComponent.prototype.getPrevColumn = function () { - - var prevCol = this._column.prevColumn(); - - return prevCol ? prevCol.getComponent() : false; - }; - - ColumnComponent.prototype.updateDefinition = function (updates) { - - return this._column.updateDefinition(updates); - }; - - var Column = function Column(def, parent) { - - var self = this; - - this.table = parent.table; - - this.definition = def; //column definition - - this.parent = parent; //hold parent object - - this.type = "column"; //type of element - - this.columns = []; //child columns - - this.cells = []; //cells bound to this column - - this.element = this.createElement(); //column header element - - this.contentElement = false; - - this.titleElement = false; - - this.groupElement = this.createGroupElement(); //column group holder element - - this.isGroup = false; - - this.tooltip = false; //hold column tooltip - - this.hozAlign = ""; //horizontal text alignment - - this.vertAlign = ""; //vert text alignment - - - //multi dimensional filed handling - - this.field = ""; - - this.fieldStructure = ""; - - this.getFieldValue = ""; - - this.setFieldValue = ""; - - this.titleFormatterRendered = false; - - this.setField(this.definition.field); - - if (this.table.options.invalidOptionWarnings) { - - this.checkDefinition(); - } - - this.modules = {}; //hold module variables; - - - this.cellEvents = { - - cellClick: false, - - cellDblClick: false, - - cellContext: false, - - cellTap: false, - - cellDblTap: false, - - cellTapHold: false, - - cellMouseEnter: false, - - cellMouseLeave: false, - - cellMouseOver: false, - - cellMouseOut: false, - - cellMouseMove: false - - }; - - this.width = null; //column width - - this.widthStyled = ""; //column width prestyled to improve render efficiency - - this.minWidth = null; //column minimum width - - this.minWidthStyled = ""; //column minimum prestyled to improve render efficiency - - this.widthFixed = false; //user has specified a width for this column - - - this.visible = true; //default visible state - - - this._mapDepricatedFunctionality(); - - //initialize column - - if (def.columns) { - - this.isGroup = true; - - def.columns.forEach(function (def, i) { - - var newCol = new Column(def, self); - - self.attachColumn(newCol); - }); - - self.checkColumnVisibility(); - } else { - - parent.registerColumnField(this); - } - - if (def.rowHandle && this.table.options.movableRows !== false && this.table.modExists("moveRow")) { - - this.table.modules.moveRow.setHandle(true); - } - - this._buildHeader(); - - this.bindModuleColumns(); - }; - - Column.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - - el.setAttribute("role", "columnheader"); - - el.setAttribute("aria-sort", "none"); - - return el; - }; - - Column.prototype.createGroupElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-col-group-cols"); - - return el; - }; - - Column.prototype.checkDefinition = function () { - var _this4 = this; - - Object.keys(this.definition).forEach(function (key) { - - if (_this4.defaultOptionList.indexOf(key) === -1) { - - console.warn("Invalid column definition option in '" + (_this4.field || _this4.definition.title) + "' column:", key); - } - }); - }; - - Column.prototype.setField = function (field) { - - this.field = field; - - this.fieldStructure = field ? this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field] : []; - - this.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData; - - this.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData; - }; - - //register column position with column manager - - Column.prototype.registerColumnPosition = function (column) { - - this.parent.registerColumnPosition(column); - }; - - //register column position with column manager - - Column.prototype.registerColumnField = function (column) { - - this.parent.registerColumnField(column); - }; - - //trigger position registration - - Column.prototype.reRegisterPosition = function () { - - if (this.isGroup) { - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); - } else { - - this.registerColumnPosition(this); - } - }; - - Column.prototype._mapDepricatedFunctionality = function () { - - if (typeof this.definition.hideInHtml !== "undefined") { - - this.definition.htmlOutput = !this.definition.hideInHtml; - - console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput"); - } - - if (typeof this.definition.align !== "undefined") { - - this.definition.hozAlign = this.definition.align; - - console.warn("align column definition property is deprecated, you should now use hozAlign"); - } - }; - - Column.prototype.setTooltip = function () { - - var self = this, - def = self.definition; - - //set header tooltips - - var tooltip = def.headerTooltip || def.tooltip === false ? def.headerTooltip : self.table.options.tooltipsHeader; - - if (tooltip) { - - if (tooltip === true) { - - if (def.field) { - - self.table.modules.localize.bind("columns|" + def.field, function (value) { - - self.element.setAttribute("title", value || def.title); - }); - } else { - - self.element.setAttribute("title", def.title); - } - } else { - - if (typeof tooltip == "function") { - - tooltip = tooltip(self.getComponent()); - - if (tooltip === false) { - - tooltip = ""; - } - } - - self.element.setAttribute("title", tooltip); - } - } else { - - self.element.setAttribute("title", ""); - } - }; - - //build header element - - Column.prototype._buildHeader = function () { - - var self = this, - def = self.definition; - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - }if (def.headerVertical) { - - self.element.classList.add("tabulator-col-vertical"); - - if (def.headerVertical === "flip") { - - self.element.classList.add("tabulator-col-vertical-flip"); - } - } - - self.contentElement = self._bindEvents(); - - self.contentElement = self._buildColumnHeaderContent(); - - self.element.appendChild(self.contentElement); - - if (self.isGroup) { - - self._buildGroupHeader(); - } else { - - self._buildColumnHeader(); - } - - self.setTooltip(); - - //set resizable handles - - if (self.table.options.resizableColumns && self.table.modExists("resizeColumns")) { - - self.table.modules.resizeColumns.initializeColumn("header", self, self.element); - } - - //set resizable handles - - if (def.headerFilter && self.table.modExists("filter") && self.table.modExists("edit")) { - - if (typeof def.headerFilterPlaceholder !== "undefined" && def.field) { - - self.table.modules.localize.setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder); - } - - self.table.modules.filter.initializeColumn(self); - } - - //set resizable handles - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.initializeColumn(self); - } - - //set movable column - - if (self.table.options.movableColumns && !self.isGroup && self.table.modExists("moveColumn")) { - - self.table.modules.moveColumn.initializeColumn(self); - } - - //set calcs column - - if ((def.topCalc || def.bottomCalc) && self.table.modExists("columnCalcs")) { - - self.table.modules.columnCalcs.initializeColumn(self); - } - - //handle persistence - - if (self.table.modExists("persistence") && self.table.modules.persistence.config.columns) { - - self.table.modules.persistence.initializeColumn(self); - } - - //update header tooltip on mouse enter - - self.element.addEventListener("mouseenter", function (e) { - - self.setTooltip(); - }); - }; - - Column.prototype._bindEvents = function () { - - var self = this, - def = self.definition, - dblTap, - tapHold, - tap; - - //setup header click event bindings - - if (typeof def.headerClick == "function") { - - self.element.addEventListener("click", function (e) { - def.headerClick(e, self.getComponent()); - }); - } - - if (typeof def.headerDblClick == "function") { - - self.element.addEventListener("dblclick", function (e) { - def.headerDblClick(e, self.getComponent()); - }); - } - - if (typeof def.headerContext == "function") { - - self.element.addEventListener("contextmenu", function (e) { - def.headerContext(e, self.getComponent()); - }); - } - - //setup header tap event bindings - - if (typeof def.headerTap == "function") { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - if (tap) { - - def.headerTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (typeof def.headerDblTap == "function") { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - def.headerDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (typeof def.headerTapHold == "function") { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - def.headerTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - - //store column cell click event bindings - - if (typeof def.cellClick == "function") { - - self.cellEvents.cellClick = def.cellClick; - } - - if (typeof def.cellDblClick == "function") { - - self.cellEvents.cellDblClick = def.cellDblClick; - } - - if (typeof def.cellContext == "function") { - - self.cellEvents.cellContext = def.cellContext; - } - - //store column mouse event bindings - - if (typeof def.cellMouseEnter == "function") { - - self.cellEvents.cellMouseEnter = def.cellMouseEnter; - } - - if (typeof def.cellMouseLeave == "function") { - - self.cellEvents.cellMouseLeave = def.cellMouseLeave; - } - - if (typeof def.cellMouseOver == "function") { - - self.cellEvents.cellMouseOver = def.cellMouseOver; - } - - if (typeof def.cellMouseOut == "function") { - - self.cellEvents.cellMouseOut = def.cellMouseOut; - } - - if (typeof def.cellMouseMove == "function") { - - self.cellEvents.cellMouseMove = def.cellMouseMove; - } - - //setup column cell tap event bindings - - if (typeof def.cellTap == "function") { - - self.cellEvents.cellTap = def.cellTap; - } - - if (typeof def.cellDblTap == "function") { - - self.cellEvents.cellDblTap = def.cellDblTap; - } - - if (typeof def.cellTapHold == "function") { - - self.cellEvents.cellTapHold = def.cellTapHold; - } - - //setup column cell edit callbacks - - if (typeof def.cellEdited == "function") { - - self.cellEvents.cellEdited = def.cellEdited; - } - - if (typeof def.cellEditing == "function") { - - self.cellEvents.cellEditing = def.cellEditing; - } - - if (typeof def.cellEditCancelled == "function") { - - self.cellEvents.cellEditCancelled = def.cellEditCancelled; - } - }; - - //build header element for header - - Column.prototype._buildColumnHeader = function () { - - var self = this, - def = self.definition, - table = self.table, - sortable; - - //set column sorter - - if (table.modExists("sort")) { - - table.modules.sort.initializeColumn(self, self.contentElement); - } - - //set column header context menu - - if ((def.headerContextMenu || def.headerMenu) && table.modExists("menu")) { - - table.modules.menu.initializeColumnHeader(self); - } - - //set column formatter - - if (table.modExists("format")) { - - table.modules.format.initializeColumn(self); - } - - //set column editor - - if (typeof def.editor != "undefined" && table.modExists("edit")) { - - table.modules.edit.initializeColumn(self); - } - - //set colum validator - - if (typeof def.validator != "undefined" && table.modExists("validate")) { - - table.modules.validate.initializeColumn(self); - } - - //set column mutator - - if (table.modExists("mutator")) { - - table.modules.mutator.initializeColumn(self); - } - - //set column accessor - - if (table.modExists("accessor")) { - - table.modules.accessor.initializeColumn(self); - } - - //set respoviveLayout - - if (_typeof(table.options.responsiveLayout) && table.modExists("responsiveLayout")) { - - table.modules.responsiveLayout.initializeColumn(self); - } - - //set column visibility - - if (typeof def.visible != "undefined") { - - if (def.visible) { - - self.show(true); - } else { - - self.hide(true); - } - } - - //asign additional css classes to column header - - if (def.cssClass) { - - var classeNames = def.cssClass.split(" "); - - classeNames.forEach(function (className) { - - self.element.classList.add(className); - }); - } - - if (def.field) { - - this.element.setAttribute("tabulator-field", def.field); - } - - //set min width if present - - self.setMinWidth(typeof def.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(def.minWidth)); - - self.reinitializeWidth(); - - //set tooltip if present - - self.tooltip = self.definition.tooltip || self.definition.tooltip === false ? self.definition.tooltip : self.table.options.tooltips; - - //set orizontal text alignment - - self.hozAlign = typeof self.definition.hozAlign == "undefined" ? self.table.options.cellHozAlign : self.definition.hozAlign; - - self.vertAlign = typeof self.definition.vertAlign == "undefined" ? self.table.options.cellVertAlign : self.definition.vertAlign; - }; - - Column.prototype._buildColumnHeaderContent = function () { - - var def = this.definition, - table = this.table; - - var contentElement = document.createElement("div"); - - contentElement.classList.add("tabulator-col-content"); - - this.titleElement = this._buildColumnHeaderTitle(); - - contentElement.appendChild(this.titleElement); - - return contentElement; - }; - - //build title element of column - - Column.prototype._buildColumnHeaderTitle = function () { - - var self = this, - def = self.definition, - table = self.table, - title; - - var titleHolderElement = document.createElement("div"); - - titleHolderElement.classList.add("tabulator-col-title"); - - if (def.editableTitle) { - - var titleElement = document.createElement("input"); - - titleElement.classList.add("tabulator-title-editor"); - - titleElement.addEventListener("click", function (e) { - - e.stopPropagation(); - - titleElement.focus(); - }); - - titleElement.addEventListener("change", function () { - - def.title = titleElement.value; - - table.options.columnTitleChanged.call(self.table, self.getComponent()); - }); - - titleHolderElement.appendChild(titleElement); - - if (def.field) { - - table.modules.localize.bind("columns|" + def.field, function (text) { - - titleElement.value = text || def.title || " "; - }); - } else { - - titleElement.value = def.title || " "; - } - } else { - - if (def.field) { - - table.modules.localize.bind("columns|" + def.field, function (text) { - - self._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); - }); - } else { - - self._formatColumnHeaderTitle(titleHolderElement, def.title || " "); - } - } - - return titleHolderElement; - }; - - Column.prototype._formatColumnHeaderTitle = function (el, title) { - var _this5 = this; - - var formatter, contents, params, mockCell, onRendered; - - if (this.definition.titleFormatter && this.table.modExists("format")) { - - formatter = this.table.modules.format.getFormatter(this.definition.titleFormatter); - - onRendered = function onRendered(callback) { - - _this5.titleFormatterRendered = callback; - }; - - mockCell = { - - getValue: function getValue() { - - return title; - }, - - getElement: function getElement() { - - return el; - } - - }; - - params = this.definition.titleFormatterParams || {}; - - params = typeof params === "function" ? params() : params; - - contents = formatter.call(this.table.modules.format, mockCell, params, onRendered); - - switch (typeof contents === 'undefined' ? 'undefined' : _typeof(contents)) { - - case "object": - - if (contents instanceof Node) { - - el.appendChild(contents); - } else { - - el.innerHTML = ""; - - console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", contents); - } - - break; - - case "undefined": - - case "null": - - el.innerHTML = ""; - - break; - - default: - - el.innerHTML = contents; - - } - } else { - - el.innerHTML = title; - } - }; - - //build header element for column group - - Column.prototype._buildGroupHeader = function () { - var _this6 = this; - - this.element.classList.add("tabulator-col-group"); - - this.element.setAttribute("role", "columngroup"); - - this.element.setAttribute("aria-title", this.definition.title); - - //asign additional css classes to column header - - if (this.definition.cssClass) { - - var classeNames = this.definition.cssClass.split(" "); - - classeNames.forEach(function (className) { - - _this6.element.classList.add(className); - }); - } - - this.element.appendChild(this.groupElement); - }; - - //flat field lookup - - Column.prototype._getFlatData = function (data) { - - return data[this.field]; - }; - - //nested field lookup - - Column.prototype._getNestedData = function (data) { - - var dataObj = data, - structure = this.fieldStructure, - length = structure.length, - output; - - for (var i = 0; i < length; i++) { - - dataObj = dataObj[structure[i]]; - - output = dataObj; - - if (!dataObj) { - - break; - } - } - - return output; - }; - - //flat field set - - Column.prototype._setFlatData = function (data, value) { - - if (this.field) { - - data[this.field] = value; - } - }; - - //nested field set - - Column.prototype._setNestedData = function (data, value) { - - var dataObj = data, - structure = this.fieldStructure, - length = structure.length; - - for (var i = 0; i < length; i++) { - - if (i == length - 1) { - - dataObj[structure[i]] = value; - } else { - - if (!dataObj[structure[i]]) { - - if (typeof value !== "undefined") { - - dataObj[structure[i]] = {}; - } else { - - break; - } - } - - dataObj = dataObj[structure[i]]; - } - } - }; - - //attach column to this group - - Column.prototype.attachColumn = function (column) { - - var self = this; - - if (self.groupElement) { - - self.columns.push(column); - - self.groupElement.appendChild(column.getElement()); - } else { - - console.warn("Column Warning - Column being attached to another column instead of column group"); - } - }; - - //vertically align header in column - - Column.prototype.verticalAlign = function (alignment, height) { - - //calculate height of column header and group holder element - - var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : height || this.parent.getHeadersElement().clientHeight; - - // var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight; - - - this.element.style.height = parentHeight + "px"; - - if (this.isGroup) { - - this.groupElement.style.minHeight = parentHeight - this.contentElement.offsetHeight + "px"; - } - - //vertically align cell contents - - if (!this.isGroup && alignment !== "top") { - - if (alignment === "bottom") { - - this.element.style.paddingTop = this.element.clientHeight - this.contentElement.offsetHeight + "px"; - } else { - - this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) / 2 + "px"; - } - } - - this.columns.forEach(function (column) { - - column.verticalAlign(alignment); - }); - }; - - //clear vertical alignmenet - - Column.prototype.clearVerticalAlign = function () { - - this.element.style.paddingTop = ""; - - this.element.style.height = ""; - - this.element.style.minHeight = ""; - - this.groupElement.style.minHeight = ""; - - this.columns.forEach(function (column) { - - column.clearVerticalAlign(); - }); - }; - - Column.prototype.bindModuleColumns = function () { - - //check if rownum formatter is being used on a column - - if (this.definition.formatter == "rownum") { - - this.table.rowManager.rowNumColumn = this; - } - }; - - //// Retreive Column Information //// - - - //return column header element - - Column.prototype.getElement = function () { - - return this.element; - }; - - //return colunm group element - - Column.prototype.getGroupElement = function () { - - return this.groupElement; - }; - - //return field name - - Column.prototype.getField = function () { - - return this.field; - }; - - //return the first column in a group - - Column.prototype.getFirstColumn = function () { - - if (!this.isGroup) { - - return this; - } else { - - if (this.columns.length) { - - return this.columns[0].getFirstColumn(); - } else { - - return false; - } - } - }; - - //return the last column in a group - - Column.prototype.getLastColumn = function () { - - if (!this.isGroup) { - - return this; - } else { - - if (this.columns.length) { - - return this.columns[this.columns.length - 1].getLastColumn(); - } else { - - return false; - } - } - }; - - //return all columns in a group - - Column.prototype.getColumns = function () { - - return this.columns; - }; - - //return all columns in a group - - Column.prototype.getCells = function () { - - return this.cells; - }; - - //retreive the top column in a group of columns - - Column.prototype.getTopColumn = function () { - - if (this.parent.isGroup) { - - return this.parent.getTopColumn(); - } else { - - return this; - } - }; - - //return column definition object - - Column.prototype.getDefinition = function (updateBranches) { - - var colDefs = []; - - if (this.isGroup && updateBranches) { - - this.columns.forEach(function (column) { - - colDefs.push(column.getDefinition(true)); - }); - - this.definition.columns = colDefs; - } - - return this.definition; - }; - - //////////////////// Actions //////////////////// - - - Column.prototype.checkColumnVisibility = function () { - - var visible = false; - - this.columns.forEach(function (column) { - - if (column.visible) { - - visible = true; - } - }); - - if (visible) { - - this.show(); - - this.parent.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } else { - - this.hide(); - } - }; - - //show column - - Column.prototype.show = function (silent, responsiveToggle) { - - if (!this.visible) { - - this.visible = true; - - this.element.style.display = ""; - - if (this.parent.isGroup) { - - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - - cell.show(); - }); - - if (!this.isGroup && this.width === null) { - - this.reinitializeWidth(); - } - - this.table.columnManager._verticalAlignHeaders(); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), true); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - //hide column - - Column.prototype.hide = function (silent, responsiveToggle) { - - if (this.visible) { - - this.visible = false; - - this.element.style.display = "none"; - - this.table.columnManager._verticalAlignHeaders(); - - if (this.parent.isGroup) { - - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - - cell.hide(); - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - Column.prototype.matchChildWidths = function () { - - var childWidth = 0; - - if (this.contentElement && this.columns.length) { - - this.columns.forEach(function (column) { - - if (column.visible) { - - childWidth += column.getWidth(); - } - }); - - this.contentElement.style.maxWidth = childWidth - 1 + "px"; - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - Column.prototype.setWidth = function (width) { - - this.widthFixed = true; - - this.setWidthActual(width); - }; - - Column.prototype.setWidthActual = function (width) { - - if (isNaN(width)) { - - width = Math.floor(this.table.element.clientWidth / 100 * parseInt(width)); - } - - width = Math.max(this.minWidth, width); - - this.width = width; - - this.widthStyled = width ? width + "px" : ""; - - this.element.style.width = this.widthStyled; - - if (!this.isGroup) { - - this.cells.forEach(function (cell) { - - cell.setWidth(); - }); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - - //set resizable handles - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - }; - - Column.prototype.checkCellHeights = function () { - - var rows = []; - - this.cells.forEach(function (cell) { - - if (cell.row.heightInitialized) { - - if (cell.row.getElement().offsetParent !== null) { - - rows.push(cell.row); - - cell.row.clearCellHeight(); - } else { - - cell.row.heightInitialized = false; - } - } - }); - - rows.forEach(function (row) { - - row.calcHeight(); - }); - - rows.forEach(function (row) { - - row.setCellHeight(); - }); - }; - - Column.prototype.getWidth = function () { - - var width = 0; - - if (this.isGroup) { - - this.columns.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - } else { - - width = this.width; - } - - return width; - }; - - Column.prototype.getHeight = function () { - - return this.element.offsetHeight; - }; - - Column.prototype.setMinWidth = function (minWidth) { - - this.minWidth = minWidth; - - this.minWidthStyled = minWidth ? minWidth + "px" : ""; - - this.element.style.minWidth = this.minWidthStyled; - - this.cells.forEach(function (cell) { - - cell.setMinWidth(); - }); - }; - - Column.prototype.delete = function () { - var _this7 = this; - - return new Promise(function (resolve, reject) { - - if (_this7.isGroup) { - - _this7.columns.forEach(function (column) { - - column.delete(); - }); - } - - //cancel edit if column is currently being edited - - if (_this7.table.modExists("edit")) { - - if (_this7.table.modules.edit.currentCell.column === _this7) { - - _this7.table.modules.edit.cancelEdit(); - } - } - - var cellCount = _this7.cells.length; - - for (var i = 0; i < cellCount; i++) { - - _this7.cells[0].delete(); - } - - _this7.element.parentNode.removeChild(_this7.element); - - _this7.table.columnManager.deregisterColumn(_this7); - - resolve(); - }); - }; - - Column.prototype.columnRendered = function () { - - if (this.titleFormatterRendered) { - - this.titleFormatterRendered(); - } - }; - - //////////////// Cell Management ///////////////// - - - //generate cell for this column - - Column.prototype.generateCell = function (row) { - - var self = this; - - var cell = new Cell(self, row); - - this.cells.push(cell); - - return cell; - }; - - Column.prototype.nextColumn = function () { - - var index = this.table.columnManager.findColumnIndex(this); - - return index > -1 ? this._nextVisibleColumn(index + 1) : false; - }; - - Column.prototype._nextVisibleColumn = function (index) { - - var column = this.table.columnManager.getColumnByIndex(index); - - return !column || column.visible ? column : this._nextVisibleColumn(index + 1); - }; - - Column.prototype.prevColumn = function () { - - var index = this.table.columnManager.findColumnIndex(this); - - return index > -1 ? this._prevVisibleColumn(index - 1) : false; - }; - - Column.prototype._prevVisibleColumn = function (index) { - - var column = this.table.columnManager.getColumnByIndex(index); - - return !column || column.visible ? column : this._prevVisibleColumn(index - 1); - }; - - Column.prototype.reinitializeWidth = function (force) { - - this.widthFixed = false; - - //set width if present - - if (typeof this.definition.width !== "undefined" && !force) { - - this.setWidth(this.definition.width); - } - - //hide header filters to prevent them altering column width - - if (this.table.modExists("filter")) { - - this.table.modules.filter.hideHeaderFilterElements(); - } - - this.fitToData(); - - //show header filters again after layout is complete - - if (this.table.modExists("filter")) { - - this.table.modules.filter.showHeaderFilterElements(); - } - }; - - //set column width to maximum cell width - - Column.prototype.fitToData = function () { - - var self = this; - - if (!this.widthFixed) { - - this.element.style.width = ""; - - self.cells.forEach(function (cell) { - - cell.clearWidth(); - }); - } - - var maxWidth = this.element.offsetWidth; - - if (!self.width || !this.widthFixed) { - - self.cells.forEach(function (cell) { - - var width = cell.getWidth(); - - if (width > maxWidth) { - - maxWidth = width; - } - }); - - if (maxWidth) { - - self.setWidthActual(maxWidth + 1); - } - } - }; - - Column.prototype.updateDefinition = function (updates) { - var _this8 = this; - - return new Promise(function (resolve, reject) { - - var definition; - - if (!_this8.isGroup) { - - definition = Object.assign({}, _this8.getDefinition()); - - definition = Object.assign(definition, updates); - - _this8.table.columnManager.addColumn(definition, false, _this8).then(function (column) { - - if (definition.field == _this8.field) { - - _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays - } - - _this8.delete().then(function () { - - resolve(column.getComponent()); - }).catch(function (err) { - - reject(err); - }); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - - reject("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - } - }); - }; - - Column.prototype.deleteCell = function (cell) { - - var index = this.cells.indexOf(cell); - - if (index > -1) { - - this.cells.splice(index, 1); - } - }; - - Column.prototype.defaultOptionList = ["title", "field", "columns", "visible", "align", "hozAlign", "vertAlign", "width", "minWidth", "widthGrow", "widthShrink", "resizable", "frozen", "responsive", "tooltip", "cssClass", "rowHandle", "hideInHtml", "print", "htmlOutput", "sorter", "sorterParams", "formatter", "formatterParams", "variableHeight", "editable", "editor", "editorParams", "validator", "mutator", "mutatorParams", "mutatorData", "mutatorDataParams", "mutatorEdit", "mutatorEditParams", "mutatorClipboard", "mutatorClipboardParams", "accessor", "accessorParams", "accessorData", "accessorDataParams", "accessorDownload", "accessorDownloadParams", "accessorClipboard", "accessorClipboardParams", "accessorPrint", "accessorPrintParams", "accessorHtmlOutput", "accessorHtmlOutputParams", "clipboard", "download", "downloadTitle", "topCalc", "topCalcParams", "topCalcFormatter", "topCalcFormatterParams", "bottomCalc", "bottomCalcParams", "bottomCalcFormatter", "bottomCalcFormatterParams", "cellClick", "cellDblClick", "cellContext", "cellTap", "cellDblTap", "cellTapHold", "cellMouseEnter", "cellMouseLeave", "cellMouseOver", "cellMouseOut", "cellMouseMove", "cellEditing", "cellEdited", "cellEditCancelled", "headerSort", "headerSortStartingDir", "headerSortTristate", "headerClick", "headerDblClick", "headerContext", "headerTap", "headerDblTap", "headerTapHold", "headerTooltip", "headerVertical", "editableTitle", "titleFormatter", "titleFormatterParams", "headerFilter", "headerFilterPlaceholder", "headerFilterParams", "headerFilterEmptyCheck", "headerFilterFunc", "headerFilterFuncParams", "headerFilterLiveFilter", "print", "headerContextMenu", "headerMenu", "contextMenu", "formatterPrint", "formatterPrintParams", "formatterClipboard", "formatterClipboardParams", "formatterHtmlOutput", "formatterHtmlOutputParams"]; - - //////////////// Event Bindings ///////////////// - - - //////////////// Object Generation ///////////////// - - Column.prototype.getComponent = function () { - - return new ColumnComponent(this); - }; - - var RowManager = function RowManager(table) { - - this.table = table; - - this.element = this.createHolderElement(); //containing element - - this.tableElement = this.createTableElement(); //table element - - this.heightFixer = this.createTableElement(); //table element - - this.columnManager = null; //hold column manager object - - this.height = 0; //hold height of table element - - - this.firstRender = false; //handle first render - - this.renderMode = "virtual"; //current rendering mode - - this.fixedHeight = false; //current rendering mode - - - this.rows = []; //hold row data objects - - this.activeRows = []; //rows currently available to on display in the table - - this.activeRowsCount = 0; //count of active rows - - - this.displayRows = []; //rows currently on display in the table - - this.displayRowsCount = 0; //count of display rows - - - this.scrollTop = 0; - - this.scrollLeft = 0; - - this.vDomRowHeight = 20; //approximation of row heights for padding - - - this.vDomTop = 0; //hold position for first rendered row in the virtual DOM - - this.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM - - - this.vDomScrollPosTop = 0; //last scroll position of the vDom top; - - this.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom; - - - this.vDomTopPad = 0; //hold value of padding for top of virtual DOM - - this.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM - - - this.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go - - - this.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling - - - this.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows) - - this.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin - - - this.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed - - this.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed - - - this.rowNumColumn = false; //hold column component for row number column - - - this.redrawBlock = false; //prevent redraws to allow multiple data manipulations becore continuing - - this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed - - this.redrawBlockRederInPosition = false; //store latest redraw function calls for when redraw is needed - }; - - //////////////// Setup Functions ///////////////// - - - RowManager.prototype.createHolderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-tableHolder"); - - el.setAttribute("tabindex", 0); - - return el; - }; - - RowManager.prototype.createTableElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-table"); - - return el; - }; - - //return containing element - - RowManager.prototype.getElement = function () { - - return this.element; - }; - - //return table element - - RowManager.prototype.getTableElement = function () { - - return this.tableElement; - }; - - //return position of row in table - - RowManager.prototype.getRowPosition = function (row, active) { - - if (active) { - - return this.activeRows.indexOf(row); - } else { - - return this.rows.indexOf(row); - } - }; - - //link to column manager - - RowManager.prototype.setColumnManager = function (manager) { - - this.columnManager = manager; - }; - - RowManager.prototype.initialize = function () { - - var self = this; - - self.setRenderMode(); - - //initialize manager - - self.element.appendChild(self.tableElement); - - self.firstRender = true; - - //scroll header along with table body - - self.element.addEventListener("scroll", function () { - - var left = self.element.scrollLeft; - - //handle horizontal scrolling - - if (self.scrollLeft != left) { - - self.columnManager.scrollHorizontal(left); - - if (self.table.options.groupBy) { - - self.table.modules.groupRows.scrollHeaders(left); - } - - if (self.table.modExists("columnCalcs")) { - - self.table.modules.columnCalcs.scrollHorizontal(left); - } - - self.table.options.scrollHorizontal(left); - } - - self.scrollLeft = left; - }); - - //handle virtual dom scrolling - - if (this.renderMode === "virtual") { - - self.element.addEventListener("scroll", function () { - - var top = self.element.scrollTop; - - var dir = self.scrollTop > top; - - //handle verical scrolling - - if (self.scrollTop != top) { - - self.scrollTop = top; - - self.scrollVertical(dir); - - if (self.table.options.ajaxProgressiveLoad == "scroll") { - - self.table.modules.ajax.nextPage(self.element.scrollHeight - self.element.clientHeight - top); - } - - self.table.options.scrollVertical(top); - } else { - - self.scrollTop = top; - } - }); - } - }; - - ////////////////// Row Manipulation ////////////////// - - - RowManager.prototype.findRow = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Row) { - - //subject is row element - - return subject; - } else if (subject instanceof RowComponent) { - - //subject is public row component - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the row - - var match = self.rows.find(function (row) { - - return row.element === subject; - }); - - return match || false; - } - } else if (typeof subject == "undefined" || subject === null) { - - return false; - } else { - - //subject should be treated as the index of the row - - var _match = self.rows.find(function (row) { - - return row.data[self.table.options.index] == subject; - }); - - return _match || false; - } - - //catch all for any other type of input - - - return false; - }; - - RowManager.prototype.getRowFromDataObject = function (data) { - - var match = this.rows.find(function (row) { - - return row.data === data; - }); - - return match || false; - }; - - RowManager.prototype.getRowFromPosition = function (position, active) { - - if (active) { - - return this.activeRows[position]; - } else { - - return this.rows[position]; - } - }; - - RowManager.prototype.scrollToRow = function (row, position, ifVisible) { - var _this9 = this; - - var rowIndex = this.getDisplayRows().indexOf(row), - rowEl = row.getElement(), - rowTop, - offset = 0; - - return new Promise(function (resolve, reject) { - - if (rowIndex > -1) { - - if (typeof position === "undefined") { - - position = _this9.table.options.scrollToRowPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this9.table.options.scrollToRowIfVisible; - } - - if (position === "nearest") { - - switch (_this9.renderMode) { - - case "classic": - - rowTop = Tabulator.prototype.helpers.elOffset(rowEl).top; - - position = Math.abs(_this9.element.scrollTop - rowTop) > Math.abs(_this9.element.scrollTop + _this9.element.clientHeight - rowTop) ? "bottom" : "top"; - - break; - - case "virtual": - - position = Math.abs(_this9.vDomTop - rowIndex) > Math.abs(_this9.vDomBottom - rowIndex) ? "bottom" : "top"; - - break; - - } - } - - //check row visibility - - if (!ifVisible) { - - if (Tabulator.prototype.helpers.elVisible(rowEl)) { - - offset = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top; - - if (offset > 0 && offset < _this9.element.clientHeight - rowEl.offsetHeight) { - - return false; - } - } - } - - //scroll to row - - switch (_this9.renderMode) { - - case "classic": - - _this9.element.scrollTop = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top + _this9.element.scrollTop; - - break; - - case "virtual": - - _this9._virtualRenderFill(rowIndex, true); - - break; - - } - - //align to correct position - - switch (position) { - - case "middle": - - case "center": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - - _this9.element.scrollTop = _this9.element.scrollTop + (rowEl.offsetTop - _this9.element.scrollTop) - (_this9.element.scrollHeight - rowEl.offsetTop) / 2; - } else { - - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight / 2; - } - - break; - - case "bottom": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - - _this9.element.scrollTop = _this9.element.scrollTop - (_this9.element.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight; - } else { - - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight + rowEl.offsetHeight; - } - - break; - - } - - resolve(); - } else { - - console.warn("Scroll Error - Row not visible"); - - reject("Scroll Error - Row not visible"); - } - }); - }; - - ////////////////// Data Handling ////////////////// - - - RowManager.prototype.setData = function (data, renderInPosition, columnsChanged) { - var _this10 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - - if (renderInPosition && _this10.getDisplayRows().length) { - - if (self.table.options.pagination) { - - self._setDataActual(data, true); - } else { - - _this10.reRenderInPosition(function () { - - self._setDataActual(data); - }); - } - } else { - - if (_this10.table.options.autoColumns && columnsChanged) { - - _this10.table.columnManager.generateColumnsFromRowData(data); - } - - _this10.resetScroll(); - - _this10._setDataActual(data); - } - - resolve(); - }); - }; - - RowManager.prototype._setDataActual = function (data, renderInPosition) { - - var self = this; - - self.table.options.dataLoading.call(this.table, data); - - this._wipeElements(); - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.clear(); - } - - if (Array.isArray(data)) { - - if (this.table.modExists("selectRow")) { - - this.table.modules.selectRow.clearSelectionData(); - } - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - - this.table.modules.reactiveData.watchData(data); - } - - data.forEach(function (def, i) { - - if (def && (typeof def === 'undefined' ? 'undefined' : _typeof(def)) === "object") { - - var row = new Row(def, self); - - self.rows.push(row); - } else { - - console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def); - } - }); - - self.table.options.dataLoaded.call(this.table, data); - - self.refreshActiveData(false, false, renderInPosition); - } else { - - console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ", typeof data === 'undefined' ? 'undefined' : _typeof(data), "\nData: ", data); - } - }; - - RowManager.prototype._wipeElements = function () { - - this.rows.forEach(function (row) { - - row.wipe(); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.wipe(); - } - - this.rows = []; - }; - - RowManager.prototype.deleteRow = function (row, blockRedraw) { - - var allIndex = this.rows.indexOf(row), - activeIndex = this.activeRows.indexOf(row); - - if (activeIndex > -1) { - - this.activeRows.splice(activeIndex, 1); - } - - if (allIndex > -1) { - - this.rows.splice(allIndex, 1); - } - - this.setActiveRows(this.activeRows); - - this.displayRowIterator(function (rows) { - - var displayIndex = rows.indexOf(row); - - if (displayIndex > -1) { - - rows.splice(displayIndex, 1); - } - }); - - if (!blockRedraw) { - - this.reRenderInPosition(); - } - - this.regenerateRowNumbers(); - - this.table.options.rowDeleted.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.updateGroupRows(true); - } else if (this.table.options.pagination && this.table.modExists("page")) { - - this.refreshActiveData(false, false, true); - } else { - - if (this.table.options.pagination && this.table.modExists("page")) { - - this.refreshActiveData("page"); - } - } - }; - - RowManager.prototype.addRow = function (data, pos, index, blockRedraw) { - - var row = this.addRowActual(data, pos, index, blockRedraw); - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("rowAdd", row, { data: data, pos: pos, index: index }); - } - - return row; - }; - - //add multiple rows - - RowManager.prototype.addRows = function (data, pos, index) { - var _this11 = this; - - var self = this, - length = 0, - rows = []; - - return new Promise(function (resolve, reject) { - - pos = _this11.findAddRowPos(pos); - - if (!Array.isArray(data)) { - - data = [data]; - } - - length = data.length - 1; - - if (typeof index == "undefined" && pos || typeof index !== "undefined" && !pos) { - - data.reverse(); - } - - data.forEach(function (item, i) { - - var row = self.addRow(item, pos, index, true); - - rows.push(row); - }); - - if (_this11.table.options.groupBy && _this11.table.modExists("groupRows")) { - - _this11.table.modules.groupRows.updateGroupRows(true); - } else if (_this11.table.options.pagination && _this11.table.modExists("page")) { - - _this11.refreshActiveData(false, false, true); - } else { - - _this11.reRenderInPosition(); - } - - //recalc column calculations if present - - if (_this11.table.modExists("columnCalcs")) { - - _this11.table.modules.columnCalcs.recalc(_this11.table.rowManager.activeRows); - } - - _this11.regenerateRowNumbers(); - - resolve(rows); - }); - }; - - RowManager.prototype.findAddRowPos = function (pos) { - - if (typeof pos === "undefined") { - - pos = this.table.options.addRowPos; - } - - if (pos === "pos") { - - pos = true; - } - - if (pos === "bottom") { - - pos = false; - } - - return pos; - }; - - RowManager.prototype.addRowActual = function (data, pos, index, blockRedraw) { - - var row = data instanceof Row ? data : new Row(data || {}, this), - top = this.findAddRowPos(pos), - allIndex = -1, - activeIndex, - dispRows; - - if (!index && this.table.options.pagination && this.table.options.paginationAddRow == "page") { - - dispRows = this.getDisplayRows(); - - if (top) { - - if (dispRows.length) { - - index = dispRows[0]; - } else { - - if (this.activeRows.length) { - - index = this.activeRows[this.activeRows.length - 1]; - - top = false; - } - } - } else { - - if (dispRows.length) { - - index = dispRows[dispRows.length - 1]; - - top = dispRows.length < this.table.modules.page.getPageSize() ? false : true; - } - } - } - - if (typeof index !== "undefined") { - - index = this.findRow(index); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.assignRowToGroup(row); - - var groupRows = row.getGroup().rows; - - if (groupRows.length > 1) { - - if (!index || index && groupRows.indexOf(index) == -1) { - - if (top) { - - if (groupRows[0] !== row) { - - index = groupRows[0]; - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } else { - - if (groupRows[groupRows.length - 1] !== row) { - - index = groupRows[groupRows.length - 1]; - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } else { - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } - - if (index) { - - allIndex = this.rows.indexOf(index); - } - - if (index && allIndex > -1) { - - activeIndex = this.activeRows.indexOf(index); - - this.displayRowIterator(function (rows) { - - var displayIndex = rows.indexOf(index); - - if (displayIndex > -1) { - - rows.splice(top ? displayIndex : displayIndex + 1, 0, row); - } - }); - - if (activeIndex > -1) { - - this.activeRows.splice(top ? activeIndex : activeIndex + 1, 0, row); - } - - this.rows.splice(top ? allIndex : allIndex + 1, 0, row); - } else { - - if (top) { - - this.displayRowIterator(function (rows) { - - rows.unshift(row); - }); - - this.activeRows.unshift(row); - - this.rows.unshift(row); - } else { - - this.displayRowIterator(function (rows) { - - rows.push(row); - }); - - this.activeRows.push(row); - - this.rows.push(row); - } - } - - this.setActiveRows(this.activeRows); - - this.table.options.rowAdded.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (!blockRedraw) { - - this.reRenderInPosition(); - } - - return row; - }; - - RowManager.prototype.moveRow = function (from, to, after) { - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("rowMove", from, { posFrom: this.getRowPosition(from), posTo: this.getRowPosition(to), to: to, after: after }); - } - - this.moveRowActual(from, to, after); - - this.regenerateRowNumbers(); - - this.table.options.rowMoved.call(this.table, from.getComponent()); - }; - - RowManager.prototype.moveRowActual = function (from, to, after) { - var _this12 = this; - - this._moveRowInArray(this.rows, from, to, after); - - this._moveRowInArray(this.activeRows, from, to, after); - - this.displayRowIterator(function (rows) { - - _this12._moveRowInArray(rows, from, to, after); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (!after && to instanceof Group) { - - to = this.table.rowManager.prevDisplayRow(from) || to; - } - - var toGroup = to.getGroup(); - - var fromGroup = from.getGroup(); - - if (toGroup === fromGroup) { - - this._moveRowInArray(toGroup.rows, from, to, after); - } else { - - if (fromGroup) { - - fromGroup.removeRow(from); - } - - toGroup.insertRow(from, to, after); - } - } - }; - - RowManager.prototype._moveRowInArray = function (rows, from, to, after) { - - var fromIndex, toIndex, start, end; - - if (from !== to) { - - fromIndex = rows.indexOf(from); - - if (fromIndex > -1) { - - rows.splice(fromIndex, 1); - - toIndex = rows.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - rows.splice(toIndex + 1, 0, from); - } else { - - rows.splice(toIndex, 0, from); - } - } else { - - rows.splice(fromIndex, 0, from); - } - } - - //restyle rows - - if (rows === this.getDisplayRows()) { - - start = fromIndex < toIndex ? fromIndex : toIndex; - - end = toIndex > fromIndex ? toIndex : fromIndex + 1; - - for (var i = start; i <= end; i++) { - - if (rows[i]) { - - this.styleRow(rows[i], i); - } - } - } - } - }; - - RowManager.prototype.clearData = function () { - - this.setData([]); - }; - - RowManager.prototype.getRowIndex = function (row) { - - return this.findRowIndex(row, this.rows); - }; - - RowManager.prototype.getDisplayRowIndex = function (row) { - - var index = this.getDisplayRows().indexOf(row); - - return index > -1 ? index : false; - }; - - RowManager.prototype.nextDisplayRow = function (row, rowOnly) { - - var index = this.getDisplayRowIndex(row), - nextRow = false; - - if (index !== false && index < this.displayRowsCount - 1) { - - nextRow = this.getDisplayRows()[index + 1]; - } - - if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) { - - return this.nextDisplayRow(nextRow, rowOnly); - } - - return nextRow; - }; - - RowManager.prototype.prevDisplayRow = function (row, rowOnly) { - - var index = this.getDisplayRowIndex(row), - prevRow = false; - - if (index) { - - prevRow = this.getDisplayRows()[index - 1]; - } - - if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) { - - return this.prevDisplayRow(prevRow, rowOnly); - } - - return prevRow; - }; - - RowManager.prototype.findRowIndex = function (row, list) { - - var rowIndex; - - row = this.findRow(row); - - if (row) { - - rowIndex = list.indexOf(row); - - if (rowIndex > -1) { - - return rowIndex; - } - } - - return false; - }; - - RowManager.prototype.getData = function (active, transform) { - - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - - if (row.type == "row") { - - output.push(row.getData(transform || "data")); - } - }); - - return output; - }; - - RowManager.prototype.getComponents = function (active) { - - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - - output.push(row.getComponent()); - }); - - return output; - }; - - RowManager.prototype.getDataCount = function (active) { - - var rows = this.getRows(active); - - return rows.length; - }; - - RowManager.prototype._genRemoteRequest = function () { - var _this13 = this; - - var table = this.table, - options = table.options, - params = {}; - - if (table.modExists("page")) { - - //set sort data if defined - - if (options.ajaxSorting) { - - var sorters = this.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - - delete item.column; - }); - - params[this.table.modules.page.paginationDataSentNames.sorters] = sorters; - } - - //set filter data if defined - - if (options.ajaxFiltering) { - - var filters = this.table.modules.filter.getFilters(true, true); - - params[this.table.modules.page.paginationDataSentNames.filters] = filters; - } - - this.table.modules.ajax.setParams(params, true); - } - - table.modules.ajax.sendRequest().then(function (data) { - - _this13._setDataActual(data, true); - }).catch(function (e) {}); - }; - - //choose the path to refresh data after a filter update - - RowManager.prototype.filterRefresh = function () { - - var table = this.table, - options = table.options, - left = this.scrollLeft; - - if (options.ajaxFiltering) { - - if (options.pagination == "remote" && table.modExists("page")) { - - table.modules.page.reset(true); - - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - - //assume data is url, make ajax call to url to get data - - this._genRemoteRequest(); - } - } else { - - this.refreshActiveData("filter"); - } - - this.scrollHorizontal(left); - }; - - //choose the path to refresh data after a sorter update - - RowManager.prototype.sorterRefresh = function (loadOrignalData) { - - var table = this.table, - options = this.table.options, - left = this.scrollLeft; - - if (options.ajaxSorting) { - - if ((options.pagination == "remote" || options.progressiveLoad) && table.modExists("page")) { - - table.modules.page.reset(true); - - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - - //assume data is url, make ajax call to url to get data - - this._genRemoteRequest(); - } - } else { - - this.refreshActiveData(loadOrignalData ? "filter" : "sort"); - } - - this.scrollHorizontal(left); - }; - - RowManager.prototype.scrollHorizontal = function (left) { - - this.scrollLeft = left; - - this.element.scrollLeft = left; - - if (this.table.options.groupBy) { - - this.table.modules.groupRows.scrollHeaders(left); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.scrollHorizontal(left); - } - }; - - //set active data set - - RowManager.prototype.refreshActiveData = function (stage, skipStage, renderInPosition) { - - var self = this, - table = this.table, - cascadeOrder = ["all", "filter", "sort", "display", "freeze", "group", "tree", "page"], - displayIndex; - - if (this.redrawBlock) { - - if (!this.redrawBlockRestoreConfig || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage)) { - - this.redrawBlockRestoreConfig = { - - stage: stage, - - skipStage: skipStage, - - renderInPosition: renderInPosition - - }; - } - - return; - } else { - - if (self.table.modExists("edit")) { - - self.table.modules.edit.cancelEdit(); - } - - if (!stage) { - - stage = "all"; - } - - if (table.options.selectable && !table.options.selectablePersistence && table.modExists("selectRow")) { - - table.modules.selectRow.deselectRows(); - } - - //cascade through data refresh stages - - switch (stage) { - - case "all": - - case "filter": - - if (!skipStage) { - - if (table.modExists("filter")) { - - self.setActiveRows(table.modules.filter.filter(self.rows)); - } else { - - self.setActiveRows(self.rows.slice(0)); - } - } else { - - skipStage = false; - } - - case "sort": - - if (!skipStage) { - - if (table.modExists("sort")) { - - table.modules.sort.sort(this.activeRows); - } - } else { - - skipStage = false; - } - - //regenerate row numbers for row number formatter if in use - - this.regenerateRowNumbers(); - - //generic stage to allow for pipeline trigger after the data manipulation stage - - case "display": - - this.resetDisplayRows(); - - case "freeze": - - if (!skipStage) { - - if (this.table.modExists("frozenRows")) { - - if (table.modules.frozenRows.isFrozen()) { - - if (!table.modules.frozenRows.getDisplayIndex()) { - - table.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.frozenRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.frozenRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.frozenRows.setDisplayIndex(displayIndex); - } - } - } - } else { - - skipStage = false; - } - - case "group": - - if (!skipStage) { - - if (table.options.groupBy && table.modExists("groupRows")) { - - if (!table.modules.groupRows.getDisplayIndex()) { - - table.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.groupRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.groupRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.groupRows.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - case "tree": - - if (!skipStage) { - - if (table.options.dataTree && table.modExists("dataTree")) { - - if (!table.modules.dataTree.getDisplayIndex()) { - - table.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.dataTree.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.dataTree.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.dataTree.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - if (table.options.pagination && table.modExists("page") && !renderInPosition) { - - if (table.modules.page.getMode() == "local") { - - table.modules.page.reset(); - } - } - - case "page": - - if (!skipStage) { - - if (table.options.pagination && table.modExists("page")) { - - if (!table.modules.page.getDisplayIndex()) { - - table.modules.page.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.page.getDisplayIndex(); - - if (table.modules.page.getMode() == "local") { - - table.modules.page.setMaxRows(this.getDisplayRows(displayIndex - 1).length); - } - - displayIndex = self.setDisplayRows(table.modules.page.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.page.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - } - - if (Tabulator.prototype.helpers.elVisible(self.element)) { - - if (renderInPosition) { - - self.reRenderInPosition(); - } else { - - self.renderTable(); - - if (table.options.layoutColumnsOnNewData) { - - self.table.columnManager.redraw(true); - } - } - } - - if (table.modExists("columnCalcs")) { - - table.modules.columnCalcs.recalc(this.activeRows); - } - } - }; - - //regenerate row numbers for row number formatter if in use - - RowManager.prototype.regenerateRowNumbers = function () { - var _this14 = this; - - if (this.rowNumColumn) { - - this.activeRows.forEach(function (row) { - - var cell = row.getCell(_this14.rowNumColumn); - - if (cell) { - - cell._generateContents(); - } - }); - } - }; - - RowManager.prototype.setActiveRows = function (activeRows) { - - this.activeRows = activeRows; - - this.activeRowsCount = this.activeRows.length; - }; - - //reset display rows array - - RowManager.prototype.resetDisplayRows = function () { - - this.displayRows = []; - - this.displayRows.push(this.activeRows.slice(0)); - - this.displayRowsCount = this.displayRows[0].length; - - if (this.table.modExists("frozenRows")) { - - this.table.modules.frozenRows.setDisplayIndex(0); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.setDisplayIndex(0); - } - - if (this.table.options.pagination && this.table.modExists("page")) { - - this.table.modules.page.setDisplayIndex(0); - } - }; - - RowManager.prototype.getNextDisplayIndex = function () { - - return this.displayRows.length; - }; - - //set display row pipeline data - - RowManager.prototype.setDisplayRows = function (displayRows, index) { - - var output = true; - - if (index && typeof this.displayRows[index] != "undefined") { - - this.displayRows[index] = displayRows; - - output = true; - } else { - - this.displayRows.push(displayRows); - - output = index = this.displayRows.length - 1; - } - - if (index == this.displayRows.length - 1) { - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - } - - return output; - }; - - RowManager.prototype.getDisplayRows = function (index) { - - if (typeof index == "undefined") { - - return this.displayRows.length ? this.displayRows[this.displayRows.length - 1] : []; - } else { - - return this.displayRows[index] || []; - } - }; - - RowManager.prototype.getVisibleRows = function (viewable) { - - var topEdge = this.element.scrollTop, - bottomEdge = this.element.clientHeight + topEdge, - topFound = false, - topRow = 0, - bottomRow = 0, - rows = this.getDisplayRows(); - - if (viewable) { - - this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - - if (!topFound) { - - if (topEdge - rows[i].getElement().offsetTop >= 0) { - - topRow = i; - } else { - - topFound = true; - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - - bottomRow = i; - } else { - - break; - } - } - } else { - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - - bottomRow = i; - } else { - - break; - } - } - } - } - } else { - - topRow = this.vDomTop; - - bottomRow = this.vDomBottom; - } - - return rows.slice(topRow, bottomRow + 1); - }; - - //repeat action accross display rows - - RowManager.prototype.displayRowIterator = function (callback) { - - this.displayRows.forEach(callback); - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - }; - - //return only actual rows (not group headers etc) - - RowManager.prototype.getRows = function (active) { - - var rows; - - switch (active) { - - case "active": - - rows = this.activeRows; - - break; - - case "display": - - rows = this.table.rowManager.getDisplayRows(); - - break; - - case "visible": - - rows = this.getVisibleRows(true); - - break; - - default: - - rows = this.rows; - - } - - return rows; - }; - - ///////////////// Table Rendering ///////////////// - - - //trigger rerender of table in current position - - RowManager.prototype.reRenderInPosition = function (callback) { - - if (this.getRenderMode() == "virtual") { - - if (this.redrawBlock) { - - if (callback) { - - callback(); - } else { - - this.redrawBlockRederInPosition = true; - } - } else { - - var scrollTop = this.element.scrollTop; - - var topRow = false; - - var topOffset = false; - - var left = this.scrollLeft; - - var rows = this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - - var diff = scrollTop - rows[i].getElement().offsetTop; - - if (topOffset === false || Math.abs(diff) < topOffset) { - - topOffset = diff; - - topRow = i; - } else { - - break; - } - } - } - - if (callback) { - - callback(); - } - - this._virtualRenderFill(topRow === false ? this.displayRowsCount - 1 : topRow, true, topOffset || 0); - - this.scrollHorizontal(left); - } - } else { - - this.renderTable(); - - if (callback) { - - callback(); - } - } - }; - - RowManager.prototype.setRenderMode = function () { - - if (this.table.options.virtualDom) { - - this.renderMode = "virtual"; - - if (this.table.element.clientHeight || this.table.options.height) { - - this.fixedHeight = true; - } else { - - this.fixedHeight = false; - } - } else { - - this.renderMode = "classic"; - } - }; - - RowManager.prototype.getRenderMode = function () { - - return this.renderMode; - }; - - RowManager.prototype.renderTable = function () { - - this.table.options.renderStarted.call(this.table); - - this.element.scrollTop = 0; - - switch (this.renderMode) { - - case "classic": - - this._simpleRender(); - - break; - - case "virtual": - - this._virtualRenderFill(); - - break; - - } - - if (this.firstRender) { - - if (this.displayRowsCount) { - - this.firstRender = false; - - this.table.modules.layout.layout(); - } else { - - this.renderEmptyScroll(); - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (!this.displayRowsCount) { - - if (this.table.options.placeholder) { - - this.table.options.placeholder.setAttribute("tabulator-render-mode", this.renderMode); - - this.getElement().appendChild(this.table.options.placeholder); - - this.table.options.placeholder.style.width = this.table.columnManager.getWidth() + "px"; - } - } - - this.table.options.renderComplete.call(this.table); - }; - - //simple render on heightless table - - RowManager.prototype._simpleRender = function () { - - this._clearVirtualDom(); - - if (this.displayRowsCount) { - - this.checkClassicModeGroupHeaderWidth(); - } else { - - this.renderEmptyScroll(); - } - }; - - RowManager.prototype.checkClassicModeGroupHeaderWidth = function () { - - var self = this, - element = this.tableElement, - onlyGroupHeaders = true; - - self.getDisplayRows().forEach(function (row, index) { - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - - row.initialize(true); - - if (row.type !== "group") { - - onlyGroupHeaders = false; - } - }); - - if (onlyGroupHeaders) { - - element.style.minWidth = self.table.columnManager.getWidth() + "px"; - } else { - - element.style.minWidth = ""; - } - }; - - //show scrollbars on empty table div - - RowManager.prototype.renderEmptyScroll = function () { - - if (this.table.options.placeholder) { - - this.tableElement.style.display = "none"; - } else { - - this.tableElement.style.minWidth = this.table.columnManager.getWidth() + "px"; - - this.tableElement.style.minHeight = "1px"; - - this.tableElement.style.visibility = "hidden"; - } - }; - - RowManager.prototype._clearVirtualDom = function () { - - var element = this.tableElement; - - if (this.table.options.placeholder && this.table.options.placeholder.parentNode) { - - this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder); - } - - // element.children.detach(); - - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.style.paddingTop = ""; - - element.style.paddingBottom = ""; - - element.style.minWidth = ""; - - element.style.minHeight = ""; - - element.style.display = ""; - - element.style.visibility = ""; - - this.scrollTop = 0; - - this.scrollLeft = 0; - - this.vDomTop = 0; - - this.vDomBottom = 0; - - this.vDomTopPad = 0; - - this.vDomBottomPad = 0; - }; - - RowManager.prototype.styleRow = function (row, index) { - - var rowEl = row.getElement(); - - if (index % 2) { - - rowEl.classList.add("tabulator-row-even"); - - rowEl.classList.remove("tabulator-row-odd"); - } else { - - rowEl.classList.add("tabulator-row-odd"); - - rowEl.classList.remove("tabulator-row-even"); - } - }; - - //full virtual render - - RowManager.prototype._virtualRenderFill = function (position, forceMove, offset) { - - var self = this, - element = self.tableElement, - holder = self.element, - topPad = 0, - rowsHeight = 0, - topPadHeight = 0, - i = 0, - onlyGroupHeaders = true, - rows = self.getDisplayRows(); - - position = position || 0; - - offset = offset || 0; - - if (!position) { - - self._clearVirtualDom(); - } else { - - while (element.firstChild) { - element.removeChild(element.firstChild); - } //check if position is too close to bottom of table - - var heightOccupied = (self.displayRowsCount - position + 1) * self.vDomRowHeight; - - if (heightOccupied < self.height) { - - position -= Math.ceil((self.height - heightOccupied) / self.vDomRowHeight); - - if (position < 0) { - - position = 0; - } - } - - //calculate initial pad - - topPad = Math.min(Math.max(Math.floor(self.vDomWindowBuffer / self.vDomRowHeight), self.vDomWindowMinMarginRows), position); - - position -= topPad; - } - - if (self.displayRowsCount && Tabulator.prototype.helpers.elVisible(self.element)) { - - self.vDomTop = position; - - self.vDomBottom = position - 1; - - while ((rowsHeight <= self.height + self.vDomWindowBuffer || i < self.vDomWindowMinTotalRows) && self.vDomBottom < self.displayRowsCount - 1) { - - var index = self.vDomBottom + 1, - row = rows[index], - rowHeight = 0; - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - - if (!row.initialized) { - - row.initialize(true); - } else { - - if (!row.heightInitialized) { - - row.normalizeHeight(true); - } - } - - rowHeight = row.getHeight(); - - if (i < topPad) { - - topPadHeight += rowHeight; - } else { - - rowsHeight += rowHeight; - } - - if (rowHeight > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = rowHeight * 2; - } - - if (row.type !== "group") { - - onlyGroupHeaders = false; - } - - self.vDomBottom++; - - i++; - } - - if (!position) { - - this.vDomTopPad = 0; - - //adjust rowheight to match average of rendered elements - - self.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i); - - self.vDomBottomPad = self.vDomRowHeight * (self.displayRowsCount - self.vDomBottom - 1); - - self.vDomScrollHeight = topPadHeight + rowsHeight + self.vDomBottomPad - self.height; - } else { - - self.vDomTopPad = !forceMove ? self.scrollTop - topPadHeight : self.vDomRowHeight * this.vDomTop + offset; - - self.vDomBottomPad = self.vDomBottom == self.displayRowsCount - 1 ? 0 : Math.max(self.vDomScrollHeight - self.vDomTopPad - rowsHeight - topPadHeight, 0); - } - - element.style.paddingTop = self.vDomTopPad + "px"; - - element.style.paddingBottom = self.vDomBottomPad + "px"; - - if (forceMove) { - - this.scrollTop = self.vDomTopPad + topPadHeight + offset - (this.element.scrollWidth > this.element.clientWidth ? this.element.offsetHeight - this.element.clientHeight : 0); - } - - this.scrollTop = Math.min(this.scrollTop, this.element.scrollHeight - this.height); - - //adjust for horizontal scrollbar if present (and not at top of table) - - if (this.element.scrollWidth > this.element.offsetWidth && forceMove) { - - this.scrollTop += this.element.offsetHeight - this.element.clientHeight; - } - - this.vDomScrollPosTop = this.scrollTop; - - this.vDomScrollPosBottom = this.scrollTop; - - holder.scrollTop = this.scrollTop; - - element.style.minWidth = onlyGroupHeaders ? self.table.columnManager.getWidth() + "px" : ""; - - if (self.table.options.groupBy) { - - if (self.table.modules.layout.getMode() != "fitDataFill" && self.displayRowsCount == self.table.modules.groupRows.countGroups()) { - - self.tableElement.style.minWidth = self.table.columnManager.getWidth(); - } - } - } else { - - this.renderEmptyScroll(); - } - - if (!this.fixedHeight) { - - this.adjustTableSize(); - } - }; - - //handle vertical scrolling - - RowManager.prototype.scrollVertical = function (dir) { - - var topDiff = this.scrollTop - this.vDomScrollPosTop; - - var bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - var margin = this.vDomWindowBuffer * 2; - - if (-topDiff > margin || bottomDiff > margin) { - - //if big scroll redraw table; - - var left = this.scrollLeft; - - this._virtualRenderFill(Math.floor(this.element.scrollTop / this.element.scrollHeight * this.displayRowsCount)); - - this.scrollHorizontal(left); - } else { - - if (dir) { - - //scrolling up - - if (topDiff < 0) { - - this._addTopRow(-topDiff); - } - - if (bottomDiff < 0) { - - //hide bottom row if needed - - if (this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer) { - - this._removeBottomRow(-bottomDiff); - } else { - - this.vDomScrollPosBottom = this.scrollTop; - } - } - } else { - - //scrolling down - - if (topDiff >= 0) { - - //hide top row if needed - - if (this.scrollTop > this.vDomWindowBuffer) { - - this._removeTopRow(topDiff); - } else { - - this.vDomScrollPosTop = this.scrollTop; - } - } - - if (bottomDiff >= 0) { - - this._addBottomRow(bottomDiff); - } - } - } - }; - - RowManager.prototype._addTopRow = function (topDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomTop) { - - var index = this.vDomTop - 1, - topRow = rows[index], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - //hide top row if needed - - if (topDiff >= topRowHeight) { - - this.styleRow(topRow, index); - - table.insertBefore(topRow.getElement(), table.firstChild); - - if (!topRow.initialized || !topRow.heightInitialized) { - - this.vDomTopNewRows.push(topRow); - - if (!topRow.heightInitialized) { - - topRow.clearCellHeight(); - } - } - - topRow.initialize(); - - this.vDomTopPad -= topRowHeight; - - if (this.vDomTopPad < 0) { - - this.vDomTopPad = index * this.vDomRowHeight; - } - - if (!index) { - - this.vDomTopPad = 0; - } - - table.style.paddingTop = this.vDomTopPad + "px"; - - this.vDomScrollPosTop -= topRowHeight; - - this.vDomTop--; - } - - topDiff = -(this.scrollTop - this.vDomScrollPosTop); - - if (topRow.getHeight() > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = topRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomTop && topDiff >= (rows[this.vDomTop - 1].getHeight() || this.vDomRowHeight)) { - - this._addTopRow(topDiff, i + 1); - } else { - - this._quickNormalizeRowHeight(this.vDomTopNewRows); - } - } - }; - - RowManager.prototype._removeTopRow = function (topDiff) { - - var table = this.tableElement, - topRow = this.getDisplayRows()[this.vDomTop], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - if (topDiff >= topRowHeight) { - - var rowEl = topRow.getElement(); - - rowEl.parentNode.removeChild(rowEl); - - this.vDomTopPad += topRowHeight; - - table.style.paddingTop = this.vDomTopPad + "px"; - - this.vDomScrollPosTop += this.vDomTop ? topRowHeight : topRowHeight + this.vDomWindowBuffer; - - this.vDomTop++; - - topDiff = this.scrollTop - this.vDomScrollPosTop; - - this._removeTopRow(topDiff); - } - }; - - RowManager.prototype._addBottomRow = function (bottomDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomBottom < this.displayRowsCount - 1) { - - var index = this.vDomBottom + 1, - bottomRow = rows[index], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - //hide bottom row if needed - - if (bottomDiff >= bottomRowHeight) { - - this.styleRow(bottomRow, index); - - table.appendChild(bottomRow.getElement()); - - if (!bottomRow.initialized || !bottomRow.heightInitialized) { - - this.vDomBottomNewRows.push(bottomRow); - - if (!bottomRow.heightInitialized) { - - bottomRow.clearCellHeight(); - } - } - - bottomRow.initialize(); - - this.vDomBottomPad -= bottomRowHeight; - - if (this.vDomBottomPad < 0 || index == this.displayRowsCount - 1) { - - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - - this.vDomScrollPosBottom += bottomRowHeight; - - this.vDomBottom++; - } - - bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - if (bottomRow.getHeight() > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = bottomRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomBottom < this.displayRowsCount - 1 && bottomDiff >= (rows[this.vDomBottom + 1].getHeight() || this.vDomRowHeight)) { - - this._addBottomRow(bottomDiff, i + 1); - } else { - - this._quickNormalizeRowHeight(this.vDomBottomNewRows); - } - } - }; - - RowManager.prototype._removeBottomRow = function (bottomDiff) { - - var table = this.tableElement, - bottomRow = this.getDisplayRows()[this.vDomBottom], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - if (bottomDiff >= bottomRowHeight) { - - var rowEl = bottomRow.getElement(); - - if (rowEl.parentNode) { - - rowEl.parentNode.removeChild(rowEl); - } - - this.vDomBottomPad += bottomRowHeight; - - if (this.vDomBottomPad < 0) { - - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - - this.vDomScrollPosBottom -= bottomRowHeight; - - this.vDomBottom--; - - bottomDiff = -(this.scrollTop - this.vDomScrollPosBottom); - - this._removeBottomRow(bottomDiff); - } - }; - - RowManager.prototype._quickNormalizeRowHeight = function (rows) { - - rows.forEach(function (row) { - - row.calcHeight(); - }); - - rows.forEach(function (row) { - - row.setCellHeight(); - }); - - rows.length = 0; - }; - - //normalize height of active rows - - RowManager.prototype.normalizeHeight = function () { - - this.activeRows.forEach(function (row) { - - row.normalizeHeight(); - }); - }; - - //adjust the height of the table holder to fit in the Tabulator element - - RowManager.prototype.adjustTableSize = function () { - - var initialHeight = this.element.clientHeight, - modExists; - - if (this.renderMode === "virtual") { - - var otherHeight = this.columnManager.getElement().offsetHeight + (this.table.footerManager && !this.table.footerManager.external ? this.table.footerManager.getElement().offsetHeight : 0); - - if (this.fixedHeight) { - - this.element.style.minHeight = "calc(100% - " + otherHeight + "px)"; - - this.element.style.height = "calc(100% - " + otherHeight + "px)"; - - this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)"; - } else { - - this.element.style.height = ""; - - this.element.style.height = this.table.element.clientHeight - otherHeight + "px"; - - this.element.scrollTop = this.scrollTop; - } - - this.height = this.element.clientHeight; - - this.vDomWindowBuffer = this.table.options.virtualDomBuffer || this.height; - - //check if the table has changed size when dealing with variable height tables - - if (!this.fixedHeight && initialHeight != this.element.clientHeight) { - - modExists = this.table.modExists("resizeTable"); - - if (modExists && !this.table.modules.resizeTable.autoResize || !modExists) { - - this.redraw(); - } - } - } - }; - - //renitialize all rows - - RowManager.prototype.reinitialize = function () { - - this.rows.forEach(function (row) { - - row.reinitialize(); - }); - }; - - //prevent table from being redrawn - - RowManager.prototype.blockRedraw = function () { - - this.redrawBlock = true; - - this.redrawBlockRestoreConfig = false; - }; - - //restore table redrawing - - RowManager.prototype.restoreRedraw = function () { - - this.redrawBlock = false; - - if (this.redrawBlockRestoreConfig) { - - this.refreshActiveData(this.redrawBlockRestoreConfig.stage, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition); - - this.redrawBlockRestoreConfig = false; - } else { - - if (this.redrawBlockRederInPosition) { - - this.reRenderInPosition(); - } - } - - this.redrawBlockRederInPosition = false; - }; - - //redraw table - - RowManager.prototype.redraw = function (force) { - - var pos = 0, - left = this.scrollLeft; - - this.adjustTableSize(); - - this.table.tableWidth = this.table.element.clientWidth; - - if (!force) { - - if (this.renderMode == "classic") { - - if (this.table.options.groupBy) { - - this.refreshActiveData("group", false, false); - } else { - - this._simpleRender(); - } - } else { - - this.reRenderInPosition(); - - this.scrollHorizontal(left); - } - - if (!this.displayRowsCount) { - - if (this.table.options.placeholder) { - - this.getElement().appendChild(this.table.options.placeholder); - } - } - } else { - - this.renderTable(); - } - }; - - RowManager.prototype.resetScroll = function () { - - this.element.scrollLeft = 0; - - this.element.scrollTop = 0; - - if (this.table.browser === "ie") { - - var event = document.createEvent("Event"); - - event.initEvent("scroll", false, true); - - this.element.dispatchEvent(event); - } else { - - this.element.dispatchEvent(new Event('scroll')); - } - }; - - //public row object - - var RowComponent = function RowComponent(row) { - - this._row = row; - }; - - RowComponent.prototype.getData = function (transform) { - - return this._row.getData(transform); - }; - - RowComponent.prototype.getElement = function () { - - return this._row.getElement(); - }; - - RowComponent.prototype.getCells = function () { - - var cells = []; - - this._row.getCells().forEach(function (cell) { - - cells.push(cell.getComponent()); - }); - - return cells; - }; - - RowComponent.prototype.getCell = function (column) { - - var cell = this._row.getCell(column); - - return cell ? cell.getComponent() : false; - }; - - RowComponent.prototype.getIndex = function () { - - return this._row.getData("data")[this._row.table.options.index]; - }; - - RowComponent.prototype.getPosition = function (active) { - - return this._row.table.rowManager.getRowPosition(this._row, active); - }; - - RowComponent.prototype.delete = function () { - - return this._row.delete(); - }; - - RowComponent.prototype.scrollTo = function () { - - return this._row.table.rowManager.scrollToRow(this._row); - }; - - RowComponent.prototype.pageTo = function () { - - if (this._row.table.modExists("page", true)) { - - return this._row.table.modules.page.setPageToRow(this._row); - } - }; - - RowComponent.prototype.move = function (to, after) { - - this._row.moveToRow(to, after); - }; - - RowComponent.prototype.update = function (data) { - - return this._row.updateData(data); - }; - - RowComponent.prototype.normalizeHeight = function () { - - this._row.normalizeHeight(true); - }; - - RowComponent.prototype.select = function () { - - this._row.table.modules.selectRow.selectRows(this._row); - }; - - RowComponent.prototype.deselect = function () { - - this._row.table.modules.selectRow.deselectRows(this._row); - }; - - RowComponent.prototype.toggleSelect = function () { - - this._row.table.modules.selectRow.toggleRow(this._row); - }; - - RowComponent.prototype.isSelected = function () { - - return this._row.table.modules.selectRow.isRowSelected(this._row); - }; - - RowComponent.prototype._getSelf = function () { - - return this._row; - }; - - RowComponent.prototype.freeze = function () { - - if (this._row.table.modExists("frozenRows", true)) { - - this._row.table.modules.frozenRows.freezeRow(this._row); - } - }; - - RowComponent.prototype.unfreeze = function () { - - if (this._row.table.modExists("frozenRows", true)) { - - this._row.table.modules.frozenRows.unfreezeRow(this._row); - } - }; - - RowComponent.prototype.treeCollapse = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.collapseRow(this._row); - } - }; - - RowComponent.prototype.treeExpand = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.expandRow(this._row); - } - }; - - RowComponent.prototype.treeToggle = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.toggleRow(this._row); - } - }; - - RowComponent.prototype.getTreeParent = function () { - - if (this._row.table.modExists("dataTree", true)) { - - return this._row.table.modules.dataTree.getTreeParent(this._row); - } - - return false; - }; - - RowComponent.prototype.getTreeChildren = function () { - - if (this._row.table.modExists("dataTree", true)) { - - return this._row.table.modules.dataTree.getTreeChildren(this._row); - } - - return false; - }; - - RowComponent.prototype.reformat = function () { - - return this._row.reinitialize(); - }; - - RowComponent.prototype.getGroup = function () { - - return this._row.getGroup().getComponent(); - }; - - RowComponent.prototype.getTable = function () { - - return this._row.table; - }; - - RowComponent.prototype.getNextRow = function () { - - var row = this._row.nextRow(); - - return row ? row.getComponent() : row; - }; - - RowComponent.prototype.getPrevRow = function () { - - var row = this._row.prevRow(); - - return row ? row.getComponent() : row; - }; - - var Row = function Row(data, parent) { - var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "row"; - - - this.table = parent.table; - - this.parent = parent; - - this.data = {}; - - this.type = type; //type of element - - this.element = this.createElement(); - - this.modules = {}; //hold module variables; - - this.cells = []; - - this.height = 0; //hold element height - - this.heightStyled = ""; //hold element height prestyled to improve render efficiency - - this.manualHeight = false; //user has manually set row height - - this.outerHeight = 0; //holde lements outer height - - this.initialized = false; //element has been rendered - - this.heightInitialized = false; //element has resized cells to fit - - - this.setData(data); - - this.generateElement(); - }; - - Row.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - - el.setAttribute("role", "row"); - - return el; - }; - - Row.prototype.getElement = function () { - - return this.element; - }; - - Row.prototype.detachElement = function () { - - if (this.element && this.element.parentNode) { - - this.element.parentNode.removeChild(this.element); - } - }; - - Row.prototype.generateElement = function () { - - var self = this, - dblTap, - tapHold, - tap; - - //set row selection characteristics - - if (self.table.options.selectable !== false && self.table.modExists("selectRow")) { - - self.table.modules.selectRow.initializeRow(this); - } - - //setup movable rows - - if (self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - - self.table.modules.moveRow.initializeRow(this); - } - - //setup data tree - - if (self.table.options.dataTree !== false && self.table.modExists("dataTree")) { - - self.table.modules.dataTree.initializeRow(this); - } - - //setup column colapse container - - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - - self.table.modules.responsiveLayout.initializeRow(this); - } - - //set column menu - - if (self.table.options.rowContextMenu && this.table.modExists("menu")) { - - self.table.modules.menu.initializeRow(this); - } - - //handle row click events - - if (self.table.options.rowClick) { - - self.element.addEventListener("click", function (e) { - - self.table.options.rowClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowDblClick) { - - self.element.addEventListener("dblclick", function (e) { - - self.table.options.rowDblClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowContext) { - - self.element.addEventListener("contextmenu", function (e) { - - self.table.options.rowContext(e, self.getComponent()); - }); - } - - //handle mouse events - - if (self.table.options.rowMouseEnter) { - - self.element.addEventListener("mouseenter", function (e) { - - self.table.options.rowMouseEnter(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseLeave) { - - self.element.addEventListener("mouseleave", function (e) { - - self.table.options.rowMouseLeave(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOver) { - - self.element.addEventListener("mouseover", function (e) { - - self.table.options.rowMouseOver(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOut) { - - self.element.addEventListener("mouseout", function (e) { - - self.table.options.rowMouseOut(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseMove) { - - self.element.addEventListener("mousemove", function (e) { - - self.table.options.rowMouseMove(e, self.getComponent()); - }); - } - - if (self.table.options.rowTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - if (tap) { - - self.table.options.rowTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.table.options.rowDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - self.table.options.rowDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (self.table.options.rowTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - self.table.options.rowTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - }; - - Row.prototype.generateCells = function () { - - this.cells = this.table.columnManager.generateCells(this); - }; - - //functions to setup on first render - - Row.prototype.initialize = function (force) { - - var self = this; - - if (!self.initialized || force) { - - self.deleteCells(); - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - } //handle frozen cells - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layoutRow(this); - } - - this.generateCells(); - - self.cells.forEach(function (cell) { - - self.element.appendChild(cell.getElement()); - - cell.cellRendered(); - }); - - if (force) { - - self.normalizeHeight(); - } - - //setup movable rows - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - - self.table.modules.dataTree.layoutRow(this); - } - - //setup column colapse container - - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - - self.table.modules.responsiveLayout.layoutRow(this); - } - - if (self.table.options.rowFormatter) { - - self.table.options.rowFormatter(self.getComponent()); - } - - //set resizable handles - - if (self.table.options.resizableRows && self.table.modExists("resizeRows")) { - - self.table.modules.resizeRows.initializeRow(self); - } - - self.initialized = true; - } - }; - - Row.prototype.reinitializeHeight = function () { - - this.heightInitialized = false; - - if (this.element.offsetParent !== null) { - - this.normalizeHeight(true); - } - }; - - Row.prototype.reinitialize = function () { - - this.initialized = false; - - this.heightInitialized = false; - - if (!this.manualHeight) { - - this.height = 0; - - this.heightStyled = ""; - } - - if (this.element.offsetParent !== null) { - - this.initialize(true); - } - }; - - //get heights when doing bulk row style calcs in virtual DOM - - Row.prototype.calcHeight = function (force) { - - var maxHeight = 0, - minHeight = this.table.options.resizableRows ? this.element.clientHeight : 0; - - this.cells.forEach(function (cell) { - - var height = cell.getHeight(); - - if (height > maxHeight) { - - maxHeight = height; - } - }); - - if (force) { - - this.height = Math.max(maxHeight, minHeight); - } else { - - this.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight); - } - - this.heightStyled = this.height ? this.height + "px" : ""; - - this.outerHeight = this.element.offsetHeight; - }; - - //set of cells - - Row.prototype.setCellHeight = function () { - - this.cells.forEach(function (cell) { - - cell.setHeight(); - }); - - this.heightInitialized = true; - }; - - Row.prototype.clearCellHeight = function () { - - this.cells.forEach(function (cell) { - - cell.clearHeight(); - }); - }; - - //normalize the height of elements in the row - - Row.prototype.normalizeHeight = function (force) { - - if (force) { - - this.clearCellHeight(); - } - - this.calcHeight(force); - - this.setCellHeight(); - }; - - // Row.prototype.setHeight = function(height){ - - // this.height = height; - - - // this.setCellHeight(); - - // }; - - - //set height of rows - - Row.prototype.setHeight = function (height, force) { - - if (this.height != height || force) { - - this.manualHeight = true; - - this.height = height; - - this.heightStyled = height ? height + "px" : ""; - - this.setCellHeight(); - - // this.outerHeight = this.element.outerHeight(); - - this.outerHeight = this.element.offsetHeight; - } - }; - - //return rows outer height - - Row.prototype.getHeight = function () { - - return this.outerHeight; - }; - - //return rows outer Width - - Row.prototype.getWidth = function () { - - return this.element.offsetWidth; - }; - - //////////////// Cell Management ///////////////// - - - Row.prototype.deleteCell = function (cell) { - - var index = this.cells.indexOf(cell); - - if (index > -1) { - - this.cells.splice(index, 1); - } - }; - - //////////////// Data Management ///////////////// - - - Row.prototype.setData = function (data) { - - if (this.table.modExists("mutator")) { - - data = this.table.modules.mutator.transformRow(data, "data"); - } - - this.data = data; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - - this.table.modules.reactiveData.watchRow(this); - } - }; - - //update the rows data - - Row.prototype.updateData = function (updatedData) { - var _this15 = this; - - var visible = Tabulator.prototype.helpers.elVisible(this.element), - tempData = {}, - newRowData; - - return new Promise(function (resolve, reject) { - - if (typeof updatedData === "string") { - - updatedData = JSON.parse(updatedData); - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - - _this15.table.modules.reactiveData.block(); - } - - //mutate incomming data if needed - - if (_this15.table.modExists("mutator")) { - - tempData = Object.assign(tempData, _this15.data); - - tempData = Object.assign(tempData, updatedData); - - newRowData = _this15.table.modules.mutator.transformRow(tempData, "data", updatedData); - } else { - - newRowData = updatedData; - } - - //set data - - for (var attrname in newRowData) { - - _this15.data[attrname] = newRowData[attrname]; - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - - _this15.table.modules.reactiveData.unblock(); - } - - //update affected cells only - - for (var attrname in updatedData) { - - var columns = _this15.table.columnManager.getColumnsByFieldRoot(attrname); - - columns.forEach(function (column) { - - var cell = _this15.getCell(column.getField()); - - if (cell) { - - var value = column.getFieldValue(newRowData); - - if (cell.getValue() != value) { - - cell.setValueProcessData(value); - - if (visible) { - - cell.cellRendered(); - } - } - } - }); - } - - //Partial reinitialization if visible - - if (visible) { - - _this15.normalizeHeight(true); - - if (_this15.table.options.rowFormatter) { - - _this15.table.options.rowFormatter(_this15.getComponent()); - } - } else { - - _this15.initialized = false; - - _this15.height = 0; - - _this15.heightStyled = ""; - } - - if (_this15.table.options.dataTree !== false && _this15.table.modExists("dataTree") && _this15.table.modules.dataTree.redrawNeeded(updatedData)) { - - _this15.table.modules.dataTree.initializeRow(_this15); - - _this15.table.modules.dataTree.layoutRow(_this15); - - _this15.table.rowManager.refreshActiveData("tree", false, true); - } - - //this.reinitialize(); - - - _this15.table.options.rowUpdated.call(_this15.table, _this15.getComponent()); - - resolve(); - }); - }; - - Row.prototype.getData = function (transform) { - - var self = this; - - if (transform) { - - if (self.table.modExists("accessor")) { - - return self.table.modules.accessor.transformRow(self.data, transform); - } - } else { - - return this.data; - } - }; - - Row.prototype.getCell = function (column) { - - var match = false; - - column = this.table.columnManager.findColumn(column); - - match = this.cells.find(function (cell) { - - return cell.column === column; - }); - - return match; - }; - - Row.prototype.getCellIndex = function (findCell) { - - return this.cells.findIndex(function (cell) { - - return cell === findCell; - }); - }; - - Row.prototype.findNextEditableCell = function (index) { - - var nextCell = false; - - if (index < this.cells.length - 1) { - - for (var i = index + 1; i < this.cells.length; i++) { - - var cell = this.cells[i]; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - - var allowEdit = true; - - if (typeof cell.column.modules.edit.check == "function") { - - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - - nextCell = cell; - - break; - } - } - } - } - - return nextCell; - }; - - Row.prototype.findPrevEditableCell = function (index) { - - var prevCell = false; - - if (index > 0) { - - for (var i = index - 1; i >= 0; i--) { - - var cell = this.cells[i], - allowEdit = true; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - - if (typeof cell.column.modules.edit.check == "function") { - - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - - prevCell = cell; - - break; - } - } - } - } - - return prevCell; - }; - - Row.prototype.getCells = function () { - - return this.cells; - }; - - Row.prototype.nextRow = function () { - - var row = this.table.rowManager.nextDisplayRow(this, true); - - return row || false; - }; - - Row.prototype.prevRow = function () { - - var row = this.table.rowManager.prevDisplayRow(this, true); - - return row || false; - }; - - Row.prototype.moveToRow = function (to, before) { - - var toRow = this.table.rowManager.findRow(to); - - if (toRow) { - - this.table.rowManager.moveRowActual(this, toRow, !before); - - this.table.rowManager.refreshActiveData("display", false, true); - } else { - - console.warn("Move Error - No matching row found:", to); - } - }; - - ///////////////////// Actions ///////////////////// - - - Row.prototype.delete = function () { - var _this16 = this; - - return new Promise(function (resolve, reject) { - - var index, rows; - - if (_this16.table.options.history && _this16.table.modExists("history")) { - - if (_this16.table.options.groupBy && _this16.table.modExists("groupRows")) { - - rows = _this16.getGroup().rows; - - index = rows.indexOf(_this16); - - if (index) { - - index = rows[index - 1]; - } - } else { - - index = _this16.table.rowManager.getRowIndex(_this16); - - if (index) { - - index = _this16.table.rowManager.rows[index - 1]; - } - } - - _this16.table.modules.history.action("rowDelete", _this16, { data: _this16.getData(), pos: !index, index: index }); - } - - _this16.deleteActual(); - - resolve(); - }); - }; - - Row.prototype.deleteActual = function (blockRedraw) { - - var index = this.table.rowManager.getRowIndex(this); - - //deselect row if it is selected - - if (this.table.modExists("selectRow")) { - - this.table.modules.selectRow._deselectRow(this, true); - } - - //cancel edit if row is currently being edited - - if (this.table.modExists("edit")) { - - if (this.table.modules.edit.currentCell.row === this) { - - this.table.modules.edit.cancelEdit(); - } - } - - // if(this.table.options.dataTree && this.table.modExists("dataTree")){ - - // this.table.modules.dataTree.collapseRow(this, true); - - // } - - - //remove any reactive data watchers from row object - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) {} - - // this.table.modules.reactiveData.unwatchRow(this); - - //remove from group - - if (this.modules.group) { - - this.modules.group.removeRow(this); - } - - this.table.rowManager.deleteRow(this, blockRedraw); - - this.deleteCells(); - - this.initialized = false; - - this.heightInitialized = false; - - //recalc column calculations if present - - if (this.table.modExists("columnCalcs")) { - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.columnCalcs.recalcRowGroup(this); - } else { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - }; - - Row.prototype.deleteCells = function () { - - var cellCount = this.cells.length; - - for (var i = 0; i < cellCount; i++) { - - this.cells[0].delete(); - } - }; - - Row.prototype.wipe = function () { - - this.deleteCells(); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element = false; - - this.modules = {}; - - if (this.element.parentNode) { - - this.element.parentNode.removeChild(this.element); - } - }; - - Row.prototype.getGroup = function () { - - return this.modules.group || false; - }; - - //////////////// Object Generation ///////////////// - - Row.prototype.getComponent = function () { - - return new RowComponent(this); - }; - - //public row object - - var CellComponent = function CellComponent(cell) { - - this._cell = cell; - }; - - CellComponent.prototype.getValue = function () { - - return this._cell.getValue(); - }; - - CellComponent.prototype.getOldValue = function () { - - return this._cell.getOldValue(); - }; - - CellComponent.prototype.getElement = function () { - - return this._cell.getElement(); - }; - - CellComponent.prototype.getRow = function () { - - return this._cell.row.getComponent(); - }; - - CellComponent.prototype.getData = function () { - - return this._cell.row.getData(); - }; - - CellComponent.prototype.getField = function () { - - return this._cell.column.getField(); - }; - - CellComponent.prototype.getColumn = function () { - - return this._cell.column.getComponent(); - }; - - CellComponent.prototype.setValue = function (value, mutate) { - - if (typeof mutate == "undefined") { - - mutate = true; - } - - this._cell.setValue(value, mutate); - }; - - CellComponent.prototype.restoreOldValue = function () { - - this._cell.setValueActual(this._cell.getOldValue()); - }; - - CellComponent.prototype.edit = function (force) { - - return this._cell.edit(force); - }; - - CellComponent.prototype.cancelEdit = function () { - - this._cell.cancelEdit(); - }; - - CellComponent.prototype.nav = function () { - - return this._cell.nav(); - }; - - CellComponent.prototype.checkHeight = function () { - - this._cell.checkHeight(); - }; - - CellComponent.prototype.getTable = function () { - - return this._cell.table; - }; - - CellComponent.prototype._getSelf = function () { - - return this._cell; - }; - - var Cell = function Cell(column, row) { - - this.table = column.table; - - this.column = column; - - this.row = row; - - this.element = null; - - this.value = null; - - this.oldValue = null; - - this.modules = {}; - - this.height = null; - - this.width = null; - - this.minWidth = null; - - this.build(); - }; - - //////////////// Setup Functions ///////////////// - - - //generate element - - Cell.prototype.build = function () { - - this.generateElement(); - - this.setWidth(); - - this._configureCell(); - - this.setValueActual(this.column.getFieldValue(this.row.data)); - }; - - Cell.prototype.generateElement = function () { - - this.element = document.createElement('div'); - - this.element.className = "tabulator-cell"; - - this.element.setAttribute("role", "gridcell"); - - this.element = this.element; - }; - - Cell.prototype._configureCell = function () { - - var self = this, - cellEvents = self.column.cellEvents, - element = self.element, - field = this.column.getField(), - vertAligns = { - - top: "flex-start", - - bottom: "flex-end", - - middle: "center" - - }, - hozAligns = { - - left: "flex-start", - - right: "flex-end", - - center: "center" - - }; - - //set text alignment - - element.style.textAlign = self.column.hozAlign; - - if (self.column.vertAlign) { - - element.style.display = "inline-flex"; - - element.style.alignItems = vertAligns[self.column.vertAlign] || ""; - - if (self.column.hozAlign) { - - element.style.justifyContent = hozAligns[self.column.hozAlign] || ""; - } - } - - if (field) { - - element.setAttribute("tabulator-field", field); - } - - //add class to cell if needed - - if (self.column.definition.cssClass) { - - var classNames = self.column.definition.cssClass.split(" "); - - classNames.forEach(function (className) { - - element.classList.add(className); - }); - } - - //update tooltip on mouse enter - - if (this.table.options.tooltipGenerationMode === "hover") { - - element.addEventListener("mouseenter", function (e) { - - self._generateTooltip(); - }); - } - - self._bindClickEvents(cellEvents); - - self._bindTouchEvents(cellEvents); - - self._bindMouseEvents(cellEvents); - - if (self.column.modules.edit) { - - self.table.modules.edit.bindEditor(self); - } - - if (self.column.definition.rowHandle && self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - - self.table.modules.moveRow.initializeCell(self); - } - - //hide cell if not visible - - if (!self.column.visible) { - - self.hide(); - } - }; - - Cell.prototype._bindClickEvents = function (cellEvents) { - - var self = this, - element = self.element; - - //set event bindings - - if (cellEvents.cellClick || self.table.options.cellClick) { - - element.addEventListener("click", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellClick) { - - cellEvents.cellClick.call(self.table, e, component); - } - - if (self.table.options.cellClick) { - - self.table.options.cellClick.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellDblClick || this.table.options.cellDblClick) { - - element.addEventListener("dblclick", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellDblClick) { - - cellEvents.cellDblClick.call(self.table, e, component); - } - - if (self.table.options.cellDblClick) { - - self.table.options.cellDblClick.call(self.table, e, component); - } - }); - } else { - - element.addEventListener("dblclick", function (e) { - - if (self.table.modExists("edit")) { - - if (self.table.modules.edit.currentCell === self) { - - return; //prevent instant selection of editor content - } - } - - e.preventDefault(); - - try { - - if (document.selection) { - // IE - - var range = document.body.createTextRange(); - - range.moveToElementText(self.element); - - range.select(); - } else if (window.getSelection) { - - var range = document.createRange(); - - range.selectNode(self.element); - - window.getSelection().removeAllRanges(); - - window.getSelection().addRange(range); - } - } catch (e) {} - }); - } - - if (cellEvents.cellContext || this.table.options.cellContext) { - - element.addEventListener("contextmenu", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellContext) { - - cellEvents.cellContext.call(self.table, e, component); - } - - if (self.table.options.cellContext) { - - self.table.options.cellContext.call(self.table, e, component); - } - }); - } - }; - - Cell.prototype._bindMouseEvents = function (cellEvents) { - - var self = this, - element = self.element; - - if (cellEvents.cellMouseEnter || self.table.options.cellMouseEnter) { - - element.addEventListener("mouseenter", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseEnter) { - - cellEvents.cellMouseEnter.call(self.table, e, component); - } - - if (self.table.options.cellMouseEnter) { - - self.table.options.cellMouseEnter.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseLeave || self.table.options.cellMouseLeave) { - - element.addEventListener("mouseleave", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseLeave) { - - cellEvents.cellMouseLeave.call(self.table, e, component); - } - - if (self.table.options.cellMouseLeave) { - - self.table.options.cellMouseLeave.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOver || self.table.options.cellMouseOver) { - - element.addEventListener("mouseover", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseOver) { - - cellEvents.cellMouseOver.call(self.table, e, component); - } - - if (self.table.options.cellMouseOver) { - - self.table.options.cellMouseOver.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOut || self.table.options.cellMouseOut) { - - element.addEventListener("mouseout", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseOut) { - - cellEvents.cellMouseOut.call(self.table, e, component); - } - - if (self.table.options.cellMouseOut) { - - self.table.options.cellMouseOut.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseMove || self.table.options.cellMouseMove) { - - element.addEventListener("mousemove", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseMove) { - - cellEvents.cellMouseMove.call(self.table, e, component); - } - - if (self.table.options.cellMouseMove) { - - self.table.options.cellMouseMove.call(self.table, e, component); - } - }); - } - }; - - Cell.prototype._bindTouchEvents = function (cellEvents) { - - var self = this, - element = self.element, - dblTap, - tapHold, - tap; - - if (cellEvents.cellTap || this.table.options.cellTap) { - - tap = false; - - element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - - if (tap) { - - var component = self.getComponent(); - - if (cellEvents.cellTap) { - - cellEvents.cellTap.call(self.table, e, component); - } - - if (self.table.options.cellTap) { - - self.table.options.cellTap.call(self.table, e, component); - } - } - - tap = false; - }); - } - - if (cellEvents.cellDblTap || this.table.options.cellDblTap) { - - dblTap = null; - - element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - var component = self.getComponent(); - - if (cellEvents.cellDblTap) { - - cellEvents.cellDblTap.call(self.table, e, component); - } - - if (self.table.options.cellDblTap) { - - self.table.options.cellDblTap.call(self.table, e, component); - } - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (cellEvents.cellTapHold || this.table.options.cellTapHold) { - - tapHold = null; - - element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - var component = self.getComponent(); - - if (cellEvents.cellTapHold) { - - cellEvents.cellTapHold.call(self.table, e, component); - } - - if (self.table.options.cellTapHold) { - - self.table.options.cellTapHold.call(self.table, e, component); - } - }, 1000); - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - }; - - //generate cell contents - - Cell.prototype._generateContents = function () { - - var val; - - if (this.table.modExists("format")) { - - val = this.table.modules.format.formatValue(this); - } else { - - val = this.element.innerHTML = this.value; - } - - switch (typeof val === 'undefined' ? 'undefined' : _typeof(val)) { - - case "object": - - if (val instanceof Node) { - - //clear previous cell contents - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element.appendChild(val); - } else { - - this.element.innerHTML = ""; - - if (val != null) { - - console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", val); - } - } - - break; - - case "undefined": - - case "null": - - this.element.innerHTML = ""; - - break; - - default: - - this.element.innerHTML = val; - - } - }; - - Cell.prototype.cellRendered = function () { - - if (this.table.modExists("format") && this.table.modules.format.cellRendered) { - - this.table.modules.format.cellRendered(this); - } - }; - - //generate tooltip text - - Cell.prototype._generateTooltip = function () { - - var tooltip = this.column.tooltip; - - if (tooltip) { - - if (tooltip === true) { - - tooltip = this.value; - } else if (typeof tooltip == "function") { - - tooltip = tooltip(this.getComponent()); - - if (tooltip === false) { - - tooltip = ""; - } - } - - if (typeof tooltip === "undefined") { - - tooltip = ""; - } - - this.element.setAttribute("title", tooltip); - } else { - - this.element.setAttribute("title", ""); - } - }; - - //////////////////// Getters //////////////////// - - Cell.prototype.getElement = function () { - - return this.element; - }; - - Cell.prototype.getValue = function () { - - return this.value; - }; - - Cell.prototype.getOldValue = function () { - - return this.oldValue; - }; - - //////////////////// Actions //////////////////// - - - Cell.prototype.setValue = function (value, mutate) { - - var changed = this.setValueProcessData(value, mutate), - component; - - if (changed) { - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("cellEdit", this, { oldValue: this.oldValue, newValue: this.value }); - } - - component = this.getComponent(); - - if (this.column.cellEvents.cellEdited) { - - this.column.cellEvents.cellEdited.call(this.table, component); - } - - this.cellRendered(); - - this.table.options.cellEdited.call(this.table, component); - - this.table.options.dataEdited.call(this.table, this.table.rowManager.getData()); - } - }; - - Cell.prototype.setValueProcessData = function (value, mutate) { - - var changed = false; - - if (this.value != value) { - - changed = true; - - if (mutate) { - - if (this.column.modules.mutate) { - - value = this.table.modules.mutator.transformCell(this, value); - } - } - } - - this.setValueActual(value); - - if (changed && this.table.modExists("columnCalcs")) { - - if (this.column.definition.topCalc || this.column.definition.bottomCalc) { - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (this.table.options.columnCalcs == "table" || this.table.options.columnCalcs == "both") { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.columnCalcs != "table") { - - this.table.modules.columnCalcs.recalcRowGroup(this.row); - } - } else { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - } - - return changed; - }; - - Cell.prototype.setValueActual = function (value) { - - this.oldValue = this.value; - - this.value = value; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - - this.table.modules.reactiveData.block(); - } - - this.column.setFieldValue(this.row.data, value); - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - - this.table.modules.reactiveData.unblock(); - } - - this._generateContents(); - - this._generateTooltip(); - - //set resizable handles - - if (this.table.options.resizableColumns && this.table.modExists("resizeColumns")) { - - this.table.modules.resizeColumns.initializeColumn("cell", this.column, this.element); - } - - //set column menu - - if (this.column.definition.contextMenu && this.table.modExists("menu")) { - - this.table.modules.menu.initializeCell(this); - } - - //handle frozen cells - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layoutElement(this.element, this.column); - } - }; - - Cell.prototype.setWidth = function () { - - this.width = this.column.width; - - this.element.style.width = this.column.widthStyled; - }; - - Cell.prototype.clearWidth = function () { - - this.width = ""; - - this.element.style.width = ""; - }; - - Cell.prototype.getWidth = function () { - - return this.width || this.element.offsetWidth; - }; - - Cell.prototype.setMinWidth = function () { - - this.minWidth = this.column.minWidth; - - this.element.style.minWidth = this.column.minWidthStyled; - }; - - Cell.prototype.checkHeight = function () { - - // var height = this.element.css("height"); - - this.row.reinitializeHeight(); - }; - - Cell.prototype.clearHeight = function () { - - this.element.style.height = ""; - - this.height = null; - }; - - Cell.prototype.setHeight = function () { - - this.height = this.row.height; - - this.element.style.height = this.row.heightStyled; - }; - - Cell.prototype.getHeight = function () { - - return this.height || this.element.offsetHeight; - }; - - Cell.prototype.show = function () { - - this.element.style.display = ""; - }; - - Cell.prototype.hide = function () { - - this.element.style.display = "none"; - }; - - Cell.prototype.edit = function (force) { - - if (this.table.modExists("edit", true)) { - - return this.table.modules.edit.editCell(this, force); - } - }; - - Cell.prototype.cancelEdit = function () { - - if (this.table.modExists("edit", true)) { - - var editing = this.table.modules.edit.getCurrentCell(); - - if (editing && editing._getSelf() === this) { - - this.table.modules.edit.cancelEdit(); - } else { - - console.warn("Cancel Editor Error - This cell is not currently being edited "); - } - } - }; - - Cell.prototype.delete = function () { - - if (!this.table.rowManager.redrawBlock) { - - this.element.parentNode.removeChild(this.element); - } - - this.element = false; - - this.column.deleteCell(this); - - this.row.deleteCell(this); - - this.calcs = {}; - }; - - //////////////// Navigation ///////////////// - - - Cell.prototype.nav = function () { - - var self = this, - nextCell = false, - index = this.row.getCellIndex(this); - - return { - - next: function next() { - - var nextCell = this.right(), - nextRow; - - if (!nextCell) { - - nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - - nextCell = nextRow.findNextEditableCell(-1); - - if (nextCell) { - - nextCell.edit(); - - return true; - } - } - } else { - - return true; - } - - return false; - }, - - prev: function prev() { - - var nextCell = this.left(), - prevRow; - - if (!nextCell) { - - prevRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (prevRow) { - - nextCell = prevRow.findPrevEditableCell(prevRow.cells.length); - - if (nextCell) { - - nextCell.edit(); - - return true; - } - } - } else { - - return true; - } - - return false; - }, - - left: function left() { - - nextCell = self.row.findPrevEditableCell(index); - - if (nextCell) { - - nextCell.edit(); - - return true; - } else { - - return false; - } - }, - - right: function right() { - - nextCell = self.row.findNextEditableCell(index); - - if (nextCell) { - - nextCell.edit(); - - return true; - } else { - - return false; - } - }, - - up: function up() { - - var nextRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (nextRow) { - - nextRow.cells[index].edit(); - } - }, - - down: function down() { - - var nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - - nextRow.cells[index].edit(); - } - } - - }; - }; - - Cell.prototype.getIndex = function () { - - this.row.getCellIndex(this); - }; - - //////////////// Object Generation ///////////////// - - Cell.prototype.getComponent = function () { - - return new CellComponent(this); - }; - - var FooterManager = function FooterManager(table) { - - this.table = table; - - this.active = false; - - this.element = this.createElement(); //containing element - - this.external = false; - - this.links = []; - - this._initialize(); - }; - - FooterManager.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-footer"); - - return el; - }; - - FooterManager.prototype._initialize = function (element) { - - if (this.table.options.footerElement) { - - switch (_typeof(this.table.options.footerElement)) { - - case "string": - - if (this.table.options.footerElement[0] === "<") { - - this.element.innerHTML = this.table.options.footerElement; - } else { - - this.external = true; - - this.element = document.querySelector(this.table.options.footerElement); - } - - break; - - default: - - this.element = this.table.options.footerElement; - - break; - - } - } - }; - - FooterManager.prototype.getElement = function () { - - return this.element; - }; - - FooterManager.prototype.append = function (element, parent) { - - this.activate(parent); - - this.element.appendChild(element); - - this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.prepend = function (element, parent) { - - this.activate(parent); - - this.element.insertBefore(element, this.element.firstChild); - - this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.remove = function (element) { - - element.parentNode.removeChild(element); - - this.deactivate(); - }; - - FooterManager.prototype.deactivate = function (force) { - - if (!this.element.firstChild || force) { - - if (!this.external) { - - this.element.parentNode.removeChild(this.element); - } - - this.active = false; - } - - // this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.activate = function (parent) { - - if (!this.active) { - - this.active = true; - - if (!this.external) { - - this.table.element.appendChild(this.getElement()); - - this.table.element.style.display = ''; - } - } - - if (parent) { - - this.links.push(parent); - } - }; - - FooterManager.prototype.redraw = function () { - - this.links.forEach(function (link) { - - link.footerRedraw(); - }); - }; - - var Tabulator = function Tabulator(element, options) { - - this.options = {}; - - this.columnManager = null; // hold Column Manager - - this.rowManager = null; //hold Row Manager - - this.footerManager = null; //holder Footer Manager - - this.browser = ""; //hold current browser type - - this.browserSlow = false; //handle reduced functionality for slower browsers - - this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence - - - this.modules = {}; //hold all modules bound to this table - - - this.initializeElement(element); - - this.initializeOptions(options || {}); - - this._create(); - - Tabulator.prototype.comms.register(this); //register table for inderdevice communication - }; - - //default setup options - - Tabulator.prototype.defaultOptions = { - - height: false, //height of tabulator - - minHeight: false, //minimum height of tabulator - - maxHeight: false, //maximum height of tabulator - - - layout: "fitData", ///layout type "fitColumns" | "fitData" - - layoutColumnsOnNewData: false, //update column widths on setData - - - columnMinWidth: 40, //minimum global width for a column - - columnHeaderVertAlign: "top", //vertical alignment of column headers - - columnVertAlign: false, // DEPRECATED - Left to allow warning - - - resizableColumns: true, //resizable columns - - resizableRows: false, //resizable rows - - autoResize: true, //auto resize table - - - columns: [], //store for colum header info - - - cellHozAlign: "", //horizontal align columns - - cellVertAlign: "", //certical align columns - - - data: [], //default starting data - - - autoColumns: false, //build columns from data row structure - - - reactiveData: false, //enable data reactivity - - - nestedFieldSeparator: ".", //seperatpr for nested data - - - tooltips: false, //Tool tip value - - tooltipsHeader: false, //Tool tip for headers - - tooltipGenerationMode: "load", //when to generate tooltips - - - initialSort: false, //initial sorting criteria - - initialFilter: false, //initial filtering criteria - - initialHeaderFilter: false, //initial header filtering criteria - - - columnHeaderSortMulti: true, //multiple or single column sorting - - - sortOrderReverse: false, //reverse internal sort ordering - - - headerSort: true, //set default global header sort - - headerSortTristate: false, //set default tristate header sorting - - - footerElement: false, //hold footer element - - - index: "id", //filed for row index - - - keybindings: [], //array for keybindings - - - tabEndNewRow: false, //create new row when tab to end of table - - - invalidOptionWarnings: true, //allow toggling of invalid option warnings - - - clipboard: false, //enable clipboard - - clipboardCopyStyled: true, //formatted table data - - clipboardCopyConfig: false, //clipboard config - - clipboardCopyFormatter: false, //DEPRICATED - REMOVE in 5.0 - - clipboardCopyRowRange: "active", //restrict clipboard to visible rows only - - clipboardPasteParser: "table", //convert pasted clipboard data to rows - - clipboardPasteAction: "insert", //how to insert pasted data into the table - - - clipboardCopied: function clipboardCopied() {}, //data has been copied to the clipboard - - clipboardPasted: function clipboardPasted() {}, //data has been pasted into the table - - clipboardPasteError: function clipboardPasteError() {}, //data has not successfully been pasted into the table - - - downloadDataFormatter: false, //function to manipulate table data before it is downloaded - - downloadReady: function downloadReady(data, blob) { - return blob; - }, //function to manipulate download data - - downloadComplete: false, //function to manipulate download data - - downloadConfig: false, //download config - - - dataTree: false, //enable data tree - - dataTreeElementColumn: false, - - dataTreeBranchElement: true, //show data tree branch element - - dataTreeChildIndent: 9, //data tree child indent in px - - dataTreeChildField: "_children", //data tre column field to look for child rows - - dataTreeCollapseElement: false, //data tree row collapse element - - dataTreeExpandElement: false, //data tree row expand element - - dataTreeStartExpanded: false, - - dataTreeRowExpanded: function dataTreeRowExpanded() {}, //row has been expanded - - dataTreeRowCollapsed: function dataTreeRowCollapsed() {}, //row has been collapsed - - dataTreeChildColumnCalcs: false, //include visible data tree rows in column calculations - - dataTreeSelectPropagate: false, //seleccting a parent row selects its children - - - printAsHtml: false, //enable print as html - - printFormatter: false, //printing page formatter - - printHeader: false, //page header contents - - printFooter: false, //page footer contents - - printCopyStyle: true, //DEPRICATED - REMOVE in 5.0 - - printStyled: true, //enable print as html styling - - printVisibleRows: true, //DEPRICATED - REMOVE in 5.0 - - printRowRange: "visible", //restrict print to visible rows only - - printConfig: {}, //print config options - - - addRowPos: "bottom", //position to insert blank rows, top|bottom - - - selectable: "highlight", //highlight rows on hover - - selectableRangeMode: "drag", //highlight rows on hover - - selectableRollingSelection: true, //roll selection once maximum number of selectable rows is reached - - selectablePersistence: true, // maintain selection when table view is updated - - selectableCheck: function selectableCheck(data, row) { - return true; - }, //check wheather row is selectable - - - headerFilterLiveFilterDelay: 300, //delay before updating column after user types in header filter - - headerFilterPlaceholder: false, //placeholder text to display in header filters - - - headerVisible: true, //hide header - - - history: false, //enable edit history - - - locale: false, //current system language - - langs: {}, - - virtualDom: true, //enable DOM virtualization - - virtualDomBuffer: 0, // set virtual DOM buffer size - - - persistentLayout: false, //DEPRICATED - REMOVE in 5.0 - - persistentSort: false, //DEPRICATED - REMOVE in 5.0 - - persistentFilter: false, //DEPRICATED - REMOVE in 5.0 - - persistenceID: "", //key for persistent storage - - persistenceMode: true, //mode for storing persistence information - - persistenceReaderFunc: false, //function for handling persistence data reading - - persistenceWriterFunc: false, //function for handling persistence data writing - - - persistence: false, - - responsiveLayout: false, //responsive layout flags - - responsiveLayoutCollapseStartOpen: true, //start showing collapsed data - - responsiveLayoutCollapseUseFormatters: true, //responsive layout collapse formatter - - responsiveLayoutCollapseFormatter: false, //responsive layout collapse formatter - - - pagination: false, //set pagination type - - paginationSize: false, //set number of rows to a page - - paginationInitialPage: 1, //initail page to show on load - - paginationButtonCount: 5, // set count of page button - - paginationSizeSelector: false, //add pagination size selector element - - paginationElement: false, //element to hold pagination numbers - - paginationDataSent: {}, //pagination data sent to the server - - paginationDataReceived: {}, //pagination data received from the server - - paginationAddRow: "page", //add rows on table or page - - - ajaxURL: false, //url for ajax loading - - ajaxURLGenerator: false, - - ajaxParams: {}, //params for ajax loading - - ajaxConfig: "get", //ajax request type - - ajaxContentType: "form", //ajax request type - - ajaxRequestFunc: false, //promise function - - ajaxLoader: true, //show loader - - ajaxLoaderLoading: false, //loader element - - ajaxLoaderError: false, //loader element - - ajaxFiltering: false, - - ajaxSorting: false, - - ajaxProgressiveLoad: false, //progressive loading - - ajaxProgressiveLoadDelay: 0, //delay between requests - - ajaxProgressiveLoadScrollMargin: 0, //margin before scroll begins - - - groupBy: false, //enable table grouping and set field to group by - - groupStartOpen: true, //starting state of group - - groupValues: false, - - groupHeader: false, //header generation function - - - htmlOutputConfig: false, //html outypu config - - - movableColumns: false, //enable movable columns - - - movableRows: false, //enable movable rows - - movableRowsConnectedTables: false, //tables for movable rows to be connected to - - movableRowsSender: false, - - movableRowsReceiver: "insert", - - movableRowsSendingStart: function movableRowsSendingStart() {}, - - movableRowsSent: function movableRowsSent() {}, - - movableRowsSentFailed: function movableRowsSentFailed() {}, - - movableRowsSendingStop: function movableRowsSendingStop() {}, - - movableRowsReceivingStart: function movableRowsReceivingStart() {}, - - movableRowsReceived: function movableRowsReceived() {}, - - movableRowsReceivedFailed: function movableRowsReceivedFailed() {}, - - movableRowsReceivingStop: function movableRowsReceivingStop() {}, - - scrollToRowPosition: "top", - - scrollToRowIfVisible: true, - - scrollToColumnPosition: "left", - - scrollToColumnIfVisible: true, - - rowFormatter: false, - - rowFormatterPrint: null, - - rowFormatterClipboard: null, - - rowFormatterHtmlOutput: null, - - placeholder: false, - - //table building callbacks - - tableBuilding: function tableBuilding() {}, - - tableBuilt: function tableBuilt() {}, - - //render callbacks - - renderStarted: function renderStarted() {}, - - renderComplete: function renderComplete() {}, - - //row callbacks - - rowClick: false, - - rowDblClick: false, - - rowContext: false, - - rowTap: false, - - rowDblTap: false, - - rowTapHold: false, - - rowMouseEnter: false, - - rowMouseLeave: false, - - rowMouseOver: false, - - rowMouseOut: false, - - rowMouseMove: false, - - rowContextMenu: false, - - rowAdded: function rowAdded() {}, - - rowDeleted: function rowDeleted() {}, - - rowMoved: function rowMoved() {}, - - rowUpdated: function rowUpdated() {}, - - rowSelectionChanged: function rowSelectionChanged() {}, - - rowSelected: function rowSelected() {}, - - rowDeselected: function rowDeselected() {}, - - rowResized: function rowResized() {}, - - //cell callbacks - - //row callbacks - - cellClick: false, - - cellDblClick: false, - - cellContext: false, - - cellTap: false, - - cellDblTap: false, - - cellTapHold: false, - - cellMouseEnter: false, - - cellMouseLeave: false, - - cellMouseOver: false, - - cellMouseOut: false, - - cellMouseMove: false, - - cellEditing: function cellEditing() {}, - - cellEdited: function cellEdited() {}, - - cellEditCancelled: function cellEditCancelled() {}, - - //column callbacks - - columnMoved: false, - - columnResized: function columnResized() {}, - - columnTitleChanged: function columnTitleChanged() {}, - - columnVisibilityChanged: function columnVisibilityChanged() {}, - - //HTML iport callbacks - - htmlImporting: function htmlImporting() {}, - - htmlImported: function htmlImported() {}, - - //data callbacks - - dataLoading: function dataLoading() {}, - - dataLoaded: function dataLoaded() {}, - - dataEdited: function dataEdited() {}, - - //ajax callbacks - - ajaxRequesting: function ajaxRequesting() {}, - - ajaxResponse: false, - - ajaxError: function ajaxError() {}, - - //filtering callbacks - - dataFiltering: false, - - dataFiltered: false, - - //sorting callbacks - - dataSorting: function dataSorting() {}, - - dataSorted: function dataSorted() {}, - - //grouping callbacks - - groupToggleElement: "arrow", - - groupClosedShowCalcs: false, - - dataGrouping: function dataGrouping() {}, - - dataGrouped: false, - - groupVisibilityChanged: function groupVisibilityChanged() {}, - - groupClick: false, - - groupDblClick: false, - - groupContext: false, - - groupTap: false, - - groupDblTap: false, - - groupTapHold: false, - - columnCalcs: true, - - //pagination callbacks - - pageLoaded: function pageLoaded() {}, - - //localization callbacks - - localized: function localized() {}, - - //validation has failed - - validationFailed: function validationFailed() {}, - - //history callbacks - - historyUndo: function historyUndo() {}, - - historyRedo: function historyRedo() {}, - - //scroll callbacks - - scrollHorizontal: function scrollHorizontal() {}, - - scrollVertical: function scrollVertical() {} - - }; - - Tabulator.prototype.initializeOptions = function (options) { - - //warn user if option is not available - - if (options.invalidOptionWarnings !== false) { - - for (var key in options) { - - if (typeof this.defaultOptions[key] === "undefined") { - - console.warn("Invalid table constructor option:", key); - } - } - } - - //assign options to table - - for (var key in this.defaultOptions) { - - if (key in options) { - - this.options[key] = options[key]; - } else { - - if (Array.isArray(this.defaultOptions[key])) { - - this.options[key] = []; - } else if (_typeof(this.defaultOptions[key]) === "object" && this.defaultOptions[key] !== null) { - - this.options[key] = {}; - } else { - - this.options[key] = this.defaultOptions[key]; - } - } - } - }; - - Tabulator.prototype.initializeElement = function (element) { - - if (typeof HTMLElement !== "undefined" && element instanceof HTMLElement) { - - this.element = element; - - return true; - } else if (typeof element === "string") { - - this.element = document.querySelector(element); - - if (this.element) { - - return true; - } else { - - console.error("Tabulator Creation Error - no element found matching selector: ", element); - - return false; - } - } else { - - console.error("Tabulator Creation Error - Invalid element provided:", element); - - return false; - } - }; - - //convert depricated functionality to new functions - - Tabulator.prototype._mapDepricatedFunctionality = function () { - - //map depricated persistance setup options - - if (this.options.persistentLayout || this.options.persistentSort || this.options.persistentFilter) { - - if (!this.options.persistence) { - - this.options.persistence = {}; - } - } - - if (typeof this.options.clipboardCopyHeader !== "undefined") { - - this.options.columnHeaders = this.options.clipboardCopyHeader; - - console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option"); - } - - if (this.options.printVisibleRows !== true) { - - console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"); - - this.options.persistence.printRowRange = "active"; - } - - if (this.options.printCopyStyle !== true) { - - console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"); - - this.options.persistence.printStyled = this.options.printCopyStyle; - } - - if (this.options.persistentLayout) { - - console.warn("persistentLayout option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.columns === "undefined") { - - this.options.persistence.columns = true; - } - } - - if (this.options.persistentSort) { - - console.warn("persistentSort option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.sort === "undefined") { - - this.options.persistence.sort = true; - } - } - - if (this.options.persistentFilter) { - - console.warn("persistentFilter option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.filter === "undefined") { - - this.options.persistence.filter = true; - } - } - - if (this.options.columnVertAlign) { - - console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"); - - this.options.columnHeaderVertAlign = this.options.columnVertAlign; - } - }; - - Tabulator.prototype._clearSelection = function () { - - this.element.classList.add("tabulator-block-select"); - - if (window.getSelection) { - - if (window.getSelection().empty) { - // Chrome - - window.getSelection().empty(); - } else if (window.getSelection().removeAllRanges) { - // Firefox - - window.getSelection().removeAllRanges(); - } - } else if (document.selection) { - // IE? - - document.selection.empty(); - } - - this.element.classList.remove("tabulator-block-select"); - }; - - //concreate table - - Tabulator.prototype._create = function () { - - this._clearObjectPointers(); - - this._mapDepricatedFunctionality(); - - this.bindModules(); - - if (this.element.tagName === "TABLE") { - - if (this.modExists("htmlTableImport", true)) { - - this.modules.htmlTableImport.parseTable(); - } - } - - this.columnManager = new ColumnManager(this); - - this.rowManager = new RowManager(this); - - this.footerManager = new FooterManager(this); - - this.columnManager.setRowManager(this.rowManager); - - this.rowManager.setColumnManager(this.columnManager); - - this._buildElement(); - - this._loadInitialData(); - }; - - //clear pointers to objects in default config object - - Tabulator.prototype._clearObjectPointers = function () { - - this.options.columns = this.options.columns.slice(0); - - if (!this.options.reactiveData) { - - this.options.data = this.options.data.slice(0); - } - }; - - //build tabulator element - - Tabulator.prototype._buildElement = function () { - var _this17 = this; - - var element = this.element, - mod = this.modules, - options = this.options; - - options.tableBuilding.call(this); - - element.classList.add("tabulator"); - - element.setAttribute("role", "grid"); - - //empty element - - while (element.firstChild) { - element.removeChild(element.firstChild); - } //set table height - - if (options.height) { - - options.height = isNaN(options.height) ? options.height : options.height + "px"; - - element.style.height = options.height; - } - - //set table min height - - if (options.minHeight !== false) { - - options.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + "px"; - - element.style.minHeight = options.minHeight; - } - - //set table maxHeight - - if (options.maxHeight !== false) { - - options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px"; - - element.style.maxHeight = options.maxHeight; - } - - this.columnManager.initialize(); - - this.rowManager.initialize(); - - this._detectBrowser(); - - if (this.modExists("layout", true)) { - - mod.layout.initialize(options.layout); - } - - //set localization - - if (options.headerFilterPlaceholder !== false) { - - mod.localize.setHeaderFilterPlaceholder(options.headerFilterPlaceholder); - } - - for (var locale in options.langs) { - - mod.localize.installLang(locale, options.langs[locale]); - } - - mod.localize.setLocale(options.locale); - - //configure placeholder element - - if (typeof options.placeholder == "string") { - - var el = document.createElement("div"); - - el.classList.add("tabulator-placeholder"); - - var span = document.createElement("span"); - - span.innerHTML = options.placeholder; - - el.appendChild(span); - - options.placeholder = el; - } - - //build table elements - - element.appendChild(this.columnManager.getElement()); - - element.appendChild(this.rowManager.getElement()); - - if (options.footerElement) { - - this.footerManager.activate(); - } - - if (options.persistence && this.modExists("persistence", true)) { - - mod.persistence.initialize(); - } - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.columns) { - - options.columns = mod.persistence.load("columns", options.columns); - } - - if (options.movableRows && this.modExists("moveRow")) { - - mod.moveRow.initialize(); - } - - if (options.autoColumns && this.options.data) { - - this.columnManager.generateColumnsFromRowData(this.options.data); - } - - if (this.modExists("columnCalcs")) { - - mod.columnCalcs.initialize(); - } - - this.columnManager.setColumns(options.columns); - - if (options.dataTree && this.modExists("dataTree", true)) { - - mod.dataTree.initialize(); - } - - if (this.modExists("frozenRows")) { - - this.modules.frozenRows.initialize(); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort || options.initialSort) && this.modExists("sort", true)) { - - var sorters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort) { - - sorters = mod.persistence.load("sort"); - - if (sorters === false && options.initialSort) { - - sorters = options.initialSort; - } - } else if (options.initialSort) { - - sorters = options.initialSort; - } - - mod.sort.setSort(sorters); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter || options.initialFilter) && this.modExists("filter", true)) { - - var filters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter) { - - filters = mod.persistence.load("filter"); - - if (filters === false && options.initialFilter) { - - filters = options.initialFilter; - } - } else if (options.initialFilter) { - - filters = options.initialFilter; - } - - mod.filter.setFilter(filters); - } - - if (options.initialHeaderFilter && this.modExists("filter", true)) { - - options.initialHeaderFilter.forEach(function (item) { - - var column = _this17.columnManager.findColumn(item.field); - - if (column) { - - mod.filter.setHeaderFilterValue(column, item.value); - } else { - - console.warn("Column Filter Error - No matching column found:", item.field); - - return false; - } - }); - } - - if (this.modExists("ajax")) { - - mod.ajax.initialize(); - } - - if (options.pagination && this.modExists("page", true)) { - - mod.page.initialize(); - } - - if (options.groupBy && this.modExists("groupRows", true)) { - - mod.groupRows.initialize(); - } - - if (this.modExists("keybindings")) { - - mod.keybindings.initialize(); - } - - if (this.modExists("selectRow")) { - - mod.selectRow.clearSelectionData(true); - } - - if (options.autoResize && this.modExists("resizeTable")) { - - mod.resizeTable.initialize(); - } - - if (this.modExists("clipboard")) { - - mod.clipboard.initialize(); - } - - if (options.printAsHtml && this.modExists("print")) { - - mod.print.initialize(); - } - - options.tableBuilt.call(this); - }; - - Tabulator.prototype._loadInitialData = function () { - - var self = this; - - if (self.options.pagination && self.modExists("page")) { - - self.modules.page.reset(true, true); - - if (self.options.pagination == "local") { - - if (self.options.data.length) { - - self.rowManager.setData(self.options.data, false, true); - } else { - - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () { - - if (self.options.paginationInitialPage) { - - self.modules.page.setPage(self.options.paginationInitialPage); - } - }); - - return; - } else { - - self.rowManager.setData(self.options.data, false, true); - } - } - - if (self.options.paginationInitialPage) { - - self.modules.page.setPage(self.options.paginationInitialPage); - } - } else { - - if (self.options.ajaxURL) { - - self.modules.page.setPage(self.options.paginationInitialPage).then(function () {}).catch(function () {}); - } else { - - self.rowManager.setData([], false, true); - } - } - } else { - - if (self.options.data.length) { - - self.rowManager.setData(self.options.data); - } else { - - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () {}); - } else { - - self.rowManager.setData(self.options.data, false, true); - } - } - } - }; - - //deconstructor - - Tabulator.prototype.destroy = function () { - - var element = this.element; - - Tabulator.prototype.comms.deregister(this); //deregister table from inderdevice communication - - - if (this.options.reactiveData && this.modExists("reactiveData", true)) { - - this.modules.reactiveData.unwatchData(); - } - - //clear row data - - this.rowManager.rows.forEach(function (row) { - - row.wipe(); - }); - - this.rowManager.rows = []; - - this.rowManager.activeRows = []; - - this.rowManager.displayRows = []; - - //clear event bindings - - if (this.options.autoResize && this.modExists("resizeTable")) { - - this.modules.resizeTable.clearBindings(); - } - - if (this.modExists("keybindings")) { - - this.modules.keybindings.clearBindings(); - } - - //clear DOM - - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.classList.remove("tabulator"); - }; - - Tabulator.prototype._detectBrowser = function () { - - var ua = navigator.userAgent || navigator.vendor || window.opera; - - if (ua.indexOf("Trident") > -1) { - - this.browser = "ie"; - - this.browserSlow = true; - } else if (ua.indexOf("Edge") > -1) { - - this.browser = "edge"; - - this.browserSlow = true; - } else if (ua.indexOf("Firefox") > -1) { - - this.browser = "firefox"; - - this.browserSlow = false; - } else { - - this.browser = "other"; - - this.browserSlow = false; - } - - this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.substr(0, 4)); - }; - - ////////////////// Data Handling ////////////////// - - - //block table redrawing - - Tabulator.prototype.blockRedraw = function () { - - return this.rowManager.blockRedraw(); - }; - - //restore table redrawing - - Tabulator.prototype.restoreRedraw = function () { - - return this.rowManager.restoreRedraw(); - }; - - //local data from local file - - Tabulator.prototype.setDataFromLocalFile = function (extensions) { - var _this18 = this; - - return new Promise(function (resolve, reject) { - - var input = document.createElement("input"); - - input.type = "file"; - - input.accept = extensions || ".json,application/json"; - - input.addEventListener("change", function (e) { - - var file = input.files[0], - reader = new FileReader(), - data; - - reader.readAsText(file); - - reader.onload = function (e) { - - try { - - data = JSON.parse(reader.result); - } catch (e) { - - console.warn("File Load Error - File contents is invalid JSON", e); - - reject(e); - - return; - } - - _this18._setData(data).then(function (data) { - - resolve(data); - }).catch(function (err) { - - resolve(err); - }); - }; - - reader.onerror = function (e) { - - console.warn("File Load Error - Unable to read file"); - - reject(); - }; - }); - - input.click(); - }); - }; - - //load data - - Tabulator.prototype.setData = function (data, params, config) { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, false, true); - }; - - Tabulator.prototype._setData = function (data, params, config, inPosition, columnsChanged) { - - var self = this; - - if (typeof data === "string") { - - if (data.indexOf("{") == 0 || data.indexOf("[") == 0) { - - //data is a json encoded string - - return self.rowManager.setData(JSON.parse(data), inPosition, columnsChanged); - } else { - - if (self.modExists("ajax", true)) { - - if (params) { - - self.modules.ajax.setParams(params); - } - - if (config) { - - self.modules.ajax.setConfig(config); - } - - self.modules.ajax.setUrl(data); - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - - self.modules.page.reset(true, true); - - return self.modules.page.setPage(1); - } else { - - //assume data is url, make ajax call to url to get data - - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } - } - } else { - - if (data) { - - //asume data is already an object - - return self.rowManager.setData(data, inPosition, columnsChanged); - } else { - - //no data provided, check if ajaxURL is present; - - if (self.modExists("ajax") && (self.modules.ajax.getUrl || self.options.ajaxURLGenerator)) { - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - - self.modules.page.reset(true, true); - - return self.modules.page.setPage(1); - } else { - - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } else { - - //empty data - - return self.rowManager.setData([], inPosition, columnsChanged); - } - } - } - }; - - //clear data - - Tabulator.prototype.clearData = function () { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - this.rowManager.clearData(); - }; - - //get table data array - - Tabulator.prototype.getData = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getData(active); - }; - - //get table data array count - - Tabulator.prototype.getDataCount = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getDataCount(active); - }; - - //search for specific row components - - Tabulator.prototype.searchRows = function (field, type, value) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.search("rows", field, type, value); - } - }; - - //search for specific data - - Tabulator.prototype.searchData = function (field, type, value) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.search("data", field, type, value); - } - }; - - //get table html - - Tabulator.prototype.getHtml = function (visible, style, config) { - - if (this.modExists("export", true)) { - - return this.modules.export.getHtml(visible, style, config); - } - }; - - //get print html - - Tabulator.prototype.print = function (visible, style, config) { - - if (this.modExists("print", true)) { - - return this.modules.print.printFullscreen(visible, style, config); - } - }; - - //retrieve Ajax URL - - Tabulator.prototype.getAjaxUrl = function () { - - if (this.modExists("ajax", true)) { - - return this.modules.ajax.getUrl(); - } - }; - - //replace data, keeping table in position with same sort - - Tabulator.prototype.replaceData = function (data, params, config) { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, true); - }; - - //update table data - - Tabulator.prototype.updateData = function (data) { - var _this19 = this; - - var self = this; - - var responses = 0; - - return new Promise(function (resolve, reject) { - - if (_this19.modExists("ajax")) { - - _this19.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - data.forEach(function (item) { - - var row = self.rowManager.findRow(item[self.options.index]); - - if (row) { - - responses++; - - row.updateData(item).then(function () { - - responses--; - - if (!responses) { - - resolve(); - } - }); - } - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - Tabulator.prototype.addData = function (data, pos, index) { - var _this20 = this; - - return new Promise(function (resolve, reject) { - - if (_this20.modExists("ajax")) { - - _this20.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - _this20.rowManager.addRows(data, pos, index).then(function (rows) { - - var output = []; - - rows.forEach(function (row) { - - output.push(row.getComponent()); - }); - - resolve(output); - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - //update table data - - Tabulator.prototype.updateOrAddData = function (data) { - var _this21 = this; - - var self = this, - rows = [], - responses = 0; - - return new Promise(function (resolve, reject) { - - if (_this21.modExists("ajax")) { - - _this21.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - data.forEach(function (item) { - - var row = self.rowManager.findRow(item[self.options.index]); - - responses++; - - if (row) { - - row.updateData(item).then(function () { - - responses--; - - rows.push(row.getComponent()); - - if (!responses) { - - resolve(rows); - } - }); - } else { - - self.rowManager.addRows(item).then(function (newRows) { - - responses--; - - rows.push(newRows[0].getComponent()); - - if (!responses) { - - resolve(rows); - } - }); - } - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - //get row object - - Tabulator.prototype.getRow = function (index) { - - var row = this.rowManager.findRow(index); - - if (row) { - - return row.getComponent(); - } else { - - console.warn("Find Error - No matching row found:", index); - - return false; - } - }; - - //get row object - - Tabulator.prototype.getRowFromPosition = function (position, active) { - - var row = this.rowManager.getRowFromPosition(position, active); - - if (row) { - - return row.getComponent(); - } else { - - console.warn("Find Error - No matching row found:", position); - - return false; - } - }; - - //delete row from table - - Tabulator.prototype.deleteRow = function (index) { - var _this22 = this; - - return new Promise(function (resolve, reject) { - - var self = _this22, - count = 0, - successCount = 0, - foundRows = []; - - function doneCheck() { - - count++; - - if (count == index.length) { - - if (successCount) { - - self.rowManager.reRenderInPosition(); - - resolve(); - } - } - } - - if (!Array.isArray(index)) { - - index = [index]; - } - - //find matching rows - - index.forEach(function (item) { - - var row = _this22.rowManager.findRow(item, true); - - if (row) { - - foundRows.push(row); - } else { - - console.warn("Delete Error - No matching row found:", item); - - reject("Delete Error - No matching row found"); - - doneCheck(); - } - }); - - //sort rows into correct order to ensure smooth delete from table - - foundRows.sort(function (a, b) { - - return _this22.rowManager.rows.indexOf(a) > _this22.rowManager.rows.indexOf(b) ? 1 : -1; - }); - - foundRows.forEach(function (row) { - - row.delete().then(function () { - - successCount++; - - doneCheck(); - }).catch(function (err) { - - doneCheck(); - - reject(err); - }); - }); - }); - }; - - //add row to table - - Tabulator.prototype.addRow = function (data, pos, index) { - var _this23 = this; - - return new Promise(function (resolve, reject) { - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - _this23.rowManager.addRows(data, pos, index).then(function (rows) { - - //recalc column calculations if present - - if (_this23.modExists("columnCalcs")) { - - _this23.modules.columnCalcs.recalc(_this23.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }); - }); - }; - - //update a row if it exitsts otherwise create it - - Tabulator.prototype.updateOrAddRow = function (index, data) { - var _this24 = this; - - return new Promise(function (resolve, reject) { - - var row = _this24.rowManager.findRow(index); - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (row) { - - row.updateData(data).then(function () { - - //recalc column calculations if present - - if (_this24.modExists("columnCalcs")) { - - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(row.getComponent()); - }).catch(function (err) { - - reject(err); - }); - } else { - - row = _this24.rowManager.addRows(data).then(function (rows) { - - //recalc column calculations if present - - if (_this24.modExists("columnCalcs")) { - - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }).catch(function (err) { - - reject(err); - }); - } - }); - }; - - //update row data - - Tabulator.prototype.updateRow = function (index, data) { - var _this25 = this; - - return new Promise(function (resolve, reject) { - - var row = _this25.rowManager.findRow(index); - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (row) { - - row.updateData(data).then(function () { - - resolve(row.getComponent()); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Update Error - No matching row found:", index); - - reject("Update Error - No matching row found"); - } - }); - }; - - //scroll to row in DOM - - Tabulator.prototype.scrollToRow = function (index, position, ifVisible) { - var _this26 = this; - - return new Promise(function (resolve, reject) { - - var row = _this26.rowManager.findRow(index); - - if (row) { - - _this26.rowManager.scrollToRow(row, position, ifVisible).then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Scroll Error - No matching row found:", index); - - reject("Scroll Error - No matching row found"); - } - }); - }; - - Tabulator.prototype.moveRow = function (from, to, after) { - - var fromRow = this.rowManager.findRow(from); - - if (fromRow) { - - fromRow.moveToRow(to, after); - } else { - - console.warn("Move Error - No matching row found:", from); - } - }; - - Tabulator.prototype.getRows = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getComponents(active); - }; - - //get position of row in table - - Tabulator.prototype.getRowPosition = function (index, active) { - - var row = this.rowManager.findRow(index); - - if (row) { - - return this.rowManager.getRowPosition(row, active); - } else { - - console.warn("Position Error - No matching row found:", index); - - return false; - } - }; - - //copy table data to clipboard - - Tabulator.prototype.copyToClipboard = function (selector) { - - if (this.modExists("clipboard", true)) { - - this.modules.clipboard.copy(selector); - } - }; - - /////////////// Column Functions /////////////// - - - Tabulator.prototype.setColumns = function (definition) { - - this.columnManager.setColumns(definition); - }; - - Tabulator.prototype.getColumns = function (structured) { - - return this.columnManager.getComponents(structured); - }; - - Tabulator.prototype.getColumn = function (field) { - - var col = this.columnManager.findColumn(field); - - if (col) { - - return col.getComponent(); - } else { - - console.warn("Find Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.getColumnDefinitions = function () { - - return this.columnManager.getDefinitionTree(); - }; - - Tabulator.prototype.getColumnLayout = function () { - - if (this.modExists("persistence", true)) { - - return this.modules.persistence.parseColumns(this.columnManager.getColumns()); - } - }; - - Tabulator.prototype.setColumnLayout = function (layout) { - - if (this.modExists("persistence", true)) { - - this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns, layout)); - - return true; - } - - return false; - }; - - Tabulator.prototype.showColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - column.show(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - - this.modules.responsiveLayout.update(); - } - } else { - - console.warn("Column Show Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.hideColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - column.hide(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - - this.modules.responsiveLayout.update(); - } - } else { - - console.warn("Column Hide Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.toggleColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - if (column.visible) { - - column.hide(); - } else { - - column.show(); - } - } else { - - console.warn("Column Visibility Toggle Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.addColumn = function (definition, before, field) { - var _this27 = this; - - return new Promise(function (resolve, reject) { - - var column = _this27.columnManager.findColumn(field); - - _this27.columnManager.addColumn(definition, before, column).then(function (column) { - - resolve(column.getComponent()); - }).catch(function (err) { - - reject(err); - }); - }); - }; - - Tabulator.prototype.deleteColumn = function (field) { - var _this28 = this; - - return new Promise(function (resolve, reject) { - - var column = _this28.columnManager.findColumn(field); - - if (column) { - - column.delete().then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Delete Error - No matching column found:", field); - - reject(); - } - }); - }; - - Tabulator.prototype.updateColumnDefinition = function (field, definition) { - var _this29 = this; - - return new Promise(function (resolve, reject) { - - var column = _this29.columnManager.findColumn(field); - - if (column) { - - column.updateDefinition(definition).then(function (col) { - - resolve(col); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Update Error - No matching column found:", field); - - reject(); - } - }); - }; - - Tabulator.prototype.moveColumn = function (from, to, after) { - - var fromColumn = this.columnManager.findColumn(from); - - var toColumn = this.columnManager.findColumn(to); - - if (fromColumn) { - - if (toColumn) { - - this.columnManager.moveColumn(fromColumn, toColumn, after); - } else { - - console.warn("Move Error - No matching column found:", toColumn); - } - } else { - - console.warn("Move Error - No matching column found:", from); - } - }; - - //scroll to column in DOM - - Tabulator.prototype.scrollToColumn = function (field, position, ifVisible) { - var _this30 = this; - - return new Promise(function (resolve, reject) { - - var column = _this30.columnManager.findColumn(field); - - if (column) { - - _this30.columnManager.scrollToColumn(column, position, ifVisible).then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Scroll Error - No matching column found:", field); - - reject("Scroll Error - No matching column found"); - } - }); - }; - - //////////// Localization Functions //////////// - - Tabulator.prototype.setLocale = function (locale) { - - this.modules.localize.setLocale(locale); - }; - - Tabulator.prototype.getLocale = function () { - - return this.modules.localize.getLocale(); - }; - - Tabulator.prototype.getLang = function (locale) { - - return this.modules.localize.getLang(locale); - }; - - //////////// General Public Functions //////////// - - - //redraw list without updating data - - Tabulator.prototype.redraw = function (force) { - - this.columnManager.redraw(force); - - this.rowManager.redraw(force); - }; - - Tabulator.prototype.setHeight = function (height) { - - if (this.rowManager.renderMode !== "classic") { - - this.options.height = isNaN(height) ? height : height + "px"; - - this.element.style.height = this.options.height; - - this.rowManager.setRenderMode(); - - this.rowManager.redraw(); - } else { - - console.warn("setHeight function is not available in classic render mode"); - } - }; - - ///////////////////// Sorting //////////////////// - - - //trigger sort - - Tabulator.prototype.setSort = function (sortList, dir) { - - if (this.modExists("sort", true)) { - - this.modules.sort.setSort(sortList, dir); - - this.rowManager.sorterRefresh(); - } - }; - - Tabulator.prototype.getSorters = function () { - - if (this.modExists("sort", true)) { - - return this.modules.sort.getSort(); - } - }; - - Tabulator.prototype.clearSort = function () { - - if (this.modExists("sort", true)) { - - this.modules.sort.clear(); - - this.rowManager.sorterRefresh(); - } - }; - - ///////////////////// Filtering //////////////////// - - - //set standard filters - - Tabulator.prototype.setFilter = function (field, type, value) { - - if (this.modExists("filter", true)) { - - this.modules.filter.setFilter(field, type, value); - - this.rowManager.filterRefresh(); - } - }; - - //add filter to array - - Tabulator.prototype.addFilter = function (field, type, value) { - - if (this.modExists("filter", true)) { - - this.modules.filter.addFilter(field, type, value); - - this.rowManager.filterRefresh(); - } - }; - - //get all filters - - Tabulator.prototype.getFilters = function (all) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.getFilters(all); - } - }; - - Tabulator.prototype.setHeaderFilterFocus = function (field) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - this.modules.filter.setHeaderFilterFocus(column); - } else { - - console.warn("Column Filter Focus Error - No matching column found:", field); - - return false; - } - } - }; - - Tabulator.prototype.getHeaderFilterValue = function (field) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - return this.modules.filter.getHeaderFilterValue(column); - } else { - - console.warn("Column Filter Error - No matching column found:", field); - } - } - }; - - Tabulator.prototype.setHeaderFilterValue = function (field, value) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - this.modules.filter.setHeaderFilterValue(column, value); - } else { - - console.warn("Column Filter Error - No matching column found:", field); - - return false; - } - } - }; - - Tabulator.prototype.getHeaderFilters = function () { - - if (this.modExists("filter", true)) { - - return this.modules.filter.getHeaderFilters(); - } - }; - - //remove filter from array - - Tabulator.prototype.removeFilter = function (field, type, value) { - - if (this.modExists("filter", true)) { - - this.modules.filter.removeFilter(field, type, value); - - this.rowManager.filterRefresh(); - } - }; - - //clear filters - - Tabulator.prototype.clearFilter = function (all) { - - if (this.modExists("filter", true)) { - - this.modules.filter.clearFilter(all); - - this.rowManager.filterRefresh(); - } - }; - - //clear header filters - - Tabulator.prototype.clearHeaderFilter = function () { - - if (this.modExists("filter", true)) { - - this.modules.filter.clearHeaderFilter(); - - this.rowManager.filterRefresh(); - } - }; - - ///////////////////// Filtering //////////////////// - - Tabulator.prototype.selectRow = function (rows) { - - if (this.modExists("selectRow", true)) { - - if (rows === true) { - - console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"); - - rows = "active"; - } - - this.modules.selectRow.selectRows(rows); - } - }; - - Tabulator.prototype.deselectRow = function (rows) { - - if (this.modExists("selectRow", true)) { - - this.modules.selectRow.deselectRows(rows); - } - }; - - Tabulator.prototype.toggleSelectRow = function (row) { - - if (this.modExists("selectRow", true)) { - - this.modules.selectRow.toggleRow(row); - } - }; - - Tabulator.prototype.getSelectedRows = function () { - - if (this.modExists("selectRow", true)) { - - return this.modules.selectRow.getSelectedRows(); - } - }; - - Tabulator.prototype.getSelectedData = function () { - - if (this.modExists("selectRow", true)) { - - return this.modules.selectRow.getSelectedData(); - } - }; - - //////////// Pagination Functions //////////// - - - Tabulator.prototype.setMaxPage = function (max) { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.setMaxPage(max); - } else { - - return false; - } - }; - - Tabulator.prototype.setPage = function (page) { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.setPage(page); - } else { - - return new Promise(function (resolve, reject) { - reject(); - }); - } - }; - - Tabulator.prototype.setPageToRow = function (row) { - var _this31 = this; - - return new Promise(function (resolve, reject) { - - if (_this31.options.pagination && _this31.modExists("page")) { - - row = _this31.rowManager.findRow(row); - - if (row) { - - _this31.modules.page.setPageToRow(row).then(function () { - - resolve(); - }).catch(function () { - - reject(); - }); - } else { - - reject(); - } - } else { - - reject(); - } - }); - }; - - Tabulator.prototype.setPageSize = function (size) { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.setPageSize(size); - - this.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else { - - return false; - } - }; - - Tabulator.prototype.getPageSize = function () { - - if (this.options.pagination && this.modExists("page", true)) { - - return this.modules.page.getPageSize(); - } - }; - - Tabulator.prototype.previousPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.previousPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.nextPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.nextPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.getPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.getPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.getPageMax = function () { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.getPageMax(); - } else { - - return false; - } - }; - - ///////////////// Grouping Functions /////////////// - - - Tabulator.prototype.setGroupBy = function (groups) { - - if (this.modExists("groupRows", true)) { - - this.options.groupBy = groups; - - this.modules.groupRows.initialize(); - - this.rowManager.refreshActiveData("display"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.setGroupStartOpen = function (values) { - - if (this.modExists("groupRows", true)) { - - this.options.groupStartOpen = values; - - this.modules.groupRows.initialize(); - - if (this.options.groupBy) { - - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.setGroupHeader = function (values) { - - if (this.modExists("groupRows", true)) { - - this.options.groupHeader = values; - - this.modules.groupRows.initialize(); - - if (this.options.groupBy) { - - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.getGroups = function (values) { - - if (this.modExists("groupRows", true)) { - - return this.modules.groupRows.getGroups(true); - } else { - - return false; - } - }; - - // get grouped table data in the same format as getData() - - Tabulator.prototype.getGroupedData = function () { - - if (this.modExists("groupRows", true)) { - - return this.options.groupBy ? this.modules.groupRows.getGroupedData() : this.getData(); - } - }; - - ///////////////// Column Calculation Functions /////////////// - - Tabulator.prototype.getCalcResults = function () { - - if (this.modExists("columnCalcs", true)) { - - return this.modules.columnCalcs.getResults(); - } else { - - return false; - } - }; - - Tabulator.prototype.recalc = function () { - - if (this.modExists("columnCalcs", true)) { - - this.modules.columnCalcs.recalcAll(this.rowManager.activeRows); - } - }; - - /////////////// Navigation Management ////////////// - - - Tabulator.prototype.navigatePrev = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - return cell.nav().prev(); - } - } - - return false; - }; - - Tabulator.prototype.navigateNext = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - return cell.nav().next(); - } - } - - return false; - }; - - Tabulator.prototype.navigateLeft = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().left(); - } - } - - return false; - }; - - Tabulator.prototype.navigateRight = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().right(); - } - } - - return false; - }; - - Tabulator.prototype.navigateUp = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().up(); - } - } - - return false; - }; - - Tabulator.prototype.navigateDown = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().down(); - } - } - - return false; - }; - - /////////////// History Management ////////////// - - Tabulator.prototype.undo = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.undo(); - } else { - - return false; - } - }; - - Tabulator.prototype.redo = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.redo(); - } else { - - return false; - } - }; - - Tabulator.prototype.getHistoryUndoSize = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.getHistoryUndoSize(); - } else { - - return false; - } - }; - - Tabulator.prototype.getHistoryRedoSize = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.getHistoryRedoSize(); - } else { - - return false; - } - }; - - /////////////// Download Management ////////////// - - - Tabulator.prototype.download = function (type, filename, options, active) { - - if (this.modExists("download", true)) { - - this.modules.download.download(type, filename, options, active); - } - }; - - Tabulator.prototype.downloadToTab = function (type, filename, options, active) { - - if (this.modExists("download", true)) { - - this.modules.download.download(type, filename, options, active, true); - } - }; - - /////////// Inter Table Communications /////////// - - - Tabulator.prototype.tableComms = function (table, module, action, data) { - - this.modules.comms.receive(table, module, action, data); - }; - - ////////////// Extension Management ////////////// - - - //object to hold module - - Tabulator.prototype.moduleBindings = {}; - - //extend module - - Tabulator.prototype.extendModule = function (name, property, values) { - - if (Tabulator.prototype.moduleBindings[name]) { - - var source = Tabulator.prototype.moduleBindings[name].prototype[property]; - - if (source) { - - if ((typeof values === 'undefined' ? 'undefined' : _typeof(values)) == "object") { - - for (var key in values) { - - source[key] = values[key]; - } - } else { - - console.warn("Module Error - Invalid value type, it must be an object"); - } - } else { - - console.warn("Module Error - property does not exist:", property); - } - } else { - - console.warn("Module Error - module does not exist:", name); - } - }; - - //add module to tabulator - - Tabulator.prototype.registerModule = function (name, module) { - - var self = this; - - Tabulator.prototype.moduleBindings[name] = module; - }; - - //ensure that module are bound to instantiated function - - Tabulator.prototype.bindModules = function () { - - this.modules = {}; - - for (var name in Tabulator.prototype.moduleBindings) { - - this.modules[name] = new Tabulator.prototype.moduleBindings[name](this); - } - }; - - //Check for module - - Tabulator.prototype.modExists = function (plugin, required) { - - if (this.modules[plugin]) { - - return true; - } else { - - if (required) { - - console.error("Tabulator Module Not Installed: " + plugin); - } - - return false; - } - }; - - Tabulator.prototype.helpers = { - - elVisible: function elVisible(el) { - - return !(el.offsetWidth <= 0 && el.offsetHeight <= 0); - }, - - elOffset: function elOffset(el) { - - var box = el.getBoundingClientRect(); - - return { - - top: box.top + window.pageYOffset - document.documentElement.clientTop, - - left: box.left + window.pageXOffset - document.documentElement.clientLeft - - }; - }, - - deepClone: function deepClone(obj) { - - var clone = Array.isArray(obj) ? [] : {}; - - for (var i in obj) { - - if (obj[i] != null && _typeof(obj[i]) === "object") { - - if (obj[i] instanceof Date) { - - clone[i] = new Date(obj[i]); - } else { - - clone[i] = this.deepClone(obj[i]); - } - } else { - - clone[i] = obj[i]; - } - } - - return clone; - } - - }; - - Tabulator.prototype.comms = { - - tables: [], - - register: function register(table) { - - Tabulator.prototype.comms.tables.push(table); - }, - - deregister: function deregister(table) { - - var index = Tabulator.prototype.comms.tables.indexOf(table); - - if (index > -1) { - - Tabulator.prototype.comms.tables.splice(index, 1); - } - }, - - lookupTable: function lookupTable(query, silent) { - - var results = [], - matches, - match; - - if (typeof query === "string") { - - matches = document.querySelectorAll(query); - - if (matches.length) { - - for (var i = 0; i < matches.length; i++) { - - match = Tabulator.prototype.comms.matchElement(matches[i]); - - if (match) { - - results.push(match); - } - } - } - } else if (typeof HTMLElement !== "undefined" && query instanceof HTMLElement || query instanceof Tabulator) { - - match = Tabulator.prototype.comms.matchElement(query); - - if (match) { - - results.push(match); - } - } else if (Array.isArray(query)) { - - query.forEach(function (item) { - - results = results.concat(Tabulator.prototype.comms.lookupTable(item)); - }); - } else { - - if (!silent) { - - console.warn("Table Connection Error - Invalid Selector", query); - } - } - - return results; - }, - - matchElement: function matchElement(element) { - - return Tabulator.prototype.comms.tables.find(function (table) { - - return element instanceof Tabulator ? table === element : table.element === element; - }); - } - - }; - - Tabulator.prototype.findTable = function (query) { - - var results = Tabulator.prototype.comms.lookupTable(query, true); - - return Array.isArray(results) && !results.length ? false : results; - }; - - var Layout = function Layout(table) { - - this.table = table; - - this.mode = null; - }; - - //initialize layout system - - - Layout.prototype.initialize = function (layout) { - - if (this.modes[layout]) { - - this.mode = layout; - } else { - - console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : " + layout); - - this.mode = 'fitData'; - } - - this.table.element.setAttribute("tabulator-layout", this.mode); - }; - - Layout.prototype.getMode = function () { - - return this.mode; - }; - - //trigger table layout - - - Layout.prototype.layout = function () { - - this.modes[this.mode].call(this, this.table.columnManager.columnsByIndex); - }; - - //layout render functions - - - Layout.prototype.modes = { - - //resize columns to fit data the contain - - - "fitData": function fitData(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch row to fill table - - - "fitDataFill": function fitDataFill(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch last column to fill table - - - "fitDataStretch": function fitDataStretch(columns) { - var _this32 = this; - - var colsWidth = 0, - tableWidth = this.table.rowManager.element.clientWidth, - gap = 0, - lastCol = false; - - columns.forEach(function (column, i) { - - if (!column.widthFixed) { - - column.reinitializeWidth(); - } - - if (_this32.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible) { - - lastCol = column; - } - - if (column.visible) { - - colsWidth += column.getWidth(); - } - }); - - if (lastCol) { - - gap = tableWidth - colsWidth + lastCol.getWidth(); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - lastCol.setWidth(0); - - this.table.modules.responsiveLayout.update(); - } - - if (gap > 0) { - - lastCol.setWidth(gap); - } else { - - lastCol.reinitializeWidth(); - } - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - }, - - //resize columns to fit - - - "fitColumns": function fitColumns(columns) { - - var self = this; - - var totalWidth = self.table.element.clientWidth; //table element width - - - var fixedWidth = 0; //total width of columns with a defined width - - - var flexWidth = 0; //total width available to flexible columns - - - var flexGrowUnits = 0; //total number of widthGrow blocks accross all columns - - - var flexColWidth = 0; //desired width of flexible columns - - - var flexColumns = []; //array of flexible width columns - - - var fixedShrinkColumns = []; //array of fixed width columns that can shrink - - - var flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns - - - var overflowWidth = 0; //horizontal overflow width - - - var gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps - - - function calcWidth(width) { - - var colWidth; - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - return colWidth; - } - - //ensure columns resize to take up the correct amount of space - - - function scaleColumns(columns, freeSpace, colWidth, shrinkCols) { - - var oversizeCols = [], - oversizeSpace = 0, - remainingSpace = 0, - nextColWidth = 0, - gap = 0, - changeUnits = 0, - undersizeCols = []; - - function calcGrow(col) { - - return colWidth * (col.column.definition.widthGrow || 1); - } - - function calcShrink(col) { - - return calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0); - } - - columns.forEach(function (col, i) { - - var width = shrinkCols ? calcShrink(col) : calcGrow(col); - - if (col.column.minWidth >= width) { - - oversizeCols.push(col); - } else { - - undersizeCols.push(col); - - changeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1; - } - }); - - if (oversizeCols.length) { - - oversizeCols.forEach(function (col) { - - oversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth; - - col.width = col.column.minWidth; - }); - - remainingSpace = freeSpace - oversizeSpace; - - nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace; - - gap = remainingSpace - nextColWidth * changeUnits; - - gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); - } else { - - gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace; - - undersizeCols.forEach(function (column) { - - column.width = shrinkCols ? calcShrink(column) : calcGrow(column); - }); - } - - return gap; - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - - //adjust for vertical scrollbar if present - - - if (this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight) { - - totalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth; - } - - columns.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width; - - minWidth = parseInt(column.minWidth); - - if (width) { - - colWidth = calcWidth(width); - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - - if (column.definition.widthShrink) { - - fixedShrinkColumns.push({ - - column: column, - - width: colWidth > minWidth ? colWidth : minWidth - - }); - - flexShrinkUnits += column.definition.widthShrink; - } - } else { - - flexColumns.push({ - - column: column, - - width: 0 - - }); - - flexGrowUnits += column.definition.widthGrow || 1; - } - } - }); - - //calculate available space - - - flexWidth = totalWidth - fixedWidth; - - //calculate correct column size - - - flexColWidth = Math.floor(flexWidth / flexGrowUnits); - - //generate column widths - - - var gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); - - //increase width of last column to account for rounding errors - - - if (flexColumns.length && gapFill > 0) { - - flexColumns[flexColumns.length - 1].width += +gapFill; - } - - //caculate space for columns to be shrunk into - - - flexColumns.forEach(function (col) { - - flexWidth -= col.width; - }); - - overflowWidth = Math.abs(gapFill) + flexWidth; - - //shrink oversize columns if there is no available space - - - if (overflowWidth > 0 && flexShrinkUnits) { - - gapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true); - } - - //decrease width of last column to account for rounding errors - - - if (fixedShrinkColumns.length) { - - fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill; - } - - flexColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - - fixedShrinkColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - } - - }; - - Tabulator.prototype.registerModule("layout", Layout); - - var Localize = function Localize(table) { - - this.table = table; //hold Tabulator object - - this.locale = "default"; //current locale - - this.lang = false; //current language - - this.bindings = {}; //update events to call when locale is changed - }; - - //set header placehoder - - Localize.prototype.setHeaderFilterPlaceholder = function (placeholder) { - - this.langs.default.headerFilters.default = placeholder; - }; - - //set header filter placeholder by column - - Localize.prototype.setHeaderFilterColumnPlaceholder = function (column, placeholder) { - - this.langs.default.headerFilters.columns[column] = placeholder; - - if (this.lang && !this.lang.headerFilters.columns[column]) { - - this.lang.headerFilters.columns[column] = placeholder; - } - }; - - //setup a lang description object - - Localize.prototype.installLang = function (locale, lang) { - - if (this.langs[locale]) { - - this._setLangProp(this.langs[locale], lang); - } else { - - this.langs[locale] = lang; - } - }; - - Localize.prototype._setLangProp = function (lang, values) { - - for (var key in values) { - - if (lang[key] && _typeof(lang[key]) == "object") { - - this._setLangProp(lang[key], values[key]); - } else { - - lang[key] = values[key]; - } - } - }; - - //set current locale - - Localize.prototype.setLocale = function (desiredLocale) { - - var self = this; - - desiredLocale = desiredLocale || "default"; - - //fill in any matching languge values - - function traverseLang(trans, path) { - - for (var prop in trans) { - - if (_typeof(trans[prop]) == "object") { - - if (!path[prop]) { - - path[prop] = {}; - } - - traverseLang(trans[prop], path[prop]); - } else { - - path[prop] = trans[prop]; - } - } - } - - //determing correct locale to load - - if (desiredLocale === true && navigator.language) { - - //get local from system - - desiredLocale = navigator.language.toLowerCase(); - } - - if (desiredLocale) { - - //if locale is not set, check for matching top level locale else use default - - if (!self.langs[desiredLocale]) { - - var prefix = desiredLocale.split("-")[0]; - - if (self.langs[prefix]) { - - console.warn("Localization Error - Exact matching locale not found, using closest match: ", desiredLocale, prefix); - - desiredLocale = prefix; - } else { - - console.warn("Localization Error - Matching locale not found, using default: ", desiredLocale); - - desiredLocale = "default"; - } - } - } - - self.locale = desiredLocale; - - //load default lang template - - self.lang = Tabulator.prototype.helpers.deepClone(self.langs.default || {}); - - if (desiredLocale != "default") { - - traverseLang(self.langs[desiredLocale], self.lang); - } - - self.table.options.localized.call(self.table, self.locale, self.lang); - - self._executeBindings(); - }; - - //get current locale - - Localize.prototype.getLocale = function (locale) { - - return self.locale; - }; - - //get lang object for given local or current if none provided - - Localize.prototype.getLang = function (locale) { - - return locale ? this.langs[locale] : this.lang; - }; - - //get text for current locale - - Localize.prototype.getText = function (path, value) { - - var path = value ? path + "|" + value : path, - pathArray = path.split("|"), - text = this._getLangElement(pathArray, this.locale); - - // if(text === false){ - - // console.warn("Localization Error - Matching localized text not found for given path: ", path); - - // } - - - return text || ""; - }; - - //traverse langs object and find localized copy - - Localize.prototype._getLangElement = function (path, locale) { - - var self = this; - - var root = self.lang; - - path.forEach(function (level) { - - var rootPath; - - if (root) { - - rootPath = root[level]; - - if (typeof rootPath != "undefined") { - - root = rootPath; - } else { - - root = false; - } - } - }); - - return root; - }; - - //set update binding - - Localize.prototype.bind = function (path, callback) { - - if (!this.bindings[path]) { - - this.bindings[path] = []; - } - - this.bindings[path].push(callback); - - callback(this.getText(path), this.lang); - }; - - //itterate through bindings and trigger updates - - Localize.prototype._executeBindings = function () { - - var self = this; - - var _loop = function _loop(path) { - - self.bindings[path].forEach(function (binding) { - - binding(self.getText(path), self.lang); - }); - }; - - for (var path in self.bindings) { - _loop(path); - } - }; - - //Localized text listings - - Localize.prototype.langs = { - - "default": { //hold default locale text - - "groups": { - - "item": "item", - - "items": "items" - - }, - - "columns": {}, - - "ajax": { - - "loading": "Loading", - - "error": "Error" - - }, - - "pagination": { - - "page_size": "Page Size", - - "first": "First", - - "first_title": "First Page", - - "last": "Last", - - "last_title": "Last Page", - - "prev": "Prev", - - "prev_title": "Prev Page", - - "next": "Next", - - "next_title": "Next Page" - - }, - - "headerFilters": { - - "default": "filter column...", - - "columns": {} - - } - - } - - }; - - Tabulator.prototype.registerModule("localize", Localize); - - var Comms = function Comms(table) { - - this.table = table; - }; - - Comms.prototype.getConnections = function (selectors) { - - var self = this, - connections = [], - connection; - - connection = Tabulator.prototype.comms.lookupTable(selectors); - - connection.forEach(function (con) { - - if (self.table !== con) { - - connections.push(con); - } - }); - - return connections; - }; - - Comms.prototype.send = function (selectors, module, action, data) { - - var self = this, - connections = this.getConnections(selectors); - - connections.forEach(function (connection) { - - connection.tableComms(self.table.element, module, action, data); - }); - - if (!connections.length && selectors) { - - console.warn("Table Connection Error - No tables matching selector found", selectors); - } - }; - - Comms.prototype.receive = function (table, module, action, data) { - - if (this.table.modExists(module)) { - - return this.table.modules[module].commsReceived(table, action, data); - } else { - - console.warn("Inter-table Comms Error - no such module:", module); - } - }; - - Tabulator.prototype.registerModule("comms", Comms); - - var Accessor = function Accessor(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"]; //list of accessor types - }; - - //initialize column accessor - Accessor.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)), - accessor; - - if (column.definition[key]) { - accessor = self.lookupAccessor(column.definition[key]); - - if (accessor) { - match = true; - - config[key] = { - accessor: accessor, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.accessor = config; - } - }; - - Accessor.prototype.lookupAccessor = function (value) { - var accessor = false; - - //set column accessor - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - if (this.accessors[value]) { - accessor = this.accessors[value]; - } else { - console.warn("Accessor Error - No such accessor found, ignoring: ", value); - } - break; - - case "function": - accessor = value; - break; - } - - return accessor; - }; - - //apply accessor to row - Accessor.prototype.transformRow = function (dataIn, type) { - var self = this, - key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)); - - //clone data object with deep copy to isolate internal data from returned result - var data = Tabulator.prototype.helpers.deepClone(dataIn || {}); - - self.table.columnManager.traverse(function (column) { - var value, accessor, params, component; - - if (column.modules.accessor) { - - accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false; - - if (accessor) { - value = column.getFieldValue(data); - - if (value != "undefined") { - component = column.getComponent(); - params = typeof accessor.params === "function" ? accessor.params(value, data, type, component) : accessor.params; - column.setFieldValue(data, accessor.accessor(value, data, type, params, component)); - } - } - } - }); - - return data; - }, - - //default accessors - Accessor.prototype.accessors = {}; - - Tabulator.prototype.registerModule("accessor", Accessor); - var Ajax = function Ajax(table) { - - this.table = table; //hold Tabulator object - this.config = false; //hold config object for ajax request - this.url = ""; //request URL - this.urlGenerator = false; - this.params = false; //request parameters - - this.loaderElement = this.createLoaderElement(); //loader message div - this.msgElement = this.createMsgElement(); //message element - this.loadingElement = false; - this.errorElement = false; - this.loaderPromise = false; - - this.progressiveLoad = false; - this.loading = false; - - this.requestOrder = 0; //prevent requests comming out of sequence if overridden by another load request - }; - - //initialize setup options - Ajax.prototype.initialize = function () { - var template; - - this.loaderElement.appendChild(this.msgElement); - - if (this.table.options.ajaxLoaderLoading) { - if (typeof this.table.options.ajaxLoaderLoading == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderLoading.trim(); - this.loadingElement = template.content.firstChild; - } else { - this.loadingElement = this.table.options.ajaxLoaderLoading; - } - } - - this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise; - - this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator; - - if (this.table.options.ajaxLoaderError) { - if (typeof this.table.options.ajaxLoaderError == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderError.trim(); - this.errorElement = template.content.firstChild; - } else { - this.errorElement = this.table.options.ajaxLoaderError; - } - } - - if (this.table.options.ajaxParams) { - this.setParams(this.table.options.ajaxParams); - } - - if (this.table.options.ajaxConfig) { - this.setConfig(this.table.options.ajaxConfig); - } - - if (this.table.options.ajaxURL) { - this.setUrl(this.table.options.ajaxURL); - } - - if (this.table.options.ajaxProgressiveLoad) { - if (this.table.options.pagination) { - this.progressiveLoad = false; - console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"); - } else { - if (this.table.modExists("page")) { - this.progressiveLoad = this.table.options.ajaxProgressiveLoad; - this.table.modules.page.initializeProgressive(this.progressiveLoad); - } else { - console.error("Pagination plugin is required for progressive ajax loading"); - } - } - } - }; - - Ajax.prototype.createLoaderElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-loader"); - return el; - }; - - Ajax.prototype.createMsgElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-loader-msg"); - el.setAttribute("role", "alert"); - - return el; - }; - - //set ajax params - Ajax.prototype.setParams = function (params, update) { - if (update) { - this.params = this.params || {}; - - for (var key in params) { - this.params[key] = params[key]; - } - } else { - this.params = params; - } - }; - - Ajax.prototype.getParams = function () { - return this.params || {}; - }; - - //load config object - Ajax.prototype.setConfig = function (config) { - this._loadDefaultConfig(); - - if (typeof config == "string") { - this.config.method = config; - } else { - for (var key in config) { - this.config[key] = config[key]; - } - } - }; - - //create config object from default - Ajax.prototype._loadDefaultConfig = function (force) { - var self = this; - if (!self.config || force) { - - self.config = {}; - - //load base config from defaults - for (var key in self.defaultConfig) { - self.config[key] = self.defaultConfig[key]; - } - } - }; - - //set request url - Ajax.prototype.setUrl = function (url) { - this.url = url; - }; - - //get request url - Ajax.prototype.getUrl = function () { - return this.url; - }; - - //lstandard loading function - Ajax.prototype.loadData = function (inPosition, columnsChanged) { - var self = this; - - if (this.progressiveLoad) { - return this._loadDataProgressive(); - } else { - return this._loadDataStandard(inPosition, columnsChanged); - } - }; - - Ajax.prototype.nextPage = function (diff) { - var margin; - - if (!this.loading) { - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.getElement().clientHeight * 2; - - if (diff < margin) { - this.table.modules.page.nextPage().then(function () {}).catch(function () {}); - } - } - }; - - Ajax.prototype.blockActiveRequest = function () { - this.requestOrder++; - }; - - Ajax.prototype._loadDataProgressive = function () { - this.table.rowManager.setData([]); - return this.table.modules.page.setPage(1); - }; - - Ajax.prototype._loadDataStandard = function (inPosition, columnsChanged) { - var _this33 = this; - - return new Promise(function (resolve, reject) { - _this33.sendRequest(inPosition).then(function (data) { - _this33.table.rowManager.setData(data, inPosition, columnsChanged).then(function () { - resolve(); - }).catch(function (e) { - reject(e); - }); - }).catch(function (e) { - reject(e); - }); - }); - }; - - Ajax.prototype.generateParamsList = function (data, prefix) { - var self = this, - output = []; - - prefix = prefix || ""; - - if (Array.isArray(data)) { - data.forEach(function (item, i) { - output = output.concat(self.generateParamsList(item, prefix ? prefix + "[" + i + "]" : i)); - }); - } else if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === "object") { - for (var key in data) { - output = output.concat(self.generateParamsList(data[key], prefix ? prefix + "[" + key + "]" : key)); - } - } else { - output.push({ key: prefix, value: data }); - } - - return output; - }; - - Ajax.prototype.serializeParams = function (params) { - var output = this.generateParamsList(params), - encoded = []; - - output.forEach(function (item) { - encoded.push(encodeURIComponent(item.key) + "=" + encodeURIComponent(item.value)); - }); - - return encoded.join("&"); - }; - - //send ajax request - Ajax.prototype.sendRequest = function (silent) { - var _this34 = this; - - var self = this, - url = self.url, - requestNo, - esc, - query; - - self.requestOrder++; - requestNo = self.requestOrder; - - self._loadDefaultConfig(); - - return new Promise(function (resolve, reject) { - if (self.table.options.ajaxRequesting.call(_this34.table, self.url, self.params) !== false) { - - self.loading = true; - - if (!silent) { - self.showLoader(); - } - - _this34.loaderPromise(url, self.config, self.params).then(function (data) { - if (requestNo === self.requestOrder) { - if (self.table.options.ajaxResponse) { - data = self.table.options.ajaxResponse.call(self.table, self.url, self.params, data); - } - resolve(data); - - self.hideLoader(); - self.loading = false; - } else { - console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"); - } - }).catch(function (error) { - console.error("Ajax Load Error: ", error); - self.table.options.ajaxError.call(self.table, error); - - self.showError(); - - setTimeout(function () { - self.hideLoader(); - }, 3000); - - self.loading = false; - - reject(); - }); - } else { - reject(); - } - }); - }; - - Ajax.prototype.showLoader = function () { - var shouldLoad = typeof this.table.options.ajaxLoader === "function" ? this.table.options.ajaxLoader() : this.table.options.ajaxLoader; - - if (shouldLoad) { - - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-error"); - this.msgElement.classList.add("tabulator-loading"); - - if (this.loadingElement) { - this.msgElement.appendChild(this.loadingElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|loading"); - } - - this.table.element.appendChild(this.loaderElement); - } - }; - - Ajax.prototype.showError = function () { - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-loading"); - this.msgElement.classList.add("tabulator-error"); - - if (this.errorElement) { - this.msgElement.appendChild(this.errorElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|error"); - } - - this.table.element.appendChild(this.loaderElement); - }; - - Ajax.prototype.hideLoader = function () { - if (this.loaderElement.parentNode) { - this.loaderElement.parentNode.removeChild(this.loaderElement); - } - }; - - //default ajax config object - Ajax.prototype.defaultConfig = { - method: "GET" - }; - - Ajax.prototype.defaultURLGenerator = function (url, config, params) { - - if (url) { - if (params && Object.keys(params).length) { - if (!config.method || config.method.toLowerCase() == "get") { - config.method = "get"; - - url += (url.includes("?") ? "&" : "?") + this.serializeParams(params); - } - } - } - - return url; - }; - - Ajax.prototype.defaultLoaderPromise = function (url, config, params) { - var self = this, - contentType; - - return new Promise(function (resolve, reject) { - - //set url - url = self.urlGenerator(url, config, params); - - //set body content if not GET request - if (config.method.toUpperCase() != "GET") { - contentType = _typeof(self.table.options.ajaxContentType) === "object" ? self.table.options.ajaxContentType : self.contentTypeFormatters[self.table.options.ajaxContentType]; - if (contentType) { - - for (var key in contentType.headers) { - if (!config.headers) { - config.headers = {}; - } - - if (typeof config.headers[key] === "undefined") { - config.headers[key] = contentType.headers[key]; - } - } - - config.body = contentType.body.call(self, url, config, params); - } else { - console.warn("Ajax Error - Invalid ajaxContentType value:", self.table.options.ajaxContentType); - } - } - - if (url) { - - //configure headers - if (typeof config.headers === "undefined") { - config.headers = {}; - } - - if (typeof config.headers.Accept === "undefined") { - config.headers.Accept = "application/json"; - } - - if (typeof config.headers["X-Requested-With"] === "undefined") { - config.headers["X-Requested-With"] = "XMLHttpRequest"; - } - - if (typeof config.mode === "undefined") { - config.mode = "cors"; - } - - if (config.mode == "cors") { - - if (typeof config.headers["Access-Control-Allow-Origin"] === "undefined") { - config.headers["Access-Control-Allow-Origin"] = window.location.origin; - } - - if (typeof config.credentials === "undefined") { - config.credentials = 'same-origin'; - } - } else { - if (typeof config.credentials === "undefined") { - config.credentials = 'include'; - } - } - - //send request - fetch(url, config).then(function (response) { - if (response.ok) { - response.json().then(function (data) { - resolve(data); - }).catch(function (error) { - reject(error); - console.warn("Ajax Load Error - Invalid JSON returned", error); - }); - } else { - console.error("Ajax Load Error - Connection Error: " + response.status, response.statusText); - reject(response); - } - }).catch(function (error) { - console.error("Ajax Load Error - Connection Error: ", error); - reject(error); - }); - } else { - console.warn("Ajax Load Error - No URL Set"); - resolve([]); - } - }); - }; - - Ajax.prototype.contentTypeFormatters = { - "json": { - headers: { - 'Content-Type': 'application/json' - }, - body: function body(url, config, params) { - return JSON.stringify(params); - } - }, - "form": { - headers: {}, - body: function body(url, config, params) { - var output = this.generateParamsList(params), - form = new FormData(); - - output.forEach(function (item) { - form.append(item.key, item.value); - }); - - return form; - } - } - }; - - Tabulator.prototype.registerModule("ajax", Ajax); - - var ColumnCalcs = function ColumnCalcs(table) { - this.table = table; //hold Tabulator object - this.topCalcs = []; - this.botCalcs = []; - this.genColumn = false; - this.topElement = this.createElement(); - this.botElement = this.createElement(); - this.topRow = false; - this.botRow = false; - this.topInitialized = false; - this.botInitialized = false; - - this.initialize(); - }; - - ColumnCalcs.prototype.createElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-calcs-holder"); - return el; - }; - - ColumnCalcs.prototype.initialize = function () { - this.genColumn = new Column({ field: "value" }, this); - }; - - //dummy functions to handle being mock column manager - ColumnCalcs.prototype.registerColumnField = function () {}; - - //initialize column calcs - ColumnCalcs.prototype.initializeColumn = function (column) { - var def = column.definition; - - var config = { - topCalcParams: def.topCalcParams || {}, - botCalcParams: def.bottomCalcParams || {} - }; - - if (def.topCalc) { - - switch (_typeof(def.topCalc)) { - case "string": - if (this.calculations[def.topCalc]) { - config.topCalc = this.calculations[def.topCalc]; - } else { - console.warn("Column Calc Error - No such calculation found, ignoring: ", def.topCalc); - } - break; - - case "function": - config.topCalc = def.topCalc; - break; - - } - - if (config.topCalc) { - column.modules.columnCalcs = config; - this.topCalcs.push(column); - - if (this.table.options.columnCalcs != "group") { - this.initializeTopRow(); - } - } - } - - if (def.bottomCalc) { - switch (_typeof(def.bottomCalc)) { - case "string": - if (this.calculations[def.bottomCalc]) { - config.botCalc = this.calculations[def.bottomCalc]; - } else { - console.warn("Column Calc Error - No such calculation found, ignoring: ", def.bottomCalc); - } - break; - - case "function": - config.botCalc = def.bottomCalc; - break; - - } - - if (config.botCalc) { - column.modules.columnCalcs = config; - this.botCalcs.push(column); - - if (this.table.options.columnCalcs != "group") { - this.initializeBottomRow(); - } - } - } - }; - - ColumnCalcs.prototype.removeCalcs = function () { - var changed = false; - - if (this.topInitialized) { - this.topInitialized = false; - this.topElement.parentNode.removeChild(this.topElement); - changed = true; - } - - if (this.botInitialized) { - this.botInitialized = false; - this.table.footerManager.remove(this.botElement); - changed = true; - } - - if (changed) { - this.table.rowManager.adjustTableSize(); - } - }; - - ColumnCalcs.prototype.initializeTopRow = function () { - if (!this.topInitialized) { - // this.table.columnManager.headersElement.after(this.topElement); - this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling); - this.topInitialized = true; - } - }; - - ColumnCalcs.prototype.initializeBottomRow = function () { - if (!this.botInitialized) { - this.table.footerManager.prepend(this.botElement); - this.botInitialized = true; - } - }; - - ColumnCalcs.prototype.scrollHorizontal = function (left) { - var hozAdjust = 0, - scrollWidth = this.table.columnManager.getElement().scrollWidth - this.table.element.clientWidth; - - if (this.botInitialized) { - this.botRow.getElement().style.marginLeft = -left + "px"; - } - }; - - ColumnCalcs.prototype.recalc = function (rows) { - var data, row; - - if (this.topInitialized || this.botInitialized) { - data = this.rowsToData(rows); - - if (this.topInitialized) { - if (this.topRow) { - this.topRow.deleteCells(); - } - - row = this.generateRow("top", this.rowsToData(rows)); - this.topRow = row; - while (this.topElement.firstChild) { - this.topElement.removeChild(this.topElement.firstChild); - }this.topElement.appendChild(row.getElement()); - row.initialize(true); - } - - if (this.botInitialized) { - if (this.botRow) { - this.botRow.deleteCells(); - } - - row = this.generateRow("bottom", this.rowsToData(rows)); - this.botRow = row; - while (this.botElement.firstChild) { - this.botElement.removeChild(this.botElement.firstChild); - }this.botElement.appendChild(row.getElement()); - row.initialize(true); - } - - this.table.rowManager.adjustTableSize(); - - //set resizable handles - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } - } - }; - - ColumnCalcs.prototype.recalcRowGroup = function (row) { - this.recalcGroup(this.table.modules.groupRows.getRowGroup(row)); - }; - - ColumnCalcs.prototype.recalcAll = function () { - var _this35 = this; - - if (this.topCalcs.length || this.botCalcs.length) { - if (this.table.options.columnCalcs !== "group") { - this.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.groupBy && this.table.options.columnCalcs !== "table") { - - var groups = table.modules.groupRows.getChildGroups(); - - groups.forEach(function (group) { - _this35.recalcGroup(group); - }); - } - } - }; - - ColumnCalcs.prototype.recalcGroup = function (group) { - var data, rowData; - - if (group) { - if (group.calcs) { - if (group.calcs.bottom) { - data = this.rowsToData(group.rows); - rowData = this.generateRowData("bottom", data); - - group.calcs.bottom.updateData(rowData); - group.calcs.bottom.reinitialize(); - } - - if (group.calcs.top) { - data = this.rowsToData(group.rows); - rowData = this.generateRowData("top", data); - - group.calcs.top.updateData(rowData); - group.calcs.top.reinitialize(); - } - } - } - }; - - //generate top stats row - ColumnCalcs.prototype.generateTopRow = function (rows) { - return this.generateRow("top", this.rowsToData(rows)); - }; - //generate bottom stats row - ColumnCalcs.prototype.generateBottomRow = function (rows) { - return this.generateRow("bottom", this.rowsToData(rows)); - }; - - ColumnCalcs.prototype.rowsToData = function (rows) { - var _this36 = this; - - var data = []; - - rows.forEach(function (row) { - data.push(row.getData()); - - if (_this36.table.options.dataTree && _this36.table.options.dataTreeChildColumnCalcs) { - if (row.modules.dataTree.open) { - var children = _this36.rowsToData(_this36.table.modules.dataTree.getFilteredTreeChildren(row)); - data = data.concat(children); - } - } - }); - - return data; - }; - - //generate stats row - ColumnCalcs.prototype.generateRow = function (pos, data) { - var self = this, - rowData = this.generateRowData(pos, data), - row; - - if (self.table.modExists("mutator")) { - self.table.modules.mutator.disable(); - } - - row = new Row(rowData, this, "calc"); - - if (self.table.modExists("mutator")) { - self.table.modules.mutator.enable(); - } - - row.getElement().classList.add("tabulator-calcs", "tabulator-calcs-" + pos); - - row.generateCells = function () { - - var cells = []; - - self.table.columnManager.columnsByIndex.forEach(function (column) { - - //set field name of mock column - self.genColumn.setField(column.getField()); - self.genColumn.hozAlign = column.hozAlign; - - if (column.definition[pos + "CalcFormatter"] && self.table.modExists("format")) { - - self.genColumn.modules.format = { - formatter: self.table.modules.format.getFormatter(column.definition[pos + "CalcFormatter"]), - params: column.definition[pos + "CalcFormatterParams"] - }; - } else { - self.genColumn.modules.format = { - formatter: self.table.modules.format.getFormatter("plaintext"), - params: {} - }; - } - - //ensure css class defintion is replicated to calculation cell - self.genColumn.definition.cssClass = column.definition.cssClass; - - //generate cell and assign to correct column - var cell = new Cell(self.genColumn, row); - cell.column = column; - cell.setWidth(); - - column.cells.push(cell); - cells.push(cell); - - if (!column.visible) { - cell.hide(); - } - }); - - this.cells = cells; - }; - - return row; - }; - - //generate stats row - ColumnCalcs.prototype.generateRowData = function (pos, data) { - var rowData = {}, - calcs = pos == "top" ? this.topCalcs : this.botCalcs, - type = pos == "top" ? "topCalc" : "botCalc", - params, - paramKey; - - calcs.forEach(function (column) { - var values = []; - - if (column.modules.columnCalcs && column.modules.columnCalcs[type]) { - data.forEach(function (item) { - values.push(column.getFieldValue(item)); - }); - - paramKey = type + "Params"; - params = typeof column.modules.columnCalcs[paramKey] === "function" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey]; - - column.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params)); - } - }); - - return rowData; - }; - - ColumnCalcs.prototype.hasTopCalcs = function () { - return !!this.topCalcs.length; - }; - - ColumnCalcs.prototype.hasBottomCalcs = function () { - return !!this.botCalcs.length; - }; - - //handle table redraw - ColumnCalcs.prototype.redraw = function () { - if (this.topRow) { - this.topRow.normalizeHeight(true); - } - if (this.botRow) { - this.botRow.normalizeHeight(true); - } - }; - - //return the calculated - ColumnCalcs.prototype.getResults = function () { - var self = this, - results = {}, - groups; - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - groups = this.table.modules.groupRows.getGroups(true); - - groups.forEach(function (group) { - results[group.getKey()] = self.getGroupResults(group); - }); - } else { - results = { - top: this.topRow ? this.topRow.getData() : {}, - bottom: this.botRow ? this.botRow.getData() : {} - }; - } - - return results; - }; - - //get results from a group - ColumnCalcs.prototype.getGroupResults = function (group) { - var self = this, - groupObj = group._getSelf(), - subGroups = group.getSubGroups(), - subGroupResults = {}, - results = {}; - - subGroups.forEach(function (subgroup) { - subGroupResults[subgroup.getKey()] = self.getGroupResults(subgroup); - }); - - results = { - top: groupObj.calcs.top ? groupObj.calcs.top.getData() : {}, - bottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {}, - groups: subGroupResults - }; - - return results; - }; - - //default calculations - ColumnCalcs.prototype.calculations = { - "avg": function avg(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : 2; - - if (values.length) { - output = values.reduce(function (sum, value) { - value = Number(value); - return sum + value; - }); - - output = output / values.length; - - output = precision !== false ? output.toFixed(precision) : output; - } - - return parseFloat(output).toString(); - }, - "max": function max(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value > output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "min": function min(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value < output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "sum": function sum(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - if (values.length) { - values.forEach(function (value) { - value = Number(value); - - output += !isNaN(value) ? Number(value) : 0; - }); - } - - return precision !== false ? output.toFixed(precision) : output; - }, - "concat": function concat(values, data, calcParams) { - var output = 0; - - if (values.length) { - output = values.reduce(function (sum, value) { - return String(sum) + String(value); - }); - } - - return output; - }, - "count": function count(values, data, calcParams) { - var output = 0; - - if (values.length) { - values.forEach(function (value) { - if (value) { - output++; - } - }); - } - - return output; - } - }; - - Tabulator.prototype.registerModule("columnCalcs", ColumnCalcs); - - var Clipboard = function Clipboard(table) { - this.table = table; - this.mode = true; - - this.pasteParser = function () {}; - this.pasteAction = function () {}; - this.customSelection = false; - this.rowRange = false; - this.blocked = true; //block copy actions not originating from this command - }; - - Clipboard.prototype.initialize = function () { - var _this37 = this; - - this.mode = this.table.options.clipboard; - - this.rowRange = this.table.options.clipboardCopyRowRange; - - if (this.mode === true || this.mode === "copy") { - this.table.element.addEventListener("copy", function (e) { - var plain, html; - - if (!_this37.blocked) { - e.preventDefault(); - - if (_this37.customSelection) { - plain = _this37.customSelection; - - if (_this37.table.options.clipboardCopyFormatter) { - plain = _this37.table.options.clipboardCopyFormatter("plain", plain); - } - } else { - html = _this37.table.modules.export.getHtml(_this37.rowRange, _this37.table.options.clipboardCopyStyled, _this37.table.options.clipboardCopyConfig, "clipboard"); - plain = html ? _this37.generatePlainContent(html) : ""; - - if (_this37.table.options.clipboardCopyFormatter) { - plain = _this37.table.options.clipboardCopyFormatter("plain", plain); - html = _this37.table.options.clipboardCopyFormatter("html", html); - } - } - - if (window.clipboardData && window.clipboardData.setData) { - window.clipboardData.setData('Text', plain); - } else if (e.clipboardData && e.clipboardData.setData) { - e.clipboardData.setData('text/plain', plain); - if (html) { - e.clipboardData.setData('text/html', html); - } - } else if (e.originalEvent && e.originalEvent.clipboardData.setData) { - e.originalEvent.clipboardData.setData('text/plain', plain); - if (html) { - e.originalEvent.clipboardData.setData('text/html', html); - } - } - - _this37.table.options.clipboardCopied.call(_this37.table, plain, html); - - _this37.reset(); - } - }); - } - - if (this.mode === true || this.mode === "paste") { - this.table.element.addEventListener("paste", function (e) { - _this37.paste(e); - }); - } - - this.setPasteParser(this.table.options.clipboardPasteParser); - this.setPasteAction(this.table.options.clipboardPasteAction); - }; - - Clipboard.prototype.reset = function () { - this.blocked = false; - this.originalSelectionText = ""; - }; - - Clipboard.prototype.generatePlainContent = function (html) { - var output = []; - - var holder = document.createElement("div"); - holder.innerHTML = html; - - var table = holder.getElementsByTagName("table")[0]; - var rows = Array.prototype.slice.call(table.getElementsByTagName("tr")); - - rows.forEach(function (row) { - var rowData = []; - - var headers = Array.prototype.slice.call(row.getElementsByTagName("th")); - var cells = Array.prototype.slice.call(row.getElementsByTagName("td")); - - cells = cells.concat(headers); - - cells.forEach(function (cell) { - var val = cell.innerHTML; - - val = val == " " ? "" : val; - - rowData.push(val); - }); - - output.push(rowData.join("\t")); - }); - - return output.join("\n"); - }; - - Clipboard.prototype.copy = function (range, internal) { - var range, sel, textRange; - this.blocked = false; - this.customSelection = false; - - if (this.mode === true || this.mode === "copy") { - - this.rowRange = range || this.table.options.clipboardCopyRowRange; - - if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") { - range = document.createRange(); - range.selectNodeContents(this.table.element); - sel = window.getSelection(); - - if (sel.toString() && internal) { - this.customSelection = sel.toString(); - } - - sel.removeAllRanges(); - sel.addRange(range); - } else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") { - textRange = document.body.createTextRange(); - textRange.moveToElementText(this.table.element); - textRange.select(); - } - - document.execCommand('copy'); - - if (sel) { - sel.removeAllRanges(); - } - } - }; - - //PASTE EVENT HANDLING - - Clipboard.prototype.setPasteAction = function (action) { - - switch (typeof action === 'undefined' ? 'undefined' : _typeof(action)) { - case "string": - this.pasteAction = this.pasteActions[action]; - - if (!this.pasteAction) { - console.warn("Clipboard Error - No such paste action found:", action); - } - break; - - case "function": - this.pasteAction = action; - break; - } - }; - - Clipboard.prototype.setPasteParser = function (parser) { - switch (typeof parser === 'undefined' ? 'undefined' : _typeof(parser)) { - case "string": - this.pasteParser = this.pasteParsers[parser]; - - if (!this.pasteParser) { - console.warn("Clipboard Error - No such paste parser found:", parser); - } - break; - - case "function": - this.pasteParser = parser; - break; - } - }; - - Clipboard.prototype.paste = function (e) { - var data, rowData, rows; - - if (this.checkPaseOrigin(e)) { - - data = this.getPasteData(e); - - rowData = this.pasteParser.call(this, data); - - if (rowData) { - e.preventDefault(); - - if (this.table.modExists("mutator")) { - rowData = this.mutateData(rowData); - } - - rows = this.pasteAction.call(this, rowData); - this.table.options.clipboardPasted.call(this.table, data, rowData, rows); - } else { - this.table.options.clipboardPasteError.call(this.table, data); - } - } - }; - - Clipboard.prototype.mutateData = function (data) { - var self = this, - output = []; - - if (Array.isArray(data)) { - data.forEach(function (row) { - output.push(self.table.modules.mutator.transformRow(row, "clipboard")); - }); - } else { - output = data; - } - - return output; - }; - - Clipboard.prototype.checkPaseOrigin = function (e) { - var valid = true; - - if (e.target.tagName != "DIV" || this.table.modules.edit.currentCell) { - valid = false; - } - - return valid; - }; - - Clipboard.prototype.getPasteData = function (e) { - var data; - - if (window.clipboardData && window.clipboardData.getData) { - data = window.clipboardData.getData('Text'); - } else if (e.clipboardData && e.clipboardData.getData) { - data = e.clipboardData.getData('text/plain'); - } else if (e.originalEvent && e.originalEvent.clipboardData.getData) { - data = e.originalEvent.clipboardData.getData('text/plain'); - } - - return data; - }; - - Clipboard.prototype.pasteParsers = { - table: function table(clipboard) { - var data = [], - success = false, - headerFindSuccess = true, - columns = this.table.columnManager.columns, - columnMap = [], - rows = []; - - //get data from clipboard into array of columns and rows. - clipboard = clipboard.split("\n"); - - clipboard.forEach(function (row) { - data.push(row.split("\t")); - }); - - if (data.length && !(data.length === 1 && data[0].length < 2)) { - success = true; - - //check if headers are present by title - data[0].forEach(function (value) { - var column = columns.find(function (column) { - return value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim(); - }); - - if (column) { - columnMap.push(column); - } else { - headerFindSuccess = false; - } - }); - - //check if column headers are present by field - if (!headerFindSuccess) { - headerFindSuccess = true; - columnMap = []; - - data[0].forEach(function (value) { - var column = columns.find(function (column) { - return value && column.field && value.trim() && column.field.trim() === value.trim(); - }); - - if (column) { - columnMap.push(column); - } else { - headerFindSuccess = false; - } - }); - - if (!headerFindSuccess) { - columnMap = this.table.columnManager.columnsByIndex; - } - } - - //remove header row if found - if (headerFindSuccess) { - data.shift(); - } - - data.forEach(function (item) { - var row = {}; - - item.forEach(function (value, i) { - if (columnMap[i]) { - row[columnMap[i].field] = value; - } - }); - - rows.push(row); - }); - - return rows; - } else { - return false; - } - } - }; - - Clipboard.prototype.pasteActions = { - replace: function replace(rows) { - return this.table.setData(rows); - }, - update: function update(rows) { - return this.table.updateOrAddData(rows); - }, - insert: function insert(rows) { - return this.table.addData(rows); - } - }; - - Tabulator.prototype.registerModule("clipboard", Clipboard); - - var DataTree = function DataTree(table) { - this.table = table; - this.indent = 10; - this.field = ""; - this.collapseEl = null; - this.expandEl = null; - this.branchEl = null; - this.elementField = false; - - this.startOpen = function () {}; - - this.displayIndex = 0; - }; - - DataTree.prototype.initialize = function () { - var dummyEl = null, - firstCol = this.table.columnManager.getFirstVisibileColumn(), - options = this.table.options; - - this.field = options.dataTreeChildField; - this.indent = options.dataTreeChildIndent; - this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false); - - if (options.dataTreeBranchElement) { - - if (options.dataTreeBranchElement === true) { - this.branchEl = document.createElement("div"); - this.branchEl.classList.add("tabulator-data-tree-branch"); - } else { - if (typeof options.dataTreeBranchElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeBranchElement; - this.branchEl = dummyEl.firstChild; - } else { - this.branchEl = options.dataTreeBranchElement; - } - } - } - - if (options.dataTreeCollapseElement) { - if (typeof options.dataTreeCollapseElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeCollapseElement; - this.collapseEl = dummyEl.firstChild; - } else { - this.collapseEl = options.dataTreeCollapseElement; - } - } else { - this.collapseEl = document.createElement("div"); - this.collapseEl.classList.add("tabulator-data-tree-control"); - this.collapseEl.tabIndex = 0; - this.collapseEl.innerHTML = "
"; - } - - if (options.dataTreeExpandElement) { - if (typeof options.dataTreeExpandElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeExpandElement; - this.expandEl = dummyEl.firstChild; - } else { - this.expandEl = options.dataTreeExpandElement; - } - } else { - this.expandEl = document.createElement("div"); - this.expandEl.classList.add("tabulator-data-tree-control"); - this.expandEl.tabIndex = 0; - this.expandEl.innerHTML = "
"; - } - - switch (_typeof(options.dataTreeStartExpanded)) { - case "boolean": - this.startOpen = function (row, index) { - return options.dataTreeStartExpanded; - }; - break; - - case "function": - this.startOpen = options.dataTreeStartExpanded; - break; - - default: - this.startOpen = function (row, index) { - return options.dataTreeStartExpanded[index]; - }; - break; - } - }; - - DataTree.prototype.initializeRow = function (row) { - var childArray = row.getData()[this.field]; - var isArray = Array.isArray(childArray); - - var children = isArray || !isArray && (typeof childArray === 'undefined' ? 'undefined' : _typeof(childArray)) === "object" && childArray !== null; - - if (!children && row.modules.dataTree && row.modules.dataTree.branchEl) { - row.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl); - } - - if (!children && row.modules.dataTree && row.modules.dataTree.controlEl) { - row.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl); - } - - row.modules.dataTree = { - index: row.modules.dataTree ? row.modules.dataTree.index : 0, - open: children ? row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0) : false, - controlEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false, - branchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false, - parent: row.modules.dataTree ? row.modules.dataTree.parent : false, - children: children - }; - }; - - DataTree.prototype.layoutRow = function (row) { - var cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0], - el = cell.getElement(), - config = row.modules.dataTree; - - if (config.branchEl) { - if (config.branchEl.parentNode) { - config.branchEl.parentNode.removeChild(config.branchEl); - } - config.branchEl = false; - } - - if (config.controlEl) { - if (config.controlEl.parentNode) { - config.controlEl.parentNode.removeChild(config.controlEl); - } - config.controlEl = false; - } - - this.generateControlElement(row, el); - - row.element.classList.add("tabulator-tree-level-" + config.index); - - if (config.index) { - if (this.branchEl) { - config.branchEl = this.branchEl.cloneNode(true); - el.insertBefore(config.branchEl, el.firstChild); - config.branchEl.style.marginLeft = (config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1) + config.index * this.indent + "px"; - } else { - el.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + config.index * this.indent + "px"; - } - } - }; - - DataTree.prototype.generateControlElement = function (row, el) { - var _this38 = this; - - var config = row.modules.dataTree, - el = el || row.getCells()[0].getElement(), - oldControl = config.controlEl; - - if (config.children !== false) { - - if (config.open) { - config.controlEl = this.collapseEl.cloneNode(true); - config.controlEl.addEventListener("click", function (e) { - e.stopPropagation(); - _this38.collapseRow(row); - }); - } else { - config.controlEl = this.expandEl.cloneNode(true); - config.controlEl.addEventListener("click", function (e) { - e.stopPropagation(); - _this38.expandRow(row); - }); - } - - config.controlEl.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - - if (oldControl && oldControl.parentNode === el) { - oldControl.parentNode.replaceChild(config.controlEl, oldControl); - } else { - el.insertBefore(config.controlEl, el.firstChild); - } - } - }; - - DataTree.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - DataTree.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - DataTree.prototype.getRows = function (rows) { - var _this39 = this; - - var output = []; - - rows.forEach(function (row, i) { - var config, children; - - output.push(row); - - if (row instanceof Row) { - - config = row.modules.dataTree.children; - - if (!config.index && config.children !== false) { - children = _this39.getChildren(row); - - children.forEach(function (child) { - output.push(child); - }); - } - } - }); - - return output; - }; - - DataTree.prototype.getChildren = function (row) { - var _this40 = this; - - var config = row.modules.dataTree, - children = [], - output = []; - - if (config.children !== false && config.open) { - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - if (this.table.modExists("filter")) { - children = this.table.modules.filter.filter(config.children); - } else { - children = config.children; - } - - if (this.table.modExists("sort")) { - this.table.modules.sort.sort(children); - } - - children.forEach(function (child) { - output.push(child); - - var subChildren = _this40.getChildren(child); - - subChildren.forEach(function (sub) { - output.push(sub); - }); - }); - } - - return output; - }; - - DataTree.prototype.generateChildren = function (row) { - var _this41 = this; - - var children = []; - - var childArray = row.getData()[this.field]; - - if (!Array.isArray(childArray)) { - childArray = [childArray]; - } - - childArray.forEach(function (childData) { - var childRow = new Row(childData || {}, _this41.table.rowManager); - childRow.modules.dataTree.index = row.modules.dataTree.index + 1; - childRow.modules.dataTree.parent = row; - if (childRow.modules.dataTree.children) { - childRow.modules.dataTree.open = _this41.startOpen(childRow.getComponent(), childRow.modules.dataTree.index); - } - children.push(childRow); - }); - - return children; - }; - - DataTree.prototype.expandRow = function (row, silent) { - var config = row.modules.dataTree; - - if (config.children !== false) { - config.open = true; - - row.reinitialize(); - - this.table.rowManager.refreshActiveData("tree", false, true); - - this.table.options.dataTreeRowExpanded(row.getComponent(), row.modules.dataTree.index); - } - }; - - DataTree.prototype.collapseRow = function (row) { - var config = row.modules.dataTree; - - if (config.children !== false) { - config.open = false; - - row.reinitialize(); - - this.table.rowManager.refreshActiveData("tree", false, true); - - this.table.options.dataTreeRowCollapsed(row.getComponent(), row.modules.dataTree.index); - } - }; - - DataTree.prototype.toggleRow = function (row) { - var config = row.modules.dataTree; - - if (config.children !== false) { - if (config.open) { - this.collapseRow(row); - } else { - this.expandRow(row); - } - } - }; - - DataTree.prototype.getTreeParent = function (row) { - return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false; - }; - - DataTree.prototype.getFilteredTreeChildren = function (row) { - var config = row.modules.dataTree, - output = [], - children; - - if (config.children) { - - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - if (this.table.modExists("filter")) { - children = this.table.modules.filter.filter(config.children); - } else { - children = config.children; - } - - children.forEach(function (childRow) { - if (childRow instanceof Row) { - output.push(childRow); - } - }); - } - - return output; - }; - - DataTree.prototype.getTreeChildren = function (row) { - var config = row.modules.dataTree, - output = []; - - if (config.children) { - - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - config.children.forEach(function (childRow) { - if (childRow instanceof Row) { - output.push(childRow.getComponent()); - } - }); - } - - return output; - }; - - DataTree.prototype.checkForRestyle = function (cell) { - if (!cell.row.cells.indexOf(cell)) { - cell.row.reinitialize(); - } - }; - - DataTree.prototype.getChildField = function () { - return this.field; - }; - - DataTree.prototype.redrawNeeded = function (data) { - return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false); - }; - - Tabulator.prototype.registerModule("dataTree", DataTree); - - var Download = function Download(table) { - this.table = table; //hold Tabulator object - this.fields = {}; //hold filed multi dimension arrays - this.columnsByIndex = []; //hold columns in their order in the table - this.columnsByField = {}; //hold columns with lookup by field name - this.config = {}; - this.active = false; - }; - - //trigger file download - Download.prototype.download = function (type, filename, options, active, interceptCallback) { - var self = this, - downloadFunc = false; - this.processConfig(); - this.active = active; - - function buildLink(data, mime) { - if (interceptCallback) { - if (interceptCallback === true) { - self.triggerDownload(data, mime, type, filename, true); - } else { - interceptCallback(data); - } - } else { - self.triggerDownload(data, mime, type, filename); - } - } - - if (typeof type == "function") { - downloadFunc = type; - } else { - if (self.downloaders[type]) { - downloadFunc = self.downloaders[type]; - } else { - console.warn("Download Error - No such download type found: ", type); - } - } - - this.processColumns(); - - if (downloadFunc) { - downloadFunc.call(this, self.processDefinitions(), self.processData(active || "active"), options || {}, buildLink, this.config); - } - }; - - Download.prototype.processConfig = function () { - var config = { //download config - columnGroups: true, - rowGroups: true, - columnCalcs: true, - dataTree: true - }; - - if (this.table.options.downloadConfig) { - for (var key in this.table.options.downloadConfig) { - config[key] = this.table.options.downloadConfig[key]; - } - } - - this.config.rowGroups = config.rowGroups && this.table.options.groupBy && this.table.modExists("groupRows"); - - if (config.columnGroups && this.table.columnManager.columns.length != this.table.columnManager.columnsByIndex.length) { - this.config.columnGroups = true; - } - - if (config.columnCalcs && this.table.modExists("columnCalcs")) { - this.config.columnCalcs = true; - } - - if (config.dataTree && this.table.options.dataTree && this.table.modExists("dataTree")) { - this.config.dataTree = true; - } - }; - - Download.prototype.processColumns = function () { - var self = this; - - self.columnsByIndex = []; - self.columnsByField = {}; - - self.table.columnManager.columnsByIndex.forEach(function (column) { - - if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) { - self.columnsByIndex.push(column); - self.columnsByField[column.field] = column; - } - }); - }; - - Download.prototype.processDefinitions = function () { - var self = this, - processedDefinitions = []; - - if (this.config.columnGroups) { - self.table.columnManager.columns.forEach(function (column) { - var colData = self.processColumnGroup(column); - - if (colData) { - processedDefinitions.push(colData); - } - }); - } else { - self.columnsByIndex.forEach(function (column) { - if (column.download !== false) { - //isolate definiton from defintion object - processedDefinitions.push(self.processDefinition(column)); - } - }); - } - - return processedDefinitions; - }; - - Download.prototype.processColumnGroup = function (column) { - var _this42 = this; - - var subGroups = column.columns, - maxDepth = 0; - var processedColumn = this.processDefinition(column); - var groupData = { - type: "group", - title: processedColumn.title, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this42.processColumnGroup(subGroup); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) { - groupData.width = 1; - groupData.definition = processedColumn; - } else { - return false; - } - } - - return groupData; - }; - - Download.prototype.processDefinition = function (column) { - var def = {}; - - for (var key in column.definition) { - def[key] = column.definition[key]; - } - - if (typeof column.definition.downloadTitle != "undefined") { - def.title = column.definition.downloadTitle; - } - - return def; - }; - - Download.prototype.processData = function (active) { - var _this43 = this; - - var self = this, - data = [], - groups = [], - rows = false, - calcs = {}; - - if (this.config.rowGroups) { - - if (active == "visible") { - - rows = self.table.rowManager.getRows(active); - - rows.forEach(function (row) { - if (row.type == "row") { - var group = row.getGroup(); - - if (groups.indexOf(group) === -1) { - groups.push(group); - } - } - }); - } else { - groups = this.table.modules.groupRows.getGroups(); - } - - groups.forEach(function (group) { - data.push(_this43.processGroupData(group, rows)); - }); - } else { - if (this.config.dataTree) { - active = active = "active" ? "display" : active; - } - data = self.table.rowManager.getData(active, "download"); - } - - if (this.config.columnCalcs) { - calcs = this.table.getCalcResults(); - - data = { - calcs: calcs, - data: data - }; - } - - //bulk data processing - if (typeof self.table.options.downloadDataFormatter == "function") { - data = self.table.options.downloadDataFormatter(data); - } - - return data; - }; - - Download.prototype.processGroupData = function (group, visRows) { - var _this44 = this; - - var subGroups = group.getSubGroups(); - - var groupData = { - type: "group", - key: group.key - }; - - if (subGroups.length) { - groupData.subGroups = []; - - subGroups.forEach(function (subGroup) { - groupData.subGroups.push(_this44.processGroupData(subGroup, visRows)); - }); - } else { - if (visRows) { - groupData.rows = []; - - group.rows.forEach(function (row) { - if (visRows.indexOf(row) > -1) { - groupData.rows.push(row.getData("download")); - } - }); - } else { - groupData.rows = group.getData(true, "download"); - } - } - - return groupData; - }; - - Download.prototype.triggerDownload = function (data, mime, type, filename, newTab) { - var element = document.createElement('a'), - blob = new Blob([data], { type: mime }), - filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type); - - blob = this.table.options.downloadReady.call(this.table, data, blob); - - if (blob) { - - if (newTab) { - window.open(window.URL.createObjectURL(blob)); - } else { - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveOrOpenBlob(blob, filename); - } else { - element.setAttribute('href', window.URL.createObjectURL(blob)); - - //set file title - element.setAttribute('download', filename); - - //trigger download - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - - //remove temporary link element - document.body.removeChild(element); - } - } - - if (this.table.options.downloadComplete) { - this.table.options.downloadComplete(); - } - } - }; - - //nested field lookup - Download.prototype.getFieldValue = function (field, data) { - var column = this.columnsByField[field]; - - if (column) { - return column.getFieldValue(data); - } - - return false; - }; - - Download.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "intercept": - this.download(data.type, "", data.options, data.active, data.intercept); - break; - } - }; - - //downloaders - Download.prototype.downloaders = { - csv: function csv(columns, data, options, setFileContents, config) { - var self = this, - titles = [], - fields = [], - delimiter = options && options.delimiter ? options.delimiter : ",", - fileContents, - output; - - //build column headers - function parseSimpleTitles() { - columns.forEach(function (column) { - titles.push('"' + String(column.title).split('"').join('""') + '"'); - fields.push(column.field); - }); - } - - function parseColumnGroup(column, level) { - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } else { - titles.push('"' + String(column.title).split('"').join('""') + '"'); - fields.push(column.definition.field); - } - } - - if (config.columnGroups) { - console.warn("Download Warning - CSV downloader cannot process column groups"); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - } else { - parseSimpleTitles(); - } - - //generate header row - fileContents = [titles.join(delimiter)]; - - function parseRows(data) { - //generate each row of the table - data.forEach(function (row) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - - //escape quotation marks - rowData.push('"' + String(value).split('"').join('""') + '"'); - }); - - fileContents.push(rowData.join(delimiter)); - }); - } - - function parseGroup(group) { - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup); - }); - } else { - parseRows(group.rows); - } - } - - if (config.columnCalcs) { - console.warn("Download Warning - CSV downloader cannot process column calculations"); - data = data.data; - } - - if (config.rowGroups) { - console.warn("Download Warning - CSV downloader cannot process row groups"); - - data.forEach(function (group) { - parseGroup(group); - }); - } else { - parseRows(data); - } - - output = fileContents.join("\n"); - - if (options.bom) { - output = '\uFEFF' + output; - } - - setFileContents(output, "text/csv"); - }, - - json: function json(columns, data, options, setFileContents, config) { - var fileContents; - - if (config.columnCalcs) { - console.warn("Download Warning - CSV downloader cannot process column calculations"); - data = data.data; - } - - fileContents = JSON.stringify(data, null, '\t'); - - setFileContents(fileContents, "application/json"); - }, - - pdf: function pdf(columns, data, options, setFileContents, config) { - var self = this, - fields = [], - header = [], - body = [], - calcs = {}, - headerDepth = 1, - table = "", - autoTableParams = {}, - rowGroupStyles = options.rowGroupStyles || { - fontStyle: "bold", - fontSize: 12, - cellPadding: 6, - fillColor: 220 - }, - rowCalcStyles = options.rowCalcStyles || { - fontStyle: "bold", - fontSize: 10, - cellPadding: 4, - fillColor: 232 - }, - jsPDFParams = options.jsPDF || {}, - title = options && options.title ? options.title : ""; - - if (config.columnCalcs) { - calcs = data.calcs; - data = data.data; - } - - if (!jsPDFParams.orientation) { - jsPDFParams.orientation = options.orientation || "landscape"; - } - - if (!jsPDFParams.unit) { - jsPDFParams.unit = "pt"; - } - - //build column headers - function parseSimpleTitles() { - columns.forEach(function (column) { - if (column.field) { - header.push(column.title || ""); - fields.push(column.field); - } - }); - - header = [header]; - } - - function parseColumnGroup(column, level) { - var colSpan = column.width, - rowSpan = 1, - col = { - content: column.title || "" - }; - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - rowSpan = 1; - } else { - fields.push(column.definition.field); - rowSpan = headerDepth - level; - } - - col.rowSpan = rowSpan; - // col.colSpan = colSpan; - - header[level].push(col); - - colSpan--; - - if (rowSpan > 1) { - for (var i = level + 1; i < headerDepth; i++) { - header[i].push(""); - } - } - - for (var i = 0; i < colSpan; i++) { - header[level].push(""); - } - } - - if (config.columnGroups) { - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - for (var i = 0; i < headerDepth; i++) { - header.push([]); - } - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - } else { - parseSimpleTitles(); - } - - function parseValue(value) { - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - - return value; - } - - function parseRows(data) { - //build table rows - data.forEach(function (row) { - body.push(parseRow(row)); - }); - } - - function parseRow(row, styles) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - value = parseValue(value); - - if (styles) { - rowData.push({ - content: value, - styles: styles - }); - } else { - rowData.push(value); - } - }); - - return rowData; - } - - function parseGroup(group, calcObj) { - var groupData = []; - - groupData.push({ content: parseValue(group.key), colSpan: fields.length, styles: rowGroupStyles }); - - body.push(groupData); - - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {}); - }); - } else { - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "top"); - } - - parseRows(group.rows); - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "bottom"); - } - } - } - - function addCalcRow(calcs, selector, pos) { - var calcData = calcs[selector]; - - if (calcData) { - if (pos) { - calcData = calcData[pos]; - } - - if (Object.keys(calcData).length) { - body.push(parseRow(calcData, rowCalcStyles)); - } - } - } - - if (config.rowGroups) { - data.forEach(function (group) { - parseGroup(group, calcs); - }); - } else { - if (config.columnCalcs) { - addCalcRow(calcs, "top"); - } - - parseRows(data); - - if (config.columnCalcs) { - addCalcRow(calcs, "bottom"); - } - } - - var doc = new jsPDF(jsPDFParams); //set document to landscape, better for most tables - - if (options && options.autoTable) { - if (typeof options.autoTable === "function") { - autoTableParams = options.autoTable(doc) || {}; - } else { - autoTableParams = options.autoTable; - } - } - - if (title) { - autoTableParams.addPageContent = function (data) { - doc.text(title, 40, 30); - }; - } - - autoTableParams.head = header; - autoTableParams.body = body; - - doc.autoTable(autoTableParams); - - if (options && options.documentProcessing) { - options.documentProcessing(doc); - } - - setFileContents(doc.output("arraybuffer"), "application/pdf"); - }, - - xlsx: function xlsx(columns, data, options, setFileContents, config) { - var self = this, - sheetName = options.sheetName || "Sheet1", - workbook = XLSX.utils.book_new(), - calcs = {}, - groupRowIndexs = [], - groupColumnIndexs = [], - calcRowIndexs = [], - output; - - workbook.SheetNames = []; - workbook.Sheets = {}; - - if (config.columnCalcs) { - calcs = data.calcs; - data = data.data; - } - - function generateSheet() { - var titles = [], - fields = [], - rows = [], - worksheet; - - //convert rows to worksheet - function rowsToSheet() { - var sheet = {}; - var range = { s: { c: 0, r: 0 }, e: { c: fields.length, r: rows.length } }; - - XLSX.utils.sheet_add_aoa(sheet, rows); - - sheet['!ref'] = XLSX.utils.encode_range(range); - - var merges = generateMerges(); - - if (merges.length) { - sheet["!merges"] = merges; - } - - return sheet; - } - - function parseSimpleTitles() { - //get field lists - columns.forEach(function (column) { - titles.push(column.title); - fields.push(column.field); - }); - - rows.push(titles); - } - - function parseColumnGroup(column, level) { - - if (typeof titles[level] === "undefined") { - titles[level] = []; - } - - if (typeof groupColumnIndexs[level] === "undefined") { - groupColumnIndexs[level] = []; - } - - if (column.width > 1) { - - groupColumnIndexs[level].push({ - type: "hoz", - start: titles[level].length, - end: titles[level].length + column.width - 1 - }); - } - - titles[level].push(column.title); - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } else { - fields.push(column.definition.field); - padColumnTitles(fields.length - 1, level); - - groupColumnIndexs[level].push({ - type: "vert", - start: fields.length - 1 - }); - } - } - - function padColumnTitles() { - var max = 0; - - titles.forEach(function (title) { - var len = title.length; - if (len > max) { - max = len; - } - }); - - titles.forEach(function (title) { - var len = title.length; - if (len < max) { - for (var i = len; i < max; i++) { - title.push(""); - } - } - }); - } - - if (config.columnGroups) { - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - titles.forEach(function (title) { - rows.push(title); - }); - } else { - parseSimpleTitles(); - } - - function generateMerges() { - var output = []; - - groupRowIndexs.forEach(function (index) { - output.push({ s: { r: index, c: 0 }, e: { r: index, c: fields.length - 1 } }); - }); - - groupColumnIndexs.forEach(function (merges, level) { - merges.forEach(function (merge) { - if (merge.type === "hoz") { - output.push({ s: { r: level, c: merge.start }, e: { r: level, c: merge.end } }); - } else { - if (level != titles.length - 1) { - output.push({ s: { r: level, c: merge.start }, e: { r: titles.length - 1, c: merge.start } }); - } - } - }); - }); - - return output; - } - - //generate each row of the table - function parseRows(data) { - data.forEach(function (row) { - rows.push(parseRow(row)); - }); - } - - function parseRow(row) { - var rowData = []; - - fields.forEach(function (field) { - var value = self.getFieldValue(field, row); - rowData.push(!(value instanceof Date) && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === "object" ? JSON.stringify(value) : value); - }); - - return rowData; - } - - function addCalcRow(calcs, selector, pos) { - var calcData = calcs[selector]; - - if (calcData) { - if (pos) { - calcData = calcData[pos]; - } - - if (Object.keys(calcData).length) { - calcRowIndexs.push(rows.length); - rows.push(parseRow(calcData)); - } - } - } - - function parseGroup(group, calcObj) { - var groupData = []; - - groupData.push(group.key); - - groupRowIndexs.push(rows.length); - - rows.push(groupData); - - if (group.subGroups) { - group.subGroups.forEach(function (subGroup) { - parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {}); - }); - } else { - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "top"); - } - - parseRows(group.rows); - - if (config.columnCalcs) { - addCalcRow(calcObj, group.key, "bottom"); - } - } - } - - if (config.rowGroups) { - data.forEach(function (group) { - parseGroup(group, calcs); - }); - } else { - if (config.columnCalcs) { - addCalcRow(calcs, "top"); - } - - parseRows(data); - - if (config.columnCalcs) { - addCalcRow(calcs, "bottom"); - } - } - - worksheet = rowsToSheet(); - - return worksheet; - } - - if (options.sheetOnly) { - setFileContents(generateSheet()); - return; - } - - if (options.sheets) { - for (var sheet in options.sheets) { - - if (options.sheets[sheet] === true) { - workbook.SheetNames.push(sheet); - workbook.Sheets[sheet] = generateSheet(); - } else { - - workbook.SheetNames.push(sheet); - - this.table.modules.comms.send(options.sheets[sheet], "download", "intercept", { - type: "xlsx", - options: { sheetOnly: true }, - active: self.active, - intercept: function intercept(data) { - workbook.Sheets[sheet] = data; - } - }); - } - } - } else { - workbook.SheetNames.push(sheetName); - workbook.Sheets[sheetName] = generateSheet(); - } - - if (options.documentProcessing) { - workbook = options.documentProcessing(workbook); - } - - //convert workbook to binary array - function s2ab(s) { - var buf = new ArrayBuffer(s.length); - var view = new Uint8Array(buf); - for (var i = 0; i != s.length; ++i) { - view[i] = s.charCodeAt(i) & 0xFF; - }return buf; - } - - output = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'binary' }); - - setFileContents(s2ab(output), "application/octet-stream"); - }, - - html: function html(columns, data, options, setFileContents, config) { - if (this.table.modExists("export", true)) { - setFileContents(this.table.modules.export.getHtml(true, options.style, config), "text/html"); - } - } - - }; - - Tabulator.prototype.registerModule("download", Download); - - var Edit = function Edit(table) { - this.table = table; //hold Tabulator object - this.currentCell = false; //hold currently editing cell - this.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening - this.recursionBlock = false; //prevent focus recursion - this.invalidEdit = false; - }; - - //initialize column editor - Edit.prototype.initializeColumn = function (column) { - var self = this, - config = { - editor: false, - blocked: false, - check: column.definition.editable, - params: column.definition.editorParams || {} - }; - - //set column editor - switch (_typeof(column.definition.editor)) { - case "string": - - if (column.definition.editor === "tick") { - column.definition.editor = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.editor]) { - config.editor = self.editors[column.definition.editor]; - } else { - console.warn("Editor Error - No such editor found: ", column.definition.editor); - } - break; - - case "function": - config.editor = column.definition.editor; - break; - - case "boolean": - - if (column.definition.editor === true) { - - if (typeof column.definition.formatter !== "function") { - - if (column.definition.formatter === "tick") { - column.definition.formatter = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.formatter]) { - config.editor = self.editors[column.definition.formatter]; - } else { - config.editor = self.editors["input"]; - } - } else { - console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ", column.definition.formatter); - } - } - break; - } - - if (config.editor) { - column.modules.edit = config; - } - }; - - Edit.prototype.getCurrentCell = function () { - return this.currentCell ? this.currentCell.getComponent() : false; - }; - - Edit.prototype.clearEditor = function () { - var cell = this.currentCell, - cellEl; - - this.invalidEdit = false; - - if (cell) { - this.currentCell = false; - - cellEl = cell.getElement(); - cellEl.classList.remove("tabulator-validation-fail"); - cellEl.classList.remove("tabulator-editing"); - while (cellEl.firstChild) { - cellEl.removeChild(cellEl.firstChild); - }cell.row.getElement().classList.remove("tabulator-row-editing"); - } - }; - - Edit.prototype.cancelEdit = function () { - - if (this.currentCell) { - var cell = this.currentCell; - var component = this.currentCell.getComponent(); - - this.clearEditor(); - cell.setValueActual(cell.getValue()); - cell.cellRendered(); - - if (cell.column.cellEvents.cellEditCancelled) { - cell.column.cellEvents.cellEditCancelled.call(this.table, component); - } - - this.table.options.cellEditCancelled.call(this.table, component); - } - }; - - //return a formatted value for a cell - Edit.prototype.bindEditor = function (cell) { - var self = this, - element = cell.getElement(); - - element.setAttribute("tabindex", 0); - - element.addEventListener("click", function (e) { - if (!element.classList.contains("tabulator-editing")) { - element.focus({ preventScroll: true }); - } - }); - - element.addEventListener("mousedown", function (e) { - self.mouseClick = true; - }); - - element.addEventListener("focus", function (e) { - if (!self.recursionBlock) { - self.edit(cell, e, false); - } - }); - }; - - Edit.prototype.focusCellNoEvent = function (cell, block) { - this.recursionBlock = true; - if (!(block && this.table.browser === "ie")) { - cell.getElement().focus({ preventScroll: true }); - } - this.recursionBlock = false; - }; - - Edit.prototype.editCell = function (cell, forceEdit) { - this.focusCellNoEvent(cell); - this.edit(cell, false, forceEdit); - }; - - Edit.prototype.focusScrollAdjust = function (cell) { - if (this.table.rowManager.getRenderMode() == "virtual") { - var topEdge = this.table.rowManager.element.scrollTop, - bottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop, - rowEl = cell.row.getElement(), - offset = rowEl.offsetTop; - - if (rowEl.offsetTop < topEdge) { - this.table.rowManager.element.scrollTop -= topEdge - rowEl.offsetTop; - } else { - if (rowEl.offsetTop + rowEl.offsetHeight > bottomEdge) { - this.table.rowManager.element.scrollTop += rowEl.offsetTop + rowEl.offsetHeight - bottomEdge; - } - } - } - }; - - Edit.prototype.edit = function (cell, e, forceEdit) { - var self = this, - allowEdit = true, - rendered = function rendered() {}, - element = cell.getElement(), - cellEditor, - component, - params; - - //prevent editing if another cell is refusing to leave focus (eg. validation fail) - if (this.currentCell) { - if (!this.invalidEdit) { - this.cancelEdit(); - } - return; - } - - //handle successfull value change - function success(value) { - if (self.currentCell === cell) { - var valid = true; - - if (cell.column.modules.validate && self.table.modExists("validate")) { - valid = self.table.modules.validate.validate(cell.column.modules.validate, cell.getComponent(), value); - } - - if (valid === true) { - self.clearEditor(); - cell.setValue(value, true); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - - return true; - } else { - self.invalidEdit = true; - element.classList.add("tabulator-validation-fail"); - self.focusCellNoEvent(cell, true); - rendered(); - self.table.options.validationFailed.call(self.table, cell.getComponent(), value, valid); - - return false; - } - } else { - // console.warn("Edit Success Error - cannot call success on a cell that is no longer being edited"); - } - } - - //handle aborted edit - function cancel() { - if (self.currentCell === cell) { - self.cancelEdit(); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - } else { - // console.warn("Edit Success Error - cannot call cancel on a cell that is no longer being edited"); - } - } - - function onRendered(callback) { - rendered = callback; - } - - if (!cell.column.modules.edit.blocked) { - if (e) { - e.stopPropagation(); - } - - switch (_typeof(cell.column.modules.edit.check)) { - case "function": - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - break; - - case "boolean": - allowEdit = cell.column.modules.edit.check; - break; - } - - if (allowEdit || forceEdit) { - - self.cancelEdit(); - - self.currentCell = cell; - - this.focusScrollAdjust(cell); - - component = cell.getComponent(); - - if (this.mouseClick) { - this.mouseClick = false; - - if (cell.column.cellEvents.cellClick) { - cell.column.cellEvents.cellClick.call(this.table, e, component); - } - } - - if (cell.column.cellEvents.cellEditing) { - cell.column.cellEvents.cellEditing.call(this.table, component); - } - - self.table.options.cellEditing.call(this.table, component); - - params = typeof cell.column.modules.edit.params === "function" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params; - - cellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params); - - //if editor returned, add to DOM, if false, abort edit - if (cellEditor !== false) { - - if (cellEditor instanceof Node) { - element.classList.add("tabulator-editing"); - cell.row.getElement().classList.add("tabulator-row-editing"); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.appendChild(cellEditor); - - //trigger onRendered Callback - rendered(); - - //prevent editing from triggering rowClick event - var children = element.children; - - for (var i = 0; i < children.length; i++) { - children[i].addEventListener("click", function (e) { - e.stopPropagation(); - }); - } - } else { - console.warn("Edit Error - Editor should return an instance of Node, the editor returned:", cellEditor); - element.blur(); - return false; - } - } else { - element.blur(); - return false; - } - - return true; - } else { - this.mouseClick = false; - element.blur(); - return false; - } - } else { - this.mouseClick = false; - element.blur(); - return false; - } - }; - - Edit.prototype.maskInput = function (el, options) { - var mask = options.mask, - maskLetter = typeof options.maskLetterChar !== "undefined" ? options.maskLetterChar : "A", - maskNumber = typeof options.maskNumberChar !== "undefined" ? options.maskNumberChar : "9", - maskWildcard = typeof options.maskWildcardChar !== "undefined" ? options.maskWildcardChar : "*", - success = false; - - function fillSymbols(index) { - var symbol = mask[index]; - if (typeof symbol !== "undefined" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber) { - el.value = el.value + "" + symbol; - fillSymbols(index + 1); - } - } - - el.addEventListener("keydown", function (e) { - var index = el.value.length, - char = e.key; - - if (e.keyCode > 46) { - if (index >= mask.length) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } else { - switch (mask[index]) { - case maskLetter: - if (char.toUpperCase() == char.toLowerCase()) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskNumber: - if (isNaN(char)) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskWildcard: - break; - - default: - if (char !== mask[index]) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - } - } - - success = true; - } - - return; - }); - - el.addEventListener("keyup", function (e) { - if (e.keyCode > 46) { - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - } - }); - - if (!el.placeholder) { - el.placeholder = mask; - } - - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - }; - - //default data editors - Edit.prototype.editors = { - - //input element - input: function input(cell, onRendered, success, cancel, editorParams) { - - //create and style input - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", editorParams.search ? "search" : "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof cellValue !== "undefined" ? cellValue : ""; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - // case 9: - case 13: - onChange(e); - break; - - case 27: - cancel(); - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //resizable text area element - textarea: function textarea(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "hybrid", - value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""), - count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1, - input = document.createElement("textarea"), - scrollHeight = 0; - - //create and style input - input.style.display = "block"; - input.style.padding = "2px"; - input.style.height = "100%"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.whiteSpace = "pre-wrap"; - input.style.resize = "none"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - - setTimeout(function () { - cell.getRow().normalizeHeight(); - }, 300); - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - input.addEventListener("keyup", function () { - - input.style.height = ""; - - var heightNow = input.scrollHeight; - - input.style.height = heightNow + "px"; - - if (heightNow != scrollHeight) { - scrollHeight = heightNow; - cell.getRow().normalizeHeight(); - } - }); - - input.addEventListener("keydown", function (e) { - - switch (e.keyCode) { - case 27: - cancel(); - break; - - case 38: - //up arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - - break; - - case 40: - //down arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart !== input.value.length) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - number: function number(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - input = document.createElement("input"); - - input.setAttribute("type", "number"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - var blurFunc = function blurFunc(e) { - onChange(); - }; - - onRendered(function () { - //submit new value on blur - input.removeEventListener("blur", blurFunc); - - input.focus({ preventScroll: true }); - input.style.height = "100%"; - - //submit new value on blur - input.addEventListener("blur", blurFunc); - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value !== cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - - case 38: //up arrow - case 40: - //down arrow - if (vertNav == "editor") { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - range: function range(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", "range"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value != cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur - input.addEventListener("blur", function (e) { - onChange(); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - case 9: - onChange(); - break; - - case 27: - cancel(); - break; - } - }); - - return input; - }, - - //select - select: function select(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - dataItems = [], - displayItems = [], - currentItem = {}, - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - if (Array.isArray(editorParams) || !Array.isArray(editorParams) && (typeof editorParams === 'undefined' ? 'undefined' : _typeof(editorParams)) === "object" && !editorParams.values) { - console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); - editorParams = { values: editorParams }; - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create select lookup list:", field); - } - - return output; - } - - function parseItems(inputValues, curentValue) { - var dataList = []; - var displayList = []; - - function processComplexListItem(item) { - var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label) : item.label, - value: item.value, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - - return item; - } - - if (typeof inputValues == "function") { - inputValues = inputValues(cell); - } - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item; - - if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === "object") { - - if (value.options) { - item = { - label: value.label, - group: true, - element: false - }; - - displayList.push(item); - - value.options.forEach(function (item) { - processComplexListItem(item); - }); - } else { - processComplexListItem(value); - } - } else { - - item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, - value: value, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - } - }); - } else { - for (var key in inputValues) { - var item = { - label: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key, - element: false - }; - - if (item.value === curentValue || !isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue)) { - setCurrentItem(item); - } - - dataList.push(item); - displayList.push(item); - } - } - - dataItems = dataList; - displayItems = displayList; - - fillList(); - } - - function fillList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - - if (item.group) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-group"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - } else { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - - el.addEventListener("click", function () { - setCurrentItem(item); - chooseItem(); - }); - - if (item === currentItem) { - el.classList.add("active"); - } - } - - el.addEventListener("mousedown", function () { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - } - - listEl.appendChild(el); - }); - } - - function setCurrentItem(item) { - - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - input.value = item.label === " " ? "" : item.label; - - if (item.element) { - item.element.classList.add("active"); - } - } - - function chooseItem() { - hideList(); - - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - success(currentItem.value); - } else { - cancel(); - } - } - - function cancelItem() { - hideList(); - cancel(); - } - - function showList() { - if (!listEl.parentNode) { - - if (editorParams.values === true) { - parseItems(getUniqueColumnValues(), initialDisplayValue); - } else if (typeof editorParams.values === "string") { - parseItems(getUniqueColumnValues(editorParams.values), initialDisplayValue); - } else { - parseItems(editorParams.values || [], initialDisplayValue); - } - - var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - document.body.appendChild(listEl); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //style input - input.setAttribute("type", "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.cursor = "default"; - input.readOnly = this.currentCell != false; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof initialValue !== "undefined" || initialValue === null ? initialValue : ""; - - // if(editorParams.values === true){ - // parseItems(getUniqueColumnValues(), initialValue); - // }else if(typeof editorParams.values === "string"){ - // parseItems(getUniqueColumnValues(editorParams.values), initialValue); - // }else{ - // parseItems(editorParams.values || [], initialValue); - // } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(dataItems[index - 1]); - } - } - break; - - case 40: - //down arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < dataItems.length - 1) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < dataItems.length - 1) { - if (index == -1) { - setCurrentItem(dataItems[0]); - } else { - setCurrentItem(dataItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - } - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - cancelItem(); - } - }); - - input.addEventListener("focus", function (e) { - showList(); - }); - - //style list element - listEl = document.createElement("div"); - listEl.classList.add("tabulator-edit-select-list"); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - return input; - }, - - //autocomplete - autocomplete: function autocomplete(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - allItems = [], - displayItems = [], - values = [], - currentItem = false, - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - //style input - input.setAttribute("type", "search"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style list element - listEl.classList.add("tabulator-edit-select-list"); - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create autocomplete lookup list:", field); - } - - return output; - } - - function filterList(term, intialLoad) { - var matches = [], - values, - items, - searchEl; - - //lookup base values list - if (editorParams.values === true) { - values = getUniqueColumnValues(); - } else if (typeof editorParams.values === "string") { - values = getUniqueColumnValues(editorParams.values); - } else { - values = editorParams.values || []; - } - - if (editorParams.searchFunc) { - matches = editorParams.searchFunc(term, values); - - if (matches instanceof Promise) { - - addNotice(typeof editorParams.searchingPlaceholder !== "undefined" ? editorParams.searchingPlaceholder : "Searching..."); - - matches.then(function (result) { - fillListIfNotEmpty(parseItems(result), intialLoad); - }).catch(function (err) { - console.err("error in autocomplete search promise:", err); - }); - } else { - fillListIfNotEmpty(parseItems(matches), intialLoad); - } - } else { - items = parseItems(values); - - if (term === "") { - if (editorParams.showListOnEmpty) { - matches = items; - } - } else { - items.forEach(function (item) { - if (item.value !== null || typeof item.value !== "undefined") { - if (String(item.value).toLowerCase().indexOf(String(term).toLowerCase()) > -1 || String(item.title).toLowerCase().indexOf(String(term).toLowerCase()) > -1) { - matches.push(item); - } - } - }); - } - - fillListIfNotEmpty(matches, intialLoad); - } - } - - function addNotice(notice) { - var searchEl = document.createElement("div"); - - clearList(); - - if (notice !== false) { - searchEl.classList.add("tabulator-edit-select-list-notice"); - searchEl.tabIndex = 0; - - if (notice instanceof Node) { - searchEl.appendChild(notice); - } else { - searchEl.innerHTML = notice; - } - - listEl.appendChild(searchEl); - } - } - - function parseItems(inputValues) { - var itemList = []; - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value, - value: value - }; - - itemList.push(item); - }); - } else { - for (var key in inputValues) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key - }; - - itemList.push(item); - } - } - - return itemList; - } - - function clearList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - } - } - - function fillListIfNotEmpty(items, intialLoad) { - if (items.length) { - fillList(items, intialLoad); - } else { - if (editorParams.emptyPlaceholder) { - addNotice(editorParams.emptyPlaceholder); - } - } - } - - function fillList(items, intialLoad) { - var current = false; - - clearList(); - - displayItems = items; - - displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.title; - - el.addEventListener("click", function (e) { - setCurrentItem(item); - chooseItem(); - }); - - el.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - - if (intialLoad && item.value == initialValue) { - input.value = item.title; - item.element.classList.add("active"); - current = true; - } - - if (item === currentItem) { - item.element.classList.add("active"); - current = true; - } - } - - listEl.appendChild(el); - }); - - if (!current) { - setCurrentItem(false); - } - } - - function chooseItem() { - hideList(); - - if (currentItem) { - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - input.value = currentItem.title; - success(currentItem.value); - } else { - cancel(); - } - } else { - if (editorParams.freetext) { - initialValue = input.value; - success(input.value); - } else { - if (editorParams.allowEmpty && input.value === "") { - initialValue = input.value; - success(input.value); - } else { - cancel(); - } - } - } - } - - function showList() { - if (!listEl.parentNode) { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - document.body.appendChild(listEl); - } - } - - function setCurrentItem(item, showInputValue) { - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - - if (item && item.element) { - item.element.classList.add("active"); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(displayItems[index - 1]); - } else { - setCurrentItem(false); - } - } - break; - - case 40: - //down arrow - - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < displayItems.length - 1) { - - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < displayItems.length - 1) { - if (index == -1) { - setCurrentItem(displayItems[0]); - } else { - setCurrentItem(displayItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - - case 36: //home - case 35: - //end - //prevent table navigation while using input element - e.stopImmediatePropagation(); - break; - } - }); - - input.addEventListener("keyup", function (e) { - - switch (e.keyCode) { - case 38: //up arrow - case 37: //left arrow - case 39: //up arrow - case 40: //right arrow - case 13: //enter - case 27: - //escape - break; - - default: - filterList(input.value); - } - }); - - input.addEventListener("search", function (e) { - filterList(input.value); - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - chooseItem(); - } - }); - - input.addEventListener("focus", function (e) { - var value = initialDisplayValue; - showList(); - input.value = value; - filterList(value, true); - }); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //start rating - star: function star(cell, onRendered, success, cancel, editorParams) { - var self = this, - element = cell.getElement(), - value = cell.getValue(), - maxStars = element.getElementsByTagName("svg").length || 5, - size = element.getElementsByTagName("svg")[0] ? element.getElementsByTagName("svg")[0].getAttribute("width") : 14, - stars = [], - starsHolder = document.createElement("div"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"); - - //change star type - function starChange(val) { - stars.forEach(function (star, i) { - if (i < val) { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-active"); - } else { - star.classList.replace("tabulator-star-inactive", "tabulator-star-active"); - } - - star.innerHTML = ''; - } else { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-inactive"); - } else { - star.classList.replace("tabulator-star-active", "tabulator-star-inactive"); - } - - star.innerHTML = ''; - } - }); - } - - //build stars - function buildStar(i) { - - var starHolder = document.createElement("span"); - var nextStar = star.cloneNode(true); - - stars.push(nextStar); - - starHolder.addEventListener("mouseenter", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - starChange(i); - }); - - starHolder.addEventListener("mousemove", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - }); - - starHolder.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - success(i); - }); - - starHolder.appendChild(nextStar); - starsHolder.appendChild(starHolder); - } - - //handle keyboard navigation value change - function changeValue(val) { - value = val; - starChange(val); - } - - //style cell - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - //style holding element - starsHolder.style.verticalAlign = "middle"; - starsHolder.style.display = "inline-block"; - starsHolder.style.padding = "4px"; - - //style star - star.setAttribute("width", size); - star.setAttribute("height", size); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - starsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - starsHolder.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //create correct number of stars - for (var i = 1; i <= maxStars; i++) { - buildStar(i); - } - - //ensure value does not exceed number of stars - value = Math.min(parseInt(value), maxStars); - - // set initial styling of stars - starChange(value); - - starsHolder.addEventListener("mousemove", function (e) { - starChange(0); - }); - - starsHolder.addEventListener("click", function (e) { - success(0); - }); - - element.addEventListener("blur", function (e) { - cancel(); - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - changeValue(value + 1); - break; - - case 37: - //left arrow - changeValue(value - 1); - break; - - case 13: - //enter - success(value); - break; - - case 27: - //escape - cancel(); - break; - } - }); - - return starsHolder; - }, - - //draggable progress bar - progress: function progress(cell, onRendered, success, cancel, editorParams) { - var element = cell.getElement(), - max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max, - min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min, - percent = (max - min) / 100, - value = cell.getValue() || 0, - handle = document.createElement("div"), - bar = document.createElement("div"), - mouseDrag, - mouseDragWidth; - - //set new value - function updateValue() { - var calcVal = percent * Math.round(bar.offsetWidth / (element.clientWidth / 100)) + min; - success(calcVal); - element.setAttribute("aria-valuenow", calcVal); - element.setAttribute("aria-label", value); - } - - //style handle - handle.style.position = "absolute"; - handle.style.right = "0"; - handle.style.top = "0"; - handle.style.bottom = "0"; - handle.style.width = "5px"; - handle.classList.add("tabulator-progress-handle"); - - //style bar - bar.style.display = "inline-block"; - bar.style.position = "relative"; - // bar.style.top = "8px"; - // bar.style.bottom = "8px"; - // bar.style.left = "4px"; - // bar.style.marginRight = "4px"; - bar.style.height = "100%"; - bar.style.backgroundColor = "#488CE9"; - bar.style.maxWidth = "100%"; - bar.style.minWidth = "0%"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - bar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - bar.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style cell - element.style.padding = "4px 4px"; - - //make sure value is in range - value = Math.min(parseFloat(value), max); - value = Math.max(parseFloat(value), min); - - //workout percentage - value = Math.round((value - min) / percent); - // bar.style.right = value + "%"; - bar.style.width = value + "%"; - - element.setAttribute("aria-valuemin", min); - element.setAttribute("aria-valuemax", max); - - bar.appendChild(handle); - - handle.addEventListener("mousedown", function (e) { - mouseDrag = e.screenX; - mouseDragWidth = bar.offsetWidth; - }); - - handle.addEventListener("mouseover", function () { - handle.style.cursor = "ew-resize"; - }); - - element.addEventListener("mousemove", function (e) { - if (mouseDrag) { - bar.style.width = mouseDragWidth + e.screenX - mouseDrag + "px"; - } - }); - - element.addEventListener("mouseup", function (e) { - if (mouseDrag) { - e.stopPropagation(); - e.stopImmediatePropagation(); - - mouseDrag = false; - mouseDragWidth = false; - - updateValue(); - } - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - e.preventDefault(); - bar.style.width = bar.clientWidth + element.clientWidth / 100 + "px"; - break; - - case 37: - //left arrow - e.preventDefault(); - bar.style.width = bar.clientWidth - element.clientWidth / 100 + "px"; - break; - - case 9: //tab - case 13: - //enter - updateValue(); - break; - - case 27: - //escape - cancel(); - break; - - } - }); - - element.addEventListener("blur", function () { - cancel(); - }); - - return bar; - }, - - //checkbox - tickCross: function tickCross(cell, onRendered, success, cancel, editorParams) { - var value = cell.getValue(), - input = document.createElement("input"), - tristate = editorParams.tristate, - indetermValue = typeof editorParams.indeterminateValue === "undefined" ? null : editorParams.indeterminateValue, - indetermState = false; - - input.setAttribute("type", "checkbox"); - input.style.marginTop = "5px"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - if (tristate && (typeof value === "undefined" || value === indetermValue || value === "")) { - indetermState = true; - input.indeterminate = true; - } - - if (this.table.browser != "firefox") { - //prevent blur issue on mac firefox - onRendered(function () { - input.focus({ preventScroll: true }); - }); - } - - input.checked = value === true || value === "true" || value === "True" || value === 1; - - function setValue(blur) { - if (tristate) { - if (!blur) { - if (input.checked && !indetermState) { - input.checked = false; - input.indeterminate = true; - indetermState = true; - return indetermValue; - } else { - indetermState = false; - return input.checked; - } - } else { - if (indetermState) { - return indetermValue; - } else { - return input.checked; - } - } - } else { - return input.checked; - } - } - - //submit new value on blur - input.addEventListener("change", function (e) { - success(setValue()); - }); - - input.addEventListener("blur", function (e) { - success(setValue(true)); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - if (e.keyCode == 13) { - success(setValue()); - } - if (e.keyCode == 27) { - cancel(); - } - }); - - return input; - } - }; - - Tabulator.prototype.registerModule("edit", Edit); - - var Export = function Export(table) { - this.table = table; //hold Tabulator object - this.config = {}; - this.cloneTableStyle = true; - this.colVisProp = ""; - }; - - Export.prototype.genereateTable = function (config, style, range, colVisProp) { - this.cloneTableStyle = style; - this.config = config || {}; - this.colVisProp = colVisProp; - - var table = document.createElement("table"); - table.classList.add("tabulator-print-table"); - - if (this.config.columnHeaders !== false) { - table.appendChild(this.generateHeaderElements()); - } - - table.appendChild(this.generateBodyElements(this.rowLookup(range))); - - this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]); - - return table; - }; - - Export.prototype.rowLookup = function (range) { - var _this45 = this; - - var rows = []; - - if (typeof range == "function") { - range.call(this.table).forEach(function (row) { - row = _this45.table.rowManager.findRow(row); - - if (row) { - rows.push(row); - } - }); - } else { - switch (range) { - case true: - case "visible": - rows = this.table.rowManager.getVisibleRows(true); - break; - - case "all": - rows = this.table.rowManager.rows; - break; - - case "selected": - rows = this.table.modules.selectRow.selectedRows; - break; - - case "active": - default: - rows = this.table.rowManager.getDisplayRows(); - } - } - - return Object.assign([], rows); - }; - - Export.prototype.generateColumnGroupHeaders = function () { - var _this46 = this; - - var output = []; - - var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex; - - columns.forEach(function (column) { - var colData = _this46.processColumnGroup(column); - - if (colData) { - output.push(colData); - } - }); - - return output; - }; - - Export.prototype.processColumnGroup = function (column) { - var _this47 = this; - - var subGroups = column.columns, - maxDepth = 0; - - var groupData = { - title: column.definition.title, - column: column, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this47.processColumnGroup(subGroup); - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (this.columnVisCheck(column)) { - groupData.width = 1; - } else { - return false; - } - } - - return groupData; - }; - - Export.prototype.groupHeadersToRows = function (columns) { - - var headers = [], - headerDepth = 0; - - function parseColumnGroup(column, level) { - - var depth = headerDepth - level; - - if (typeof headers[level] === "undefined") { - headers[level] = []; - } - - column.height = column.subGroups ? 1 : depth - column.depth + 1; - - headers[level].push(column); - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } - } - - //calculate maximum header debth - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - return headers; - }; - - Export.prototype.generateHeaderElements = function () { - var _this48 = this; - - var headerEl = document.createElement("thead"); - - var rows = this.groupHeadersToRows(this.generateColumnGroupHeaders()); - - rows.forEach(function (row) { - var rowEl = document.createElement("tr"); - - _this48.mapElementStyles(_this48.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - - row.forEach(function (column) { - var cellEl = document.createElement("th"); - var classNames = column.column.definition.cssClass ? column.column.definition.cssClass.split(" ") : []; - - cellEl.colSpan = column.width; - cellEl.rowSpan = column.height; - - cellEl.innerHTML = column.column.definition.title; - - if (_this48.cloneTableStyle) { - cellEl.style.boxSizing = "border-box"; - } - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - _this48.mapElementStyles(column.column.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - _this48.mapElementStyles(column.column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - if (column.column.visible) { - _this48.mapElementStyles(column.column.getElement(), cellEl, ["width"]); - } else { - if (column.column.definition.width) { - cellEl.style.width = column.column.definition.width + "px"; - } - } - - if (column.column.parent) { - _this48.mapElementStyles(column.column.parent.groupElement, cellEl, ["border-top"]); - } - - rowEl.appendChild(cellEl); - }); - - headerEl.appendChild(rowEl); - }); - - return headerEl; - }; - - Export.prototype.generateBodyElements = function (rows) {}; - - Export.prototype.generateBodyElements = function (rows) { - var _this49 = this; - - var oddRow, evenRow, calcRow, firstRow, firstCell, firstGroup, lastCell, styleCells, styleRow, treeElementField, rowFormatter; - - //assign row formatter - rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))]; - rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter; - - //lookup row styles - if (this.cloneTableStyle && window.getComputedStyle) { - oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"); - evenRow = this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"); - calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs"); - firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"); - firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0]; - - if (firstRow) { - styleCells = firstRow.getElementsByClassName("tabulator-cell"); - firstCell = styleCells[0]; - lastCell = styleCells[styleCells.length - 1]; - } - } - - var bodyEl = document.createElement("tbody"); - - var columns = []; - - if (this.config.columnCalcs !== false && this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized) { - rows.unshift(this.table.modules.columnCalcs.topRow); - } - - if (this.table.modules.columnCalcs.botInitialized) { - rows.push(this.table.modules.columnCalcs.botRow); - } - } - - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (_this49.columnVisCheck(column)) { - columns.push(column); - } - }); - - if (this.table.options.dataTree && this.config.dataTree !== false && this.table.modExists("columnCalcs")) { - treeElementField = this.table.modules.dataTree.elementField; - } - - rows = rows.filter(function (row) { - switch (row.type) { - case "group": - return _this49.config.rowGroups !== false; - break; - - case "calc": - return _this49.config.columnCalcs !== false; - break; - } - - return true; - }); - - if (rows.length > 1000) { - console.warn("It may take a long time to render an HTML table with more than 1000 rows"); - } - - rows.forEach(function (row, i) { - var rowData = row.getData(_this49.colVisProp); - - var rowEl = document.createElement("tr"); - rowEl.classList.add("tabulator-print-table-row"); - - switch (row.type) { - case "group": - var cellEl = document.createElement("td"); - cellEl.colSpan = columns.length; - cellEl.innerHTML = row.key; - - rowEl.classList.add("tabulator-print-table-group"); - - _this49.mapElementStyles(firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - _this49.mapElementStyles(firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - rowEl.appendChild(cellEl); - break; - - case "calc": - rowEl.classList.add("tabulator-print-table-calcs"); - - case "row": - - if (_this49.table.options.dataTree && _this49.config.dataTree === false && row.modules.dataTree.parent) { - return; - } - - columns.forEach(function (column, i) { - var cellEl = document.createElement("td"); - - var value = column.getFieldValue(rowData); - - var cellWrapper = { - modules: {}, - getValue: function getValue() { - return value; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return cellEl; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getData: function getData() { - return rowData; - }, - getRow: function getRow() { - return row.getComponent(); - }, - getComponent: function getComponent() { - return cellWrapper; - }, - column: column - }; - - var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : []; - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - if (_this49.table.modExists("format") && _this49.config.formatCells !== false) { - value = _this49.table.modules.format.formatExportValue(cellWrapper, _this49.colVisProp); - } else { - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - } - - if (value instanceof Node) { - cellEl.appendChild(value); - } else { - cellEl.innerHTML = value; - } - - if (firstCell) { - _this49.mapElementStyles(firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size"]); - - if (column.definition.align) { - cellEl.style.textAlign = column.definition.align; - } - } - - if (_this49.table.options.dataTree && _this49.config.dataTree !== false) { - if (treeElementField && treeElementField == column.field || !treeElementField && i == 0) { - if (row.modules.dataTree.controlEl) { - cellEl.insertBefore(row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild); - } - if (row.modules.dataTree.branchEl) { - cellEl.insertBefore(row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild); - } - } - } - - rowEl.appendChild(cellEl); - - if (cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback) { - cellWrapper.modules.format.renderedCallback(); - } - }); - - styleRow = row.type == "calc" ? calcRow : i % 2 && evenRow ? evenRow : oddRow; - - _this49.mapElementStyles(styleRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - - if (rowFormatter && _this49.config.formatCells !== false) { - var rowComponent = row.getComponent(); - - rowComponent.getElement = function () { - return rowEl; - }; - - rowFormatter(rowComponent); - } - - break; - } - - bodyEl.appendChild(rowEl); - }); - - return bodyEl; - }; - - Export.prototype.columnVisCheck = function (column) { - return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]); - }; - - Export.prototype.getHtml = function (visible, style, config, colVisProp) { - var holder = document.createElement("div"); - - holder.appendChild(this.genereateTable(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput")); - - return holder.innerHTML; - }; - - Export.prototype.mapElementStyles = function (from, to, props) { - if (this.cloneTableStyle && from && to) { - - var lookup = { - "background-color": "backgroundColor", - "color": "fontColor", - "width": "width", - "font-weight": "fontWeight", - "font-family": "fontFamily", - "font-size": "fontSize", - "text-align": "textAlign", - "border-top": "borderTop", - "border-left": "borderLeft", - "border-right": "borderRight", - "border-bottom": "borderBottom", - "padding-top": "paddingTop", - "padding-left": "paddingLeft", - "padding-right": "paddingRight", - "padding-bottom": "paddingBottom" - }; - - if (window.getComputedStyle) { - var fromStyle = window.getComputedStyle(from); - - props.forEach(function (prop) { - to.style[lookup[prop]] = fromStyle.getPropertyValue(prop); - }); - } - } - }; - - Tabulator.prototype.registerModule("export", Export); - - var Filter = function Filter(table) { - - this.table = table; //hold Tabulator object - - this.filterList = []; //hold filter list - this.headerFilters = {}; //hold column filters - this.headerFilterColumns = []; //hold columns that use header filters - - this.prevHeaderFilterChangeCheck = ""; - this.prevHeaderFilterChangeCheck = "{}"; - - this.changed = false; //has filtering changed since last render - }; - - //initialize column header filter - Filter.prototype.initializeColumn = function (column, value) { - var self = this, - field = column.getField(), - params; - - //handle successfull value change - function success(value) { - var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match", - type = "", - filterChangeCheck = "", - filterFunc; - - if (typeof column.modules.filter.prevSuccess === "undefined" || column.modules.filter.prevSuccess !== value) { - - column.modules.filter.prevSuccess = value; - - if (!column.modules.filter.emptyFunc(value)) { - column.modules.filter.value = value; - - switch (_typeof(column.definition.headerFilterFunc)) { - case "string": - if (self.filters[column.definition.headerFilterFunc]) { - type = column.definition.headerFilterFunc; - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return self.filters[column.definition.headerFilterFunc](value, fieldVal, data, params); - }; - } else { - console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc); - } - break; - - case "function": - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return column.definition.headerFilterFunc(value, fieldVal, data, params); - }; - - type = filterFunc; - break; - } - - if (!filterFunc) { - switch (filterType) { - case "partial": - filterFunc = function filterFunc(data) { - var colVal = column.getFieldValue(data); - - if (typeof colVal !== 'undefined' && colVal !== null) { - return String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1; - } else { - return false; - } - }; - type = "like"; - break; - - default: - filterFunc = function filterFunc(data) { - return column.getFieldValue(data) == value; - }; - type = "="; - } - } - - self.headerFilters[field] = { value: value, func: filterFunc, type: type }; - } else { - delete self.headerFilters[field]; - } - - filterChangeCheck = JSON.stringify(self.headerFilters); - - if (self.prevHeaderFilterChangeCheck !== filterChangeCheck) { - self.prevHeaderFilterChangeCheck = filterChangeCheck; - - self.changed = true; - self.table.rowManager.filterRefresh(); - } - } - - return true; - } - - column.modules.filter = { - success: success, - attrType: false, - tagType: false, - emptyFunc: false - }; - - this.generateHeaderFilterElement(column); - }; - - Filter.prototype.generateHeaderFilterElement = function (column, initialValue, reinitialize) { - var _this50 = this; - - var self = this, - success = column.modules.filter.success, - field = column.getField(), - filterElement, - editor, - editorElement, - cellWrapper, - typingTimer, - searchTrigger, - params; - - //handle aborted edit - function cancel() {} - - if (column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode) { - column.contentElement.removeChild(column.modules.filter.headerElement.parentNode); - } - - if (field) { - - //set empty value function - column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) { - return !value && value !== "0"; - }; - - filterElement = document.createElement("div"); - filterElement.classList.add("tabulator-header-filter"); - - //set column editor - switch (_typeof(column.definition.headerFilter)) { - case "string": - if (self.table.modules.edit.editors[column.definition.headerFilter]) { - editor = self.table.modules.edit.editors[column.definition.headerFilter]; - - if ((column.definition.headerFilter === "tick" || column.definition.headerFilter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - console.warn("Filter Error - Cannot build header filter, No such editor found: ", column.definition.editor); - } - break; - - case "function": - editor = column.definition.headerFilter; - break; - - case "boolean": - if (column.modules.edit && column.modules.edit.editor) { - editor = column.modules.edit.editor; - } else { - if (column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]) { - editor = self.table.modules.edit.editors[column.definition.formatter]; - - if ((column.definition.formatter === "tick" || column.definition.formatter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - editor = self.table.modules.edit.editors["input"]; - } - } - break; - } - - if (editor) { - - cellWrapper = { - getValue: function getValue() { - return typeof initialValue !== "undefined" ? initialValue : ""; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return filterElement; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getRow: function getRow() { - return { - normalizeHeight: function normalizeHeight() {} - }; - } - }; - - params = column.definition.headerFilterParams || {}; - - params = typeof params === "function" ? params.call(self.table) : params; - - editorElement = editor.call(this.table.modules.edit, cellWrapper, function () {}, success, cancel, params); - - if (!editorElement) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor returned a value of false"); - return; - } - - if (!(editorElement instanceof Node)) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor should return an instance of Node, the editor returned:", editorElement); - return; - } - - //set Placeholder Text - if (field) { - self.table.modules.localize.bind("headerFilters|columns|" + column.definition.field, function (value) { - editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.table.modules.localize.getText("headerFilters|default")); - }); - } else { - self.table.modules.localize.bind("headerFilters|default", function (value) { - editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value); - }); - } - - //focus on element on click - editorElement.addEventListener("click", function (e) { - e.stopPropagation(); - editorElement.focus(); - }); - - editorElement.addEventListener("focus", function (e) { - var left = _this50.table.columnManager.element.scrollLeft; - - if (left !== _this50.table.rowManager.element.scrollLeft) { - _this50.table.rowManager.scrollHorizontal(left); - _this50.table.columnManager.scrollHorizontal(left); - } - }); - - //live update filters as user types - typingTimer = false; - - searchTrigger = function searchTrigger(e) { - if (typingTimer) { - clearTimeout(typingTimer); - } - - typingTimer = setTimeout(function () { - success(editorElement.value); - }, self.table.options.headerFilterLiveFilterDelay); - }; - - column.modules.filter.headerElement = editorElement; - column.modules.filter.attrType = editorElement.hasAttribute("type") ? editorElement.getAttribute("type").toLowerCase() : ""; - column.modules.filter.tagType = editorElement.tagName.toLowerCase(); - - if (column.definition.headerFilterLiveFilter !== false) { - - if (!(column.definition.headerFilter === 'autocomplete' || column.definition.headerFilter === 'tickCross' || (column.definition.editor === 'autocomplete' || column.definition.editor === 'tickCross') && column.definition.headerFilter === true)) { - editorElement.addEventListener("keyup", searchTrigger); - editorElement.addEventListener("search", searchTrigger); - - //update number filtered columns on change - if (column.modules.filter.attrType == "number") { - editorElement.addEventListener("change", function (e) { - success(editorElement.value); - }); - } - - //change text inputs to search inputs to allow for clearing of field - if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") { - editorElement.setAttribute("type", "search"); - // editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click - } - } - - //prevent input and select elements from propegating click to column sorters etc - if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") { - editorElement.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - } - } - - filterElement.appendChild(editorElement); - - column.contentElement.appendChild(filterElement); - - if (!reinitialize) { - self.headerFilterColumns.push(column); - } - } - } else { - console.warn("Filter Error - Cannot add header filter, column has no field set:", column.definition.title); - } - }; - - //hide all header filter elements (used to ensure correct column widths in "fitData" layout mode) - Filter.prototype.hideHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = 'none'; - } - }); - }; - - //show all header filter elements (used to ensure correct column widths in "fitData" layout mode) - Filter.prototype.showHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = ''; - } - }); - }; - - //programatically set focus of header filter - Filter.prototype.setHeaderFilterFocus = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.focus(); - } else { - console.warn("Column Filter Focus Error - No header filter set on column:", column.getField()); - } - }; - - //programmatically get value of header filter - Filter.prototype.getHeaderFilterValue = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - return column.modules.filter.headerElement.value; - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - }; - - //programatically set value of header filter - Filter.prototype.setHeaderFilterValue = function (column, value) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, value, true); - column.modules.filter.success(value); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } - }; - - Filter.prototype.reloadHeaderFilter = function (column) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, column.modules.filter.value, true); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } - }; - - //check if the filters has changed since last use - Filter.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; - }; - - //set standard filters - Filter.prototype.setFilter = function (field, type, value) { - var self = this; - - self.filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - self.addFilter(field); - }; - - //add filter to array - Filter.prototype.addFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - - filter = self.findFilter(filter); - - if (filter) { - self.filterList.push(filter); - - self.changed = true; - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - Filter.prototype.findFilter = function (filter) { - var self = this, - column; - - if (Array.isArray(filter)) { - return this.findSubFilters(filter); - } - - var filterFunc = false; - - if (typeof filter.field == "function") { - filterFunc = function filterFunc(data) { - return filter.field(data, filter.type || {}); // pass params to custom filter function - }; - } else { - - if (self.filters[filter.type]) { - - column = self.table.columnManager.getColumnByField(filter.field); - - if (column) { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, column.getFieldValue(data)); - }; - } else { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, data[filter.field]); - }; - } - } else { - console.warn("Filter Error - No such filter type found, ignoring: ", filter.type); - } - } - - filter.func = filterFunc; - - return filter.func ? filter : false; - }; - - Filter.prototype.findSubFilters = function (filters) { - var self = this, - output = []; - - filters.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - output.push(filter); - } - }); - - return output.length ? output : false; - }; - - //get all filters - Filter.prototype.getFilters = function (all, ajax) { - var output = []; - - if (all) { - output = this.getHeaderFilters(); - } - - if (ajax) { - output.forEach(function (item) { - if (typeof item.type == "function") { - item.type = "function"; - } - }); - } - - output = output.concat(this.filtersToArray(this.filterList, ajax)); - - return output; - }; - - //filter to Object - Filter.prototype.filtersToArray = function (filterList, ajax) { - var _this51 = this; - - var output = []; - - filterList.forEach(function (filter) { - var item; - - if (Array.isArray(filter)) { - output.push(_this51.filtersToArray(filter, ajax)); - } else { - item = { field: filter.field, type: filter.type, value: filter.value }; - - if (ajax) { - if (typeof item.type == "function") { - item.type = "function"; - } - } - - output.push(item); - } - }); - - return output; - }; - - //get all filters - Filter.prototype.getHeaderFilters = function () { - var self = this, - output = []; - - for (var key in this.headerFilters) { - output.push({ field: key, type: this.headerFilters[key].type, value: this.headerFilters[key].value }); - } - - return output; - }; - - //remove filter from array - Filter.prototype.removeFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - var index = -1; - - if (_typeof(filter.field) == "object") { - index = self.filterList.findIndex(function (element) { - return filter === element; - }); - } else { - index = self.filterList.findIndex(function (element) { - return filter.field === element.field && filter.type === element.type && filter.value === element.value; - }); - } - - if (index > -1) { - self.filterList.splice(index, 1); - self.changed = true; - } else { - console.warn("Filter Error - No matching filter type found, ignoring: ", filter.type); - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - //clear filters - Filter.prototype.clearFilter = function (all) { - this.filterList = []; - - if (all) { - this.clearHeaderFilter(); - } - - this.changed = true; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - //clear header filters - Filter.prototype.clearHeaderFilter = function () { - var self = this; - - this.headerFilters = {}; - self.prevHeaderFilterChangeCheck = "{}"; - - this.headerFilterColumns.forEach(function (column) { - column.modules.filter.value = null; - column.modules.filter.prevSuccess = undefined; - self.reloadHeaderFilter(column); - }); - - this.changed = true; - }; - - //search data and return matching rows - Filter.prototype.search = function (searchType, field, type, value) { - var self = this, - activeRows = [], - filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - filterList.push(filter); - } - }); - - this.table.rowManager.rows.forEach(function (row) { - var match = true; - - filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, row.getData())) { - match = false; - } - }); - - if (match) { - activeRows.push(searchType === "data" ? row.getData("data") : row.getComponent()); - } - }); - - return activeRows; - }; - - //filter row array - Filter.prototype.filter = function (rowList, filters) { - var self = this, - activeRows = [], - activeRowComponents = []; - - if (self.table.options.dataFiltering) { - self.table.options.dataFiltering.call(self.table, self.getFilters()); - } - - if (!self.table.options.ajaxFiltering && (self.filterList.length || Object.keys(self.headerFilters).length)) { - - rowList.forEach(function (row) { - if (self.filterRow(row)) { - activeRows.push(row); - } - }); - } else { - activeRows = rowList.slice(0); - } - - if (self.table.options.dataFiltered) { - - activeRows.forEach(function (row) { - activeRowComponents.push(row.getComponent()); - }); - - self.table.options.dataFiltered.call(self.table, self.getFilters(), activeRowComponents); - } - - return activeRows; - }; - - //filter individual row - Filter.prototype.filterRow = function (row, filters) { - var self = this, - match = true, - data = row.getData(); - - self.filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, data)) { - match = false; - } - }); - - for (var field in self.headerFilters) { - if (!self.headerFilters[field].func(data)) { - match = false; - } - } - - return match; - }; - - Filter.prototype.filterRecurse = function (filter, data) { - var self = this, - match = false; - - if (Array.isArray(filter)) { - filter.forEach(function (subFilter) { - if (self.filterRecurse(subFilter, data)) { - match = true; - } - }); - } else { - match = filter.func(data); - } - - return match; - }; - - //list of available filters - Filter.prototype.filters = { - - //equal to - "=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal == filterVal ? true : false; - }, - - //less than - "<": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal < filterVal ? true : false; - }, - - //less than or equal to - "<=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal <= filterVal ? true : false; - }, - - //greater than - ">": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal > filterVal ? true : false; - }, - - //greater than or equal to - ">=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal >= filterVal ? true : false; - }, - - //not equal to - "!=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal != filterVal ? true : false; - }, - - "regex": function regex(filterVal, rowVal, rowData, filterParams) { - - if (typeof filterVal == "string") { - filterVal = new RegExp(filterVal); - } - - return filterVal.test(rowVal); - }, - - //contains the string - "like": function like(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1; - } else { - return false; - } - } - }, - - //in array - "in": function _in(filterVal, rowVal, rowData, filterParams) { - if (Array.isArray(filterVal)) { - return filterVal.indexOf(rowVal) > -1; - } else { - console.warn("Filter Error - filter value is not an array:", filterVal); - return false; - } - } - }; - - Tabulator.prototype.registerModule("filter", Filter); - - var Format = function Format(table) { - this.table = table; //hold Tabulator object - }; - - //initialize column formatter - Format.prototype.initializeColumn = function (column) { - column.modules.format = this.lookupFormatter(column, ""); - - if (typeof column.definition.formatterPrint !== "undefined") { - column.modules.format.print = this.lookupFormatter(column, "Print"); - } - - if (typeof column.definition.formatterClipboard !== "undefined") { - column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard"); - } - - if (typeof column.definition.formatterHtmlOutput !== "undefined") { - column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput"); - } - }; - - Format.prototype.lookupFormatter = function (column, type) { - var config = { params: column.definition["formatter" + type + "Params"] || {} }, - formatter = column.definition["formatter" + type]; - - //set column formatter - switch (typeof formatter === 'undefined' ? 'undefined' : _typeof(formatter)) { - case "string": - - if (formatter === "tick") { - formatter = "tickCross"; - - if (typeof config.params.crossElement == "undefined") { - config.params.crossElement = false; - } - - console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false"); - } - - if (this.formatters[formatter]) { - config.formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - config.formatter = this.formatters.plaintext; - } - break; - - case "function": - config.formatter = formatter; - break; - - default: - config.formatter = this.formatters.plaintext; - break; - } - - return config; - }; - - Format.prototype.cellRendered = function (cell) { - if (cell.modules.format && cell.modules.format.renderedCallback) { - cell.modules.format.renderedCallback(); - } - }; - - //return a formatted value for a cell - Format.prototype.formatValue = function (cell) { - var component = cell.getComponent(), - params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params; - - function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - } - - return cell.column.modules.format.formatter.call(this, component, params, onRendered); - }; - - Format.prototype.formatExportValue = function (cell, type) { - var formatter = cell.column.modules.format[type], - params; - - if (formatter) { - var onRendered = function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - }; - - params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params; - - return formatter.formatter.call(this, cell.getComponent(), params, onRendered); - } else { - return this.formatValue(cell); - } - }; - - Format.prototype.sanitizeHTML = function (value) { - if (value) { - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - return String(value).replace(/[&<>"'`=\/]/g, function (s) { - return entityMap[s]; - }); - } else { - return value; - } - }; - - Format.prototype.emptyToSpace = function (value) { - return value === null || typeof value === "undefined" || value === "" ? " " : value; - }; - - //get formatter for cell - Format.prototype.getFormatter = function (formatter) { - var formatter; - - switch (typeof formatter === 'undefined' ? 'undefined' : _typeof(formatter)) { - case "string": - if (this.formatters[formatter]) { - formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - formatter = this.formatters.plaintext; - } - break; - - case "function": - formatter = formatter; - break; - - default: - formatter = this.formatters.plaintext; - break; - } - - return formatter; - }; - - //default data formatters - Format.prototype.formatters = { - //plain text value - plaintext: function plaintext(cell, formatterParams, onRendered) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //html text value - html: function html(cell, formatterParams, onRendered) { - return cell.getValue(); - }, - - //multiline text area - textarea: function textarea(cell, formatterParams, onRendered) { - cell.getElement().style.whiteSpace = "pre-wrap"; - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //currency formatting - money: function money(cell, formatterParams, onRendered) { - var floatVal = parseFloat(cell.getValue()), - number, - integer, - decimal, - rgx; - - var decimalSym = formatterParams.decimal || "."; - var thousandSym = formatterParams.thousand || ","; - var symbol = formatterParams.symbol || ""; - var after = !!formatterParams.symbolAfter; - var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2; - - if (isNaN(floatVal)) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - } - - number = precision !== false ? floatVal.toFixed(precision) : floatVal; - number = String(number).split("."); - - integer = number[0]; - decimal = number.length > 1 ? decimalSym + number[1] : ""; - - rgx = /(\d+)(\d{3})/; - - while (rgx.test(integer)) { - integer = integer.replace(rgx, "$1" + thousandSym + "$2"); - } - - return after ? integer + decimal + symbol : symbol + integer + decimal; - }, - - //clickable anchor tag - link: function link(cell, formatterParams, onRendered) { - var value = cell.getValue(), - urlPrefix = formatterParams.urlPrefix || "", - download = formatterParams.download, - label = value, - el = document.createElement("a"), - data; - - if (formatterParams.labelField) { - data = cell.getData(); - label = data[formatterParams.labelField]; - } - - if (formatterParams.label) { - switch (_typeof(formatterParams.label)) { - case "string": - label = formatterParams.label; - break; - - case "function": - label = formatterParams.label(cell); - break; - } - } - - if (label) { - if (formatterParams.urlField) { - data = cell.getData(); - value = data[formatterParams.urlField]; - } - - if (formatterParams.url) { - switch (_typeof(formatterParams.url)) { - case "string": - value = formatterParams.url; - break; - - case "function": - value = formatterParams.url(cell); - break; - } - } - - el.setAttribute("href", urlPrefix + value); - - if (formatterParams.target) { - el.setAttribute("target", formatterParams.target); - } - - if (formatterParams.download) { - - if (typeof download == "function") { - download = download(cell); - } else { - download = download === true ? "" : download; - } - - el.setAttribute("download", download); - } - - el.innerHTML = this.emptyToSpace(this.sanitizeHTML(label)); - - return el; - } else { - return " "; - } - }, - - //image element - image: function image(cell, formatterParams, onRendered) { - var el = document.createElement("img"); - el.setAttribute("src", cell.getValue()); - - switch (_typeof(formatterParams.height)) { - case "number": - el.style.height = formatterParams.height + "px"; - break; - - case "string": - el.style.height = formatterParams.height; - break; - } - - switch (_typeof(formatterParams.width)) { - case "number": - el.style.width = formatterParams.width + "px"; - break; - - case "string": - el.style.width = formatterParams.width; - break; - } - - el.addEventListener("load", function () { - cell.getRow().normalizeHeight(); - }); - - return el; - }, - - //tick or cross - tickCross: function tickCross(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - empty = formatterParams.allowEmpty, - truthy = formatterParams.allowTruthy, - tick = typeof formatterParams.tickElement !== "undefined" ? formatterParams.tickElement : '', - cross = typeof formatterParams.crossElement !== "undefined" ? formatterParams.crossElement : ''; - - if (truthy && value || value === true || value === "true" || value === "True" || value === 1 || value === "1") { - element.setAttribute("aria-checked", true); - return tick || ""; - } else { - if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) { - element.setAttribute("aria-checked", "mixed"); - return ""; - } else { - element.setAttribute("aria-checked", false); - return cross || ""; - } - } - }, - - datetime: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var outputFormat = formatterParams.outputFormat || "DD/MM/YYYY hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - return newDatetime.format(outputFormat); - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - datetimediff: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var suffix = typeof formatterParams.suffix !== "undefined" ? formatterParams.suffix : false; - var unit = typeof formatterParams.unit !== "undefined" ? formatterParams.unit : undefined; - var humanize = typeof formatterParams.humanize !== "undefined" ? formatterParams.humanize : false; - var date = typeof formatterParams.date !== "undefined" ? formatterParams.date : moment(); - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - if (humanize) { - return moment.duration(newDatetime.diff(date)).humanize(suffix); - } else { - return newDatetime.diff(date, unit) + (suffix ? " " + suffix : ""); - } - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - //select - lookup: function lookup(cell, formatterParams, onRendered) { - var value = cell.getValue(); - - if (typeof formatterParams[value] === "undefined") { - console.warn('Missing display value for ' + value); - return value; - } - - return formatterParams[value]; - }, - - //star rating - star: function star(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - maxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5, - stars = document.createElement("span"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"), - starActive = '', - starInactive = ''; - - //style stars holder - stars.style.verticalAlign = "middle"; - - //style star - star.setAttribute("width", "14"); - star.setAttribute("height", "14"); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - value = value && !isNaN(value) ? parseInt(value) : 0; - - value = Math.max(0, Math.min(value, maxStars)); - - for (var i = 1; i <= maxStars; i++) { - var nextStar = star.cloneNode(true); - nextStar.innerHTML = i <= value ? starActive : starInactive; - - stars.appendChild(nextStar); - } - - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - element.setAttribute("aria-label", value); - - return stars; - }, - - traffic: function traffic(cell, formatterParams, onRendered) { - var value = this.sanitizeHTML(cell.getValue()) || 0, - el = document.createElement("span"), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - colors = formatterParams && typeof formatterParams.color !== "undefined" ? formatterParams.color : ["red", "orange", "green"], - color = "#666666", - percent, - percentValue; - - if (isNaN(value) || typeof cell.getValue() === "undefined") { - return; - } - - el.classList.add("tabulator-traffic-light"); - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set color - switch (typeof colors === 'undefined' ? 'undefined' : _typeof(colors)) { - case "string": - color = colors; - break; - case "function": - color = colors(value); - break; - case "object": - if (Array.isArray(colors)) { - var unit = 100 / colors.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, colors.length - 1); - index = Math.max(index, 0); - color = colors[index]; - break; - } - } - - el.style.backgroundColor = color; - - return el; - }, - - //progress bar - progress: function progress(cell, formatterParams, onRendered) { - //progress bar - var value = this.sanitizeHTML(cell.getValue()) || 0, - element = cell.getElement(), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center", - percent, - percentValue, - color, - legend, - legendColor, - top, - left, - right, - bottom; - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set bar color - switch (_typeof(formatterParams.color)) { - case "string": - color = formatterParams.color; - break; - case "function": - color = formatterParams.color(value); - break; - case "object": - if (Array.isArray(formatterParams.color)) { - var unit = 100 / formatterParams.color.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.color.length - 1); - index = Math.max(index, 0); - color = formatterParams.color[index]; - break; - } - default: - color = "#2DC214"; - } - - //generate legend - switch (_typeof(formatterParams.legend)) { - case "string": - legend = formatterParams.legend; - break; - case "function": - legend = formatterParams.legend(value); - break; - case "boolean": - legend = value; - break; - default: - legend = false; - } - - //set legend color - switch (_typeof(formatterParams.legendColor)) { - case "string": - legendColor = formatterParams.legendColor; - break; - case "function": - legendColor = formatterParams.legendColor(value); - break; - case "object": - if (Array.isArray(formatterParams.legendColor)) { - var unit = 100 / formatterParams.legendColor.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.legendColor.length - 1); - index = Math.max(index, 0); - legendColor = formatterParams.legendColor[index]; - } - break; - default: - legendColor = "#000"; - } - - element.style.minWidth = "30px"; - element.style.position = "relative"; - - element.setAttribute("aria-label", percentValue); - - var barEl = document.createElement("div"); - barEl.style.display = "inline-block"; - barEl.style.position = "relative"; - barEl.style.width = percentValue + "%"; - barEl.style.backgroundColor = color; - barEl.style.height = "100%"; - - barEl.setAttribute('data-max', max); - barEl.setAttribute('data-min', min); - - if (legend) { - var legendEl = document.createElement("div"); - legendEl.style.position = "absolute"; - legendEl.style.top = "4px"; - legendEl.style.left = 0; - legendEl.style.textAlign = legendAlign; - legendEl.style.width = "100%"; - legendEl.style.color = legendColor; - legendEl.innerHTML = legend; - } - - onRendered(function () { - - //handle custom element needed if formatter is to be included in printed/downloaded output - if (!(cell instanceof CellComponent)) { - var holderEl = document.createElement("div"); - holderEl.style.position = "absolute"; - holderEl.style.top = "4px"; - holderEl.style.bottom = "4px"; - holderEl.style.left = "4px"; - holderEl.style.right = "4px"; - - element.appendChild(holderEl); - - element = holderEl; - } - - element.appendChild(barEl); - - if (legend) { - element.appendChild(legendEl); - } - }); - - return ""; - }, - - //background color - color: function color(cell, formatterParams, onRendered) { - cell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue()); - return ""; - }, - - //tick icon - buttonTick: function buttonTick(cell, formatterParams, onRendered) { - return ''; - }, - - //cross icon - buttonCross: function buttonCross(cell, formatterParams, onRendered) { - return ''; - }, - - //current row number - rownum: function rownum(cell, formatterParams, onRendered) { - return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1; - }, - - //row handle - handle: function handle(cell, formatterParams, onRendered) { - cell.getElement().classList.add("tabulator-row-handle"); - return "
"; - }, - - responsiveCollapse: function responsiveCollapse(cell, formatterParams, onRendered) { - var self = this, - open = false, - el = document.createElement("div"), - config = cell.getRow()._row.modules.responsiveLayout; - - el.classList.add("tabulator-responsive-collapse-toggle"); - el.innerHTML = "+-"; - - cell.getElement().classList.add("tabulator-row-handle"); - - function toggleList(isOpen) { - var collapseEl = config.element; - - config.open = isOpen; - - if (collapseEl) { - - if (config.open) { - el.classList.add("open"); - collapseEl.style.display = ''; - } else { - el.classList.remove("open"); - collapseEl.style.display = 'none'; - } - } - } - - el.addEventListener("click", function (e) { - e.stopImmediatePropagation(); - toggleList(!config.open); - }); - - toggleList(config.open); - - return el; - }, - - rowSelection: function rowSelection(cell) { - var _this52 = this; - - var checkbox = document.createElement("input"); - - checkbox.type = 'checkbox'; - - if (this.table.modExists("selectRow", true)) { - - checkbox.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - if (typeof cell.getRow == 'function') { - var row = cell.getRow(); - - checkbox.addEventListener("change", function (e) { - row.toggleSelect(); - }); - - checkbox.checked = row.isSelected(); - this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox); - } else { - checkbox.addEventListener("change", function (e) { - if (_this52.table.modules.selectRow.selectedRows.length) { - _this52.table.deselectRow(); - } else { - _this52.table.selectRow(); - } - }); - - this.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox); - } - } - return checkbox; - } - }; - - Tabulator.prototype.registerModule("format", Format); - - var FrozenColumns = function FrozenColumns(table) { - this.table = table; //hold Tabulator object - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightPadding = 0; - this.initializationMode = "left"; - this.active = false; - this.scrollEndTimer = false; - }; - - //reset initial state - FrozenColumns.prototype.reset = function () { - this.initializationMode = "left"; - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightMargin = 0; - this.active = false; - - this.table.columnManager.headersElement.style.marginLeft = 0; - this.table.columnManager.element.style.paddingRight = 0; - }; - - //initialize specific column - FrozenColumns.prototype.initializeColumn = function (column) { - var config = { margin: 0, edge: false }; - - if (!column.isGroup) { - - if (this.frozenCheck(column)) { - - config.position = this.initializationMode; - - if (this.initializationMode == "left") { - this.leftColumns.push(column); - } else { - this.rightColumns.unshift(column); - } - - this.active = true; - - column.modules.frozen = config; - } else { - this.initializationMode = "right"; - } - } - }; - - FrozenColumns.prototype.frozenCheck = function (column) { - var frozen = false; - - if (column.parent.isGroup && column.definition.frozen) { - console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"); - } - - if (column.parent.isGroup) { - return this.frozenCheck(column.parent); - } else { - return column.definition.frozen; - } - - return frozen; - }; - - //quick layout to smooth horizontal scrolling - FrozenColumns.prototype.scrollHorizontal = function () { - var _this53 = this; - - var rows; - - if (this.active) { - clearTimeout(this.scrollEndTimer); - - //layout all rows after scroll is complete - this.scrollEndTimer = setTimeout(function () { - _this53.layout(); - }, 100); - - rows = this.table.rowManager.getVisibleRows(); - - this.calcMargins(); - - this.layoutColumnPosition(); - - this.layoutCalcRows(); - - rows.forEach(function (row) { - if (row.type === "row") { - _this53.layoutRow(row); - } - }); - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } - }; - - //calculate margins for rows - FrozenColumns.prototype.calcMargins = function () { - this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px"; - this.table.columnManager.headersElement.style.marginLeft = this.leftMargin; - - this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px"; - this.table.columnManager.element.style.paddingRight = this.rightMargin; - - //calculate right frozen columns - this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft; - }; - - //layout calculation rows - FrozenColumns.prototype.layoutCalcRows = function () { - if (this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow) { - this.layoutRow(this.table.modules.columnCalcs.topRow); - } - if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) { - this.layoutRow(this.table.modules.columnCalcs.botRow); - } - } - }; - - //calculate column positions and layout headers - FrozenColumns.prototype.layoutColumnPosition = function (allCells) { - var _this54 = this; - - var leftParents = []; - - this.leftColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this54._calcSpace(_this54.leftColumns, i) + _this54.table.columnManager.scrollLeft + "px"; - - if (i == _this54.leftColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - var parentEl = _this54.getColGroupParentElement(column); - if (!leftParents.includes(parentEl)) { - _this54.layoutElement(parentEl, column); - leftParents.push(parentEl); - } - - if (column.modules.frozen.edge) { - parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } else { - _this54.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this54.layoutElement(cell.getElement(), column); - }); - } - }); - - this.rightColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this54.rightPadding - _this54._calcSpace(_this54.rightColumns, i + 1) + "px"; - - if (i == _this54.rightColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - _this54.layoutElement(_this54.getColGroupParentElement(column), column); - } else { - _this54.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this54.layoutElement(cell.getElement(), column); - }); - } - }); - }; - - FrozenColumns.prototype.getColGroupParentElement = function (column) { - return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement(); - }; - - //layout columns appropropriatly - FrozenColumns.prototype.layout = function () { - var self = this, - rightMargin = 0; - - if (self.active) { - - //calculate row padding - this.calcMargins(); - - // self.table.rowManager.activeRows.forEach(function(row){ - // self.layoutRow(row); - // }); - - // if(self.table.options.dataTree){ - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row") { - self.layoutRow(row); - } - }); - // } - - this.layoutCalcRows(); - - //calculate left columns - this.layoutColumnPosition(true); - - // if(tableHolder.scrollHeight > tableHolder.clientHeight){ - // rightMargin -= tableHolder.offsetWidth - tableHolder.clientWidth; - // } - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } - }; - - FrozenColumns.prototype.layoutRow = function (row) { - var _this55 = this; - - var rowEl = row.getElement(); - - rowEl.style.paddingLeft = this.leftMargin; - // rowEl.style.paddingRight = this.rightMargin + "px"; - - this.leftColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this55.layoutElement(cell.getElement(), column); - } - }); - - this.rightColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this55.layoutElement(cell.getElement(), column); - } - }); - }; - - FrozenColumns.prototype.layoutElement = function (element, column) { - - if (column.modules.frozen) { - element.style.position = "absolute"; - element.style.left = column.modules.frozen.margin; - - element.classList.add("tabulator-frozen"); - - if (column.modules.frozen.edge) { - element.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } - }; - - FrozenColumns.prototype._calcSpace = function (columns, index) { - var width = 0; - - for (var i = 0; i < index; i++) { - if (columns[i].visible) { - width += columns[i].getWidth(); - } - } - - return width; - }; - - Tabulator.prototype.registerModule("frozenColumns", FrozenColumns); - var FrozenRows = function FrozenRows(table) { - this.table = table; //hold Tabulator object - this.topElement = document.createElement("div"); - this.rows = []; - this.displayIndex = 0; //index in display pipeline - }; - - FrozenRows.prototype.initialize = function () { - this.rows = []; - - this.topElement.classList.add("tabulator-frozen-rows-holder"); - - // this.table.columnManager.element.append(this.topElement); - this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling); - }; - - FrozenRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - FrozenRows.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - FrozenRows.prototype.isFrozen = function () { - return !!this.rows.length; - }; - - //filter frozen rows out of display data - FrozenRows.prototype.getRows = function (rows) { - var self = this, - frozen = [], - output = rows.slice(0); - - this.rows.forEach(function (row) { - var index = output.indexOf(row); - - if (index > -1) { - output.splice(index, 1); - } - }); - - return output; - }; - - FrozenRows.prototype.freezeRow = function (row) { - if (!row.modules.frozen) { - row.modules.frozen = true; - this.topElement.appendChild(row.getElement()); - row.initialize(); - row.normalizeHeight(); - this.table.rowManager.adjustTableSize(); - - this.rows.push(row); - - this.table.rowManager.refreshActiveData("display"); - - this.styleRows(); - } else { - console.warn("Freeze Error - Row is already frozen"); - } - }; - - FrozenRows.prototype.unfreezeRow = function (row) { - var index = this.rows.indexOf(row); - - if (row.modules.frozen) { - - row.modules.frozen = false; - - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.table.rowManager.adjustTableSize(); - - this.rows.splice(index, 1); - - this.table.rowManager.refreshActiveData("display"); - - if (this.rows.length) { - this.styleRows(); - } - } else { - console.warn("Freeze Error - Row is already unfrozen"); - } - }; - - FrozenRows.prototype.styleRows = function (row) { - var self = this; - - this.rows.forEach(function (row, i) { - self.table.rowManager.styleRow(row, i); - }); - }; - - Tabulator.prototype.registerModule("frozenRows", FrozenRows); - - //public group object - var GroupComponent = function GroupComponent(group) { - this._group = group; - this.type = "GroupComponent"; - }; - - GroupComponent.prototype.getKey = function () { - return this._group.key; - }; - - GroupComponent.prototype.getField = function () { - return this._group.field; - }; - - GroupComponent.prototype.getElement = function () { - return this._group.element; - }; - - GroupComponent.prototype.getRows = function () { - return this._group.getRows(true); - }; - - GroupComponent.prototype.getSubGroups = function () { - return this._group.getSubGroups(true); - }; - - GroupComponent.prototype.getParentGroup = function () { - return this._group.parent ? this._group.parent.getComponent() : false; - }; - - GroupComponent.prototype.getVisibility = function () { - return this._group.visible; - }; - - GroupComponent.prototype.show = function () { - this._group.show(); - }; - - GroupComponent.prototype.hide = function () { - this._group.hide(); - }; - - GroupComponent.prototype.toggle = function () { - this._group.toggleVisibility(); - }; - - GroupComponent.prototype._getSelf = function () { - return this._group; - }; - - GroupComponent.prototype.getTable = function () { - return this._group.groupManager.table; - }; - - ////////////////////////////////////////////////// - //////////////// Group Functions ///////////////// - ////////////////////////////////////////////////// - - var Group = function Group(groupManager, parent, level, key, field, generator, oldGroup) { - - this.groupManager = groupManager; - this.parent = parent; - this.key = key; - this.level = level; - this.field = field; - this.hasSubGroups = level < groupManager.groupIDLookups.length - 1; - this.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow; - this.type = "group"; //type of element - this.old = oldGroup; - this.rows = []; - this.groups = []; - this.groupList = []; - this.generator = generator; - this.elementContents = false; - this.height = 0; - this.outerHeight = 0; - this.initialized = false; - this.calcs = {}; - this.initialized = false; - this.modules = {}; - this.arrowElement = false; - - this.visible = oldGroup ? oldGroup.visible : typeof groupManager.startOpen[level] !== "undefined" ? groupManager.startOpen[level] : groupManager.startOpen[0]; - - this.createElements(); - this.addBindings(); - - this.createValueGroups(); - }; - - Group.prototype.wipe = function () { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - group.wipe(); - }); - } else { - this.element = false; - this.arrowElement = false; - this.elementContents = false; - } - }; - - Group.prototype.createElements = function () { - var arrow = document.createElement("div"); - arrow.classList.add("tabulator-arrow"); - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-row"); - this.element.classList.add("tabulator-group"); - this.element.classList.add("tabulator-group-level-" + this.level); - this.element.setAttribute("role", "rowgroup"); - - this.arrowElement = document.createElement("div"); - this.arrowElement.classList.add("tabulator-group-toggle"); - this.arrowElement.appendChild(arrow); - - //setup movable rows - if (this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists("moveRow")) { - this.groupManager.table.modules.moveRow.initializeGroupHeader(this); - } - }; - - Group.prototype.createValueGroups = function () { - var _this56 = this; - - var level = this.level + 1; - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - this.groupManager.allowedValues[level].forEach(function (value) { - _this56._createGroup(value, level); - }); - } - }; - - Group.prototype.addBindings = function () { - var self = this, - dblTap, - tapHold, - tap, - toggleElement; - - //handle group click events - if (self.groupManager.table.options.groupClick) { - self.element.addEventListener("click", function (e) { - self.groupManager.table.options.groupClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.groupManager.table.options.groupDblClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContext) { - self.element.addEventListener("contextmenu", function (e) { - self.groupManager.table.options.groupContext.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.groupManager.table.options.groupTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.groupManager.table.options.groupDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.groupManager.table.options.groupDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.groupManager.table.options.groupTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.groupManager.table.options.groupTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - if (self.groupManager.table.options.groupToggleElement) { - toggleElement = self.groupManager.table.options.groupToggleElement == "arrow" ? self.arrowElement : self.element; - - toggleElement.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - self.toggleVisibility(); - }); - } - }; - - Group.prototype._createGroup = function (groupID, level) { - var groupKey = level + "_" + groupID; - var group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false); - - this.groups[groupKey] = group; - this.groupList.push(group); - }; - - Group.prototype._addRowToGroup = function (row) { - - var level = this.level + 1; - - if (this.hasSubGroups) { - var groupID = this.groupManager.groupIDLookups[level].func(row.getData()), - groupKey = level + "_" + groupID; - - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - } else { - if (!this.groups[groupKey]) { - this._createGroup(groupID, level); - } - - this.groups[groupKey].addRow(row); - } - } - }; - - Group.prototype._addRow = function (row) { - this.rows.push(row); - row.modules.group = this; - }; - - Group.prototype.insertRow = function (row, to, after) { - var data = this.conformRowData({}); - - row.updateData(data); - - var toIndex = this.rows.indexOf(to); - - if (toIndex > -1) { - if (after) { - this.rows.splice(toIndex + 1, 0, row); - } else { - this.rows.splice(toIndex, 0, row); - } - } else { - if (after) { - this.rows.push(row); - } else { - this.rows.unshift(row); - } - } - - row.modules.group = this; - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - - this.groupManager.updateGroupRows(true); - }; - - Group.prototype.scrollHeader = function (left) { - this.arrowElement.style.marginLeft = left; - - this.groupList.forEach(function (child) { - child.scrollHeader(left); - }); - }; - - Group.prototype.getRowIndex = function (row) {}; - - //update row data to match grouping contraints - Group.prototype.conformRowData = function (data) { - if (this.field) { - data[this.field] = this.key; - } else { - console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"); - } - - if (this.parent) { - data = this.parent.conformRowData(data); - } - - return data; - }; - - Group.prototype.removeRow = function (row) { - var index = this.rows.indexOf(row); - var el = row.getElement(); - - if (index > -1) { - this.rows.splice(index, 1); - } - - if (!this.groupManager.table.options.groupValues && !this.rows.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - - this.groupManager.updateGroupRows(true); - } else { - - if (el.parentNode) { - el.parentNode.removeChild(el); - } - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - } - }; - - Group.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - - if (!this.groupList.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - } - } - }; - - Group.prototype.getHeadersAndRows = function (noCalc) { - var output = []; - - output.push(this); - - this._visSet(); - - if (this.visible) { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows(noCalc)); - }); - } else { - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - - output = output.concat(this.rows); - - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } else { - if (!this.groupList.length && this.groupManager.table.options.columnCalcs != "table") { - - if (this.groupManager.table.modExists("columnCalcs")) { - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - } - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } - } - } - - return output; - }; - - Group.prototype.getData = function (visible, transform) { - var self = this, - output = []; - - this._visSet(); - - if (!visible || visible && this.visible) { - this.rows.forEach(function (row) { - output.push(row.getData(transform || "data")); - }); - } - - return output; - }; - - // Group.prototype.getRows = function(){ - // this._visSet(); - - // return this.visible ? this.rows : []; - // }; - - Group.prototype.getRowCount = function () { - var count = 0; - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - count += group.getRowCount(); - }); - } else { - count = this.rows.length; - } - return count; - }; - - Group.prototype.toggleVisibility = function () { - if (this.visible) { - this.hide(); - } else { - this.show(); - } - }; - - Group.prototype.hide = function () { - this.visible = false; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.remove("tabulator-group-visible"); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - row.detachElement(); - }); - }); - } else { - this.rows.forEach(function (row) { - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), false); - }; - - Group.prototype.show = function () { - var self = this; - - self.visible = true; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.add("tabulator-group-visible"); - - var prev = self.getElement(); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - }); - } else { - self.rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), true); - }; - - Group.prototype._visSet = function () { - var data = []; - - if (typeof this.visible == "function") { - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent()); - } - }; - - Group.prototype.getRowGroup = function (row) { - var match = false; - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - } else { - if (this.rows.find(function (item) { - return item === row; - })) { - match = this; - } - } - - return match; - }; - - Group.prototype.getSubGroups = function (component) { - var output = []; - - this.groupList.forEach(function (child) { - output.push(component ? child.getComponent() : child); - }); - - return output; - }; - - Group.prototype.getRows = function (compoment) { - var output = []; - - this.rows.forEach(function (row) { - output.push(compoment ? row.getComponent() : row); - }); - - return output; - }; - - Group.prototype.generateGroupHeaderContents = function () { - var data = []; - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent()); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }if (typeof this.elementContents === "string") { - this.element.innerHTML = this.elementContents; - } else { - this.element.appendChild(this.elementContents); - } - - this.element.insertBefore(this.arrowElement, this.element.firstChild); - }; - - ////////////// Standard Row Functions ////////////// - - Group.prototype.getElement = function () { - this.addBindingsd = false; - - this._visSet(); - - if (this.visible) { - this.element.classList.add("tabulator-group-visible"); - } else { - this.element.classList.remove("tabulator-group-visible"); - } - - for (var i = 0; i < this.element.childNodes.length; ++i) { - this.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]); - } - - this.generateGroupHeaderContents(); - - // this.addBindings(); - - return this.element; - }; - - Group.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } - }; - - //normalize the height of elements in the row - Group.prototype.normalizeHeight = function () { - this.setHeight(this.element.clientHeight); - }; - - Group.prototype.initialize = function (force) { - if (!this.initialized || force) { - this.normalizeHeight(); - this.initialized = true; - } - }; - - Group.prototype.reinitialize = function () { - this.initialized = false; - this.height = 0; - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - this.initialize(true); - } - }; - - Group.prototype.setHeight = function (height) { - if (this.height != height) { - this.height = height; - this.outerHeight = this.element.offsetHeight; - } - }; - - //return rows outer height - Group.prototype.getHeight = function () { - return this.outerHeight; - }; - - Group.prototype.getGroup = function () { - return this; - }; - - Group.prototype.reinitializeHeight = function () {}; - Group.prototype.calcHeight = function () {}; - Group.prototype.setCellHeight = function () {}; - Group.prototype.clearCellHeight = function () {}; - - //////////////// Object Generation ///////////////// - Group.prototype.getComponent = function () { - return new GroupComponent(this); - }; - - ////////////////////////////////////////////////// - ////////////// Group Row Extension /////////////// - ////////////////////////////////////////////////// - - var GroupRows = function GroupRows(table) { - - this.table = table; //hold Tabulator object - - this.groupIDLookups = false; //enable table grouping and set field to group by - this.startOpen = [function () { - return false; - }]; //starting state of group - this.headerGenerator = [function () { - return ""; - }]; - this.groupList = []; //ordered list of groups - this.allowedValues = false; - this.groups = {}; //hold row groups - this.displayIndex = 0; //index in display pipeline - }; - - //initialize group configuration - GroupRows.prototype.initialize = function () { - var self = this, - groupBy = self.table.options.groupBy, - startOpen = self.table.options.groupStartOpen, - groupHeader = self.table.options.groupHeader; - - this.allowedValues = self.table.options.groupValues; - - if (Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length) { - console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"); - } - - self.headerGenerator = [function () { - return ""; - }]; - this.startOpen = [function () { - return false; - }]; //starting state of group - - self.table.modules.localize.bind("groups|item", function (langValue, lang) { - self.headerGenerator[0] = function (value, count, data) { - //header layout function - return (typeof value === "undefined" ? "" : value) + "(" + count + " " + (count === 1 ? langValue : lang.groups.items) + ")"; - }; - }); - - this.groupIDLookups = []; - - if (Array.isArray(groupBy) || groupBy) { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both") { - this.table.modules.columnCalcs.removeCalcs(); - } - } else { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group") { - - var cols = this.table.columnManager.getRealColumns(); - - cols.forEach(function (col) { - if (col.definition.topCalc) { - self.table.modules.columnCalcs.initializeTopRow(); - } - - if (col.definition.bottomCalc) { - self.table.modules.columnCalcs.initializeBottomRow(); - } - }); - } - } - - if (!Array.isArray(groupBy)) { - groupBy = [groupBy]; - } - - groupBy.forEach(function (group, i) { - var lookupFunc, column; - - if (typeof group == "function") { - lookupFunc = group; - } else { - column = self.table.columnManager.getColumnByField(group); - - if (column) { - lookupFunc = function lookupFunc(data) { - return column.getFieldValue(data); - }; - } else { - lookupFunc = function lookupFunc(data) { - return data[group]; - }; - } - } - - self.groupIDLookups.push({ - field: typeof group === "function" ? false : group, - func: lookupFunc, - values: self.allowedValues ? self.allowedValues[i] : false - }); - }); - - if (startOpen) { - - if (!Array.isArray(startOpen)) { - startOpen = [startOpen]; - } - - startOpen.forEach(function (level) { - level = typeof level == "function" ? level : function () { - return true; - }; - }); - - self.startOpen = startOpen; - } - - if (groupHeader) { - self.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader]; - } - - this.initialized = true; - }; - - GroupRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - GroupRows.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - //return appropriate rows with group headers - GroupRows.prototype.getRows = function (rows) { - if (this.groupIDLookups.length) { - - this.table.options.dataGrouping.call(this.table); - - this.generateGroups(rows); - - if (this.table.options.dataGrouped) { - this.table.options.dataGrouped.call(this.table, this.getGroups(true)); - } - - return this.updateGroupRows(); - } else { - return rows.slice(0); - } - }; - - GroupRows.prototype.getGroups = function (compoment) { - var groupComponents = []; - - this.groupList.forEach(function (group) { - groupComponents.push(compoment ? group.getComponent() : group); - }); - - return groupComponents; - }; - - GroupRows.prototype.getChildGroups = function (group) { - var _this57 = this; - - var groupComponents = []; - - if (!group) { - group = this; - } - - group.groupList.forEach(function (child) { - if (child.groupList.length) { - groupComponents = groupComponents.concat(_this57.getChildGroups(child)); - } else { - groupComponents.push(child); - } - }); - - return groupComponents; - }; - - GroupRows.prototype.wipe = function () { - this.groupList.forEach(function (group) { - group.wipe(); - }); - }; - - GroupRows.prototype.pullGroupListData = function (groupList) { - var self = this; - var groupListData = []; - - groupList.forEach(function (group) { - var groupHeader = {}; - groupHeader.level = 0; - groupHeader.rowCount = 0; - groupHeader.headerContent = ""; - var childData = []; - - if (group.hasSubGroups) { - childData = self.pullGroupListData(group.groupList); - - groupHeader.level = group.level; - groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers - groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group); - - groupListData.push(groupHeader); - groupListData = groupListData.concat(childData); - } else { - groupHeader.level = group.level; - groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group); - groupHeader.rowCount = group.getRows().length; - - groupListData.push(groupHeader); - - group.getRows().forEach(function (row) { - groupListData.push(row.getData("data")); - }); - } - }); - - return groupListData; - }; - - GroupRows.prototype.getGroupedData = function () { - - return this.pullGroupListData(this.groupList); - }; - - GroupRows.prototype.getRowGroup = function (row) { - var match = false; - - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - - return match; - }; - - GroupRows.prototype.countGroups = function () { - return this.groupList.length; - }; - - GroupRows.prototype.generateGroups = function (rows) { - var self = this, - oldGroups = self.groups; - - self.groups = {}; - self.groupList = []; - - if (this.allowedValues && this.allowedValues[0]) { - this.allowedValues[0].forEach(function (value) { - self.createGroup(value, 0, oldGroups); - }); - - rows.forEach(function (row) { - self.assignRowToExistingGroup(row, oldGroups); - }); - } else { - rows.forEach(function (row) { - self.assignRowToGroup(row, oldGroups); - }); - } - }; - - GroupRows.prototype.createGroup = function (groupID, level, oldGroups) { - var groupKey = level + "_" + groupID, - group; - - oldGroups = oldGroups || []; - - group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]); - - this.groups[groupKey] = group; - this.groupList.push(group); - }; - - // GroupRows.prototype.assignRowToGroup = function(row, oldGroups){ - // var groupID = this.groupIDLookups[0].func(row.getData()), - // groupKey = "0_" + groupID; - - // if(!this.groups[groupKey]){ - // this.createGroup(groupID, 0, oldGroups); - // } - - // this.groups[groupKey].addRow(row); - // }; - - GroupRows.prototype.assignRowToExistingGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - groupKey = "0_" + groupID; - - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - }; - - GroupRows.prototype.assignRowToGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - newGroupNeeded = !this.groups["0_" + groupID]; - - if (newGroupNeeded) { - this.createGroup(groupID, 0, oldGroups); - } - - this.groups["0_" + groupID].addRow(row); - - return !newGroupNeeded; - }; - - GroupRows.prototype.updateGroupRows = function (force) { - var self = this, - output = [], - oldRowCount; - - self.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows()); - }); - - //force update of table display - if (force) { - - var displayIndex = self.table.rowManager.setDisplayRows(output, this.getDisplayIndex()); - - if (displayIndex !== true) { - this.setDisplayIndex(displayIndex); - } - - self.table.rowManager.refreshActiveData("group", true, true); - } - - return output; - }; - - GroupRows.prototype.scrollHeaders = function (left) { - left = left + "px"; - - this.groupList.forEach(function (group) { - group.scrollHeader(left); - }); - }; - - GroupRows.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - } - }; - - Tabulator.prototype.registerModule("groupRows", GroupRows); - var History = function History(table) { - this.table = table; //hold Tabulator object - - this.history = []; - this.index = -1; - }; - - History.prototype.clear = function () { - this.history = []; - this.index = -1; - }; - - History.prototype.action = function (type, component, data) { - - this.history = this.history.slice(0, this.index + 1); - - this.history.push({ - type: type, - component: component, - data: data - }); - - this.index++; - }; - - History.prototype.getHistoryUndoSize = function () { - return this.index + 1; - }; - - History.prototype.getHistoryRedoSize = function () { - return this.history.length - (this.index + 1); - }; - - History.prototype.undo = function () { - - if (this.index > -1) { - var action = this.history[this.index]; - - this.undoers[action.type].call(this, action); - - this.index--; - - this.table.options.historyUndo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Undo Error - No more history to undo"); - return false; - } - }; - - History.prototype.redo = function () { - if (this.history.length - 1 > this.index) { - - this.index++; - - var action = this.history[this.index]; - - this.redoers[action.type].call(this, action); - - this.table.options.historyRedo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Redo Error - No more history to redo"); - return false; - } - }; - - History.prototype.undoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.oldValue); - }, - - rowAdd: function rowAdd(action) { - action.component.deleteActual(); - }, - - rowDelete: function rowDelete(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after); - this.table.rowManager.redraw(); - } - }; - - History.prototype.redoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.newValue); - }, - - rowAdd: function rowAdd(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowDelete: function rowDelete(action) { - action.component.deleteActual(); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after); - this.table.rowManager.redraw(); - } - }; - - //rebind rows to new element after deletion - History.prototype._rebindRow = function (oldRow, newRow) { - this.history.forEach(function (action) { - if (action.component instanceof Row) { - if (action.component === oldRow) { - action.component = newRow; - } - } else if (action.component instanceof Cell) { - if (action.component.row === oldRow) { - var field = action.component.column.getField(); - - if (field) { - action.component = newRow.getCell(field); - } - } - } - }); - }; - - Tabulator.prototype.registerModule("history", History); - var HtmlTableImport = function HtmlTableImport(table) { - this.table = table; //hold Tabulator object - this.fieldIndex = []; - this.hasIndex = false; - }; - - HtmlTableImport.prototype.parseTable = function () { - var self = this, - element = self.table.element, - options = self.table.options, - columns = options.columns, - headers = element.getElementsByTagName("th"), - rows = element.getElementsByTagName("tbody")[0], - data = [], - newTable; - - self.hasIndex = false; - - self.table.options.htmlImporting.call(this.table); - - rows = rows ? rows.getElementsByTagName("tr") : []; - - //check for tablator inline options - self._extractOptions(element, options); - - if (headers.length) { - self._extractHeaders(headers, rows); - } else { - self._generateBlankHeaders(headers, rows); - } - - //iterate through table rows and build data set - for (var index = 0; index < rows.length; index++) { - var row = rows[index], - cells = row.getElementsByTagName("td"), - item = {}; - - //create index if the dont exist in table - if (!self.hasIndex) { - item[options.index] = index; - } - - for (var i = 0; i < cells.length; i++) { - var cell = cells[i]; - if (typeof this.fieldIndex[i] !== "undefined") { - item[this.fieldIndex[i]] = cell.innerHTML; - } - } - - //add row data to item - data.push(item); - } - - //create new element - var newElement = document.createElement("div"); - - //transfer attributes to new element - var attributes = element.attributes; - - // loop through attributes and apply them on div - - for (var i in attributes) { - if (_typeof(attributes[i]) == "object") { - newElement.setAttribute(attributes[i].name, attributes[i].value); - } - } - - // replace table with div element - element.parentNode.replaceChild(newElement, element); - - options.data = data; - - self.table.options.htmlImported.call(this.table); - - // // newElement.tabulator(options); - - this.table.element = newElement; - }; - - //extract tabulator attribute options - HtmlTableImport.prototype._extractOptions = function (element, options, defaultOptions) { - var attributes = element.attributes; - var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options); - var optionsList = {}; - - optionsArr.forEach(function (item) { - optionsList[item.toLowerCase()] = item; - }); - - for (var index in attributes) { - var attrib = attributes[index]; - var name; - - if (attrib && (typeof attrib === 'undefined' ? 'undefined' : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { - name = attrib.name.replace("tabulator-", ""); - - if (typeof optionsList[name] !== "undefined") { - options[optionsList[name]] = this._attribValue(attrib.value); - } - } - } - }; - - //get value of attribute - HtmlTableImport.prototype._attribValue = function (value) { - if (value === "true") { - return true; - } - - if (value === "false") { - return false; - } - - return value; - }; - - //find column if it has already been defined - HtmlTableImport.prototype._findCol = function (title) { - var match = this.table.options.columns.find(function (column) { - return column.title === title; - }); - - return match || false; - }; - - //extract column from headers - HtmlTableImport.prototype._extractHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - exists = false, - col = this._findCol(header.textContent), - width, - attributes; - - if (col) { - exists = true; - } else { - col = { title: header.textContent.trim() }; - } - - if (!col.field) { - col.field = header.textContent.trim().toLowerCase().replace(" ", "_"); - } - - width = header.getAttribute("width"); - - if (width && !col.width) { - col.width = width; - } - - //check for tablator inline options - attributes = header.attributes; - - // //check for tablator inline options - this._extractOptions(header, col, Column.prototype.defaultOptionList); - - this.fieldIndex[index] = col.field; - - if (col.field == this.table.options.index) { - this.hasIndex = true; - } - - if (!exists) { - this.table.options.columns.push(col); - } - } - }; - - //generate blank headers - HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - col = { title: "", field: "col" + index }; - - this.fieldIndex[index] = col.field; - - var width = header.getAttribute("width"); - - if (width) { - col.width = width; - } - - this.table.options.columns.push(col); - } - }; - - Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport); - var Keybindings = function Keybindings(table) { - this.table = table; //hold Tabulator object - this.watchKeys = null; - this.pressedKeys = null; - this.keyupBinding = false; - this.keydownBinding = false; - }; - - Keybindings.prototype.initialize = function () { - var bindings = this.table.options.keybindings, - mergedBindings = {}; - - this.watchKeys = {}; - this.pressedKeys = []; - - if (bindings !== false) { - - for (var key in this.bindings) { - mergedBindings[key] = this.bindings[key]; - } - - if (Object.keys(bindings).length) { - - for (var _key in bindings) { - mergedBindings[_key] = bindings[_key]; - } - } - - this.mapBindings(mergedBindings); - this.bindEvents(); - } - }; - - Keybindings.prototype.mapBindings = function (bindings) { - var _this58 = this; - - var self = this; - - var _loop2 = function _loop2(key) { - - if (_this58.actions[key]) { - - if (bindings[key]) { - - if (_typeof(bindings[key]) !== "object") { - bindings[key] = [bindings[key]]; - } - - bindings[key].forEach(function (binding) { - self.mapBinding(key, binding); - }); - } - } else { - console.warn("Key Binding Error - no such action:", key); - } - }; - - for (var key in bindings) { - _loop2(key); - } - }; - - Keybindings.prototype.mapBinding = function (action, symbolsList) { - var self = this; - - var binding = { - action: this.actions[action], - keys: [], - ctrl: false, - shift: false, - meta: false - }; - - var symbols = symbolsList.toString().toLowerCase().split(" ").join("").split("+"); - - symbols.forEach(function (symbol) { - switch (symbol) { - case "ctrl": - binding.ctrl = true; - break; - - case "shift": - binding.shift = true; - break; - - case "meta": - binding.meta = true; - break; - - default: - symbol = parseInt(symbol); - binding.keys.push(symbol); - - if (!self.watchKeys[symbol]) { - self.watchKeys[symbol] = []; - } - - self.watchKeys[symbol].push(binding); - } - }); - }; - - Keybindings.prototype.bindEvents = function () { - var self = this; - - this.keyupBinding = function (e) { - var code = e.keyCode; - var bindings = self.watchKeys[code]; - - if (bindings) { - - self.pressedKeys.push(code); - - bindings.forEach(function (binding) { - self.checkBinding(e, binding); - }); - } - }; - - this.keydownBinding = function (e) { - var code = e.keyCode; - var bindings = self.watchKeys[code]; - - if (bindings) { - - var index = self.pressedKeys.indexOf(code); - - if (index > -1) { - self.pressedKeys.splice(index, 1); - } - } - }; - - this.table.element.addEventListener("keydown", this.keyupBinding); - - this.table.element.addEventListener("keyup", this.keydownBinding); - }; - - Keybindings.prototype.clearBindings = function () { - if (this.keyupBinding) { - this.table.element.removeEventListener("keydown", this.keyupBinding); - } - - if (this.keydownBinding) { - this.table.element.removeEventListener("keyup", this.keydownBinding); - } - }; - - Keybindings.prototype.checkBinding = function (e, binding) { - var self = this, - match = true; - - if (e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta) { - binding.keys.forEach(function (key) { - var index = self.pressedKeys.indexOf(key); - - if (index == -1) { - match = false; - } - }); - - if (match) { - binding.action.call(self, e); - } - - return true; - } - - return false; - }; - - //default bindings - Keybindings.prototype.bindings = { - navPrev: "shift + 9", - navNext: 9, - navUp: 38, - navDown: 40, - scrollPageUp: 33, - scrollPageDown: 34, - scrollToStart: 36, - scrollToEnd: 35, - undo: "ctrl + 90", - redo: "ctrl + 89", - copyToClipboard: "ctrl + 67" - }; - - //default actions - Keybindings.prototype.actions = { - keyBlock: function keyBlock(e) { - e.stopPropagation(); - e.preventDefault(); - }, - scrollPageUp: function scrollPageUp(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop - rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos >= 0) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - } - - this.table.element.focus(); - }, - scrollPageDown: function scrollPageDown(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop + rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos <= scrollMax) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - } - - this.table.element.focus(); - }, - scrollToStart: function scrollToStart(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - - this.table.element.focus(); - }, - scrollToEnd: function scrollToEnd(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - - this.table.element.focus(); - }, - navPrev: function navPrev(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().prev(); - } - } - }, - - navNext: function navNext(e) { - var cell = false; - var newRow = this.table.options.tabEndNewRow; - var nav; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - - nav = cell.nav(); - - if (!nav.next()) { - if (newRow) { - - cell.getElement().firstChild.blur(); - - if (newRow === true) { - newRow = this.table.addRow({}); - } else { - if (typeof newRow == "function") { - newRow = this.table.addRow(newRow(cell.row.getComponent())); - } else { - newRow = this.table.addRow(newRow); - } - } - - newRow.then(function () { - setTimeout(function () { - nav.next(); - }); - }); - } - } - } - } - }, - - navLeft: function navLeft(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().left(); - } - } - }, - - navRight: function navRight(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().right(); - } - } - }, - - navUp: function navUp(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().up(); - } - } - }, - - navDown: function navDown(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().down(); - } - } - }, - - undo: function undo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.undo(); - } - } - }, - - redo: function redo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.redo(); - } - } - }, - - copyToClipboard: function copyToClipboard(e) { - if (!this.table.modules.edit.currentCell) { - if (this.table.modExists("clipboard", true)) { - this.table.modules.clipboard.copy(false, true); - } - } - } - }; - - Tabulator.prototype.registerModule("keybindings", Keybindings); - var Menu = function Menu(table) { - this.table = table; //hold Tabulator object - this.menuEl = false; - this.blurEvent = this.hideMenu.bind(this); - }; - - Menu.prototype.initializeColumnHeader = function (column) { - var _this59 = this; - - var headerMenuEl; - - if (column.definition.headerContextMenu) { - column.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof column.definition.headerContextMenu == "function" ? column.definition.headerContextMenu(column.getComponent()) : column.definition.headerContextMenu; - - e.preventDefault(); - - _this59.loadMenu(e, column, menu); - }); - } - - if (column.definition.headerMenu) { - - headerMenuEl = document.createElement("span"); - headerMenuEl.classList.add("tabulator-header-menu-button"); - headerMenuEl.innerHTML = "⋮"; - - headerMenuEl.addEventListener("click", function (e) { - var menu = typeof column.definition.headerMenu == "function" ? column.definition.headerMenu(column.getComponent()) : column.definition.headerMenu; - e.stopPropagation(); - e.preventDefault(); - - _this59.loadMenu(e, column, menu); - }); - - column.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild); - } - }; - - Menu.prototype.initializeCell = function (cell) { - var _this60 = this; - - cell.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof cell.column.definition.contextMenu == "function" ? cell.column.definition.contextMenu(cell.getComponent()) : cell.column.definition.contextMenu; - - e.preventDefault(); - - _this60.loadMenu(e, cell, menu); - }); - }; - - Menu.prototype.initializeRow = function (row) { - var _this61 = this; - - row.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this61.table.options.rowContextMenu == "function" ? _this61.table.options.rowContextMenu(row.getComponent()) : _this61.table.options.rowContextMenu; - - e.preventDefault(); - - _this61.loadMenu(e, row, menu); - }); - }; - - Menu.prototype.loadMenu = function (e, component, menu) { - var _this62 = this; - - var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); - - //abort if no menu set - if (!menu || !menu.length) { - return; - } - - this.hideMenu(); - - this.menuEl = document.createElement("div"); - this.menuEl.classList.add("tabulator-menu"); - - menu.forEach(function (item) { - var itemEl = document.createElement("div"); - var label = item.label; - var disabled = item.disabled; - - if (item.separator) { - itemEl.classList.add("tabulator-menu-separator"); - } else { - itemEl.classList.add("tabulator-menu-item"); - - if (typeof label == "function") { - label = label(component.getComponent()); - } - - if (label instanceof Node) { - itemEl.appendChild(label); - } else { - itemEl.innerHTML = label; - } - - if (typeof disabled == "function") { - disabled = disabled(component.getComponent()); - } - - if (disabled) { - itemEl.classList.add("tabulator-menu-item-disabled"); - itemEl.addEventListener("click", function (e) { - e.stopPropagation(); - }); - } else { - itemEl.addEventListener("click", function (e) { - _this62.hideMenu(); - item.action(e, component.getComponent()); - }); - } - } - - _this62.menuEl.appendChild(itemEl); - }); - - this.menuEl.style.top = e.pageY + "px"; - this.menuEl.style.left = e.pageX + "px"; - - document.body.addEventListener("click", this.blurEvent); - this.table.rowManager.element.addEventListener("scroll", this.blurEvent); - - setTimeout(function () { - document.body.addEventListener("contextmenu", _this62.blurEvent); - }, 100); - - document.body.appendChild(this.menuEl); - - //move menu to start on right edge if it is too close to the edge of the screen - if (e.pageX + this.menuEl.offsetWidth >= document.body.offsetWidth) { - this.menuEl.style.left = ""; - this.menuEl.style.right = document.body.offsetWidth - e.pageX + "px"; - } - - //move menu to start on bottom edge if it is too close to the edge of the screen - if (e.pageY + this.menuEl.offsetHeight >= docHeight) { - this.menuEl.style.top = ""; - this.menuEl.style.bottom = docHeight - e.pageY + "px"; - } - }; - - Menu.prototype.hideMenu = function () { - if (this.menuEl.parentNode) { - this.menuEl.parentNode.removeChild(this.menuEl); - } - - if (this.blurEvent) { - document.body.removeEventListener("click", this.blurEvent); - document.body.removeEventListener("contextmenu", this.blurEvent); - this.table.rowManager.element.removeEventListener("scroll", this.blurEvent); - } - }; - - //default accessors - Menu.prototype.menus = {}; - - Tabulator.prototype.registerModule("menu", Menu); - var MoveColumns = function MoveColumns(table) { - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating column header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving column - this.toCol = false; //destination column - this.toColAfter = false; //position of moving column relative to the desitnation column - this.startX = 0; //starting position within header element - this.autoScrollMargin = 40; //auto scroll on edge when within margin - this.autoScrollStep = 5; //auto scroll distance in pixels - this.autoScrollTimeout = false; //auto scroll timeout - this.touchMove = false; - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); - }; - - MoveColumns.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.classList.add("tabulator-col-placeholder"); - - return el; - }; - - MoveColumns.prototype.initializeColumn = function (column) { - var self = this, - config = {}, - colEl; - - if (!column.modules.frozen) { - - colEl = column.getElement(); - - config.mousemove = function (e) { - if (column.parent === self.moving.parent) { - if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) { - if (self.toCol !== column || !self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling); - self.moveColumn(column, true); - } - } else { - if (self.toCol !== column || self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl); - self.moveColumn(column, false); - } - } - } - }.bind(self); - - colEl.addEventListener("mousedown", function (e) { - self.touchMove = false; - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, column); - }, self.checkPeriod); - } - }); - - colEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - self.bindTouchEvents(column); - } - - column.modules.moveColumn = config; - }; - - MoveColumns.prototype.bindTouchEvents = function (column) { - var self = this, - colEl = column.getElement(), - startXMove = false, - //shifting center position of the cell - dir = false, - currentCol, - nextCol, - prevCol, - nextColWidth, - prevColWidth, - nextColWidthLast, - prevColWidthLast; - - colEl.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentCol = column; - nextCol = column.nextColumn(); - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = column.prevColumn(); - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - nextColWidthLast = 0; - prevColWidthLast = 0; - startXMove = false; - - self.startMove(e, column); - }, self.checkPeriod); - }, { passive: true }); - - colEl.addEventListener("touchmove", function (e) { - var halfCol, diff, moveToCol; - - if (self.moving) { - self.moveHover(e); - - if (!startXMove) { - startXMove = e.touches[0].pageX; - } - - diff = e.touches[0].pageX - startXMove; - - if (diff > 0) { - if (nextCol && diff - nextColWidthLast > nextColWidth) { - moveToCol = nextCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement().nextSibling); - self.moveColumn(moveToCol, true); - } - } - } else { - if (prevCol && -diff - prevColWidthLast > prevColWidth) { - moveToCol = prevCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement()); - self.moveColumn(moveToCol, false); - } - } - } - - if (moveToCol) { - currentCol = moveToCol; - nextCol = moveToCol.nextColumn(); - nextColWidthLast = nextColWidth; - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = moveToCol.prevColumn(); - prevColWidthLast = prevColWidth; - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - } - } - }, { passive: true }); - - colEl.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - } - }); - }; - - MoveColumns.prototype.startMove = function (e, column) { - var element = column.getElement(); - - this.moving = column; - this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(element).left; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = column.getWidth() + "px"; - this.placeholderElement.style.height = column.getHeight() + "px"; - - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - this.table.columnManager.getElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.bottom = "0"; - - if (!this.touchMove) { - this._bindMouseMove(); - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - } - - this.moveHover(e); - }; - - MoveColumns.prototype._bindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().addEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); - }; - - MoveColumns.prototype._unbindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().removeEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); - }; - - MoveColumns.prototype.moveColumn = function (column, after) { - var movingCells = this.moving.getCells(); - - this.toCol = column; - this.toColAfter = after; - - if (after) { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling); - }); - } else { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl); - }); - } - }; - - MoveColumns.prototype.endMove = function (e) { - if (e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toCol) { - this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter); - } - - this.moving = false; - this.toCol = false; - this.toColAfter = false; - - if (!this.touchMove) { - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - } - } - }; - - MoveColumns.prototype.moveHover = function (e) { - var self = this, - columnHolder = self.table.columnManager.getElement(), - scrollLeft = columnHolder.scrollLeft, - xPos = (self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(columnHolder).left + scrollLeft, - scrollPos; - - self.hoverElement.style.left = xPos - self.startX + "px"; - - if (xPos - scrollLeft < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.max(0, scrollLeft - 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - - if (scrollLeft + columnHolder.clientWidth - xPos < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.min(columnHolder.clientWidth, scrollLeft + 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - }; - - Tabulator.prototype.registerModule("moveColumn", MoveColumns); - - var MoveRows = function MoveRows(table) { - - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating row header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving row - this.toRow = false; //destination row - this.toRowAfter = false; //position of moving row relative to the desitnation row - this.hasHandle = false; //row has handle instead of fully movable row - this.startY = 0; //starting Y position within header element - this.startX = 0; //starting X position within header element - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); - this.tableRowDropEvent = false; - - this.touchMove = false; - - this.connection = false; - this.connections = []; - - this.connectedTable = false; - this.connectedRow = false; - }; - - MoveRows.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - el.classList.add("tabulator-row-placeholder"); - - return el; - }; - - MoveRows.prototype.initialize = function (handle) { - this.connection = this.table.options.movableRowsConnectedTables; - }; - - MoveRows.prototype.setHandle = function (handle) { - this.hasHandle = handle; - }; - - MoveRows.prototype.initializeGroupHeader = function (group) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) { - if (self.toRow !== group || !self.toRowAfter) { - var rowEl = group.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(group, true); - } - } else { - if (self.toRow !== group || self.toRowAfter) { - var rowEl = group.getElement(); - if (rowEl.previousSibling) { - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(group, false); - } - } - } - }.bind(self); - - group.modules.moveRow = config; - }; - - MoveRows.prototype.initializeRow = function (row) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(row.element).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) { - if (self.toRow !== row || !self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(row, true); - } - } else { - if (self.toRow !== row || self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(row, false); - } - } - }.bind(self); - - if (!this.hasHandle) { - - rowEl = row.getElement(); - - rowEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, row); - }, self.checkPeriod); - } - }); - - rowEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(row, row.getElement()); - } - - row.modules.moveRow = config; - }; - - MoveRows.prototype.initializeCell = function (cell) { - var self = this, - cellEl = cell.getElement(); - - cellEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, cell.row); - }, self.checkPeriod); - } - }); - - cellEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(cell.row, cell.getElement()); - }; - - MoveRows.prototype.bindTouchEvents = function (row, element) { - var self = this, - startYMove = false, - //shifting center position of the cell - dir = false, - currentRow, - nextRow, - prevRow, - nextRowHeight, - prevRowHeight, - nextRowHeightLast, - prevRowHeightLast; - - element.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentRow = row; - nextRow = row.nextRow(); - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = row.prevRow(); - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - nextRowHeightLast = 0; - prevRowHeightLast = 0; - startYMove = false; - - self.startMove(e, row); - }, self.checkPeriod); - }, { passive: true }); - this.moving, this.toRow, this.toRowAfter; - element.addEventListener("touchmove", function (e) { - - var halfCol, diff, moveToRow; - - if (self.moving) { - e.preventDefault(); - - self.moveHover(e); - - if (!startYMove) { - startYMove = e.touches[0].pageY; - } - - diff = e.touches[0].pageY - startYMove; - - if (diff > 0) { - if (nextRow && diff - nextRowHeightLast > nextRowHeight) { - moveToRow = nextRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement().nextSibling); - self.moveRow(moveToRow, true); - } - } - } else { - if (prevRow && -diff - prevRowHeightLast > prevRowHeight) { - moveToRow = prevRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement()); - self.moveRow(moveToRow, false); - } - } - } - - if (moveToRow) { - currentRow = moveToRow; - nextRow = moveToRow.nextRow(); - nextRowHeightLast = nextRowHeight; - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = moveToRow.prevRow(); - prevRowHeightLast = prevRowHeight; - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - } - } - }); - - element.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - self.touchMove = false; - } - }); - }; - - MoveRows.prototype._bindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().addEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); - }; - - MoveRows.prototype._unbindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().removeEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); - }; - - MoveRows.prototype.startMove = function (e, row) { - var element = row.getElement(); - - this.setStartPosition(e, row); - - this.moving = row; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = row.getWidth() + "px"; - this.placeholderElement.style.height = row.getHeight() + "px"; - - if (!this.connection) { - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - } else { - this.table.element.classList.add("tabulator-movingrow-sending"); - this.connectToTables(row); - } - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - if (this.connection) { - document.body.appendChild(this.hoverElement); - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - this.hoverElement.style.width = this.table.element.clientWidth + "px"; - this.hoverElement.style.whiteSpace = "nowrap"; - this.hoverElement.style.overflow = "hidden"; - this.hoverElement.style.pointerEvents = "none"; - } else { - this.table.rowManager.getTableElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - - this._bindMouseMove(); - } - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - - this.moveHover(e); - }; - - MoveRows.prototype.setStartPosition = function (e, row) { - var pageX = this.touchMove ? e.touches[0].pageX : e.pageX, - pageY = this.touchMove ? e.touches[0].pageY : e.pageY, - element, - position; - - element = row.getElement(); - if (this.connection) { - position = element.getBoundingClientRect(); - - this.startX = position.left - pageX + window.pageXOffset; - this.startY = position.top - pageY + window.pageYOffset; - } else { - this.startY = pageY - element.getBoundingClientRect().top; - } - }; - - MoveRows.prototype.endMove = function (e) { - if (!e || e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - if (!this.connection) { - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - } - - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toRow) { - this.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter); - } - - this.moving = false; - this.toRow = false; - this.toRowAfter = false; - - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - - if (this.connection) { - this.table.element.classList.remove("tabulator-movingrow-sending"); - this.disconnectFromTables(); - } - } - }; - - MoveRows.prototype.moveRow = function (row, after) { - this.toRow = row; - this.toRowAfter = after; - }; - - MoveRows.prototype.moveHover = function (e) { - if (this.connection) { - this.moveHoverConnections.call(this, e); - } else { - this.moveHoverTable.call(this, e); - } - }; - - MoveRows.prototype.moveHoverTable = function (e) { - var rowHolder = this.table.rowManager.getElement(), - scrollTop = rowHolder.scrollTop, - yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop, - scrollPos; - - this.hoverElement.style.top = yPos - this.startY + "px"; - }; - - MoveRows.prototype.moveHoverConnections = function (e) { - this.hoverElement.style.left = this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX) + "px"; - this.hoverElement.style.top = this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY) + "px"; - }; - - //establish connection with other tables - MoveRows.prototype.connectToTables = function (row) { - var self = this, - connections = this.table.modules.comms.getConnections(this.connection); - - this.table.options.movableRowsSendingStart.call(this.table, connections); - - this.table.modules.comms.send(this.connection, "moveRow", "connect", { - row: row - }); - }; - - //disconnect from other tables - MoveRows.prototype.disconnectFromTables = function () { - var self = this, - connections = this.table.modules.comms.getConnections(this.connection); - - this.table.options.movableRowsSendingStop.call(this.table, connections); - - this.table.modules.comms.send(this.connection, "moveRow", "disconnect"); - }; - - //accept incomming connection - MoveRows.prototype.connect = function (table, row) { - var self = this; - if (!this.connectedTable) { - this.connectedTable = table; - this.connectedRow = row; - - this.table.element.classList.add("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.tableRowDropEvent = self.tableRowDrop.bind(self); - - self.table.element.addEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStart.call(this.table, row, table); - - return true; - } else { - console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable); - return false; - } - }; - - //close incomming connection - MoveRows.prototype.disconnect = function (table) { - var self = this; - if (table === this.connectedTable) { - this.connectedTable = false; - this.connectedRow = false; - - this.table.element.classList.remove("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().removeEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.table.element.removeEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStop.call(this.table, table); - } else { - console.warn("Move Row Error - trying to disconnect from non connected table"); - } - }; - - MoveRows.prototype.dropComplete = function (table, row, success) { - var sender = false; - - if (success) { - - switch (_typeof(this.table.options.movableRowsSender)) { - case "string": - sender = this.senders[this.table.options.movableRowsSender]; - break; - - case "function": - sender = this.table.options.movableRowsSender; - break; - } - - if (sender) { - sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - if (this.table.options.movableRowsSender) { - console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender); - } - } - - this.table.options.movableRowsSent.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - this.table.options.movableRowsSentFailed.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } - - this.endMove(); - }; - - MoveRows.prototype.tableRowDrop = function (e, row) { - var receiver = false, - success = false; - - e.stopImmediatePropagation(); - - switch (_typeof(this.table.options.movableRowsReceiver)) { - case "string": - receiver = this.receivers[this.table.options.movableRowsReceiver]; - break; - - case "function": - receiver = this.table.options.movableRowsReceiver; - break; - } - - if (receiver) { - success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver); - } - - if (success) { - this.table.options.movableRowsReceived.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - this.table.options.movableRowsReceivedFailed.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } - - this.table.modules.comms.send(this.connectedTable, "moveRow", "dropcomplete", { - row: row, - success: success - }); - }; - - MoveRows.prototype.receivers = { - insert: function insert(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData(), undefined, toRow); - return true; - }, - - add: function add(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData()); - return true; - }, - - update: function update(fromRow, toRow, fromTable) { - if (toRow) { - toRow.update(fromRow.getData()); - return true; - } - - return false; - }, - - replace: function replace(fromRow, toRow, fromTable) { - if (toRow) { - this.table.addRow(fromRow.getData(), undefined, toRow); - toRow.delete(); - return true; - } - - return false; - } - }; - - MoveRows.prototype.senders = { - delete: function _delete(fromRow, toRow, toTable) { - fromRow.delete(); - } - }; - - MoveRows.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "connect": - return this.connect(table, data.row); - break; - - case "disconnect": - return this.disconnect(table); - break; - - case "dropcomplete": - return this.dropComplete(table, data.row, data.success); - break; - } - }; - - Tabulator.prototype.registerModule("moveRow", MoveRows); - var Mutator = function Mutator(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types - this.enabled = true; - }; - - //initialize column mutator - Mutator.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - mutator; - - if (column.definition[key]) { - mutator = self.lookupMutator(column.definition[key]); - - if (mutator) { - match = true; - - config[key] = { - mutator: mutator, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.mutate = config; - } - }; - - Mutator.prototype.lookupMutator = function (value) { - var mutator = false; - - //set column mutator - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - if (this.mutators[value]) { - mutator = this.mutators[value]; - } else { - console.warn("Mutator Error - No such mutator found, ignoring: ", value); - } - break; - - case "function": - mutator = value; - break; - } - - return mutator; - }; - - //apply mutator to row - Mutator.prototype.transformRow = function (data, type, updatedData) { - var self = this, - key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - value; - - if (this.enabled) { - - self.table.columnManager.traverse(function (column) { - var mutator, params, component; - - if (column.modules.mutate) { - mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; - - if (mutator) { - value = column.getFieldValue(typeof updatedData !== "undefined" ? updatedData : data); - - if (type == "data" || typeof value !== "undefined") { - component = column.getComponent(); - params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; - column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); - } - } - } - }); - } - - return data; - }; - - //apply mutator to new cell value - Mutator.prototype.transformCell = function (cell, value) { - var mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false, - tempData = {}; - - if (mutator) { - tempData = Object.assign(tempData, cell.row.getData()); - cell.column.setFieldValue(tempData, value); - return mutator.mutator(value, tempData, "edit", mutator.params, cell.getComponent()); - } else { - return value; - } - }; - - Mutator.prototype.enable = function () { - this.enabled = true; - }; - - Mutator.prototype.disable = function () { - this.enabled = false; - }; - - //default mutators - Mutator.prototype.mutators = {}; - - Tabulator.prototype.registerModule("mutator", Mutator); - var Page = function Page(table) { - - this.table = table; //hold Tabulator object - - this.mode = "local"; - this.progressiveLoad = false; - - this.size = 0; - this.page = 1; - this.count = 5; - this.max = 1; - - this.displayIndex = 0; //index in display pipeline - - this.initialLoad = true; - - this.pageSizes = []; - - this.dataReceivedNames = {}; - this.dataSentNames = {}; - - this.createElements(); - }; - - Page.prototype.createElements = function () { - - var button; - - this.element = document.createElement("span"); - this.element.classList.add("tabulator-paginator"); - - this.pagesElement = document.createElement("span"); - this.pagesElement.classList.add("tabulator-pages"); - - button = document.createElement("button"); - button.classList.add("tabulator-page"); - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", ""); - button.setAttribute("title", ""); - - this.firstBut = button.cloneNode(true); - this.firstBut.setAttribute("data-page", "first"); - - this.prevBut = button.cloneNode(true); - this.prevBut.setAttribute("data-page", "prev"); - - this.nextBut = button.cloneNode(true); - this.nextBut.setAttribute("data-page", "next"); - - this.lastBut = button.cloneNode(true); - this.lastBut.setAttribute("data-page", "last"); - - if (this.table.options.paginationSizeSelector) { - this.pageSizeSelect = document.createElement("select"); - this.pageSizeSelect.classList.add("tabulator-page-size"); - } - }; - - Page.prototype.generatePageSizeSelectList = function () { - var _this63 = this; - - var pageSizes = []; - - if (this.pageSizeSelect) { - - if (Array.isArray(this.table.options.paginationSizeSelector)) { - pageSizes = this.table.options.paginationSizeSelector; - this.pageSizes = pageSizes; - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes.unshift(this.size); - } - } else { - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes = []; - - for (var i = 1; i < 5; i++) { - pageSizes.push(this.size * i); - } - - this.pageSizes = pageSizes; - } else { - pageSizes = this.pageSizes; - } - } - - while (this.pageSizeSelect.firstChild) { - this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild); - }pageSizes.forEach(function (item) { - var itemEl = document.createElement("option"); - itemEl.value = item; - itemEl.innerHTML = item; - - _this63.pageSizeSelect.appendChild(itemEl); - }); - - this.pageSizeSelect.value = this.size; - } - }; - - //setup pageination - Page.prototype.initialize = function (hidden) { - var self = this, - pageSelectLabel, - testElRow, - testElCell; - - //update param names - this.dataSentNames = Object.assign({}, this.paginationDataSentNames); - this.dataSentNames = Object.assign(this.dataSentNames, this.table.options.paginationDataSent); - - this.dataReceivedNames = Object.assign({}, this.paginationDataReceivedNames); - this.dataReceivedNames = Object.assign(this.dataReceivedNames, this.table.options.paginationDataReceived); - - //build pagination element - - //bind localizations - self.table.modules.localize.bind("pagination|first", function (value) { - self.firstBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|first_title", function (value) { - self.firstBut.setAttribute("aria-label", value); - self.firstBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|prev", function (value) { - self.prevBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|prev_title", function (value) { - self.prevBut.setAttribute("aria-label", value); - self.prevBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|next", function (value) { - self.nextBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|next_title", function (value) { - self.nextBut.setAttribute("aria-label", value); - self.nextBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|last", function (value) { - self.lastBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|last_title", function (value) { - self.lastBut.setAttribute("aria-label", value); - self.lastBut.setAttribute("title", value); - }); - - //click bindings - self.firstBut.addEventListener("click", function () { - self.setPage(1); - }); - - self.prevBut.addEventListener("click", function () { - self.previousPage(); - }); - - self.nextBut.addEventListener("click", function () { - self.nextPage().then(function () {}).catch(function () {}); - }); - - self.lastBut.addEventListener("click", function () { - self.setPage(self.max); - }); - - if (self.table.options.paginationElement) { - self.element = self.table.options.paginationElement; - } - - if (this.pageSizeSelect) { - pageSelectLabel = document.createElement("label"); - - self.table.modules.localize.bind("pagination|page_size", function (value) { - self.pageSizeSelect.setAttribute("aria-label", value); - self.pageSizeSelect.setAttribute("title", value); - pageSelectLabel.innerHTML = value; - }); - - self.element.appendChild(pageSelectLabel); - self.element.appendChild(self.pageSizeSelect); - - self.pageSizeSelect.addEventListener("change", function (e) { - self.setPageSize(self.pageSizeSelect.value); - self.setPage(1).then(function () {}).catch(function () {}); - }); - } - - //append to DOM - self.element.appendChild(self.firstBut); - self.element.appendChild(self.prevBut); - self.element.appendChild(self.pagesElement); - self.element.appendChild(self.nextBut); - self.element.appendChild(self.lastBut); - - if (!self.table.options.paginationElement && !hidden) { - self.table.footerManager.append(self.element, self); - } - - //set default values - self.mode = self.table.options.pagination; - - if (self.table.options.paginationSize) { - self.size = self.table.options.paginationSize; - } else { - testElRow = document.createElement("div"); - testElRow.classList.add("tabulator-row"); - testElRow.style.visibility = hidden; - - testElCell = document.createElement("div"); - testElCell.classList.add("tabulator-cell"); - testElCell.innerHTML = "Page Row Test"; - - testElRow.appendChild(testElCell); - - self.table.rowManager.getTableElement().appendChild(testElRow); - - self.size = Math.floor(self.table.rowManager.getElement().clientHeight / testElRow.offsetHeight); - - self.table.rowManager.getTableElement().removeChild(testElRow); - } - - // self.page = self.table.options.paginationInitialPage || 1; - self.count = self.table.options.paginationButtonCount; - - self.generatePageSizeSelectList(); - }; - - Page.prototype.initializeProgressive = function (mode) { - this.initialize(true); - this.mode = "progressive_" + mode; - this.progressiveLoad = true; - }; - - Page.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - Page.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - //calculate maximum page from number of rows - Page.prototype.setMaxRows = function (rowCount) { - if (!rowCount) { - this.max = 1; - } else { - this.max = Math.ceil(rowCount / this.size); - } - - if (this.page > this.max) { - this.page = this.max; - } - }; - - //reset to first page without triggering action - Page.prototype.reset = function (force, columnsChanged) { - if (this.mode == "local" || force) { - this.page = 1; - } - - if (columnsChanged) { - this.initialLoad = true; - } - - return true; - }; - - //set the maxmum page - Page.prototype.setMaxPage = function (max) { - - max = parseInt(max); - - this.max = max || 1; - - if (this.page > this.max) { - this.page = this.max; - this.trigger(); - } - }; - - //set current page number - Page.prototype.setPage = function (page) { - var _this64 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - - page = parseInt(page); - - if (page > 0 && page <= _this64.max) { - _this64.page = page; - _this64.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.page) { - self.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Requested page is out of range of 1 - " + _this64.max + ":", page); - reject(); - } - }); - }; - - Page.prototype.setPageToRow = function (row) { - var _this65 = this; - - return new Promise(function (resolve, reject) { - - var rows = _this65.table.rowManager.getDisplayRows(_this65.displayIndex - 1); - var index = rows.indexOf(row); - - if (index > -1) { - var page = Math.ceil((index + 1) / _this65.size); - - _this65.setPage(page).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - console.warn("Pagination Error - Requested row is not visible"); - reject(); - } - }); - }; - - Page.prototype.setPageSize = function (size) { - size = parseInt(size); - - if (size > 0) { - this.size = size; - } - - if (this.pageSizeSelect) { - // this.pageSizeSelect.value = size; - this.generatePageSizeSelectList(); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.page) { - this.table.modules.persistence.save("page"); - } - }; - - //setup the pagination buttons - Page.prototype._setPageButtons = function () { - var self = this; - - var leftSize = Math.floor((this.count - 1) / 2); - var rightSize = Math.ceil((this.count - 1) / 2); - var min = this.max - this.page + leftSize + 1 < this.count ? this.max - this.count + 1 : Math.max(this.page - leftSize, 1); - var max = this.page <= rightSize ? Math.min(this.count, this.max) : Math.min(this.page + rightSize, this.max); - - while (self.pagesElement.firstChild) { - self.pagesElement.removeChild(self.pagesElement.firstChild); - }if (self.page == 1) { - self.firstBut.disabled = true; - self.prevBut.disabled = true; - } else { - self.firstBut.disabled = false; - self.prevBut.disabled = false; - } - - if (self.page == self.max) { - self.lastBut.disabled = true; - self.nextBut.disabled = true; - } else { - self.lastBut.disabled = false; - self.nextBut.disabled = false; - } - - for (var i = min; i <= max; i++) { - if (i > 0 && i <= self.max) { - self.pagesElement.appendChild(self._generatePageButton(i)); - } - } - - this.footerRedraw(); - }; - - Page.prototype._generatePageButton = function (page) { - var self = this, - button = document.createElement("button"); - - button.classList.add("tabulator-page"); - if (page == self.page) { - button.classList.add("active"); - } - - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", "Show Page " + page); - button.setAttribute("title", "Show Page " + page); - button.setAttribute("data-page", page); - button.textContent = page; - - button.addEventListener("click", function (e) { - self.setPage(page); - }); - - return button; - }; - - //previous page - Page.prototype.previousPage = function () { - var _this66 = this; - - return new Promise(function (resolve, reject) { - if (_this66.page > 1) { - _this66.page--; - _this66.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this66.table.options.persistence && _this66.table.modExists("persistence", true) && _this66.table.modules.persistence.config.page) { - _this66.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Previous page would be less than page 1:", 0); - reject(); - } - }); - }; - - //next page - Page.prototype.nextPage = function () { - var _this67 = this; - - return new Promise(function (resolve, reject) { - if (_this67.page < _this67.max) { - _this67.page++; - _this67.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this67.table.options.persistence && _this67.table.modExists("persistence", true) && _this67.table.modules.persistence.config.page) { - _this67.table.modules.persistence.save("page"); - } - } else { - if (!_this67.progressiveLoad) { - console.warn("Pagination Error - Next page would be greater than maximum page of " + _this67.max + ":", _this67.max + 1); - } - reject(); - } - }); - }; - - //return current page number - Page.prototype.getPage = function () { - return this.page; - }; - - //return max page number - Page.prototype.getPageMax = function () { - return this.max; - }; - - Page.prototype.getPageSize = function (size) { - return this.size; - }; - - Page.prototype.getMode = function () { - return this.mode; - }; - - //return appropriate rows for current page - Page.prototype.getRows = function (data) { - var output, start, end; - - if (this.mode == "local") { - output = []; - start = this.size * (this.page - 1); - end = start + parseInt(this.size); - - this._setPageButtons(); - - for (var i = start; i < end; i++) { - if (data[i]) { - output.push(data[i]); - } - } - - return output; - } else { - - this._setPageButtons(); - - return data.slice(0); - } - }; - - Page.prototype.trigger = function () { - var _this68 = this; - - var left; - - return new Promise(function (resolve, reject) { - - switch (_this68.mode) { - case "local": - left = _this68.table.rowManager.scrollLeft; - - _this68.table.rowManager.refreshActiveData("page"); - _this68.table.rowManager.scrollHorizontal(left); - - _this68.table.options.pageLoaded.call(_this68.table, _this68.getPage()); - resolve(); - break; - - case "remote": - case "progressive_load": - case "progressive_scroll": - _this68.table.modules.ajax.blockActiveRequest(); - _this68._getRemotePage().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - break; - - default: - console.warn("Pagination Error - no such pagination mode:", _this68.mode); - reject(); - } - }); - }; - - Page.prototype._getRemotePage = function () { - var _this69 = this; - - var self = this, - oldParams, - pageParams; - - return new Promise(function (resolve, reject) { - - if (!self.table.modExists("ajax", true)) { - reject(); - } - - //record old params and restore after request has been made - oldParams = Tabulator.prototype.helpers.deepClone(self.table.modules.ajax.getParams() || {}); - pageParams = self.table.modules.ajax.getParams(); - - //configure request params - pageParams[_this69.dataSentNames.page] = self.page; - - //set page size if defined - if (_this69.size) { - pageParams[_this69.dataSentNames.size] = _this69.size; - } - - //set sort data if defined - if (_this69.table.options.ajaxSorting && _this69.table.modExists("sort")) { - var sorters = self.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - pageParams[_this69.dataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (_this69.table.options.ajaxFiltering && _this69.table.modExists("filter")) { - var filters = self.table.modules.filter.getFilters(true, true); - pageParams[_this69.dataSentNames.filters] = filters; - } - - self.table.modules.ajax.setParams(pageParams); - - self.table.modules.ajax.sendRequest(_this69.progressiveLoad).then(function (data) { - self._parseRemoteData(data); - resolve(); - }).catch(function (e) { - reject(); - }); - - self.table.modules.ajax.setParams(oldParams); - }); - }; - - Page.prototype._parseRemoteData = function (data) { - var self = this, - left, - data, - margin; - - if (typeof data[this.dataReceivedNames.last_page] === "undefined") { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property"); - } - - if (data[this.dataReceivedNames.data]) { - this.max = parseInt(data[this.dataReceivedNames.last_page]) || 1; - - if (this.progressiveLoad) { - switch (this.mode) { - case "progressive_load": - - if (this.page == 1) { - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - } else { - this.table.rowManager.addRows(data[this.dataReceivedNames.data]); - } - - if (this.page < this.max) { - setTimeout(function () { - self.nextPage().then(function () {}).catch(function () {}); - }, self.table.options.ajaxProgressiveLoadDelay); - } - break; - - case "progressive_scroll": - data = this.table.rowManager.getData().concat(data[this.dataReceivedNames.data]); - - this.table.rowManager.setData(data, true, this.initialLoad && this.page == 1); - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2; - - if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) { - self.nextPage().then(function () {}).catch(function () {}); - } - break; - } - } else { - left = this.table.rowManager.scrollLeft; - - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - - this.table.rowManager.scrollHorizontal(left); - - this.table.columnManager.scrollHorizontal(left); - - this.table.options.pageLoaded.call(this.table, this.getPage()); - } - - this.initialLoad = false; - } else { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property"); - } - }; - - //handle the footer element being redrawn - Page.prototype.footerRedraw = function () { - var footer = this.table.footerManager.element; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } else { - this.pagesElement.style.display = ''; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } - } - }; - - //set the paramter names for pagination requests - Page.prototype.paginationDataSentNames = { - "page": "page", - "size": "size", - "sorters": "sorters", - // "sort_dir":"sort_dir", - "filters": "filters" - // "filter_value":"filter_value", - // "filter_type":"filter_type", - }; - - //set the property names for pagination responses - Page.prototype.paginationDataReceivedNames = { - "current_page": "current_page", - "last_page": "last_page", - "data": "data" - }; - - Tabulator.prototype.registerModule("page", Page); - - var Persistence = function Persistence(table) { - this.table = table; //hold Tabulator object - this.mode = ""; - this.id = ""; - // this.persistProps = ["field", "width", "visible"]; - this.defWatcherBlock = false; - this.config = {}; - this.readFunc = false; - this.writeFunc = false; - }; - - // Test for whether localStorage is available for use. - Persistence.prototype.localStorageTest = function () { - var testKey = "_tabulator_test"; - - try { - window.localStorage.setItem(testKey, testKey); - window.localStorage.removeItem(testKey); - return true; - } catch (e) { - return false; - } - }; - - //setup parameters - Persistence.prototype.initialize = function () { - //determine persistent layout storage type - - var mode = this.table.options.persistenceMode, - id = this.table.options.persistenceID, - retreivedData; - - this.mode = mode !== true ? mode : this.localStorageTest() ? "local" : "cookie"; - - if (this.table.options.persistenceReaderFunc) { - if (typeof this.table.options.persistenceReaderFunc === "function") { - this.readFunc = this.table.options.persistenceReaderFunc; - } else { - if (this.readers[this.table.options.persistenceReaderFunc]) { - this.readFunc = this.readers[this.table.options.persistenceReaderFunc]; - } else { - console.warn("Persistence Read Error - invalid reader set", this.table.options.persistenceReaderFunc); - } - } - } else { - if (this.readers[this.mode]) { - this.readFunc = this.readers[this.mode]; - } else { - console.warn("Persistence Read Error - invalid reader set", this.mode); - } - } - - if (this.table.options.persistenceWriterFunc) { - if (typeof this.table.options.persistenceWriterFunc === "function") { - this.writeFunc = this.table.options.persistenceWriterFunc; - } else { - if (this.readers[this.table.options.persistenceWriterFunc]) { - this.writeFunc = this.readers[this.table.options.persistenceWriterFunc]; - } else { - console.warn("Persistence Write Error - invalid reader set", this.table.options.persistenceWriterFunc); - } - } - } else { - if (this.writers[this.mode]) { - this.writeFunc = this.writers[this.mode]; - } else { - console.warn("Persistence Write Error - invalid writer set", this.mode); - } - } - - //set storage tag - this.id = "tabulator-" + (id || this.table.element.getAttribute("id") || ""); - - this.config = { - sort: this.table.options.persistence === true || this.table.options.persistence.sort, - filter: this.table.options.persistence === true || this.table.options.persistence.filter, - group: this.table.options.persistence === true || this.table.options.persistence.group, - page: this.table.options.persistence === true || this.table.options.persistence.page, - columns: this.table.options.persistence === true ? ["title", "width", "visible"] : this.table.options.persistence.columns - }; - - //load pagination data if needed - if (this.config.page) { - retreivedData = this.retreiveData("page"); - - if (retreivedData) { - if (typeof retreivedData.paginationSize !== "undefined" && (this.config.page === true || this.config.page.size)) { - this.table.options.paginationSize = retreivedData.paginationSize; - } - - if (typeof retreivedData.paginationInitialPage !== "undefined" && (this.config.page === true || this.config.page.page)) { - this.table.options.paginationInitialPage = retreivedData.paginationInitialPage; - } - } - } - - //load group data if needed - if (this.config.group) { - retreivedData = this.retreiveData("group"); - - if (retreivedData) { - if (typeof retreivedData.groupBy !== "undefined" && (this.config.group === true || this.config.group.groupBy)) { - this.table.options.groupBy = retreivedData.groupBy; - } - if (typeof retreivedData.groupStartOpen !== "undefined" && (this.config.group === true || this.config.group.groupStartOpen)) { - this.table.options.groupStartOpen = retreivedData.groupStartOpen; - } - if (typeof retreivedData.groupHeader !== "undefined" && (this.config.group === true || this.config.group.groupHeader)) { - this.table.options.groupHeader = retreivedData.groupHeader; - } - } - } - }; - - Persistence.prototype.initializeColumn = function (column) { - var self = this, - def, - keys; - - if (this.config.columns) { - this.defWatcherBlock = true; - - def = column.getDefinition(); - - keys = this.config.columns === true ? Object.keys(def) : this.config.columns; - - keys.forEach(function (key) { - var props = Object.getOwnPropertyDescriptor(def, key); - var value = def[key]; - if (props) { - Object.defineProperty(def, key, { - set: function set(newValue) { - value = newValue; - - if (!self.defWatcherBlock) { - self.save("columns"); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - if (props.get) { - props.get(); - } - return value; - } - }); - } - }); - - this.defWatcherBlock = false; - } - }; - - //load saved definitions - Persistence.prototype.load = function (type, current) { - var data = this.retreiveData(type); - - if (current) { - data = data ? this.mergeDefinition(current, data) : current; - } - - return data; - }; - - //retreive data from memory - Persistence.prototype.retreiveData = function (type) { - return this.readFunc ? this.readFunc(this.id, type) : false; - }; - - //merge old and new column definitions - Persistence.prototype.mergeDefinition = function (oldCols, newCols) { - var self = this, - output = []; - - // oldCols = oldCols || []; - newCols = newCols || []; - - newCols.forEach(function (column, to) { - - var from = self._findColumn(oldCols, column), - keys; - - if (from) { - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(from); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - if (typeof column[key] !== "undefined") { - from[key] = column[key]; - } - }); - - if (from.columns) { - from.columns = self.mergeDefinition(from.columns, column.columns); - } - - output.push(from); - } - }); - - oldCols.forEach(function (column, i) { - var from = self._findColumn(newCols, column); - if (!from) { - if (output.length > i) { - output.splice(i, 0, column); - } else { - output.push(column); - } - } - }); - - return output; - }; - - //find matching columns - Persistence.prototype._findColumn = function (columns, subject) { - var type = subject.columns ? "group" : subject.field ? "field" : "object"; - - return columns.find(function (col) { - switch (type) { - case "group": - return col.title === subject.title && col.columns.length === subject.columns.length; - break; - - case "field": - return col.field === subject.field; - break; - - case "object": - return col === subject; - break; - } - }); - }; - - //save data - Persistence.prototype.save = function (type) { - var data = {}; - - switch (type) { - case "columns": - data = this.parseColumns(this.table.columnManager.getColumns()); - break; - - case "filter": - data = this.table.modules.filter.getFilters(); - break; - - case "sort": - data = this.validateSorters(this.table.modules.sort.getSort()); - break; - - case "group": - data = this.getGroupConfig(); - break; - - case "page": - data = this.getPageConfig(); - break; - } - - if (this.writeFunc) { - this.writeFunc(this.id, type, data); - } - }; - - //ensure sorters contain no function data - Persistence.prototype.validateSorters = function (data) { - data.forEach(function (item) { - item.column = item.field; - delete item.field; - }); - - return data; - }; - - Persistence.prototype.getGroupConfig = function () { - if (this.config.group) { - if (this.config.group === true || this.config.group.groupBy) { - data.groupBy = this.table.options.groupBy; - } - - if (this.config.group === true || this.config.group.groupStartOpen) { - data.groupStartOpen = this.table.options.groupStartOpen; - } - - if (this.config.group === true || this.config.group.groupHeader) { - data.groupHeader = this.table.options.groupHeader; - } - } - - return data; - }; - - Persistence.prototype.getPageConfig = function () { - var data = {}; - - if (this.config.page) { - if (this.config.page === true || this.config.page.size) { - data.paginationSize = this.table.modules.page.getPageSize(); - } - - if (this.config.page === true || this.config.page.page) { - data.paginationInitialPage = this.table.modules.page.getPage(); - } - } - - return data; - }; - - //parse columns for data to store - Persistence.prototype.parseColumns = function (columns) { - var self = this, - definitions = []; - - columns.forEach(function (column) { - var defStore = {}, - colDef = column.getDefinition(), - keys; - - if (column.isGroup) { - defStore.title = colDef.title; - defStore.columns = self.parseColumns(column.getColumns()); - } else { - defStore.field = column.getField(); - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(colDef); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - - switch (key) { - case "width": - defStore.width = column.getWidth(); - break; - case "visible": - defStore.visible = column.visible; - break; - - default: - defStore[key] = colDef[key]; - } - }); - } - - definitions.push(defStore); - }); - - return definitions; - }; - - // read peristence information from storage - Persistence.prototype.readers = { - local: function local(id, type) { - var data = localStorage.getItem(id + "-" + type); - - return data ? JSON.parse(data) : false; - }, - cookie: function cookie(id, type) { - var cookie = document.cookie, - key = id + "-" + type, - cookiePos = cookie.indexOf(key + "="), - end, - data; - - //if cookie exists, decode and load column data into tabulator - if (cookiePos > -1) { - cookie = cookie.substr(cookiePos); - - end = cookie.indexOf(";"); - - if (end > -1) { - cookie = cookie.substr(0, end); - } - - data = cookie.replace(key + "=", ""); - } - - return data ? JSON.parse(data) : false; - } - }; - - //write persistence information to storage - Persistence.prototype.writers = { - local: function local(id, type, data) { - localStorage.setItem(id + "-" + type, JSON.stringify(data)); - }, - cookie: function cookie(id, type, data) { - var expireDate = new Date(); - - expireDate.setDate(expireDate.getDate() + 10000); - - document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString(); - } - }; - - Tabulator.prototype.registerModule("persistence", Persistence); - - var Print = function Print(table) { - this.table = table; //hold Tabulator object - this.element = false; - this.manualBlock = false; - }; - - Print.prototype.initialize = function () { - window.addEventListener("beforeprint", this.replaceTable.bind(this)); - window.addEventListener("afterprint", this.cleanup.bind(this)); - }; - - Print.prototype.replaceTable = function () { - if (!this.manualBlock) { - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-table"); - - this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print")); - - this.table.element.style.display = "none"; - - this.table.element.parentNode.insertBefore(this.element, this.table.element); - } - }; - - Print.prototype.cleanup = function () { - document.body.classList.remove("tabulator-print-fullscreen-hide"); - - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - this.table.element.style.display = ""; - } - }; - - Print.prototype.printFullscreen = function (visible, style, config) { - var scrollX = window.scrollX, - scrollY = window.scrollY, - headerEl = document.createElement("div"), - footerEl = document.createElement("div"), - tableEl = this.table.modules.export.genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible, "print"), - headerContent, - footerContent; - - this.manualBlock = true; - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-fullscreen"); - - if (this.table.options.printHeader) { - headerEl.classList.add("tabulator-print-header"); - - headerContent = typeof this.table.options.printHeader == "function" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader; - - if (typeof headerContent == "string") { - headerEl.innerHTML = headerContent; - } else { - headerEl.appendChild(headerContent); - } - - this.element.appendChild(headerEl); - } - - this.element.appendChild(tableEl); - - if (this.table.options.printFooter) { - footerEl.classList.add("tabulator-print-footer"); - - footerContent = typeof this.table.options.printFooter == "function" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter; - - if (typeof footerContent == "string") { - footerEl.innerHTML = footerContent; - } else { - footerEl.appendChild(footerContent); - } - - this.element.appendChild(footerEl); - } - - document.body.classList.add("tabulator-print-fullscreen-hide"); - document.body.appendChild(this.element); - - if (this.table.options.printFormatter) { - this.table.options.printFormatter(this.element, tableEl); - } - - window.print(); - - this.cleanup(); - - window.scrollTo(scrollX, scrollY); - - this.manualBlock = false; - }; - - Tabulator.prototype.registerModule("print", Print); - var ReactiveData = function ReactiveData(table) { - this.table = table; //hold Tabulator object - this.data = false; - this.blocked = false; //block reactivity while performing update - this.origFuncs = {}; // hold original data array functions to allow replacement after data is done with - this.currentVersion = 0; - }; - - ReactiveData.prototype.watchData = function (data) { - var self = this, - pushFunc, - version; - - this.currentVersion++; - - version = this.currentVersion; - - self.unwatchData(); - - self.data = data; - - //override array push function - self.origFuncs.push = data.push; - - Object.defineProperty(self.data, "push", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, false); - }); - } - - return self.origFuncs.push.apply(data, arguments); - } - }); - - //override array unshift function - self.origFuncs.unshift = data.unshift; - - Object.defineProperty(self.data, "unshift", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, true); - }); - } - - return self.origFuncs.unshift.apply(data, arguments); - } - }); - - //override array shift function - self.origFuncs.shift = data.shift; - - Object.defineProperty(self.data, "shift", { - enumerable: false, - configurable: true, - value: function value() { - var row; - - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[0]); - - if (row) { - row.deleteActual(); - } - } - } - - return self.origFuncs.shift.call(data); - } - }); - - //override array pop function - self.origFuncs.pop = data.pop; - - Object.defineProperty(self.data, "pop", { - enumerable: false, - configurable: true, - value: function value() { - var row; - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]); - - if (row) { - row.deleteActual(); - } - } - } - return self.origFuncs.pop.call(data); - } - }); - - //override array splice function - self.origFuncs.splice = data.splice; - - Object.defineProperty(self.data, "splice", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments), - start = args[0] < 0 ? data.length + args[0] : args[0], - end = args[1], - newRows = args[2] ? args.slice(2) : false, - startRow; - - if (!self.blocked && version === self.currentVersion) { - - //add new rows - if (newRows) { - startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false; - - if (startRow) { - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, startRow, true); - }); - } else { - newRows = newRows.slice().reverse(); - - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, false, true); - }); - } - } - - //delete removed rows - if (end !== 0) { - var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end); - - oldRows.forEach(function (rowData, i) { - var row = self.table.rowManager.getRowFromDataObject(rowData); - - if (row) { - row.deleteActual(i !== oldRows.length - 1); - } - }); - } - - if (newRows || end !== 0) { - self.table.rowManager.reRenderInPosition(); - } - } - - return self.origFuncs.splice.apply(data, arguments); - } - }); - }; - - ReactiveData.prototype.unwatchData = function () { - if (this.data !== false) { - for (var key in this.origFuncs) { - Object.defineProperty(this.data, key, { - enumerable: true, - configurable: true, - writable: true, - value: this.origFuncs.key - }); - } - } - }; - - ReactiveData.prototype.watchRow = function (row) { - var self = this, - data = row.getData(); - - this.blocked = true; - - for (var key in data) { - this.watchKey(row, data, key); - } - - this.blocked = false; - }; - - ReactiveData.prototype.watchKey = function (row, data, key) { - var self = this, - props = Object.getOwnPropertyDescriptor(data, key), - value = data[key], - version = this.currentVersion; - - Object.defineProperty(data, key, { - set: function set(newValue) { - value = newValue; - if (!self.blocked && version === self.currentVersion) { - var update = {}; - update[key] = newValue; - row.updateData(update); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - - if (props.get) { - props.get(); - } - - return value; - } - }); - }; - - ReactiveData.prototype.unwatchRow = function (row) { - var data = row.getData(); - - for (var key in data) { - Object.defineProperty(data, key, { - value: data[key] - }); - } - }; - - ReactiveData.prototype.block = function () { - this.blocked = true; - }; - - ReactiveData.prototype.unblock = function () { - this.blocked = false; - }; - - Tabulator.prototype.registerModule("reactiveData", ReactiveData); - - var ResizeColumns = function ResizeColumns(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startX = false; - this.startWidth = false; - this.handle = null; - this.prevHandle = null; - }; - - ResizeColumns.prototype.initializeColumn = function (type, column, element) { - var self = this, - variableHeight = false, - mode = this.table.options.resizableColumns; - - //set column resize mode - if (type === "header") { - variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight; - column.modules.resize = { variableHeight: variableHeight }; - } - - if (mode === true || mode == type) { - - var handle = document.createElement('div'); - handle.className = "tabulator-col-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-col-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - var nearestColumn = column.getLastColumn(); - - if (nearestColumn && self._checkResizability(nearestColumn)) { - self.startColumn = column; - self._mouseDown(e, nearestColumn, handle); - } - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - //reszie column on double click - handle.addEventListener("dblclick", function (e) { - var col = column.getLastColumn(); - - if (col && self._checkResizability(col)) { - e.stopPropagation(); - col.reinitializeWidth(true); - } - }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - self.startColumn = column; - self._mouseDown(e, prevColumn, prevHandle); - } - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - //resize column on double click - prevHandle.addEventListener("dblclick", function (e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - e.stopPropagation(); - prevColumn.reinitializeWidth(true); - } - } - }); - - element.appendChild(handle); - element.appendChild(prevHandle); - } - }; - - ResizeColumns.prototype._checkResizability = function (column) { - return typeof column.definition.resizable != "undefined" ? column.definition.resizable : this.table.options.resizableColumns; - }; - - ResizeColumns.prototype._mouseDown = function (e, column, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - // self.table.columnManager.tempScrollBlock(); - - column.setWidth(self.startWidth + ((typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX) - self.startX)); - - if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - } - - function mouseUp(e) { - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = false; - } - - if (self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - - document.body.removeEventListener("mouseup", mouseUp); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.save("columns"); - } - - self.table.options.columnResized.call(self.table, column.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = true; - } - - self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX; - self.startWidth = column.getWidth(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); - }; - - Tabulator.prototype.registerModule("resizeColumns", ResizeColumns); - var ResizeRows = function ResizeRows(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startY = false; - this.startHeight = false; - this.handle = null; - this.prevHandle = null; - }; - - ResizeRows.prototype.initializeRow = function (row) { - var self = this, - rowEl = row.getElement(); - - var handle = document.createElement('div'); - handle.className = "tabulator-row-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-row-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - self.startRow = row; - self._mouseDown(e, row, handle); - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var prevRow = self.table.rowManager.prevDisplayRow(row); - - if (prevRow) { - self.startRow = prevRow; - self._mouseDown(e, prevRow, prevHandle); - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - rowEl.appendChild(handle); - rowEl.appendChild(prevHandle); - }; - - ResizeRows.prototype._mouseDown = function (e, row, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - row.setHeight(self.startHeight + ((typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY) - self.startY)); - } - - function mouseUp(e) { - - // //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = false; - // } - - document.body.removeEventListener("mouseup", mouseMove); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - self.table.options.rowResized.call(this.table, row.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = true; - // } - - self.startY = typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY; - self.startHeight = row.getHeight(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); - }; - - Tabulator.prototype.registerModule("resizeRows", ResizeRows); - var ResizeTable = function ResizeTable(table) { - this.table = table; //hold Tabulator object - this.binding = false; - this.observer = false; - this.containerObserver = false; - - this.tableHeight = 0; - this.tableWidth = 0; - this.containerHeight = 0; - this.containerWidth = 0; - - this.autoResize = false; - }; - - ResizeTable.prototype.initialize = function (row) { - var _this70 = this; - - var table = this.table, - tableStyle; - - this.tableHeight = table.element.clientHeight; - this.tableWidth = table.element.clientWidth; - - if (table.element.parentNode) { - this.containerHeight = table.element.parentNode.clientHeight; - this.containerWidth = table.element.parentNode.clientWidth; - } - - if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") { - - this.autoResize = true; - - this.observer = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this70.tableHeight != nodeHeight || _this70.tableWidth != nodeWidth) { - _this70.tableHeight = nodeHeight; - _this70.tableWidth = nodeWidth; - - if (table.element.parentNode) { - _this70.containerHeight = table.element.parentNode.clientHeight; - _this70.containerWidth = table.element.parentNode.clientWidth; - } - - table.redraw(); - } - } - }); - - this.observer.observe(table.element); - - tableStyle = window.getComputedStyle(table.element); - - if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) { - - this.containerObserver = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this70.containerHeight != nodeHeight || _this70.containerWidth != nodeWidth) { - _this70.containerHeight = nodeHeight; - _this70.containerWidth = nodeWidth; - _this70.tableHeight = table.element.clientHeight; - _this70.tableWidth = table.element.clientWidth; - - table.redraw(); - } - - table.redraw(); - } - }); - - this.containerObserver.observe(this.table.element.parentNode); - } - } else { - this.binding = function () { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - table.redraw(); - } - }; - - window.addEventListener("resize", this.binding); - } - }; - - ResizeTable.prototype.clearBindings = function (row) { - if (this.binding) { - window.removeEventListener("resize", this.binding); - } - - if (this.observer) { - this.observer.unobserve(this.table.element); - } - - if (this.containerObserver) { - this.containerObserver.unobserve(this.table.element.parentNode); - } - }; - - Tabulator.prototype.registerModule("resizeTable", ResizeTable); - var ResponsiveLayout = function ResponsiveLayout(table) { - this.table = table; //hold Tabulator object - this.columns = []; - this.hiddenColumns = []; - this.mode = ""; - this.index = 0; - this.collapseFormatter = []; - this.collapseStartOpen = true; - this.collapseHandleColumn = false; - }; - - //generate resposive columns list - ResponsiveLayout.prototype.initialize = function () { - var self = this, - columns = []; - - this.mode = this.table.options.responsiveLayout; - this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData; - this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen; - this.hiddenColumns = []; - - //detemine level of responsivity for each column - this.table.columnManager.columnsByIndex.forEach(function (column, i) { - if (column.modules.responsive) { - if (column.modules.responsive.order && column.modules.responsive.visible) { - column.modules.responsive.index = i; - columns.push(column); - - if (!column.visible && self.mode === "collapse") { - self.hiddenColumns.push(column); - } - } - } - }); - - //sort list by responsivity - columns = columns.reverse(); - columns = columns.sort(function (a, b) { - var diff = b.modules.responsive.order - a.modules.responsive.order; - return diff || b.modules.responsive.index - a.modules.responsive.index; - }); - - this.columns = columns; - - if (this.mode === "collapse") { - this.generateCollapsedContent(); - } - - //assign collapse column - for (var _iterator = this.table.columnManager.columnsByIndex, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var col = _ref; - - if (col.definition.formatter == "responsiveCollapse") { - this.collapseHandleColumn = col; - break; - } - } - - if (this.collapseHandleColumn) { - if (this.hiddenColumns.length) { - this.collapseHandleColumn.show(); - } else { - this.collapseHandleColumn.hide(); - } - } - }; - - //define layout information - ResponsiveLayout.prototype.initializeColumn = function (column) { - var def = column.getDefinition(); - - column.modules.responsive = { order: typeof def.responsive === "undefined" ? 1 : def.responsive, visible: def.visible === false ? false : true }; - }; - - ResponsiveLayout.prototype.initializeRow = function (row) { - var el; - - if (row.type !== "calc") { - el = document.createElement("div"); - el.classList.add("tabulator-responsive-collapse"); - - row.modules.responsiveLayout = { - element: el, - open: this.collapseStartOpen - }; - - if (!this.collapseStartOpen) { - el.style.display = 'none'; - } - } - }; - - ResponsiveLayout.prototype.layoutRow = function (row) { - var rowEl = row.getElement(); - - if (row.modules.responsiveLayout) { - rowEl.appendChild(row.modules.responsiveLayout.element); - this.generateCollapsedRowContent(row); - } - }; - - //update column visibility - ResponsiveLayout.prototype.updateColumnVisibility = function (column, visible) { - var index; - if (column.modules.responsive) { - column.modules.responsive.visible = visible; - this.initialize(); - } - }; - - ResponsiveLayout.prototype.hideColumn = function (column) { - var colCount = this.hiddenColumns.length; - - column.hide(false, true); - - if (this.mode === "collapse") { - this.hiddenColumns.unshift(column); - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !colCount) { - this.collapseHandleColumn.show(); - } - } - }; - - ResponsiveLayout.prototype.showColumn = function (column) { - var index; - - column.show(false, true); - //set column width to prevent calculation loops on uninitialized columns - column.setWidth(column.getWidth()); - - if (this.mode === "collapse") { - index = this.hiddenColumns.indexOf(column); - - if (index > -1) { - this.hiddenColumns.splice(index, 1); - } - - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !this.hiddenColumns.length) { - this.collapseHandleColumn.hide(); - } - } - }; - - //redraw columns to fit space - ResponsiveLayout.prototype.update = function () { - var self = this, - working = true; - - while (working) { - - var width = self.table.modules.layout.getMode() == "fitColumns" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth(); - - var diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width; - - if (diff < 0) { - //table is too wide - var column = self.columns[self.index]; - - if (column) { - self.hideColumn(column); - self.index++; - } else { - working = false; - } - } else { - - //table has spare space - var _column = self.columns[self.index - 1]; - - if (_column) { - if (diff > 0) { - if (diff >= _column.getWidth()) { - self.showColumn(_column); - self.index--; - } else { - working = false; - } - } else { - working = false; - } - } else { - working = false; - } - } - - if (!self.table.rowManager.activeRowsCount) { - self.table.rowManager.renderEmptyScroll(); - } - } - }; - - ResponsiveLayout.prototype.generateCollapsedContent = function () { - var self = this, - rows = this.table.rowManager.getDisplayRows(); - - rows.forEach(function (row) { - self.generateCollapsedRowContent(row); - }); - }; - - ResponsiveLayout.prototype.generateCollapsedRowContent = function (row) { - var el, contents; - - if (row.modules.responsiveLayout) { - el = row.modules.responsiveLayout.element; - - while (el.firstChild) { - el.removeChild(el.firstChild); - }contents = this.collapseFormatter(this.generateCollapsedRowData(row)); - if (contents) { - el.appendChild(contents); - } - } - }; - - ResponsiveLayout.prototype.generateCollapsedRowData = function (row) { - var self = this, - data = row.getData(), - output = [], - mockCellComponent; - - this.hiddenColumns.forEach(function (column) { - var value = column.getFieldValue(data); - - if (column.definition.title && column.field) { - if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) { - - mockCellComponent = { - value: false, - data: {}, - getValue: function getValue() { - return value; - }, - getData: function getData() { - return data; - }, - getElement: function getElement() { - return document.createElement("div"); - }, - getRow: function getRow() { - return row.getComponent(); - }, - getColumn: function getColumn() { - return column.getComponent(); - } - }; - - output.push({ - title: column.definition.title, - value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params) - }); - } else { - output.push({ - title: column.definition.title, - value: value - }); - } - } - }); - - return output; - }; - - ResponsiveLayout.prototype.formatCollapsedData = function (data) { - var list = document.createElement("table"), - listContents = ""; - - data.forEach(function (item) { - var div = document.createElement("div"); - - if (item.value instanceof Node) { - div.appendChild(item.value); - item.value = div.innerHTML; - } - - listContents += "" + item.title + "" + item.value + ""; - }); - - list.innerHTML = listContents; - - return Object.keys(data).length ? list : ""; - }; - - Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); - - var SelectRow = function SelectRow(table) { - this.table = table; //hold Tabulator object - this.selecting = false; //flag selecting in progress - this.lastClickedRow = false; //last clicked row - this.selectPrev = []; //hold previously selected element for drag drop selection - this.selectedRows = []; //hold selected rows - this.headerCheckboxElement = null; // hold header select element - }; - - SelectRow.prototype.clearSelectionData = function (silent) { - this.selecting = false; - this.lastClickedRow = false; - this.selectPrev = []; - this.selectedRows = []; - - if (!silent) { - this._rowSelectionChanged(); - } - }; - - SelectRow.prototype.initializeRow = function (row) { - var self = this, - element = row.getElement(); - - // trigger end of row selection - var endSelect = function endSelect() { - - setTimeout(function () { - self.selecting = false; - }, 50); - - document.body.removeEventListener("mouseup", endSelect); - }; - - row.modules.select = { selected: false }; - - //set row selection class - if (self.table.options.selectableCheck.call(this.table, row.getComponent())) { - element.classList.add("tabulator-selectable"); - element.classList.remove("tabulator-unselectable"); - - if (self.table.options.selectable && self.table.options.selectable != "highlight") { - if (self.table.options.selectableRangeMode === "click") { - element.addEventListener("click", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - self.lastClickedRow = self.lastClickedRow || row; - - var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow); - var rowIdx = self.table.rowManager.getDisplayRowIndex(row); - - var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx; - var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx; - - var rows = self.table.rowManager.getDisplayRows().slice(0); - var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1); - - if (e.ctrlKey || e.metaKey) { - toggledRows.forEach(function (toggledRow) { - if (toggledRow !== self.lastClickedRow) { - - if (self.table.options.selectable !== true && !self.isRowSelected(row)) { - if (self.selectedRows.length < self.table.options.selectable) { - self.toggleRow(toggledRow); - } - } else { - self.toggleRow(toggledRow); - } - } - }); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - - if (self.table.options.selectable !== true) { - if (toggledRows.length > self.table.options.selectable) { - toggledRows = toggledRows.slice(0, self.table.options.selectable); - } - } - - self.selectRows(toggledRows); - } - self.table._clearSelection(); - } else if (e.ctrlKey || e.metaKey) { - self.toggleRow(row); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - self.selectRows(row); - self.lastClickedRow = row; - } - }); - } else { - element.addEventListener("click", function (e) { - if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) { - self.table._clearSelection(); - } - - if (!self.selecting) { - self.toggleRow(row); - } - }); - - element.addEventListener("mousedown", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - - self.selecting = true; - - self.selectPrev = []; - - document.body.addEventListener("mouseup", endSelect); - document.body.addEventListener("keyup", endSelect); - - self.toggleRow(row); - - return false; - } - }); - - element.addEventListener("mouseenter", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.toggleRow(row); - - if (self.selectPrev[1] == row) { - self.toggleRow(self.selectPrev[0]); - } - } - }); - - element.addEventListener("mouseout", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.selectPrev.unshift(row); - } - }); - } - } - } else { - element.classList.add("tabulator-unselectable"); - element.classList.remove("tabulator-selectable"); - } - }; - - //toggle row selection - SelectRow.prototype.toggleRow = function (row) { - if (this.table.options.selectableCheck.call(this.table, row.getComponent())) { - if (row.modules.select && row.modules.select.selected) { - this._deselectRow(row); - } else { - this._selectRow(row); - } - } - }; - - //select a number of rows - SelectRow.prototype.selectRows = function (rows) { - var _this71 = this; - - var rowMatch; - - switch (typeof rows === 'undefined' ? 'undefined' : _typeof(rows)) { - case "undefined": - this.table.rowManager.rows.forEach(function (row) { - _this71._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - break; - - case "string": - - rowMatch = this.table.rowManager.findRow(rows); - - if (rowMatch) { - this._selectRow(rowMatch, true, true); - } else { - this.table.rowManager.getRows(rows).forEach(function (row) { - _this71._selectRow(row, true, true); - }); - } - - this._rowSelectionChanged(); - break; - - default: - if (Array.isArray(rows)) { - rows.forEach(function (row) { - _this71._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - } else { - this._selectRow(rows, false, true); - } - break; - } - }; - - //select an individual row - SelectRow.prototype._selectRow = function (rowInfo, silent, force) { - var index; - - //handle max row count - if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) { - if (this.selectedRows.length >= this.table.options.selectable) { - if (this.table.options.selectableRollingSelection) { - this._deselectRow(this.selectedRows[0]); - } else { - return false; - } - } - } - - var row = this.table.rowManager.findRow(rowInfo); - - if (row) { - if (this.selectedRows.indexOf(row) == -1) { - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = true; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = true; - } - row.getElement().classList.add("tabulator-selected"); - - this.selectedRows.push(row); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, true); - } - - if (!silent) { - this.table.options.rowSelected.call(this.table, row.getComponent()); - } - - this._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo); - } - } - }; - - SelectRow.prototype.isRowSelected = function (row) { - return this.selectedRows.indexOf(row) !== -1; - }; - - //deselect a number of rows - SelectRow.prototype.deselectRows = function (rows, silent) { - var self = this, - rowCount; - - if (typeof rows == "undefined") { - - rowCount = self.selectedRows.length; - - for (var i = 0; i < rowCount; i++) { - self._deselectRow(self.selectedRows[0], true); - } - - self._rowSelectionChanged(silent); - } else { - if (Array.isArray(rows)) { - rows.forEach(function (row) { - self._deselectRow(row, true); - }); - - self._rowSelectionChanged(silent); - } else { - self._deselectRow(rows, silent); - } - } - }; - - //deselect an individual row - SelectRow.prototype._deselectRow = function (rowInfo, silent) { - var self = this, - row = self.table.rowManager.findRow(rowInfo), - index; - - if (row) { - index = self.selectedRows.findIndex(function (selectedRow) { - return selectedRow == row; - }); - - if (index > -1) { - - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = false; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = false; - } - row.getElement().classList.remove("tabulator-selected"); - self.selectedRows.splice(index, 1); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, false); - } - - if (!silent) { - self.table.options.rowDeselected.call(this.table, row.getComponent()); - } - - self._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo); - } - } - }; - - SelectRow.prototype.getSelectedData = function () { - var data = []; - - this.selectedRows.forEach(function (row) { - data.push(row.getData()); - }); - - return data; - }; - - SelectRow.prototype.getSelectedRows = function () { - - var rows = []; - - this.selectedRows.forEach(function (row) { - rows.push(row.getComponent()); - }); - - return rows; - }; - - SelectRow.prototype._rowSelectionChanged = function (silent) { - if (this.headerCheckboxElement) { - if (this.selectedRows.length === 0) { - this.headerCheckboxElement.checked = false; - this.headerCheckboxElement.indeterminate = false; - } else if (this.table.rowManager.rows.length === this.selectedRows.length) { - this.headerCheckboxElement.checked = true; - this.headerCheckboxElement.indeterminate = false; - } else { - this.headerCheckboxElement.indeterminate = true; - this.headerCheckboxElement.checked = false; - } - } - - if (!silent) { - this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows()); - } - }; - - SelectRow.prototype.registerRowSelectCheckbox = function (row, element) { - if (!row._row.modules.select) { - row._row.modules.select = {}; - } - - row._row.modules.select.checkboxEl = element; - }; - - SelectRow.prototype.registerHeaderSelectCheckbox = function (element) { - this.headerCheckboxElement = element; - }; - - SelectRow.prototype.childRowSelection = function (row, select) { - var children = this.table.modules.dataTree.getChildren(row); - - if (select) { - for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var child = _ref2; - - this._selectRow(child, true); - } - } else { - for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - var _child = _ref3; - - this._deselectRow(_child, true); - } - } - }; - - Tabulator.prototype.registerModule("selectRow", SelectRow); - - var Sort = function Sort(table) { - this.table = table; //hold Tabulator object - this.sortList = []; //holder current sort - this.changed = false; //has the sort changed since last render - }; - - //initialize column header for sorting - Sort.prototype.initializeColumn = function (column, content) { - var self = this, - sorter = false, - colEl, - arrowEl; - - switch (_typeof(column.definition.sorter)) { - case "string": - if (self.sorters[column.definition.sorter]) { - sorter = self.sorters[column.definition.sorter]; - } else { - console.warn("Sort Error - No such sorter found: ", column.definition.sorter); - } - break; - - case "function": - sorter = column.definition.sorter; - break; - } - - column.modules.sort = { - sorter: sorter, dir: "none", - params: column.definition.sorterParams || {}, - startingDir: column.definition.headerSortStartingDir || "asc", - tristate: typeof column.definition.headerSortTristate !== "undefined" ? column.definition.headerSortTristate : this.table.options.headerSortTristate - }; - - if (typeof column.definition.headerSort === "undefined" ? this.table.options.headerSort !== false : column.definition.headerSort !== false) { - - colEl = column.getElement(); - - colEl.classList.add("tabulator-sortable"); - - arrowEl = document.createElement("div"); - arrowEl.classList.add("tabulator-arrow"); - //create sorter arrow - content.appendChild(arrowEl); - - //sort on click - colEl.addEventListener("click", function (e) { - var dir = "", - sorters = [], - match = false; - - if (column.modules.sort) { - if (column.modules.sort.tristate) { - if (column.modules.sort.dir == "none") { - dir = column.modules.sort.startingDir; - } else { - if (column.modules.sort.dir == column.modules.sort.startingDir) { - dir = column.modules.sort.dir == "asc" ? "desc" : "asc"; - } else { - dir = "none"; - } - } - } else { - switch (column.modules.sort.dir) { - case "asc": - dir = "desc"; - break; - - case "desc": - dir = "asc"; - break; - - default: - dir = column.modules.sort.startingDir; - } - } - - if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) { - sorters = self.getSort(); - - match = sorters.findIndex(function (sorter) { - return sorter.field === column.getField(); - }); - - if (match > -1) { - sorters[match].dir = dir; - - if (match != sorters.length - 1) { - match = sorters.splice(match, 1)[0]; - if (dir != "none") { - sorters.push(match); - } - } - } else { - if (dir != "none") { - sorters.push({ column: column, dir: dir }); - } - } - - //add to existing sort - self.setSort(sorters); - } else { - if (dir == "none") { - self.clear(); - } else { - //sort by column only - self.setSort(column, dir); - } - } - - self.table.rowManager.sorterRefresh(!self.sortList.length); - } - }); - } - }; - - //check if the sorters have changed since last use - Sort.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; - }; - - //return current sorters - Sort.prototype.getSort = function () { - var self = this, - sorters = []; - - self.sortList.forEach(function (item) { - if (item.column) { - sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir }); - } - }); - - return sorters; - }; - - //change sort list and trigger sort - Sort.prototype.setSort = function (sortList, dir) { - var self = this, - newSortList = []; - - if (!Array.isArray(sortList)) { - sortList = [{ column: sortList, dir: dir }]; - } - - sortList.forEach(function (item) { - var column; - - column = self.table.columnManager.findColumn(item.column); - - if (column) { - item.column = column; - newSortList.push(item); - self.changed = true; - } else { - console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column); - } - }); - - self.sortList = newSortList; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.sort) { - this.table.modules.persistence.save("sort"); - } - }; - - //clear sorters - Sort.prototype.clear = function () { - this.setSort([]); - }; - - //find appropriate sorter for column - Sort.prototype.findSorter = function (column) { - var row = this.table.rowManager.activeRows[0], - sorter = "string", - field, - value; - - if (row) { - row = row.getData(); - field = column.getField(); - - if (field) { - - value = column.getFieldValue(row); - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "undefined": - sorter = "string"; - break; - - case "boolean": - sorter = "boolean"; - break; - - default: - if (!isNaN(value) && value !== "") { - sorter = "number"; - } else { - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - sorter = "alphanum"; - } - } - break; - } - } - } - - return this.sorters[sorter]; - }; - - //work through sort list sorting data - Sort.prototype.sort = function (data) { - var self = this, - sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList, - sortListActual = [], - lastSort; - - if (self.table.options.dataSorting) { - self.table.options.dataSorting.call(self.table, self.getSort()); - } - - self.clearColumnHeaders(); - - if (!self.table.options.ajaxSorting) { - - //build list of valid sorters and trigger column specific callbacks before sort begins - sortList.forEach(function (item, i) { - var sortObj = item.column.modules.sort; - - if (item.column && sortObj) { - - //if no sorter has been defined, take a guess - if (!sortObj.sorter) { - sortObj.sorter = self.findSorter(item.column); - } - - item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params; - - sortListActual.push(item); - } - - self.setColumnHeader(item.column, item.dir); - }); - - //sort data - if (sortListActual.length) { - self._sortItems(data, sortListActual); - } - } else { - sortList.forEach(function (item, i) { - self.setColumnHeader(item.column, item.dir); - }); - } - - if (self.table.options.dataSorted) { - self.table.options.dataSorted.call(self.table, self.getSort(), self.table.rowManager.getComponents("active")); - } - }; - - //clear sort arrows on columns - Sort.prototype.clearColumnHeaders = function () { - this.table.columnManager.getRealColumns().forEach(function (column) { - if (column.modules.sort) { - column.modules.sort.dir = "none"; - column.getElement().setAttribute("aria-sort", "none"); - } - }); - }; - - //set the column header sort direction - Sort.prototype.setColumnHeader = function (column, dir) { - column.modules.sort.dir = dir; - column.getElement().setAttribute("aria-sort", dir); - }; - - //sort each item in sort list - Sort.prototype._sortItems = function (data, sortList) { - var _this72 = this; - - var sorterCount = sortList.length - 1; - - data.sort(function (a, b) { - var result; - - for (var i = sorterCount; i >= 0; i--) { - var sortItem = sortList[i]; - - result = _this72._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); - - if (result !== 0) { - break; - } - } - - return result; - }); - }; - - //process individual rows for a sort function on active data - Sort.prototype._sortRow = function (a, b, column, dir, params) { - var el1Comp, el2Comp, colComp; - - //switch elements depending on search direction - var el1 = dir == "asc" ? a : b; - var el2 = dir == "asc" ? b : a; - - a = column.getFieldValue(el1.getData()); - b = column.getFieldValue(el2.getData()); - - a = typeof a !== "undefined" ? a : ""; - b = typeof b !== "undefined" ? b : ""; - - el1Comp = el1.getComponent(); - el2Comp = el2.getComponent(); - - return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params); - }; - - //default data sorters - Sort.prototype.sorters = { - - //sort numbers - number: function number(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var decimal = params.decimalSeparator || "."; - var thousand = params.thousandSeparator || ","; - var emptyAlign = 0; - - a = parseFloat(String(a).split(thousand).join("").split(decimal).join(".")); - b = parseFloat(String(b).split(thousand).join("").split(decimal).join(".")); - - //handle non numeric values - if (isNaN(a)) { - emptyAlign = isNaN(b) ? 0 : -1; - } else if (isNaN(b)) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort strings - string: function string(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - var locale; - - //handle empty values - if (!a) { - emptyAlign = !b ? 0 : -1; - } else if (!b) { - emptyAlign = 1; - } else { - //compare valid values - switch (_typeof(params.locale)) { - case "boolean": - if (params.locale) { - locale = this.table.modules.localize.getLocale(); - } - break; - case "string": - locale = params.locale; - break; - } - - return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale); - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort date - date: function date(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "DD/MM/YYYY"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort hh:mm formatted times - time: function time(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "hh:mm"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort datetime - datetime: function datetime(a, b, aRow, bRow, column, dir, params) { - var format = params.format || "DD/MM/YYYY hh:mm:ss", - alignEmptyValues = params.alignEmptyValues, - emptyAlign = 0; - - if (typeof moment != "undefined") { - a = moment(a, format); - b = moment(b, format); - - if (!a.isValid()) { - emptyAlign = !b.isValid() ? 0 : -1; - } else if (!b.isValid()) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } else { - console.error("Sort Error - 'datetime' sorter is dependant on moment.js"); - } - }, - - //sort booleans - boolean: function boolean(a, b, aRow, bRow, column, dir, params) { - var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0; - var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0; - - return el1 - el2; - }, - - //sort if element contains any data - array: function array(a, b, aRow, bRow, column, dir, params) { - var el1 = 0; - var el2 = 0; - var type = params.type || "length"; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - function calc(value) { - - switch (type) { - case "length": - return value.length; - break; - - case "sum": - return value.reduce(function (c, d) { - return c + d; - }); - break; - - case "max": - return Math.max.apply(null, value); - break; - - case "min": - return Math.min.apply(null, value); - break; - - case "avg": - return value.reduce(function (c, d) { - return c + d; - }) / value.length; - break; - } - } - - //handle non array values - if (!Array.isArray(a)) { - alignEmptyValues = !Array.isArray(b) ? 0 : -1; - } else if (!Array.isArray(b)) { - alignEmptyValues = 1; - } else { - - //compare valid values - el1 = a ? calc(a) : 0; - el2 = b ? calc(b) : 0; - - return el1 - el2; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort if element contains any data - exists: function exists(a, b, aRow, bRow, column, dir, params) { - var el1 = typeof a == "undefined" ? 0 : 1; - var el2 = typeof b == "undefined" ? 0 : 1; - - return el1 - el2; - }, - - //sort alpha numeric strings - alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) { - var a, - b, - a1, - b1, - i = 0, - L, - rx = /(\d+)|(\D+)/g, - rd = /\d/; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - //handle empty values - if (!as && as !== 0) { - emptyAlign = !bs && bs !== 0 ? 0 : -1; - } else if (!bs && bs !== 0) { - emptyAlign = 1; - } else { - - if (isFinite(as) && isFinite(bs)) return as - bs; - a = String(as).toLowerCase(); - b = String(bs).toLowerCase(); - if (a === b) return 0; - if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1; - a = a.match(rx); - b = b.match(rx); - L = a.length > b.length ? b.length : a.length; - while (i < L) { - a1 = a[i]; - b1 = b[i++]; - if (a1 !== b1) { - if (isFinite(a1) && isFinite(b1)) { - if (a1.charAt(0) === "0") a1 = "." + a1; - if (b1.charAt(0) === "0") b1 = "." + b1; - return a1 - b1; - } else return a1 > b1 ? 1 : -1; - } - } - - return a.length > b.length; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } - }; - - Tabulator.prototype.registerModule("sort", Sort); - - var Validate = function Validate(table) { - this.table = table; - }; - - //validate - Validate.prototype.initializeColumn = function (column) { - var self = this, - config = [], - validator; - - if (column.definition.validator) { - - if (Array.isArray(column.definition.validator)) { - column.definition.validator.forEach(function (item) { - validator = self._extractValidator(item); - - if (validator) { - config.push(validator); - } - }); - } else { - validator = this._extractValidator(column.definition.validator); - - if (validator) { - config.push(validator); - } - } - - column.modules.validate = config.length ? config : false; - } - }; - - Validate.prototype._extractValidator = function (value) { - var type, params, pos; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - pos = value.indexOf(':'); - - if (pos > -1) { - type = value.substring(0, pos); - params = value.substring(pos + 1); - } else { - type = value; - } - - return this._buildValidator(type, params); - break; - - case "function": - return this._buildValidator(value); - break; - - case "object": - return this._buildValidator(value.type, value.parameters); - break; - } - }; - - Validate.prototype._buildValidator = function (type, params) { - - var func = typeof type == "function" ? type : this.validators[type]; - - if (!func) { - console.warn("Validator Setup Error - No matching validator found:", type); - return false; - } else { - return { - type: typeof type == "function" ? "function" : type, - func: func, - params: params - }; - } - }; - - Validate.prototype.validate = function (validators, cell, value) { - var self = this, - valid = []; - - if (validators) { - validators.forEach(function (item) { - if (!item.func.call(self, cell, value, item.params)) { - valid.push({ - type: item.type, - parameters: item.params - }); - } - }); - } - - return valid.length ? valid : true; - }; - - Validate.prototype.validators = { - - //is integer - integer: function integer(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; - }, - - //is float - float: function float(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && value % 1 !== 0; - }, - - //must be a number - numeric: function numeric(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return !isNaN(value); - }, - - //must be a string - string: function string(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return isNaN(value); - }, - - //maximum value - max: function max(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) <= parameters; - }, - - //minimum value - min: function min(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) >= parameters; - }, - - //minimum string length - minLength: function minLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length >= parameters; - }, - - //maximum string length - maxLength: function maxLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length <= parameters; - }, - - //in provided value list - in: function _in(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - if (typeof parameters == "string") { - parameters = parameters.split("|"); - } - - return value === "" || parameters.indexOf(value) > -1; - }, - - //must match provided regex - regex: function regex(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var reg = new RegExp(parameters); - - return reg.test(value); - }, - - //value must be unique in this column - unique: function unique(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var unique = true; - - var cellData = cell.getData(); - var column = cell.getColumn()._getSelf(); - - this.table.rowManager.rows.forEach(function (row) { - var data = row.getData(); - - if (data !== cellData) { - if (value == column.getFieldValue(data)) { - unique = false; - } - } - }); - - return unique; - }, - - //must have a value - required: function required(cell, value, parameters) { - return value !== "" && value !== null && typeof value !== "undefined"; - } - }; - - Tabulator.prototype.registerModule("validate", Validate); - - return Tabulator; -}); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/tabulator.min.js b/app/static/vendors/tabulator/js.old/tabulator.min.js deleted file mode 100644 index ea2c2b2..0000000 --- a/app/static/vendors/tabulator/js.old/tabulator.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tabulator=t()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;no?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){t=e[0];for(var n in t){var s={field:n,title:n},r=t[n];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),e.forEach(function(e,t){o._addColumn(e)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var n=new i(e,this),s=n.getElement(),r=o?this.findColumnIndex(o):o;if(o&&r>-1){var a=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(a,0,n),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,n),l.parentNode.insertBefore(s,l.nextSibling))}else t?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement())),n.columnRendered();return n},t.prototype.registerColumnField=function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach(function(e){var o;e.clearVerticalAlign(),(o=e.getHeight())>t&&(t=o)}),e.columns.forEach(function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)}),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e)))return this.columnsByField[e]||!1;if(e instanceof i)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.columns.find(function(t){return t.element===e})||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===e&&o.push(t.columnsByField[i])}),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){var e=this.columnsByIndex.findIndex(function(e){return e.visible});return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex(function(t){return e===t})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){this.columnsByIndex.forEach(function(t,o){e(t,o)})},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach(function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach(function(e){t.push(e.getDefinition(!0))}),t},t.prototype.getComponents=function(e){var t=this,o=[];return(e?t.columns:t.columnsByIndex).forEach(function(e){o.push(e.getComponent())}),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach(function(t){t.visible&&(e+=t.getWidth())}),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},t.prototype._moveColumnInArray=function(e,t,o,i,n){var s,r=e.indexOf(t);r>-1&&(e.splice(r,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=r,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach(function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(s,0,t)}}))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,r=0,a=e.getElement();return new Promise(function(l,c){if(void 0===t&&(t=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-i.element.clientWidth/2;break;case"right":r=a.clientWidth-i.headersElement.clientWidth}if(!o&&(s=a.offsetLeft)>0&&s+a.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,r;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),r="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=r>s?r:s)}),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i._addColumn(e,t,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&r.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(r)})},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(u.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():e?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var o=function(e){this._column=e,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e},o.prototype.getVisibility=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){return this._column.delete()},o.prototype.getSubColumns=function(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e},o.prototype.getParentColumn=function(){return this._column.parent instanceof i&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},o.prototype.setHeaderFilterValue=function(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)};var i=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach(function(t,o){var n=new e(t,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),t.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};i.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},i.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},i.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach(function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)})},i.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},i.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},i.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},i.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)},i.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign"))},i.prototype.setTooltip=function(){var e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,function(o){e.element.setAttribute("title",o||t.title)}):e.element.setAttribute("title",t.title):("function"==typeof o&&!1===(o=o(e.getComponent()))&&(o=""),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},i.prototype._buildHeader=function(){for(var e=this,t=e.definition;e.element.firstChild;)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&(void 0!==t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",function(t){e.setTooltip()})},i.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(e){n.headerClick(e,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(e){n.headerDblClick(e,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(e){n.headerContext(e,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&n.headerTap(e,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},i.prototype._buildColumnHeader=function(){var e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),void 0!==t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),void 0!==t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),void 0!==t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){t.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth(void 0===t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign=void 0===e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign=void 0===e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},i.prototype._buildColumnHeaderContent=function(){var e=(this.definition,this.table,document.createElement("div"));return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},i.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(e){e.stopPropagation(),n.focus()}),n.addEventListener("change",function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())}),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,function(e){n.value=e||t.title||" "}):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")}):e._formatColumnHeaderTitle(i,t.title||" ");return i},i.prototype._formatColumnHeaderTitle=function(e,t){var o,i,n,s,r,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),r=function(e){a.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n,r),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},i.prototype._buildGroupHeader=function(){var e=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){this.definition.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}this.element.appendChild(this.groupElement)},i.prototype._getFlatData=function(e){return e[this.field]},i.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},i.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},i.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},i.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},i.prototype.reinitializeWidth=function(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},i.prototype.fitToData=function(){var e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach(function(e){e.clearWidth()}));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach(function(e){var o=e.getWidth();o>t&&(t=o)}),t&&e.setWidthActual(t+1))},i.prototype.updateDefinition=function(e){var t=this;return new Promise(function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then(function(e){n.field==t.field&&(t.field=!1),t.delete().then(function(){o(e.getComponent())}).catch(function(e){i(e)})}).catch(function(e){i(e)}))})},i.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}, -i.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams"],i.prototype.getComponent=function(){return new o(this)};var n=function(e){this.table=e,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};n.prototype.createHolderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},n.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},n.prototype.getElement=function(){return this.element},n.prototype.getTableElement=function(){return this.tableElement},n.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},n.prototype.setColumnManager=function(e){this.columnManager=e},n.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t}),"virtual"===this.renderMode&&e.element.addEventListener("scroll",function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t})},n.prototype.findRow=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e))){if(void 0===e||null===e)return!1;return t.rows.find(function(o){return o.data[t.table.options.index]==e})||!1}if(e instanceof r)return e;if(e instanceof s)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.rows.find(function(t){return t.element===e})||!1}return!1},n.prototype.getRowFromDataObject=function(e){return this.rows.find(function(t){return t.data===e})||!1},n.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},n.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),r=e.getElement(),a=0;return new Promise(function(e,l){if(s>-1){if(void 0===t&&(t=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=u.prototype.helpers.elOffset(r).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&u.prototype.helpers.elVisible(r)&&(a=u.prototype.helpers.elOffset(r).top-u.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)}),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},n.prototype.addRow=function(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},n.prototype.addRows=function(e,t,o){var i=this,n=this,s=0,r=[];return new Promise(function(a,l){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),s=e.length-1,(void 0===o&&t||void 0!==o&&!t)&&e.reverse(),e.forEach(function(e,i){var s=n.addRow(e,t,o,!0);r.push(s)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(r)})},n.prototype.findAddRowPos=function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},n.prototype.addRowActual=function(e,t,o,i){var n,s,a=e instanceof r?e:new r(e||{},this),l=this.findAddRowPos(t),c=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==u.indexOf(o)?l?u[0]!==a&&(o=u[0],this._moveRowInArray(a.getGroup().rows,a,o,!l)):u[u.length-1]!==a&&(o=u[u.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!l)):this._moveRowInArray(a.getGroup().rows,a,o,!l))}return o&&(c=this.rows.indexOf(o)),o&&c>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,a)}),n>-1&&this.activeRows.splice(l?n:n+1,0,a),this.rows.splice(l?c:c+1,0,a)):l?(this.displayRowIterator(function(e){e.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(e){e.push(a)}),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),a},n.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},n.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator(function(n){i._moveRowInArray(n,e,t,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof T&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},n.prototype._moveRowInArray=function(e,t,o,i){var n,s,r,a;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){r=nn?s:n+1;for(var l=r;l<=a;l++)e[l]&&this.styleRow(e[l],l)}},n.prototype.clearData=function(){this.setData([])},n.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},n.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},n.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1)&&o},n.prototype.getData=function(e,t){var o=[];return this.getRows(e).forEach(function(e){"row"==e.type&&o.push(e.getData(t||"data"))}),o},n.prototype.getComponents=function(e){var t=[];return this.getRows(e).forEach(function(e){t.push(e.getComponent())}),t},n.prototype.getDataCount=function(e){return this.getRows(e).length},n.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(e){delete e.column}),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}t.modules.ajax.sendRequest().then(function(t){e._setDataActual(t,!0)}).catch(function(e){})},n.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},n.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},n.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},n.prototype.refreshActiveData=function(e,t,o){var i,n=this,s=this.table,r=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||r.indexOf(e)=0))break;s=a}else if(t-r[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-r[a].getElement().offsetTop>=0))break;s=a}}else n=this.vDomTop,s=this.vDomBottom;return r.slice(n,s+1)},n.prototype.displayRowIterator=function(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},n.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},n.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r]){var a=t-s[r].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(d=!1),i.vDomBottom++,c++}e?(i.vDomTopPad=t?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+l)/c),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",t&&(this.scrollTop=i.vDomTopPad+l+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&t&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=d?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},n.prototype.scrollVertical=function(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},n.prototype._addTopRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],r=s.getHeight()||this.vDomRowHeight;e>=r&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=r,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r,this.vDomTop--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},n.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},n.prototype._addBottomRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=r&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=r,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r,this.vDomBottom++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},n.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},n.prototype._quickNormalizeRowHeight=function(e){e.forEach(function(e){e.calcHeight()}),e.forEach(function(e){e.setCellHeight()}),e.length=0},n.prototype.normalizeHeight=function(){this.activeRows.forEach(function(e){e.normalizeHeight()})},n.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,this.fixedHeight||t==this.element.clientHeight||((e=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw()}},n.prototype.reinitialize=function(){this.rows.forEach(function(e){e.reinitialize()})},n.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},n.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1},n.prototype.redraw=function(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},n.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var s=function(e){this._row=e};s.prototype.getData=function(e){return this._row.getData(e)},s.prototype.getElement=function(){return this._row.getElement()},s.prototype.getCells=function(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e},s.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},s.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},s.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},s.prototype.delete=function(){return this._row.delete()},s.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},s.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},s.prototype.move=function(e,t){this._row.moveToRow(e,t)},s.prototype.update=function(e){return this._row.updateData(e)},s.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},s.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},s.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},s.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},s.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},s.prototype._getSelf=function(){return this._row},s.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},s.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},s.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},s.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},s.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},s.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},s.prototype.getTreeChildren=function(){ -return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},s.prototype.reformat=function(){return this._row.reinitialize()},s.prototype.getGroup=function(){return this._row.getGroup().getComponent()},s.prototype.getTable=function(){return this._row.table},s.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},s.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(e),this.generateElement()};r.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var e,t,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(e){i.table.options.rowClick(e,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(e){i.table.options.rowDblClick(e,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(e){i.table.options.rowContext(e,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(e){i.table.options.rowMouseEnter(e,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(e){i.table.options.rowMouseLeave(e,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(e){i.table.options.rowMouseOver(e,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(e){i.table.options.rowMouseOut(e,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(e){i.table.options.rowMouseMove(e,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null}))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(e){var t=this;if(!t.initialized||e){for(t.deleteCells();t.element.firstChild;)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach(function(e){t.element.appendChild(e.getElement()),e.cellRendered()}),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},r.prototype.setCellHeight=function(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0},r.prototype.clearCellHeight=function(){this.cells.forEach(function(e){e.clearHeight()})},r.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},r.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},r.prototype.getHeight=function(){return this.outerHeight},r.prototype.getWidth=function(){return this.element.offsetWidth},r.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},r.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},r.prototype.updateData=function(e){var t,o=this,i=u.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,r){"string"==typeof e&&(e=JSON.parse(e)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e;for(var a in t)o.data[a]=t[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in e){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()})},r.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},r.prototype.getCell=function(e){return e=this.table.columnManager.findColumn(e),this.cells.find(function(t){return t.column===e})},r.prototype.getCellIndex=function(e){return this.cells.findIndex(function(t){return t===e})},r.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&u.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},r.prototype.getCells=function(){return this.cells},r.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},r.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},r.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},r.prototype.delete=function(){var e=this;return new Promise(function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,(i=n.indexOf(e))&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e))&&(i=e.table.rowManager.rows[i-1]),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()})},r.prototype.deleteActual=function(e){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},r.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))},u.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},u.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},u.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",function(e){var s,r=n.files[0],a=new FileReader;a.readAsText(r),a.onload=function(e){try{s=JSON.parse(a.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t._setData(s).then(function(e){o(e)}).catch(function(e){o(e)})},a.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},u.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},u.prototype._setData=function(e,t,o,i,n){var s=this;return"string"!=typeof e?e?s.rowManager.setData(e,i,n):s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n):0==e.indexOf("{")||0==e.indexOf("[")?s.rowManager.setData(JSON.parse(e),i,n):s.modExists("ajax",!0)?(t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)):void 0},u.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},u.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},u.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},u.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},u.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},u.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},u.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},u.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},u.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},u.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise(function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},u.prototype.addData=function(e,t,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then(function(e){var t=[];e.forEach(function(e){t.push(e.getComponent())}),n(t)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},u.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise(function(s,r){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then(function(){n--,i.push(t.getComponent()),n||s(i)}):o.rowManager.addRows(e).then(function(e){n--,i.push(e[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},u.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},u.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},u.prototype.deleteRow=function(e){var t=this;return new Promise(function(o,i){function n(){++r==e.length&&a&&(s.rowManager.reRenderInPosition(),o())}var s=t,r=0,a=0,l=[];Array.isArray(e)||(e=[e]),e.forEach(function(e){var o=t.rowManager.findRow(e,!0);o?l.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),n())}),l.sort(function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1}),l.forEach(function(e){e.delete().then(function(){a++,n()}).catch(function(e){n(),i(e)})})})},u.prototype.addRow=function(e,t,o){var i=this;return new Promise(function(n,s){"string"==typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then(function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())})})},u.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(e){n(e)}):s=o.rowManager.addRows(t).then(function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())}).catch(function(e){n(e)})})},u.prototype.updateRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){i(s.getComponent())}).catch(function(e){n(e)}):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))})},u.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.rowManager.findRow(e);r?i.rowManager.scrollToRow(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))})},u.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},u.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},u.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},u.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},u.prototype.setColumns=function(e){this.columnManager.setColumns(e)},u.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},u.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},u.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},u.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},u.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},u.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},u.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},u.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},u.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,r).then(function(e){n(e.getComponent())}).catch(function(e){s(e)})})},u.prototype.deleteColumn=function(e){var t=this;return new Promise(function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then(function(){o()}).catch(function(e){i(e)}):(console.warn("Column Delete Error - No matching column found:",e),i())})},u.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then(function(e){i(e)}).catch(function(e){n(e)}):(console.warn("Column Update Error - No matching column found:",e),n())})},u.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)},u.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(e);r?i.columnManager.scrollToColumn(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))})},u.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},u.prototype.getLocale=function(){return this.modules.localize.getLocale()},u.prototype.getLang=function(e){return this.modules.localize.getLang(e)},u.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},u.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")},u.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},u.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},u.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},u.prototype.setFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o),this.rowManager.filterRefresh())},u.prototype.addFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o),this.rowManager.filterRefresh())},u.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},u.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},u.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},u.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},u.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},u.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},u.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},u.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},u.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},u.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},u.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},u.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},u.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},u.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},u.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise(function(e,t){t()})},u.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then(function(){o()}).catch(function(){i()}):i()):i()})},u.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then(function(){}).catch(function(){})},u.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},u.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},u.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},u.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},u.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},u.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},u.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},u.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},u.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},u.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},u.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},u.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},u.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().prev()},u.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().next()},u.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},u.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},u.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},u.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},u.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},u.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},u.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},u.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},u.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},u.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},u.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},u.prototype.moduleBindings={},u.prototype.extendModule=function(e,t,o){if(u.prototype.moduleBindings[e]){var i=u.prototype.moduleBindings[e].prototype[t];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)},u.prototype.registerModule=function(e,t){u.prototype.moduleBindings[e]=t},u.prototype.bindModules=function(){this.modules={};for(var e in u.prototype.moduleBindings)this.modules[e]=new u.prototype.moduleBindings[e](this)},u.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},u.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===_typeof(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},u.prototype.comms={tables:[],register:function(e){u.prototype.comms.tables.push(e)},deregister:function(e){var t=u.prototype.comms.tables.indexOf(e);t>-1&&u.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"==typeof e){if(o=document.querySelectorAll(e),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){function t(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function o(e,i,n,s){function r(e){return n*(e.column.definition.widthGrow||1)}function a(e){return t(e.width)-n*(e.column.definition.widthShrink||0)}var l=[],c=0,u=0,d=0,h=0,p=0,m=[];return e.forEach(function(e,t){var o=s?a(e):r(e);e.column.minWidth>=o?l.push(e):(m.push(e),p+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)}),l.length?(l.forEach(function(e){c+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth}),u=i-c,d=p?Math.floor(u/p):u,h=u-d*p,h+=o(m,u,d,s)):(h=p?i-Math.floor(i/p)*p:i,m.forEach(function(e){e.width=s?a(e):r(e)})),h}var i=this,n=i.table.element.clientWidth,s=0,r=0,a=0,l=0,c=[],u=[],d=0,h=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach(function(e){var o,i,n;e.visible&&(o=e.definition.width,i=parseInt(e.minWidth),o?(n=t(o),s+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),d+=e.definition.widthShrink)):(c.push({column:e,width:0}),a+=e.definition.widthGrow||1))}),r=n-s,l=Math.floor(r/a);var p=o(c,r,l,!1);c.length&&p>0&&(c[c.length-1].width+=+p),c.forEach(function(e){r-=e.width}),h=Math.abs(p)+r,h>0&&d&&(p=o(u,h,Math.floor(h/d),!0)),u.length&&(u[u.length-1].width-=p),c.forEach(function(e){e.column.setWidth(e.width)}),u.forEach(function(e){e.column.setWidth(e.width)})}},u.prototype.registerModule("layout",d);var h=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};h.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},h.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},h.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},h.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==_typeof(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},h.prototype.setLocale=function(e){function t(e,o){for(var i in e)"object"==_typeof(e[i])?(o[i]||(o[i]={}),t(e[i],o[i])):o[i]=e[i]}var o=this;if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!o.langs[e]){var i=e.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}o.locale=e,o.lang=u.prototype.helpers.deepClone(o.langs.default||{}),"default"!=e&&t(o.langs[e],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},h.prototype.getLocale=function(e){return self.locale},h.prototype.getLang=function(e){return e?this.langs[e]:this.lang},h.prototype.getText=function(e,t){var e=t?e+"|"+t:e,o=e.split("|");return this._getLangElement(o,this.locale)||""},h.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach(function(e){var t;i&&(t=i[e],i=void 0!==t&&t)}),i},h.prototype.bind=function(e,t){ -this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},h.prototype._executeBindings=function(){var e=this;for(var t in e.bindings)!function(t){e.bindings[t].forEach(function(o){o(e.getText(t),e.lang)})}(t)},h.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},u.prototype.registerModule("localize",h);var p=function(e){this.table=e};p.prototype.getConnections=function(e){var t,o=this,i=[];return t=u.prototype.comms.lookupTable(e),t.forEach(function(e){o.table!==e&&i.push(e)}),i},p.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach(function(e){e.tableComms(n.table.element,t,o,i)}),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},p.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},u.prototype.registerModule("comms",p);var m=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};m.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupAccessor(e.definition[r]))&&(o=!0,i[r]={accessor:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.accessor=i)},m.prototype.lookupAccessor=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t},m.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=u.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse(function(e){var o,s,r,a;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(o=e.getFieldValue(n))&&(a=e.getComponent(),r="function"==typeof s.params?s.params(o,n,t,a):s.params,e.setFieldValue(n,s.accessor(o,n,t,r,a)))}),n},m.prototype.accessors={},u.prototype.registerModule("accessor",m);var f=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};f.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},f.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},f.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},f.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},f.prototype.getParams=function(){return this.params||{}},f.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},f.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},f.prototype.setUrl=function(e){this.url=e},f.prototype.getUrl=function(){return this.url},f.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},f.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n=void 0!==o.precision&&o.precision;return e.forEach(function(e){((e=Number(e))"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),_typeof(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]}}},v.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},v.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},v.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.expandRow(e)})),i.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},v.prototype.setDisplayIndex=function(e){this.displayIndex=e},v.prototype.getDisplayIndex=function(){return this.displayIndex},v.prototype.getRows=function(e){var t=this,o=[];return e.forEach(function(e,i){var n,s;o.push(e),e instanceof r&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach(function(e){o.push(e)})))}),o},v.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n},v.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new r(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},v.prototype.expandRow=function(e,t){var o=e.modules.dataTree;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},v.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},v.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},v.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},v.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach(function(e){e instanceof r&&i.push(e)})),i},v.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof r&&o.push(e.getComponent())})),o},v.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},v.prototype.getChildField=function(){return this.field},v.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},u.prototype.registerModule("dataTree",v);var y=function(e){this.table=e,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={},this.active=!1};y.prototype.download=function(e,t,o,i,n){function s(o,i){n?!0===n?r.triggerDownload(o,i,e,t,!0):n(o):r.triggerDownload(o,i,e,t)}var r=this,a=!1;this.processConfig(),this.active=i,"function"==typeof e?a=e:r.downloaders[e]?a=r.downloaders[e]:console.warn("Download Error - No such download type found: ",e),this.processColumns(),a&&a.call(this,r.processDefinitions(),r.processData(i||"active"),o||{},s,this.config)},y.prototype.processConfig=function(){var e={columnGroups:!0,rowGroups:!0,columnCalcs:!0,dataTree:!0};if(this.table.options.downloadConfig)for(var t in this.table.options.downloadConfig)e[t]=this.table.options.downloadConfig[t];this.config.rowGroups=e.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows"),e.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0),e.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0),e.dataTree&&this.table.options.dataTree&&this.table.modExists("dataTree")&&(this.config.dataTree=!0)},y.prototype.processColumns=function(){var e=this;e.columnsByIndex=[],e.columnsByField={},e.table.columnManager.columnsByIndex.forEach(function(t){t.field&&!1!==t.definition.download&&(t.visible||!t.visible&&t.definition.download)&&(e.columnsByIndex.push(t),e.columnsByField[t.field]=t)})},y.prototype.processDefinitions=function(){var e=this,t=[];return this.config.columnGroups?e.table.columnManager.columns.forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}):e.columnsByIndex.forEach(function(o){!1!==o.download&&t.push(e.processDefinition(o))}),t},y.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=this.processDefinition(e),s={type:"group",title:n.title,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);o.depth>i&&(i=o.depth),o&&(s.width+=o.width,s.subGroups.push(o))}),s.depth+=i,!s.width)return!1}else{if(!e.field||!1===e.definition.download||!(e.visible||!e.visible&&e.definition.download))return!1;s.width=1,s.definition=n}return s},y.prototype.processDefinition=function(e){var t={};for(var o in e.definition)t[o]=e.definition[o];return void 0!==e.definition.downloadTitle&&(t.title=e.definition.downloadTitle),t},y.prototype.processData=function(e){var t=this,o=this,i=[],n=[],s=!1,r={};return this.config.rowGroups?("visible"==e?(s=o.table.rowManager.getRows(e),s.forEach(function(e){ -if("row"==e.type){var t=e.getGroup();-1===n.indexOf(t)&&n.push(t)}})):n=this.table.modules.groupRows.getGroups(),n.forEach(function(e){i.push(t.processGroupData(e,s))})):(this.config.dataTree&&(e=e="display"),i=o.table.rowManager.getData(e,"download")),this.config.columnCalcs&&(r=this.table.getCalcResults(),i={calcs:r,data:i}),"function"==typeof o.table.options.downloadDataFormatter&&(i=o.table.options.downloadDataFormatter(i)),i},y.prototype.processGroupData=function(e,t){var o=this,i=e.getSubGroups(),n={type:"group",key:e.key};return i.length?(n.subGroups=[],i.forEach(function(e){n.subGroups.push(o.processGroupData(e,t))})):t?(n.rows=[],e.rows.forEach(function(e){t.indexOf(e)>-1&&n.rows.push(e.getData("download"))})):n.rows=e.getData(!0,"download"),n},y.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),r=new Blob([e],{type:t}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(r=this.table.options.downloadReady.call(this.table,e,r))&&(n?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,i):(s.setAttribute("href",window.URL.createObjectURL(r)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},y.prototype.getFieldValue=function(e,t){var o=this.columnsByField[e];return!!o&&o.getFieldValue(t)},y.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},y.prototype.downloaders={csv:function(e,t,o,i,n){function s(e,t){e.subGroups?e.subGroups.forEach(function(e){s(e,t+1)}):(d.push('"'+String(e.title).split('"').join('""')+'"'),h.push(e.definition.field))}function r(e){e.forEach(function(e){var t=[];h.forEach(function(o){var i=u.getFieldValue(o,e);switch(void 0===i?"undefined":_typeof(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}t.push('"'+String(i).split('"').join('""')+'"')}),l.push(t.join(p))})}function a(e){e.subGroups?e.subGroups.forEach(function(e){a(e)}):r(e.rows)}var l,c,u=this,d=[],h=[],p=o&&o.delimiter?o.delimiter:",";n.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),e.forEach(function(e){s(e,0)})):function(){e.forEach(function(e){d.push('"'+String(e.title).split('"').join('""')+'"'),h.push(e.field)})}(),l=[d.join(p)],n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),n.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),t.forEach(function(e){a(e)})):r(t),c=l.join("\n"),o.bom&&(c="\ufeff"+c),i(c,"text/csv")},json:function(e,t,o,i,n){var s;n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),s=JSON.stringify(t,null,"\t"),i(s,"application/json")},pdf:function(e,t,o,i,n){function s(e,t){var o=e.width,i=1,n={content:e.title||""};if(e.subGroups?(e.subGroups.forEach(function(e){s(e,t+1)}),i=1):(h.push(e.definition.field),i=g-t),n.rowSpan=i,p[t].push(n),o--,i>1)for(var r=t+1;rg&&(g=e.depth)});for(var C=0;C1&&h[t].push({type:"hoz",start:f[t].length,end:f[t].length+e.width-1}),f[t].push(e.title),e.subGroups?e.subGroups.forEach(function(e){o(e,t+1)}):(g.push(e.definition.field),i(g.length),h[t].push({type:"vert",start:g.length-1}))}function i(){var e=0;f.forEach(function(t){var o=t.length;o>e&&(e=o)}),f.forEach(function(t){var o=t.length;if(oo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o)}},w.prototype.edit=function(e,t,o){function i(t){if(c.currentCell===e){var o=!0;return e.column.modules.validate&&c.table.modExists("validate")&&(o=c.table.modules.validate.validate(e.column.modules.validate,e.getComponent(),t)),!0===o?(c.clearEditor(),e.setValue(t,!0),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e),!0):(c.invalidEdit=!0,h.classList.add("tabulator-validation-fail"),c.focusCellNoEvent(e,!0),d(),c.table.options.validationFailed.call(c.table,e.getComponent(),t,o),!1)}}function n(){c.currentCell===e&&(c.cancelEdit(),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e))}function s(e){d=e}var r,a,l,c=this,u=!0,d=function(){},h=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":u=e.column.modules.edit.check(e.getComponent());break;case"boolean":u=e.column.modules.edit.check}if(u||o){if(c.cancelEdit(),c.currentCell=e,this.focusScrollAdjust(e),a=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,a)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,a),c.table.options.cellEditing.call(this.table,a),l="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(a):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(c,a,s,i,n,l)))return h.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),h.blur(),!1;for(h.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(r),d();for(var p=h.children,m=0;m46){if(o>=i.length)return t.preventDefault(),t.stopPropagation(),a=!1,!1;switch(i[o]){case n:if(l.toUpperCase()==l.toLowerCase())return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case s:if(isNaN(l))return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case r:break;default:if(l!==i[o])return t.preventDefault(),t.stopPropagation(),a=!1,!1}a=!0}}),e.addEventListener("keyup",function(i){i.keyCode>46&&t.maskAutoFill&&o(e.value.length)}),e.placeholder||(e.placeholder=i),t.maskAutoFill&&o(e.value.length)},w.prototype.editors={input:function(e,t,o,i,n){function s(e){(null===r||void 0===r)&&""!==a.value||a.value!==r?o(a.value)&&(r=a.value):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=void 0!==r?r:"",t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("change",s),a.addEventListener("blur",s),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s(e);break;case 27:i()}}),n.mask&&this.table.modules.edit.maskInput(a,n),a},textarea:function(e,t,o,i,n){function s(t){(null===r||void 0===r)&&""!==c.value||c.value!==r?(o(c.value)&&(r=c.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):i()}var r=e.getValue(),a=n.verticalNavigation||"hybrid",l=String(null!==r&&void 0!==r?r:""),c=(l.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),u=0;if(c.style.display="block",c.style.padding="2px",c.style.height="100%",c.style.width="100%",c.style.boxSizing="border-box",c.style.whiteSpace="pre-wrap",c.style.resize="none",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),c.setAttribute(d,c.getAttribute(d)+n.elementAttributes["+"+d])):c.setAttribute(d,n.elementAttributes[d]);return c.value=l,t(function(){c.focus({preventScroll:!0}),c.style.height="100%"}),c.addEventListener("change",s),c.addEventListener("blur",s),c.addEventListener("keyup",function(){c.style.height="";var t=c.scrollHeight;c.style.height=t+"px",t!=u&&(u=t,e.getRow().normalizeHeight())}),c.addEventListener("keydown",function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==a||"hybrid"==a&&c.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&c.selectionStart!==c.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(c,n),c},number:function(e,t,o,i,n){function s(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==r?o(e)&&(r=e):i()}var r=e.getValue(),a=n.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==n.max&&l.setAttribute("max",n.max),void 0!==n.min&&l.setAttribute("min",n.min),void 0!==n.step&&l.setAttribute("step",n.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var c in n.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+n.elementAttributes["+"+c])):l.setAttribute(c,n.elementAttributes[c]);l.value=r;var u=function(e){s()};return t(function(){l.removeEventListener("blur",u),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",u)}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(l,n),l},range:function(e,t,o,i,n){function s(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=r?o(e)&&(r=e):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),void 0!==n.max&&a.setAttribute("max",n.max),void 0!==n.min&&a.setAttribute("min",n.min),void 0!==n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=r,t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("blur",function(e){s()}),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:s();break;case 27:i()}}),a},select:function(e,t,o,i,n){function s(t){var o,i={},s=f.table.getData();return o=t?f.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach(function(e){var t=o.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(i[t]=!0)}),i=n.sortValuesList?"asc"==n.sortValuesList?Object.keys(i).sort():Object.keys(i).sort().reverse():Object.keys(i)):console.warn("unable to find matching column to create select lookup list:",t),i}function r(t,o){function i(e){var e={label:n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return e.value!==o&&(isNaN(parseFloat(e.value))||isNaN(parseFloat(e.value))||parseFloat(e.value)!==parseFloat(o))||l(e),s.push(e),r.push(e),e}var s=[],r=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},r.push(t),e.options.forEach(function(e){i(e)})):i(e):(t={label:n.listItemFormatter?n.listItemFormatter(e,e):e,value:e,element:!1},t.value!==o&&(isNaN(parseFloat(t.value))||isNaN(parseFloat(t.value))||parseFloat(t.value)!==parseFloat(o))||l(t),s.push(t),r.push(t))});else for(var c in t){var u={label:n.listItemFormatter?n.listItemFormatter(c,t[c]):t[c],value:c,element:!1};u.value!==o&&(isNaN(parseFloat(u.value))||isNaN(parseFloat(u.value))||parseFloat(u.value)!==parseFloat(o))||l(u),s.push(u),r.push(u)}C=s,x=r,a()}function a(){for(;E.firstChild;)E.removeChild(E.firstChild);x.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){l(e),c()}),e===R&&t.classList.add("active")),t.addEventListener("mousedown",function(){M=!1,setTimeout(function(){M=!0},10)}),e.element=t),E.appendChild(t)})}function l(e){R&&R.element&&R.element.classList.remove("active"),R=e,w.value=" "===e.label?"":e.label,e.element&&e.element.classList.add("active")}function c(){p(),b!==R.value?(b=R.value,o(R.value)):i()}function d(){p(),i()}function h(){if(!E.parentNode){!0===n.values?r(s(),y):"string"==typeof n.values?r(s(n.values),y):r(n.values||[],y);var e=u.prototype.helpers.elOffset(g);E.style.minWidth=g.offsetWidth+"px",E.style.top=e.top+g.offsetHeight+"px",E.style.left=e.left+"px",E.addEventListener("mousedown",function(e){M=!1,setTimeout(function(){M=!0},10)}),document.body.appendChild(E)}}function p(){E.parentNode&&E.parentNode.removeChild(E),m()}function m(){f.table.rowManager.element.removeEventListener("scroll",d)}var f=this,g=e.getElement(),b=e.getValue(),v=n.verticalNavigation||"editor",y=void 0!==b||null===b?b:void 0!==n.defaultValue?n.defaultValue:"",w=document.createElement("input"),E=document.createElement("div"),C=[],x=[],R={},M=!0;if(this.table.rowManager.element.addEventListener("scroll",d),(Array.isArray(n)||!Array.isArray(n)&&"object"===(void 0===n?"undefined":_typeof(n))&&!n.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),n={values:n}),w.setAttribute("type","text"),w.style.padding="4px",w.style.width="100%",w.style.boxSizing="border-box",w.style.cursor="default",w.readOnly=0!=this.currentCell,n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var L in n.elementAttributes)"+"==L.charAt(0)?(L=L.slice(1),w.setAttribute(L,w.getAttribute(L)+n.elementAttributes["+"+L])):w.setAttribute(L,n.elementAttributes[L]);return w.value=void 0!==b||null===b?b:"",w.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=C.indexOf(R),("editor"==v||"hybrid"==v&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&l(C[t-1]));break;case 40:t=C.indexOf(R),("editor"==v||"hybrid"==v&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&r.push(t)}),d(r,t))}function a(e){var t=document.createElement("div");c(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,M.appendChild(t))}function l(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var o={title:n.listItemFormatter?n.listItemFormatter(e,e):e,value:e};t.push(o)});else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function c(){for(;M.firstChild;)M.removeChild(M.firstChild)}function d(e,t){e.length?h(e,t):n.emptyPlaceholder&&a(n.emptyPlaceholder)}function h(e,t){var o=!1;c(),L=e,L.forEach(function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",function(t){f(e),p()}),i.addEventListener("mousedown",function(e){D=!1,setTimeout(function(){D=!0},10)}),e.element=i,t&&e.value==E&&(R.value=e.title,e.element.classList.add("active"),o=!0),e===T&&(e.element.classList.add("active"),o=!0)),M.appendChild(i)}),o||f(!1)}function p(){g(),T?E!==T.value?(E=T.value,R.value=T.title,o(T.value)):i():n.freetext?(E=R.value,o(R.value)):n.allowEmpty&&""===R.value?(E=R.value,o(R.value)):i()}function m(){if(!M.parentNode){for(;M.firstChild;)M.removeChild(M.firstChild);var e=u.prototype.helpers.elOffset(w);M.style.minWidth=w.offsetWidth+"px",M.style.top=e.top+w.offsetHeight+"px",M.style.left=e.left+"px",document.body.appendChild(M)}}function f(e,t){T&&T.element&&T.element.classList.remove("active"),T=e,e&&e.element&&e.element.classList.add("active")}function g(){M.parentNode&&M.parentNode.removeChild(M),v()}function b(){g(),i()}function v(){y.table.rowManager.element.removeEventListener("scroll",b)}var y=this,w=e.getElement(),E=e.getValue(),C=n.verticalNavigation||"editor",x=void 0!==E||null===E?E:void 0!==n.defaultValue?n.defaultValue:"",R=document.createElement("input"),M=document.createElement("div"),L=[],T=!1,D=!0;if(this.table.rowManager.element.addEventListener("scroll",b),R.setAttribute("type","search"),R.style.padding="4px",R.style.width="100%",R.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var k in n.elementAttributes)"+"==k.charAt(0)?(k=k.slice(1),R.setAttribute(k,R.getAttribute(k)+n.elementAttributes["+"+k])):R.setAttribute(k,n.elementAttributes[k]);return M.classList.add("tabulator-edit-select-list"),M.addEventListener("mousedown",function(e){D=!1,setTimeout(function(){D=!0},10)}),R.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=L.indexOf(T),("editor"==C||"hybrid"==C&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),f(t>0?L[t-1]:!1));break;case 40:t=L.indexOf(T),("editor"==C||"hybrid"==C&&t'):("ie"==a.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){c=e,s(e)}var a=this,l=e.getElement(),c=e.getValue(),u=l.getElementsByTagName("svg").length||5,d=l.getElementsByTagName("svg")[0]?l.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],p=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.style.whiteSpace="nowrap",l.style.overflow="hidden",l.style.textOverflow="ellipsis",p.style.verticalAlign="middle",p.style.display="inline-block",p.style.padding="4px",m.setAttribute("width",d),m.setAttribute("height",d),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),p.setAttribute(f,p.getAttribute(f)+n.elementAttributes["+"+f])):p.setAttribute(f,n.elementAttributes[f]);for(var g=1;g<=u;g++)!function(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),s(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e)}),t.appendChild(i),p.appendChild(t)}(g);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(e){s(0)}),p.addEventListener("click",function(e){o(0)}),l.addEventListener("blur",function(e){i()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(c+1);break;case 37:r(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(e,t,o,i,n){function s(){var e=d*Math.round(m.offsetWidth/(l.clientWidth/100))+u;o(e),l.setAttribute("aria-valuenow",e),l.setAttribute("aria-label",h)}var r,a,l=e.getElement(),c=void 0===n.max?l.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,u=void 0===n.min?l.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(c-u)/100,h=e.getValue()||0,p=document.createElement("div"),m=document.createElement("div");if(p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),m.setAttribute(f,m.getAttribute(f)+n.elementAttributes["+"+f])):m.setAttribute(f,n.elementAttributes[f]);return l.style.padding="4px 4px",h=Math.min(parseFloat(h),c),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/d),m.style.width=h+"%",l.setAttribute("aria-valuemin",u),l.setAttribute("aria-valuemax",c),m.appendChild(p),p.addEventListener("mousedown",function(e){r=e.screenX,a=m.offsetWidth}),p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(e){r&&(m.style.width=a+e.screenX-r+"px")}),l.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,a=!1,s())}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:s();break;case 27:i()}}),l.addEventListener("blur",function(){i()}),m},tickCross:function(e,t,o,i,n){function s(e){return l?e?u?c:a.checked:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,c):(u=!1,a.checked):a.checked}var r=e.getValue(),a=document.createElement("input"),l=n.tristate,c=void 0===n.indeterminateValue?null:n.indeterminateValue,u=!1;if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),a.setAttribute(d,a.getAttribute(d)+n.elementAttributes["+"+d])):a.setAttribute(d,n.elementAttributes[d]);return a.value=r,!l||void 0!==r&&r!==c&&""!==r||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){a.focus({preventScroll:!0})}),a.checked=!0===r||"true"===r||"True"===r||1===r,a.addEventListener("change",function(e){o(s())}),a.addEventListener("blur",function(e){o(s(!0))}),a.addEventListener("keydown",function(e){ -13==e.keyCode&&o(s()),27==e.keyCode&&i()}),a}},u.prototype.registerModule("edit",w);var E=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};E.prototype.genereateTable=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=document.createElement("table");return n.classList.add("tabulator-print-table"),!1!==this.config.columnHeaders&&n.appendChild(this.generateHeaderElements()),n.appendChild(this.generateBodyElements(this.rowLookup(o))),this.mapElementStyles(this.table.element,n,["border-top","border-left","border-right","border-bottom"]),n},E.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach(function(e){(e=t.table.rowManager.findRow(e))&&o.push(e)});else switch(e){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},E.prototype.generateColumnGroupHeaders=function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}),t},E.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n={title:e.definition.title,column:e,depth:1};if(o.length){if(n.subGroups=[],n.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);o&&(n.width+=o.width,n.subGroups.push(o),o.depth>i&&(i=o.depth))}),n.depth+=i,!n.width)return!1}else{if(!this.columnVisCheck(e))return!1;n.width=1}return n},E.prototype.groupHeadersToRows=function(e){function t(e,n){var s=i-n;void 0===o[n]&&(o[n]=[]),e.height=e.subGroups?1:s-e.depth+1,o[n].push(e),e.subGroups&&e.subGroups.forEach(function(e){t(e,n+1)})}var o=[],i=0;return e.forEach(function(e){e.depth>i&&(i=e.depth)}),e.forEach(function(e){t(e,0)}),o},E.prototype.generateHeaderElements=function(){var e=this,t=document.createElement("thead");return this.groupHeadersToRows(this.generateColumnGroupHeaders()).forEach(function(o){var i=document.createElement("tr");e.mapElementStyles(e.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.forEach(function(t){var o=document.createElement("th"),n=t.column.definition.cssClass?t.column.definition.cssClass.split(" "):[];o.colSpan=t.width,o.rowSpan=t.height,o.innerHTML=t.column.definition.title,e.cloneTableStyle&&(o.style.boxSizing="border-box"),n.forEach(function(e){o.classList.add(e)}),e.mapElementStyles(t.column.getElement(),o,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.mapElementStyles(t.column.contentElement,o,["padding-top","padding-left","padding-right","padding-bottom"]),t.column.visible?e.mapElementStyles(t.column.getElement(),o,["width"]):t.column.definition.width&&(o.style.width=t.column.definition.width+"px"),t.column.parent&&e.mapElementStyles(t.column.parent.groupElement,o,["border-top"]),i.appendChild(o)}),t.appendChild(i)}),t},E.prototype.generateBodyElements=function(e){},E.prototype.generateBodyElements=function(e){var t,o,i,n,s,r,a,l,c,u,d=this;u=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u=null!==u?u:this.table.options.rowFormatter,this.cloneTableStyle&&window.getComputedStyle&&(t=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),o=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),i=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),n=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),r=this.table.element.getElementsByClassName("tabulator-group")[0],n&&(a=n.getElementsByClassName("tabulator-cell"),s=a[0],a[a.length-1]));var h=document.createElement("tbody"),p=[];return!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),this.table.columnManager.columnsByIndex.forEach(function(e){d.columnVisCheck(e)&&p.push(e)}),this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(c=this.table.modules.dataTree.elementField),e=e.filter(function(e){switch(e.type){case"group":return!1!==d.config.rowGroups;case"calc":return!1!==d.config.columnCalcs}return!0}),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(function(e,n){var a=e.getData(d.colVisProp),m=document.createElement("tr");switch(m.classList.add("tabulator-print-table-row"),e.type){case"group":var f=document.createElement("td");f.colSpan=p.length,f.innerHTML=e.key,m.classList.add("tabulator-print-table-group"),d.mapElementStyles(r,m,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),d.mapElementStyles(r,f,["padding-top","padding-left","padding-right","padding-bottom"]),m.appendChild(f);break;case"calc":m.classList.add("tabulator-print-table-calcs");case"row":if(d.table.options.dataTree&&!1===d.config.dataTree&&e.modules.dataTree.parent)return;if(p.forEach(function(t,o){var i=document.createElement("td"),n=t.getFieldValue(a),r={modules:{},getValue:function(){return n},getField:function(){return t.definition.field},getElement:function(){return i},getColumn:function(){return t.getComponent()},getData:function(){return a},getRow:function(){return e.getComponent()},getComponent:function(){return r},column:t};if((t.definition.cssClass?t.definition.cssClass.split(" "):[]).forEach(function(e){i.classList.add(e)}),d.table.modExists("format")&&!1!==d.config.formatCells)n=d.table.modules.format.formatExportValue(r,d.colVisProp);else switch(void 0===n?"undefined":_typeof(n)){case"object":n=JSON.stringify(n);break;case"undefined":case"null":n="";break;default:n=n}n instanceof Node?i.appendChild(n):i.innerHTML=n,s&&(d.mapElementStyles(s,i,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),t.definition.align&&(i.style.textAlign=t.definition.align)),d.table.options.dataTree&&!1!==d.config.dataTree&&(c&&c==t.field||!c&&0==o)&&(e.modules.dataTree.controlEl&&i.insertBefore(e.modules.dataTree.controlEl.cloneNode(!0),i.firstChild),e.modules.dataTree.branchEl&&i.insertBefore(e.modules.dataTree.branchEl.cloneNode(!0),i.firstChild)),m.appendChild(i),r.modules.format&&r.modules.format.renderedCallback&&r.modules.format.renderedCallback()}),l="calc"==e.type?i:n%2&&o?o:t,d.mapElementStyles(l,m,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),u&&!1!==d.config.formatCells){var g=e.getComponent();g.getElement=function(){return m},u(g)}}h.appendChild(m)}),h},E.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},E.prototype.getHtml=function(e,t,o,i){var n=document.createElement("div");return n.appendChild(this.genereateTable(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput")),n.innerHTML},E.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){var i={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(e);o.forEach(function(e){t.style[i[e]]=n.getPropertyValue(e)})}}},u.prototype.registerModule("export",E);var C=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};C.prototype.initializeColumn=function(e,t){function o(t){var o,s="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[n];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":i.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(o){var n=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return n="function"==typeof n?n(t,s,o):n,i.filters[e.definition.headerFilterFunc](t,s,o,n)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":o=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"==typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},r=o}if(!o)switch(s){case"partial":o=function(o){var i=e.getFieldValue(o);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(o){return e.getFieldValue(o)==t},r="="}i.headerFilters[n]={value:t,func:o,type:r}}a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.changed=!0,i.table.rowManager.filterRefresh())}return!0}var i=this,n=e.getField();e.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},C.prototype.generateHeaderFilterElement=function(e,t,o){function i(){}var n,s,r,a,l,c,u,d=this,h=this,p=e.modules.filter.success,m=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(s=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":s=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?s=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(s=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):s=h.table.modules.edit.editors.input}if(s){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(h.table):u,!(r=s.call(this.table.modules.edit,a,function(){},p,i,u)))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(r instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",r);m?h.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){r.setAttribute("placeholder",void 0!==e&&e?e:h.table.modules.localize.getText("headerFilters|default"))}):h.table.modules.localize.bind("headerFilters|default",function(e){r.setAttribute("placeholder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)}),r.addEventListener("click",function(e){e.stopPropagation(),r.focus()}),r.addEventListener("focus",function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))}),l=!1,c=function(e){l&&clearTimeout(l),l=setTimeout(function(){p(r.value)},h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=r,e.modules.filter.attrType=r.hasAttribute("type")?r.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=r.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(r.addEventListener("keyup",c),r.addEventListener("search",c),"number"==e.modules.filter.attrType&&r.addEventListener("change",function(e){p(r.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&r.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||r.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(r),e.contentElement.appendChild(n),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},C.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},C.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},C.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},C.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},C.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},C.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},C.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},C.prototype.setFilter=function(e,t,o){var i=this;i.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o}]),i.addFilter(e)},C.prototype.addFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach(function(e){(e=i.findFilter(e))&&(i.filterList.push(e),i.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},C.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i))}:function(t){return o.filters[e.type](e.value,t[e.field])}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},C.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach(function(e){(e=t.findFilter(e))&&o.push(e)}),!!o.length&&o},C.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),o=o.concat(this.filtersToArray(this.filterList,t))},C.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},C.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},C.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},C.prototype.clearFilter=function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},C.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},C.prototype.search=function(e,t,o,i){var n=this,s=[],r=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&r.push(e)}),this.table.rowManager.rows.forEach(function(t){var o=!0;r.forEach(function(e){n.filterRecurse(e,t.getData())||(o=!1)}),o&&s.push("data"===e?t.getData("data"):t.getComponent())}),s},C.prototype.filter=function(e,t){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=e.slice(0):e.forEach(function(e){o.filterRow(e)&&i.push(e)}),o.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},C.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();o.filterList.forEach(function(e){o.filterRecurse(e,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},C.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach(function(e){o.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},C.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},in:function(e,t,o,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},u.prototype.registerModule("filter",C);var x=function(e){this.table=e};x.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},x.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];switch(void 0===i?"undefined":_typeof(i)){case"string":"tick"===i&&(i="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[i]?o.formatter=this.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=i;break;default:o.formatter=this.formatters.plaintext}return o},x.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},x.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,i,t)},x.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},x.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},x.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},x.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},x.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,r,a=parseFloat(e.getValue()),l=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,h=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(i=!1!==h?a.toFixed(h):a,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",r=/(\d+)(\d{3})/;r.test(n);)n=n.replace(r,"$1"+c+"$2");return d?n+s+u:u+n+s},link:function(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",r=t.download,a=n,l=document.createElement("a");if(t.labelField&&(i=e.getData(),a=i[t.labelField]),t.label)switch(_typeof(t.label)){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(_typeof(t.url)){case"string":n=t.url;break;case"function":n=t.url(e)}return l.setAttribute("href",s+n),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height}switch(_typeof(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width}return i.addEventListener("load",function(){e.getRow().normalizeHeight()}),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,r=t.allowTruthy,a=void 0!==t.tickElement?t.tickElement:'',l=void 0!==t.crossElement?t.crossElement:'';return r&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),a||""):!s||"null"!==i&&""!==i&&null!==i&&void 0!==i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=e.getValue(),a=moment(r,i);return a.isValid()?a.format(n):!0===s?r:"function"==typeof s?s(r):s},datetimediff:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,r=void 0!==t.unit?t.unit:void 0,a=void 0!==t.humanize&&t.humanize,l=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,i);return u.isValid()?a?moment.duration(u.diff(l)).humanize(s):u.diff(l,r)+(s?" "+s:""):!0===n?c:"function"==typeof n?n(c):n},lookup:function(e,t,o){var i=e.getValue();return void 0===t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,s));for(var l=1;l<=s;l++){var c=a.cloneNode(!0);c.innerHTML=l<=i?'':'',r.appendChild(c)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),r},traffic:function(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=a?parseFloat(s):a,n=parseFloat(n)>=l?parseFloat(n):l,i=(a-l)/100,n=Math.round((n-l)/i),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,h=Math.floor(n/d);h=Math.min(h,c.length-1),h=Math.max(h,0),u=c[h];break}}return r.style.backgroundColor=u,r}},progress:function(e,t,o){var i,n,s,r,l,c=this.sanitizeHTML(e.getValue())||0,u=e.getElement(),d=t&&t.max?t.max:100,h=t&&t.min?t.min:0,p=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=d?parseFloat(c):d,n=parseFloat(n)>=h?parseFloat(n):h,i=(d-h)/100,n=Math.round((n-h)/i),_typeof(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,f=Math.floor(n/m);f=Math.min(f,t.color.length-1),f=Math.max(f,0),s=t.color[f];break}default:s="#2DC214"}switch(_typeof(t.legend)){case"string":r=t.legend;break;case"function":r=t.legend(c);break;case"boolean":r=c;break;default:r=!1}switch(_typeof(t.legendColor)){case"string":l=t.legendColor;break;case"function":l=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){var m=100/t.legendColor.length,f=Math.floor(n/m);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),l=t.legendColor[f]}break;default:l="#000"}u.style.minWidth="30px",u.style.position="relative",u.setAttribute("aria-label",n);var g=document.createElement("div");if(g.style.display="inline-block",g.style.position="relative",g.style.width=n+"%",g.style.backgroundColor=s,g.style.height="100%",g.setAttribute("data-max",d),g.setAttribute("data-min",h),r){var b=document.createElement("div");b.style.position="absolute",b.style.top="4px",b.style.left=0,b.style.textAlign=p,b.style.width="100%",b.style.color=l,b.innerHTML=r}return o(function(){if(!(e instanceof a)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",u.appendChild(t),u=t}u.appendChild(g),r&&u.appendChild(b)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function i(e){var t=s.element;s.open=e, -t&&(s.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}var n=document.createElement("div"),s=e.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",function(e){i.toggleSelect()}),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},u.prototype.registerModule("format",x);var R=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};R.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0},R.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},R.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},R.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},R.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},R.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))},R.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach(function(e){t.layoutElement(e.getElement(),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach(function(e){t.layoutElement(e.getElement(),o)})})},R.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},R.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},R.prototype.layoutRow=function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}),this.rightColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})},R.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},R.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)}),t},M.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},M.prototype.unfreezeRow=function(e){var t=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var o=e.getElement();o.parentNode.removeChild(o),this.table.rowManager.adjustTableSize(),this.rows.splice(t,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},M.prototype.styleRows=function(e){var t=this;this.rows.forEach(function(e,o){t.table.rowManager.styleRow(e,o)})},u.prototype.registerModule("frozenRows",M);var L=function(e){this._group=e,this.type="GroupComponent"};L.prototype.getKey=function(){return this._group.key},L.prototype.getField=function(){return this._group.field},L.prototype.getElement=function(){return this._group.element},L.prototype.getRows=function(){return this._group.getRows(!0)},L.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},L.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},L.prototype.getVisibility=function(){return this._group.visible},L.prototype.show=function(){this._group.show()},L.prototype.hide=function(){this._group.hide()},L.prototype.toggle=function(){this._group.toggleVisibility()},L.prototype._getSelf=function(){return this._group},L.prototype.getTable=function(){return this._group.groupManager.table};var T=function(e,t,o,i,n,s,r){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},T.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)})},T.prototype.getRowIndex=function(e){},T.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},T.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(o.parentNode&&o.parentNode.removeChild(o),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},T.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},T.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){t=t.concat(o.getHeadersAndRows(e))}):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t},T.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(function(e){o.push(e.getData(t||"data"))}),o},T.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach(function(t){e+=t.getRowCount()}):e=this.rows.length,e},T.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},T.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){e.detachElement()})}):this.rows.forEach(function(e){var t=e.getElement();t.parentNode.removeChild(t)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},T.prototype.show=function(){var e=this;if(e.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=e.getElement();this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})}):e.rows.forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},T.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},T.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}):this.rows.find(function(t){return t===e})&&(t=this),t},T.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},T.prototype.getRows=function(e){var t=[];return this.rows.forEach(function(o){t.push(e?o.getComponent():o)}),t},T.prototype.generateGroupHeaderContents=function(){var e=[];for(this.rows.forEach(function(t){e.push(t.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},T.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",function(t,o){e.headerGenerator[0]=function(e,i,n){return(void 0===e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach(function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(t)||(t=[t]),t.forEach(function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(e){e="function"==typeof e?e:function(){return!0}}),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},D.prototype.setDisplayIndex=function(e){this.displayIndex=e},D.prototype.getDisplayIndex=function(){return this.displayIndex},D.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},D.prototype.getGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},D.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach(function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)}),o},D.prototype.wipe=function(){this.groupList.forEach(function(e){e.wipe()})},D.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach(function(e){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach(function(e){o.push(e.getData("data"))}))}),o},D.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},D.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}),t},D.prototype.countGroups=function(){return this.groupList.length},D.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(e){t.createGroup(e,0,o)}),e.forEach(function(e){t.assignRowToExistingGroup(e,o)})):e.forEach(function(e){t.assignRowToGroup(e,o)})},D.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new T(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},D.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},D.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},D.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows())}),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},D.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach(function(t){t.scrollHeader(e)})},D.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))},u.prototype.registerModule("groupRows",D);var k=function(e){this.table=e,this.history=[],this.index=-1};k.prototype.clear=function(){this.history=[],this.index=-1},k.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},k.prototype.getHistoryUndoSize=function(){return this.index+1},k.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},k.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},k.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},k.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},k.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},k.prototype._rebindRow=function(e,t){this.history.forEach(function(o){if(o.component instanceof r)o.component===e&&(o.component=t);else if(o.component instanceof l&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}})},u.prototype.registerModule("history",k);var S=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};S.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var r=0;r-1&&e.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},z.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},z.prototype.checkBinding=function(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach(function(e){-1==o.pressedKeys.indexOf(e)&&(i=!1)}),i&&t.action.call(o,e),!0)},z.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},z.prototype.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().prev())},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow -;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(e.preventDefault(),t=o.nav(),t.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(i),i.then(function(){setTimeout(function(){t.next()})})))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().left())},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().right())},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().up())},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().down())},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},u.prototype.registerModule("keybindings",z);var H=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};H.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},H.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},H.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},H.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);o&&o.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach(function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(e){e.stopPropagation()})):o.addEventListener("click",function(o){i.hideMenu(),e.action(o,t.getComponent())})),i.menuEl.appendChild(o)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px"))},H.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},H.prototype.menus={},u.prototype.registerModule("menu",H);var F=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};F.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},F.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-u.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=i},F.prototype.bindTouchEvents=function(e){var t,o,i,n,s,r,a,l=this,c=e.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,t=e,o=e.nextColumn(),n=o?o.getWidth()/2:0,i=e.prevColumn(),s=i?i.getWidth()/2:0,r=0,a=0,u=!1,l.startMove(c,e)},l.checkPeriod)},{passive:!0}),c.addEventListener("touchmove",function(c){var d,h;l.moving&&(l.moveHover(c),u||(u=c.touches[0].pageX),d=c.touches[0].pageX-u,d>0?o&&d-r>n&&(h=o)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-a>s&&(h=i)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(t=h,o=h.nextColumn(),r=n,n=o?o.getWidth()/2:0,i=h.prevColumn(),a=s,s=i?i.getWidth()/2:0))},{passive:!0}),c.addEventListener("touchend",function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(e)})},F.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-u.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)},F.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)}):e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)})},F.prototype.endMove=function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},F.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-u.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},A.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-u.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},A.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},A.prototype.bindTouchEvents=function(e,t){var o,i,n,s,r,a,l,c=this,u=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,i=e.nextRow(),s=i?i.getHeight()/2:0,n=e.prevRow(),r=n?n.getHeight()/2:0,a=0,l=0,u=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var d,h;c.moving&&(t.preventDefault(),c.moveHover(t),u||(u=t.touches[0].pageY),d=t.touches[0].pageY-u,d>0?i&&d-a>s&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>r&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement()),c.moveRow(h,!1)),h&&(o=h,i=h.nextRow(),a=s,s=i?i.getHeight()/2:0,n=h.prevRow(),l=r,r=n?n.getHeight()/2:0))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},A.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},A.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},A.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},A.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.pageXOffset,this.startY=i.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},A.prototype.endMove=function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},A.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},A.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},A.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},A.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},A.prototype.connectToTables=function(e){var t=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connection,"moveRow","connect",{row:e})},A.prototype.disconnectFromTables=function(){var e=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connection,"moveRow","disconnect")},A.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},A.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},A.prototype.dropComplete=function(e,t,o){var i=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},A.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(e.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?i=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},A.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},A.prototype.senders={delete:function(e,t,o){e.delete()}},A.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},u.prototype.registerModule("moveRow",A);var P=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};P.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupMutator(e.definition[r]))&&(o=!0,i[r]={mutator:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.mutate=i)},P.prototype.lookupMutator=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t},P.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&n.table.columnManager.traverse(function(n){var r,a,l;n.modules.mutate&&(r=n.modules.mutate[s]||n.modules.mutate.mutator||!1)&&(i=n.getFieldValue(void 0!==o?o:e),"data"!=t&&void 0===i||(l=n.getComponent(),a="function"==typeof r.params?r.params(i,e,t,l):r.params,n.setFieldValue(e,r.mutator(i,e,t,a,l))))}),e},P.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},P.prototype.enable=function(){this.enabled=!0},P.prototype.disable=function(){this.enabled=!1},P.prototype.mutators={},u.prototype.registerModule("mutator",P);var _=function(e){this.table=e,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};_.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},_.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var o=document.createElement("option");o.value=t,o.innerHTML=t,e.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},_.prototype.initialize=function(e){var t,o,i,n=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),n.table.modules.localize.bind("pagination|first",function(e){n.firstBut.innerHTML=e}),n.table.modules.localize.bind("pagination|first_title",function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|prev",function(e){n.prevBut.innerHTML=e}),n.table.modules.localize.bind("pagination|prev_title",function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|next",function(e){n.nextBut.innerHTML=e}),n.table.modules.localize.bind("pagination|next_title",function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|last",function(e){n.lastBut.innerHTML=e}),n.table.modules.localize.bind("pagination|last_title",function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)}),n.firstBut.addEventListener("click",function(){n.setPage(1)}),n.prevBut.addEventListener("click",function(){n.previousPage()}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max)}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(e){n.setPageSize(n.pageSizeSelect.value),n.setPage(1).then(function(){}).catch(function(){})})),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||e||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.table.options.paginationSize?n.size=n.table.options.paginationSize:(o=document.createElement("div"),o.classList.add("tabulator-row"),o.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",o.appendChild(i),n.table.rowManager.getTableElement().appendChild(o),n.size=Math.floor(n.table.rowManager.getElement().clientHeight/o.offsetHeight),n.table.rowManager.getTableElement().removeChild(o)),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},_.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},_.prototype.setDisplayIndex=function(e){this.displayIndex=e},_.prototype.getDisplayIndex=function(){return this.displayIndex},_.prototype.setMaxRows=function(e){this.max=e?Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},_.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},_.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},_.prototype.setPage=function(e){var t=this,o=this;return new Promise(function(i,n){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then(function(){i()}).catch(function(){n()}),o.table.options.persistence&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.config.page&&o.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),n())})},_.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var r=Math.ceil((s+1)/t.size);t.setPage(r).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},_.prototype.setPageSize=function(e){e=parseInt(e),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},_.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},_.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),o.setAttribute("aria-label","Show Page "+e),o.setAttribute("title","Show Page "+e),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",function(o){t.setPage(e)}),o},_.prototype.previousPage=function(){var e=this;return new Promise(function(t,o){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){o()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},_.prototype.nextPage=function(){var e=this;return new Promise(function(t,o){e.pagen?i.splice(n,0,e):i.push(e))}),i},N.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},N.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},N.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},N.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},N.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},N.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach(function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach(function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}})),o.push(n)}),o},N.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,r=n.indexOf(s+"=");return r>-1&&(n=n.substr(r),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},N.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},u.prototype.registerModule("persistence",N);var B=function(e){this.table=e,this.element=!1,this.manualBlock=!1};B.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},B.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))},B.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")},B.prototype.printFullscreen=function(e,t,o){var i,n,s=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),c=this.table.modules.export.genereateTable(void 0!==o?o:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof i?a.innerHTML=i:a.appendChild(i),this.element.appendChild(a)),this.element.appendChild(c),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof n?l.innerHTML=n:l.appendChild(n),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,c),window.print(),this.cleanup(),window.scrollTo(s,r),this.manualBlock=!1},u.prototype.registerModule("print",B);var I=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};I.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!1)}),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!0)}),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],r=n[1],a=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(a&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,i,!0)}):(a=a.slice().reverse(),a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(s,void 0===n[1]?n[1]:s+r);l.forEach(function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)})}(a||0!==r)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},I.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},I.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var o in t)this.watchKey(e,t,o);this.blocked=!1},I.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],r=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&r===i.currentVersion){var a={};a[o]=t,e.updateData(a)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},I.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},I.prototype.block=function(){this.blocked=!0},I.prototype.unblock=function(){this.blocked=!1},u.prototype.registerModule("reactiveData",I);var O=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};O.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){var r=document.createElement("div");r.className="tabulator-col-resize-handle";var a=document.createElement("div");a.className="tabulator-col-resize-handle prev",r.addEventListener("click",function(e){e.stopPropagation()});var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,r))};r.addEventListener("mousedown",l),r.addEventListener("touchstart",l,{passive:!0}),r.addEventListener("dblclick",function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))}),a.addEventListener("click",function(e){e.stopPropagation()});var c=function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,a)))};a.addEventListener("mousedown",c),a.addEventListener("touchstart",c,{passive:!0}),a.addEventListener("dblclick",function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),o.appendChild(r),o.appendChild(a)}},O.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},O.prototype._mouseDown=function(e,t,o){function i(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},u.prototype.registerModule("resizeColumns",O);var j=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};j.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",function(e){e.stopPropagation()});var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(i),o.appendChild(n)},j.prototype._mouseDown=function(e,t,o){function i(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},u.prototype.registerModule("resizeRows",j);var V=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};V.prototype.initialize=function(e){var t,o=this,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}}),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},V.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},u.prototype.registerModule("resizeTable",V);var G=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};G.prototype.initialize=function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();for(var o=this.table.columnManager.columnsByIndex,i=Array.isArray(o),n=0,o=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var r=s;if("responsiveCollapse"==r.definition.formatter){this.collapseHandleColumn=r;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},G.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},G.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},G.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},G.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},G.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},G.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},G.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1];s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},G.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},G.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},G.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.getData(),n=[];return this.hiddenColumns.forEach(function(s){var r=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return r},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:r}))}),n},G.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},u.prototype.registerModule("responsiveLayout",G);var W=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};W.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},W.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,r=i>=n?i:n,a=t.table.rowManager.getDisplayRows().slice(0),l=a.splice(s,r-s+1);o.ctrlKey||o.metaKey?(l.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},W.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},W.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},W.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},W.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},W.prototype.deselectRows=function(e,t){var o,i=this;if(void 0===e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},W.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},W.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},W.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},W.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},W.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},W.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)for(var i=o,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var r;if(n){if(s>=i.length)break;r=i[s++]}else{if(s=i.next(),s.done)break;r=s.value}var a=r;this._selectRow(a,!0)}else for(var l=o,c=Array.isArray(l),u=0,l=c?l:l[Symbol.iterator]();;){var d;if(c){if(u>=l.length)break;d=l[u++]}else{if(u=l.next(),u.done)break;d=u.value}var h=d;this._deselectRow(h,!0)}},u.prototype.registerModule("selectRow",W);var U=function(e){this.table=e,this.sortList=[],this.changed=!1};U.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(_typeof(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:void 0!==e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",function(t){var o="",i=[],s=!1 -;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(t){return t.field===e.getField()}),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},U.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},U.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},U.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)}),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},U.prototype.clear=function(){this.setSort([])},U.prototype.findSorter=function(e){var t,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),e.getField()))switch(t=e.getFieldValue(o),void 0===t?"undefined":_typeof(t)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},U.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table,t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):(o.forEach(function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)}),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&t.table.options.dataSorted.call(t.table,t.getSort(),t.table.rowManager.getComponents("active"))},U.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))})},U.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},U.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort(function(e,n){for(var s,r=i;r>=0;r--){var a=t[r];if(0!==(s=o._sortRow(e,n,a.column,a.dir,a.params)))break}return s})},U.prototype._sortRow=function(e,t,o,i,n){var s,r,a="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(a.getData()),t=o.getFieldValue(l.getData()),e=void 0!==e?e:"",t=void 0!==t?t:"",s=a.getComponent(),r=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,r,o.getComponent(),i,n)},U.prototype.sorters={number:function(e,t,o,i,n,s,r){var a=r.alignEmptyValues,l=r.decimalSeparator||".",c=r.thousandSeparator||",",u=0;if(e=parseFloat(String(e).split(c).join("").split(l).join(".")),t=parseFloat(String(t).split(c).join("").split(l).join(".")),isNaN(e))u=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;u=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(u*=-1),u},string:function(e,t,o,i,n,s,r){var a,l=r.alignEmptyValues,c=0;if(e){if(t){switch(_typeof(r.locale)){case"boolean":r.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}c=1}else c=t?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,r){return r.format||(r.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},time:function(e,t,o,i,n,s,r){return r.format||(r.format="hh:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},datetime:function(e,t,o,i,n,s,r){var a=r.format||"DD/MM/YYYY hh:mm:ss",l=r.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(e=moment(e,a),t=moment(t,a),e.isValid()){if(t.isValid())return e-t;c=1}else c=t.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(e,t,o,i,n,s,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,o,i,n,s,r){function a(e){switch(u){case"length":return e.length;case"sum":return e.reduce(function(e,t){return e+t});case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce(function(e,t){return e+t})/e.length}}var l=0,c=0,u=r.type||"length",d=r.alignEmptyValues,h=0;if(Array.isArray(e)){if(Array.isArray(t))return l=e?a(e):0,c=t?a(t):0,l-c;d=1}else d=Array.isArray(t)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(e,t,o,i,n,s,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,o,i,n,s,r){var a,l,c,u,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=r.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(a=String(e).toLowerCase(),l=String(t).toLowerCase(),a===l)return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),d=a.length>l.length?l.length:a.length;hu?1:-1;return a.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},u.prototype.registerModule("sort",U);var Y=function(e){this.table=e};return Y.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(function(e){(t=o._extractValidator(e))&&i.push(t)}):(t=this._extractValidator(e.definition.validator))&&i.push(t),e.modules.validate=!!i.length&&i)},Y.prototype._extractValidator=function(e){var t,o,i;switch(void 0===e?"undefined":_typeof(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},Y.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},Y.prototype.validate=function(e,t,o){var i=this,n=[];return e&&e.forEach(function(e){e.func.call(i,t,o,e.params)||n.push({type:e.type,parameters:e.params})}),!n.length||n},Y.prototype.validators={integer:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,o){return""===t||null===t||void 0===t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||void 0===t||isNaN(t)},max:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)>=o},minLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||void 0===t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){return""===t||null===t||void 0===t||new RegExp(o).test(t)},unique:function(e,t,o){if(""===t||null===t||void 0===t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)}),i},required:function(e,t,o){return""!==t&&null!==t&&void 0!==t}},u.prototype.registerModule("validate",Y),u}); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/tabulator_core.js b/app/static/vendors/tabulator/js.old/tabulator_core.js deleted file mode 100644 index 4a5287b..0000000 --- a/app/static/vendors/tabulator/js.old/tabulator_core.js +++ /dev/null @@ -1,8523 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ - -'use strict'; - -// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -if (!Array.prototype.findIndex) { - - Object.defineProperty(Array.prototype, 'findIndex', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - var k = 0; - - // 6. Repeat, while k < len - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - // b. Let kValue be ? Get(O, Pk). - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - // d. If testResult is true, return k. - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return k; - } - - // e. Increase k by 1. - - k++; - } - - // 7. Return -1. - - return -1; - } - - }); -} - -// https://tc39.github.io/ecma262/#sec-array.prototype.find - -if (!Array.prototype.find) { - - Object.defineProperty(Array.prototype, 'find', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - var k = 0; - - // 6. Repeat, while k < len - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - // b. Let kValue be ? Get(O, Pk). - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - // d. If testResult is true, return kValue. - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return kValue; - } - - // e. Increase k by 1. - - k++; - } - - // 7. Return undefined. - - return undefined; - } - - }); -} - -var ColumnManager = function ColumnManager(table) { - - this.table = table; //hold parent table - - this.blockHozScrollEvent = false; - - this.headersElement = this.createHeadersElement(); - - this.element = this.createHeaderElement(); //containing element - - this.rowManager = null; //hold row manager object - - this.columns = []; // column definition object - - this.columnsByIndex = []; //columns by index - - this.columnsByField = {}; //columns by field - - this.scrollLeft = 0; - - this.element.insertBefore(this.headersElement, this.element.firstChild); -}; - -////////////// Setup Functions ///////////////// - - -ColumnManager.prototype.createHeadersElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-headers"); - - return el; -}; - -ColumnManager.prototype.createHeaderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-header"); - - if (!this.table.options.headerVisible) { - - el.classList.add("tabulator-header-hidden"); - } - - return el; -}; - -ColumnManager.prototype.initialize = function () { - - var self = this; - - //scroll body along with header - - // self.element.addEventListener("scroll", function(e){ - - // if(!self.blockHozScrollEvent){ - - // self.table.rowManager.scrollHorizontal(self.element.scrollLeft); - - // } - - // }); -}; - -//link to row manager - -ColumnManager.prototype.setRowManager = function (manager) { - - this.rowManager = manager; -}; - -//return containing element - -ColumnManager.prototype.getElement = function () { - - return this.element; -}; - -//return header containing element - -ColumnManager.prototype.getHeadersElement = function () { - - return this.headersElement; -}; - -// ColumnManager.prototype.tempScrollBlock = function(){ - -// clearTimeout(this.blockHozScrollEvent); - -// this.blockHozScrollEvent = setTimeout(() => {this.blockHozScrollEvent = false;}, 50); - -// } - - -//scroll horizontally to match table body - -ColumnManager.prototype.scrollHorizontal = function (left) { - - var hozAdjust = 0, - scrollWidth = this.element.scrollWidth - this.table.element.clientWidth; - - // this.tempScrollBlock(); - - this.element.scrollLeft = left; - - //adjust for vertical scrollbar moving table when present - - if (left > scrollWidth) { - - hozAdjust = left - scrollWidth; - - this.element.style.marginLeft = -hozAdjust + "px"; - } else { - - this.element.style.marginLeft = 0; - } - - //keep frozen columns fixed in position - - //this._calcFrozenColumnsPos(hozAdjust + 3); - - - this.scrollLeft = left; - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.scrollHorizontal(); - } -}; - -///////////// Column Setup Functions ///////////// - - -ColumnManager.prototype.generateColumnsFromRowData = function (data) { - - var cols = [], - row, - sorter; - - if (data && data.length) { - - row = data[0]; - - for (var key in row) { - - var col = { - - field: key, - - title: key - - }; - - var value = row[key]; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - - case "undefined": - - sorter = "string"; - - break; - - case "boolean": - - sorter = "boolean"; - - break; - - case "object": - - if (Array.isArray(value)) { - - sorter = "array"; - } else { - - sorter = "string"; - } - - break; - - default: - - if (!isNaN(value) && value !== "") { - - sorter = "number"; - } else { - - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - - sorter = "alphanum"; - } else { - - sorter = "string"; - } - } - - break; - - } - - col.sorter = sorter; - - cols.push(col); - } - - this.table.options.columns = cols; - - this.setColumns(this.table.options.columns); - } -}; - -ColumnManager.prototype.setColumns = function (cols, row) { - - var self = this; - - while (self.headersElement.firstChild) { - self.headersElement.removeChild(self.headersElement.firstChild); - }self.columns = []; - - self.columnsByIndex = []; - - self.columnsByField = {}; - - //reset frozen columns - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.reset(); - } - - cols.forEach(function (def, i) { - - self._addColumn(def); - }); - - self._reIndexColumns(); - - if (self.table.options.responsiveLayout && self.table.modExists("responsiveLayout", true)) { - - self.table.modules.responsiveLayout.initialize(); - } - - self.redraw(true); -}; - -ColumnManager.prototype._addColumn = function (definition, before, nextToColumn) { - - var column = new Column(definition, this), - colEl = column.getElement(), - index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn; - - if (nextToColumn && index > -1) { - - var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn()); - - var nextEl = nextToColumn.getElement(); - - if (before) { - - this.columns.splice(parentIndex, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl); - } else { - - this.columns.splice(parentIndex + 1, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl.nextSibling); - } - } else { - - if (before) { - - this.columns.unshift(column); - - this.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild); - } else { - - this.columns.push(column); - - this.headersElement.appendChild(column.getElement()); - } - - column.columnRendered(); - } - - return column; -}; - -ColumnManager.prototype.registerColumnField = function (col) { - - if (col.definition.field) { - - this.columnsByField[col.definition.field] = col; - } -}; - -ColumnManager.prototype.registerColumnPosition = function (col) { - - this.columnsByIndex.push(col); -}; - -ColumnManager.prototype._reIndexColumns = function () { - - this.columnsByIndex = []; - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); -}; - -//ensure column headers take up the correct amount of space in column groups - -ColumnManager.prototype._verticalAlignHeaders = function () { - - var self = this, - minHeight = 0; - - self.columns.forEach(function (column) { - - var height; - - column.clearVerticalAlign(); - - height = column.getHeight(); - - if (height > minHeight) { - - minHeight = height; - } - }); - - self.columns.forEach(function (column) { - - column.verticalAlign(self.table.options.columnHeaderVertAlign, minHeight); - }); - - self.rowManager.adjustTableSize(); -}; - -//////////////// Column Details ///////////////// - - -ColumnManager.prototype.findColumn = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Column) { - - //subject is column element - - return subject; - } else if (subject instanceof ColumnComponent) { - - //subject is public column component - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the column header - - var match = self.columns.find(function (column) { - - return column.element === subject; - }); - - return match || false; - } - } else { - - //subject should be treated as the field name of the column - - return this.columnsByField[subject] || false; - } - - //catch all for any other type of input - - - return false; -}; - -ColumnManager.prototype.getColumnByField = function (field) { - - return this.columnsByField[field]; -}; - -ColumnManager.prototype.getColumnsByFieldRoot = function (root) { - var _this = this; - - var matches = []; - - Object.keys(this.columnsByField).forEach(function (field) { - - var fieldRoot = field.split(".")[0]; - - if (fieldRoot === root) { - - matches.push(_this.columnsByField[field]); - } - }); - - return matches; -}; - -ColumnManager.prototype.getColumnByIndex = function (index) { - - return this.columnsByIndex[index]; -}; - -ColumnManager.prototype.getFirstVisibileColumn = function (index) { - - var index = this.columnsByIndex.findIndex(function (col) { - - return col.visible; - }); - - return index > -1 ? this.columnsByIndex[index] : false; -}; - -ColumnManager.prototype.getColumns = function () { - - return this.columns; -}; - -ColumnManager.prototype.findColumnIndex = function (column) { - - return this.columnsByIndex.findIndex(function (col) { - - return column === col; - }); -}; - -//return all columns that are not groups - -ColumnManager.prototype.getRealColumns = function () { - - return this.columnsByIndex; -}; - -//travers across columns and call action - -ColumnManager.prototype.traverse = function (callback) { - - var self = this; - - self.columnsByIndex.forEach(function (column, i) { - - callback(column, i); - }); -}; - -//get defintions of actual columns - -ColumnManager.prototype.getDefinitions = function (active) { - - var self = this, - output = []; - - self.columnsByIndex.forEach(function (column) { - - if (!active || active && column.visible) { - - output.push(column.getDefinition()); - } - }); - - return output; -}; - -//get full nested definition tree - -ColumnManager.prototype.getDefinitionTree = function () { - - var self = this, - output = []; - - self.columns.forEach(function (column) { - - output.push(column.getDefinition(true)); - }); - - return output; -}; - -ColumnManager.prototype.getComponents = function (structured) { - - var self = this, - output = [], - columns = structured ? self.columns : self.columnsByIndex; - - columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - - return output; -}; - -ColumnManager.prototype.getWidth = function () { - - var width = 0; - - this.columnsByIndex.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - - return width; -}; - -ColumnManager.prototype.moveColumn = function (from, to, after) { - - this.moveColumnActual(from, to, after); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - to.element.parentNode.insertBefore(from.element, to.element); - - if (after) { - - to.element.parentNode.insertBefore(to.element, from.element); - } - - this._verticalAlignHeaders(); - - this.table.rowManager.reinitialize(); -}; - -ColumnManager.prototype.moveColumnActual = function (from, to, after) { - - if (from.parent.isGroup) { - - this._moveColumnInArray(from.parent.columns, from, to, after); - } else { - - this._moveColumnInArray(this.columns, from, to, after); - } - - this._moveColumnInArray(this.columnsByIndex, from, to, after, true); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.options.columnMoved) { - - this.table.options.columnMoved.call(this.table, from.getComponent(), this.table.columnManager.getComponents()); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } -}; - -ColumnManager.prototype._moveColumnInArray = function (columns, from, to, after, updateRows) { - - var fromIndex = columns.indexOf(from), - toIndex; - - if (fromIndex > -1) { - - columns.splice(fromIndex, 1); - - toIndex = columns.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - toIndex = toIndex + 1; - } - } else { - - toIndex = fromIndex; - } - - columns.splice(toIndex, 0, from); - - if (updateRows) { - - this.table.rowManager.rows.forEach(function (row) { - - if (row.cells.length) { - - var cell = row.cells.splice(fromIndex, 1)[0]; - - row.cells.splice(toIndex, 0, cell); - } - }); - } - } -}; - -ColumnManager.prototype.scrollToColumn = function (column, position, ifVisible) { - var _this2 = this; - - var left = 0, - offset = 0, - adjust = 0, - colEl = column.getElement(); - - return new Promise(function (resolve, reject) { - - if (typeof position === "undefined") { - - position = _this2.table.options.scrollToColumnPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this2.table.options.scrollToColumnIfVisible; - } - - if (column.visible) { - - //align to correct position - - switch (position) { - - case "middle": - - case "center": - - adjust = -_this2.element.clientWidth / 2; - - break; - - case "right": - - adjust = colEl.clientWidth - _this2.headersElement.clientWidth; - - break; - - } - - //check column visibility - - if (!ifVisible) { - - offset = colEl.offsetLeft; - - if (offset > 0 && offset + colEl.offsetWidth < _this2.element.clientWidth) { - - return false; - } - } - - //calculate scroll position - - left = colEl.offsetLeft + _this2.element.scrollLeft + adjust; - - left = Math.max(Math.min(left, _this2.table.rowManager.element.scrollWidth - _this2.table.rowManager.element.clientWidth), 0); - - _this2.table.rowManager.scrollHorizontal(left); - - _this2.scrollHorizontal(left); - - resolve(); - } else { - - console.warn("Scroll Error - Column not visible"); - - reject("Scroll Error - Column not visible"); - } - }); -}; - -//////////////// Cell Management ///////////////// - - -ColumnManager.prototype.generateCells = function (row) { - - var self = this; - - var cells = []; - - self.columnsByIndex.forEach(function (column) { - - cells.push(column.generateCell(row)); - }); - - return cells; -}; - -//////////////// Column Management ///////////////// - - -ColumnManager.prototype.getFlexBaseWidth = function () { - - var self = this, - totalWidth = self.table.element.clientWidth, - //table element width - - fixedWidth = 0; - - //adjust for vertical scrollbar if present - - if (self.rowManager.element.scrollHeight > self.rowManager.element.clientHeight) { - - totalWidth -= self.rowManager.element.offsetWidth - self.rowManager.element.clientWidth; - } - - this.columnsByIndex.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width || 0; - - minWidth = typeof column.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(column.minWidth); - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - } - }); - - return fixedWidth; -}; - -ColumnManager.prototype.addColumn = function (definition, before, nextToColumn) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var column = _this3._addColumn(definition, before, nextToColumn); - - _this3._reIndexColumns(); - - if (_this3.table.options.responsiveLayout && _this3.table.modExists("responsiveLayout", true)) { - - _this3.table.modules.responsiveLayout.initialize(); - } - - if (_this3.table.modExists("columnCalcs")) { - - _this3.table.modules.columnCalcs.recalc(_this3.table.rowManager.activeRows); - } - - _this3.redraw(); - - if (_this3.table.modules.layout.getMode() != "fitColumns") { - - column.reinitializeWidth(); - } - - _this3._verticalAlignHeaders(); - - _this3.table.rowManager.reinitialize(); - - resolve(column); - }); -}; - -//remove column from system - -ColumnManager.prototype.deregisterColumn = function (column) { - - var field = column.getField(), - index; - - //remove from field list - - if (field) { - - delete this.columnsByField[field]; - } - - //remove from index list - - index = this.columnsByIndex.indexOf(column); - - if (index > -1) { - - this.columnsByIndex.splice(index, 1); - } - - //remove from column list - - index = this.columns.indexOf(column); - - if (index > -1) { - - this.columns.splice(index, 1); - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - this.redraw(); -}; - -//redraw columns - -ColumnManager.prototype.redraw = function (force) { - - if (force) { - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - - this._verticalAlignHeaders(); - } - - this.table.rowManager.resetScroll(); - - this.table.rowManager.reinitialize(); - } - - if (["fitColumns", "fitDataStretch"].indexOf(this.table.modules.layout.getMode()) > -1) { - - this.table.modules.layout.layout(); - } else { - - if (force) { - - this.table.modules.layout.layout(); - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (force) { - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.redraw(); - } - } - - this.table.footerManager.redraw(); -}; - -//public column object -var ColumnComponent = function ColumnComponent(column) { - this._column = column; - this.type = "ColumnComponent"; -}; - -ColumnComponent.prototype.getElement = function () { - return this._column.getElement(); -}; - -ColumnComponent.prototype.getDefinition = function () { - return this._column.getDefinition(); -}; - -ColumnComponent.prototype.getField = function () { - return this._column.getField(); -}; - -ColumnComponent.prototype.getCells = function () { - var cells = []; - - this._column.cells.forEach(function (cell) { - cells.push(cell.getComponent()); - }); - - return cells; -}; - -ColumnComponent.prototype.getVisibility = function () { - return this._column.visible; -}; - -ColumnComponent.prototype.show = function () { - if (this._column.isGroup) { - this._column.columns.forEach(function (column) { - column.show(); - }); - } else { - this._column.show(); - } -}; - -ColumnComponent.prototype.hide = function () { - if (this._column.isGroup) { - this._column.columns.forEach(function (column) { - column.hide(); - }); - } else { - this._column.hide(); - } -}; - -ColumnComponent.prototype.toggle = function () { - if (this._column.visible) { - this.hide(); - } else { - this.show(); - } -}; - -ColumnComponent.prototype.delete = function () { - return this._column.delete(); -}; - -ColumnComponent.prototype.getSubColumns = function () { - var output = []; - - if (this._column.columns.length) { - this._column.columns.forEach(function (column) { - output.push(column.getComponent()); - }); - } - - return output; -}; - -ColumnComponent.prototype.getParentColumn = function () { - return this._column.parent instanceof Column ? this._column.parent.getComponent() : false; -}; - -ColumnComponent.prototype._getSelf = function () { - return this._column; -}; - -ColumnComponent.prototype.scrollTo = function () { - return this._column.table.columnManager.scrollToColumn(this._column); -}; - -ColumnComponent.prototype.getTable = function () { - return this._column.table; -}; - -ColumnComponent.prototype.headerFilterFocus = function () { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.setHeaderFilterFocus(this._column); - } -}; - -ColumnComponent.prototype.reloadHeaderFilter = function () { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.reloadHeaderFilter(this._column); - } -}; - -ColumnComponent.prototype.getHeaderFilterValue = function () { - if (this._column.table.modExists("filter", true)) { - return this._column.table.modules.filter.getHeaderFilterValue(this._column); - } -}; - -ColumnComponent.prototype.setHeaderFilterValue = function (value) { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.setHeaderFilterValue(this._column, value); - } -}; - -ColumnComponent.prototype.move = function (to, after) { - var toColumn = this._column.table.columnManager.findColumn(to); - - if (toColumn) { - this._column.table.columnManager.moveColumn(this._column, toColumn, after); - } else { - console.warn("Move Error - No matching column found:", toColumn); - } -}; - -ColumnComponent.prototype.getNextColumn = function () { - var nextCol = this._column.nextColumn(); - - return nextCol ? nextCol.getComponent() : false; -}; - -ColumnComponent.prototype.getPrevColumn = function () { - var prevCol = this._column.prevColumn(); - - return prevCol ? prevCol.getComponent() : false; -}; - -ColumnComponent.prototype.updateDefinition = function (updates) { - return this._column.updateDefinition(updates); -}; - -var Column = function Column(def, parent) { - var self = this; - - this.table = parent.table; - this.definition = def; //column definition - this.parent = parent; //hold parent object - this.type = "column"; //type of element - this.columns = []; //child columns - this.cells = []; //cells bound to this column - this.element = this.createElement(); //column header element - this.contentElement = false; - this.titleElement = false; - this.groupElement = this.createGroupElement(); //column group holder element - this.isGroup = false; - this.tooltip = false; //hold column tooltip - this.hozAlign = ""; //horizontal text alignment - this.vertAlign = ""; //vert text alignment - - //multi dimensional filed handling - this.field = ""; - this.fieldStructure = ""; - this.getFieldValue = ""; - this.setFieldValue = ""; - - this.titleFormatterRendered = false; - - this.setField(this.definition.field); - - if (this.table.options.invalidOptionWarnings) { - this.checkDefinition(); - } - - this.modules = {}; //hold module variables; - - this.cellEvents = { - cellClick: false, - cellDblClick: false, - cellContext: false, - cellTap: false, - cellDblTap: false, - cellTapHold: false, - cellMouseEnter: false, - cellMouseLeave: false, - cellMouseOver: false, - cellMouseOut: false, - cellMouseMove: false - }; - - this.width = null; //column width - this.widthStyled = ""; //column width prestyled to improve render efficiency - this.minWidth = null; //column minimum width - this.minWidthStyled = ""; //column minimum prestyled to improve render efficiency - this.widthFixed = false; //user has specified a width for this column - - this.visible = true; //default visible state - - this._mapDepricatedFunctionality(); - - //initialize column - if (def.columns) { - - this.isGroup = true; - - def.columns.forEach(function (def, i) { - var newCol = new Column(def, self); - self.attachColumn(newCol); - }); - - self.checkColumnVisibility(); - } else { - parent.registerColumnField(this); - } - - if (def.rowHandle && this.table.options.movableRows !== false && this.table.modExists("moveRow")) { - this.table.modules.moveRow.setHandle(true); - } - - this._buildHeader(); - - this.bindModuleColumns(); -}; - -Column.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.setAttribute("role", "columnheader"); - el.setAttribute("aria-sort", "none"); - - return el; -}; - -Column.prototype.createGroupElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col-group-cols"); - - return el; -}; - -Column.prototype.checkDefinition = function () { - var _this4 = this; - - Object.keys(this.definition).forEach(function (key) { - if (_this4.defaultOptionList.indexOf(key) === -1) { - console.warn("Invalid column definition option in '" + (_this4.field || _this4.definition.title) + "' column:", key); - } - }); -}; - -Column.prototype.setField = function (field) { - this.field = field; - this.fieldStructure = field ? this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field] : []; - this.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData; - this.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData; -}; - -//register column position with column manager -Column.prototype.registerColumnPosition = function (column) { - this.parent.registerColumnPosition(column); -}; - -//register column position with column manager -Column.prototype.registerColumnField = function (column) { - this.parent.registerColumnField(column); -}; - -//trigger position registration -Column.prototype.reRegisterPosition = function () { - if (this.isGroup) { - this.columns.forEach(function (column) { - column.reRegisterPosition(); - }); - } else { - this.registerColumnPosition(this); - } -}; - -Column.prototype._mapDepricatedFunctionality = function () { - if (typeof this.definition.hideInHtml !== "undefined") { - this.definition.htmlOutput = !this.definition.hideInHtml; - console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput"); - } - - if (typeof this.definition.align !== "undefined") { - this.definition.hozAlign = this.definition.align; - console.warn("align column definition property is deprecated, you should now use hozAlign"); - } -}; - -Column.prototype.setTooltip = function () { - var self = this, - def = self.definition; - - //set header tooltips - var tooltip = def.headerTooltip || def.tooltip === false ? def.headerTooltip : self.table.options.tooltipsHeader; - - if (tooltip) { - if (tooltip === true) { - if (def.field) { - self.table.modules.localize.bind("columns|" + def.field, function (value) { - self.element.setAttribute("title", value || def.title); - }); - } else { - self.element.setAttribute("title", def.title); - } - } else { - if (typeof tooltip == "function") { - tooltip = tooltip(self.getComponent()); - - if (tooltip === false) { - tooltip = ""; - } - } - - self.element.setAttribute("title", tooltip); - } - } else { - self.element.setAttribute("title", ""); - } -}; - -//build header element -Column.prototype._buildHeader = function () { - var self = this, - def = self.definition; - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - }if (def.headerVertical) { - self.element.classList.add("tabulator-col-vertical"); - - if (def.headerVertical === "flip") { - self.element.classList.add("tabulator-col-vertical-flip"); - } - } - - self.contentElement = self._bindEvents(); - - self.contentElement = self._buildColumnHeaderContent(); - - self.element.appendChild(self.contentElement); - - if (self.isGroup) { - self._buildGroupHeader(); - } else { - self._buildColumnHeader(); - } - - self.setTooltip(); - - //set resizable handles - if (self.table.options.resizableColumns && self.table.modExists("resizeColumns")) { - self.table.modules.resizeColumns.initializeColumn("header", self, self.element); - } - - //set resizable handles - if (def.headerFilter && self.table.modExists("filter") && self.table.modExists("edit")) { - if (typeof def.headerFilterPlaceholder !== "undefined" && def.field) { - self.table.modules.localize.setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder); - } - - self.table.modules.filter.initializeColumn(self); - } - - //set resizable handles - if (self.table.modExists("frozenColumns")) { - self.table.modules.frozenColumns.initializeColumn(self); - } - - //set movable column - if (self.table.options.movableColumns && !self.isGroup && self.table.modExists("moveColumn")) { - self.table.modules.moveColumn.initializeColumn(self); - } - - //set calcs column - if ((def.topCalc || def.bottomCalc) && self.table.modExists("columnCalcs")) { - self.table.modules.columnCalcs.initializeColumn(self); - } - - //handle persistence - if (self.table.modExists("persistence") && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.initializeColumn(self); - } - - //update header tooltip on mouse enter - self.element.addEventListener("mouseenter", function (e) { - self.setTooltip(); - }); -}; - -Column.prototype._bindEvents = function () { - - var self = this, - def = self.definition, - dblTap, - tapHold, - tap; - - //setup header click event bindings - if (typeof def.headerClick == "function") { - self.element.addEventListener("click", function (e) { - def.headerClick(e, self.getComponent()); - }); - } - - if (typeof def.headerDblClick == "function") { - self.element.addEventListener("dblclick", function (e) { - def.headerDblClick(e, self.getComponent()); - }); - } - - if (typeof def.headerContext == "function") { - self.element.addEventListener("contextmenu", function (e) { - def.headerContext(e, self.getComponent()); - }); - } - - //setup header tap event bindings - if (typeof def.headerTap == "function") { - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - def.headerTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (typeof def.headerDblTap == "function") { - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - def.headerDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (typeof def.headerTapHold == "function") { - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - def.headerTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - //store column cell click event bindings - if (typeof def.cellClick == "function") { - self.cellEvents.cellClick = def.cellClick; - } - - if (typeof def.cellDblClick == "function") { - self.cellEvents.cellDblClick = def.cellDblClick; - } - - if (typeof def.cellContext == "function") { - self.cellEvents.cellContext = def.cellContext; - } - - //store column mouse event bindings - if (typeof def.cellMouseEnter == "function") { - self.cellEvents.cellMouseEnter = def.cellMouseEnter; - } - - if (typeof def.cellMouseLeave == "function") { - self.cellEvents.cellMouseLeave = def.cellMouseLeave; - } - - if (typeof def.cellMouseOver == "function") { - self.cellEvents.cellMouseOver = def.cellMouseOver; - } - - if (typeof def.cellMouseOut == "function") { - self.cellEvents.cellMouseOut = def.cellMouseOut; - } - - if (typeof def.cellMouseMove == "function") { - self.cellEvents.cellMouseMove = def.cellMouseMove; - } - - //setup column cell tap event bindings - if (typeof def.cellTap == "function") { - self.cellEvents.cellTap = def.cellTap; - } - - if (typeof def.cellDblTap == "function") { - self.cellEvents.cellDblTap = def.cellDblTap; - } - - if (typeof def.cellTapHold == "function") { - self.cellEvents.cellTapHold = def.cellTapHold; - } - - //setup column cell edit callbacks - if (typeof def.cellEdited == "function") { - self.cellEvents.cellEdited = def.cellEdited; - } - - if (typeof def.cellEditing == "function") { - self.cellEvents.cellEditing = def.cellEditing; - } - - if (typeof def.cellEditCancelled == "function") { - self.cellEvents.cellEditCancelled = def.cellEditCancelled; - } -}; - -//build header element for header -Column.prototype._buildColumnHeader = function () { - var self = this, - def = self.definition, - table = self.table, - sortable; - - //set column sorter - if (table.modExists("sort")) { - table.modules.sort.initializeColumn(self, self.contentElement); - } - - //set column header context menu - if ((def.headerContextMenu || def.headerMenu) && table.modExists("menu")) { - table.modules.menu.initializeColumnHeader(self); - } - - //set column formatter - if (table.modExists("format")) { - table.modules.format.initializeColumn(self); - } - - //set column editor - if (typeof def.editor != "undefined" && table.modExists("edit")) { - table.modules.edit.initializeColumn(self); - } - - //set colum validator - if (typeof def.validator != "undefined" && table.modExists("validate")) { - table.modules.validate.initializeColumn(self); - } - - //set column mutator - if (table.modExists("mutator")) { - table.modules.mutator.initializeColumn(self); - } - - //set column accessor - if (table.modExists("accessor")) { - table.modules.accessor.initializeColumn(self); - } - - //set respoviveLayout - if (_typeof(table.options.responsiveLayout) && table.modExists("responsiveLayout")) { - table.modules.responsiveLayout.initializeColumn(self); - } - - //set column visibility - if (typeof def.visible != "undefined") { - if (def.visible) { - self.show(true); - } else { - self.hide(true); - } - } - - //asign additional css classes to column header - if (def.cssClass) { - var classeNames = def.cssClass.split(" "); - classeNames.forEach(function (className) { - self.element.classList.add(className); - }); - } - - if (def.field) { - this.element.setAttribute("tabulator-field", def.field); - } - - //set min width if present - self.setMinWidth(typeof def.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(def.minWidth)); - - self.reinitializeWidth(); - - //set tooltip if present - self.tooltip = self.definition.tooltip || self.definition.tooltip === false ? self.definition.tooltip : self.table.options.tooltips; - - //set orizontal text alignment - self.hozAlign = typeof self.definition.hozAlign == "undefined" ? self.table.options.cellHozAlign : self.definition.hozAlign; - self.vertAlign = typeof self.definition.vertAlign == "undefined" ? self.table.options.cellVertAlign : self.definition.vertAlign; -}; - -Column.prototype._buildColumnHeaderContent = function () { - var def = this.definition, - table = this.table; - - var contentElement = document.createElement("div"); - contentElement.classList.add("tabulator-col-content"); - - this.titleElement = this._buildColumnHeaderTitle(); - - contentElement.appendChild(this.titleElement); - - return contentElement; -}; - -//build title element of column -Column.prototype._buildColumnHeaderTitle = function () { - var self = this, - def = self.definition, - table = self.table, - title; - - var titleHolderElement = document.createElement("div"); - titleHolderElement.classList.add("tabulator-col-title"); - - if (def.editableTitle) { - var titleElement = document.createElement("input"); - titleElement.classList.add("tabulator-title-editor"); - - titleElement.addEventListener("click", function (e) { - e.stopPropagation(); - titleElement.focus(); - }); - - titleElement.addEventListener("change", function () { - def.title = titleElement.value; - table.options.columnTitleChanged.call(self.table, self.getComponent()); - }); - - titleHolderElement.appendChild(titleElement); - - if (def.field) { - table.modules.localize.bind("columns|" + def.field, function (text) { - titleElement.value = text || def.title || " "; - }); - } else { - titleElement.value = def.title || " "; - } - } else { - if (def.field) { - table.modules.localize.bind("columns|" + def.field, function (text) { - self._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); - }); - } else { - self._formatColumnHeaderTitle(titleHolderElement, def.title || " "); - } - } - - return titleHolderElement; -}; - -Column.prototype._formatColumnHeaderTitle = function (el, title) { - var _this5 = this; - - var formatter, contents, params, mockCell, onRendered; - - if (this.definition.titleFormatter && this.table.modExists("format")) { - - formatter = this.table.modules.format.getFormatter(this.definition.titleFormatter); - - onRendered = function onRendered(callback) { - _this5.titleFormatterRendered = callback; - }; - - mockCell = { - getValue: function getValue() { - return title; - }, - getElement: function getElement() { - return el; - } - }; - - params = this.definition.titleFormatterParams || {}; - - params = typeof params === "function" ? params() : params; - - contents = formatter.call(this.table.modules.format, mockCell, params, onRendered); - - switch (typeof contents === 'undefined' ? 'undefined' : _typeof(contents)) { - case "object": - if (contents instanceof Node) { - el.appendChild(contents); - } else { - el.innerHTML = ""; - console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", contents); - } - break; - case "undefined": - case "null": - el.innerHTML = ""; - break; - default: - el.innerHTML = contents; - } - } else { - el.innerHTML = title; - } -}; - -//build header element for column group -Column.prototype._buildGroupHeader = function () { - var _this6 = this; - - this.element.classList.add("tabulator-col-group"); - this.element.setAttribute("role", "columngroup"); - this.element.setAttribute("aria-title", this.definition.title); - - //asign additional css classes to column header - if (this.definition.cssClass) { - var classeNames = this.definition.cssClass.split(" "); - classeNames.forEach(function (className) { - _this6.element.classList.add(className); - }); - } - - this.element.appendChild(this.groupElement); -}; - -//flat field lookup -Column.prototype._getFlatData = function (data) { - return data[this.field]; -}; - -//nested field lookup -Column.prototype._getNestedData = function (data) { - var dataObj = data, - structure = this.fieldStructure, - length = structure.length, - output; - - for (var i = 0; i < length; i++) { - - dataObj = dataObj[structure[i]]; - - output = dataObj; - - if (!dataObj) { - break; - } - } - - return output; -}; - -//flat field set -Column.prototype._setFlatData = function (data, value) { - if (this.field) { - data[this.field] = value; - } -}; - -//nested field set -Column.prototype._setNestedData = function (data, value) { - var dataObj = data, - structure = this.fieldStructure, - length = structure.length; - - for (var i = 0; i < length; i++) { - - if (i == length - 1) { - dataObj[structure[i]] = value; - } else { - if (!dataObj[structure[i]]) { - if (typeof value !== "undefined") { - dataObj[structure[i]] = {}; - } else { - break; - } - } - - dataObj = dataObj[structure[i]]; - } - } -}; - -//attach column to this group -Column.prototype.attachColumn = function (column) { - var self = this; - - if (self.groupElement) { - self.columns.push(column); - self.groupElement.appendChild(column.getElement()); - } else { - console.warn("Column Warning - Column being attached to another column instead of column group"); - } -}; - -//vertically align header in column -Column.prototype.verticalAlign = function (alignment, height) { - - //calculate height of column header and group holder element - var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : height || this.parent.getHeadersElement().clientHeight; - // var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight; - - this.element.style.height = parentHeight + "px"; - - if (this.isGroup) { - this.groupElement.style.minHeight = parentHeight - this.contentElement.offsetHeight + "px"; - } - - //vertically align cell contents - if (!this.isGroup && alignment !== "top") { - if (alignment === "bottom") { - this.element.style.paddingTop = this.element.clientHeight - this.contentElement.offsetHeight + "px"; - } else { - this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) / 2 + "px"; - } - } - - this.columns.forEach(function (column) { - column.verticalAlign(alignment); - }); -}; - -//clear vertical alignmenet -Column.prototype.clearVerticalAlign = function () { - this.element.style.paddingTop = ""; - this.element.style.height = ""; - this.element.style.minHeight = ""; - this.groupElement.style.minHeight = ""; - - this.columns.forEach(function (column) { - column.clearVerticalAlign(); - }); -}; - -Column.prototype.bindModuleColumns = function () { - //check if rownum formatter is being used on a column - if (this.definition.formatter == "rownum") { - this.table.rowManager.rowNumColumn = this; - } -}; - -//// Retreive Column Information //// - -//return column header element -Column.prototype.getElement = function () { - return this.element; -}; - -//return colunm group element -Column.prototype.getGroupElement = function () { - return this.groupElement; -}; - -//return field name -Column.prototype.getField = function () { - return this.field; -}; - -//return the first column in a group -Column.prototype.getFirstColumn = function () { - if (!this.isGroup) { - return this; - } else { - if (this.columns.length) { - return this.columns[0].getFirstColumn(); - } else { - return false; - } - } -}; - -//return the last column in a group -Column.prototype.getLastColumn = function () { - if (!this.isGroup) { - return this; - } else { - if (this.columns.length) { - return this.columns[this.columns.length - 1].getLastColumn(); - } else { - return false; - } - } -}; - -//return all columns in a group -Column.prototype.getColumns = function () { - return this.columns; -}; - -//return all columns in a group -Column.prototype.getCells = function () { - return this.cells; -}; - -//retreive the top column in a group of columns -Column.prototype.getTopColumn = function () { - if (this.parent.isGroup) { - return this.parent.getTopColumn(); - } else { - return this; - } -}; - -//return column definition object -Column.prototype.getDefinition = function (updateBranches) { - var colDefs = []; - - if (this.isGroup && updateBranches) { - this.columns.forEach(function (column) { - colDefs.push(column.getDefinition(true)); - }); - - this.definition.columns = colDefs; - } - - return this.definition; -}; - -//////////////////// Actions //////////////////// - -Column.prototype.checkColumnVisibility = function () { - var visible = false; - - this.columns.forEach(function (column) { - if (column.visible) { - visible = true; - } - }); - - if (visible) { - this.show(); - this.parent.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } else { - this.hide(); - } -}; - -//show column -Column.prototype.show = function (silent, responsiveToggle) { - if (!this.visible) { - this.visible = true; - - this.element.style.display = ""; - - if (this.parent.isGroup) { - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - cell.show(); - }); - - if (!this.isGroup && this.width === null) { - this.reinitializeWidth(); - } - - this.table.columnManager._verticalAlignHeaders(); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), true); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -//hide column -Column.prototype.hide = function (silent, responsiveToggle) { - if (this.visible) { - this.visible = false; - - this.element.style.display = "none"; - - this.table.columnManager._verticalAlignHeaders(); - - if (this.parent.isGroup) { - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - cell.hide(); - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -Column.prototype.matchChildWidths = function () { - var childWidth = 0; - - if (this.contentElement && this.columns.length) { - this.columns.forEach(function (column) { - if (column.visible) { - childWidth += column.getWidth(); - } - }); - - this.contentElement.style.maxWidth = childWidth - 1 + "px"; - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -Column.prototype.setWidth = function (width) { - this.widthFixed = true; - this.setWidthActual(width); -}; - -Column.prototype.setWidthActual = function (width) { - if (isNaN(width)) { - width = Math.floor(this.table.element.clientWidth / 100 * parseInt(width)); - } - - width = Math.max(this.minWidth, width); - - this.width = width; - this.widthStyled = width ? width + "px" : ""; - - this.element.style.width = this.widthStyled; - - if (!this.isGroup) { - this.cells.forEach(function (cell) { - cell.setWidth(); - }); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - - //set resizable handles - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } -}; - -Column.prototype.checkCellHeights = function () { - var rows = []; - - this.cells.forEach(function (cell) { - if (cell.row.heightInitialized) { - if (cell.row.getElement().offsetParent !== null) { - rows.push(cell.row); - cell.row.clearCellHeight(); - } else { - cell.row.heightInitialized = false; - } - } - }); - - rows.forEach(function (row) { - row.calcHeight(); - }); - - rows.forEach(function (row) { - row.setCellHeight(); - }); -}; - -Column.prototype.getWidth = function () { - var width = 0; - - if (this.isGroup) { - this.columns.forEach(function (column) { - if (column.visible) { - width += column.getWidth(); - } - }); - } else { - width = this.width; - } - - return width; -}; - -Column.prototype.getHeight = function () { - return this.element.offsetHeight; -}; - -Column.prototype.setMinWidth = function (minWidth) { - this.minWidth = minWidth; - this.minWidthStyled = minWidth ? minWidth + "px" : ""; - - this.element.style.minWidth = this.minWidthStyled; - - this.cells.forEach(function (cell) { - cell.setMinWidth(); - }); -}; - -Column.prototype.delete = function () { - var _this7 = this; - - return new Promise(function (resolve, reject) { - - if (_this7.isGroup) { - _this7.columns.forEach(function (column) { - column.delete(); - }); - } - - //cancel edit if column is currently being edited - if (_this7.table.modExists("edit")) { - if (_this7.table.modules.edit.currentCell.column === _this7) { - _this7.table.modules.edit.cancelEdit(); - } - } - - var cellCount = _this7.cells.length; - - for (var i = 0; i < cellCount; i++) { - _this7.cells[0].delete(); - } - - _this7.element.parentNode.removeChild(_this7.element); - - _this7.table.columnManager.deregisterColumn(_this7); - - resolve(); - }); -}; - -Column.prototype.columnRendered = function () { - if (this.titleFormatterRendered) { - this.titleFormatterRendered(); - } -}; - -//////////////// Cell Management ///////////////// - -//generate cell for this column -Column.prototype.generateCell = function (row) { - var self = this; - - var cell = new Cell(self, row); - - this.cells.push(cell); - - return cell; -}; - -Column.prototype.nextColumn = function () { - var index = this.table.columnManager.findColumnIndex(this); - return index > -1 ? this._nextVisibleColumn(index + 1) : false; -}; - -Column.prototype._nextVisibleColumn = function (index) { - var column = this.table.columnManager.getColumnByIndex(index); - return !column || column.visible ? column : this._nextVisibleColumn(index + 1); -}; - -Column.prototype.prevColumn = function () { - var index = this.table.columnManager.findColumnIndex(this); - return index > -1 ? this._prevVisibleColumn(index - 1) : false; -}; - -Column.prototype._prevVisibleColumn = function (index) { - var column = this.table.columnManager.getColumnByIndex(index); - return !column || column.visible ? column : this._prevVisibleColumn(index - 1); -}; - -Column.prototype.reinitializeWidth = function (force) { - this.widthFixed = false; - - //set width if present - if (typeof this.definition.width !== "undefined" && !force) { - this.setWidth(this.definition.width); - } - - //hide header filters to prevent them altering column width - if (this.table.modExists("filter")) { - this.table.modules.filter.hideHeaderFilterElements(); - } - - this.fitToData(); - - //show header filters again after layout is complete - if (this.table.modExists("filter")) { - this.table.modules.filter.showHeaderFilterElements(); - } -}; - -//set column width to maximum cell width -Column.prototype.fitToData = function () { - var self = this; - - if (!this.widthFixed) { - this.element.style.width = ""; - - self.cells.forEach(function (cell) { - cell.clearWidth(); - }); - } - - var maxWidth = this.element.offsetWidth; - - if (!self.width || !this.widthFixed) { - self.cells.forEach(function (cell) { - var width = cell.getWidth(); - - if (width > maxWidth) { - maxWidth = width; - } - }); - - if (maxWidth) { - self.setWidthActual(maxWidth + 1); - } - } -}; - -Column.prototype.updateDefinition = function (updates) { - var _this8 = this; - - return new Promise(function (resolve, reject) { - var definition; - - if (!_this8.isGroup) { - definition = Object.assign({}, _this8.getDefinition()); - definition = Object.assign(definition, updates); - - _this8.table.columnManager.addColumn(definition, false, _this8).then(function (column) { - - if (definition.field == _this8.field) { - _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays - } - - _this8.delete().then(function () { - resolve(column.getComponent()); - }).catch(function (err) { - reject(err); - }); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - reject("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - } - }); -}; - -Column.prototype.deleteCell = function (cell) { - var index = this.cells.indexOf(cell); - - if (index > -1) { - this.cells.splice(index, 1); - } -}; - -Column.prototype.defaultOptionList = ["title", "field", "columns", "visible", "align", "hozAlign", "vertAlign", "width", "minWidth", "widthGrow", "widthShrink", "resizable", "frozen", "responsive", "tooltip", "cssClass", "rowHandle", "hideInHtml", "print", "htmlOutput", "sorter", "sorterParams", "formatter", "formatterParams", "variableHeight", "editable", "editor", "editorParams", "validator", "mutator", "mutatorParams", "mutatorData", "mutatorDataParams", "mutatorEdit", "mutatorEditParams", "mutatorClipboard", "mutatorClipboardParams", "accessor", "accessorParams", "accessorData", "accessorDataParams", "accessorDownload", "accessorDownloadParams", "accessorClipboard", "accessorClipboardParams", "accessorPrint", "accessorPrintParams", "accessorHtmlOutput", "accessorHtmlOutputParams", "clipboard", "download", "downloadTitle", "topCalc", "topCalcParams", "topCalcFormatter", "topCalcFormatterParams", "bottomCalc", "bottomCalcParams", "bottomCalcFormatter", "bottomCalcFormatterParams", "cellClick", "cellDblClick", "cellContext", "cellTap", "cellDblTap", "cellTapHold", "cellMouseEnter", "cellMouseLeave", "cellMouseOver", "cellMouseOut", "cellMouseMove", "cellEditing", "cellEdited", "cellEditCancelled", "headerSort", "headerSortStartingDir", "headerSortTristate", "headerClick", "headerDblClick", "headerContext", "headerTap", "headerDblTap", "headerTapHold", "headerTooltip", "headerVertical", "editableTitle", "titleFormatter", "titleFormatterParams", "headerFilter", "headerFilterPlaceholder", "headerFilterParams", "headerFilterEmptyCheck", "headerFilterFunc", "headerFilterFuncParams", "headerFilterLiveFilter", "print", "headerContextMenu", "headerMenu", "contextMenu", "formatterPrint", "formatterPrintParams", "formatterClipboard", "formatterClipboardParams", "formatterHtmlOutput", "formatterHtmlOutputParams"]; - -//////////////// Event Bindings ///////////////// - -//////////////// Object Generation ///////////////// -Column.prototype.getComponent = function () { - return new ColumnComponent(this); -}; - -var RowManager = function RowManager(table) { - - this.table = table; - this.element = this.createHolderElement(); //containing element - this.tableElement = this.createTableElement(); //table element - this.heightFixer = this.createTableElement(); //table element - this.columnManager = null; //hold column manager object - this.height = 0; //hold height of table element - - this.firstRender = false; //handle first render - this.renderMode = "virtual"; //current rendering mode - this.fixedHeight = false; //current rendering mode - - this.rows = []; //hold row data objects - this.activeRows = []; //rows currently available to on display in the table - this.activeRowsCount = 0; //count of active rows - - this.displayRows = []; //rows currently on display in the table - this.displayRowsCount = 0; //count of display rows - - this.scrollTop = 0; - this.scrollLeft = 0; - - this.vDomRowHeight = 20; //approximation of row heights for padding - - this.vDomTop = 0; //hold position for first rendered row in the virtual DOM - this.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM - - this.vDomScrollPosTop = 0; //last scroll position of the vDom top; - this.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom; - - this.vDomTopPad = 0; //hold value of padding for top of virtual DOM - this.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM - - this.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go - - this.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling - - this.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows) - this.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin - - this.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed - this.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed - - this.rowNumColumn = false; //hold column component for row number column - - this.redrawBlock = false; //prevent redraws to allow multiple data manipulations becore continuing - this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed - this.redrawBlockRederInPosition = false; //store latest redraw function calls for when redraw is needed -}; - -//////////////// Setup Functions ///////////////// - -RowManager.prototype.createHolderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-tableHolder"); - el.setAttribute("tabindex", 0); - - return el; -}; - -RowManager.prototype.createTableElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-table"); - - return el; -}; - -//return containing element -RowManager.prototype.getElement = function () { - return this.element; -}; - -//return table element -RowManager.prototype.getTableElement = function () { - return this.tableElement; -}; - -//return position of row in table -RowManager.prototype.getRowPosition = function (row, active) { - if (active) { - return this.activeRows.indexOf(row); - } else { - return this.rows.indexOf(row); - } -}; - -//link to column manager -RowManager.prototype.setColumnManager = function (manager) { - this.columnManager = manager; -}; - -RowManager.prototype.initialize = function () { - var self = this; - - self.setRenderMode(); - - //initialize manager - self.element.appendChild(self.tableElement); - - self.firstRender = true; - - //scroll header along with table body - self.element.addEventListener("scroll", function () { - var left = self.element.scrollLeft; - - //handle horizontal scrolling - if (self.scrollLeft != left) { - self.columnManager.scrollHorizontal(left); - - if (self.table.options.groupBy) { - self.table.modules.groupRows.scrollHeaders(left); - } - - if (self.table.modExists("columnCalcs")) { - self.table.modules.columnCalcs.scrollHorizontal(left); - } - - self.table.options.scrollHorizontal(left); - } - - self.scrollLeft = left; - }); - - //handle virtual dom scrolling - if (this.renderMode === "virtual") { - - self.element.addEventListener("scroll", function () { - var top = self.element.scrollTop; - var dir = self.scrollTop > top; - - //handle verical scrolling - if (self.scrollTop != top) { - self.scrollTop = top; - self.scrollVertical(dir); - - if (self.table.options.ajaxProgressiveLoad == "scroll") { - self.table.modules.ajax.nextPage(self.element.scrollHeight - self.element.clientHeight - top); - } - - self.table.options.scrollVertical(top); - } else { - self.scrollTop = top; - } - }); - } -}; - -////////////////// Row Manipulation ////////////////// - -RowManager.prototype.findRow = function (subject) { - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Row) { - //subject is row element - return subject; - } else if (subject instanceof RowComponent) { - //subject is public row component - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - //subject is a HTML element of the row - var match = self.rows.find(function (row) { - return row.element === subject; - }); - - return match || false; - } - } else if (typeof subject == "undefined" || subject === null) { - return false; - } else { - //subject should be treated as the index of the row - var _match = self.rows.find(function (row) { - return row.data[self.table.options.index] == subject; - }); - - return _match || false; - } - - //catch all for any other type of input - - return false; -}; - -RowManager.prototype.getRowFromDataObject = function (data) { - var match = this.rows.find(function (row) { - return row.data === data; - }); - - return match || false; -}; - -RowManager.prototype.getRowFromPosition = function (position, active) { - if (active) { - return this.activeRows[position]; - } else { - return this.rows[position]; - } -}; - -RowManager.prototype.scrollToRow = function (row, position, ifVisible) { - var _this9 = this; - - var rowIndex = this.getDisplayRows().indexOf(row), - rowEl = row.getElement(), - rowTop, - offset = 0; - - return new Promise(function (resolve, reject) { - if (rowIndex > -1) { - - if (typeof position === "undefined") { - position = _this9.table.options.scrollToRowPosition; - } - - if (typeof ifVisible === "undefined") { - ifVisible = _this9.table.options.scrollToRowIfVisible; - } - - if (position === "nearest") { - switch (_this9.renderMode) { - case "classic": - rowTop = Tabulator.prototype.helpers.elOffset(rowEl).top; - position = Math.abs(_this9.element.scrollTop - rowTop) > Math.abs(_this9.element.scrollTop + _this9.element.clientHeight - rowTop) ? "bottom" : "top"; - break; - case "virtual": - position = Math.abs(_this9.vDomTop - rowIndex) > Math.abs(_this9.vDomBottom - rowIndex) ? "bottom" : "top"; - break; - } - } - - //check row visibility - if (!ifVisible) { - if (Tabulator.prototype.helpers.elVisible(rowEl)) { - offset = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top; - - if (offset > 0 && offset < _this9.element.clientHeight - rowEl.offsetHeight) { - return false; - } - } - } - - //scroll to row - switch (_this9.renderMode) { - case "classic": - _this9.element.scrollTop = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top + _this9.element.scrollTop; - break; - case "virtual": - _this9._virtualRenderFill(rowIndex, true); - break; - } - - //align to correct position - switch (position) { - case "middle": - case "center": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - _this9.element.scrollTop = _this9.element.scrollTop + (rowEl.offsetTop - _this9.element.scrollTop) - (_this9.element.scrollHeight - rowEl.offsetTop) / 2; - } else { - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight / 2; - } - - break; - - case "bottom": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - _this9.element.scrollTop = _this9.element.scrollTop - (_this9.element.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight; - } else { - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight + rowEl.offsetHeight; - } - - break; - } - - resolve(); - } else { - console.warn("Scroll Error - Row not visible"); - reject("Scroll Error - Row not visible"); - } - }); -}; - -////////////////// Data Handling ////////////////// - -RowManager.prototype.setData = function (data, renderInPosition, columnsChanged) { - var _this10 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - if (renderInPosition && _this10.getDisplayRows().length) { - if (self.table.options.pagination) { - self._setDataActual(data, true); - } else { - _this10.reRenderInPosition(function () { - self._setDataActual(data); - }); - } - } else { - if (_this10.table.options.autoColumns && columnsChanged) { - _this10.table.columnManager.generateColumnsFromRowData(data); - } - _this10.resetScroll(); - _this10._setDataActual(data); - } - - resolve(); - }); -}; - -RowManager.prototype._setDataActual = function (data, renderInPosition) { - var self = this; - - self.table.options.dataLoading.call(this.table, data); - - this._wipeElements(); - - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.clear(); - } - - if (Array.isArray(data)) { - - if (this.table.modExists("selectRow")) { - this.table.modules.selectRow.clearSelectionData(); - } - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - this.table.modules.reactiveData.watchData(data); - } - - data.forEach(function (def, i) { - if (def && (typeof def === 'undefined' ? 'undefined' : _typeof(def)) === "object") { - var row = new Row(def, self); - self.rows.push(row); - } else { - console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def); - } - }); - - self.table.options.dataLoaded.call(this.table, data); - - self.refreshActiveData(false, false, renderInPosition); - } else { - console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ", typeof data === 'undefined' ? 'undefined' : _typeof(data), "\nData: ", data); - } -}; - -RowManager.prototype._wipeElements = function () { - this.rows.forEach(function (row) { - row.wipe(); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.wipe(); - } - - this.rows = []; -}; - -RowManager.prototype.deleteRow = function (row, blockRedraw) { - var allIndex = this.rows.indexOf(row), - activeIndex = this.activeRows.indexOf(row); - - if (activeIndex > -1) { - this.activeRows.splice(activeIndex, 1); - } - - if (allIndex > -1) { - this.rows.splice(allIndex, 1); - } - - this.setActiveRows(this.activeRows); - - this.displayRowIterator(function (rows) { - var displayIndex = rows.indexOf(row); - - if (displayIndex > -1) { - rows.splice(displayIndex, 1); - } - }); - - if (!blockRedraw) { - this.reRenderInPosition(); - } - - this.regenerateRowNumbers(); - - this.table.options.rowDeleted.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } else if (this.table.options.pagination && this.table.modExists("page")) { - this.refreshActiveData(false, false, true); - } else { - if (this.table.options.pagination && this.table.modExists("page")) { - this.refreshActiveData("page"); - } - } -}; - -RowManager.prototype.addRow = function (data, pos, index, blockRedraw) { - - var row = this.addRowActual(data, pos, index, blockRedraw); - - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("rowAdd", row, { data: data, pos: pos, index: index }); - } - - return row; -}; - -//add multiple rows -RowManager.prototype.addRows = function (data, pos, index) { - var _this11 = this; - - var self = this, - length = 0, - rows = []; - - return new Promise(function (resolve, reject) { - pos = _this11.findAddRowPos(pos); - - if (!Array.isArray(data)) { - data = [data]; - } - - length = data.length - 1; - - if (typeof index == "undefined" && pos || typeof index !== "undefined" && !pos) { - data.reverse(); - } - - data.forEach(function (item, i) { - var row = self.addRow(item, pos, index, true); - rows.push(row); - }); - - if (_this11.table.options.groupBy && _this11.table.modExists("groupRows")) { - _this11.table.modules.groupRows.updateGroupRows(true); - } else if (_this11.table.options.pagination && _this11.table.modExists("page")) { - _this11.refreshActiveData(false, false, true); - } else { - _this11.reRenderInPosition(); - } - - //recalc column calculations if present - if (_this11.table.modExists("columnCalcs")) { - _this11.table.modules.columnCalcs.recalc(_this11.table.rowManager.activeRows); - } - - _this11.regenerateRowNumbers(); - resolve(rows); - }); -}; - -RowManager.prototype.findAddRowPos = function (pos) { - if (typeof pos === "undefined") { - pos = this.table.options.addRowPos; - } - - if (pos === "pos") { - pos = true; - } - - if (pos === "bottom") { - pos = false; - } - - return pos; -}; - -RowManager.prototype.addRowActual = function (data, pos, index, blockRedraw) { - var row = data instanceof Row ? data : new Row(data || {}, this), - top = this.findAddRowPos(pos), - allIndex = -1, - activeIndex, - dispRows; - - if (!index && this.table.options.pagination && this.table.options.paginationAddRow == "page") { - dispRows = this.getDisplayRows(); - - if (top) { - if (dispRows.length) { - index = dispRows[0]; - } else { - if (this.activeRows.length) { - index = this.activeRows[this.activeRows.length - 1]; - top = false; - } - } - } else { - if (dispRows.length) { - index = dispRows[dispRows.length - 1]; - top = dispRows.length < this.table.modules.page.getPageSize() ? false : true; - } - } - } - - if (typeof index !== "undefined") { - index = this.findRow(index); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.assignRowToGroup(row); - - var groupRows = row.getGroup().rows; - - if (groupRows.length > 1) { - - if (!index || index && groupRows.indexOf(index) == -1) { - if (top) { - if (groupRows[0] !== row) { - index = groupRows[0]; - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } else { - if (groupRows[groupRows.length - 1] !== row) { - index = groupRows[groupRows.length - 1]; - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } else { - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } - - if (index) { - allIndex = this.rows.indexOf(index); - } - - if (index && allIndex > -1) { - activeIndex = this.activeRows.indexOf(index); - - this.displayRowIterator(function (rows) { - var displayIndex = rows.indexOf(index); - - if (displayIndex > -1) { - rows.splice(top ? displayIndex : displayIndex + 1, 0, row); - } - }); - - if (activeIndex > -1) { - this.activeRows.splice(top ? activeIndex : activeIndex + 1, 0, row); - } - - this.rows.splice(top ? allIndex : allIndex + 1, 0, row); - } else { - - if (top) { - - this.displayRowIterator(function (rows) { - rows.unshift(row); - }); - - this.activeRows.unshift(row); - this.rows.unshift(row); - } else { - this.displayRowIterator(function (rows) { - rows.push(row); - }); - - this.activeRows.push(row); - this.rows.push(row); - } - } - - this.setActiveRows(this.activeRows); - - this.table.options.rowAdded.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (!blockRedraw) { - this.reRenderInPosition(); - } - - return row; -}; - -RowManager.prototype.moveRow = function (from, to, after) { - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("rowMove", from, { posFrom: this.getRowPosition(from), posTo: this.getRowPosition(to), to: to, after: after }); - } - - this.moveRowActual(from, to, after); - - this.regenerateRowNumbers(); - - this.table.options.rowMoved.call(this.table, from.getComponent()); -}; - -RowManager.prototype.moveRowActual = function (from, to, after) { - var _this12 = this; - - this._moveRowInArray(this.rows, from, to, after); - this._moveRowInArray(this.activeRows, from, to, after); - - this.displayRowIterator(function (rows) { - _this12._moveRowInArray(rows, from, to, after); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (!after && to instanceof Group) { - to = this.table.rowManager.prevDisplayRow(from) || to; - } - - var toGroup = to.getGroup(); - var fromGroup = from.getGroup(); - - if (toGroup === fromGroup) { - this._moveRowInArray(toGroup.rows, from, to, after); - } else { - if (fromGroup) { - fromGroup.removeRow(from); - } - - toGroup.insertRow(from, to, after); - } - } -}; - -RowManager.prototype._moveRowInArray = function (rows, from, to, after) { - var fromIndex, toIndex, start, end; - - if (from !== to) { - - fromIndex = rows.indexOf(from); - - if (fromIndex > -1) { - - rows.splice(fromIndex, 1); - - toIndex = rows.indexOf(to); - - if (toIndex > -1) { - - if (after) { - rows.splice(toIndex + 1, 0, from); - } else { - rows.splice(toIndex, 0, from); - } - } else { - rows.splice(fromIndex, 0, from); - } - } - - //restyle rows - if (rows === this.getDisplayRows()) { - - start = fromIndex < toIndex ? fromIndex : toIndex; - end = toIndex > fromIndex ? toIndex : fromIndex + 1; - - for (var i = start; i <= end; i++) { - if (rows[i]) { - this.styleRow(rows[i], i); - } - } - } - } -}; - -RowManager.prototype.clearData = function () { - this.setData([]); -}; - -RowManager.prototype.getRowIndex = function (row) { - return this.findRowIndex(row, this.rows); -}; - -RowManager.prototype.getDisplayRowIndex = function (row) { - var index = this.getDisplayRows().indexOf(row); - return index > -1 ? index : false; -}; - -RowManager.prototype.nextDisplayRow = function (row, rowOnly) { - var index = this.getDisplayRowIndex(row), - nextRow = false; - - if (index !== false && index < this.displayRowsCount - 1) { - nextRow = this.getDisplayRows()[index + 1]; - } - - if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) { - return this.nextDisplayRow(nextRow, rowOnly); - } - - return nextRow; -}; - -RowManager.prototype.prevDisplayRow = function (row, rowOnly) { - var index = this.getDisplayRowIndex(row), - prevRow = false; - - if (index) { - prevRow = this.getDisplayRows()[index - 1]; - } - - if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) { - return this.prevDisplayRow(prevRow, rowOnly); - } - - return prevRow; -}; - -RowManager.prototype.findRowIndex = function (row, list) { - var rowIndex; - - row = this.findRow(row); - - if (row) { - rowIndex = list.indexOf(row); - - if (rowIndex > -1) { - return rowIndex; - } - } - - return false; -}; - -RowManager.prototype.getData = function (active, transform) { - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - if (row.type == "row") { - output.push(row.getData(transform || "data")); - } - }); - - return output; -}; - -RowManager.prototype.getComponents = function (active) { - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - output.push(row.getComponent()); - }); - - return output; -}; - -RowManager.prototype.getDataCount = function (active) { - var rows = this.getRows(active); - - return rows.length; -}; - -RowManager.prototype._genRemoteRequest = function () { - var _this13 = this; - - var table = this.table, - options = table.options, - params = {}; - - if (table.modExists("page")) { - //set sort data if defined - if (options.ajaxSorting) { - var sorters = this.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - params[this.table.modules.page.paginationDataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (options.ajaxFiltering) { - var filters = this.table.modules.filter.getFilters(true, true); - - params[this.table.modules.page.paginationDataSentNames.filters] = filters; - } - - this.table.modules.ajax.setParams(params, true); - } - - table.modules.ajax.sendRequest().then(function (data) { - _this13._setDataActual(data, true); - }).catch(function (e) {}); -}; - -//choose the path to refresh data after a filter update -RowManager.prototype.filterRefresh = function () { - var table = this.table, - options = table.options, - left = this.scrollLeft; - - if (options.ajaxFiltering) { - if (options.pagination == "remote" && table.modExists("page")) { - table.modules.page.reset(true); - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - //assume data is url, make ajax call to url to get data - this._genRemoteRequest(); - } - } else { - this.refreshActiveData("filter"); - } - - this.scrollHorizontal(left); -}; - -//choose the path to refresh data after a sorter update -RowManager.prototype.sorterRefresh = function (loadOrignalData) { - var table = this.table, - options = this.table.options, - left = this.scrollLeft; - - if (options.ajaxSorting) { - if ((options.pagination == "remote" || options.progressiveLoad) && table.modExists("page")) { - table.modules.page.reset(true); - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - //assume data is url, make ajax call to url to get data - this._genRemoteRequest(); - } - } else { - this.refreshActiveData(loadOrignalData ? "filter" : "sort"); - } - - this.scrollHorizontal(left); -}; - -RowManager.prototype.scrollHorizontal = function (left) { - this.scrollLeft = left; - this.element.scrollLeft = left; - - if (this.table.options.groupBy) { - this.table.modules.groupRows.scrollHeaders(left); - } - - if (this.table.modExists("columnCalcs")) { - this.table.modules.columnCalcs.scrollHorizontal(left); - } -}; - -//set active data set -RowManager.prototype.refreshActiveData = function (stage, skipStage, renderInPosition) { - var self = this, - table = this.table, - cascadeOrder = ["all", "filter", "sort", "display", "freeze", "group", "tree", "page"], - displayIndex; - - if (this.redrawBlock) { - - if (!this.redrawBlockRestoreConfig || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage)) { - this.redrawBlockRestoreConfig = { - stage: stage, - skipStage: skipStage, - renderInPosition: renderInPosition - }; - } - - return; - } else { - - if (self.table.modExists("edit")) { - self.table.modules.edit.cancelEdit(); - } - - if (!stage) { - stage = "all"; - } - - if (table.options.selectable && !table.options.selectablePersistence && table.modExists("selectRow")) { - table.modules.selectRow.deselectRows(); - } - - //cascade through data refresh stages - switch (stage) { - case "all": - - case "filter": - if (!skipStage) { - if (table.modExists("filter")) { - self.setActiveRows(table.modules.filter.filter(self.rows)); - } else { - self.setActiveRows(self.rows.slice(0)); - } - } else { - skipStage = false; - } - - case "sort": - if (!skipStage) { - if (table.modExists("sort")) { - table.modules.sort.sort(this.activeRows); - } - } else { - skipStage = false; - } - - //regenerate row numbers for row number formatter if in use - this.regenerateRowNumbers(); - - //generic stage to allow for pipeline trigger after the data manipulation stage - case "display": - this.resetDisplayRows(); - - case "freeze": - if (!skipStage) { - if (this.table.modExists("frozenRows")) { - if (table.modules.frozenRows.isFrozen()) { - if (!table.modules.frozenRows.getDisplayIndex()) { - table.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.frozenRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.frozenRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.frozenRows.setDisplayIndex(displayIndex); - } - } - } - } else { - skipStage = false; - } - - case "group": - if (!skipStage) { - if (table.options.groupBy && table.modExists("groupRows")) { - - if (!table.modules.groupRows.getDisplayIndex()) { - table.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.groupRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.groupRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.groupRows.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - - case "tree": - - if (!skipStage) { - if (table.options.dataTree && table.modExists("dataTree")) { - if (!table.modules.dataTree.getDisplayIndex()) { - table.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.dataTree.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.dataTree.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.dataTree.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - - if (table.options.pagination && table.modExists("page") && !renderInPosition) { - if (table.modules.page.getMode() == "local") { - table.modules.page.reset(); - } - } - - case "page": - if (!skipStage) { - if (table.options.pagination && table.modExists("page")) { - - if (!table.modules.page.getDisplayIndex()) { - table.modules.page.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.page.getDisplayIndex(); - - if (table.modules.page.getMode() == "local") { - table.modules.page.setMaxRows(this.getDisplayRows(displayIndex - 1).length); - } - - displayIndex = self.setDisplayRows(table.modules.page.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.page.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - } - - if (Tabulator.prototype.helpers.elVisible(self.element)) { - if (renderInPosition) { - self.reRenderInPosition(); - } else { - self.renderTable(); - if (table.options.layoutColumnsOnNewData) { - self.table.columnManager.redraw(true); - } - } - } - - if (table.modExists("columnCalcs")) { - table.modules.columnCalcs.recalc(this.activeRows); - } - } -}; - -//regenerate row numbers for row number formatter if in use -RowManager.prototype.regenerateRowNumbers = function () { - var _this14 = this; - - if (this.rowNumColumn) { - this.activeRows.forEach(function (row) { - var cell = row.getCell(_this14.rowNumColumn); - - if (cell) { - cell._generateContents(); - } - }); - } -}; - -RowManager.prototype.setActiveRows = function (activeRows) { - this.activeRows = activeRows; - this.activeRowsCount = this.activeRows.length; -}; - -//reset display rows array -RowManager.prototype.resetDisplayRows = function () { - this.displayRows = []; - - this.displayRows.push(this.activeRows.slice(0)); - - this.displayRowsCount = this.displayRows[0].length; - - if (this.table.modExists("frozenRows")) { - this.table.modules.frozenRows.setDisplayIndex(0); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.setDisplayIndex(0); - } - - if (this.table.options.pagination && this.table.modExists("page")) { - this.table.modules.page.setDisplayIndex(0); - } -}; - -RowManager.prototype.getNextDisplayIndex = function () { - return this.displayRows.length; -}; - -//set display row pipeline data -RowManager.prototype.setDisplayRows = function (displayRows, index) { - - var output = true; - - if (index && typeof this.displayRows[index] != "undefined") { - this.displayRows[index] = displayRows; - output = true; - } else { - this.displayRows.push(displayRows); - output = index = this.displayRows.length - 1; - } - - if (index == this.displayRows.length - 1) { - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - } - - return output; -}; - -RowManager.prototype.getDisplayRows = function (index) { - if (typeof index == "undefined") { - return this.displayRows.length ? this.displayRows[this.displayRows.length - 1] : []; - } else { - return this.displayRows[index] || []; - } -}; - -RowManager.prototype.getVisibleRows = function (viewable) { - var topEdge = this.element.scrollTop, - bottomEdge = this.element.clientHeight + topEdge, - topFound = false, - topRow = 0, - bottomRow = 0, - rows = this.getDisplayRows(); - - if (viewable) { - - this.getDisplayRows(); - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - if (rows[i]) { - if (!topFound) { - if (topEdge - rows[i].getElement().offsetTop >= 0) { - topRow = i; - } else { - topFound = true; - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - bottomRow = i; - } else { - break; - } - } - } else { - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - bottomRow = i; - } else { - break; - } - } - } - } - } else { - topRow = this.vDomTop; - bottomRow = this.vDomBottom; - } - - return rows.slice(topRow, bottomRow + 1); -}; - -//repeat action accross display rows -RowManager.prototype.displayRowIterator = function (callback) { - this.displayRows.forEach(callback); - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; -}; - -//return only actual rows (not group headers etc) -RowManager.prototype.getRows = function (active) { - var rows; - - switch (active) { - case "active": - rows = this.activeRows; - break; - - case "display": - rows = this.table.rowManager.getDisplayRows(); - break; - - case "visible": - rows = this.getVisibleRows(true); - break; - - default: - rows = this.rows; - } - - return rows; -}; - -///////////////// Table Rendering ///////////////// - -//trigger rerender of table in current position -RowManager.prototype.reRenderInPosition = function (callback) { - if (this.getRenderMode() == "virtual") { - - if (this.redrawBlock) { - if (callback) { - callback(); - } else { - this.redrawBlockRederInPosition = true; - } - } else { - var scrollTop = this.element.scrollTop; - var topRow = false; - var topOffset = false; - - var left = this.scrollLeft; - - var rows = this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - var diff = scrollTop - rows[i].getElement().offsetTop; - - if (topOffset === false || Math.abs(diff) < topOffset) { - topOffset = diff; - topRow = i; - } else { - break; - } - } - } - - if (callback) { - callback(); - } - - this._virtualRenderFill(topRow === false ? this.displayRowsCount - 1 : topRow, true, topOffset || 0); - - this.scrollHorizontal(left); - } - } else { - this.renderTable(); - - if (callback) { - callback(); - } - } -}; - -RowManager.prototype.setRenderMode = function () { - - if (this.table.options.virtualDom) { - - this.renderMode = "virtual"; - - if (this.table.element.clientHeight || this.table.options.height) { - this.fixedHeight = true; - } else { - this.fixedHeight = false; - } - } else { - this.renderMode = "classic"; - } -}; - -RowManager.prototype.getRenderMode = function () { - return this.renderMode; -}; - -RowManager.prototype.renderTable = function () { - - this.table.options.renderStarted.call(this.table); - - this.element.scrollTop = 0; - - switch (this.renderMode) { - case "classic": - this._simpleRender(); - break; - - case "virtual": - this._virtualRenderFill(); - break; - } - - if (this.firstRender) { - if (this.displayRowsCount) { - this.firstRender = false; - this.table.modules.layout.layout(); - } else { - this.renderEmptyScroll(); - } - } - - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } - - if (!this.displayRowsCount) { - if (this.table.options.placeholder) { - - this.table.options.placeholder.setAttribute("tabulator-render-mode", this.renderMode); - - this.getElement().appendChild(this.table.options.placeholder); - this.table.options.placeholder.style.width = this.table.columnManager.getWidth() + "px"; - } - } - - this.table.options.renderComplete.call(this.table); -}; - -//simple render on heightless table -RowManager.prototype._simpleRender = function () { - this._clearVirtualDom(); - - if (this.displayRowsCount) { - this.checkClassicModeGroupHeaderWidth(); - } else { - this.renderEmptyScroll(); - } -}; - -RowManager.prototype.checkClassicModeGroupHeaderWidth = function () { - var self = this, - element = this.tableElement, - onlyGroupHeaders = true; - - self.getDisplayRows().forEach(function (row, index) { - self.styleRow(row, index); - element.appendChild(row.getElement()); - row.initialize(true); - - if (row.type !== "group") { - onlyGroupHeaders = false; - } - }); - - if (onlyGroupHeaders) { - element.style.minWidth = self.table.columnManager.getWidth() + "px"; - } else { - element.style.minWidth = ""; - } -}; - -//show scrollbars on empty table div -RowManager.prototype.renderEmptyScroll = function () { - if (this.table.options.placeholder) { - this.tableElement.style.display = "none"; - } else { - this.tableElement.style.minWidth = this.table.columnManager.getWidth() + "px"; - this.tableElement.style.minHeight = "1px"; - this.tableElement.style.visibility = "hidden"; - } -}; - -RowManager.prototype._clearVirtualDom = function () { - var element = this.tableElement; - - if (this.table.options.placeholder && this.table.options.placeholder.parentNode) { - this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder); - } - - // element.children.detach(); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.style.paddingTop = ""; - element.style.paddingBottom = ""; - element.style.minWidth = ""; - element.style.minHeight = ""; - element.style.display = ""; - element.style.visibility = ""; - - this.scrollTop = 0; - this.scrollLeft = 0; - this.vDomTop = 0; - this.vDomBottom = 0; - this.vDomTopPad = 0; - this.vDomBottomPad = 0; -}; - -RowManager.prototype.styleRow = function (row, index) { - var rowEl = row.getElement(); - - if (index % 2) { - rowEl.classList.add("tabulator-row-even"); - rowEl.classList.remove("tabulator-row-odd"); - } else { - rowEl.classList.add("tabulator-row-odd"); - rowEl.classList.remove("tabulator-row-even"); - } -}; - -//full virtual render -RowManager.prototype._virtualRenderFill = function (position, forceMove, offset) { - var self = this, - element = self.tableElement, - holder = self.element, - topPad = 0, - rowsHeight = 0, - topPadHeight = 0, - i = 0, - onlyGroupHeaders = true, - rows = self.getDisplayRows(); - - position = position || 0; - - offset = offset || 0; - - if (!position) { - self._clearVirtualDom(); - } else { - while (element.firstChild) { - element.removeChild(element.firstChild); - } //check if position is too close to bottom of table - var heightOccupied = (self.displayRowsCount - position + 1) * self.vDomRowHeight; - - if (heightOccupied < self.height) { - position -= Math.ceil((self.height - heightOccupied) / self.vDomRowHeight); - - if (position < 0) { - position = 0; - } - } - - //calculate initial pad - topPad = Math.min(Math.max(Math.floor(self.vDomWindowBuffer / self.vDomRowHeight), self.vDomWindowMinMarginRows), position); - position -= topPad; - } - - if (self.displayRowsCount && Tabulator.prototype.helpers.elVisible(self.element)) { - - self.vDomTop = position; - - self.vDomBottom = position - 1; - - while ((rowsHeight <= self.height + self.vDomWindowBuffer || i < self.vDomWindowMinTotalRows) && self.vDomBottom < self.displayRowsCount - 1) { - var index = self.vDomBottom + 1, - row = rows[index], - rowHeight = 0; - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - if (!row.initialized) { - row.initialize(true); - } else { - if (!row.heightInitialized) { - row.normalizeHeight(true); - } - } - - rowHeight = row.getHeight(); - - if (i < topPad) { - topPadHeight += rowHeight; - } else { - rowsHeight += rowHeight; - } - - if (rowHeight > this.vDomWindowBuffer) { - this.vDomWindowBuffer = rowHeight * 2; - } - - if (row.type !== "group") { - onlyGroupHeaders = false; - } - - self.vDomBottom++; - i++; - } - - if (!position) { - this.vDomTopPad = 0; - //adjust rowheight to match average of rendered elements - self.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i); - self.vDomBottomPad = self.vDomRowHeight * (self.displayRowsCount - self.vDomBottom - 1); - - self.vDomScrollHeight = topPadHeight + rowsHeight + self.vDomBottomPad - self.height; - } else { - self.vDomTopPad = !forceMove ? self.scrollTop - topPadHeight : self.vDomRowHeight * this.vDomTop + offset; - self.vDomBottomPad = self.vDomBottom == self.displayRowsCount - 1 ? 0 : Math.max(self.vDomScrollHeight - self.vDomTopPad - rowsHeight - topPadHeight, 0); - } - - element.style.paddingTop = self.vDomTopPad + "px"; - element.style.paddingBottom = self.vDomBottomPad + "px"; - - if (forceMove) { - this.scrollTop = self.vDomTopPad + topPadHeight + offset - (this.element.scrollWidth > this.element.clientWidth ? this.element.offsetHeight - this.element.clientHeight : 0); - } - - this.scrollTop = Math.min(this.scrollTop, this.element.scrollHeight - this.height); - - //adjust for horizontal scrollbar if present (and not at top of table) - if (this.element.scrollWidth > this.element.offsetWidth && forceMove) { - this.scrollTop += this.element.offsetHeight - this.element.clientHeight; - } - - this.vDomScrollPosTop = this.scrollTop; - this.vDomScrollPosBottom = this.scrollTop; - - holder.scrollTop = this.scrollTop; - - element.style.minWidth = onlyGroupHeaders ? self.table.columnManager.getWidth() + "px" : ""; - - if (self.table.options.groupBy) { - if (self.table.modules.layout.getMode() != "fitDataFill" && self.displayRowsCount == self.table.modules.groupRows.countGroups()) { - self.tableElement.style.minWidth = self.table.columnManager.getWidth(); - } - } - } else { - this.renderEmptyScroll(); - } - - if (!this.fixedHeight) { - this.adjustTableSize(); - } -}; - -//handle vertical scrolling -RowManager.prototype.scrollVertical = function (dir) { - var topDiff = this.scrollTop - this.vDomScrollPosTop; - var bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - var margin = this.vDomWindowBuffer * 2; - - if (-topDiff > margin || bottomDiff > margin) { - //if big scroll redraw table; - var left = this.scrollLeft; - this._virtualRenderFill(Math.floor(this.element.scrollTop / this.element.scrollHeight * this.displayRowsCount)); - this.scrollHorizontal(left); - } else { - - if (dir) { - //scrolling up - if (topDiff < 0) { - - this._addTopRow(-topDiff); - } - - if (bottomDiff < 0) { - - //hide bottom row if needed - if (this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer) { - this._removeBottomRow(-bottomDiff); - } else { - this.vDomScrollPosBottom = this.scrollTop; - } - } - } else { - //scrolling down - if (topDiff >= 0) { - - //hide top row if needed - if (this.scrollTop > this.vDomWindowBuffer) { - - this._removeTopRow(topDiff); - } else { - this.vDomScrollPosTop = this.scrollTop; - } - } - - if (bottomDiff >= 0) { - - this._addBottomRow(bottomDiff); - } - } - } -}; - -RowManager.prototype._addTopRow = function (topDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomTop) { - var index = this.vDomTop - 1, - topRow = rows[index], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - //hide top row if needed - if (topDiff >= topRowHeight) { - this.styleRow(topRow, index); - table.insertBefore(topRow.getElement(), table.firstChild); - if (!topRow.initialized || !topRow.heightInitialized) { - this.vDomTopNewRows.push(topRow); - - if (!topRow.heightInitialized) { - topRow.clearCellHeight(); - } - } - topRow.initialize(); - - this.vDomTopPad -= topRowHeight; - - if (this.vDomTopPad < 0) { - this.vDomTopPad = index * this.vDomRowHeight; - } - - if (!index) { - this.vDomTopPad = 0; - } - - table.style.paddingTop = this.vDomTopPad + "px"; - this.vDomScrollPosTop -= topRowHeight; - this.vDomTop--; - } - - topDiff = -(this.scrollTop - this.vDomScrollPosTop); - - if (topRow.getHeight() > this.vDomWindowBuffer) { - this.vDomWindowBuffer = topRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomTop && topDiff >= (rows[this.vDomTop - 1].getHeight() || this.vDomRowHeight)) { - this._addTopRow(topDiff, i + 1); - } else { - this._quickNormalizeRowHeight(this.vDomTopNewRows); - } - } -}; - -RowManager.prototype._removeTopRow = function (topDiff) { - var table = this.tableElement, - topRow = this.getDisplayRows()[this.vDomTop], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - if (topDiff >= topRowHeight) { - - var rowEl = topRow.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.vDomTopPad += topRowHeight; - table.style.paddingTop = this.vDomTopPad + "px"; - this.vDomScrollPosTop += this.vDomTop ? topRowHeight : topRowHeight + this.vDomWindowBuffer; - this.vDomTop++; - - topDiff = this.scrollTop - this.vDomScrollPosTop; - - this._removeTopRow(topDiff); - } -}; - -RowManager.prototype._addBottomRow = function (bottomDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomBottom < this.displayRowsCount - 1) { - var index = this.vDomBottom + 1, - bottomRow = rows[index], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - //hide bottom row if needed - if (bottomDiff >= bottomRowHeight) { - this.styleRow(bottomRow, index); - table.appendChild(bottomRow.getElement()); - - if (!bottomRow.initialized || !bottomRow.heightInitialized) { - this.vDomBottomNewRows.push(bottomRow); - - if (!bottomRow.heightInitialized) { - bottomRow.clearCellHeight(); - } - } - - bottomRow.initialize(); - - this.vDomBottomPad -= bottomRowHeight; - - if (this.vDomBottomPad < 0 || index == this.displayRowsCount - 1) { - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - this.vDomScrollPosBottom += bottomRowHeight; - this.vDomBottom++; - } - - bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - if (bottomRow.getHeight() > this.vDomWindowBuffer) { - this.vDomWindowBuffer = bottomRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomBottom < this.displayRowsCount - 1 && bottomDiff >= (rows[this.vDomBottom + 1].getHeight() || this.vDomRowHeight)) { - this._addBottomRow(bottomDiff, i + 1); - } else { - this._quickNormalizeRowHeight(this.vDomBottomNewRows); - } - } -}; - -RowManager.prototype._removeBottomRow = function (bottomDiff) { - var table = this.tableElement, - bottomRow = this.getDisplayRows()[this.vDomBottom], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - if (bottomDiff >= bottomRowHeight) { - - var rowEl = bottomRow.getElement(); - - if (rowEl.parentNode) { - rowEl.parentNode.removeChild(rowEl); - } - - this.vDomBottomPad += bottomRowHeight; - - if (this.vDomBottomPad < 0) { - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - this.vDomScrollPosBottom -= bottomRowHeight; - this.vDomBottom--; - - bottomDiff = -(this.scrollTop - this.vDomScrollPosBottom); - - this._removeBottomRow(bottomDiff); - } -}; - -RowManager.prototype._quickNormalizeRowHeight = function (rows) { - rows.forEach(function (row) { - row.calcHeight(); - }); - - rows.forEach(function (row) { - row.setCellHeight(); - }); - - rows.length = 0; -}; - -//normalize height of active rows -RowManager.prototype.normalizeHeight = function () { - this.activeRows.forEach(function (row) { - row.normalizeHeight(); - }); -}; - -//adjust the height of the table holder to fit in the Tabulator element -RowManager.prototype.adjustTableSize = function () { - var initialHeight = this.element.clientHeight, - modExists; - - if (this.renderMode === "virtual") { - var otherHeight = this.columnManager.getElement().offsetHeight + (this.table.footerManager && !this.table.footerManager.external ? this.table.footerManager.getElement().offsetHeight : 0); - - if (this.fixedHeight) { - this.element.style.minHeight = "calc(100% - " + otherHeight + "px)"; - this.element.style.height = "calc(100% - " + otherHeight + "px)"; - this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)"; - } else { - this.element.style.height = ""; - this.element.style.height = this.table.element.clientHeight - otherHeight + "px"; - this.element.scrollTop = this.scrollTop; - } - - this.height = this.element.clientHeight; - this.vDomWindowBuffer = this.table.options.virtualDomBuffer || this.height; - - //check if the table has changed size when dealing with variable height tables - if (!this.fixedHeight && initialHeight != this.element.clientHeight) { - modExists = this.table.modExists("resizeTable"); - - if (modExists && !this.table.modules.resizeTable.autoResize || !modExists) { - this.redraw(); - } - } - } -}; - -//renitialize all rows -RowManager.prototype.reinitialize = function () { - this.rows.forEach(function (row) { - row.reinitialize(); - }); -}; - -//prevent table from being redrawn -RowManager.prototype.blockRedraw = function () { - this.redrawBlock = true; - this.redrawBlockRestoreConfig = false; -}; - -//restore table redrawing -RowManager.prototype.restoreRedraw = function () { - this.redrawBlock = false; - - if (this.redrawBlockRestoreConfig) { - this.refreshActiveData(this.redrawBlockRestoreConfig.stage, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition); - - this.redrawBlockRestoreConfig = false; - } else { - if (this.redrawBlockRederInPosition) { - this.reRenderInPosition(); - } - } - - this.redrawBlockRederInPosition = false; -}; - -//redraw table -RowManager.prototype.redraw = function (force) { - var pos = 0, - left = this.scrollLeft; - - this.adjustTableSize(); - - this.table.tableWidth = this.table.element.clientWidth; - - if (!force) { - if (this.renderMode == "classic") { - - if (this.table.options.groupBy) { - this.refreshActiveData("group", false, false); - } else { - this._simpleRender(); - } - } else { - this.reRenderInPosition(); - this.scrollHorizontal(left); - } - - if (!this.displayRowsCount) { - if (this.table.options.placeholder) { - this.getElement().appendChild(this.table.options.placeholder); - } - } - } else { - this.renderTable(); - } -}; - -RowManager.prototype.resetScroll = function () { - this.element.scrollLeft = 0; - this.element.scrollTop = 0; - - if (this.table.browser === "ie") { - var event = document.createEvent("Event"); - event.initEvent("scroll", false, true); - this.element.dispatchEvent(event); - } else { - this.element.dispatchEvent(new Event('scroll')); - } -}; - -//public row object -var RowComponent = function RowComponent(row) { - this._row = row; -}; - -RowComponent.prototype.getData = function (transform) { - return this._row.getData(transform); -}; - -RowComponent.prototype.getElement = function () { - return this._row.getElement(); -}; - -RowComponent.prototype.getCells = function () { - var cells = []; - - this._row.getCells().forEach(function (cell) { - cells.push(cell.getComponent()); - }); - - return cells; -}; - -RowComponent.prototype.getCell = function (column) { - var cell = this._row.getCell(column); - return cell ? cell.getComponent() : false; -}; - -RowComponent.prototype.getIndex = function () { - return this._row.getData("data")[this._row.table.options.index]; -}; - -RowComponent.prototype.getPosition = function (active) { - return this._row.table.rowManager.getRowPosition(this._row, active); -}; - -RowComponent.prototype.delete = function () { - return this._row.delete(); -}; - -RowComponent.prototype.scrollTo = function () { - return this._row.table.rowManager.scrollToRow(this._row); -}; - -RowComponent.prototype.pageTo = function () { - if (this._row.table.modExists("page", true)) { - return this._row.table.modules.page.setPageToRow(this._row); - } -}; - -RowComponent.prototype.move = function (to, after) { - this._row.moveToRow(to, after); -}; - -RowComponent.prototype.update = function (data) { - return this._row.updateData(data); -}; - -RowComponent.prototype.normalizeHeight = function () { - this._row.normalizeHeight(true); -}; - -RowComponent.prototype.select = function () { - this._row.table.modules.selectRow.selectRows(this._row); -}; - -RowComponent.prototype.deselect = function () { - this._row.table.modules.selectRow.deselectRows(this._row); -}; - -RowComponent.prototype.toggleSelect = function () { - this._row.table.modules.selectRow.toggleRow(this._row); -}; - -RowComponent.prototype.isSelected = function () { - return this._row.table.modules.selectRow.isRowSelected(this._row); -}; - -RowComponent.prototype._getSelf = function () { - return this._row; -}; - -RowComponent.prototype.freeze = function () { - if (this._row.table.modExists("frozenRows", true)) { - this._row.table.modules.frozenRows.freezeRow(this._row); - } -}; - -RowComponent.prototype.unfreeze = function () { - if (this._row.table.modExists("frozenRows", true)) { - this._row.table.modules.frozenRows.unfreezeRow(this._row); - } -}; - -RowComponent.prototype.treeCollapse = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.collapseRow(this._row); - } -}; - -RowComponent.prototype.treeExpand = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.expandRow(this._row); - } -}; - -RowComponent.prototype.treeToggle = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.toggleRow(this._row); - } -}; - -RowComponent.prototype.getTreeParent = function () { - if (this._row.table.modExists("dataTree", true)) { - return this._row.table.modules.dataTree.getTreeParent(this._row); - } - - return false; -}; - -RowComponent.prototype.getTreeChildren = function () { - if (this._row.table.modExists("dataTree", true)) { - return this._row.table.modules.dataTree.getTreeChildren(this._row); - } - - return false; -}; - -RowComponent.prototype.reformat = function () { - return this._row.reinitialize(); -}; - -RowComponent.prototype.getGroup = function () { - return this._row.getGroup().getComponent(); -}; - -RowComponent.prototype.getTable = function () { - return this._row.table; -}; - -RowComponent.prototype.getNextRow = function () { - var row = this._row.nextRow(); - return row ? row.getComponent() : row; -}; - -RowComponent.prototype.getPrevRow = function () { - var row = this._row.prevRow(); - return row ? row.getComponent() : row; -}; - -var Row = function Row(data, parent) { - var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "row"; - - this.table = parent.table; - this.parent = parent; - this.data = {}; - this.type = type; //type of element - this.element = this.createElement(); - this.modules = {}; //hold module variables; - this.cells = []; - this.height = 0; //hold element height - this.heightStyled = ""; //hold element height prestyled to improve render efficiency - this.manualHeight = false; //user has manually set row height - this.outerHeight = 0; //holde lements outer height - this.initialized = false; //element has been rendered - this.heightInitialized = false; //element has resized cells to fit - - this.setData(data); - this.generateElement(); -}; - -Row.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - el.setAttribute("role", "row"); - - return el; -}; - -Row.prototype.getElement = function () { - return this.element; -}; - -Row.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -Row.prototype.generateElement = function () { - var self = this, - dblTap, - tapHold, - tap; - - //set row selection characteristics - if (self.table.options.selectable !== false && self.table.modExists("selectRow")) { - self.table.modules.selectRow.initializeRow(this); - } - - //setup movable rows - if (self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - self.table.modules.moveRow.initializeRow(this); - } - - //setup data tree - if (self.table.options.dataTree !== false && self.table.modExists("dataTree")) { - self.table.modules.dataTree.initializeRow(this); - } - - //setup column colapse container - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - self.table.modules.responsiveLayout.initializeRow(this); - } - - //set column menu - if (self.table.options.rowContextMenu && this.table.modExists("menu")) { - self.table.modules.menu.initializeRow(this); - } - - //handle row click events - if (self.table.options.rowClick) { - self.element.addEventListener("click", function (e) { - self.table.options.rowClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.table.options.rowDblClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowContext) { - self.element.addEventListener("contextmenu", function (e) { - self.table.options.rowContext(e, self.getComponent()); - }); - } - - //handle mouse events - if (self.table.options.rowMouseEnter) { - self.element.addEventListener("mouseenter", function (e) { - self.table.options.rowMouseEnter(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseLeave) { - self.element.addEventListener("mouseleave", function (e) { - self.table.options.rowMouseLeave(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOver) { - self.element.addEventListener("mouseover", function (e) { - self.table.options.rowMouseOver(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOut) { - self.element.addEventListener("mouseout", function (e) { - self.table.options.rowMouseOut(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseMove) { - self.element.addEventListener("mousemove", function (e) { - self.table.options.rowMouseMove(e, self.getComponent()); - }); - } - - if (self.table.options.rowTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.table.options.rowTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.table.options.rowDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.table.options.rowDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.table.options.rowTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.table.options.rowTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } -}; - -Row.prototype.generateCells = function () { - this.cells = this.table.columnManager.generateCells(this); -}; - -//functions to setup on first render -Row.prototype.initialize = function (force) { - var self = this; - - if (!self.initialized || force) { - - self.deleteCells(); - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - } //handle frozen cells - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layoutRow(this); - } - - this.generateCells(); - - self.cells.forEach(function (cell) { - self.element.appendChild(cell.getElement()); - cell.cellRendered(); - }); - - if (force) { - self.normalizeHeight(); - } - - //setup movable rows - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.layoutRow(this); - } - - //setup column colapse container - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - self.table.modules.responsiveLayout.layoutRow(this); - } - - if (self.table.options.rowFormatter) { - self.table.options.rowFormatter(self.getComponent()); - } - - //set resizable handles - if (self.table.options.resizableRows && self.table.modExists("resizeRows")) { - self.table.modules.resizeRows.initializeRow(self); - } - - self.initialized = true; - } -}; - -Row.prototype.reinitializeHeight = function () { - this.heightInitialized = false; - - if (this.element.offsetParent !== null) { - this.normalizeHeight(true); - } -}; - -Row.prototype.reinitialize = function () { - this.initialized = false; - this.heightInitialized = false; - - if (!this.manualHeight) { - this.height = 0; - this.heightStyled = ""; - } - - if (this.element.offsetParent !== null) { - this.initialize(true); - } -}; - -//get heights when doing bulk row style calcs in virtual DOM -Row.prototype.calcHeight = function (force) { - - var maxHeight = 0, - minHeight = this.table.options.resizableRows ? this.element.clientHeight : 0; - - this.cells.forEach(function (cell) { - var height = cell.getHeight(); - if (height > maxHeight) { - maxHeight = height; - } - }); - - if (force) { - this.height = Math.max(maxHeight, minHeight); - } else { - this.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight); - } - - this.heightStyled = this.height ? this.height + "px" : ""; - this.outerHeight = this.element.offsetHeight; -}; - -//set of cells -Row.prototype.setCellHeight = function () { - this.cells.forEach(function (cell) { - cell.setHeight(); - }); - - this.heightInitialized = true; -}; - -Row.prototype.clearCellHeight = function () { - this.cells.forEach(function (cell) { - cell.clearHeight(); - }); -}; - -//normalize the height of elements in the row -Row.prototype.normalizeHeight = function (force) { - - if (force) { - this.clearCellHeight(); - } - - this.calcHeight(force); - - this.setCellHeight(); -}; - -// Row.prototype.setHeight = function(height){ -// this.height = height; - -// this.setCellHeight(); -// }; - -//set height of rows -Row.prototype.setHeight = function (height, force) { - if (this.height != height || force) { - - this.manualHeight = true; - - this.height = height; - this.heightStyled = height ? height + "px" : ""; - - this.setCellHeight(); - - // this.outerHeight = this.element.outerHeight(); - this.outerHeight = this.element.offsetHeight; - } -}; - -//return rows outer height -Row.prototype.getHeight = function () { - return this.outerHeight; -}; - -//return rows outer Width -Row.prototype.getWidth = function () { - return this.element.offsetWidth; -}; - -//////////////// Cell Management ///////////////// - -Row.prototype.deleteCell = function (cell) { - var index = this.cells.indexOf(cell); - - if (index > -1) { - this.cells.splice(index, 1); - } -}; - -//////////////// Data Management ///////////////// - -Row.prototype.setData = function (data) { - if (this.table.modExists("mutator")) { - data = this.table.modules.mutator.transformRow(data, "data"); - } - - this.data = data; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - this.table.modules.reactiveData.watchRow(this); - } -}; - -//update the rows data -Row.prototype.updateData = function (updatedData) { - var _this15 = this; - - var visible = Tabulator.prototype.helpers.elVisible(this.element), - tempData = {}, - newRowData; - - return new Promise(function (resolve, reject) { - - if (typeof updatedData === "string") { - updatedData = JSON.parse(updatedData); - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - _this15.table.modules.reactiveData.block(); - } - - //mutate incomming data if needed - if (_this15.table.modExists("mutator")) { - - tempData = Object.assign(tempData, _this15.data); - tempData = Object.assign(tempData, updatedData); - - newRowData = _this15.table.modules.mutator.transformRow(tempData, "data", updatedData); - } else { - newRowData = updatedData; - } - - //set data - for (var attrname in newRowData) { - _this15.data[attrname] = newRowData[attrname]; - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - _this15.table.modules.reactiveData.unblock(); - } - - //update affected cells only - for (var attrname in updatedData) { - - var columns = _this15.table.columnManager.getColumnsByFieldRoot(attrname); - - columns.forEach(function (column) { - var cell = _this15.getCell(column.getField()); - - if (cell) { - var value = column.getFieldValue(newRowData); - if (cell.getValue() != value) { - cell.setValueProcessData(value); - - if (visible) { - cell.cellRendered(); - } - } - } - }); - } - - //Partial reinitialization if visible - if (visible) { - _this15.normalizeHeight(true); - - if (_this15.table.options.rowFormatter) { - _this15.table.options.rowFormatter(_this15.getComponent()); - } - } else { - _this15.initialized = false; - _this15.height = 0; - _this15.heightStyled = ""; - } - - if (_this15.table.options.dataTree !== false && _this15.table.modExists("dataTree") && _this15.table.modules.dataTree.redrawNeeded(updatedData)) { - _this15.table.modules.dataTree.initializeRow(_this15); - _this15.table.modules.dataTree.layoutRow(_this15); - _this15.table.rowManager.refreshActiveData("tree", false, true); - } - - //this.reinitialize(); - - _this15.table.options.rowUpdated.call(_this15.table, _this15.getComponent()); - - resolve(); - }); -}; - -Row.prototype.getData = function (transform) { - var self = this; - - if (transform) { - if (self.table.modExists("accessor")) { - return self.table.modules.accessor.transformRow(self.data, transform); - } - } else { - return this.data; - } -}; - -Row.prototype.getCell = function (column) { - var match = false; - - column = this.table.columnManager.findColumn(column); - - match = this.cells.find(function (cell) { - return cell.column === column; - }); - - return match; -}; - -Row.prototype.getCellIndex = function (findCell) { - return this.cells.findIndex(function (cell) { - return cell === findCell; - }); -}; - -Row.prototype.findNextEditableCell = function (index) { - var nextCell = false; - - if (index < this.cells.length - 1) { - for (var i = index + 1; i < this.cells.length; i++) { - var cell = this.cells[i]; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - var allowEdit = true; - - if (typeof cell.column.modules.edit.check == "function") { - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - nextCell = cell; - break; - } - } - } - } - - return nextCell; -}; - -Row.prototype.findPrevEditableCell = function (index) { - var prevCell = false; - - if (index > 0) { - for (var i = index - 1; i >= 0; i--) { - var cell = this.cells[i], - allowEdit = true; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - if (typeof cell.column.modules.edit.check == "function") { - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - prevCell = cell; - break; - } - } - } - } - - return prevCell; -}; - -Row.prototype.getCells = function () { - return this.cells; -}; - -Row.prototype.nextRow = function () { - var row = this.table.rowManager.nextDisplayRow(this, true); - return row || false; -}; - -Row.prototype.prevRow = function () { - var row = this.table.rowManager.prevDisplayRow(this, true); - return row || false; -}; - -Row.prototype.moveToRow = function (to, before) { - var toRow = this.table.rowManager.findRow(to); - - if (toRow) { - this.table.rowManager.moveRowActual(this, toRow, !before); - this.table.rowManager.refreshActiveData("display", false, true); - } else { - console.warn("Move Error - No matching row found:", to); - } -}; - -///////////////////// Actions ///////////////////// - -Row.prototype.delete = function () { - var _this16 = this; - - return new Promise(function (resolve, reject) { - var index, rows; - - if (_this16.table.options.history && _this16.table.modExists("history")) { - - if (_this16.table.options.groupBy && _this16.table.modExists("groupRows")) { - rows = _this16.getGroup().rows; - index = rows.indexOf(_this16); - - if (index) { - index = rows[index - 1]; - } - } else { - index = _this16.table.rowManager.getRowIndex(_this16); - - if (index) { - index = _this16.table.rowManager.rows[index - 1]; - } - } - - _this16.table.modules.history.action("rowDelete", _this16, { data: _this16.getData(), pos: !index, index: index }); - } - - _this16.deleteActual(); - - resolve(); - }); -}; - -Row.prototype.deleteActual = function (blockRedraw) { - var index = this.table.rowManager.getRowIndex(this); - - //deselect row if it is selected - if (this.table.modExists("selectRow")) { - this.table.modules.selectRow._deselectRow(this, true); - } - - //cancel edit if row is currently being edited - if (this.table.modExists("edit")) { - if (this.table.modules.edit.currentCell.row === this) { - this.table.modules.edit.cancelEdit(); - } - } - - // if(this.table.options.dataTree && this.table.modExists("dataTree")){ - // this.table.modules.dataTree.collapseRow(this, true); - // } - - //remove any reactive data watchers from row object - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) {} - // this.table.modules.reactiveData.unwatchRow(this); - - - //remove from group - if (this.modules.group) { - this.modules.group.removeRow(this); - } - - this.table.rowManager.deleteRow(this, blockRedraw); - - this.deleteCells(); - - this.initialized = false; - this.heightInitialized = false; - - //recalc column calculations if present - if (this.table.modExists("columnCalcs")) { - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.columnCalcs.recalcRowGroup(this); - } else { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } -}; - -Row.prototype.deleteCells = function () { - var cellCount = this.cells.length; - - for (var i = 0; i < cellCount; i++) { - this.cells[0].delete(); - } -}; - -Row.prototype.wipe = function () { - this.deleteCells(); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element = false; - this.modules = {}; - - if (this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -Row.prototype.getGroup = function () { - return this.modules.group || false; -}; - -//////////////// Object Generation ///////////////// -Row.prototype.getComponent = function () { - return new RowComponent(this); -}; - -//public row object -var CellComponent = function CellComponent(cell) { - this._cell = cell; -}; - -CellComponent.prototype.getValue = function () { - return this._cell.getValue(); -}; - -CellComponent.prototype.getOldValue = function () { - return this._cell.getOldValue(); -}; - -CellComponent.prototype.getElement = function () { - return this._cell.getElement(); -}; - -CellComponent.prototype.getRow = function () { - return this._cell.row.getComponent(); -}; - -CellComponent.prototype.getData = function () { - return this._cell.row.getData(); -}; - -CellComponent.prototype.getField = function () { - return this._cell.column.getField(); -}; - -CellComponent.prototype.getColumn = function () { - return this._cell.column.getComponent(); -}; - -CellComponent.prototype.setValue = function (value, mutate) { - if (typeof mutate == "undefined") { - mutate = true; - } - - this._cell.setValue(value, mutate); -}; - -CellComponent.prototype.restoreOldValue = function () { - this._cell.setValueActual(this._cell.getOldValue()); -}; - -CellComponent.prototype.edit = function (force) { - return this._cell.edit(force); -}; - -CellComponent.prototype.cancelEdit = function () { - this._cell.cancelEdit(); -}; - -CellComponent.prototype.nav = function () { - return this._cell.nav(); -}; - -CellComponent.prototype.checkHeight = function () { - this._cell.checkHeight(); -}; - -CellComponent.prototype.getTable = function () { - return this._cell.table; -}; - -CellComponent.prototype._getSelf = function () { - return this._cell; -}; - -var Cell = function Cell(column, row) { - - this.table = column.table; - this.column = column; - this.row = row; - this.element = null; - this.value = null; - this.oldValue = null; - this.modules = {}; - - this.height = null; - this.width = null; - this.minWidth = null; - - this.build(); -}; - -//////////////// Setup Functions ///////////////// - -//generate element -Cell.prototype.build = function () { - this.generateElement(); - - this.setWidth(); - - this._configureCell(); - - this.setValueActual(this.column.getFieldValue(this.row.data)); -}; - -Cell.prototype.generateElement = function () { - this.element = document.createElement('div'); - this.element.className = "tabulator-cell"; - this.element.setAttribute("role", "gridcell"); - this.element = this.element; -}; - -Cell.prototype._configureCell = function () { - var self = this, - cellEvents = self.column.cellEvents, - element = self.element, - field = this.column.getField(), - vertAligns = { - top: "flex-start", - bottom: "flex-end", - middle: "center" - }, - hozAligns = { - left: "flex-start", - right: "flex-end", - center: "center" - }; - - //set text alignment - element.style.textAlign = self.column.hozAlign; - - if (self.column.vertAlign) { - element.style.display = "inline-flex"; - - element.style.alignItems = vertAligns[self.column.vertAlign] || ""; - - if (self.column.hozAlign) { - element.style.justifyContent = hozAligns[self.column.hozAlign] || ""; - } - } - - if (field) { - element.setAttribute("tabulator-field", field); - } - - //add class to cell if needed - if (self.column.definition.cssClass) { - var classNames = self.column.definition.cssClass.split(" "); - classNames.forEach(function (className) { - element.classList.add(className); - }); - } - - //update tooltip on mouse enter - if (this.table.options.tooltipGenerationMode === "hover") { - element.addEventListener("mouseenter", function (e) { - self._generateTooltip(); - }); - } - - self._bindClickEvents(cellEvents); - - self._bindTouchEvents(cellEvents); - - self._bindMouseEvents(cellEvents); - - if (self.column.modules.edit) { - self.table.modules.edit.bindEditor(self); - } - - if (self.column.definition.rowHandle && self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - self.table.modules.moveRow.initializeCell(self); - } - - //hide cell if not visible - if (!self.column.visible) { - self.hide(); - } -}; - -Cell.prototype._bindClickEvents = function (cellEvents) { - var self = this, - element = self.element; - - //set event bindings - if (cellEvents.cellClick || self.table.options.cellClick) { - element.addEventListener("click", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellClick) { - cellEvents.cellClick.call(self.table, e, component); - } - - if (self.table.options.cellClick) { - self.table.options.cellClick.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellDblClick || this.table.options.cellDblClick) { - element.addEventListener("dblclick", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellDblClick) { - cellEvents.cellDblClick.call(self.table, e, component); - } - - if (self.table.options.cellDblClick) { - self.table.options.cellDblClick.call(self.table, e, component); - } - }); - } else { - element.addEventListener("dblclick", function (e) { - - if (self.table.modExists("edit")) { - if (self.table.modules.edit.currentCell === self) { - return; //prevent instant selection of editor content - } - } - - e.preventDefault(); - - try { - if (document.selection) { - // IE - var range = document.body.createTextRange(); - range.moveToElementText(self.element); - range.select(); - } else if (window.getSelection) { - var range = document.createRange(); - range.selectNode(self.element); - window.getSelection().removeAllRanges(); - window.getSelection().addRange(range); - } - } catch (e) {} - }); - } - - if (cellEvents.cellContext || this.table.options.cellContext) { - element.addEventListener("contextmenu", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellContext) { - cellEvents.cellContext.call(self.table, e, component); - } - - if (self.table.options.cellContext) { - self.table.options.cellContext.call(self.table, e, component); - } - }); - } -}; - -Cell.prototype._bindMouseEvents = function (cellEvents) { - var self = this, - element = self.element; - - if (cellEvents.cellMouseEnter || self.table.options.cellMouseEnter) { - element.addEventListener("mouseenter", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseEnter) { - cellEvents.cellMouseEnter.call(self.table, e, component); - } - - if (self.table.options.cellMouseEnter) { - self.table.options.cellMouseEnter.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseLeave || self.table.options.cellMouseLeave) { - element.addEventListener("mouseleave", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseLeave) { - cellEvents.cellMouseLeave.call(self.table, e, component); - } - - if (self.table.options.cellMouseLeave) { - self.table.options.cellMouseLeave.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOver || self.table.options.cellMouseOver) { - element.addEventListener("mouseover", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseOver) { - cellEvents.cellMouseOver.call(self.table, e, component); - } - - if (self.table.options.cellMouseOver) { - self.table.options.cellMouseOver.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOut || self.table.options.cellMouseOut) { - element.addEventListener("mouseout", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseOut) { - cellEvents.cellMouseOut.call(self.table, e, component); - } - - if (self.table.options.cellMouseOut) { - self.table.options.cellMouseOut.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseMove || self.table.options.cellMouseMove) { - element.addEventListener("mousemove", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseMove) { - cellEvents.cellMouseMove.call(self.table, e, component); - } - - if (self.table.options.cellMouseMove) { - self.table.options.cellMouseMove.call(self.table, e, component); - } - }); - } -}; - -Cell.prototype._bindTouchEvents = function (cellEvents) { - var self = this, - element = self.element, - dblTap, - tapHold, - tap; - - if (cellEvents.cellTap || this.table.options.cellTap) { - tap = false; - - element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - if (tap) { - var component = self.getComponent(); - - if (cellEvents.cellTap) { - cellEvents.cellTap.call(self.table, e, component); - } - - if (self.table.options.cellTap) { - self.table.options.cellTap.call(self.table, e, component); - } - } - - tap = false; - }); - } - - if (cellEvents.cellDblTap || this.table.options.cellDblTap) { - dblTap = null; - - element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - var component = self.getComponent(); - - if (cellEvents.cellDblTap) { - cellEvents.cellDblTap.call(self.table, e, component); - } - - if (self.table.options.cellDblTap) { - self.table.options.cellDblTap.call(self.table, e, component); - } - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (cellEvents.cellTapHold || this.table.options.cellTapHold) { - tapHold = null; - - element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - var component = self.getComponent(); - - if (cellEvents.cellTapHold) { - cellEvents.cellTapHold.call(self.table, e, component); - } - - if (self.table.options.cellTapHold) { - self.table.options.cellTapHold.call(self.table, e, component); - } - }, 1000); - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } -}; - -//generate cell contents -Cell.prototype._generateContents = function () { - var val; - - if (this.table.modExists("format")) { - val = this.table.modules.format.formatValue(this); - } else { - val = this.element.innerHTML = this.value; - } - - switch (typeof val === 'undefined' ? 'undefined' : _typeof(val)) { - case "object": - if (val instanceof Node) { - - //clear previous cell contents - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element.appendChild(val); - } else { - this.element.innerHTML = ""; - - if (val != null) { - console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", val); - } - } - break; - case "undefined": - case "null": - this.element.innerHTML = ""; - break; - default: - this.element.innerHTML = val; - } -}; - -Cell.prototype.cellRendered = function () { - if (this.table.modExists("format") && this.table.modules.format.cellRendered) { - this.table.modules.format.cellRendered(this); - } -}; - -//generate tooltip text -Cell.prototype._generateTooltip = function () { - var tooltip = this.column.tooltip; - - if (tooltip) { - if (tooltip === true) { - tooltip = this.value; - } else if (typeof tooltip == "function") { - tooltip = tooltip(this.getComponent()); - - if (tooltip === false) { - tooltip = ""; - } - } - - if (typeof tooltip === "undefined") { - tooltip = ""; - } - - this.element.setAttribute("title", tooltip); - } else { - this.element.setAttribute("title", ""); - } -}; - -//////////////////// Getters //////////////////// -Cell.prototype.getElement = function () { - return this.element; -}; - -Cell.prototype.getValue = function () { - return this.value; -}; - -Cell.prototype.getOldValue = function () { - return this.oldValue; -}; - -//////////////////// Actions //////////////////// - -Cell.prototype.setValue = function (value, mutate) { - - var changed = this.setValueProcessData(value, mutate), - component; - - if (changed) { - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("cellEdit", this, { oldValue: this.oldValue, newValue: this.value }); - } - - component = this.getComponent(); - - if (this.column.cellEvents.cellEdited) { - this.column.cellEvents.cellEdited.call(this.table, component); - } - - this.cellRendered(); - - this.table.options.cellEdited.call(this.table, component); - - this.table.options.dataEdited.call(this.table, this.table.rowManager.getData()); - } -}; - -Cell.prototype.setValueProcessData = function (value, mutate) { - var changed = false; - - if (this.value != value) { - - changed = true; - - if (mutate) { - if (this.column.modules.mutate) { - value = this.table.modules.mutator.transformCell(this, value); - } - } - } - - this.setValueActual(value); - - if (changed && this.table.modExists("columnCalcs")) { - if (this.column.definition.topCalc || this.column.definition.bottomCalc) { - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (this.table.options.columnCalcs == "table" || this.table.options.columnCalcs == "both") { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.columnCalcs != "table") { - this.table.modules.columnCalcs.recalcRowGroup(this.row); - } - } else { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - } - - return changed; -}; - -Cell.prototype.setValueActual = function (value) { - this.oldValue = this.value; - - this.value = value; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - this.table.modules.reactiveData.block(); - } - - this.column.setFieldValue(this.row.data, value); - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - this.table.modules.reactiveData.unblock(); - } - - this._generateContents(); - this._generateTooltip(); - - //set resizable handles - if (this.table.options.resizableColumns && this.table.modExists("resizeColumns")) { - this.table.modules.resizeColumns.initializeColumn("cell", this.column, this.element); - } - - //set column menu - if (this.column.definition.contextMenu && this.table.modExists("menu")) { - this.table.modules.menu.initializeCell(this); - } - - //handle frozen cells - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layoutElement(this.element, this.column); - } -}; - -Cell.prototype.setWidth = function () { - this.width = this.column.width; - this.element.style.width = this.column.widthStyled; -}; - -Cell.prototype.clearWidth = function () { - this.width = ""; - this.element.style.width = ""; -}; - -Cell.prototype.getWidth = function () { - return this.width || this.element.offsetWidth; -}; - -Cell.prototype.setMinWidth = function () { - this.minWidth = this.column.minWidth; - this.element.style.minWidth = this.column.minWidthStyled; -}; - -Cell.prototype.checkHeight = function () { - // var height = this.element.css("height"); - this.row.reinitializeHeight(); -}; - -Cell.prototype.clearHeight = function () { - this.element.style.height = ""; - this.height = null; -}; - -Cell.prototype.setHeight = function () { - this.height = this.row.height; - this.element.style.height = this.row.heightStyled; -}; - -Cell.prototype.getHeight = function () { - return this.height || this.element.offsetHeight; -}; - -Cell.prototype.show = function () { - this.element.style.display = ""; -}; - -Cell.prototype.hide = function () { - this.element.style.display = "none"; -}; - -Cell.prototype.edit = function (force) { - if (this.table.modExists("edit", true)) { - return this.table.modules.edit.editCell(this, force); - } -}; - -Cell.prototype.cancelEdit = function () { - if (this.table.modExists("edit", true)) { - var editing = this.table.modules.edit.getCurrentCell(); - - if (editing && editing._getSelf() === this) { - this.table.modules.edit.cancelEdit(); - } else { - console.warn("Cancel Editor Error - This cell is not currently being edited "); - } - } -}; - -Cell.prototype.delete = function () { - if (!this.table.rowManager.redrawBlock) { - this.element.parentNode.removeChild(this.element); - } - this.element = false; - this.column.deleteCell(this); - this.row.deleteCell(this); - this.calcs = {}; -}; - -//////////////// Navigation ///////////////// - -Cell.prototype.nav = function () { - - var self = this, - nextCell = false, - index = this.row.getCellIndex(this); - - return { - next: function next() { - var nextCell = this.right(), - nextRow; - - if (!nextCell) { - nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - nextCell = nextRow.findNextEditableCell(-1); - - if (nextCell) { - nextCell.edit(); - return true; - } - } - } else { - return true; - } - - return false; - }, - prev: function prev() { - var nextCell = this.left(), - prevRow; - - if (!nextCell) { - prevRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (prevRow) { - nextCell = prevRow.findPrevEditableCell(prevRow.cells.length); - - if (nextCell) { - nextCell.edit(); - return true; - } - } - } else { - return true; - } - - return false; - }, - left: function left() { - - nextCell = self.row.findPrevEditableCell(index); - - if (nextCell) { - nextCell.edit(); - return true; - } else { - return false; - } - }, - right: function right() { - nextCell = self.row.findNextEditableCell(index); - - if (nextCell) { - nextCell.edit(); - return true; - } else { - return false; - } - }, - up: function up() { - var nextRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (nextRow) { - nextRow.cells[index].edit(); - } - }, - down: function down() { - var nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - nextRow.cells[index].edit(); - } - } - - }; -}; - -Cell.prototype.getIndex = function () { - this.row.getCellIndex(this); -}; - -//////////////// Object Generation ///////////////// -Cell.prototype.getComponent = function () { - return new CellComponent(this); -}; -var FooterManager = function FooterManager(table) { - this.table = table; - this.active = false; - this.element = this.createElement(); //containing element - this.external = false; - this.links = []; - - this._initialize(); -}; - -FooterManager.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-footer"); - - return el; -}; - -FooterManager.prototype._initialize = function (element) { - if (this.table.options.footerElement) { - - switch (_typeof(this.table.options.footerElement)) { - case "string": - - if (this.table.options.footerElement[0] === "<") { - this.element.innerHTML = this.table.options.footerElement; - } else { - this.external = true; - this.element = document.querySelector(this.table.options.footerElement); - } - break; - default: - this.element = this.table.options.footerElement; - break; - } - } -}; - -FooterManager.prototype.getElement = function () { - return this.element; -}; - -FooterManager.prototype.append = function (element, parent) { - this.activate(parent); - - this.element.appendChild(element); - this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.prepend = function (element, parent) { - this.activate(parent); - - this.element.insertBefore(element, this.element.firstChild); - this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.remove = function (element) { - element.parentNode.removeChild(element); - this.deactivate(); -}; - -FooterManager.prototype.deactivate = function (force) { - if (!this.element.firstChild || force) { - if (!this.external) { - this.element.parentNode.removeChild(this.element); - } - this.active = false; - } - - // this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.activate = function (parent) { - if (!this.active) { - this.active = true; - if (!this.external) { - this.table.element.appendChild(this.getElement()); - this.table.element.style.display = ''; - } - } - - if (parent) { - this.links.push(parent); - } -}; - -FooterManager.prototype.redraw = function () { - this.links.forEach(function (link) { - link.footerRedraw(); - }); -}; - -var Tabulator = function Tabulator(element, options) { - - this.options = {}; - - this.columnManager = null; // hold Column Manager - this.rowManager = null; //hold Row Manager - this.footerManager = null; //holder Footer Manager - this.browser = ""; //hold current browser type - this.browserSlow = false; //handle reduced functionality for slower browsers - this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence - - this.modules = {}; //hold all modules bound to this table - - this.initializeElement(element); - this.initializeOptions(options || {}); - this._create(); - - Tabulator.prototype.comms.register(this); //register table for inderdevice communication -}; - -//default setup options -Tabulator.prototype.defaultOptions = { - - height: false, //height of tabulator - minHeight: false, //minimum height of tabulator - maxHeight: false, //maximum height of tabulator - - layout: "fitData", ///layout type "fitColumns" | "fitData" - layoutColumnsOnNewData: false, //update column widths on setData - - columnMinWidth: 40, //minimum global width for a column - columnHeaderVertAlign: "top", //vertical alignment of column headers - columnVertAlign: false, // DEPRECATED - Left to allow warning - - resizableColumns: true, //resizable columns - resizableRows: false, //resizable rows - autoResize: true, //auto resize table - - columns: [], //store for colum header info - - cellHozAlign: "", //horizontal align columns - cellVertAlign: "", //certical align columns - - - data: [], //default starting data - - autoColumns: false, //build columns from data row structure - - reactiveData: false, //enable data reactivity - - nestedFieldSeparator: ".", //seperatpr for nested data - - tooltips: false, //Tool tip value - tooltipsHeader: false, //Tool tip for headers - tooltipGenerationMode: "load", //when to generate tooltips - - initialSort: false, //initial sorting criteria - initialFilter: false, //initial filtering criteria - initialHeaderFilter: false, //initial header filtering criteria - - columnHeaderSortMulti: true, //multiple or single column sorting - - sortOrderReverse: false, //reverse internal sort ordering - - headerSort: true, //set default global header sort - headerSortTristate: false, //set default tristate header sorting - - footerElement: false, //hold footer element - - index: "id", //filed for row index - - keybindings: [], //array for keybindings - - tabEndNewRow: false, //create new row when tab to end of table - - invalidOptionWarnings: true, //allow toggling of invalid option warnings - - clipboard: false, //enable clipboard - clipboardCopyStyled: true, //formatted table data - clipboardCopyConfig: false, //clipboard config - clipboardCopyFormatter: false, //DEPRICATED - REMOVE in 5.0 - clipboardCopyRowRange: "active", //restrict clipboard to visible rows only - clipboardPasteParser: "table", //convert pasted clipboard data to rows - clipboardPasteAction: "insert", //how to insert pasted data into the table - - clipboardCopied: function clipboardCopied() {}, //data has been copied to the clipboard - clipboardPasted: function clipboardPasted() {}, //data has been pasted into the table - clipboardPasteError: function clipboardPasteError() {}, //data has not successfully been pasted into the table - - downloadDataFormatter: false, //function to manipulate table data before it is downloaded - downloadReady: function downloadReady(data, blob) { - return blob; - }, //function to manipulate download data - downloadComplete: false, //function to manipulate download data - downloadConfig: false, //download config - - dataTree: false, //enable data tree - dataTreeElementColumn: false, - dataTreeBranchElement: true, //show data tree branch element - dataTreeChildIndent: 9, //data tree child indent in px - dataTreeChildField: "_children", //data tre column field to look for child rows - dataTreeCollapseElement: false, //data tree row collapse element - dataTreeExpandElement: false, //data tree row expand element - dataTreeStartExpanded: false, - dataTreeRowExpanded: function dataTreeRowExpanded() {}, //row has been expanded - dataTreeRowCollapsed: function dataTreeRowCollapsed() {}, //row has been collapsed - dataTreeChildColumnCalcs: false, //include visible data tree rows in column calculations - dataTreeSelectPropagate: false, //seleccting a parent row selects its children - - printAsHtml: false, //enable print as html - printFormatter: false, //printing page formatter - printHeader: false, //page header contents - printFooter: false, //page footer contents - printCopyStyle: true, //DEPRICATED - REMOVE in 5.0 - printStyled: true, //enable print as html styling - printVisibleRows: true, //DEPRICATED - REMOVE in 5.0 - printRowRange: "visible", //restrict print to visible rows only - printConfig: {}, //print config options - - addRowPos: "bottom", //position to insert blank rows, top|bottom - - selectable: "highlight", //highlight rows on hover - selectableRangeMode: "drag", //highlight rows on hover - selectableRollingSelection: true, //roll selection once maximum number of selectable rows is reached - selectablePersistence: true, // maintain selection when table view is updated - selectableCheck: function selectableCheck(data, row) { - return true; - }, //check wheather row is selectable - - headerFilterLiveFilterDelay: 300, //delay before updating column after user types in header filter - headerFilterPlaceholder: false, //placeholder text to display in header filters - - headerVisible: true, //hide header - - history: false, //enable edit history - - locale: false, //current system language - langs: {}, - - virtualDom: true, //enable DOM virtualization - virtualDomBuffer: 0, // set virtual DOM buffer size - - persistentLayout: false, //DEPRICATED - REMOVE in 5.0 - persistentSort: false, //DEPRICATED - REMOVE in 5.0 - persistentFilter: false, //DEPRICATED - REMOVE in 5.0 - persistenceID: "", //key for persistent storage - persistenceMode: true, //mode for storing persistence information - persistenceReaderFunc: false, //function for handling persistence data reading - persistenceWriterFunc: false, //function for handling persistence data writing - - persistence: false, - - responsiveLayout: false, //responsive layout flags - responsiveLayoutCollapseStartOpen: true, //start showing collapsed data - responsiveLayoutCollapseUseFormatters: true, //responsive layout collapse formatter - responsiveLayoutCollapseFormatter: false, //responsive layout collapse formatter - - pagination: false, //set pagination type - paginationSize: false, //set number of rows to a page - paginationInitialPage: 1, //initail page to show on load - paginationButtonCount: 5, // set count of page button - paginationSizeSelector: false, //add pagination size selector element - paginationElement: false, //element to hold pagination numbers - paginationDataSent: {}, //pagination data sent to the server - paginationDataReceived: {}, //pagination data received from the server - paginationAddRow: "page", //add rows on table or page - - ajaxURL: false, //url for ajax loading - ajaxURLGenerator: false, - ajaxParams: {}, //params for ajax loading - ajaxConfig: "get", //ajax request type - ajaxContentType: "form", //ajax request type - ajaxRequestFunc: false, //promise function - ajaxLoader: true, //show loader - ajaxLoaderLoading: false, //loader element - ajaxLoaderError: false, //loader element - ajaxFiltering: false, - ajaxSorting: false, - ajaxProgressiveLoad: false, //progressive loading - ajaxProgressiveLoadDelay: 0, //delay between requests - ajaxProgressiveLoadScrollMargin: 0, //margin before scroll begins - - groupBy: false, //enable table grouping and set field to group by - groupStartOpen: true, //starting state of group - groupValues: false, - - groupHeader: false, //header generation function - - htmlOutputConfig: false, //html outypu config - - movableColumns: false, //enable movable columns - - movableRows: false, //enable movable rows - movableRowsConnectedTables: false, //tables for movable rows to be connected to - movableRowsSender: false, - movableRowsReceiver: "insert", - movableRowsSendingStart: function movableRowsSendingStart() {}, - movableRowsSent: function movableRowsSent() {}, - movableRowsSentFailed: function movableRowsSentFailed() {}, - movableRowsSendingStop: function movableRowsSendingStop() {}, - movableRowsReceivingStart: function movableRowsReceivingStart() {}, - movableRowsReceived: function movableRowsReceived() {}, - movableRowsReceivedFailed: function movableRowsReceivedFailed() {}, - movableRowsReceivingStop: function movableRowsReceivingStop() {}, - - scrollToRowPosition: "top", - scrollToRowIfVisible: true, - - scrollToColumnPosition: "left", - scrollToColumnIfVisible: true, - - rowFormatter: false, - rowFormatterPrint: null, - rowFormatterClipboard: null, - rowFormatterHtmlOutput: null, - - placeholder: false, - - //table building callbacks - tableBuilding: function tableBuilding() {}, - tableBuilt: function tableBuilt() {}, - - //render callbacks - renderStarted: function renderStarted() {}, - renderComplete: function renderComplete() {}, - - //row callbacks - rowClick: false, - rowDblClick: false, - rowContext: false, - rowTap: false, - rowDblTap: false, - rowTapHold: false, - rowMouseEnter: false, - rowMouseLeave: false, - rowMouseOver: false, - rowMouseOut: false, - rowMouseMove: false, - rowContextMenu: false, - rowAdded: function rowAdded() {}, - rowDeleted: function rowDeleted() {}, - rowMoved: function rowMoved() {}, - rowUpdated: function rowUpdated() {}, - rowSelectionChanged: function rowSelectionChanged() {}, - rowSelected: function rowSelected() {}, - rowDeselected: function rowDeselected() {}, - rowResized: function rowResized() {}, - - //cell callbacks - //row callbacks - cellClick: false, - cellDblClick: false, - cellContext: false, - cellTap: false, - cellDblTap: false, - cellTapHold: false, - cellMouseEnter: false, - cellMouseLeave: false, - cellMouseOver: false, - cellMouseOut: false, - cellMouseMove: false, - cellEditing: function cellEditing() {}, - cellEdited: function cellEdited() {}, - cellEditCancelled: function cellEditCancelled() {}, - - //column callbacks - columnMoved: false, - columnResized: function columnResized() {}, - columnTitleChanged: function columnTitleChanged() {}, - columnVisibilityChanged: function columnVisibilityChanged() {}, - - //HTML iport callbacks - htmlImporting: function htmlImporting() {}, - htmlImported: function htmlImported() {}, - - //data callbacks - dataLoading: function dataLoading() {}, - dataLoaded: function dataLoaded() {}, - dataEdited: function dataEdited() {}, - - //ajax callbacks - ajaxRequesting: function ajaxRequesting() {}, - ajaxResponse: false, - ajaxError: function ajaxError() {}, - - //filtering callbacks - dataFiltering: false, - dataFiltered: false, - - //sorting callbacks - dataSorting: function dataSorting() {}, - dataSorted: function dataSorted() {}, - - //grouping callbacks - groupToggleElement: "arrow", - groupClosedShowCalcs: false, - dataGrouping: function dataGrouping() {}, - dataGrouped: false, - groupVisibilityChanged: function groupVisibilityChanged() {}, - groupClick: false, - groupDblClick: false, - groupContext: false, - groupTap: false, - groupDblTap: false, - groupTapHold: false, - - columnCalcs: true, - - //pagination callbacks - pageLoaded: function pageLoaded() {}, - - //localization callbacks - localized: function localized() {}, - - //validation has failed - validationFailed: function validationFailed() {}, - - //history callbacks - historyUndo: function historyUndo() {}, - historyRedo: function historyRedo() {}, - - //scroll callbacks - scrollHorizontal: function scrollHorizontal() {}, - scrollVertical: function scrollVertical() {} - -}; - -Tabulator.prototype.initializeOptions = function (options) { - - //warn user if option is not available - if (options.invalidOptionWarnings !== false) { - for (var key in options) { - if (typeof this.defaultOptions[key] === "undefined") { - console.warn("Invalid table constructor option:", key); - } - } - } - - //assign options to table - for (var key in this.defaultOptions) { - if (key in options) { - this.options[key] = options[key]; - } else { - if (Array.isArray(this.defaultOptions[key])) { - this.options[key] = []; - } else if (_typeof(this.defaultOptions[key]) === "object" && this.defaultOptions[key] !== null) { - this.options[key] = {}; - } else { - this.options[key] = this.defaultOptions[key]; - } - } - } -}; - -Tabulator.prototype.initializeElement = function (element) { - - if (typeof HTMLElement !== "undefined" && element instanceof HTMLElement) { - this.element = element; - return true; - } else if (typeof element === "string") { - this.element = document.querySelector(element); - - if (this.element) { - return true; - } else { - console.error("Tabulator Creation Error - no element found matching selector: ", element); - return false; - } - } else { - console.error("Tabulator Creation Error - Invalid element provided:", element); - return false; - } -}; - -//convert depricated functionality to new functions -Tabulator.prototype._mapDepricatedFunctionality = function () { - - //map depricated persistance setup options - if (this.options.persistentLayout || this.options.persistentSort || this.options.persistentFilter) { - if (!this.options.persistence) { - this.options.persistence = {}; - } - } - - if (typeof this.options.clipboardCopyHeader !== "undefined") { - this.options.columnHeaders = this.options.clipboardCopyHeader; - console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option"); - } - - if (this.options.printVisibleRows !== true) { - console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"); - - this.options.persistence.printRowRange = "active"; - } - - if (this.options.printCopyStyle !== true) { - console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"); - - this.options.persistence.printStyled = this.options.printCopyStyle; - } - - if (this.options.persistentLayout) { - console.warn("persistentLayout option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.columns === "undefined") { - this.options.persistence.columns = true; - } - } - - if (this.options.persistentSort) { - console.warn("persistentSort option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.sort === "undefined") { - this.options.persistence.sort = true; - } - } - - if (this.options.persistentFilter) { - console.warn("persistentFilter option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.filter === "undefined") { - this.options.persistence.filter = true; - } - } - - if (this.options.columnVertAlign) { - console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"); - - this.options.columnHeaderVertAlign = this.options.columnVertAlign; - } -}; - -Tabulator.prototype._clearSelection = function () { - - this.element.classList.add("tabulator-block-select"); - - if (window.getSelection) { - if (window.getSelection().empty) { - // Chrome - window.getSelection().empty(); - } else if (window.getSelection().removeAllRanges) { - // Firefox - window.getSelection().removeAllRanges(); - } - } else if (document.selection) { - // IE? - document.selection.empty(); - } - - this.element.classList.remove("tabulator-block-select"); -}; - -//concreate table -Tabulator.prototype._create = function () { - this._clearObjectPointers(); - - this._mapDepricatedFunctionality(); - - this.bindModules(); - - if (this.element.tagName === "TABLE") { - if (this.modExists("htmlTableImport", true)) { - this.modules.htmlTableImport.parseTable(); - } - } - - this.columnManager = new ColumnManager(this); - this.rowManager = new RowManager(this); - this.footerManager = new FooterManager(this); - - this.columnManager.setRowManager(this.rowManager); - this.rowManager.setColumnManager(this.columnManager); - - this._buildElement(); - - this._loadInitialData(); -}; - -//clear pointers to objects in default config object -Tabulator.prototype._clearObjectPointers = function () { - this.options.columns = this.options.columns.slice(0); - - if (!this.options.reactiveData) { - this.options.data = this.options.data.slice(0); - } -}; - -//build tabulator element -Tabulator.prototype._buildElement = function () { - var _this17 = this; - - var element = this.element, - mod = this.modules, - options = this.options; - - options.tableBuilding.call(this); - - element.classList.add("tabulator"); - element.setAttribute("role", "grid"); - - //empty element - while (element.firstChild) { - element.removeChild(element.firstChild); - } //set table height - if (options.height) { - options.height = isNaN(options.height) ? options.height : options.height + "px"; - element.style.height = options.height; - } - - //set table min height - if (options.minHeight !== false) { - options.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + "px"; - element.style.minHeight = options.minHeight; - } - - //set table maxHeight - if (options.maxHeight !== false) { - options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px"; - element.style.maxHeight = options.maxHeight; - } - - this.columnManager.initialize(); - this.rowManager.initialize(); - - this._detectBrowser(); - - if (this.modExists("layout", true)) { - mod.layout.initialize(options.layout); - } - - //set localization - if (options.headerFilterPlaceholder !== false) { - mod.localize.setHeaderFilterPlaceholder(options.headerFilterPlaceholder); - } - - for (var locale in options.langs) { - mod.localize.installLang(locale, options.langs[locale]); - } - - mod.localize.setLocale(options.locale); - - //configure placeholder element - if (typeof options.placeholder == "string") { - - var el = document.createElement("div"); - el.classList.add("tabulator-placeholder"); - - var span = document.createElement("span"); - span.innerHTML = options.placeholder; - - el.appendChild(span); - - options.placeholder = el; - } - - //build table elements - element.appendChild(this.columnManager.getElement()); - element.appendChild(this.rowManager.getElement()); - - if (options.footerElement) { - this.footerManager.activate(); - } - - if (options.persistence && this.modExists("persistence", true)) { - mod.persistence.initialize(); - } - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.columns) { - options.columns = mod.persistence.load("columns", options.columns); - } - - if (options.movableRows && this.modExists("moveRow")) { - mod.moveRow.initialize(); - } - - if (options.autoColumns && this.options.data) { - this.columnManager.generateColumnsFromRowData(this.options.data); - } - - if (this.modExists("columnCalcs")) { - mod.columnCalcs.initialize(); - } - - this.columnManager.setColumns(options.columns); - - if (options.dataTree && this.modExists("dataTree", true)) { - mod.dataTree.initialize(); - } - - if (this.modExists("frozenRows")) { - this.modules.frozenRows.initialize(); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort || options.initialSort) && this.modExists("sort", true)) { - var sorters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort) { - sorters = mod.persistence.load("sort"); - - if (sorters === false && options.initialSort) { - sorters = options.initialSort; - } - } else if (options.initialSort) { - sorters = options.initialSort; - } - - mod.sort.setSort(sorters); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter || options.initialFilter) && this.modExists("filter", true)) { - var filters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter) { - filters = mod.persistence.load("filter"); - - if (filters === false && options.initialFilter) { - filters = options.initialFilter; - } - } else if (options.initialFilter) { - filters = options.initialFilter; - } - - mod.filter.setFilter(filters); - } - - if (options.initialHeaderFilter && this.modExists("filter", true)) { - options.initialHeaderFilter.forEach(function (item) { - - var column = _this17.columnManager.findColumn(item.field); - - if (column) { - mod.filter.setHeaderFilterValue(column, item.value); - } else { - console.warn("Column Filter Error - No matching column found:", item.field); - return false; - } - }); - } - - if (this.modExists("ajax")) { - mod.ajax.initialize(); - } - - if (options.pagination && this.modExists("page", true)) { - mod.page.initialize(); - } - - if (options.groupBy && this.modExists("groupRows", true)) { - mod.groupRows.initialize(); - } - - if (this.modExists("keybindings")) { - mod.keybindings.initialize(); - } - - if (this.modExists("selectRow")) { - mod.selectRow.clearSelectionData(true); - } - - if (options.autoResize && this.modExists("resizeTable")) { - mod.resizeTable.initialize(); - } - - if (this.modExists("clipboard")) { - mod.clipboard.initialize(); - } - - if (options.printAsHtml && this.modExists("print")) { - mod.print.initialize(); - } - - options.tableBuilt.call(this); -}; - -Tabulator.prototype._loadInitialData = function () { - var self = this; - - if (self.options.pagination && self.modExists("page")) { - self.modules.page.reset(true, true); - - if (self.options.pagination == "local") { - if (self.options.data.length) { - self.rowManager.setData(self.options.data, false, true); - } else { - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () { - if (self.options.paginationInitialPage) { - self.modules.page.setPage(self.options.paginationInitialPage); - } - }); - - return; - } else { - self.rowManager.setData(self.options.data, false, true); - } - } - - if (self.options.paginationInitialPage) { - self.modules.page.setPage(self.options.paginationInitialPage); - } - } else { - if (self.options.ajaxURL) { - self.modules.page.setPage(self.options.paginationInitialPage).then(function () {}).catch(function () {}); - } else { - self.rowManager.setData([], false, true); - } - } - } else { - if (self.options.data.length) { - self.rowManager.setData(self.options.data); - } else { - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () {}); - } else { - self.rowManager.setData(self.options.data, false, true); - } - } - } -}; - -//deconstructor -Tabulator.prototype.destroy = function () { - var element = this.element; - - Tabulator.prototype.comms.deregister(this); //deregister table from inderdevice communication - - if (this.options.reactiveData && this.modExists("reactiveData", true)) { - this.modules.reactiveData.unwatchData(); - } - - //clear row data - this.rowManager.rows.forEach(function (row) { - row.wipe(); - }); - - this.rowManager.rows = []; - this.rowManager.activeRows = []; - this.rowManager.displayRows = []; - - //clear event bindings - if (this.options.autoResize && this.modExists("resizeTable")) { - this.modules.resizeTable.clearBindings(); - } - - if (this.modExists("keybindings")) { - this.modules.keybindings.clearBindings(); - } - - //clear DOM - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.classList.remove("tabulator"); -}; - -Tabulator.prototype._detectBrowser = function () { - var ua = navigator.userAgent || navigator.vendor || window.opera; - - if (ua.indexOf("Trident") > -1) { - this.browser = "ie"; - this.browserSlow = true; - } else if (ua.indexOf("Edge") > -1) { - this.browser = "edge"; - this.browserSlow = true; - } else if (ua.indexOf("Firefox") > -1) { - this.browser = "firefox"; - this.browserSlow = false; - } else { - this.browser = "other"; - this.browserSlow = false; - } - - this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.substr(0, 4)); -}; - -////////////////// Data Handling ////////////////// - -//block table redrawing -Tabulator.prototype.blockRedraw = function () { - return this.rowManager.blockRedraw(); -}; - -//restore table redrawing -Tabulator.prototype.restoreRedraw = function () { - return this.rowManager.restoreRedraw(); -}; - -//local data from local file -Tabulator.prototype.setDataFromLocalFile = function (extensions) { - var _this18 = this; - - return new Promise(function (resolve, reject) { - var input = document.createElement("input"); - input.type = "file"; - input.accept = extensions || ".json,application/json"; - - input.addEventListener("change", function (e) { - var file = input.files[0], - reader = new FileReader(), - data; - - reader.readAsText(file); - - reader.onload = function (e) { - - try { - data = JSON.parse(reader.result); - } catch (e) { - console.warn("File Load Error - File contents is invalid JSON", e); - reject(e); - return; - } - - _this18._setData(data).then(function (data) { - resolve(data); - }).catch(function (err) { - resolve(err); - }); - }; - - reader.onerror = function (e) { - console.warn("File Load Error - Unable to read file"); - reject(); - }; - }); - - input.click(); - }); -}; - -//load data -Tabulator.prototype.setData = function (data, params, config) { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, false, true); -}; - -Tabulator.prototype._setData = function (data, params, config, inPosition, columnsChanged) { - var self = this; - - if (typeof data === "string") { - if (data.indexOf("{") == 0 || data.indexOf("[") == 0) { - //data is a json encoded string - return self.rowManager.setData(JSON.parse(data), inPosition, columnsChanged); - } else { - - if (self.modExists("ajax", true)) { - if (params) { - self.modules.ajax.setParams(params); - } - - if (config) { - self.modules.ajax.setConfig(config); - } - - self.modules.ajax.setUrl(data); - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - self.modules.page.reset(true, true); - return self.modules.page.setPage(1); - } else { - //assume data is url, make ajax call to url to get data - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } - } - } else { - if (data) { - //asume data is already an object - return self.rowManager.setData(data, inPosition, columnsChanged); - } else { - - //no data provided, check if ajaxURL is present; - if (self.modExists("ajax") && (self.modules.ajax.getUrl || self.options.ajaxURLGenerator)) { - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - self.modules.page.reset(true, true); - return self.modules.page.setPage(1); - } else { - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } else { - //empty data - return self.rowManager.setData([], inPosition, columnsChanged); - } - } - } -}; - -//clear data -Tabulator.prototype.clearData = function () { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - this.rowManager.clearData(); -}; - -//get table data array -Tabulator.prototype.getData = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getData(active); -}; - -//get table data array count -Tabulator.prototype.getDataCount = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getDataCount(active); -}; - -//search for specific row components -Tabulator.prototype.searchRows = function (field, type, value) { - if (this.modExists("filter", true)) { - return this.modules.filter.search("rows", field, type, value); - } -}; - -//search for specific data -Tabulator.prototype.searchData = function (field, type, value) { - if (this.modExists("filter", true)) { - return this.modules.filter.search("data", field, type, value); - } -}; - -//get table html -Tabulator.prototype.getHtml = function (visible, style, config) { - if (this.modExists("export", true)) { - return this.modules.export.getHtml(visible, style, config); - } -}; - -//get print html -Tabulator.prototype.print = function (visible, style, config) { - if (this.modExists("print", true)) { - return this.modules.print.printFullscreen(visible, style, config); - } -}; - -//retrieve Ajax URL -Tabulator.prototype.getAjaxUrl = function () { - if (this.modExists("ajax", true)) { - return this.modules.ajax.getUrl(); - } -}; - -//replace data, keeping table in position with same sort -Tabulator.prototype.replaceData = function (data, params, config) { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, true); -}; - -//update table data -Tabulator.prototype.updateData = function (data) { - var _this19 = this; - - var self = this; - var responses = 0; - - return new Promise(function (resolve, reject) { - if (_this19.modExists("ajax")) { - _this19.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - data.forEach(function (item) { - var row = self.rowManager.findRow(item[self.options.index]); - - if (row) { - responses++; - - row.updateData(item).then(function () { - responses--; - - if (!responses) { - resolve(); - } - }); - } - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -Tabulator.prototype.addData = function (data, pos, index) { - var _this20 = this; - - return new Promise(function (resolve, reject) { - if (_this20.modExists("ajax")) { - _this20.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - _this20.rowManager.addRows(data, pos, index).then(function (rows) { - var output = []; - - rows.forEach(function (row) { - output.push(row.getComponent()); - }); - - resolve(output); - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -//update table data -Tabulator.prototype.updateOrAddData = function (data) { - var _this21 = this; - - var self = this, - rows = [], - responses = 0; - - return new Promise(function (resolve, reject) { - if (_this21.modExists("ajax")) { - _this21.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - data.forEach(function (item) { - var row = self.rowManager.findRow(item[self.options.index]); - - responses++; - - if (row) { - row.updateData(item).then(function () { - responses--; - rows.push(row.getComponent()); - - if (!responses) { - resolve(rows); - } - }); - } else { - self.rowManager.addRows(item).then(function (newRows) { - responses--; - rows.push(newRows[0].getComponent()); - - if (!responses) { - resolve(rows); - } - }); - } - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -//get row object -Tabulator.prototype.getRow = function (index) { - var row = this.rowManager.findRow(index); - - if (row) { - return row.getComponent(); - } else { - console.warn("Find Error - No matching row found:", index); - return false; - } -}; - -//get row object -Tabulator.prototype.getRowFromPosition = function (position, active) { - var row = this.rowManager.getRowFromPosition(position, active); - - if (row) { - return row.getComponent(); - } else { - console.warn("Find Error - No matching row found:", position); - return false; - } -}; - -//delete row from table -Tabulator.prototype.deleteRow = function (index) { - var _this22 = this; - - return new Promise(function (resolve, reject) { - var self = _this22, - count = 0, - successCount = 0, - foundRows = []; - - function doneCheck() { - count++; - - if (count == index.length) { - if (successCount) { - self.rowManager.reRenderInPosition(); - resolve(); - } - } - } - - if (!Array.isArray(index)) { - index = [index]; - } - - //find matching rows - index.forEach(function (item) { - var row = _this22.rowManager.findRow(item, true); - - if (row) { - foundRows.push(row); - } else { - console.warn("Delete Error - No matching row found:", item); - reject("Delete Error - No matching row found"); - doneCheck(); - } - }); - - //sort rows into correct order to ensure smooth delete from table - foundRows.sort(function (a, b) { - return _this22.rowManager.rows.indexOf(a) > _this22.rowManager.rows.indexOf(b) ? 1 : -1; - }); - - foundRows.forEach(function (row) { - row.delete().then(function () { - successCount++; - doneCheck(); - }).catch(function (err) { - doneCheck(); - reject(err); - }); - }); - }); -}; - -//add row to table -Tabulator.prototype.addRow = function (data, pos, index) { - var _this23 = this; - - return new Promise(function (resolve, reject) { - if (typeof data === "string") { - data = JSON.parse(data); - } - - _this23.rowManager.addRows(data, pos, index).then(function (rows) { - //recalc column calculations if present - if (_this23.modExists("columnCalcs")) { - _this23.modules.columnCalcs.recalc(_this23.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }); - }); -}; - -//update a row if it exitsts otherwise create it -Tabulator.prototype.updateOrAddRow = function (index, data) { - var _this24 = this; - - return new Promise(function (resolve, reject) { - var row = _this24.rowManager.findRow(index); - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (row) { - row.updateData(data).then(function () { - //recalc column calculations if present - if (_this24.modExists("columnCalcs")) { - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(row.getComponent()); - }).catch(function (err) { - reject(err); - }); - } else { - row = _this24.rowManager.addRows(data).then(function (rows) { - //recalc column calculations if present - if (_this24.modExists("columnCalcs")) { - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }).catch(function (err) { - reject(err); - }); - } - }); -}; - -//update row data -Tabulator.prototype.updateRow = function (index, data) { - var _this25 = this; - - return new Promise(function (resolve, reject) { - var row = _this25.rowManager.findRow(index); - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (row) { - row.updateData(data).then(function () { - resolve(row.getComponent()); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Update Error - No matching row found:", index); - reject("Update Error - No matching row found"); - } - }); -}; - -//scroll to row in DOM -Tabulator.prototype.scrollToRow = function (index, position, ifVisible) { - var _this26 = this; - - return new Promise(function (resolve, reject) { - var row = _this26.rowManager.findRow(index); - - if (row) { - _this26.rowManager.scrollToRow(row, position, ifVisible).then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Scroll Error - No matching row found:", index); - reject("Scroll Error - No matching row found"); - } - }); -}; - -Tabulator.prototype.moveRow = function (from, to, after) { - var fromRow = this.rowManager.findRow(from); - - if (fromRow) { - fromRow.moveToRow(to, after); - } else { - console.warn("Move Error - No matching row found:", from); - } -}; - -Tabulator.prototype.getRows = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getComponents(active); -}; - -//get position of row in table -Tabulator.prototype.getRowPosition = function (index, active) { - var row = this.rowManager.findRow(index); - - if (row) { - return this.rowManager.getRowPosition(row, active); - } else { - console.warn("Position Error - No matching row found:", index); - return false; - } -}; - -//copy table data to clipboard -Tabulator.prototype.copyToClipboard = function (selector) { - if (this.modExists("clipboard", true)) { - this.modules.clipboard.copy(selector); - } -}; - -/////////////// Column Functions /////////////// - -Tabulator.prototype.setColumns = function (definition) { - this.columnManager.setColumns(definition); -}; - -Tabulator.prototype.getColumns = function (structured) { - return this.columnManager.getComponents(structured); -}; - -Tabulator.prototype.getColumn = function (field) { - var col = this.columnManager.findColumn(field); - - if (col) { - return col.getComponent(); - } else { - console.warn("Find Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.getColumnDefinitions = function () { - return this.columnManager.getDefinitionTree(); -}; - -Tabulator.prototype.getColumnLayout = function () { - if (this.modExists("persistence", true)) { - return this.modules.persistence.parseColumns(this.columnManager.getColumns()); - } -}; - -Tabulator.prototype.setColumnLayout = function (layout) { - if (this.modExists("persistence", true)) { - this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns, layout)); - return true; - } - return false; -}; - -Tabulator.prototype.showColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - column.show(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - this.modules.responsiveLayout.update(); - } - } else { - console.warn("Column Show Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.hideColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - column.hide(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - this.modules.responsiveLayout.update(); - } - } else { - console.warn("Column Hide Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.toggleColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - if (column.visible) { - column.hide(); - } else { - column.show(); - } - } else { - console.warn("Column Visibility Toggle Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.addColumn = function (definition, before, field) { - var _this27 = this; - - return new Promise(function (resolve, reject) { - var column = _this27.columnManager.findColumn(field); - - _this27.columnManager.addColumn(definition, before, column).then(function (column) { - resolve(column.getComponent()); - }).catch(function (err) { - reject(err); - }); - }); -}; - -Tabulator.prototype.deleteColumn = function (field) { - var _this28 = this; - - return new Promise(function (resolve, reject) { - var column = _this28.columnManager.findColumn(field); - - if (column) { - column.delete().then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Delete Error - No matching column found:", field); - reject(); - } - }); -}; - -Tabulator.prototype.updateColumnDefinition = function (field, definition) { - var _this29 = this; - - return new Promise(function (resolve, reject) { - var column = _this29.columnManager.findColumn(field); - - if (column) { - column.updateDefinition(definition).then(function (col) { - resolve(col); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Update Error - No matching column found:", field); - reject(); - } - }); -}; - -Tabulator.prototype.moveColumn = function (from, to, after) { - var fromColumn = this.columnManager.findColumn(from); - var toColumn = this.columnManager.findColumn(to); - - if (fromColumn) { - if (toColumn) { - this.columnManager.moveColumn(fromColumn, toColumn, after); - } else { - console.warn("Move Error - No matching column found:", toColumn); - } - } else { - console.warn("Move Error - No matching column found:", from); - } -}; - -//scroll to column in DOM -Tabulator.prototype.scrollToColumn = function (field, position, ifVisible) { - var _this30 = this; - - return new Promise(function (resolve, reject) { - var column = _this30.columnManager.findColumn(field); - - if (column) { - _this30.columnManager.scrollToColumn(column, position, ifVisible).then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Scroll Error - No matching column found:", field); - reject("Scroll Error - No matching column found"); - } - }); -}; - -//////////// Localization Functions //////////// -Tabulator.prototype.setLocale = function (locale) { - this.modules.localize.setLocale(locale); -}; - -Tabulator.prototype.getLocale = function () { - return this.modules.localize.getLocale(); -}; - -Tabulator.prototype.getLang = function (locale) { - return this.modules.localize.getLang(locale); -}; - -//////////// General Public Functions //////////// - -//redraw list without updating data -Tabulator.prototype.redraw = function (force) { - this.columnManager.redraw(force); - this.rowManager.redraw(force); -}; - -Tabulator.prototype.setHeight = function (height) { - - if (this.rowManager.renderMode !== "classic") { - this.options.height = isNaN(height) ? height : height + "px"; - this.element.style.height = this.options.height; - this.rowManager.setRenderMode(); - this.rowManager.redraw(); - } else { - console.warn("setHeight function is not available in classic render mode"); - } -}; - -///////////////////// Sorting //////////////////// - -//trigger sort -Tabulator.prototype.setSort = function (sortList, dir) { - if (this.modExists("sort", true)) { - this.modules.sort.setSort(sortList, dir); - this.rowManager.sorterRefresh(); - } -}; - -Tabulator.prototype.getSorters = function () { - if (this.modExists("sort", true)) { - return this.modules.sort.getSort(); - } -}; - -Tabulator.prototype.clearSort = function () { - if (this.modExists("sort", true)) { - this.modules.sort.clear(); - this.rowManager.sorterRefresh(); - } -}; - -///////////////////// Filtering //////////////////// - -//set standard filters -Tabulator.prototype.setFilter = function (field, type, value) { - if (this.modExists("filter", true)) { - this.modules.filter.setFilter(field, type, value); - this.rowManager.filterRefresh(); - } -}; - -//add filter to array -Tabulator.prototype.addFilter = function (field, type, value) { - if (this.modExists("filter", true)) { - this.modules.filter.addFilter(field, type, value); - this.rowManager.filterRefresh(); - } -}; - -//get all filters -Tabulator.prototype.getFilters = function (all) { - if (this.modExists("filter", true)) { - return this.modules.filter.getFilters(all); - } -}; - -Tabulator.prototype.setHeaderFilterFocus = function (field) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - this.modules.filter.setHeaderFilterFocus(column); - } else { - console.warn("Column Filter Focus Error - No matching column found:", field); - return false; - } - } -}; - -Tabulator.prototype.getHeaderFilterValue = function (field) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - return this.modules.filter.getHeaderFilterValue(column); - } else { - console.warn("Column Filter Error - No matching column found:", field); - } - } -}; - -Tabulator.prototype.setHeaderFilterValue = function (field, value) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - this.modules.filter.setHeaderFilterValue(column, value); - } else { - console.warn("Column Filter Error - No matching column found:", field); - return false; - } - } -}; - -Tabulator.prototype.getHeaderFilters = function () { - if (this.modExists("filter", true)) { - return this.modules.filter.getHeaderFilters(); - } -}; - -//remove filter from array -Tabulator.prototype.removeFilter = function (field, type, value) { - if (this.modExists("filter", true)) { - this.modules.filter.removeFilter(field, type, value); - this.rowManager.filterRefresh(); - } -}; - -//clear filters -Tabulator.prototype.clearFilter = function (all) { - if (this.modExists("filter", true)) { - this.modules.filter.clearFilter(all); - this.rowManager.filterRefresh(); - } -}; - -//clear header filters -Tabulator.prototype.clearHeaderFilter = function () { - if (this.modExists("filter", true)) { - this.modules.filter.clearHeaderFilter(); - this.rowManager.filterRefresh(); - } -}; - -///////////////////// Filtering //////////////////// -Tabulator.prototype.selectRow = function (rows) { - if (this.modExists("selectRow", true)) { - if (rows === true) { - console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"); - rows = "active"; - } - this.modules.selectRow.selectRows(rows); - } -}; - -Tabulator.prototype.deselectRow = function (rows) { - if (this.modExists("selectRow", true)) { - this.modules.selectRow.deselectRows(rows); - } -}; - -Tabulator.prototype.toggleSelectRow = function (row) { - if (this.modExists("selectRow", true)) { - this.modules.selectRow.toggleRow(row); - } -}; - -Tabulator.prototype.getSelectedRows = function () { - if (this.modExists("selectRow", true)) { - return this.modules.selectRow.getSelectedRows(); - } -}; - -Tabulator.prototype.getSelectedData = function () { - if (this.modExists("selectRow", true)) { - return this.modules.selectRow.getSelectedData(); - } -}; - -//////////// Pagination Functions //////////// - -Tabulator.prototype.setMaxPage = function (max) { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.setMaxPage(max); - } else { - return false; - } -}; - -Tabulator.prototype.setPage = function (page) { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.setPage(page); - } else { - return new Promise(function (resolve, reject) { - reject(); - }); - } -}; - -Tabulator.prototype.setPageToRow = function (row) { - var _this31 = this; - - return new Promise(function (resolve, reject) { - if (_this31.options.pagination && _this31.modExists("page")) { - row = _this31.rowManager.findRow(row); - - if (row) { - _this31.modules.page.setPageToRow(row).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - reject(); - } - } else { - reject(); - } - }); -}; - -Tabulator.prototype.setPageSize = function (size) { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.setPageSize(size); - this.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else { - return false; - } -}; - -Tabulator.prototype.getPageSize = function () { - if (this.options.pagination && this.modExists("page", true)) { - return this.modules.page.getPageSize(); - } -}; - -Tabulator.prototype.previousPage = function () { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.previousPage(); - } else { - return false; - } -}; - -Tabulator.prototype.nextPage = function () { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.nextPage(); - } else { - return false; - } -}; - -Tabulator.prototype.getPage = function () { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.getPage(); - } else { - return false; - } -}; - -Tabulator.prototype.getPageMax = function () { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.getPageMax(); - } else { - return false; - } -}; - -///////////////// Grouping Functions /////////////// - -Tabulator.prototype.setGroupBy = function (groups) { - if (this.modExists("groupRows", true)) { - this.options.groupBy = groups; - this.modules.groupRows.initialize(); - this.rowManager.refreshActiveData("display"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - return false; - } -}; - -Tabulator.prototype.setGroupStartOpen = function (values) { - if (this.modExists("groupRows", true)) { - this.options.groupStartOpen = values; - this.modules.groupRows.initialize(); - if (this.options.groupBy) { - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - return false; - } -}; - -Tabulator.prototype.setGroupHeader = function (values) { - if (this.modExists("groupRows", true)) { - this.options.groupHeader = values; - this.modules.groupRows.initialize(); - if (this.options.groupBy) { - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - return false; - } -}; - -Tabulator.prototype.getGroups = function (values) { - if (this.modExists("groupRows", true)) { - return this.modules.groupRows.getGroups(true); - } else { - return false; - } -}; - -// get grouped table data in the same format as getData() -Tabulator.prototype.getGroupedData = function () { - if (this.modExists("groupRows", true)) { - return this.options.groupBy ? this.modules.groupRows.getGroupedData() : this.getData(); - } -}; - -///////////////// Column Calculation Functions /////////////// -Tabulator.prototype.getCalcResults = function () { - if (this.modExists("columnCalcs", true)) { - return this.modules.columnCalcs.getResults(); - } else { - return false; - } -}; - -Tabulator.prototype.recalc = function () { - if (this.modExists("columnCalcs", true)) { - this.modules.columnCalcs.recalcAll(this.rowManager.activeRows); - } -}; - -/////////////// Navigation Management ////////////// - -Tabulator.prototype.navigatePrev = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - return cell.nav().prev(); - } - } - - return false; -}; - -Tabulator.prototype.navigateNext = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - return cell.nav().next(); - } - } - - return false; -}; - -Tabulator.prototype.navigateLeft = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().left(); - } - } - - return false; -}; - -Tabulator.prototype.navigateRight = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().right(); - } - } - - return false; -}; - -Tabulator.prototype.navigateUp = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().up(); - } - } - - return false; -}; - -Tabulator.prototype.navigateDown = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().down(); - } - } - - return false; -}; - -/////////////// History Management ////////////// -Tabulator.prototype.undo = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.undo(); - } else { - return false; - } -}; - -Tabulator.prototype.redo = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.redo(); - } else { - return false; - } -}; - -Tabulator.prototype.getHistoryUndoSize = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.getHistoryUndoSize(); - } else { - return false; - } -}; - -Tabulator.prototype.getHistoryRedoSize = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.getHistoryRedoSize(); - } else { - return false; - } -}; - -/////////////// Download Management ////////////// - -Tabulator.prototype.download = function (type, filename, options, active) { - if (this.modExists("download", true)) { - this.modules.download.download(type, filename, options, active); - } -}; - -Tabulator.prototype.downloadToTab = function (type, filename, options, active) { - if (this.modExists("download", true)) { - this.modules.download.download(type, filename, options, active, true); - } -}; - -/////////// Inter Table Communications /////////// - -Tabulator.prototype.tableComms = function (table, module, action, data) { - this.modules.comms.receive(table, module, action, data); -}; - -////////////// Extension Management ////////////// - -//object to hold module -Tabulator.prototype.moduleBindings = {}; - -//extend module -Tabulator.prototype.extendModule = function (name, property, values) { - - if (Tabulator.prototype.moduleBindings[name]) { - var source = Tabulator.prototype.moduleBindings[name].prototype[property]; - - if (source) { - if ((typeof values === 'undefined' ? 'undefined' : _typeof(values)) == "object") { - for (var key in values) { - source[key] = values[key]; - } - } else { - console.warn("Module Error - Invalid value type, it must be an object"); - } - } else { - console.warn("Module Error - property does not exist:", property); - } - } else { - console.warn("Module Error - module does not exist:", name); - } -}; - -//add module to tabulator -Tabulator.prototype.registerModule = function (name, module) { - var self = this; - Tabulator.prototype.moduleBindings[name] = module; -}; - -//ensure that module are bound to instantiated function -Tabulator.prototype.bindModules = function () { - this.modules = {}; - - for (var name in Tabulator.prototype.moduleBindings) { - this.modules[name] = new Tabulator.prototype.moduleBindings[name](this); - } -}; - -//Check for module -Tabulator.prototype.modExists = function (plugin, required) { - if (this.modules[plugin]) { - return true; - } else { - if (required) { - console.error("Tabulator Module Not Installed: " + plugin); - } - return false; - } -}; - -Tabulator.prototype.helpers = { - - elVisible: function elVisible(el) { - return !(el.offsetWidth <= 0 && el.offsetHeight <= 0); - }, - - elOffset: function elOffset(el) { - var box = el.getBoundingClientRect(); - - return { - top: box.top + window.pageYOffset - document.documentElement.clientTop, - left: box.left + window.pageXOffset - document.documentElement.clientLeft - }; - }, - - deepClone: function deepClone(obj) { - var clone = Array.isArray(obj) ? [] : {}; - - for (var i in obj) { - if (obj[i] != null && _typeof(obj[i]) === "object") { - if (obj[i] instanceof Date) { - clone[i] = new Date(obj[i]); - } else { - clone[i] = this.deepClone(obj[i]); - } - } else { - clone[i] = obj[i]; - } - } - return clone; - } -}; - -Tabulator.prototype.comms = { - tables: [], - register: function register(table) { - Tabulator.prototype.comms.tables.push(table); - }, - deregister: function deregister(table) { - var index = Tabulator.prototype.comms.tables.indexOf(table); - - if (index > -1) { - Tabulator.prototype.comms.tables.splice(index, 1); - } - }, - lookupTable: function lookupTable(query, silent) { - var results = [], - matches, - match; - - if (typeof query === "string") { - matches = document.querySelectorAll(query); - - if (matches.length) { - for (var i = 0; i < matches.length; i++) { - match = Tabulator.prototype.comms.matchElement(matches[i]); - - if (match) { - results.push(match); - } - } - } - } else if (typeof HTMLElement !== "undefined" && query instanceof HTMLElement || query instanceof Tabulator) { - match = Tabulator.prototype.comms.matchElement(query); - - if (match) { - results.push(match); - } - } else if (Array.isArray(query)) { - query.forEach(function (item) { - results = results.concat(Tabulator.prototype.comms.lookupTable(item)); - }); - } else { - if (!silent) { - console.warn("Table Connection Error - Invalid Selector", query); - } - } - - return results; - }, - matchElement: function matchElement(element) { - return Tabulator.prototype.comms.tables.find(function (table) { - return element instanceof Tabulator ? table === element : table.element === element; - }); - } -}; - -Tabulator.prototype.findTable = function (query) { - var results = Tabulator.prototype.comms.lookupTable(query, true); - return Array.isArray(results) && !results.length ? false : results; -}; - -var Layout = function Layout(table) { - - this.table = table; - - this.mode = null; -}; - -//initialize layout system - -Layout.prototype.initialize = function (layout) { - - if (this.modes[layout]) { - - this.mode = layout; - } else { - - console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : " + layout); - - this.mode = 'fitData'; - } - - this.table.element.setAttribute("tabulator-layout", this.mode); -}; - -Layout.prototype.getMode = function () { - - return this.mode; -}; - -//trigger table layout - -Layout.prototype.layout = function () { - - this.modes[this.mode].call(this, this.table.columnManager.columnsByIndex); -}; - -//layout render functions - -Layout.prototype.modes = { - - //resize columns to fit data the contain - - "fitData": function fitData(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch row to fill table - - "fitDataFill": function fitDataFill(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch last column to fill table - - "fitDataStretch": function fitDataStretch(columns) { - var _this32 = this; - - var colsWidth = 0, - tableWidth = this.table.rowManager.element.clientWidth, - gap = 0, - lastCol = false; - - columns.forEach(function (column, i) { - - if (!column.widthFixed) { - - column.reinitializeWidth(); - } - - if (_this32.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible) { - - lastCol = column; - } - - if (column.visible) { - - colsWidth += column.getWidth(); - } - }); - - if (lastCol) { - - gap = tableWidth - colsWidth + lastCol.getWidth(); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - lastCol.setWidth(0); - - this.table.modules.responsiveLayout.update(); - } - - if (gap > 0) { - - lastCol.setWidth(gap); - } else { - - lastCol.reinitializeWidth(); - } - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - }, - - //resize columns to fit - - "fitColumns": function fitColumns(columns) { - - var self = this; - - var totalWidth = self.table.element.clientWidth; //table element width - - var fixedWidth = 0; //total width of columns with a defined width - - var flexWidth = 0; //total width available to flexible columns - - var flexGrowUnits = 0; //total number of widthGrow blocks accross all columns - - var flexColWidth = 0; //desired width of flexible columns - - var flexColumns = []; //array of flexible width columns - - var fixedShrinkColumns = []; //array of fixed width columns that can shrink - - var flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns - - var overflowWidth = 0; //horizontal overflow width - - var gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps - - - function calcWidth(width) { - - var colWidth; - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - return colWidth; - } - - //ensure columns resize to take up the correct amount of space - - function scaleColumns(columns, freeSpace, colWidth, shrinkCols) { - - var oversizeCols = [], - oversizeSpace = 0, - remainingSpace = 0, - nextColWidth = 0, - gap = 0, - changeUnits = 0, - undersizeCols = []; - - function calcGrow(col) { - - return colWidth * (col.column.definition.widthGrow || 1); - } - - function calcShrink(col) { - - return calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0); - } - - columns.forEach(function (col, i) { - - var width = shrinkCols ? calcShrink(col) : calcGrow(col); - - if (col.column.minWidth >= width) { - - oversizeCols.push(col); - } else { - - undersizeCols.push(col); - - changeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1; - } - }); - - if (oversizeCols.length) { - - oversizeCols.forEach(function (col) { - - oversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth; - - col.width = col.column.minWidth; - }); - - remainingSpace = freeSpace - oversizeSpace; - - nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace; - - gap = remainingSpace - nextColWidth * changeUnits; - - gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); - } else { - - gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace; - - undersizeCols.forEach(function (column) { - - column.width = shrinkCols ? calcShrink(column) : calcGrow(column); - }); - } - - return gap; - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - - //adjust for vertical scrollbar if present - - if (this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight) { - - totalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth; - } - - columns.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width; - - minWidth = parseInt(column.minWidth); - - if (width) { - - colWidth = calcWidth(width); - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - - if (column.definition.widthShrink) { - - fixedShrinkColumns.push({ - - column: column, - - width: colWidth > minWidth ? colWidth : minWidth - - }); - - flexShrinkUnits += column.definition.widthShrink; - } - } else { - - flexColumns.push({ - - column: column, - - width: 0 - - }); - - flexGrowUnits += column.definition.widthGrow || 1; - } - } - }); - - //calculate available space - - flexWidth = totalWidth - fixedWidth; - - //calculate correct column size - - flexColWidth = Math.floor(flexWidth / flexGrowUnits); - - //generate column widths - - var gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); - - //increase width of last column to account for rounding errors - - if (flexColumns.length && gapFill > 0) { - - flexColumns[flexColumns.length - 1].width += +gapFill; - } - - //caculate space for columns to be shrunk into - - flexColumns.forEach(function (col) { - - flexWidth -= col.width; - }); - - overflowWidth = Math.abs(gapFill) + flexWidth; - - //shrink oversize columns if there is no available space - - if (overflowWidth > 0 && flexShrinkUnits) { - - gapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true); - } - - //decrease width of last column to account for rounding errors - - if (fixedShrinkColumns.length) { - - fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill; - } - - flexColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - - fixedShrinkColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - } - -}; - -Tabulator.prototype.registerModule("layout", Layout); -var Localize = function Localize(table) { - this.table = table; //hold Tabulator object - this.locale = "default"; //current locale - this.lang = false; //current language - this.bindings = {}; //update events to call when locale is changed -}; - -//set header placehoder -Localize.prototype.setHeaderFilterPlaceholder = function (placeholder) { - this.langs.default.headerFilters.default = placeholder; -}; - -//set header filter placeholder by column -Localize.prototype.setHeaderFilterColumnPlaceholder = function (column, placeholder) { - this.langs.default.headerFilters.columns[column] = placeholder; - - if (this.lang && !this.lang.headerFilters.columns[column]) { - this.lang.headerFilters.columns[column] = placeholder; - } -}; - -//setup a lang description object -Localize.prototype.installLang = function (locale, lang) { - if (this.langs[locale]) { - this._setLangProp(this.langs[locale], lang); - } else { - this.langs[locale] = lang; - } -}; - -Localize.prototype._setLangProp = function (lang, values) { - for (var key in values) { - if (lang[key] && _typeof(lang[key]) == "object") { - this._setLangProp(lang[key], values[key]); - } else { - lang[key] = values[key]; - } - } -}; - -//set current locale -Localize.prototype.setLocale = function (desiredLocale) { - var self = this; - - desiredLocale = desiredLocale || "default"; - - //fill in any matching languge values - function traverseLang(trans, path) { - for (var prop in trans) { - - if (_typeof(trans[prop]) == "object") { - if (!path[prop]) { - path[prop] = {}; - } - traverseLang(trans[prop], path[prop]); - } else { - path[prop] = trans[prop]; - } - } - } - - //determing correct locale to load - if (desiredLocale === true && navigator.language) { - //get local from system - desiredLocale = navigator.language.toLowerCase(); - } - - if (desiredLocale) { - - //if locale is not set, check for matching top level locale else use default - if (!self.langs[desiredLocale]) { - var prefix = desiredLocale.split("-")[0]; - - if (self.langs[prefix]) { - console.warn("Localization Error - Exact matching locale not found, using closest match: ", desiredLocale, prefix); - desiredLocale = prefix; - } else { - console.warn("Localization Error - Matching locale not found, using default: ", desiredLocale); - desiredLocale = "default"; - } - } - } - - self.locale = desiredLocale; - - //load default lang template - self.lang = Tabulator.prototype.helpers.deepClone(self.langs.default || {}); - - if (desiredLocale != "default") { - traverseLang(self.langs[desiredLocale], self.lang); - } - - self.table.options.localized.call(self.table, self.locale, self.lang); - - self._executeBindings(); -}; - -//get current locale -Localize.prototype.getLocale = function (locale) { - return self.locale; -}; - -//get lang object for given local or current if none provided -Localize.prototype.getLang = function (locale) { - return locale ? this.langs[locale] : this.lang; -}; - -//get text for current locale -Localize.prototype.getText = function (path, value) { - var path = value ? path + "|" + value : path, - pathArray = path.split("|"), - text = this._getLangElement(pathArray, this.locale); - - // if(text === false){ - // console.warn("Localization Error - Matching localized text not found for given path: ", path); - // } - - return text || ""; -}; - -//traverse langs object and find localized copy -Localize.prototype._getLangElement = function (path, locale) { - var self = this; - var root = self.lang; - - path.forEach(function (level) { - var rootPath; - - if (root) { - rootPath = root[level]; - - if (typeof rootPath != "undefined") { - root = rootPath; - } else { - root = false; - } - } - }); - - return root; -}; - -//set update binding -Localize.prototype.bind = function (path, callback) { - if (!this.bindings[path]) { - this.bindings[path] = []; - } - - this.bindings[path].push(callback); - - callback(this.getText(path), this.lang); -}; - -//itterate through bindings and trigger updates -Localize.prototype._executeBindings = function () { - var self = this; - - var _loop = function _loop(path) { - self.bindings[path].forEach(function (binding) { - binding(self.getText(path), self.lang); - }); - }; - - for (var path in self.bindings) { - _loop(path); - } -}; - -//Localized text listings -Localize.prototype.langs = { - "default": { //hold default locale text - "groups": { - "item": "item", - "items": "items" - }, - "columns": {}, - "ajax": { - "loading": "Loading", - "error": "Error" - }, - "pagination": { - "page_size": "Page Size", - "first": "First", - "first_title": "First Page", - "last": "Last", - "last_title": "Last Page", - "prev": "Prev", - "prev_title": "Prev Page", - "next": "Next", - "next_title": "Next Page" - }, - "headerFilters": { - "default": "filter column...", - "columns": {} - } - } -}; - -Tabulator.prototype.registerModule("localize", Localize); -var Comms = function Comms(table) { - this.table = table; -}; - -Comms.prototype.getConnections = function (selectors) { - var self = this, - connections = [], - connection; - - connection = Tabulator.prototype.comms.lookupTable(selectors); - - connection.forEach(function (con) { - if (self.table !== con) { - connections.push(con); - } - }); - - return connections; -}; - -Comms.prototype.send = function (selectors, module, action, data) { - var self = this, - connections = this.getConnections(selectors); - - connections.forEach(function (connection) { - connection.tableComms(self.table.element, module, action, data); - }); - - if (!connections.length && selectors) { - console.warn("Table Connection Error - No tables matching selector found", selectors); - } -}; - -Comms.prototype.receive = function (table, module, action, data) { - if (this.table.modExists(module)) { - return this.table.modules[module].commsReceived(table, action, data); - } else { - console.warn("Inter-table Comms Error - no such module:", module); - } -}; - -Tabulator.prototype.registerModule("comms", Comms); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js.old/tabulator_core.min.js b/app/static/vendors/tabulator/js.old/tabulator_core.min.js deleted file mode 100644 index feed651..0000000 --- a/app/static/vendors/tabulator/js.old/tabulator_core.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/* Tabulator v4.6.3 (c) Oliver Folkerd */ -"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;no?(e=t-o,this.element.style.marginLeft=-e+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},ColumnManager.prototype.generateColumnsFromRowData=function(t){var e,o,i=[];if(t&&t.length){e=t[0];for(var n in e){var s={field:n,title:n},l=e[n];switch(void 0===l?"undefined":_typeof(l)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(l)?"array":"string";break;default:o=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},ColumnManager.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},ColumnManager.prototype._addColumn=function(t,e,o){var i=new Column(t,this),n=i.getElement(),s=o?this.findColumnIndex(o):o;if(o&&s>-1){var l=this.columns.indexOf(o.getTopColumn()),a=o.getElement();e?(this.columns.splice(l,0,i),a.parentNode.insertBefore(n,a)):(this.columns.splice(l+1,0,i),a.parentNode.insertBefore(n,a.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},ColumnManager.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},ColumnManager.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},ColumnManager.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},ColumnManager.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)}),t.columns.forEach(function(o){o.verticalAlign(t.table.options.columnHeaderVertAlign,e)}),t.rowManager.adjustTableSize()},ColumnManager.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof Column)return t;if(t instanceof ColumnComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},ColumnManager.prototype.getColumnByField=function(t){return this.columnsByField[t]},ColumnManager.prototype.getColumnsByFieldRoot=function(t){var e=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===t&&o.push(e.columnsByField[i])}),o},ColumnManager.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},ColumnManager.prototype.getFirstVisibileColumn=function(t){var t=this.columnsByIndex.findIndex(function(t){return t.visible});return t>-1&&this.columnsByIndex[t]},ColumnManager.prototype.getColumns=function(){return this.columns},ColumnManager.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},ColumnManager.prototype.getRealColumns=function(){return this.columnsByIndex},ColumnManager.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},ColumnManager.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},ColumnManager.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},ColumnManager.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},ColumnManager.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},ColumnManager.prototype.moveColumn=function(t,e,o){this.moveColumnActual(t,e,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e.element.parentNode.insertBefore(t.element,e.element),o&&e.element.parentNode.insertBefore(e.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},ColumnManager.prototype.moveColumnActual=function(t,e,o){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,o):this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},ColumnManager.prototype._moveColumnInArray=function(t,e,o,i,n){var s,l=t.indexOf(e);l>-1&&(t.splice(l,1),s=t.indexOf(o),s>-1?i&&(s+=1):s=l,t.splice(s,0,e),n&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(l,1)[0];t.cells.splice(s,0,e)}}))},ColumnManager.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,s=0,l=0,a=t.getElement();return new Promise(function(r,u){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":l=-i.element.clientWidth/2;break;case"right":l=a.clientWidth-i.headersElement.clientWidth}if(!o&&(s=a.offsetLeft)>0&&s+a.offsetWidtht.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,l;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),l="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=l>s?l:s)}),o},ColumnManager.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var l=i._addColumn(t,e,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&l.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(l)})},ColumnManager.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],e=this.columnsByIndex.indexOf(t),e>-1&&this.columnsByIndex.splice(e,1),e=this.columns.indexOf(t),e>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},ColumnManager.prototype.redraw=function(t){t&&(Tabulator.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var ColumnComponent=function(t){this._column=t,this.type="ColumnComponent"};ColumnComponent.prototype.getElement=function(){return this._column.getElement()},ColumnComponent.prototype.getDefinition=function(){return this._column.getDefinition()},ColumnComponent.prototype.getField=function(){return this._column.getField()},ColumnComponent.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getVisibility=function(){return this._column.visible},ColumnComponent.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},ColumnComponent.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},ColumnComponent.prototype.toggle=function(){this._column.visible?this.hide():this.show()},ColumnComponent.prototype.delete=function(){return this._column.delete()},ColumnComponent.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getParentColumn=function(){return this._column.parent instanceof Column&&this._column.parent.getComponent()},ColumnComponent.prototype._getSelf=function(){return this._column},ColumnComponent.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},ColumnComponent.prototype.getTable=function(){return this._column.table},ColumnComponent.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},ColumnComponent.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},ColumnComponent.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},ColumnComponent.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},ColumnComponent.prototype.move=function(t,e){var o=this._column.table.columnManager.findColumn(t);o?this._column.table.columnManager.moveColumn(this._column,o,e):console.warn("Move Error - No matching column found:",o)},ColumnComponent.prototype.getNextColumn=function(){var t=this._column.nextColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)};var Column=function t(e,o){var i=this;this.table=o.table,this.definition=e,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this._mapDepricatedFunctionality(),e.columns?(this.isGroup=!0,e.columns.forEach(function(e,o){var n=new t(e,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};Column.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},Column.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},Column.prototype.checkDefinition=function(){var t=this;Object.keys(this.definition).forEach(function(e){-1===t.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",e)})},Column.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},Column.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},Column.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},Column.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},Column.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign"))},Column.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.modules.localize.bind("columns|"+e.field,function(o){t.element.setAttribute("title",o||e.title)}):t.element.setAttribute("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.setAttribute("title",o)):t.element.setAttribute("title","")},Column.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",function(e){t.setTooltip()})},Column.prototype._bindEvents=function(){var t,e,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(t){n.headerClick(t,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(t){n.headerDblClick(t,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(t){n.headerContext(t,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&n.headerTap(t,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof n.headerTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},Column.prototype._buildColumnHeader=function(){var t=this,e=t.definition,o=t.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(t,t.contentElement),(e.headerContextMenu||e.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(t),o.modExists("format")&&o.modules.format.initializeColumn(t),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(t),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(t),o.modExists("mutator")&&o.modules.mutator.initializeColumn(t),o.modExists("accessor")&&o.modules.accessor.initializeColumn(t),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass){e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}e.field&&this.element.setAttribute("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:parseInt(e.minWidth)),t.reinitializeWidth(),t.tooltip=t.definition.tooltip||!1===t.definition.tooltip?t.definition.tooltip:t.table.options.tooltips,t.hozAlign=void 0===t.definition.hozAlign?t.table.options.cellHozAlign:t.definition.hozAlign,t.vertAlign=void 0===t.definition.vertAlign?t.table.options.cellVertAlign:t.definition.vertAlign},Column.prototype._buildColumnHeaderContent=function(){var t=(this.definition,this.table,document.createElement("div"));return t.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),t.appendChild(this.titleElement),t},Column.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,o=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(t){t.stopPropagation(),n.focus()}),n.addEventListener("change",function(){e.title=n.value,o.options.columnTitleChanged.call(t.table,t.getComponent())}),i.appendChild(n),e.field?o.modules.localize.bind("columns|"+e.field,function(t){n.value=t||e.title||" "}):n.value=e.title||" "}else e.field?o.modules.localize.bind("columns|"+e.field,function(o){t._formatColumnHeaderTitle(i,o||e.title||" ")}):t._formatColumnHeaderTitle(i,e.title||" ");return i},Column.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,s,l,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),l=function(t){a.titleFormatterRendered=t},s={getValue:function(){return e},getElement:function(){return t}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n,l),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=i}else t.innerHTML=e},Column.prototype._buildGroupHeader=function(){var t=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){this.definition.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}this.element.appendChild(this.groupElement)},Column.prototype._getFlatData=function(t){return t[this.field]},Column.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(t+1)},Column.prototype._nextVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)},Column.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)},Column.prototype._prevVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)},Column.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},Column.prototype.fitToData=function(){var t=this;this.widthFixed||(this.element.style.width="",t.cells.forEach(function(t){t.clearWidth()}));var e=this.element.offsetWidth;t.width&&this.widthFixed||(t.cells.forEach(function(t){var o=t.getWidth();o>e&&(e=o)}),e&&t.setWidthActual(e+1))},Column.prototype.updateDefinition=function(t){var e=this;return new Promise(function(o,i){var n;e.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},e.getDefinition()),n=Object.assign(n,t),e.table.columnManager.addColumn(n,!1,e).then(function(t){n.field==e.field&&(e.field=!1), -e.delete().then(function(){o(t.getComponent())}).catch(function(t){i(t)})}).catch(function(t){i(t)}))})},Column.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Column.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams"],Column.prototype.getComponent=function(){return new ColumnComponent(this)};var RowManager=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};RowManager.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},RowManager.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},RowManager.prototype.getElement=function(){return this.element},RowManager.prototype.getTableElement=function(){return this.tableElement},RowManager.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},RowManager.prototype.setColumnManager=function(t){this.columnManager=t},RowManager.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e),t.table.options.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e),t.table.options.scrollVertical(e)):t.scrollTop=e})},RowManager.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof Row)return t;if(t instanceof RowComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.rows.find(function(e){return e.element===t})||!1}return!1},RowManager.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},RowManager.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},RowManager.prototype.scrollToRow=function(t,e,o){var i,n=this,s=this.getDisplayRows().indexOf(t),l=t.getElement(),a=0;return new Promise(function(t,r){if(s>-1){if(void 0===e&&(e=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===e)switch(n.renderMode){case"classic":i=Tabulator.prototype.helpers.elOffset(l).top,e=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&Tabulator.prototype.helpers.elVisible(l)&&(a=Tabulator.prototype.helpers.elOffset(l).top-Tabulator.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),e||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},RowManager.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},RowManager.prototype.addRows=function(t,e,o){var i=this,n=this,s=0,l=[];return new Promise(function(a,r){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),s=t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,i){var s=n.addRow(t,e,o,!0);l.push(s)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(l)})},RowManager.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},RowManager.prototype.addRowActual=function(t,e,o,i){var n,s,l=t instanceof Row?t:new Row(t||{},this),a=this.findAddRowPos(e),r=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),a?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],a=!1):s.length&&(o=s[s.length-1],a=!(s.length1&&(!o||o&&-1==u.indexOf(o)?a?u[0]!==l&&(o=u[0],this._moveRowInArray(l.getGroup().rows,l,o,!a)):u[u.length-1]!==l&&(o=u[u.length-1],this._moveRowInArray(l.getGroup().rows,l,o,!a)):this._moveRowInArray(l.getGroup().rows,l,o,!a))}return o&&(r=this.rows.indexOf(o)),o&&r>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(a?e:e+1,0,l)}),n>-1&&this.activeRows.splice(a?n:n+1,0,l),this.rows.splice(a?r:r+1,0,l)):a?(this.displayRowIterator(function(t){t.unshift(l)}),this.activeRows.unshift(l),this.rows.unshift(l)):(this.displayRowIterator(function(t){t.push(l)}),this.activeRows.push(l),this.rows.push(l)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,l.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),l},RowManager.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(e),to:e,after:o}),this.moveRowActual(t,e,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())},RowManager.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator(function(n){i._moveRowInArray(n,t,e,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&e instanceof Group&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e.getGroup(),s=t.getGroup();n===s?this._moveRowInArray(n.rows,t,e,o):(s&&s.removeRow(t),n.insertRow(t,e,o))}},RowManager.prototype._moveRowInArray=function(t,e,o,i){var n,s,l,a;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),s=t.indexOf(o),s>-1?i?t.splice(s+1,0,e):t.splice(s,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){l=nn?s:n+1;for(var r=l;r<=a;r++)t[r]&&this.styleRow(t[r],r)}},RowManager.prototype.clearData=function(){this.setData([])},RowManager.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},RowManager.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},RowManager.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},RowManager.prototype.getData=function(t,e){var o=[];return this.getRows(t).forEach(function(t){"row"==t.type&&o.push(t.getData(e||"data"))}),o},RowManager.prototype.getComponents=function(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e},RowManager.prototype.getDataCount=function(t){return this.getRows(t).length},RowManager.prototype._genRemoteRequest=function(){var t=this,e=this.table,o=e.options,i={};if(e.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(t){delete t.column}),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t._setDataActual(e,!0)}).catch(function(t){})},RowManager.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):e.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},RowManager.prototype.sorterRefresh=function(t){var e=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(i)},RowManager.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)},RowManager.prototype.refreshActiveData=function(t,e,o){var i,n=this,s=this.table,l=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||l.indexOf(t)=0))break;s=a}else if(e-l[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-l[a].getElement().offsetTop>=0))break;s=a}}else n=this.vDomTop,s=this.vDomBottom;return l.slice(n,s+1)},RowManager.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},RowManager.prototype.getRows=function(t){var e;switch(t){case"active":e=this.activeRows;break;case"display":e=this.table.rowManager.getDisplayRows();break;case"visible":e=this.getVisibleRows(!0);break;default:e=this.rows}return e},RowManager.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode())if(this.redrawBlock)t?t():this.redrawBlockRederInPosition=!0;else{for(var e=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),l=this.vDomTop;l<=this.vDomBottom;l++)if(s[l]){var a=e-s[l].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*f),"group"!==m.type&&(c=!1),i.vDomBottom++,u++}t?(i.vDomTopPad=e?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-r,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-r,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+r)/u),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=r+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",e&&(this.scrollTop=i.vDomTopPad+r+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&e&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=c?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},RowManager.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else t?(e<0&&this._addTopRow(-e),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(e>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(e):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},RowManager.prototype._addTopRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],l=s.getHeight()||this.vDomRowHeight;t>=l&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=l,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=l,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},RowManager.prototype._removeTopRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,e.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}},RowManager.prototype._addBottomRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=l&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=l,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=l,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),e=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},RowManager.prototype._removeBottomRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),e.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}},RowManager.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},RowManager.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},RowManager.prototype.adjustTableSize=function(){var t,e=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,this.fixedHeight||e==this.element.clientHeight||((t=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!t)&&this.redraw()}},RowManager.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},RowManager.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},RowManager.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1},RowManager.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},RowManager.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var RowComponent=function(t){this._row=t};RowComponent.prototype.getData=function(t){return this._row.getData(t)},RowComponent.prototype.getElement=function(){return this._row.getElement()},RowComponent.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},RowComponent.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},RowComponent.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},RowComponent.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},RowComponent.prototype.delete=function(){return this._row.delete()},RowComponent.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},RowComponent.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},RowComponent.prototype.move=function(t,e){this._row.moveToRow(t,e)},RowComponent.prototype.update=function(t){return this._row.updateData(t)},RowComponent.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},RowComponent.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},RowComponent.prototype.deselect=function(){ -this._row.table.modules.selectRow.deselectRows(this._row)},RowComponent.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},RowComponent.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},RowComponent.prototype._getSelf=function(){return this._row},RowComponent.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},RowComponent.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},RowComponent.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},RowComponent.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},RowComponent.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},RowComponent.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},RowComponent.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},RowComponent.prototype.reformat=function(){return this._row.reinitialize()},RowComponent.prototype.getGroup=function(){return this._row.getGroup().getComponent()},RowComponent.prototype.getTable=function(){return this._row.table},RowComponent.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},RowComponent.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var Row=function(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=e.table,this.parent=e,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(t),this.generateElement()};Row.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},Row.prototype.getElement=function(){return this.element},Row.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},Row.prototype.generateElement=function(){var t,e,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},Row.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},Row.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},Row.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},Row.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},Row.prototype.calcHeight=function(t){var e=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(t){var o=t.getHeight();o>e&&(e=o)}),this.height=t?Math.max(e,o):this.manualHeight?this.height:Math.max(e,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},Row.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},Row.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},Row.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},Row.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},Row.prototype.getHeight=function(){return this.outerHeight},Row.prototype.getWidth=function(){return this.element.offsetWidth},Row.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Row.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},Row.prototype.updateData=function(t){var e,o=this,i=Tabulator.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,l){"string"==typeof t&&(t=JSON.parse(t)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,t),e=o.table.modules.mutator.transformRow(n,"data",t)):e=t;for(var a in e)o.data[a]=e[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in t){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(t){var n=o.getCell(t.getField());if(n){var s=t.getFieldValue(e);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(t)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()})},Row.prototype.getData=function(t){var e=this;return t?e.table.modExists("accessor")?e.table.modules.accessor.transformRow(e.data,t):void 0:this.data},Row.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},Row.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},Row.prototype.findNextEditableCell=function(t){var e=!1;if(t0)for(var o=t-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&Tabulator.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){e=i;break}}return e},Row.prototype.getCells=function(){return this.cells},Row.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},Row.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},Row.prototype.moveToRow=function(t,e){var o=this.table.rowManager.findRow(t);o?(this.table.rowManager.moveRowActual(this,o,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)},Row.prototype.delete=function(){var t=this;return new Promise(function(e,o){var i,n;t.table.options.history&&t.table.modExists("history")&&(t.table.options.groupBy&&t.table.modExists("groupRows")?(n=t.getGroup().rows,(i=n.indexOf(t))&&(i=n[i-1])):(i=t.table.rowManager.getRowIndex(t))&&(i=t.table.rowManager.rows[i-1]),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})),t.deleteActual(),e()})},Row.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},Row.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))},Tabulator.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},Tabulator.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},Tabulator.prototype.setDataFromLocalFile=function(t){var e=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=t||".json,application/json",n.addEventListener("change",function(t){var s,l=n.files[0],a=new FileReader;a.readAsText(l),a.onload=function(t){try{s=JSON.parse(a.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(s).then(function(t){o(t)}).catch(function(t){o(t)})},a.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},Tabulator.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!1,!0)},Tabulator.prototype._setData=function(t,e,o,i,n){var s=this;return"string"!=typeof t?t?s.rowManager.setData(t,i,n):s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n):0==t.indexOf("{")||0==t.indexOf("[")?s.rowManager.setData(JSON.parse(t),i,n):s.modExists("ajax",!0)?(e&&s.modules.ajax.setParams(e),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(t),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)):void 0},Tabulator.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},Tabulator.prototype.getData=function(t){return!0===t&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getData(t)},Tabulator.prototype.getDataCount=function(t){return!0===t&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getDataCount(t)},Tabulator.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},Tabulator.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},Tabulator.prototype.getHtml=function(t,e,o){if(this.modExists("export",!0))return this.modules.export.getHtml(t,e,o)},Tabulator.prototype.print=function(t,e,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,e,o)},Tabulator.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},Tabulator.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},Tabulator.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,s){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);e&&(i++,e.updateData(t).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},Tabulator.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?i.rowManager.addRows(t,e,o).then(function(t){var e=[];t.forEach(function(t){e.push(t.getComponent())}),n(e)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},Tabulator.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(s,l){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||s(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),l("Update Error - No data provided"))})},Tabulator.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.prototype.getRowFromPosition=function(t,e){var o=this.rowManager.getRowFromPosition(t,e);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){function n(){++l==t.length&&a&&(s.rowManager.reRenderInPosition(),o())}var s=e,l=0,a=0,r=[];Array.isArray(t)||(t=[t]),t.forEach(function(t){var o=e.rowManager.findRow(t,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"),n())}),r.sort(function(t,o){return e.rowManager.rows.indexOf(t)>e.rowManager.rows.indexOf(o)?1:-1}),r.forEach(function(t){t.delete().then(function(){a++,n()}).catch(function(t){n(),i(t)})})})},Tabulator.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,s){"string"==typeof t&&(t=JSON.parse(t)),i.rowManager.addRows(t,e,o).then(function(t){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(t[0].getComponent())})})},Tabulator.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(t){n(t)}):s=o.rowManager.addRows(e).then(function(t){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(t[0].getComponent())}).catch(function(t){n(t)})})},Tabulator.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),s?s.updateData(e).then(function(){i(s.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},Tabulator.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,s){var l=i.rowManager.findRow(t);l?i.rowManager.scrollToRow(l,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching row found:",t),s("Scroll Error - No matching row found"))})},Tabulator.prototype.moveRow=function(t,e,o){var i=this.rowManager.findRow(t);i?i.moveToRow(e,o):console.warn("Move Error - No matching row found:",t)},Tabulator.prototype.getRows=function(t){return!0===t&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getComponents(t)},Tabulator.prototype.getRowPosition=function(t,e){var o=this.rowManager.findRow(t);return o?this.rowManager.getRowPosition(o,e):(console.warn("Position Error - No matching row found:",t),!1)},Tabulator.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)},Tabulator.prototype.setColumns=function(t){this.columnManager.setColumns(t)},Tabulator.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},Tabulator.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},Tabulator.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},Tabulator.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},Tabulator.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},Tabulator.prototype.showColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},Tabulator.prototype.hideColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},Tabulator.prototype.toggleColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},Tabulator.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var l=i.columnManager.findColumn(o);i.columnManager.addColumn(t,e,l).then(function(t){n(t.getComponent())}).catch(function(t){s(t)})})},Tabulator.prototype.deleteColumn=function(t){var e=this;return new Promise(function(o,i){var n=e.columnManager.findColumn(t);n?n.delete().then(function(){o()}).catch(function(t){i(t)}):(console.warn("Column Delete Error - No matching column found:",t),i())})},Tabulator.prototype.updateColumnDefinition=function(t,e){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(t);s?s.updateDefinition(e).then(function(t){i(t)}).catch(function(t){n(t)}):(console.warn("Column Update Error - No matching column found:",t),n())})},Tabulator.prototype.moveColumn=function(t,e,o){var i=this.columnManager.findColumn(t),n=this.columnManager.findColumn(e);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",t)},Tabulator.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,s){var l=i.columnManager.findColumn(t);l?i.columnManager.scrollToColumn(l,e,o).then(function(){n()}).catch(function(t){s(t)}):(console.warn("Scroll Error - No matching column found:",t),s("Scroll Error - No matching column found"))})},Tabulator.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},Tabulator.prototype.getLocale=function(){return this.modules.localize.getLocale()},Tabulator.prototype.getLang=function(t){return this.modules.localize.getLang(t)},Tabulator.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},Tabulator.prototype.setHeight=function(t){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")},Tabulator.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},Tabulator.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},Tabulator.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},Tabulator.prototype.setFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.addFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},Tabulator.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterFocus(e)}},Tabulator.prototype.getHeaderFilterValue=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(e)return this.modules.filter.getHeaderFilterValue(e);console.warn("Column Filter Error - No matching column found:",t)}},Tabulator.prototype.setHeaderFilterValue=function(t,e){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(!o)return console.warn("Column Filter Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterValue(o,e)}},Tabulator.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},Tabulator.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},Tabulator.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},Tabulator.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&(!0===t&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),t="active"),this.modules.selectRow.selectRows(t))},Tabulator.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},Tabulator.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},Tabulator.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},Tabulator.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},Tabulator.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},Tabulator.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},Tabulator.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){e.options.pagination&&e.modExists("page")?(t=e.rowManager.findRow(t),t?e.modules.page.setPageToRow(t).then(function(){o()}).catch(function(){i()}):i()):i()})},Tabulator.prototype.setPageSize=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){})},Tabulator.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},Tabulator.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},Tabulator.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},Tabulator.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},Tabulator.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},Tabulator.prototype.setGroupBy=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},Tabulator.prototype.setGroupStartOpen=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},Tabulator.prototype.setGroupHeader=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},Tabulator.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},Tabulator.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},Tabulator.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},Tabulator.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},Tabulator.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},Tabulator.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},Tabulator.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},Tabulator.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},Tabulator.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},Tabulator.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},Tabulator.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},Tabulator.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},Tabulator.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},Tabulator.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},Tabulator.prototype.download=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i)},Tabulator.prototype.downloadToTab=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i,!0)},Tabulator.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},Tabulator.prototype.moduleBindings={},Tabulator.prototype.extendModule=function(t,e,o){if(Tabulator.prototype.moduleBindings[t]){var i=Tabulator.prototype.moduleBindings[t].prototype[e];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)},Tabulator.prototype.registerModule=function(t,e){Tabulator.prototype.moduleBindings[t]=e},Tabulator.prototype.bindModules=function(){this.modules={};for(var t in Tabulator.prototype.moduleBindings)this.modules[t]=new Tabulator.prototype.moduleBindings[t](this)},Tabulator.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},Tabulator.prototype.helpers={elVisible:function(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)},elOffset:function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(t){var e=Array.isArray(t)?[]:{};for(var o in t)null!=t[o]&&"object"===_typeof(t[o])?t[o]instanceof Date?e[o]=new Date(t[o]):e[o]=this.deepClone(t[o]):e[o]=t[o];return e}},Tabulator.prototype.comms={tables:[],register:function(t){Tabulator.prototype.comms.tables.push(t)},deregister:function(t){var e=Tabulator.prototype.comms.tables.indexOf(t);e>-1&&Tabulator.prototype.comms.tables.splice(e,1)},lookupTable:function(t,e){var o,i,n=[];if("string"==typeof t){if(o=document.querySelectorAll(t),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t){function e(t){return"string"==typeof t?t.indexOf("%")>-1?n/100*parseInt(t):parseInt(t):t}function o(t,i,n,s){function l(t){return n*(t.column.definition.widthGrow||1)}function a(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var r=[],u=0,c=0,h=0,p=0,d=0,m=[];return t.forEach(function(t,e){var o=s?a(t):l(t) -;t.column.minWidth>=o?r.push(t):(m.push(t),d+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),r.length?(r.forEach(function(t){u+=s?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),c=i-u,h=d?Math.floor(c/d):c,p=c-h*d,p+=o(m,c,h,s)):(p=d?i-Math.floor(i/d)*d:i,m.forEach(function(t){t.width=s?a(t):l(t)})),p}var i=this,n=i.table.element.clientWidth,s=0,l=0,a=0,r=0,u=[],c=[],h=0,p=0,d=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),s+=n>i?n:i,t.definition.widthShrink&&(c.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(u.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),l=n-s,r=Math.floor(l/a);var d=o(u,l,r,!1);u.length&&d>0&&(u[u.length-1].width+=+d),u.forEach(function(t){l-=t.width}),p=Math.abs(d)+l,p>0&&h&&(d=o(c,p,Math.floor(p/h),!0)),c.length&&(c[c.length-1].width-=d),u.forEach(function(t){t.column.setWidth(t.width)}),c.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.prototype.registerModule("layout",Layout);var Localize=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};Localize.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},Localize.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},Localize.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},Localize.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},Localize.prototype.setLocale=function(t){function e(t,o){for(var i in t)"object"==_typeof(t[i])?(o[i]||(o[i]={}),e(t[i],o[i])):o[i]=t[i]}var o=this;if(t=t||"default",!0===t&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langs[t]){var i=t.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=Tabulator.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},Localize.prototype.getLocale=function(t){return self.locale},Localize.prototype.getLang=function(t){return t?this.langs[t]:this.lang},Localize.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},Localize.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},Localize.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},Localize.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},Localize.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},Tabulator.prototype.registerModule("localize",Localize);var Comms=function(t){this.table=t};Comms.prototype.getConnections=function(t){var e,o=this,i=[];return e=Tabulator.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},Comms.prototype.send=function(t,e,o,i){var n=this,s=this.getConnections(t);s.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},Comms.prototype.receive=function(t,e,o,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such module:",e)},Tabulator.prototype.registerModule("comms",Comms); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/accessor.js b/app/static/vendors/tabulator/js/modules/accessor.js deleted file mode 100644 index 8ffe1bf..0000000 --- a/app/static/vendors/tabulator/js/modules/accessor.js +++ /dev/null @@ -1,93 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Accessor = function Accessor(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"]; //list of accessor types -}; - -//initialize column accessor -Accessor.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)), - accessor; - - if (column.definition[key]) { - accessor = self.lookupAccessor(column.definition[key]); - - if (accessor) { - match = true; - - config[key] = { - accessor: accessor, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.accessor = config; - } -}; - -Accessor.prototype.lookupAccessor = function (value) { - var accessor = false; - - //set column accessor - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - if (this.accessors[value]) { - accessor = this.accessors[value]; - } else { - console.warn("Accessor Error - No such accessor found, ignoring: ", value); - } - break; - - case "function": - accessor = value; - break; - } - - return accessor; -}; - -//apply accessor to row -Accessor.prototype.transformRow = function (dataIn, type) { - var self = this, - key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)); - - //clone data object with deep copy to isolate internal data from returned result - var data = Tabulator.prototype.helpers.deepClone(dataIn || {}); - - self.table.columnManager.traverse(function (column) { - var value, accessor, params, component; - - if (column.modules.accessor) { - - accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false; - - if (accessor) { - value = column.getFieldValue(data); - - if (value != "undefined") { - component = column.getComponent(); - params = typeof accessor.params === "function" ? accessor.params(value, data, type, component) : accessor.params; - column.setFieldValue(data, accessor.accessor(value, data, type, params, component)); - } - } - } - }); - - return data; -}, - -//default accessors -Accessor.prototype.accessors = {}; - -Tabulator.prototype.registerModule("accessor", Accessor); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/accessor.min.js b/app/static/vendors/tabulator/js/modules/accessor.min.js deleted file mode 100644 index 2633b8f..0000000 --- a/app/static/vendors/tabulator/js/modules/accessor.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Accessor=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};Accessor.prototype.initializeColumn=function(o){var e=this,s=!1,r={};this.allowedTypes.forEach(function(t){var c,a="accessor"+(t.charAt(0).toUpperCase()+t.slice(1));o.definition[a]&&(c=e.lookupAccessor(o.definition[a]))&&(s=!0,r[a]={accessor:c,params:o.definition[a+"Params"]||{}})}),s&&(o.modules.accessor=r)},Accessor.prototype.lookupAccessor=function(o){var e=!1;switch(void 0===o?"undefined":_typeof(o)){case"string":this.accessors[o]?e=this.accessors[o]:console.warn("Accessor Error - No such accessor found, ignoring: ",o);break;case"function":e=o}return e},Accessor.prototype.transformRow=function(o,e){var s=this,r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),t=Tabulator.prototype.helpers.deepClone(o||{});return s.table.columnManager.traverse(function(o){var s,c,a,n;o.modules.accessor&&(c=o.modules.accessor[r]||o.modules.accessor.accessor||!1)&&"undefined"!=(s=o.getFieldValue(t))&&(n=o.getComponent(),a="function"==typeof c.params?c.params(s,t,e,n):c.params,o.setFieldValue(t,c.accessor(s,t,e,a,n)))}),t},Accessor.prototype.accessors={},Tabulator.prototype.registerModule("accessor",Accessor); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/ajax.js b/app/static/vendors/tabulator/js/modules/ajax.js deleted file mode 100644 index 7d72604..0000000 --- a/app/static/vendors/tabulator/js/modules/ajax.js +++ /dev/null @@ -1,465 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Ajax = function Ajax(table) { - - this.table = table; //hold Tabulator object - this.config = false; //hold config object for ajax request - this.url = ""; //request URL - this.urlGenerator = false; - this.params = false; //request parameters - - this.loaderElement = this.createLoaderElement(); //loader message div - this.msgElement = this.createMsgElement(); //message element - this.loadingElement = false; - this.errorElement = false; - this.loaderPromise = false; - - this.progressiveLoad = false; - this.loading = false; - - this.requestOrder = 0; //prevent requests comming out of sequence if overridden by another load request -}; - -//initialize setup options -Ajax.prototype.initialize = function () { - var template; - - this.loaderElement.appendChild(this.msgElement); - - if (this.table.options.ajaxLoaderLoading) { - if (typeof this.table.options.ajaxLoaderLoading == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderLoading.trim(); - this.loadingElement = template.content.firstChild; - } else { - this.loadingElement = this.table.options.ajaxLoaderLoading; - } - } - - this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise; - - this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator; - - if (this.table.options.ajaxLoaderError) { - if (typeof this.table.options.ajaxLoaderError == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderError.trim(); - this.errorElement = template.content.firstChild; - } else { - this.errorElement = this.table.options.ajaxLoaderError; - } - } - - if (this.table.options.ajaxParams) { - this.setParams(this.table.options.ajaxParams); - } - - if (this.table.options.ajaxConfig) { - this.setConfig(this.table.options.ajaxConfig); - } - - if (this.table.options.ajaxURL) { - this.setUrl(this.table.options.ajaxURL); - } - - if (this.table.options.ajaxProgressiveLoad) { - if (this.table.options.pagination) { - this.progressiveLoad = false; - console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"); - } else { - if (this.table.modExists("page")) { - this.progressiveLoad = this.table.options.ajaxProgressiveLoad; - this.table.modules.page.initializeProgressive(this.progressiveLoad); - } else { - console.error("Pagination plugin is required for progressive ajax loading"); - } - } - } -}; - -Ajax.prototype.createLoaderElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-loader"); - return el; -}; - -Ajax.prototype.createMsgElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-loader-msg"); - el.setAttribute("role", "alert"); - - return el; -}; - -//set ajax params -Ajax.prototype.setParams = function (params, update) { - if (update) { - this.params = this.params || {}; - - for (var key in params) { - this.params[key] = params[key]; - } - } else { - this.params = params; - } -}; - -Ajax.prototype.getParams = function () { - return this.params || {}; -}; - -//load config object -Ajax.prototype.setConfig = function (config) { - this._loadDefaultConfig(); - - if (typeof config == "string") { - this.config.method = config; - } else { - for (var key in config) { - this.config[key] = config[key]; - } - } -}; - -//create config object from default -Ajax.prototype._loadDefaultConfig = function (force) { - var self = this; - if (!self.config || force) { - - self.config = {}; - - //load base config from defaults - for (var key in self.defaultConfig) { - self.config[key] = self.defaultConfig[key]; - } - } -}; - -//set request url -Ajax.prototype.setUrl = function (url) { - this.url = url; -}; - -//get request url -Ajax.prototype.getUrl = function () { - return this.url; -}; - -//lstandard loading function -Ajax.prototype.loadData = function (inPosition, columnsChanged) { - var self = this; - - if (this.progressiveLoad) { - return this._loadDataProgressive(); - } else { - return this._loadDataStandard(inPosition, columnsChanged); - } -}; - -Ajax.prototype.nextPage = function (diff) { - var margin; - - if (!this.loading) { - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.getElement().clientHeight * 2; - - if (diff < margin) { - this.table.modules.page.nextPage().then(function () {}).catch(function () {}); - } - } -}; - -Ajax.prototype.blockActiveRequest = function () { - this.requestOrder++; -}; - -Ajax.prototype._loadDataProgressive = function () { - this.table.rowManager.setData([]); - return this.table.modules.page.setPage(1); -}; - -Ajax.prototype._loadDataStandard = function (inPosition, columnsChanged) { - var _this = this; - - return new Promise(function (resolve, reject) { - _this.sendRequest(inPosition).then(function (data) { - _this.table.rowManager.setData(data, inPosition, columnsChanged).then(function () { - resolve(); - }).catch(function (e) { - reject(e); - }); - }).catch(function (e) { - reject(e); - }); - }); -}; - -Ajax.prototype.generateParamsList = function (data, prefix) { - var self = this, - output = []; - - prefix = prefix || ""; - - if (Array.isArray(data)) { - data.forEach(function (item, i) { - output = output.concat(self.generateParamsList(item, prefix ? prefix + "[" + i + "]" : i)); - }); - } else if ((typeof data === "undefined" ? "undefined" : _typeof(data)) === "object") { - for (var key in data) { - output = output.concat(self.generateParamsList(data[key], prefix ? prefix + "[" + key + "]" : key)); - } - } else { - output.push({ key: prefix, value: data }); - } - - return output; -}; - -Ajax.prototype.serializeParams = function (params) { - var output = this.generateParamsList(params), - encoded = []; - - output.forEach(function (item) { - encoded.push(encodeURIComponent(item.key) + "=" + encodeURIComponent(item.value)); - }); - - return encoded.join("&"); -}; - -//send ajax request -Ajax.prototype.sendRequest = function (silent) { - var _this2 = this; - - var self = this, - url = self.url, - requestNo, - esc, - query; - - self.requestOrder++; - requestNo = self.requestOrder; - - self._loadDefaultConfig(); - - return new Promise(function (resolve, reject) { - if (self.table.options.ajaxRequesting.call(_this2.table, self.url, self.params) !== false) { - - self.loading = true; - - if (!silent) { - self.showLoader(); - } - - _this2.loaderPromise(url, self.config, self.params).then(function (data) { - if (requestNo === self.requestOrder) { - if (self.table.options.ajaxResponse) { - data = self.table.options.ajaxResponse.call(self.table, self.url, self.params, data); - } - resolve(data); - - self.hideLoader(); - self.loading = false; - } else { - console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"); - } - }).catch(function (error) { - console.error("Ajax Load Error: ", error); - self.table.options.ajaxError.call(self.table, error); - - self.showError(); - - setTimeout(function () { - self.hideLoader(); - }, 3000); - - self.loading = false; - - reject(); - }); - } else { - reject(); - } - }); -}; - -Ajax.prototype.showLoader = function () { - var shouldLoad = typeof this.table.options.ajaxLoader === "function" ? this.table.options.ajaxLoader() : this.table.options.ajaxLoader; - - if (shouldLoad) { - - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-error"); - this.msgElement.classList.add("tabulator-loading"); - - if (this.loadingElement) { - this.msgElement.appendChild(this.loadingElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|loading"); - } - - this.table.element.appendChild(this.loaderElement); - } -}; - -Ajax.prototype.showError = function () { - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-loading"); - this.msgElement.classList.add("tabulator-error"); - - if (this.errorElement) { - this.msgElement.appendChild(this.errorElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|error"); - } - - this.table.element.appendChild(this.loaderElement); -}; - -Ajax.prototype.hideLoader = function () { - if (this.loaderElement.parentNode) { - this.loaderElement.parentNode.removeChild(this.loaderElement); - } -}; - -//default ajax config object -Ajax.prototype.defaultConfig = { - method: "GET" -}; - -Ajax.prototype.defaultURLGenerator = function (url, config, params) { - - if (url) { - if (params && Object.keys(params).length) { - if (!config.method || config.method.toLowerCase() == "get") { - config.method = "get"; - - url += (url.includes("?") ? "&" : "?") + this.serializeParams(params); - } - } - } - - return url; -}; - -Ajax.prototype.defaultLoaderPromise = function (url, config, params) { - var self = this, - contentType; - - return new Promise(function (resolve, reject) { - - //set url - url = self.urlGenerator(url, config, params); - - //set body content if not GET request - if (config.method.toUpperCase() != "GET") { - contentType = _typeof(self.table.options.ajaxContentType) === "object" ? self.table.options.ajaxContentType : self.contentTypeFormatters[self.table.options.ajaxContentType]; - if (contentType) { - - for (var key in contentType.headers) { - if (!config.headers) { - config.headers = {}; - } - - if (typeof config.headers[key] === "undefined") { - config.headers[key] = contentType.headers[key]; - } - } - - config.body = contentType.body.call(self, url, config, params); - } else { - console.warn("Ajax Error - Invalid ajaxContentType value:", self.table.options.ajaxContentType); - } - } - - if (url) { - - //configure headers - if (typeof config.headers === "undefined") { - config.headers = {}; - } - - if (typeof config.headers.Accept === "undefined") { - config.headers.Accept = "application/json"; - } - - if (typeof config.headers["X-Requested-With"] === "undefined") { - config.headers["X-Requested-With"] = "XMLHttpRequest"; - } - - if (typeof config.mode === "undefined") { - config.mode = "cors"; - } - - if (config.mode == "cors") { - - if (typeof config.headers["Access-Control-Allow-Origin"] === "undefined") { - config.headers["Access-Control-Allow-Origin"] = window.location.origin; - } - - if (typeof config.credentials === "undefined") { - config.credentials = 'same-origin'; - } - } else { - if (typeof config.credentials === "undefined") { - config.credentials = 'include'; - } - } - - //send request - fetch(url, config).then(function (response) { - if (response.ok) { - response.json().then(function (data) { - resolve(data); - }).catch(function (error) { - reject(error); - console.warn("Ajax Load Error - Invalid JSON returned", error); - }); - } else { - console.error("Ajax Load Error - Connection Error: " + response.status, response.statusText); - reject(response); - } - }).catch(function (error) { - console.error("Ajax Load Error - Connection Error: ", error); - reject(error); - }); - } else { - console.warn("Ajax Load Error - No URL Set"); - resolve([]); - } - }); -}; - -Ajax.prototype.contentTypeFormatters = { - "json": { - headers: { - 'Content-Type': 'application/json' - }, - body: function body(url, config, params) { - return JSON.stringify(params); - } - }, - "form": { - headers: {}, - body: function body(url, config, params) { - var output = this.generateParamsList(params), - form = new FormData(); - - output.forEach(function (item) { - form.append(item.key, item.value); - }); - - return form; - } - } -}; - -Tabulator.prototype.registerModule("ajax", Ajax); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/ajax.min.js b/app/static/vendors/tabulator/js/modules/ajax.min.js deleted file mode 100644 index a5dae29..0000000 --- a/app/static/vendors/tabulator/js/modules/ajax.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ajax=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};Ajax.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},Ajax.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},Ajax.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},Ajax.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},Ajax.prototype.getParams=function(){return this.params||{}},Ajax.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},Ajax.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},Ajax.prototype.setUrl=function(e){this.url=e},Ajax.prototype.getUrl=function(){return this.url},Ajax.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},Ajax.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,e output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "min": function min(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value < output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "sum": function sum(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - if (values.length) { - values.forEach(function (value) { - value = Number(value); - - output += !isNaN(value) ? Number(value) : 0; - }); - } - - return precision !== false ? output.toFixed(precision) : output; - }, - "concat": function concat(values, data, calcParams) { - var output = 0; - - if (values.length) { - output = values.reduce(function (sum, value) { - return String(sum) + String(value); - }); - } - - return output; - }, - "count": function count(values, data, calcParams) { - var output = 0; - - if (values.length) { - values.forEach(function (value) { - if (value) { - output++; - } - }); - } - - return output; - } -}; - -Tabulator.prototype.registerModule("columnCalcs", ColumnCalcs); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/calculation_colums.min.js b/app/static/vendors/tabulator/js/modules/calculation_colums.min.js deleted file mode 100644 index 33464d5..0000000 --- a/app/static/vendors/tabulator/js/modules/calculation_colums.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ColumnCalcs=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};ColumnCalcs.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},ColumnCalcs.prototype.initialize=function(){this.genColumn=new Column({field:"value"},this)},ColumnCalcs.prototype.registerColumnField=function(){},ColumnCalcs.prototype.initializeColumn=function(t){var o=t.definition,e={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(_typeof(o.topCalc)){case"string":this.calculations[o.topCalc]?e.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":e.topCalc=o.topCalc}e.topCalc&&(t.modules.columnCalcs=e,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(o.bottomCalc){switch(_typeof(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?e.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":e.botCalc=o.bottomCalc}e.botCalc&&(t.modules.columnCalcs=e,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},ColumnCalcs.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},ColumnCalcs.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},ColumnCalcs.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},ColumnCalcs.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},ColumnCalcs.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},ColumnCalcs.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},ColumnCalcs.prototype.recalcAll=function(){var t=this;if((this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalc(this.table.rowManager.activeRows),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs)){table.modules.groupRows.getChildGroups().forEach(function(o){t.recalcGroup(o)})}},ColumnCalcs.prototype.recalcGroup=function(t){var o,e;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),e=this.generateRowData("bottom",o),t.calcs.bottom.updateData(e),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),e=this.generateRowData("top",o),t.calcs.top.updateData(e),t.calcs.top.reinitialize()))},ColumnCalcs.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},ColumnCalcs.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},ColumnCalcs.prototype.rowsToData=function(t){var o=this,e=[];return t.forEach(function(t){if(e.push(t.getData()),o.table.options.dataTree&&o.table.options.dataTreeChildColumnCalcs&&t.modules.dataTree.open){var l=o.rowsToData(o.table.modules.dataTree.getFilteredTreeChildren(t));e=e.concat(l)}}),e},ColumnCalcs.prototype.generateRow=function(t,o){var e,l=this,i=this.generateRowData(t,o);return l.table.modExists("mutator")&&l.table.modules.mutator.disable(),e=new Row(i,this,"calc"),l.table.modExists("mutator")&&l.table.modules.mutator.enable(),e.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),e.generateCells=function(){var o=[];l.table.columnManager.columnsByIndex.forEach(function(i){l.genColumn.setField(i.getField()),l.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&l.table.modExists("format")?l.genColumn.modules.format={formatter:l.table.modules.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]}:l.genColumn.modules.format={formatter:l.table.modules.format.getFormatter("plaintext"),params:{}},l.genColumn.definition.cssClass=i.definition.cssClass;var a=new Cell(l.genColumn,e);a.column=i,a.setWidth(),i.cells.push(a),o.push(a),i.visible||a.hide()}),this.cells=o},e},ColumnCalcs.prototype.generateRowData=function(t,o){var e,l,i={},a="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return a.forEach(function(t){var a=[];t.modules.columnCalcs&&t.modules.columnCalcs[n]&&(o.forEach(function(o){a.push(t.getFieldValue(o))}),l=n+"Params",e="function"==typeof t.modules.columnCalcs[l]?t.modules.columnCalcs[l](a,o):t.modules.columnCalcs[l],t.setFieldValue(i,t.modules.columnCalcs[n](a,o,e)))}),i},ColumnCalcs.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},ColumnCalcs.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},ColumnCalcs.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},ColumnCalcs.prototype.getResults=function(){var t,o=this,e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(function(t){e[t.getKey()]=o.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e},ColumnCalcs.prototype.getGroupResults=function(t){var o=this,e=t._getSelf(),l=t.getSubGroups(),i={};return l.forEach(function(t){i[t.getKey()]=o.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:i}},ColumnCalcs.prototype.calculations={avg:function(t,o,e){var l=0,i=void 0!==e.precision?e.precision:2;return t.length&&(l=t.reduce(function(t,o){return o=Number(o),t+o}),l/=t.length,l=!1!==i?l.toFixed(i):l),parseFloat(l).toString()},max:function(t,o,e){var l=null,i=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))>l||null===l)&&(l=t)}),null!==l?!1!==i?l.toFixed(i):l:""},min:function(t,o,e){var l=null,i=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))"),a.dataTreeExpandElement?"string"==typeof a.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=a.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=a.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),_typeof(a.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return a.dataTreeStartExpanded};break;case"function":this.startOpen=a.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return a.dataTreeStartExpanded[t]}}},DataTree.prototype.initializeRow=function(e){var t=e.getData()[this.field],a=Array.isArray(t),n=a||!a&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!n&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!n&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!n&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!n)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!n)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:n}},DataTree.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],a=t.getElement(),n=e.modules.dataTree;n.branchEl&&(n.branchEl.parentNode&&n.branchEl.parentNode.removeChild(n.branchEl),n.branchEl=!1),n.controlEl&&(n.controlEl.parentNode&&n.controlEl.parentNode.removeChild(n.controlEl),n.controlEl=!1),this.generateControlElement(e,a),e.element.classList.add("tabulator-tree-level-"+n.index),n.index&&(this.branchEl?(n.branchEl=this.branchEl.cloneNode(!0),a.insertBefore(n.branchEl,a.firstChild),n.branchEl.style.marginLeft=(n.branchEl.offsetWidth+n.branchEl.style.marginRight)*(n.index-1)+n.index*this.indent+"px"):a.style.paddingLeft=parseInt(window.getComputedStyle(a,null).getPropertyValue("padding-left"))+n.index*this.indent+"px")},DataTree.prototype.generateControlElement=function(e,t){var a=this,n=e.modules.dataTree,t=t||e.getCells()[0].getElement(),r=n.controlEl;!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.collapseRow(e)})):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.expandRow(e)})),n.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),r&&r.parentNode===t?r.parentNode.replaceChild(n.controlEl,r):t.insertBefore(n.controlEl,t.firstChild))},DataTree.prototype.setDisplayIndex=function(e){this.displayIndex=e},DataTree.prototype.getDisplayIndex=function(){return this.displayIndex},DataTree.prototype.getRows=function(e){var t=this,a=[];return e.forEach(function(e,n){var r,l;a.push(e),e instanceof Row&&(r=e.modules.dataTree.children,r.index||!1===r.children||(l=t.getChildren(e),l.forEach(function(e){a.push(e)})))}),a},DataTree.prototype.getChildren=function(e){var t=this,a=e.modules.dataTree,n=[],r=[];return!1!==a.children&&a.open&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),n=this.table.modExists("filter")?this.table.modules.filter.filter(a.children):a.children,this.table.modExists("sort")&&this.table.modules.sort.sort(n),n.forEach(function(e){r.push(e),t.getChildren(e).forEach(function(e){r.push(e)})})),r},DataTree.prototype.generateChildren=function(e){var t=this,a=[],n=e.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach(function(n){var r=new Row(n||{},t.table.rowManager);r.modules.dataTree.index=e.modules.dataTree.index+1,r.modules.dataTree.parent=e,r.modules.dataTree.children&&(r.modules.dataTree.open=t.startOpen(r.getComponent(),r.modules.dataTree.index)),a.push(r)}),a},DataTree.prototype.expandRow=function(e,t){var a=e.modules.dataTree;!1!==a.children&&(a.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},DataTree.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},DataTree.prototype.getFilteredTreeChildren=function(e){var t,a=e.modules.dataTree,n=[];return a.children&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(a.children):a.children,t.forEach(function(e){e instanceof Row&&n.push(e)})),n},DataTree.prototype.rowDelete=function(e){var t,a=e.modules.dataTree.parent;a&&(t=this.findChildIndex(e,a),!1!==t&&a.data[this.field].splice(t,1),a.data[this.field].length||delete a.data[this.field],this.initializeRow(a),this.layoutRow(a)),this.table.rowManager.refreshActiveData("tree",!1,!0)},DataTree.prototype.addTreeChildRow=function(e,t,a,n){var r=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==n&&!1!==(r=this.findChildIndex(n,e))&&e.data[this.field].splice(a?r:r+1,0,t),!1===r&&(a?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},DataTree.prototype.findChildIndex=function(e,t){var a=this,n=!1;return"object"==(void 0===e?"undefined":_typeof(e))?e instanceof Row?n=e.data:e instanceof RowComponent?n=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(n=t.modules.dataTree.children.find(function(t){return t instanceof Row&&t.element===e}))&&(n=n.data):n=void 0!==e&&null!==e&&t.data[this.field].find(function(t){return t.data[a.table.options.index]==e}),n&&(Array.isArray(t.data[this.field])&&(n=t.data[this.field].indexOf(n)),-1==n&&(n=!1)),n},DataTree.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,a=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof Row&&a.push(e.getComponent())})),a},DataTree.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},DataTree.prototype.getChildField=function(){return this.field},DataTree.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},Tabulator.prototype.registerModule("dataTree",DataTree); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/download.js b/app/static/vendors/tabulator/js/modules/download.js deleted file mode 100644 index 9954910..0000000 --- a/app/static/vendors/tabulator/js/modules/download.js +++ /dev/null @@ -1,433 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Download = function Download(table) { - this.table = table; //hold Tabulator object -}; - -//trigger file download -Download.prototype.download = function (type, filename, options, range, interceptCallback) { - var self = this, - downloadFunc = false; - - function buildLink(data, mime) { - if (interceptCallback) { - if (interceptCallback === true) { - self.triggerDownload(data, mime, type, filename, true); - } else { - interceptCallback(data); - } - } else { - self.triggerDownload(data, mime, type, filename); - } - } - - if (typeof type == "function") { - downloadFunc = type; - } else { - if (self.downloaders[type]) { - downloadFunc = self.downloaders[type]; - } else { - console.warn("Download Error - No such download type found: ", type); - } - } - - if (downloadFunc) { - var list = this.generateExportList(range); - - downloadFunc.call(this.table, list, options || {}, buildLink); - } -}; - -Download.prototype.generateExportList = function (range) { - var list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, "download"); - - //assign group header formatter - var groupHeader = this.table.options.groupHeaderDownload; - - if (groupHeader && !Array.isArray(groupHeader)) { - groupHeader = [groupHeader]; - } - - list.forEach(function (row) { - var group; - - if (row.type === "group") { - group = row.columns[0]; - - if (groupHeader && groupHeader[row.indent]) { - group.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } - } - }); - - return list; -}; - -Download.prototype.triggerDownload = function (data, mime, type, filename, newTab) { - var element = document.createElement('a'), - blob = new Blob([data], { type: mime }), - filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type); - - blob = this.table.options.downloadReady.call(this.table, data, blob); - - if (blob) { - - if (newTab) { - window.open(window.URL.createObjectURL(blob)); - } else { - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveOrOpenBlob(blob, filename); - } else { - element.setAttribute('href', window.URL.createObjectURL(blob)); - - //set file title - element.setAttribute('download', filename); - - //trigger download - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - - //remove temporary link element - document.body.removeChild(element); - } - } - - if (this.table.options.downloadComplete) { - this.table.options.downloadComplete(); - } - } -}; - -Download.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "intercept": - this.download(data.type, "", data.options, data.active, data.intercept); - break; - } -}; - -//downloaders -Download.prototype.downloaders = { - csv: function csv(list, options, setFileContents) { - var delimiter = options && options.delimiter ? options.delimiter : ",", - fileContents = [], - headers = []; - - list.forEach(function (row) { - var item = []; - - switch (row.type) { - case "group": - console.warn("Download Warning - CSV downloader cannot process row groups"); - break; - - case "calc": - console.warn("Download Warning - CSV downloader cannot process column calculations"); - break; - - case "header": - row.columns.forEach(function (col, i) { - if (col && col.depth === 1) { - headers[i] = typeof col.value == "undefined" || typeof col.value == "null" ? "" : col.value; - } - }); - break; - - case "row": - row.columns.forEach(function (col) { - - if (col) { - - switch (_typeof(col.value)) { - case "object": - col.value = JSON.stringify(col.value); - break; - - case "undefined": - case "null": - col.value = ""; - break; - } - - item.push('"' + String(col.value).split('"').join('""') + '"'); - } - }); - - fileContents.push(item.join(delimiter)); - break; - } - }); - - if (headers.length) { - fileContents = [headers].concat(fileContents); - } - - fileContents = fileContents.join("\n"); - - if (options.bom) { - fileContents = "\uFEFF" + fileContents; - } - - setFileContents(fileContents, "text/csv"); - }, - - json: function json(list, options, setFileContents) { - var fileContents = []; - - list.forEach(function (row) { - var item = {}; - - switch (row.type) { - case "header": - break; - - case "group": - console.warn("Download Warning - JSON downloader cannot process row groups"); - break; - - case "calc": - console.warn("Download Warning - JSON downloader cannot process column calculations"); - break; - - case "row": - row.columns.forEach(function (col) { - if (col) { - item[col.component.getField()] = col.value; - } - }); - - fileContents.push(item); - break; - } - }); - - fileContents = JSON.stringify(fileContents, null, '\t'); - - setFileContents(fileContents, "application/json"); - }, - - pdf: function pdf(list, options, setFileContents) { - var header = [], - body = [], - autoTableParams = {}, - rowGroupStyles = options.rowGroupStyles || { - fontStyle: "bold", - fontSize: 12, - cellPadding: 6, - fillColor: 220 - }, - rowCalcStyles = options.rowCalcStyles || { - fontStyle: "bold", - fontSize: 10, - cellPadding: 4, - fillColor: 232 - }, - jsPDFParams = options.jsPDF || {}, - title = options && options.title ? options.title : ""; - - if (!jsPDFParams.orientation) { - jsPDFParams.orientation = options.orientation || "landscape"; - } - - if (!jsPDFParams.unit) { - jsPDFParams.unit = "pt"; - } - - //parse row list - list.forEach(function (row) { - var item = {}; - - switch (row.type) { - case "header": - header.push(parseRow(row)); - break; - - case "group": - body.push(parseRow(row, rowGroupStyles)); - break; - - case "calc": - body.push(parseRow(row, rowCalcStyles)); - break; - - case "row": - body.push(parseRow(row)); - break; - } - }); - - function parseRow(row, styles) { - var rowData = []; - - row.columns.forEach(function (col) { - var cell; - - if (col) { - switch (_typeof(col.value)) { - case "object": - col.value = JSON.stringify(col.value); - break; - - case "undefined": - case "null": - col.value = ""; - break; - } - - cell = { - content: col.value, - colSpan: col.width, - rowSpan: col.height - }; - - if (styles) { - cell.styles = styles; - } - - rowData.push(cell); - } else { - rowData.push(""); - } - }); - - return rowData; - } - - //configure PDF - var doc = new jsPDF(jsPDFParams); //set document to landscape, better for most tables - - if (options && options.autoTable) { - if (typeof options.autoTable === "function") { - autoTableParams = options.autoTable(doc) || {}; - } else { - autoTableParams = options.autoTable; - } - } - - if (title) { - autoTableParams.addPageContent = function (data) { - doc.text(title, 40, 30); - }; - } - - autoTableParams.head = header; - autoTableParams.body = body; - - doc.autoTable(autoTableParams); - - if (options && options.documentProcessing) { - options.documentProcessing(doc); - } - - setFileContents(doc.output("arraybuffer"), "application/pdf"); - }, - - xlsx: function xlsx(list, options, setFileContents) { - var self = this, - sheetName = options.sheetName || "Sheet1", - workbook = XLSX.utils.book_new(), - output; - - workbook.SheetNames = []; - workbook.Sheets = {}; - - function generateSheet() { - var rows = [], - merges = [], - worksheet = {}, - range = { s: { c: 0, r: 0 }, e: { c: list[0] ? list[0].columns.reduce(function (a, b) { - return a + (b && b.width ? b.width : 1); - }, 0) : 0, r: list.length } }; - - //parse row list - list.forEach(function (row, i) { - var rowData = []; - - row.columns.forEach(function (col, j) { - - if (col) { - rowData.push(!(col.value instanceof Date) && _typeof(col.value) === "object" ? JSON.stringify(col.value) : col.value); - - if (col.width > 1 || col.height > -1) { - merges.push({ s: { r: i, c: j }, e: { r: i + col.height - 1, c: j + col.width - 1 } }); - } - } else { - rowData.push(""); - } - }); - - rows.push(rowData); - }); - - //convert rows to worksheet - XLSX.utils.sheet_add_aoa(worksheet, rows); - - worksheet['!ref'] = XLSX.utils.encode_range(range); - - if (merges.length) { - worksheet["!merges"] = merges; - } - - return worksheet; - } - - if (options.sheetOnly) { - setFileContents(generateSheet()); - return; - } - - if (options.sheets) { - for (var sheet in options.sheets) { - - if (options.sheets[sheet] === true) { - workbook.SheetNames.push(sheet); - workbook.Sheets[sheet] = generateSheet(); - } else { - - workbook.SheetNames.push(sheet); - - this.table.modules.comms.send(options.sheets[sheet], "download", "intercept", { - type: "xlsx", - options: { sheetOnly: true }, - active: self.active, - intercept: function intercept(data) { - workbook.Sheets[sheet] = data; - } - }); - } - } - } else { - workbook.SheetNames.push(sheetName); - workbook.Sheets[sheetName] = generateSheet(); - } - - if (options.documentProcessing) { - workbook = options.documentProcessing(workbook); - } - - //convert workbook to binary array - function s2ab(s) { - var buf = new ArrayBuffer(s.length); - var view = new Uint8Array(buf); - for (var i = 0; i != s.length; ++i) { - view[i] = s.charCodeAt(i) & 0xFF; - }return buf; - } - - output = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'binary' }); - - setFileContents(s2ab(output), "application/octet-stream"); - }, - - html: function html(list, options, setFileContents) { - if (this.modExists("export", true)) { - setFileContents(this.modules.export.genereateHTMLTable(list), "text/html"); - } - } - -}; - -Tabulator.prototype.registerModule("download", Download); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/download.min.js b/app/static/vendors/tabulator/js/modules/download.min.js deleted file mode 100644 index b3b776c..0000000 --- a/app/static/vendors/tabulator/js/modules/download.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Download=function(e){this.table=e};Download.prototype.download=function(e,o,t,n,a){function r(t,n){a?!0===a?l.triggerDownload(t,n,e,o,!0):a(t):l.triggerDownload(t,n,e,o)}var l=this,s=!1;if("function"==typeof e?s=e:l.downloaders[e]?s=l.downloaders[e]:console.warn("Download Error - No such download type found: ",e),s){var i=this.generateExportList(n);s.call(this.table,i,t||{},r)}},Download.prototype.generateExportList=function(e){var o=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),t=this.table.options.groupHeaderDownload;return t&&!Array.isArray(t)&&(t=[t]),o.forEach(function(e){var o;"group"===e.type&&(o=e.columns[0],t&&t[e.indent]&&(o.value=t[e.indent](o.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))}),o},Download.prototype.triggerDownload=function(e,o,t,n,a){var r=document.createElement("a"),l=new Blob([e],{type:o}),n=n||"Tabulator."+("function"==typeof t?"txt":t);(l=this.table.options.downloadReady.call(this.table,e,l))&&(a?window.open(window.URL.createObjectURL(l)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(l,n):(r.setAttribute("href",window.URL.createObjectURL(l)),r.setAttribute("download",n),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},Download.prototype.commsReceived=function(e,o,t){switch(o){case"intercept":this.download(t.type,"",t.options,t.active,t.intercept)}},Download.prototype.downloaders={csv:function(e,o,t){var n=o&&o.delimiter?o.delimiter:",",a=[],r=[];e.forEach(function(e){var o=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(function(e,o){e&&1===e.depth&&(r[o]=void 0===e.value||"null"==typeof e.value?"":e.value)});break;case"row":e.columns.forEach(function(e){if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}o.push('"'+String(e.value).split('"').join('""')+'"')}}),a.push(o.join(n))}}),r.length&&(a=[r].concat(a)),a=a.join("\n"),o.bom&&(a="\ufeff"+a),t(a,"text/csv")},json:function(e,o,t){var n=[];e.forEach(function(e){var o={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach(function(e){e&&(o[e.component.getField()]=e.value)}),n.push(o)}}),n=JSON.stringify(n,null,"\t"),t(n,"application/json")},pdf:function(e,o,t){function n(e,o){var t=[];return e.columns.forEach(function(e){var n;if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}n={content:e.value,colSpan:e.width,rowSpan:e.height},o&&(n.styles=o),t.push(n)}else t.push("")}),t}var a=[],r=[],l={},s=o.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},i=o.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=o.jsPDF||{},u=o&&o.title?o.title:"";c.orientation||(c.orientation=o.orientation||"landscape"),c.unit||(c.unit="pt"),e.forEach(function(e){switch(e.type){case"header":a.push(n(e));break;case"group":r.push(n(e,s));break;case"calc":r.push(n(e,i));break;case"row":r.push(n(e))}});var d=new jsPDF(c);o&&o.autoTable&&(l="function"==typeof o.autoTable?o.autoTable(d)||{}:o.autoTable),u&&(l.addPageContent=function(e){d.text(u,40,30)}),l.head=a,l.body=r,d.autoTable(l),o&&o.documentProcessing&&o.documentProcessing(d),t(d.output("arraybuffer"),"application/pdf")},xlsx:function(e,o,t){function n(){var o=[],t=[],n={},a={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce(function(e,o){return e+(o&&o.width?o.width:1)},0):0,r:e.length}};return e.forEach(function(e,n){var a=[];e.columns.forEach(function(e,o){e?(a.push(e.value instanceof Date||"object"!==_typeof(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&t.push({s:{r:n,c:o},e:{r:n+e.height-1,c:o+e.width-1}})):a.push("")}),o.push(a)}),XLSX.utils.sheet_add_aoa(n,o),n["!ref"]=XLSX.utils.encode_range(a),t.length&&(n["!merges"]=t),n}var a,r=this,l=o.sheetName||"Sheet1",s=XLSX.utils.book_new();if(s.SheetNames=[],s.Sheets={},o.sheetOnly)return void t(n());if(o.sheets)for(var i in o.sheets)!0===o.sheets[i]?(s.SheetNames.push(i),s.Sheets[i]=n()):(s.SheetNames.push(i),this.table.modules.comms.send(o.sheets[i],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:r.active,intercept:function(e){s.Sheets[i]=e}}));else s.SheetNames.push(l),s.Sheets[l]=n();o.documentProcessing&&(s=o.documentProcessing(s)),a=XLSX.write(s,{bookType:"xlsx",bookSST:!0,type:"binary"}),t(function(e){for(var o=new ArrayBuffer(e.length),t=new Uint8Array(o),n=0;n!=e.length;++n)t[n]=255&e.charCodeAt(n);return o}(a),"application/octet-stream")},html:function(e,o,t){this.modExists("export",!0)&&t(this.modules.export.genereateHTMLTable(e),"text/html")}},Tabulator.prototype.registerModule("download",Download); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/edit.js b/app/static/vendors/tabulator/js/modules/edit.js deleted file mode 100644 index e35dd84..0000000 --- a/app/static/vendors/tabulator/js/modules/edit.js +++ /dev/null @@ -1,2109 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Edit = function Edit(table) { - this.table = table; //hold Tabulator object - this.currentCell = false; //hold currently editing cell - this.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening - this.recursionBlock = false; //prevent focus recursion - this.invalidEdit = false; - this.editedCells = []; -}; - -//initialize column editor -Edit.prototype.initializeColumn = function (column) { - var self = this, - config = { - editor: false, - blocked: false, - check: column.definition.editable, - params: column.definition.editorParams || {} - }; - - //set column editor - switch (_typeof(column.definition.editor)) { - case "string": - - if (column.definition.editor === "tick") { - column.definition.editor = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.editor]) { - config.editor = self.editors[column.definition.editor]; - } else { - console.warn("Editor Error - No such editor found: ", column.definition.editor); - } - break; - - case "function": - config.editor = column.definition.editor; - break; - - case "boolean": - - if (column.definition.editor === true) { - - if (typeof column.definition.formatter !== "function") { - - if (column.definition.formatter === "tick") { - column.definition.formatter = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.formatter]) { - config.editor = self.editors[column.definition.formatter]; - } else { - config.editor = self.editors["input"]; - } - } else { - console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ", column.definition.formatter); - } - } - break; - } - - if (config.editor) { - column.modules.edit = config; - } -}; - -Edit.prototype.getCurrentCell = function () { - return this.currentCell ? this.currentCell.getComponent() : false; -}; - -Edit.prototype.clearEditor = function (cancel) { - var cell = this.currentCell, - cellEl; - - this.invalidEdit = false; - - if (cell) { - this.currentCell = false; - - cellEl = cell.getElement(); - - if (cancel) { - cell.validate(); - } else { - cellEl.classList.remove("tabulator-validation-fail"); - } - - cellEl.classList.remove("tabulator-editing"); - while (cellEl.firstChild) { - cellEl.removeChild(cellEl.firstChild); - }cell.row.getElement().classList.remove("tabulator-row-editing"); - } -}; - -Edit.prototype.cancelEdit = function () { - - if (this.currentCell) { - var cell = this.currentCell; - var component = this.currentCell.getComponent(); - - this.clearEditor(true); - cell.setValueActual(cell.getValue()); - cell.cellRendered(); - - if (cell.column.cellEvents.cellEditCancelled) { - cell.column.cellEvents.cellEditCancelled.call(this.table, component); - } - - this.table.options.cellEditCancelled.call(this.table, component); - } -}; - -//return a formatted value for a cell -Edit.prototype.bindEditor = function (cell) { - var self = this, - element = cell.getElement(); - - element.setAttribute("tabindex", 0); - - element.addEventListener("click", function (e) { - if (!element.classList.contains("tabulator-editing")) { - element.focus({ preventScroll: true }); - } - }); - - element.addEventListener("mousedown", function (e) { - self.mouseClick = true; - }); - - element.addEventListener("focus", function (e) { - if (!self.recursionBlock) { - self.edit(cell, e, false); - } - }); -}; - -Edit.prototype.focusCellNoEvent = function (cell, block) { - this.recursionBlock = true; - if (!(block && this.table.browser === "ie")) { - cell.getElement().focus({ preventScroll: true }); - } - this.recursionBlock = false; -}; - -Edit.prototype.editCell = function (cell, forceEdit) { - this.focusCellNoEvent(cell); - this.edit(cell, false, forceEdit); -}; - -Edit.prototype.focusScrollAdjust = function (cell) { - if (this.table.rowManager.getRenderMode() == "virtual") { - var topEdge = this.table.rowManager.element.scrollTop, - bottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop, - rowEl = cell.row.getElement(), - offset = rowEl.offsetTop; - - if (rowEl.offsetTop < topEdge) { - this.table.rowManager.element.scrollTop -= topEdge - rowEl.offsetTop; - } else { - if (rowEl.offsetTop + rowEl.offsetHeight > bottomEdge) { - this.table.rowManager.element.scrollTop += rowEl.offsetTop + rowEl.offsetHeight - bottomEdge; - } - } - } -}; - -Edit.prototype.edit = function (cell, e, forceEdit) { - var self = this, - allowEdit = true, - rendered = function rendered() {}, - element = cell.getElement(), - cellEditor, - component, - params; - - //prevent editing if another cell is refusing to leave focus (eg. validation fail) - if (this.currentCell) { - if (!this.invalidEdit) { - this.cancelEdit(); - } - return; - } - - //handle successfull value change - function success(value) { - if (self.currentCell === cell) { - var valid = true; - - if (cell.column.modules.validate && self.table.modExists("validate") && self.table.options.validationMode != "manual") { - valid = self.table.modules.validate.validate(cell.column.modules.validate, cell, value); - } - - if (valid === true || self.table.options.validationMode === "highlight") { - self.clearEditor(); - cell.setValue(value, true); - - if (!cell.modules.edit) { - cell.modules.edit = {}; - } - - cell.modules.edit.edited = true; - - if (self.editedCells.indexOf(cell) == -1) { - self.editedCells.push(cell); - } - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - - if (valid !== true) { - element.classList.add("tabulator-validation-fail"); - return false; - } - - return true; - } else { - self.invalidEdit = true; - element.classList.add("tabulator-validation-fail"); - self.focusCellNoEvent(cell, true); - rendered(); - self.table.options.validationFailed.call(self.table, cell.getComponent(), value, valid); - - return false; - } - } else { - // console.warn("Edit Success Error - cannot call success on a cell that is no longer being edited"); - } - } - - //handle aborted edit - function cancel() { - if (self.currentCell === cell) { - self.cancelEdit(); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - } else { - // console.warn("Edit Success Error - cannot call cancel on a cell that is no longer being edited"); - } - } - - function onRendered(callback) { - rendered = callback; - } - - if (!cell.column.modules.edit.blocked) { - if (e) { - e.stopPropagation(); - } - - switch (_typeof(cell.column.modules.edit.check)) { - case "function": - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - break; - - case "boolean": - allowEdit = cell.column.modules.edit.check; - break; - } - - if (allowEdit || forceEdit) { - - self.cancelEdit(); - - self.currentCell = cell; - - this.focusScrollAdjust(cell); - - component = cell.getComponent(); - - if (this.mouseClick) { - this.mouseClick = false; - - if (cell.column.cellEvents.cellClick) { - cell.column.cellEvents.cellClick.call(this.table, e, component); - } - } - - if (cell.column.cellEvents.cellEditing) { - cell.column.cellEvents.cellEditing.call(this.table, component); - } - - self.table.options.cellEditing.call(this.table, component); - - params = typeof cell.column.modules.edit.params === "function" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params; - - cellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params); - - //if editor returned, add to DOM, if false, abort edit - if (cellEditor !== false) { - - if (cellEditor instanceof Node) { - element.classList.add("tabulator-editing"); - cell.row.getElement().classList.add("tabulator-row-editing"); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.appendChild(cellEditor); - - //trigger onRendered Callback - rendered(); - - //prevent editing from triggering rowClick event - var children = element.children; - - for (var i = 0; i < children.length; i++) { - children[i].addEventListener("click", function (e) { - e.stopPropagation(); - }); - } - } else { - console.warn("Edit Error - Editor should return an instance of Node, the editor returned:", cellEditor); - element.blur(); - return false; - } - } else { - element.blur(); - return false; - } - - return true; - } else { - this.mouseClick = false; - element.blur(); - return false; - } - } else { - this.mouseClick = false; - element.blur(); - return false; - } -}; - -Edit.prototype.maskInput = function (el, options) { - var mask = options.mask, - maskLetter = typeof options.maskLetterChar !== "undefined" ? options.maskLetterChar : "A", - maskNumber = typeof options.maskNumberChar !== "undefined" ? options.maskNumberChar : "9", - maskWildcard = typeof options.maskWildcardChar !== "undefined" ? options.maskWildcardChar : "*", - success = false; - - function fillSymbols(index) { - var symbol = mask[index]; - if (typeof symbol !== "undefined" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber) { - el.value = el.value + "" + symbol; - fillSymbols(index + 1); - } - } - - el.addEventListener("keydown", function (e) { - var index = el.value.length, - char = e.key; - - if (e.keyCode > 46) { - if (index >= mask.length) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } else { - switch (mask[index]) { - case maskLetter: - if (char.toUpperCase() == char.toLowerCase()) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskNumber: - if (isNaN(char)) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskWildcard: - break; - - default: - if (char !== mask[index]) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - } - } - - success = true; - } - - return; - }); - - el.addEventListener("keyup", function (e) { - if (e.keyCode > 46) { - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - } - }); - - if (!el.placeholder) { - el.placeholder = mask; - } - - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } -}; - -Edit.prototype.getEditedCells = function () { - var output = []; - - this.editedCells.forEach(function (cell) { - output.push(cell.getComponent()); - }); - - return output; -}; - -Edit.prototype.clearEdited = function (cell) { - var editIndex; - - if (cell.modules.edit && cell.modules.edit.edited) { - cell.modules.validate.invalid = false; - - editIndex = this.editedCells.indexOf(cell); - - if (editIndex > -1) { - this.editedCells.splice(editIndex, 1); - } - } -}; - -//default data editors -Edit.prototype.editors = { - - //input element - input: function input(cell, onRendered, success, cancel, editorParams) { - - //create and style input - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", editorParams.search ? "search" : "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof cellValue !== "undefined" ? cellValue : ""; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - // case 9: - case 13: - onChange(e); - break; - - case 27: - cancel(); - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //resizable text area element - textarea: function textarea(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "hybrid", - value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""), - count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1, - input = document.createElement("textarea"), - scrollHeight = 0; - - //create and style input - input.style.display = "block"; - input.style.padding = "2px"; - input.style.height = "100%"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.whiteSpace = "pre-wrap"; - input.style.resize = "none"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - - setTimeout(function () { - cell.getRow().normalizeHeight(); - }, 300); - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - input.addEventListener("keyup", function () { - - input.style.height = ""; - - var heightNow = input.scrollHeight; - - input.style.height = heightNow + "px"; - - if (heightNow != scrollHeight) { - scrollHeight = heightNow; - cell.getRow().normalizeHeight(); - } - }); - - input.addEventListener("keydown", function (e) { - - switch (e.keyCode) { - case 27: - cancel(); - break; - - case 38: - //up arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - - break; - - case 40: - //down arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart !== input.value.length) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - number: function number(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - input = document.createElement("input"); - - input.setAttribute("type", "number"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - var blurFunc = function blurFunc(e) { - onChange(); - }; - - onRendered(function () { - //submit new value on blur - input.removeEventListener("blur", blurFunc); - - input.focus({ preventScroll: true }); - input.style.height = "100%"; - - //submit new value on blur - input.addEventListener("blur", blurFunc); - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value !== cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - - case 38: //up arrow - case 40: - //down arrow - if (vertNav == "editor") { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - range: function range(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", "range"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value != cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur - input.addEventListener("blur", function (e) { - onChange(); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - } - }); - - return input; - }, - - //select - select: function select(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : [], - input = document.createElement("input"), - listEl = document.createElement("div"), - multiselect = editorParams.multiselect, - dataItems = [], - currentItem = {}, - displayItems = [], - currentItems = [], - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - if (Array.isArray(editorParams) || !Array.isArray(editorParams) && (typeof editorParams === "undefined" ? "undefined" : _typeof(editorParams)) === "object" && !editorParams.values) { - console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); - editorParams = { values: editorParams }; - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create select lookup list:", field); - } - - return output; - } - - function parseItems(inputValues, curentValues) { - var dataList = []; - var displayList = []; - - function processComplexListItem(item) { - var item = { - label: item.label, - value: item.value, - itemParams: item.itemParams, - elementAttributes: item.elementAttributes, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - - return item; - } - - if (typeof inputValues == "function") { - inputValues = inputValues(cell); - } - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item; - - if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "object") { - - if (value.options) { - item = { - label: value.label, - group: true, - itemParams: value.itemParams, - elementAttributes: value.elementAttributes, - element: false - }; - - displayList.push(item); - - value.options.forEach(function (item) { - processComplexListItem(item); - }); - } else { - processComplexListItem(value); - } - } else { - - item = { - label: value, - value: value, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - } - }); - } else { - for (var key in inputValues) { - var item = { - label: inputValues[key], - value: key, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - } - } - - dataItems = dataList; - displayItems = displayList; - - fillList(); - } - - function fillList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }displayItems.forEach(function (item) { - - var el = item.element; - - if (!el) { - el = document.createElement("div"); - item.label = editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label, cell, el, item.itemParams) : item.label; - if (item.group) { - el.classList.add("tabulator-edit-select-list-group"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - } else { - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - - el.addEventListener("click", function () { - // setCurrentItem(item); - // chooseItem(); - if (multiselect) { - toggleItem(item); - input.focus(); - } else { - chooseItem(item); - } - }); - - // if(item === currentItem){ - // el.classList.add("active"); - // } - - if (currentItems.indexOf(item) > -1) { - el.classList.add("active"); - } - } - - if (item.elementAttributes && _typeof(item.elementAttributes) == "object") { - for (var key in item.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - el.setAttribute(key, input.getAttribute(key) + item.elementAttributes["+" + key]); - } else { - el.setAttribute(key, item.elementAttributes[key]); - } - } - } - el.addEventListener("mousedown", function () { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - } - - listEl.appendChild(el); - }); - } - - function setCurrentItem(item, active) { - - if (!multiselect && currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("focused"); - } - - currentItem = item; - - if (item.element) { - item.element.classList.add("focused"); - if (active) { - item.element.classList.add("active"); - } - } - } - - // function chooseItem(){ - // hideList(); - - // if(initialValue !== currentItem.value){ - // initialValue = currentItem.value; - // success(currentItem.value); - // }else{ - // cancel(); - // } - // } - - function setItem(item) { - var index = currentItems.indexOf(item); - - if (index == -1) { - currentItems.push(item); - setCurrentItem(item, true); - } - - fillInput(); - } - - function unsetItem(index) { - var item = currentItems[index]; - - if (index > -1) { - currentItems.splice(index, 1); - if (item.element) { - item.element.classList.remove("active"); - } - } - } - - function toggleItem(item) { - if (!item) { - item = currentItem; - } - - var index = currentItems.indexOf(item); - - if (index > -1) { - unsetItem(index); - } else { - if (multiselect !== true && currentItems.length >= multiselect) { - unsetItem(0); - } - - setItem(item); - } - - fillInput(); - } - - function chooseItem(item) { - hideList(); - - if (!item) { - item = currentItem; - } - - if (item) { - success(item.value); - } - } - - function chooseItems() { - hideList(); - - var output = []; - - currentItems.forEach(function (item) { - output.push(item.value); - }); - - success(output); - } - - function fillInput() { - var output = []; - - currentItems.forEach(function (item) { - output.push(item.label); - }); - - input.value = output.join(", "); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function showList() { - if (!listEl.parentNode) { - - if (editorParams.values === true) { - parseItems(getUniqueColumnValues(), initialDisplayValue); - } else if (typeof editorParams.values === "string") { - parseItems(getUniqueColumnValues(editorParams.values), initialDisplayValue); - } else { - parseItems(editorParams.values || [], initialDisplayValue); - } - - var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - document.body.appendChild(listEl); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //style input - input.setAttribute("type", "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.cursor = "default"; - input.readOnly = this.currentCell != false; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof initialValue !== "undefined" || initialValue === null ? initialValue : ""; - - // if(editorParams.values === true){ - // parseItems(getUniqueColumnValues(), initialValue); - // }else if(typeof editorParams.values === "string"){ - // parseItems(getUniqueColumnValues(editorParams.values), initialValue); - // }else{ - // parseItems(editorParams.values || [], initialValue); - // } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(dataItems[index - 1], !multiselect); - } - } - break; - - case 40: - //down arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < dataItems.length - 1) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < dataItems.length - 1) { - if (index == -1) { - setCurrentItem(dataItems[0], !multiselect); - } else { - setCurrentItem(dataItems[index + 1], !multiselect); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - // chooseItem(); - - if (multiselect) { - toggleItem(); - } else { - chooseItem(); - } - - break; - - case 27: - //escape - cancelItem(); - break; - } - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - if (multiselect) { - chooseItems(); - } else { - cancelItem(); - } - } - }); - - input.addEventListener("focus", function (e) { - showList(); - }); - - //style list element - listEl = document.createElement("div"); - listEl.classList.add("tabulator-edit-select-list"); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - return input; - }, - - //autocomplete - autocomplete: function autocomplete(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - allItems = [], - displayItems = [], - values = [], - currentItem = false, - blurable = true, - uniqueColumnValues = false; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - //style input - input.setAttribute("type", "search"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style list element - listEl.classList.add("tabulator-edit-select-list"); - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - function genUniqueColumnValues() { - if (editorParams.values === true) { - uniqueColumnValues = getUniqueColumnValues(); - } else if (typeof editorParams.values === "string") { - uniqueColumnValues = getUniqueColumnValues(editorParams.values); - } - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create autocomplete lookup list:", field); - } - - return output; - } - - function filterList(term, intialLoad) { - var matches = [], - values, - items, - searchEl; - - //lookup base values list - if (uniqueColumnValues) { - values = uniqueColumnValues; - } else { - values = editorParams.values || []; - } - - if (editorParams.searchFunc) { - matches = editorParams.searchFunc(term, values); - - if (matches instanceof Promise) { - - addNotice(typeof editorParams.searchingPlaceholder !== "undefined" ? editorParams.searchingPlaceholder : "Searching..."); - - matches.then(function (result) { - fillListIfNotEmpty(parseItems(result), intialLoad); - }).catch(function (err) { - console.err("error in autocomplete search promise:", err); - }); - } else { - fillListIfNotEmpty(parseItems(matches), intialLoad); - } - } else { - items = parseItems(values); - - if (term === "") { - if (editorParams.showListOnEmpty) { - matches = items; - } - } else { - items.forEach(function (item) { - if (item.value !== null || typeof item.value !== "undefined") { - if (String(item.value).toLowerCase().indexOf(String(term).toLowerCase()) > -1 || String(item.title).toLowerCase().indexOf(String(term).toLowerCase()) > -1) { - matches.push(item); - } - } - }); - } - - fillListIfNotEmpty(matches, intialLoad); - } - } - - function addNotice(notice) { - var searchEl = document.createElement("div"); - - clearList(); - - if (notice !== false) { - searchEl.classList.add("tabulator-edit-select-list-notice"); - searchEl.tabIndex = 0; - - if (notice instanceof Node) { - searchEl.appendChild(notice); - } else { - searchEl.innerHTML = notice; - } - - listEl.appendChild(searchEl); - } - } - - function parseItems(inputValues) { - var itemList = []; - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - - var item = {}; - - if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "object") { - item.title = editorParams.listItemFormatter ? editorParams.listItemFormatter(value.value, value.label) : value.label; - item.value = value.value; - } else { - item.title = editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value; - item.value = value; - } - - itemList.push(item); - }); - } else { - for (var key in inputValues) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key - }; - - itemList.push(item); - } - } - - return itemList; - } - - function clearList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - } - } - - function fillListIfNotEmpty(items, intialLoad) { - if (items.length) { - fillList(items, intialLoad); - } else { - if (editorParams.emptyPlaceholder) { - addNotice(editorParams.emptyPlaceholder); - } - } - } - - function fillList(items, intialLoad) { - var current = false; - - clearList(); - - displayItems = items; - - displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.title; - - el.addEventListener("click", function (e) { - setCurrentItem(item); - chooseItem(); - }); - - el.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - - if (intialLoad && item.value == initialValue) { - input.value = item.title; - item.element.classList.add("active"); - current = true; - } - - if (item === currentItem) { - item.element.classList.add("active"); - current = true; - } - } - - listEl.appendChild(el); - }); - - if (!current) { - setCurrentItem(false); - } - } - - function chooseItem() { - hideList(); - - if (currentItem) { - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - input.value = currentItem.title; - success(currentItem.value); - } else { - cancel(); - } - } else { - if (editorParams.freetext) { - initialValue = input.value; - success(input.value); - } else { - if (editorParams.allowEmpty && input.value === "") { - initialValue = input.value; - success(input.value); - } else { - cancel(); - } - } - } - } - - function showList() { - if (!listEl.parentNode) { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - document.body.appendChild(listEl); - } - } - - function setCurrentItem(item, showInputValue) { - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - - if (item && item.element) { - item.element.classList.add("active"); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(displayItems[index - 1]); - } else { - setCurrentItem(false); - } - } - break; - - case 40: - //down arrow - - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < displayItems.length - 1) { - - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < displayItems.length - 1) { - if (index == -1) { - setCurrentItem(displayItems[0]); - } else { - setCurrentItem(displayItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - // e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - - case 36: //home - case 35: - //end - //prevent table navigation while using input element - e.stopImmediatePropagation(); - break; - } - }); - - input.addEventListener("keyup", function (e) { - - switch (e.keyCode) { - case 38: //up arrow - case 37: //left arrow - case 39: //up arrow - case 40: //right arrow - case 13: //enter - case 27: - //escape - break; - - default: - filterList(input.value); - } - }); - - input.addEventListener("search", function (e) { - filterList(input.value); - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - chooseItem(); - } - }); - - input.addEventListener("focus", function (e) { - var value = initialDisplayValue; - genUniqueColumnValues(); - showList(); - input.value = value; - filterList(value, true); - }); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //star rating - star: function star(cell, onRendered, success, cancel, editorParams) { - var self = this, - element = cell.getElement(), - value = cell.getValue(), - maxStars = element.getElementsByTagName("svg").length || 5, - size = element.getElementsByTagName("svg")[0] ? element.getElementsByTagName("svg")[0].getAttribute("width") : 14, - stars = [], - starsHolder = document.createElement("div"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"); - - //change star type - function starChange(val) { - stars.forEach(function (star, i) { - if (i < val) { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-active"); - } else { - star.classList.replace("tabulator-star-inactive", "tabulator-star-active"); - } - - star.innerHTML = ''; - } else { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-inactive"); - } else { - star.classList.replace("tabulator-star-active", "tabulator-star-inactive"); - } - - star.innerHTML = ''; - } - }); - } - - //build stars - function buildStar(i) { - - var starHolder = document.createElement("span"); - var nextStar = star.cloneNode(true); - - stars.push(nextStar); - - starHolder.addEventListener("mouseenter", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - starChange(i); - }); - - starHolder.addEventListener("mousemove", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - }); - - starHolder.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - success(i); - element.blur(); - }); - - starHolder.appendChild(nextStar); - starsHolder.appendChild(starHolder); - } - - //handle keyboard navigation value change - function changeValue(val) { - value = val; - starChange(val); - } - - //style cell - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - //style holding element - starsHolder.style.verticalAlign = "middle"; - starsHolder.style.display = "inline-block"; - starsHolder.style.padding = "4px"; - - //style star - star.setAttribute("width", size); - star.setAttribute("height", size); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - starsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - starsHolder.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //create correct number of stars - for (var i = 1; i <= maxStars; i++) { - buildStar(i); - } - - //ensure value does not exceed number of stars - value = Math.min(parseInt(value), maxStars); - - // set initial styling of stars - starChange(value); - - starsHolder.addEventListener("mousemove", function (e) { - starChange(0); - }); - - starsHolder.addEventListener("click", function (e) { - success(0); - }); - - element.addEventListener("blur", function (e) { - cancel(); - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - changeValue(value + 1); - break; - - case 37: - //left arrow - changeValue(value - 1); - break; - - case 13: - //enter - success(value); - break; - - case 27: - //escape - cancel(); - break; - } - }); - - return starsHolder; - }, - - //draggable progress bar - progress: function progress(cell, onRendered, success, cancel, editorParams) { - var element = cell.getElement(), - max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max, - min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min, - percent = (max - min) / 100, - value = cell.getValue() || 0, - handle = document.createElement("div"), - bar = document.createElement("div"), - mouseDrag, - mouseDragWidth; - - //set new value - function updateValue() { - var calcVal = percent * Math.round(bar.offsetWidth / (element.clientWidth / 100)) + min; - success(calcVal); - element.setAttribute("aria-valuenow", calcVal); - element.setAttribute("aria-label", value); - } - - //style handle - handle.style.position = "absolute"; - handle.style.right = "0"; - handle.style.top = "0"; - handle.style.bottom = "0"; - handle.style.width = "5px"; - handle.classList.add("tabulator-progress-handle"); - - //style bar - bar.style.display = "inline-block"; - bar.style.position = "relative"; - // bar.style.top = "8px"; - // bar.style.bottom = "8px"; - // bar.style.left = "4px"; - // bar.style.marginRight = "4px"; - bar.style.height = "100%"; - bar.style.backgroundColor = "#488CE9"; - bar.style.maxWidth = "100%"; - bar.style.minWidth = "0%"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - bar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - bar.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style cell - element.style.padding = "4px 4px"; - - //make sure value is in range - value = Math.min(parseFloat(value), max); - value = Math.max(parseFloat(value), min); - - //workout percentage - value = Math.round((value - min) / percent); - // bar.style.right = value + "%"; - bar.style.width = value + "%"; - - element.setAttribute("aria-valuemin", min); - element.setAttribute("aria-valuemax", max); - - bar.appendChild(handle); - - handle.addEventListener("mousedown", function (e) { - mouseDrag = e.screenX; - mouseDragWidth = bar.offsetWidth; - }); - - handle.addEventListener("mouseover", function () { - handle.style.cursor = "ew-resize"; - }); - - element.addEventListener("mousemove", function (e) { - if (mouseDrag) { - bar.style.width = mouseDragWidth + e.screenX - mouseDrag + "px"; - } - }); - - element.addEventListener("mouseup", function (e) { - if (mouseDrag) { - e.stopPropagation(); - e.stopImmediatePropagation(); - - mouseDrag = false; - mouseDragWidth = false; - - updateValue(); - } - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - e.preventDefault(); - bar.style.width = bar.clientWidth + element.clientWidth / 100 + "px"; - break; - - case 37: - //left arrow - e.preventDefault(); - bar.style.width = bar.clientWidth - element.clientWidth / 100 + "px"; - break; - - case 9: //tab - case 13: - //enter - updateValue(); - break; - - case 27: - //escape - cancel(); - break; - - } - }); - - element.addEventListener("blur", function () { - cancel(); - }); - - return bar; - }, - - //checkbox - tickCross: function tickCross(cell, onRendered, success, cancel, editorParams) { - var value = cell.getValue(), - input = document.createElement("input"), - tristate = editorParams.tristate, - indetermValue = typeof editorParams.indeterminateValue === "undefined" ? null : editorParams.indeterminateValue, - indetermState = false; - - input.setAttribute("type", "checkbox"); - input.style.marginTop = "5px"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - if (tristate && (typeof value === "undefined" || value === indetermValue || value === "")) { - indetermState = true; - input.indeterminate = true; - } - - if (this.table.browser != "firefox") { - //prevent blur issue on mac firefox - onRendered(function () { - input.focus({ preventScroll: true }); - }); - } - - input.checked = value === true || value === "true" || value === "True" || value === 1; - - function setValue(blur) { - if (tristate) { - if (!blur) { - if (input.checked && !indetermState) { - input.checked = false; - input.indeterminate = true; - indetermState = true; - return indetermValue; - } else { - indetermState = false; - return input.checked; - } - } else { - if (indetermState) { - return indetermValue; - } else { - return input.checked; - } - } - } else { - return input.checked; - } - } - - //submit new value on blur - input.addEventListener("change", function (e) { - success(setValue()); - }); - - input.addEventListener("blur", function (e) { - success(setValue(true)); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - if (e.keyCode == 13) { - success(setValue()); - } - if (e.keyCode == 27) { - cancel(); - } - }); - - return input; - } -}; - -Tabulator.prototype.registerModule("edit", Edit); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/edit.min.js b/app/static/vendors/tabulator/js/modules/edit.min.js deleted file mode 100644 index 8e256be..0000000 --- a/app/static/vendors/tabulator/js/modules/edit.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),e?i.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i)}},Edit.prototype.edit=function(e,t,i){function n(t){if(u.currentCell===e){var i=!0;return e.column.modules.validate&&u.table.modExists("validate")&&"manual"!=u.table.options.validationMode&&(i=u.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===i||"highlight"===u.table.options.validationMode?(u.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==u.editedCells.indexOf(e)&&u.editedCells.push(e),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e),!0===i||(m.classList.add("tabulator-validation-fail"),!1)):(u.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),u.focusCellNoEvent(e,!0),c(),u.table.options.validationFailed.call(u.table,e.getComponent(),t,i),!1)}}function o(){u.currentCell===e&&(u.cancelEdit(),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e))}function a(e){c=e}var r,l,s,u=this,d=!0,c=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":d=e.column.modules.edit.check(e.getComponent());break;case"boolean":d=e.column.modules.edit.check}if(d||i){if(u.cancelEdit(),u.currentCell=e,this.focusScrollAdjust(e),l=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,l)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,l),u.table.options.cellEditing.call(this.table,l),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(l):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(u,l,a,n,o,s)))return m.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(r),c();for(var f=m.children,p=0;p46){if(i>=n.length)return t.preventDefault(),t.stopPropagation(),l=!1,!1;switch(n[i]){case o:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case a:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),l=!1,!1;break;case r:break;default:if(s!==n[i])return t.preventDefault(),t.stopPropagation(),l=!1,!1}l=!0}}),e.addEventListener("keyup",function(n){n.keyCode>46&&t.maskAutoFill&&i(e.value.length)}),e.placeholder||(e.placeholder=n),t.maskAutoFill&&i(e.value.length)},Edit.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},Edit.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},Edit.prototype.editors={input:function(e,t,i,n,o){function a(e){(null===r||void 0===r)&&""!==l.value||l.value!==r?i(l.value)&&(r=l.value):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type",o.search?"search":"text"),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=void 0!==r?r:"",t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("change",a),l.addEventListener("blur",a),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a(e);break;case 27:n()}}),o.mask&&this.table.modules.edit.maskInput(l,o),l},textarea:function(e,t,i,n,o){function a(t){(null===r||void 0===r)&&""!==u.value||u.value!==r?(i(u.value)&&(r=u.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var r=e.getValue(),l=o.verticalNavigation||"hybrid",s=String(null!==r&&void 0!==r?r:""),u=(s.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),d=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),u.setAttribute(c,u.getAttribute(c)+o.elementAttributes["+"+c])):u.setAttribute(c,o.elementAttributes[c]);return u.value=s,t(function(){u.focus({preventScroll:!0}),u.style.height="100%"}),u.addEventListener("change",a),u.addEventListener("blur",a),u.addEventListener("keyup",function(){u.style.height="";var t=u.scrollHeight;u.style.height=t+"px",t!=d&&(d=t,e.getRow().normalizeHeight())}),u.addEventListener("keydown",function(e){switch(e.keyCode){case 27:n();break;case 38:("editor"==l||"hybrid"==l&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==l||"hybrid"==l&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(u,o),u},number:function(e,t,i,n,o){function a(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!==r?i(e)&&(r=e):n()}var r=e.getValue(),l=o.verticalNavigation||"editor",s=document.createElement("input");if(s.setAttribute("type","number"),void 0!==o.max&&s.setAttribute("max",o.max),void 0!==o.min&&s.setAttribute("min",o.min),void 0!==o.step&&s.setAttribute("step",o.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var u in o.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),s.setAttribute(u,s.getAttribute(u)+o.elementAttributes["+"+u])):s.setAttribute(u,o.elementAttributes[u]);s.value=r;var d=function(e){a()};return t(function(){s.removeEventListener("blur",d),s.focus({preventScroll:!0}),s.style.height="100%",s.addEventListener("blur",d)}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a();break;case 27:n();break;case 38:case 40:"editor"==l&&(e.stopImmediatePropagation(),e.stopPropagation())}}),o.mask&&this.table.modules.edit.maskInput(s,o),s},range:function(e,t,i,n,o){function a(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!=r?i(e)&&(r=e):n()}var r=e.getValue(),l=document.createElement("input");if(l.setAttribute("type","range"),void 0!==o.max&&l.setAttribute("max",o.max),void 0!==o.min&&l.setAttribute("min",o.min),void 0!==o.step&&l.setAttribute("step",o.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var s in o.elementAttributes)"+"==s.charAt(0)?(s=s.slice(1),l.setAttribute(s,l.getAttribute(s)+o.elementAttributes["+"+s])):l.setAttribute(s,o.elementAttributes[s]);return l.value=r,t(function(){l.focus({preventScroll:!0}),l.style.height="100%"}),l.addEventListener("blur",function(e){a()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:a();break;case 27:n()}}),l},select:function(e,t,i,n,o){function a(t){var i,n={},a=y.table.getData();return i=t?y.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),i?(a.forEach(function(e){var t=i.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(n[t]=!0)}),n=o.sortValuesList?"asc"==o.sortValuesList?Object.keys(n).sort():Object.keys(n).sort().reverse():Object.keys(n)):console.warn("unable to find matching column to create select lookup list:",t),n}function r(t,i){function n(e){var e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return i.indexOf(e.value)>-1&&u(e),o.push(e),a.push(e),e}var o=[],a=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},a.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:e,value:e,element:!1},i.indexOf(t.value)>-1&&u(t),o.push(t),a.push(t))});else for(var r in t){var s={label:t[r],value:r,element:!1};i.indexOf(s.value)>-1&&u(s),o.push(s),a.push(s)}P=o,T=a,l()}function l(){for(;w.firstChild;)w.removeChild(w.firstChild);T.forEach(function(t){var i=t.element;if(!i){if(i=document.createElement("div"),t.label=o.listItemFormatter?o.listItemFormatter(t.value,t.label,e,i,t.itemParams):t.label,t.group?(i.classList.add("tabulator-edit-select-list-group"),i.tabIndex=0,i.innerHTML=""===t.label?" ":t.label):(i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=""===t.label?" ":t.label,i.addEventListener("click",function(){x?(c(t),L.focus()):m(t)}),I.indexOf(t)>-1&&i.classList.add("active")),t.elementAttributes&&"object"==_typeof(t.elementAttributes))for(var n in t.elementAttributes)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,L.getAttribute(n)+t.elementAttributes["+"+n])):i.setAttribute(n,t.elementAttributes[n]);i.addEventListener("mousedown",function(){S=!1,setTimeout(function(){S=!0},10)}),t.element=i}w.appendChild(i)})}function s(e,t){!x&&N&&N.element&&N.element.classList.remove("active"),N&&N.element&&N.element.classList.remove("focused"),N=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function u(e){-1==I.indexOf(e)&&(I.push(e),s(e,!0)),p()}function d(e){var t=I[e];e>-1&&(I.splice(e,1),t.element&&t.element.classList.remove("active"))}function c(e){e||(e=N);var t=I.indexOf(e);t>-1?d(t):(!0!==x&&I.length>=x&&d(0),u(e)),p()}function m(e){h(),e||(e=N),e&&i(e.value)}function f(){h();var e=[];I.forEach(function(t){e.push(t.value)}),i(e)}function p(){var e=[];I.forEach(function(t){e.push(t.label)}),L.value=e.join(", ")}function v(){h(),n()}function b(){if(!w.parentNode){!0===o.values?r(a(),C):"string"==typeof o.values?r(a(o.values),C):r(o.values||[],C);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",w.addEventListener("mousedown",function(e){S=!1,setTimeout(function(){S=!0},10)}),document.body.appendChild(w)}}function h(){w.parentNode&&w.parentNode.removeChild(w),g()}function g(){y.table.rowManager.element.removeEventListener("scroll",v)}var y=this,E=e.getElement(),A=e.getValue(),k=o.verticalNavigation||"editor",C=void 0!==A||null===A?A:void 0!==o.defaultValue?o.defaultValue:[],L=document.createElement("input"),w=document.createElement("div"),x=o.multiselect,P=[],N={},T=[],I=[],S=!0;if(this.table.rowManager.element.addEventListener("scroll",v),(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":_typeof(o))&&!o.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),o={values:o}),L.setAttribute("type","text"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",L.style.cursor="default",L.readOnly=0!=this.currentCell,o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var O in o.elementAttributes)"+"==O.charAt(0)?(O=O.slice(1),L.setAttribute(O,L.getAttribute(O)+o.elementAttributes["+"+O])):L.setAttribute(O,o.elementAttributes[O]);return L.value=void 0!==A||null===A?A:"",L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=P.indexOf(N),("editor"==k||"hybrid"==k&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&s(P[t-1],!x));break;case 40:t=P.indexOf(N),("editor"==k||"hybrid"==k&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&a.push(t)}),c(a,t))}function s(e){var t=document.createElement("div");d(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,w.appendChild(t))}function u(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var i={};"object"===(void 0===e?"undefined":_typeof(e))?(i.title=o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,i.value=e.value):(i.title=o.listItemFormatter?o.listItemFormatter(e,e):e,i.value=e),t.push(i)});else for(var i in e){var n={title:o.listItemFormatter?o.listItemFormatter(i,e[i]):e[i],value:i};t.push(n)}return t}function d(){for(;w.firstChild;)w.removeChild(w.firstChild)}function c(e,t){e.length?m(e,t):o.emptyPlaceholder&&s(o.emptyPlaceholder)}function m(e,t){var i=!1;d(),x=e,x.forEach(function(e){var n=e.element;n||(n=document.createElement("div"),n.classList.add("tabulator-edit-select-list-item"),n.tabIndex=0,n.innerHTML=e.title,n.addEventListener("click",function(t){v(e),f()}),n.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),e.element=n,t&&e.value==A&&(L.value=e.title,e.element.classList.add("active"),i=!0),e===P&&(e.element.classList.add("active"),i=!0)),w.appendChild(n)}),i||v(!1)}function f(){b(),P?A!==P.value?(A=P.value,L.value=P.title,i(P.value)):n():o.freetext?(A=L.value,i(L.value)):o.allowEmpty&&""===L.value?(A=L.value,i(L.value)):n()}function p(){if(!w.parentNode){for(;w.firstChild;)w.removeChild(w.firstChild);var e=Tabulator.prototype.helpers.elOffset(E);w.style.minWidth=E.offsetWidth+"px",w.style.top=e.top+E.offsetHeight+"px",w.style.left=e.left+"px",document.body.appendChild(w)}}function v(e,t){P&&P.element&&P.element.classList.remove("active"),P=e,e&&e.element&&e.element.classList.add("active")}function b(){w.parentNode&&w.parentNode.removeChild(w),g()}function h(){b(),n()}function g(){y.table.rowManager.element.removeEventListener("scroll",h)}var y=this,E=e.getElement(),A=e.getValue(),k=o.verticalNavigation||"editor",C=void 0!==A||null===A?A:void 0!==o.defaultValue?o.defaultValue:"",L=document.createElement("input"),w=document.createElement("div"),x=[],P=!1,N=!0,T=!1;if(this.table.rowManager.element.addEventListener("scroll",h),L.setAttribute("type","search"),L.style.padding="4px",L.style.width="100%",L.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var I in o.elementAttributes)"+"==I.charAt(0)?(I=I.slice(1),L.setAttribute(I,L.getAttribute(I)+o.elementAttributes["+"+I])):L.setAttribute(I,o.elementAttributes[I]);return w.classList.add("tabulator-edit-select-list"),w.addEventListener("mousedown",function(e){N=!1,setTimeout(function(){N=!0},10)}),L.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=x.indexOf(P),("editor"==k||"hybrid"==k&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),v(t>0?x[t-1]:!1));break;case 40:t=x.indexOf(P),("editor"==k||"hybrid"==k&&t'):("ie"==l.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){u=e,a(e)}var l=this,s=e.getElement(),u=e.getValue(),d=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",p.setAttribute("width",c),p.setAttribute("height",c),p.setAttribute("viewBox","0 0 512 512"),p.setAttribute("xml:space","preserve"),p.style.padding="0 1px",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),f.setAttribute(v,f.getAttribute(v)+o.elementAttributes["+"+v])):f.setAttribute(v,o.elementAttributes[v]);for(var b=1;b<=d;b++)!function(e){var t=document.createElement("span"),n=p.cloneNode(!0);m.push(n),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),a(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),s.blur()}),t.appendChild(n),f.appendChild(t)}(b);return u=Math.min(parseInt(u),d),a(u),f.addEventListener("mousemove",function(e){a(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(u+1);break;case 37:r(u-1);break;case 13:i(u);break;case 27:n()}}),f},progress:function(e,t,i,n,o){function a(){var e=c*Math.round(p.offsetWidth/(s.clientWidth/100))+d;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var r,l,s=e.getElement(),u=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,d=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,c=(u-d)/100,m=e.getValue()||0,f=document.createElement("div"),p=document.createElement("div");if(f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var v in o.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),p.setAttribute(v,p.getAttribute(v)+o.elementAttributes["+"+v])):p.setAttribute(v,o.elementAttributes[v]);return s.style.padding="4px 4px",m=Math.min(parseFloat(m),u),m=Math.max(parseFloat(m),d),m=Math.round((m-d)/c),p.style.width=m+"%",s.setAttribute("aria-valuemin",d),s.setAttribute("aria-valuemax",u),p.appendChild(f),f.addEventListener("mousedown",function(e){r=e.screenX,l=p.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){r&&(p.style.width=l+e.screenX-r+"px")}),s.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,l=!1,a())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+s.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-s.clientWidth/100+"px";break;case 9:case 13:a();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),p},tickCross:function(e,t,i,n,o){function a(e){return s?e?d?u:l.checked:l.checked&&!d?(l.checked=!1,l.indeterminate=!0,d=!0,u):(d=!1,l.checked):l.checked}var r=e.getValue(),l=document.createElement("input"),s=o.tristate,u=void 0===o.indeterminateValue?null:o.indeterminateValue,d=!1;if(l.setAttribute("type","checkbox"),l.style.marginTop="5px",l.style.boxSizing="border-box",o.elementAttributes&&"object"==_typeof(o.elementAttributes))for(var c in o.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+o.elementAttributes["+"+c])):l.setAttribute(c,o.elementAttributes[c]);return l.value=r,!s||void 0!==r&&r!==u&&""!==r||(d=!0,l.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){l.focus({preventScroll:!0})}),l.checked=!0===r||"true"===r||"True"===r||1===r,l.addEventListener("change",function(e){i(a())}),l.addEventListener("blur",function(e){i(a(!0))}),l.addEventListener("keydown",function(e){13==e.keyCode&&i(a()),27==e.keyCode&&n()}),l}},Tabulator.prototype.registerModule("edit",Edit); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/export.js b/app/static/vendors/tabulator/js/modules/export.js deleted file mode 100644 index 18d3f6c..0000000 --- a/app/static/vendors/tabulator/js/modules/export.js +++ /dev/null @@ -1,616 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ExportRow = function ExportRow(type, columns, component, indent) { - this.type = type; - this.columns = columns; - this.component = component || false; - this.indent = indent || 0; -}; - -var ExportColumn = function ExportColumn(value, component, width, height, depth) { - this.value = value; - this.component = component || false; - this.width = width; - this.height = height; - this.depth = depth; -}; - -var Export = function Export(table) { - this.table = table; //hold Tabulator object - this.config = {}; - this.cloneTableStyle = true; - this.colVisProp = ""; -}; - -Export.prototype.generateExportList = function (config, style, range, colVisProp) { - this.cloneTableStyle = style; - this.config = config || {}; - this.colVisProp = colVisProp; - - var headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : []; - var body = this.bodyToExportRows(this.rowLookup(range)); - - return headers.concat(body); -}; - -Export.prototype.genereateTable = function (config, style, range, colVisProp) { - var list = this.generateExportList(config, style, range, colVisProp); - - return this.genereateTableElement(list); -}; - -Export.prototype.rowLookup = function (range) { - var _this = this; - - var rows = []; - - if (typeof range == "function") { - range.call(this.table).forEach(function (row) { - row = _this.table.rowManager.findRow(row); - - if (row) { - rows.push(row); - } - }); - } else { - switch (range) { - case true: - case "visible": - rows = this.table.rowManager.getVisibleRows(true); - break; - - case "all": - rows = this.table.rowManager.rows; - break; - - case "selected": - rows = this.table.modules.selectRow.selectedRows; - break; - - case "active": - default: - rows = this.table.rowManager.getDisplayRows(); - } - } - - return Object.assign([], rows); -}; - -Export.prototype.generateColumnGroupHeaders = function () { - var _this2 = this; - - var output = []; - - var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex; - - columns.forEach(function (column) { - var colData = _this2.processColumnGroup(column); - - if (colData) { - output.push(colData); - } - }); - - return output; -}; - -Export.prototype.processColumnGroup = function (column) { - var _this3 = this; - - var subGroups = column.columns, - maxDepth = 0, - title = column.definition["title" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title; - - var groupData = { - title: title, - column: column, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this3.processColumnGroup(subGroup); - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (this.columnVisCheck(column)) { - groupData.width = 1; - } else { - return false; - } - } - - return groupData; -}; - -Export.prototype.columnVisCheck = function (column) { - return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]); -}; - -Export.prototype.headersToExportRows = function (columns) { - var headers = [], - headerDepth = 0, - exportRows = []; - - function parseColumnGroup(column, level) { - - var depth = headerDepth - level; - - if (typeof headers[level] === "undefined") { - headers[level] = []; - } - - column.height = column.subGroups ? 1 : depth - column.depth + 1; - - headers[level].push(column); - - if (column.height > 1) { - for (var _i = 1; _i < column.height; _i++) { - - if (typeof headers[level + _i] === "undefined") { - headers[level + _i] = []; - } - - headers[level + _i].push(false); - } - } - - if (column.width > 1) { - for (var _i2 = 1; _i2 < column.width; _i2++) { - headers[level].push(false); - } - } - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } - } - - //calculate maximum header debth - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - headers.forEach(function (header) { - var columns = []; - - header.forEach(function (col) { - if (col) { - columns.push(new ExportColumn(col.title, col.column.getComponent(), col.width, col.height, col.depth)); - } else { - columns.push(null); - } - }); - - exportRows.push(new ExportRow("header", columns)); - }); - - return exportRows; -}; - -Export.prototype.bodyToExportRows = function (rows) { - var _this4 = this; - - var columns = []; - var exportRows = []; - - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (_this4.columnVisCheck(column)) { - columns.push(column.getComponent()); - } - }); - - if (this.config.columnCalcs !== false && this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized) { - rows.unshift(this.table.modules.columnCalcs.topRow); - } - - if (this.table.modules.columnCalcs.botInitialized) { - rows.push(this.table.modules.columnCalcs.botRow); - } - } - - rows = rows.filter(function (row) { - switch (row.type) { - case "group": - return _this4.config.rowGroups !== false; - break; - - case "calc": - return _this4.config.columnCalcs !== false; - break; - - case "row": - return !(_this4.table.options.dataTree && _this4.config.dataTree === false && row.modules.dataTree.parent); - break; - } - - return true; - }); - - rows.forEach(function (row, i) { - var rowData = row.getData(_this4.colVisProp); - var exportCols = []; - var indent = 0; - - switch (row.type) { - case "group": - indent = row.level; - exportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1)); - break; - - case "calc": - case "row": - columns.forEach(function (col) { - exportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1)); - }); - - if (_this4.table.options.dataTree && _this4.config.dataTree !== false) { - indent = row.modules.dataTree.index; - } - break; - } - - exportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent)); - }); - - return exportRows; -}; - -Export.prototype.genereateTableElement = function (list) { - var _this5 = this; - - var table = document.createElement("table"), - headerEl = document.createElement("thead"), - bodyEl = document.createElement("tbody"), - styles = this.lookupTableStyles(), - rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))], - setup = {}; - - setup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter; - - if (this.table.options.dataTree && this.config.dataTree !== false && this.table.modExists("columnCalcs")) { - setup.treeElementField = this.table.modules.dataTree.elementField; - } - - //assign group header formatter - setup.groupHeader = this.table.options["groupHeader" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))]; - - if (setup.groupHeader && !Array.isArray(setup.groupHeader)) { - setup.groupHeader = [setup.groupHeader]; - } - - table.classList.add("tabulator-print-table"); - - this.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - - if (list.length > 1000) { - console.warn("It may take a long time to render an HTML table with more than 1000 rows"); - } - - list.forEach(function (row, i) { - switch (row.type) { - case "header": - headerEl.appendChild(_this5.genereateHeaderElement(row, setup, styles)); - break; - - case "group": - bodyEl.appendChild(_this5.genereateGroupElement(row, setup, styles)); - break; - - case "calc": - bodyEl.appendChild(_this5.genereateCalcElement(row, setup, styles)); - break; - - case "row": - var rowEl = _this5.genereateRowElement(row, setup, styles); - _this5.mapElementStyles(i % 2 && styles.evenRow ? styles.evenRow : styles.oddRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - bodyEl.appendChild(rowEl); - break; - } - }); - - if (headerEl.innerHTML) { - table.appendChild(headerEl); - } - - table.appendChild(bodyEl); - - this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]); - return table; -}; - -Export.prototype.lookupTableStyles = function () { - var styles = {}; - - //lookup row styles - if (this.cloneTableStyle && window.getComputedStyle) { - styles.oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"); - styles.evenRow = this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"); - styles.calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs"); - styles.firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"); - styles.firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0]; - - if (styles.firstRow) { - styles.styleCells = styles.firstRow.getElementsByClassName("tabulator-cell"); - styles.firstCell = styles.styleCells[0]; - styles.lastCell = styles.styleCells[styles.styleCells.length - 1]; - } - } - - return styles; -}; - -Export.prototype.genereateHeaderElement = function (row, setup, styles) { - var _this6 = this; - - var rowEl = document.createElement("tr"); - - row.columns.forEach(function (column) { - if (column) { - var cellEl = document.createElement("th"); - var classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(" ") : []; - - cellEl.colSpan = column.width; - cellEl.rowSpan = column.height; - - cellEl.innerHTML = column.value; - - if (_this6.cloneTableStyle) { - cellEl.style.boxSizing = "border-box"; - } - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - _this6.mapElementStyles(column.component.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - _this6.mapElementStyles(column.component._column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - if (column.component._column.visible) { - _this6.mapElementStyles(column.component.getElement(), cellEl, ["width"]); - } else { - if (column.component._column.definition.width) { - cellEl.style.width = column.component._column.definition.width + "px"; - } - } - - if (column.component._column.parent) { - _this6.mapElementStyles(column.component._column.parent.groupElement, cellEl, ["border-top"]); - } - - rowEl.appendChild(cellEl); - } - }); - - return rowEl; -}; - -Export.prototype.genereateGroupElement = function (row, setup, styles) { - - var rowEl = document.createElement("tr"), - cellEl = document.createElement("td"), - group = row.columns[0]; - - rowEl.classList.add("tabulator-print-table-row"); - - if (setup.groupHeader && setup.groupHeader[row.indent]) { - group.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } else { - if (setup.groupHeader === false) { - group.value = group.value; - } else { - group.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } - } - - cellEl.colSpan = group.width; - cellEl.innerHTML = group.value; - - rowEl.classList.add("tabulator-print-table-group"); - rowEl.classList.add("tabulator-group-level-" + row.indent); - - if (group.component.getVisibility()) { - rowEl.classList.add("tabulator-group-visible"); - } - - this.mapElementStyles(styles.firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - this.mapElementStyles(styles.firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - rowEl.appendChild(cellEl); - - return rowEl; -}; - -Export.prototype.genereateCalcElement = function (row, setup, styles) { - var rowEl = this.genereateRowElement(row, setup, styles); - - rowEl.classList.add("tabulator-print-table-calcs"); - this.mapElementStyles(styles.calcRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - - return rowEl; -}; - -Export.prototype.genereateRowElement = function (row, setup, styles) { - var _this7 = this; - - var rowEl = document.createElement("tr"); - - rowEl.classList.add("tabulator-print-table-row"); - - row.columns.forEach(function (col) { - - if (col) { - var cellEl = document.createElement("td"), - column = col.component._column, - value = col.value; - - var cellWrapper = { - modules: {}, - getValue: function getValue() { - return value; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return cellEl; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getData: function getData() { - return rowData; - }, - getRow: function getRow() { - return row.getComponent(); - }, - getComponent: function getComponent() { - return cellWrapper; - }, - column: column - }; - - var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : []; - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - if (_this7.table.modExists("format") && _this7.config.formatCells !== false) { - value = _this7.table.modules.format.formatExportValue(cellWrapper, _this7.colVisProp); - } else { - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - } - - if (value instanceof Node) { - cellEl.appendChild(value); - } else { - cellEl.innerHTML = value; - } - - if (styles.firstCell) { - _this7.mapElementStyles(styles.firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size"]); - - if (column.definition.align) { - cellEl.style.textAlign = column.definition.align; - } - } - - if (_this7.table.options.dataTree && _this7.config.dataTree !== false) { - if (setup.treeElementField && setup.treeElementField == column.field || !setup.treeElementField && i == 0) { - if (row.component._row.modules.dataTree.controlEl) { - cellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild); - } - if (row.component._row.modules.dataTree.branchEl) { - cellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild); - } - } - } - - rowEl.appendChild(cellEl); - - if (cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback) { - cellWrapper.modules.format.renderedCallback(); - } - - if (setup.rowFormatter && _this7.config.formatCells !== false) { - var rowComponent = row.getComponent(); - - rowComponent.getElement = function () { - return rowEl; - }; - - setup.rowFormatter(rowComponent); - } - } - }); - - return rowEl; -}; - -Export.prototype.genereateHTMLTable = function (list) { - var holder = document.createElement("div"); - - holder.appendChild(this.genereateTableElement(list)); - - return holder.innerHTML; -}; - -Export.prototype.getHtml = function (visible, style, config, colVisProp) { - var list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput"); - - return this.genereateHTMLTable(list); -}; - -Export.prototype.mapElementStyles = function (from, to, props) { - if (this.cloneTableStyle && from && to) { - - var lookup = { - "background-color": "backgroundColor", - "color": "fontColor", - "width": "width", - "font-weight": "fontWeight", - "font-family": "fontFamily", - "font-size": "fontSize", - "text-align": "textAlign", - "border-top": "borderTop", - "border-left": "borderLeft", - "border-right": "borderRight", - "border-bottom": "borderBottom", - "padding-top": "paddingTop", - "padding-left": "paddingLeft", - "padding-right": "paddingRight", - "padding-bottom": "paddingBottom" - }; - - if (window.getComputedStyle) { - var fromStyle = window.getComputedStyle(from); - - props.forEach(function (prop) { - to.style[lookup[prop]] = fromStyle.getPropertyValue(prop); - }); - } - } -}; - -Tabulator.prototype.registerModule("export", Export); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/export.min.js b/app/static/vendors/tabulator/js/modules/export.min.js deleted file mode 100644 index d0dcccd..0000000 --- a/app/static/vendors/tabulator/js/modules/export.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ExportRow=function(t,e,o,r){this.type=t,this.columns=e,this.component=o||!1,this.indent=r||0},ExportColumn=function(t,e,o,r,n){this.value=t,this.component=e||!1,this.width=o,this.height=r,this.depth=n},Export=function(t){this.table=t,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};Export.prototype.generateExportList=function(t,e,o,r){this.cloneTableStyle=e,this.config=t||{},this.colVisProp=r;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],l=this.bodyToExportRows(this.rowLookup(o));return n.concat(l)},Export.prototype.genereateTable=function(t,e,o,r){var n=this.generateExportList(t,e,o,r);return this.genereateTableElement(n)},Export.prototype.rowLookup=function(t){var e=this,o=[];if("function"==typeof t)t.call(this.table).forEach(function(t){(t=e.table.rowManager.findRow(t))&&o.push(t)});else switch(t){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},Export.prototype.generateColumnGroupHeaders=function(){var t=this,e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var r=t.processColumnGroup(o);r&&e.push(r)}),e},Export.prototype.processColumnGroup=function(t){var e=this,o=t.columns,r=0,n=t.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||t.definition.title,l={title:n,column:t,depth:1};if(o.length){if(l.subGroups=[],l.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(l.width+=o.width,l.subGroups.push(o),o.depth>r&&(r=o.depth))}),l.depth+=r,!l.width)return!1}else{if(!this.columnVisCheck(t))return!1;l.width=1}return l},Export.prototype.columnVisCheck=function(t){return!1!==t.definition[this.colVisProp]&&(t.visible||!t.visible&&t.definition[this.colVisProp])},Export.prototype.headersToExportRows=function(t){function e(t,n){var l=r-n;if(void 0===o[n]&&(o[n]=[]),t.height=t.subGroups?1:l-t.depth+1,o[n].push(t),t.height>1)for(var a=1;a1)for(var i=1;ir&&(r=t.depth)}),t.forEach(function(t){e(t,0)}),o.forEach(function(t){var e=[];t.forEach(function(t){t?e.push(new ExportColumn(t.title,t.column.getComponent(),t.width,t.height,t.depth)):e.push(null)}),n.push(new ExportRow("header",e))}),n},Export.prototype.bodyToExportRows=function(t){var e=this,o=[],r=[];return this.table.columnManager.columnsByIndex.forEach(function(t){e.columnVisCheck(t)&&o.push(t.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),t=t.filter(function(t){switch(t.type){case"group":return!1!==e.config.rowGroups;case"calc":return!1!==e.config.columnCalcs;case"row":return!(e.table.options.dataTree&&!1===e.config.dataTree&&t.modules.dataTree.parent)}return!0}),t.forEach(function(t,n){var l=t.getData(e.colVisProp),a=[],i=0;switch(t.type){case"group":i=t.level,a.push(new ExportColumn(t.key,t.getComponent(),o.length,1));break;case"calc":case"row":o.forEach(function(t){a.push(new ExportColumn(t._column.getFieldValue(l),t,1,1))}),e.table.options.dataTree&&!1!==e.config.dataTree&&(i=t.modules.dataTree.index)}r.push(new ExportRow(t.type,a,t.getComponent(),i))}),r},Export.prototype.genereateTableElement=function(t){var e=this,o=document.createElement("table"),r=document.createElement("thead"),n=document.createElement("tbody"),l=this.lookupTableStyles(),a=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],i={};return i.rowFormatter=null!==a?a:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(i.treeElementField=this.table.modules.dataTree.elementField),i.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],i.groupHeader&&!Array.isArray(i.groupHeader)&&(i.groupHeader=[i.groupHeader]),o.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),r,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach(function(t,o){switch(t.type){case"header":r.appendChild(e.genereateHeaderElement(t,i,l));break;case"group":n.appendChild(e.genereateGroupElement(t,i,l));break;case"calc":n.appendChild(e.genereateCalcElement(t,i,l));break;case"row":var a=e.genereateRowElement(t,i,l);e.mapElementStyles(o%2&&l.evenRow?l.evenRow:l.oddRow,a,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(a)}}),r.innerHTML&&o.appendChild(r),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},Export.prototype.lookupTableStyles=function(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t},Export.prototype.genereateHeaderElement=function(t,e,o){var r=this,n=document.createElement("tr");return t.columns.forEach(function(t){if(t){var e=document.createElement("th"),o=t.component._column.definition.cssClass?t.component._column.definition.cssClass.split(" "):[];e.colSpan=t.width,e.rowSpan=t.height,e.innerHTML=t.value,r.cloneTableStyle&&(e.style.boxSizing="border-box"),o.forEach(function(t){e.classList.add(t)}),r.mapElementStyles(t.component.getElement(),e,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),r.mapElementStyles(t.component._column.contentElement,e,["padding-top","padding-left","padding-right","padding-bottom"]),t.component._column.visible?r.mapElementStyles(t.component.getElement(),e,["width"]):t.component._column.definition.width&&(e.style.width=t.component._column.definition.width+"px"),t.component._column.parent&&r.mapElementStyles(t.component._column.parent.groupElement,e,["border-top"]),n.appendChild(e)}}),n},Export.prototype.genereateGroupElement=function(t,e,o){var r=document.createElement("tr"),n=document.createElement("td"),l=t.columns[0];return r.classList.add("tabulator-print-table-row"),e.groupHeader&&e.groupHeader[t.indent]?l.value=e.groupHeader[t.indent](l.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):!1===e.groupHeader?l.value=l.value:l.value=t.component._group.generator(l.value,t.component._group.getRowCount(),t.component._group.getData(),t.component),n.colSpan=l.width,n.innerHTML=l.value,r.classList.add("tabulator-print-table-group"),r.classList.add("tabulator-group-level-"+t.indent),l.component.getVisibility()&&r.classList.add("tabulator-group-visible"),this.mapElementStyles(o.firstGroup,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(o.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),r.appendChild(n),r},Export.prototype.genereateCalcElement=function(t,e,o){var r=this.genereateRowElement(t,e,o);return r.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(o.calcRow,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),r},Export.prototype.genereateRowElement=function(t,e,o){var r=this,n=document.createElement("tr");return n.classList.add("tabulator-print-table-row"),t.columns.forEach(function(l){if(l){var a=document.createElement("td"),s=l.component._column,p=l.value,c={modules:{},getValue:function(){return p},getField:function(){return s.definition.field},getElement:function(){return a},getColumn:function(){return s.getComponent()},getData:function(){return rowData},getRow:function(){return t.getComponent()},getComponent:function(){return c},column:s};if((s.definition.cssClass?s.definition.cssClass.split(" "):[]).forEach(function(t){a.classList.add(t)}),r.table.modExists("format")&&!1!==r.config.formatCells)p=r.table.modules.format.formatExportValue(c,r.colVisProp);else switch(void 0===p?"undefined":_typeof(p)){case"object":p=JSON.stringify(p);break;case"undefined":case"null":p="";break;default:p=p}if(p instanceof Node?a.appendChild(p):a.innerHTML=p,o.firstCell&&(r.mapElementStyles(o.firstCell,a,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),s.definition.align&&(a.style.textAlign=s.definition.align)),r.table.options.dataTree&&!1!==r.config.dataTree&&(e.treeElementField&&e.treeElementField==s.field||!e.treeElementField&&0==i)&&(t.component._row.modules.dataTree.controlEl&&a.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),t.component._row.modules.dataTree.branchEl&&a.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),n.appendChild(a),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback(),e.rowFormatter&&!1!==r.config.formatCells){var u=t.getComponent();u.getElement=function(){return n},e.rowFormatter(u)}}}),n},Export.prototype.genereateHTMLTable=function(t){var e=document.createElement("div");return e.appendChild(this.genereateTableElement(t)),e.innerHTML},Export.prototype.getHtml=function(t,e,o,r){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,e,t,r||"htmlOutput");return this.genereateHTMLTable(n)},Export.prototype.mapElementStyles=function(t,e,o){if(this.cloneTableStyle&&t&&e){var r={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(t);o.forEach(function(t){e.style[r[t]]=n.getPropertyValue(t)})}}},Tabulator.prototype.registerModule("export",Export); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/filter.js b/app/static/vendors/tabulator/js/modules/filter.js deleted file mode 100644 index aaed59b..0000000 --- a/app/static/vendors/tabulator/js/modules/filter.js +++ /dev/null @@ -1,807 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Filter = function Filter(table) { - - this.table = table; //hold Tabulator object - - this.filterList = []; //hold filter list - this.headerFilters = {}; //hold column filters - this.headerFilterColumns = []; //hold columns that use header filters - - this.prevHeaderFilterChangeCheck = ""; - this.prevHeaderFilterChangeCheck = "{}"; - - this.changed = false; //has filtering changed since last render -}; - -//initialize column header filter -Filter.prototype.initializeColumn = function (column, value) { - var self = this, - field = column.getField(), - params; - - //handle successfull value change - function success(value) { - var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match", - type = "", - filterChangeCheck = "", - filterFunc; - - if (typeof column.modules.filter.prevSuccess === "undefined" || column.modules.filter.prevSuccess !== value) { - - column.modules.filter.prevSuccess = value; - - if (!column.modules.filter.emptyFunc(value)) { - column.modules.filter.value = value; - - switch (_typeof(column.definition.headerFilterFunc)) { - case "string": - if (self.filters[column.definition.headerFilterFunc]) { - type = column.definition.headerFilterFunc; - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return self.filters[column.definition.headerFilterFunc](value, fieldVal, data, params); - }; - } else { - console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc); - } - break; - - case "function": - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return column.definition.headerFilterFunc(value, fieldVal, data, params); - }; - - type = filterFunc; - break; - } - - if (!filterFunc) { - switch (filterType) { - case "partial": - filterFunc = function filterFunc(data) { - var colVal = column.getFieldValue(data); - - if (typeof colVal !== 'undefined' && colVal !== null) { - return String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1; - } else { - return false; - } - }; - type = "like"; - break; - - default: - filterFunc = function filterFunc(data) { - return column.getFieldValue(data) == value; - }; - type = "="; - } - } - - self.headerFilters[field] = { value: value, func: filterFunc, type: type, params: params || {} }; - } else { - delete self.headerFilters[field]; - } - - filterChangeCheck = JSON.stringify(self.headerFilters); - - if (self.prevHeaderFilterChangeCheck !== filterChangeCheck) { - self.prevHeaderFilterChangeCheck = filterChangeCheck; - - self.changed = true; - self.table.rowManager.filterRefresh(); - } - } - - return true; - } - - column.modules.filter = { - success: success, - attrType: false, - tagType: false, - emptyFunc: false - }; - - this.generateHeaderFilterElement(column); -}; - -Filter.prototype.generateHeaderFilterElement = function (column, initialValue, reinitialize) { - var _this = this; - - var self = this, - success = column.modules.filter.success, - field = column.getField(), - filterElement, - editor, - editorElement, - cellWrapper, - typingTimer, - searchTrigger, - params; - - //handle aborted edit - function cancel() {} - - if (column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode) { - column.contentElement.removeChild(column.modules.filter.headerElement.parentNode); - } - - if (field) { - - //set empty value function - column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) { - return !value && value !== "0"; - }; - - filterElement = document.createElement("div"); - filterElement.classList.add("tabulator-header-filter"); - - //set column editor - switch (_typeof(column.definition.headerFilter)) { - case "string": - if (self.table.modules.edit.editors[column.definition.headerFilter]) { - editor = self.table.modules.edit.editors[column.definition.headerFilter]; - - if ((column.definition.headerFilter === "tick" || column.definition.headerFilter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - console.warn("Filter Error - Cannot build header filter, No such editor found: ", column.definition.editor); - } - break; - - case "function": - editor = column.definition.headerFilter; - break; - - case "boolean": - if (column.modules.edit && column.modules.edit.editor) { - editor = column.modules.edit.editor; - } else { - if (column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]) { - editor = self.table.modules.edit.editors[column.definition.formatter]; - - if ((column.definition.formatter === "tick" || column.definition.formatter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - editor = self.table.modules.edit.editors["input"]; - } - } - break; - } - - if (editor) { - - cellWrapper = { - getValue: function getValue() { - return typeof initialValue !== "undefined" ? initialValue : ""; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return filterElement; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getRow: function getRow() { - return { - normalizeHeight: function normalizeHeight() {} - }; - } - }; - - params = column.definition.headerFilterParams || {}; - - params = typeof params === "function" ? params.call(self.table) : params; - - editorElement = editor.call(this.table.modules.edit, cellWrapper, function () {}, success, cancel, params); - - if (!editorElement) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor returned a value of false"); - return; - } - - if (!(editorElement instanceof Node)) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor should return an instance of Node, the editor returned:", editorElement); - return; - } - - //set Placeholder Text - if (field) { - self.table.modules.localize.bind("headerFilters|columns|" + column.definition.field, function (value) { - editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.table.modules.localize.getText("headerFilters|default")); - }); - } else { - self.table.modules.localize.bind("headerFilters|default", function (value) { - editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value); - }); - } - - //focus on element on click - editorElement.addEventListener("click", function (e) { - e.stopPropagation(); - editorElement.focus(); - }); - - editorElement.addEventListener("focus", function (e) { - var left = _this.table.columnManager.element.scrollLeft; - - if (left !== _this.table.rowManager.element.scrollLeft) { - _this.table.rowManager.scrollHorizontal(left); - _this.table.columnManager.scrollHorizontal(left); - } - }); - - //live update filters as user types - typingTimer = false; - - searchTrigger = function searchTrigger(e) { - if (typingTimer) { - clearTimeout(typingTimer); - } - - typingTimer = setTimeout(function () { - success(editorElement.value); - }, self.table.options.headerFilterLiveFilterDelay); - }; - - column.modules.filter.headerElement = editorElement; - column.modules.filter.attrType = editorElement.hasAttribute("type") ? editorElement.getAttribute("type").toLowerCase() : ""; - column.modules.filter.tagType = editorElement.tagName.toLowerCase(); - - if (column.definition.headerFilterLiveFilter !== false) { - - if (!(column.definition.headerFilter === 'autocomplete' || column.definition.headerFilter === 'tickCross' || (column.definition.editor === 'autocomplete' || column.definition.editor === 'tickCross') && column.definition.headerFilter === true)) { - editorElement.addEventListener("keyup", searchTrigger); - editorElement.addEventListener("search", searchTrigger); - - //update number filtered columns on change - if (column.modules.filter.attrType == "number") { - editorElement.addEventListener("change", function (e) { - success(editorElement.value); - }); - } - - //change text inputs to search inputs to allow for clearing of field - if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") { - editorElement.setAttribute("type", "search"); - // editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click - } - } - - //prevent input and select elements from propegating click to column sorters etc - if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") { - editorElement.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - } - } - - filterElement.appendChild(editorElement); - - column.contentElement.appendChild(filterElement); - - if (!reinitialize) { - self.headerFilterColumns.push(column); - } - } - } else { - console.warn("Filter Error - Cannot add header filter, column has no field set:", column.definition.title); - } -}; - -//hide all header filter elements (used to ensure correct column widths in "fitData" layout mode) -Filter.prototype.hideHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = 'none'; - } - }); -}; - -//show all header filter elements (used to ensure correct column widths in "fitData" layout mode) -Filter.prototype.showHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = ''; - } - }); -}; - -//programatically set focus of header filter -Filter.prototype.setHeaderFilterFocus = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.focus(); - } else { - console.warn("Column Filter Focus Error - No header filter set on column:", column.getField()); - } -}; - -//programmatically get value of header filter -Filter.prototype.getHeaderFilterValue = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - return column.modules.filter.headerElement.value; - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } -}; - -//programatically set value of header filter -Filter.prototype.setHeaderFilterValue = function (column, value) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, value, true); - column.modules.filter.success(value); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } -}; - -Filter.prototype.reloadHeaderFilter = function (column) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, column.modules.filter.value, true); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } -}; - -//check if the filters has changed since last use -Filter.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; -}; - -//set standard filters -Filter.prototype.setFilter = function (field, type, value, params) { - var self = this; - - self.filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value, params: params }]; - } - - self.addFilter(field); -}; - -//add filter to array -Filter.prototype.addFilter = function (field, type, value, params) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value, params: params }]; - } - - field.forEach(function (filter) { - - filter = self.findFilter(filter); - - if (filter) { - self.filterList.push(filter); - - self.changed = true; - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -Filter.prototype.findFilter = function (filter) { - var self = this, - column; - - if (Array.isArray(filter)) { - return this.findSubFilters(filter); - } - - var filterFunc = false; - - if (typeof filter.field == "function") { - filterFunc = function filterFunc(data) { - return filter.field(data, filter.type || {}); // pass params to custom filter function - }; - } else { - - if (self.filters[filter.type]) { - - column = self.table.columnManager.getColumnByField(filter.field); - - if (column) { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {}); - }; - } else { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, data[filter.field], data, filter.params || {}); - }; - } - } else { - console.warn("Filter Error - No such filter type found, ignoring: ", filter.type); - } - } - - filter.func = filterFunc; - - return filter.func ? filter : false; -}; - -Filter.prototype.findSubFilters = function (filters) { - var self = this, - output = []; - - filters.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - output.push(filter); - } - }); - - return output.length ? output : false; -}; - -//get all filters -Filter.prototype.getFilters = function (all, ajax) { - var output = []; - - if (all) { - output = this.getHeaderFilters(); - } - - if (ajax) { - output.forEach(function (item) { - if (typeof item.type == "function") { - item.type = "function"; - } - }); - } - - output = output.concat(this.filtersToArray(this.filterList, ajax)); - - return output; -}; - -//filter to Object -Filter.prototype.filtersToArray = function (filterList, ajax) { - var _this2 = this; - - var output = []; - - filterList.forEach(function (filter) { - var item; - - if (Array.isArray(filter)) { - output.push(_this2.filtersToArray(filter, ajax)); - } else { - item = { field: filter.field, type: filter.type, value: filter.value }; - - if (ajax) { - if (typeof item.type == "function") { - item.type = "function"; - } - } - - output.push(item); - } - }); - - return output; -}; - -//get all filters -Filter.prototype.getHeaderFilters = function () { - var self = this, - output = []; - - for (var key in this.headerFilters) { - output.push({ field: key, type: this.headerFilters[key].type, value: this.headerFilters[key].value }); - } - - return output; -}; - -//remove filter from array -Filter.prototype.removeFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - var index = -1; - - if (_typeof(filter.field) == "object") { - index = self.filterList.findIndex(function (element) { - return filter === element; - }); - } else { - index = self.filterList.findIndex(function (element) { - return filter.field === element.field && filter.type === element.type && filter.value === element.value; - }); - } - - if (index > -1) { - self.filterList.splice(index, 1); - self.changed = true; - } else { - console.warn("Filter Error - No matching filter type found, ignoring: ", filter.type); - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -//clear filters -Filter.prototype.clearFilter = function (all) { - this.filterList = []; - - if (all) { - this.clearHeaderFilter(); - } - - this.changed = true; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } -}; - -//clear header filters -Filter.prototype.clearHeaderFilter = function () { - var self = this; - - this.headerFilters = {}; - self.prevHeaderFilterChangeCheck = "{}"; - - this.headerFilterColumns.forEach(function (column) { - column.modules.filter.value = null; - column.modules.filter.prevSuccess = undefined; - self.reloadHeaderFilter(column); - }); - - this.changed = true; -}; - -//search data and return matching rows -Filter.prototype.search = function (searchType, field, type, value) { - var self = this, - activeRows = [], - filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - filterList.push(filter); - } - }); - - this.table.rowManager.rows.forEach(function (row) { - var match = true; - - filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, row.getData())) { - match = false; - } - }); - - if (match) { - activeRows.push(searchType === "data" ? row.getData("data") : row.getComponent()); - } - }); - - return activeRows; -}; - -//filter row array -Filter.prototype.filter = function (rowList, filters) { - var self = this, - activeRows = [], - activeRowComponents = []; - - if (self.table.options.dataFiltering) { - self.table.options.dataFiltering.call(self.table, self.getFilters()); - } - - if (!self.table.options.ajaxFiltering && (self.filterList.length || Object.keys(self.headerFilters).length)) { - - rowList.forEach(function (row) { - if (self.filterRow(row)) { - activeRows.push(row); - } - }); - } else { - activeRows = rowList.slice(0); - } - - if (self.table.options.dataFiltered) { - - activeRows.forEach(function (row) { - activeRowComponents.push(row.getComponent()); - }); - - self.table.options.dataFiltered.call(self.table, self.getFilters(), activeRowComponents); - } - - return activeRows; -}; - -//filter individual row -Filter.prototype.filterRow = function (row, filters) { - var self = this, - match = true, - data = row.getData(); - - self.filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, data)) { - match = false; - } - }); - - for (var field in self.headerFilters) { - if (!self.headerFilters[field].func(data)) { - match = false; - } - } - - return match; -}; - -Filter.prototype.filterRecurse = function (filter, data) { - var self = this, - match = false; - - if (Array.isArray(filter)) { - filter.forEach(function (subFilter) { - if (self.filterRecurse(subFilter, data)) { - match = true; - } - }); - } else { - match = filter.func(data); - } - - return match; -}; - -//list of available filters -Filter.prototype.filters = { - - //equal to - "=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal == filterVal ? true : false; - }, - - //less than - "<": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal < filterVal ? true : false; - }, - - //less than or equal to - "<=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal <= filterVal ? true : false; - }, - - //greater than - ">": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal > filterVal ? true : false; - }, - - //greater than or equal to - ">=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal >= filterVal ? true : false; - }, - - //not equal to - "!=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal != filterVal ? true : false; - }, - - "regex": function regex(filterVal, rowVal, rowData, filterParams) { - - if (typeof filterVal == "string") { - filterVal = new RegExp(filterVal); - } - - return filterVal.test(rowVal); - }, - - //contains the string - "like": function like(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1; - } else { - return false; - } - } - }, - - //contains the keywords - "keywords": function keywords(filterVal, rowVal, rowData, filterParams) { - var keywords = filterVal.toLowerCase().split(typeof filterParams.separator === "undefined" ? " " : filterParams.separator), - value = String(rowVal === null || typeof rowVal === "undefined" ? "" : rowVal).toLowerCase(), - matches = []; - - keywords.forEach(function (keyword) { - if (value.includes(keyword)) { - matches.push(true); - } - }); - - return filterParams.matchAll ? matches.length === keywords.length : !!matches.length; - }, - - //starts with the string - "starts": function starts(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase()); - } else { - return false; - } - } - }, - - //ends with the string - "ends": function ends(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase()); - } else { - return false; - } - } - }, - - //in array - "in": function _in(filterVal, rowVal, rowData, filterParams) { - if (Array.isArray(filterVal)) { - return filterVal.indexOf(rowVal) > -1; - } else { - console.warn("Filter Error - filter value is not an array:", filterVal); - return false; - } - } -}; - -Tabulator.prototype.registerModule("filter", Filter); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/filter.min.js b/app/static/vendors/tabulator/js/modules/filter.min.js deleted file mode 100644 index 8be2662..0000000 --- a/app/static/vendors/tabulator/js/modules/filter.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Filter=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};Filter.prototype.initializeColumn=function(e,t){function r(t){var r,o="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",a="",s="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete n.headerFilters[l];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":n.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,r=function(r){var i=e.definition.headerFilterFuncParams||{},l=e.getFieldValue(r);return i="function"==typeof i?i(t,l,r):i,n.filters[e.definition.headerFilterFunc](t,l,r,i)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=function(r){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(r);return i="function"==typeof i?i(t,n,r):i,e.definition.headerFilterFunc(t,n,r,i)},a=r}if(!r)switch(o){case"partial":r=function(r){var i=e.getFieldValue(r);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},a="like";break;default:r=function(r){return e.getFieldValue(r)==t},a="="}n.headerFilters[l]={value:t,func:r,type:a,params:i||{}}}s=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==s&&(n.prevHeaderFilterChangeCheck=s,n.changed=!0,n.table.rowManager.filterRefresh())}return!0}var i,n=this,l=e.getField();e.modules.filter={success:r,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},Filter.prototype.generateHeaderFilterElement=function(e,t,r){function i(){}var n,l,o,a,s,d,u,f=this,c=this,h=e.modules.filter.success,p=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),p){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":c.table.modules.edit.editors[e.definition.headerFilter]?(l=c.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":l=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?l=e.modules.edit.editor:e.definition.formatter&&c.table.modules.edit.editors[e.definition.formatter]?(l=c.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):l=c.table.modules.edit.editors.input}if(l){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(c.table):u,!(o=l.call(this.table.modules.edit,a,function(){},h,i,u)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);p?c.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){o.setAttribute("placeholder",void 0!==e&&e?e:c.table.modules.localize.getText("headerFilters|default"))}):c.table.modules.localize.bind("headerFilters|default",function(e){o.setAttribute("placeholder",void 0!==c.column.definition.headerFilterPlaceholder&&c.column.definition.headerFilterPlaceholder?c.column.definition.headerFilterPlaceholder:e)}),o.addEventListener("click",function(e){e.stopPropagation(),o.focus()}),o.addEventListener("focus",function(e){var t=f.table.columnManager.element.scrollLeft;t!==f.table.rowManager.element.scrollLeft&&(f.table.rowManager.scrollHorizontal(t),f.table.columnManager.scrollHorizontal(t))}),s=!1,d=function(e){s&&clearTimeout(s),s=setTimeout(function(){h(o.value)},c.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=o,e.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=o.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(o.addEventListener("keyup",d),o.addEventListener("search",d),"number"==e.modules.filter.attrType&&o.addEventListener("change",function(e){h(o.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||o.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(o),e.contentElement.appendChild(n),r||c.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},Filter.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},Filter.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},Filter.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},Filter.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},Filter.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},Filter.prototype.setFilter=function(e,t,r,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:r,params:i}]),n.addFilter(e)},Filter.prototype.addFilter=function(e,t,r,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:r,params:i}]),e.forEach(function(e){(e=n.findFilter(e))&&(n.filterList.push(e),n.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.findFilter=function(e){var t,r=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:r.filters[e.type]?(t=r.table.columnManager.getColumnByField(e.field),i=t?function(i){return r.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return r.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},Filter.prototype.findSubFilters=function(e){var t=this,r=[];return e.forEach(function(e){(e=t.findFilter(e))&&r.push(e)}),!!r.length&&r},Filter.prototype.getFilters=function(e,t){var r=[];return e&&(r=this.getHeaderFilters()),t&&r.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),r=r.concat(this.filtersToArray(this.filterList,t))},Filter.prototype.filtersToArray=function(e,t){var r=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(r.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},Filter.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},Filter.prototype.removeFilter=function(e,t,r){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:r}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.clearFilter=function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},Filter.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},Filter.prototype.search=function(e,t,r,i){var n=this,l=[],o=[];return Array.isArray(t)||(t=[{field:t,type:r,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&o.push(e)}),this.table.rowManager.rows.forEach(function(t){var r=!0;o.forEach(function(e){n.filterRecurse(e,t.getData())||(r=!1)}),r&&l.push("data"===e?t.getData("data"):t.getComponent())}),l},Filter.prototype.filter=function(e,t){var r=this,i=[],n=[];return r.table.options.dataFiltering&&r.table.options.dataFiltering.call(r.table,r.getFilters()),r.table.options.ajaxFiltering||!r.filterList.length&&!Object.keys(r.headerFilters).length?i=e.slice(0):e.forEach(function(e){r.filterRow(e)&&i.push(e)}),r.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),r.table.options.dataFiltered.call(r.table,r.getFilters(),n)),i},Filter.prototype.filterRow=function(e,t){var r=this,i=!0,n=e.getData();r.filterList.forEach(function(e){r.filterRecurse(e,n)||(i=!1)});for(var l in r.headerFilters)r.headerFilters[l].func(n)||(i=!1);return i},Filter.prototype.filterRecurse=function(e,t){var r=this,i=!1;return Array.isArray(e)?e.forEach(function(e){r.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},Filter.prototype.filters={"=":function(e,t,r,i){return t==e},"<":function(e,t,r,i){return t":function(e,t,r,i){return t>e},">=":function(e,t,r,i){return t>=e},"!=":function(e,t,r,i){return t!=e},regex:function(e,t,r,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,r,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,r,i){var n=e.toLowerCase().split(void 0===i.separator?" ":i.separator),l=String(null===t||void 0===t?"":t).toLowerCase(),o=[];return n.forEach(function(e){l.includes(e)&&o.push(!0)}),i.matchAll?o.length===n.length:!!o.length},starts:function(e,t,r,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,r,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,r,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},Tabulator.prototype.registerModule("filter",Filter); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/format.js b/app/static/vendors/tabulator/js/modules/format.js deleted file mode 100644 index 5714027..0000000 --- a/app/static/vendors/tabulator/js/modules/format.js +++ /dev/null @@ -1,725 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Format = function Format(table) { - this.table = table; //hold Tabulator object -}; - -//initialize column formatter -Format.prototype.initializeColumn = function (column) { - column.modules.format = this.lookupFormatter(column, ""); - - if (typeof column.definition.formatterPrint !== "undefined") { - column.modules.format.print = this.lookupFormatter(column, "Print"); - } - - if (typeof column.definition.formatterClipboard !== "undefined") { - column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard"); - } - - if (typeof column.definition.formatterHtmlOutput !== "undefined") { - column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput"); - } -}; - -Format.prototype.lookupFormatter = function (column, type) { - var config = { params: column.definition["formatter" + type + "Params"] || {} }, - formatter = column.definition["formatter" + type]; - - //set column formatter - switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) { - case "string": - - if (formatter === "tick") { - formatter = "tickCross"; - - if (typeof config.params.crossElement == "undefined") { - config.params.crossElement = false; - } - - console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false"); - } - - if (this.formatters[formatter]) { - config.formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - config.formatter = this.formatters.plaintext; - } - break; - - case "function": - config.formatter = formatter; - break; - - default: - config.formatter = this.formatters.plaintext; - break; - } - - return config; -}; - -Format.prototype.cellRendered = function (cell) { - if (cell.modules.format && cell.modules.format.renderedCallback) { - cell.modules.format.renderedCallback(); - } -}; - -//return a formatted value for a cell -Format.prototype.formatValue = function (cell) { - var component = cell.getComponent(), - params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params; - - function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - } - - return cell.column.modules.format.formatter.call(this, component, params, onRendered); -}; - -Format.prototype.formatExportValue = function (cell, type) { - var formatter = cell.column.modules.format[type], - params; - - if (formatter) { - var onRendered = function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - }; - - params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params; - - return formatter.formatter.call(this, cell.getComponent(), params, onRendered); - } else { - return this.formatValue(cell); - } -}; - -Format.prototype.sanitizeHTML = function (value) { - if (value) { - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - return String(value).replace(/[&<>"'`=\/]/g, function (s) { - return entityMap[s]; - }); - } else { - return value; - } -}; - -Format.prototype.emptyToSpace = function (value) { - return value === null || typeof value === "undefined" || value === "" ? " " : value; -}; - -//get formatter for cell -Format.prototype.getFormatter = function (formatter) { - var formatter; - - switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) { - case "string": - if (this.formatters[formatter]) { - formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - formatter = this.formatters.plaintext; - } - break; - - case "function": - formatter = formatter; - break; - - default: - formatter = this.formatters.plaintext; - break; - } - - return formatter; -}; - -//default data formatters -Format.prototype.formatters = { - //plain text value - plaintext: function plaintext(cell, formatterParams, onRendered) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //html text value - html: function html(cell, formatterParams, onRendered) { - return cell.getValue(); - }, - - //multiline text area - textarea: function textarea(cell, formatterParams, onRendered) { - cell.getElement().style.whiteSpace = "pre-wrap"; - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //currency formatting - money: function money(cell, formatterParams, onRendered) { - var floatVal = parseFloat(cell.getValue()), - number, - integer, - decimal, - rgx; - - var decimalSym = formatterParams.decimal || "."; - var thousandSym = formatterParams.thousand || ","; - var symbol = formatterParams.symbol || ""; - var after = !!formatterParams.symbolAfter; - var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2; - - if (isNaN(floatVal)) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - } - - number = precision !== false ? floatVal.toFixed(precision) : floatVal; - number = String(number).split("."); - - integer = number[0]; - decimal = number.length > 1 ? decimalSym + number[1] : ""; - - rgx = /(\d+)(\d{3})/; - - while (rgx.test(integer)) { - integer = integer.replace(rgx, "$1" + thousandSym + "$2"); - } - - return after ? integer + decimal + symbol : symbol + integer + decimal; - }, - - //clickable anchor tag - link: function link(cell, formatterParams, onRendered) { - var value = cell.getValue(), - urlPrefix = formatterParams.urlPrefix || "", - download = formatterParams.download, - label = value, - el = document.createElement("a"), - data; - - if (formatterParams.labelField) { - data = cell.getData(); - label = data[formatterParams.labelField]; - } - - if (formatterParams.label) { - switch (_typeof(formatterParams.label)) { - case "string": - label = formatterParams.label; - break; - - case "function": - label = formatterParams.label(cell); - break; - } - } - - if (label) { - if (formatterParams.urlField) { - data = cell.getData(); - value = data[formatterParams.urlField]; - } - - if (formatterParams.url) { - switch (_typeof(formatterParams.url)) { - case "string": - value = formatterParams.url; - break; - - case "function": - value = formatterParams.url(cell); - break; - } - } - - el.setAttribute("href", urlPrefix + value); - - if (formatterParams.target) { - el.setAttribute("target", formatterParams.target); - } - - if (formatterParams.download) { - - if (typeof download == "function") { - download = download(cell); - } else { - download = download === true ? "" : download; - } - - el.setAttribute("download", download); - } - - el.innerHTML = this.emptyToSpace(this.sanitizeHTML(label)); - - return el; - } else { - return " "; - } - }, - - //image element - image: function image(cell, formatterParams, onRendered) { - var el = document.createElement("img"); - el.setAttribute("src", cell.getValue()); - - switch (_typeof(formatterParams.height)) { - case "number": - el.style.height = formatterParams.height + "px"; - break; - - case "string": - el.style.height = formatterParams.height; - break; - } - - switch (_typeof(formatterParams.width)) { - case "number": - el.style.width = formatterParams.width + "px"; - break; - - case "string": - el.style.width = formatterParams.width; - break; - } - - el.addEventListener("load", function () { - cell.getRow().normalizeHeight(); - }); - - return el; - }, - - //tick or cross - tickCross: function tickCross(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - empty = formatterParams.allowEmpty, - truthy = formatterParams.allowTruthy, - tick = typeof formatterParams.tickElement !== "undefined" ? formatterParams.tickElement : '', - cross = typeof formatterParams.crossElement !== "undefined" ? formatterParams.crossElement : ''; - - if (truthy && value || value === true || value === "true" || value === "True" || value === 1 || value === "1") { - element.setAttribute("aria-checked", true); - return tick || ""; - } else { - if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) { - element.setAttribute("aria-checked", "mixed"); - return ""; - } else { - element.setAttribute("aria-checked", false); - return cross || ""; - } - } - }, - - datetime: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var outputFormat = formatterParams.outputFormat || "DD/MM/YYYY hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - return formatterParams.timezone ? newDatetime.tz(formatterParams.timezone).format(outputFormat) : newDatetime.format(outputFormat); - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - datetimediff: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var suffix = typeof formatterParams.suffix !== "undefined" ? formatterParams.suffix : false; - var unit = typeof formatterParams.unit !== "undefined" ? formatterParams.unit : undefined; - var humanize = typeof formatterParams.humanize !== "undefined" ? formatterParams.humanize : false; - var date = typeof formatterParams.date !== "undefined" ? formatterParams.date : moment(); - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - if (humanize) { - return moment.duration(newDatetime.diff(date)).humanize(suffix); - } else { - return newDatetime.diff(date, unit) + (suffix ? " " + suffix : ""); - } - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - //select - lookup: function lookup(cell, formatterParams, onRendered) { - var value = cell.getValue(); - - if (typeof formatterParams[value] === "undefined") { - console.warn('Missing display value for ' + value); - return value; - } - - return formatterParams[value]; - }, - - //star rating - star: function star(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - maxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5, - stars = document.createElement("span"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"), - starActive = '', - starInactive = ''; - - //style stars holder - stars.style.verticalAlign = "middle"; - - //style star - star.setAttribute("width", "14"); - star.setAttribute("height", "14"); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - value = value && !isNaN(value) ? parseInt(value) : 0; - - value = Math.max(0, Math.min(value, maxStars)); - - for (var i = 1; i <= maxStars; i++) { - var nextStar = star.cloneNode(true); - nextStar.innerHTML = i <= value ? starActive : starInactive; - - stars.appendChild(nextStar); - } - - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - element.setAttribute("aria-label", value); - - return stars; - }, - - traffic: function traffic(cell, formatterParams, onRendered) { - var value = this.sanitizeHTML(cell.getValue()) || 0, - el = document.createElement("span"), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - colors = formatterParams && typeof formatterParams.color !== "undefined" ? formatterParams.color : ["red", "orange", "green"], - color = "#666666", - percent, - percentValue; - - if (isNaN(value) || typeof cell.getValue() === "undefined") { - return; - } - - el.classList.add("tabulator-traffic-light"); - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set color - switch (typeof colors === "undefined" ? "undefined" : _typeof(colors)) { - case "string": - color = colors; - break; - case "function": - color = colors(value); - break; - case "object": - if (Array.isArray(colors)) { - var unit = 100 / colors.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, colors.length - 1); - index = Math.max(index, 0); - color = colors[index]; - break; - } - } - - el.style.backgroundColor = color; - - return el; - }, - - //progress bar - progress: function progress(cell, formatterParams, onRendered) { - //progress bar - var value = this.sanitizeHTML(cell.getValue()) || 0, - element = cell.getElement(), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center", - percent, - percentValue, - color, - legend, - legendColor, - top, - left, - right, - bottom; - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set bar color - switch (_typeof(formatterParams.color)) { - case "string": - color = formatterParams.color; - break; - case "function": - color = formatterParams.color(value); - break; - case "object": - if (Array.isArray(formatterParams.color)) { - var unit = 100 / formatterParams.color.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.color.length - 1); - index = Math.max(index, 0); - color = formatterParams.color[index]; - break; - } - default: - color = "#2DC214"; - } - - //generate legend - switch (_typeof(formatterParams.legend)) { - case "string": - legend = formatterParams.legend; - break; - case "function": - legend = formatterParams.legend(value); - break; - case "boolean": - legend = value; - break; - default: - legend = false; - } - - //set legend color - switch (_typeof(formatterParams.legendColor)) { - case "string": - legendColor = formatterParams.legendColor; - break; - case "function": - legendColor = formatterParams.legendColor(value); - break; - case "object": - if (Array.isArray(formatterParams.legendColor)) { - var unit = 100 / formatterParams.legendColor.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.legendColor.length - 1); - index = Math.max(index, 0); - legendColor = formatterParams.legendColor[index]; - } - break; - default: - legendColor = "#000"; - } - - element.style.minWidth = "30px"; - element.style.position = "relative"; - - element.setAttribute("aria-label", percentValue); - - var barEl = document.createElement("div"); - barEl.style.display = "inline-block"; - barEl.style.position = "relative"; - barEl.style.width = percentValue + "%"; - barEl.style.backgroundColor = color; - barEl.style.height = "100%"; - - barEl.setAttribute('data-max', max); - barEl.setAttribute('data-min', min); - - if (legend) { - var legendEl = document.createElement("div"); - legendEl.style.position = "absolute"; - legendEl.style.top = "4px"; - legendEl.style.left = 0; - legendEl.style.textAlign = legendAlign; - legendEl.style.width = "100%"; - legendEl.style.color = legendColor; - legendEl.innerHTML = legend; - } - - onRendered(function () { - - //handle custom element needed if formatter is to be included in printed/downloaded output - if (!(cell instanceof CellComponent)) { - var holderEl = document.createElement("div"); - holderEl.style.position = "absolute"; - holderEl.style.top = "4px"; - holderEl.style.bottom = "4px"; - holderEl.style.left = "4px"; - holderEl.style.right = "4px"; - - element.appendChild(holderEl); - - element = holderEl; - } - - element.appendChild(barEl); - - if (legend) { - element.appendChild(legendEl); - } - }); - - return ""; - }, - - //background color - color: function color(cell, formatterParams, onRendered) { - cell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue()); - return ""; - }, - - //tick icon - buttonTick: function buttonTick(cell, formatterParams, onRendered) { - return ''; - }, - - //cross icon - buttonCross: function buttonCross(cell, formatterParams, onRendered) { - return ''; - }, - - //current row number - rownum: function rownum(cell, formatterParams, onRendered) { - return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1; - }, - - //row handle - handle: function handle(cell, formatterParams, onRendered) { - cell.getElement().classList.add("tabulator-row-handle"); - return "
"; - }, - - responsiveCollapse: function responsiveCollapse(cell, formatterParams, onRendered) { - var self = this, - open = false, - el = document.createElement("div"), - config = cell.getRow()._row.modules.responsiveLayout; - - el.classList.add("tabulator-responsive-collapse-toggle"); - el.innerHTML = "+-"; - - cell.getElement().classList.add("tabulator-row-handle"); - - function toggleList(isOpen) { - var collapseEl = config.element; - - config.open = isOpen; - - if (collapseEl) { - - if (config.open) { - el.classList.add("open"); - collapseEl.style.display = ''; - } else { - el.classList.remove("open"); - collapseEl.style.display = 'none'; - } - } - } - - el.addEventListener("click", function (e) { - e.stopImmediatePropagation(); - toggleList(!config.open); - }); - - toggleList(config.open); - - return el; - }, - - rowSelection: function rowSelection(cell) { - var _this = this; - - var checkbox = document.createElement("input"); - - checkbox.type = 'checkbox'; - - if (this.table.modExists("selectRow", true)) { - - checkbox.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - if (typeof cell.getRow == 'function') { - var row = cell.getRow(); - - checkbox.addEventListener("change", function (e) { - row.toggleSelect(); - }); - - checkbox.checked = row.isSelected(); - this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox); - } else { - checkbox.addEventListener("change", function (e) { - if (_this.table.modules.selectRow.selectedRows.length) { - _this.table.deselectRow(); - } else { - _this.table.selectRow(); - } - }); - - this.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox); - } - } - return checkbox; - } -}; - -Tabulator.prototype.registerModule("format", Format); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/format.min.js b/app/static/vendors/tabulator/js/modules/format.min.js deleted file mode 100644 index 0b39b61..0000000 --- a/app/static/vendors/tabulator/js/modules/format.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Format=function(e){this.table=e};Format.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},Format.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},r=e.definition["formatter"+t];switch(void 0===r?"undefined":_typeof(r)){case"string":"tick"===r&&(r="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[r]?o.formatter=this.formatters[r]:(console.warn("Formatter Error - No such formatter found: ",r),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=r;break;default:o.formatter=this.formatters.plaintext}return o},Format.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),r="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,r,t)},Format.prototype.formatExportValue=function(e,t){var o,r=e.column.modules.format[t];if(r){var a=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof r.params?r.params(component):r.params,r.formatter.call(this,e.getComponent(),o,a)}return this.formatValue(e)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var r,a,n,l,i=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(r=!1!==m?i.toFixed(m):i,r=String(r).split("."),a=r[0],n=r.length>1?s+r[1]:"",l=/(\d+)(\d{3})/;l.test(a);)a=a.replace(l,"$1"+c+"$2");return d?a+n+u:u+a+n},link:function(e,t,o){var r,a=e.getValue(),n=t.urlPrefix||"",l=t.download,i=a,s=document.createElement("a");if(t.labelField&&(r=e.getData(),i=r[t.labelField]),t.label)switch(_typeof(t.label)){case"string":i=t.label;break;case"function":i=t.label(e)}if(i){if(t.urlField&&(r=e.getData(),a=r[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return s.setAttribute("href",n+a),t.target&&s.setAttribute("target",t.target),t.download&&(l="function"==typeof l?l(e):!0===l?"":l,s.setAttribute("download",l)),s.innerHTML=this.emptyToSpace(this.sanitizeHTML(i)),s}return" "},image:function(e,t,o){var r=document.createElement("img");switch(r.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":r.style.height=t.height+"px";break;case"string":r.style.height=t.height}switch(_typeof(t.width)){case"number":r.style.width=t.width+"px";break;case"string":r.style.width=t.width}return r.addEventListener("load",function(){e.getRow().normalizeHeight()}),r},tickCross:function(e,t,o){var r=e.getValue(),a=e.getElement(),n=t.allowEmpty,l=t.allowTruthy,i=void 0!==t.tickElement?t.tickElement:'',s=void 0!==t.crossElement?t.crossElement:'';return l&&r||!0===r||"true"===r||"True"===r||1===r||"1"===r?(a.setAttribute("aria-checked",!0),i||""):!n||"null"!==r&&""!==r&&null!==r&&void 0!==r?(a.setAttribute("aria-checked",!1),s||""):(a.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=t.outputFormat||"DD/MM/YYYY hh:mm:ss",n=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue(),i=moment(l,r);return i.isValid()?t.timezone?i.tz(t.timezone).format(a):i.format(a):!0===n?l:"function"==typeof n?n(l):n},datetimediff:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",n=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:void 0,i=void 0!==t.humanize&&t.humanize,s=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,r);return u.isValid()?i?moment.duration(u.diff(s)).humanize(n):u.diff(s,l)+(n?" "+n:""):!0===a?c:"function"==typeof a?a(c):a},lookup:function(e,t,o){var r=e.getValue();return void 0===t[r]?(console.warn("Missing display value for "+r),r):t[r]},star:function(e,t,o){var r=e.getValue(),a=e.getElement(),n=t&&t.stars?t.stars:5,l=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");l.style.verticalAlign="middle",i.setAttribute("width","14"),i.setAttribute("height","14"),i.setAttribute("viewBox","0 0 512 512"),i.setAttribute("xml:space","preserve"),i.style.padding="0 1px",r=r&&!isNaN(r)?parseInt(r):0,r=Math.max(0,Math.min(r,n));for(var s=1;s<=n;s++){var c=i.cloneNode(!0);c.innerHTML=s<=r?'':'',l.appendChild(c)}return a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.setAttribute("aria-label",r),l},traffic:function(e,t,o){var r,a,n=this.sanitizeHTML(e.getValue())||0,l=document.createElement("span"),i=t&&t.max?t.max:100,s=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(l.classList.add("tabulator-traffic-light"),a=parseFloat(n)<=i?parseFloat(n):i,a=parseFloat(a)>=s?parseFloat(a):s,r=(i-s)/100,a=Math.round((a-s)/r),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(n);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),m=Math.max(m,0),u=c[m];break}}return l.style.backgroundColor=u,l}},progress:function(e,t,o){var r,a,n,l,i,s=this.sanitizeHTML(e.getValue())||0,c=e.getElement(),u=t&&t.max?t.max:100,d=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(a=parseFloat(s)<=u?parseFloat(s):u,a=parseFloat(a)>=d?parseFloat(a):d,r=(u-d)/100,a=Math.round((a-d)/r),_typeof(t.color)){case"string":n=t.color;break;case"function":n=t.color(s);break;case"object":if(Array.isArray(t.color)){var p=100/t.color.length,f=Math.floor(a/p);f=Math.min(f,t.color.length-1),f=Math.max(f,0),n=t.color[f];break}default:n="#2DC214"}switch(_typeof(t.legend)){case"string":l=t.legend;break;case"function":l=t.legend(s);break;case"boolean":l=s;break;default:l=!1}switch(_typeof(t.legendColor)){case"string":i=t.legendColor;break;case"function":i=t.legendColor(s);break;case"object":if(Array.isArray(t.legendColor)){var p=100/t.legendColor.length,f=Math.floor(a/p);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),i=t.legendColor[f]}break;default:i="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a);var h=document.createElement("div");if(h.style.display="inline-block",h.style.position="relative",h.style.width=a+"%",h.style.backgroundColor=n,h.style.height="100%",h.setAttribute("data-max",u),h.setAttribute("data-min",d),l){var g=document.createElement("div");g.style.position="absolute",g.style.top="4px",g.style.left=0,g.style.textAlign=m,g.style.width="100%",g.style.color=i,g.innerHTML=l}return o(function(){if(!(e instanceof CellComponent)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",c.appendChild(t),c=t}c.appendChild(h),l&&c.appendChild(g)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function r(e){var t=n.element;n.open=e,t&&(n.open?(a.classList.add("open"),t.style.display=""):(a.classList.remove("open"),t.style.display="none"))}var a=document.createElement("div"),n=e.getRow()._row.modules.responsiveLayout;return a.classList.add("tabulator-responsive-collapse-toggle"),a.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),a.addEventListener("click",function(e){e.stopImmediatePropagation(),r(!n.open)}),r(n.open),a},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var r=e.getRow();o.addEventListener("change",function(e){r.toggleSelect()}),o.checked=r.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(r,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Tabulator.prototype.registerModule("format",Format); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/frozen_columns.js b/app/static/vendors/tabulator/js/modules/frozen_columns.js deleted file mode 100644 index fdbc4ab..0000000 --- a/app/static/vendors/tabulator/js/modules/frozen_columns.js +++ /dev/null @@ -1,275 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var FrozenColumns = function FrozenColumns(table) { - this.table = table; //hold Tabulator object - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightPadding = 0; - this.initializationMode = "left"; - this.active = false; - this.scrollEndTimer = false; -}; - -//reset initial state -FrozenColumns.prototype.reset = function () { - this.initializationMode = "left"; - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightMargin = 0; - this.active = false; - - this.table.columnManager.headersElement.style.marginLeft = 0; - this.table.columnManager.element.style.paddingRight = 0; -}; - -//initialize specific column -FrozenColumns.prototype.initializeColumn = function (column) { - var config = { margin: 0, edge: false }; - - if (!column.isGroup) { - - if (this.frozenCheck(column)) { - - config.position = this.initializationMode; - - if (this.initializationMode == "left") { - this.leftColumns.push(column); - } else { - this.rightColumns.unshift(column); - } - - this.active = true; - - column.modules.frozen = config; - } else { - this.initializationMode = "right"; - } - } -}; - -FrozenColumns.prototype.frozenCheck = function (column) { - var frozen = false; - - if (column.parent.isGroup && column.definition.frozen) { - console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"); - } - - if (column.parent.isGroup) { - return this.frozenCheck(column.parent); - } else { - return column.definition.frozen; - } - - return frozen; -}; - -//quick layout to smooth horizontal scrolling -FrozenColumns.prototype.scrollHorizontal = function () { - var _this = this; - - var rows; - - if (this.active) { - clearTimeout(this.scrollEndTimer); - - //layout all rows after scroll is complete - this.scrollEndTimer = setTimeout(function () { - _this.layout(); - }, 100); - - rows = this.table.rowManager.getVisibleRows(); - - this.calcMargins(); - - this.layoutColumnPosition(); - - this.layoutCalcRows(); - - rows.forEach(function (row) { - if (row.type === "row") { - _this.layoutRow(row); - } - }); - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } -}; - -//calculate margins for rows -FrozenColumns.prototype.calcMargins = function () { - this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px"; - this.table.columnManager.headersElement.style.marginLeft = this.leftMargin; - - this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px"; - this.table.columnManager.element.style.paddingRight = this.rightMargin; - - //calculate right frozen columns - this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft; -}; - -//layout calculation rows -FrozenColumns.prototype.layoutCalcRows = function () { - if (this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow) { - this.layoutRow(this.table.modules.columnCalcs.topRow); - } - if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) { - this.layoutRow(this.table.modules.columnCalcs.botRow); - } - } -}; - -//calculate column positions and layout headers -FrozenColumns.prototype.layoutColumnPosition = function (allCells) { - var _this2 = this; - - var leftParents = []; - - this.leftColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this2._calcSpace(_this2.leftColumns, i) + _this2.table.columnManager.scrollLeft + "px"; - - if (i == _this2.leftColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - var parentEl = _this2.getColGroupParentElement(column); - if (!leftParents.includes(parentEl)) { - _this2.layoutElement(parentEl, column); - leftParents.push(parentEl); - } - - if (column.modules.frozen.edge) { - parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } else { - _this2.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this2.layoutElement(cell.getElement(), column); - }); - } - }); - - this.rightColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this2.rightPadding - _this2._calcSpace(_this2.rightColumns, i + 1) + "px"; - - if (i == _this2.rightColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - _this2.layoutElement(_this2.getColGroupParentElement(column), column); - } else { - _this2.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this2.layoutElement(cell.getElement(), column); - }); - } - }); -}; - -FrozenColumns.prototype.getColGroupParentElement = function (column) { - return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement(); -}; - -//layout columns appropropriatly -FrozenColumns.prototype.layout = function () { - var self = this, - rightMargin = 0; - - if (self.active) { - - //calculate row padding - this.calcMargins(); - - // self.table.rowManager.activeRows.forEach(function(row){ - // self.layoutRow(row); - // }); - - // if(self.table.options.dataTree){ - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row") { - self.layoutRow(row); - } - }); - // } - - this.layoutCalcRows(); - - //calculate left columns - this.layoutColumnPosition(true); - - // if(tableHolder.scrollHeight > tableHolder.clientHeight){ - // rightMargin -= tableHolder.offsetWidth - tableHolder.clientWidth; - // } - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } -}; - -FrozenColumns.prototype.layoutRow = function (row) { - var _this3 = this; - - var rowEl = row.getElement(); - - rowEl.style.paddingLeft = this.leftMargin; - // rowEl.style.paddingRight = this.rightMargin + "px"; - - this.leftColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this3.layoutElement(cell.getElement(), column); - } - }); - - this.rightColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this3.layoutElement(cell.getElement(), column); - } - }); -}; - -FrozenColumns.prototype.layoutElement = function (element, column) { - - if (column.modules.frozen) { - element.style.position = "absolute"; - element.style.left = column.modules.frozen.margin; - - element.classList.add("tabulator-frozen"); - - if (column.modules.frozen.edge) { - element.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } -}; - -FrozenColumns.prototype._calcSpace = function (columns, index) { - var width = 0; - - for (var i = 0; i < index; i++) { - if (columns[i].visible) { - width += columns[i].getWidth(); - } - } - - return width; -}; - -Tabulator.prototype.registerModule("frozenColumns", FrozenColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/frozen_columns.min.js b/app/static/vendors/tabulator/js/modules/frozen_columns.min.js deleted file mode 100644 index bf2bb60..0000000 --- a/app/static/vendors/tabulator/js/modules/frozen_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var FrozenColumns=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};FrozenColumns.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0},FrozenColumns.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")},FrozenColumns.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen},FrozenColumns.prototype.scrollHorizontal=function(){var t,e=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){e.layout()},100),t=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),t.forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},FrozenColumns.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))},FrozenColumns.prototype.layoutColumnPosition=function(t){var e=this,o=[];this.leftColumns.forEach(function(n,l){if(n.modules.frozen.margin=e._calcSpace(e.leftColumns,l)+e.table.columnManager.scrollLeft+"px",l==e.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var i=e.getColGroupParentElement(n);o.includes(i)||(e.layoutElement(i,n),o.push(i)),n.modules.frozen.edge&&i.classList.add("tabulator-frozen-"+n.modules.frozen.position)}else e.layoutElement(n.getElement(),n);t&&n.cells.forEach(function(t){e.layoutElement(t.getElement(),n)})}),this.rightColumns.forEach(function(o,n){o.modules.frozen.margin=e.rightPadding-e._calcSpace(e.rightColumns,n+1)+"px",n==e.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?e.layoutElement(e.getColGroupParentElement(o),o):e.layoutElement(o.getElement(),o),t&&o.cells.forEach(function(t){e.layoutElement(t.getElement(),o)})})},FrozenColumns.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()},FrozenColumns.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.layoutRow=function(t){var e=this;t.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)}),this.rightColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)})},FrozenColumns.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},FrozenColumns.prototype._calcSpace=function(t,e){for(var o=0,n=0;n -1) { - output.splice(index, 1); - } - }); - - return output; -}; - -FrozenRows.prototype.freezeRow = function (row) { - if (!row.modules.frozen) { - row.modules.frozen = true; - this.topElement.appendChild(row.getElement()); - row.initialize(); - row.normalizeHeight(); - this.table.rowManager.adjustTableSize(); - - this.rows.push(row); - - this.table.rowManager.refreshActiveData("display"); - - this.styleRows(); - } else { - console.warn("Freeze Error - Row is already frozen"); - } -}; - -FrozenRows.prototype.unfreezeRow = function (row) { - var index = this.rows.indexOf(row); - - if (row.modules.frozen) { - - row.modules.frozen = false; - - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.table.rowManager.adjustTableSize(); - - this.rows.splice(index, 1); - - this.table.rowManager.refreshActiveData("display"); - - if (this.rows.length) { - this.styleRows(); - } - } else { - console.warn("Freeze Error - Row is already unfrozen"); - } -}; - -FrozenRows.prototype.styleRows = function (row) { - var self = this; - - this.rows.forEach(function (row, i) { - self.table.rowManager.styleRow(row, i); - }); -}; - -Tabulator.prototype.registerModule("frozenRows", FrozenRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/frozen_rows.min.js b/app/static/vendors/tabulator/js/modules/frozen_rows.min.js deleted file mode 100644 index c38e992..0000000 --- a/app/static/vendors/tabulator/js/modules/frozen_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var FrozenRows=function(e){this.table=e,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};FrozenRows.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)},FrozenRows.prototype.setDisplayIndex=function(e){this.displayIndex=e},FrozenRows.prototype.getDisplayIndex=function(){return this.displayIndex},FrozenRows.prototype.isFrozen=function(){return!!this.rows.length},FrozenRows.prototype.getRows=function(e){var o=e.slice(0);return this.rows.forEach(function(e){var t=o.indexOf(e);t>-1&&o.splice(t,1)}),o},FrozenRows.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},FrozenRows.prototype.unfreezeRow=function(e){var o=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var t=e.getElement();t.parentNode.removeChild(t),this.table.rowManager.adjustTableSize(),this.rows.splice(o,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},FrozenRows.prototype.styleRows=function(e){var o=this;this.rows.forEach(function(e,t){o.table.rowManager.styleRow(e,t)})},Tabulator.prototype.registerModule("frozenRows",FrozenRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/group_rows.js b/app/static/vendors/tabulator/js/modules/group_rows.js deleted file mode 100644 index 05731ec..0000000 --- a/app/static/vendors/tabulator/js/modules/group_rows.js +++ /dev/null @@ -1,1087 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -//public group object -var GroupComponent = function GroupComponent(group) { - this._group = group; - this.type = "GroupComponent"; -}; - -GroupComponent.prototype.getKey = function () { - return this._group.key; -}; - -GroupComponent.prototype.getField = function () { - return this._group.field; -}; - -GroupComponent.prototype.getElement = function () { - return this._group.element; -}; - -GroupComponent.prototype.getRows = function () { - return this._group.getRows(true); -}; - -GroupComponent.prototype.getSubGroups = function () { - return this._group.getSubGroups(true); -}; - -GroupComponent.prototype.getParentGroup = function () { - return this._group.parent ? this._group.parent.getComponent() : false; -}; - -GroupComponent.prototype.getVisibility = function () { - console.warn("getVisibility function is deprecated, you should now use the isVisible function"); - return this._group.visible; -}; - -GroupComponent.prototype.isVisible = function () { - return this._group.visible; -}; - -GroupComponent.prototype.show = function () { - this._group.show(); -}; - -GroupComponent.prototype.hide = function () { - this._group.hide(); -}; - -GroupComponent.prototype.toggle = function () { - this._group.toggleVisibility(); -}; - -GroupComponent.prototype._getSelf = function () { - return this._group; -}; - -GroupComponent.prototype.getTable = function () { - return this._group.groupManager.table; -}; - -////////////////////////////////////////////////// -//////////////// Group Functions ///////////////// -////////////////////////////////////////////////// - -var Group = function Group(groupManager, parent, level, key, field, generator, oldGroup) { - - this.groupManager = groupManager; - this.parent = parent; - this.key = key; - this.level = level; - this.field = field; - this.hasSubGroups = level < groupManager.groupIDLookups.length - 1; - this.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow; - this.type = "group"; //type of element - this.old = oldGroup; - this.rows = []; - this.groups = []; - this.groupList = []; - this.generator = generator; - this.elementContents = false; - this.height = 0; - this.outerHeight = 0; - this.initialized = false; - this.calcs = {}; - this.initialized = false; - this.modules = {}; - this.arrowElement = false; - - this.visible = oldGroup ? oldGroup.visible : typeof groupManager.startOpen[level] !== "undefined" ? groupManager.startOpen[level] : groupManager.startOpen[0]; - - this.component = null; - - this.createElements(); - this.addBindings(); - - this.createValueGroups(); -}; - -Group.prototype.wipe = function () { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - group.wipe(); - }); - } else { - this.element = false; - this.arrowElement = false; - this.elementContents = false; - } -}; - -Group.prototype.createElements = function () { - var arrow = document.createElement("div"); - arrow.classList.add("tabulator-arrow"); - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-row"); - this.element.classList.add("tabulator-group"); - this.element.classList.add("tabulator-group-level-" + this.level); - this.element.setAttribute("role", "rowgroup"); - - this.arrowElement = document.createElement("div"); - this.arrowElement.classList.add("tabulator-group-toggle"); - this.arrowElement.appendChild(arrow); - - //setup movable rows - if (this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists("moveRow")) { - this.groupManager.table.modules.moveRow.initializeGroupHeader(this); - } -}; - -Group.prototype.createValueGroups = function () { - var _this = this; - - var level = this.level + 1; - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - this.groupManager.allowedValues[level].forEach(function (value) { - _this._createGroup(value, level); - }); - } -}; - -Group.prototype.addBindings = function () { - var self = this, - dblTap, - tapHold, - tap, - toggleElement; - - //handle group click events - if (self.groupManager.table.options.groupClick) { - self.element.addEventListener("click", function (e) { - self.groupManager.table.options.groupClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.groupManager.table.options.groupDblClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContext) { - self.element.addEventListener("contextmenu", function (e) { - self.groupManager.table.options.groupContext.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContextMenu && self.groupManager.table.modExists("menu")) { - self.groupManager.table.modules.menu.initializeGroup.call(self.groupManager.table.modules.menu, self); - } - - if (self.groupManager.table.options.groupTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.groupManager.table.options.groupTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.groupManager.table.options.groupDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.groupManager.table.options.groupDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.groupManager.table.options.groupTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.groupManager.table.options.groupTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - if (self.groupManager.table.options.groupToggleElement) { - toggleElement = self.groupManager.table.options.groupToggleElement == "arrow" ? self.arrowElement : self.element; - - toggleElement.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - self.toggleVisibility(); - }); - } -}; - -Group.prototype._createGroup = function (groupID, level) { - var groupKey = level + "_" + groupID; - var group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false); - - this.groups[groupKey] = group; - this.groupList.push(group); -}; - -Group.prototype._addRowToGroup = function (row) { - - var level = this.level + 1; - - if (this.hasSubGroups) { - var groupID = this.groupManager.groupIDLookups[level].func(row.getData()), - groupKey = level + "_" + groupID; - - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - } else { - if (!this.groups[groupKey]) { - this._createGroup(groupID, level); - } - - this.groups[groupKey].addRow(row); - } - } -}; - -Group.prototype._addRow = function (row) { - this.rows.push(row); - row.modules.group = this; -}; - -Group.prototype.insertRow = function (row, to, after) { - var data = this.conformRowData({}); - - row.updateData(data); - - var toIndex = this.rows.indexOf(to); - - if (toIndex > -1) { - if (after) { - this.rows.splice(toIndex + 1, 0, row); - } else { - this.rows.splice(toIndex, 0, row); - } - } else { - if (after) { - this.rows.push(row); - } else { - this.rows.unshift(row); - } - } - - row.modules.group = this; - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - - this.groupManager.updateGroupRows(true); -}; - -Group.prototype.scrollHeader = function (left) { - this.arrowElement.style.marginLeft = left; - - this.groupList.forEach(function (child) { - child.scrollHeader(left); - }); -}; - -Group.prototype.getRowIndex = function (row) {}; - -//update row data to match grouping contraints -Group.prototype.conformRowData = function (data) { - if (this.field) { - data[this.field] = this.key; - } else { - console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"); - } - - if (this.parent) { - data = this.parent.conformRowData(data); - } - - return data; -}; - -Group.prototype.removeRow = function (row) { - var index = this.rows.indexOf(row); - var el = row.getElement(); - - if (index > -1) { - this.rows.splice(index, 1); - } - - if (!this.groupManager.table.options.groupValues && !this.rows.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - - this.groupManager.updateGroupRows(true); - } else { - - if (el.parentNode) { - el.parentNode.removeChild(el); - } - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - } -}; - -Group.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - - if (!this.groupList.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - } - } -}; - -Group.prototype.getHeadersAndRows = function (noCalc) { - var output = []; - - output.push(this); - - this._visSet(); - - if (this.visible) { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows(noCalc)); - }); - } else { - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - - output = output.concat(this.rows); - - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } else { - if (!this.groupList.length && this.groupManager.table.options.columnCalcs != "table") { - - if (this.groupManager.table.modExists("columnCalcs")) { - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - } - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } - } - } - - return output; -}; - -Group.prototype.getData = function (visible, transform) { - var self = this, - output = []; - - this._visSet(); - - if (!visible || visible && this.visible) { - this.rows.forEach(function (row) { - output.push(row.getData(transform || "data")); - }); - } - - return output; -}; - -// Group.prototype.getRows = function(){ -// this._visSet(); - -// return this.visible ? this.rows : []; -// }; - -Group.prototype.getRowCount = function () { - var count = 0; - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - count += group.getRowCount(); - }); - } else { - count = this.rows.length; - } - return count; -}; - -Group.prototype.toggleVisibility = function () { - if (this.visible) { - this.hide(); - } else { - this.show(); - } -}; - -Group.prototype.hide = function () { - this.visible = false; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.remove("tabulator-group-visible"); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - row.detachElement(); - }); - }); - } else { - this.rows.forEach(function (row) { - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), false); -}; - -Group.prototype.show = function () { - var self = this; - - self.visible = true; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.add("tabulator-group-visible"); - - var prev = self.getElement(); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - }); - } else { - self.rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), true); -}; - -Group.prototype._visSet = function () { - var data = []; - - if (typeof this.visible == "function") { - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent()); - } -}; - -Group.prototype.getRowGroup = function (row) { - var match = false; - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - } else { - if (this.rows.find(function (item) { - return item === row; - })) { - match = this; - } - } - - return match; -}; - -Group.prototype.getSubGroups = function (component) { - var output = []; - - this.groupList.forEach(function (child) { - output.push(component ? child.getComponent() : child); - }); - - return output; -}; - -Group.prototype.getRows = function (compoment) { - var output = []; - - this.rows.forEach(function (row) { - output.push(compoment ? row.getComponent() : row); - }); - - return output; -}; - -Group.prototype.generateGroupHeaderContents = function () { - var data = []; - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent()); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }if (typeof this.elementContents === "string") { - this.element.innerHTML = this.elementContents; - } else { - this.element.appendChild(this.elementContents); - } - - this.element.insertBefore(this.arrowElement, this.element.firstChild); -}; - -////////////// Standard Row Functions ////////////// - -Group.prototype.getElement = function () { - this.addBindingsd = false; - - this._visSet(); - - if (this.visible) { - this.element.classList.add("tabulator-group-visible"); - } else { - this.element.classList.remove("tabulator-group-visible"); - } - - for (var i = 0; i < this.element.childNodes.length; ++i) { - this.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]); - } - - this.generateGroupHeaderContents(); - - // this.addBindings(); - - return this.element; -}; - -Group.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -//normalize the height of elements in the row -Group.prototype.normalizeHeight = function () { - this.setHeight(this.element.clientHeight); -}; - -Group.prototype.initialize = function (force) { - if (!this.initialized || force) { - this.normalizeHeight(); - this.initialized = true; - } -}; - -Group.prototype.reinitialize = function () { - this.initialized = false; - this.height = 0; - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - this.initialize(true); - } -}; - -Group.prototype.setHeight = function (height) { - if (this.height != height) { - this.height = height; - this.outerHeight = this.element.offsetHeight; - } -}; - -//return rows outer height -Group.prototype.getHeight = function () { - return this.outerHeight; -}; - -Group.prototype.getGroup = function () { - return this; -}; - -Group.prototype.reinitializeHeight = function () {}; -Group.prototype.calcHeight = function () {}; -Group.prototype.setCellHeight = function () {}; -Group.prototype.clearCellHeight = function () {}; - -//////////////// Object Generation ///////////////// -Group.prototype.getComponent = function () { - if (!this.component) { - this.component = new GroupComponent(this); - } - - return this.component; -}; - -////////////////////////////////////////////////// -////////////// Group Row Extension /////////////// -////////////////////////////////////////////////// - -var GroupRows = function GroupRows(table) { - - this.table = table; //hold Tabulator object - - this.groupIDLookups = false; //enable table grouping and set field to group by - this.startOpen = [function () { - return false; - }]; //starting state of group - this.headerGenerator = [function () { - return ""; - }]; - this.groupList = []; //ordered list of groups - this.allowedValues = false; - this.groups = {}; //hold row groups - this.displayIndex = 0; //index in display pipeline -}; - -//initialize group configuration -GroupRows.prototype.initialize = function () { - var self = this, - groupBy = self.table.options.groupBy, - startOpen = self.table.options.groupStartOpen, - groupHeader = self.table.options.groupHeader; - - this.allowedValues = self.table.options.groupValues; - - if (Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length) { - console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"); - } - - self.headerGenerator = [function () { - return ""; - }]; - this.startOpen = [function () { - return false; - }]; //starting state of group - - self.table.modules.localize.bind("groups|item", function (langValue, lang) { - self.headerGenerator[0] = function (value, count, data) { - //header layout function - return (typeof value === "undefined" ? "" : value) + "(" + count + " " + (count === 1 ? langValue : lang.groups.items) + ")"; - }; - }); - - this.groupIDLookups = []; - - if (Array.isArray(groupBy) || groupBy) { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both") { - this.table.modules.columnCalcs.removeCalcs(); - } - } else { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group") { - - var cols = this.table.columnManager.getRealColumns(); - - cols.forEach(function (col) { - if (col.definition.topCalc) { - self.table.modules.columnCalcs.initializeTopRow(); - } - - if (col.definition.bottomCalc) { - self.table.modules.columnCalcs.initializeBottomRow(); - } - }); - } - } - - if (!Array.isArray(groupBy)) { - groupBy = [groupBy]; - } - - groupBy.forEach(function (group, i) { - var lookupFunc, column; - - if (typeof group == "function") { - lookupFunc = group; - } else { - column = self.table.columnManager.getColumnByField(group); - - if (column) { - lookupFunc = function lookupFunc(data) { - return column.getFieldValue(data); - }; - } else { - lookupFunc = function lookupFunc(data) { - return data[group]; - }; - } - } - - self.groupIDLookups.push({ - field: typeof group === "function" ? false : group, - func: lookupFunc, - values: self.allowedValues ? self.allowedValues[i] : false - }); - }); - - if (startOpen) { - - if (!Array.isArray(startOpen)) { - startOpen = [startOpen]; - } - - startOpen.forEach(function (level) { - level = typeof level == "function" ? level : function () { - return true; - }; - }); - - self.startOpen = startOpen; - } - - if (groupHeader) { - self.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader]; - } - - this.initialized = true; -}; - -GroupRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; -}; - -GroupRows.prototype.getDisplayIndex = function () { - return this.displayIndex; -}; - -//return appropriate rows with group headers -GroupRows.prototype.getRows = function (rows) { - if (this.groupIDLookups.length) { - - this.table.options.dataGrouping.call(this.table); - - this.generateGroups(rows); - - if (this.table.options.dataGrouped) { - this.table.options.dataGrouped.call(this.table, this.getGroups(true)); - } - - return this.updateGroupRows(); - } else { - return rows.slice(0); - } -}; - -GroupRows.prototype.getGroups = function (compoment) { - var groupComponents = []; - - this.groupList.forEach(function (group) { - groupComponents.push(compoment ? group.getComponent() : group); - }); - - return groupComponents; -}; - -GroupRows.prototype.getChildGroups = function (group) { - var _this2 = this; - - var groupComponents = []; - - if (!group) { - group = this; - } - - group.groupList.forEach(function (child) { - if (child.groupList.length) { - groupComponents = groupComponents.concat(_this2.getChildGroups(child)); - } else { - groupComponents.push(child); - } - }); - - return groupComponents; -}; - -GroupRows.prototype.wipe = function () { - this.groupList.forEach(function (group) { - group.wipe(); - }); -}; - -GroupRows.prototype.pullGroupListData = function (groupList) { - var self = this; - var groupListData = []; - - groupList.forEach(function (group) { - var groupHeader = {}; - groupHeader.level = 0; - groupHeader.rowCount = 0; - groupHeader.headerContent = ""; - var childData = []; - - if (group.hasSubGroups) { - childData = self.pullGroupListData(group.groupList); - - groupHeader.level = group.level; - groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers - groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group); - - groupListData.push(groupHeader); - groupListData = groupListData.concat(childData); - } else { - groupHeader.level = group.level; - groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group); - groupHeader.rowCount = group.getRows().length; - - groupListData.push(groupHeader); - - group.getRows().forEach(function (row) { - groupListData.push(row.getData("data")); - }); - } - }); - - return groupListData; -}; - -GroupRows.prototype.getGroupedData = function () { - - return this.pullGroupListData(this.groupList); -}; - -GroupRows.prototype.getRowGroup = function (row) { - var match = false; - - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - - return match; -}; - -GroupRows.prototype.countGroups = function () { - return this.groupList.length; -}; - -GroupRows.prototype.generateGroups = function (rows) { - var self = this, - oldGroups = self.groups; - - self.groups = {}; - self.groupList = []; - - if (this.allowedValues && this.allowedValues[0]) { - this.allowedValues[0].forEach(function (value) { - self.createGroup(value, 0, oldGroups); - }); - - rows.forEach(function (row) { - self.assignRowToExistingGroup(row, oldGroups); - }); - } else { - rows.forEach(function (row) { - self.assignRowToGroup(row, oldGroups); - }); - } -}; - -GroupRows.prototype.createGroup = function (groupID, level, oldGroups) { - var groupKey = level + "_" + groupID, - group; - - oldGroups = oldGroups || []; - - group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]); - - this.groups[groupKey] = group; - this.groupList.push(group); -}; - -// GroupRows.prototype.assignRowToGroup = function(row, oldGroups){ -// var groupID = this.groupIDLookups[0].func(row.getData()), -// groupKey = "0_" + groupID; - -// if(!this.groups[groupKey]){ -// this.createGroup(groupID, 0, oldGroups); -// } - -// this.groups[groupKey].addRow(row); -// }; - -GroupRows.prototype.assignRowToExistingGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - groupKey = "0_" + groupID; - - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } -}; - -GroupRows.prototype.assignRowToGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - newGroupNeeded = !this.groups["0_" + groupID]; - - if (newGroupNeeded) { - this.createGroup(groupID, 0, oldGroups); - } - - this.groups["0_" + groupID].addRow(row); - - return !newGroupNeeded; -}; - -GroupRows.prototype.updateGroupRows = function (force) { - var self = this, - output = [], - oldRowCount; - - self.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows()); - }); - - //force update of table display - if (force) { - - var displayIndex = self.table.rowManager.setDisplayRows(output, this.getDisplayIndex()); - - if (displayIndex !== true) { - this.setDisplayIndex(displayIndex); - } - - self.table.rowManager.refreshActiveData("group", true, true); - } - - return output; -}; - -GroupRows.prototype.scrollHeaders = function (left) { - left = left + "px"; - - this.groupList.forEach(function (group) { - group.scrollHeader(left); - }); -}; - -GroupRows.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - } -}; - -Tabulator.prototype.registerModule("groupRows", GroupRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/group_rows.min.js b/app/static/vendors/tabulator/js/modules/group_rows.min.js deleted file mode 100644 index 6039f2c..0000000 --- a/app/static/vendors/tabulator/js/modules/group_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getField=function(){return this._group.field},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},GroupComponent.prototype.isVisible=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.groupManager.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e-1?e?this.rows.splice(i+1,0,t):this.rows.splice(i,0,t):e?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},Group.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})},Group.prototype.getRowIndex=function(t){},Group.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},Group.prototype.removeRow=function(t){var o=this.rows.indexOf(t),e=t.getElement();o>-1&&this.rows.splice(o,1),this.groupManager.table.options.groupValues||this.rows.length?(e.parentNode&&e.parentNode.removeChild(e),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},Group.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],o=this.groupList.indexOf(t),o>-1&&this.groupList.splice(o,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},Group.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows(t))}):(!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top)),o=o.concat(this.rows),!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top))),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom)))),o},Group.prototype.getData=function(t,o){var e=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){e.push(t.getData(o||"data"))}),e},Group.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t},Group.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},Group.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){t.detachElement()})}):this.rows.forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},Group.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var o=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e})}):t.rows.forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},Group.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},Group.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}):this.rows.find(function(o){return o===t})&&(o=this),o},Group.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},Group.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;tr.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(o,e){t.headerGenerator[0]=function(t,r,i){return(void 0===t?"":t)+"("+r+" "+(1===r?o:e.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(o)||o)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var i=this.table.columnManager.getRealColumns();i.forEach(function(o){o.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),o.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(o,e){var r,i;"function"==typeof o?r=o:(i=t.table.columnManager.getColumnByField(o),r=i?function(t){return i.getFieldValue(t)}:function(t){return t[o]}),t.groupIDLookups.push({field:"function"!=typeof o&&o,func:r,values:!!t.allowedValues&&t.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=e),r&&(t.headerGenerator=Array.isArray(r)?r:[r]),this.initialized=!0},GroupRows.prototype.setDisplayIndex=function(t){this.displayIndex=t},GroupRows.prototype.getDisplayIndex=function(){return this.displayIndex},GroupRows.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},GroupRows.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},GroupRows.prototype.getChildGroups=function(t){var o=this,e=[];return t||(t=this),t.groupList.forEach(function(t){t.groupList.length?e=e.concat(o.getChildGroups(t)):e.push(t)}),e},GroupRows.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})},GroupRows.prototype.pullGroupListData=function(t){var o=this,e=[];return t.forEach(function(t){var r={};r.level=0,r.rowCount=0,r.headerContent="";var i=[];t.hasSubGroups?(i=o.pullGroupListData(t.groupList),r.level=t.level,r.rowCount=i.length-t.groupList.length,r.headerContent=t.generator(t.key,r.rowCount,t.rows,t),e.push(r),e=e.concat(i)):(r.level=t.level,r.headerContent=t.generator(t.key,t.rows.length,t.rows,t),r.rowCount=t.getRows().length,e.push(r),t.getRows().forEach(function(t){e.push(t.getData("data"))}))}),e},GroupRows.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},GroupRows.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}),o},GroupRows.prototype.countGroups=function(){return this.groupList.length},GroupRows.prototype.generateGroups=function(t){var o=this,e=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){o.createGroup(t,0,e)}),t.forEach(function(t){o.assignRowToExistingGroup(t,e)})):t.forEach(function(t){o.assignRowToGroup(t,e)})},GroupRows.prototype.createGroup=function(t,o,e){var r,i=o+"_"+t;e=e||[],r=new Group(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[i]),this.groups[i]=r,this.groupList.push(r)},GroupRows.prototype.assignRowToExistingGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]&&this.groups[r].addRow(t)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r=!this.groups["0_"+e];return r&&this.createGroup(e,0,o),this.groups["0_"+e].addRow(t),!r},GroupRows.prototype.updateGroupRows=function(t){var o=this,e=[];if(o.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var r=o.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==r&&this.setDisplayIndex(r),o.table.rowManager.refreshActiveData("group",!0,!0)}return e},GroupRows.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(o){o.scrollHeader(t)})},GroupRows.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],(o=this.groupList.indexOf(t))>-1&&this.groupList.splice(o,1))},Tabulator.prototype.registerModule("groupRows",GroupRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/history.js b/app/static/vendors/tabulator/js/modules/history.js deleted file mode 100644 index 1c3ae3e..0000000 --- a/app/static/vendors/tabulator/js/modules/history.js +++ /dev/null @@ -1,141 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var History = function History(table) { - this.table = table; //hold Tabulator object - - this.history = []; - this.index = -1; -}; - -History.prototype.clear = function () { - this.history = []; - this.index = -1; -}; - -History.prototype.action = function (type, component, data) { - - this.history = this.history.slice(0, this.index + 1); - - this.history.push({ - type: type, - component: component, - data: data - }); - - this.index++; -}; - -History.prototype.getHistoryUndoSize = function () { - return this.index + 1; -}; - -History.prototype.getHistoryRedoSize = function () { - return this.history.length - (this.index + 1); -}; - -History.prototype.undo = function () { - - if (this.index > -1) { - var action = this.history[this.index]; - - this.undoers[action.type].call(this, action); - - this.index--; - - this.table.options.historyUndo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Undo Error - No more history to undo"); - return false; - } -}; - -History.prototype.redo = function () { - if (this.history.length - 1 > this.index) { - - this.index++; - - var action = this.history[this.index]; - - this.redoers[action.type].call(this, action); - - this.table.options.historyRedo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Redo Error - No more history to redo"); - return false; - } -}; - -History.prototype.undoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.oldValue); - }, - - rowAdd: function rowAdd(action) { - action.component.deleteActual(); - }, - - rowDelete: function rowDelete(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after); - this.table.rowManager.redraw(); - } -}; - -History.prototype.redoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.newValue); - }, - - rowAdd: function rowAdd(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowDelete: function rowDelete(action) { - action.component.deleteActual(); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after); - this.table.rowManager.redraw(); - } -}; - -//rebind rows to new element after deletion -History.prototype._rebindRow = function (oldRow, newRow) { - this.history.forEach(function (action) { - if (action.component instanceof Row) { - if (action.component === oldRow) { - action.component = newRow; - } - } else if (action.component instanceof Cell) { - if (action.component.row === oldRow) { - var field = action.component.column.getField(); - - if (field) { - action.component = newRow.getCell(field); - } - } - } - }); -}; - -Tabulator.prototype.registerModule("history", History); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/history.min.js b/app/static/vendors/tabulator/js/modules/history.min.js deleted file mode 100644 index 5df3187..0000000 --- a/app/static/vendors/tabulator/js/modules/history.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var History=function(t){this.table=t,this.history=[],this.index=-1};History.prototype.clear=function(){this.history=[],this.index=-1},History.prototype.action=function(t,o,e){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:e}),this.index++},History.prototype.getHistoryUndoSize=function(){return this.index+1},History.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},History.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},History.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},History.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posFrom],!t.data.after),this.table.rowManager.redraw()}},History.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posTo],t.data.after),this.table.rowManager.redraw()}},History.prototype._rebindRow=function(t,o){this.history.forEach(function(e){if(e.component instanceof Row)e.component===t&&(e.component=o);else if(e.component instanceof Cell&&e.component.row===t){var i=e.component.column.getField();i&&(e.component=o.getCell(i))}})},Tabulator.prototype.registerModule("history",History); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/html_table_import.js b/app/static/vendors/tabulator/js/modules/html_table_import.js deleted file mode 100644 index 34fed7c..0000000 --- a/app/static/vendors/tabulator/js/modules/html_table_import.js +++ /dev/null @@ -1,191 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var HtmlTableImport = function HtmlTableImport(table) { - this.table = table; //hold Tabulator object - this.fieldIndex = []; - this.hasIndex = false; -}; - -HtmlTableImport.prototype.parseTable = function () { - var self = this, - element = self.table.element, - options = self.table.options, - columns = options.columns, - headers = element.getElementsByTagName("th"), - rows = element.getElementsByTagName("tbody")[0], - data = [], - newTable; - - self.hasIndex = false; - - self.table.options.htmlImporting.call(this.table); - - rows = rows ? rows.getElementsByTagName("tr") : []; - - //check for tablator inline options - self._extractOptions(element, options); - - if (headers.length) { - self._extractHeaders(headers, rows); - } else { - self._generateBlankHeaders(headers, rows); - } - - //iterate through table rows and build data set - for (var index = 0; index < rows.length; index++) { - var row = rows[index], - cells = row.getElementsByTagName("td"), - item = {}; - - //create index if the dont exist in table - if (!self.hasIndex) { - item[options.index] = index; - } - - for (var i = 0; i < cells.length; i++) { - var cell = cells[i]; - if (typeof this.fieldIndex[i] !== "undefined") { - item[this.fieldIndex[i]] = cell.innerHTML; - } - } - - //add row data to item - data.push(item); - } - - //create new element - var newElement = document.createElement("div"); - - //transfer attributes to new element - var attributes = element.attributes; - - // loop through attributes and apply them on div - - for (var i in attributes) { - if (_typeof(attributes[i]) == "object") { - newElement.setAttribute(attributes[i].name, attributes[i].value); - } - } - - // replace table with div element - element.parentNode.replaceChild(newElement, element); - - options.data = data; - - self.table.options.htmlImported.call(this.table); - - // // newElement.tabulator(options); - - this.table.element = newElement; -}; - -//extract tabulator attribute options -HtmlTableImport.prototype._extractOptions = function (element, options, defaultOptions) { - var attributes = element.attributes; - var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options); - var optionsList = {}; - - optionsArr.forEach(function (item) { - optionsList[item.toLowerCase()] = item; - }); - - for (var index in attributes) { - var attrib = attributes[index]; - var name; - - if (attrib && (typeof attrib === "undefined" ? "undefined" : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { - name = attrib.name.replace("tabulator-", ""); - - if (typeof optionsList[name] !== "undefined") { - options[optionsList[name]] = this._attribValue(attrib.value); - } - } - } -}; - -//get value of attribute -HtmlTableImport.prototype._attribValue = function (value) { - if (value === "true") { - return true; - } - - if (value === "false") { - return false; - } - - return value; -}; - -//find column if it has already been defined -HtmlTableImport.prototype._findCol = function (title) { - var match = this.table.options.columns.find(function (column) { - return column.title === title; - }); - - return match || false; -}; - -//extract column from headers -HtmlTableImport.prototype._extractHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - exists = false, - col = this._findCol(header.textContent), - width, - attributes; - - if (col) { - exists = true; - } else { - col = { title: header.textContent.trim() }; - } - - if (!col.field) { - col.field = header.textContent.trim().toLowerCase().replace(" ", "_"); - } - - width = header.getAttribute("width"); - - if (width && !col.width) { - col.width = width; - } - - //check for tablator inline options - attributes = header.attributes; - - // //check for tablator inline options - this._extractOptions(header, col, Column.prototype.defaultOptionList); - - this.fieldIndex[index] = col.field; - - if (col.field == this.table.options.index) { - this.hasIndex = true; - } - - if (!exists) { - this.table.options.columns.push(col); - } - } -}; - -//generate blank headers -HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - col = { title: "", field: "col" + index }; - - this.fieldIndex[index] = col.field; - - var width = header.getAttribute("width"); - - if (width) { - col.width = width; - } - - this.table.options.columns.push(col); - } -}; - -Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/html_table_import.min.js b/app/static/vendors/tabulator/js/modules/html_table_import.min.js deleted file mode 100644 index aef2b5c..0000000 --- a/app/static/vendors/tabulator/js/modules/html_table_import.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HtmlTableImport=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};HtmlTableImport.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,a=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],l=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),a.length?t._extractHeaders(a,n):t._generateBlankHeaders(a,n);for(var r=0;r -1) { - self.pressedKeys.splice(index, 1); - } - } - }; - - this.table.element.addEventListener("keydown", this.keyupBinding); - - this.table.element.addEventListener("keyup", this.keydownBinding); -}; - -Keybindings.prototype.clearBindings = function () { - if (this.keyupBinding) { - this.table.element.removeEventListener("keydown", this.keyupBinding); - } - - if (this.keydownBinding) { - this.table.element.removeEventListener("keyup", this.keydownBinding); - } -}; - -Keybindings.prototype.checkBinding = function (e, binding) { - var self = this, - match = true; - - if (e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta) { - binding.keys.forEach(function (key) { - var index = self.pressedKeys.indexOf(key); - - if (index == -1) { - match = false; - } - }); - - if (match) { - binding.action.call(self, e); - } - - return true; - } - - return false; -}; - -//default bindings -Keybindings.prototype.bindings = { - navPrev: "shift + 9", - navNext: 9, - navUp: 38, - navDown: 40, - scrollPageUp: 33, - scrollPageDown: 34, - scrollToStart: 36, - scrollToEnd: 35, - undo: "ctrl + 90", - redo: "ctrl + 89", - copyToClipboard: "ctrl + 67" -}; - -//default actions -Keybindings.prototype.actions = { - keyBlock: function keyBlock(e) { - e.stopPropagation(); - e.preventDefault(); - }, - scrollPageUp: function scrollPageUp(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop - rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos >= 0) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - } - - this.table.element.focus(); - }, - scrollPageDown: function scrollPageDown(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop + rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos <= scrollMax) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - } - - this.table.element.focus(); - }, - scrollToStart: function scrollToStart(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - - this.table.element.focus(); - }, - scrollToEnd: function scrollToEnd(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - - this.table.element.focus(); - }, - navPrev: function navPrev(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().prev(); - } - } - }, - - navNext: function navNext(e) { - var cell = false; - var newRow = this.table.options.tabEndNewRow; - var nav; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - - nav = cell.nav(); - - if (!nav.next()) { - if (newRow) { - - cell.getElement().firstChild.blur(); - - if (newRow === true) { - newRow = this.table.addRow({}); - } else { - if (typeof newRow == "function") { - newRow = this.table.addRow(newRow(cell.row.getComponent())); - } else { - newRow = this.table.addRow(Object.assign({}, newRow)); - } - } - - newRow.then(function () { - setTimeout(function () { - nav.next(); - }); - }); - } - } - } - } - }, - - navLeft: function navLeft(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().left(); - } - } - }, - - navRight: function navRight(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().right(); - } - } - }, - - navUp: function navUp(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().up(); - } - } - }, - - navDown: function navDown(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().down(); - } - } - }, - - undo: function undo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.undo(); - } - } - }, - - redo: function redo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.redo(); - } - } - }, - - copyToClipboard: function copyToClipboard(e) { - if (!this.table.modules.edit.currentCell) { - if (this.table.modExists("clipboard", true)) { - this.table.modules.clipboard.copy(false, true); - } - } - } -}; - -Tabulator.prototype.registerModule("keybindings", Keybindings); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/keybindings.min.js b/app/static/vendors/tabulator/js/modules/keybindings.min.js deleted file mode 100644 index 3535b88..0000000 --- a/app/static/vendors/tabulator/js/modules/keybindings.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Keybindings=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};Keybindings.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var i in this.bindings)e[i]=this.bindings[i];if(Object.keys(t).length)for(var n in t)e[n]=t[n];this.mapBindings(e),this.bindEvents()}},Keybindings.prototype.mapBindings=function(t){var e=this,i=this;for(var n in t)!function(n){e.actions[n]?t[n]&&("object"!==_typeof(t[n])&&(t[n]=[t[n]]),t[n].forEach(function(t){i.mapBinding(n,t)})):console.warn("Key Binding Error - no such action:",n)}(n)},Keybindings.prototype.mapBinding=function(t,e){var i=this,n={action:this.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":n.ctrl=!0;break;case"shift":n.shift=!0;break;case"meta":n.meta=!0;break;default:t=parseInt(t),n.keys.push(t),i.watchKeys[t]||(i.watchKeys[t]=[]),i.watchKeys[t].push(n)}})},Keybindings.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var i=e.keyCode,n=t.watchKeys[i];n&&(t.pressedKeys.push(i),n.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=e.keyCode;if(t.watchKeys[i]){var n=t.pressedKeys.indexOf(i);n>-1&&t.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},Keybindings.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},Keybindings.prototype.checkBinding=function(t,e){var i=this,n=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(function(t){-1==i.pressedKeys.indexOf(t)&&(n=!1)}),n&&e.action.call(i,t),!0)},Keybindings.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},Keybindings.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.height,n=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=n?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e,i=!1,n=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(i=this.table.modules.edit.currentCell)&&(t.preventDefault(),e=i.nav(),e.next()||n&&(i.getElement().firstChild.blur(),n=!0===n?this.table.addRow({}):"function"==typeof n?this.table.addRow(n(i.row.getComponent())):this.table.addRow(Object.assign({},n)),n.then(function(){setTimeout(function(){e.next()})})))},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},Tabulator.prototype.registerModule("keybindings",Keybindings); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/menu.js b/app/static/vendors/tabulator/js/modules/menu.js deleted file mode 100644 index d86575f..0000000 --- a/app/static/vendors/tabulator/js/modules/menu.js +++ /dev/null @@ -1,200 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Menu = function Menu(table) { - this.table = table; //hold Tabulator object - this.menuEl = false; - this.blurEvent = this.hideMenu.bind(this); - this.escEvent = this.escMenu.bind(this); - this.nestedMenuBlock = false; -}; - -Menu.prototype.initializeColumnHeader = function (column) { - var _this = this; - - var headerMenuEl; - - if (column.definition.headerContextMenu) { - column.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof column.definition.headerContextMenu == "function" ? column.definition.headerContextMenu(column.getComponent()) : column.definition.headerContextMenu; - - e.preventDefault(); - - _this.loadMenu(e, column, menu); - }); - } - - if (column.definition.headerMenu) { - - headerMenuEl = document.createElement("span"); - headerMenuEl.classList.add("tabulator-header-menu-button"); - headerMenuEl.innerHTML = "⋮"; - - headerMenuEl.addEventListener("click", function (e) { - var menu = typeof column.definition.headerMenu == "function" ? column.definition.headerMenu(column.getComponent()) : column.definition.headerMenu; - e.stopPropagation(); - e.preventDefault(); - - _this.loadMenu(e, column, menu); - }); - - column.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild); - } -}; - -Menu.prototype.initializeCell = function (cell) { - var _this2 = this; - - cell.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof cell.column.definition.contextMenu == "function" ? cell.column.definition.contextMenu(cell.getComponent()) : cell.column.definition.contextMenu; - - e.stopImmediatePropagation(); - - _this2.loadMenu(e, cell, menu); - }); -}; - -Menu.prototype.initializeRow = function (row) { - var _this3 = this; - - row.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this3.table.options.rowContextMenu == "function" ? _this3.table.options.rowContextMenu(row.getComponent()) : _this3.table.options.rowContextMenu; - - _this3.loadMenu(e, row, menu); - }); -}; - -Menu.prototype.initializeGroup = function (group) { - var _this4 = this; - - group.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this4.table.options.groupContextMenu == "function" ? _this4.table.options.groupContextMenu(group.getComponent()) : _this4.table.options.groupContextMenu; - - _this4.loadMenu(e, group, menu); - }); -}; - -Menu.prototype.loadMenu = function (e, component, menu) { - var _this5 = this; - - var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); - - e.preventDefault(); - - //abort if no menu set - if (!menu || !menu.length) { - return; - } - - if (this.nestedMenuBlock) { - //abort if child menu already open - if (this.isOpen()) { - return; - } - } else { - this.nestedMenuBlock = setTimeout(function () { - _this5.nestedMenuBlock = false; - }, 100); - } - - this.hideMenu(); - - this.menuEl = document.createElement("div"); - this.menuEl.classList.add("tabulator-menu"); - - menu.forEach(function (item) { - var itemEl = document.createElement("div"); - var label = item.label; - var disabled = item.disabled; - - if (item.separator) { - itemEl.classList.add("tabulator-menu-separator"); - } else { - itemEl.classList.add("tabulator-menu-item"); - - if (typeof label == "function") { - label = label(component.getComponent()); - } - - if (label instanceof Node) { - itemEl.appendChild(label); - } else { - itemEl.innerHTML = label; - } - - if (typeof disabled == "function") { - disabled = disabled(component.getComponent()); - } - - if (disabled) { - itemEl.classList.add("tabulator-menu-item-disabled"); - itemEl.addEventListener("click", function (e) { - e.stopPropagation(); - }); - } else { - itemEl.addEventListener("click", function (e) { - _this5.hideMenu(); - item.action(e, component.getComponent()); - }); - } - } - - _this5.menuEl.appendChild(itemEl); - }); - - this.menuEl.style.top = e.pageY + "px"; - this.menuEl.style.left = e.pageX + "px"; - - document.body.addEventListener("click", this.blurEvent); - this.table.rowManager.element.addEventListener("scroll", this.blurEvent); - - setTimeout(function () { - document.body.addEventListener("contextmenu", _this5.blurEvent); - }, 100); - - document.body.addEventListener("keydown", this.escEvent); - - document.body.appendChild(this.menuEl); - - //move menu to start on right edge if it is too close to the edge of the screen - if (e.pageX + this.menuEl.offsetWidth >= document.body.offsetWidth) { - this.menuEl.style.left = ""; - this.menuEl.style.right = document.body.offsetWidth - e.pageX + "px"; - } - - //move menu to start on bottom edge if it is too close to the edge of the screen - if (e.pageY + this.menuEl.offsetHeight >= docHeight) { - this.menuEl.style.top = ""; - this.menuEl.style.bottom = docHeight - e.pageY + "px"; - } -}; - -Menu.prototype.isOpen = function () { - return !!this.menuEl.parentNode; -}; - -Menu.prototype.escMenu = function (e) { - if (e.keyCode == 27) { - this.hideMenu(); - } -}; - -Menu.prototype.hideMenu = function () { - if (this.menuEl.parentNode) { - this.menuEl.parentNode.removeChild(this.menuEl); - } - - if (this.escEvent) { - document.body.removeEventListener("keydown", this.escEvent); - } - - if (this.blurEvent) { - document.body.removeEventListener("click", this.blurEvent); - document.body.removeEventListener("contextmenu", this.blurEvent); - this.table.rowManager.element.removeEventListener("scroll", this.blurEvent); - } -}; - -//default accessors -Menu.prototype.menus = {}; - -Tabulator.prototype.registerModule("menu", Menu); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/menu.min.js b/app/static/vendors/tabulator/js/modules/menu.min.js deleted file mode 100644 index 40b8241..0000000 --- a/app/static/vendors/tabulator/js/modules/menu.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var Menu=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1};Menu.prototype.initializeColumnHeader=function(e){var t,n=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var o="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),n.loadMenu(t,e,o)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var o="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),n.loadMenu(t,e,o)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},Menu.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;n.stopImmediatePropagation(),t.loadMenu(n,e,o)})},Menu.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;t.loadMenu(n,e,o)})},Menu.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var o="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;t.loadMenu(n,e,o)})},Menu.prototype.loadMenu=function(e,t,n){var o=this,i=Math.max(document.body.offsetHeight,window.innerHeight);if(e.preventDefault(),n&&n.length){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout(function(){o.nestedMenuBlock=!1},100);this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),n.forEach(function(e){var n=document.createElement("div"),i=e.label,u=e.disabled;e.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof i&&(i=i(t.getComponent())),i instanceof Node?n.appendChild(i):n.innerHTML=i,"function"==typeof u&&(u=u(t.getComponent())),u?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",function(e){e.stopPropagation()})):n.addEventListener("click",function(n){o.hideMenu(),e.action(n,t.getComponent())})),o.menuEl.appendChild(n)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",o.blurEvent)},100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=i&&(this.menuEl.style.top="",this.menuEl.style.bottom=i-e.pageY+"px")}},Menu.prototype.isOpen=function(){return!!this.menuEl.parentNode},Menu.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},Menu.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},Menu.prototype.menus={},Tabulator.prototype.registerModule("menu",Menu); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/moveable_columns.js b/app/static/vendors/tabulator/js/modules/moveable_columns.js deleted file mode 100644 index 5244016..0000000 --- a/app/static/vendors/tabulator/js/modules/moveable_columns.js +++ /dev/null @@ -1,289 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var MoveColumns = function MoveColumns(table) { - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating column header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving column - this.toCol = false; //destination column - this.toColAfter = false; //position of moving column relative to the desitnation column - this.startX = 0; //starting position within header element - this.autoScrollMargin = 40; //auto scroll on edge when within margin - this.autoScrollStep = 5; //auto scroll distance in pixels - this.autoScrollTimeout = false; //auto scroll timeout - this.touchMove = false; - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); -}; - -MoveColumns.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.classList.add("tabulator-col-placeholder"); - - return el; -}; - -MoveColumns.prototype.initializeColumn = function (column) { - var self = this, - config = {}, - colEl; - - if (!column.modules.frozen) { - - colEl = column.getElement(); - - config.mousemove = function (e) { - if (column.parent === self.moving.parent) { - if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) { - if (self.toCol !== column || !self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling); - self.moveColumn(column, true); - } - } else { - if (self.toCol !== column || self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl); - self.moveColumn(column, false); - } - } - } - }.bind(self); - - colEl.addEventListener("mousedown", function (e) { - self.touchMove = false; - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, column); - }, self.checkPeriod); - } - }); - - colEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - self.bindTouchEvents(column); - } - - column.modules.moveColumn = config; -}; - -MoveColumns.prototype.bindTouchEvents = function (column) { - var self = this, - colEl = column.getElement(), - startXMove = false, - //shifting center position of the cell - dir = false, - currentCol, - nextCol, - prevCol, - nextColWidth, - prevColWidth, - nextColWidthLast, - prevColWidthLast; - - colEl.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentCol = column; - nextCol = column.nextColumn(); - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = column.prevColumn(); - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - nextColWidthLast = 0; - prevColWidthLast = 0; - startXMove = false; - - self.startMove(e, column); - }, self.checkPeriod); - }, { passive: true }); - - colEl.addEventListener("touchmove", function (e) { - var halfCol, diff, moveToCol; - - if (self.moving) { - self.moveHover(e); - - if (!startXMove) { - startXMove = e.touches[0].pageX; - } - - diff = e.touches[0].pageX - startXMove; - - if (diff > 0) { - if (nextCol && diff - nextColWidthLast > nextColWidth) { - moveToCol = nextCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement().nextSibling); - self.moveColumn(moveToCol, true); - } - } - } else { - if (prevCol && -diff - prevColWidthLast > prevColWidth) { - moveToCol = prevCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement()); - self.moveColumn(moveToCol, false); - } - } - } - - if (moveToCol) { - currentCol = moveToCol; - nextCol = moveToCol.nextColumn(); - nextColWidthLast = nextColWidth; - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = moveToCol.prevColumn(); - prevColWidthLast = prevColWidth; - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - } - } - }, { passive: true }); - - colEl.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - } - }); -}; - -MoveColumns.prototype.startMove = function (e, column) { - var element = column.getElement(); - - this.moving = column; - this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(element).left; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = column.getWidth() + "px"; - this.placeholderElement.style.height = column.getHeight() + "px"; - - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - this.table.columnManager.getElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.bottom = "0"; - - if (!this.touchMove) { - this._bindMouseMove(); - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - } - - this.moveHover(e); -}; - -MoveColumns.prototype._bindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().addEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); -}; - -MoveColumns.prototype._unbindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().removeEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); -}; - -MoveColumns.prototype.moveColumn = function (column, after) { - var movingCells = this.moving.getCells(); - - this.toCol = column; - this.toColAfter = after; - - if (after) { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling); - }); - } else { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl); - }); - } -}; - -MoveColumns.prototype.endMove = function (e) { - if (e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toCol) { - this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter); - } - - this.moving = false; - this.toCol = false; - this.toColAfter = false; - - if (!this.touchMove) { - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - } - } -}; - -MoveColumns.prototype.moveHover = function (e) { - var self = this, - columnHolder = self.table.columnManager.getElement(), - scrollLeft = columnHolder.scrollLeft, - xPos = (self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(columnHolder).left + scrollLeft, - scrollPos; - - self.hoverElement.style.left = xPos - self.startX + "px"; - - if (xPos - scrollLeft < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.max(0, scrollLeft - 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - - if (scrollLeft + columnHolder.clientWidth - xPos < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.min(columnHolder.clientWidth, scrollLeft + 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } -}; - -Tabulator.prototype.registerModule("moveColumn", MoveColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/moveable_columns.min.js b/app/static/vendors/tabulator/js/modules/moveable_columns.min.js deleted file mode 100644 index 0135a3b..0000000 --- a/app/static/vendors/tabulator/js/modules/moveable_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var MoveColumns=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};MoveColumns.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},MoveColumns.prototype.initializeColumn=function(e){var t,o=this,n={};e.modules.frozen||(t=e.getElement(),n.mousemove=function(n){e.parent===o.moving.parent&&((o.touchMove?n.touches[0].pageX:n.pageX)-Tabulator.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=n},MoveColumns.prototype.bindTouchEvents=function(e){var t,o,n,l,i,s,m,r=this,u=e.getElement(),h=!1;u.addEventListener("touchstart",function(u){r.checkTimeout=setTimeout(function(){r.touchMove=!0,t=e,o=e.nextColumn(),l=o?o.getWidth()/2:0,n=e.prevColumn(),i=n?n.getWidth()/2:0,s=0,m=0,h=!1,r.startMove(u,e)},r.checkPeriod)},{passive:!0}),u.addEventListener("touchmove",function(u){var a,c;r.moving&&(r.moveHover(u),h||(h=u.touches[0].pageX),a=u.touches[0].pageX-h,a>0?o&&a-s>l&&(c=o)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement().nextSibling),r.moveColumn(c,!0)):n&&-a-m>i&&(c=n)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement()),r.moveColumn(c,!1)),c&&(t=c,o=c.nextColumn(),s=l,l=o?o.getWidth()/2:0,n=c.prevColumn(),m=i,i=n?n.getWidth()/2:0))},{passive:!0}),u.addEventListener("touchend",function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)})},MoveColumns.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)},MoveColumns.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n.nextSibling)}):e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n)})},MoveColumns.prototype.endMove=function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},MoveColumns.prototype.moveHover=function(e){var t,o=this,n=o.table.columnManager.getElement(),l=n.scrollLeft,i=(o.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(n).left+l;o.hoverElement.style.left=i-o.startX+"px",i-l group.getHeight() / 2) { - if (self.toRow !== group || !self.toRowAfter) { - var rowEl = group.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(group, true); - } - } else { - if (self.toRow !== group || self.toRowAfter) { - var rowEl = group.getElement(); - if (rowEl.previousSibling) { - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(group, false); - } - } - } - }.bind(self); - - group.modules.moveRow = config; -}; - -MoveRows.prototype.initializeRow = function (row) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(row.element).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) { - if (self.toRow !== row || !self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(row, true); - } - } else { - if (self.toRow !== row || self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(row, false); - } - } - }.bind(self); - - if (!this.hasHandle) { - - rowEl = row.getElement(); - - rowEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, row); - }, self.checkPeriod); - } - }); - - rowEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(row, row.getElement()); - } - - row.modules.moveRow = config; -}; - -MoveRows.prototype.initializeCell = function (cell) { - var self = this, - cellEl = cell.getElement(); - - cellEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, cell.row); - }, self.checkPeriod); - } - }); - - cellEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(cell.row, cell.getElement()); -}; - -MoveRows.prototype.bindTouchEvents = function (row, element) { - var self = this, - startYMove = false, - //shifting center position of the cell - dir = false, - currentRow, - nextRow, - prevRow, - nextRowHeight, - prevRowHeight, - nextRowHeightLast, - prevRowHeightLast; - - element.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentRow = row; - nextRow = row.nextRow(); - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = row.prevRow(); - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - nextRowHeightLast = 0; - prevRowHeightLast = 0; - startYMove = false; - - self.startMove(e, row); - }, self.checkPeriod); - }, { passive: true }); - this.moving, this.toRow, this.toRowAfter; - element.addEventListener("touchmove", function (e) { - - var halfCol, diff, moveToRow; - - if (self.moving) { - e.preventDefault(); - - self.moveHover(e); - - if (!startYMove) { - startYMove = e.touches[0].pageY; - } - - diff = e.touches[0].pageY - startYMove; - - if (diff > 0) { - if (nextRow && diff - nextRowHeightLast > nextRowHeight) { - moveToRow = nextRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement().nextSibling); - self.moveRow(moveToRow, true); - } - } - } else { - if (prevRow && -diff - prevRowHeightLast > prevRowHeight) { - moveToRow = prevRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement()); - self.moveRow(moveToRow, false); - } - } - } - - if (moveToRow) { - currentRow = moveToRow; - nextRow = moveToRow.nextRow(); - nextRowHeightLast = nextRowHeight; - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = moveToRow.prevRow(); - prevRowHeightLast = prevRowHeight; - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - } - } - }); - - element.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - self.touchMove = false; - } - }); -}; - -MoveRows.prototype._bindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().addEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); -}; - -MoveRows.prototype._unbindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().removeEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); -}; - -MoveRows.prototype.startMove = function (e, row) { - var element = row.getElement(); - - this.setStartPosition(e, row); - - this.moving = row; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = row.getWidth() + "px"; - this.placeholderElement.style.height = row.getHeight() + "px"; - - if (!this.connection) { - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - } else { - this.table.element.classList.add("tabulator-movingrow-sending"); - this.connectToTables(row); - } - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - if (this.connection) { - document.body.appendChild(this.hoverElement); - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - this.hoverElement.style.width = this.table.element.clientWidth + "px"; - this.hoverElement.style.whiteSpace = "nowrap"; - this.hoverElement.style.overflow = "hidden"; - this.hoverElement.style.pointerEvents = "none"; - } else { - this.table.rowManager.getTableElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - - this._bindMouseMove(); - } - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - - this.moveHover(e); -}; - -MoveRows.prototype.setStartPosition = function (e, row) { - var pageX = this.touchMove ? e.touches[0].pageX : e.pageX, - pageY = this.touchMove ? e.touches[0].pageY : e.pageY, - element, - position; - - element = row.getElement(); - if (this.connection) { - position = element.getBoundingClientRect(); - - this.startX = position.left - pageX + window.pageXOffset; - this.startY = position.top - pageY + window.pageYOffset; - } else { - this.startY = pageY - element.getBoundingClientRect().top; - } -}; - -MoveRows.prototype.endMove = function (e) { - if (!e || e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - if (!this.connection) { - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - } - - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toRow) { - this.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter); - } - - this.moving = false; - this.toRow = false; - this.toRowAfter = false; - - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - - if (this.connection) { - this.table.element.classList.remove("tabulator-movingrow-sending"); - this.disconnectFromTables(); - } - } -}; - -MoveRows.prototype.moveRow = function (row, after) { - this.toRow = row; - this.toRowAfter = after; -}; - -MoveRows.prototype.moveHover = function (e) { - if (this.connection) { - this.moveHoverConnections.call(this, e); - } else { - this.moveHoverTable.call(this, e); - } -}; - -MoveRows.prototype.moveHoverTable = function (e) { - var rowHolder = this.table.rowManager.getElement(), - scrollTop = rowHolder.scrollTop, - yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop, - scrollPos; - - this.hoverElement.style.top = yPos - this.startY + "px"; -}; - -MoveRows.prototype.moveHoverConnections = function (e) { - this.hoverElement.style.left = this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX) + "px"; - this.hoverElement.style.top = this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY) + "px"; -}; - -MoveRows.prototype.elementRowDrop = function (e, element, row) { - if (this.table.options.movableRowsElementDrop) { - this.table.options.movableRowsElementDrop(e, element, row ? row.getComponent() : false); - } -}; - -//establish connection with other tables -MoveRows.prototype.connectToTables = function (row) { - var _this = this; - - var connectionTables; - - if (this.connectionSelectorsTables) { - connectionTables = this.table.modules.comms.getConnections(this.connectionSelectorsTables); - - this.table.options.movableRowsSendingStart.call(this.table, connectionTables); - - this.table.modules.comms.send(this.connectionSelectorsTables, "moveRow", "connect", { - row: row - }); - } - - if (this.connectionSelectorsElements) { - - this.connectionElements = []; - - if (!Array.isArray(this.connectionSelectorsElements)) { - this.connectionSelectorsElements = [this.connectionSelectorsElements]; - } - - this.connectionSelectorsElements.forEach(function (query) { - if (typeof query === "string") { - _this.connectionElements = _this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query))); - } else { - _this.connectionElements.push(query); - } - }); - - this.connectionElements.forEach(function (element) { - var dropEvent = function dropEvent(e) { - _this.elementRowDrop(e, element, _this.moving); - }; - - element.addEventListener("mouseup", dropEvent); - element.tabulatorElementDropEvent = dropEvent; - - element.classList.add("tabulator-movingrow-receiving"); - }); - } -}; - -//disconnect from other tables -MoveRows.prototype.disconnectFromTables = function () { - var connectionTables; - - if (this.connectionSelectorsTables) { - connectionTables = this.table.modules.comms.getConnections(this.connectionSelectorsTables); - - this.table.options.movableRowsSendingStop.call(this.table, connectionTables); - - this.table.modules.comms.send(this.connectionSelectorsTables, "moveRow", "disconnect"); - } - - this.connectionElements.forEach(function (element) { - element.classList.remove("tabulator-movingrow-receiving"); - element.removeEventListener("mouseup", element.tabulatorElementDropEvent); - delete element.tabulatorElementDropEvent; - }); -}; - -//accept incomming connection -MoveRows.prototype.connect = function (table, row) { - var self = this; - if (!this.connectedTable) { - this.connectedTable = table; - this.connectedRow = row; - - this.table.element.classList.add("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.tableRowDropEvent = self.tableRowDrop.bind(self); - - self.table.element.addEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStart.call(this.table, row, table); - - return true; - } else { - console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable); - return false; - } -}; - -//close incomming connection -MoveRows.prototype.disconnect = function (table) { - var self = this; - if (table === this.connectedTable) { - this.connectedTable = false; - this.connectedRow = false; - - this.table.element.classList.remove("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().removeEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.table.element.removeEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStop.call(this.table, table); - } else { - console.warn("Move Row Error - trying to disconnect from non connected table"); - } -}; - -MoveRows.prototype.dropComplete = function (table, row, success) { - var sender = false; - - if (success) { - - switch (_typeof(this.table.options.movableRowsSender)) { - case "string": - sender = this.senders[this.table.options.movableRowsSender]; - break; - - case "function": - sender = this.table.options.movableRowsSender; - break; - } - - if (sender) { - sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - if (this.table.options.movableRowsSender) { - console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender); - } - } - - this.table.options.movableRowsSent.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - this.table.options.movableRowsSentFailed.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } - - this.endMove(); -}; - -MoveRows.prototype.tableRowDrop = function (e, row) { - var receiver = false, - success = false; - - console.trace("drop"); - - e.stopImmediatePropagation(); - - switch (_typeof(this.table.options.movableRowsReceiver)) { - case "string": - receiver = this.receivers[this.table.options.movableRowsReceiver]; - break; - - case "function": - receiver = this.table.options.movableRowsReceiver; - break; - } - - if (receiver) { - success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver); - } - - if (success) { - this.table.options.movableRowsReceived.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - this.table.options.movableRowsReceivedFailed.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } - - this.table.modules.comms.send(this.connectedTable, "moveRow", "dropcomplete", { - row: row, - success: success - }); -}; - -MoveRows.prototype.receivers = { - insert: function insert(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData(), undefined, toRow); - return true; - }, - - add: function add(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData()); - return true; - }, - - update: function update(fromRow, toRow, fromTable) { - if (toRow) { - toRow.update(fromRow.getData()); - return true; - } - - return false; - }, - - replace: function replace(fromRow, toRow, fromTable) { - if (toRow) { - this.table.addRow(fromRow.getData(), undefined, toRow); - toRow.delete(); - return true; - } - - return false; - } -}; - -MoveRows.prototype.senders = { - delete: function _delete(fromRow, toRow, toTable) { - fromRow.delete(); - } -}; - -MoveRows.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "connect": - return this.connect(table, data.row); - break; - - case "disconnect": - return this.disconnect(table); - break; - - case "dropcomplete": - return this.dropComplete(table, data.row, data.success); - break; - } -}; - -Tabulator.prototype.registerModule("moveRow", MoveRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/moveable_rows.min.js b/app/static/vendors/tabulator/js/modules/moveable_rows.min.js deleted file mode 100644 index f928535..0000000 --- a/app/static/vendors/tabulator/js/modules/moveable_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MoveRows=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1};MoveRows.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e},MoveRows.prototype.initialize=function(e){this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements},MoveRows.prototype.setHandle=function(e){this.hasHandle=e},MoveRows.prototype.initializeGroupHeader=function(e){var t=this,o={};o.mouseup=function(e){t.tableRowDrop(e,row)}.bind(t),o.mousemove=function(o){if(o.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var n=e.getElement();n.previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},MoveRows.prototype.initializeRow=function(e){var t,o=this,n={};n.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),n.mousemove=function(t){if(t.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n},MoveRows.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},MoveRows.prototype.bindTouchEvents=function(e,t){var o,n,s,i,l,c,r,a=this,h=!1;t.addEventListener("touchstart",function(t){a.checkTimeout=setTimeout(function(){a.touchMove=!0,o=e,n=e.nextRow(),i=n?n.getHeight()/2:0,s=e.prevRow(),l=s?s.getHeight()/2:0,c=0,r=0,h=!1,a.startMove(t,e)},a.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var m,v;a.moving&&(t.preventDefault(),a.moveHover(t),h||(h=t.touches[0].pageY),m=t.touches[0].pageY-h,m>0?n&&m-c>i&&(v=n)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(a.placeholderElement,v.getElement().nextSibling),a.moveRow(v,!0)):s&&-m-r>l&&(v=s)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(a.placeholderElement,v.getElement()),a.moveRow(v,!1)),v&&(o=v,n=v.nextRow(),c=i,i=n?n.getHeight()/2:0,s=v.prevRow(),r=l,l=s?s.getHeight()/2:0))}),t.addEventListener("touchend",function(e){a.checkTimeout&&clearTimeout(a.checkTimeout),a.moving&&(a.endMove(e),a.touchMove=!1)})},MoveRows.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},MoveRows.prototype.setStartPosition=function(e,t){var o,n,s=this.touchMove?e.touches[0].pageX:e.pageX,i=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(n=o.getBoundingClientRect(),this.startX=n.left-s+window.pageXOffset,this.startY=n.top-i+window.pageYOffset):this.startY=i-o.getBoundingClientRect().top},MoveRows.prototype.endMove=function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},MoveRows.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},MoveRows.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},MoveRows.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=n-this.startY+"px"},MoveRows.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},MoveRows.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},MoveRows.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(e){"string"==typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)}),this.connectionElements.forEach(function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")}))},MoveRows.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent})},MoveRows.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},MoveRows.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},MoveRows.prototype.dropComplete=function(e,t,o){var n=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":n=this.senders[this.table.options.movableRowsSender];break;case"function":n=this.table.options.movableRowsSender}n?n.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},MoveRows.prototype.tableRowDrop=function(e,t){var o=!1,n=!1;switch(console.trace("drop"),e.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?n=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),n?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:n})},MoveRows.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},MoveRows.prototype.senders={delete:function(e,t,o){e.delete()}},MoveRows.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},Tabulator.prototype.registerModule("moveRow",MoveRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/mutator.js b/app/static/vendors/tabulator/js/modules/mutator.js deleted file mode 100644 index e5b5dad..0000000 --- a/app/static/vendors/tabulator/js/modules/mutator.js +++ /dev/null @@ -1,116 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Mutator = function Mutator(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types - this.enabled = true; -}; - -//initialize column mutator -Mutator.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - mutator; - - if (column.definition[key]) { - mutator = self.lookupMutator(column.definition[key]); - - if (mutator) { - match = true; - - config[key] = { - mutator: mutator, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.mutate = config; - } -}; - -Mutator.prototype.lookupMutator = function (value) { - var mutator = false; - - //set column mutator - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - if (this.mutators[value]) { - mutator = this.mutators[value]; - } else { - console.warn("Mutator Error - No such mutator found, ignoring: ", value); - } - break; - - case "function": - mutator = value; - break; - } - - return mutator; -}; - -//apply mutator to row -Mutator.prototype.transformRow = function (data, type, updatedData) { - var self = this, - key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - value; - - if (this.enabled) { - - self.table.columnManager.traverse(function (column) { - var mutator, params, component; - - if (column.modules.mutate) { - mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; - - if (mutator) { - value = column.getFieldValue(typeof updatedData !== "undefined" ? updatedData : data); - - if (type == "data" || typeof value !== "undefined") { - component = column.getComponent(); - params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; - column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); - } - } - } - }); - } - - return data; -}; - -//apply mutator to new cell value -Mutator.prototype.transformCell = function (cell, value) { - var mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false, - tempData = {}; - - if (mutator) { - tempData = Object.assign(tempData, cell.row.getData()); - cell.column.setFieldValue(tempData, value); - return mutator.mutator(value, tempData, "edit", mutator.params, cell.getComponent()); - } else { - return value; - } -}; - -Mutator.prototype.enable = function () { - this.enabled = true; -}; - -Mutator.prototype.disable = function () { - this.enabled = false; -}; - -//default mutators -Mutator.prototype.mutators = {}; - -Tabulator.prototype.registerModule("mutator", Mutator); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/mutator.min.js b/app/static/vendors/tabulator/js/modules/mutator.min.js deleted file mode 100644 index 00005d1..0000000 --- a/app/static/vendors/tabulator/js/modules/mutator.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mutator=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};Mutator.prototype.initializeColumn=function(t){var o=this,e=!1,a={};this.allowedTypes.forEach(function(r){var u,n="mutator"+(r.charAt(0).toUpperCase()+r.slice(1));t.definition[n]&&(u=o.lookupMutator(t.definition[n]))&&(e=!0,a[n]={mutator:u,params:t.definition[n+"Params"]||{}})}),e&&(t.modules.mutate=a)},Mutator.prototype.lookupMutator=function(t){var o=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t}return o},Mutator.prototype.transformRow=function(t,o,e){var a,r=this,u="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));return this.enabled&&r.table.columnManager.traverse(function(r){var n,i,s;r.modules.mutate&&(n=r.modules.mutate[u]||r.modules.mutate.mutator||!1)&&(a=r.getFieldValue(void 0!==e?e:t),"data"!=o&&void 0===a||(s=r.getComponent(),i="function"==typeof n.params?n.params(a,t,o,s):n.params,r.setFieldValue(t,n.mutator(a,t,o,i,s))))}),t},Mutator.prototype.transformCell=function(t,o){var e=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,a={};return e?(a=Object.assign(a,t.row.getData()),t.column.setFieldValue(a,o),e.mutator(o,a,"edit",e.params,t.getComponent())):o},Mutator.prototype.enable=function(){this.enabled=!0},Mutator.prototype.disable=function(){this.enabled=!1},Mutator.prototype.mutators={},Tabulator.prototype.registerModule("mutator",Mutator); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/page.js b/app/static/vendors/tabulator/js/modules/page.js deleted file mode 100644 index d37b814..0000000 --- a/app/static/vendors/tabulator/js/modules/page.js +++ /dev/null @@ -1,730 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Page = function Page(table) { - - this.table = table; //hold Tabulator object - - this.mode = "local"; - this.progressiveLoad = false; - - this.size = 0; - this.page = 1; - this.count = 5; - this.max = 1; - - this.displayIndex = 0; //index in display pipeline - - this.initialLoad = true; - - this.pageSizes = []; - - this.dataReceivedNames = {}; - this.dataSentNames = {}; - - this.createElements(); -}; - -Page.prototype.createElements = function () { - - var button; - - this.element = document.createElement("span"); - this.element.classList.add("tabulator-paginator"); - - this.pagesElement = document.createElement("span"); - this.pagesElement.classList.add("tabulator-pages"); - - button = document.createElement("button"); - button.classList.add("tabulator-page"); - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", ""); - button.setAttribute("title", ""); - - this.firstBut = button.cloneNode(true); - this.firstBut.setAttribute("data-page", "first"); - - this.prevBut = button.cloneNode(true); - this.prevBut.setAttribute("data-page", "prev"); - - this.nextBut = button.cloneNode(true); - this.nextBut.setAttribute("data-page", "next"); - - this.lastBut = button.cloneNode(true); - this.lastBut.setAttribute("data-page", "last"); - - if (this.table.options.paginationSizeSelector) { - this.pageSizeSelect = document.createElement("select"); - this.pageSizeSelect.classList.add("tabulator-page-size"); - } -}; - -Page.prototype.generatePageSizeSelectList = function () { - var _this = this; - - var pageSizes = []; - - if (this.pageSizeSelect) { - - if (Array.isArray(this.table.options.paginationSizeSelector)) { - pageSizes = this.table.options.paginationSizeSelector; - this.pageSizes = pageSizes; - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes.unshift(this.size); - } - } else { - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes = []; - - for (var i = 1; i < 5; i++) { - pageSizes.push(this.size * i); - } - - this.pageSizes = pageSizes; - } else { - pageSizes = this.pageSizes; - } - } - - while (this.pageSizeSelect.firstChild) { - this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild); - }pageSizes.forEach(function (item) { - var itemEl = document.createElement("option"); - itemEl.value = item; - - if (item === true) { - _this.table.modules.localize.bind("pagination|all", function (value) { - itemEl.innerHTML = value; - }); - } else { - itemEl.innerHTML = item; - } - - _this.pageSizeSelect.appendChild(itemEl); - }); - - this.pageSizeSelect.value = this.size; - } -}; - -//setup pageination -Page.prototype.initialize = function (hidden) { - var self = this, - pageSelectLabel, - testElRow, - testElCell; - - //update param names - this.dataSentNames = Object.assign({}, this.paginationDataSentNames); - this.dataSentNames = Object.assign(this.dataSentNames, this.table.options.paginationDataSent); - - this.dataReceivedNames = Object.assign({}, this.paginationDataReceivedNames); - this.dataReceivedNames = Object.assign(this.dataReceivedNames, this.table.options.paginationDataReceived); - - //build pagination element - - //bind localizations - self.table.modules.localize.bind("pagination|first", function (value) { - self.firstBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|first_title", function (value) { - self.firstBut.setAttribute("aria-label", value); - self.firstBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|prev", function (value) { - self.prevBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|prev_title", function (value) { - self.prevBut.setAttribute("aria-label", value); - self.prevBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|next", function (value) { - self.nextBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|next_title", function (value) { - self.nextBut.setAttribute("aria-label", value); - self.nextBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|last", function (value) { - self.lastBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|last_title", function (value) { - self.lastBut.setAttribute("aria-label", value); - self.lastBut.setAttribute("title", value); - }); - - //click bindings - self.firstBut.addEventListener("click", function () { - self.setPage(1); - }); - - self.prevBut.addEventListener("click", function () { - self.previousPage(); - }); - - self.nextBut.addEventListener("click", function () { - self.nextPage().then(function () {}).catch(function () {}); - }); - - self.lastBut.addEventListener("click", function () { - self.setPage(self.max); - }); - - if (self.table.options.paginationElement) { - self.element = self.table.options.paginationElement; - } - - if (this.pageSizeSelect) { - pageSelectLabel = document.createElement("label"); - - self.table.modules.localize.bind("pagination|page_size", function (value) { - self.pageSizeSelect.setAttribute("aria-label", value); - self.pageSizeSelect.setAttribute("title", value); - pageSelectLabel.innerHTML = value; - }); - - self.element.appendChild(pageSelectLabel); - self.element.appendChild(self.pageSizeSelect); - - self.pageSizeSelect.addEventListener("change", function (e) { - self.setPageSize(self.pageSizeSelect.value == "true" ? true : self.pageSizeSelect.value); - self.setPage(1).then(function () {}).catch(function () {}); - }); - } - - //append to DOM - self.element.appendChild(self.firstBut); - self.element.appendChild(self.prevBut); - self.element.appendChild(self.pagesElement); - self.element.appendChild(self.nextBut); - self.element.appendChild(self.lastBut); - - if (!self.table.options.paginationElement && !hidden) { - self.table.footerManager.append(self.element, self); - } - - //set default values - self.mode = self.table.options.pagination; - - if (self.table.options.paginationSize) { - self.size = self.table.options.paginationSize; - } else { - testElRow = document.createElement("div"); - testElRow.classList.add("tabulator-row"); - testElRow.style.visibility = hidden; - - testElCell = document.createElement("div"); - testElCell.classList.add("tabulator-cell"); - testElCell.innerHTML = "Page Row Test"; - - testElRow.appendChild(testElCell); - - self.table.rowManager.getTableElement().appendChild(testElRow); - - self.size = Math.floor(self.table.rowManager.getElement().clientHeight / testElRow.offsetHeight); - - self.table.rowManager.getTableElement().removeChild(testElRow); - } - - // self.page = self.table.options.paginationInitialPage || 1; - self.count = self.table.options.paginationButtonCount; - - self.generatePageSizeSelectList(); -}; - -Page.prototype.initializeProgressive = function (mode) { - this.initialize(true); - this.mode = "progressive_" + mode; - this.progressiveLoad = true; -}; - -Page.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; -}; - -Page.prototype.getDisplayIndex = function () { - return this.displayIndex; -}; - -//calculate maximum page from number of rows -Page.prototype.setMaxRows = function (rowCount) { - if (!rowCount) { - this.max = 1; - } else { - this.max = this.size === true ? 1 : Math.ceil(rowCount / this.size); - } - - if (this.page > this.max) { - this.page = this.max; - } -}; - -//reset to first page without triggering action -Page.prototype.reset = function (force, columnsChanged) { - if (this.mode == "local" || force) { - this.page = 1; - } - - if (columnsChanged) { - this.initialLoad = true; - } - - return true; -}; - -//set the maxmum page -Page.prototype.setMaxPage = function (max) { - - max = parseInt(max); - - this.max = max || 1; - - if (this.page > this.max) { - this.page = this.max; - this.trigger(); - } -}; - -//set current page number -Page.prototype.setPage = function (page) { - var _this2 = this; - - var self = this; - - switch (page) { - case "first": - return this.setPage(1); - break; - - case "prev": - return this.previousPage(); - break; - - case "next": - return this.nextPage(); - break; - - case "last": - return this.setPage(this.max); - break; - } - - return new Promise(function (resolve, reject) { - - page = parseInt(page); - - if (page > 0 && page <= _this2.max) { - _this2.page = page; - _this2.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.page) { - self.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Requested page is out of range of 1 - " + _this2.max + ":", page); - reject(); - } - }); -}; - -Page.prototype.setPageToRow = function (row) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var rows = _this3.table.rowManager.getDisplayRows(_this3.displayIndex - 1); - var index = rows.indexOf(row); - - if (index > -1) { - var page = _this3.size === true ? 1 : Math.ceil((index + 1) / _this3.size); - - _this3.setPage(page).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - console.warn("Pagination Error - Requested row is not visible"); - reject(); - } - }); -}; - -Page.prototype.setPageSize = function (size) { - if (size !== true) { - size = parseInt(size); - } - - if (size > 0) { - this.size = size; - } - - if (this.pageSizeSelect) { - // this.pageSizeSelect.value = size; - this.generatePageSizeSelectList(); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.page) { - this.table.modules.persistence.save("page"); - } -}; - -//setup the pagination buttons -Page.prototype._setPageButtons = function () { - var self = this; - - var leftSize = Math.floor((this.count - 1) / 2); - var rightSize = Math.ceil((this.count - 1) / 2); - var min = this.max - this.page + leftSize + 1 < this.count ? this.max - this.count + 1 : Math.max(this.page - leftSize, 1); - var max = this.page <= rightSize ? Math.min(this.count, this.max) : Math.min(this.page + rightSize, this.max); - - while (self.pagesElement.firstChild) { - self.pagesElement.removeChild(self.pagesElement.firstChild); - }if (self.page == 1) { - self.firstBut.disabled = true; - self.prevBut.disabled = true; - } else { - self.firstBut.disabled = false; - self.prevBut.disabled = false; - } - - if (self.page == self.max) { - self.lastBut.disabled = true; - self.nextBut.disabled = true; - } else { - self.lastBut.disabled = false; - self.nextBut.disabled = false; - } - - for (var i = min; i <= max; i++) { - if (i > 0 && i <= self.max) { - self.pagesElement.appendChild(self._generatePageButton(i)); - } - } - - this.footerRedraw(); -}; - -Page.prototype._generatePageButton = function (page) { - var self = this, - button = document.createElement("button"); - - button.classList.add("tabulator-page"); - if (page == self.page) { - button.classList.add("active"); - } - - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - - self.table.modules.localize.bind("pagination|page_title", function (value) { - button.setAttribute("aria-label", value + " " + page); - button.setAttribute("title", value + " " + page); - }); - - button.setAttribute("data-page", page); - button.textContent = page; - - button.addEventListener("click", function (e) { - self.setPage(page); - }); - - return button; -}; - -//previous page -Page.prototype.previousPage = function () { - var _this4 = this; - - return new Promise(function (resolve, reject) { - if (_this4.page > 1) { - _this4.page--; - _this4.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this4.table.options.persistence && _this4.table.modExists("persistence", true) && _this4.table.modules.persistence.config.page) { - _this4.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Previous page would be less than page 1:", 0); - reject(); - } - }); -}; - -//next page -Page.prototype.nextPage = function () { - var _this5 = this; - - return new Promise(function (resolve, reject) { - if (_this5.page < _this5.max) { - _this5.page++; - _this5.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this5.table.options.persistence && _this5.table.modExists("persistence", true) && _this5.table.modules.persistence.config.page) { - _this5.table.modules.persistence.save("page"); - } - } else { - if (!_this5.progressiveLoad) { - console.warn("Pagination Error - Next page would be greater than maximum page of " + _this5.max + ":", _this5.max + 1); - } - reject(); - } - }); -}; - -//return current page number -Page.prototype.getPage = function () { - return this.page; -}; - -//return max page number -Page.prototype.getPageMax = function () { - return this.max; -}; - -Page.prototype.getPageSize = function (size) { - return this.size; -}; - -Page.prototype.getMode = function () { - return this.mode; -}; - -//return appropriate rows for current page -Page.prototype.getRows = function (data) { - var output, start, end; - - if (this.mode == "local") { - output = []; - - if (this.size === true) { - start = 0; - end = data.length - 1; - } else { - start = this.size * (this.page - 1); - end = start + parseInt(this.size); - } - - this._setPageButtons(); - - for (var i = start; i < end; i++) { - if (data[i]) { - output.push(data[i]); - } - } - - return output; - } else { - - this._setPageButtons(); - - return data.slice(0); - } -}; - -Page.prototype.trigger = function () { - var _this6 = this; - - var left; - - return new Promise(function (resolve, reject) { - - switch (_this6.mode) { - case "local": - left = _this6.table.rowManager.scrollLeft; - - _this6.table.rowManager.refreshActiveData("page"); - _this6.table.rowManager.scrollHorizontal(left); - - _this6.table.options.pageLoaded.call(_this6.table, _this6.getPage()); - resolve(); - break; - - case "remote": - case "progressive_load": - case "progressive_scroll": - _this6.table.modules.ajax.blockActiveRequest(); - _this6._getRemotePage().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - break; - - default: - console.warn("Pagination Error - no such pagination mode:", _this6.mode); - reject(); - } - }); -}; - -Page.prototype._getRemotePage = function () { - var _this7 = this; - - var self = this, - oldParams, - pageParams; - - return new Promise(function (resolve, reject) { - - if (!self.table.modExists("ajax", true)) { - reject(); - } - - //record old params and restore after request has been made - oldParams = Tabulator.prototype.helpers.deepClone(self.table.modules.ajax.getParams() || {}); - pageParams = self.table.modules.ajax.getParams(); - - //configure request params - pageParams[_this7.dataSentNames.page] = self.page; - - //set page size if defined - if (_this7.size) { - pageParams[_this7.dataSentNames.size] = _this7.size; - } - - //set sort data if defined - if (_this7.table.options.ajaxSorting && _this7.table.modExists("sort")) { - var sorters = self.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - pageParams[_this7.dataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (_this7.table.options.ajaxFiltering && _this7.table.modExists("filter")) { - var filters = self.table.modules.filter.getFilters(true, true); - pageParams[_this7.dataSentNames.filters] = filters; - } - - self.table.modules.ajax.setParams(pageParams); - - self.table.modules.ajax.sendRequest(_this7.progressiveLoad).then(function (data) { - self._parseRemoteData(data); - resolve(); - }).catch(function (e) { - reject(); - }); - - self.table.modules.ajax.setParams(oldParams); - }); -}; - -Page.prototype._parseRemoteData = function (data) { - var self = this, - left, - data, - margin; - - if (typeof data[this.dataReceivedNames.last_page] === "undefined") { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property"); - } - - if (data[this.dataReceivedNames.data]) { - this.max = parseInt(data[this.dataReceivedNames.last_page]) || 1; - - if (this.progressiveLoad) { - switch (this.mode) { - case "progressive_load": - - if (this.page == 1) { - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - } else { - this.table.rowManager.addRows(data[this.dataReceivedNames.data]); - } - - if (this.page < this.max) { - setTimeout(function () { - self.nextPage().then(function () {}).catch(function () {}); - }, self.table.options.ajaxProgressiveLoadDelay); - } - break; - - case "progressive_scroll": - data = this.table.rowManager.getData().concat(data[this.dataReceivedNames.data]); - - this.table.rowManager.setData(data, true, this.initialLoad && this.page == 1); - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2; - - if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) { - self.nextPage().then(function () {}).catch(function () {}); - } - break; - } - } else { - left = this.table.rowManager.scrollLeft; - - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - - this.table.rowManager.scrollHorizontal(left); - - this.table.columnManager.scrollHorizontal(left); - - this.table.options.pageLoaded.call(this.table, this.getPage()); - } - - this.initialLoad = false; - } else { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property"); - } -}; - -//handle the footer element being redrawn -Page.prototype.footerRedraw = function () { - var footer = this.table.footerManager.element; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } else { - this.pagesElement.style.display = ''; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } - } -}; - -//set the paramter names for pagination requests -Page.prototype.paginationDataSentNames = { - "page": "page", - "size": "size", - "sorters": "sorters", - // "sort_dir":"sort_dir", - "filters": "filters" - // "filter_value":"filter_value", - // "filter_type":"filter_type", -}; - -//set the property names for pagination responses -Page.prototype.paginationDataReceivedNames = { - "current_page": "current_page", - "last_page": "last_page", - "data": "data" -}; - -Tabulator.prototype.registerModule("page", Page); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/page.min.js b/app/static/vendors/tabulator/js/modules/page.min.js deleted file mode 100644 index c2835ba..0000000 --- a/app/static/vendors/tabulator/js/modules/page.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var Page=function(e){this.table=e,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};Page.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},Page.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var a=1;a<5;a++)t.push(this.size*a);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var a=document.createElement("option");a.value=t,!0===t?e.table.modules.localize.bind("pagination|all",function(e){a.innerHTML=e}):a.innerHTML=t,e.pageSizeSelect.appendChild(a)}),this.pageSizeSelect.value=this.size}},Page.prototype.initialize=function(e){var t,a,i,s=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),s.table.modules.localize.bind("pagination|first",function(e){s.firstBut.innerHTML=e}),s.table.modules.localize.bind("pagination|first_title",function(e){s.firstBut.setAttribute("aria-label",e),s.firstBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|prev",function(e){s.prevBut.innerHTML=e}),s.table.modules.localize.bind("pagination|prev_title",function(e){s.prevBut.setAttribute("aria-label",e),s.prevBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|next",function(e){s.nextBut.innerHTML=e}),s.table.modules.localize.bind("pagination|next_title",function(e){s.nextBut.setAttribute("aria-label",e),s.nextBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|last",function(e){s.lastBut.innerHTML=e}),s.table.modules.localize.bind("pagination|last_title",function(e){s.lastBut.setAttribute("aria-label",e),s.lastBut.setAttribute("title",e)}),s.firstBut.addEventListener("click",function(){s.setPage(1)}),s.prevBut.addEventListener("click",function(){s.previousPage()}),s.nextBut.addEventListener("click",function(){s.nextPage().then(function(){}).catch(function(){})}),s.lastBut.addEventListener("click",function(){s.setPage(s.max)}),s.table.options.paginationElement&&(s.element=s.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),s.table.modules.localize.bind("pagination|page_size",function(e){s.pageSizeSelect.setAttribute("aria-label",e),s.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),s.element.appendChild(t),s.element.appendChild(s.pageSizeSelect),s.pageSizeSelect.addEventListener("change",function(e){s.setPageSize("true"==s.pageSizeSelect.value||s.pageSizeSelect.value),s.setPage(1).then(function(){}).catch(function(){})})),s.element.appendChild(s.firstBut),s.element.appendChild(s.prevBut),s.element.appendChild(s.pagesElement),s.element.appendChild(s.nextBut),s.element.appendChild(s.lastBut),s.table.options.paginationElement||e||s.table.footerManager.append(s.element,s),s.mode=s.table.options.pagination,s.table.options.paginationSize?s.size=s.table.options.paginationSize:(a=document.createElement("div"),a.classList.add("tabulator-row"),a.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",a.appendChild(i),s.table.rowManager.getTableElement().appendChild(a),s.size=Math.floor(s.table.rowManager.getElement().clientHeight/a.offsetHeight),s.table.rowManager.getTableElement().removeChild(a)),s.count=s.table.options.paginationButtonCount,s.generatePageSizeSelectList()},Page.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},Page.prototype.setDisplayIndex=function(e){this.displayIndex=e},Page.prototype.getDisplayIndex=function(){return this.displayIndex},Page.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},Page.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},Page.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},Page.prototype.setPage=function(e){var t=this,a=this;switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return new Promise(function(i,s){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then(function(){i()}).catch(function(){s()}),a.table.options.persistence&&a.table.modExists("persistence",!0)&&a.table.modules.persistence.config.page&&a.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),s())})},Page.prototype.setPageToRow=function(e){var t=this;return new Promise(function(a,i){var s=t.table.rowManager.getDisplayRows(t.displayIndex-1),n=s.indexOf(e);if(n>-1){var o=!0===t.size?1:Math.ceil((n+1)/t.size);t.setPage(o).then(function(){a()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},Page.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},Page.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),a=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&n<=e.max&&e.pagesElement.appendChild(e._generatePageButton(n));this.footerRedraw()},Page.prototype._generatePageButton=function(e){var t=this,a=document.createElement("button");return a.classList.add("tabulator-page"),e==t.page&&a.classList.add("active"),a.setAttribute("type","button"),a.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",function(t){a.setAttribute("aria-label",t+" "+e),a.setAttribute("title",t+" "+e)}),a.setAttribute("data-page",e),a.textContent=e,a.addEventListener("click",function(a){t.setPage(e)}),a},Page.prototype.previousPage=function(){var e=this;return new Promise(function(t,a){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){a()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),a())})},Page.prototype.nextPage=function(){var e=this;return new Promise(function(t,a){e.page i) { - output.splice(i, 0, column); - } else { - output.push(column); - } - } - }); - - return output; -}; - -//find matching columns -Persistence.prototype._findColumn = function (columns, subject) { - var type = subject.columns ? "group" : subject.field ? "field" : "object"; - - return columns.find(function (col) { - switch (type) { - case "group": - return col.title === subject.title && col.columns.length === subject.columns.length; - break; - - case "field": - return col.field === subject.field; - break; - - case "object": - return col === subject; - break; - } - }); -}; - -//save data -Persistence.prototype.save = function (type) { - var data = {}; - - switch (type) { - case "columns": - data = this.parseColumns(this.table.columnManager.getColumns()); - break; - - case "filter": - data = this.table.modules.filter.getFilters(); - break; - - case "sort": - data = this.validateSorters(this.table.modules.sort.getSort()); - break; - - case "group": - data = this.getGroupConfig(); - break; - - case "page": - data = this.getPageConfig(); - break; - } - - if (this.writeFunc) { - this.writeFunc(this.id, type, data); - } -}; - -//ensure sorters contain no function data -Persistence.prototype.validateSorters = function (data) { - data.forEach(function (item) { - item.column = item.field; - delete item.field; - }); - - return data; -}; - -Persistence.prototype.getGroupConfig = function () { - if (this.config.group) { - if (this.config.group === true || this.config.group.groupBy) { - data.groupBy = this.table.options.groupBy; - } - - if (this.config.group === true || this.config.group.groupStartOpen) { - data.groupStartOpen = this.table.options.groupStartOpen; - } - - if (this.config.group === true || this.config.group.groupHeader) { - data.groupHeader = this.table.options.groupHeader; - } - } - - return data; -}; - -Persistence.prototype.getPageConfig = function () { - var data = {}; - - if (this.config.page) { - if (this.config.page === true || this.config.page.size) { - data.paginationSize = this.table.modules.page.getPageSize(); - } - - if (this.config.page === true || this.config.page.page) { - data.paginationInitialPage = this.table.modules.page.getPage(); - } - } - - return data; -}; - -//parse columns for data to store -Persistence.prototype.parseColumns = function (columns) { - var self = this, - definitions = []; - - columns.forEach(function (column) { - var defStore = {}, - colDef = column.getDefinition(), - keys; - - if (column.isGroup) { - defStore.title = colDef.title; - defStore.columns = self.parseColumns(column.getColumns()); - } else { - defStore.field = column.getField(); - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(colDef); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - - switch (key) { - case "width": - defStore.width = column.getWidth(); - break; - case "visible": - defStore.visible = column.visible; - break; - - default: - defStore[key] = colDef[key]; - } - }); - } - - definitions.push(defStore); - }); - - return definitions; -}; - -// read peristence information from storage -Persistence.prototype.readers = { - local: function local(id, type) { - var data = localStorage.getItem(id + "-" + type); - - return data ? JSON.parse(data) : false; - }, - cookie: function cookie(id, type) { - var cookie = document.cookie, - key = id + "-" + type, - cookiePos = cookie.indexOf(key + "="), - end, - data; - - //if cookie exists, decode and load column data into tabulator - if (cookiePos > -1) { - cookie = cookie.substr(cookiePos); - - end = cookie.indexOf(";"); - - if (end > -1) { - cookie = cookie.substr(0, end); - } - - data = cookie.replace(key + "=", ""); - } - - return data ? JSON.parse(data) : false; - } -}; - -//write persistence information to storage -Persistence.prototype.writers = { - local: function local(id, type, data) { - localStorage.setItem(id + "-" + type, JSON.stringify(data)); - }, - cookie: function cookie(id, type, data) { - var expireDate = new Date(); - - expireDate.setDate(expireDate.getDate() + 10000); - - document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString(); - } -}; - -Tabulator.prototype.registerModule("persistence", Persistence); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/persistence.min.js b/app/static/vendors/tabulator/js/modules/persistence.min.js deleted file mode 100644 index 8d87ab3..0000000 --- a/app/static/vendors/tabulator/js/modules/persistence.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var Persistence=function(e){this.table=e,this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1};Persistence.prototype.localStorageTest=function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}},Persistence.prototype.initialize=function(){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:this.readers[this.table.options.persistenceReaderFunc]?this.readFunc=this.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):this.readers[this.mode]?this.readFunc=this.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:this.readers[this.table.options.persistenceWriterFunc]?this.writeFunc=this.readers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):this.writers[this.mode]?this.writeFunc=this.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader))},Persistence.prototype.initializeColumn=function(e){var t,i,s=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),i=!0===this.config.columns?Object.keys(t):this.config.columns,i.forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e),o=t[e];i&&Object.defineProperty(t,e,{set:function(e){o=e,s.defWatcherBlock||s.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),o}})}),this.defWatcherBlock=!1)},Persistence.prototype.load=function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i},Persistence.prototype.retreiveData=function(e){return!!this.readFunc&&this.readFunc(this.id,e)},Persistence.prototype.mergeDefinition=function(e,t){var i=this,s=[];return t=t||[],t.forEach(function(t,o){var n,r=i._findColumn(e,t);r&&(!0===i.config.columns||void 0==i.config.columns?(n=Object.keys(r),n.push("width")):n=i.config.columns,n.forEach(function(e){void 0!==t[e]&&(r[e]=t[e])}),r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),s.push(r))}),e.forEach(function(e,o){i._findColumn(t,e)||(s.length>o?s.splice(o,0,e):s.push(e))}),s},Persistence.prototype._findColumn=function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},Persistence.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},Persistence.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},Persistence.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},Persistence.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},Persistence.prototype.parseColumns=function(e){var t=this,i=[];return e.forEach(function(e){var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=t.parseColumns(e.getColumns())):(o.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(s=Object.keys(n),s.push("width")):s=t.config.columns,s.forEach(function(t){switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:o[t]=n[t]}})),i.push(o)}),i},Persistence.prototype.readers={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&(o=o.substr(r),i=o.indexOf(";"),i>-1&&(o=o.substr(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},Persistence.prototype.writers={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}},Tabulator.prototype.registerModule("persistence",Persistence); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/print.js b/app/static/vendors/tabulator/js/modules/print.js deleted file mode 100644 index 940f1a9..0000000 --- a/app/static/vendors/tabulator/js/modules/print.js +++ /dev/null @@ -1,96 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Print = function Print(table) { - this.table = table; //hold Tabulator object - this.element = false; - this.manualBlock = false; -}; - -Print.prototype.initialize = function () { - window.addEventListener("beforeprint", this.replaceTable.bind(this)); - window.addEventListener("afterprint", this.cleanup.bind(this)); -}; - -Print.prototype.replaceTable = function () { - if (!this.manualBlock) { - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-table"); - - this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print")); - - this.table.element.style.display = "none"; - - this.table.element.parentNode.insertBefore(this.element, this.table.element); - } -}; - -Print.prototype.cleanup = function () { - document.body.classList.remove("tabulator-print-fullscreen-hide"); - - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - this.table.element.style.display = ""; - } -}; - -Print.prototype.printFullscreen = function (visible, style, config) { - var scrollX = window.scrollX, - scrollY = window.scrollY, - headerEl = document.createElement("div"), - footerEl = document.createElement("div"), - tableEl = this.table.modules.export.genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible, "print"), - headerContent, - footerContent; - - this.manualBlock = true; - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-fullscreen"); - - if (this.table.options.printHeader) { - headerEl.classList.add("tabulator-print-header"); - - headerContent = typeof this.table.options.printHeader == "function" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader; - - if (typeof headerContent == "string") { - headerEl.innerHTML = headerContent; - } else { - headerEl.appendChild(headerContent); - } - - this.element.appendChild(headerEl); - } - - this.element.appendChild(tableEl); - - if (this.table.options.printFooter) { - footerEl.classList.add("tabulator-print-footer"); - - footerContent = typeof this.table.options.printFooter == "function" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter; - - if (typeof footerContent == "string") { - footerEl.innerHTML = footerContent; - } else { - footerEl.appendChild(footerContent); - } - - this.element.appendChild(footerEl); - } - - document.body.classList.add("tabulator-print-fullscreen-hide"); - document.body.appendChild(this.element); - - if (this.table.options.printFormatter) { - this.table.options.printFormatter(this.element, tableEl); - } - - window.print(); - - this.cleanup(); - - window.scrollTo(scrollX, scrollY); - - this.manualBlock = false; -}; - -Tabulator.prototype.registerModule("print", Print); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/print.min.js b/app/static/vendors/tabulator/js/modules/print.min.js deleted file mode 100644 index b46279c..0000000 --- a/app/static/vendors/tabulator/js/modules/print.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var Print=function(t){this.table=t,this.element=!1,this.manualBlock=!1};Print.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},Print.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))},Print.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")},Print.prototype.printFullscreen=function(t,e,i){var n,l,o=window.scrollX,a=window.scrollY,s=document.createElement("div"),r=document.createElement("div"),p=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(s.classList.add("tabulator-print-header"),n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof n?s.innerHTML=n:s.appendChild(n),this.element.appendChild(s)),this.element.appendChild(p),this.table.options.printFooter&&(r.classList.add("tabulator-print-footer"),l="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof l?r.innerHTML=l:r.appendChild(l),this.element.appendChild(r)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,p),window.print(),this.cleanup(),window.scrollTo(o,a),this.manualBlock=!1},Tabulator.prototype.registerModule("print",Print); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/reactive_data.js b/app/static/vendors/tabulator/js/modules/reactive_data.js deleted file mode 100644 index eb73971..0000000 --- a/app/static/vendors/tabulator/js/modules/reactive_data.js +++ /dev/null @@ -1,235 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ReactiveData = function ReactiveData(table) { - this.table = table; //hold Tabulator object - this.data = false; - this.blocked = false; //block reactivity while performing update - this.origFuncs = {}; // hold original data array functions to allow replacement after data is done with - this.currentVersion = 0; -}; - -ReactiveData.prototype.watchData = function (data) { - var self = this, - pushFunc, - version; - - this.currentVersion++; - - version = this.currentVersion; - - self.unwatchData(); - - self.data = data; - - //override array push function - self.origFuncs.push = data.push; - - Object.defineProperty(self.data, "push", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, false); - }); - } - - return self.origFuncs.push.apply(data, arguments); - } - }); - - //override array unshift function - self.origFuncs.unshift = data.unshift; - - Object.defineProperty(self.data, "unshift", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, true); - }); - } - - return self.origFuncs.unshift.apply(data, arguments); - } - }); - - //override array shift function - self.origFuncs.shift = data.shift; - - Object.defineProperty(self.data, "shift", { - enumerable: false, - configurable: true, - value: function value() { - var row; - - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[0]); - - if (row) { - row.deleteActual(); - } - } - } - - return self.origFuncs.shift.call(data); - } - }); - - //override array pop function - self.origFuncs.pop = data.pop; - - Object.defineProperty(self.data, "pop", { - enumerable: false, - configurable: true, - value: function value() { - var row; - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]); - - if (row) { - row.deleteActual(); - } - } - } - return self.origFuncs.pop.call(data); - } - }); - - //override array splice function - self.origFuncs.splice = data.splice; - - Object.defineProperty(self.data, "splice", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments), - start = args[0] < 0 ? data.length + args[0] : args[0], - end = args[1], - newRows = args[2] ? args.slice(2) : false, - startRow; - - if (!self.blocked && version === self.currentVersion) { - - //add new rows - if (newRows) { - startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false; - - if (startRow) { - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, startRow, true); - }); - } else { - newRows = newRows.slice().reverse(); - - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, false, true); - }); - } - } - - //delete removed rows - if (end !== 0) { - var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end); - - oldRows.forEach(function (rowData, i) { - var row = self.table.rowManager.getRowFromDataObject(rowData); - - if (row) { - row.deleteActual(i !== oldRows.length - 1); - } - }); - } - - if (newRows || end !== 0) { - self.table.rowManager.reRenderInPosition(); - } - } - - return self.origFuncs.splice.apply(data, arguments); - } - }); -}; - -ReactiveData.prototype.unwatchData = function () { - if (this.data !== false) { - for (var key in this.origFuncs) { - Object.defineProperty(this.data, key, { - enumerable: true, - configurable: true, - writable: true, - value: this.origFuncs.key - }); - } - } -}; - -ReactiveData.prototype.watchRow = function (row) { - var self = this, - data = row.getData(); - - this.blocked = true; - - for (var key in data) { - this.watchKey(row, data, key); - } - - this.blocked = false; -}; - -ReactiveData.prototype.watchKey = function (row, data, key) { - var self = this, - props = Object.getOwnPropertyDescriptor(data, key), - value = data[key], - version = this.currentVersion; - - Object.defineProperty(data, key, { - set: function set(newValue) { - value = newValue; - if (!self.blocked && version === self.currentVersion) { - var update = {}; - update[key] = newValue; - row.updateData(update); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - - if (props.get) { - props.get(); - } - - return value; - } - }); -}; - -ReactiveData.prototype.unwatchRow = function (row) { - var data = row.getData(); - - for (var key in data) { - Object.defineProperty(data, key, { - value: data[key] - }); - } -}; - -ReactiveData.prototype.block = function () { - this.blocked = true; -}; - -ReactiveData.prototype.unblock = function () { - this.blocked = false; -}; - -Tabulator.prototype.registerModule("reactiveData", ReactiveData); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/reactive_data.min.js b/app/static/vendors/tabulator/js/modules/reactive_data.min.js deleted file mode 100644 index c5dc047..0000000 --- a/app/static/vendors/tabulator/js/modules/reactive_data.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var ReactiveData=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};ReactiveData.prototype.watchData=function(e){var t,a=this;this.currentVersion++,t=this.currentVersion,a.unwatchData(),a.data=e,a.origFuncs.push=e.push,Object.defineProperty(a.data,"push",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!1)}),a.origFuncs.push.apply(e,arguments)}}),a.origFuncs.unshift=e.unshift,Object.defineProperty(a.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!0)}),a.origFuncs.unshift.apply(e,arguments)}}),a.origFuncs.shift=e.shift,Object.defineProperty(a.data,"shift",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[0]))&&r.deleteActual(),a.origFuncs.shift.call(e)}}),a.origFuncs.pop=e.pop,Object.defineProperty(a.data,"pop",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[a.data.length-1]))&&r.deleteActual(),a.origFuncs.pop.call(e)}}),a.origFuncs.splice=e.splice,Object.defineProperty(a.data,"splice",{enumerable:!1,configurable:!0,value:function(){var r,o=Array.from(arguments),n=o[0]<0?e.length+o[0]:o[0],c=o[1],i=!!o[2]&&o.slice(2);if(!a.blocked&&t===a.currentVersion){if(i&&(r=!!e[n]&&a.table.rowManager.getRowFromDataObject(e[n]),r?i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,r,!0)}):(i=i.slice().reverse(),i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==c){var u=e.slice(n,void 0===o[1]?o[1]:n+c);u.forEach(function(e,t){var r=a.table.rowManager.getRowFromDataObject(e);r&&r.deleteActual(t!==u.length-1)})}(i||0!==c)&&a.table.rowManager.reRenderInPosition()}return a.origFuncs.splice.apply(e,arguments)}})},ReactiveData.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},ReactiveData.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var a in t)this.watchKey(e,t,a);this.blocked=!1},ReactiveData.prototype.watchKey=function(e,t,a){var r=this,o=Object.getOwnPropertyDescriptor(t,a),n=t[a],c=this.currentVersion;Object.defineProperty(t,a,{set:function(t){if(n=t,!r.blocked&&c===r.currentVersion){var i={};i[a]=t,e.updateData(i)}o.set&&o.set(t)},get:function(){return o.get&&o.get(),n}})},ReactiveData.prototype.unwatchRow=function(e){var t=e.getData();for(var a in t)Object.defineProperty(t,a,{value:t[a]})},ReactiveData.prototype.block=function(){this.blocked=!0},ReactiveData.prototype.unblock=function(){this.blocked=!1},Tabulator.prototype.registerModule("reactiveData",ReactiveData); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_columns.js b/app/static/vendors/tabulator/js/modules/resize_columns.js deleted file mode 100644 index 753c02b..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_columns.js +++ /dev/null @@ -1,163 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ResizeColumns = function ResizeColumns(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startX = false; - this.startWidth = false; - this.handle = null; - this.prevHandle = null; -}; - -ResizeColumns.prototype.initializeColumn = function (type, column, element) { - var self = this, - variableHeight = false, - mode = this.table.options.resizableColumns; - - //set column resize mode - if (type === "header") { - variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight; - column.modules.resize = { variableHeight: variableHeight }; - } - - if (mode === true || mode == type) { - - var handle = document.createElement('div'); - handle.className = "tabulator-col-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-col-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - var nearestColumn = column.getLastColumn(); - - if (nearestColumn && self._checkResizability(nearestColumn)) { - self.startColumn = column; - self._mouseDown(e, nearestColumn, handle); - } - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - //reszie column on double click - handle.addEventListener("dblclick", function (e) { - var col = column.getLastColumn(); - - if (col && self._checkResizability(col)) { - e.stopPropagation(); - col.reinitializeWidth(true); - } - }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - self.startColumn = column; - self._mouseDown(e, prevColumn, prevHandle); - } - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - //resize column on double click - prevHandle.addEventListener("dblclick", function (e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - e.stopPropagation(); - prevColumn.reinitializeWidth(true); - } - } - }); - - element.appendChild(handle); - element.appendChild(prevHandle); - } -}; - -ResizeColumns.prototype._checkResizability = function (column) { - return typeof column.definition.resizable != "undefined" ? column.definition.resizable : this.table.options.resizableColumns; -}; - -ResizeColumns.prototype._mouseDown = function (e, column, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - // self.table.columnManager.tempScrollBlock(); - - column.setWidth(self.startWidth + ((typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX) - self.startX)); - - if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - } - - function mouseUp(e) { - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = false; - } - - if (self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - - document.body.removeEventListener("mouseup", mouseUp); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.save("columns"); - } - - self.table.options.columnResized.call(self.table, column.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = true; - } - - self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX; - self.startWidth = column.getWidth(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); -}; - -Tabulator.prototype.registerModule("resizeColumns", ResizeColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_columns.min.js b/app/static/vendors/tabulator/js/modules/resize_columns.min.js deleted file mode 100644 index 7ae0e38..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_columns.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var ResizeColumns=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};ResizeColumns.prototype.initializeColumn=function(e,t,n){var o=this,i=!1,s=this.table.options.resizableColumns;if("header"===e&&(i="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:i}),!0===s||s==e){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var l=document.createElement("div");l.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(e){e.stopPropagation()});var r=function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(o.startColumn=t,o._mouseDown(e,n,a))};a.addEventListener("mousedown",r),a.addEventListener("touchstart",r,{passive:!0}),a.addEventListener("dblclick",function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(e.stopPropagation(),n.reinitializeWidth(!0))}),l.addEventListener("click",function(e){e.stopPropagation()});var d=function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(o.startColumn=t,o._mouseDown(e,s,l)))};l.addEventListener("mousedown",d),l.addEventListener("touchstart",d,{passive:!0}),l.addEventListener("dblclick",function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),n.appendChild(a),n.appendChild(l)}},ResizeColumns.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},ResizeColumns.prototype._mouseDown=function(e,t,n){function o(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function i(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),n.removeEventListener("touchend",i),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",i),n.addEventListener("touchmove",o,{passive:!0}),n.addEventListener("touchend",i)},Tabulator.prototype.registerModule("resizeColumns",ResizeColumns); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_rows.js b/app/static/vendors/tabulator/js/modules/resize_rows.js deleted file mode 100644 index 8d39fcd..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_rows.js +++ /dev/null @@ -1,98 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ResizeRows = function ResizeRows(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startY = false; - this.startHeight = false; - this.handle = null; - this.prevHandle = null; -}; - -ResizeRows.prototype.initializeRow = function (row) { - var self = this, - rowEl = row.getElement(); - - var handle = document.createElement('div'); - handle.className = "tabulator-row-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-row-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - self.startRow = row; - self._mouseDown(e, row, handle); - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var prevRow = self.table.rowManager.prevDisplayRow(row); - - if (prevRow) { - self.startRow = prevRow; - self._mouseDown(e, prevRow, prevHandle); - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - rowEl.appendChild(handle); - rowEl.appendChild(prevHandle); -}; - -ResizeRows.prototype._mouseDown = function (e, row, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - row.setHeight(self.startHeight + ((typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY) - self.startY)); - } - - function mouseUp(e) { - - // //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = false; - // } - - document.body.removeEventListener("mouseup", mouseMove); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - self.table.options.rowResized.call(this.table, row.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = true; - // } - - self.startY = typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY; - self.startHeight = row.getHeight(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); -}; - -Tabulator.prototype.registerModule("resizeRows", ResizeRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_rows.min.js b/app/static/vendors/tabulator/js/modules/resize_rows.min.js deleted file mode 100644 index fb0db00..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_rows.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var ResizeRows=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};ResizeRows.prototype.initializeRow=function(e){var t=this,o=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(e){e.stopPropagation()});var a=function(o){t.startRow=e,t._mouseDown(o,e,s)};s.addEventListener("mousedown",a),s.addEventListener("touchstart",a,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(o,s,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(s),o.appendChild(n)},ResizeRows.prototype._mouseDown=function(e,t,o){function s(e){t.setHeight(a.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-a.startY))}function n(e){document.body.removeEventListener("mouseup",s),document.body.removeEventListener("mousemove",s),o.removeEventListener("touchmove",s),o.removeEventListener("touchend",n),a.table.element.classList.remove("tabulator-block-select"),a.table.options.rowResized.call(this.table,t.getComponent())}var a=this;a.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),a.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,a.startHeight=t.getHeight(),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",s,{passive:!0}),o.addEventListener("touchend",n)},Tabulator.prototype.registerModule("resizeRows",ResizeRows); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_table.js b/app/static/vendors/tabulator/js/modules/resize_table.js deleted file mode 100644 index 1286641..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_table.js +++ /dev/null @@ -1,107 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ResizeTable = function ResizeTable(table) { - this.table = table; //hold Tabulator object - this.binding = false; - this.observer = false; - this.containerObserver = false; - - this.tableHeight = 0; - this.tableWidth = 0; - this.containerHeight = 0; - this.containerWidth = 0; - - this.autoResize = false; -}; - -ResizeTable.prototype.initialize = function (row) { - var _this = this; - - var table = this.table, - tableStyle; - - this.tableHeight = table.element.clientHeight; - this.tableWidth = table.element.clientWidth; - - if (table.element.parentNode) { - this.containerHeight = table.element.parentNode.clientHeight; - this.containerWidth = table.element.parentNode.clientWidth; - } - - if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") { - - this.autoResize = true; - - this.observer = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this.tableHeight != nodeHeight || _this.tableWidth != nodeWidth) { - _this.tableHeight = nodeHeight; - _this.tableWidth = nodeWidth; - - if (table.element.parentNode) { - _this.containerHeight = table.element.parentNode.clientHeight; - _this.containerWidth = table.element.parentNode.clientWidth; - } - - table.redraw(); - } - } - }); - - this.observer.observe(table.element); - - tableStyle = window.getComputedStyle(table.element); - - if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) { - - this.containerObserver = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this.containerHeight != nodeHeight || _this.containerWidth != nodeWidth) { - _this.containerHeight = nodeHeight; - _this.containerWidth = nodeWidth; - _this.tableHeight = table.element.clientHeight; - _this.tableWidth = table.element.clientWidth; - - table.redraw(); - } - - table.redraw(); - } - }); - - this.containerObserver.observe(this.table.element.parentNode); - } - } else { - this.binding = function () { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - table.redraw(); - } - }; - - window.addEventListener("resize", this.binding); - } -}; - -ResizeTable.prototype.clearBindings = function (row) { - if (this.binding) { - window.removeEventListener("resize", this.binding); - } - - if (this.observer) { - this.observer.unobserve(this.table.element); - } - - if (this.containerObserver) { - this.containerObserver.unobserve(this.table.element.parentNode); - } -}; - -Tabulator.prototype.registerModule("resizeTable", ResizeTable); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/resize_table.min.js b/app/static/vendors/tabulator/js/modules/resize_table.min.js deleted file mode 100644 index e992d75..0000000 --- a/app/static/vendors/tabulator/js/modules/resize_table.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var ResizeTable=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};ResizeTable.prototype.initialize=function(e){var t,i=this,n=this.table;this.tableHeight=n.element.clientHeight,this.tableWidth=n.element.clientWidth,n.element.parentNode&&(this.containerHeight=n.element.parentNode.clientHeight,this.containerWidth=n.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===n.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.tableHeight==t&&i.tableWidth==r||(i.tableHeight=t,i.tableWidth=r,n.element.parentNode&&(i.containerHeight=n.element.parentNode.clientHeight,i.containerWidth=n.element.parentNode.clientWidth),n.redraw())}}),this.observer.observe(n.element),t=window.getComputedStyle(n.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.containerHeight==t&&i.containerWidth==r||(i.containerHeight=t,i.containerWidth=r,i.tableHeight=n.element.clientHeight,i.tableWidth=n.element.clientWidth,n.redraw()),n.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell)&&n.redraw()},window.addEventListener("resize",this.binding))},ResizeTable.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},Tabulator.prototype.registerModule("resizeTable",ResizeTable); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/responsive_layout.js b/app/static/vendors/tabulator/js/modules/responsive_layout.js deleted file mode 100644 index 329f2a6..0000000 --- a/app/static/vendors/tabulator/js/modules/responsive_layout.js +++ /dev/null @@ -1,301 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var ResponsiveLayout = function ResponsiveLayout(table) { - this.table = table; //hold Tabulator object - this.columns = []; - this.hiddenColumns = []; - this.mode = ""; - this.index = 0; - this.collapseFormatter = []; - this.collapseStartOpen = true; - this.collapseHandleColumn = false; -}; - -//generate resposive columns list -ResponsiveLayout.prototype.initialize = function () { - var self = this, - columns = []; - - this.mode = this.table.options.responsiveLayout; - this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData; - this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen; - this.hiddenColumns = []; - - //detemine level of responsivity for each column - this.table.columnManager.columnsByIndex.forEach(function (column, i) { - if (column.modules.responsive) { - if (column.modules.responsive.order && column.modules.responsive.visible) { - column.modules.responsive.index = i; - columns.push(column); - - if (!column.visible && self.mode === "collapse") { - self.hiddenColumns.push(column); - } - } - } - }); - - //sort list by responsivity - columns = columns.reverse(); - columns = columns.sort(function (a, b) { - var diff = b.modules.responsive.order - a.modules.responsive.order; - return diff || b.modules.responsive.index - a.modules.responsive.index; - }); - - this.columns = columns; - - if (this.mode === "collapse") { - this.generateCollapsedContent(); - } - - //assign collapse column - for (var _iterator = this.table.columnManager.columnsByIndex, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var col = _ref; - - if (col.definition.formatter == "responsiveCollapse") { - this.collapseHandleColumn = col; - break; - } - } - - if (this.collapseHandleColumn) { - if (this.hiddenColumns.length) { - this.collapseHandleColumn.show(); - } else { - this.collapseHandleColumn.hide(); - } - } -}; - -//define layout information -ResponsiveLayout.prototype.initializeColumn = function (column) { - var def = column.getDefinition(); - - column.modules.responsive = { order: typeof def.responsive === "undefined" ? 1 : def.responsive, visible: def.visible === false ? false : true }; -}; - -ResponsiveLayout.prototype.initializeRow = function (row) { - var el; - - if (row.type !== "calc") { - el = document.createElement("div"); - el.classList.add("tabulator-responsive-collapse"); - - row.modules.responsiveLayout = { - element: el, - open: this.collapseStartOpen - }; - - if (!this.collapseStartOpen) { - el.style.display = 'none'; - } - } -}; - -ResponsiveLayout.prototype.layoutRow = function (row) { - var rowEl = row.getElement(); - - if (row.modules.responsiveLayout) { - rowEl.appendChild(row.modules.responsiveLayout.element); - this.generateCollapsedRowContent(row); - } -}; - -//update column visibility -ResponsiveLayout.prototype.updateColumnVisibility = function (column, visible) { - var index; - if (column.modules.responsive) { - column.modules.responsive.visible = visible; - this.initialize(); - } -}; - -ResponsiveLayout.prototype.hideColumn = function (column) { - var colCount = this.hiddenColumns.length; - - column.hide(false, true); - - if (this.mode === "collapse") { - this.hiddenColumns.unshift(column); - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !colCount) { - this.collapseHandleColumn.show(); - } - } -}; - -ResponsiveLayout.prototype.showColumn = function (column) { - var index; - - column.show(false, true); - //set column width to prevent calculation loops on uninitialized columns - column.setWidth(column.getWidth()); - - if (this.mode === "collapse") { - index = this.hiddenColumns.indexOf(column); - - if (index > -1) { - this.hiddenColumns.splice(index, 1); - } - - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !this.hiddenColumns.length) { - this.collapseHandleColumn.hide(); - } - } -}; - -//redraw columns to fit space -ResponsiveLayout.prototype.update = function () { - var self = this, - working = true; - - while (working) { - - var width = self.table.modules.layout.getMode() == "fitColumns" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth(); - - var diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width; - - if (diff < 0) { - //table is too wide - var column = self.columns[self.index]; - - if (column) { - self.hideColumn(column); - self.index++; - } else { - working = false; - } - } else { - - //table has spare space - var _column = self.columns[self.index - 1]; - - if (_column) { - if (diff > 0) { - if (diff >= _column.getWidth()) { - self.showColumn(_column); - self.index--; - } else { - working = false; - } - } else { - working = false; - } - } else { - working = false; - } - } - - if (!self.table.rowManager.activeRowsCount) { - self.table.rowManager.renderEmptyScroll(); - } - } -}; - -ResponsiveLayout.prototype.generateCollapsedContent = function () { - var self = this, - rows = this.table.rowManager.getDisplayRows(); - - rows.forEach(function (row) { - self.generateCollapsedRowContent(row); - }); -}; - -ResponsiveLayout.prototype.generateCollapsedRowContent = function (row) { - var el, contents; - - if (row.modules.responsiveLayout) { - el = row.modules.responsiveLayout.element; - - while (el.firstChild) { - el.removeChild(el.firstChild); - }contents = this.collapseFormatter(this.generateCollapsedRowData(row)); - if (contents) { - el.appendChild(contents); - } - } -}; - -ResponsiveLayout.prototype.generateCollapsedRowData = function (row) { - var self = this, - data = row.getData(), - output = [], - mockCellComponent; - - this.hiddenColumns.forEach(function (column) { - var value = column.getFieldValue(data); - - if (column.definition.title && column.field) { - if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) { - - mockCellComponent = { - value: false, - data: {}, - getValue: function getValue() { - return value; - }, - getData: function getData() { - return data; - }, - getElement: function getElement() { - return document.createElement("div"); - }, - getRow: function getRow() { - return row.getComponent(); - }, - getColumn: function getColumn() { - return column.getComponent(); - } - }; - - output.push({ - title: column.definition.title, - value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params) - }); - } else { - output.push({ - title: column.definition.title, - value: value - }); - } - } - }); - - return output; -}; - -ResponsiveLayout.prototype.formatCollapsedData = function (data) { - var list = document.createElement("table"), - listContents = ""; - - data.forEach(function (item) { - var div = document.createElement("div"); - - if (item.value instanceof Node) { - div.appendChild(item.value); - item.value = div.innerHTML; - } - - listContents += "" + item.title + "" + item.value + ""; - }); - - list.innerHTML = listContents; - - return Object.keys(data).length ? list : ""; -}; - -Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/responsive_layout.min.js b/app/static/vendors/tabulator/js/modules/responsive_layout.min.js deleted file mode 100644 index 4ef6538..0000000 --- a/app/static/vendors/tabulator/js/modules/responsive_layout.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var ResponsiveLayout=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};ResponsiveLayout.prototype.initialize=function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,n){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=n,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();for(var o=this.table.columnManager.columnsByIndex,n=Array.isArray(o),s=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(s>=o.length)break;i=o[s++]}else{if(s=o.next(),s.done)break;i=s.value}var l=i;if("responsiveCollapse"==l.definition.formatter){this.collapseHandleColumn=l;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},ResponsiveLayout.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},ResponsiveLayout.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},ResponsiveLayout.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},ResponsiveLayout.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},ResponsiveLayout.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(n<0){var s=e.columns[e.index];s?(e.hideColumn(s),e.index++):t=!1}else{var i=e.columns[e.index-1];i&&n>0&&n>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},ResponsiveLayout.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},ResponsiveLayout.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},ResponsiveLayout.prototype.generateCollapsedRowData=function(e){var t,o=this,n=e.getData(),s=[];return this.hiddenColumns.forEach(function(i){var l=i.getFieldValue(n);i.definition.title&&i.field&&(i.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return l},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return i.getComponent()}},s.push({title:i.definition.title,value:i.modules.format.formatter.call(o.table.modules.format,t,i.modules.format.params)})):s.push({title:i.definition.title,value:l}))}),s},ResponsiveLayout.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},Tabulator.prototype.registerModule("responsiveLayout",ResponsiveLayout); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/select_row.js b/app/static/vendors/tabulator/js/modules/select_row.js deleted file mode 100644 index 2869429..0000000 --- a/app/static/vendors/tabulator/js/modules/select_row.js +++ /dev/null @@ -1,417 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var SelectRow = function SelectRow(table) { - this.table = table; //hold Tabulator object - this.selecting = false; //flag selecting in progress - this.lastClickedRow = false; //last clicked row - this.selectPrev = []; //hold previously selected element for drag drop selection - this.selectedRows = []; //hold selected rows - this.headerCheckboxElement = null; // hold header select element -}; - -SelectRow.prototype.clearSelectionData = function (silent) { - this.selecting = false; - this.lastClickedRow = false; - this.selectPrev = []; - this.selectedRows = []; - - if (!silent) { - this._rowSelectionChanged(); - } -}; - -SelectRow.prototype.initializeRow = function (row) { - var self = this, - element = row.getElement(); - - // trigger end of row selection - var endSelect = function endSelect() { - - setTimeout(function () { - self.selecting = false; - }, 50); - - document.body.removeEventListener("mouseup", endSelect); - }; - - row.modules.select = { selected: false }; - - //set row selection class - if (self.table.options.selectableCheck.call(this.table, row.getComponent())) { - element.classList.add("tabulator-selectable"); - element.classList.remove("tabulator-unselectable"); - - if (self.table.options.selectable && self.table.options.selectable != "highlight") { - if (self.table.options.selectableRangeMode === "click") { - element.addEventListener("click", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - self.lastClickedRow = self.lastClickedRow || row; - - var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow); - var rowIdx = self.table.rowManager.getDisplayRowIndex(row); - - var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx; - var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx; - - var rows = self.table.rowManager.getDisplayRows().slice(0); - var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1); - - if (e.ctrlKey || e.metaKey) { - toggledRows.forEach(function (toggledRow) { - if (toggledRow !== self.lastClickedRow) { - - if (self.table.options.selectable !== true && !self.isRowSelected(row)) { - if (self.selectedRows.length < self.table.options.selectable) { - self.toggleRow(toggledRow); - } - } else { - self.toggleRow(toggledRow); - } - } - }); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - - if (self.table.options.selectable !== true) { - if (toggledRows.length > self.table.options.selectable) { - toggledRows = toggledRows.slice(0, self.table.options.selectable); - } - } - - self.selectRows(toggledRows); - } - self.table._clearSelection(); - } else if (e.ctrlKey || e.metaKey) { - self.toggleRow(row); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - self.selectRows(row); - self.lastClickedRow = row; - } - }); - } else { - element.addEventListener("click", function (e) { - if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) { - self.table._clearSelection(); - } - - if (!self.selecting) { - self.toggleRow(row); - } - }); - - element.addEventListener("mousedown", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - - self.selecting = true; - - self.selectPrev = []; - - document.body.addEventListener("mouseup", endSelect); - document.body.addEventListener("keyup", endSelect); - - self.toggleRow(row); - - return false; - } - }); - - element.addEventListener("mouseenter", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.toggleRow(row); - - if (self.selectPrev[1] == row) { - self.toggleRow(self.selectPrev[0]); - } - } - }); - - element.addEventListener("mouseout", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.selectPrev.unshift(row); - } - }); - } - } - } else { - element.classList.add("tabulator-unselectable"); - element.classList.remove("tabulator-selectable"); - } -}; - -//toggle row selection -SelectRow.prototype.toggleRow = function (row) { - if (this.table.options.selectableCheck.call(this.table, row.getComponent())) { - if (row.modules.select && row.modules.select.selected) { - this._deselectRow(row); - } else { - this._selectRow(row); - } - } -}; - -//select a number of rows -SelectRow.prototype.selectRows = function (rows) { - var _this = this; - - var rowMatch; - - switch (typeof rows === "undefined" ? "undefined" : _typeof(rows)) { - case "undefined": - this.table.rowManager.rows.forEach(function (row) { - _this._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - break; - - case "string": - - rowMatch = this.table.rowManager.findRow(rows); - - if (rowMatch) { - this._selectRow(rowMatch, true, true); - } else { - this.table.rowManager.getRows(rows).forEach(function (row) { - _this._selectRow(row, true, true); - }); - } - - this._rowSelectionChanged(); - break; - - default: - if (Array.isArray(rows)) { - rows.forEach(function (row) { - _this._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - } else { - this._selectRow(rows, false, true); - } - break; - } -}; - -//select an individual row -SelectRow.prototype._selectRow = function (rowInfo, silent, force) { - var index; - - //handle max row count - if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) { - if (this.selectedRows.length >= this.table.options.selectable) { - if (this.table.options.selectableRollingSelection) { - this._deselectRow(this.selectedRows[0]); - } else { - return false; - } - } - } - - var row = this.table.rowManager.findRow(rowInfo); - - if (row) { - if (this.selectedRows.indexOf(row) == -1) { - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = true; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = true; - } - row.getElement().classList.add("tabulator-selected"); - - this.selectedRows.push(row); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, true); - } - - if (!silent) { - this.table.options.rowSelected.call(this.table, row.getComponent()); - } - - this._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo); - } - } -}; - -SelectRow.prototype.isRowSelected = function (row) { - return this.selectedRows.indexOf(row) !== -1; -}; - -//deselect a number of rows -SelectRow.prototype.deselectRows = function (rows, silent) { - var self = this, - rowCount; - - if (typeof rows == "undefined") { - - rowCount = self.selectedRows.length; - - for (var i = 0; i < rowCount; i++) { - self._deselectRow(self.selectedRows[0], true); - } - - self._rowSelectionChanged(silent); - } else { - if (Array.isArray(rows)) { - rows.forEach(function (row) { - self._deselectRow(row, true); - }); - - self._rowSelectionChanged(silent); - } else { - self._deselectRow(rows, silent); - } - } -}; - -//deselect an individual row -SelectRow.prototype._deselectRow = function (rowInfo, silent) { - var self = this, - row = self.table.rowManager.findRow(rowInfo), - index; - - if (row) { - index = self.selectedRows.findIndex(function (selectedRow) { - return selectedRow == row; - }); - - if (index > -1) { - - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = false; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = false; - } - row.getElement().classList.remove("tabulator-selected"); - self.selectedRows.splice(index, 1); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, false); - } - - if (!silent) { - self.table.options.rowDeselected.call(this.table, row.getComponent()); - } - - self._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo); - } - } -}; - -SelectRow.prototype.getSelectedData = function () { - var data = []; - - this.selectedRows.forEach(function (row) { - data.push(row.getData()); - }); - - return data; -}; - -SelectRow.prototype.getSelectedRows = function () { - - var rows = []; - - this.selectedRows.forEach(function (row) { - rows.push(row.getComponent()); - }); - - return rows; -}; - -SelectRow.prototype._rowSelectionChanged = function (silent) { - if (this.headerCheckboxElement) { - if (this.selectedRows.length === 0) { - this.headerCheckboxElement.checked = false; - this.headerCheckboxElement.indeterminate = false; - } else if (this.table.rowManager.rows.length === this.selectedRows.length) { - this.headerCheckboxElement.checked = true; - this.headerCheckboxElement.indeterminate = false; - } else { - this.headerCheckboxElement.indeterminate = true; - this.headerCheckboxElement.checked = false; - } - } - - if (!silent) { - this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows()); - } -}; - -SelectRow.prototype.registerRowSelectCheckbox = function (row, element) { - if (!row._row.modules.select) { - row._row.modules.select = {}; - } - - row._row.modules.select.checkboxEl = element; -}; - -SelectRow.prototype.registerHeaderSelectCheckbox = function (element) { - this.headerCheckboxElement = element; -}; - -SelectRow.prototype.childRowSelection = function (row, select) { - var children = this.table.modules.dataTree.getChildren(row); - - if (select) { - for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var child = _ref; - - this._selectRow(child, true); - } - } else { - for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var _child = _ref2; - - this._deselectRow(_child, true); - } - } -}; - -Tabulator.prototype.registerModule("selectRow", SelectRow); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/select_row.min.js b/app/static/vendors/tabulator/js/modules/select_row.min.js deleted file mode 100644 index 488d7e6..0000000 --- a/app/static/vendors/tabulator/js/modules/select_row.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SelectRow=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};SelectRow.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},SelectRow.prototype.initializeRow=function(e){var t=this,o=e.getElement(),l=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var l=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),s=t.table.rowManager.getDisplayRowIndex(e),c=l<=s?l:s,i=l>=s?l:s,n=t.table.rowManager.getDisplayRows().slice(0),a=n.splice(c,i-c+1);o.ctrlKey||o.metaKey?(a.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(a=a.slice(0,t.table.options.selectable)),t.selectRows(a)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",l),document.body.addEventListener("keyup",l),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},SelectRow.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},SelectRow.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},SelectRow.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var l=this.table.rowManager.findRow(e);l?-1==this.selectedRows.indexOf(l)&&(l.modules.select||(l.modules.select={}),l.modules.select.selected=!0,l.modules.select.checkboxEl&&(l.modules.select.checkboxEl.checked=!0),l.getElement().classList.add("tabulator-selected"),this.selectedRows.push(l),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(l,!0),t||this.table.options.rowSelected.call(this.table,l.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},SelectRow.prototype.deselectRows=function(e,t){var o,l=this;if(void 0===e){o=l.selectedRows.length;for(var s=0;s-1&&(s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),s.getElement().classList.remove("tabulator-selected"),l.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),t||l.table.options.rowDeselected.call(this.table,s.getComponent()),l._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},SelectRow.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},SelectRow.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},SelectRow.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},SelectRow.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},SelectRow.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)for(var l=o,s=Array.isArray(l),c=0,l=s?l:l[Symbol.iterator]();;){var i;if(s){if(c>=l.length)break;i=l[c++]}else{if(c=l.next(),c.done)break;i=c.value}var n=i;this._selectRow(n,!0)}else for(var a=o,r=Array.isArray(a),d=0,a=r?a:a[Symbol.iterator]();;){var h;if(r){if(d>=a.length)break;h=a[d++]}else{if(d=a.next(),d.done)break;h=d.value}var w=h;this._deselectRow(w,!0)}},Tabulator.prototype.registerModule("selectRow",SelectRow); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/sort.js b/app/static/vendors/tabulator/js/modules/sort.js deleted file mode 100644 index 2422968..0000000 --- a/app/static/vendors/tabulator/js/modules/sort.js +++ /dev/null @@ -1,571 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Sort = function Sort(table) { - this.table = table; //hold Tabulator object - this.sortList = []; //holder current sort - this.changed = false; //has the sort changed since last render -}; - -//initialize column header for sorting -Sort.prototype.initializeColumn = function (column, content) { - var self = this, - sorter = false, - colEl, - arrowEl; - - switch (_typeof(column.definition.sorter)) { - case "string": - if (self.sorters[column.definition.sorter]) { - sorter = self.sorters[column.definition.sorter]; - } else { - console.warn("Sort Error - No such sorter found: ", column.definition.sorter); - } - break; - - case "function": - sorter = column.definition.sorter; - break; - } - - column.modules.sort = { - sorter: sorter, dir: "none", - params: column.definition.sorterParams || {}, - startingDir: column.definition.headerSortStartingDir || "asc", - tristate: typeof column.definition.headerSortTristate !== "undefined" ? column.definition.headerSortTristate : this.table.options.headerSortTristate - }; - - if (typeof column.definition.headerSort === "undefined" ? this.table.options.headerSort !== false : column.definition.headerSort !== false) { - - colEl = column.getElement(); - - colEl.classList.add("tabulator-sortable"); - - arrowEl = document.createElement("div"); - arrowEl.classList.add("tabulator-arrow"); - //create sorter arrow - content.appendChild(arrowEl); - - //sort on click - colEl.addEventListener("click", function (e) { - var dir = "", - sorters = [], - match = false; - - if (column.modules.sort) { - if (column.modules.sort.tristate) { - if (column.modules.sort.dir == "none") { - dir = column.modules.sort.startingDir; - } else { - if (column.modules.sort.dir == column.modules.sort.startingDir) { - dir = column.modules.sort.dir == "asc" ? "desc" : "asc"; - } else { - dir = "none"; - } - } - } else { - switch (column.modules.sort.dir) { - case "asc": - dir = "desc"; - break; - - case "desc": - dir = "asc"; - break; - - default: - dir = column.modules.sort.startingDir; - } - } - - if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) { - sorters = self.getSort(); - - match = sorters.findIndex(function (sorter) { - return sorter.field === column.getField(); - }); - - if (match > -1) { - sorters[match].dir = dir; - - if (match != sorters.length - 1) { - match = sorters.splice(match, 1)[0]; - if (dir != "none") { - sorters.push(match); - } - } - } else { - if (dir != "none") { - sorters.push({ column: column, dir: dir }); - } - } - - //add to existing sort - self.setSort(sorters); - } else { - if (dir == "none") { - self.clear(); - } else { - //sort by column only - self.setSort(column, dir); - } - } - - self.table.rowManager.sorterRefresh(!self.sortList.length); - } - }); - } -}; - -//check if the sorters have changed since last use -Sort.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; -}; - -//return current sorters -Sort.prototype.getSort = function () { - var self = this, - sorters = []; - - self.sortList.forEach(function (item) { - if (item.column) { - sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir }); - } - }); - - return sorters; -}; - -//change sort list and trigger sort -Sort.prototype.setSort = function (sortList, dir) { - var self = this, - newSortList = []; - - if (!Array.isArray(sortList)) { - sortList = [{ column: sortList, dir: dir }]; - } - - sortList.forEach(function (item) { - var column; - - column = self.table.columnManager.findColumn(item.column); - - if (column) { - item.column = column; - newSortList.push(item); - self.changed = true; - } else { - console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column); - } - }); - - self.sortList = newSortList; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.sort) { - this.table.modules.persistence.save("sort"); - } -}; - -//clear sorters -Sort.prototype.clear = function () { - this.setSort([]); -}; - -//find appropriate sorter for column -Sort.prototype.findSorter = function (column) { - var row = this.table.rowManager.activeRows[0], - sorter = "string", - field, - value; - - if (row) { - row = row.getData(); - field = column.getField(); - - if (field) { - - value = column.getFieldValue(row); - - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "undefined": - sorter = "string"; - break; - - case "boolean": - sorter = "boolean"; - break; - - default: - if (!isNaN(value) && value !== "") { - sorter = "number"; - } else { - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - sorter = "alphanum"; - } - } - break; - } - } - } - - return this.sorters[sorter]; -}; - -//work through sort list sorting data -Sort.prototype.sort = function (data) { - var self = this, - sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList, - sortListActual = [], - rowComponents = [], - lastSort; - - if (self.table.options.dataSorting) { - self.table.options.dataSorting.call(self.table, self.getSort()); - } - - self.clearColumnHeaders(); - - if (!self.table.options.ajaxSorting) { - - //build list of valid sorters and trigger column specific callbacks before sort begins - sortList.forEach(function (item, i) { - var sortObj = item.column.modules.sort; - - if (item.column && sortObj) { - - //if no sorter has been defined, take a guess - if (!sortObj.sorter) { - sortObj.sorter = self.findSorter(item.column); - } - - item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params; - - sortListActual.push(item); - } - - self.setColumnHeader(item.column, item.dir); - }); - - //sort data - if (sortListActual.length) { - self._sortItems(data, sortListActual); - } - } else { - sortList.forEach(function (item, i) { - self.setColumnHeader(item.column, item.dir); - }); - } - - if (self.table.options.dataSorted) { - data.forEach(function (row) { - rowComponents.push(row.getComponent()); - }); - - self.table.options.dataSorted.call(self.table, self.getSort(), rowComponents); - } -}; - -//clear sort arrows on columns -Sort.prototype.clearColumnHeaders = function () { - this.table.columnManager.getRealColumns().forEach(function (column) { - if (column.modules.sort) { - column.modules.sort.dir = "none"; - column.getElement().setAttribute("aria-sort", "none"); - } - }); -}; - -//set the column header sort direction -Sort.prototype.setColumnHeader = function (column, dir) { - column.modules.sort.dir = dir; - column.getElement().setAttribute("aria-sort", dir); -}; - -//sort each item in sort list -Sort.prototype._sortItems = function (data, sortList) { - var _this = this; - - var sorterCount = sortList.length - 1; - - data.sort(function (a, b) { - var result; - - for (var i = sorterCount; i >= 0; i--) { - var sortItem = sortList[i]; - - result = _this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); - - if (result !== 0) { - break; - } - } - - return result; - }); -}; - -//process individual rows for a sort function on active data -Sort.prototype._sortRow = function (a, b, column, dir, params) { - var el1Comp, el2Comp, colComp; - - //switch elements depending on search direction - var el1 = dir == "asc" ? a : b; - var el2 = dir == "asc" ? b : a; - - a = column.getFieldValue(el1.getData()); - b = column.getFieldValue(el2.getData()); - - a = typeof a !== "undefined" ? a : ""; - b = typeof b !== "undefined" ? b : ""; - - el1Comp = el1.getComponent(); - el2Comp = el2.getComponent(); - - return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params); -}; - -//default data sorters -Sort.prototype.sorters = { - - //sort numbers - number: function number(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var decimal = params.decimalSeparator || "."; - var thousand = params.thousandSeparator || ","; - var emptyAlign = 0; - - a = parseFloat(String(a).split(thousand).join("").split(decimal).join(".")); - b = parseFloat(String(b).split(thousand).join("").split(decimal).join(".")); - - //handle non numeric values - if (isNaN(a)) { - emptyAlign = isNaN(b) ? 0 : -1; - } else if (isNaN(b)) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort strings - string: function string(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - var locale; - - //handle empty values - if (!a) { - emptyAlign = !b ? 0 : -1; - } else if (!b) { - emptyAlign = 1; - } else { - //compare valid values - switch (_typeof(params.locale)) { - case "boolean": - if (params.locale) { - locale = this.table.modules.localize.getLocale(); - } - break; - case "string": - locale = params.locale; - break; - } - - return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale); - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort date - date: function date(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "DD/MM/YYYY"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort HH:mm formatted times - time: function time(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "HH:mm"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort datetime - datetime: function datetime(a, b, aRow, bRow, column, dir, params) { - var format = params.format || "DD/MM/YYYY HH:mm:ss", - alignEmptyValues = params.alignEmptyValues, - emptyAlign = 0; - - if (typeof moment != "undefined") { - a = moment(a, format); - b = moment(b, format); - - if (!a.isValid()) { - emptyAlign = !b.isValid() ? 0 : -1; - } else if (!b.isValid()) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } else { - console.error("Sort Error - 'datetime' sorter is dependant on moment.js"); - } - }, - - //sort booleans - boolean: function boolean(a, b, aRow, bRow, column, dir, params) { - var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0; - var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0; - - return el1 - el2; - }, - - //sort if element contains any data - array: function array(a, b, aRow, bRow, column, dir, params) { - var el1 = 0; - var el2 = 0; - var type = params.type || "length"; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - function calc(value) { - - switch (type) { - case "length": - return value.length; - break; - - case "sum": - return value.reduce(function (c, d) { - return c + d; - }); - break; - - case "max": - return Math.max.apply(null, value); - break; - - case "min": - return Math.min.apply(null, value); - break; - - case "avg": - return value.reduce(function (c, d) { - return c + d; - }) / value.length; - break; - } - } - - //handle non array values - if (!Array.isArray(a)) { - alignEmptyValues = !Array.isArray(b) ? 0 : -1; - } else if (!Array.isArray(b)) { - alignEmptyValues = 1; - } else { - - //compare valid values - el1 = a ? calc(a) : 0; - el2 = b ? calc(b) : 0; - - return el1 - el2; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort if element contains any data - exists: function exists(a, b, aRow, bRow, column, dir, params) { - var el1 = typeof a == "undefined" ? 0 : 1; - var el2 = typeof b == "undefined" ? 0 : 1; - - return el1 - el2; - }, - - //sort alpha numeric strings - alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) { - var a, - b, - a1, - b1, - i = 0, - L, - rx = /(\d+)|(\D+)/g, - rd = /\d/; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - //handle empty values - if (!as && as !== 0) { - emptyAlign = !bs && bs !== 0 ? 0 : -1; - } else if (!bs && bs !== 0) { - emptyAlign = 1; - } else { - - if (isFinite(as) && isFinite(bs)) return as - bs; - a = String(as).toLowerCase(); - b = String(bs).toLowerCase(); - if (a === b) return 0; - if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1; - a = a.match(rx); - b = b.match(rx); - L = a.length > b.length ? b.length : a.length; - while (i < L) { - a1 = a[i]; - b1 = b[i++]; - if (a1 !== b1) { - if (isFinite(a1) && isFinite(b1)) { - if (a1.charAt(0) === "0") a1 = "." + a1; - if (b1.charAt(0) === "0") b1 = "." + b1; - return a1 - b1; - } else return a1 > b1 ? 1 : -1; - } - } - - return a.length > b.length; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } -}; - -Tabulator.prototype.registerModule("sort", Sort); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/sort.min.js b/app/static/vendors/tabulator/js/modules/sort.min.js deleted file mode 100644 index d0b4cb0..0000000 --- a/app/static/vendors/tabulator/js/modules/sort.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sort=function(t){this.table=t,this.sortList=[],this.changed=!1};Sort.prototype.initializeColumn=function(t,e){var r,o,n=this,i=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?i=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":i=t.definition.sorter}t.modules.sort={sorter:i,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:void 0!==t.definition.headerSortTristate?t.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===t.definition.headerSort?!1!==this.table.options.headerSort:!1!==t.definition.headerSort)&&(r=t.getElement(),r.classList.add("tabulator-sortable"),o=document.createElement("div"),o.classList.add("tabulator-arrow"),e.appendChild(o),r.addEventListener("click",function(e){var r="",o=[],i=!1;if(t.modules.sort){if(t.modules.sort.tristate)r="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":r="desc";break;case"desc":r="asc";break;default:r=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(o=n.getSort(),i=o.findIndex(function(e){return e.field===t.getField()}),i>-1?(o[i].dir=r,i!=o.length-1&&(i=o.splice(i,1)[0],"none"!=r&&o.push(i))):"none"!=r&&o.push({column:t,dir:r}),n.setSort(o)):"none"==r?n.clear():n.setSort(t,r),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},Sort.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},Sort.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},Sort.prototype.setSort=function(t,e){var r=this,o=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=r.table.columnManager.findColumn(t.column),e?(t.column=e,o.push(t),r.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),r.sortList=o,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},Sort.prototype.clear=function(){this.setSort([])},Sort.prototype.findSorter=function(t){var e,r=this.table.rowManager.activeRows[0],o="string";if(r&&(r=r.getData(),t.getField()))switch(e=t.getFieldValue(r),void 0===e?"undefined":_typeof(e)){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return this.sorters[o]},Sort.prototype.sort=function(t){var e=this,r=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,o=[],n=[];e.table.options.dataSorting&&e.table.options.dataSorting.call(e.table,e.getSort()),e.clearColumnHeaders(),e.table.options.ajaxSorting?r.forEach(function(t,r){e.setColumnHeader(t.column,t.dir)}):(r.forEach(function(t,r){var n=t.column.modules.sort;t.column&&n&&(n.sorter||(n.sorter=e.findSorter(t.column)),t.params="function"==typeof n.params?n.params(t.column.getComponent(),t.dir):n.params,o.push(t)),e.setColumnHeader(t.column,t.dir)}),o.length&&e._sortItems(t,o)),e.table.options.dataSorted&&(t.forEach(function(t){n.push(t.getComponent())}),e.table.options.dataSorted.call(e.table,e.getSort(),n))},Sort.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},Sort.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},Sort.prototype._sortItems=function(t,e){var r=this,o=e.length-1;t.sort(function(t,n){for(var i,s=o;s>=0;s--){var a=e[s];if(0!==(i=r._sortRow(t,n,a.column,a.dir,a.params)))break}return i})},Sort.prototype._sortRow=function(t,e,r,o,n){var i,s,a="asc"==o?t:e,l="asc"==o?e:t;return t=r.getFieldValue(a.getData()),e=r.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",i=a.getComponent(),s=l.getComponent(),r.modules.sort.sorter.call(this,t,e,i,s,r.getComponent(),o,n)},Sort.prototype.sorters={number:function(t,e,r,o,n,i,s){var a=s.alignEmptyValues,l=s.decimalSeparator||".",u=s.thousandSeparator||",",c=0;if(t=parseFloat(String(t).split(u).join("").split(l).join(".")),e=parseFloat(String(e).split(u).join("").split(l).join(".")),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===a&&"desc"===i||"bottom"===a&&"asc"===i)&&(c*=-1),c},string:function(t,e,r,o,n,i,s){var a,l=s.alignEmptyValues,u=0;if(t){if(e){switch(_typeof(s.locale)){case"boolean":s.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=s.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}u=1}else u=e?-1:0;return("top"===l&&"desc"===i||"bottom"===l&&"asc"===i)&&(u*=-1),u},date:function(t,e,r,o,n,i,s){return s.format||(s.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,r,o,n,i,s)},time:function(t,e,r,o,n,i,s){return s.format||(s.format="HH:mm"),this.sorters.datetime.call(this,t,e,r,o,n,i,s)},datetime:function(t,e,r,o,n,i,s){var a=s.format||"DD/MM/YYYY HH:mm:ss",l=s.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(t=moment(t,a),e=moment(e,a),t.isValid()){if(e.isValid())return t-e;u=1}else u=e.isValid()?-1:0;return("top"===l&&"desc"===i||"bottom"===l&&"asc"===i)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,r,o,n,i,s){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,r,o,n,i,s){function a(t){switch(c){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,u=0,c=s.type||"length",d=s.alignEmptyValues,m=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?a(t):0,u=e?a(e):0,l-u;d=1}else d=Array.isArray(e)?-1:0;return("top"===d&&"desc"===i||"bottom"===d&&"asc"===i)&&(m*=-1),m},exists:function(t,e,r,o,n,i,s){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,r,o,n,i,s){var a,l,u,c,d,m=0,f=/(\d+)|(\D+)/g,p=/\d/,h=s.alignEmptyValues,g=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(a=String(t).toLowerCase(),l=String(e).toLowerCase(),a===l)return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(f),l=l.match(f),d=a.length>l.length?l.length:a.length;mc?1:-1;return a.length>l.length}g=1}else g=e||0===e?-1:0;return("top"===h&&"desc"===i||"bottom"===h&&"asc"===i)&&(g*=-1),g}},Tabulator.prototype.registerModule("sort",Sort); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/validate.js b/app/static/vendors/tabulator/js/modules/validate.js deleted file mode 100644 index b5f6182..0000000 --- a/app/static/vendors/tabulator/js/modules/validate.js +++ /dev/null @@ -1,286 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -var Validate = function Validate(table) { - this.table = table; - this.invalidCells = []; -}; - -//validate -Validate.prototype.initializeColumn = function (column) { - var self = this, - config = [], - validator; - - if (column.definition.validator) { - - if (Array.isArray(column.definition.validator)) { - column.definition.validator.forEach(function (item) { - validator = self._extractValidator(item); - - if (validator) { - config.push(validator); - } - }); - } else { - validator = this._extractValidator(column.definition.validator); - - if (validator) { - config.push(validator); - } - } - - column.modules.validate = config.length ? config : false; - } -}; - -Validate.prototype._extractValidator = function (value) { - var type, params, pos; - - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "string": - pos = value.indexOf(':'); - - if (pos > -1) { - type = value.substring(0, pos); - params = value.substring(pos + 1); - } else { - type = value; - } - - return this._buildValidator(type, params); - break; - - case "function": - return this._buildValidator(value); - break; - - case "object": - return this._buildValidator(value.type, value.parameters); - break; - } -}; - -Validate.prototype._buildValidator = function (type, params) { - - var func = typeof type == "function" ? type : this.validators[type]; - - if (!func) { - console.warn("Validator Setup Error - No matching validator found:", type); - return false; - } else { - return { - type: typeof type == "function" ? "function" : type, - func: func, - params: params - }; - } -}; - -Validate.prototype.validate = function (validators, cell, value) { - var self = this, - valid = [], - invalidIndex = this.invalidCells.indexOf(cell); - - if (validators) { - validators.forEach(function (item) { - if (!item.func.call(self, cell.getComponent(), value, item.params)) { - valid.push({ - type: item.type, - parameters: item.params - }); - } - }); - } - - valid = valid.length ? valid : true; - - if (!cell.modules.validate) { - cell.modules.validate = {}; - } - - if (valid === true) { - cell.modules.validate.invalid = false; - cell.getElement().classList.remove("tabulator-validation-fail"); - - if (invalidIndex > -1) { - this.invalidCells.splice(invalidIndex, 1); - } - } else { - cell.modules.validate.invalid = true; - - if (this.table.options.validationMode !== "manual") { - cell.getElement().classList.add("tabulator-validation-fail"); - } - - if (invalidIndex == -1) { - this.invalidCells.push(cell); - } - } - - return valid; -}; - -Validate.prototype.getInvalidCells = function () { - var output = []; - - this.invalidCells.forEach(function (cell) { - output.push(cell.getComponent()); - }); - - return output; -}; - -Validate.prototype.clearValidation = function (cell) { - var invalidIndex; - - if (cell.modules.validate && cell.modules.validate.invalid) { - - cell.element.classList.remove("tabulator-validation-fail"); - cell.modules.validate.invalid = false; - - invalidIndex = this.invalidCells.indexOf(cell); - - if (invalidIndex > -1) { - this.invalidCells.splice(invalidIndex, 1); - } - } -}; - -Validate.prototype.validators = { - - //is integer - integer: function integer(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; - }, - - //is float - float: function float(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && value % 1 !== 0; - }, - - //must be a number - numeric: function numeric(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return !isNaN(value); - }, - - //must be a string - string: function string(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return isNaN(value); - }, - - //maximum value - max: function max(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) <= parameters; - }, - - //minimum value - min: function min(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) >= parameters; - }, - - //starts with value - starts: function starts(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).toLowerCase().startsWith(String(parameters).toLowerCase()); - }, - - //ends with value - ends: function ends(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).toLowerCase().endsWith(String(parameters).toLowerCase()); - }, - - //minimum string length - minLength: function minLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length >= parameters; - }, - - //maximum string length - maxLength: function maxLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length <= parameters; - }, - - //in provided value list - in: function _in(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - if (typeof parameters == "string") { - parameters = parameters.split("|"); - } - - return value === "" || parameters.indexOf(value) > -1; - }, - - //must match provided regex - regex: function regex(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var reg = new RegExp(parameters); - - return reg.test(value); - }, - - //value must be unique in this column - unique: function unique(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var unique = true; - - var cellData = cell.getData(); - var column = cell.getColumn()._getSelf(); - - this.table.rowManager.rows.forEach(function (row) { - var data = row.getData(); - - if (data !== cellData) { - if (value == column.getFieldValue(data)) { - unique = false; - } - } - }); - - return unique; - }, - - //must have a value - required: function required(cell, value, parameters) { - return value !== "" && value !== null && typeof value !== "undefined"; - } -}; - -Tabulator.prototype.registerModule("validate", Validate); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/modules/validate.min.js b/app/static/vendors/tabulator/js/modules/validate.min.js deleted file mode 100644 index fc189c0..0000000 --- a/app/static/vendors/tabulator/js/modules/validate.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Validate=function(t){this.table=t,this.invalidCells=[]};Validate.prototype.initializeColumn=function(t){var i,n=this,e=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(i=n._extractValidator(t))&&e.push(i)}):(i=this._extractValidator(t.definition.validator))&&e.push(i),t.modules.validate=!!e.length&&e)},Validate.prototype._extractValidator=function(t){var i,n,e;switch(void 0===t?"undefined":_typeof(t)){case"string":return e=t.indexOf(":"),e>-1?(i=t.substring(0,e),n=t.substring(e+1)):i=t,this._buildValidator(i,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},Validate.prototype._buildValidator=function(t,i){var n="function"==typeof t?t:this.validators[t];return n?{type:"function"==typeof t?"function":t,func:n,params:i}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},Validate.prototype.validate=function(t,i,n){var e=this,a=[],o=this.invalidCells.indexOf(i);return t&&t.forEach(function(t){t.func.call(e,i.getComponent(),n,t.params)||a.push({type:t.type,parameters:t.params})}),a=!a.length||a,i.modules.validate||(i.modules.validate={}),!0===a?(i.modules.validate.invalid=!1,i.getElement().classList.remove("tabulator-validation-fail"),o>-1&&this.invalidCells.splice(o,1)):(i.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&i.getElement().classList.add("tabulator-validation-fail"),-1==o&&this.invalidCells.push(i)),a},Validate.prototype.getInvalidCells=function(){var t=[];return this.invalidCells.forEach(function(i){t.push(i.getComponent())}),t},Validate.prototype.clearValidation=function(t){var i;t.modules.validate&&t.modules.validate.invalid&&(t.element.classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,(i=this.invalidCells.indexOf(t))>-1&&this.invalidCells.splice(i,1))},Validate.prototype.validators={integer:function(t,i,n){return""===i||null===i||void 0===i||"number"==typeof(i=Number(i))&&isFinite(i)&&Math.floor(i)===i},float:function(t,i,n){return""===i||null===i||void 0===i||"number"==typeof(i=Number(i))&&isFinite(i)&&i%1!=0},numeric:function(t,i,n){return""===i||null===i||void 0===i||!isNaN(i)},string:function(t,i,n){return""===i||null===i||void 0===i||isNaN(i)},max:function(t,i,n){return""===i||null===i||void 0===i||parseFloat(i)<=n},min:function(t,i,n){return""===i||null===i||void 0===i||parseFloat(i)>=n},starts:function(t,i,n){return""===i||null===i||void 0===i||String(i).toLowerCase().startsWith(String(n).toLowerCase())},ends:function(t,i,n){return""===i||null===i||void 0===i||String(i).toLowerCase().endsWith(String(n).toLowerCase())},minLength:function(t,i,n){return""===i||null===i||void 0===i||String(i).length>=n},maxLength:function(t,i,n){return""===i||null===i||void 0===i||String(i).length<=n},in:function(t,i,n){return""===i||null===i||void 0===i||("string"==typeof n&&(n=n.split("|")),""===i||n.indexOf(i)>-1)},regex:function(t,i,n){return""===i||null===i||void 0===i||new RegExp(n).test(i)},unique:function(t,i,n){if(""===i||null===i||void 0===i)return!0;var e=!0,a=t.getData(),o=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var n=t.getData();n!==a&&i==o.getFieldValue(n)&&(e=!1)}),e},required:function(t,i,n){return""!==i&&null!==i&&void 0!==i}},Tabulator.prototype.registerModule("validate",Validate); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/tabulator.js b/app/static/vendors/tabulator/js/tabulator.js deleted file mode 100644 index 256e565..0000000 --- a/app/static/vendors/tabulator/js/tabulator.js +++ /dev/null @@ -1,24907 +0,0 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -;(function (global, factory) { - if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define(factory); - } else { - global.Tabulator = factory(); - } -})(this, function () { - - 'use strict'; - - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - - - if (!Array.prototype.findIndex) { - - Object.defineProperty(Array.prototype, 'findIndex', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - - var k = 0; - - // 6. Repeat, while k < len - - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - - // b. Let kValue be ? Get(O, Pk). - - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - - // d. If testResult is true, return k. - - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return k; - } - - // e. Increase k by 1. - - - k++; - } - - // 7. Return -1. - - - return -1; - } - - }); - } - - // https://tc39.github.io/ecma262/#sec-array.prototype.find - - - if (!Array.prototype.find) { - - Object.defineProperty(Array.prototype, 'find', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - - var k = 0; - - // 6. Repeat, while k < len - - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - - // b. Let kValue be ? Get(O, Pk). - - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - - // d. If testResult is true, return kValue. - - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return kValue; - } - - // e. Increase k by 1. - - - k++; - } - - // 7. Return undefined. - - - return undefined; - } - - }); - } - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill - - - if (!String.prototype.includes) { - - String.prototype.includes = function (search, start) { - - 'use strict'; - - if (search instanceof RegExp) { - - throw TypeError('first argument must not be a RegExp'); - } - - if (start === undefined) { - start = 0; - } - - return this.indexOf(search, start) !== -1; - }; - } - - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - - - if (!Array.prototype.includes) { - - Object.defineProperty(Array.prototype, 'includes', { - - value: function value(searchElement, fromIndex) { - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - // 1. Let O be ? ToObject(this value). - - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - - var len = o.length >>> 0; - - // 3. If len is 0, return false. - - - if (len === 0) { - - return false; - } - - // 4. Let n be ? ToInteger(fromIndex). - - - // (If fromIndex is undefined, this step produces the value 0.) - - - var n = fromIndex | 0; - - // 5. If n ≥ 0, then - - - // a. Let k be n. - - - // 6. Else n < 0, - - - // a. Let k be len + n. - - - // b. If k < 0, let k be 0. - - - var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - - function sameValueZero(x, y) { - - return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y); - } - - // 7. Repeat, while k < len - - - while (k < len) { - - // a. Let elementK be the result of ? Get(O, ! ToString(k)). - - - // b. If SameValueZero(searchElement, elementK) is true, return true. - - - if (sameValueZero(o[k], searchElement)) { - - return true; - } - - // c. Increase k by 1. - - - k++; - } - - // 8. Return false - - - return false; - } - - }); - } - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill - - - if (typeof Object.assign !== 'function') { - - // Must be writable: true, enumerable: false, configurable: true - - - Object.defineProperty(Object, "assign", { - - value: function assign(target, varArgs) { - // .length of function is 2 - - - 'use strict'; - - if (target === null || target === undefined) { - - throw new TypeError('Cannot convert undefined or null to object'); - } - - var to = Object(target); - - for (var index = 1; index < arguments.length; index++) { - - var nextSource = arguments[index]; - - if (nextSource !== null && nextSource !== undefined) { - - for (var nextKey in nextSource) { - - // Avoid bugs when hasOwnProperty is shadowed - - - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - - to[nextKey] = nextSource[nextKey]; - } - } - } - } - - return to; - }, - - writable: true, - - configurable: true - - }); - } - - var ColumnManager = function ColumnManager(table) { - - this.table = table; //hold parent table - - - this.blockHozScrollEvent = false; - - this.headersElement = this.createHeadersElement(); - - this.element = this.createHeaderElement(); //containing element - - - this.rowManager = null; //hold row manager object - - - this.columns = []; // column definition object - - - this.columnsByIndex = []; //columns by index - - - this.columnsByField = {}; //columns by field - - - this.scrollLeft = 0; - - this.element.insertBefore(this.headersElement, this.element.firstChild); - }; - - ////////////// Setup Functions ///////////////// - - - ColumnManager.prototype.createHeadersElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-headers"); - - return el; - }; - - ColumnManager.prototype.createHeaderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-header"); - - if (!this.table.options.headerVisible) { - - el.classList.add("tabulator-header-hidden"); - } - - return el; - }; - - ColumnManager.prototype.initialize = function () { - - var self = this; - - //scroll body along with header - - - // self.element.addEventListener("scroll", function(e){ - - - // if(!self.blockHozScrollEvent){ - - - // self.table.rowManager.scrollHorizontal(self.element.scrollLeft); - - - // } - - - // }); - - }; - - //link to row manager - - - ColumnManager.prototype.setRowManager = function (manager) { - - this.rowManager = manager; - }; - - //return containing element - - - ColumnManager.prototype.getElement = function () { - - return this.element; - }; - - //return header containing element - - - ColumnManager.prototype.getHeadersElement = function () { - - return this.headersElement; - }; - - // ColumnManager.prototype.tempScrollBlock = function(){ - - - // clearTimeout(this.blockHozScrollEvent); - - - // this.blockHozScrollEvent = setTimeout(() => {this.blockHozScrollEvent = false;}, 50); - - - // } - - - //scroll horizontally to match table body - - - ColumnManager.prototype.scrollHorizontal = function (left) { - - var hozAdjust = 0, - scrollWidth = this.element.scrollWidth - this.table.element.clientWidth; - - // this.tempScrollBlock(); - - - this.element.scrollLeft = left; - - //adjust for vertical scrollbar moving table when present - - - if (left > scrollWidth) { - - hozAdjust = left - scrollWidth; - - this.element.style.marginLeft = -hozAdjust + "px"; - } else { - - this.element.style.marginLeft = 0; - } - - //keep frozen columns fixed in position - - - //this._calcFrozenColumnsPos(hozAdjust + 3); - - - this.scrollLeft = left; - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.scrollHorizontal(); - } - }; - - ///////////// Column Setup Functions ///////////// - - - ColumnManager.prototype.generateColumnsFromRowData = function (data) { - - var cols = [], - row, - sorter; - - if (data && data.length) { - - row = data[0]; - - for (var key in row) { - - var col = { - - field: key, - - title: key - - }; - - var value = row[key]; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - - case "undefined": - - sorter = "string"; - - break; - - case "boolean": - - sorter = "boolean"; - - break; - - case "object": - - if (Array.isArray(value)) { - - sorter = "array"; - } else { - - sorter = "string"; - } - - break; - - default: - - if (!isNaN(value) && value !== "") { - - sorter = "number"; - } else { - - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - - sorter = "alphanum"; - } else { - - sorter = "string"; - } - } - - break; - - } - - col.sorter = sorter; - - cols.push(col); - } - - this.table.options.columns = cols; - - this.setColumns(this.table.options.columns); - } - }; - - ColumnManager.prototype.setColumns = function (cols, row) { - - var self = this; - - while (self.headersElement.firstChild) { - self.headersElement.removeChild(self.headersElement.firstChild); - }self.columns = []; - - self.columnsByIndex = []; - - self.columnsByField = {}; - - //reset frozen columns - - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.reset(); - } - - cols.forEach(function (def, i) { - - self._addColumn(def); - }); - - self._reIndexColumns(); - - if (self.table.options.responsiveLayout && self.table.modExists("responsiveLayout", true)) { - - self.table.modules.responsiveLayout.initialize(); - } - - self.redraw(true); - }; - - ColumnManager.prototype._addColumn = function (definition, before, nextToColumn) { - - var column = new Column(definition, this), - colEl = column.getElement(), - index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn; - - if (nextToColumn && index > -1) { - - var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn()); - - var nextEl = nextToColumn.getElement(); - - if (before) { - - this.columns.splice(parentIndex, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl); - } else { - - this.columns.splice(parentIndex + 1, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl.nextSibling); - } - } else { - - if (before) { - - this.columns.unshift(column); - - this.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild); - } else { - - this.columns.push(column); - - this.headersElement.appendChild(column.getElement()); - } - - column.columnRendered(); - } - - return column; - }; - - ColumnManager.prototype.registerColumnField = function (col) { - - if (col.definition.field) { - - this.columnsByField[col.definition.field] = col; - } - }; - - ColumnManager.prototype.registerColumnPosition = function (col) { - - this.columnsByIndex.push(col); - }; - - ColumnManager.prototype._reIndexColumns = function () { - - this.columnsByIndex = []; - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); - }; - - //ensure column headers take up the correct amount of space in column groups - - - ColumnManager.prototype._verticalAlignHeaders = function () { - - var self = this, - minHeight = 0; - - self.columns.forEach(function (column) { - - var height; - - column.clearVerticalAlign(); - - height = column.getHeight(); - - if (height > minHeight) { - - minHeight = height; - } - }); - - self.columns.forEach(function (column) { - - column.verticalAlign(self.table.options.columnHeaderVertAlign, minHeight); - }); - - self.rowManager.adjustTableSize(); - }; - - //////////////// Column Details ///////////////// - - - ColumnManager.prototype.findColumn = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Column) { - - //subject is column element - - - return subject; - } else if (subject instanceof ColumnComponent) { - - //subject is public column component - - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the column header - - - var match = self.columns.find(function (column) { - - return column.element === subject; - }); - - return match || false; - } - } else { - - //subject should be treated as the field name of the column - - - return this.columnsByField[subject] || false; - } - - //catch all for any other type of input - - - return false; - }; - - ColumnManager.prototype.getColumnByField = function (field) { - - return this.columnsByField[field]; - }; - - ColumnManager.prototype.getColumnsByFieldRoot = function (root) { - var _this = this; - - var matches = []; - - Object.keys(this.columnsByField).forEach(function (field) { - - var fieldRoot = field.split(".")[0]; - - if (fieldRoot === root) { - - matches.push(_this.columnsByField[field]); - } - }); - - return matches; - }; - - ColumnManager.prototype.getColumnByIndex = function (index) { - - return this.columnsByIndex[index]; - }; - - ColumnManager.prototype.getFirstVisibileColumn = function (index) { - - var index = this.columnsByIndex.findIndex(function (col) { - - return col.visible; - }); - - return index > -1 ? this.columnsByIndex[index] : false; - }; - - ColumnManager.prototype.getColumns = function () { - - return this.columns; - }; - - ColumnManager.prototype.findColumnIndex = function (column) { - - return this.columnsByIndex.findIndex(function (col) { - - return column === col; - }); - }; - - //return all columns that are not groups - - - ColumnManager.prototype.getRealColumns = function () { - - return this.columnsByIndex; - }; - - //travers across columns and call action - - - ColumnManager.prototype.traverse = function (callback) { - - var self = this; - - self.columnsByIndex.forEach(function (column, i) { - - callback(column, i); - }); - }; - - //get defintions of actual columns - - - ColumnManager.prototype.getDefinitions = function (active) { - - var self = this, - output = []; - - self.columnsByIndex.forEach(function (column) { - - if (!active || active && column.visible) { - - output.push(column.getDefinition()); - } - }); - - return output; - }; - - //get full nested definition tree - - - ColumnManager.prototype.getDefinitionTree = function () { - - var self = this, - output = []; - - self.columns.forEach(function (column) { - - output.push(column.getDefinition(true)); - }); - - return output; - }; - - ColumnManager.prototype.getComponents = function (structured) { - - var self = this, - output = [], - columns = structured ? self.columns : self.columnsByIndex; - - columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - - return output; - }; - - ColumnManager.prototype.getWidth = function () { - - var width = 0; - - this.columnsByIndex.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - - return width; - }; - - ColumnManager.prototype.moveColumn = function (from, to, after) { - - this.moveColumnActual(from, to, after); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - to.element.parentNode.insertBefore(from.element, to.element); - - if (after) { - - to.element.parentNode.insertBefore(to.element, from.element); - } - - this._verticalAlignHeaders(); - - this.table.rowManager.reinitialize(); - }; - - ColumnManager.prototype.moveColumnActual = function (from, to, after) { - - if (from.parent.isGroup) { - - this._moveColumnInArray(from.parent.columns, from, to, after); - } else { - - this._moveColumnInArray(this.columns, from, to, after); - } - - this._moveColumnInArray(this.columnsByIndex, from, to, after, true); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.options.columnMoved) { - - this.table.options.columnMoved.call(this.table, from.getComponent(), this.table.columnManager.getComponents()); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - }; - - ColumnManager.prototype._moveColumnInArray = function (columns, from, to, after, updateRows) { - - var fromIndex = columns.indexOf(from), - toIndex; - - if (fromIndex > -1) { - - columns.splice(fromIndex, 1); - - toIndex = columns.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - toIndex = toIndex + 1; - } - } else { - - toIndex = fromIndex; - } - - columns.splice(toIndex, 0, from); - - if (updateRows) { - - this.table.rowManager.rows.forEach(function (row) { - - if (row.cells.length) { - - var cell = row.cells.splice(fromIndex, 1)[0]; - - row.cells.splice(toIndex, 0, cell); - } - }); - } - } - }; - - ColumnManager.prototype.scrollToColumn = function (column, position, ifVisible) { - var _this2 = this; - - var left = 0, - offset = 0, - adjust = 0, - colEl = column.getElement(); - - return new Promise(function (resolve, reject) { - - if (typeof position === "undefined") { - - position = _this2.table.options.scrollToColumnPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this2.table.options.scrollToColumnIfVisible; - } - - if (column.visible) { - - //align to correct position - - - switch (position) { - - case "middle": - - case "center": - - adjust = -_this2.element.clientWidth / 2; - - break; - - case "right": - - adjust = colEl.clientWidth - _this2.headersElement.clientWidth; - - break; - - } - - //check column visibility - - - if (!ifVisible) { - - offset = colEl.offsetLeft; - - if (offset > 0 && offset + colEl.offsetWidth < _this2.element.clientWidth) { - - return false; - } - } - - //calculate scroll position - - - left = colEl.offsetLeft + _this2.element.scrollLeft + adjust; - - left = Math.max(Math.min(left, _this2.table.rowManager.element.scrollWidth - _this2.table.rowManager.element.clientWidth), 0); - - _this2.table.rowManager.scrollHorizontal(left); - - _this2.scrollHorizontal(left); - - resolve(); - } else { - - console.warn("Scroll Error - Column not visible"); - - reject("Scroll Error - Column not visible"); - } - }); - }; - - //////////////// Cell Management ///////////////// - - - ColumnManager.prototype.generateCells = function (row) { - - var self = this; - - var cells = []; - - self.columnsByIndex.forEach(function (column) { - - cells.push(column.generateCell(row)); - }); - - return cells; - }; - - //////////////// Column Management ///////////////// - - - ColumnManager.prototype.getFlexBaseWidth = function () { - - var self = this, - totalWidth = self.table.element.clientWidth, - //table element width - - - fixedWidth = 0; - - //adjust for vertical scrollbar if present - - - if (self.rowManager.element.scrollHeight > self.rowManager.element.clientHeight) { - - totalWidth -= self.rowManager.element.offsetWidth - self.rowManager.element.clientWidth; - } - - this.columnsByIndex.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width || 0; - - minWidth = typeof column.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(column.minWidth); - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - } - }); - - return fixedWidth; - }; - - ColumnManager.prototype.addColumn = function (definition, before, nextToColumn) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var column = _this3._addColumn(definition, before, nextToColumn); - - _this3._reIndexColumns(); - - if (_this3.table.options.responsiveLayout && _this3.table.modExists("responsiveLayout", true)) { - - _this3.table.modules.responsiveLayout.initialize(); - } - - if (_this3.table.modExists("columnCalcs")) { - - _this3.table.modules.columnCalcs.recalc(_this3.table.rowManager.activeRows); - } - - _this3.redraw(); - - if (_this3.table.modules.layout.getMode() != "fitColumns") { - - column.reinitializeWidth(); - } - - _this3._verticalAlignHeaders(); - - _this3.table.rowManager.reinitialize(); - - resolve(column); - }); - }; - - //remove column from system - - - ColumnManager.prototype.deregisterColumn = function (column) { - - var field = column.getField(), - index; - - //remove from field list - - - if (field) { - - delete this.columnsByField[field]; - } - - //remove from index list - - - index = this.columnsByIndex.indexOf(column); - - if (index > -1) { - - this.columnsByIndex.splice(index, 1); - } - - //remove from column list - - - index = this.columns.indexOf(column); - - if (index > -1) { - - this.columns.splice(index, 1); - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - this.redraw(); - }; - - //redraw columns - - - ColumnManager.prototype.redraw = function (force) { - - if (force) { - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - - this._verticalAlignHeaders(); - } - - this.table.rowManager.resetScroll(); - - this.table.rowManager.reinitialize(); - } - - if (["fitColumns", "fitDataStretch"].indexOf(this.table.modules.layout.getMode()) > -1) { - - this.table.modules.layout.layout(); - } else { - - if (force) { - - this.table.modules.layout.layout(); - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (force) { - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.redraw(); - } - } - - this.table.footerManager.redraw(); - }; - - //public column object - - var ColumnComponent = function ColumnComponent(column) { - - this._column = column; - - this.type = "ColumnComponent"; - }; - - ColumnComponent.prototype.getElement = function () { - - return this._column.getElement(); - }; - - ColumnComponent.prototype.getDefinition = function () { - - return this._column.getDefinition(); - }; - - ColumnComponent.prototype.getField = function () { - - return this._column.getField(); - }; - - ColumnComponent.prototype.getCells = function () { - - var cells = []; - - this._column.cells.forEach(function (cell) { - - cells.push(cell.getComponent()); - }); - - return cells; - }; - - ColumnComponent.prototype.getVisibility = function () { - - console.warn("getVisibility function is deprecated, you should now use the isVisible function"); - - return this._column.visible; - }; - - ColumnComponent.prototype.isVisible = function () { - - return this._column.visible; - }; - - ColumnComponent.prototype.show = function () { - - if (this._column.isGroup) { - - this._column.columns.forEach(function (column) { - - column.show(); - }); - } else { - - this._column.show(); - } - }; - - ColumnComponent.prototype.hide = function () { - - if (this._column.isGroup) { - - this._column.columns.forEach(function (column) { - - column.hide(); - }); - } else { - - this._column.hide(); - } - }; - - ColumnComponent.prototype.toggle = function () { - - if (this._column.visible) { - - this.hide(); - } else { - - this.show(); - } - }; - - ColumnComponent.prototype.delete = function () { - - return this._column.delete(); - }; - - ColumnComponent.prototype.getSubColumns = function () { - - var output = []; - - if (this._column.columns.length) { - - this._column.columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - } - - return output; - }; - - ColumnComponent.prototype.getParentColumn = function () { - - return this._column.parent instanceof Column ? this._column.parent.getComponent() : false; - }; - - ColumnComponent.prototype._getSelf = function () { - - return this._column; - }; - - ColumnComponent.prototype.scrollTo = function () { - - return this._column.table.columnManager.scrollToColumn(this._column); - }; - - ColumnComponent.prototype.getTable = function () { - - return this._column.table; - }; - - ColumnComponent.prototype.headerFilterFocus = function () { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.setHeaderFilterFocus(this._column); - } - }; - - ColumnComponent.prototype.reloadHeaderFilter = function () { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.reloadHeaderFilter(this._column); - } - }; - - ColumnComponent.prototype.getHeaderFilterValue = function () { - - if (this._column.table.modExists("filter", true)) { - - return this._column.table.modules.filter.getHeaderFilterValue(this._column); - } - }; - - ColumnComponent.prototype.setHeaderFilterValue = function (value) { - - if (this._column.table.modExists("filter", true)) { - - this._column.table.modules.filter.setHeaderFilterValue(this._column, value); - } - }; - - ColumnComponent.prototype.move = function (to, after) { - - var toColumn = this._column.table.columnManager.findColumn(to); - - if (toColumn) { - - this._column.table.columnManager.moveColumn(this._column, toColumn, after); - } else { - - console.warn("Move Error - No matching column found:", toColumn); - } - }; - - ColumnComponent.prototype.getNextColumn = function () { - - var nextCol = this._column.nextColumn(); - - return nextCol ? nextCol.getComponent() : false; - }; - - ColumnComponent.prototype.getPrevColumn = function () { - - var prevCol = this._column.prevColumn(); - - return prevCol ? prevCol.getComponent() : false; - }; - - ColumnComponent.prototype.updateDefinition = function (updates) { - - return this._column.updateDefinition(updates); - }; - - ColumnComponent.prototype.getWidth = function () { - - return this._column.getWidth(); - }; - - ColumnComponent.prototype.setWidth = function (width) { - - if (width === true) { - - return this._column.reinitializeWidth(true); - } else { - - return this._column.setWidth(width); - } - }; - - ColumnComponent.prototype.validate = function () { - - return this._column.validate(); - }; - - var Column = function Column(def, parent) { - - var self = this; - - this.table = parent.table; - - this.definition = def; //column definition - - this.parent = parent; //hold parent object - - this.type = "column"; //type of element - - this.columns = []; //child columns - - this.cells = []; //cells bound to this column - - this.element = this.createElement(); //column header element - - this.contentElement = false; - - this.titleElement = false; - - this.groupElement = this.createGroupElement(); //column group holder element - - this.isGroup = false; - - this.tooltip = false; //hold column tooltip - - this.hozAlign = ""; //horizontal text alignment - - this.vertAlign = ""; //vert text alignment - - - //multi dimensional filed handling - - this.field = ""; - - this.fieldStructure = ""; - - this.getFieldValue = ""; - - this.setFieldValue = ""; - - this.titleFormatterRendered = false; - - this.setField(this.definition.field); - - if (this.table.options.invalidOptionWarnings) { - - this.checkDefinition(); - } - - this.modules = {}; //hold module variables; - - - this.cellEvents = { - - cellClick: false, - - cellDblClick: false, - - cellContext: false, - - cellTap: false, - - cellDblTap: false, - - cellTapHold: false, - - cellMouseEnter: false, - - cellMouseLeave: false, - - cellMouseOver: false, - - cellMouseOut: false, - - cellMouseMove: false - - }; - - this.width = null; //column width - - this.widthStyled = ""; //column width prestyled to improve render efficiency - - this.minWidth = null; //column minimum width - - this.minWidthStyled = ""; //column minimum prestyled to improve render efficiency - - this.widthFixed = false; //user has specified a width for this column - - - this.visible = true; //default visible state - - - this.component = null; - - this._mapDepricatedFunctionality(); - - //initialize column - - if (def.columns) { - - this.isGroup = true; - - def.columns.forEach(function (def, i) { - - var newCol = new Column(def, self); - - self.attachColumn(newCol); - }); - - self.checkColumnVisibility(); - } else { - - parent.registerColumnField(this); - } - - if (def.rowHandle && this.table.options.movableRows !== false && this.table.modExists("moveRow")) { - - this.table.modules.moveRow.setHandle(true); - } - - this._buildHeader(); - - this.bindModuleColumns(); - }; - - Column.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - - el.setAttribute("role", "columnheader"); - - el.setAttribute("aria-sort", "none"); - - return el; - }; - - Column.prototype.createGroupElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-col-group-cols"); - - return el; - }; - - Column.prototype.checkDefinition = function () { - var _this4 = this; - - Object.keys(this.definition).forEach(function (key) { - - if (_this4.defaultOptionList.indexOf(key) === -1) { - - console.warn("Invalid column definition option in '" + (_this4.field || _this4.definition.title) + "' column:", key); - } - }); - }; - - Column.prototype.setField = function (field) { - - this.field = field; - - this.fieldStructure = field ? this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field] : []; - - this.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData; - - this.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData; - }; - - //register column position with column manager - - Column.prototype.registerColumnPosition = function (column) { - - this.parent.registerColumnPosition(column); - }; - - //register column position with column manager - - Column.prototype.registerColumnField = function (column) { - - this.parent.registerColumnField(column); - }; - - //trigger position registration - - Column.prototype.reRegisterPosition = function () { - - if (this.isGroup) { - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); - } else { - - this.registerColumnPosition(this); - } - }; - - Column.prototype._mapDepricatedFunctionality = function () { - - if (typeof this.definition.hideInHtml !== "undefined") { - - this.definition.htmlOutput = !this.definition.hideInHtml; - - console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput"); - } - - if (typeof this.definition.align !== "undefined") { - - this.definition.hozAlign = this.definition.align; - - console.warn("align column definition property is deprecated, you should now use hozAlign"); - } - - if (typeof this.definition.downloadTitle !== "undefined") { - - this.definition.titleDownload = this.definition.downloadTitle; - - console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"); - } - }; - - Column.prototype.setTooltip = function () { - - var self = this, - def = self.definition; - - //set header tooltips - - var tooltip = def.headerTooltip || def.tooltip === false ? def.headerTooltip : self.table.options.tooltipsHeader; - - if (tooltip) { - - if (tooltip === true) { - - if (def.field) { - - self.table.modules.localize.bind("columns|" + def.field, function (value) { - - self.element.setAttribute("title", value || def.title); - }); - } else { - - self.element.setAttribute("title", def.title); - } - } else { - - if (typeof tooltip == "function") { - - tooltip = tooltip(self.getComponent()); - - if (tooltip === false) { - - tooltip = ""; - } - } - - self.element.setAttribute("title", tooltip); - } - } else { - - self.element.setAttribute("title", ""); - } - }; - - //build header element - - Column.prototype._buildHeader = function () { - - var self = this, - def = self.definition; - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - }if (def.headerVertical) { - - self.element.classList.add("tabulator-col-vertical"); - - if (def.headerVertical === "flip") { - - self.element.classList.add("tabulator-col-vertical-flip"); - } - } - - self.contentElement = self._bindEvents(); - - self.contentElement = self._buildColumnHeaderContent(); - - self.element.appendChild(self.contentElement); - - if (self.isGroup) { - - self._buildGroupHeader(); - } else { - - self._buildColumnHeader(); - } - - self.setTooltip(); - - //set resizable handles - - if (self.table.options.resizableColumns && self.table.modExists("resizeColumns")) { - - self.table.modules.resizeColumns.initializeColumn("header", self, self.element); - } - - //set resizable handles - - if (def.headerFilter && self.table.modExists("filter") && self.table.modExists("edit")) { - - if (typeof def.headerFilterPlaceholder !== "undefined" && def.field) { - - self.table.modules.localize.setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder); - } - - self.table.modules.filter.initializeColumn(self); - } - - //set resizable handles - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.initializeColumn(self); - } - - //set movable column - - if (self.table.options.movableColumns && !self.isGroup && self.table.modExists("moveColumn")) { - - self.table.modules.moveColumn.initializeColumn(self); - } - - //set calcs column - - if ((def.topCalc || def.bottomCalc) && self.table.modExists("columnCalcs")) { - - self.table.modules.columnCalcs.initializeColumn(self); - } - - //handle persistence - - if (self.table.modExists("persistence") && self.table.modules.persistence.config.columns) { - - self.table.modules.persistence.initializeColumn(self); - } - - //update header tooltip on mouse enter - - self.element.addEventListener("mouseenter", function (e) { - - self.setTooltip(); - }); - }; - - Column.prototype._bindEvents = function () { - - var self = this, - def = self.definition, - dblTap, - tapHold, - tap; - - //setup header click event bindings - - if (typeof def.headerClick == "function") { - - self.element.addEventListener("click", function (e) { - def.headerClick(e, self.getComponent()); - }); - } - - if (typeof def.headerDblClick == "function") { - - self.element.addEventListener("dblclick", function (e) { - def.headerDblClick(e, self.getComponent()); - }); - } - - if (typeof def.headerContext == "function") { - - self.element.addEventListener("contextmenu", function (e) { - def.headerContext(e, self.getComponent()); - }); - } - - //setup header tap event bindings - - if (typeof def.headerTap == "function") { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - if (tap) { - - def.headerTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (typeof def.headerDblTap == "function") { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - def.headerDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (typeof def.headerTapHold == "function") { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - def.headerTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - - //store column cell click event bindings - - if (typeof def.cellClick == "function") { - - self.cellEvents.cellClick = def.cellClick; - } - - if (typeof def.cellDblClick == "function") { - - self.cellEvents.cellDblClick = def.cellDblClick; - } - - if (typeof def.cellContext == "function") { - - self.cellEvents.cellContext = def.cellContext; - } - - //store column mouse event bindings - - if (typeof def.cellMouseEnter == "function") { - - self.cellEvents.cellMouseEnter = def.cellMouseEnter; - } - - if (typeof def.cellMouseLeave == "function") { - - self.cellEvents.cellMouseLeave = def.cellMouseLeave; - } - - if (typeof def.cellMouseOver == "function") { - - self.cellEvents.cellMouseOver = def.cellMouseOver; - } - - if (typeof def.cellMouseOut == "function") { - - self.cellEvents.cellMouseOut = def.cellMouseOut; - } - - if (typeof def.cellMouseMove == "function") { - - self.cellEvents.cellMouseMove = def.cellMouseMove; - } - - //setup column cell tap event bindings - - if (typeof def.cellTap == "function") { - - self.cellEvents.cellTap = def.cellTap; - } - - if (typeof def.cellDblTap == "function") { - - self.cellEvents.cellDblTap = def.cellDblTap; - } - - if (typeof def.cellTapHold == "function") { - - self.cellEvents.cellTapHold = def.cellTapHold; - } - - //setup column cell edit callbacks - - if (typeof def.cellEdited == "function") { - - self.cellEvents.cellEdited = def.cellEdited; - } - - if (typeof def.cellEditing == "function") { - - self.cellEvents.cellEditing = def.cellEditing; - } - - if (typeof def.cellEditCancelled == "function") { - - self.cellEvents.cellEditCancelled = def.cellEditCancelled; - } - }; - - //build header element for header - - Column.prototype._buildColumnHeader = function () { - - var self = this, - def = self.definition, - table = self.table, - sortable; - - //set column sorter - - if (table.modExists("sort")) { - - table.modules.sort.initializeColumn(self, self.contentElement); - } - - //set column header context menu - - if ((def.headerContextMenu || def.headerMenu) && table.modExists("menu")) { - - table.modules.menu.initializeColumnHeader(self); - } - - //set column formatter - - if (table.modExists("format")) { - - table.modules.format.initializeColumn(self); - } - - //set column editor - - if (typeof def.editor != "undefined" && table.modExists("edit")) { - - table.modules.edit.initializeColumn(self); - } - - //set colum validator - - if (typeof def.validator != "undefined" && table.modExists("validate")) { - - table.modules.validate.initializeColumn(self); - } - - //set column mutator - - if (table.modExists("mutator")) { - - table.modules.mutator.initializeColumn(self); - } - - //set column accessor - - if (table.modExists("accessor")) { - - table.modules.accessor.initializeColumn(self); - } - - //set respoviveLayout - - if (_typeof(table.options.responsiveLayout) && table.modExists("responsiveLayout")) { - - table.modules.responsiveLayout.initializeColumn(self); - } - - //set column visibility - - if (typeof def.visible != "undefined") { - - if (def.visible) { - - self.show(true); - } else { - - self.hide(true); - } - } - - //asign additional css classes to column header - - if (def.cssClass) { - - var classeNames = def.cssClass.split(" "); - - classeNames.forEach(function (className) { - - self.element.classList.add(className); - }); - } - - if (def.field) { - - this.element.setAttribute("tabulator-field", def.field); - } - - //set min width if present - - self.setMinWidth(typeof def.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(def.minWidth)); - - self.reinitializeWidth(); - - //set tooltip if present - - self.tooltip = self.definition.tooltip || self.definition.tooltip === false ? self.definition.tooltip : self.table.options.tooltips; - - //set orizontal text alignment - - self.hozAlign = typeof self.definition.hozAlign == "undefined" ? self.table.options.cellHozAlign : self.definition.hozAlign; - - self.vertAlign = typeof self.definition.vertAlign == "undefined" ? self.table.options.cellVertAlign : self.definition.vertAlign; - }; - - Column.prototype._buildColumnHeaderContent = function () { - - var def = this.definition, - table = this.table; - - var contentElement = document.createElement("div"); - - contentElement.classList.add("tabulator-col-content"); - - this.titleElement = this._buildColumnHeaderTitle(); - - contentElement.appendChild(this.titleElement); - - return contentElement; - }; - - //build title element of column - - Column.prototype._buildColumnHeaderTitle = function () { - - var self = this, - def = self.definition, - table = self.table, - title; - - var titleHolderElement = document.createElement("div"); - - titleHolderElement.classList.add("tabulator-col-title"); - - if (def.editableTitle) { - - var titleElement = document.createElement("input"); - - titleElement.classList.add("tabulator-title-editor"); - - titleElement.addEventListener("click", function (e) { - - e.stopPropagation(); - - titleElement.focus(); - }); - - titleElement.addEventListener("change", function () { - - def.title = titleElement.value; - - table.options.columnTitleChanged.call(self.table, self.getComponent()); - }); - - titleHolderElement.appendChild(titleElement); - - if (def.field) { - - table.modules.localize.bind("columns|" + def.field, function (text) { - - titleElement.value = text || def.title || " "; - }); - } else { - - titleElement.value = def.title || " "; - } - } else { - - if (def.field) { - - table.modules.localize.bind("columns|" + def.field, function (text) { - - self._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); - }); - } else { - - self._formatColumnHeaderTitle(titleHolderElement, def.title || " "); - } - } - - return titleHolderElement; - }; - - Column.prototype._formatColumnHeaderTitle = function (el, title) { - var _this5 = this; - - var formatter, contents, params, mockCell, onRendered; - - if (this.definition.titleFormatter && this.table.modExists("format")) { - - formatter = this.table.modules.format.getFormatter(this.definition.titleFormatter); - - onRendered = function onRendered(callback) { - - _this5.titleFormatterRendered = callback; - }; - - mockCell = { - - getValue: function getValue() { - - return title; - }, - - getElement: function getElement() { - - return el; - } - - }; - - params = this.definition.titleFormatterParams || {}; - - params = typeof params === "function" ? params() : params; - - contents = formatter.call(this.table.modules.format, mockCell, params, onRendered); - - switch (typeof contents === 'undefined' ? 'undefined' : _typeof(contents)) { - - case "object": - - if (contents instanceof Node) { - - el.appendChild(contents); - } else { - - el.innerHTML = ""; - - console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", contents); - } - - break; - - case "undefined": - - case "null": - - el.innerHTML = ""; - - break; - - default: - - el.innerHTML = contents; - - } - } else { - - el.innerHTML = title; - } - }; - - //build header element for column group - - Column.prototype._buildGroupHeader = function () { - var _this6 = this; - - this.element.classList.add("tabulator-col-group"); - - this.element.setAttribute("role", "columngroup"); - - this.element.setAttribute("aria-title", this.definition.title); - - //asign additional css classes to column header - - if (this.definition.cssClass) { - - var classeNames = this.definition.cssClass.split(" "); - - classeNames.forEach(function (className) { - - _this6.element.classList.add(className); - }); - } - - //set column header context menu - - if ((this.definition.headerContextMenu || this.definition.headerMenu) && this.table.modExists("menu")) { - - this.table.modules.menu.initializeColumnHeader(this); - } - - this.element.appendChild(this.groupElement); - }; - - //flat field lookup - - Column.prototype._getFlatData = function (data) { - - return data[this.field]; - }; - - //nested field lookup - - Column.prototype._getNestedData = function (data) { - - var dataObj = data, - structure = this.fieldStructure, - length = structure.length, - output; - - for (var _i = 0; _i < length; _i++) { - - dataObj = dataObj[structure[_i]]; - - output = dataObj; - - if (!dataObj) { - - break; - } - } - - return output; - }; - - //flat field set - - Column.prototype._setFlatData = function (data, value) { - - if (this.field) { - - data[this.field] = value; - } - }; - - //nested field set - - Column.prototype._setNestedData = function (data, value) { - - var dataObj = data, - structure = this.fieldStructure, - length = structure.length; - - for (var _i2 = 0; _i2 < length; _i2++) { - - if (_i2 == length - 1) { - - dataObj[structure[_i2]] = value; - } else { - - if (!dataObj[structure[_i2]]) { - - if (typeof value !== "undefined") { - - dataObj[structure[_i2]] = {}; - } else { - - break; - } - } - - dataObj = dataObj[structure[_i2]]; - } - } - }; - - //attach column to this group - - Column.prototype.attachColumn = function (column) { - - var self = this; - - if (self.groupElement) { - - self.columns.push(column); - - self.groupElement.appendChild(column.getElement()); - } else { - - console.warn("Column Warning - Column being attached to another column instead of column group"); - } - }; - - //vertically align header in column - - Column.prototype.verticalAlign = function (alignment, height) { - - //calculate height of column header and group holder element - - var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : height || this.parent.getHeadersElement().clientHeight; - - // var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight; - - - this.element.style.height = parentHeight + "px"; - - if (this.isGroup) { - - this.groupElement.style.minHeight = parentHeight - this.contentElement.offsetHeight + "px"; - } - - //vertically align cell contents - - if (!this.isGroup && alignment !== "top") { - - if (alignment === "bottom") { - - this.element.style.paddingTop = this.element.clientHeight - this.contentElement.offsetHeight + "px"; - } else { - - this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) / 2 + "px"; - } - } - - this.columns.forEach(function (column) { - - column.verticalAlign(alignment); - }); - }; - - //clear vertical alignmenet - - Column.prototype.clearVerticalAlign = function () { - - this.element.style.paddingTop = ""; - - this.element.style.height = ""; - - this.element.style.minHeight = ""; - - this.groupElement.style.minHeight = ""; - - this.columns.forEach(function (column) { - - column.clearVerticalAlign(); - }); - }; - - Column.prototype.bindModuleColumns = function () { - - //check if rownum formatter is being used on a column - - if (this.definition.formatter == "rownum") { - - this.table.rowManager.rowNumColumn = this; - } - }; - - //// Retreive Column Information //// - - - //return column header element - - Column.prototype.getElement = function () { - - return this.element; - }; - - //return colunm group element - - Column.prototype.getGroupElement = function () { - - return this.groupElement; - }; - - //return field name - - Column.prototype.getField = function () { - - return this.field; - }; - - //return the first column in a group - - Column.prototype.getFirstColumn = function () { - - if (!this.isGroup) { - - return this; - } else { - - if (this.columns.length) { - - return this.columns[0].getFirstColumn(); - } else { - - return false; - } - } - }; - - //return the last column in a group - - Column.prototype.getLastColumn = function () { - - if (!this.isGroup) { - - return this; - } else { - - if (this.columns.length) { - - return this.columns[this.columns.length - 1].getLastColumn(); - } else { - - return false; - } - } - }; - - //return all columns in a group - - Column.prototype.getColumns = function () { - - return this.columns; - }; - - //return all columns in a group - - Column.prototype.getCells = function () { - - return this.cells; - }; - - //retreive the top column in a group of columns - - Column.prototype.getTopColumn = function () { - - if (this.parent.isGroup) { - - return this.parent.getTopColumn(); - } else { - - return this; - } - }; - - //return column definition object - - Column.prototype.getDefinition = function (updateBranches) { - - var colDefs = []; - - if (this.isGroup && updateBranches) { - - this.columns.forEach(function (column) { - - colDefs.push(column.getDefinition(true)); - }); - - this.definition.columns = colDefs; - } - - return this.definition; - }; - - //////////////////// Actions //////////////////// - - - Column.prototype.checkColumnVisibility = function () { - - var visible = false; - - this.columns.forEach(function (column) { - - if (column.visible) { - - visible = true; - } - }); - - if (visible) { - - this.show(); - - this.parent.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } else { - - this.hide(); - } - }; - - //show column - - Column.prototype.show = function (silent, responsiveToggle) { - - if (!this.visible) { - - this.visible = true; - - this.element.style.display = ""; - - if (this.parent.isGroup) { - - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - - cell.show(); - }); - - if (!this.isGroup && this.width === null) { - - this.reinitializeWidth(); - } - - this.table.columnManager._verticalAlignHeaders(); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), true); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - //hide column - - Column.prototype.hide = function (silent, responsiveToggle) { - - if (this.visible) { - - this.visible = false; - - this.element.style.display = "none"; - - this.table.columnManager._verticalAlignHeaders(); - - if (this.parent.isGroup) { - - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - - cell.hide(); - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - Column.prototype.matchChildWidths = function () { - - var childWidth = 0; - - if (this.contentElement && this.columns.length) { - - this.columns.forEach(function (column) { - - if (column.visible) { - - childWidth += column.getWidth(); - } - }); - - this.contentElement.style.maxWidth = childWidth - 1 + "px"; - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - } - }; - - Column.prototype.setWidth = function (width) { - - this.widthFixed = true; - - this.setWidthActual(width); - }; - - Column.prototype.setWidthActual = function (width) { - - if (isNaN(width)) { - - width = Math.floor(this.table.element.clientWidth / 100 * parseInt(width)); - } - - width = Math.max(this.minWidth, width); - - this.width = width; - - this.widthStyled = width ? width + "px" : ""; - - this.element.style.width = this.widthStyled; - - if (!this.isGroup) { - - this.cells.forEach(function (cell) { - - cell.setWidth(); - }); - } - - if (this.parent.isGroup) { - - this.parent.matchChildWidths(); - } - - //set resizable handles - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - }; - - Column.prototype.checkCellHeights = function () { - - var rows = []; - - this.cells.forEach(function (cell) { - - if (cell.row.heightInitialized) { - - if (cell.row.getElement().offsetParent !== null) { - - rows.push(cell.row); - - cell.row.clearCellHeight(); - } else { - - cell.row.heightInitialized = false; - } - } - }); - - rows.forEach(function (row) { - - row.calcHeight(); - }); - - rows.forEach(function (row) { - - row.setCellHeight(); - }); - }; - - Column.prototype.getWidth = function () { - - var width = 0; - - if (this.isGroup) { - - this.columns.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - } else { - - width = this.width; - } - - return width; - }; - - Column.prototype.getHeight = function () { - - return this.element.offsetHeight; - }; - - Column.prototype.setMinWidth = function (minWidth) { - - this.minWidth = minWidth; - - this.minWidthStyled = minWidth ? minWidth + "px" : ""; - - this.element.style.minWidth = this.minWidthStyled; - - this.cells.forEach(function (cell) { - - cell.setMinWidth(); - }); - }; - - Column.prototype.delete = function () { - var _this7 = this; - - return new Promise(function (resolve, reject) { - - if (_this7.isGroup) { - - _this7.columns.forEach(function (column) { - - column.delete(); - }); - } - - //cancel edit if column is currently being edited - - if (_this7.table.modExists("edit")) { - - if (_this7.table.modules.edit.currentCell.column === _this7) { - - _this7.table.modules.edit.cancelEdit(); - } - } - - var cellCount = _this7.cells.length; - - for (var _i3 = 0; _i3 < cellCount; _i3++) { - - _this7.cells[0].delete(); - } - - _this7.element.parentNode.removeChild(_this7.element); - - _this7.table.columnManager.deregisterColumn(_this7); - - resolve(); - }); - }; - - Column.prototype.columnRendered = function () { - - if (this.titleFormatterRendered) { - - this.titleFormatterRendered(); - } - }; - - Column.prototype.validate = function () { - - var invalid = []; - - this.cells.forEach(function (cell) { - - if (!cell.validate()) { - - invalid.push(cell.getComponent()); - } - }); - - return invalid.length ? invalid : true; - }; - - //////////////// Cell Management ///////////////// - - - //generate cell for this column - - Column.prototype.generateCell = function (row) { - - var self = this; - - var cell = new Cell(self, row); - - this.cells.push(cell); - - return cell; - }; - - Column.prototype.nextColumn = function () { - - var index = this.table.columnManager.findColumnIndex(this); - - return index > -1 ? this._nextVisibleColumn(index + 1) : false; - }; - - Column.prototype._nextVisibleColumn = function (index) { - - var column = this.table.columnManager.getColumnByIndex(index); - - return !column || column.visible ? column : this._nextVisibleColumn(index + 1); - }; - - Column.prototype.prevColumn = function () { - - var index = this.table.columnManager.findColumnIndex(this); - - return index > -1 ? this._prevVisibleColumn(index - 1) : false; - }; - - Column.prototype._prevVisibleColumn = function (index) { - - var column = this.table.columnManager.getColumnByIndex(index); - - return !column || column.visible ? column : this._prevVisibleColumn(index - 1); - }; - - Column.prototype.reinitializeWidth = function (force) { - - this.widthFixed = false; - - //set width if present - - if (typeof this.definition.width !== "undefined" && !force) { - - this.setWidth(this.definition.width); - } - - //hide header filters to prevent them altering column width - - if (this.table.modExists("filter")) { - - this.table.modules.filter.hideHeaderFilterElements(); - } - - this.fitToData(); - - //show header filters again after layout is complete - - if (this.table.modExists("filter")) { - - this.table.modules.filter.showHeaderFilterElements(); - } - }; - - //set column width to maximum cell width - - Column.prototype.fitToData = function () { - - var self = this; - - if (!this.widthFixed) { - - this.element.style.width = ""; - - self.cells.forEach(function (cell) { - - cell.clearWidth(); - }); - } - - var maxWidth = this.element.offsetWidth; - - if (!self.width || !this.widthFixed) { - - self.cells.forEach(function (cell) { - - var width = cell.getWidth(); - - if (width > maxWidth) { - - maxWidth = width; - } - }); - - if (maxWidth) { - - self.setWidthActual(maxWidth + 1); - } - } - }; - - Column.prototype.updateDefinition = function (updates) { - var _this8 = this; - - return new Promise(function (resolve, reject) { - - var definition; - - if (!_this8.isGroup) { - - definition = Object.assign({}, _this8.getDefinition()); - - definition = Object.assign(definition, updates); - - _this8.table.columnManager.addColumn(definition, false, _this8).then(function (column) { - - if (definition.field == _this8.field) { - - _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays - } - - _this8.delete().then(function () { - - resolve(column.getComponent()); - }).catch(function (err) { - - reject(err); - }); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - - reject("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - } - }); - }; - - Column.prototype.deleteCell = function (cell) { - - var index = this.cells.indexOf(cell); - - if (index > -1) { - - this.cells.splice(index, 1); - } - }; - - Column.prototype.defaultOptionList = ["title", "field", "columns", "visible", "align", "hozAlign", "vertAlign", "width", "minWidth", "widthGrow", "widthShrink", "resizable", "frozen", "responsive", "tooltip", "cssClass", "rowHandle", "hideInHtml", "print", "htmlOutput", "sorter", "sorterParams", "formatter", "formatterParams", "variableHeight", "editable", "editor", "editorParams", "validator", "mutator", "mutatorParams", "mutatorData", "mutatorDataParams", "mutatorEdit", "mutatorEditParams", "mutatorClipboard", "mutatorClipboardParams", "accessor", "accessorParams", "accessorData", "accessorDataParams", "accessorDownload", "accessorDownloadParams", "accessorClipboard", "accessorClipboardParams", "accessorPrint", "accessorPrintParams", "accessorHtmlOutput", "accessorHtmlOutputParams", "clipboard", "download", "downloadTitle", "topCalc", "topCalcParams", "topCalcFormatter", "topCalcFormatterParams", "bottomCalc", "bottomCalcParams", "bottomCalcFormatter", "bottomCalcFormatterParams", "cellClick", "cellDblClick", "cellContext", "cellTap", "cellDblTap", "cellTapHold", "cellMouseEnter", "cellMouseLeave", "cellMouseOver", "cellMouseOut", "cellMouseMove", "cellEditing", "cellEdited", "cellEditCancelled", "headerSort", "headerSortStartingDir", "headerSortTristate", "headerClick", "headerDblClick", "headerContext", "headerTap", "headerDblTap", "headerTapHold", "headerTooltip", "headerVertical", "editableTitle", "titleFormatter", "titleFormatterParams", "headerFilter", "headerFilterPlaceholder", "headerFilterParams", "headerFilterEmptyCheck", "headerFilterFunc", "headerFilterFuncParams", "headerFilterLiveFilter", "print", "headerContextMenu", "headerMenu", "contextMenu", "formatterPrint", "formatterPrintParams", "formatterClipboard", "formatterClipboardParams", "formatterHtmlOutput", "formatterHtmlOutputParams", "titlePrint", "titleClipboard", "titleHtmlOutput", "titleDownload"]; - - //////////////// Event Bindings ///////////////// - - - //////////////// Object Generation ///////////////// - - Column.prototype.getComponent = function () { - - if (!this.component) { - - this.component = new ColumnComponent(this); - } - - return this.component; - }; - - var RowManager = function RowManager(table) { - - this.table = table; - - this.element = this.createHolderElement(); //containing element - - this.tableElement = this.createTableElement(); //table element - - this.heightFixer = this.createTableElement(); //table element - - this.columnManager = null; //hold column manager object - - this.height = 0; //hold height of table element - - - this.firstRender = false; //handle first render - - this.renderMode = "virtual"; //current rendering mode - - this.fixedHeight = false; //current rendering mode - - - this.rows = []; //hold row data objects - - this.activeRows = []; //rows currently available to on display in the table - - this.activeRowsCount = 0; //count of active rows - - - this.displayRows = []; //rows currently on display in the table - - this.displayRowsCount = 0; //count of display rows - - - this.scrollTop = 0; - - this.scrollLeft = 0; - - this.vDomRowHeight = 20; //approximation of row heights for padding - - - this.vDomTop = 0; //hold position for first rendered row in the virtual DOM - - this.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM - - - this.vDomScrollPosTop = 0; //last scroll position of the vDom top; - - this.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom; - - - this.vDomTopPad = 0; //hold value of padding for top of virtual DOM - - this.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM - - - this.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go - - - this.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling - - - this.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows) - - this.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin - - - this.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed - - this.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed - - - this.rowNumColumn = false; //hold column component for row number column - - - this.redrawBlock = false; //prevent redraws to allow multiple data manipulations becore continuing - - this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed - - this.redrawBlockRederInPosition = false; //store latest redraw function calls for when redraw is needed - }; - - //////////////// Setup Functions ///////////////// - - - RowManager.prototype.createHolderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-tableHolder"); - - el.setAttribute("tabindex", 0); - - return el; - }; - - RowManager.prototype.createTableElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-table"); - - return el; - }; - - //return containing element - - RowManager.prototype.getElement = function () { - - return this.element; - }; - - //return table element - - RowManager.prototype.getTableElement = function () { - - return this.tableElement; - }; - - //return position of row in table - - RowManager.prototype.getRowPosition = function (row, active) { - - if (active) { - - return this.activeRows.indexOf(row); - } else { - - return this.rows.indexOf(row); - } - }; - - //link to column manager - - RowManager.prototype.setColumnManager = function (manager) { - - this.columnManager = manager; - }; - - RowManager.prototype.initialize = function () { - - var self = this; - - self.setRenderMode(); - - //initialize manager - - self.element.appendChild(self.tableElement); - - self.firstRender = true; - - //scroll header along with table body - - self.element.addEventListener("scroll", function () { - - var left = self.element.scrollLeft; - - //handle horizontal scrolling - - if (self.scrollLeft != left) { - - self.columnManager.scrollHorizontal(left); - - if (self.table.options.groupBy) { - - self.table.modules.groupRows.scrollHeaders(left); - } - - if (self.table.modExists("columnCalcs")) { - - self.table.modules.columnCalcs.scrollHorizontal(left); - } - - self.table.options.scrollHorizontal(left); - } - - self.scrollLeft = left; - }); - - //handle virtual dom scrolling - - if (this.renderMode === "virtual") { - - self.element.addEventListener("scroll", function () { - - var top = self.element.scrollTop; - - var dir = self.scrollTop > top; - - //handle verical scrolling - - if (self.scrollTop != top) { - - self.scrollTop = top; - - self.scrollVertical(dir); - - if (self.table.options.ajaxProgressiveLoad == "scroll") { - - self.table.modules.ajax.nextPage(self.element.scrollHeight - self.element.clientHeight - top); - } - - self.table.options.scrollVertical(top); - } else { - - self.scrollTop = top; - } - }); - } - }; - - ////////////////// Row Manipulation ////////////////// - - - RowManager.prototype.findRow = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Row) { - - //subject is row element - - return subject; - } else if (subject instanceof RowComponent) { - - //subject is public row component - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the row - - var match = self.rows.find(function (row) { - - return row.element === subject; - }); - - return match || false; - } - } else if (typeof subject == "undefined" || subject === null) { - - return false; - } else { - - //subject should be treated as the index of the row - - var _match = self.rows.find(function (row) { - - return row.data[self.table.options.index] == subject; - }); - - return _match || false; - } - - //catch all for any other type of input - - - return false; - }; - - RowManager.prototype.getRowFromDataObject = function (data) { - - var match = this.rows.find(function (row) { - - return row.data === data; - }); - - return match || false; - }; - - RowManager.prototype.getRowFromPosition = function (position, active) { - - if (active) { - - return this.activeRows[position]; - } else { - - return this.rows[position]; - } - }; - - RowManager.prototype.scrollToRow = function (row, position, ifVisible) { - var _this9 = this; - - var rowIndex = this.getDisplayRows().indexOf(row), - rowEl = row.getElement(), - rowTop, - offset = 0; - - return new Promise(function (resolve, reject) { - - if (rowIndex > -1) { - - if (typeof position === "undefined") { - - position = _this9.table.options.scrollToRowPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this9.table.options.scrollToRowIfVisible; - } - - if (position === "nearest") { - - switch (_this9.renderMode) { - - case "classic": - - rowTop = Tabulator.prototype.helpers.elOffset(rowEl).top; - - position = Math.abs(_this9.element.scrollTop - rowTop) > Math.abs(_this9.element.scrollTop + _this9.element.clientHeight - rowTop) ? "bottom" : "top"; - - break; - - case "virtual": - - position = Math.abs(_this9.vDomTop - rowIndex) > Math.abs(_this9.vDomBottom - rowIndex) ? "bottom" : "top"; - - break; - - } - } - - //check row visibility - - if (!ifVisible) { - - if (Tabulator.prototype.helpers.elVisible(rowEl)) { - - offset = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top; - - if (offset > 0 && offset < _this9.element.clientHeight - rowEl.offsetHeight) { - - return false; - } - } - } - - //scroll to row - - switch (_this9.renderMode) { - - case "classic": - - _this9.element.scrollTop = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top + _this9.element.scrollTop; - - break; - - case "virtual": - - _this9._virtualRenderFill(rowIndex, true); - - break; - - } - - //align to correct position - - switch (position) { - - case "middle": - - case "center": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - - _this9.element.scrollTop = _this9.element.scrollTop + (rowEl.offsetTop - _this9.element.scrollTop) - (_this9.element.scrollHeight - rowEl.offsetTop) / 2; - } else { - - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight / 2; - } - - break; - - case "bottom": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - - _this9.element.scrollTop = _this9.element.scrollTop - (_this9.element.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight; - } else { - - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight + rowEl.offsetHeight; - } - - break; - - } - - resolve(); - } else { - - console.warn("Scroll Error - Row not visible"); - - reject("Scroll Error - Row not visible"); - } - }); - }; - - ////////////////// Data Handling ////////////////// - - - RowManager.prototype.setData = function (data, renderInPosition, columnsChanged) { - var _this10 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - - if (renderInPosition && _this10.getDisplayRows().length) { - - if (self.table.options.pagination) { - - self._setDataActual(data, true); - } else { - - _this10.reRenderInPosition(function () { - - self._setDataActual(data); - }); - } - } else { - - if (_this10.table.options.autoColumns && columnsChanged) { - - _this10.table.columnManager.generateColumnsFromRowData(data); - } - - _this10.resetScroll(); - - _this10._setDataActual(data); - } - - resolve(); - }); - }; - - RowManager.prototype._setDataActual = function (data, renderInPosition) { - - var self = this; - - self.table.options.dataLoading.call(this.table, data); - - this._wipeElements(); - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.clear(); - } - - if (Array.isArray(data)) { - - if (this.table.modExists("selectRow")) { - - this.table.modules.selectRow.clearSelectionData(); - } - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - - this.table.modules.reactiveData.watchData(data); - } - - data.forEach(function (def, i) { - - if (def && (typeof def === 'undefined' ? 'undefined' : _typeof(def)) === "object") { - - var row = new Row(def, self); - - self.rows.push(row); - } else { - - console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def); - } - }); - - self.table.options.dataLoaded.call(this.table, data); - - self.refreshActiveData(false, false, renderInPosition); - } else { - - console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ", typeof data === 'undefined' ? 'undefined' : _typeof(data), "\nData: ", data); - } - }; - - RowManager.prototype._wipeElements = function () { - - this.rows.forEach(function (row) { - - row.wipe(); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.wipe(); - } - - this.rows = []; - }; - - RowManager.prototype.deleteRow = function (row, blockRedraw) { - - var allIndex = this.rows.indexOf(row), - activeIndex = this.activeRows.indexOf(row); - - if (activeIndex > -1) { - - this.activeRows.splice(activeIndex, 1); - } - - if (allIndex > -1) { - - this.rows.splice(allIndex, 1); - } - - this.setActiveRows(this.activeRows); - - this.displayRowIterator(function (rows) { - - var displayIndex = rows.indexOf(row); - - if (displayIndex > -1) { - - rows.splice(displayIndex, 1); - } - }); - - if (!blockRedraw) { - - this.reRenderInPosition(); - } - - this.regenerateRowNumbers(); - - this.table.options.rowDeleted.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.updateGroupRows(true); - } else if (this.table.options.pagination && this.table.modExists("page")) { - - this.refreshActiveData(false, false, true); - } else { - - if (this.table.options.pagination && this.table.modExists("page")) { - - this.refreshActiveData("page"); - } - } - }; - - RowManager.prototype.addRow = function (data, pos, index, blockRedraw) { - - var row = this.addRowActual(data, pos, index, blockRedraw); - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("rowAdd", row, { data: data, pos: pos, index: index }); - } - - return row; - }; - - //add multiple rows - - RowManager.prototype.addRows = function (data, pos, index) { - var _this11 = this; - - var self = this, - length = 0, - rows = []; - - return new Promise(function (resolve, reject) { - - pos = _this11.findAddRowPos(pos); - - if (!Array.isArray(data)) { - - data = [data]; - } - - length = data.length - 1; - - if (typeof index == "undefined" && pos || typeof index !== "undefined" && !pos) { - - data.reverse(); - } - - data.forEach(function (item, i) { - - var row = self.addRow(item, pos, index, true); - - rows.push(row); - }); - - if (_this11.table.options.groupBy && _this11.table.modExists("groupRows")) { - - _this11.table.modules.groupRows.updateGroupRows(true); - } else if (_this11.table.options.pagination && _this11.table.modExists("page")) { - - _this11.refreshActiveData(false, false, true); - } else { - - _this11.reRenderInPosition(); - } - - //recalc column calculations if present - - if (_this11.table.modExists("columnCalcs")) { - - _this11.table.modules.columnCalcs.recalc(_this11.table.rowManager.activeRows); - } - - _this11.regenerateRowNumbers(); - - resolve(rows); - }); - }; - - RowManager.prototype.findAddRowPos = function (pos) { - - if (typeof pos === "undefined") { - - pos = this.table.options.addRowPos; - } - - if (pos === "pos") { - - pos = true; - } - - if (pos === "bottom") { - - pos = false; - } - - return pos; - }; - - RowManager.prototype.addRowActual = function (data, pos, index, blockRedraw) { - - var row = data instanceof Row ? data : new Row(data || {}, this), - top = this.findAddRowPos(pos), - allIndex = -1, - activeIndex, - dispRows; - - if (!index && this.table.options.pagination && this.table.options.paginationAddRow == "page") { - - dispRows = this.getDisplayRows(); - - if (top) { - - if (dispRows.length) { - - index = dispRows[0]; - } else { - - if (this.activeRows.length) { - - index = this.activeRows[this.activeRows.length - 1]; - - top = false; - } - } - } else { - - if (dispRows.length) { - - index = dispRows[dispRows.length - 1]; - - top = dispRows.length < this.table.modules.page.getPageSize() ? false : true; - } - } - } - - if (typeof index !== "undefined") { - - index = this.findRow(index); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.assignRowToGroup(row); - - var groupRows = row.getGroup().rows; - - if (groupRows.length > 1) { - - if (!index || index && groupRows.indexOf(index) == -1) { - - if (top) { - - if (groupRows[0] !== row) { - - index = groupRows[0]; - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } else { - - if (groupRows[groupRows.length - 1] !== row) { - - index = groupRows[groupRows.length - 1]; - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } else { - - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } - - if (index) { - - allIndex = this.rows.indexOf(index); - } - - if (index && allIndex > -1) { - - activeIndex = this.activeRows.indexOf(index); - - this.displayRowIterator(function (rows) { - - var displayIndex = rows.indexOf(index); - - if (displayIndex > -1) { - - rows.splice(top ? displayIndex : displayIndex + 1, 0, row); - } - }); - - if (activeIndex > -1) { - - this.activeRows.splice(top ? activeIndex : activeIndex + 1, 0, row); - } - - this.rows.splice(top ? allIndex : allIndex + 1, 0, row); - } else { - - if (top) { - - this.displayRowIterator(function (rows) { - - rows.unshift(row); - }); - - this.activeRows.unshift(row); - - this.rows.unshift(row); - } else { - - this.displayRowIterator(function (rows) { - - rows.push(row); - }); - - this.activeRows.push(row); - - this.rows.push(row); - } - } - - this.setActiveRows(this.activeRows); - - this.table.options.rowAdded.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (!blockRedraw) { - - this.reRenderInPosition(); - } - - return row; - }; - - RowManager.prototype.moveRow = function (from, to, after) { - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("rowMove", from, { posFrom: this.getRowPosition(from), posTo: this.getRowPosition(to), to: to, after: after }); - } - - this.moveRowActual(from, to, after); - - this.regenerateRowNumbers(); - - this.table.options.rowMoved.call(this.table, from.getComponent()); - }; - - RowManager.prototype.moveRowActual = function (from, to, after) { - var _this12 = this; - - this._moveRowInArray(this.rows, from, to, after); - - this._moveRowInArray(this.activeRows, from, to, after); - - this.displayRowIterator(function (rows) { - - _this12._moveRowInArray(rows, from, to, after); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (!after && to instanceof Group) { - - to = this.table.rowManager.prevDisplayRow(from) || to; - } - - var toGroup = to.getGroup(); - - var fromGroup = from.getGroup(); - - if (toGroup === fromGroup) { - - this._moveRowInArray(toGroup.rows, from, to, after); - } else { - - if (fromGroup) { - - fromGroup.removeRow(from); - } - - toGroup.insertRow(from, to, after); - } - } - }; - - RowManager.prototype._moveRowInArray = function (rows, from, to, after) { - - var fromIndex, toIndex, start, end; - - if (from !== to) { - - fromIndex = rows.indexOf(from); - - if (fromIndex > -1) { - - rows.splice(fromIndex, 1); - - toIndex = rows.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - rows.splice(toIndex + 1, 0, from); - } else { - - rows.splice(toIndex, 0, from); - } - } else { - - rows.splice(fromIndex, 0, from); - } - } - - //restyle rows - - if (rows === this.getDisplayRows()) { - - start = fromIndex < toIndex ? fromIndex : toIndex; - - end = toIndex > fromIndex ? toIndex : fromIndex + 1; - - for (var _i4 = start; _i4 <= end; _i4++) { - - if (rows[_i4]) { - - this.styleRow(rows[_i4], _i4); - } - } - } - } - }; - - RowManager.prototype.clearData = function () { - - this.setData([]); - }; - - RowManager.prototype.getRowIndex = function (row) { - - return this.findRowIndex(row, this.rows); - }; - - RowManager.prototype.getDisplayRowIndex = function (row) { - - var index = this.getDisplayRows().indexOf(row); - - return index > -1 ? index : false; - }; - - RowManager.prototype.nextDisplayRow = function (row, rowOnly) { - - var index = this.getDisplayRowIndex(row), - nextRow = false; - - if (index !== false && index < this.displayRowsCount - 1) { - - nextRow = this.getDisplayRows()[index + 1]; - } - - if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) { - - return this.nextDisplayRow(nextRow, rowOnly); - } - - return nextRow; - }; - - RowManager.prototype.prevDisplayRow = function (row, rowOnly) { - - var index = this.getDisplayRowIndex(row), - prevRow = false; - - if (index) { - - prevRow = this.getDisplayRows()[index - 1]; - } - - if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) { - - return this.prevDisplayRow(prevRow, rowOnly); - } - - return prevRow; - }; - - RowManager.prototype.findRowIndex = function (row, list) { - - var rowIndex; - - row = this.findRow(row); - - if (row) { - - rowIndex = list.indexOf(row); - - if (rowIndex > -1) { - - return rowIndex; - } - } - - return false; - }; - - RowManager.prototype.getData = function (active, transform) { - - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - - if (row.type == "row") { - - output.push(row.getData(transform || "data")); - } - }); - - return output; - }; - - RowManager.prototype.getComponents = function (active) { - - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - - output.push(row.getComponent()); - }); - - return output; - }; - - RowManager.prototype.getDataCount = function (active) { - - var rows = this.getRows(active); - - return rows.length; - }; - - RowManager.prototype._genRemoteRequest = function () { - var _this13 = this; - - var table = this.table, - options = table.options, - params = {}; - - if (table.modExists("page")) { - - //set sort data if defined - - if (options.ajaxSorting) { - - var sorters = this.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - - delete item.column; - }); - - params[this.table.modules.page.paginationDataSentNames.sorters] = sorters; - } - - //set filter data if defined - - if (options.ajaxFiltering) { - - var filters = this.table.modules.filter.getFilters(true, true); - - params[this.table.modules.page.paginationDataSentNames.filters] = filters; - } - - this.table.modules.ajax.setParams(params, true); - } - - table.modules.ajax.sendRequest().then(function (data) { - - _this13._setDataActual(data, true); - }).catch(function (e) {}); - }; - - //choose the path to refresh data after a filter update - - RowManager.prototype.filterRefresh = function () { - - var table = this.table, - options = table.options, - left = this.scrollLeft; - - if (options.ajaxFiltering) { - - if (options.pagination == "remote" && table.modExists("page")) { - - table.modules.page.reset(true); - - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - - //assume data is url, make ajax call to url to get data - - this._genRemoteRequest(); - } - } else { - - this.refreshActiveData("filter"); - } - - this.scrollHorizontal(left); - }; - - //choose the path to refresh data after a sorter update - - RowManager.prototype.sorterRefresh = function (loadOrignalData) { - - var table = this.table, - options = this.table.options, - left = this.scrollLeft; - - if (options.ajaxSorting) { - - if ((options.pagination == "remote" || options.progressiveLoad) && table.modExists("page")) { - - table.modules.page.reset(true); - - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - - //assume data is url, make ajax call to url to get data - - this._genRemoteRequest(); - } - } else { - - this.refreshActiveData(loadOrignalData ? "filter" : "sort"); - } - - this.scrollHorizontal(left); - }; - - RowManager.prototype.scrollHorizontal = function (left) { - - this.scrollLeft = left; - - this.element.scrollLeft = left; - - if (this.table.options.groupBy) { - - this.table.modules.groupRows.scrollHeaders(left); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.scrollHorizontal(left); - } - }; - - //set active data set - - RowManager.prototype.refreshActiveData = function (stage, skipStage, renderInPosition) { - - var self = this, - table = this.table, - cascadeOrder = ["all", "filter", "sort", "display", "freeze", "group", "tree", "page"], - displayIndex; - - if (this.redrawBlock) { - - if (!this.redrawBlockRestoreConfig || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage)) { - - this.redrawBlockRestoreConfig = { - - stage: stage, - - skipStage: skipStage, - - renderInPosition: renderInPosition - - }; - } - - return; - } else { - - if (self.table.modExists("edit")) { - - self.table.modules.edit.cancelEdit(); - } - - if (!stage) { - - stage = "all"; - } - - if (table.options.selectable && !table.options.selectablePersistence && table.modExists("selectRow")) { - - table.modules.selectRow.deselectRows(); - } - - //cascade through data refresh stages - - switch (stage) { - - case "all": - - case "filter": - - if (!skipStage) { - - if (table.modExists("filter")) { - - self.setActiveRows(table.modules.filter.filter(self.rows)); - } else { - - self.setActiveRows(self.rows.slice(0)); - } - } else { - - skipStage = false; - } - - case "sort": - - if (!skipStage) { - - if (table.modExists("sort")) { - - table.modules.sort.sort(this.activeRows); - } - } else { - - skipStage = false; - } - - //regenerate row numbers for row number formatter if in use - - this.regenerateRowNumbers(); - - //generic stage to allow for pipeline trigger after the data manipulation stage - - case "display": - - this.resetDisplayRows(); - - case "freeze": - - if (!skipStage) { - - if (this.table.modExists("frozenRows")) { - - if (table.modules.frozenRows.isFrozen()) { - - if (!table.modules.frozenRows.getDisplayIndex()) { - - table.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.frozenRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.frozenRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.frozenRows.setDisplayIndex(displayIndex); - } - } - } - } else { - - skipStage = false; - } - - case "group": - - if (!skipStage) { - - if (table.options.groupBy && table.modExists("groupRows")) { - - if (!table.modules.groupRows.getDisplayIndex()) { - - table.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.groupRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.groupRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.groupRows.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - case "tree": - - if (!skipStage) { - - if (table.options.dataTree && table.modExists("dataTree")) { - - if (!table.modules.dataTree.getDisplayIndex()) { - - table.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.dataTree.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.dataTree.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.dataTree.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - if (table.options.pagination && table.modExists("page") && !renderInPosition) { - - if (table.modules.page.getMode() == "local") { - - table.modules.page.reset(); - } - } - - case "page": - - if (!skipStage) { - - if (table.options.pagination && table.modExists("page")) { - - if (!table.modules.page.getDisplayIndex()) { - - table.modules.page.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.page.getDisplayIndex(); - - if (table.modules.page.getMode() == "local") { - - table.modules.page.setMaxRows(this.getDisplayRows(displayIndex - 1).length); - } - - displayIndex = self.setDisplayRows(table.modules.page.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - - table.modules.page.setDisplayIndex(displayIndex); - } - } - } else { - - skipStage = false; - } - - } - - if (Tabulator.prototype.helpers.elVisible(self.element)) { - - if (renderInPosition) { - - self.reRenderInPosition(); - } else { - - self.renderTable(); - - if (table.options.layoutColumnsOnNewData) { - - self.table.columnManager.redraw(true); - } - } - } - - if (table.modExists("columnCalcs")) { - - table.modules.columnCalcs.recalc(this.activeRows); - } - } - }; - - //regenerate row numbers for row number formatter if in use - - RowManager.prototype.regenerateRowNumbers = function () { - var _this14 = this; - - if (this.rowNumColumn) { - - this.activeRows.forEach(function (row) { - - var cell = row.getCell(_this14.rowNumColumn); - - if (cell) { - - cell._generateContents(); - } - }); - } - }; - - RowManager.prototype.setActiveRows = function (activeRows) { - - this.activeRows = activeRows; - - this.activeRowsCount = this.activeRows.length; - }; - - //reset display rows array - - RowManager.prototype.resetDisplayRows = function () { - - this.displayRows = []; - - this.displayRows.push(this.activeRows.slice(0)); - - this.displayRowsCount = this.displayRows[0].length; - - if (this.table.modExists("frozenRows")) { - - this.table.modules.frozenRows.setDisplayIndex(0); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.groupRows.setDisplayIndex(0); - } - - if (this.table.options.pagination && this.table.modExists("page")) { - - this.table.modules.page.setDisplayIndex(0); - } - }; - - RowManager.prototype.getNextDisplayIndex = function () { - - return this.displayRows.length; - }; - - //set display row pipeline data - - RowManager.prototype.setDisplayRows = function (displayRows, index) { - - var output = true; - - if (index && typeof this.displayRows[index] != "undefined") { - - this.displayRows[index] = displayRows; - - output = true; - } else { - - this.displayRows.push(displayRows); - - output = index = this.displayRows.length - 1; - } - - if (index == this.displayRows.length - 1) { - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - } - - return output; - }; - - RowManager.prototype.getDisplayRows = function (index) { - - if (typeof index == "undefined") { - - return this.displayRows.length ? this.displayRows[this.displayRows.length - 1] : []; - } else { - - return this.displayRows[index] || []; - } - }; - - RowManager.prototype.getVisibleRows = function (viewable) { - - var topEdge = this.element.scrollTop, - bottomEdge = this.element.clientHeight + topEdge, - topFound = false, - topRow = 0, - bottomRow = 0, - rows = this.getDisplayRows(); - - if (viewable) { - - this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - - if (!topFound) { - - if (topEdge - rows[i].getElement().offsetTop >= 0) { - - topRow = i; - } else { - - topFound = true; - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - - bottomRow = i; - } else { - - break; - } - } - } else { - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - - bottomRow = i; - } else { - - break; - } - } - } - } - } else { - - topRow = this.vDomTop; - - bottomRow = this.vDomBottom; - } - - return rows.slice(topRow, bottomRow + 1); - }; - - //repeat action accross display rows - - RowManager.prototype.displayRowIterator = function (callback) { - - this.displayRows.forEach(callback); - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - }; - - //return only actual rows (not group headers etc) - - RowManager.prototype.getRows = function (active) { - - var rows; - - switch (active) { - - case "active": - - rows = this.activeRows; - - break; - - case "display": - - rows = this.table.rowManager.getDisplayRows(); - - break; - - case "visible": - - rows = this.getVisibleRows(true); - - break; - - default: - - rows = this.rows; - - } - - return rows; - }; - - ///////////////// Table Rendering ///////////////// - - - //trigger rerender of table in current position - - RowManager.prototype.reRenderInPosition = function (callback) { - - if (this.getRenderMode() == "virtual") { - - if (this.redrawBlock) { - - if (callback) { - - callback(); - } else { - - this.redrawBlockRederInPosition = true; - } - } else { - - var scrollTop = this.element.scrollTop; - - var topRow = false; - - var topOffset = false; - - var left = this.scrollLeft; - - var rows = this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - - var diff = scrollTop - rows[i].getElement().offsetTop; - - if (topOffset === false || Math.abs(diff) < topOffset) { - - topOffset = diff; - - topRow = i; - } else { - - break; - } - } - } - - if (callback) { - - callback(); - } - - this._virtualRenderFill(topRow === false ? this.displayRowsCount - 1 : topRow, true, topOffset || 0); - - this.scrollHorizontal(left); - } - } else { - - this.renderTable(); - - if (callback) { - - callback(); - } - } - }; - - RowManager.prototype.setRenderMode = function () { - - if (this.table.options.virtualDom) { - - this.renderMode = "virtual"; - - if (this.table.element.clientHeight || this.table.options.height) { - - this.fixedHeight = true; - } else { - - this.fixedHeight = false; - } - } else { - - this.renderMode = "classic"; - } - }; - - RowManager.prototype.getRenderMode = function () { - - return this.renderMode; - }; - - RowManager.prototype.renderTable = function () { - - this.table.options.renderStarted.call(this.table); - - this.element.scrollTop = 0; - - switch (this.renderMode) { - - case "classic": - - this._simpleRender(); - - break; - - case "virtual": - - this._virtualRenderFill(); - - break; - - } - - if (this.firstRender) { - - if (this.displayRowsCount) { - - this.firstRender = false; - - this.table.modules.layout.layout(); - } else { - - this.renderEmptyScroll(); - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (!this.displayRowsCount) { - - if (this.table.options.placeholder) { - - this.table.options.placeholder.setAttribute("tabulator-render-mode", this.renderMode); - - this.getElement().appendChild(this.table.options.placeholder); - - this.table.options.placeholder.style.width = this.table.columnManager.getWidth() + "px"; - } - } - - this.table.options.renderComplete.call(this.table); - }; - - //simple render on heightless table - - RowManager.prototype._simpleRender = function () { - - this._clearVirtualDom(); - - if (this.displayRowsCount) { - - this.checkClassicModeGroupHeaderWidth(); - } else { - - this.renderEmptyScroll(); - } - }; - - RowManager.prototype.checkClassicModeGroupHeaderWidth = function () { - - var self = this, - element = this.tableElement, - onlyGroupHeaders = true; - - self.getDisplayRows().forEach(function (row, index) { - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - - row.initialize(true); - - if (row.type !== "group") { - - onlyGroupHeaders = false; - } - }); - - if (onlyGroupHeaders) { - - element.style.minWidth = self.table.columnManager.getWidth() + "px"; - } else { - - element.style.minWidth = ""; - } - }; - - //show scrollbars on empty table div - - RowManager.prototype.renderEmptyScroll = function () { - - if (this.table.options.placeholder) { - - this.tableElement.style.display = "none"; - } else { - - this.tableElement.style.minWidth = this.table.columnManager.getWidth() + "px"; - - this.tableElement.style.minHeight = "1px"; - - this.tableElement.style.visibility = "hidden"; - } - }; - - RowManager.prototype._clearVirtualDom = function () { - - var element = this.tableElement; - - if (this.table.options.placeholder && this.table.options.placeholder.parentNode) { - - this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder); - } - - // element.children.detach(); - - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.style.paddingTop = ""; - - element.style.paddingBottom = ""; - - element.style.minWidth = ""; - - element.style.minHeight = ""; - - element.style.display = ""; - - element.style.visibility = ""; - - this.scrollTop = 0; - - this.scrollLeft = 0; - - this.vDomTop = 0; - - this.vDomBottom = 0; - - this.vDomTopPad = 0; - - this.vDomBottomPad = 0; - }; - - RowManager.prototype.styleRow = function (row, index) { - - var rowEl = row.getElement(); - - if (index % 2) { - - rowEl.classList.add("tabulator-row-even"); - - rowEl.classList.remove("tabulator-row-odd"); - } else { - - rowEl.classList.add("tabulator-row-odd"); - - rowEl.classList.remove("tabulator-row-even"); - } - }; - - //full virtual render - - RowManager.prototype._virtualRenderFill = function (position, forceMove, offset) { - - var self = this, - element = self.tableElement, - holder = self.element, - topPad = 0, - rowsHeight = 0, - topPadHeight = 0, - i = 0, - onlyGroupHeaders = true, - rows = self.getDisplayRows(); - - position = position || 0; - - offset = offset || 0; - - if (!position) { - - self._clearVirtualDom(); - } else { - - while (element.firstChild) { - element.removeChild(element.firstChild); - } //check if position is too close to bottom of table - - var heightOccupied = (self.displayRowsCount - position + 1) * self.vDomRowHeight; - - if (heightOccupied < self.height) { - - position -= Math.ceil((self.height - heightOccupied) / self.vDomRowHeight); - - if (position < 0) { - - position = 0; - } - } - - //calculate initial pad - - topPad = Math.min(Math.max(Math.floor(self.vDomWindowBuffer / self.vDomRowHeight), self.vDomWindowMinMarginRows), position); - - position -= topPad; - } - - if (self.displayRowsCount && Tabulator.prototype.helpers.elVisible(self.element)) { - - self.vDomTop = position; - - self.vDomBottom = position - 1; - - while ((rowsHeight <= self.height + self.vDomWindowBuffer || i < self.vDomWindowMinTotalRows) && self.vDomBottom < self.displayRowsCount - 1) { - - var index = self.vDomBottom + 1, - row = rows[index], - rowHeight = 0; - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - - if (!row.initialized) { - - row.initialize(true); - } else { - - if (!row.heightInitialized) { - - row.normalizeHeight(true); - } - } - - rowHeight = row.getHeight(); - - if (i < topPad) { - - topPadHeight += rowHeight; - } else { - - rowsHeight += rowHeight; - } - - if (rowHeight > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = rowHeight * 2; - } - - if (row.type !== "group") { - - onlyGroupHeaders = false; - } - - self.vDomBottom++; - - i++; - } - - if (!position) { - - this.vDomTopPad = 0; - - //adjust rowheight to match average of rendered elements - - self.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i); - - self.vDomBottomPad = self.vDomRowHeight * (self.displayRowsCount - self.vDomBottom - 1); - - self.vDomScrollHeight = topPadHeight + rowsHeight + self.vDomBottomPad - self.height; - } else { - - self.vDomTopPad = !forceMove ? self.scrollTop - topPadHeight : self.vDomRowHeight * this.vDomTop + offset; - - self.vDomBottomPad = self.vDomBottom == self.displayRowsCount - 1 ? 0 : Math.max(self.vDomScrollHeight - self.vDomTopPad - rowsHeight - topPadHeight, 0); - } - - element.style.paddingTop = self.vDomTopPad + "px"; - - element.style.paddingBottom = self.vDomBottomPad + "px"; - - if (forceMove) { - - this.scrollTop = self.vDomTopPad + topPadHeight + offset - (this.element.scrollWidth > this.element.clientWidth ? this.element.offsetHeight - this.element.clientHeight : 0); - } - - this.scrollTop = Math.min(this.scrollTop, this.element.scrollHeight - this.height); - - //adjust for horizontal scrollbar if present (and not at top of table) - - if (this.element.scrollWidth > this.element.offsetWidth && forceMove) { - - this.scrollTop += this.element.offsetHeight - this.element.clientHeight; - } - - this.vDomScrollPosTop = this.scrollTop; - - this.vDomScrollPosBottom = this.scrollTop; - - holder.scrollTop = this.scrollTop; - - element.style.minWidth = onlyGroupHeaders ? self.table.columnManager.getWidth() + "px" : ""; - - if (self.table.options.groupBy) { - - if (self.table.modules.layout.getMode() != "fitDataFill" && self.displayRowsCount == self.table.modules.groupRows.countGroups()) { - - self.tableElement.style.minWidth = self.table.columnManager.getWidth(); - } - } - } else { - - this.renderEmptyScroll(); - } - - if (!this.fixedHeight) { - - this.adjustTableSize(); - } - }; - - //handle vertical scrolling - - RowManager.prototype.scrollVertical = function (dir) { - - var topDiff = this.scrollTop - this.vDomScrollPosTop; - - var bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - var margin = this.vDomWindowBuffer * 2; - - if (-topDiff > margin || bottomDiff > margin) { - - //if big scroll redraw table; - - var left = this.scrollLeft; - - this._virtualRenderFill(Math.floor(this.element.scrollTop / this.element.scrollHeight * this.displayRowsCount)); - - this.scrollHorizontal(left); - } else { - - if (dir) { - - //scrolling up - - if (topDiff < 0) { - - this._addTopRow(-topDiff); - } - - if (bottomDiff < 0) { - - //hide bottom row if needed - - if (this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer) { - - this._removeBottomRow(-bottomDiff); - } else { - - this.vDomScrollPosBottom = this.scrollTop; - } - } - } else { - - //scrolling down - - if (topDiff >= 0) { - - //hide top row if needed - - if (this.scrollTop > this.vDomWindowBuffer) { - - this._removeTopRow(topDiff); - } else { - - this.vDomScrollPosTop = this.scrollTop; - } - } - - if (bottomDiff >= 0) { - - this._addBottomRow(bottomDiff); - } - } - } - }; - - RowManager.prototype._addTopRow = function (topDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomTop) { - - var index = this.vDomTop - 1, - topRow = rows[index], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - //hide top row if needed - - if (topDiff >= topRowHeight) { - - this.styleRow(topRow, index); - - table.insertBefore(topRow.getElement(), table.firstChild); - - if (!topRow.initialized || !topRow.heightInitialized) { - - this.vDomTopNewRows.push(topRow); - - if (!topRow.heightInitialized) { - - topRow.clearCellHeight(); - } - } - - topRow.initialize(); - - this.vDomTopPad -= topRowHeight; - - if (this.vDomTopPad < 0) { - - this.vDomTopPad = index * this.vDomRowHeight; - } - - if (!index) { - - this.vDomTopPad = 0; - } - - table.style.paddingTop = this.vDomTopPad + "px"; - - this.vDomScrollPosTop -= topRowHeight; - - this.vDomTop--; - } - - topDiff = -(this.scrollTop - this.vDomScrollPosTop); - - if (topRow.getHeight() > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = topRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomTop && topDiff >= (rows[this.vDomTop - 1].getHeight() || this.vDomRowHeight)) { - - this._addTopRow(topDiff, i + 1); - } else { - - this._quickNormalizeRowHeight(this.vDomTopNewRows); - } - } - }; - - RowManager.prototype._removeTopRow = function (topDiff) { - - var table = this.tableElement, - topRow = this.getDisplayRows()[this.vDomTop], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - if (topDiff >= topRowHeight) { - - var rowEl = topRow.getElement(); - - rowEl.parentNode.removeChild(rowEl); - - this.vDomTopPad += topRowHeight; - - table.style.paddingTop = this.vDomTopPad + "px"; - - this.vDomScrollPosTop += this.vDomTop ? topRowHeight : topRowHeight + this.vDomWindowBuffer; - - this.vDomTop++; - - topDiff = this.scrollTop - this.vDomScrollPosTop; - - this._removeTopRow(topDiff); - } - }; - - RowManager.prototype._addBottomRow = function (bottomDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomBottom < this.displayRowsCount - 1) { - - var index = this.vDomBottom + 1, - bottomRow = rows[index], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - //hide bottom row if needed - - if (bottomDiff >= bottomRowHeight) { - - this.styleRow(bottomRow, index); - - table.appendChild(bottomRow.getElement()); - - if (!bottomRow.initialized || !bottomRow.heightInitialized) { - - this.vDomBottomNewRows.push(bottomRow); - - if (!bottomRow.heightInitialized) { - - bottomRow.clearCellHeight(); - } - } - - bottomRow.initialize(); - - this.vDomBottomPad -= bottomRowHeight; - - if (this.vDomBottomPad < 0 || index == this.displayRowsCount - 1) { - - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - - this.vDomScrollPosBottom += bottomRowHeight; - - this.vDomBottom++; - } - - bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - if (bottomRow.getHeight() > this.vDomWindowBuffer) { - - this.vDomWindowBuffer = bottomRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomBottom < this.displayRowsCount - 1 && bottomDiff >= (rows[this.vDomBottom + 1].getHeight() || this.vDomRowHeight)) { - - this._addBottomRow(bottomDiff, i + 1); - } else { - - this._quickNormalizeRowHeight(this.vDomBottomNewRows); - } - } - }; - - RowManager.prototype._removeBottomRow = function (bottomDiff) { - - var table = this.tableElement, - bottomRow = this.getDisplayRows()[this.vDomBottom], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - if (bottomDiff >= bottomRowHeight) { - - var rowEl = bottomRow.getElement(); - - if (rowEl.parentNode) { - - rowEl.parentNode.removeChild(rowEl); - } - - this.vDomBottomPad += bottomRowHeight; - - if (this.vDomBottomPad < 0) { - - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - - this.vDomScrollPosBottom -= bottomRowHeight; - - this.vDomBottom--; - - bottomDiff = -(this.scrollTop - this.vDomScrollPosBottom); - - this._removeBottomRow(bottomDiff); - } - }; - - RowManager.prototype._quickNormalizeRowHeight = function (rows) { - - rows.forEach(function (row) { - - row.calcHeight(); - }); - - rows.forEach(function (row) { - - row.setCellHeight(); - }); - - rows.length = 0; - }; - - //normalize height of active rows - - RowManager.prototype.normalizeHeight = function () { - - this.activeRows.forEach(function (row) { - - row.normalizeHeight(); - }); - }; - - //adjust the height of the table holder to fit in the Tabulator element - - RowManager.prototype.adjustTableSize = function () { - - var initialHeight = this.element.clientHeight, - modExists; - - if (this.renderMode === "virtual") { - - var otherHeight = this.columnManager.getElement().offsetHeight + (this.table.footerManager && !this.table.footerManager.external ? this.table.footerManager.getElement().offsetHeight : 0); - - if (this.fixedHeight) { - - this.element.style.minHeight = "calc(100% - " + otherHeight + "px)"; - - this.element.style.height = "calc(100% - " + otherHeight + "px)"; - - this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)"; - } else { - - this.element.style.height = ""; - - this.element.style.height = this.table.element.clientHeight - otherHeight + "px"; - - this.element.scrollTop = this.scrollTop; - } - - this.height = this.element.clientHeight; - - this.vDomWindowBuffer = this.table.options.virtualDomBuffer || this.height; - - //check if the table has changed size when dealing with variable height tables - - if (!this.fixedHeight && initialHeight != this.element.clientHeight) { - - modExists = this.table.modExists("resizeTable"); - - if (modExists && !this.table.modules.resizeTable.autoResize || !modExists) { - - this.redraw(); - } - } - } - }; - - //renitialize all rows - - RowManager.prototype.reinitialize = function () { - - this.rows.forEach(function (row) { - - row.reinitialize(); - }); - }; - - //prevent table from being redrawn - - RowManager.prototype.blockRedraw = function () { - - this.redrawBlock = true; - - this.redrawBlockRestoreConfig = false; - }; - - //restore table redrawing - - RowManager.prototype.restoreRedraw = function () { - - this.redrawBlock = false; - - if (this.redrawBlockRestoreConfig) { - - this.refreshActiveData(this.redrawBlockRestoreConfig.stage, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition); - - this.redrawBlockRestoreConfig = false; - } else { - - if (this.redrawBlockRederInPosition) { - - this.reRenderInPosition(); - } - } - - this.redrawBlockRederInPosition = false; - }; - - //redraw table - - RowManager.prototype.redraw = function (force) { - - var pos = 0, - left = this.scrollLeft; - - this.adjustTableSize(); - - this.table.tableWidth = this.table.element.clientWidth; - - if (!force) { - - if (this.renderMode == "classic") { - - if (this.table.options.groupBy) { - - this.refreshActiveData("group", false, false); - } else { - - this._simpleRender(); - } - } else { - - this.reRenderInPosition(); - - this.scrollHorizontal(left); - } - - if (!this.displayRowsCount) { - - if (this.table.options.placeholder) { - - this.getElement().appendChild(this.table.options.placeholder); - } - } - } else { - - this.renderTable(); - } - }; - - RowManager.prototype.resetScroll = function () { - - this.element.scrollLeft = 0; - - this.element.scrollTop = 0; - - if (this.table.browser === "ie") { - - var event = document.createEvent("Event"); - - event.initEvent("scroll", false, true); - - this.element.dispatchEvent(event); - } else { - - this.element.dispatchEvent(new Event('scroll')); - } - }; - - //public row object - - var RowComponent = function RowComponent(row) { - - this._row = row; - }; - - RowComponent.prototype.getData = function (transform) { - - return this._row.getData(transform); - }; - - RowComponent.prototype.getElement = function () { - - return this._row.getElement(); - }; - - RowComponent.prototype.getCells = function () { - - var cells = []; - - this._row.getCells().forEach(function (cell) { - - cells.push(cell.getComponent()); - }); - - return cells; - }; - - RowComponent.prototype.getCell = function (column) { - - var cell = this._row.getCell(column); - - return cell ? cell.getComponent() : false; - }; - - RowComponent.prototype.getIndex = function () { - - return this._row.getData("data")[this._row.table.options.index]; - }; - - RowComponent.prototype.getPosition = function (active) { - - return this._row.table.rowManager.getRowPosition(this._row, active); - }; - - RowComponent.prototype.delete = function () { - - return this._row.delete(); - }; - - RowComponent.prototype.scrollTo = function () { - - return this._row.table.rowManager.scrollToRow(this._row); - }; - - RowComponent.prototype.pageTo = function () { - - if (this._row.table.modExists("page", true)) { - - return this._row.table.modules.page.setPageToRow(this._row); - } - }; - - RowComponent.prototype.move = function (to, after) { - - this._row.moveToRow(to, after); - }; - - RowComponent.prototype.update = function (data) { - - return this._row.updateData(data); - }; - - RowComponent.prototype.normalizeHeight = function () { - - this._row.normalizeHeight(true); - }; - - RowComponent.prototype.select = function () { - - this._row.table.modules.selectRow.selectRows(this._row); - }; - - RowComponent.prototype.deselect = function () { - - this._row.table.modules.selectRow.deselectRows(this._row); - }; - - RowComponent.prototype.toggleSelect = function () { - - this._row.table.modules.selectRow.toggleRow(this._row); - }; - - RowComponent.prototype.isSelected = function () { - - return this._row.table.modules.selectRow.isRowSelected(this._row); - }; - - RowComponent.prototype._getSelf = function () { - - return this._row; - }; - - RowComponent.prototype.validate = function () { - - return this._row.validate(); - }; - - RowComponent.prototype.freeze = function () { - - if (this._row.table.modExists("frozenRows", true)) { - - this._row.table.modules.frozenRows.freezeRow(this._row); - } - }; - - RowComponent.prototype.unfreeze = function () { - - if (this._row.table.modExists("frozenRows", true)) { - - this._row.table.modules.frozenRows.unfreezeRow(this._row); - } - }; - - RowComponent.prototype.isFrozen = function () { - - if (this._row.table.modExists("frozenRows", true)) { - - var index = this._row.table.modules.frozenRows.rows.indexOf(this._row); - - return index > -1; - } - - return false; - }; - - RowComponent.prototype.treeCollapse = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.collapseRow(this._row); - } - }; - - RowComponent.prototype.treeExpand = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.expandRow(this._row); - } - }; - - RowComponent.prototype.treeToggle = function () { - - if (this._row.table.modExists("dataTree", true)) { - - this._row.table.modules.dataTree.toggleRow(this._row); - } - }; - - RowComponent.prototype.getTreeParent = function () { - - if (this._row.table.modExists("dataTree", true)) { - - return this._row.table.modules.dataTree.getTreeParent(this._row); - } - - return false; - }; - - RowComponent.prototype.getTreeChildren = function () { - - if (this._row.table.modExists("dataTree", true)) { - - return this._row.table.modules.dataTree.getTreeChildren(this._row); - } - - return false; - }; - - RowComponent.prototype.addTreeChild = function (data, pos, index) { - - if (this._row.table.modExists("dataTree", true)) { - - return this._row.table.modules.dataTree.addTreeChildRow(this._row, data, pos, index); - } - - return false; - }; - - RowComponent.prototype.reformat = function () { - - return this._row.reinitialize(); - }; - - RowComponent.prototype.getGroup = function () { - - return this._row.getGroup().getComponent(); - }; - - RowComponent.prototype.getTable = function () { - - return this._row.table; - }; - - RowComponent.prototype.getNextRow = function () { - - var row = this._row.nextRow(); - - return row ? row.getComponent() : row; - }; - - RowComponent.prototype.getPrevRow = function () { - - var row = this._row.prevRow(); - - return row ? row.getComponent() : row; - }; - - var Row = function Row(data, parent) { - var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "row"; - - - this.table = parent.table; - - this.parent = parent; - - this.data = {}; - - this.type = type; //type of element - - this.element = this.createElement(); - - this.modules = {}; //hold module variables; - - this.cells = []; - - this.height = 0; //hold element height - - this.heightStyled = ""; //hold element height prestyled to improve render efficiency - - this.manualHeight = false; //user has manually set row height - - this.outerHeight = 0; //holde lements outer height - - this.initialized = false; //element has been rendered - - this.heightInitialized = false; //element has resized cells to fit - - - this.component = null; - - this.setData(data); - - this.generateElement(); - }; - - Row.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - - el.setAttribute("role", "row"); - - return el; - }; - - Row.prototype.getElement = function () { - - return this.element; - }; - - Row.prototype.detachElement = function () { - - if (this.element && this.element.parentNode) { - - this.element.parentNode.removeChild(this.element); - } - }; - - Row.prototype.generateElement = function () { - - var self = this, - dblTap, - tapHold, - tap; - - //set row selection characteristics - - if (self.table.options.selectable !== false && self.table.modExists("selectRow")) { - - self.table.modules.selectRow.initializeRow(this); - } - - //setup movable rows - - if (self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - - self.table.modules.moveRow.initializeRow(this); - } - - //setup data tree - - if (self.table.options.dataTree !== false && self.table.modExists("dataTree")) { - - self.table.modules.dataTree.initializeRow(this); - } - - //setup column colapse container - - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - - self.table.modules.responsiveLayout.initializeRow(this); - } - - //set column menu - - if (self.table.options.rowContextMenu && this.table.modExists("menu")) { - - self.table.modules.menu.initializeRow(this); - } - - //handle row click events - - if (self.table.options.rowClick) { - - self.element.addEventListener("click", function (e) { - - self.table.options.rowClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowDblClick) { - - self.element.addEventListener("dblclick", function (e) { - - self.table.options.rowDblClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowContext) { - - self.element.addEventListener("contextmenu", function (e) { - - self.table.options.rowContext(e, self.getComponent()); - }); - } - - //handle mouse events - - if (self.table.options.rowMouseEnter) { - - self.element.addEventListener("mouseenter", function (e) { - - self.table.options.rowMouseEnter(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseLeave) { - - self.element.addEventListener("mouseleave", function (e) { - - self.table.options.rowMouseLeave(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOver) { - - self.element.addEventListener("mouseover", function (e) { - - self.table.options.rowMouseOver(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOut) { - - self.element.addEventListener("mouseout", function (e) { - - self.table.options.rowMouseOut(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseMove) { - - self.element.addEventListener("mousemove", function (e) { - - self.table.options.rowMouseMove(e, self.getComponent()); - }); - } - - if (self.table.options.rowTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - if (tap) { - - self.table.options.rowTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.table.options.rowDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - self.table.options.rowDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (self.table.options.rowTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - self.table.options.rowTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - }; - - Row.prototype.generateCells = function () { - - this.cells = this.table.columnManager.generateCells(this); - }; - - //functions to setup on first render - - Row.prototype.initialize = function (force) { - - var self = this; - - if (!self.initialized || force) { - - self.deleteCells(); - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - } //handle frozen cells - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layoutRow(this); - } - - this.generateCells(); - - self.cells.forEach(function (cell) { - - self.element.appendChild(cell.getElement()); - - cell.cellRendered(); - }); - - if (force) { - - self.normalizeHeight(); - } - - //setup movable rows - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - - self.table.modules.dataTree.layoutRow(this); - } - - //setup column colapse container - - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - - self.table.modules.responsiveLayout.layoutRow(this); - } - - if (self.table.options.rowFormatter) { - - self.table.options.rowFormatter(self.getComponent()); - } - - //set resizable handles - - if (self.table.options.resizableRows && self.table.modExists("resizeRows")) { - - self.table.modules.resizeRows.initializeRow(self); - } - - self.initialized = true; - } - }; - - Row.prototype.reinitializeHeight = function () { - - this.heightInitialized = false; - - if (this.element.offsetParent !== null) { - - this.normalizeHeight(true); - } - }; - - Row.prototype.reinitialize = function () { - - this.initialized = false; - - this.heightInitialized = false; - - if (!this.manualHeight) { - - this.height = 0; - - this.heightStyled = ""; - } - - if (this.element.offsetParent !== null) { - - this.initialize(true); - } - }; - - //get heights when doing bulk row style calcs in virtual DOM - - Row.prototype.calcHeight = function (force) { - - var maxHeight = 0, - minHeight = this.table.options.resizableRows ? this.element.clientHeight : 0; - - this.cells.forEach(function (cell) { - - var height = cell.getHeight(); - - if (height > maxHeight) { - - maxHeight = height; - } - }); - - if (force) { - - this.height = Math.max(maxHeight, minHeight); - } else { - - this.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight); - } - - this.heightStyled = this.height ? this.height + "px" : ""; - - this.outerHeight = this.element.offsetHeight; - }; - - //set of cells - - Row.prototype.setCellHeight = function () { - - this.cells.forEach(function (cell) { - - cell.setHeight(); - }); - - this.heightInitialized = true; - }; - - Row.prototype.clearCellHeight = function () { - - this.cells.forEach(function (cell) { - - cell.clearHeight(); - }); - }; - - //normalize the height of elements in the row - - Row.prototype.normalizeHeight = function (force) { - - if (force) { - - this.clearCellHeight(); - } - - this.calcHeight(force); - - this.setCellHeight(); - }; - - // Row.prototype.setHeight = function(height){ - - // this.height = height; - - - // this.setCellHeight(); - - // }; - - - //set height of rows - - Row.prototype.setHeight = function (height, force) { - - if (this.height != height || force) { - - this.manualHeight = true; - - this.height = height; - - this.heightStyled = height ? height + "px" : ""; - - this.setCellHeight(); - - // this.outerHeight = this.element.outerHeight(); - - this.outerHeight = this.element.offsetHeight; - } - }; - - //return rows outer height - - Row.prototype.getHeight = function () { - - return this.outerHeight; - }; - - //return rows outer Width - - Row.prototype.getWidth = function () { - - return this.element.offsetWidth; - }; - - //////////////// Cell Management ///////////////// - - - Row.prototype.deleteCell = function (cell) { - - var index = this.cells.indexOf(cell); - - if (index > -1) { - - this.cells.splice(index, 1); - } - }; - - //////////////// Data Management ///////////////// - - - Row.prototype.setData = function (data) { - - if (this.table.modExists("mutator")) { - - data = this.table.modules.mutator.transformRow(data, "data"); - } - - this.data = data; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - - this.table.modules.reactiveData.watchRow(this); - } - }; - - //update the rows data - - Row.prototype.updateData = function (updatedData) { - var _this15 = this; - - var visible = Tabulator.prototype.helpers.elVisible(this.element), - tempData = {}, - newRowData; - - return new Promise(function (resolve, reject) { - - if (typeof updatedData === "string") { - - updatedData = JSON.parse(updatedData); - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - - _this15.table.modules.reactiveData.block(); - } - - //mutate incomming data if needed - - if (_this15.table.modExists("mutator")) { - - tempData = Object.assign(tempData, _this15.data); - - tempData = Object.assign(tempData, updatedData); - - newRowData = _this15.table.modules.mutator.transformRow(tempData, "data", updatedData); - } else { - - newRowData = updatedData; - } - - //set data - - for (var attrname in newRowData) { - - _this15.data[attrname] = newRowData[attrname]; - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - - _this15.table.modules.reactiveData.unblock(); - } - - //update affected cells only - - for (var attrname in updatedData) { - - var columns = _this15.table.columnManager.getColumnsByFieldRoot(attrname); - - columns.forEach(function (column) { - - var cell = _this15.getCell(column.getField()); - - if (cell) { - - var value = column.getFieldValue(newRowData); - - if (cell.getValue() != value) { - - cell.setValueProcessData(value); - - if (visible) { - - cell.cellRendered(); - } - } - } - }); - } - - //Partial reinitialization if visible - - if (visible) { - - _this15.normalizeHeight(true); - - if (_this15.table.options.rowFormatter) { - - _this15.table.options.rowFormatter(_this15.getComponent()); - } - } else { - - _this15.initialized = false; - - _this15.height = 0; - - _this15.heightStyled = ""; - } - - if (_this15.table.options.dataTree !== false && _this15.table.modExists("dataTree") && _this15.table.modules.dataTree.redrawNeeded(updatedData)) { - - _this15.table.modules.dataTree.initializeRow(_this15); - - _this15.table.modules.dataTree.layoutRow(_this15); - - _this15.table.rowManager.refreshActiveData("tree", false, true); - } - - //this.reinitialize(); - - - _this15.table.options.rowUpdated.call(_this15.table, _this15.getComponent()); - - resolve(); - }); - }; - - Row.prototype.getData = function (transform) { - - var self = this; - - if (transform) { - - if (self.table.modExists("accessor")) { - - return self.table.modules.accessor.transformRow(self.data, transform); - } - } else { - - return this.data; - } - }; - - Row.prototype.getCell = function (column) { - - var match = false; - - column = this.table.columnManager.findColumn(column); - - match = this.cells.find(function (cell) { - - return cell.column === column; - }); - - return match; - }; - - Row.prototype.getCellIndex = function (findCell) { - - return this.cells.findIndex(function (cell) { - - return cell === findCell; - }); - }; - - Row.prototype.findNextEditableCell = function (index) { - - var nextCell = false; - - if (index < this.cells.length - 1) { - - for (var i = index + 1; i < this.cells.length; i++) { - - var cell = this.cells[i]; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - - var allowEdit = true; - - if (typeof cell.column.modules.edit.check == "function") { - - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - - nextCell = cell; - - break; - } - } - } - } - - return nextCell; - }; - - Row.prototype.findPrevEditableCell = function (index) { - - var prevCell = false; - - if (index > 0) { - - for (var i = index - 1; i >= 0; i--) { - - var cell = this.cells[i], - allowEdit = true; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - - if (typeof cell.column.modules.edit.check == "function") { - - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - - prevCell = cell; - - break; - } - } - } - } - - return prevCell; - }; - - Row.prototype.getCells = function () { - - return this.cells; - }; - - Row.prototype.nextRow = function () { - - var row = this.table.rowManager.nextDisplayRow(this, true); - - return row || false; - }; - - Row.prototype.prevRow = function () { - - var row = this.table.rowManager.prevDisplayRow(this, true); - - return row || false; - }; - - Row.prototype.moveToRow = function (to, before) { - - var toRow = this.table.rowManager.findRow(to); - - if (toRow) { - - this.table.rowManager.moveRowActual(this, toRow, !before); - - this.table.rowManager.refreshActiveData("display", false, true); - } else { - - console.warn("Move Error - No matching row found:", to); - } - }; - - Row.prototype.validate = function () { - - var invalid = []; - - this.cells.forEach(function (cell) { - - if (!cell.validate()) { - - invalid.push(cell.getComponent()); - } - }); - - return invalid.length ? invalid : true; - }; - - ///////////////////// Actions ///////////////////// - - - Row.prototype.delete = function () { - var _this16 = this; - - return new Promise(function (resolve, reject) { - - var index, rows; - - if (_this16.table.options.history && _this16.table.modExists("history")) { - - if (_this16.table.options.groupBy && _this16.table.modExists("groupRows")) { - - rows = _this16.getGroup().rows; - - index = rows.indexOf(_this16); - - if (index) { - - index = rows[index - 1]; - } - } else { - - index = _this16.table.rowManager.getRowIndex(_this16); - - if (index) { - - index = _this16.table.rowManager.rows[index - 1]; - } - } - - _this16.table.modules.history.action("rowDelete", _this16, { data: _this16.getData(), pos: !index, index: index }); - } - - _this16.deleteActual(); - - resolve(); - }); - }; - - Row.prototype.deleteActual = function (blockRedraw) { - - var index = this.table.rowManager.getRowIndex(this); - - //deselect row if it is selected - - if (this.table.modExists("selectRow")) { - - this.table.modules.selectRow._deselectRow(this, true); - } - - //cancel edit if row is currently being edited - - if (this.table.modExists("edit")) { - - if (this.table.modules.edit.currentCell.row === this) { - - this.table.modules.edit.cancelEdit(); - } - } - - // if(this.table.options.dataTree && this.table.modExists("dataTree")){ - - // this.table.modules.dataTree.collapseRow(this, true); - - // } - - - //remove any reactive data watchers from row object - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) {} - - // this.table.modules.reactiveData.unwatchRow(this); - - //remove from group - - if (this.modules.group) { - - this.modules.group.removeRow(this); - } - - this.table.rowManager.deleteRow(this, blockRedraw); - - this.deleteCells(); - - this.initialized = false; - - this.heightInitialized = false; - - if (this.table.options.dataTree && this.table.modExists("dataTree", true)) { - - this.table.modules.dataTree.rowDelete(this); - } - - //recalc column calculations if present - - if (this.table.modExists("columnCalcs")) { - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - this.table.modules.columnCalcs.recalcRowGroup(this); - } else { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - }; - - Row.prototype.deleteCells = function () { - - var cellCount = this.cells.length; - - for (var _i5 = 0; _i5 < cellCount; _i5++) { - - this.cells[0].delete(); - } - }; - - Row.prototype.wipe = function () { - - this.deleteCells(); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element = false; - - this.modules = {}; - - if (this.element.parentNode) { - - this.element.parentNode.removeChild(this.element); - } - }; - - Row.prototype.getGroup = function () { - - return this.modules.group || false; - }; - - //////////////// Object Generation ///////////////// - - Row.prototype.getComponent = function () { - - if (!this.component) { - - this.component = new RowComponent(this); - } - - return this.component; - }; - - //public row object - - var CellComponent = function CellComponent(cell) { - - this._cell = cell; - }; - - CellComponent.prototype.getValue = function () { - - return this._cell.getValue(); - }; - - CellComponent.prototype.getOldValue = function () { - - return this._cell.getOldValue(); - }; - - CellComponent.prototype.getElement = function () { - - return this._cell.getElement(); - }; - - CellComponent.prototype.getRow = function () { - - return this._cell.row.getComponent(); - }; - - CellComponent.prototype.getData = function () { - - return this._cell.row.getData(); - }; - - CellComponent.prototype.getField = function () { - - return this._cell.column.getField(); - }; - - CellComponent.prototype.getColumn = function () { - - return this._cell.column.getComponent(); - }; - - CellComponent.prototype.setValue = function (value, mutate) { - - if (typeof mutate == "undefined") { - - mutate = true; - } - - this._cell.setValue(value, mutate); - }; - - CellComponent.prototype.restoreOldValue = function () { - - this._cell.setValueActual(this._cell.getOldValue()); - }; - - CellComponent.prototype.edit = function (force) { - - return this._cell.edit(force); - }; - - CellComponent.prototype.cancelEdit = function () { - - this._cell.cancelEdit(); - }; - - CellComponent.prototype.isEdited = function () { - - return !!this._cell.modules.edit && this._cell.modules.edit.edited; - }; - - CellComponent.prototype.clearEdited = function () { - - if (self.table.modExists("edit", true)) { - - this._cell.table.modules.edit.clearEdited(this._cell); - } - }; - - CellComponent.prototype.isValid = function () { - - return this._cell.modules.validate ? !this._cell.modules.validate.invalid : true; - }; - - CellComponent.prototype.validate = function () { - - return this._cell.validate(); - }; - - CellComponent.prototype.clearValidation = function () { - - if (self.table.modExists("validate", true)) { - - this._cell.table.modules.validate.clearValidation(this._cell); - } - }; - - CellComponent.prototype.nav = function () { - - return this._cell.nav(); - }; - - CellComponent.prototype.checkHeight = function () { - - this._cell.checkHeight(); - }; - - CellComponent.prototype.getTable = function () { - - return this._cell.table; - }; - - CellComponent.prototype._getSelf = function () { - - return this._cell; - }; - - var Cell = function Cell(column, row) { - - this.table = column.table; - - this.column = column; - - this.row = row; - - this.element = null; - - this.value = null; - - this.oldValue = null; - - this.modules = {}; - - this.height = null; - - this.width = null; - - this.minWidth = null; - - this.component = null; - - this.build(); - }; - - //////////////// Setup Functions ///////////////// - - - //generate element - - Cell.prototype.build = function () { - - this.generateElement(); - - this.setWidth(); - - this._configureCell(); - - this.setValueActual(this.column.getFieldValue(this.row.data)); - }; - - Cell.prototype.generateElement = function () { - - this.element = document.createElement('div'); - - this.element.className = "tabulator-cell"; - - this.element.setAttribute("role", "gridcell"); - - this.element = this.element; - }; - - Cell.prototype._configureCell = function () { - - var self = this, - cellEvents = self.column.cellEvents, - element = self.element, - field = this.column.getField(), - vertAligns = { - - top: "flex-start", - - bottom: "flex-end", - - middle: "center" - - }, - hozAligns = { - - left: "flex-start", - - right: "flex-end", - - center: "center" - - }; - - //set text alignment - - element.style.textAlign = self.column.hozAlign; - - if (self.column.vertAlign) { - - element.style.display = "inline-flex"; - - element.style.alignItems = vertAligns[self.column.vertAlign] || ""; - - if (self.column.hozAlign) { - - element.style.justifyContent = hozAligns[self.column.hozAlign] || ""; - } - } - - if (field) { - - element.setAttribute("tabulator-field", field); - } - - //add class to cell if needed - - if (self.column.definition.cssClass) { - - var classNames = self.column.definition.cssClass.split(" "); - - classNames.forEach(function (className) { - - element.classList.add(className); - }); - } - - //update tooltip on mouse enter - - if (this.table.options.tooltipGenerationMode === "hover") { - - element.addEventListener("mouseenter", function (e) { - - self._generateTooltip(); - }); - } - - self._bindClickEvents(cellEvents); - - self._bindTouchEvents(cellEvents); - - self._bindMouseEvents(cellEvents); - - if (self.column.modules.edit) { - - self.table.modules.edit.bindEditor(self); - } - - if (self.column.definition.rowHandle && self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - - self.table.modules.moveRow.initializeCell(self); - } - - //hide cell if not visible - - if (!self.column.visible) { - - self.hide(); - } - }; - - Cell.prototype._bindClickEvents = function (cellEvents) { - - var self = this, - element = self.element; - - //set event bindings - - if (cellEvents.cellClick || self.table.options.cellClick) { - - element.addEventListener("click", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellClick) { - - cellEvents.cellClick.call(self.table, e, component); - } - - if (self.table.options.cellClick) { - - self.table.options.cellClick.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellDblClick || this.table.options.cellDblClick) { - - element.addEventListener("dblclick", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellDblClick) { - - cellEvents.cellDblClick.call(self.table, e, component); - } - - if (self.table.options.cellDblClick) { - - self.table.options.cellDblClick.call(self.table, e, component); - } - }); - } else { - - element.addEventListener("dblclick", function (e) { - - if (self.table.modExists("edit")) { - - if (self.table.modules.edit.currentCell === self) { - - return; //prevent instant selection of editor content - } - } - - e.preventDefault(); - - try { - - if (document.selection) { - // IE - - var range = document.body.createTextRange(); - - range.moveToElementText(self.element); - - range.select(); - } else if (window.getSelection) { - - var range = document.createRange(); - - range.selectNode(self.element); - - window.getSelection().removeAllRanges(); - - window.getSelection().addRange(range); - } - } catch (e) {} - }); - } - - if (cellEvents.cellContext || this.table.options.cellContext) { - - element.addEventListener("contextmenu", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellContext) { - - cellEvents.cellContext.call(self.table, e, component); - } - - if (self.table.options.cellContext) { - - self.table.options.cellContext.call(self.table, e, component); - } - }); - } - }; - - Cell.prototype._bindMouseEvents = function (cellEvents) { - - var self = this, - element = self.element; - - if (cellEvents.cellMouseEnter || self.table.options.cellMouseEnter) { - - element.addEventListener("mouseenter", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseEnter) { - - cellEvents.cellMouseEnter.call(self.table, e, component); - } - - if (self.table.options.cellMouseEnter) { - - self.table.options.cellMouseEnter.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseLeave || self.table.options.cellMouseLeave) { - - element.addEventListener("mouseleave", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseLeave) { - - cellEvents.cellMouseLeave.call(self.table, e, component); - } - - if (self.table.options.cellMouseLeave) { - - self.table.options.cellMouseLeave.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOver || self.table.options.cellMouseOver) { - - element.addEventListener("mouseover", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseOver) { - - cellEvents.cellMouseOver.call(self.table, e, component); - } - - if (self.table.options.cellMouseOver) { - - self.table.options.cellMouseOver.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOut || self.table.options.cellMouseOut) { - - element.addEventListener("mouseout", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseOut) { - - cellEvents.cellMouseOut.call(self.table, e, component); - } - - if (self.table.options.cellMouseOut) { - - self.table.options.cellMouseOut.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseMove || self.table.options.cellMouseMove) { - - element.addEventListener("mousemove", function (e) { - - var component = self.getComponent(); - - if (cellEvents.cellMouseMove) { - - cellEvents.cellMouseMove.call(self.table, e, component); - } - - if (self.table.options.cellMouseMove) { - - self.table.options.cellMouseMove.call(self.table, e, component); - } - }); - } - }; - - Cell.prototype._bindTouchEvents = function (cellEvents) { - - var self = this, - element = self.element, - dblTap, - tapHold, - tap; - - if (cellEvents.cellTap || this.table.options.cellTap) { - - tap = false; - - element.addEventListener("touchstart", function (e) { - - tap = true; - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - - if (tap) { - - var component = self.getComponent(); - - if (cellEvents.cellTap) { - - cellEvents.cellTap.call(self.table, e, component); - } - - if (self.table.options.cellTap) { - - self.table.options.cellTap.call(self.table, e, component); - } - } - - tap = false; - }); - } - - if (cellEvents.cellDblTap || this.table.options.cellDblTap) { - - dblTap = null; - - element.addEventListener("touchend", function (e) { - - if (dblTap) { - - clearTimeout(dblTap); - - dblTap = null; - - var component = self.getComponent(); - - if (cellEvents.cellDblTap) { - - cellEvents.cellDblTap.call(self.table, e, component); - } - - if (self.table.options.cellDblTap) { - - self.table.options.cellDblTap.call(self.table, e, component); - } - } else { - - dblTap = setTimeout(function () { - - clearTimeout(dblTap); - - dblTap = null; - }, 300); - } - }); - } - - if (cellEvents.cellTapHold || this.table.options.cellTapHold) { - - tapHold = null; - - element.addEventListener("touchstart", function (e) { - - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - - clearTimeout(tapHold); - - tapHold = null; - - tap = false; - - var component = self.getComponent(); - - if (cellEvents.cellTapHold) { - - cellEvents.cellTapHold.call(self.table, e, component); - } - - if (self.table.options.cellTapHold) { - - self.table.options.cellTapHold.call(self.table, e, component); - } - }, 1000); - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - - clearTimeout(tapHold); - - tapHold = null; - }); - } - }; - - //generate cell contents - - Cell.prototype._generateContents = function () { - - var val; - - if (this.table.modExists("format")) { - - val = this.table.modules.format.formatValue(this); - } else { - - val = this.element.innerHTML = this.value; - } - - switch (typeof val === 'undefined' ? 'undefined' : _typeof(val)) { - - case "object": - - if (val instanceof Node) { - - //clear previous cell contents - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element.appendChild(val); - } else { - - this.element.innerHTML = ""; - - if (val != null) { - - console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", val); - } - } - - break; - - case "undefined": - - case "null": - - this.element.innerHTML = ""; - - break; - - default: - - this.element.innerHTML = val; - - } - }; - - Cell.prototype.cellRendered = function () { - - if (this.table.modExists("format") && this.table.modules.format.cellRendered) { - - this.table.modules.format.cellRendered(this); - } - }; - - //generate tooltip text - - Cell.prototype._generateTooltip = function () { - - var tooltip = this.column.tooltip; - - if (tooltip) { - - if (tooltip === true) { - - tooltip = this.value; - } else if (typeof tooltip == "function") { - - tooltip = tooltip(this.getComponent()); - - if (tooltip === false) { - - tooltip = ""; - } - } - - if (typeof tooltip === "undefined") { - - tooltip = ""; - } - - this.element.setAttribute("title", tooltip); - } else { - - this.element.setAttribute("title", ""); - } - }; - - //////////////////// Getters //////////////////// - - Cell.prototype.getElement = function () { - - return this.element; - }; - - Cell.prototype.getValue = function () { - - return this.value; - }; - - Cell.prototype.getOldValue = function () { - - return this.oldValue; - }; - - //////////////////// Actions //////////////////// - - - Cell.prototype.setValue = function (value, mutate) { - - var changed = this.setValueProcessData(value, mutate), - component; - - if (changed) { - - if (this.table.options.history && this.table.modExists("history")) { - - this.table.modules.history.action("cellEdit", this, { oldValue: this.oldValue, newValue: this.value }); - } - - component = this.getComponent(); - - if (this.column.cellEvents.cellEdited) { - - this.column.cellEvents.cellEdited.call(this.table, component); - } - - this.cellRendered(); - - this.table.options.cellEdited.call(this.table, component); - - this.table.options.dataEdited.call(this.table, this.table.rowManager.getData()); - } - }; - - Cell.prototype.setValueProcessData = function (value, mutate) { - - var changed = false; - - if (this.value != value) { - - changed = true; - - if (mutate) { - - if (this.column.modules.mutate) { - - value = this.table.modules.mutator.transformCell(this, value); - } - } - } - - this.setValueActual(value); - - if (changed && this.table.modExists("columnCalcs")) { - - if (this.column.definition.topCalc || this.column.definition.bottomCalc) { - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (this.table.options.columnCalcs == "table" || this.table.options.columnCalcs == "both") { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.columnCalcs != "table") { - - this.table.modules.columnCalcs.recalcRowGroup(this.row); - } - } else { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - } - - return changed; - }; - - Cell.prototype.setValueActual = function (value) { - - this.oldValue = this.value; - - this.value = value; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - - this.table.modules.reactiveData.block(); - } - - this.column.setFieldValue(this.row.data, value); - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - - this.table.modules.reactiveData.unblock(); - } - - this._generateContents(); - - this._generateTooltip(); - - //set resizable handles - - if (this.table.options.resizableColumns && this.table.modExists("resizeColumns")) { - - this.table.modules.resizeColumns.initializeColumn("cell", this.column, this.element); - } - - //set column menu - - if (this.column.definition.contextMenu && this.table.modExists("menu")) { - - this.table.modules.menu.initializeCell(this); - } - - //handle frozen cells - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layoutElement(this.element, this.column); - } - }; - - Cell.prototype.setWidth = function () { - - this.width = this.column.width; - - this.element.style.width = this.column.widthStyled; - }; - - Cell.prototype.clearWidth = function () { - - this.width = ""; - - this.element.style.width = ""; - }; - - Cell.prototype.getWidth = function () { - - return this.width || this.element.offsetWidth; - }; - - Cell.prototype.setMinWidth = function () { - - this.minWidth = this.column.minWidth; - - this.element.style.minWidth = this.column.minWidthStyled; - }; - - Cell.prototype.checkHeight = function () { - - // var height = this.element.css("height"); - - this.row.reinitializeHeight(); - }; - - Cell.prototype.clearHeight = function () { - - this.element.style.height = ""; - - this.height = null; - }; - - Cell.prototype.setHeight = function () { - - this.height = this.row.height; - - this.element.style.height = this.row.heightStyled; - }; - - Cell.prototype.getHeight = function () { - - return this.height || this.element.offsetHeight; - }; - - Cell.prototype.show = function () { - - this.element.style.display = ""; - }; - - Cell.prototype.hide = function () { - - this.element.style.display = "none"; - }; - - Cell.prototype.edit = function (force) { - - if (this.table.modExists("edit", true)) { - - return this.table.modules.edit.editCell(this, force); - } - }; - - Cell.prototype.cancelEdit = function () { - - if (this.table.modExists("edit", true)) { - - var editing = this.table.modules.edit.getCurrentCell(); - - if (editing && editing._getSelf() === this) { - - this.table.modules.edit.cancelEdit(); - } else { - - console.warn("Cancel Editor Error - This cell is not currently being edited "); - } - } - }; - - Cell.prototype.validate = function () { - - if (this.column.modules.validate && this.table.modExists("validate", true)) { - - var valid = this.table.modules.validate.validate(this.column.modules.validate, this, this.getValue()); - - return valid === true; - } else { - - return true; - } - }; - - Cell.prototype.delete = function () { - - if (!this.table.rowManager.redrawBlock) { - - this.element.parentNode.removeChild(this.element); - } - - if (this.modules.validate && this.modules.validate.invalid) { - - this.table.modules.validate.clearValidation(this); - } - - if (this.modules.edit && this.modules.edit.edited) { - - this.table.modules.edit.clearEdited(this); - } - - this.element = false; - - this.column.deleteCell(this); - - this.row.deleteCell(this); - - this.calcs = {}; - }; - - //////////////// Navigation ///////////////// - - - Cell.prototype.nav = function () { - - var self = this, - nextCell = false, - index = this.row.getCellIndex(this); - - return { - - next: function next() { - - var nextCell = this.right(), - nextRow; - - if (!nextCell) { - - nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - - nextCell = nextRow.findNextEditableCell(-1); - - if (nextCell) { - - nextCell.edit(); - - return true; - } - } - } else { - - return true; - } - - return false; - }, - - prev: function prev() { - - var nextCell = this.left(), - prevRow; - - if (!nextCell) { - - prevRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (prevRow) { - - nextCell = prevRow.findPrevEditableCell(prevRow.cells.length); - - if (nextCell) { - - nextCell.edit(); - - return true; - } - } - } else { - - return true; - } - - return false; - }, - - left: function left() { - - nextCell = self.row.findPrevEditableCell(index); - - if (nextCell) { - - nextCell.edit(); - - return true; - } else { - - return false; - } - }, - - right: function right() { - - nextCell = self.row.findNextEditableCell(index); - - if (nextCell) { - - nextCell.edit(); - - return true; - } else { - - return false; - } - }, - - up: function up() { - - var nextRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (nextRow) { - - nextRow.cells[index].edit(); - } - }, - - down: function down() { - - var nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - - nextRow.cells[index].edit(); - } - } - - }; - }; - - Cell.prototype.getIndex = function () { - - this.row.getCellIndex(this); - }; - - //////////////// Object Generation ///////////////// - - Cell.prototype.getComponent = function () { - - if (!this.component) { - - this.component = new CellComponent(this); - } - - return this.component; - }; - - var FooterManager = function FooterManager(table) { - - this.table = table; - - this.active = false; - - this.element = this.createElement(); //containing element - - this.external = false; - - this.links = []; - - this._initialize(); - }; - - FooterManager.prototype.createElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-footer"); - - return el; - }; - - FooterManager.prototype._initialize = function (element) { - - if (this.table.options.footerElement) { - - switch (_typeof(this.table.options.footerElement)) { - - case "string": - - if (this.table.options.footerElement[0] === "<") { - - this.element.innerHTML = this.table.options.footerElement; - } else { - - this.external = true; - - this.element = document.querySelector(this.table.options.footerElement); - } - - break; - - default: - - this.element = this.table.options.footerElement; - - break; - - } - } - }; - - FooterManager.prototype.getElement = function () { - - return this.element; - }; - - FooterManager.prototype.append = function (element, parent) { - - this.activate(parent); - - this.element.appendChild(element); - - this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.prepend = function (element, parent) { - - this.activate(parent); - - this.element.insertBefore(element, this.element.firstChild); - - this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.remove = function (element) { - - element.parentNode.removeChild(element); - - this.deactivate(); - }; - - FooterManager.prototype.deactivate = function (force) { - - if (!this.element.firstChild || force) { - - if (!this.external) { - - this.element.parentNode.removeChild(this.element); - } - - this.active = false; - } - - // this.table.rowManager.adjustTableSize(); - }; - - FooterManager.prototype.activate = function (parent) { - - if (!this.active) { - - this.active = true; - - if (!this.external) { - - this.table.element.appendChild(this.getElement()); - - this.table.element.style.display = ''; - } - } - - if (parent) { - - this.links.push(parent); - } - }; - - FooterManager.prototype.redraw = function () { - - this.links.forEach(function (link) { - - link.footerRedraw(); - }); - }; - - var Tabulator = function Tabulator(element, options) { - - this.options = {}; - - this.columnManager = null; // hold Column Manager - - this.rowManager = null; //hold Row Manager - - this.footerManager = null; //holder Footer Manager - - this.browser = ""; //hold current browser type - - this.browserSlow = false; //handle reduced functionality for slower browsers - - this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence - - - this.modules = {}; //hold all modules bound to this table - - - this.initializeElement(element); - - this.initializeOptions(options || {}); - - this._create(); - - Tabulator.prototype.comms.register(this); //register table for inderdevice communication - }; - - //default setup options - - Tabulator.prototype.defaultOptions = { - - height: false, //height of tabulator - - minHeight: false, //minimum height of tabulator - - maxHeight: false, //maximum height of tabulator - - - layout: "fitData", ///layout type "fitColumns" | "fitData" - - layoutColumnsOnNewData: false, //update column widths on setData - - - columnMinWidth: 40, //minimum global width for a column - - columnHeaderVertAlign: "top", //vertical alignment of column headers - - columnVertAlign: false, // DEPRECATED - Left to allow warning - - - resizableColumns: true, //resizable columns - - resizableRows: false, //resizable rows - - autoResize: true, //auto resize table - - - columns: [], //store for colum header info - - - cellHozAlign: "", //horizontal align columns - - cellVertAlign: "", //certical align columns - - - data: [], //default starting data - - - autoColumns: false, //build columns from data row structure - - - reactiveData: false, //enable data reactivity - - - nestedFieldSeparator: ".", //seperatpr for nested data - - - tooltips: false, //Tool tip value - - tooltipsHeader: false, //Tool tip for headers - - tooltipGenerationMode: "load", //when to generate tooltips - - - initialSort: false, //initial sorting criteria - - initialFilter: false, //initial filtering criteria - - initialHeaderFilter: false, //initial header filtering criteria - - - columnHeaderSortMulti: true, //multiple or single column sorting - - - sortOrderReverse: false, //reverse internal sort ordering - - - headerSort: true, //set default global header sort - - headerSortTristate: false, //set default tristate header sorting - - - footerElement: false, //hold footer element - - - index: "id", //filed for row index - - - keybindings: [], //array for keybindings - - - tabEndNewRow: false, //create new row when tab to end of table - - - invalidOptionWarnings: true, //allow toggling of invalid option warnings - - - clipboard: false, //enable clipboard - - clipboardCopyStyled: true, //formatted table data - - clipboardCopyConfig: false, //clipboard config - - clipboardCopyFormatter: false, //DEPRICATED - REMOVE in 5.0 - - clipboardCopyRowRange: "active", //restrict clipboard to visible rows only - - clipboardPasteParser: "table", //convert pasted clipboard data to rows - - clipboardPasteAction: "insert", //how to insert pasted data into the table - - - clipboardCopied: function clipboardCopied() {}, //data has been copied to the clipboard - - clipboardPasted: function clipboardPasted() {}, //data has been pasted into the table - - clipboardPasteError: function clipboardPasteError() {}, //data has not successfully been pasted into the table - - - downloadDataFormatter: false, //function to manipulate table data before it is downloaded - - downloadReady: function downloadReady(data, blob) { - return blob; - }, //function to manipulate download data - - downloadComplete: false, //function to manipulate download data - - downloadConfig: {}, //download config - - downloadRowRange: "active", //restrict download to active rows only - - - dataTree: false, //enable data tree - - dataTreeElementColumn: false, - - dataTreeBranchElement: true, //show data tree branch element - - dataTreeChildIndent: 9, //data tree child indent in px - - dataTreeChildField: "_children", //data tre column field to look for child rows - - dataTreeCollapseElement: false, //data tree row collapse element - - dataTreeExpandElement: false, //data tree row expand element - - dataTreeStartExpanded: false, - - dataTreeRowExpanded: function dataTreeRowExpanded() {}, //row has been expanded - - dataTreeRowCollapsed: function dataTreeRowCollapsed() {}, //row has been collapsed - - dataTreeChildColumnCalcs: false, //include visible data tree rows in column calculations - - dataTreeSelectPropagate: false, //seleccting a parent row selects its children - - - printAsHtml: false, //enable print as html - - printFormatter: false, //printing page formatter - - printHeader: false, //page header contents - - printFooter: false, //page footer contents - - printCopyStyle: true, //DEPRICATED - REMOVE in 5.0 - - printStyled: true, //enable print as html styling - - printVisibleRows: true, //DEPRICATED - REMOVE in 5.0 - - printRowRange: "visible", //restrict print to visible rows only - - printConfig: {}, //print config options - - - addRowPos: "bottom", //position to insert blank rows, top|bottom - - - selectable: "highlight", //highlight rows on hover - - selectableRangeMode: "drag", //highlight rows on hover - - selectableRollingSelection: true, //roll selection once maximum number of selectable rows is reached - - selectablePersistence: true, // maintain selection when table view is updated - - selectableCheck: function selectableCheck(data, row) { - return true; - }, //check wheather row is selectable - - - headerFilterLiveFilterDelay: 300, //delay before updating column after user types in header filter - - headerFilterPlaceholder: false, //placeholder text to display in header filters - - - headerVisible: true, //hide header - - - history: false, //enable edit history - - - locale: false, //current system language - - langs: {}, - - virtualDom: true, //enable DOM virtualization - - virtualDomBuffer: 0, // set virtual DOM buffer size - - - persistentLayout: false, //DEPRICATED - REMOVE in 5.0 - - persistentSort: false, //DEPRICATED - REMOVE in 5.0 - - persistentFilter: false, //DEPRICATED - REMOVE in 5.0 - - persistenceID: "", //key for persistent storage - - persistenceMode: true, //mode for storing persistence information - - persistenceReaderFunc: false, //function for handling persistence data reading - - persistenceWriterFunc: false, //function for handling persistence data writing - - - persistence: false, - - responsiveLayout: false, //responsive layout flags - - responsiveLayoutCollapseStartOpen: true, //start showing collapsed data - - responsiveLayoutCollapseUseFormatters: true, //responsive layout collapse formatter - - responsiveLayoutCollapseFormatter: false, //responsive layout collapse formatter - - - pagination: false, //set pagination type - - paginationSize: false, //set number of rows to a page - - paginationInitialPage: 1, //initail page to show on load - - paginationButtonCount: 5, // set count of page button - - paginationSizeSelector: false, //add pagination size selector element - - paginationElement: false, //element to hold pagination numbers - - paginationDataSent: {}, //pagination data sent to the server - - paginationDataReceived: {}, //pagination data received from the server - - paginationAddRow: "page", //add rows on table or page - - - ajaxURL: false, //url for ajax loading - - ajaxURLGenerator: false, - - ajaxParams: {}, //params for ajax loading - - ajaxConfig: "get", //ajax request type - - ajaxContentType: "form", //ajax request type - - ajaxRequestFunc: false, //promise function - - ajaxLoader: true, //show loader - - ajaxLoaderLoading: false, //loader element - - ajaxLoaderError: false, //loader element - - ajaxFiltering: false, - - ajaxSorting: false, - - ajaxProgressiveLoad: false, //progressive loading - - ajaxProgressiveLoadDelay: 0, //delay between requests - - ajaxProgressiveLoadScrollMargin: 0, //margin before scroll begins - - - groupBy: false, //enable table grouping and set field to group by - - groupStartOpen: true, //starting state of group - - groupValues: false, - - groupHeader: false, //header generation function - - groupHeaderPrint: null, - - groupHeaderClipboard: null, - - groupHeaderHtmlOutput: null, - - groupHeaderDownload: null, - - htmlOutputConfig: false, //html outypu config - - - movableColumns: false, //enable movable columns - - - movableRows: false, //enable movable rows - - movableRowsConnectedTables: false, //tables for movable rows to be connected to - - movableRowsConnectedElements: false, //other elements for movable rows to be connected to - - movableRowsSender: false, - - movableRowsReceiver: "insert", - - movableRowsSendingStart: function movableRowsSendingStart() {}, - - movableRowsSent: function movableRowsSent() {}, - - movableRowsSentFailed: function movableRowsSentFailed() {}, - - movableRowsSendingStop: function movableRowsSendingStop() {}, - - movableRowsReceivingStart: function movableRowsReceivingStart() {}, - - movableRowsReceived: function movableRowsReceived() {}, - - movableRowsReceivedFailed: function movableRowsReceivedFailed() {}, - - movableRowsReceivingStop: function movableRowsReceivingStop() {}, - - movableRowsElementDrop: function movableRowsElementDrop() {}, - - scrollToRowPosition: "top", - - scrollToRowIfVisible: true, - - scrollToColumnPosition: "left", - - scrollToColumnIfVisible: true, - - rowFormatter: false, - - rowFormatterPrint: null, - - rowFormatterClipboard: null, - - rowFormatterHtmlOutput: null, - - placeholder: false, - - //table building callbacks - - tableBuilding: function tableBuilding() {}, - - tableBuilt: function tableBuilt() {}, - - //render callbacks - - renderStarted: function renderStarted() {}, - - renderComplete: function renderComplete() {}, - - //row callbacks - - rowClick: false, - - rowDblClick: false, - - rowContext: false, - - rowTap: false, - - rowDblTap: false, - - rowTapHold: false, - - rowMouseEnter: false, - - rowMouseLeave: false, - - rowMouseOver: false, - - rowMouseOut: false, - - rowMouseMove: false, - - rowContextMenu: false, - - rowAdded: function rowAdded() {}, - - rowDeleted: function rowDeleted() {}, - - rowMoved: function rowMoved() {}, - - rowUpdated: function rowUpdated() {}, - - rowSelectionChanged: function rowSelectionChanged() {}, - - rowSelected: function rowSelected() {}, - - rowDeselected: function rowDeselected() {}, - - rowResized: function rowResized() {}, - - //cell callbacks - - //row callbacks - - cellClick: false, - - cellDblClick: false, - - cellContext: false, - - cellTap: false, - - cellDblTap: false, - - cellTapHold: false, - - cellMouseEnter: false, - - cellMouseLeave: false, - - cellMouseOver: false, - - cellMouseOut: false, - - cellMouseMove: false, - - cellEditing: function cellEditing() {}, - - cellEdited: function cellEdited() {}, - - cellEditCancelled: function cellEditCancelled() {}, - - //column callbacks - - columnMoved: false, - - columnResized: function columnResized() {}, - - columnTitleChanged: function columnTitleChanged() {}, - - columnVisibilityChanged: function columnVisibilityChanged() {}, - - //HTML iport callbacks - - htmlImporting: function htmlImporting() {}, - - htmlImported: function htmlImported() {}, - - //data callbacks - - dataLoading: function dataLoading() {}, - - dataLoaded: function dataLoaded() {}, - - dataEdited: function dataEdited() {}, - - //ajax callbacks - - ajaxRequesting: function ajaxRequesting() {}, - - ajaxResponse: false, - - ajaxError: function ajaxError() {}, - - //filtering callbacks - - dataFiltering: false, - - dataFiltered: false, - - //sorting callbacks - - dataSorting: function dataSorting() {}, - - dataSorted: function dataSorted() {}, - - //grouping callbacks - - groupToggleElement: "arrow", - - groupClosedShowCalcs: false, - - dataGrouping: function dataGrouping() {}, - - dataGrouped: false, - - groupVisibilityChanged: function groupVisibilityChanged() {}, - - groupClick: false, - - groupDblClick: false, - - groupContext: false, - - groupContextMenu: false, - - groupTap: false, - - groupDblTap: false, - - groupTapHold: false, - - columnCalcs: true, - - //pagination callbacks - - pageLoaded: function pageLoaded() {}, - - //localization callbacks - - localized: function localized() {}, - - //validation callbacks - - validationMode: "blocking", - - validationFailed: function validationFailed() {}, - - //history callbacks - - historyUndo: function historyUndo() {}, - - historyRedo: function historyRedo() {}, - - //scroll callbacks - - scrollHorizontal: function scrollHorizontal() {}, - - scrollVertical: function scrollVertical() {} - - }; - - Tabulator.prototype.initializeOptions = function (options) { - - //warn user if option is not available - - if (options.invalidOptionWarnings !== false) { - - for (var key in options) { - - if (typeof this.defaultOptions[key] === "undefined") { - - console.warn("Invalid table constructor option:", key); - } - } - } - - //assign options to table - - for (var key in this.defaultOptions) { - - if (key in options) { - - this.options[key] = options[key]; - } else { - - if (Array.isArray(this.defaultOptions[key])) { - - this.options[key] = []; - } else if (_typeof(this.defaultOptions[key]) === "object" && this.defaultOptions[key] !== null) { - - this.options[key] = {}; - } else { - - this.options[key] = this.defaultOptions[key]; - } - } - } - }; - - Tabulator.prototype.initializeElement = function (element) { - - if (typeof HTMLElement !== "undefined" && element instanceof HTMLElement) { - - this.element = element; - - return true; - } else if (typeof element === "string") { - - this.element = document.querySelector(element); - - if (this.element) { - - return true; - } else { - - console.error("Tabulator Creation Error - no element found matching selector: ", element); - - return false; - } - } else { - - console.error("Tabulator Creation Error - Invalid element provided:", element); - - return false; - } - }; - - //convert depricated functionality to new functions - - Tabulator.prototype._mapDepricatedFunctionality = function () { - - //map depricated persistance setup options - - if (this.options.persistentLayout || this.options.persistentSort || this.options.persistentFilter) { - - if (!this.options.persistence) { - - this.options.persistence = {}; - } - } - - if (this.options.downloadDataFormatter) { - - console.warn("DEPRECATION WARNING - downloadDataFormatter option has been deprecated"); - } - - if (typeof this.options.clipboardCopyHeader !== "undefined") { - - this.options.columnHeaders = this.options.clipboardCopyHeader; - - console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option"); - } - - if (this.options.printVisibleRows !== true) { - - console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"); - - this.options.persistence.printRowRange = "active"; - } - - if (this.options.printCopyStyle !== true) { - - console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"); - - this.options.persistence.printStyled = this.options.printCopyStyle; - } - - if (this.options.persistentLayout) { - - console.warn("persistentLayout option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.columns === "undefined") { - - this.options.persistence.columns = true; - } - } - - if (this.options.persistentSort) { - - console.warn("persistentSort option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.sort === "undefined") { - - this.options.persistence.sort = true; - } - } - - if (this.options.persistentFilter) { - - console.warn("persistentFilter option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.filter === "undefined") { - - this.options.persistence.filter = true; - } - } - - if (this.options.columnVertAlign) { - - console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"); - - this.options.columnHeaderVertAlign = this.options.columnVertAlign; - } - }; - - Tabulator.prototype._clearSelection = function () { - - this.element.classList.add("tabulator-block-select"); - - if (window.getSelection) { - - if (window.getSelection().empty) { - // Chrome - - window.getSelection().empty(); - } else if (window.getSelection().removeAllRanges) { - // Firefox - - window.getSelection().removeAllRanges(); - } - } else if (document.selection) { - // IE? - - document.selection.empty(); - } - - this.element.classList.remove("tabulator-block-select"); - }; - - //concreate table - - Tabulator.prototype._create = function () { - - this._clearObjectPointers(); - - this._mapDepricatedFunctionality(); - - this.bindModules(); - - if (this.element.tagName === "TABLE") { - - if (this.modExists("htmlTableImport", true)) { - - this.modules.htmlTableImport.parseTable(); - } - } - - this.columnManager = new ColumnManager(this); - - this.rowManager = new RowManager(this); - - this.footerManager = new FooterManager(this); - - this.columnManager.setRowManager(this.rowManager); - - this.rowManager.setColumnManager(this.columnManager); - - this._buildElement(); - - this._loadInitialData(); - }; - - //clear pointers to objects in default config object - - Tabulator.prototype._clearObjectPointers = function () { - - this.options.columns = this.options.columns.slice(0); - - if (!this.options.reactiveData) { - - this.options.data = this.options.data.slice(0); - } - }; - - //build tabulator element - - Tabulator.prototype._buildElement = function () { - var _this17 = this; - - var element = this.element, - mod = this.modules, - options = this.options; - - options.tableBuilding.call(this); - - element.classList.add("tabulator"); - - element.setAttribute("role", "grid"); - - //empty element - - while (element.firstChild) { - element.removeChild(element.firstChild); - } //set table height - - if (options.height) { - - options.height = isNaN(options.height) ? options.height : options.height + "px"; - - element.style.height = options.height; - } - - //set table min height - - if (options.minHeight !== false) { - - options.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + "px"; - - element.style.minHeight = options.minHeight; - } - - //set table maxHeight - - if (options.maxHeight !== false) { - - options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px"; - - element.style.maxHeight = options.maxHeight; - } - - this.columnManager.initialize(); - - this.rowManager.initialize(); - - this._detectBrowser(); - - if (this.modExists("layout", true)) { - - mod.layout.initialize(options.layout); - } - - //set localization - - if (options.headerFilterPlaceholder !== false) { - - mod.localize.setHeaderFilterPlaceholder(options.headerFilterPlaceholder); - } - - for (var locale in options.langs) { - - mod.localize.installLang(locale, options.langs[locale]); - } - - mod.localize.setLocale(options.locale); - - //configure placeholder element - - if (typeof options.placeholder == "string") { - - var el = document.createElement("div"); - - el.classList.add("tabulator-placeholder"); - - var span = document.createElement("span"); - - span.innerHTML = options.placeholder; - - el.appendChild(span); - - options.placeholder = el; - } - - //build table elements - - element.appendChild(this.columnManager.getElement()); - - element.appendChild(this.rowManager.getElement()); - - if (options.footerElement) { - - this.footerManager.activate(); - } - - if (options.persistence && this.modExists("persistence", true)) { - - mod.persistence.initialize(); - } - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.columns) { - - options.columns = mod.persistence.load("columns", options.columns); - } - - if (options.movableRows && this.modExists("moveRow")) { - - mod.moveRow.initialize(); - } - - if (options.autoColumns && this.options.data) { - - this.columnManager.generateColumnsFromRowData(this.options.data); - } - - if (this.modExists("columnCalcs")) { - - mod.columnCalcs.initialize(); - } - - this.columnManager.setColumns(options.columns); - - if (options.dataTree && this.modExists("dataTree", true)) { - - mod.dataTree.initialize(); - } - - if (this.modExists("frozenRows")) { - - this.modules.frozenRows.initialize(); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort || options.initialSort) && this.modExists("sort", true)) { - - var sorters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort) { - - sorters = mod.persistence.load("sort"); - - if (sorters === false && options.initialSort) { - - sorters = options.initialSort; - } - } else if (options.initialSort) { - - sorters = options.initialSort; - } - - mod.sort.setSort(sorters); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter || options.initialFilter) && this.modExists("filter", true)) { - - var filters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter) { - - filters = mod.persistence.load("filter"); - - if (filters === false && options.initialFilter) { - - filters = options.initialFilter; - } - } else if (options.initialFilter) { - - filters = options.initialFilter; - } - - mod.filter.setFilter(filters); - } - - if (options.initialHeaderFilter && this.modExists("filter", true)) { - - options.initialHeaderFilter.forEach(function (item) { - - var column = _this17.columnManager.findColumn(item.field); - - if (column) { - - mod.filter.setHeaderFilterValue(column, item.value); - } else { - - console.warn("Column Filter Error - No matching column found:", item.field); - - return false; - } - }); - } - - if (this.modExists("ajax")) { - - mod.ajax.initialize(); - } - - if (options.pagination && this.modExists("page", true)) { - - mod.page.initialize(); - } - - if (options.groupBy && this.modExists("groupRows", true)) { - - mod.groupRows.initialize(); - } - - if (this.modExists("keybindings")) { - - mod.keybindings.initialize(); - } - - if (this.modExists("selectRow")) { - - mod.selectRow.clearSelectionData(true); - } - - if (options.autoResize && this.modExists("resizeTable")) { - - mod.resizeTable.initialize(); - } - - if (this.modExists("clipboard")) { - - mod.clipboard.initialize(); - } - - if (options.printAsHtml && this.modExists("print")) { - - mod.print.initialize(); - } - - options.tableBuilt.call(this); - }; - - Tabulator.prototype._loadInitialData = function () { - - var self = this; - - if (self.options.pagination && self.modExists("page")) { - - self.modules.page.reset(true, true); - - if (self.options.pagination == "local") { - - if (self.options.data.length) { - - self.rowManager.setData(self.options.data, false, true); - } else { - - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () { - - if (self.options.paginationInitialPage) { - - self.modules.page.setPage(self.options.paginationInitialPage); - } - }); - - return; - } else { - - self.rowManager.setData(self.options.data, false, true); - } - } - - if (self.options.paginationInitialPage) { - - self.modules.page.setPage(self.options.paginationInitialPage); - } - } else { - - if (self.options.ajaxURL) { - - self.modules.page.setPage(self.options.paginationInitialPage).then(function () {}).catch(function () {}); - } else { - - self.rowManager.setData([], false, true); - } - } - } else { - - if (self.options.data.length) { - - self.rowManager.setData(self.options.data); - } else { - - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () {}); - } else { - - self.rowManager.setData(self.options.data, false, true); - } - } - } - }; - - //deconstructor - - Tabulator.prototype.destroy = function () { - - var element = this.element; - - Tabulator.prototype.comms.deregister(this); //deregister table from inderdevice communication - - - if (this.options.reactiveData && this.modExists("reactiveData", true)) { - - this.modules.reactiveData.unwatchData(); - } - - //clear row data - - this.rowManager.rows.forEach(function (row) { - - row.wipe(); - }); - - this.rowManager.rows = []; - - this.rowManager.activeRows = []; - - this.rowManager.displayRows = []; - - //clear event bindings - - if (this.options.autoResize && this.modExists("resizeTable")) { - - this.modules.resizeTable.clearBindings(); - } - - if (this.modExists("keybindings")) { - - this.modules.keybindings.clearBindings(); - } - - //clear DOM - - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.classList.remove("tabulator"); - }; - - Tabulator.prototype._detectBrowser = function () { - - var ua = navigator.userAgent || navigator.vendor || window.opera; - - if (ua.indexOf("Trident") > -1) { - - this.browser = "ie"; - - this.browserSlow = true; - } else if (ua.indexOf("Edge") > -1) { - - this.browser = "edge"; - - this.browserSlow = true; - } else if (ua.indexOf("Firefox") > -1) { - - this.browser = "firefox"; - - this.browserSlow = false; - } else { - - this.browser = "other"; - - this.browserSlow = false; - } - - this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.substr(0, 4)); - }; - - ////////////////// Data Handling ////////////////// - - - //block table redrawing - - Tabulator.prototype.blockRedraw = function () { - - return this.rowManager.blockRedraw(); - }; - - //restore table redrawing - - Tabulator.prototype.restoreRedraw = function () { - - return this.rowManager.restoreRedraw(); - }; - - //local data from local file - - Tabulator.prototype.setDataFromLocalFile = function (extensions) { - var _this18 = this; - - return new Promise(function (resolve, reject) { - - var input = document.createElement("input"); - - input.type = "file"; - - input.accept = extensions || ".json,application/json"; - - input.addEventListener("change", function (e) { - - var file = input.files[0], - reader = new FileReader(), - data; - - reader.readAsText(file); - - reader.onload = function (e) { - - try { - - data = JSON.parse(reader.result); - } catch (e) { - - console.warn("File Load Error - File contents is invalid JSON", e); - - reject(e); - - return; - } - - _this18._setData(data).then(function (data) { - - resolve(data); - }).catch(function (err) { - - resolve(err); - }); - }; - - reader.onerror = function (e) { - - console.warn("File Load Error - Unable to read file"); - - reject(); - }; - }); - - input.click(); - }); - }; - - //load data - - Tabulator.prototype.setData = function (data, params, config) { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, false, true); - }; - - Tabulator.prototype._setData = function (data, params, config, inPosition, columnsChanged) { - - var self = this; - - if (typeof data === "string") { - - if (data.indexOf("{") == 0 || data.indexOf("[") == 0) { - - //data is a json encoded string - - return self.rowManager.setData(JSON.parse(data), inPosition, columnsChanged); - } else { - - if (self.modExists("ajax", true)) { - - if (params) { - - self.modules.ajax.setParams(params); - } - - if (config) { - - self.modules.ajax.setConfig(config); - } - - self.modules.ajax.setUrl(data); - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - - self.modules.page.reset(true, true); - - return self.modules.page.setPage(1); - } else { - - //assume data is url, make ajax call to url to get data - - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } - } - } else { - - if (data) { - - //asume data is already an object - - return self.rowManager.setData(data, inPosition, columnsChanged); - } else { - - //no data provided, check if ajaxURL is present; - - if (self.modExists("ajax") && (self.modules.ajax.getUrl || self.options.ajaxURLGenerator)) { - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - - self.modules.page.reset(true, true); - - return self.modules.page.setPage(1); - } else { - - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } else { - - //empty data - - return self.rowManager.setData([], inPosition, columnsChanged); - } - } - } - }; - - //clear data - - Tabulator.prototype.clearData = function () { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - this.rowManager.clearData(); - }; - - //get table data array - - Tabulator.prototype.getData = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getData(active); - }; - - //get table data array count - - Tabulator.prototype.getDataCount = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getDataCount(active); - }; - - //search for specific row components - - Tabulator.prototype.searchRows = function (field, type, value) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.search("rows", field, type, value); - } - }; - - //search for specific data - - Tabulator.prototype.searchData = function (field, type, value) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.search("data", field, type, value); - } - }; - - //get table html - - Tabulator.prototype.getHtml = function (visible, style, config) { - - if (this.modExists("export", true)) { - - return this.modules.export.getHtml(visible, style, config); - } - }; - - //get print html - - Tabulator.prototype.print = function (visible, style, config) { - - if (this.modExists("print", true)) { - - return this.modules.print.printFullscreen(visible, style, config); - } - }; - - //retrieve Ajax URL - - Tabulator.prototype.getAjaxUrl = function () { - - if (this.modExists("ajax", true)) { - - return this.modules.ajax.getUrl(); - } - }; - - //replace data, keeping table in position with same sort - - Tabulator.prototype.replaceData = function (data, params, config) { - - if (this.modExists("ajax")) { - - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, true); - }; - - //update table data - - Tabulator.prototype.updateData = function (data) { - var _this19 = this; - - var self = this; - - var responses = 0; - - return new Promise(function (resolve, reject) { - - if (_this19.modExists("ajax")) { - - _this19.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - data.forEach(function (item) { - - var row = self.rowManager.findRow(item[self.options.index]); - - if (row) { - - responses++; - - row.updateData(item).then(function () { - - responses--; - - if (!responses) { - - resolve(); - } - }); - } - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - Tabulator.prototype.addData = function (data, pos, index) { - var _this20 = this; - - return new Promise(function (resolve, reject) { - - if (_this20.modExists("ajax")) { - - _this20.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - _this20.rowManager.addRows(data, pos, index).then(function (rows) { - - var output = []; - - rows.forEach(function (row) { - - output.push(row.getComponent()); - }); - - resolve(output); - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - //update table data - - Tabulator.prototype.updateOrAddData = function (data) { - var _this21 = this; - - var self = this, - rows = [], - responses = 0; - - return new Promise(function (resolve, reject) { - - if (_this21.modExists("ajax")) { - - _this21.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (data) { - - data.forEach(function (item) { - - var row = self.rowManager.findRow(item[self.options.index]); - - responses++; - - if (row) { - - row.updateData(item).then(function () { - - responses--; - - rows.push(row.getComponent()); - - if (!responses) { - - resolve(rows); - } - }); - } else { - - self.rowManager.addRows(item).then(function (newRows) { - - responses--; - - rows.push(newRows[0].getComponent()); - - if (!responses) { - - resolve(rows); - } - }); - } - }); - } else { - - console.warn("Update Error - No data provided"); - - reject("Update Error - No data provided"); - } - }); - }; - - //get row object - - Tabulator.prototype.getRow = function (index) { - - var row = this.rowManager.findRow(index); - - if (row) { - - return row.getComponent(); - } else { - - console.warn("Find Error - No matching row found:", index); - - return false; - } - }; - - //get row object - - Tabulator.prototype.getRowFromPosition = function (position, active) { - - var row = this.rowManager.getRowFromPosition(position, active); - - if (row) { - - return row.getComponent(); - } else { - - console.warn("Find Error - No matching row found:", position); - - return false; - } - }; - - //delete row from table - - Tabulator.prototype.deleteRow = function (index) { - var _this22 = this; - - return new Promise(function (resolve, reject) { - - var self = _this22, - count = 0, - successCount = 0, - foundRows = []; - - function doneCheck() { - - count++; - - if (count == index.length) { - - if (successCount) { - - self.rowManager.reRenderInPosition(); - - resolve(); - } - } - } - - if (!Array.isArray(index)) { - - index = [index]; - } - - //find matching rows - - index.forEach(function (item) { - - var row = _this22.rowManager.findRow(item, true); - - if (row) { - - foundRows.push(row); - } else { - - console.warn("Delete Error - No matching row found:", item); - - reject("Delete Error - No matching row found"); - - doneCheck(); - } - }); - - //sort rows into correct order to ensure smooth delete from table - - foundRows.sort(function (a, b) { - - return _this22.rowManager.rows.indexOf(a) > _this22.rowManager.rows.indexOf(b) ? 1 : -1; - }); - - foundRows.forEach(function (row) { - - row.delete().then(function () { - - successCount++; - - doneCheck(); - }).catch(function (err) { - - doneCheck(); - - reject(err); - }); - }); - }); - }; - - //add row to table - - Tabulator.prototype.addRow = function (data, pos, index) { - var _this23 = this; - - return new Promise(function (resolve, reject) { - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - _this23.rowManager.addRows(data, pos, index).then(function (rows) { - - //recalc column calculations if present - - if (_this23.modExists("columnCalcs")) { - - _this23.modules.columnCalcs.recalc(_this23.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }); - }); - }; - - //update a row if it exitsts otherwise create it - - Tabulator.prototype.updateOrAddRow = function (index, data) { - var _this24 = this; - - return new Promise(function (resolve, reject) { - - var row = _this24.rowManager.findRow(index); - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (row) { - - row.updateData(data).then(function () { - - //recalc column calculations if present - - if (_this24.modExists("columnCalcs")) { - - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(row.getComponent()); - }).catch(function (err) { - - reject(err); - }); - } else { - - row = _this24.rowManager.addRows(data).then(function (rows) { - - //recalc column calculations if present - - if (_this24.modExists("columnCalcs")) { - - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }).catch(function (err) { - - reject(err); - }); - } - }); - }; - - //update row data - - Tabulator.prototype.updateRow = function (index, data) { - var _this25 = this; - - return new Promise(function (resolve, reject) { - - var row = _this25.rowManager.findRow(index); - - if (typeof data === "string") { - - data = JSON.parse(data); - } - - if (row) { - - row.updateData(data).then(function () { - - resolve(row.getComponent()); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Update Error - No matching row found:", index); - - reject("Update Error - No matching row found"); - } - }); - }; - - //scroll to row in DOM - - Tabulator.prototype.scrollToRow = function (index, position, ifVisible) { - var _this26 = this; - - return new Promise(function (resolve, reject) { - - var row = _this26.rowManager.findRow(index); - - if (row) { - - _this26.rowManager.scrollToRow(row, position, ifVisible).then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Scroll Error - No matching row found:", index); - - reject("Scroll Error - No matching row found"); - } - }); - }; - - Tabulator.prototype.moveRow = function (from, to, after) { - - var fromRow = this.rowManager.findRow(from); - - if (fromRow) { - - fromRow.moveToRow(to, after); - } else { - - console.warn("Move Error - No matching row found:", from); - } - }; - - Tabulator.prototype.getRows = function (active) { - - if (active === true) { - - console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"); - - active = "active"; - } - - return this.rowManager.getComponents(active); - }; - - //get position of row in table - - Tabulator.prototype.getRowPosition = function (index, active) { - - var row = this.rowManager.findRow(index); - - if (row) { - - return this.rowManager.getRowPosition(row, active); - } else { - - console.warn("Position Error - No matching row found:", index); - - return false; - } - }; - - //copy table data to clipboard - - Tabulator.prototype.copyToClipboard = function (selector) { - - if (this.modExists("clipboard", true)) { - - this.modules.clipboard.copy(selector); - } - }; - - /////////////// Column Functions /////////////// - - - Tabulator.prototype.setColumns = function (definition) { - - this.columnManager.setColumns(definition); - }; - - Tabulator.prototype.getColumns = function (structured) { - - return this.columnManager.getComponents(structured); - }; - - Tabulator.prototype.getColumn = function (field) { - - var col = this.columnManager.findColumn(field); - - if (col) { - - return col.getComponent(); - } else { - - console.warn("Find Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.getColumnDefinitions = function () { - - return this.columnManager.getDefinitionTree(); - }; - - Tabulator.prototype.getColumnLayout = function () { - - if (this.modExists("persistence", true)) { - - return this.modules.persistence.parseColumns(this.columnManager.getColumns()); - } - }; - - Tabulator.prototype.setColumnLayout = function (layout) { - - if (this.modExists("persistence", true)) { - - this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns, layout)); - - return true; - } - - return false; - }; - - Tabulator.prototype.showColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - column.show(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - - this.modules.responsiveLayout.update(); - } - } else { - - console.warn("Column Show Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.hideColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - column.hide(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - - this.modules.responsiveLayout.update(); - } - } else { - - console.warn("Column Hide Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.toggleColumn = function (field) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - if (column.visible) { - - column.hide(); - } else { - - column.show(); - } - } else { - - console.warn("Column Visibility Toggle Error - No matching column found:", field); - - return false; - } - }; - - Tabulator.prototype.addColumn = function (definition, before, field) { - var _this27 = this; - - return new Promise(function (resolve, reject) { - - var column = _this27.columnManager.findColumn(field); - - _this27.columnManager.addColumn(definition, before, column).then(function (column) { - - resolve(column.getComponent()); - }).catch(function (err) { - - reject(err); - }); - }); - }; - - Tabulator.prototype.deleteColumn = function (field) { - var _this28 = this; - - return new Promise(function (resolve, reject) { - - var column = _this28.columnManager.findColumn(field); - - if (column) { - - column.delete().then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Delete Error - No matching column found:", field); - - reject(); - } - }); - }; - - Tabulator.prototype.updateColumnDefinition = function (field, definition) { - var _this29 = this; - - return new Promise(function (resolve, reject) { - - var column = _this29.columnManager.findColumn(field); - - if (column) { - - column.updateDefinition(definition).then(function (col) { - - resolve(col); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Column Update Error - No matching column found:", field); - - reject(); - } - }); - }; - - Tabulator.prototype.moveColumn = function (from, to, after) { - - var fromColumn = this.columnManager.findColumn(from); - - var toColumn = this.columnManager.findColumn(to); - - if (fromColumn) { - - if (toColumn) { - - this.columnManager.moveColumn(fromColumn, toColumn, after); - } else { - - console.warn("Move Error - No matching column found:", toColumn); - } - } else { - - console.warn("Move Error - No matching column found:", from); - } - }; - - //scroll to column in DOM - - Tabulator.prototype.scrollToColumn = function (field, position, ifVisible) { - var _this30 = this; - - return new Promise(function (resolve, reject) { - - var column = _this30.columnManager.findColumn(field); - - if (column) { - - _this30.columnManager.scrollToColumn(column, position, ifVisible).then(function () { - - resolve(); - }).catch(function (err) { - - reject(err); - }); - } else { - - console.warn("Scroll Error - No matching column found:", field); - - reject("Scroll Error - No matching column found"); - } - }); - }; - - //////////// Localization Functions //////////// - - Tabulator.prototype.setLocale = function (locale) { - - this.modules.localize.setLocale(locale); - }; - - Tabulator.prototype.getLocale = function () { - - return this.modules.localize.getLocale(); - }; - - Tabulator.prototype.getLang = function (locale) { - - return this.modules.localize.getLang(locale); - }; - - //////////// General Public Functions //////////// - - - //redraw list without updating data - - Tabulator.prototype.redraw = function (force) { - - this.columnManager.redraw(force); - - this.rowManager.redraw(force); - }; - - Tabulator.prototype.setHeight = function (height) { - - if (this.rowManager.renderMode !== "classic") { - - this.options.height = isNaN(height) ? height : height + "px"; - - this.element.style.height = this.options.height; - - this.rowManager.setRenderMode(); - - this.rowManager.redraw(); - } else { - - console.warn("setHeight function is not available in classic render mode"); - } - }; - - ///////////////////// Sorting //////////////////// - - - //trigger sort - - Tabulator.prototype.setSort = function (sortList, dir) { - - if (this.modExists("sort", true)) { - - this.modules.sort.setSort(sortList, dir); - - this.rowManager.sorterRefresh(); - } - }; - - Tabulator.prototype.getSorters = function () { - - if (this.modExists("sort", true)) { - - return this.modules.sort.getSort(); - } - }; - - Tabulator.prototype.clearSort = function () { - - if (this.modExists("sort", true)) { - - this.modules.sort.clear(); - - this.rowManager.sorterRefresh(); - } - }; - - ///////////////////// Filtering //////////////////// - - - //set standard filters - - Tabulator.prototype.setFilter = function (field, type, value, params) { - - if (this.modExists("filter", true)) { - - this.modules.filter.setFilter(field, type, value, params); - - this.rowManager.filterRefresh(); - } - }; - - //add filter to array - - Tabulator.prototype.addFilter = function (field, type, value, params) { - - if (this.modExists("filter", true)) { - - this.modules.filter.addFilter(field, type, value, params); - - this.rowManager.filterRefresh(); - } - }; - - //get all filters - - Tabulator.prototype.getFilters = function (all) { - - if (this.modExists("filter", true)) { - - return this.modules.filter.getFilters(all); - } - }; - - Tabulator.prototype.setHeaderFilterFocus = function (field) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - this.modules.filter.setHeaderFilterFocus(column); - } else { - - console.warn("Column Filter Focus Error - No matching column found:", field); - - return false; - } - } - }; - - Tabulator.prototype.getHeaderFilterValue = function (field) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - return this.modules.filter.getHeaderFilterValue(column); - } else { - - console.warn("Column Filter Error - No matching column found:", field); - } - } - }; - - Tabulator.prototype.setHeaderFilterValue = function (field, value) { - - if (this.modExists("filter", true)) { - - var column = this.columnManager.findColumn(field); - - if (column) { - - this.modules.filter.setHeaderFilterValue(column, value); - } else { - - console.warn("Column Filter Error - No matching column found:", field); - - return false; - } - } - }; - - Tabulator.prototype.getHeaderFilters = function () { - - if (this.modExists("filter", true)) { - - return this.modules.filter.getHeaderFilters(); - } - }; - - //remove filter from array - - Tabulator.prototype.removeFilter = function (field, type, value) { - - if (this.modExists("filter", true)) { - - this.modules.filter.removeFilter(field, type, value); - - this.rowManager.filterRefresh(); - } - }; - - //clear filters - - Tabulator.prototype.clearFilter = function (all) { - - if (this.modExists("filter", true)) { - - this.modules.filter.clearFilter(all); - - this.rowManager.filterRefresh(); - } - }; - - //clear header filters - - Tabulator.prototype.clearHeaderFilter = function () { - - if (this.modExists("filter", true)) { - - this.modules.filter.clearHeaderFilter(); - - this.rowManager.filterRefresh(); - } - }; - - ///////////////////// select //////////////////// - - Tabulator.prototype.selectRow = function (rows) { - - if (this.modExists("selectRow", true)) { - - if (rows === true) { - - console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"); - - rows = "active"; - } - - this.modules.selectRow.selectRows(rows); - } - }; - - Tabulator.prototype.deselectRow = function (rows) { - - if (this.modExists("selectRow", true)) { - - this.modules.selectRow.deselectRows(rows); - } - }; - - Tabulator.prototype.toggleSelectRow = function (row) { - - if (this.modExists("selectRow", true)) { - - this.modules.selectRow.toggleRow(row); - } - }; - - Tabulator.prototype.getSelectedRows = function () { - - if (this.modExists("selectRow", true)) { - - return this.modules.selectRow.getSelectedRows(); - } - }; - - Tabulator.prototype.getSelectedData = function () { - - if (this.modExists("selectRow", true)) { - - return this.modules.selectRow.getSelectedData(); - } - }; - - ///////////////////// validation //////////////////// - - Tabulator.prototype.getInvalidCells = function () { - - if (this.modExists("validate", true)) { - - return this.modules.validate.getInvalidCells(); - } - }; - - Tabulator.prototype.clearCellValidation = function (cells) { - var _this31 = this; - - if (this.modExists("validate", true)) { - - if (!cells) { - - cells = this.modules.validate.getInvalidCells(); - } - - if (!Array.isArray(cells)) { - - cells = [cells]; - } - - cells.forEach(function (cell) { - - _this31.modules.validate.clearValidation(cell._getSelf()); - }); - } - }; - - Tabulator.prototype.validate = function (cells) { - - var output = []; - - //clear row data - - this.rowManager.rows.forEach(function (row) { - - var valid = row.validate(); - - if (valid !== true) { - - output = output.concat(valid); - } - }); - - return output.length ? output : true; - }; - - //////////// Pagination Functions //////////// - - - Tabulator.prototype.setMaxPage = function (max) { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.setMaxPage(max); - } else { - - return false; - } - }; - - Tabulator.prototype.setPage = function (page) { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.setPage(page); - } else { - - return new Promise(function (resolve, reject) { - reject(); - }); - } - }; - - Tabulator.prototype.setPageToRow = function (row) { - var _this32 = this; - - return new Promise(function (resolve, reject) { - - if (_this32.options.pagination && _this32.modExists("page")) { - - row = _this32.rowManager.findRow(row); - - if (row) { - - _this32.modules.page.setPageToRow(row).then(function () { - - resolve(); - }).catch(function () { - - reject(); - }); - } else { - - reject(); - } - } else { - - reject(); - } - }); - }; - - Tabulator.prototype.setPageSize = function (size) { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.setPageSize(size); - - this.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else { - - return false; - } - }; - - Tabulator.prototype.getPageSize = function () { - - if (this.options.pagination && this.modExists("page", true)) { - - return this.modules.page.getPageSize(); - } - }; - - Tabulator.prototype.previousPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.previousPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.nextPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - this.modules.page.nextPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.getPage = function () { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.getPage(); - } else { - - return false; - } - }; - - Tabulator.prototype.getPageMax = function () { - - if (this.options.pagination && this.modExists("page")) { - - return this.modules.page.getPageMax(); - } else { - - return false; - } - }; - - ///////////////// Grouping Functions /////////////// - - - Tabulator.prototype.setGroupBy = function (groups) { - - if (this.modExists("groupRows", true)) { - - this.options.groupBy = groups; - - this.modules.groupRows.initialize(); - - this.rowManager.refreshActiveData("display"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.setGroupStartOpen = function (values) { - - if (this.modExists("groupRows", true)) { - - this.options.groupStartOpen = values; - - this.modules.groupRows.initialize(); - - if (this.options.groupBy) { - - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.setGroupHeader = function (values) { - - if (this.modExists("groupRows", true)) { - - this.options.groupHeader = values; - - this.modules.groupRows.initialize(); - - if (this.options.groupBy) { - - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - - this.modules.persistence.save("group"); - } - } else { - - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - - return false; - } - }; - - Tabulator.prototype.getGroups = function (values) { - - if (this.modExists("groupRows", true)) { - - return this.modules.groupRows.getGroups(true); - } else { - - return false; - } - }; - - // get grouped table data in the same format as getData() - - Tabulator.prototype.getGroupedData = function () { - - if (this.modExists("groupRows", true)) { - - return this.options.groupBy ? this.modules.groupRows.getGroupedData() : this.getData(); - } - }; - - Tabulator.prototype.getEditedCells = function () { - - if (this.modExists("edit", true)) { - - return this.modules.edit.getEditedCells(); - } - }; - - Tabulator.prototype.clearCellEdited = function (cells) { - var _this33 = this; - - if (this.modExists("edit", true)) { - - if (!cells) { - - cells = this.modules.edit.getEditedCells(); - } - - if (!Array.isArray(cells)) { - - cells = [cells]; - } - - cells.forEach(function (cell) { - - _this33.modules.edit.clearEdited(cell._getSelf()); - }); - } - }; - - ///////////////// Column Calculation Functions /////////////// - - Tabulator.prototype.getCalcResults = function () { - - if (this.modExists("columnCalcs", true)) { - - return this.modules.columnCalcs.getResults(); - } else { - - return false; - } - }; - - Tabulator.prototype.recalc = function () { - - if (this.modExists("columnCalcs", true)) { - - this.modules.columnCalcs.recalcAll(this.rowManager.activeRows); - } - }; - - /////////////// Navigation Management ////////////// - - - Tabulator.prototype.navigatePrev = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - return cell.nav().prev(); - } - } - - return false; - }; - - Tabulator.prototype.navigateNext = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - return cell.nav().next(); - } - } - - return false; - }; - - Tabulator.prototype.navigateLeft = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().left(); - } - } - - return false; - }; - - Tabulator.prototype.navigateRight = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().right(); - } - } - - return false; - }; - - Tabulator.prototype.navigateUp = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().up(); - } - } - - return false; - }; - - Tabulator.prototype.navigateDown = function () { - - var cell = false; - - if (this.modExists("edit", true)) { - - cell = this.modules.edit.currentCell; - - if (cell) { - - e.preventDefault(); - - return cell.nav().down(); - } - } - - return false; - }; - - /////////////// History Management ////////////// - - Tabulator.prototype.undo = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.undo(); - } else { - - return false; - } - }; - - Tabulator.prototype.redo = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.redo(); - } else { - - return false; - } - }; - - Tabulator.prototype.getHistoryUndoSize = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.getHistoryUndoSize(); - } else { - - return false; - } - }; - - Tabulator.prototype.getHistoryRedoSize = function () { - - if (this.options.history && this.modExists("history", true)) { - - return this.modules.history.getHistoryRedoSize(); - } else { - - return false; - } - }; - - /////////////// Download Management ////////////// - - - Tabulator.prototype.download = function (type, filename, options, active) { - - if (this.modExists("download", true)) { - - this.modules.download.download(type, filename, options, active); - } - }; - - Tabulator.prototype.downloadToTab = function (type, filename, options, active) { - - if (this.modExists("download", true)) { - - this.modules.download.download(type, filename, options, active, true); - } - }; - - /////////// Inter Table Communications /////////// - - - Tabulator.prototype.tableComms = function (table, module, action, data) { - - this.modules.comms.receive(table, module, action, data); - }; - - ////////////// Extension Management ////////////// - - - //object to hold module - - Tabulator.prototype.moduleBindings = {}; - - //extend module - - Tabulator.prototype.extendModule = function (name, property, values) { - - if (Tabulator.prototype.moduleBindings[name]) { - - var source = Tabulator.prototype.moduleBindings[name].prototype[property]; - - if (source) { - - if ((typeof values === 'undefined' ? 'undefined' : _typeof(values)) == "object") { - - for (var key in values) { - - source[key] = values[key]; - } - } else { - - console.warn("Module Error - Invalid value type, it must be an object"); - } - } else { - - console.warn("Module Error - property does not exist:", property); - } - } else { - - console.warn("Module Error - module does not exist:", name); - } - }; - - //add module to tabulator - - Tabulator.prototype.registerModule = function (name, module) { - - var self = this; - - Tabulator.prototype.moduleBindings[name] = module; - }; - - //ensure that module are bound to instantiated function - - Tabulator.prototype.bindModules = function () { - - this.modules = {}; - - for (var name in Tabulator.prototype.moduleBindings) { - - this.modules[name] = new Tabulator.prototype.moduleBindings[name](this); - } - }; - - //Check for module - - Tabulator.prototype.modExists = function (plugin, required) { - - if (this.modules[plugin]) { - - return true; - } else { - - if (required) { - - console.error("Tabulator Module Not Installed: " + plugin); - } - - return false; - } - }; - - Tabulator.prototype.helpers = { - - elVisible: function elVisible(el) { - - return !(el.offsetWidth <= 0 && el.offsetHeight <= 0); - }, - - elOffset: function elOffset(el) { - - var box = el.getBoundingClientRect(); - - return { - - top: box.top + window.pageYOffset - document.documentElement.clientTop, - - left: box.left + window.pageXOffset - document.documentElement.clientLeft - - }; - }, - - deepClone: function deepClone(obj) { - - var clone = Array.isArray(obj) ? [] : {}; - - for (var i in obj) { - - if (obj[i] != null && _typeof(obj[i]) === "object") { - - if (obj[i] instanceof Date) { - - clone[i] = new Date(obj[i]); - } else { - - clone[i] = this.deepClone(obj[i]); - } - } else { - - clone[i] = obj[i]; - } - } - - return clone; - } - - }; - - Tabulator.prototype.comms = { - - tables: [], - - register: function register(table) { - - Tabulator.prototype.comms.tables.push(table); - }, - - deregister: function deregister(table) { - - var index = Tabulator.prototype.comms.tables.indexOf(table); - - if (index > -1) { - - Tabulator.prototype.comms.tables.splice(index, 1); - } - }, - - lookupTable: function lookupTable(query, silent) { - - var results = [], - matches, - match; - - if (typeof query === "string") { - - matches = document.querySelectorAll(query); - - if (matches.length) { - - for (var i = 0; i < matches.length; i++) { - - match = Tabulator.prototype.comms.matchElement(matches[i]); - - if (match) { - - results.push(match); - } - } - } - } else if (typeof HTMLElement !== "undefined" && query instanceof HTMLElement || query instanceof Tabulator) { - - match = Tabulator.prototype.comms.matchElement(query); - - if (match) { - - results.push(match); - } - } else if (Array.isArray(query)) { - - query.forEach(function (item) { - - results = results.concat(Tabulator.prototype.comms.lookupTable(item)); - }); - } else { - - if (!silent) { - - console.warn("Table Connection Error - Invalid Selector", query); - } - } - - return results; - }, - - matchElement: function matchElement(element) { - - return Tabulator.prototype.comms.tables.find(function (table) { - - return element instanceof Tabulator ? table === element : table.element === element; - }); - } - - }; - - Tabulator.prototype.findTable = function (query) { - - var results = Tabulator.prototype.comms.lookupTable(query, true); - - return Array.isArray(results) && !results.length ? false : results; - }; - - var Layout = function Layout(table) { - - this.table = table; - - this.mode = null; - }; - - //initialize layout system - - - Layout.prototype.initialize = function (layout) { - - if (this.modes[layout]) { - - this.mode = layout; - } else { - - console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : " + layout); - - this.mode = 'fitData'; - } - - this.table.element.setAttribute("tabulator-layout", this.mode); - }; - - Layout.prototype.getMode = function () { - - return this.mode; - }; - - //trigger table layout - - - Layout.prototype.layout = function () { - - this.modes[this.mode].call(this, this.table.columnManager.columnsByIndex); - }; - - //layout render functions - - - Layout.prototype.modes = { - - //resize columns to fit data they contain - - - "fitData": function fitData(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data they contain and stretch row to fill table - - - "fitDataFill": function fitDataFill(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data they contain - - - "fitDataTable": function fitDataTable(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch last column to fill table - - - "fitDataStretch": function fitDataStretch(columns) { - var _this34 = this; - - var colsWidth = 0, - tableWidth = this.table.rowManager.element.clientWidth, - gap = 0, - lastCol = false; - - columns.forEach(function (column, i) { - - if (!column.widthFixed) { - - column.reinitializeWidth(); - } - - if (_this34.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible) { - - lastCol = column; - } - - if (column.visible) { - - colsWidth += column.getWidth(); - } - }); - - if (lastCol) { - - gap = tableWidth - colsWidth + lastCol.getWidth(); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - lastCol.setWidth(0); - - this.table.modules.responsiveLayout.update(); - } - - if (gap > 0) { - - lastCol.setWidth(gap); - } else { - - lastCol.reinitializeWidth(); - } - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - }, - - //resize columns to fit - - - "fitColumns": function fitColumns(columns) { - - var self = this; - - var totalWidth = self.table.element.clientWidth; //table element width - - - var fixedWidth = 0; //total width of columns with a defined width - - - var flexWidth = 0; //total width available to flexible columns - - - var flexGrowUnits = 0; //total number of widthGrow blocks accross all columns - - - var flexColWidth = 0; //desired width of flexible columns - - - var flexColumns = []; //array of flexible width columns - - - var fixedShrinkColumns = []; //array of fixed width columns that can shrink - - - var flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns - - - var overflowWidth = 0; //horizontal overflow width - - - var gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps - - - function calcWidth(width) { - - var colWidth; - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - return colWidth; - } - - //ensure columns resize to take up the correct amount of space - - - function scaleColumns(columns, freeSpace, colWidth, shrinkCols) { - - var oversizeCols = [], - oversizeSpace = 0, - remainingSpace = 0, - nextColWidth = 0, - gap = 0, - changeUnits = 0, - undersizeCols = []; - - function calcGrow(col) { - - return colWidth * (col.column.definition.widthGrow || 1); - } - - function calcShrink(col) { - - return calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0); - } - - columns.forEach(function (col, i) { - - var width = shrinkCols ? calcShrink(col) : calcGrow(col); - - if (col.column.minWidth >= width) { - - oversizeCols.push(col); - } else { - - undersizeCols.push(col); - - changeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1; - } - }); - - if (oversizeCols.length) { - - oversizeCols.forEach(function (col) { - - oversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth; - - col.width = col.column.minWidth; - }); - - remainingSpace = freeSpace - oversizeSpace; - - nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace; - - gap = remainingSpace - nextColWidth * changeUnits; - - gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); - } else { - - gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace; - - undersizeCols.forEach(function (column) { - - column.width = shrinkCols ? calcShrink(column) : calcGrow(column); - }); - } - - return gap; - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - - //adjust for vertical scrollbar if present - - - if (this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight) { - - totalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth; - } - - columns.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width; - - minWidth = parseInt(column.minWidth); - - if (width) { - - colWidth = calcWidth(width); - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - - if (column.definition.widthShrink) { - - fixedShrinkColumns.push({ - - column: column, - - width: colWidth > minWidth ? colWidth : minWidth - - }); - - flexShrinkUnits += column.definition.widthShrink; - } - } else { - - flexColumns.push({ - - column: column, - - width: 0 - - }); - - flexGrowUnits += column.definition.widthGrow || 1; - } - } - }); - - //calculate available space - - - flexWidth = totalWidth - fixedWidth; - - //calculate correct column size - - - flexColWidth = Math.floor(flexWidth / flexGrowUnits); - - //generate column widths - - - var gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); - - //increase width of last column to account for rounding errors - - - if (flexColumns.length && gapFill > 0) { - - flexColumns[flexColumns.length - 1].width += +gapFill; - } - - //caculate space for columns to be shrunk into - - - flexColumns.forEach(function (col) { - - flexWidth -= col.width; - }); - - overflowWidth = Math.abs(gapFill) + flexWidth; - - //shrink oversize columns if there is no available space - - - if (overflowWidth > 0 && flexShrinkUnits) { - - gapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true); - } - - //decrease width of last column to account for rounding errors - - - if (fixedShrinkColumns.length) { - - fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill; - } - - flexColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - - fixedShrinkColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - } - - }; - - Tabulator.prototype.registerModule("layout", Layout); - - var Localize = function Localize(table) { - - this.table = table; //hold Tabulator object - - this.locale = "default"; //current locale - - this.lang = false; //current language - - this.bindings = {}; //update events to call when locale is changed - }; - - //set header placehoder - - Localize.prototype.setHeaderFilterPlaceholder = function (placeholder) { - - this.langs.default.headerFilters.default = placeholder; - }; - - //set header filter placeholder by column - - Localize.prototype.setHeaderFilterColumnPlaceholder = function (column, placeholder) { - - this.langs.default.headerFilters.columns[column] = placeholder; - - if (this.lang && !this.lang.headerFilters.columns[column]) { - - this.lang.headerFilters.columns[column] = placeholder; - } - }; - - //setup a lang description object - - Localize.prototype.installLang = function (locale, lang) { - - if (this.langs[locale]) { - - this._setLangProp(this.langs[locale], lang); - } else { - - this.langs[locale] = lang; - } - }; - - Localize.prototype._setLangProp = function (lang, values) { - - for (var key in values) { - - if (lang[key] && _typeof(lang[key]) == "object") { - - this._setLangProp(lang[key], values[key]); - } else { - - lang[key] = values[key]; - } - } - }; - - //set current locale - - Localize.prototype.setLocale = function (desiredLocale) { - - var self = this; - - desiredLocale = desiredLocale || "default"; - - //fill in any matching languge values - - function traverseLang(trans, path) { - - for (var prop in trans) { - - if (_typeof(trans[prop]) == "object") { - - if (!path[prop]) { - - path[prop] = {}; - } - - traverseLang(trans[prop], path[prop]); - } else { - - path[prop] = trans[prop]; - } - } - } - - //determing correct locale to load - - if (desiredLocale === true && navigator.language) { - - //get local from system - - desiredLocale = navigator.language.toLowerCase(); - } - - if (desiredLocale) { - - //if locale is not set, check for matching top level locale else use default - - if (!self.langs[desiredLocale]) { - - var prefix = desiredLocale.split("-")[0]; - - if (self.langs[prefix]) { - - console.warn("Localization Error - Exact matching locale not found, using closest match: ", desiredLocale, prefix); - - desiredLocale = prefix; - } else { - - console.warn("Localization Error - Matching locale not found, using default: ", desiredLocale); - - desiredLocale = "default"; - } - } - } - - self.locale = desiredLocale; - - //load default lang template - - self.lang = Tabulator.prototype.helpers.deepClone(self.langs.default || {}); - - if (desiredLocale != "default") { - - traverseLang(self.langs[desiredLocale], self.lang); - } - - self.table.options.localized.call(self.table, self.locale, self.lang); - - self._executeBindings(); - }; - - //get current locale - - Localize.prototype.getLocale = function (locale) { - - return self.locale; - }; - - //get lang object for given local or current if none provided - - Localize.prototype.getLang = function (locale) { - - return locale ? this.langs[locale] : this.lang; - }; - - //get text for current locale - - Localize.prototype.getText = function (path, value) { - - var path = value ? path + "|" + value : path, - pathArray = path.split("|"), - text = this._getLangElement(pathArray, this.locale); - - // if(text === false){ - - // console.warn("Localization Error - Matching localized text not found for given path: ", path); - - // } - - - return text || ""; - }; - - //traverse langs object and find localized copy - - Localize.prototype._getLangElement = function (path, locale) { - - var self = this; - - var root = self.lang; - - path.forEach(function (level) { - - var rootPath; - - if (root) { - - rootPath = root[level]; - - if (typeof rootPath != "undefined") { - - root = rootPath; - } else { - - root = false; - } - } - }); - - return root; - }; - - //set update binding - - Localize.prototype.bind = function (path, callback) { - - if (!this.bindings[path]) { - - this.bindings[path] = []; - } - - this.bindings[path].push(callback); - - callback(this.getText(path), this.lang); - }; - - //itterate through bindings and trigger updates - - Localize.prototype._executeBindings = function () { - - var self = this; - - var _loop = function _loop(path) { - - self.bindings[path].forEach(function (binding) { - - binding(self.getText(path), self.lang); - }); - }; - - for (var path in self.bindings) { - _loop(path); - } - }; - - //Localized text listings - - Localize.prototype.langs = { - - "default": { //hold default locale text - - "groups": { - - "item": "item", - - "items": "items" - - }, - - "columns": {}, - - "ajax": { - - "loading": "Loading", - - "error": "Error" - - }, - - "pagination": { - - "page_size": "Page Size", - - "page_title": "Show Page", - - "first": "First", - - "first_title": "First Page", - - "last": "Last", - - "last_title": "Last Page", - - "prev": "Prev", - - "prev_title": "Prev Page", - - "next": "Next", - - "next_title": "Next Page", - - "all": "All" - - }, - - "headerFilters": { - - "default": "filter column...", - - "columns": {} - - } - - } - - }; - - Tabulator.prototype.registerModule("localize", Localize); - - var Comms = function Comms(table) { - - this.table = table; - }; - - Comms.prototype.getConnections = function (selectors) { - - var self = this, - connections = [], - connection; - - connection = Tabulator.prototype.comms.lookupTable(selectors); - - connection.forEach(function (con) { - - if (self.table !== con) { - - connections.push(con); - } - }); - - return connections; - }; - - Comms.prototype.send = function (selectors, module, action, data) { - - var self = this, - connections = this.getConnections(selectors); - - connections.forEach(function (connection) { - - connection.tableComms(self.table.element, module, action, data); - }); - - if (!connections.length && selectors) { - - console.warn("Table Connection Error - No tables matching selector found", selectors); - } - }; - - Comms.prototype.receive = function (table, module, action, data) { - - if (this.table.modExists(module)) { - - return this.table.modules[module].commsReceived(table, action, data); - } else { - - console.warn("Inter-table Comms Error - no such module:", module); - } - }; - - Tabulator.prototype.registerModule("comms", Comms); - - var Accessor = function Accessor(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"]; //list of accessor types - }; - - //initialize column accessor - Accessor.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)), - accessor; - - if (column.definition[key]) { - accessor = self.lookupAccessor(column.definition[key]); - - if (accessor) { - match = true; - - config[key] = { - accessor: accessor, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.accessor = config; - } - }; - - Accessor.prototype.lookupAccessor = function (value) { - var accessor = false; - - //set column accessor - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - if (this.accessors[value]) { - accessor = this.accessors[value]; - } else { - console.warn("Accessor Error - No such accessor found, ignoring: ", value); - } - break; - - case "function": - accessor = value; - break; - } - - return accessor; - }; - - //apply accessor to row - Accessor.prototype.transformRow = function (dataIn, type) { - var self = this, - key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)); - - //clone data object with deep copy to isolate internal data from returned result - var data = Tabulator.prototype.helpers.deepClone(dataIn || {}); - - self.table.columnManager.traverse(function (column) { - var value, accessor, params, component; - - if (column.modules.accessor) { - - accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false; - - if (accessor) { - value = column.getFieldValue(data); - - if (value != "undefined") { - component = column.getComponent(); - params = typeof accessor.params === "function" ? accessor.params(value, data, type, component) : accessor.params; - column.setFieldValue(data, accessor.accessor(value, data, type, params, component)); - } - } - } - }); - - return data; - }, - - //default accessors - Accessor.prototype.accessors = {}; - - Tabulator.prototype.registerModule("accessor", Accessor); - var Ajax = function Ajax(table) { - - this.table = table; //hold Tabulator object - this.config = false; //hold config object for ajax request - this.url = ""; //request URL - this.urlGenerator = false; - this.params = false; //request parameters - - this.loaderElement = this.createLoaderElement(); //loader message div - this.msgElement = this.createMsgElement(); //message element - this.loadingElement = false; - this.errorElement = false; - this.loaderPromise = false; - - this.progressiveLoad = false; - this.loading = false; - - this.requestOrder = 0; //prevent requests comming out of sequence if overridden by another load request - }; - - //initialize setup options - Ajax.prototype.initialize = function () { - var template; - - this.loaderElement.appendChild(this.msgElement); - - if (this.table.options.ajaxLoaderLoading) { - if (typeof this.table.options.ajaxLoaderLoading == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderLoading.trim(); - this.loadingElement = template.content.firstChild; - } else { - this.loadingElement = this.table.options.ajaxLoaderLoading; - } - } - - this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise; - - this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator; - - if (this.table.options.ajaxLoaderError) { - if (typeof this.table.options.ajaxLoaderError == "string") { - template = document.createElement('template'); - template.innerHTML = this.table.options.ajaxLoaderError.trim(); - this.errorElement = template.content.firstChild; - } else { - this.errorElement = this.table.options.ajaxLoaderError; - } - } - - if (this.table.options.ajaxParams) { - this.setParams(this.table.options.ajaxParams); - } - - if (this.table.options.ajaxConfig) { - this.setConfig(this.table.options.ajaxConfig); - } - - if (this.table.options.ajaxURL) { - this.setUrl(this.table.options.ajaxURL); - } - - if (this.table.options.ajaxProgressiveLoad) { - if (this.table.options.pagination) { - this.progressiveLoad = false; - console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"); - } else { - if (this.table.modExists("page")) { - this.progressiveLoad = this.table.options.ajaxProgressiveLoad; - this.table.modules.page.initializeProgressive(this.progressiveLoad); - } else { - console.error("Pagination plugin is required for progressive ajax loading"); - } - } - } - }; - - Ajax.prototype.createLoaderElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-loader"); - return el; - }; - - Ajax.prototype.createMsgElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-loader-msg"); - el.setAttribute("role", "alert"); - - return el; - }; - - //set ajax params - Ajax.prototype.setParams = function (params, update) { - if (update) { - this.params = this.params || {}; - - for (var key in params) { - this.params[key] = params[key]; - } - } else { - this.params = params; - } - }; - - Ajax.prototype.getParams = function () { - return this.params || {}; - }; - - //load config object - Ajax.prototype.setConfig = function (config) { - this._loadDefaultConfig(); - - if (typeof config == "string") { - this.config.method = config; - } else { - for (var key in config) { - this.config[key] = config[key]; - } - } - }; - - //create config object from default - Ajax.prototype._loadDefaultConfig = function (force) { - var self = this; - if (!self.config || force) { - - self.config = {}; - - //load base config from defaults - for (var key in self.defaultConfig) { - self.config[key] = self.defaultConfig[key]; - } - } - }; - - //set request url - Ajax.prototype.setUrl = function (url) { - this.url = url; - }; - - //get request url - Ajax.prototype.getUrl = function () { - return this.url; - }; - - //lstandard loading function - Ajax.prototype.loadData = function (inPosition, columnsChanged) { - var self = this; - - if (this.progressiveLoad) { - return this._loadDataProgressive(); - } else { - return this._loadDataStandard(inPosition, columnsChanged); - } - }; - - Ajax.prototype.nextPage = function (diff) { - var margin; - - if (!this.loading) { - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.getElement().clientHeight * 2; - - if (diff < margin) { - this.table.modules.page.nextPage().then(function () {}).catch(function () {}); - } - } - }; - - Ajax.prototype.blockActiveRequest = function () { - this.requestOrder++; - }; - - Ajax.prototype._loadDataProgressive = function () { - this.table.rowManager.setData([]); - return this.table.modules.page.setPage(1); - }; - - Ajax.prototype._loadDataStandard = function (inPosition, columnsChanged) { - var _this35 = this; - - return new Promise(function (resolve, reject) { - _this35.sendRequest(inPosition).then(function (data) { - _this35.table.rowManager.setData(data, inPosition, columnsChanged).then(function () { - resolve(); - }).catch(function (e) { - reject(e); - }); - }).catch(function (e) { - reject(e); - }); - }); - }; - - Ajax.prototype.generateParamsList = function (data, prefix) { - var self = this, - output = []; - - prefix = prefix || ""; - - if (Array.isArray(data)) { - data.forEach(function (item, i) { - output = output.concat(self.generateParamsList(item, prefix ? prefix + "[" + i + "]" : i)); - }); - } else if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === "object") { - for (var key in data) { - output = output.concat(self.generateParamsList(data[key], prefix ? prefix + "[" + key + "]" : key)); - } - } else { - output.push({ key: prefix, value: data }); - } - - return output; - }; - - Ajax.prototype.serializeParams = function (params) { - var output = this.generateParamsList(params), - encoded = []; - - output.forEach(function (item) { - encoded.push(encodeURIComponent(item.key) + "=" + encodeURIComponent(item.value)); - }); - - return encoded.join("&"); - }; - - //send ajax request - Ajax.prototype.sendRequest = function (silent) { - var _this36 = this; - - var self = this, - url = self.url, - requestNo, - esc, - query; - - self.requestOrder++; - requestNo = self.requestOrder; - - self._loadDefaultConfig(); - - return new Promise(function (resolve, reject) { - if (self.table.options.ajaxRequesting.call(_this36.table, self.url, self.params) !== false) { - - self.loading = true; - - if (!silent) { - self.showLoader(); - } - - _this36.loaderPromise(url, self.config, self.params).then(function (data) { - if (requestNo === self.requestOrder) { - if (self.table.options.ajaxResponse) { - data = self.table.options.ajaxResponse.call(self.table, self.url, self.params, data); - } - resolve(data); - - self.hideLoader(); - self.loading = false; - } else { - console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"); - } - }).catch(function (error) { - console.error("Ajax Load Error: ", error); - self.table.options.ajaxError.call(self.table, error); - - self.showError(); - - setTimeout(function () { - self.hideLoader(); - }, 3000); - - self.loading = false; - - reject(); - }); - } else { - reject(); - } - }); - }; - - Ajax.prototype.showLoader = function () { - var shouldLoad = typeof this.table.options.ajaxLoader === "function" ? this.table.options.ajaxLoader() : this.table.options.ajaxLoader; - - if (shouldLoad) { - - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-error"); - this.msgElement.classList.add("tabulator-loading"); - - if (this.loadingElement) { - this.msgElement.appendChild(this.loadingElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|loading"); - } - - this.table.element.appendChild(this.loaderElement); - } - }; - - Ajax.prototype.showError = function () { - this.hideLoader(); - - while (this.msgElement.firstChild) { - this.msgElement.removeChild(this.msgElement.firstChild); - }this.msgElement.classList.remove("tabulator-loading"); - this.msgElement.classList.add("tabulator-error"); - - if (this.errorElement) { - this.msgElement.appendChild(this.errorElement); - } else { - this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|error"); - } - - this.table.element.appendChild(this.loaderElement); - }; - - Ajax.prototype.hideLoader = function () { - if (this.loaderElement.parentNode) { - this.loaderElement.parentNode.removeChild(this.loaderElement); - } - }; - - //default ajax config object - Ajax.prototype.defaultConfig = { - method: "GET" - }; - - Ajax.prototype.defaultURLGenerator = function (url, config, params) { - - if (url) { - if (params && Object.keys(params).length) { - if (!config.method || config.method.toLowerCase() == "get") { - config.method = "get"; - - url += (url.includes("?") ? "&" : "?") + this.serializeParams(params); - } - } - } - - return url; - }; - - Ajax.prototype.defaultLoaderPromise = function (url, config, params) { - var self = this, - contentType; - - return new Promise(function (resolve, reject) { - - //set url - url = self.urlGenerator(url, config, params); - - //set body content if not GET request - if (config.method.toUpperCase() != "GET") { - contentType = _typeof(self.table.options.ajaxContentType) === "object" ? self.table.options.ajaxContentType : self.contentTypeFormatters[self.table.options.ajaxContentType]; - if (contentType) { - - for (var key in contentType.headers) { - if (!config.headers) { - config.headers = {}; - } - - if (typeof config.headers[key] === "undefined") { - config.headers[key] = contentType.headers[key]; - } - } - - config.body = contentType.body.call(self, url, config, params); - } else { - console.warn("Ajax Error - Invalid ajaxContentType value:", self.table.options.ajaxContentType); - } - } - - if (url) { - - //configure headers - if (typeof config.headers === "undefined") { - config.headers = {}; - } - - if (typeof config.headers.Accept === "undefined") { - config.headers.Accept = "application/json"; - } - - if (typeof config.headers["X-Requested-With"] === "undefined") { - config.headers["X-Requested-With"] = "XMLHttpRequest"; - } - - if (typeof config.mode === "undefined") { - config.mode = "cors"; - } - - if (config.mode == "cors") { - - if (typeof config.headers["Access-Control-Allow-Origin"] === "undefined") { - config.headers["Access-Control-Allow-Origin"] = window.location.origin; - } - - if (typeof config.credentials === "undefined") { - config.credentials = 'same-origin'; - } - } else { - if (typeof config.credentials === "undefined") { - config.credentials = 'include'; - } - } - - //send request - fetch(url, config).then(function (response) { - if (response.ok) { - response.json().then(function (data) { - resolve(data); - }).catch(function (error) { - reject(error); - console.warn("Ajax Load Error - Invalid JSON returned", error); - }); - } else { - console.error("Ajax Load Error - Connection Error: " + response.status, response.statusText); - reject(response); - } - }).catch(function (error) { - console.error("Ajax Load Error - Connection Error: ", error); - reject(error); - }); - } else { - console.warn("Ajax Load Error - No URL Set"); - resolve([]); - } - }); - }; - - Ajax.prototype.contentTypeFormatters = { - "json": { - headers: { - 'Content-Type': 'application/json' - }, - body: function body(url, config, params) { - return JSON.stringify(params); - } - }, - "form": { - headers: {}, - body: function body(url, config, params) { - var output = this.generateParamsList(params), - form = new FormData(); - - output.forEach(function (item) { - form.append(item.key, item.value); - }); - - return form; - } - } - }; - - Tabulator.prototype.registerModule("ajax", Ajax); - - var ColumnCalcs = function ColumnCalcs(table) { - this.table = table; //hold Tabulator object - this.topCalcs = []; - this.botCalcs = []; - this.genColumn = false; - this.topElement = this.createElement(); - this.botElement = this.createElement(); - this.topRow = false; - this.botRow = false; - this.topInitialized = false; - this.botInitialized = false; - - this.initialize(); - }; - - ColumnCalcs.prototype.createElement = function () { - var el = document.createElement("div"); - el.classList.add("tabulator-calcs-holder"); - return el; - }; - - ColumnCalcs.prototype.initialize = function () { - this.genColumn = new Column({ field: "value" }, this); - }; - - //dummy functions to handle being mock column manager - ColumnCalcs.prototype.registerColumnField = function () {}; - - //initialize column calcs - ColumnCalcs.prototype.initializeColumn = function (column) { - var def = column.definition; - - var config = { - topCalcParams: def.topCalcParams || {}, - botCalcParams: def.bottomCalcParams || {} - }; - - if (def.topCalc) { - - switch (_typeof(def.topCalc)) { - case "string": - if (this.calculations[def.topCalc]) { - config.topCalc = this.calculations[def.topCalc]; - } else { - console.warn("Column Calc Error - No such calculation found, ignoring: ", def.topCalc); - } - break; - - case "function": - config.topCalc = def.topCalc; - break; - - } - - if (config.topCalc) { - column.modules.columnCalcs = config; - this.topCalcs.push(column); - - if (this.table.options.columnCalcs != "group") { - this.initializeTopRow(); - } - } - } - - if (def.bottomCalc) { - switch (_typeof(def.bottomCalc)) { - case "string": - if (this.calculations[def.bottomCalc]) { - config.botCalc = this.calculations[def.bottomCalc]; - } else { - console.warn("Column Calc Error - No such calculation found, ignoring: ", def.bottomCalc); - } - break; - - case "function": - config.botCalc = def.bottomCalc; - break; - - } - - if (config.botCalc) { - column.modules.columnCalcs = config; - this.botCalcs.push(column); - - if (this.table.options.columnCalcs != "group") { - this.initializeBottomRow(); - } - } - } - }; - - ColumnCalcs.prototype.removeCalcs = function () { - var changed = false; - - if (this.topInitialized) { - this.topInitialized = false; - this.topElement.parentNode.removeChild(this.topElement); - changed = true; - } - - if (this.botInitialized) { - this.botInitialized = false; - this.table.footerManager.remove(this.botElement); - changed = true; - } - - if (changed) { - this.table.rowManager.adjustTableSize(); - } - }; - - ColumnCalcs.prototype.initializeTopRow = function () { - if (!this.topInitialized) { - // this.table.columnManager.headersElement.after(this.topElement); - this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling); - this.topInitialized = true; - } - }; - - ColumnCalcs.prototype.initializeBottomRow = function () { - if (!this.botInitialized) { - this.table.footerManager.prepend(this.botElement); - this.botInitialized = true; - } - }; - - ColumnCalcs.prototype.scrollHorizontal = function (left) { - var hozAdjust = 0, - scrollWidth = this.table.columnManager.getElement().scrollWidth - this.table.element.clientWidth; - - if (this.botInitialized) { - this.botRow.getElement().style.marginLeft = -left + "px"; - } - }; - - ColumnCalcs.prototype.recalc = function (rows) { - var data, row; - - if (this.topInitialized || this.botInitialized) { - data = this.rowsToData(rows); - - if (this.topInitialized) { - if (this.topRow) { - this.topRow.deleteCells(); - } - - row = this.generateRow("top", this.rowsToData(rows)); - this.topRow = row; - while (this.topElement.firstChild) { - this.topElement.removeChild(this.topElement.firstChild); - }this.topElement.appendChild(row.getElement()); - row.initialize(true); - } - - if (this.botInitialized) { - if (this.botRow) { - this.botRow.deleteCells(); - } - - row = this.generateRow("bottom", this.rowsToData(rows)); - this.botRow = row; - while (this.botElement.firstChild) { - this.botElement.removeChild(this.botElement.firstChild); - }this.botElement.appendChild(row.getElement()); - row.initialize(true); - } - - this.table.rowManager.adjustTableSize(); - - //set resizable handles - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } - } - }; - - ColumnCalcs.prototype.recalcRowGroup = function (row) { - this.recalcGroup(this.table.modules.groupRows.getRowGroup(row)); - }; - - ColumnCalcs.prototype.recalcAll = function () { - var _this37 = this; - - if (this.topCalcs.length || this.botCalcs.length) { - if (this.table.options.columnCalcs !== "group") { - this.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.groupBy && this.table.options.columnCalcs !== "table") { - - var groups = table.modules.groupRows.getChildGroups(); - - groups.forEach(function (group) { - _this37.recalcGroup(group); - }); - } - } - }; - - ColumnCalcs.prototype.recalcGroup = function (group) { - var data, rowData; - - if (group) { - if (group.calcs) { - if (group.calcs.bottom) { - data = this.rowsToData(group.rows); - rowData = this.generateRowData("bottom", data); - - group.calcs.bottom.updateData(rowData); - group.calcs.bottom.reinitialize(); - } - - if (group.calcs.top) { - data = this.rowsToData(group.rows); - rowData = this.generateRowData("top", data); - - group.calcs.top.updateData(rowData); - group.calcs.top.reinitialize(); - } - } - } - }; - - //generate top stats row - ColumnCalcs.prototype.generateTopRow = function (rows) { - return this.generateRow("top", this.rowsToData(rows)); - }; - //generate bottom stats row - ColumnCalcs.prototype.generateBottomRow = function (rows) { - return this.generateRow("bottom", this.rowsToData(rows)); - }; - - ColumnCalcs.prototype.rowsToData = function (rows) { - var _this38 = this; - - var data = []; - - rows.forEach(function (row) { - data.push(row.getData()); - - if (_this38.table.options.dataTree && _this38.table.options.dataTreeChildColumnCalcs) { - if (row.modules.dataTree.open) { - var children = _this38.rowsToData(_this38.table.modules.dataTree.getFilteredTreeChildren(row)); - data = data.concat(children); - } - } - }); - - return data; - }; - - //generate stats row - ColumnCalcs.prototype.generateRow = function (pos, data) { - var self = this, - rowData = this.generateRowData(pos, data), - row; - - if (self.table.modExists("mutator")) { - self.table.modules.mutator.disable(); - } - - row = new Row(rowData, this, "calc"); - - if (self.table.modExists("mutator")) { - self.table.modules.mutator.enable(); - } - - row.getElement().classList.add("tabulator-calcs", "tabulator-calcs-" + pos); - - row.generateCells = function () { - - var cells = []; - - self.table.columnManager.columnsByIndex.forEach(function (column) { - - //set field name of mock column - self.genColumn.setField(column.getField()); - self.genColumn.hozAlign = column.hozAlign; - - if (column.definition[pos + "CalcFormatter"] && self.table.modExists("format")) { - - self.genColumn.modules.format = { - formatter: self.table.modules.format.getFormatter(column.definition[pos + "CalcFormatter"]), - params: column.definition[pos + "CalcFormatterParams"] - }; - } else { - self.genColumn.modules.format = { - formatter: self.table.modules.format.getFormatter("plaintext"), - params: {} - }; - } - - //ensure css class defintion is replicated to calculation cell - self.genColumn.definition.cssClass = column.definition.cssClass; - - //generate cell and assign to correct column - var cell = new Cell(self.genColumn, row); - cell.column = column; - cell.setWidth(); - - column.cells.push(cell); - cells.push(cell); - - if (!column.visible) { - cell.hide(); - } - }); - - this.cells = cells; - }; - - return row; - }; - - //generate stats row - ColumnCalcs.prototype.generateRowData = function (pos, data) { - var rowData = {}, - calcs = pos == "top" ? this.topCalcs : this.botCalcs, - type = pos == "top" ? "topCalc" : "botCalc", - params, - paramKey; - - calcs.forEach(function (column) { - var values = []; - - if (column.modules.columnCalcs && column.modules.columnCalcs[type]) { - data.forEach(function (item) { - values.push(column.getFieldValue(item)); - }); - - paramKey = type + "Params"; - params = typeof column.modules.columnCalcs[paramKey] === "function" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey]; - - column.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params)); - } - }); - - return rowData; - }; - - ColumnCalcs.prototype.hasTopCalcs = function () { - return !!this.topCalcs.length; - }; - - ColumnCalcs.prototype.hasBottomCalcs = function () { - return !!this.botCalcs.length; - }; - - //handle table redraw - ColumnCalcs.prototype.redraw = function () { - if (this.topRow) { - this.topRow.normalizeHeight(true); - } - if (this.botRow) { - this.botRow.normalizeHeight(true); - } - }; - - //return the calculated - ColumnCalcs.prototype.getResults = function () { - var self = this, - results = {}, - groups; - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - groups = this.table.modules.groupRows.getGroups(true); - - groups.forEach(function (group) { - results[group.getKey()] = self.getGroupResults(group); - }); - } else { - results = { - top: this.topRow ? this.topRow.getData() : {}, - bottom: this.botRow ? this.botRow.getData() : {} - }; - } - - return results; - }; - - //get results from a group - ColumnCalcs.prototype.getGroupResults = function (group) { - var self = this, - groupObj = group._getSelf(), - subGroups = group.getSubGroups(), - subGroupResults = {}, - results = {}; - - subGroups.forEach(function (subgroup) { - subGroupResults[subgroup.getKey()] = self.getGroupResults(subgroup); - }); - - results = { - top: groupObj.calcs.top ? groupObj.calcs.top.getData() : {}, - bottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {}, - groups: subGroupResults - }; - - return results; - }; - - //default calculations - ColumnCalcs.prototype.calculations = { - "avg": function avg(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : 2; - - if (values.length) { - output = values.reduce(function (sum, value) { - value = Number(value); - return sum + value; - }); - - output = output / values.length; - - output = precision !== false ? output.toFixed(precision) : output; - } - - return parseFloat(output).toString(); - }, - "max": function max(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value > output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "min": function min(values, data, calcParams) { - var output = null, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - values.forEach(function (value) { - - value = Number(value); - - if (value < output || output === null) { - output = value; - } - }); - - return output !== null ? precision !== false ? output.toFixed(precision) : output : ""; - }, - "sum": function sum(values, data, calcParams) { - var output = 0, - precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false; - - if (values.length) { - values.forEach(function (value) { - value = Number(value); - - output += !isNaN(value) ? Number(value) : 0; - }); - } - - return precision !== false ? output.toFixed(precision) : output; - }, - "concat": function concat(values, data, calcParams) { - var output = 0; - - if (values.length) { - output = values.reduce(function (sum, value) { - return String(sum) + String(value); - }); - } - - return output; - }, - "count": function count(values, data, calcParams) { - var output = 0; - - if (values.length) { - values.forEach(function (value) { - if (value) { - output++; - } - }); - } - - return output; - } - }; - - Tabulator.prototype.registerModule("columnCalcs", ColumnCalcs); - - var Clipboard = function Clipboard(table) { - this.table = table; - this.mode = true; - - this.pasteParser = function () {}; - this.pasteAction = function () {}; - this.customSelection = false; - this.rowRange = false; - this.blocked = true; //block copy actions not originating from this command - }; - - Clipboard.prototype.initialize = function () { - var _this39 = this; - - this.mode = this.table.options.clipboard; - - this.rowRange = this.table.options.clipboardCopyRowRange; - - if (this.mode === true || this.mode === "copy") { - this.table.element.addEventListener("copy", function (e) { - var plain, html, list; - - if (!_this39.blocked) { - e.preventDefault(); - - if (_this39.customSelection) { - plain = _this39.customSelection; - - if (_this39.table.options.clipboardCopyFormatter) { - plain = _this39.table.options.clipboardCopyFormatter("plain", plain); - } - } else { - - var list = _this39.table.modules.export.generateExportList(_this39.rowRange, _this39.table.options.clipboardCopyStyled, _this39.table.options.clipboardCopyConfig, "clipboard"); - - html = _this39.table.modules.export.genereateHTMLTable(list); - plain = html ? _this39.generatePlainContent(list) : ""; - - if (_this39.table.options.clipboardCopyFormatter) { - plain = _this39.table.options.clipboardCopyFormatter("plain", plain); - html = _this39.table.options.clipboardCopyFormatter("html", html); - } - } - - if (window.clipboardData && window.clipboardData.setData) { - window.clipboardData.setData('Text', plain); - } else if (e.clipboardData && e.clipboardData.setData) { - e.clipboardData.setData('text/plain', plain); - if (html) { - e.clipboardData.setData('text/html', html); - } - } else if (e.originalEvent && e.originalEvent.clipboardData.setData) { - e.originalEvent.clipboardData.setData('text/plain', plain); - if (html) { - e.originalEvent.clipboardData.setData('text/html', html); - } - } - - _this39.table.options.clipboardCopied.call(_this39.table, plain, html); - - _this39.reset(); - } - }); - } - - if (this.mode === true || this.mode === "paste") { - this.table.element.addEventListener("paste", function (e) { - _this39.paste(e); - }); - } - - this.setPasteParser(this.table.options.clipboardPasteParser); - this.setPasteAction(this.table.options.clipboardPasteAction); - }; - - Clipboard.prototype.reset = function () { - this.blocked = false; - this.originalSelectionText = ""; - }; - - Clipboard.prototype.generatePlainContent = function (list) { - var output = []; - - list.forEach(function (row) { - var rowData = []; - - row.columns.forEach(function (col) { - var value = ""; - - if (col) { - - if (row.type === "group") { - col.value = col.component.getKey(); - } - - switch (_typeof(col.value)) { - case "object": - value = JSON.stringify(col.value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = col.value; - } - } - - rowData.push(value); - }); - - output.push(rowData.join("\t")); - }); - - return output.join("\n"); - }; - - Clipboard.prototype.copy = function (range, internal) { - var range, sel, textRange; - this.blocked = false; - this.customSelection = false; - - if (this.mode === true || this.mode === "copy") { - - this.rowRange = range || this.table.options.clipboardCopyRowRange; - - if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") { - range = document.createRange(); - range.selectNodeContents(this.table.element); - sel = window.getSelection(); - - if (sel.toString() && internal) { - this.customSelection = sel.toString(); - } - - sel.removeAllRanges(); - sel.addRange(range); - } else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") { - textRange = document.body.createTextRange(); - textRange.moveToElementText(this.table.element); - textRange.select(); - } - - document.execCommand('copy'); - - if (sel) { - sel.removeAllRanges(); - } - } - }; - - //PASTE EVENT HANDLING - - Clipboard.prototype.setPasteAction = function (action) { - - switch (typeof action === 'undefined' ? 'undefined' : _typeof(action)) { - case "string": - this.pasteAction = this.pasteActions[action]; - - if (!this.pasteAction) { - console.warn("Clipboard Error - No such paste action found:", action); - } - break; - - case "function": - this.pasteAction = action; - break; - } - }; - - Clipboard.prototype.setPasteParser = function (parser) { - switch (typeof parser === 'undefined' ? 'undefined' : _typeof(parser)) { - case "string": - this.pasteParser = this.pasteParsers[parser]; - - if (!this.pasteParser) { - console.warn("Clipboard Error - No such paste parser found:", parser); - } - break; - - case "function": - this.pasteParser = parser; - break; - } - }; - - Clipboard.prototype.paste = function (e) { - var data, rowData, rows; - - if (this.checkPaseOrigin(e)) { - - data = this.getPasteData(e); - - rowData = this.pasteParser.call(this, data); - - if (rowData) { - e.preventDefault(); - - if (this.table.modExists("mutator")) { - rowData = this.mutateData(rowData); - } - - rows = this.pasteAction.call(this, rowData); - this.table.options.clipboardPasted.call(this.table, data, rowData, rows); - } else { - this.table.options.clipboardPasteError.call(this.table, data); - } - } - }; - - Clipboard.prototype.mutateData = function (data) { - var self = this, - output = []; - - if (Array.isArray(data)) { - data.forEach(function (row) { - output.push(self.table.modules.mutator.transformRow(row, "clipboard")); - }); - } else { - output = data; - } - - return output; - }; - - Clipboard.prototype.checkPaseOrigin = function (e) { - var valid = true; - - if (e.target.tagName != "DIV" || this.table.modules.edit.currentCell) { - valid = false; - } - - return valid; - }; - - Clipboard.prototype.getPasteData = function (e) { - var data; - - if (window.clipboardData && window.clipboardData.getData) { - data = window.clipboardData.getData('Text'); - } else if (e.clipboardData && e.clipboardData.getData) { - data = e.clipboardData.getData('text/plain'); - } else if (e.originalEvent && e.originalEvent.clipboardData.getData) { - data = e.originalEvent.clipboardData.getData('text/plain'); - } - - return data; - }; - - Clipboard.prototype.pasteParsers = { - table: function table(clipboard) { - var data = [], - success = false, - headerFindSuccess = true, - columns = this.table.columnManager.columns, - columnMap = [], - rows = []; - - //get data from clipboard into array of columns and rows. - clipboard = clipboard.split("\n"); - - clipboard.forEach(function (row) { - data.push(row.split("\t")); - }); - - if (data.length && !(data.length === 1 && data[0].length < 2)) { - success = true; - - //check if headers are present by title - data[0].forEach(function (value) { - var column = columns.find(function (column) { - return value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim(); - }); - - if (column) { - columnMap.push(column); - } else { - headerFindSuccess = false; - } - }); - - //check if column headers are present by field - if (!headerFindSuccess) { - headerFindSuccess = true; - columnMap = []; - - data[0].forEach(function (value) { - var column = columns.find(function (column) { - return value && column.field && value.trim() && column.field.trim() === value.trim(); - }); - - if (column) { - columnMap.push(column); - } else { - headerFindSuccess = false; - } - }); - - if (!headerFindSuccess) { - columnMap = this.table.columnManager.columnsByIndex; - } - } - - //remove header row if found - if (headerFindSuccess) { - data.shift(); - } - - data.forEach(function (item) { - var row = {}; - - item.forEach(function (value, i) { - if (columnMap[i]) { - row[columnMap[i].field] = value; - } - }); - - rows.push(row); - }); - - return rows; - } else { - return false; - } - } - }; - - Clipboard.prototype.pasteActions = { - replace: function replace(rows) { - return this.table.setData(rows); - }, - update: function update(rows) { - return this.table.updateOrAddData(rows); - }, - insert: function insert(rows) { - return this.table.addData(rows); - } - }; - - Tabulator.prototype.registerModule("clipboard", Clipboard); - - var DataTree = function DataTree(table) { - this.table = table; - this.indent = 10; - this.field = ""; - this.collapseEl = null; - this.expandEl = null; - this.branchEl = null; - this.elementField = false; - - this.startOpen = function () {}; - - this.displayIndex = 0; - }; - - DataTree.prototype.initialize = function () { - var dummyEl = null, - firstCol = this.table.columnManager.getFirstVisibileColumn(), - options = this.table.options; - - this.field = options.dataTreeChildField; - this.indent = options.dataTreeChildIndent; - this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false); - - if (options.dataTreeBranchElement) { - - if (options.dataTreeBranchElement === true) { - this.branchEl = document.createElement("div"); - this.branchEl.classList.add("tabulator-data-tree-branch"); - } else { - if (typeof options.dataTreeBranchElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeBranchElement; - this.branchEl = dummyEl.firstChild; - } else { - this.branchEl = options.dataTreeBranchElement; - } - } - } - - if (options.dataTreeCollapseElement) { - if (typeof options.dataTreeCollapseElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeCollapseElement; - this.collapseEl = dummyEl.firstChild; - } else { - this.collapseEl = options.dataTreeCollapseElement; - } - } else { - this.collapseEl = document.createElement("div"); - this.collapseEl.classList.add("tabulator-data-tree-control"); - this.collapseEl.tabIndex = 0; - this.collapseEl.innerHTML = "
"; - } - - if (options.dataTreeExpandElement) { - if (typeof options.dataTreeExpandElement === "string") { - dummyEl = document.createElement("div"); - dummyEl.innerHTML = options.dataTreeExpandElement; - this.expandEl = dummyEl.firstChild; - } else { - this.expandEl = options.dataTreeExpandElement; - } - } else { - this.expandEl = document.createElement("div"); - this.expandEl.classList.add("tabulator-data-tree-control"); - this.expandEl.tabIndex = 0; - this.expandEl.innerHTML = "
"; - } - - switch (_typeof(options.dataTreeStartExpanded)) { - case "boolean": - this.startOpen = function (row, index) { - return options.dataTreeStartExpanded; - }; - break; - - case "function": - this.startOpen = options.dataTreeStartExpanded; - break; - - default: - this.startOpen = function (row, index) { - return options.dataTreeStartExpanded[index]; - }; - break; - } - }; - - DataTree.prototype.initializeRow = function (row) { - var childArray = row.getData()[this.field]; - var isArray = Array.isArray(childArray); - - var children = isArray || !isArray && (typeof childArray === 'undefined' ? 'undefined' : _typeof(childArray)) === "object" && childArray !== null; - - if (!children && row.modules.dataTree && row.modules.dataTree.branchEl) { - row.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl); - } - - if (!children && row.modules.dataTree && row.modules.dataTree.controlEl) { - row.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl); - } - - row.modules.dataTree = { - index: row.modules.dataTree ? row.modules.dataTree.index : 0, - open: children ? row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0) : false, - controlEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false, - branchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false, - parent: row.modules.dataTree ? row.modules.dataTree.parent : false, - children: children - }; - }; - - DataTree.prototype.layoutRow = function (row) { - var cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0], - el = cell.getElement(), - config = row.modules.dataTree; - - if (config.branchEl) { - if (config.branchEl.parentNode) { - config.branchEl.parentNode.removeChild(config.branchEl); - } - config.branchEl = false; - } - - if (config.controlEl) { - if (config.controlEl.parentNode) { - config.controlEl.parentNode.removeChild(config.controlEl); - } - config.controlEl = false; - } - - this.generateControlElement(row, el); - - row.element.classList.add("tabulator-tree-level-" + config.index); - - if (config.index) { - if (this.branchEl) { - config.branchEl = this.branchEl.cloneNode(true); - el.insertBefore(config.branchEl, el.firstChild); - config.branchEl.style.marginLeft = (config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1) + config.index * this.indent + "px"; - } else { - el.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + config.index * this.indent + "px"; - } - } - }; - - DataTree.prototype.generateControlElement = function (row, el) { - var _this40 = this; - - var config = row.modules.dataTree, - el = el || row.getCells()[0].getElement(), - oldControl = config.controlEl; - - if (config.children !== false) { - - if (config.open) { - config.controlEl = this.collapseEl.cloneNode(true); - config.controlEl.addEventListener("click", function (e) { - e.stopPropagation(); - _this40.collapseRow(row); - }); - } else { - config.controlEl = this.expandEl.cloneNode(true); - config.controlEl.addEventListener("click", function (e) { - e.stopPropagation(); - _this40.expandRow(row); - }); - } - - config.controlEl.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - - if (oldControl && oldControl.parentNode === el) { - oldControl.parentNode.replaceChild(config.controlEl, oldControl); - } else { - el.insertBefore(config.controlEl, el.firstChild); - } - } - }; - - DataTree.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - DataTree.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - DataTree.prototype.getRows = function (rows) { - var _this41 = this; - - var output = []; - - rows.forEach(function (row, i) { - var config, children; - - output.push(row); - - if (row instanceof Row) { - - config = row.modules.dataTree.children; - - if (!config.index && config.children !== false) { - children = _this41.getChildren(row); - - children.forEach(function (child) { - output.push(child); - }); - } - } - }); - - return output; - }; - - DataTree.prototype.getChildren = function (row) { - var _this42 = this; - - var config = row.modules.dataTree, - children = [], - output = []; - - if (config.children !== false && config.open) { - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - if (this.table.modExists("filter")) { - children = this.table.modules.filter.filter(config.children); - } else { - children = config.children; - } - - if (this.table.modExists("sort")) { - this.table.modules.sort.sort(children); - } - - children.forEach(function (child) { - output.push(child); - - var subChildren = _this42.getChildren(child); - - subChildren.forEach(function (sub) { - output.push(sub); - }); - }); - } - - return output; - }; - - DataTree.prototype.generateChildren = function (row) { - var _this43 = this; - - var children = []; - - var childArray = row.getData()[this.field]; - - if (!Array.isArray(childArray)) { - childArray = [childArray]; - } - - childArray.forEach(function (childData) { - var childRow = new Row(childData || {}, _this43.table.rowManager); - childRow.modules.dataTree.index = row.modules.dataTree.index + 1; - childRow.modules.dataTree.parent = row; - if (childRow.modules.dataTree.children) { - childRow.modules.dataTree.open = _this43.startOpen(childRow.getComponent(), childRow.modules.dataTree.index); - } - children.push(childRow); - }); - - return children; - }; - - DataTree.prototype.expandRow = function (row, silent) { - var config = row.modules.dataTree; - - if (config.children !== false) { - config.open = true; - - row.reinitialize(); - - this.table.rowManager.refreshActiveData("tree", false, true); - - this.table.options.dataTreeRowExpanded(row.getComponent(), row.modules.dataTree.index); - } - }; - - DataTree.prototype.collapseRow = function (row) { - var config = row.modules.dataTree; - - if (config.children !== false) { - config.open = false; - - row.reinitialize(); - - this.table.rowManager.refreshActiveData("tree", false, true); - - this.table.options.dataTreeRowCollapsed(row.getComponent(), row.modules.dataTree.index); - } - }; - - DataTree.prototype.toggleRow = function (row) { - var config = row.modules.dataTree; - - if (config.children !== false) { - if (config.open) { - this.collapseRow(row); - } else { - this.expandRow(row); - } - } - }; - - DataTree.prototype.getTreeParent = function (row) { - return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false; - }; - - DataTree.prototype.getFilteredTreeChildren = function (row) { - var config = row.modules.dataTree, - output = [], - children; - - if (config.children) { - - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - if (this.table.modExists("filter")) { - children = this.table.modules.filter.filter(config.children); - } else { - children = config.children; - } - - children.forEach(function (childRow) { - if (childRow instanceof Row) { - output.push(childRow); - } - }); - } - - return output; - }; - - DataTree.prototype.rowDelete = function (row) { - var parent = row.modules.dataTree.parent, - childIndex; - - if (parent) { - childIndex = this.findChildIndex(row, parent); - - if (childIndex !== false) { - parent.data[this.field].splice(childIndex, 1); - } - - if (!parent.data[this.field].length) { - delete parent.data[this.field]; - } - - this.initializeRow(parent); - this.layoutRow(parent); - } - - this.table.rowManager.refreshActiveData("tree", false, true); - }; - - DataTree.prototype.addTreeChildRow = function (row, data, top, index) { - var childIndex = false; - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (!Array.isArray(row.data[this.field])) { - row.data[this.field] = []; - - row.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index); - } - - if (typeof index !== "undefined") { - childIndex = this.findChildIndex(index, row); - - if (childIndex !== false) { - row.data[this.field].splice(top ? childIndex : childIndex + 1, 0, data); - } - } - - if (childIndex === false) { - if (top) { - row.data[this.field].unshift(data); - } else { - row.data[this.field].push(data); - } - } - - this.initializeRow(row); - this.layoutRow(row); - - this.table.rowManager.refreshActiveData("tree", false, true); - }; - - DataTree.prototype.findChildIndex = function (subject, parent) { - var _this44 = this; - - var match = false; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Row) { - //subject is row element - match = subject.data; - } else if (subject instanceof RowComponent) { - //subject is public row component - match = subject._getSelf().data; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - if (parent.modules.dataTree) { - match = parent.modules.dataTree.children.find(function (childRow) { - return childRow instanceof Row ? childRow.element === subject : false; - }); - - if (match) { - match = match.data; - } - } - } - } else if (typeof subject == "undefined" || subject === null) { - match = false; - } else { - //subject should be treated as the index of the row - match = parent.data[this.field].find(function (row) { - return row.data[_this44.table.options.index] == subject; - }); - } - - if (match) { - - if (Array.isArray(parent.data[this.field])) { - match = parent.data[this.field].indexOf(match); - } - - if (match == -1) { - match = false; - } - } - - //catch all for any other type of input - - return match; - }; - - DataTree.prototype.getTreeChildren = function (row) { - var config = row.modules.dataTree, - output = []; - - if (config.children) { - - if (!Array.isArray(config.children)) { - config.children = this.generateChildren(row); - } - - config.children.forEach(function (childRow) { - if (childRow instanceof Row) { - output.push(childRow.getComponent()); - } - }); - } - - return output; - }; - - DataTree.prototype.checkForRestyle = function (cell) { - if (!cell.row.cells.indexOf(cell)) { - cell.row.reinitialize(); - } - }; - - DataTree.prototype.getChildField = function () { - return this.field; - }; - - DataTree.prototype.redrawNeeded = function (data) { - return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false); - }; - - Tabulator.prototype.registerModule("dataTree", DataTree); - - var Download = function Download(table) { - this.table = table; //hold Tabulator object - }; - - //trigger file download - Download.prototype.download = function (type, filename, options, range, interceptCallback) { - var self = this, - downloadFunc = false; - - function buildLink(data, mime) { - if (interceptCallback) { - if (interceptCallback === true) { - self.triggerDownload(data, mime, type, filename, true); - } else { - interceptCallback(data); - } - } else { - self.triggerDownload(data, mime, type, filename); - } - } - - if (typeof type == "function") { - downloadFunc = type; - } else { - if (self.downloaders[type]) { - downloadFunc = self.downloaders[type]; - } else { - console.warn("Download Error - No such download type found: ", type); - } - } - - if (downloadFunc) { - var list = this.generateExportList(range); - - downloadFunc.call(this.table, list, options || {}, buildLink); - } - }; - - Download.prototype.generateExportList = function (range) { - var list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, "download"); - - //assign group header formatter - var groupHeader = this.table.options.groupHeaderDownload; - - if (groupHeader && !Array.isArray(groupHeader)) { - groupHeader = [groupHeader]; - } - - list.forEach(function (row) { - var group; - - if (row.type === "group") { - group = row.columns[0]; - - if (groupHeader && groupHeader[row.indent]) { - group.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } - } - }); - - return list; - }; - - Download.prototype.triggerDownload = function (data, mime, type, filename, newTab) { - var element = document.createElement('a'), - blob = new Blob([data], { type: mime }), - filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type); - - blob = this.table.options.downloadReady.call(this.table, data, blob); - - if (blob) { - - if (newTab) { - window.open(window.URL.createObjectURL(blob)); - } else { - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveOrOpenBlob(blob, filename); - } else { - element.setAttribute('href', window.URL.createObjectURL(blob)); - - //set file title - element.setAttribute('download', filename); - - //trigger download - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - - //remove temporary link element - document.body.removeChild(element); - } - } - - if (this.table.options.downloadComplete) { - this.table.options.downloadComplete(); - } - } - }; - - Download.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "intercept": - this.download(data.type, "", data.options, data.active, data.intercept); - break; - } - }; - - //downloaders - Download.prototype.downloaders = { - csv: function csv(list, options, setFileContents) { - var delimiter = options && options.delimiter ? options.delimiter : ",", - fileContents = [], - headers = []; - - list.forEach(function (row) { - var item = []; - - switch (row.type) { - case "group": - console.warn("Download Warning - CSV downloader cannot process row groups"); - break; - - case "calc": - console.warn("Download Warning - CSV downloader cannot process column calculations"); - break; - - case "header": - row.columns.forEach(function (col, i) { - if (col && col.depth === 1) { - headers[i] = typeof col.value == "undefined" || typeof col.value == "null" ? "" : col.value; - } - }); - break; - - case "row": - row.columns.forEach(function (col) { - - if (col) { - - switch (_typeof(col.value)) { - case "object": - col.value = JSON.stringify(col.value); - break; - - case "undefined": - case "null": - col.value = ""; - break; - } - - item.push('"' + String(col.value).split('"').join('""') + '"'); - } - }); - - fileContents.push(item.join(delimiter)); - break; - } - }); - - if (headers.length) { - fileContents = [headers].concat(fileContents); - } - - fileContents = fileContents.join("\n"); - - if (options.bom) { - fileContents = '\uFEFF' + fileContents; - } - - setFileContents(fileContents, "text/csv"); - }, - - json: function json(list, options, setFileContents) { - var fileContents = []; - - list.forEach(function (row) { - var item = {}; - - switch (row.type) { - case "header": - break; - - case "group": - console.warn("Download Warning - JSON downloader cannot process row groups"); - break; - - case "calc": - console.warn("Download Warning - JSON downloader cannot process column calculations"); - break; - - case "row": - row.columns.forEach(function (col) { - if (col) { - item[col.component.getField()] = col.value; - } - }); - - fileContents.push(item); - break; - } - }); - - fileContents = JSON.stringify(fileContents, null, '\t'); - - setFileContents(fileContents, "application/json"); - }, - - pdf: function pdf(list, options, setFileContents) { - var header = [], - body = [], - autoTableParams = {}, - rowGroupStyles = options.rowGroupStyles || { - fontStyle: "bold", - fontSize: 12, - cellPadding: 6, - fillColor: 220 - }, - rowCalcStyles = options.rowCalcStyles || { - fontStyle: "bold", - fontSize: 10, - cellPadding: 4, - fillColor: 232 - }, - jsPDFParams = options.jsPDF || {}, - title = options && options.title ? options.title : ""; - - if (!jsPDFParams.orientation) { - jsPDFParams.orientation = options.orientation || "landscape"; - } - - if (!jsPDFParams.unit) { - jsPDFParams.unit = "pt"; - } - - //parse row list - list.forEach(function (row) { - var item = {}; - - switch (row.type) { - case "header": - header.push(parseRow(row)); - break; - - case "group": - body.push(parseRow(row, rowGroupStyles)); - break; - - case "calc": - body.push(parseRow(row, rowCalcStyles)); - break; - - case "row": - body.push(parseRow(row)); - break; - } - }); - - function parseRow(row, styles) { - var rowData = []; - - row.columns.forEach(function (col) { - var cell; - - if (col) { - switch (_typeof(col.value)) { - case "object": - col.value = JSON.stringify(col.value); - break; - - case "undefined": - case "null": - col.value = ""; - break; - } - - cell = { - content: col.value, - colSpan: col.width, - rowSpan: col.height - }; - - if (styles) { - cell.styles = styles; - } - - rowData.push(cell); - } else { - rowData.push(""); - } - }); - - return rowData; - } - - //configure PDF - var doc = new jsPDF(jsPDFParams); //set document to landscape, better for most tables - - if (options && options.autoTable) { - if (typeof options.autoTable === "function") { - autoTableParams = options.autoTable(doc) || {}; - } else { - autoTableParams = options.autoTable; - } - } - - if (title) { - autoTableParams.addPageContent = function (data) { - doc.text(title, 40, 30); - }; - } - - autoTableParams.head = header; - autoTableParams.body = body; - - doc.autoTable(autoTableParams); - - if (options && options.documentProcessing) { - options.documentProcessing(doc); - } - - setFileContents(doc.output("arraybuffer"), "application/pdf"); - }, - - xlsx: function xlsx(list, options, setFileContents) { - var self = this, - sheetName = options.sheetName || "Sheet1", - workbook = XLSX.utils.book_new(), - output; - - workbook.SheetNames = []; - workbook.Sheets = {}; - - function generateSheet() { - var rows = [], - merges = [], - worksheet = {}, - range = { s: { c: 0, r: 0 }, e: { c: list[0] ? list[0].columns.reduce(function (a, b) { - return a + (b && b.width ? b.width : 1); - }, 0) : 0, r: list.length } }; - - //parse row list - list.forEach(function (row, i) { - var rowData = []; - - row.columns.forEach(function (col, j) { - - if (col) { - rowData.push(!(col.value instanceof Date) && _typeof(col.value) === "object" ? JSON.stringify(col.value) : col.value); - - if (col.width > 1 || col.height > -1) { - merges.push({ s: { r: i, c: j }, e: { r: i + col.height - 1, c: j + col.width - 1 } }); - } - } else { - rowData.push(""); - } - }); - - rows.push(rowData); - }); - - //convert rows to worksheet - XLSX.utils.sheet_add_aoa(worksheet, rows); - - worksheet['!ref'] = XLSX.utils.encode_range(range); - - if (merges.length) { - worksheet["!merges"] = merges; - } - - return worksheet; - } - - if (options.sheetOnly) { - setFileContents(generateSheet()); - return; - } - - if (options.sheets) { - for (var sheet in options.sheets) { - - if (options.sheets[sheet] === true) { - workbook.SheetNames.push(sheet); - workbook.Sheets[sheet] = generateSheet(); - } else { - - workbook.SheetNames.push(sheet); - - this.table.modules.comms.send(options.sheets[sheet], "download", "intercept", { - type: "xlsx", - options: { sheetOnly: true }, - active: self.active, - intercept: function intercept(data) { - workbook.Sheets[sheet] = data; - } - }); - } - } - } else { - workbook.SheetNames.push(sheetName); - workbook.Sheets[sheetName] = generateSheet(); - } - - if (options.documentProcessing) { - workbook = options.documentProcessing(workbook); - } - - //convert workbook to binary array - function s2ab(s) { - var buf = new ArrayBuffer(s.length); - var view = new Uint8Array(buf); - for (var i = 0; i != s.length; ++i) { - view[i] = s.charCodeAt(i) & 0xFF; - }return buf; - } - - output = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'binary' }); - - setFileContents(s2ab(output), "application/octet-stream"); - }, - - html: function html(list, options, setFileContents) { - if (this.modExists("export", true)) { - setFileContents(this.modules.export.genereateHTMLTable(list), "text/html"); - } - } - - }; - - Tabulator.prototype.registerModule("download", Download); - - var Edit = function Edit(table) { - this.table = table; //hold Tabulator object - this.currentCell = false; //hold currently editing cell - this.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening - this.recursionBlock = false; //prevent focus recursion - this.invalidEdit = false; - this.editedCells = []; - }; - - //initialize column editor - Edit.prototype.initializeColumn = function (column) { - var self = this, - config = { - editor: false, - blocked: false, - check: column.definition.editable, - params: column.definition.editorParams || {} - }; - - //set column editor - switch (_typeof(column.definition.editor)) { - case "string": - - if (column.definition.editor === "tick") { - column.definition.editor = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.editor]) { - config.editor = self.editors[column.definition.editor]; - } else { - console.warn("Editor Error - No such editor found: ", column.definition.editor); - } - break; - - case "function": - config.editor = column.definition.editor; - break; - - case "boolean": - - if (column.definition.editor === true) { - - if (typeof column.definition.formatter !== "function") { - - if (column.definition.formatter === "tick") { - column.definition.formatter = "tickCross"; - console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor"); - } - - if (self.editors[column.definition.formatter]) { - config.editor = self.editors[column.definition.formatter]; - } else { - config.editor = self.editors["input"]; - } - } else { - console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ", column.definition.formatter); - } - } - break; - } - - if (config.editor) { - column.modules.edit = config; - } - }; - - Edit.prototype.getCurrentCell = function () { - return this.currentCell ? this.currentCell.getComponent() : false; - }; - - Edit.prototype.clearEditor = function (cancel) { - var cell = this.currentCell, - cellEl; - - this.invalidEdit = false; - - if (cell) { - this.currentCell = false; - - cellEl = cell.getElement(); - - if (cancel) { - cell.validate(); - } else { - cellEl.classList.remove("tabulator-validation-fail"); - } - - cellEl.classList.remove("tabulator-editing"); - while (cellEl.firstChild) { - cellEl.removeChild(cellEl.firstChild); - }cell.row.getElement().classList.remove("tabulator-row-editing"); - } - }; - - Edit.prototype.cancelEdit = function () { - - if (this.currentCell) { - var cell = this.currentCell; - var component = this.currentCell.getComponent(); - - this.clearEditor(true); - cell.setValueActual(cell.getValue()); - cell.cellRendered(); - - if (cell.column.cellEvents.cellEditCancelled) { - cell.column.cellEvents.cellEditCancelled.call(this.table, component); - } - - this.table.options.cellEditCancelled.call(this.table, component); - } - }; - - //return a formatted value for a cell - Edit.prototype.bindEditor = function (cell) { - var self = this, - element = cell.getElement(); - - element.setAttribute("tabindex", 0); - - element.addEventListener("click", function (e) { - if (!element.classList.contains("tabulator-editing")) { - element.focus({ preventScroll: true }); - } - }); - - element.addEventListener("mousedown", function (e) { - self.mouseClick = true; - }); - - element.addEventListener("focus", function (e) { - if (!self.recursionBlock) { - self.edit(cell, e, false); - } - }); - }; - - Edit.prototype.focusCellNoEvent = function (cell, block) { - this.recursionBlock = true; - if (!(block && this.table.browser === "ie")) { - cell.getElement().focus({ preventScroll: true }); - } - this.recursionBlock = false; - }; - - Edit.prototype.editCell = function (cell, forceEdit) { - this.focusCellNoEvent(cell); - this.edit(cell, false, forceEdit); - }; - - Edit.prototype.focusScrollAdjust = function (cell) { - if (this.table.rowManager.getRenderMode() == "virtual") { - var topEdge = this.table.rowManager.element.scrollTop, - bottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop, - rowEl = cell.row.getElement(), - offset = rowEl.offsetTop; - - if (rowEl.offsetTop < topEdge) { - this.table.rowManager.element.scrollTop -= topEdge - rowEl.offsetTop; - } else { - if (rowEl.offsetTop + rowEl.offsetHeight > bottomEdge) { - this.table.rowManager.element.scrollTop += rowEl.offsetTop + rowEl.offsetHeight - bottomEdge; - } - } - } - }; - - Edit.prototype.edit = function (cell, e, forceEdit) { - var self = this, - allowEdit = true, - rendered = function rendered() {}, - element = cell.getElement(), - cellEditor, - component, - params; - - //prevent editing if another cell is refusing to leave focus (eg. validation fail) - if (this.currentCell) { - if (!this.invalidEdit) { - this.cancelEdit(); - } - return; - } - - //handle successfull value change - function success(value) { - if (self.currentCell === cell) { - var valid = true; - - if (cell.column.modules.validate && self.table.modExists("validate") && self.table.options.validationMode != "manual") { - valid = self.table.modules.validate.validate(cell.column.modules.validate, cell, value); - } - - if (valid === true || self.table.options.validationMode === "highlight") { - self.clearEditor(); - cell.setValue(value, true); - - if (!cell.modules.edit) { - cell.modules.edit = {}; - } - - cell.modules.edit.edited = true; - - if (self.editedCells.indexOf(cell) == -1) { - self.editedCells.push(cell); - } - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - - if (valid !== true) { - element.classList.add("tabulator-validation-fail"); - return false; - } - - return true; - } else { - self.invalidEdit = true; - element.classList.add("tabulator-validation-fail"); - self.focusCellNoEvent(cell, true); - rendered(); - self.table.options.validationFailed.call(self.table, cell.getComponent(), value, valid); - - return false; - } - } else { - // console.warn("Edit Success Error - cannot call success on a cell that is no longer being edited"); - } - } - - //handle aborted edit - function cancel() { - if (self.currentCell === cell) { - self.cancelEdit(); - - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.checkForRestyle(cell); - } - } else { - // console.warn("Edit Success Error - cannot call cancel on a cell that is no longer being edited"); - } - } - - function onRendered(callback) { - rendered = callback; - } - - if (!cell.column.modules.edit.blocked) { - if (e) { - e.stopPropagation(); - } - - switch (_typeof(cell.column.modules.edit.check)) { - case "function": - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - break; - - case "boolean": - allowEdit = cell.column.modules.edit.check; - break; - } - - if (allowEdit || forceEdit) { - - self.cancelEdit(); - - self.currentCell = cell; - - this.focusScrollAdjust(cell); - - component = cell.getComponent(); - - if (this.mouseClick) { - this.mouseClick = false; - - if (cell.column.cellEvents.cellClick) { - cell.column.cellEvents.cellClick.call(this.table, e, component); - } - } - - if (cell.column.cellEvents.cellEditing) { - cell.column.cellEvents.cellEditing.call(this.table, component); - } - - self.table.options.cellEditing.call(this.table, component); - - params = typeof cell.column.modules.edit.params === "function" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params; - - cellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params); - - //if editor returned, add to DOM, if false, abort edit - if (cellEditor !== false) { - - if (cellEditor instanceof Node) { - element.classList.add("tabulator-editing"); - cell.row.getElement().classList.add("tabulator-row-editing"); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.appendChild(cellEditor); - - //trigger onRendered Callback - rendered(); - - //prevent editing from triggering rowClick event - var children = element.children; - - for (var i = 0; i < children.length; i++) { - children[i].addEventListener("click", function (e) { - e.stopPropagation(); - }); - } - } else { - console.warn("Edit Error - Editor should return an instance of Node, the editor returned:", cellEditor); - element.blur(); - return false; - } - } else { - element.blur(); - return false; - } - - return true; - } else { - this.mouseClick = false; - element.blur(); - return false; - } - } else { - this.mouseClick = false; - element.blur(); - return false; - } - }; - - Edit.prototype.maskInput = function (el, options) { - var mask = options.mask, - maskLetter = typeof options.maskLetterChar !== "undefined" ? options.maskLetterChar : "A", - maskNumber = typeof options.maskNumberChar !== "undefined" ? options.maskNumberChar : "9", - maskWildcard = typeof options.maskWildcardChar !== "undefined" ? options.maskWildcardChar : "*", - success = false; - - function fillSymbols(index) { - var symbol = mask[index]; - if (typeof symbol !== "undefined" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber) { - el.value = el.value + "" + symbol; - fillSymbols(index + 1); - } - } - - el.addEventListener("keydown", function (e) { - var index = el.value.length, - char = e.key; - - if (e.keyCode > 46) { - if (index >= mask.length) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } else { - switch (mask[index]) { - case maskLetter: - if (char.toUpperCase() == char.toLowerCase()) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskNumber: - if (isNaN(char)) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - break; - - case maskWildcard: - break; - - default: - if (char !== mask[index]) { - e.preventDefault(); - e.stopPropagation(); - success = false; - return false; - } - } - } - - success = true; - } - - return; - }); - - el.addEventListener("keyup", function (e) { - if (e.keyCode > 46) { - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - } - }); - - if (!el.placeholder) { - el.placeholder = mask; - } - - if (options.maskAutoFill) { - fillSymbols(el.value.length); - } - }; - - Edit.prototype.getEditedCells = function () { - var output = []; - - this.editedCells.forEach(function (cell) { - output.push(cell.getComponent()); - }); - - return output; - }; - - Edit.prototype.clearEdited = function (cell) { - var editIndex; - - if (cell.modules.edit && cell.modules.edit.edited) { - cell.modules.validate.invalid = false; - - editIndex = this.editedCells.indexOf(cell); - - if (editIndex > -1) { - this.editedCells.splice(editIndex, 1); - } - } - }; - - //default data editors - Edit.prototype.editors = { - - //input element - input: function input(cell, onRendered, success, cancel, editorParams) { - - //create and style input - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", editorParams.search ? "search" : "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof cellValue !== "undefined" ? cellValue : ""; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - // case 9: - case 13: - onChange(e); - break; - - case 27: - cancel(); - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //resizable text area element - textarea: function textarea(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "hybrid", - value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""), - count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1, - input = document.createElement("textarea"), - scrollHeight = 0; - - //create and style input - input.style.display = "block"; - input.style.padding = "2px"; - input.style.height = "100%"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.whiteSpace = "pre-wrap"; - input.style.resize = "none"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange(e) { - - if ((cellValue === null || typeof cellValue === "undefined") && input.value !== "" || input.value !== cellValue) { - - if (success(input.value)) { - cellValue = input.value; //persist value if successfully validated incase editor is used as header filter - } - - setTimeout(function () { - cell.getRow().normalizeHeight(); - }, 300); - } else { - cancel(); - } - } - - //submit new value on blur or change - input.addEventListener("change", onChange); - input.addEventListener("blur", onChange); - - input.addEventListener("keyup", function () { - - input.style.height = ""; - - var heightNow = input.scrollHeight; - - input.style.height = heightNow + "px"; - - if (heightNow != scrollHeight) { - scrollHeight = heightNow; - cell.getRow().normalizeHeight(); - } - }); - - input.addEventListener("keydown", function (e) { - - switch (e.keyCode) { - case 27: - cancel(); - break; - - case 38: - //up arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - - break; - - case 40: - //down arrow - if (vertNav == "editor" || vertNav == "hybrid" && input.selectionStart !== input.value.length) { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - number: function number(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - input = document.createElement("input"); - - input.setAttribute("type", "number"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - var blurFunc = function blurFunc(e) { - onChange(); - }; - - onRendered(function () { - //submit new value on blur - input.removeEventListener("blur", blurFunc); - - input.focus({ preventScroll: true }); - input.style.height = "100%"; - - //submit new value on blur - input.addEventListener("blur", blurFunc); - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value !== cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - - case 38: //up arrow - case 40: - //down arrow - if (vertNav == "editor") { - e.stopImmediatePropagation(); - e.stopPropagation(); - } - break; - } - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //input element with type of number - range: function range(cell, onRendered, success, cancel, editorParams) { - - var cellValue = cell.getValue(), - input = document.createElement("input"); - - input.setAttribute("type", "range"); - - if (typeof editorParams.max != "undefined") { - input.setAttribute("max", editorParams.max); - } - - if (typeof editorParams.min != "undefined") { - input.setAttribute("min", editorParams.min); - } - - if (typeof editorParams.step != "undefined") { - input.setAttribute("step", editorParams.step); - } - - //create and style input - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = cellValue; - - onRendered(function () { - input.focus({ preventScroll: true }); - input.style.height = "100%"; - }); - - function onChange() { - var value = input.value; - - if (!isNaN(value) && value !== "") { - value = Number(value); - } - - if (value != cellValue) { - if (success(value)) { - cellValue = value; //persist value if successfully validated incase editor is used as header filter - } - } else { - cancel(); - } - } - - //submit new value on blur - input.addEventListener("blur", function (e) { - onChange(); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 13: - // case 9: - onChange(); - break; - - case 27: - cancel(); - break; - } - }); - - return input; - }, - - //select - select: function select(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : [], - input = document.createElement("input"), - listEl = document.createElement("div"), - multiselect = editorParams.multiselect, - dataItems = [], - currentItem = {}, - displayItems = [], - currentItems = [], - blurable = true; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - if (Array.isArray(editorParams) || !Array.isArray(editorParams) && (typeof editorParams === 'undefined' ? 'undefined' : _typeof(editorParams)) === "object" && !editorParams.values) { - console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); - editorParams = { values: editorParams }; - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create select lookup list:", field); - } - - return output; - } - - function parseItems(inputValues, curentValues) { - var dataList = []; - var displayList = []; - - function processComplexListItem(item) { - var item = { - label: item.label, - value: item.value, - itemParams: item.itemParams, - elementAttributes: item.elementAttributes, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - - return item; - } - - if (typeof inputValues == "function") { - inputValues = inputValues(cell); - } - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - var item; - - if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === "object") { - - if (value.options) { - item = { - label: value.label, - group: true, - itemParams: value.itemParams, - elementAttributes: value.elementAttributes, - element: false - }; - - displayList.push(item); - - value.options.forEach(function (item) { - processComplexListItem(item); - }); - } else { - processComplexListItem(value); - } - } else { - - item = { - label: value, - value: value, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - } - }); - } else { - for (var key in inputValues) { - var item = { - label: inputValues[key], - value: key, - element: false - }; - - // if(item.value === curentValue || (!isNaN(parseFloat(item.value)) && !isNaN(parseFloat(item.value)) && parseFloat(item.value) === parseFloat(curentValue))){ - // setCurrentItem(item); - // } - - if (curentValues.indexOf(item.value) > -1) { - setItem(item); - } - - dataList.push(item); - displayList.push(item); - } - } - - dataItems = dataList; - displayItems = displayList; - - fillList(); - } - - function fillList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }displayItems.forEach(function (item) { - - var el = item.element; - - if (!el) { - el = document.createElement("div"); - item.label = editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label, cell, el, item.itemParams) : item.label; - if (item.group) { - el.classList.add("tabulator-edit-select-list-group"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - } else { - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.label === "" ? " " : item.label; - - el.addEventListener("click", function () { - // setCurrentItem(item); - // chooseItem(); - if (multiselect) { - toggleItem(item); - input.focus(); - } else { - chooseItem(item); - } - }); - - // if(item === currentItem){ - // el.classList.add("active"); - // } - - if (currentItems.indexOf(item) > -1) { - el.classList.add("active"); - } - } - - if (item.elementAttributes && _typeof(item.elementAttributes) == "object") { - for (var key in item.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - el.setAttribute(key, input.getAttribute(key) + item.elementAttributes["+" + key]); - } else { - el.setAttribute(key, item.elementAttributes[key]); - } - } - } - el.addEventListener("mousedown", function () { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - } - - listEl.appendChild(el); - }); - } - - function setCurrentItem(item, active) { - - if (!multiselect && currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("focused"); - } - - currentItem = item; - - if (item.element) { - item.element.classList.add("focused"); - if (active) { - item.element.classList.add("active"); - } - } - } - - // function chooseItem(){ - // hideList(); - - // if(initialValue !== currentItem.value){ - // initialValue = currentItem.value; - // success(currentItem.value); - // }else{ - // cancel(); - // } - // } - - function setItem(item) { - var index = currentItems.indexOf(item); - - if (index == -1) { - currentItems.push(item); - setCurrentItem(item, true); - } - - fillInput(); - } - - function unsetItem(index) { - var item = currentItems[index]; - - if (index > -1) { - currentItems.splice(index, 1); - if (item.element) { - item.element.classList.remove("active"); - } - } - } - - function toggleItem(item) { - if (!item) { - item = currentItem; - } - - var index = currentItems.indexOf(item); - - if (index > -1) { - unsetItem(index); - } else { - if (multiselect !== true && currentItems.length >= multiselect) { - unsetItem(0); - } - - setItem(item); - } - - fillInput(); - } - - function chooseItem(item) { - hideList(); - - if (!item) { - item = currentItem; - } - - if (item) { - success(item.value); - } - } - - function chooseItems() { - hideList(); - - var output = []; - - currentItems.forEach(function (item) { - output.push(item.value); - }); - - success(output); - } - - function fillInput() { - var output = []; - - currentItems.forEach(function (item) { - output.push(item.label); - }); - - input.value = output.join(", "); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function showList() { - if (!listEl.parentNode) { - - if (editorParams.values === true) { - parseItems(getUniqueColumnValues(), initialDisplayValue); - } else if (typeof editorParams.values === "string") { - parseItems(getUniqueColumnValues(editorParams.values), initialDisplayValue); - } else { - parseItems(editorParams.values || [], initialDisplayValue); - } - - var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - document.body.appendChild(listEl); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //style input - input.setAttribute("type", "text"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - input.style.cursor = "default"; - input.readOnly = this.currentCell != false; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = typeof initialValue !== "undefined" || initialValue === null ? initialValue : ""; - - // if(editorParams.values === true){ - // parseItems(getUniqueColumnValues(), initialValue); - // }else if(typeof editorParams.values === "string"){ - // parseItems(getUniqueColumnValues(editorParams.values), initialValue); - // }else{ - // parseItems(editorParams.values || [], initialValue); - // } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(dataItems[index - 1], !multiselect); - } - } - break; - - case 40: - //down arrow - index = dataItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < dataItems.length - 1) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < dataItems.length - 1) { - if (index == -1) { - setCurrentItem(dataItems[0], !multiselect); - } else { - setCurrentItem(dataItems[index + 1], !multiselect); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - break; - - case 13: - //enter - // chooseItem(); - - if (multiselect) { - toggleItem(); - } else { - chooseItem(); - } - - break; - - case 27: - //escape - cancelItem(); - break; - } - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - if (multiselect) { - chooseItems(); - } else { - cancelItem(); - } - } - }); - - input.addEventListener("focus", function (e) { - showList(); - }); - - //style list element - listEl = document.createElement("div"); - listEl.classList.add("tabulator-edit-select-list"); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - return input; - }, - - //autocomplete - autocomplete: function autocomplete(cell, onRendered, success, cancel, editorParams) { - var self = this, - cellEl = cell.getElement(), - initialValue = cell.getValue(), - vertNav = editorParams.verticalNavigation || "editor", - initialDisplayValue = typeof initialValue !== "undefined" || initialValue === null ? initialValue : typeof editorParams.defaultValue !== "undefined" ? editorParams.defaultValue : "", - input = document.createElement("input"), - listEl = document.createElement("div"), - allItems = [], - displayItems = [], - values = [], - currentItem = false, - blurable = true, - uniqueColumnValues = false; - - this.table.rowManager.element.addEventListener("scroll", cancelItem); - - //style input - input.setAttribute("type", "search"); - - input.style.padding = "4px"; - input.style.width = "100%"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style list element - listEl.classList.add("tabulator-edit-select-list"); - - listEl.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - function genUniqueColumnValues() { - if (editorParams.values === true) { - uniqueColumnValues = getUniqueColumnValues(); - } else if (typeof editorParams.values === "string") { - uniqueColumnValues = getUniqueColumnValues(editorParams.values); - } - } - - function getUniqueColumnValues(field) { - var output = {}, - data = self.table.getData(), - column; - - if (field) { - column = self.table.columnManager.getColumnByField(field); - } else { - column = cell.getColumn()._getSelf(); - } - - if (column) { - data.forEach(function (row) { - var val = column.getFieldValue(row); - - if (val !== null && typeof val !== "undefined" && val !== "") { - output[val] = true; - } - }); - - if (editorParams.sortValuesList) { - if (editorParams.sortValuesList == "asc") { - output = Object.keys(output).sort(); - } else { - output = Object.keys(output).sort().reverse(); - } - } else { - output = Object.keys(output); - } - } else { - console.warn("unable to find matching column to create autocomplete lookup list:", field); - } - - return output; - } - - function filterList(term, intialLoad) { - var matches = [], - values, - items, - searchEl; - - //lookup base values list - if (uniqueColumnValues) { - values = uniqueColumnValues; - } else { - values = editorParams.values || []; - } - - if (editorParams.searchFunc) { - matches = editorParams.searchFunc(term, values); - - if (matches instanceof Promise) { - - addNotice(typeof editorParams.searchingPlaceholder !== "undefined" ? editorParams.searchingPlaceholder : "Searching..."); - - matches.then(function (result) { - fillListIfNotEmpty(parseItems(result), intialLoad); - }).catch(function (err) { - console.err("error in autocomplete search promise:", err); - }); - } else { - fillListIfNotEmpty(parseItems(matches), intialLoad); - } - } else { - items = parseItems(values); - - if (term === "") { - if (editorParams.showListOnEmpty) { - matches = items; - } - } else { - items.forEach(function (item) { - if (item.value !== null || typeof item.value !== "undefined") { - if (String(item.value).toLowerCase().indexOf(String(term).toLowerCase()) > -1 || String(item.title).toLowerCase().indexOf(String(term).toLowerCase()) > -1) { - matches.push(item); - } - } - }); - } - - fillListIfNotEmpty(matches, intialLoad); - } - } - - function addNotice(notice) { - var searchEl = document.createElement("div"); - - clearList(); - - if (notice !== false) { - searchEl.classList.add("tabulator-edit-select-list-notice"); - searchEl.tabIndex = 0; - - if (notice instanceof Node) { - searchEl.appendChild(notice); - } else { - searchEl.innerHTML = notice; - } - - listEl.appendChild(searchEl); - } - } - - function parseItems(inputValues) { - var itemList = []; - - if (Array.isArray(inputValues)) { - inputValues.forEach(function (value) { - - var item = {}; - - if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === "object") { - item.title = editorParams.listItemFormatter ? editorParams.listItemFormatter(value.value, value.label) : value.label; - item.value = value.value; - } else { - item.title = editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value; - item.value = value; - } - - itemList.push(item); - }); - } else { - for (var key in inputValues) { - var item = { - title: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key], - value: key - }; - - itemList.push(item); - } - } - - return itemList; - } - - function clearList() { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - } - } - - function fillListIfNotEmpty(items, intialLoad) { - if (items.length) { - fillList(items, intialLoad); - } else { - if (editorParams.emptyPlaceholder) { - addNotice(editorParams.emptyPlaceholder); - } - } - } - - function fillList(items, intialLoad) { - var current = false; - - clearList(); - - displayItems = items; - - displayItems.forEach(function (item) { - var el = item.element; - - if (!el) { - el = document.createElement("div"); - el.classList.add("tabulator-edit-select-list-item"); - el.tabIndex = 0; - el.innerHTML = item.title; - - el.addEventListener("click", function (e) { - setCurrentItem(item); - chooseItem(); - }); - - el.addEventListener("mousedown", function (e) { - blurable = false; - - setTimeout(function () { - blurable = true; - }, 10); - }); - - item.element = el; - - if (intialLoad && item.value == initialValue) { - input.value = item.title; - item.element.classList.add("active"); - current = true; - } - - if (item === currentItem) { - item.element.classList.add("active"); - current = true; - } - } - - listEl.appendChild(el); - }); - - if (!current) { - setCurrentItem(false); - } - } - - function chooseItem() { - hideList(); - - if (currentItem) { - if (initialValue !== currentItem.value) { - initialValue = currentItem.value; - input.value = currentItem.title; - success(currentItem.value); - } else { - cancel(); - } - } else { - if (editorParams.freetext) { - initialValue = input.value; - success(input.value); - } else { - if (editorParams.allowEmpty && input.value === "") { - initialValue = input.value; - success(input.value); - } else { - cancel(); - } - } - } - } - - function showList() { - if (!listEl.parentNode) { - while (listEl.firstChild) { - listEl.removeChild(listEl.firstChild); - }var offset = Tabulator.prototype.helpers.elOffset(cellEl); - - listEl.style.minWidth = cellEl.offsetWidth + "px"; - - listEl.style.top = offset.top + cellEl.offsetHeight + "px"; - listEl.style.left = offset.left + "px"; - document.body.appendChild(listEl); - } - } - - function setCurrentItem(item, showInputValue) { - if (currentItem && currentItem.element) { - currentItem.element.classList.remove("active"); - } - - currentItem = item; - - if (item && item.element) { - item.element.classList.add("active"); - } - } - - function hideList() { - if (listEl.parentNode) { - listEl.parentNode.removeChild(listEl); - } - - removeScrollListener(); - } - - function cancelItem() { - hideList(); - cancel(); - } - - function removeScrollListener() { - self.table.rowManager.element.removeEventListener("scroll", cancelItem); - } - - //allow key based navigation - input.addEventListener("keydown", function (e) { - var index; - - switch (e.keyCode) { - case 38: - //up arrow - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index > 0) { - setCurrentItem(displayItems[index - 1]); - } else { - setCurrentItem(false); - } - } - break; - - case 40: - //down arrow - - index = displayItems.indexOf(currentItem); - - if (vertNav == "editor" || vertNav == "hybrid" && index < displayItems.length - 1) { - - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - - if (index < displayItems.length - 1) { - if (index == -1) { - setCurrentItem(displayItems[0]); - } else { - setCurrentItem(displayItems[index + 1]); - } - } - } - break; - - case 37: //left arrow - case 39: - //right arrow - e.stopImmediatePropagation(); - e.stopPropagation(); - // e.preventDefault(); - break; - - case 13: - //enter - chooseItem(); - break; - - case 27: - //escape - cancelItem(); - break; - - case 36: //home - case 35: - //end - //prevent table navigation while using input element - e.stopImmediatePropagation(); - break; - } - }); - - input.addEventListener("keyup", function (e) { - - switch (e.keyCode) { - case 38: //up arrow - case 37: //left arrow - case 39: //up arrow - case 40: //right arrow - case 13: //enter - case 27: - //escape - break; - - default: - filterList(input.value); - } - }); - - input.addEventListener("search", function (e) { - filterList(input.value); - }); - - input.addEventListener("blur", function (e) { - if (blurable) { - chooseItem(); - } - }); - - input.addEventListener("focus", function (e) { - var value = initialDisplayValue; - genUniqueColumnValues(); - showList(); - input.value = value; - filterList(value, true); - }); - - onRendered(function () { - input.style.height = "100%"; - input.focus({ preventScroll: true }); - }); - - if (editorParams.mask) { - this.table.modules.edit.maskInput(input, editorParams); - } - - return input; - }, - - //star rating - star: function star(cell, onRendered, success, cancel, editorParams) { - var self = this, - element = cell.getElement(), - value = cell.getValue(), - maxStars = element.getElementsByTagName("svg").length || 5, - size = element.getElementsByTagName("svg")[0] ? element.getElementsByTagName("svg")[0].getAttribute("width") : 14, - stars = [], - starsHolder = document.createElement("div"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"); - - //change star type - function starChange(val) { - stars.forEach(function (star, i) { - if (i < val) { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-active"); - } else { - star.classList.replace("tabulator-star-inactive", "tabulator-star-active"); - } - - star.innerHTML = ''; - } else { - if (self.table.browser == "ie") { - star.setAttribute("class", "tabulator-star-inactive"); - } else { - star.classList.replace("tabulator-star-active", "tabulator-star-inactive"); - } - - star.innerHTML = ''; - } - }); - } - - //build stars - function buildStar(i) { - - var starHolder = document.createElement("span"); - var nextStar = star.cloneNode(true); - - stars.push(nextStar); - - starHolder.addEventListener("mouseenter", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - starChange(i); - }); - - starHolder.addEventListener("mousemove", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - }); - - starHolder.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - success(i); - element.blur(); - }); - - starHolder.appendChild(nextStar); - starsHolder.appendChild(starHolder); - } - - //handle keyboard navigation value change - function changeValue(val) { - value = val; - starChange(val); - } - - //style cell - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - //style holding element - starsHolder.style.verticalAlign = "middle"; - starsHolder.style.display = "inline-block"; - starsHolder.style.padding = "4px"; - - //style star - star.setAttribute("width", size); - star.setAttribute("height", size); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - starsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - starsHolder.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //create correct number of stars - for (var i = 1; i <= maxStars; i++) { - buildStar(i); - } - - //ensure value does not exceed number of stars - value = Math.min(parseInt(value), maxStars); - - // set initial styling of stars - starChange(value); - - starsHolder.addEventListener("mousemove", function (e) { - starChange(0); - }); - - starsHolder.addEventListener("click", function (e) { - success(0); - }); - - element.addEventListener("blur", function (e) { - cancel(); - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - changeValue(value + 1); - break; - - case 37: - //left arrow - changeValue(value - 1); - break; - - case 13: - //enter - success(value); - break; - - case 27: - //escape - cancel(); - break; - } - }); - - return starsHolder; - }, - - //draggable progress bar - progress: function progress(cell, onRendered, success, cancel, editorParams) { - var element = cell.getElement(), - max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max, - min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min, - percent = (max - min) / 100, - value = cell.getValue() || 0, - handle = document.createElement("div"), - bar = document.createElement("div"), - mouseDrag, - mouseDragWidth; - - //set new value - function updateValue() { - var calcVal = percent * Math.round(bar.offsetWidth / (element.clientWidth / 100)) + min; - success(calcVal); - element.setAttribute("aria-valuenow", calcVal); - element.setAttribute("aria-label", value); - } - - //style handle - handle.style.position = "absolute"; - handle.style.right = "0"; - handle.style.top = "0"; - handle.style.bottom = "0"; - handle.style.width = "5px"; - handle.classList.add("tabulator-progress-handle"); - - //style bar - bar.style.display = "inline-block"; - bar.style.position = "relative"; - // bar.style.top = "8px"; - // bar.style.bottom = "8px"; - // bar.style.left = "4px"; - // bar.style.marginRight = "4px"; - bar.style.height = "100%"; - bar.style.backgroundColor = "#488CE9"; - bar.style.maxWidth = "100%"; - bar.style.minWidth = "0%"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - bar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - bar.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - //style cell - element.style.padding = "4px 4px"; - - //make sure value is in range - value = Math.min(parseFloat(value), max); - value = Math.max(parseFloat(value), min); - - //workout percentage - value = Math.round((value - min) / percent); - // bar.style.right = value + "%"; - bar.style.width = value + "%"; - - element.setAttribute("aria-valuemin", min); - element.setAttribute("aria-valuemax", max); - - bar.appendChild(handle); - - handle.addEventListener("mousedown", function (e) { - mouseDrag = e.screenX; - mouseDragWidth = bar.offsetWidth; - }); - - handle.addEventListener("mouseover", function () { - handle.style.cursor = "ew-resize"; - }); - - element.addEventListener("mousemove", function (e) { - if (mouseDrag) { - bar.style.width = mouseDragWidth + e.screenX - mouseDrag + "px"; - } - }); - - element.addEventListener("mouseup", function (e) { - if (mouseDrag) { - e.stopPropagation(); - e.stopImmediatePropagation(); - - mouseDrag = false; - mouseDragWidth = false; - - updateValue(); - } - }); - - //allow key based navigation - element.addEventListener("keydown", function (e) { - switch (e.keyCode) { - case 39: - //right arrow - e.preventDefault(); - bar.style.width = bar.clientWidth + element.clientWidth / 100 + "px"; - break; - - case 37: - //left arrow - e.preventDefault(); - bar.style.width = bar.clientWidth - element.clientWidth / 100 + "px"; - break; - - case 9: //tab - case 13: - //enter - updateValue(); - break; - - case 27: - //escape - cancel(); - break; - - } - }); - - element.addEventListener("blur", function () { - cancel(); - }); - - return bar; - }, - - //checkbox - tickCross: function tickCross(cell, onRendered, success, cancel, editorParams) { - var value = cell.getValue(), - input = document.createElement("input"), - tristate = editorParams.tristate, - indetermValue = typeof editorParams.indeterminateValue === "undefined" ? null : editorParams.indeterminateValue, - indetermState = false; - - input.setAttribute("type", "checkbox"); - input.style.marginTop = "5px"; - input.style.boxSizing = "border-box"; - - if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") { - for (var key in editorParams.elementAttributes) { - if (key.charAt(0) == "+") { - key = key.slice(1); - input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]); - } else { - input.setAttribute(key, editorParams.elementAttributes[key]); - } - } - } - - input.value = value; - - if (tristate && (typeof value === "undefined" || value === indetermValue || value === "")) { - indetermState = true; - input.indeterminate = true; - } - - if (this.table.browser != "firefox") { - //prevent blur issue on mac firefox - onRendered(function () { - input.focus({ preventScroll: true }); - }); - } - - input.checked = value === true || value === "true" || value === "True" || value === 1; - - function setValue(blur) { - if (tristate) { - if (!blur) { - if (input.checked && !indetermState) { - input.checked = false; - input.indeterminate = true; - indetermState = true; - return indetermValue; - } else { - indetermState = false; - return input.checked; - } - } else { - if (indetermState) { - return indetermValue; - } else { - return input.checked; - } - } - } else { - return input.checked; - } - } - - //submit new value on blur - input.addEventListener("change", function (e) { - success(setValue()); - }); - - input.addEventListener("blur", function (e) { - success(setValue(true)); - }); - - //submit new value on enter - input.addEventListener("keydown", function (e) { - if (e.keyCode == 13) { - success(setValue()); - } - if (e.keyCode == 27) { - cancel(); - } - }); - - return input; - } - }; - - Tabulator.prototype.registerModule("edit", Edit); - - var ExportRow = function ExportRow(type, columns, component, indent) { - this.type = type; - this.columns = columns; - this.component = component || false; - this.indent = indent || 0; - }; - - var ExportColumn = function ExportColumn(value, component, width, height, depth) { - this.value = value; - this.component = component || false; - this.width = width; - this.height = height; - this.depth = depth; - }; - - var Export = function Export(table) { - this.table = table; //hold Tabulator object - this.config = {}; - this.cloneTableStyle = true; - this.colVisProp = ""; - }; - - Export.prototype.generateExportList = function (config, style, range, colVisProp) { - this.cloneTableStyle = style; - this.config = config || {}; - this.colVisProp = colVisProp; - - var headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : []; - var body = this.bodyToExportRows(this.rowLookup(range)); - - return headers.concat(body); - }; - - Export.prototype.genereateTable = function (config, style, range, colVisProp) { - var list = this.generateExportList(config, style, range, colVisProp); - - return this.genereateTableElement(list); - }; - - Export.prototype.rowLookup = function (range) { - var _this45 = this; - - var rows = []; - - if (typeof range == "function") { - range.call(this.table).forEach(function (row) { - row = _this45.table.rowManager.findRow(row); - - if (row) { - rows.push(row); - } - }); - } else { - switch (range) { - case true: - case "visible": - rows = this.table.rowManager.getVisibleRows(true); - break; - - case "all": - rows = this.table.rowManager.rows; - break; - - case "selected": - rows = this.table.modules.selectRow.selectedRows; - break; - - case "active": - default: - rows = this.table.rowManager.getDisplayRows(); - } - } - - return Object.assign([], rows); - }; - - Export.prototype.generateColumnGroupHeaders = function () { - var _this46 = this; - - var output = []; - - var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex; - - columns.forEach(function (column) { - var colData = _this46.processColumnGroup(column); - - if (colData) { - output.push(colData); - } - }); - - return output; - }; - - Export.prototype.processColumnGroup = function (column) { - var _this47 = this; - - var subGroups = column.columns, - maxDepth = 0, - title = column.definition["title" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title; - - var groupData = { - title: title, - column: column, - depth: 1 - }; - - if (subGroups.length) { - groupData.subGroups = []; - groupData.width = 0; - - subGroups.forEach(function (subGroup) { - var subGroupData = _this47.processColumnGroup(subGroup); - - if (subGroupData) { - groupData.width += subGroupData.width; - groupData.subGroups.push(subGroupData); - - if (subGroupData.depth > maxDepth) { - maxDepth = subGroupData.depth; - } - } - }); - - groupData.depth += maxDepth; - - if (!groupData.width) { - return false; - } - } else { - if (this.columnVisCheck(column)) { - groupData.width = 1; - } else { - return false; - } - } - - return groupData; - }; - - Export.prototype.columnVisCheck = function (column) { - return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]); - }; - - Export.prototype.headersToExportRows = function (columns) { - var headers = [], - headerDepth = 0, - exportRows = []; - - function parseColumnGroup(column, level) { - - var depth = headerDepth - level; - - if (typeof headers[level] === "undefined") { - headers[level] = []; - } - - column.height = column.subGroups ? 1 : depth - column.depth + 1; - - headers[level].push(column); - - if (column.height > 1) { - for (var _i6 = 1; _i6 < column.height; _i6++) { - - if (typeof headers[level + _i6] === "undefined") { - headers[level + _i6] = []; - } - - headers[level + _i6].push(false); - } - } - - if (column.width > 1) { - for (var _i7 = 1; _i7 < column.width; _i7++) { - headers[level].push(false); - } - } - - if (column.subGroups) { - column.subGroups.forEach(function (subGroup) { - parseColumnGroup(subGroup, level + 1); - }); - } - } - - //calculate maximum header debth - columns.forEach(function (column) { - if (column.depth > headerDepth) { - headerDepth = column.depth; - } - }); - - columns.forEach(function (column) { - parseColumnGroup(column, 0); - }); - - headers.forEach(function (header) { - var columns = []; - - header.forEach(function (col) { - if (col) { - columns.push(new ExportColumn(col.title, col.column.getComponent(), col.width, col.height, col.depth)); - } else { - columns.push(null); - } - }); - - exportRows.push(new ExportRow("header", columns)); - }); - - return exportRows; - }; - - Export.prototype.bodyToExportRows = function (rows) { - var _this48 = this; - - var columns = []; - var exportRows = []; - - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (_this48.columnVisCheck(column)) { - columns.push(column.getComponent()); - } - }); - - if (this.config.columnCalcs !== false && this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized) { - rows.unshift(this.table.modules.columnCalcs.topRow); - } - - if (this.table.modules.columnCalcs.botInitialized) { - rows.push(this.table.modules.columnCalcs.botRow); - } - } - - rows = rows.filter(function (row) { - switch (row.type) { - case "group": - return _this48.config.rowGroups !== false; - break; - - case "calc": - return _this48.config.columnCalcs !== false; - break; - - case "row": - return !(_this48.table.options.dataTree && _this48.config.dataTree === false && row.modules.dataTree.parent); - break; - } - - return true; - }); - - rows.forEach(function (row, i) { - var rowData = row.getData(_this48.colVisProp); - var exportCols = []; - var indent = 0; - - switch (row.type) { - case "group": - indent = row.level; - exportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1)); - break; - - case "calc": - case "row": - columns.forEach(function (col) { - exportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1)); - }); - - if (_this48.table.options.dataTree && _this48.config.dataTree !== false) { - indent = row.modules.dataTree.index; - } - break; - } - - exportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent)); - }); - - return exportRows; - }; - - Export.prototype.genereateTableElement = function (list) { - var _this49 = this; - - var table = document.createElement("table"), - headerEl = document.createElement("thead"), - bodyEl = document.createElement("tbody"), - styles = this.lookupTableStyles(), - rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))], - setup = {}; - - setup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter; - - if (this.table.options.dataTree && this.config.dataTree !== false && this.table.modExists("columnCalcs")) { - setup.treeElementField = this.table.modules.dataTree.elementField; - } - - //assign group header formatter - setup.groupHeader = this.table.options["groupHeader" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))]; - - if (setup.groupHeader && !Array.isArray(setup.groupHeader)) { - setup.groupHeader = [setup.groupHeader]; - } - - table.classList.add("tabulator-print-table"); - - this.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - - if (list.length > 1000) { - console.warn("It may take a long time to render an HTML table with more than 1000 rows"); - } - - list.forEach(function (row, i) { - switch (row.type) { - case "header": - headerEl.appendChild(_this49.genereateHeaderElement(row, setup, styles)); - break; - - case "group": - bodyEl.appendChild(_this49.genereateGroupElement(row, setup, styles)); - break; - - case "calc": - bodyEl.appendChild(_this49.genereateCalcElement(row, setup, styles)); - break; - - case "row": - var rowEl = _this49.genereateRowElement(row, setup, styles); - _this49.mapElementStyles(i % 2 && styles.evenRow ? styles.evenRow : styles.oddRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - bodyEl.appendChild(rowEl); - break; - } - }); - - if (headerEl.innerHTML) { - table.appendChild(headerEl); - } - - table.appendChild(bodyEl); - - this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]); - return table; - }; - - Export.prototype.lookupTableStyles = function () { - var styles = {}; - - //lookup row styles - if (this.cloneTableStyle && window.getComputedStyle) { - styles.oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"); - styles.evenRow = this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"); - styles.calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs"); - styles.firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"); - styles.firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0]; - - if (styles.firstRow) { - styles.styleCells = styles.firstRow.getElementsByClassName("tabulator-cell"); - styles.firstCell = styles.styleCells[0]; - styles.lastCell = styles.styleCells[styles.styleCells.length - 1]; - } - } - - return styles; - }; - - Export.prototype.genereateHeaderElement = function (row, setup, styles) { - var _this50 = this; - - var rowEl = document.createElement("tr"); - - row.columns.forEach(function (column) { - if (column) { - var cellEl = document.createElement("th"); - var classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(" ") : []; - - cellEl.colSpan = column.width; - cellEl.rowSpan = column.height; - - cellEl.innerHTML = column.value; - - if (_this50.cloneTableStyle) { - cellEl.style.boxSizing = "border-box"; - } - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - _this50.mapElementStyles(column.component.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]); - _this50.mapElementStyles(column.component._column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - if (column.component._column.visible) { - _this50.mapElementStyles(column.component.getElement(), cellEl, ["width"]); - } else { - if (column.component._column.definition.width) { - cellEl.style.width = column.component._column.definition.width + "px"; - } - } - - if (column.component._column.parent) { - _this50.mapElementStyles(column.component._column.parent.groupElement, cellEl, ["border-top"]); - } - - rowEl.appendChild(cellEl); - } - }); - - return rowEl; - }; - - Export.prototype.genereateGroupElement = function (row, setup, styles) { - - var rowEl = document.createElement("tr"), - cellEl = document.createElement("td"), - group = row.columns[0]; - - rowEl.classList.add("tabulator-print-table-row"); - - if (setup.groupHeader && setup.groupHeader[row.indent]) { - group.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } else { - if (setup.groupHeader === false) { - group.value = group.value; - } else { - group.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component); - } - } - - cellEl.colSpan = group.width; - cellEl.innerHTML = group.value; - - rowEl.classList.add("tabulator-print-table-group"); - rowEl.classList.add("tabulator-group-level-" + row.indent); - - if (group.component.getVisibility()) { - rowEl.classList.add("tabulator-group-visible"); - } - - this.mapElementStyles(styles.firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - this.mapElementStyles(styles.firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]); - - rowEl.appendChild(cellEl); - - return rowEl; - }; - - Export.prototype.genereateCalcElement = function (row, setup, styles) { - var rowEl = this.genereateRowElement(row, setup, styles); - - rowEl.classList.add("tabulator-print-table-calcs"); - this.mapElementStyles(styles.calcRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]); - - return rowEl; - }; - - Export.prototype.genereateRowElement = function (row, setup, styles) { - var _this51 = this; - - var rowEl = document.createElement("tr"); - - rowEl.classList.add("tabulator-print-table-row"); - - row.columns.forEach(function (col) { - - if (col) { - var cellEl = document.createElement("td"), - column = col.component._column, - value = col.value; - - var cellWrapper = { - modules: {}, - getValue: function getValue() { - return value; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return cellEl; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getData: function getData() { - return rowData; - }, - getRow: function getRow() { - return row.getComponent(); - }, - getComponent: function getComponent() { - return cellWrapper; - }, - column: column - }; - - var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : []; - - classNames.forEach(function (className) { - cellEl.classList.add(className); - }); - - if (_this51.table.modExists("format") && _this51.config.formatCells !== false) { - value = _this51.table.modules.format.formatExportValue(cellWrapper, _this51.colVisProp); - } else { - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "object": - value = JSON.stringify(value); - break; - - case "undefined": - case "null": - value = ""; - break; - - default: - value = value; - } - } - - if (value instanceof Node) { - cellEl.appendChild(value); - } else { - cellEl.innerHTML = value; - } - - if (styles.firstCell) { - _this51.mapElementStyles(styles.firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size"]); - - if (column.definition.align) { - cellEl.style.textAlign = column.definition.align; - } - } - - if (_this51.table.options.dataTree && _this51.config.dataTree !== false) { - if (setup.treeElementField && setup.treeElementField == column.field || !setup.treeElementField && i == 0) { - if (row.component._row.modules.dataTree.controlEl) { - cellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild); - } - if (row.component._row.modules.dataTree.branchEl) { - cellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild); - } - } - } - - rowEl.appendChild(cellEl); - - if (cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback) { - cellWrapper.modules.format.renderedCallback(); - } - - if (setup.rowFormatter && _this51.config.formatCells !== false) { - var rowComponent = row.getComponent(); - - rowComponent.getElement = function () { - return rowEl; - }; - - setup.rowFormatter(rowComponent); - } - } - }); - - return rowEl; - }; - - Export.prototype.genereateHTMLTable = function (list) { - var holder = document.createElement("div"); - - holder.appendChild(this.genereateTableElement(list)); - - return holder.innerHTML; - }; - - Export.prototype.getHtml = function (visible, style, config, colVisProp) { - var list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput"); - - return this.genereateHTMLTable(list); - }; - - Export.prototype.mapElementStyles = function (from, to, props) { - if (this.cloneTableStyle && from && to) { - - var lookup = { - "background-color": "backgroundColor", - "color": "fontColor", - "width": "width", - "font-weight": "fontWeight", - "font-family": "fontFamily", - "font-size": "fontSize", - "text-align": "textAlign", - "border-top": "borderTop", - "border-left": "borderLeft", - "border-right": "borderRight", - "border-bottom": "borderBottom", - "padding-top": "paddingTop", - "padding-left": "paddingLeft", - "padding-right": "paddingRight", - "padding-bottom": "paddingBottom" - }; - - if (window.getComputedStyle) { - var fromStyle = window.getComputedStyle(from); - - props.forEach(function (prop) { - to.style[lookup[prop]] = fromStyle.getPropertyValue(prop); - }); - } - } - }; - - Tabulator.prototype.registerModule("export", Export); - - var Filter = function Filter(table) { - - this.table = table; //hold Tabulator object - - this.filterList = []; //hold filter list - this.headerFilters = {}; //hold column filters - this.headerFilterColumns = []; //hold columns that use header filters - - this.prevHeaderFilterChangeCheck = ""; - this.prevHeaderFilterChangeCheck = "{}"; - - this.changed = false; //has filtering changed since last render - }; - - //initialize column header filter - Filter.prototype.initializeColumn = function (column, value) { - var self = this, - field = column.getField(), - params; - - //handle successfull value change - function success(value) { - var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match", - type = "", - filterChangeCheck = "", - filterFunc; - - if (typeof column.modules.filter.prevSuccess === "undefined" || column.modules.filter.prevSuccess !== value) { - - column.modules.filter.prevSuccess = value; - - if (!column.modules.filter.emptyFunc(value)) { - column.modules.filter.value = value; - - switch (_typeof(column.definition.headerFilterFunc)) { - case "string": - if (self.filters[column.definition.headerFilterFunc]) { - type = column.definition.headerFilterFunc; - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return self.filters[column.definition.headerFilterFunc](value, fieldVal, data, params); - }; - } else { - console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc); - } - break; - - case "function": - filterFunc = function filterFunc(data) { - var params = column.definition.headerFilterFuncParams || {}; - var fieldVal = column.getFieldValue(data); - - params = typeof params === "function" ? params(value, fieldVal, data) : params; - - return column.definition.headerFilterFunc(value, fieldVal, data, params); - }; - - type = filterFunc; - break; - } - - if (!filterFunc) { - switch (filterType) { - case "partial": - filterFunc = function filterFunc(data) { - var colVal = column.getFieldValue(data); - - if (typeof colVal !== 'undefined' && colVal !== null) { - return String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1; - } else { - return false; - } - }; - type = "like"; - break; - - default: - filterFunc = function filterFunc(data) { - return column.getFieldValue(data) == value; - }; - type = "="; - } - } - - self.headerFilters[field] = { value: value, func: filterFunc, type: type, params: params || {} }; - } else { - delete self.headerFilters[field]; - } - - filterChangeCheck = JSON.stringify(self.headerFilters); - - if (self.prevHeaderFilterChangeCheck !== filterChangeCheck) { - self.prevHeaderFilterChangeCheck = filterChangeCheck; - - self.changed = true; - self.table.rowManager.filterRefresh(); - } - } - - return true; - } - - column.modules.filter = { - success: success, - attrType: false, - tagType: false, - emptyFunc: false - }; - - this.generateHeaderFilterElement(column); - }; - - Filter.prototype.generateHeaderFilterElement = function (column, initialValue, reinitialize) { - var _this52 = this; - - var self = this, - success = column.modules.filter.success, - field = column.getField(), - filterElement, - editor, - editorElement, - cellWrapper, - typingTimer, - searchTrigger, - params; - - //handle aborted edit - function cancel() {} - - if (column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode) { - column.contentElement.removeChild(column.modules.filter.headerElement.parentNode); - } - - if (field) { - - //set empty value function - column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) { - return !value && value !== "0"; - }; - - filterElement = document.createElement("div"); - filterElement.classList.add("tabulator-header-filter"); - - //set column editor - switch (_typeof(column.definition.headerFilter)) { - case "string": - if (self.table.modules.edit.editors[column.definition.headerFilter]) { - editor = self.table.modules.edit.editors[column.definition.headerFilter]; - - if ((column.definition.headerFilter === "tick" || column.definition.headerFilter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - console.warn("Filter Error - Cannot build header filter, No such editor found: ", column.definition.editor); - } - break; - - case "function": - editor = column.definition.headerFilter; - break; - - case "boolean": - if (column.modules.edit && column.modules.edit.editor) { - editor = column.modules.edit.editor; - } else { - if (column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]) { - editor = self.table.modules.edit.editors[column.definition.formatter]; - - if ((column.definition.formatter === "tick" || column.definition.formatter === "tickCross") && !column.definition.headerFilterEmptyCheck) { - column.modules.filter.emptyFunc = function (value) { - return value !== true && value !== false; - }; - } - } else { - editor = self.table.modules.edit.editors["input"]; - } - } - break; - } - - if (editor) { - - cellWrapper = { - getValue: function getValue() { - return typeof initialValue !== "undefined" ? initialValue : ""; - }, - getField: function getField() { - return column.definition.field; - }, - getElement: function getElement() { - return filterElement; - }, - getColumn: function getColumn() { - return column.getComponent(); - }, - getRow: function getRow() { - return { - normalizeHeight: function normalizeHeight() {} - }; - } - }; - - params = column.definition.headerFilterParams || {}; - - params = typeof params === "function" ? params.call(self.table) : params; - - editorElement = editor.call(this.table.modules.edit, cellWrapper, function () {}, success, cancel, params); - - if (!editorElement) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor returned a value of false"); - return; - } - - if (!(editorElement instanceof Node)) { - console.warn("Filter Error - Cannot add filter to " + field + " column, editor should return an instance of Node, the editor returned:", editorElement); - return; - } - - //set Placeholder Text - if (field) { - self.table.modules.localize.bind("headerFilters|columns|" + column.definition.field, function (value) { - editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.table.modules.localize.getText("headerFilters|default")); - }); - } else { - self.table.modules.localize.bind("headerFilters|default", function (value) { - editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value); - }); - } - - //focus on element on click - editorElement.addEventListener("click", function (e) { - e.stopPropagation(); - editorElement.focus(); - }); - - editorElement.addEventListener("focus", function (e) { - var left = _this52.table.columnManager.element.scrollLeft; - - if (left !== _this52.table.rowManager.element.scrollLeft) { - _this52.table.rowManager.scrollHorizontal(left); - _this52.table.columnManager.scrollHorizontal(left); - } - }); - - //live update filters as user types - typingTimer = false; - - searchTrigger = function searchTrigger(e) { - if (typingTimer) { - clearTimeout(typingTimer); - } - - typingTimer = setTimeout(function () { - success(editorElement.value); - }, self.table.options.headerFilterLiveFilterDelay); - }; - - column.modules.filter.headerElement = editorElement; - column.modules.filter.attrType = editorElement.hasAttribute("type") ? editorElement.getAttribute("type").toLowerCase() : ""; - column.modules.filter.tagType = editorElement.tagName.toLowerCase(); - - if (column.definition.headerFilterLiveFilter !== false) { - - if (!(column.definition.headerFilter === 'autocomplete' || column.definition.headerFilter === 'tickCross' || (column.definition.editor === 'autocomplete' || column.definition.editor === 'tickCross') && column.definition.headerFilter === true)) { - editorElement.addEventListener("keyup", searchTrigger); - editorElement.addEventListener("search", searchTrigger); - - //update number filtered columns on change - if (column.modules.filter.attrType == "number") { - editorElement.addEventListener("change", function (e) { - success(editorElement.value); - }); - } - - //change text inputs to search inputs to allow for clearing of field - if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") { - editorElement.setAttribute("type", "search"); - // editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click - } - } - - //prevent input and select elements from propegating click to column sorters etc - if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") { - editorElement.addEventListener("mousedown", function (e) { - e.stopPropagation(); - }); - } - } - - filterElement.appendChild(editorElement); - - column.contentElement.appendChild(filterElement); - - if (!reinitialize) { - self.headerFilterColumns.push(column); - } - } - } else { - console.warn("Filter Error - Cannot add header filter, column has no field set:", column.definition.title); - } - }; - - //hide all header filter elements (used to ensure correct column widths in "fitData" layout mode) - Filter.prototype.hideHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = 'none'; - } - }); - }; - - //show all header filter elements (used to ensure correct column widths in "fitData" layout mode) - Filter.prototype.showHeaderFilterElements = function () { - this.headerFilterColumns.forEach(function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.style.display = ''; - } - }); - }; - - //programatically set focus of header filter - Filter.prototype.setHeaderFilterFocus = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - column.modules.filter.headerElement.focus(); - } else { - console.warn("Column Filter Focus Error - No header filter set on column:", column.getField()); - } - }; - - //programmatically get value of header filter - Filter.prototype.getHeaderFilterValue = function (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - return column.modules.filter.headerElement.value; - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - }; - - //programatically set value of header filter - Filter.prototype.setHeaderFilterValue = function (column, value) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, value, true); - column.modules.filter.success(value); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } - }; - - Filter.prototype.reloadHeaderFilter = function (column) { - if (column) { - if (column.modules.filter && column.modules.filter.headerElement) { - this.generateHeaderFilterElement(column, column.modules.filter.value, true); - } else { - console.warn("Column Filter Error - No header filter set on column:", column.getField()); - } - } - }; - - //check if the filters has changed since last use - Filter.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; - }; - - //set standard filters - Filter.prototype.setFilter = function (field, type, value, params) { - var self = this; - - self.filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value, params: params }]; - } - - self.addFilter(field); - }; - - //add filter to array - Filter.prototype.addFilter = function (field, type, value, params) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value, params: params }]; - } - - field.forEach(function (filter) { - - filter = self.findFilter(filter); - - if (filter) { - self.filterList.push(filter); - - self.changed = true; - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - Filter.prototype.findFilter = function (filter) { - var self = this, - column; - - if (Array.isArray(filter)) { - return this.findSubFilters(filter); - } - - var filterFunc = false; - - if (typeof filter.field == "function") { - filterFunc = function filterFunc(data) { - return filter.field(data, filter.type || {}); // pass params to custom filter function - }; - } else { - - if (self.filters[filter.type]) { - - column = self.table.columnManager.getColumnByField(filter.field); - - if (column) { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {}); - }; - } else { - filterFunc = function filterFunc(data) { - return self.filters[filter.type](filter.value, data[filter.field], data, filter.params || {}); - }; - } - } else { - console.warn("Filter Error - No such filter type found, ignoring: ", filter.type); - } - } - - filter.func = filterFunc; - - return filter.func ? filter : false; - }; - - Filter.prototype.findSubFilters = function (filters) { - var self = this, - output = []; - - filters.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - output.push(filter); - } - }); - - return output.length ? output : false; - }; - - //get all filters - Filter.prototype.getFilters = function (all, ajax) { - var output = []; - - if (all) { - output = this.getHeaderFilters(); - } - - if (ajax) { - output.forEach(function (item) { - if (typeof item.type == "function") { - item.type = "function"; - } - }); - } - - output = output.concat(this.filtersToArray(this.filterList, ajax)); - - return output; - }; - - //filter to Object - Filter.prototype.filtersToArray = function (filterList, ajax) { - var _this53 = this; - - var output = []; - - filterList.forEach(function (filter) { - var item; - - if (Array.isArray(filter)) { - output.push(_this53.filtersToArray(filter, ajax)); - } else { - item = { field: filter.field, type: filter.type, value: filter.value }; - - if (ajax) { - if (typeof item.type == "function") { - item.type = "function"; - } - } - - output.push(item); - } - }); - - return output; - }; - - //get all filters - Filter.prototype.getHeaderFilters = function () { - var self = this, - output = []; - - for (var key in this.headerFilters) { - output.push({ field: key, type: this.headerFilters[key].type, value: this.headerFilters[key].value }); - } - - return output; - }; - - //remove filter from array - Filter.prototype.removeFilter = function (field, type, value) { - var self = this; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - var index = -1; - - if (_typeof(filter.field) == "object") { - index = self.filterList.findIndex(function (element) { - return filter === element; - }); - } else { - index = self.filterList.findIndex(function (element) { - return filter.field === element.field && filter.type === element.type && filter.value === element.value; - }); - } - - if (index > -1) { - self.filterList.splice(index, 1); - self.changed = true; - } else { - console.warn("Filter Error - No matching filter type found, ignoring: ", filter.type); - } - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - //clear filters - Filter.prototype.clearFilter = function (all) { - this.filterList = []; - - if (all) { - this.clearHeaderFilter(); - } - - this.changed = true; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) { - this.table.modules.persistence.save("filter"); - } - }; - - //clear header filters - Filter.prototype.clearHeaderFilter = function () { - var self = this; - - this.headerFilters = {}; - self.prevHeaderFilterChangeCheck = "{}"; - - this.headerFilterColumns.forEach(function (column) { - column.modules.filter.value = null; - column.modules.filter.prevSuccess = undefined; - self.reloadHeaderFilter(column); - }); - - this.changed = true; - }; - - //search data and return matching rows - Filter.prototype.search = function (searchType, field, type, value) { - var self = this, - activeRows = [], - filterList = []; - - if (!Array.isArray(field)) { - field = [{ field: field, type: type, value: value }]; - } - - field.forEach(function (filter) { - filter = self.findFilter(filter); - - if (filter) { - filterList.push(filter); - } - }); - - this.table.rowManager.rows.forEach(function (row) { - var match = true; - - filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, row.getData())) { - match = false; - } - }); - - if (match) { - activeRows.push(searchType === "data" ? row.getData("data") : row.getComponent()); - } - }); - - return activeRows; - }; - - //filter row array - Filter.prototype.filter = function (rowList, filters) { - var self = this, - activeRows = [], - activeRowComponents = []; - - if (self.table.options.dataFiltering) { - self.table.options.dataFiltering.call(self.table, self.getFilters()); - } - - if (!self.table.options.ajaxFiltering && (self.filterList.length || Object.keys(self.headerFilters).length)) { - - rowList.forEach(function (row) { - if (self.filterRow(row)) { - activeRows.push(row); - } - }); - } else { - activeRows = rowList.slice(0); - } - - if (self.table.options.dataFiltered) { - - activeRows.forEach(function (row) { - activeRowComponents.push(row.getComponent()); - }); - - self.table.options.dataFiltered.call(self.table, self.getFilters(), activeRowComponents); - } - - return activeRows; - }; - - //filter individual row - Filter.prototype.filterRow = function (row, filters) { - var self = this, - match = true, - data = row.getData(); - - self.filterList.forEach(function (filter) { - if (!self.filterRecurse(filter, data)) { - match = false; - } - }); - - for (var field in self.headerFilters) { - if (!self.headerFilters[field].func(data)) { - match = false; - } - } - - return match; - }; - - Filter.prototype.filterRecurse = function (filter, data) { - var self = this, - match = false; - - if (Array.isArray(filter)) { - filter.forEach(function (subFilter) { - if (self.filterRecurse(subFilter, data)) { - match = true; - } - }); - } else { - match = filter.func(data); - } - - return match; - }; - - //list of available filters - Filter.prototype.filters = { - - //equal to - "=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal == filterVal ? true : false; - }, - - //less than - "<": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal < filterVal ? true : false; - }, - - //less than or equal to - "<=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal <= filterVal ? true : false; - }, - - //greater than - ">": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal > filterVal ? true : false; - }, - - //greater than or equal to - ">=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal >= filterVal ? true : false; - }, - - //not equal to - "!=": function _(filterVal, rowVal, rowData, filterParams) { - return rowVal != filterVal ? true : false; - }, - - "regex": function regex(filterVal, rowVal, rowData, filterParams) { - - if (typeof filterVal == "string") { - filterVal = new RegExp(filterVal); - } - - return filterVal.test(rowVal); - }, - - //contains the string - "like": function like(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1; - } else { - return false; - } - } - }, - - //contains the keywords - "keywords": function keywords(filterVal, rowVal, rowData, filterParams) { - var keywords = filterVal.toLowerCase().split(typeof filterParams.separator === "undefined" ? " " : filterParams.separator), - value = String(rowVal === null || typeof rowVal === "undefined" ? "" : rowVal).toLowerCase(), - matches = []; - - keywords.forEach(function (keyword) { - if (value.includes(keyword)) { - matches.push(true); - } - }); - - return filterParams.matchAll ? matches.length === keywords.length : !!matches.length; - }, - - //starts with the string - "starts": function starts(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase()); - } else { - return false; - } - } - }, - - //ends with the string - "ends": function ends(filterVal, rowVal, rowData, filterParams) { - if (filterVal === null || typeof filterVal === "undefined") { - return rowVal === filterVal ? true : false; - } else { - if (typeof rowVal !== 'undefined' && rowVal !== null) { - return String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase()); - } else { - return false; - } - } - }, - - //in array - "in": function _in(filterVal, rowVal, rowData, filterParams) { - if (Array.isArray(filterVal)) { - return filterVal.indexOf(rowVal) > -1; - } else { - console.warn("Filter Error - filter value is not an array:", filterVal); - return false; - } - } - }; - - Tabulator.prototype.registerModule("filter", Filter); - - var Format = function Format(table) { - this.table = table; //hold Tabulator object - }; - - //initialize column formatter - Format.prototype.initializeColumn = function (column) { - column.modules.format = this.lookupFormatter(column, ""); - - if (typeof column.definition.formatterPrint !== "undefined") { - column.modules.format.print = this.lookupFormatter(column, "Print"); - } - - if (typeof column.definition.formatterClipboard !== "undefined") { - column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard"); - } - - if (typeof column.definition.formatterHtmlOutput !== "undefined") { - column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput"); - } - }; - - Format.prototype.lookupFormatter = function (column, type) { - var config = { params: column.definition["formatter" + type + "Params"] || {} }, - formatter = column.definition["formatter" + type]; - - //set column formatter - switch (typeof formatter === 'undefined' ? 'undefined' : _typeof(formatter)) { - case "string": - - if (formatter === "tick") { - formatter = "tickCross"; - - if (typeof config.params.crossElement == "undefined") { - config.params.crossElement = false; - } - - console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false"); - } - - if (this.formatters[formatter]) { - config.formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - config.formatter = this.formatters.plaintext; - } - break; - - case "function": - config.formatter = formatter; - break; - - default: - config.formatter = this.formatters.plaintext; - break; - } - - return config; - }; - - Format.prototype.cellRendered = function (cell) { - if (cell.modules.format && cell.modules.format.renderedCallback) { - cell.modules.format.renderedCallback(); - } - }; - - //return a formatted value for a cell - Format.prototype.formatValue = function (cell) { - var component = cell.getComponent(), - params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params; - - function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - } - - return cell.column.modules.format.formatter.call(this, component, params, onRendered); - }; - - Format.prototype.formatExportValue = function (cell, type) { - var formatter = cell.column.modules.format[type], - params; - - if (formatter) { - var onRendered = function onRendered(callback) { - if (!cell.modules.format) { - cell.modules.format = {}; - } - - cell.modules.format.renderedCallback = callback; - }; - - params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params; - - return formatter.formatter.call(this, cell.getComponent(), params, onRendered); - } else { - return this.formatValue(cell); - } - }; - - Format.prototype.sanitizeHTML = function (value) { - if (value) { - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - return String(value).replace(/[&<>"'`=\/]/g, function (s) { - return entityMap[s]; - }); - } else { - return value; - } - }; - - Format.prototype.emptyToSpace = function (value) { - return value === null || typeof value === "undefined" || value === "" ? " " : value; - }; - - //get formatter for cell - Format.prototype.getFormatter = function (formatter) { - var formatter; - - switch (typeof formatter === 'undefined' ? 'undefined' : _typeof(formatter)) { - case "string": - if (this.formatters[formatter]) { - formatter = this.formatters[formatter]; - } else { - console.warn("Formatter Error - No such formatter found: ", formatter); - formatter = this.formatters.plaintext; - } - break; - - case "function": - formatter = formatter; - break; - - default: - formatter = this.formatters.plaintext; - break; - } - - return formatter; - }; - - //default data formatters - Format.prototype.formatters = { - //plain text value - plaintext: function plaintext(cell, formatterParams, onRendered) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //html text value - html: function html(cell, formatterParams, onRendered) { - return cell.getValue(); - }, - - //multiline text area - textarea: function textarea(cell, formatterParams, onRendered) { - cell.getElement().style.whiteSpace = "pre-wrap"; - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - }, - - //currency formatting - money: function money(cell, formatterParams, onRendered) { - var floatVal = parseFloat(cell.getValue()), - number, - integer, - decimal, - rgx; - - var decimalSym = formatterParams.decimal || "."; - var thousandSym = formatterParams.thousand || ","; - var symbol = formatterParams.symbol || ""; - var after = !!formatterParams.symbolAfter; - var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2; - - if (isNaN(floatVal)) { - return this.emptyToSpace(this.sanitizeHTML(cell.getValue())); - } - - number = precision !== false ? floatVal.toFixed(precision) : floatVal; - number = String(number).split("."); - - integer = number[0]; - decimal = number.length > 1 ? decimalSym + number[1] : ""; - - rgx = /(\d+)(\d{3})/; - - while (rgx.test(integer)) { - integer = integer.replace(rgx, "$1" + thousandSym + "$2"); - } - - return after ? integer + decimal + symbol : symbol + integer + decimal; - }, - - //clickable anchor tag - link: function link(cell, formatterParams, onRendered) { - var value = cell.getValue(), - urlPrefix = formatterParams.urlPrefix || "", - download = formatterParams.download, - label = value, - el = document.createElement("a"), - data; - - if (formatterParams.labelField) { - data = cell.getData(); - label = data[formatterParams.labelField]; - } - - if (formatterParams.label) { - switch (_typeof(formatterParams.label)) { - case "string": - label = formatterParams.label; - break; - - case "function": - label = formatterParams.label(cell); - break; - } - } - - if (label) { - if (formatterParams.urlField) { - data = cell.getData(); - value = data[formatterParams.urlField]; - } - - if (formatterParams.url) { - switch (_typeof(formatterParams.url)) { - case "string": - value = formatterParams.url; - break; - - case "function": - value = formatterParams.url(cell); - break; - } - } - - el.setAttribute("href", urlPrefix + value); - - if (formatterParams.target) { - el.setAttribute("target", formatterParams.target); - } - - if (formatterParams.download) { - - if (typeof download == "function") { - download = download(cell); - } else { - download = download === true ? "" : download; - } - - el.setAttribute("download", download); - } - - el.innerHTML = this.emptyToSpace(this.sanitizeHTML(label)); - - return el; - } else { - return " "; - } - }, - - //image element - image: function image(cell, formatterParams, onRendered) { - var el = document.createElement("img"); - el.setAttribute("src", cell.getValue()); - - switch (_typeof(formatterParams.height)) { - case "number": - el.style.height = formatterParams.height + "px"; - break; - - case "string": - el.style.height = formatterParams.height; - break; - } - - switch (_typeof(formatterParams.width)) { - case "number": - el.style.width = formatterParams.width + "px"; - break; - - case "string": - el.style.width = formatterParams.width; - break; - } - - el.addEventListener("load", function () { - cell.getRow().normalizeHeight(); - }); - - return el; - }, - - //tick or cross - tickCross: function tickCross(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - empty = formatterParams.allowEmpty, - truthy = formatterParams.allowTruthy, - tick = typeof formatterParams.tickElement !== "undefined" ? formatterParams.tickElement : '', - cross = typeof formatterParams.crossElement !== "undefined" ? formatterParams.crossElement : ''; - - if (truthy && value || value === true || value === "true" || value === "True" || value === 1 || value === "1") { - element.setAttribute("aria-checked", true); - return tick || ""; - } else { - if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) { - element.setAttribute("aria-checked", "mixed"); - return ""; - } else { - element.setAttribute("aria-checked", false); - return cross || ""; - } - } - }, - - datetime: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var outputFormat = formatterParams.outputFormat || "DD/MM/YYYY hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - return formatterParams.timezone ? newDatetime.tz(formatterParams.timezone).format(outputFormat) : newDatetime.format(outputFormat); - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - datetimediff: function datetime(cell, formatterParams, onRendered) { - var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss"; - var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : ""; - var suffix = typeof formatterParams.suffix !== "undefined" ? formatterParams.suffix : false; - var unit = typeof formatterParams.unit !== "undefined" ? formatterParams.unit : undefined; - var humanize = typeof formatterParams.humanize !== "undefined" ? formatterParams.humanize : false; - var date = typeof formatterParams.date !== "undefined" ? formatterParams.date : moment(); - var value = cell.getValue(); - - var newDatetime = moment(value, inputFormat); - - if (newDatetime.isValid()) { - if (humanize) { - return moment.duration(newDatetime.diff(date)).humanize(suffix); - } else { - return newDatetime.diff(date, unit) + (suffix ? " " + suffix : ""); - } - } else { - - if (invalid === true) { - return value; - } else if (typeof invalid === "function") { - return invalid(value); - } else { - return invalid; - } - } - }, - - //select - lookup: function lookup(cell, formatterParams, onRendered) { - var value = cell.getValue(); - - if (typeof formatterParams[value] === "undefined") { - console.warn('Missing display value for ' + value); - return value; - } - - return formatterParams[value]; - }, - - //star rating - star: function star(cell, formatterParams, onRendered) { - var value = cell.getValue(), - element = cell.getElement(), - maxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5, - stars = document.createElement("span"), - star = document.createElementNS('http://www.w3.org/2000/svg', "svg"), - starActive = '', - starInactive = ''; - - //style stars holder - stars.style.verticalAlign = "middle"; - - //style star - star.setAttribute("width", "14"); - star.setAttribute("height", "14"); - star.setAttribute("viewBox", "0 0 512 512"); - star.setAttribute("xml:space", "preserve"); - star.style.padding = "0 1px"; - - value = value && !isNaN(value) ? parseInt(value) : 0; - - value = Math.max(0, Math.min(value, maxStars)); - - for (var i = 1; i <= maxStars; i++) { - var nextStar = star.cloneNode(true); - nextStar.innerHTML = i <= value ? starActive : starInactive; - - stars.appendChild(nextStar); - } - - element.style.whiteSpace = "nowrap"; - element.style.overflow = "hidden"; - element.style.textOverflow = "ellipsis"; - - element.setAttribute("aria-label", value); - - return stars; - }, - - traffic: function traffic(cell, formatterParams, onRendered) { - var value = this.sanitizeHTML(cell.getValue()) || 0, - el = document.createElement("span"), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - colors = formatterParams && typeof formatterParams.color !== "undefined" ? formatterParams.color : ["red", "orange", "green"], - color = "#666666", - percent, - percentValue; - - if (isNaN(value) || typeof cell.getValue() === "undefined") { - return; - } - - el.classList.add("tabulator-traffic-light"); - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set color - switch (typeof colors === 'undefined' ? 'undefined' : _typeof(colors)) { - case "string": - color = colors; - break; - case "function": - color = colors(value); - break; - case "object": - if (Array.isArray(colors)) { - var unit = 100 / colors.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, colors.length - 1); - index = Math.max(index, 0); - color = colors[index]; - break; - } - } - - el.style.backgroundColor = color; - - return el; - }, - - //progress bar - progress: function progress(cell, formatterParams, onRendered) { - //progress bar - var value = this.sanitizeHTML(cell.getValue()) || 0, - element = cell.getElement(), - max = formatterParams && formatterParams.max ? formatterParams.max : 100, - min = formatterParams && formatterParams.min ? formatterParams.min : 0, - legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center", - percent, - percentValue, - color, - legend, - legendColor, - top, - left, - right, - bottom; - - //make sure value is in range - percentValue = parseFloat(value) <= max ? parseFloat(value) : max; - percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; - - //workout percentage - percent = (max - min) / 100; - percentValue = Math.round((percentValue - min) / percent); - - //set bar color - switch (_typeof(formatterParams.color)) { - case "string": - color = formatterParams.color; - break; - case "function": - color = formatterParams.color(value); - break; - case "object": - if (Array.isArray(formatterParams.color)) { - var unit = 100 / formatterParams.color.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.color.length - 1); - index = Math.max(index, 0); - color = formatterParams.color[index]; - break; - } - default: - color = "#2DC214"; - } - - //generate legend - switch (_typeof(formatterParams.legend)) { - case "string": - legend = formatterParams.legend; - break; - case "function": - legend = formatterParams.legend(value); - break; - case "boolean": - legend = value; - break; - default: - legend = false; - } - - //set legend color - switch (_typeof(formatterParams.legendColor)) { - case "string": - legendColor = formatterParams.legendColor; - break; - case "function": - legendColor = formatterParams.legendColor(value); - break; - case "object": - if (Array.isArray(formatterParams.legendColor)) { - var unit = 100 / formatterParams.legendColor.length; - var index = Math.floor(percentValue / unit); - - index = Math.min(index, formatterParams.legendColor.length - 1); - index = Math.max(index, 0); - legendColor = formatterParams.legendColor[index]; - } - break; - default: - legendColor = "#000"; - } - - element.style.minWidth = "30px"; - element.style.position = "relative"; - - element.setAttribute("aria-label", percentValue); - - var barEl = document.createElement("div"); - barEl.style.display = "inline-block"; - barEl.style.position = "relative"; - barEl.style.width = percentValue + "%"; - barEl.style.backgroundColor = color; - barEl.style.height = "100%"; - - barEl.setAttribute('data-max', max); - barEl.setAttribute('data-min', min); - - if (legend) { - var legendEl = document.createElement("div"); - legendEl.style.position = "absolute"; - legendEl.style.top = "4px"; - legendEl.style.left = 0; - legendEl.style.textAlign = legendAlign; - legendEl.style.width = "100%"; - legendEl.style.color = legendColor; - legendEl.innerHTML = legend; - } - - onRendered(function () { - - //handle custom element needed if formatter is to be included in printed/downloaded output - if (!(cell instanceof CellComponent)) { - var holderEl = document.createElement("div"); - holderEl.style.position = "absolute"; - holderEl.style.top = "4px"; - holderEl.style.bottom = "4px"; - holderEl.style.left = "4px"; - holderEl.style.right = "4px"; - - element.appendChild(holderEl); - - element = holderEl; - } - - element.appendChild(barEl); - - if (legend) { - element.appendChild(legendEl); - } - }); - - return ""; - }, - - //background color - color: function color(cell, formatterParams, onRendered) { - cell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue()); - return ""; - }, - - //tick icon - buttonTick: function buttonTick(cell, formatterParams, onRendered) { - return ''; - }, - - //cross icon - buttonCross: function buttonCross(cell, formatterParams, onRendered) { - return ''; - }, - - //current row number - rownum: function rownum(cell, formatterParams, onRendered) { - return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1; - }, - - //row handle - handle: function handle(cell, formatterParams, onRendered) { - cell.getElement().classList.add("tabulator-row-handle"); - return "
"; - }, - - responsiveCollapse: function responsiveCollapse(cell, formatterParams, onRendered) { - var self = this, - open = false, - el = document.createElement("div"), - config = cell.getRow()._row.modules.responsiveLayout; - - el.classList.add("tabulator-responsive-collapse-toggle"); - el.innerHTML = "+-"; - - cell.getElement().classList.add("tabulator-row-handle"); - - function toggleList(isOpen) { - var collapseEl = config.element; - - config.open = isOpen; - - if (collapseEl) { - - if (config.open) { - el.classList.add("open"); - collapseEl.style.display = ''; - } else { - el.classList.remove("open"); - collapseEl.style.display = 'none'; - } - } - } - - el.addEventListener("click", function (e) { - e.stopImmediatePropagation(); - toggleList(!config.open); - }); - - toggleList(config.open); - - return el; - }, - - rowSelection: function rowSelection(cell) { - var _this54 = this; - - var checkbox = document.createElement("input"); - - checkbox.type = 'checkbox'; - - if (this.table.modExists("selectRow", true)) { - - checkbox.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - if (typeof cell.getRow == 'function') { - var row = cell.getRow(); - - checkbox.addEventListener("change", function (e) { - row.toggleSelect(); - }); - - checkbox.checked = row.isSelected(); - this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox); - } else { - checkbox.addEventListener("change", function (e) { - if (_this54.table.modules.selectRow.selectedRows.length) { - _this54.table.deselectRow(); - } else { - _this54.table.selectRow(); - } - }); - - this.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox); - } - } - return checkbox; - } - }; - - Tabulator.prototype.registerModule("format", Format); - - var FrozenColumns = function FrozenColumns(table) { - this.table = table; //hold Tabulator object - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightPadding = 0; - this.initializationMode = "left"; - this.active = false; - this.scrollEndTimer = false; - }; - - //reset initial state - FrozenColumns.prototype.reset = function () { - this.initializationMode = "left"; - this.leftColumns = []; - this.rightColumns = []; - this.leftMargin = 0; - this.rightMargin = 0; - this.rightMargin = 0; - this.active = false; - - this.table.columnManager.headersElement.style.marginLeft = 0; - this.table.columnManager.element.style.paddingRight = 0; - }; - - //initialize specific column - FrozenColumns.prototype.initializeColumn = function (column) { - var config = { margin: 0, edge: false }; - - if (!column.isGroup) { - - if (this.frozenCheck(column)) { - - config.position = this.initializationMode; - - if (this.initializationMode == "left") { - this.leftColumns.push(column); - } else { - this.rightColumns.unshift(column); - } - - this.active = true; - - column.modules.frozen = config; - } else { - this.initializationMode = "right"; - } - } - }; - - FrozenColumns.prototype.frozenCheck = function (column) { - var frozen = false; - - if (column.parent.isGroup && column.definition.frozen) { - console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"); - } - - if (column.parent.isGroup) { - return this.frozenCheck(column.parent); - } else { - return column.definition.frozen; - } - - return frozen; - }; - - //quick layout to smooth horizontal scrolling - FrozenColumns.prototype.scrollHorizontal = function () { - var _this55 = this; - - var rows; - - if (this.active) { - clearTimeout(this.scrollEndTimer); - - //layout all rows after scroll is complete - this.scrollEndTimer = setTimeout(function () { - _this55.layout(); - }, 100); - - rows = this.table.rowManager.getVisibleRows(); - - this.calcMargins(); - - this.layoutColumnPosition(); - - this.layoutCalcRows(); - - rows.forEach(function (row) { - if (row.type === "row") { - _this55.layoutRow(row); - } - }); - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } - }; - - //calculate margins for rows - FrozenColumns.prototype.calcMargins = function () { - this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px"; - this.table.columnManager.headersElement.style.marginLeft = this.leftMargin; - - this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px"; - this.table.columnManager.element.style.paddingRight = this.rightMargin; - - //calculate right frozen columns - this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft; - }; - - //layout calculation rows - FrozenColumns.prototype.layoutCalcRows = function () { - if (this.table.modExists("columnCalcs")) { - if (this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow) { - this.layoutRow(this.table.modules.columnCalcs.topRow); - } - if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) { - this.layoutRow(this.table.modules.columnCalcs.botRow); - } - } - }; - - //calculate column positions and layout headers - FrozenColumns.prototype.layoutColumnPosition = function (allCells) { - var _this56 = this; - - var leftParents = []; - - this.leftColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this56._calcSpace(_this56.leftColumns, i) + _this56.table.columnManager.scrollLeft + "px"; - - if (i == _this56.leftColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - var parentEl = _this56.getColGroupParentElement(column); - if (!leftParents.includes(parentEl)) { - _this56.layoutElement(parentEl, column); - leftParents.push(parentEl); - } - - if (column.modules.frozen.edge) { - parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } else { - _this56.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this56.layoutElement(cell.getElement(), column); - }); - } - }); - - this.rightColumns.forEach(function (column, i) { - column.modules.frozen.margin = _this56.rightPadding - _this56._calcSpace(_this56.rightColumns, i + 1) + "px"; - - if (i == _this56.rightColumns.length - 1) { - column.modules.frozen.edge = true; - } else { - column.modules.frozen.edge = false; - } - - if (column.parent.isGroup) { - _this56.layoutElement(_this56.getColGroupParentElement(column), column); - } else { - _this56.layoutElement(column.getElement(), column); - } - - if (allCells) { - column.cells.forEach(function (cell) { - _this56.layoutElement(cell.getElement(), column); - }); - } - }); - }; - - FrozenColumns.prototype.getColGroupParentElement = function (column) { - return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement(); - }; - - //layout columns appropropriatly - FrozenColumns.prototype.layout = function () { - var self = this, - rightMargin = 0; - - if (self.active) { - - //calculate row padding - this.calcMargins(); - - // self.table.rowManager.activeRows.forEach(function(row){ - // self.layoutRow(row); - // }); - - // if(self.table.options.dataTree){ - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row") { - self.layoutRow(row); - } - }); - // } - - this.layoutCalcRows(); - - //calculate left columns - this.layoutColumnPosition(true); - - // if(tableHolder.scrollHeight > tableHolder.clientHeight){ - // rightMargin -= tableHolder.offsetWidth - tableHolder.clientWidth; - // } - - this.table.rowManager.tableElement.style.marginRight = this.rightMargin; - } - }; - - FrozenColumns.prototype.layoutRow = function (row) { - var _this57 = this; - - var rowEl = row.getElement(); - - rowEl.style.paddingLeft = this.leftMargin; - // rowEl.style.paddingRight = this.rightMargin + "px"; - - this.leftColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this57.layoutElement(cell.getElement(), column); - } - }); - - this.rightColumns.forEach(function (column) { - var cell = row.getCell(column); - - if (cell) { - _this57.layoutElement(cell.getElement(), column); - } - }); - }; - - FrozenColumns.prototype.layoutElement = function (element, column) { - - if (column.modules.frozen) { - element.style.position = "absolute"; - element.style.left = column.modules.frozen.margin; - - element.classList.add("tabulator-frozen"); - - if (column.modules.frozen.edge) { - element.classList.add("tabulator-frozen-" + column.modules.frozen.position); - } - } - }; - - FrozenColumns.prototype._calcSpace = function (columns, index) { - var width = 0; - - for (var _i8 = 0; _i8 < index; _i8++) { - if (columns[_i8].visible) { - width += columns[_i8].getWidth(); - } - } - - return width; - }; - - Tabulator.prototype.registerModule("frozenColumns", FrozenColumns); - var FrozenRows = function FrozenRows(table) { - this.table = table; //hold Tabulator object - this.topElement = document.createElement("div"); - this.rows = []; - this.displayIndex = 0; //index in display pipeline - }; - - FrozenRows.prototype.initialize = function () { - this.rows = []; - - this.topElement.classList.add("tabulator-frozen-rows-holder"); - - // this.table.columnManager.element.append(this.topElement); - this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling); - }; - - FrozenRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - FrozenRows.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - FrozenRows.prototype.isFrozen = function () { - return !!this.rows.length; - }; - - //filter frozen rows out of display data - FrozenRows.prototype.getRows = function (rows) { - var self = this, - frozen = [], - output = rows.slice(0); - - this.rows.forEach(function (row) { - var index = output.indexOf(row); - - if (index > -1) { - output.splice(index, 1); - } - }); - - return output; - }; - - FrozenRows.prototype.freezeRow = function (row) { - if (!row.modules.frozen) { - row.modules.frozen = true; - this.topElement.appendChild(row.getElement()); - row.initialize(); - row.normalizeHeight(); - this.table.rowManager.adjustTableSize(); - - this.rows.push(row); - - this.table.rowManager.refreshActiveData("display"); - - this.styleRows(); - } else { - console.warn("Freeze Error - Row is already frozen"); - } - }; - - FrozenRows.prototype.unfreezeRow = function (row) { - var index = this.rows.indexOf(row); - - if (row.modules.frozen) { - - row.modules.frozen = false; - - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.table.rowManager.adjustTableSize(); - - this.rows.splice(index, 1); - - this.table.rowManager.refreshActiveData("display"); - - if (this.rows.length) { - this.styleRows(); - } - } else { - console.warn("Freeze Error - Row is already unfrozen"); - } - }; - - FrozenRows.prototype.styleRows = function (row) { - var self = this; - - this.rows.forEach(function (row, i) { - self.table.rowManager.styleRow(row, i); - }); - }; - - Tabulator.prototype.registerModule("frozenRows", FrozenRows); - - //public group object - var GroupComponent = function GroupComponent(group) { - this._group = group; - this.type = "GroupComponent"; - }; - - GroupComponent.prototype.getKey = function () { - return this._group.key; - }; - - GroupComponent.prototype.getField = function () { - return this._group.field; - }; - - GroupComponent.prototype.getElement = function () { - return this._group.element; - }; - - GroupComponent.prototype.getRows = function () { - return this._group.getRows(true); - }; - - GroupComponent.prototype.getSubGroups = function () { - return this._group.getSubGroups(true); - }; - - GroupComponent.prototype.getParentGroup = function () { - return this._group.parent ? this._group.parent.getComponent() : false; - }; - - GroupComponent.prototype.getVisibility = function () { - console.warn("getVisibility function is deprecated, you should now use the isVisible function"); - return this._group.visible; - }; - - GroupComponent.prototype.isVisible = function () { - return this._group.visible; - }; - - GroupComponent.prototype.show = function () { - this._group.show(); - }; - - GroupComponent.prototype.hide = function () { - this._group.hide(); - }; - - GroupComponent.prototype.toggle = function () { - this._group.toggleVisibility(); - }; - - GroupComponent.prototype._getSelf = function () { - return this._group; - }; - - GroupComponent.prototype.getTable = function () { - return this._group.groupManager.table; - }; - - ////////////////////////////////////////////////// - //////////////// Group Functions ///////////////// - ////////////////////////////////////////////////// - - var Group = function Group(groupManager, parent, level, key, field, generator, oldGroup) { - - this.groupManager = groupManager; - this.parent = parent; - this.key = key; - this.level = level; - this.field = field; - this.hasSubGroups = level < groupManager.groupIDLookups.length - 1; - this.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow; - this.type = "group"; //type of element - this.old = oldGroup; - this.rows = []; - this.groups = []; - this.groupList = []; - this.generator = generator; - this.elementContents = false; - this.height = 0; - this.outerHeight = 0; - this.initialized = false; - this.calcs = {}; - this.initialized = false; - this.modules = {}; - this.arrowElement = false; - - this.visible = oldGroup ? oldGroup.visible : typeof groupManager.startOpen[level] !== "undefined" ? groupManager.startOpen[level] : groupManager.startOpen[0]; - - this.component = null; - - this.createElements(); - this.addBindings(); - - this.createValueGroups(); - }; - - Group.prototype.wipe = function () { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - group.wipe(); - }); - } else { - this.element = false; - this.arrowElement = false; - this.elementContents = false; - } - }; - - Group.prototype.createElements = function () { - var arrow = document.createElement("div"); - arrow.classList.add("tabulator-arrow"); - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-row"); - this.element.classList.add("tabulator-group"); - this.element.classList.add("tabulator-group-level-" + this.level); - this.element.setAttribute("role", "rowgroup"); - - this.arrowElement = document.createElement("div"); - this.arrowElement.classList.add("tabulator-group-toggle"); - this.arrowElement.appendChild(arrow); - - //setup movable rows - if (this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists("moveRow")) { - this.groupManager.table.modules.moveRow.initializeGroupHeader(this); - } - }; - - Group.prototype.createValueGroups = function () { - var _this58 = this; - - var level = this.level + 1; - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - this.groupManager.allowedValues[level].forEach(function (value) { - _this58._createGroup(value, level); - }); - } - }; - - Group.prototype.addBindings = function () { - var self = this, - dblTap, - tapHold, - tap, - toggleElement; - - //handle group click events - if (self.groupManager.table.options.groupClick) { - self.element.addEventListener("click", function (e) { - self.groupManager.table.options.groupClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.groupManager.table.options.groupDblClick.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContext) { - self.element.addEventListener("contextmenu", function (e) { - self.groupManager.table.options.groupContext.call(self.groupManager.table, e, self.getComponent()); - }); - } - - if (self.groupManager.table.options.groupContextMenu && self.groupManager.table.modExists("menu")) { - self.groupManager.table.modules.menu.initializeGroup.call(self.groupManager.table.modules.menu, self); - } - - if (self.groupManager.table.options.groupTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.groupManager.table.options.groupTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.groupManager.table.options.groupDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.groupManager.table.options.groupDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.groupManager.table.options.groupTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.groupManager.table.options.groupTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - if (self.groupManager.table.options.groupToggleElement) { - toggleElement = self.groupManager.table.options.groupToggleElement == "arrow" ? self.arrowElement : self.element; - - toggleElement.addEventListener("click", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - self.toggleVisibility(); - }); - } - }; - - Group.prototype._createGroup = function (groupID, level) { - var groupKey = level + "_" + groupID; - var group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false); - - this.groups[groupKey] = group; - this.groupList.push(group); - }; - - Group.prototype._addRowToGroup = function (row) { - - var level = this.level + 1; - - if (this.hasSubGroups) { - var groupID = this.groupManager.groupIDLookups[level].func(row.getData()), - groupKey = level + "_" + groupID; - - if (this.groupManager.allowedValues && this.groupManager.allowedValues[level]) { - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - } else { - if (!this.groups[groupKey]) { - this._createGroup(groupID, level); - } - - this.groups[groupKey].addRow(row); - } - } - }; - - Group.prototype._addRow = function (row) { - this.rows.push(row); - row.modules.group = this; - }; - - Group.prototype.insertRow = function (row, to, after) { - var data = this.conformRowData({}); - - row.updateData(data); - - var toIndex = this.rows.indexOf(to); - - if (toIndex > -1) { - if (after) { - this.rows.splice(toIndex + 1, 0, row); - } else { - this.rows.splice(toIndex, 0, row); - } - } else { - if (after) { - this.rows.push(row); - } else { - this.rows.unshift(row); - } - } - - row.modules.group = this; - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - - this.groupManager.updateGroupRows(true); - }; - - Group.prototype.scrollHeader = function (left) { - this.arrowElement.style.marginLeft = left; - - this.groupList.forEach(function (child) { - child.scrollHeader(left); - }); - }; - - Group.prototype.getRowIndex = function (row) {}; - - //update row data to match grouping contraints - Group.prototype.conformRowData = function (data) { - if (this.field) { - data[this.field] = this.key; - } else { - console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"); - } - - if (this.parent) { - data = this.parent.conformRowData(data); - } - - return data; - }; - - Group.prototype.removeRow = function (row) { - var index = this.rows.indexOf(row); - var el = row.getElement(); - - if (index > -1) { - this.rows.splice(index, 1); - } - - if (!this.groupManager.table.options.groupValues && !this.rows.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - - this.groupManager.updateGroupRows(true); - } else { - - if (el.parentNode) { - el.parentNode.removeChild(el); - } - - this.generateGroupHeaderContents(); - - if (this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table") { - this.groupManager.table.modules.columnCalcs.recalcGroup(this); - } - } - }; - - Group.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - - if (!this.groupList.length) { - if (this.parent) { - this.parent.removeGroup(this); - } else { - this.groupManager.removeGroup(this); - } - } - } - }; - - Group.prototype.getHeadersAndRows = function (noCalc) { - var output = []; - - output.push(this); - - this._visSet(); - - if (this.visible) { - if (this.groupList.length) { - this.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows(noCalc)); - }); - } else { - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - - output = output.concat(this.rows); - - if (!noCalc && this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } else { - if (!this.groupList.length && this.groupManager.table.options.columnCalcs != "table") { - - if (this.groupManager.table.modExists("columnCalcs")) { - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()) { - if (this.calcs.top) { - this.calcs.top.detachElement(); - this.calcs.top.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows); - output.push(this.calcs.top); - } - } - - if (!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()) { - if (this.calcs.bottom) { - this.calcs.bottom.detachElement(); - this.calcs.bottom.deleteCells(); - } - - if (this.groupManager.table.options.groupClosedShowCalcs) { - this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows); - output.push(this.calcs.bottom); - } - } - } - } - } - - return output; - }; - - Group.prototype.getData = function (visible, transform) { - var self = this, - output = []; - - this._visSet(); - - if (!visible || visible && this.visible) { - this.rows.forEach(function (row) { - output.push(row.getData(transform || "data")); - }); - } - - return output; - }; - - // Group.prototype.getRows = function(){ - // this._visSet(); - - // return this.visible ? this.rows : []; - // }; - - Group.prototype.getRowCount = function () { - var count = 0; - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - count += group.getRowCount(); - }); - } else { - count = this.rows.length; - } - return count; - }; - - Group.prototype.toggleVisibility = function () { - if (this.visible) { - this.hide(); - } else { - this.show(); - } - }; - - Group.prototype.hide = function () { - this.visible = false; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.remove("tabulator-group-visible"); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - row.detachElement(); - }); - }); - } else { - this.rows.forEach(function (row) { - var rowEl = row.getElement(); - rowEl.parentNode.removeChild(rowEl); - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), false); - }; - - Group.prototype.show = function () { - var self = this; - - self.visible = true; - - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { - - this.element.classList.add("tabulator-group-visible"); - - var prev = self.getElement(); - - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var rows = group.getHeadersAndRows(); - - rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - }); - } else { - self.rows.forEach(function (row) { - var rowEl = row.getElement(); - prev.parentNode.insertBefore(rowEl, prev.nextSibling); - row.initialize(); - prev = rowEl; - }); - } - - this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); - } else { - this.groupManager.updateGroupRows(true); - } - - this.groupManager.table.options.groupVisibilityChanged.call(this.table, this.getComponent(), true); - }; - - Group.prototype._visSet = function () { - var data = []; - - if (typeof this.visible == "function") { - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent()); - } - }; - - Group.prototype.getRowGroup = function (row) { - var match = false; - if (this.groupList.length) { - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - } else { - if (this.rows.find(function (item) { - return item === row; - })) { - match = this; - } - } - - return match; - }; - - Group.prototype.getSubGroups = function (component) { - var output = []; - - this.groupList.forEach(function (child) { - output.push(component ? child.getComponent() : child); - }); - - return output; - }; - - Group.prototype.getRows = function (compoment) { - var output = []; - - this.rows.forEach(function (row) { - output.push(compoment ? row.getComponent() : row); - }); - - return output; - }; - - Group.prototype.generateGroupHeaderContents = function () { - var data = []; - - this.rows.forEach(function (row) { - data.push(row.getData()); - }); - - this.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent()); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }if (typeof this.elementContents === "string") { - this.element.innerHTML = this.elementContents; - } else { - this.element.appendChild(this.elementContents); - } - - this.element.insertBefore(this.arrowElement, this.element.firstChild); - }; - - ////////////// Standard Row Functions ////////////// - - Group.prototype.getElement = function () { - this.addBindingsd = false; - - this._visSet(); - - if (this.visible) { - this.element.classList.add("tabulator-group-visible"); - } else { - this.element.classList.remove("tabulator-group-visible"); - } - - for (var i = 0; i < this.element.childNodes.length; ++i) { - this.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]); - } - - this.generateGroupHeaderContents(); - - // this.addBindings(); - - return this.element; - }; - - Group.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } - }; - - //normalize the height of elements in the row - Group.prototype.normalizeHeight = function () { - this.setHeight(this.element.clientHeight); - }; - - Group.prototype.initialize = function (force) { - if (!this.initialized || force) { - this.normalizeHeight(); - this.initialized = true; - } - }; - - Group.prototype.reinitialize = function () { - this.initialized = false; - this.height = 0; - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - this.initialize(true); - } - }; - - Group.prototype.setHeight = function (height) { - if (this.height != height) { - this.height = height; - this.outerHeight = this.element.offsetHeight; - } - }; - - //return rows outer height - Group.prototype.getHeight = function () { - return this.outerHeight; - }; - - Group.prototype.getGroup = function () { - return this; - }; - - Group.prototype.reinitializeHeight = function () {}; - Group.prototype.calcHeight = function () {}; - Group.prototype.setCellHeight = function () {}; - Group.prototype.clearCellHeight = function () {}; - - //////////////// Object Generation ///////////////// - Group.prototype.getComponent = function () { - if (!this.component) { - this.component = new GroupComponent(this); - } - - return this.component; - }; - - ////////////////////////////////////////////////// - ////////////// Group Row Extension /////////////// - ////////////////////////////////////////////////// - - var GroupRows = function GroupRows(table) { - - this.table = table; //hold Tabulator object - - this.groupIDLookups = false; //enable table grouping and set field to group by - this.startOpen = [function () { - return false; - }]; //starting state of group - this.headerGenerator = [function () { - return ""; - }]; - this.groupList = []; //ordered list of groups - this.allowedValues = false; - this.groups = {}; //hold row groups - this.displayIndex = 0; //index in display pipeline - }; - - //initialize group configuration - GroupRows.prototype.initialize = function () { - var self = this, - groupBy = self.table.options.groupBy, - startOpen = self.table.options.groupStartOpen, - groupHeader = self.table.options.groupHeader; - - this.allowedValues = self.table.options.groupValues; - - if (Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length) { - console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"); - } - - self.headerGenerator = [function () { - return ""; - }]; - this.startOpen = [function () { - return false; - }]; //starting state of group - - self.table.modules.localize.bind("groups|item", function (langValue, lang) { - self.headerGenerator[0] = function (value, count, data) { - //header layout function - return (typeof value === "undefined" ? "" : value) + "(" + count + " " + (count === 1 ? langValue : lang.groups.items) + ")"; - }; - }); - - this.groupIDLookups = []; - - if (Array.isArray(groupBy) || groupBy) { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both") { - this.table.modules.columnCalcs.removeCalcs(); - } - } else { - if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group") { - - var cols = this.table.columnManager.getRealColumns(); - - cols.forEach(function (col) { - if (col.definition.topCalc) { - self.table.modules.columnCalcs.initializeTopRow(); - } - - if (col.definition.bottomCalc) { - self.table.modules.columnCalcs.initializeBottomRow(); - } - }); - } - } - - if (!Array.isArray(groupBy)) { - groupBy = [groupBy]; - } - - groupBy.forEach(function (group, i) { - var lookupFunc, column; - - if (typeof group == "function") { - lookupFunc = group; - } else { - column = self.table.columnManager.getColumnByField(group); - - if (column) { - lookupFunc = function lookupFunc(data) { - return column.getFieldValue(data); - }; - } else { - lookupFunc = function lookupFunc(data) { - return data[group]; - }; - } - } - - self.groupIDLookups.push({ - field: typeof group === "function" ? false : group, - func: lookupFunc, - values: self.allowedValues ? self.allowedValues[i] : false - }); - }); - - if (startOpen) { - - if (!Array.isArray(startOpen)) { - startOpen = [startOpen]; - } - - startOpen.forEach(function (level) { - level = typeof level == "function" ? level : function () { - return true; - }; - }); - - self.startOpen = startOpen; - } - - if (groupHeader) { - self.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader]; - } - - this.initialized = true; - }; - - GroupRows.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - GroupRows.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - //return appropriate rows with group headers - GroupRows.prototype.getRows = function (rows) { - if (this.groupIDLookups.length) { - - this.table.options.dataGrouping.call(this.table); - - this.generateGroups(rows); - - if (this.table.options.dataGrouped) { - this.table.options.dataGrouped.call(this.table, this.getGroups(true)); - } - - return this.updateGroupRows(); - } else { - return rows.slice(0); - } - }; - - GroupRows.prototype.getGroups = function (compoment) { - var groupComponents = []; - - this.groupList.forEach(function (group) { - groupComponents.push(compoment ? group.getComponent() : group); - }); - - return groupComponents; - }; - - GroupRows.prototype.getChildGroups = function (group) { - var _this59 = this; - - var groupComponents = []; - - if (!group) { - group = this; - } - - group.groupList.forEach(function (child) { - if (child.groupList.length) { - groupComponents = groupComponents.concat(_this59.getChildGroups(child)); - } else { - groupComponents.push(child); - } - }); - - return groupComponents; - }; - - GroupRows.prototype.wipe = function () { - this.groupList.forEach(function (group) { - group.wipe(); - }); - }; - - GroupRows.prototype.pullGroupListData = function (groupList) { - var self = this; - var groupListData = []; - - groupList.forEach(function (group) { - var groupHeader = {}; - groupHeader.level = 0; - groupHeader.rowCount = 0; - groupHeader.headerContent = ""; - var childData = []; - - if (group.hasSubGroups) { - childData = self.pullGroupListData(group.groupList); - - groupHeader.level = group.level; - groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers - groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group); - - groupListData.push(groupHeader); - groupListData = groupListData.concat(childData); - } else { - groupHeader.level = group.level; - groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group); - groupHeader.rowCount = group.getRows().length; - - groupListData.push(groupHeader); - - group.getRows().forEach(function (row) { - groupListData.push(row.getData("data")); - }); - } - }); - - return groupListData; - }; - - GroupRows.prototype.getGroupedData = function () { - - return this.pullGroupListData(this.groupList); - }; - - GroupRows.prototype.getRowGroup = function (row) { - var match = false; - - this.groupList.forEach(function (group) { - var result = group.getRowGroup(row); - - if (result) { - match = result; - } - }); - - return match; - }; - - GroupRows.prototype.countGroups = function () { - return this.groupList.length; - }; - - GroupRows.prototype.generateGroups = function (rows) { - var self = this, - oldGroups = self.groups; - - self.groups = {}; - self.groupList = []; - - if (this.allowedValues && this.allowedValues[0]) { - this.allowedValues[0].forEach(function (value) { - self.createGroup(value, 0, oldGroups); - }); - - rows.forEach(function (row) { - self.assignRowToExistingGroup(row, oldGroups); - }); - } else { - rows.forEach(function (row) { - self.assignRowToGroup(row, oldGroups); - }); - } - }; - - GroupRows.prototype.createGroup = function (groupID, level, oldGroups) { - var groupKey = level + "_" + groupID, - group; - - oldGroups = oldGroups || []; - - group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]); - - this.groups[groupKey] = group; - this.groupList.push(group); - }; - - // GroupRows.prototype.assignRowToGroup = function(row, oldGroups){ - // var groupID = this.groupIDLookups[0].func(row.getData()), - // groupKey = "0_" + groupID; - - // if(!this.groups[groupKey]){ - // this.createGroup(groupID, 0, oldGroups); - // } - - // this.groups[groupKey].addRow(row); - // }; - - GroupRows.prototype.assignRowToExistingGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - groupKey = "0_" + groupID; - - if (this.groups[groupKey]) { - this.groups[groupKey].addRow(row); - } - }; - - GroupRows.prototype.assignRowToGroup = function (row, oldGroups) { - var groupID = this.groupIDLookups[0].func(row.getData()), - newGroupNeeded = !this.groups["0_" + groupID]; - - if (newGroupNeeded) { - this.createGroup(groupID, 0, oldGroups); - } - - this.groups["0_" + groupID].addRow(row); - - return !newGroupNeeded; - }; - - GroupRows.prototype.updateGroupRows = function (force) { - var self = this, - output = [], - oldRowCount; - - self.groupList.forEach(function (group) { - output = output.concat(group.getHeadersAndRows()); - }); - - //force update of table display - if (force) { - - var displayIndex = self.table.rowManager.setDisplayRows(output, this.getDisplayIndex()); - - if (displayIndex !== true) { - this.setDisplayIndex(displayIndex); - } - - self.table.rowManager.refreshActiveData("group", true, true); - } - - return output; - }; - - GroupRows.prototype.scrollHeaders = function (left) { - left = left + "px"; - - this.groupList.forEach(function (group) { - group.scrollHeader(left); - }); - }; - - GroupRows.prototype.removeGroup = function (group) { - var groupKey = group.level + "_" + group.key, - index; - - if (this.groups[groupKey]) { - delete this.groups[groupKey]; - - index = this.groupList.indexOf(group); - - if (index > -1) { - this.groupList.splice(index, 1); - } - } - }; - - Tabulator.prototype.registerModule("groupRows", GroupRows); - var History = function History(table) { - this.table = table; //hold Tabulator object - - this.history = []; - this.index = -1; - }; - - History.prototype.clear = function () { - this.history = []; - this.index = -1; - }; - - History.prototype.action = function (type, component, data) { - - this.history = this.history.slice(0, this.index + 1); - - this.history.push({ - type: type, - component: component, - data: data - }); - - this.index++; - }; - - History.prototype.getHistoryUndoSize = function () { - return this.index + 1; - }; - - History.prototype.getHistoryRedoSize = function () { - return this.history.length - (this.index + 1); - }; - - History.prototype.undo = function () { - - if (this.index > -1) { - var action = this.history[this.index]; - - this.undoers[action.type].call(this, action); - - this.index--; - - this.table.options.historyUndo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Undo Error - No more history to undo"); - return false; - } - }; - - History.prototype.redo = function () { - if (this.history.length - 1 > this.index) { - - this.index++; - - var action = this.history[this.index]; - - this.redoers[action.type].call(this, action); - - this.table.options.historyRedo.call(this.table, action.type, action.component.getComponent(), action.data); - - return true; - } else { - console.warn("History Redo Error - No more history to redo"); - return false; - } - }; - - History.prototype.undoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.oldValue); - }, - - rowAdd: function rowAdd(action) { - action.component.deleteActual(); - }, - - rowDelete: function rowDelete(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after); - this.table.rowManager.redraw(); - } - }; - - History.prototype.redoers = { - cellEdit: function cellEdit(action) { - action.component.setValueProcessData(action.data.newValue); - }, - - rowAdd: function rowAdd(action) { - var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } - - this._rebindRow(action.component, newRow); - }, - - rowDelete: function rowDelete(action) { - action.component.deleteActual(); - }, - - rowMove: function rowMove(action) { - this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after); - this.table.rowManager.redraw(); - } - }; - - //rebind rows to new element after deletion - History.prototype._rebindRow = function (oldRow, newRow) { - this.history.forEach(function (action) { - if (action.component instanceof Row) { - if (action.component === oldRow) { - action.component = newRow; - } - } else if (action.component instanceof Cell) { - if (action.component.row === oldRow) { - var field = action.component.column.getField(); - - if (field) { - action.component = newRow.getCell(field); - } - } - } - }); - }; - - Tabulator.prototype.registerModule("history", History); - var HtmlTableImport = function HtmlTableImport(table) { - this.table = table; //hold Tabulator object - this.fieldIndex = []; - this.hasIndex = false; - }; - - HtmlTableImport.prototype.parseTable = function () { - var self = this, - element = self.table.element, - options = self.table.options, - columns = options.columns, - headers = element.getElementsByTagName("th"), - rows = element.getElementsByTagName("tbody")[0], - data = [], - newTable; - - self.hasIndex = false; - - self.table.options.htmlImporting.call(this.table); - - rows = rows ? rows.getElementsByTagName("tr") : []; - - //check for tablator inline options - self._extractOptions(element, options); - - if (headers.length) { - self._extractHeaders(headers, rows); - } else { - self._generateBlankHeaders(headers, rows); - } - - //iterate through table rows and build data set - for (var index = 0; index < rows.length; index++) { - var row = rows[index], - cells = row.getElementsByTagName("td"), - item = {}; - - //create index if the dont exist in table - if (!self.hasIndex) { - item[options.index] = index; - } - - for (var i = 0; i < cells.length; i++) { - var cell = cells[i]; - if (typeof this.fieldIndex[i] !== "undefined") { - item[this.fieldIndex[i]] = cell.innerHTML; - } - } - - //add row data to item - data.push(item); - } - - //create new element - var newElement = document.createElement("div"); - - //transfer attributes to new element - var attributes = element.attributes; - - // loop through attributes and apply them on div - - for (var i in attributes) { - if (_typeof(attributes[i]) == "object") { - newElement.setAttribute(attributes[i].name, attributes[i].value); - } - } - - // replace table with div element - element.parentNode.replaceChild(newElement, element); - - options.data = data; - - self.table.options.htmlImported.call(this.table); - - // // newElement.tabulator(options); - - this.table.element = newElement; - }; - - //extract tabulator attribute options - HtmlTableImport.prototype._extractOptions = function (element, options, defaultOptions) { - var attributes = element.attributes; - var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options); - var optionsList = {}; - - optionsArr.forEach(function (item) { - optionsList[item.toLowerCase()] = item; - }); - - for (var index in attributes) { - var attrib = attributes[index]; - var name; - - if (attrib && (typeof attrib === 'undefined' ? 'undefined' : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { - name = attrib.name.replace("tabulator-", ""); - - if (typeof optionsList[name] !== "undefined") { - options[optionsList[name]] = this._attribValue(attrib.value); - } - } - } - }; - - //get value of attribute - HtmlTableImport.prototype._attribValue = function (value) { - if (value === "true") { - return true; - } - - if (value === "false") { - return false; - } - - return value; - }; - - //find column if it has already been defined - HtmlTableImport.prototype._findCol = function (title) { - var match = this.table.options.columns.find(function (column) { - return column.title === title; - }); - - return match || false; - }; - - //extract column from headers - HtmlTableImport.prototype._extractHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - exists = false, - col = this._findCol(header.textContent), - width, - attributes; - - if (col) { - exists = true; - } else { - col = { title: header.textContent.trim() }; - } - - if (!col.field) { - col.field = header.textContent.trim().toLowerCase().replace(" ", "_"); - } - - width = header.getAttribute("width"); - - if (width && !col.width) { - col.width = width; - } - - //check for tablator inline options - attributes = header.attributes; - - // //check for tablator inline options - this._extractOptions(header, col, Column.prototype.defaultOptionList); - - this.fieldIndex[index] = col.field; - - if (col.field == this.table.options.index) { - this.hasIndex = true; - } - - if (!exists) { - this.table.options.columns.push(col); - } - } - }; - - //generate blank headers - HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) { - for (var index = 0; index < headers.length; index++) { - var header = headers[index], - col = { title: "", field: "col" + index }; - - this.fieldIndex[index] = col.field; - - var width = header.getAttribute("width"); - - if (width) { - col.width = width; - } - - this.table.options.columns.push(col); - } - }; - - Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport); - var Keybindings = function Keybindings(table) { - this.table = table; //hold Tabulator object - this.watchKeys = null; - this.pressedKeys = null; - this.keyupBinding = false; - this.keydownBinding = false; - }; - - Keybindings.prototype.initialize = function () { - var bindings = this.table.options.keybindings, - mergedBindings = {}; - - this.watchKeys = {}; - this.pressedKeys = []; - - if (bindings !== false) { - - for (var key in this.bindings) { - mergedBindings[key] = this.bindings[key]; - } - - if (Object.keys(bindings).length) { - - for (var _key in bindings) { - mergedBindings[_key] = bindings[_key]; - } - } - - this.mapBindings(mergedBindings); - this.bindEvents(); - } - }; - - Keybindings.prototype.mapBindings = function (bindings) { - var _this60 = this; - - var self = this; - - var _loop2 = function _loop2(key) { - - if (_this60.actions[key]) { - - if (bindings[key]) { - - if (_typeof(bindings[key]) !== "object") { - bindings[key] = [bindings[key]]; - } - - bindings[key].forEach(function (binding) { - self.mapBinding(key, binding); - }); - } - } else { - console.warn("Key Binding Error - no such action:", key); - } - }; - - for (var key in bindings) { - _loop2(key); - } - }; - - Keybindings.prototype.mapBinding = function (action, symbolsList) { - var self = this; - - var binding = { - action: this.actions[action], - keys: [], - ctrl: false, - shift: false, - meta: false - }; - - var symbols = symbolsList.toString().toLowerCase().split(" ").join("").split("+"); - - symbols.forEach(function (symbol) { - switch (symbol) { - case "ctrl": - binding.ctrl = true; - break; - - case "shift": - binding.shift = true; - break; - - case "meta": - binding.meta = true; - break; - - default: - symbol = parseInt(symbol); - binding.keys.push(symbol); - - if (!self.watchKeys[symbol]) { - self.watchKeys[symbol] = []; - } - - self.watchKeys[symbol].push(binding); - } - }); - }; - - Keybindings.prototype.bindEvents = function () { - var self = this; - - this.keyupBinding = function (e) { - var code = e.keyCode; - var bindings = self.watchKeys[code]; - - if (bindings) { - - self.pressedKeys.push(code); - - bindings.forEach(function (binding) { - self.checkBinding(e, binding); - }); - } - }; - - this.keydownBinding = function (e) { - var code = e.keyCode; - var bindings = self.watchKeys[code]; - - if (bindings) { - - var index = self.pressedKeys.indexOf(code); - - if (index > -1) { - self.pressedKeys.splice(index, 1); - } - } - }; - - this.table.element.addEventListener("keydown", this.keyupBinding); - - this.table.element.addEventListener("keyup", this.keydownBinding); - }; - - Keybindings.prototype.clearBindings = function () { - if (this.keyupBinding) { - this.table.element.removeEventListener("keydown", this.keyupBinding); - } - - if (this.keydownBinding) { - this.table.element.removeEventListener("keyup", this.keydownBinding); - } - }; - - Keybindings.prototype.checkBinding = function (e, binding) { - var self = this, - match = true; - - if (e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta) { - binding.keys.forEach(function (key) { - var index = self.pressedKeys.indexOf(key); - - if (index == -1) { - match = false; - } - }); - - if (match) { - binding.action.call(self, e); - } - - return true; - } - - return false; - }; - - //default bindings - Keybindings.prototype.bindings = { - navPrev: "shift + 9", - navNext: 9, - navUp: 38, - navDown: 40, - scrollPageUp: 33, - scrollPageDown: 34, - scrollToStart: 36, - scrollToEnd: 35, - undo: "ctrl + 90", - redo: "ctrl + 89", - copyToClipboard: "ctrl + 67" - }; - - //default actions - Keybindings.prototype.actions = { - keyBlock: function keyBlock(e) { - e.stopPropagation(); - e.preventDefault(); - }, - scrollPageUp: function scrollPageUp(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop - rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos >= 0) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - } - - this.table.element.focus(); - }, - scrollPageDown: function scrollPageDown(e) { - var rowManager = this.table.rowManager, - newPos = rowManager.scrollTop + rowManager.height, - scrollMax = rowManager.element.scrollHeight; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - if (newPos <= scrollMax) { - rowManager.element.scrollTop = newPos; - } else { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - } - - this.table.element.focus(); - }, - scrollToStart: function scrollToStart(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[0]); - } - - this.table.element.focus(); - }, - scrollToEnd: function scrollToEnd(e) { - var rowManager = this.table.rowManager; - - e.preventDefault(); - - if (rowManager.displayRowsCount) { - rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]); - } - - this.table.element.focus(); - }, - navPrev: function navPrev(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().prev(); - } - } - }, - - navNext: function navNext(e) { - var cell = false; - var newRow = this.table.options.tabEndNewRow; - var nav; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - - nav = cell.nav(); - - if (!nav.next()) { - if (newRow) { - - cell.getElement().firstChild.blur(); - - if (newRow === true) { - newRow = this.table.addRow({}); - } else { - if (typeof newRow == "function") { - newRow = this.table.addRow(newRow(cell.row.getComponent())); - } else { - newRow = this.table.addRow(Object.assign({}, newRow)); - } - } - - newRow.then(function () { - setTimeout(function () { - nav.next(); - }); - }); - } - } - } - } - }, - - navLeft: function navLeft(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().left(); - } - } - }, - - navRight: function navRight(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().right(); - } - } - }, - - navUp: function navUp(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().up(); - } - } - }, - - navDown: function navDown(e) { - var cell = false; - - if (this.table.modExists("edit")) { - cell = this.table.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - cell.nav().down(); - } - } - }, - - undo: function undo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.undo(); - } - } - }, - - redo: function redo(e) { - var cell = false; - if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) { - - cell = this.table.modules.edit.currentCell; - - if (!cell) { - e.preventDefault(); - this.table.modules.history.redo(); - } - } - }, - - copyToClipboard: function copyToClipboard(e) { - if (!this.table.modules.edit.currentCell) { - if (this.table.modExists("clipboard", true)) { - this.table.modules.clipboard.copy(false, true); - } - } - } - }; - - Tabulator.prototype.registerModule("keybindings", Keybindings); - var Menu = function Menu(table) { - this.table = table; //hold Tabulator object - this.menuEl = false; - this.blurEvent = this.hideMenu.bind(this); - this.escEvent = this.escMenu.bind(this); - this.nestedMenuBlock = false; - }; - - Menu.prototype.initializeColumnHeader = function (column) { - var _this61 = this; - - var headerMenuEl; - - if (column.definition.headerContextMenu) { - column.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof column.definition.headerContextMenu == "function" ? column.definition.headerContextMenu(column.getComponent()) : column.definition.headerContextMenu; - - e.preventDefault(); - - _this61.loadMenu(e, column, menu); - }); - } - - if (column.definition.headerMenu) { - - headerMenuEl = document.createElement("span"); - headerMenuEl.classList.add("tabulator-header-menu-button"); - headerMenuEl.innerHTML = "⋮"; - - headerMenuEl.addEventListener("click", function (e) { - var menu = typeof column.definition.headerMenu == "function" ? column.definition.headerMenu(column.getComponent()) : column.definition.headerMenu; - e.stopPropagation(); - e.preventDefault(); - - _this61.loadMenu(e, column, menu); - }); - - column.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild); - } - }; - - Menu.prototype.initializeCell = function (cell) { - var _this62 = this; - - cell.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof cell.column.definition.contextMenu == "function" ? cell.column.definition.contextMenu(cell.getComponent()) : cell.column.definition.contextMenu; - - e.stopImmediatePropagation(); - - _this62.loadMenu(e, cell, menu); - }); - }; - - Menu.prototype.initializeRow = function (row) { - var _this63 = this; - - row.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this63.table.options.rowContextMenu == "function" ? _this63.table.options.rowContextMenu(row.getComponent()) : _this63.table.options.rowContextMenu; - - _this63.loadMenu(e, row, menu); - }); - }; - - Menu.prototype.initializeGroup = function (group) { - var _this64 = this; - - group.getElement().addEventListener("contextmenu", function (e) { - var menu = typeof _this64.table.options.groupContextMenu == "function" ? _this64.table.options.groupContextMenu(group.getComponent()) : _this64.table.options.groupContextMenu; - - _this64.loadMenu(e, group, menu); - }); - }; - - Menu.prototype.loadMenu = function (e, component, menu) { - var _this65 = this; - - var docHeight = Math.max(document.body.offsetHeight, window.innerHeight); - - e.preventDefault(); - - //abort if no menu set - if (!menu || !menu.length) { - return; - } - - if (this.nestedMenuBlock) { - //abort if child menu already open - if (this.isOpen()) { - return; - } - } else { - this.nestedMenuBlock = setTimeout(function () { - _this65.nestedMenuBlock = false; - }, 100); - } - - this.hideMenu(); - - this.menuEl = document.createElement("div"); - this.menuEl.classList.add("tabulator-menu"); - - menu.forEach(function (item) { - var itemEl = document.createElement("div"); - var label = item.label; - var disabled = item.disabled; - - if (item.separator) { - itemEl.classList.add("tabulator-menu-separator"); - } else { - itemEl.classList.add("tabulator-menu-item"); - - if (typeof label == "function") { - label = label(component.getComponent()); - } - - if (label instanceof Node) { - itemEl.appendChild(label); - } else { - itemEl.innerHTML = label; - } - - if (typeof disabled == "function") { - disabled = disabled(component.getComponent()); - } - - if (disabled) { - itemEl.classList.add("tabulator-menu-item-disabled"); - itemEl.addEventListener("click", function (e) { - e.stopPropagation(); - }); - } else { - itemEl.addEventListener("click", function (e) { - _this65.hideMenu(); - item.action(e, component.getComponent()); - }); - } - } - - _this65.menuEl.appendChild(itemEl); - }); - - this.menuEl.style.top = e.pageY + "px"; - this.menuEl.style.left = e.pageX + "px"; - - document.body.addEventListener("click", this.blurEvent); - this.table.rowManager.element.addEventListener("scroll", this.blurEvent); - - setTimeout(function () { - document.body.addEventListener("contextmenu", _this65.blurEvent); - }, 100); - - document.body.addEventListener("keydown", this.escEvent); - - document.body.appendChild(this.menuEl); - - //move menu to start on right edge if it is too close to the edge of the screen - if (e.pageX + this.menuEl.offsetWidth >= document.body.offsetWidth) { - this.menuEl.style.left = ""; - this.menuEl.style.right = document.body.offsetWidth - e.pageX + "px"; - } - - //move menu to start on bottom edge if it is too close to the edge of the screen - if (e.pageY + this.menuEl.offsetHeight >= docHeight) { - this.menuEl.style.top = ""; - this.menuEl.style.bottom = docHeight - e.pageY + "px"; - } - }; - - Menu.prototype.isOpen = function () { - return !!this.menuEl.parentNode; - }; - - Menu.prototype.escMenu = function (e) { - if (e.keyCode == 27) { - this.hideMenu(); - } - }; - - Menu.prototype.hideMenu = function () { - if (this.menuEl.parentNode) { - this.menuEl.parentNode.removeChild(this.menuEl); - } - - if (this.escEvent) { - document.body.removeEventListener("keydown", this.escEvent); - } - - if (this.blurEvent) { - document.body.removeEventListener("click", this.blurEvent); - document.body.removeEventListener("contextmenu", this.blurEvent); - this.table.rowManager.element.removeEventListener("scroll", this.blurEvent); - } - }; - - //default accessors - Menu.prototype.menus = {}; - - Tabulator.prototype.registerModule("menu", Menu); - var MoveColumns = function MoveColumns(table) { - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating column header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving column - this.toCol = false; //destination column - this.toColAfter = false; //position of moving column relative to the desitnation column - this.startX = 0; //starting position within header element - this.autoScrollMargin = 40; //auto scroll on edge when within margin - this.autoScrollStep = 5; //auto scroll distance in pixels - this.autoScrollTimeout = false; //auto scroll timeout - this.touchMove = false; - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); - }; - - MoveColumns.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.classList.add("tabulator-col-placeholder"); - - return el; - }; - - MoveColumns.prototype.initializeColumn = function (column) { - var self = this, - config = {}, - colEl; - - if (!column.modules.frozen) { - - colEl = column.getElement(); - - config.mousemove = function (e) { - if (column.parent === self.moving.parent) { - if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) { - if (self.toCol !== column || !self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling); - self.moveColumn(column, true); - } - } else { - if (self.toCol !== column || self.toColAfter) { - colEl.parentNode.insertBefore(self.placeholderElement, colEl); - self.moveColumn(column, false); - } - } - } - }.bind(self); - - colEl.addEventListener("mousedown", function (e) { - self.touchMove = false; - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, column); - }, self.checkPeriod); - } - }); - - colEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - self.bindTouchEvents(column); - } - - column.modules.moveColumn = config; - }; - - MoveColumns.prototype.bindTouchEvents = function (column) { - var self = this, - colEl = column.getElement(), - startXMove = false, - //shifting center position of the cell - dir = false, - currentCol, - nextCol, - prevCol, - nextColWidth, - prevColWidth, - nextColWidthLast, - prevColWidthLast; - - colEl.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentCol = column; - nextCol = column.nextColumn(); - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = column.prevColumn(); - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - nextColWidthLast = 0; - prevColWidthLast = 0; - startXMove = false; - - self.startMove(e, column); - }, self.checkPeriod); - }, { passive: true }); - - colEl.addEventListener("touchmove", function (e) { - var halfCol, diff, moveToCol; - - if (self.moving) { - self.moveHover(e); - - if (!startXMove) { - startXMove = e.touches[0].pageX; - } - - diff = e.touches[0].pageX - startXMove; - - if (diff > 0) { - if (nextCol && diff - nextColWidthLast > nextColWidth) { - moveToCol = nextCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement().nextSibling); - self.moveColumn(moveToCol, true); - } - } - } else { - if (prevCol && -diff - prevColWidthLast > prevColWidth) { - moveToCol = prevCol; - - if (moveToCol !== column) { - startXMove = e.touches[0].pageX; - moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement()); - self.moveColumn(moveToCol, false); - } - } - } - - if (moveToCol) { - currentCol = moveToCol; - nextCol = moveToCol.nextColumn(); - nextColWidthLast = nextColWidth; - nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0; - prevCol = moveToCol.prevColumn(); - prevColWidthLast = prevColWidth; - prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0; - } - } - }, { passive: true }); - - colEl.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - } - }); - }; - - MoveColumns.prototype.startMove = function (e, column) { - var element = column.getElement(); - - this.moving = column; - this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(element).left; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = column.getWidth() + "px"; - this.placeholderElement.style.height = column.getHeight() + "px"; - - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - this.table.columnManager.getElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.bottom = "0"; - - if (!this.touchMove) { - this._bindMouseMove(); - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - } - - this.moveHover(e); - }; - - MoveColumns.prototype._bindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().addEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); - }; - - MoveColumns.prototype._unbindMouseMove = function () { - this.table.columnManager.columnsByIndex.forEach(function (column) { - if (column.modules.moveColumn.mousemove) { - column.getElement().removeEventListener("mousemove", column.modules.moveColumn.mousemove); - } - }); - }; - - MoveColumns.prototype.moveColumn = function (column, after) { - var movingCells = this.moving.getCells(); - - this.toCol = column; - this.toColAfter = after; - - if (after) { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling); - }); - } else { - column.getCells().forEach(function (cell, i) { - var cellEl = cell.getElement(); - cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl); - }); - } - }; - - MoveColumns.prototype.endMove = function (e) { - if (e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toCol) { - this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter); - } - - this.moving = false; - this.toCol = false; - this.toColAfter = false; - - if (!this.touchMove) { - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - } - } - }; - - MoveColumns.prototype.moveHover = function (e) { - var self = this, - columnHolder = self.table.columnManager.getElement(), - scrollLeft = columnHolder.scrollLeft, - xPos = (self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(columnHolder).left + scrollLeft, - scrollPos; - - self.hoverElement.style.left = xPos - self.startX + "px"; - - if (xPos - scrollLeft < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.max(0, scrollLeft - 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - - if (scrollLeft + columnHolder.clientWidth - xPos < self.autoScrollMargin) { - if (!self.autoScrollTimeout) { - self.autoScrollTimeout = setTimeout(function () { - scrollPos = Math.min(columnHolder.clientWidth, scrollLeft + 5); - self.table.rowManager.getElement().scrollLeft = scrollPos; - self.autoScrollTimeout = false; - }, 1); - } - } - }; - - Tabulator.prototype.registerModule("moveColumn", MoveColumns); - - var MoveRows = function MoveRows(table) { - - this.table = table; //hold Tabulator object - this.placeholderElement = this.createPlaceholderElement(); - this.hoverElement = false; //floating row header element - this.checkTimeout = false; //click check timeout holder - this.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click - this.moving = false; //currently moving row - this.toRow = false; //destination row - this.toRowAfter = false; //position of moving row relative to the desitnation row - this.hasHandle = false; //row has handle instead of fully movable row - this.startY = 0; //starting Y position within header element - this.startX = 0; //starting X position within header element - - this.moveHover = this.moveHover.bind(this); - this.endMove = this.endMove.bind(this); - this.tableRowDropEvent = false; - - this.touchMove = false; - - this.connection = false; - this.connectionSelectorsTables = false; - this.connectionSelectorsElements = false; - this.connectionElements = []; - this.connections = []; - - this.connectedTable = false; - this.connectedRow = false; - }; - - MoveRows.prototype.createPlaceholderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - el.classList.add("tabulator-row-placeholder"); - - return el; - }; - - MoveRows.prototype.initialize = function (handle) { - this.connectionSelectorsTables = this.table.options.movableRowsConnectedTables; - this.connectionSelectorsElements = this.table.options.movableRowsConnectedElements; - - this.connection = this.connectionSelectorsTables || this.connectionSelectorsElements; - }; - - MoveRows.prototype.setHandle = function (handle) { - this.hasHandle = handle; - }; - - MoveRows.prototype.initializeGroupHeader = function (group) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) { - if (self.toRow !== group || !self.toRowAfter) { - var rowEl = group.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(group, true); - } - } else { - if (self.toRow !== group || self.toRowAfter) { - var rowEl = group.getElement(); - if (rowEl.previousSibling) { - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(group, false); - } - } - } - }.bind(self); - - group.modules.moveRow = config; - }; - - MoveRows.prototype.initializeRow = function (row) { - var self = this, - config = {}, - rowEl; - - //inter table drag drop - config.mouseup = function (e) { - self.tableRowDrop(e, row); - }.bind(self); - - //same table drag drop - config.mousemove = function (e) { - if (e.pageY - Tabulator.prototype.helpers.elOffset(row.element).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) { - if (self.toRow !== row || !self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling); - self.moveRow(row, true); - } - } else { - if (self.toRow !== row || self.toRowAfter) { - var rowEl = row.getElement(); - rowEl.parentNode.insertBefore(self.placeholderElement, rowEl); - self.moveRow(row, false); - } - } - }.bind(self); - - if (!this.hasHandle) { - - rowEl = row.getElement(); - - rowEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, row); - }, self.checkPeriod); - } - }); - - rowEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(row, row.getElement()); - } - - row.modules.moveRow = config; - }; - - MoveRows.prototype.initializeCell = function (cell) { - var self = this, - cellEl = cell.getElement(); - - cellEl.addEventListener("mousedown", function (e) { - if (e.which === 1) { - self.checkTimeout = setTimeout(function () { - self.startMove(e, cell.row); - }, self.checkPeriod); - } - }); - - cellEl.addEventListener("mouseup", function (e) { - if (e.which === 1) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - } - }); - - this.bindTouchEvents(cell.row, cell.getElement()); - }; - - MoveRows.prototype.bindTouchEvents = function (row, element) { - var self = this, - startYMove = false, - //shifting center position of the cell - dir = false, - currentRow, - nextRow, - prevRow, - nextRowHeight, - prevRowHeight, - nextRowHeightLast, - prevRowHeightLast; - - element.addEventListener("touchstart", function (e) { - self.checkTimeout = setTimeout(function () { - self.touchMove = true; - currentRow = row; - nextRow = row.nextRow(); - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = row.prevRow(); - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - nextRowHeightLast = 0; - prevRowHeightLast = 0; - startYMove = false; - - self.startMove(e, row); - }, self.checkPeriod); - }, { passive: true }); - this.moving, this.toRow, this.toRowAfter; - element.addEventListener("touchmove", function (e) { - - var halfCol, diff, moveToRow; - - if (self.moving) { - e.preventDefault(); - - self.moveHover(e); - - if (!startYMove) { - startYMove = e.touches[0].pageY; - } - - diff = e.touches[0].pageY - startYMove; - - if (diff > 0) { - if (nextRow && diff - nextRowHeightLast > nextRowHeight) { - moveToRow = nextRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement().nextSibling); - self.moveRow(moveToRow, true); - } - } - } else { - if (prevRow && -diff - prevRowHeightLast > prevRowHeight) { - moveToRow = prevRow; - - if (moveToRow !== row) { - startYMove = e.touches[0].pageY; - moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement()); - self.moveRow(moveToRow, false); - } - } - } - - if (moveToRow) { - currentRow = moveToRow; - nextRow = moveToRow.nextRow(); - nextRowHeightLast = nextRowHeight; - nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0; - prevRow = moveToRow.prevRow(); - prevRowHeightLast = prevRowHeight; - prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0; - } - } - }); - - element.addEventListener("touchend", function (e) { - if (self.checkTimeout) { - clearTimeout(self.checkTimeout); - } - if (self.moving) { - self.endMove(e); - self.touchMove = false; - } - }); - }; - - MoveRows.prototype._bindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().addEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); - }; - - MoveRows.prototype._unbindMouseMove = function () { - var self = this; - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) { - row.getElement().removeEventListener("mousemove", row.modules.moveRow.mousemove); - } - }); - }; - - MoveRows.prototype.startMove = function (e, row) { - var element = row.getElement(); - - this.setStartPosition(e, row); - - this.moving = row; - - this.table.element.classList.add("tabulator-block-select"); - - //create placeholder - this.placeholderElement.style.width = row.getWidth() + "px"; - this.placeholderElement.style.height = row.getHeight() + "px"; - - if (!this.connection) { - element.parentNode.insertBefore(this.placeholderElement, element); - element.parentNode.removeChild(element); - } else { - this.table.element.classList.add("tabulator-movingrow-sending"); - this.connectToTables(row); - } - - //create hover element - this.hoverElement = element.cloneNode(true); - this.hoverElement.classList.add("tabulator-moving"); - - if (this.connection) { - document.body.appendChild(this.hoverElement); - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - this.hoverElement.style.width = this.table.element.clientWidth + "px"; - this.hoverElement.style.whiteSpace = "nowrap"; - this.hoverElement.style.overflow = "hidden"; - this.hoverElement.style.pointerEvents = "none"; - } else { - this.table.rowManager.getTableElement().appendChild(this.hoverElement); - - this.hoverElement.style.left = "0"; - this.hoverElement.style.top = "0"; - - this._bindMouseMove(); - } - - document.body.addEventListener("mousemove", this.moveHover); - document.body.addEventListener("mouseup", this.endMove); - - this.moveHover(e); - }; - - MoveRows.prototype.setStartPosition = function (e, row) { - var pageX = this.touchMove ? e.touches[0].pageX : e.pageX, - pageY = this.touchMove ? e.touches[0].pageY : e.pageY, - element, - position; - - element = row.getElement(); - if (this.connection) { - position = element.getBoundingClientRect(); - - this.startX = position.left - pageX + window.pageXOffset; - this.startY = position.top - pageY + window.pageYOffset; - } else { - this.startY = pageY - element.getBoundingClientRect().top; - } - }; - - MoveRows.prototype.endMove = function (e) { - if (!e || e.which === 1 || this.touchMove) { - this._unbindMouseMove(); - - if (!this.connection) { - this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling); - this.placeholderElement.parentNode.removeChild(this.placeholderElement); - } - - this.hoverElement.parentNode.removeChild(this.hoverElement); - - this.table.element.classList.remove("tabulator-block-select"); - - if (this.toRow) { - this.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter); - } - - this.moving = false; - this.toRow = false; - this.toRowAfter = false; - - document.body.removeEventListener("mousemove", this.moveHover); - document.body.removeEventListener("mouseup", this.endMove); - - if (this.connection) { - this.table.element.classList.remove("tabulator-movingrow-sending"); - this.disconnectFromTables(); - } - } - }; - - MoveRows.prototype.moveRow = function (row, after) { - this.toRow = row; - this.toRowAfter = after; - }; - - MoveRows.prototype.moveHover = function (e) { - if (this.connection) { - this.moveHoverConnections.call(this, e); - } else { - this.moveHoverTable.call(this, e); - } - }; - - MoveRows.prototype.moveHoverTable = function (e) { - var rowHolder = this.table.rowManager.getElement(), - scrollTop = rowHolder.scrollTop, - yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop, - scrollPos; - - this.hoverElement.style.top = yPos - this.startY + "px"; - }; - - MoveRows.prototype.moveHoverConnections = function (e) { - this.hoverElement.style.left = this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX) + "px"; - this.hoverElement.style.top = this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY) + "px"; - }; - - MoveRows.prototype.elementRowDrop = function (e, element, row) { - if (this.table.options.movableRowsElementDrop) { - this.table.options.movableRowsElementDrop(e, element, row ? row.getComponent() : false); - } - }; - - //establish connection with other tables - MoveRows.prototype.connectToTables = function (row) { - var _this66 = this; - - var connectionTables; - - if (this.connectionSelectorsTables) { - connectionTables = this.table.modules.comms.getConnections(this.connectionSelectorsTables); - - this.table.options.movableRowsSendingStart.call(this.table, connectionTables); - - this.table.modules.comms.send(this.connectionSelectorsTables, "moveRow", "connect", { - row: row - }); - } - - if (this.connectionSelectorsElements) { - - this.connectionElements = []; - - if (!Array.isArray(this.connectionSelectorsElements)) { - this.connectionSelectorsElements = [this.connectionSelectorsElements]; - } - - this.connectionSelectorsElements.forEach(function (query) { - if (typeof query === "string") { - _this66.connectionElements = _this66.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query))); - } else { - _this66.connectionElements.push(query); - } - }); - - this.connectionElements.forEach(function (element) { - var dropEvent = function dropEvent(e) { - _this66.elementRowDrop(e, element, _this66.moving); - }; - - element.addEventListener("mouseup", dropEvent); - element.tabulatorElementDropEvent = dropEvent; - - element.classList.add("tabulator-movingrow-receiving"); - }); - } - }; - - //disconnect from other tables - MoveRows.prototype.disconnectFromTables = function () { - var connectionTables; - - if (this.connectionSelectorsTables) { - connectionTables = this.table.modules.comms.getConnections(this.connectionSelectorsTables); - - this.table.options.movableRowsSendingStop.call(this.table, connectionTables); - - this.table.modules.comms.send(this.connectionSelectorsTables, "moveRow", "disconnect"); - } - - this.connectionElements.forEach(function (element) { - element.classList.remove("tabulator-movingrow-receiving"); - element.removeEventListener("mouseup", element.tabulatorElementDropEvent); - delete element.tabulatorElementDropEvent; - }); - }; - - //accept incomming connection - MoveRows.prototype.connect = function (table, row) { - var self = this; - if (!this.connectedTable) { - this.connectedTable = table; - this.connectedRow = row; - - this.table.element.classList.add("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.tableRowDropEvent = self.tableRowDrop.bind(self); - - self.table.element.addEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStart.call(this.table, row, table); - - return true; - } else { - console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable); - return false; - } - }; - - //close incomming connection - MoveRows.prototype.disconnect = function (table) { - var self = this; - if (table === this.connectedTable) { - this.connectedTable = false; - this.connectedRow = false; - - this.table.element.classList.remove("tabulator-movingrow-receiving"); - - self.table.rowManager.getDisplayRows().forEach(function (row) { - if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) { - row.getElement().removeEventListener("mouseup", row.modules.moveRow.mouseup); - } - }); - - self.table.element.removeEventListener("mouseup", self.tableRowDropEvent); - - this.table.options.movableRowsReceivingStop.call(this.table, table); - } else { - console.warn("Move Row Error - trying to disconnect from non connected table"); - } - }; - - MoveRows.prototype.dropComplete = function (table, row, success) { - var sender = false; - - if (success) { - - switch (_typeof(this.table.options.movableRowsSender)) { - case "string": - sender = this.senders[this.table.options.movableRowsSender]; - break; - - case "function": - sender = this.table.options.movableRowsSender; - break; - } - - if (sender) { - sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - if (this.table.options.movableRowsSender) { - console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender); - } - } - - this.table.options.movableRowsSent.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } else { - this.table.options.movableRowsSentFailed.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table); - } - - this.endMove(); - }; - - MoveRows.prototype.tableRowDrop = function (e, row) { - var receiver = false, - success = false; - - console.trace("drop"); - - e.stopImmediatePropagation(); - - switch (_typeof(this.table.options.movableRowsReceiver)) { - case "string": - receiver = this.receivers[this.table.options.movableRowsReceiver]; - break; - - case "function": - receiver = this.table.options.movableRowsReceiver; - break; - } - - if (receiver) { - success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver); - } - - if (success) { - this.table.options.movableRowsReceived.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } else { - this.table.options.movableRowsReceivedFailed.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable); - } - - this.table.modules.comms.send(this.connectedTable, "moveRow", "dropcomplete", { - row: row, - success: success - }); - }; - - MoveRows.prototype.receivers = { - insert: function insert(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData(), undefined, toRow); - return true; - }, - - add: function add(fromRow, toRow, fromTable) { - this.table.addRow(fromRow.getData()); - return true; - }, - - update: function update(fromRow, toRow, fromTable) { - if (toRow) { - toRow.update(fromRow.getData()); - return true; - } - - return false; - }, - - replace: function replace(fromRow, toRow, fromTable) { - if (toRow) { - this.table.addRow(fromRow.getData(), undefined, toRow); - toRow.delete(); - return true; - } - - return false; - } - }; - - MoveRows.prototype.senders = { - delete: function _delete(fromRow, toRow, toTable) { - fromRow.delete(); - } - }; - - MoveRows.prototype.commsReceived = function (table, action, data) { - switch (action) { - case "connect": - return this.connect(table, data.row); - break; - - case "disconnect": - return this.disconnect(table); - break; - - case "dropcomplete": - return this.dropComplete(table, data.row, data.success); - break; - } - }; - - Tabulator.prototype.registerModule("moveRow", MoveRows); - var Mutator = function Mutator(table) { - this.table = table; //hold Tabulator object - this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types - this.enabled = true; - }; - - //initialize column mutator - Mutator.prototype.initializeColumn = function (column) { - var self = this, - match = false, - config = {}; - - this.allowedTypes.forEach(function (type) { - var key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - mutator; - - if (column.definition[key]) { - mutator = self.lookupMutator(column.definition[key]); - - if (mutator) { - match = true; - - config[key] = { - mutator: mutator, - params: column.definition[key + "Params"] || {} - }; - } - } - }); - - if (match) { - column.modules.mutate = config; - } - }; - - Mutator.prototype.lookupMutator = function (value) { - var mutator = false; - - //set column mutator - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - if (this.mutators[value]) { - mutator = this.mutators[value]; - } else { - console.warn("Mutator Error - No such mutator found, ignoring: ", value); - } - break; - - case "function": - mutator = value; - break; - } - - return mutator; - }; - - //apply mutator to row - Mutator.prototype.transformRow = function (data, type, updatedData) { - var self = this, - key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)), - value; - - if (this.enabled) { - - self.table.columnManager.traverse(function (column) { - var mutator, params, component; - - if (column.modules.mutate) { - mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; - - if (mutator) { - value = column.getFieldValue(typeof updatedData !== "undefined" ? updatedData : data); - - if (type == "data" || typeof value !== "undefined") { - component = column.getComponent(); - params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; - column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); - } - } - } - }); - } - - return data; - }; - - //apply mutator to new cell value - Mutator.prototype.transformCell = function (cell, value) { - var mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false, - tempData = {}; - - if (mutator) { - tempData = Object.assign(tempData, cell.row.getData()); - cell.column.setFieldValue(tempData, value); - return mutator.mutator(value, tempData, "edit", mutator.params, cell.getComponent()); - } else { - return value; - } - }; - - Mutator.prototype.enable = function () { - this.enabled = true; - }; - - Mutator.prototype.disable = function () { - this.enabled = false; - }; - - //default mutators - Mutator.prototype.mutators = {}; - - Tabulator.prototype.registerModule("mutator", Mutator); - var Page = function Page(table) { - - this.table = table; //hold Tabulator object - - this.mode = "local"; - this.progressiveLoad = false; - - this.size = 0; - this.page = 1; - this.count = 5; - this.max = 1; - - this.displayIndex = 0; //index in display pipeline - - this.initialLoad = true; - - this.pageSizes = []; - - this.dataReceivedNames = {}; - this.dataSentNames = {}; - - this.createElements(); - }; - - Page.prototype.createElements = function () { - - var button; - - this.element = document.createElement("span"); - this.element.classList.add("tabulator-paginator"); - - this.pagesElement = document.createElement("span"); - this.pagesElement.classList.add("tabulator-pages"); - - button = document.createElement("button"); - button.classList.add("tabulator-page"); - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - button.setAttribute("aria-label", ""); - button.setAttribute("title", ""); - - this.firstBut = button.cloneNode(true); - this.firstBut.setAttribute("data-page", "first"); - - this.prevBut = button.cloneNode(true); - this.prevBut.setAttribute("data-page", "prev"); - - this.nextBut = button.cloneNode(true); - this.nextBut.setAttribute("data-page", "next"); - - this.lastBut = button.cloneNode(true); - this.lastBut.setAttribute("data-page", "last"); - - if (this.table.options.paginationSizeSelector) { - this.pageSizeSelect = document.createElement("select"); - this.pageSizeSelect.classList.add("tabulator-page-size"); - } - }; - - Page.prototype.generatePageSizeSelectList = function () { - var _this67 = this; - - var pageSizes = []; - - if (this.pageSizeSelect) { - - if (Array.isArray(this.table.options.paginationSizeSelector)) { - pageSizes = this.table.options.paginationSizeSelector; - this.pageSizes = pageSizes; - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes.unshift(this.size); - } - } else { - - if (this.pageSizes.indexOf(this.size) == -1) { - pageSizes = []; - - for (var _i9 = 1; _i9 < 5; _i9++) { - pageSizes.push(this.size * _i9); - } - - this.pageSizes = pageSizes; - } else { - pageSizes = this.pageSizes; - } - } - - while (this.pageSizeSelect.firstChild) { - this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild); - }pageSizes.forEach(function (item) { - var itemEl = document.createElement("option"); - itemEl.value = item; - - if (item === true) { - _this67.table.modules.localize.bind("pagination|all", function (value) { - itemEl.innerHTML = value; - }); - } else { - itemEl.innerHTML = item; - } - - _this67.pageSizeSelect.appendChild(itemEl); - }); - - this.pageSizeSelect.value = this.size; - } - }; - - //setup pageination - Page.prototype.initialize = function (hidden) { - var self = this, - pageSelectLabel, - testElRow, - testElCell; - - //update param names - this.dataSentNames = Object.assign({}, this.paginationDataSentNames); - this.dataSentNames = Object.assign(this.dataSentNames, this.table.options.paginationDataSent); - - this.dataReceivedNames = Object.assign({}, this.paginationDataReceivedNames); - this.dataReceivedNames = Object.assign(this.dataReceivedNames, this.table.options.paginationDataReceived); - - //build pagination element - - //bind localizations - self.table.modules.localize.bind("pagination|first", function (value) { - self.firstBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|first_title", function (value) { - self.firstBut.setAttribute("aria-label", value); - self.firstBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|prev", function (value) { - self.prevBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|prev_title", function (value) { - self.prevBut.setAttribute("aria-label", value); - self.prevBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|next", function (value) { - self.nextBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|next_title", function (value) { - self.nextBut.setAttribute("aria-label", value); - self.nextBut.setAttribute("title", value); - }); - - self.table.modules.localize.bind("pagination|last", function (value) { - self.lastBut.innerHTML = value; - }); - - self.table.modules.localize.bind("pagination|last_title", function (value) { - self.lastBut.setAttribute("aria-label", value); - self.lastBut.setAttribute("title", value); - }); - - //click bindings - self.firstBut.addEventListener("click", function () { - self.setPage(1); - }); - - self.prevBut.addEventListener("click", function () { - self.previousPage(); - }); - - self.nextBut.addEventListener("click", function () { - self.nextPage().then(function () {}).catch(function () {}); - }); - - self.lastBut.addEventListener("click", function () { - self.setPage(self.max); - }); - - if (self.table.options.paginationElement) { - self.element = self.table.options.paginationElement; - } - - if (this.pageSizeSelect) { - pageSelectLabel = document.createElement("label"); - - self.table.modules.localize.bind("pagination|page_size", function (value) { - self.pageSizeSelect.setAttribute("aria-label", value); - self.pageSizeSelect.setAttribute("title", value); - pageSelectLabel.innerHTML = value; - }); - - self.element.appendChild(pageSelectLabel); - self.element.appendChild(self.pageSizeSelect); - - self.pageSizeSelect.addEventListener("change", function (e) { - self.setPageSize(self.pageSizeSelect.value == "true" ? true : self.pageSizeSelect.value); - self.setPage(1).then(function () {}).catch(function () {}); - }); - } - - //append to DOM - self.element.appendChild(self.firstBut); - self.element.appendChild(self.prevBut); - self.element.appendChild(self.pagesElement); - self.element.appendChild(self.nextBut); - self.element.appendChild(self.lastBut); - - if (!self.table.options.paginationElement && !hidden) { - self.table.footerManager.append(self.element, self); - } - - //set default values - self.mode = self.table.options.pagination; - - if (self.table.options.paginationSize) { - self.size = self.table.options.paginationSize; - } else { - testElRow = document.createElement("div"); - testElRow.classList.add("tabulator-row"); - testElRow.style.visibility = hidden; - - testElCell = document.createElement("div"); - testElCell.classList.add("tabulator-cell"); - testElCell.innerHTML = "Page Row Test"; - - testElRow.appendChild(testElCell); - - self.table.rowManager.getTableElement().appendChild(testElRow); - - self.size = Math.floor(self.table.rowManager.getElement().clientHeight / testElRow.offsetHeight); - - self.table.rowManager.getTableElement().removeChild(testElRow); - } - - // self.page = self.table.options.paginationInitialPage || 1; - self.count = self.table.options.paginationButtonCount; - - self.generatePageSizeSelectList(); - }; - - Page.prototype.initializeProgressive = function (mode) { - this.initialize(true); - this.mode = "progressive_" + mode; - this.progressiveLoad = true; - }; - - Page.prototype.setDisplayIndex = function (index) { - this.displayIndex = index; - }; - - Page.prototype.getDisplayIndex = function () { - return this.displayIndex; - }; - - //calculate maximum page from number of rows - Page.prototype.setMaxRows = function (rowCount) { - if (!rowCount) { - this.max = 1; - } else { - this.max = this.size === true ? 1 : Math.ceil(rowCount / this.size); - } - - if (this.page > this.max) { - this.page = this.max; - } - }; - - //reset to first page without triggering action - Page.prototype.reset = function (force, columnsChanged) { - if (this.mode == "local" || force) { - this.page = 1; - } - - if (columnsChanged) { - this.initialLoad = true; - } - - return true; - }; - - //set the maxmum page - Page.prototype.setMaxPage = function (max) { - - max = parseInt(max); - - this.max = max || 1; - - if (this.page > this.max) { - this.page = this.max; - this.trigger(); - } - }; - - //set current page number - Page.prototype.setPage = function (page) { - var _this68 = this; - - var self = this; - - switch (page) { - case "first": - return this.setPage(1); - break; - - case "prev": - return this.previousPage(); - break; - - case "next": - return this.nextPage(); - break; - - case "last": - return this.setPage(this.max); - break; - } - - return new Promise(function (resolve, reject) { - - page = parseInt(page); - - if (page > 0 && page <= _this68.max) { - _this68.page = page; - _this68.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.page) { - self.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Requested page is out of range of 1 - " + _this68.max + ":", page); - reject(); - } - }); - }; - - Page.prototype.setPageToRow = function (row) { - var _this69 = this; - - return new Promise(function (resolve, reject) { - - var rows = _this69.table.rowManager.getDisplayRows(_this69.displayIndex - 1); - var index = rows.indexOf(row); - - if (index > -1) { - var page = _this69.size === true ? 1 : Math.ceil((index + 1) / _this69.size); - - _this69.setPage(page).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - console.warn("Pagination Error - Requested row is not visible"); - reject(); - } - }); - }; - - Page.prototype.setPageSize = function (size) { - if (size !== true) { - size = parseInt(size); - } - - if (size > 0) { - this.size = size; - } - - if (this.pageSizeSelect) { - // this.pageSizeSelect.value = size; - this.generatePageSizeSelectList(); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.page) { - this.table.modules.persistence.save("page"); - } - }; - - //setup the pagination buttons - Page.prototype._setPageButtons = function () { - var self = this; - - var leftSize = Math.floor((this.count - 1) / 2); - var rightSize = Math.ceil((this.count - 1) / 2); - var min = this.max - this.page + leftSize + 1 < this.count ? this.max - this.count + 1 : Math.max(this.page - leftSize, 1); - var max = this.page <= rightSize ? Math.min(this.count, this.max) : Math.min(this.page + rightSize, this.max); - - while (self.pagesElement.firstChild) { - self.pagesElement.removeChild(self.pagesElement.firstChild); - }if (self.page == 1) { - self.firstBut.disabled = true; - self.prevBut.disabled = true; - } else { - self.firstBut.disabled = false; - self.prevBut.disabled = false; - } - - if (self.page == self.max) { - self.lastBut.disabled = true; - self.nextBut.disabled = true; - } else { - self.lastBut.disabled = false; - self.nextBut.disabled = false; - } - - for (var _i10 = min; _i10 <= max; _i10++) { - if (_i10 > 0 && _i10 <= self.max) { - self.pagesElement.appendChild(self._generatePageButton(_i10)); - } - } - - this.footerRedraw(); - }; - - Page.prototype._generatePageButton = function (page) { - var self = this, - button = document.createElement("button"); - - button.classList.add("tabulator-page"); - if (page == self.page) { - button.classList.add("active"); - } - - button.setAttribute("type", "button"); - button.setAttribute("role", "button"); - - self.table.modules.localize.bind("pagination|page_title", function (value) { - button.setAttribute("aria-label", value + " " + page); - button.setAttribute("title", value + " " + page); - }); - - button.setAttribute("data-page", page); - button.textContent = page; - - button.addEventListener("click", function (e) { - self.setPage(page); - }); - - return button; - }; - - //previous page - Page.prototype.previousPage = function () { - var _this70 = this; - - return new Promise(function (resolve, reject) { - if (_this70.page > 1) { - _this70.page--; - _this70.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this70.table.options.persistence && _this70.table.modExists("persistence", true) && _this70.table.modules.persistence.config.page) { - _this70.table.modules.persistence.save("page"); - } - } else { - console.warn("Pagination Error - Previous page would be less than page 1:", 0); - reject(); - } - }); - }; - - //next page - Page.prototype.nextPage = function () { - var _this71 = this; - - return new Promise(function (resolve, reject) { - if (_this71.page < _this71.max) { - _this71.page++; - _this71.trigger().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - - if (_this71.table.options.persistence && _this71.table.modExists("persistence", true) && _this71.table.modules.persistence.config.page) { - _this71.table.modules.persistence.save("page"); - } - } else { - if (!_this71.progressiveLoad) { - console.warn("Pagination Error - Next page would be greater than maximum page of " + _this71.max + ":", _this71.max + 1); - } - reject(); - } - }); - }; - - //return current page number - Page.prototype.getPage = function () { - return this.page; - }; - - //return max page number - Page.prototype.getPageMax = function () { - return this.max; - }; - - Page.prototype.getPageSize = function (size) { - return this.size; - }; - - Page.prototype.getMode = function () { - return this.mode; - }; - - //return appropriate rows for current page - Page.prototype.getRows = function (data) { - var output, start, end; - - if (this.mode == "local") { - output = []; - - if (this.size === true) { - start = 0; - end = data.length - 1; - } else { - start = this.size * (this.page - 1); - end = start + parseInt(this.size); - } - - this._setPageButtons(); - - for (var _i11 = start; _i11 < end; _i11++) { - if (data[_i11]) { - output.push(data[_i11]); - } - } - - return output; - } else { - - this._setPageButtons(); - - return data.slice(0); - } - }; - - Page.prototype.trigger = function () { - var _this72 = this; - - var left; - - return new Promise(function (resolve, reject) { - - switch (_this72.mode) { - case "local": - left = _this72.table.rowManager.scrollLeft; - - _this72.table.rowManager.refreshActiveData("page"); - _this72.table.rowManager.scrollHorizontal(left); - - _this72.table.options.pageLoaded.call(_this72.table, _this72.getPage()); - resolve(); - break; - - case "remote": - case "progressive_load": - case "progressive_scroll": - _this72.table.modules.ajax.blockActiveRequest(); - _this72._getRemotePage().then(function () { - resolve(); - }).catch(function () { - reject(); - }); - break; - - default: - console.warn("Pagination Error - no such pagination mode:", _this72.mode); - reject(); - } - }); - }; - - Page.prototype._getRemotePage = function () { - var _this73 = this; - - var self = this, - oldParams, - pageParams; - - return new Promise(function (resolve, reject) { - - if (!self.table.modExists("ajax", true)) { - reject(); - } - - //record old params and restore after request has been made - oldParams = Tabulator.prototype.helpers.deepClone(self.table.modules.ajax.getParams() || {}); - pageParams = self.table.modules.ajax.getParams(); - - //configure request params - pageParams[_this73.dataSentNames.page] = self.page; - - //set page size if defined - if (_this73.size) { - pageParams[_this73.dataSentNames.size] = _this73.size; - } - - //set sort data if defined - if (_this73.table.options.ajaxSorting && _this73.table.modExists("sort")) { - var sorters = self.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - pageParams[_this73.dataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (_this73.table.options.ajaxFiltering && _this73.table.modExists("filter")) { - var filters = self.table.modules.filter.getFilters(true, true); - pageParams[_this73.dataSentNames.filters] = filters; - } - - self.table.modules.ajax.setParams(pageParams); - - self.table.modules.ajax.sendRequest(_this73.progressiveLoad).then(function (data) { - self._parseRemoteData(data); - resolve(); - }).catch(function (e) { - reject(); - }); - - self.table.modules.ajax.setParams(oldParams); - }); - }; - - Page.prototype._parseRemoteData = function (data) { - var self = this, - left, - data, - margin; - - if (typeof data[this.dataReceivedNames.last_page] === "undefined") { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property"); - } - - if (data[this.dataReceivedNames.data]) { - this.max = parseInt(data[this.dataReceivedNames.last_page]) || 1; - - if (this.progressiveLoad) { - switch (this.mode) { - case "progressive_load": - - if (this.page == 1) { - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - } else { - this.table.rowManager.addRows(data[this.dataReceivedNames.data]); - } - - if (this.page < this.max) { - setTimeout(function () { - self.nextPage().then(function () {}).catch(function () {}); - }, self.table.options.ajaxProgressiveLoadDelay); - } - break; - - case "progressive_scroll": - data = this.table.rowManager.getData().concat(data[this.dataReceivedNames.data]); - - this.table.rowManager.setData(data, true, this.initialLoad && this.page == 1); - - margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2; - - if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) { - self.nextPage().then(function () {}).catch(function () {}); - } - break; - } - } else { - left = this.table.rowManager.scrollLeft; - - this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1); - - this.table.rowManager.scrollHorizontal(left); - - this.table.columnManager.scrollHorizontal(left); - - this.table.options.pageLoaded.call(this.table, this.getPage()); - } - - this.initialLoad = false; - } else { - console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property"); - } - }; - - //handle the footer element being redrawn - Page.prototype.footerRedraw = function () { - var footer = this.table.footerManager.element; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } else { - this.pagesElement.style.display = ''; - - if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) { - this.pagesElement.style.display = 'none'; - } - } - }; - - //set the paramter names for pagination requests - Page.prototype.paginationDataSentNames = { - "page": "page", - "size": "size", - "sorters": "sorters", - // "sort_dir":"sort_dir", - "filters": "filters" - // "filter_value":"filter_value", - // "filter_type":"filter_type", - }; - - //set the property names for pagination responses - Page.prototype.paginationDataReceivedNames = { - "current_page": "current_page", - "last_page": "last_page", - "data": "data" - }; - - Tabulator.prototype.registerModule("page", Page); - - var Persistence = function Persistence(table) { - this.table = table; //hold Tabulator object - this.mode = ""; - this.id = ""; - // this.persistProps = ["field", "width", "visible"]; - this.defWatcherBlock = false; - this.config = {}; - this.readFunc = false; - this.writeFunc = false; - }; - - // Test for whether localStorage is available for use. - Persistence.prototype.localStorageTest = function () { - var testKey = "_tabulator_test"; - - try { - window.localStorage.setItem(testKey, testKey); - window.localStorage.removeItem(testKey); - return true; - } catch (e) { - return false; - } - }; - - //setup parameters - Persistence.prototype.initialize = function () { - //determine persistent layout storage type - - var mode = this.table.options.persistenceMode, - id = this.table.options.persistenceID, - retreivedData; - - this.mode = mode !== true ? mode : this.localStorageTest() ? "local" : "cookie"; - - if (this.table.options.persistenceReaderFunc) { - if (typeof this.table.options.persistenceReaderFunc === "function") { - this.readFunc = this.table.options.persistenceReaderFunc; - } else { - if (this.readers[this.table.options.persistenceReaderFunc]) { - this.readFunc = this.readers[this.table.options.persistenceReaderFunc]; - } else { - console.warn("Persistence Read Error - invalid reader set", this.table.options.persistenceReaderFunc); - } - } - } else { - if (this.readers[this.mode]) { - this.readFunc = this.readers[this.mode]; - } else { - console.warn("Persistence Read Error - invalid reader set", this.mode); - } - } - - if (this.table.options.persistenceWriterFunc) { - if (typeof this.table.options.persistenceWriterFunc === "function") { - this.writeFunc = this.table.options.persistenceWriterFunc; - } else { - if (this.readers[this.table.options.persistenceWriterFunc]) { - this.writeFunc = this.readers[this.table.options.persistenceWriterFunc]; - } else { - console.warn("Persistence Write Error - invalid reader set", this.table.options.persistenceWriterFunc); - } - } - } else { - if (this.writers[this.mode]) { - this.writeFunc = this.writers[this.mode]; - } else { - console.warn("Persistence Write Error - invalid writer set", this.mode); - } - } - - //set storage tag - this.id = "tabulator-" + (id || this.table.element.getAttribute("id") || ""); - - this.config = { - sort: this.table.options.persistence === true || this.table.options.persistence.sort, - filter: this.table.options.persistence === true || this.table.options.persistence.filter, - group: this.table.options.persistence === true || this.table.options.persistence.group, - page: this.table.options.persistence === true || this.table.options.persistence.page, - columns: this.table.options.persistence === true ? ["title", "width", "visible"] : this.table.options.persistence.columns - }; - - //load pagination data if needed - if (this.config.page) { - retreivedData = this.retreiveData("page"); - - if (retreivedData) { - if (typeof retreivedData.paginationSize !== "undefined" && (this.config.page === true || this.config.page.size)) { - this.table.options.paginationSize = retreivedData.paginationSize; - } - - if (typeof retreivedData.paginationInitialPage !== "undefined" && (this.config.page === true || this.config.page.page)) { - this.table.options.paginationInitialPage = retreivedData.paginationInitialPage; - } - } - } - - //load group data if needed - if (this.config.group) { - retreivedData = this.retreiveData("group"); - - if (retreivedData) { - if (typeof retreivedData.groupBy !== "undefined" && (this.config.group === true || this.config.group.groupBy)) { - this.table.options.groupBy = retreivedData.groupBy; - } - if (typeof retreivedData.groupStartOpen !== "undefined" && (this.config.group === true || this.config.group.groupStartOpen)) { - this.table.options.groupStartOpen = retreivedData.groupStartOpen; - } - if (typeof retreivedData.groupHeader !== "undefined" && (this.config.group === true || this.config.group.groupHeader)) { - this.table.options.groupHeader = retreivedData.groupHeader; - } - } - } - }; - - Persistence.prototype.initializeColumn = function (column) { - var self = this, - def, - keys; - - if (this.config.columns) { - this.defWatcherBlock = true; - - def = column.getDefinition(); - - keys = this.config.columns === true ? Object.keys(def) : this.config.columns; - - keys.forEach(function (key) { - var props = Object.getOwnPropertyDescriptor(def, key); - var value = def[key]; - if (props) { - Object.defineProperty(def, key, { - set: function set(newValue) { - value = newValue; - - if (!self.defWatcherBlock) { - self.save("columns"); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - if (props.get) { - props.get(); - } - return value; - } - }); - } - }); - - this.defWatcherBlock = false; - } - }; - - //load saved definitions - Persistence.prototype.load = function (type, current) { - var data = this.retreiveData(type); - - if (current) { - data = data ? this.mergeDefinition(current, data) : current; - } - - return data; - }; - - //retreive data from memory - Persistence.prototype.retreiveData = function (type) { - return this.readFunc ? this.readFunc(this.id, type) : false; - }; - - //merge old and new column definitions - Persistence.prototype.mergeDefinition = function (oldCols, newCols) { - var self = this, - output = []; - - // oldCols = oldCols || []; - newCols = newCols || []; - - newCols.forEach(function (column, to) { - - var from = self._findColumn(oldCols, column), - keys; - - if (from) { - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(from); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - if (typeof column[key] !== "undefined") { - from[key] = column[key]; - } - }); - - if (from.columns) { - from.columns = self.mergeDefinition(from.columns, column.columns); - } - - output.push(from); - } - }); - - oldCols.forEach(function (column, i) { - var from = self._findColumn(newCols, column); - if (!from) { - if (output.length > i) { - output.splice(i, 0, column); - } else { - output.push(column); - } - } - }); - - return output; - }; - - //find matching columns - Persistence.prototype._findColumn = function (columns, subject) { - var type = subject.columns ? "group" : subject.field ? "field" : "object"; - - return columns.find(function (col) { - switch (type) { - case "group": - return col.title === subject.title && col.columns.length === subject.columns.length; - break; - - case "field": - return col.field === subject.field; - break; - - case "object": - return col === subject; - break; - } - }); - }; - - //save data - Persistence.prototype.save = function (type) { - var data = {}; - - switch (type) { - case "columns": - data = this.parseColumns(this.table.columnManager.getColumns()); - break; - - case "filter": - data = this.table.modules.filter.getFilters(); - break; - - case "sort": - data = this.validateSorters(this.table.modules.sort.getSort()); - break; - - case "group": - data = this.getGroupConfig(); - break; - - case "page": - data = this.getPageConfig(); - break; - } - - if (this.writeFunc) { - this.writeFunc(this.id, type, data); - } - }; - - //ensure sorters contain no function data - Persistence.prototype.validateSorters = function (data) { - data.forEach(function (item) { - item.column = item.field; - delete item.field; - }); - - return data; - }; - - Persistence.prototype.getGroupConfig = function () { - if (this.config.group) { - if (this.config.group === true || this.config.group.groupBy) { - data.groupBy = this.table.options.groupBy; - } - - if (this.config.group === true || this.config.group.groupStartOpen) { - data.groupStartOpen = this.table.options.groupStartOpen; - } - - if (this.config.group === true || this.config.group.groupHeader) { - data.groupHeader = this.table.options.groupHeader; - } - } - - return data; - }; - - Persistence.prototype.getPageConfig = function () { - var data = {}; - - if (this.config.page) { - if (this.config.page === true || this.config.page.size) { - data.paginationSize = this.table.modules.page.getPageSize(); - } - - if (this.config.page === true || this.config.page.page) { - data.paginationInitialPage = this.table.modules.page.getPage(); - } - } - - return data; - }; - - //parse columns for data to store - Persistence.prototype.parseColumns = function (columns) { - var self = this, - definitions = []; - - columns.forEach(function (column) { - var defStore = {}, - colDef = column.getDefinition(), - keys; - - if (column.isGroup) { - defStore.title = colDef.title; - defStore.columns = self.parseColumns(column.getColumns()); - } else { - defStore.field = column.getField(); - - if (self.config.columns === true || self.config.columns == undefined) { - keys = Object.keys(colDef); - keys.push("width"); - } else { - keys = self.config.columns; - } - - keys.forEach(function (key) { - - switch (key) { - case "width": - defStore.width = column.getWidth(); - break; - case "visible": - defStore.visible = column.visible; - break; - - default: - defStore[key] = colDef[key]; - } - }); - } - - definitions.push(defStore); - }); - - return definitions; - }; - - // read peristence information from storage - Persistence.prototype.readers = { - local: function local(id, type) { - var data = localStorage.getItem(id + "-" + type); - - return data ? JSON.parse(data) : false; - }, - cookie: function cookie(id, type) { - var cookie = document.cookie, - key = id + "-" + type, - cookiePos = cookie.indexOf(key + "="), - end, - data; - - //if cookie exists, decode and load column data into tabulator - if (cookiePos > -1) { - cookie = cookie.substr(cookiePos); - - end = cookie.indexOf(";"); - - if (end > -1) { - cookie = cookie.substr(0, end); - } - - data = cookie.replace(key + "=", ""); - } - - return data ? JSON.parse(data) : false; - } - }; - - //write persistence information to storage - Persistence.prototype.writers = { - local: function local(id, type, data) { - localStorage.setItem(id + "-" + type, JSON.stringify(data)); - }, - cookie: function cookie(id, type, data) { - var expireDate = new Date(); - - expireDate.setDate(expireDate.getDate() + 10000); - - document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString(); - } - }; - - Tabulator.prototype.registerModule("persistence", Persistence); - - var Print = function Print(table) { - this.table = table; //hold Tabulator object - this.element = false; - this.manualBlock = false; - }; - - Print.prototype.initialize = function () { - window.addEventListener("beforeprint", this.replaceTable.bind(this)); - window.addEventListener("afterprint", this.cleanup.bind(this)); - }; - - Print.prototype.replaceTable = function () { - if (!this.manualBlock) { - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-table"); - - this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print")); - - this.table.element.style.display = "none"; - - this.table.element.parentNode.insertBefore(this.element, this.table.element); - } - }; - - Print.prototype.cleanup = function () { - document.body.classList.remove("tabulator-print-fullscreen-hide"); - - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - this.table.element.style.display = ""; - } - }; - - Print.prototype.printFullscreen = function (visible, style, config) { - var scrollX = window.scrollX, - scrollY = window.scrollY, - headerEl = document.createElement("div"), - footerEl = document.createElement("div"), - tableEl = this.table.modules.export.genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible, "print"), - headerContent, - footerContent; - - this.manualBlock = true; - - this.element = document.createElement("div"); - this.element.classList.add("tabulator-print-fullscreen"); - - if (this.table.options.printHeader) { - headerEl.classList.add("tabulator-print-header"); - - headerContent = typeof this.table.options.printHeader == "function" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader; - - if (typeof headerContent == "string") { - headerEl.innerHTML = headerContent; - } else { - headerEl.appendChild(headerContent); - } - - this.element.appendChild(headerEl); - } - - this.element.appendChild(tableEl); - - if (this.table.options.printFooter) { - footerEl.classList.add("tabulator-print-footer"); - - footerContent = typeof this.table.options.printFooter == "function" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter; - - if (typeof footerContent == "string") { - footerEl.innerHTML = footerContent; - } else { - footerEl.appendChild(footerContent); - } - - this.element.appendChild(footerEl); - } - - document.body.classList.add("tabulator-print-fullscreen-hide"); - document.body.appendChild(this.element); - - if (this.table.options.printFormatter) { - this.table.options.printFormatter(this.element, tableEl); - } - - window.print(); - - this.cleanup(); - - window.scrollTo(scrollX, scrollY); - - this.manualBlock = false; - }; - - Tabulator.prototype.registerModule("print", Print); - var ReactiveData = function ReactiveData(table) { - this.table = table; //hold Tabulator object - this.data = false; - this.blocked = false; //block reactivity while performing update - this.origFuncs = {}; // hold original data array functions to allow replacement after data is done with - this.currentVersion = 0; - }; - - ReactiveData.prototype.watchData = function (data) { - var self = this, - pushFunc, - version; - - this.currentVersion++; - - version = this.currentVersion; - - self.unwatchData(); - - self.data = data; - - //override array push function - self.origFuncs.push = data.push; - - Object.defineProperty(self.data, "push", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, false); - }); - } - - return self.origFuncs.push.apply(data, arguments); - } - }); - - //override array unshift function - self.origFuncs.unshift = data.unshift; - - Object.defineProperty(self.data, "unshift", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments); - - if (!self.blocked && version === self.currentVersion) { - args.forEach(function (arg) { - self.table.rowManager.addRowActual(arg, true); - }); - } - - return self.origFuncs.unshift.apply(data, arguments); - } - }); - - //override array shift function - self.origFuncs.shift = data.shift; - - Object.defineProperty(self.data, "shift", { - enumerable: false, - configurable: true, - value: function value() { - var row; - - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[0]); - - if (row) { - row.deleteActual(); - } - } - } - - return self.origFuncs.shift.call(data); - } - }); - - //override array pop function - self.origFuncs.pop = data.pop; - - Object.defineProperty(self.data, "pop", { - enumerable: false, - configurable: true, - value: function value() { - var row; - if (!self.blocked && version === self.currentVersion) { - if (self.data.length) { - row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]); - - if (row) { - row.deleteActual(); - } - } - } - return self.origFuncs.pop.call(data); - } - }); - - //override array splice function - self.origFuncs.splice = data.splice; - - Object.defineProperty(self.data, "splice", { - enumerable: false, - configurable: true, - value: function value() { - var args = Array.from(arguments), - start = args[0] < 0 ? data.length + args[0] : args[0], - end = args[1], - newRows = args[2] ? args.slice(2) : false, - startRow; - - if (!self.blocked && version === self.currentVersion) { - - //add new rows - if (newRows) { - startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false; - - if (startRow) { - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, startRow, true); - }); - } else { - newRows = newRows.slice().reverse(); - - newRows.forEach(function (rowData) { - self.table.rowManager.addRowActual(rowData, true, false, true); - }); - } - } - - //delete removed rows - if (end !== 0) { - var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end); - - oldRows.forEach(function (rowData, i) { - var row = self.table.rowManager.getRowFromDataObject(rowData); - - if (row) { - row.deleteActual(i !== oldRows.length - 1); - } - }); - } - - if (newRows || end !== 0) { - self.table.rowManager.reRenderInPosition(); - } - } - - return self.origFuncs.splice.apply(data, arguments); - } - }); - }; - - ReactiveData.prototype.unwatchData = function () { - if (this.data !== false) { - for (var key in this.origFuncs) { - Object.defineProperty(this.data, key, { - enumerable: true, - configurable: true, - writable: true, - value: this.origFuncs.key - }); - } - } - }; - - ReactiveData.prototype.watchRow = function (row) { - var self = this, - data = row.getData(); - - this.blocked = true; - - for (var key in data) { - this.watchKey(row, data, key); - } - - this.blocked = false; - }; - - ReactiveData.prototype.watchKey = function (row, data, key) { - var self = this, - props = Object.getOwnPropertyDescriptor(data, key), - value = data[key], - version = this.currentVersion; - - Object.defineProperty(data, key, { - set: function set(newValue) { - value = newValue; - if (!self.blocked && version === self.currentVersion) { - var update = {}; - update[key] = newValue; - row.updateData(update); - } - - if (props.set) { - props.set(newValue); - } - }, - get: function get() { - - if (props.get) { - props.get(); - } - - return value; - } - }); - }; - - ReactiveData.prototype.unwatchRow = function (row) { - var data = row.getData(); - - for (var key in data) { - Object.defineProperty(data, key, { - value: data[key] - }); - } - }; - - ReactiveData.prototype.block = function () { - this.blocked = true; - }; - - ReactiveData.prototype.unblock = function () { - this.blocked = false; - }; - - Tabulator.prototype.registerModule("reactiveData", ReactiveData); - - var ResizeColumns = function ResizeColumns(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startX = false; - this.startWidth = false; - this.handle = null; - this.prevHandle = null; - }; - - ResizeColumns.prototype.initializeColumn = function (type, column, element) { - var self = this, - variableHeight = false, - mode = this.table.options.resizableColumns; - - //set column resize mode - if (type === "header") { - variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight; - column.modules.resize = { variableHeight: variableHeight }; - } - - if (mode === true || mode == type) { - - var handle = document.createElement('div'); - handle.className = "tabulator-col-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-col-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - var nearestColumn = column.getLastColumn(); - - if (nearestColumn && self._checkResizability(nearestColumn)) { - self.startColumn = column; - self._mouseDown(e, nearestColumn, handle); - } - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - //reszie column on double click - handle.addEventListener("dblclick", function (e) { - var col = column.getLastColumn(); - - if (col && self._checkResizability(col)) { - e.stopPropagation(); - col.reinitializeWidth(true); - } - }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - self.startColumn = column; - self._mouseDown(e, prevColumn, prevHandle); - } - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - //resize column on double click - prevHandle.addEventListener("dblclick", function (e) { - var nearestColumn, colIndex, prevColumn; - - nearestColumn = column.getFirstColumn(); - - if (nearestColumn) { - colIndex = self.table.columnManager.findColumnIndex(nearestColumn); - prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false; - - if (prevColumn && self._checkResizability(prevColumn)) { - e.stopPropagation(); - prevColumn.reinitializeWidth(true); - } - } - }); - - element.appendChild(handle); - element.appendChild(prevHandle); - } - }; - - ResizeColumns.prototype._checkResizability = function (column) { - return typeof column.definition.resizable != "undefined" ? column.definition.resizable : this.table.options.resizableColumns; - }; - - ResizeColumns.prototype._mouseDown = function (e, column, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - // self.table.columnManager.tempScrollBlock(); - - column.setWidth(self.startWidth + ((typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX) - self.startX)); - - if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - } - - function mouseUp(e) { - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = false; - } - - if (self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) { - column.checkCellHeights(); - } - - document.body.removeEventListener("mouseup", mouseUp); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.save("columns"); - } - - self.table.options.columnResized.call(self.table, column.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - if (self.startColumn.modules.edit) { - self.startColumn.modules.edit.blocked = true; - } - - self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX; - self.startWidth = column.getWidth(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); - }; - - Tabulator.prototype.registerModule("resizeColumns", ResizeColumns); - var ResizeRows = function ResizeRows(table) { - this.table = table; //hold Tabulator object - this.startColumn = false; - this.startY = false; - this.startHeight = false; - this.handle = null; - this.prevHandle = null; - }; - - ResizeRows.prototype.initializeRow = function (row) { - var self = this, - rowEl = row.getElement(); - - var handle = document.createElement('div'); - handle.className = "tabulator-row-resize-handle"; - - var prevHandle = document.createElement('div'); - prevHandle.className = "tabulator-row-resize-handle prev"; - - handle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var handleDown = function handleDown(e) { - self.startRow = row; - self._mouseDown(e, row, handle); - }; - - handle.addEventListener("mousedown", handleDown); - handle.addEventListener("touchstart", handleDown, { passive: true }); - - prevHandle.addEventListener("click", function (e) { - e.stopPropagation(); - }); - - var prevHandleDown = function prevHandleDown(e) { - var prevRow = self.table.rowManager.prevDisplayRow(row); - - if (prevRow) { - self.startRow = prevRow; - self._mouseDown(e, prevRow, prevHandle); - } - }; - - prevHandle.addEventListener("mousedown", prevHandleDown); - prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true }); - - rowEl.appendChild(handle); - rowEl.appendChild(prevHandle); - }; - - ResizeRows.prototype._mouseDown = function (e, row, handle) { - var self = this; - - self.table.element.classList.add("tabulator-block-select"); - - function mouseMove(e) { - row.setHeight(self.startHeight + ((typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY) - self.startY)); - } - - function mouseUp(e) { - - // //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = false; - // } - - document.body.removeEventListener("mouseup", mouseMove); - document.body.removeEventListener("mousemove", mouseMove); - - handle.removeEventListener("touchmove", mouseMove); - handle.removeEventListener("touchend", mouseUp); - - self.table.element.classList.remove("tabulator-block-select"); - - self.table.options.rowResized.call(this.table, row.getComponent()); - } - - e.stopPropagation(); //prevent resize from interfereing with movable columns - - //block editor from taking action while resizing is taking place - // if(self.startColumn.modules.edit){ - // self.startColumn.modules.edit.blocked = true; - // } - - self.startY = typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY; - self.startHeight = row.getHeight(); - - document.body.addEventListener("mousemove", mouseMove); - document.body.addEventListener("mouseup", mouseUp); - - handle.addEventListener("touchmove", mouseMove, { passive: true }); - handle.addEventListener("touchend", mouseUp); - }; - - Tabulator.prototype.registerModule("resizeRows", ResizeRows); - var ResizeTable = function ResizeTable(table) { - this.table = table; //hold Tabulator object - this.binding = false; - this.observer = false; - this.containerObserver = false; - - this.tableHeight = 0; - this.tableWidth = 0; - this.containerHeight = 0; - this.containerWidth = 0; - - this.autoResize = false; - }; - - ResizeTable.prototype.initialize = function (row) { - var _this74 = this; - - var table = this.table, - tableStyle; - - this.tableHeight = table.element.clientHeight; - this.tableWidth = table.element.clientWidth; - - if (table.element.parentNode) { - this.containerHeight = table.element.parentNode.clientHeight; - this.containerWidth = table.element.parentNode.clientWidth; - } - - if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") { - - this.autoResize = true; - - this.observer = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this74.tableHeight != nodeHeight || _this74.tableWidth != nodeWidth) { - _this74.tableHeight = nodeHeight; - _this74.tableWidth = nodeWidth; - - if (table.element.parentNode) { - _this74.containerHeight = table.element.parentNode.clientHeight; - _this74.containerWidth = table.element.parentNode.clientWidth; - } - - table.redraw(); - } - } - }); - - this.observer.observe(table.element); - - tableStyle = window.getComputedStyle(table.element); - - if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) { - - this.containerObserver = new ResizeObserver(function (entry) { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - - var nodeHeight = Math.floor(entry[0].contentRect.height); - var nodeWidth = Math.floor(entry[0].contentRect.width); - - if (_this74.containerHeight != nodeHeight || _this74.containerWidth != nodeWidth) { - _this74.containerHeight = nodeHeight; - _this74.containerWidth = nodeWidth; - _this74.tableHeight = table.element.clientHeight; - _this74.tableWidth = table.element.clientWidth; - - table.redraw(); - } - - table.redraw(); - } - }); - - this.containerObserver.observe(this.table.element.parentNode); - } - } else { - this.binding = function () { - if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) { - table.redraw(); - } - }; - - window.addEventListener("resize", this.binding); - } - }; - - ResizeTable.prototype.clearBindings = function (row) { - if (this.binding) { - window.removeEventListener("resize", this.binding); - } - - if (this.observer) { - this.observer.unobserve(this.table.element); - } - - if (this.containerObserver) { - this.containerObserver.unobserve(this.table.element.parentNode); - } - }; - - Tabulator.prototype.registerModule("resizeTable", ResizeTable); - var ResponsiveLayout = function ResponsiveLayout(table) { - this.table = table; //hold Tabulator object - this.columns = []; - this.hiddenColumns = []; - this.mode = ""; - this.index = 0; - this.collapseFormatter = []; - this.collapseStartOpen = true; - this.collapseHandleColumn = false; - }; - - //generate resposive columns list - ResponsiveLayout.prototype.initialize = function () { - var self = this, - columns = []; - - this.mode = this.table.options.responsiveLayout; - this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData; - this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen; - this.hiddenColumns = []; - - //detemine level of responsivity for each column - this.table.columnManager.columnsByIndex.forEach(function (column, i) { - if (column.modules.responsive) { - if (column.modules.responsive.order && column.modules.responsive.visible) { - column.modules.responsive.index = i; - columns.push(column); - - if (!column.visible && self.mode === "collapse") { - self.hiddenColumns.push(column); - } - } - } - }); - - //sort list by responsivity - columns = columns.reverse(); - columns = columns.sort(function (a, b) { - var diff = b.modules.responsive.order - a.modules.responsive.order; - return diff || b.modules.responsive.index - a.modules.responsive.index; - }); - - this.columns = columns; - - if (this.mode === "collapse") { - this.generateCollapsedContent(); - } - - //assign collapse column - for (var _iterator = this.table.columnManager.columnsByIndex, _isArray = Array.isArray(_iterator), _i12 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i12 >= _iterator.length) break; - _ref = _iterator[_i12++]; - } else { - _i12 = _iterator.next(); - if (_i12.done) break; - _ref = _i12.value; - } - - var col = _ref; - - if (col.definition.formatter == "responsiveCollapse") { - this.collapseHandleColumn = col; - break; - } - } - - if (this.collapseHandleColumn) { - if (this.hiddenColumns.length) { - this.collapseHandleColumn.show(); - } else { - this.collapseHandleColumn.hide(); - } - } - }; - - //define layout information - ResponsiveLayout.prototype.initializeColumn = function (column) { - var def = column.getDefinition(); - - column.modules.responsive = { order: typeof def.responsive === "undefined" ? 1 : def.responsive, visible: def.visible === false ? false : true }; - }; - - ResponsiveLayout.prototype.initializeRow = function (row) { - var el; - - if (row.type !== "calc") { - el = document.createElement("div"); - el.classList.add("tabulator-responsive-collapse"); - - row.modules.responsiveLayout = { - element: el, - open: this.collapseStartOpen - }; - - if (!this.collapseStartOpen) { - el.style.display = 'none'; - } - } - }; - - ResponsiveLayout.prototype.layoutRow = function (row) { - var rowEl = row.getElement(); - - if (row.modules.responsiveLayout) { - rowEl.appendChild(row.modules.responsiveLayout.element); - this.generateCollapsedRowContent(row); - } - }; - - //update column visibility - ResponsiveLayout.prototype.updateColumnVisibility = function (column, visible) { - var index; - if (column.modules.responsive) { - column.modules.responsive.visible = visible; - this.initialize(); - } - }; - - ResponsiveLayout.prototype.hideColumn = function (column) { - var colCount = this.hiddenColumns.length; - - column.hide(false, true); - - if (this.mode === "collapse") { - this.hiddenColumns.unshift(column); - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !colCount) { - this.collapseHandleColumn.show(); - } - } - }; - - ResponsiveLayout.prototype.showColumn = function (column) { - var index; - - column.show(false, true); - //set column width to prevent calculation loops on uninitialized columns - column.setWidth(column.getWidth()); - - if (this.mode === "collapse") { - index = this.hiddenColumns.indexOf(column); - - if (index > -1) { - this.hiddenColumns.splice(index, 1); - } - - this.generateCollapsedContent(); - - if (this.collapseHandleColumn && !this.hiddenColumns.length) { - this.collapseHandleColumn.hide(); - } - } - }; - - //redraw columns to fit space - ResponsiveLayout.prototype.update = function () { - var self = this, - working = true; - - while (working) { - - var width = self.table.modules.layout.getMode() == "fitColumns" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth(); - - var diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width; - - if (diff < 0) { - //table is too wide - var column = self.columns[self.index]; - - if (column) { - self.hideColumn(column); - self.index++; - } else { - working = false; - } - } else { - - //table has spare space - var _column = self.columns[self.index - 1]; - - if (_column) { - if (diff > 0) { - if (diff >= _column.getWidth()) { - self.showColumn(_column); - self.index--; - } else { - working = false; - } - } else { - working = false; - } - } else { - working = false; - } - } - - if (!self.table.rowManager.activeRowsCount) { - self.table.rowManager.renderEmptyScroll(); - } - } - }; - - ResponsiveLayout.prototype.generateCollapsedContent = function () { - var self = this, - rows = this.table.rowManager.getDisplayRows(); - - rows.forEach(function (row) { - self.generateCollapsedRowContent(row); - }); - }; - - ResponsiveLayout.prototype.generateCollapsedRowContent = function (row) { - var el, contents; - - if (row.modules.responsiveLayout) { - el = row.modules.responsiveLayout.element; - - while (el.firstChild) { - el.removeChild(el.firstChild); - }contents = this.collapseFormatter(this.generateCollapsedRowData(row)); - if (contents) { - el.appendChild(contents); - } - } - }; - - ResponsiveLayout.prototype.generateCollapsedRowData = function (row) { - var self = this, - data = row.getData(), - output = [], - mockCellComponent; - - this.hiddenColumns.forEach(function (column) { - var value = column.getFieldValue(data); - - if (column.definition.title && column.field) { - if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) { - - mockCellComponent = { - value: false, - data: {}, - getValue: function getValue() { - return value; - }, - getData: function getData() { - return data; - }, - getElement: function getElement() { - return document.createElement("div"); - }, - getRow: function getRow() { - return row.getComponent(); - }, - getColumn: function getColumn() { - return column.getComponent(); - } - }; - - output.push({ - title: column.definition.title, - value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params) - }); - } else { - output.push({ - title: column.definition.title, - value: value - }); - } - } - }); - - return output; - }; - - ResponsiveLayout.prototype.formatCollapsedData = function (data) { - var list = document.createElement("table"), - listContents = ""; - - data.forEach(function (item) { - var div = document.createElement("div"); - - if (item.value instanceof Node) { - div.appendChild(item.value); - item.value = div.innerHTML; - } - - listContents += "" + item.title + "" + item.value + ""; - }); - - list.innerHTML = listContents; - - return Object.keys(data).length ? list : ""; - }; - - Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); - - var SelectRow = function SelectRow(table) { - this.table = table; //hold Tabulator object - this.selecting = false; //flag selecting in progress - this.lastClickedRow = false; //last clicked row - this.selectPrev = []; //hold previously selected element for drag drop selection - this.selectedRows = []; //hold selected rows - this.headerCheckboxElement = null; // hold header select element - }; - - SelectRow.prototype.clearSelectionData = function (silent) { - this.selecting = false; - this.lastClickedRow = false; - this.selectPrev = []; - this.selectedRows = []; - - if (!silent) { - this._rowSelectionChanged(); - } - }; - - SelectRow.prototype.initializeRow = function (row) { - var self = this, - element = row.getElement(); - - // trigger end of row selection - var endSelect = function endSelect() { - - setTimeout(function () { - self.selecting = false; - }, 50); - - document.body.removeEventListener("mouseup", endSelect); - }; - - row.modules.select = { selected: false }; - - //set row selection class - if (self.table.options.selectableCheck.call(this.table, row.getComponent())) { - element.classList.add("tabulator-selectable"); - element.classList.remove("tabulator-unselectable"); - - if (self.table.options.selectable && self.table.options.selectable != "highlight") { - if (self.table.options.selectableRangeMode === "click") { - element.addEventListener("click", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - self.lastClickedRow = self.lastClickedRow || row; - - var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow); - var rowIdx = self.table.rowManager.getDisplayRowIndex(row); - - var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx; - var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx; - - var rows = self.table.rowManager.getDisplayRows().slice(0); - var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1); - - if (e.ctrlKey || e.metaKey) { - toggledRows.forEach(function (toggledRow) { - if (toggledRow !== self.lastClickedRow) { - - if (self.table.options.selectable !== true && !self.isRowSelected(row)) { - if (self.selectedRows.length < self.table.options.selectable) { - self.toggleRow(toggledRow); - } - } else { - self.toggleRow(toggledRow); - } - } - }); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - - if (self.table.options.selectable !== true) { - if (toggledRows.length > self.table.options.selectable) { - toggledRows = toggledRows.slice(0, self.table.options.selectable); - } - } - - self.selectRows(toggledRows); - } - self.table._clearSelection(); - } else if (e.ctrlKey || e.metaKey) { - self.toggleRow(row); - self.lastClickedRow = row; - } else { - self.deselectRows(undefined, true); - self.selectRows(row); - self.lastClickedRow = row; - } - }); - } else { - element.addEventListener("click", function (e) { - if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) { - self.table._clearSelection(); - } - - if (!self.selecting) { - self.toggleRow(row); - } - }); - - element.addEventListener("mousedown", function (e) { - if (e.shiftKey) { - self.table._clearSelection(); - - self.selecting = true; - - self.selectPrev = []; - - document.body.addEventListener("mouseup", endSelect); - document.body.addEventListener("keyup", endSelect); - - self.toggleRow(row); - - return false; - } - }); - - element.addEventListener("mouseenter", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.toggleRow(row); - - if (self.selectPrev[1] == row) { - self.toggleRow(self.selectPrev[0]); - } - } - }); - - element.addEventListener("mouseout", function (e) { - if (self.selecting) { - self.table._clearSelection(); - self.selectPrev.unshift(row); - } - }); - } - } - } else { - element.classList.add("tabulator-unselectable"); - element.classList.remove("tabulator-selectable"); - } - }; - - //toggle row selection - SelectRow.prototype.toggleRow = function (row) { - if (this.table.options.selectableCheck.call(this.table, row.getComponent())) { - if (row.modules.select && row.modules.select.selected) { - this._deselectRow(row); - } else { - this._selectRow(row); - } - } - }; - - //select a number of rows - SelectRow.prototype.selectRows = function (rows) { - var _this75 = this; - - var rowMatch; - - switch (typeof rows === 'undefined' ? 'undefined' : _typeof(rows)) { - case "undefined": - this.table.rowManager.rows.forEach(function (row) { - _this75._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - break; - - case "string": - - rowMatch = this.table.rowManager.findRow(rows); - - if (rowMatch) { - this._selectRow(rowMatch, true, true); - } else { - this.table.rowManager.getRows(rows).forEach(function (row) { - _this75._selectRow(row, true, true); - }); - } - - this._rowSelectionChanged(); - break; - - default: - if (Array.isArray(rows)) { - rows.forEach(function (row) { - _this75._selectRow(row, true, true); - }); - - this._rowSelectionChanged(); - } else { - this._selectRow(rows, false, true); - } - break; - } - }; - - //select an individual row - SelectRow.prototype._selectRow = function (rowInfo, silent, force) { - var index; - - //handle max row count - if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) { - if (this.selectedRows.length >= this.table.options.selectable) { - if (this.table.options.selectableRollingSelection) { - this._deselectRow(this.selectedRows[0]); - } else { - return false; - } - } - } - - var row = this.table.rowManager.findRow(rowInfo); - - if (row) { - if (this.selectedRows.indexOf(row) == -1) { - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = true; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = true; - } - row.getElement().classList.add("tabulator-selected"); - - this.selectedRows.push(row); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, true); - } - - if (!silent) { - this.table.options.rowSelected.call(this.table, row.getComponent()); - } - - this._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo); - } - } - }; - - SelectRow.prototype.isRowSelected = function (row) { - return this.selectedRows.indexOf(row) !== -1; - }; - - //deselect a number of rows - SelectRow.prototype.deselectRows = function (rows, silent) { - var self = this, - rowCount; - - if (typeof rows == "undefined") { - - rowCount = self.selectedRows.length; - - for (var _i13 = 0; _i13 < rowCount; _i13++) { - self._deselectRow(self.selectedRows[0], true); - } - - self._rowSelectionChanged(silent); - } else { - if (Array.isArray(rows)) { - rows.forEach(function (row) { - self._deselectRow(row, true); - }); - - self._rowSelectionChanged(silent); - } else { - self._deselectRow(rows, silent); - } - } - }; - - //deselect an individual row - SelectRow.prototype._deselectRow = function (rowInfo, silent) { - var self = this, - row = self.table.rowManager.findRow(rowInfo), - index; - - if (row) { - index = self.selectedRows.findIndex(function (selectedRow) { - return selectedRow == row; - }); - - if (index > -1) { - - if (!row.modules.select) { - row.modules.select = {}; - } - - row.modules.select.selected = false; - if (row.modules.select.checkboxEl) { - row.modules.select.checkboxEl.checked = false; - } - row.getElement().classList.remove("tabulator-selected"); - self.selectedRows.splice(index, 1); - - if (this.table.options.dataTreeSelectPropagate) { - this.childRowSelection(row, false); - } - - if (!silent) { - self.table.options.rowDeselected.call(this.table, row.getComponent()); - } - - self._rowSelectionChanged(silent); - } - } else { - if (!silent) { - console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo); - } - } - }; - - SelectRow.prototype.getSelectedData = function () { - var data = []; - - this.selectedRows.forEach(function (row) { - data.push(row.getData()); - }); - - return data; - }; - - SelectRow.prototype.getSelectedRows = function () { - - var rows = []; - - this.selectedRows.forEach(function (row) { - rows.push(row.getComponent()); - }); - - return rows; - }; - - SelectRow.prototype._rowSelectionChanged = function (silent) { - if (this.headerCheckboxElement) { - if (this.selectedRows.length === 0) { - this.headerCheckboxElement.checked = false; - this.headerCheckboxElement.indeterminate = false; - } else if (this.table.rowManager.rows.length === this.selectedRows.length) { - this.headerCheckboxElement.checked = true; - this.headerCheckboxElement.indeterminate = false; - } else { - this.headerCheckboxElement.indeterminate = true; - this.headerCheckboxElement.checked = false; - } - } - - if (!silent) { - this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows()); - } - }; - - SelectRow.prototype.registerRowSelectCheckbox = function (row, element) { - if (!row._row.modules.select) { - row._row.modules.select = {}; - } - - row._row.modules.select.checkboxEl = element; - }; - - SelectRow.prototype.registerHeaderSelectCheckbox = function (element) { - this.headerCheckboxElement = element; - }; - - SelectRow.prototype.childRowSelection = function (row, select) { - var children = this.table.modules.dataTree.getChildren(row); - - if (select) { - for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i14 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i14 >= _iterator2.length) break; - _ref2 = _iterator2[_i14++]; - } else { - _i14 = _iterator2.next(); - if (_i14.done) break; - _ref2 = _i14.value; - } - - var child = _ref2; - - this._selectRow(child, true); - } - } else { - for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i15 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref3; - - if (_isArray3) { - if (_i15 >= _iterator3.length) break; - _ref3 = _iterator3[_i15++]; - } else { - _i15 = _iterator3.next(); - if (_i15.done) break; - _ref3 = _i15.value; - } - - var _child = _ref3; - - this._deselectRow(_child, true); - } - } - }; - - Tabulator.prototype.registerModule("selectRow", SelectRow); - - var Sort = function Sort(table) { - this.table = table; //hold Tabulator object - this.sortList = []; //holder current sort - this.changed = false; //has the sort changed since last render - }; - - //initialize column header for sorting - Sort.prototype.initializeColumn = function (column, content) { - var self = this, - sorter = false, - colEl, - arrowEl; - - switch (_typeof(column.definition.sorter)) { - case "string": - if (self.sorters[column.definition.sorter]) { - sorter = self.sorters[column.definition.sorter]; - } else { - console.warn("Sort Error - No such sorter found: ", column.definition.sorter); - } - break; - - case "function": - sorter = column.definition.sorter; - break; - } - - column.modules.sort = { - sorter: sorter, dir: "none", - params: column.definition.sorterParams || {}, - startingDir: column.definition.headerSortStartingDir || "asc", - tristate: typeof column.definition.headerSortTristate !== "undefined" ? column.definition.headerSortTristate : this.table.options.headerSortTristate - }; - - if (typeof column.definition.headerSort === "undefined" ? this.table.options.headerSort !== false : column.definition.headerSort !== false) { - - colEl = column.getElement(); - - colEl.classList.add("tabulator-sortable"); - - arrowEl = document.createElement("div"); - arrowEl.classList.add("tabulator-arrow"); - //create sorter arrow - content.appendChild(arrowEl); - - //sort on click - colEl.addEventListener("click", function (e) { - var dir = "", - sorters = [], - match = false; - - if (column.modules.sort) { - if (column.modules.sort.tristate) { - if (column.modules.sort.dir == "none") { - dir = column.modules.sort.startingDir; - } else { - if (column.modules.sort.dir == column.modules.sort.startingDir) { - dir = column.modules.sort.dir == "asc" ? "desc" : "asc"; - } else { - dir = "none"; - } - } - } else { - switch (column.modules.sort.dir) { - case "asc": - dir = "desc"; - break; - - case "desc": - dir = "asc"; - break; - - default: - dir = column.modules.sort.startingDir; - } - } - - if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) { - sorters = self.getSort(); - - match = sorters.findIndex(function (sorter) { - return sorter.field === column.getField(); - }); - - if (match > -1) { - sorters[match].dir = dir; - - if (match != sorters.length - 1) { - match = sorters.splice(match, 1)[0]; - if (dir != "none") { - sorters.push(match); - } - } - } else { - if (dir != "none") { - sorters.push({ column: column, dir: dir }); - } - } - - //add to existing sort - self.setSort(sorters); - } else { - if (dir == "none") { - self.clear(); - } else { - //sort by column only - self.setSort(column, dir); - } - } - - self.table.rowManager.sorterRefresh(!self.sortList.length); - } - }); - } - }; - - //check if the sorters have changed since last use - Sort.prototype.hasChanged = function () { - var changed = this.changed; - this.changed = false; - return changed; - }; - - //return current sorters - Sort.prototype.getSort = function () { - var self = this, - sorters = []; - - self.sortList.forEach(function (item) { - if (item.column) { - sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir }); - } - }); - - return sorters; - }; - - //change sort list and trigger sort - Sort.prototype.setSort = function (sortList, dir) { - var self = this, - newSortList = []; - - if (!Array.isArray(sortList)) { - sortList = [{ column: sortList, dir: dir }]; - } - - sortList.forEach(function (item) { - var column; - - column = self.table.columnManager.findColumn(item.column); - - if (column) { - item.column = column; - newSortList.push(item); - self.changed = true; - } else { - console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column); - } - }); - - self.sortList = newSortList; - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.sort) { - this.table.modules.persistence.save("sort"); - } - }; - - //clear sorters - Sort.prototype.clear = function () { - this.setSort([]); - }; - - //find appropriate sorter for column - Sort.prototype.findSorter = function (column) { - var row = this.table.rowManager.activeRows[0], - sorter = "string", - field, - value; - - if (row) { - row = row.getData(); - field = column.getField(); - - if (field) { - - value = column.getFieldValue(row); - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "undefined": - sorter = "string"; - break; - - case "boolean": - sorter = "boolean"; - break; - - default: - if (!isNaN(value) && value !== "") { - sorter = "number"; - } else { - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - sorter = "alphanum"; - } - } - break; - } - } - } - - return this.sorters[sorter]; - }; - - //work through sort list sorting data - Sort.prototype.sort = function (data) { - var self = this, - sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList, - sortListActual = [], - rowComponents = [], - lastSort; - - if (self.table.options.dataSorting) { - self.table.options.dataSorting.call(self.table, self.getSort()); - } - - self.clearColumnHeaders(); - - if (!self.table.options.ajaxSorting) { - - //build list of valid sorters and trigger column specific callbacks before sort begins - sortList.forEach(function (item, i) { - var sortObj = item.column.modules.sort; - - if (item.column && sortObj) { - - //if no sorter has been defined, take a guess - if (!sortObj.sorter) { - sortObj.sorter = self.findSorter(item.column); - } - - item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params; - - sortListActual.push(item); - } - - self.setColumnHeader(item.column, item.dir); - }); - - //sort data - if (sortListActual.length) { - self._sortItems(data, sortListActual); - } - } else { - sortList.forEach(function (item, i) { - self.setColumnHeader(item.column, item.dir); - }); - } - - if (self.table.options.dataSorted) { - data.forEach(function (row) { - rowComponents.push(row.getComponent()); - }); - - self.table.options.dataSorted.call(self.table, self.getSort(), rowComponents); - } - }; - - //clear sort arrows on columns - Sort.prototype.clearColumnHeaders = function () { - this.table.columnManager.getRealColumns().forEach(function (column) { - if (column.modules.sort) { - column.modules.sort.dir = "none"; - column.getElement().setAttribute("aria-sort", "none"); - } - }); - }; - - //set the column header sort direction - Sort.prototype.setColumnHeader = function (column, dir) { - column.modules.sort.dir = dir; - column.getElement().setAttribute("aria-sort", dir); - }; - - //sort each item in sort list - Sort.prototype._sortItems = function (data, sortList) { - var _this76 = this; - - var sorterCount = sortList.length - 1; - - data.sort(function (a, b) { - var result; - - for (var i = sorterCount; i >= 0; i--) { - var sortItem = sortList[i]; - - result = _this76._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params); - - if (result !== 0) { - break; - } - } - - return result; - }); - }; - - //process individual rows for a sort function on active data - Sort.prototype._sortRow = function (a, b, column, dir, params) { - var el1Comp, el2Comp, colComp; - - //switch elements depending on search direction - var el1 = dir == "asc" ? a : b; - var el2 = dir == "asc" ? b : a; - - a = column.getFieldValue(el1.getData()); - b = column.getFieldValue(el2.getData()); - - a = typeof a !== "undefined" ? a : ""; - b = typeof b !== "undefined" ? b : ""; - - el1Comp = el1.getComponent(); - el2Comp = el2.getComponent(); - - return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params); - }; - - //default data sorters - Sort.prototype.sorters = { - - //sort numbers - number: function number(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var decimal = params.decimalSeparator || "."; - var thousand = params.thousandSeparator || ","; - var emptyAlign = 0; - - a = parseFloat(String(a).split(thousand).join("").split(decimal).join(".")); - b = parseFloat(String(b).split(thousand).join("").split(decimal).join(".")); - - //handle non numeric values - if (isNaN(a)) { - emptyAlign = isNaN(b) ? 0 : -1; - } else if (isNaN(b)) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort strings - string: function string(a, b, aRow, bRow, column, dir, params) { - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - var locale; - - //handle empty values - if (!a) { - emptyAlign = !b ? 0 : -1; - } else if (!b) { - emptyAlign = 1; - } else { - //compare valid values - switch (_typeof(params.locale)) { - case "boolean": - if (params.locale) { - locale = this.table.modules.localize.getLocale(); - } - break; - case "string": - locale = params.locale; - break; - } - - return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale); - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort date - date: function date(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "DD/MM/YYYY"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort HH:mm formatted times - time: function time(a, b, aRow, bRow, column, dir, params) { - if (!params.format) { - params.format = "HH:mm"; - } - - return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params); - }, - - //sort datetime - datetime: function datetime(a, b, aRow, bRow, column, dir, params) { - var format = params.format || "DD/MM/YYYY HH:mm:ss", - alignEmptyValues = params.alignEmptyValues, - emptyAlign = 0; - - if (typeof moment != "undefined") { - a = moment(a, format); - b = moment(b, format); - - if (!a.isValid()) { - emptyAlign = !b.isValid() ? 0 : -1; - } else if (!b.isValid()) { - emptyAlign = 1; - } else { - //compare valid values - return a - b; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } else { - console.error("Sort Error - 'datetime' sorter is dependant on moment.js"); - } - }, - - //sort booleans - boolean: function boolean(a, b, aRow, bRow, column, dir, params) { - var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0; - var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0; - - return el1 - el2; - }, - - //sort if element contains any data - array: function array(a, b, aRow, bRow, column, dir, params) { - var el1 = 0; - var el2 = 0; - var type = params.type || "length"; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - function calc(value) { - - switch (type) { - case "length": - return value.length; - break; - - case "sum": - return value.reduce(function (c, d) { - return c + d; - }); - break; - - case "max": - return Math.max.apply(null, value); - break; - - case "min": - return Math.min.apply(null, value); - break; - - case "avg": - return value.reduce(function (c, d) { - return c + d; - }) / value.length; - break; - } - } - - //handle non array values - if (!Array.isArray(a)) { - alignEmptyValues = !Array.isArray(b) ? 0 : -1; - } else if (!Array.isArray(b)) { - alignEmptyValues = 1; - } else { - - //compare valid values - el1 = a ? calc(a) : 0; - el2 = b ? calc(b) : 0; - - return el1 - el2; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - }, - - //sort if element contains any data - exists: function exists(a, b, aRow, bRow, column, dir, params) { - var el1 = typeof a == "undefined" ? 0 : 1; - var el2 = typeof b == "undefined" ? 0 : 1; - - return el1 - el2; - }, - - //sort alpha numeric strings - alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) { - var a, - b, - a1, - b1, - i = 0, - L, - rx = /(\d+)|(\D+)/g, - rd = /\d/; - var alignEmptyValues = params.alignEmptyValues; - var emptyAlign = 0; - - //handle empty values - if (!as && as !== 0) { - emptyAlign = !bs && bs !== 0 ? 0 : -1; - } else if (!bs && bs !== 0) { - emptyAlign = 1; - } else { - - if (isFinite(as) && isFinite(bs)) return as - bs; - a = String(as).toLowerCase(); - b = String(bs).toLowerCase(); - if (a === b) return 0; - if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1; - a = a.match(rx); - b = b.match(rx); - L = a.length > b.length ? b.length : a.length; - while (i < L) { - a1 = a[i]; - b1 = b[i++]; - if (a1 !== b1) { - if (isFinite(a1) && isFinite(b1)) { - if (a1.charAt(0) === "0") a1 = "." + a1; - if (b1.charAt(0) === "0") b1 = "." + b1; - return a1 - b1; - } else return a1 > b1 ? 1 : -1; - } - } - - return a.length > b.length; - } - - //fix empty values in position - if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") { - emptyAlign *= -1; - } - - return emptyAlign; - } - }; - - Tabulator.prototype.registerModule("sort", Sort); - - var Validate = function Validate(table) { - this.table = table; - this.invalidCells = []; - }; - - //validate - Validate.prototype.initializeColumn = function (column) { - var self = this, - config = [], - validator; - - if (column.definition.validator) { - - if (Array.isArray(column.definition.validator)) { - column.definition.validator.forEach(function (item) { - validator = self._extractValidator(item); - - if (validator) { - config.push(validator); - } - }); - } else { - validator = this._extractValidator(column.definition.validator); - - if (validator) { - config.push(validator); - } - } - - column.modules.validate = config.length ? config : false; - } - }; - - Validate.prototype._extractValidator = function (value) { - var type, params, pos; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case "string": - pos = value.indexOf(':'); - - if (pos > -1) { - type = value.substring(0, pos); - params = value.substring(pos + 1); - } else { - type = value; - } - - return this._buildValidator(type, params); - break; - - case "function": - return this._buildValidator(value); - break; - - case "object": - return this._buildValidator(value.type, value.parameters); - break; - } - }; - - Validate.prototype._buildValidator = function (type, params) { - - var func = typeof type == "function" ? type : this.validators[type]; - - if (!func) { - console.warn("Validator Setup Error - No matching validator found:", type); - return false; - } else { - return { - type: typeof type == "function" ? "function" : type, - func: func, - params: params - }; - } - }; - - Validate.prototype.validate = function (validators, cell, value) { - var self = this, - valid = [], - invalidIndex = this.invalidCells.indexOf(cell); - - if (validators) { - validators.forEach(function (item) { - if (!item.func.call(self, cell.getComponent(), value, item.params)) { - valid.push({ - type: item.type, - parameters: item.params - }); - } - }); - } - - valid = valid.length ? valid : true; - - if (!cell.modules.validate) { - cell.modules.validate = {}; - } - - if (valid === true) { - cell.modules.validate.invalid = false; - cell.getElement().classList.remove("tabulator-validation-fail"); - - if (invalidIndex > -1) { - this.invalidCells.splice(invalidIndex, 1); - } - } else { - cell.modules.validate.invalid = true; - - if (this.table.options.validationMode !== "manual") { - cell.getElement().classList.add("tabulator-validation-fail"); - } - - if (invalidIndex == -1) { - this.invalidCells.push(cell); - } - } - - return valid; - }; - - Validate.prototype.getInvalidCells = function () { - var output = []; - - this.invalidCells.forEach(function (cell) { - output.push(cell.getComponent()); - }); - - return output; - }; - - Validate.prototype.clearValidation = function (cell) { - var invalidIndex; - - if (cell.modules.validate && cell.modules.validate.invalid) { - - cell.element.classList.remove("tabulator-validation-fail"); - cell.modules.validate.invalid = false; - - invalidIndex = this.invalidCells.indexOf(cell); - - if (invalidIndex > -1) { - this.invalidCells.splice(invalidIndex, 1); - } - } - }; - - Validate.prototype.validators = { - - //is integer - integer: function integer(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; - }, - - //is float - float: function float(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - value = Number(value); - return typeof value === 'number' && isFinite(value) && value % 1 !== 0; - }, - - //must be a number - numeric: function numeric(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return !isNaN(value); - }, - - //must be a string - string: function string(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return isNaN(value); - }, - - //maximum value - max: function max(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) <= parameters; - }, - - //minimum value - min: function min(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return parseFloat(value) >= parameters; - }, - - //starts with value - starts: function starts(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).toLowerCase().startsWith(String(parameters).toLowerCase()); - }, - - //ends with value - ends: function ends(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).toLowerCase().endsWith(String(parameters).toLowerCase()); - }, - - //minimum string length - minLength: function minLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length >= parameters; - }, - - //maximum string length - maxLength: function maxLength(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - return String(value).length <= parameters; - }, - - //in provided value list - in: function _in(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - if (typeof parameters == "string") { - parameters = parameters.split("|"); - } - - return value === "" || parameters.indexOf(value) > -1; - }, - - //must match provided regex - regex: function regex(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var reg = new RegExp(parameters); - - return reg.test(value); - }, - - //value must be unique in this column - unique: function unique(cell, value, parameters) { - if (value === "" || value === null || typeof value === "undefined") { - return true; - } - var unique = true; - - var cellData = cell.getData(); - var column = cell.getColumn()._getSelf(); - - this.table.rowManager.rows.forEach(function (row) { - var data = row.getData(); - - if (data !== cellData) { - if (value == column.getFieldValue(data)) { - unique = false; - } - } - }); - - return unique; - }, - - //must have a value - required: function required(cell, value, parameters) { - return value !== "" && value !== null && typeof value !== "undefined"; - } - }; - - Tabulator.prototype.registerModule("validate", Validate); - - return Tabulator; -}); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/tabulator.min.js b/app/static/vendors/tabulator/js/tabulator.min.js deleted file mode 100644 index 74f4780..0000000 --- a/app/static/vendors/tabulator/js/tabulator.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tabulator=t()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if(0===i)return!1;for(var n=0|t,s=Math.max(n>=0?n:i-Math.abs(n),0);so?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){t=e[0];for(var n in t){var s={field:n,title:n},r=t[n];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),e.forEach(function(e,t){o._addColumn(e)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var i=new n(e,this),s=i.getElement(),r=o?this.findColumnIndex(o):o;if(o&&r>-1){var a=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(a,0,i),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,i),l.parentNode.insertBefore(s,l.nextSibling))}else t?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},t.prototype.registerColumnField=function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach(function(e){var o;e.clearVerticalAlign(),(o=e.getHeight())>t&&(t=o)}),e.columns.forEach(function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)}),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e)))return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.columns.find(function(t){return t.element===e})||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===e&&o.push(t.columnsByField[i])}),o},t.prototype.getColumnByIndex=function(e){return this.columnsByIndex[e]},t.prototype.getFirstVisibileColumn=function(e){var e=this.columnsByIndex.findIndex(function(e){return e.visible});return e>-1&&this.columnsByIndex[e]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(e){return this.columnsByIndex.findIndex(function(t){return e===t})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(e){this.columnsByIndex.forEach(function(t,o){e(t,o)})},t.prototype.getDefinitions=function(e){var t=this,o=[];return t.columnsByIndex.forEach(function(t){(!e||e&&t.visible)&&o.push(t.getDefinition())}),o},t.prototype.getDefinitionTree=function(){var e=this,t=[];return e.columns.forEach(function(e){t.push(e.getDefinition(!0))}),t},t.prototype.getComponents=function(e){var t=this,o=[];return(e?t.columns:t.columnsByIndex).forEach(function(e){o.push(e.getComponent())}),o},t.prototype.getWidth=function(){var e=0;return this.columnsByIndex.forEach(function(t){t.visible&&(e+=t.getWidth())}),e},t.prototype.moveColumn=function(e,t,o){this.moveColumnActual(e,t,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t.element.parentNode.insertBefore(e.element,t.element),o&&t.element.parentNode.insertBefore(t.element,e.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.moveColumnActual=function(e,t,o){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,o):this._moveColumnInArray(this.columns,e,t,o),this._moveColumnInArray(this.columnsByIndex,e,t,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,e.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},t.prototype._moveColumnInArray=function(e,t,o,i,n){var s,r=e.indexOf(t);r>-1&&(e.splice(r,1),s=e.indexOf(o),s>-1?i&&(s+=1):s=r,e.splice(s,0,t),n&&this.table.rowManager.rows.forEach(function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(s,0,t)}}))},t.prototype.scrollToColumn=function(e,t,o){var i=this,n=0,s=0,r=0,a=e.getElement();return new Promise(function(l,c){if(void 0===t&&(t=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-i.element.clientWidth/2;break;case"right":r=a.clientWidth-i.headersElement.clientWidth}if(!o&&(s=a.offsetLeft)>0&&s+a.offsetWidthe.rowManager.element.clientHeight&&(t-=e.rowManager.element.offsetWidth-e.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,r;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?e.table.options.columnMinWidth:parseInt(i.minWidth),r="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,o+=r>s?r:s)}),o},t.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i._addColumn(e,t,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&r.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(r)})},t.prototype.deregisterColumn=function(e){var t,o=e.getField();o&&delete this.columnsByField[o],t=this.columnsByIndex.indexOf(e),t>-1&&this.columnsByIndex.splice(t,1),t=this.columns.indexOf(e),t>-1&&this.columns.splice(t,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(e){e&&(d.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():e?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var o=function(e){this._column=e,this.type="ColumnComponent"};o.prototype.getElement=function(){return this._column.getElement()},o.prototype.getDefinition=function(){return this._column.getDefinition()},o.prototype.getField=function(){return this._column.getField()},o.prototype.getCells=function(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e},o.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},o.prototype.isVisible=function(){return this._column.visible},o.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()},o.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()},o.prototype.toggle=function(){this._column.visible?this.hide():this.show()},o.prototype.delete=function(){return this._column.delete()},o.prototype.getSubColumns=function(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e},o.prototype.getParentColumn=function(){return this._column.parent instanceof n&&this._column.parent.getComponent()},o.prototype._getSelf=function(){return this._column},o.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},o.prototype.getTable=function(){return this._column.table},o.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},o.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},o.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},o.prototype.setHeaderFilterValue=function(e){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,e)},o.prototype.move=function(e,t){var o=this._column.table.columnManager.findColumn(e);o?this._column.table.columnManager.moveColumn(this._column,o,t):console.warn("Move Error - No matching column found:",o)},o.prototype.getNextColumn=function(){var e=this._column.nextColumn();return!!e&&e.getComponent()},o.prototype.getPrevColumn=function(){var e=this._column.prevColumn();return!!e&&e.getComponent()},o.prototype.updateDefinition=function(e){return this._column.updateDefinition(e)},o.prototype.getWidth=function(){return this._column.getWidth()},o.prototype.setWidth=function(e){return!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e)},o.prototype.validate=function(){return this._column.validate()};var n=function e(t,o){var i=this;this.table=o.table,this.definition=t,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),t.columns?(this.isGroup=!0,t.columns.forEach(function(t,o){var n=new e(t,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),t.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};n.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e},n.prototype.createGroupElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e},n.prototype.checkDefinition=function(){var e=this;Object.keys(this.definition).forEach(function(t){-1===e.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)})},n.prototype.setField=function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},n.prototype.registerColumnPosition=function(e){this.parent.registerColumnPosition(e)},n.prototype.registerColumnField=function(e){this.parent.registerColumnField(e)},n.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)},n.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),void 0!==this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},n.prototype.setTooltip=function(){var e=this,t=e.definition,o=t.headerTooltip||!1===t.tooltip?t.headerTooltip:e.table.options.tooltipsHeader;o?!0===o?t.field?e.table.modules.localize.bind("columns|"+t.field,function(o){e.element.setAttribute("title",o||t.title)}):e.element.setAttribute("title",t.title):("function"==typeof o&&!1===(o=o(e.getComponent()))&&(o=""),e.element.setAttribute("title",o)):e.element.setAttribute("title","")},n.prototype._buildHeader=function(){for(var e=this,t=e.definition;e.element.firstChild;)e.element.removeChild(e.element.firstChild);t.headerVertical&&(e.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&e.element.classList.add("tabulator-col-vertical-flip")),e.contentElement=e._bindEvents(),e.contentElement=e._buildColumnHeaderContent(),e.element.appendChild(e.contentElement),e.isGroup?e._buildGroupHeader():e._buildColumnHeader(),e.setTooltip(),e.table.options.resizableColumns&&e.table.modExists("resizeColumns")&&e.table.modules.resizeColumns.initializeColumn("header",e,e.element),t.headerFilter&&e.table.modExists("filter")&&e.table.modExists("edit")&&(void 0!==t.headerFilterPlaceholder&&t.field&&e.table.modules.localize.setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),e.table.modules.filter.initializeColumn(e)),e.table.modExists("frozenColumns")&&e.table.modules.frozenColumns.initializeColumn(e),e.table.options.movableColumns&&!e.isGroup&&e.table.modExists("moveColumn")&&e.table.modules.moveColumn.initializeColumn(e),(t.topCalc||t.bottomCalc)&&e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.initializeColumn(e),e.table.modExists("persistence")&&e.table.modules.persistence.config.columns&&e.table.modules.persistence.initializeColumn(e),e.element.addEventListener("mouseenter",function(t){e.setTooltip()})},n.prototype._bindEvents=function(){var e,t,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(e){n.headerClick(e,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(e){n.headerDblClick(e,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(e){n.headerContext(e,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&n.headerTap(e,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,n.headerDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),"function"==typeof n.headerTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,n.headerTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},n.prototype._buildColumnHeader=function(){var e=this,t=e.definition,o=e.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(e,e.contentElement),(t.headerContextMenu||t.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(e),o.modExists("format")&&o.modules.format.initializeColumn(e),void 0!==t.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(e),void 0!==t.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(e),o.modExists("mutator")&&o.modules.mutator.initializeColumn(e),o.modExists("accessor")&&o.modules.accessor.initializeColumn(e),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(e),void 0!==t.visible&&(t.visible?e.show(!0):e.hide(!0)),t.cssClass){t.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}t.field&&this.element.setAttribute("tabulator-field",t.field),e.setMinWidth(void 0===t.minWidth?e.table.options.columnMinWidth:parseInt(t.minWidth)),e.reinitializeWidth(),e.tooltip=e.definition.tooltip||!1===e.definition.tooltip?e.definition.tooltip:e.table.options.tooltips,e.hozAlign=void 0===e.definition.hozAlign?e.table.options.cellHozAlign:e.definition.hozAlign,e.vertAlign=void 0===e.definition.vertAlign?e.table.options.cellVertAlign:e.definition.vertAlign},n.prototype._buildColumnHeaderContent=function(){var e=(this.definition,this.table,document.createElement("div"));return e.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),e.appendChild(this.titleElement),e},n.prototype._buildColumnHeaderTitle=function(){var e=this,t=e.definition,o=e.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(e){e.stopPropagation(),n.focus()}),n.addEventListener("change",function(){t.title=n.value,o.options.columnTitleChanged.call(e.table,e.getComponent())}),i.appendChild(n),t.field?o.modules.localize.bind("columns|"+t.field,function(e){n.value=e||t.title||" "}):n.value=t.title||" "}else t.field?o.modules.localize.bind("columns|"+t.field,function(o){e._formatColumnHeaderTitle(i,o||t.title||" ")}):e._formatColumnHeaderTitle(i,t.title||" ");return i},n.prototype._formatColumnHeaderTitle=function(e,t){var o,i,n,s,r,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),r=function(e){a.titleFormatterRendered=e},s={getValue:function(){return t},getElement:function(){return e}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,s,n,r),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":e.innerHTML="";break;default:e.innerHTML=i}else e.innerHTML=t},n.prototype._buildGroupHeader=function(){var e=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){this.definition.cssClass.split(" ").forEach(function(t){e.element.classList.add(t)})}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.element.appendChild(this.groupElement)},n.prototype._getFlatData=function(e){return e[this.field]},n.prototype._getNestedData=function(e){for(var t,o=e,i=this.fieldStructure,n=i.length,s=0;s-1&&this._nextVisibleColumn(e+1)},n.prototype._nextVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)},n.prototype.prevColumn=function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)},n.prototype._prevVisibleColumn=function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)},n.prototype.reinitializeWidth=function(e){this.widthFixed=!1, -void 0===this.definition.width||e||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},n.prototype.fitToData=function(){var e=this;this.widthFixed||(this.element.style.width="",e.cells.forEach(function(e){e.clearWidth()}));var t=this.element.offsetWidth;e.width&&this.widthFixed||(e.cells.forEach(function(e){var o=e.getWidth();o>t&&(t=o)}),t&&e.setWidthActual(t+1))},n.prototype.updateDefinition=function(e){var t=this;return new Promise(function(o,i){var n;t.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},t.getDefinition()),n=Object.assign(n,e),t.table.columnManager.addColumn(n,!1,t).then(function(e){n.field==t.field&&(t.field=!1),t.delete().then(function(){o(e.getComponent())}).catch(function(e){i(e)})}).catch(function(e){i(e)}))})},n.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},n.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],n.prototype.getComponent=function(){return this.component||(this.component=new o(this)),this.component};var s=function(e){this.table=e,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};s.prototype.createHolderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},s.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},s.prototype.getElement=function(){return this.element},s.prototype.getTableElement=function(){return this.tableElement},s.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},s.prototype.setColumnManager=function(e){this.columnManager=e},s.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t}),"virtual"===this.renderMode&&e.element.addEventListener("scroll",function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t})},s.prototype.findRow=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e))){if(void 0===e||null===e)return!1;return t.rows.find(function(o){return o.data[t.table.options.index]==e})||!1}if(e instanceof a)return e;if(e instanceof r)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.rows.find(function(t){return t.element===e})||!1}return!1},s.prototype.getRowFromDataObject=function(e){return this.rows.find(function(t){return t.data===e})||!1},s.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},s.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),r=e.getElement(),a=0;return new Promise(function(e,l){if(s>-1){if(void 0===t&&(t=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=d.prototype.helpers.elOffset(r).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":t=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&d.prototype.helpers.elVisible(r)&&(a=d.prototype.helpers.elOffset(r).top-d.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(t){var o=t.indexOf(e);o>-1&&t.splice(o,1)}),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,e.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},s.prototype.addRow=function(e,t,o,i){var n=this.addRowActual(e,t,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:e,pos:t,index:o}),n},s.prototype.addRows=function(e,t,o){var i=this,n=this,s=0,r=[];return new Promise(function(a,l){t=i.findAddRowPos(t),Array.isArray(e)||(e=[e]),s=e.length-1,(void 0===o&&t||void 0!==o&&!t)&&e.reverse(),e.forEach(function(e,i){var s=n.addRow(e,t,o,!0);r.push(s)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(r)})},s.prototype.findAddRowPos=function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e},s.prototype.addRowActual=function(e,t,o,i){var n,s,r=e instanceof a?e:new a(e||{},this),l=this.findAddRowPos(t),c=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),l?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],l=!1):s.length&&(o=s[s.length-1],l=!(s.length1&&(!o||o&&-1==u.indexOf(o)?l?u[0]!==r&&(o=u[0],this._moveRowInArray(r.getGroup().rows,r,o,!l)):u[u.length-1]!==r&&(o=u[u.length-1],this._moveRowInArray(r.getGroup().rows,r,o,!l)):this._moveRowInArray(r.getGroup().rows,r,o,!l))}return o&&(c=this.rows.indexOf(o)),o&&c>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(e){var t=e.indexOf(o);t>-1&&e.splice(l?t:t+1,0,r)}),n>-1&&this.activeRows.splice(l?n:n+1,0,r),this.rows.splice(l?c:c+1,0,r)):l?(this.displayRowIterator(function(e){e.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator(function(e){e.push(r)}),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,r.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),r},s.prototype.moveRow=function(e,t,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",e,{posFrom:this.getRowPosition(e),posTo:this.getRowPosition(t),to:t,after:o}),this.moveRowActual(e,t,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,e.getComponent())},s.prototype.moveRowActual=function(e,t,o){var i=this;if(this._moveRowInArray(this.rows,e,t,o),this._moveRowInArray(this.activeRows,e,t,o),this.displayRowIterator(function(n){i._moveRowInArray(n,e,t,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&t instanceof S&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t.getGroup(),s=e.getGroup();n===s?this._moveRowInArray(n.rows,e,t,o):(s&&s.removeRow(e),n.insertRow(e,t,o))}},s.prototype._moveRowInArray=function(e,t,o,i){var n,s,r,a;if(t!==o&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),s=e.indexOf(o),s>-1?i?e.splice(s+1,0,t):e.splice(s,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){r=nn?s:n+1;for(var l=r;l<=a;l++)e[l]&&this.styleRow(e[l],l)}},s.prototype.clearData=function(){this.setData([])},s.prototype.getRowIndex=function(e){return this.findRowIndex(e,this.rows)},s.prototype.getDisplayRowIndex=function(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t},s.prototype.nextDisplayRow=function(e,t){var o=this.getDisplayRowIndex(e),i=!1;return!1!==o&&o-1)&&o},s.prototype.getData=function(e,t){var o=[];return this.getRows(e).forEach(function(e){"row"==e.type&&o.push(e.getData(t||"data"))}),o},s.prototype.getComponents=function(e){var t=[];return this.getRows(e).forEach(function(e){t.push(e.getComponent())}),t},s.prototype.getDataCount=function(e){return this.getRows(e).length},s.prototype._genRemoteRequest=function(){var e=this,t=this.table,o=t.options,i={};if(t.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(e){delete e.column}),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=s}this.table.modules.ajax.setParams(i,!0)}t.modules.ajax.sendRequest().then(function(t){e._setDataActual(t,!0)}).catch(function(e){})},s.prototype.filterRefresh=function(){var e=this.table,t=e.options,o=this.scrollLeft;t.ajaxFiltering?"remote"==t.pagination&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):t.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},s.prototype.sorterRefresh=function(e){var t=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(e?"filter":"sort"),this.scrollHorizontal(i)},s.prototype.scrollHorizontal=function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(e),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(e)},s.prototype.refreshActiveData=function(e,t,o){var i,n=this,s=this.table,r=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||r.indexOf(e)=0))break;s=a}else if(t-r[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-r[a].getElement().offsetTop>=0))break;s=a}}else n=this.vDomTop,s=this.vDomBottom;return r.slice(n,s+1)},s.prototype.displayRowIterator=function(e){this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},s.prototype.getRows=function(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!0);break;default:t=this.rows}return t},s.prototype.reRenderInPosition=function(e){if("virtual"==this.getRenderMode())if(this.redrawBlock)e?e():this.redrawBlockRederInPosition=!0;else{for(var t=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,s=this.getDisplayRows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r]){var a=t-s[r].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*g),"group"!==f.type&&(u=!1),i.vDomBottom++,c++}e?(i.vDomTopPad=t?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-l,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-l,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+l)/c),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=l+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",t&&(this.scrollTop=i.vDomTopPad+l+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&t&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,n.style.minWidth=u?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},s.prototype.scrollVertical=function(e){var t=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-t>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else e?(t<0&&this._addTopRow(-t),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(t>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(t):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},s.prototype._addTopRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,s=i[n],r=s.getHeight()||this.vDomRowHeight;e>=r&&(this.styleRow(s,n),o.insertBefore(s.getElement(),o.firstChild),s.initialized&&s.heightInitialized||(this.vDomTopNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomTopPad-=r,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r,this.vDomTop--),e=-(this.scrollTop-this.vDomScrollPosTop),s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(e,t+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},s.prototype._removeTopRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,t.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,e=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(e)}},s.prototype._addBottomRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=r&&(this.styleRow(s,n),o.appendChild(s.getElement()),s.initialized&&s.heightInitialized||(this.vDomBottomNewRows.push(s),s.heightInitialized||s.clearCellHeight()),s.initialize(),this.vDomBottomPad-=r,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r,this.vDomBottom++),e=this.scrollTop-this.vDomScrollPosBottom,s.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*s.getHeight()),t=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(e,t+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},s.prototype._removeBottomRow=function(e){var t=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(e>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),t.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,e=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(e)}},s.prototype._quickNormalizeRowHeight=function(e){e.forEach(function(e){e.calcHeight()}),e.forEach(function(e){e.setCellHeight()}),e.length=0},s.prototype.normalizeHeight=function(){this.activeRows.forEach(function(e){e.normalizeHeight()})},s.prototype.adjustTableSize=function(){var e,t=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,this.fixedHeight||t==this.element.clientHeight||((e=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!e)&&this.redraw()}},s.prototype.reinitialize=function(){this.rows.forEach(function(e){e.reinitialize()})},s.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},s.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1},s.prototype.redraw=function(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(t)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},s.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))};var r=function(e){this._row=e};r.prototype.getData=function(e){return this._row.getData(e)},r.prototype.getElement=function(){return this._row.getElement()},r.prototype.getCells=function(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e},r.prototype.getCell=function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()},r.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},r.prototype.getPosition=function(e){return this._row.table.rowManager.getRowPosition(this._row,e)},r.prototype.delete=function(){return this._row.delete()},r.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},r.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},r.prototype.move=function(e,t){this._row.moveToRow(e,t)},r.prototype.update=function(e){return this._row.updateData(e)}, -r.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},r.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},r.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},r.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},r.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},r.prototype._getSelf=function(){return this._row},r.prototype.validate=function(){return this._row.validate()},r.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},r.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},r.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){return this._row.table.modules.frozenRows.rows.indexOf(this._row)>-1}return!1},r.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},r.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},r.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},r.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},r.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},r.prototype.addTreeChild=function(e,t,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,e,t,o)},r.prototype.reformat=function(){return this._row.reinitialize()},r.prototype.getGroup=function(){return this._row.getGroup().getComponent()},r.prototype.getTable=function(){return this._row.table},r.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},r.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var a=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.setData(e),this.generateElement()};a.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},a.prototype.getElement=function(){return this.element},a.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},a.prototype.generateElement=function(){var e,t,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(e){i.table.options.rowClick(e,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(e){i.table.options.rowDblClick(e,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(e){i.table.options.rowContext(e,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(e){i.table.options.rowMouseEnter(e,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(e){i.table.options.rowMouseLeave(e,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(e){i.table.options.rowMouseOver(e,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(e){i.table.options.rowMouseOut(e,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(e){i.table.options.rowMouseMove(e,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null}))},a.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},a.prototype.initialize=function(e){var t=this;if(!t.initialized||e){for(t.deleteCells();t.element.firstChild;)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach(function(e){t.element.appendChild(e.getElement()),e.cellRendered()}),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},a.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},a.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},a.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=e?Math.max(t,o):this.manualHeight?this.height:Math.max(t,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},a.prototype.setCellHeight=function(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0},a.prototype.clearCellHeight=function(){this.cells.forEach(function(e){e.clearHeight()})},a.prototype.normalizeHeight=function(e){e&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()},a.prototype.setHeight=function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},a.prototype.getHeight=function(){return this.outerHeight},a.prototype.getWidth=function(){return this.element.offsetWidth},a.prototype.deleteCell=function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)},a.prototype.setData=function(e){this.table.modExists("mutator")&&(e=this.table.modules.mutator.transformRow(e,"data")),this.data=e,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},a.prototype.updateData=function(e){var t,o=this,i=d.prototype.helpers.elVisible(this.element),n={};return new Promise(function(s,r){"string"==typeof e&&(e=JSON.parse(e)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,e),t=o.table.modules.mutator.transformRow(n,"data",e)):t=e;for(var a in t)o.data[a]=t[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in e){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(e){var n=o.getCell(e.getField());if(n){var s=e.getFieldValue(t);n.getValue()!=s&&(n.setValueProcessData(s),i&&n.cellRendered())}})}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(e)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),s()})},a.prototype.getData=function(e){var t=this;return e?t.table.modExists("accessor")?t.table.modules.accessor.transformRow(t.data,e):void 0:this.data},a.prototype.getCell=function(e){return e=this.table.columnManager.findColumn(e),this.cells.find(function(t){return t.column===e})},a.prototype.getCellIndex=function(e){return this.cells.findIndex(function(t){return t===e})},a.prototype.findNextEditableCell=function(e){var t=!1;if(e0)for(var o=e-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&d.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){t=i;break}}return t},a.prototype.getCells=function(){return this.cells},a.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},a.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},a.prototype.moveToRow=function(e,t){var o=this.table.rowManager.findRow(e);o?(this.table.rowManager.moveRowActual(this,o,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)},a.prototype.validate=function(){var e=[];return this.cells.forEach(function(t){t.validate()||e.push(t.getComponent())}),!e.length||e},a.prototype.delete=function(){var e=this;return new Promise(function(t,o){var i,n;e.table.options.history&&e.table.modExists("history")&&(e.table.options.groupBy&&e.table.modExists("groupRows")?(n=e.getGroup().rows,(i=n.indexOf(e))&&(i=n[i-1])):(i=e.table.rowManager.getRowIndex(e))&&(i=e.table.rowManager.rows[i-1]),e.table.modules.history.action("rowDelete",e,{data:e.getData(),pos:!i,index:i})),e.deleteActual(),t()})},a.prototype.deleteActual=function(e){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.rowDelete(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},a.prototype.deleteCells=function(){for(var e=this.cells.length,t=0;t-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))},d.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},d.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},d.prototype.setDataFromLocalFile=function(e){var t=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=e||".json,application/json",n.addEventListener("change",function(e){var s,r=n.files[0],a=new FileReader;a.readAsText(r),a.onload=function(e){try{s=JSON.parse(a.result)}catch(e){return console.warn("File Load Error - File contents is invalid JSON",e),void i(e)}t._setData(s).then(function(e){o(e)}).catch(function(e){o(e)})},a.onerror=function(e){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},d.prototype.setData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!1,!0)},d.prototype._setData=function(e,t,o,i,n){var s=this;return"string"!=typeof e?e?s.rowManager.setData(e,i,n):s.modExists("ajax")&&(s.modules.ajax.getUrl||s.options.ajaxURLGenerator)?"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n):s.rowManager.setData([],i,n):0==e.indexOf("{")||0==e.indexOf("[")?s.rowManager.setData(JSON.parse(e),i,n):s.modExists("ajax",!0)?(t&&s.modules.ajax.setParams(t),o&&s.modules.ajax.setConfig(o),s.modules.ajax.setUrl(e),"remote"==s.options.pagination&&s.modExists("page",!0)?(s.modules.page.reset(!0,!0),s.modules.page.setPage(1)):s.modules.ajax.loadData(i,n)):void 0},d.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},d.prototype.getData=function(e){return!0===e&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getData(e)},d.prototype.getDataCount=function(e){return!0===e&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getDataCount(e)},d.prototype.searchRows=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",e,t,o)},d.prototype.searchData=function(e,t,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",e,t,o)},d.prototype.getHtml=function(e,t,o){if(this.modExists("export",!0))return this.modules.export.getHtml(e,t,o)},d.prototype.print=function(e,t,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(e,t,o)},d.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},d.prototype.replaceData=function(e,t,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(e,t,o,!0)},d.prototype.updateData=function(e){var t=this,o=this,i=0;return new Promise(function(n,s){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);t&&(i++,t.updateData(e).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.addData=function(e,t,o){var i=this;return new Promise(function(n,s){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?i.rowManager.addRows(e,t,o).then(function(e){var t=[];e.forEach(function(e){t.push(e.getComponent())}),n(t)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},d.prototype.updateOrAddData=function(e){var t=this,o=this,i=[],n=0;return new Promise(function(s,r){t.modExists("ajax")&&t.modules.ajax.blockActiveRequest(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach(function(e){var t=o.rowManager.findRow(e[o.options.index]);n++,t?t.updateData(e).then(function(){n--,i.push(t.getComponent()),n||s(i)}):o.rowManager.addRows(e).then(function(e){n--,i.push(e[0].getComponent()),n||s(i)})}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},d.prototype.getRow=function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.getRowFromPosition=function(e,t){var o=this.rowManager.getRowFromPosition(e,t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",e),!1)},d.prototype.deleteRow=function(e){var t=this;return new Promise(function(o,i){function n(){++r==e.length&&a&&(s.rowManager.reRenderInPosition(),o())}var s=t,r=0,a=0,l=[];Array.isArray(e)||(e=[e]),e.forEach(function(e){var o=t.rowManager.findRow(e,!0);o?l.push(o):(console.warn("Delete Error - No matching row found:",e),i("Delete Error - No matching row found"),n())}),l.sort(function(e,o){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(o)?1:-1}),l.forEach(function(e){e.delete().then(function(){a++,n()}).catch(function(e){n(),i(e)})})})},d.prototype.addRow=function(e,t,o){var i=this;return new Promise(function(n,s){"string"==typeof e&&(e=JSON.parse(e)),i.rowManager.addRows(e,t,o).then(function(e){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(e[0].getComponent())})})},d.prototype.updateOrAddRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(s.getComponent())}).catch(function(e){n(e)}):s=o.rowManager.addRows(t).then(function(e){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(e[0].getComponent())}).catch(function(e){n(e)})})},d.prototype.updateRow=function(e,t){var o=this;return new Promise(function(i,n){var s=o.rowManager.findRow(e);"string"==typeof t&&(t=JSON.parse(t)),s?s.updateData(t).then(function(){i(s.getComponent())}).catch(function(e){n(e)}):(console.warn("Update Error - No matching row found:",e),n("Update Error - No matching row found"))})},d.prototype.scrollToRow=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.rowManager.findRow(e);r?i.rowManager.scrollToRow(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching row found:",e),s("Scroll Error - No matching row found"))})},d.prototype.moveRow=function(e,t,o){var i=this.rowManager.findRow(e);i?i.moveToRow(t,o):console.warn("Move Error - No matching row found:",e)},d.prototype.getRows=function(e){return!0===e&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),e="active"),this.rowManager.getComponents(e)},d.prototype.getRowPosition=function(e,t){var o=this.rowManager.findRow(e);return o?this.rowManager.getRowPosition(o,t):(console.warn("Position Error - No matching row found:",e),!1)},d.prototype.copyToClipboard=function(e){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(e)},d.prototype.setColumns=function(e){this.columnManager.setColumns(e)},d.prototype.getColumns=function(e){return this.columnManager.getComponents(e)},d.prototype.getColumn=function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)},d.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},d.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},d.prototype.setColumnLayout=function(e){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,e)),!0)},d.prototype.showColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.hideColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},d.prototype.toggleColumn=function(e){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()},d.prototype.addColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(o);i.columnManager.addColumn(e,t,r).then(function(e){n(e.getComponent())}).catch(function(e){s(e)})})},d.prototype.deleteColumn=function(e){var t=this;return new Promise(function(o,i){var n=t.columnManager.findColumn(e);n?n.delete().then(function(){o()}).catch(function(e){i(e)}):(console.warn("Column Delete Error - No matching column found:",e),i())})},d.prototype.updateColumnDefinition=function(e,t){var o=this;return new Promise(function(i,n){var s=o.columnManager.findColumn(e);s?s.updateDefinition(t).then(function(e){i(e)}).catch(function(e){n(e)}):(console.warn("Column Update Error - No matching column found:",e),n())})},d.prototype.moveColumn=function(e,t,o){var i=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)},d.prototype.scrollToColumn=function(e,t,o){var i=this;return new Promise(function(n,s){var r=i.columnManager.findColumn(e);r?i.columnManager.scrollToColumn(r,t,o).then(function(){n()}).catch(function(e){s(e)}):(console.warn("Scroll Error - No matching column found:",e),s("Scroll Error - No matching column found"))})},d.prototype.setLocale=function(e){this.modules.localize.setLocale(e)},d.prototype.getLocale=function(){return this.modules.localize.getLocale()},d.prototype.getLang=function(e){return this.modules.localize.getLang(e)},d.prototype.redraw=function(e){this.columnManager.redraw(e),this.rowManager.redraw(e)},d.prototype.setHeight=function(e){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")},d.prototype.setSort=function(e,t){this.modExists("sort",!0)&&(this.modules.sort.setSort(e,t),this.rowManager.sorterRefresh())},d.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},d.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},d.prototype.setFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.addFilter=function(e,t,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(e,t,o,i),this.rowManager.filterRefresh())},d.prototype.getFilters=function(e){if(this.modExists("filter",!0))return this.modules.filter.getFilters(e)},d.prototype.setHeaderFilterFocus=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterFocus(t)}},d.prototype.getHeaderFilterValue=function(e){if(this.modExists("filter",!0)){var t=this.columnManager.findColumn(e);if(t)return this.modules.filter.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},d.prototype.setHeaderFilterValue=function(e,t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(e);if(!o)return console.warn("Column Filter Error - No matching column found:",e),!1;this.modules.filter.setHeaderFilterValue(o,t)}},d.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},d.prototype.removeFilter=function(e,t,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(e,t,o),this.rowManager.filterRefresh())},d.prototype.clearFilter=function(e){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(e),this.rowManager.filterRefresh())},d.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},d.prototype.selectRow=function(e){this.modExists("selectRow",!0)&&(!0===e&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),e="active"),this.modules.selectRow.selectRows(e))},d.prototype.deselectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(e)},d.prototype.toggleSelectRow=function(e){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(e)},d.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},d.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},d.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},d.prototype.clearCellValidation=function(e){var t=this;this.modExists("validate",!0)&&(e||(e=this.modules.validate.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.validate.clearValidation(e._getSelf())}))},d.prototype.validate=function(e){var t=[];return this.rowManager.rows.forEach(function(e){var o=e.validate();!0!==o&&(t=t.concat(o))}),!t.length||t},d.prototype.setMaxPage=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(e)},d.prototype.setPage=function(e){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(e):new Promise(function(e,t){t()})},d.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){t.options.pagination&&t.modExists("page")?(e=t.rowManager.findRow(e),e?t.modules.page.setPageToRow(e).then(function(){o()}).catch(function(){i()}):i()):i()})},d.prototype.setPageSize=function(e){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(e),this.modules.page.setPage(1).then(function(){}).catch(function(){})},d.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},d.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},d.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},d.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},d.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},d.prototype.setGroupBy=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=e,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},d.prototype.setGroupStartOpen=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=e,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},d.prototype.setGroupHeader=function(e){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=e,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},d.prototype.getGroups=function(e){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},d.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},d.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},d.prototype.clearCellEdited=function(e){var t=this;this.modExists("edit",!0)&&(e||(e=this.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(function(e){t.modules.edit.clearEdited(e._getSelf())}))},d.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},d.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},d.prototype.navigatePrev=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().prev()},d.prototype.navigateNext=function(){var e=!1;return!(!this.modExists("edit",!0)||!(e=this.modules.edit.currentCell))&&e.nav().next()},d.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},d.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},d.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},d.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},d.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},d.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},d.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},d.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},d.prototype.download=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i)},d.prototype.downloadToTab=function(e,t,o,i){this.modExists("download",!0)&&this.modules.download.download(e,t,o,i,!0)},d.prototype.tableComms=function(e,t,o,i){this.modules.comms.receive(e,t,o,i)},d.prototype.moduleBindings={},d.prototype.extendModule=function(e,t,o){if(d.prototype.moduleBindings[e]){var i=d.prototype.moduleBindings[e].prototype[t];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)},d.prototype.registerModule=function(e,t){d.prototype.moduleBindings[e]=t},d.prototype.bindModules=function(){this.modules={};for(var e in d.prototype.moduleBindings)this.modules[e]=new d.prototype.moduleBindings[e](this)},d.prototype.modExists=function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)},d.prototype.helpers={elVisible:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)},elOffset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(e){var t=Array.isArray(e)?[]:{};for(var o in e)null!=e[o]&&"object"===_typeof(e[o])?e[o]instanceof Date?t[o]=new Date(e[o]):t[o]=this.deepClone(e[o]):t[o]=e[o];return t}},d.prototype.comms={tables:[],register:function(e){d.prototype.comms.tables.push(e)},deregister:function(e){var t=d.prototype.comms.tables.indexOf(e);t>-1&&d.prototype.comms.tables.splice(t,1)},lookupTable:function(e,t){var o,i,n=[];if("string"==typeof e){if(o=document.querySelectorAll(e),o.length)for(var s=0;s0?s.setWidth(n):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){function t(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function o(e,i,n,s){function r(e){return n*(e.column.definition.widthGrow||1)}function a(e){return t(e.width)-n*(e.column.definition.widthShrink||0)}var l=[],c=0,u=0,d=0,h=0,p=0,m=[];return e.forEach(function(e,t){var o=s?a(e):r(e);e.column.minWidth>=o?l.push(e):(m.push(e),p+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)}),l.length?(l.forEach(function(e){c+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth}),u=i-c,d=p?Math.floor(u/p):u,h=u-d*p,h+=o(m,u,d,s)):(h=p?i-Math.floor(i/p)*p:i,m.forEach(function(e){e.width=s?a(e):r(e)})),h}var i=this,n=i.table.element.clientWidth,s=0,r=0,a=0,l=0,c=[],u=[],d=0,h=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach(function(e){var o,i,n;e.visible&&(o=e.definition.width,i=parseInt(e.minWidth),o?(n=t(o),s+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),d+=e.definition.widthShrink)):(c.push({column:e,width:0}),a+=e.definition.widthGrow||1))}),r=n-s,l=Math.floor(r/a);var p=o(c,r,l,!1);c.length&&p>0&&(c[c.length-1].width+=+p),c.forEach(function(e){r-=e.width}),h=Math.abs(p)+r,h>0&&d&&(p=o(u,h,Math.floor(h/d),!0)),u.length&&(u[u.length-1].width-=p),c.forEach(function(e){e.column.setWidth(e.width)}),u.forEach(function(e){e.column.setWidth(e.width)})}},d.prototype.registerModule("layout",h);var p=function(e){this.table=e,this.locale="default",this.lang=!1,this.bindings={}};p.prototype.setHeaderFilterPlaceholder=function(e){this.langs.default.headerFilters.default=e},p.prototype.setHeaderFilterColumnPlaceholder=function(e,t){this.langs.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)},p.prototype.installLang=function(e,t){this.langs[e]?this._setLangProp(this.langs[e],t):this.langs[e]=t},p.prototype._setLangProp=function(e,t){for(var o in t)e[o]&&"object"==_typeof(e[o])?this._setLangProp(e[o],t[o]):e[o]=t[o]},p.prototype.setLocale=function(e){function t(e,o){for(var i in e)"object"==_typeof(e[i])?(o[i]||(o[i]={}),t(e[i],o[i])):o[i]=e[i]}var o=this;if(e=e||"default",!0===e&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!o.langs[e]){var i=e.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}o.locale=e,o.lang=d.prototype.helpers.deepClone(o.langs.default||{}),"default"!=e&&t(o.langs[e],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},p.prototype.getLocale=function(e){return self.locale},p.prototype.getLang=function(e){return e?this.langs[e]:this.lang},p.prototype.getText=function(e,t){var e=t?e+"|"+t:e,o=e.split("|");return this._getLangElement(o,this.locale)||""},p.prototype._getLangElement=function(e,t){var o=this,i=o.lang;return e.forEach(function(e){var t;i&&(t=i[e],i=void 0!==t&&t)}),i},p.prototype.bind=function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)},p.prototype._executeBindings=function(){var e=this;for(var t in e.bindings)!function(t){e.bindings[t].forEach(function(o){o(e.getText(t),e.lang)})}(t)},p.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All"},headerFilters:{default:"filter column...",columns:{}}}},d.prototype.registerModule("localize",p);var m=function(e){this.table=e};m.prototype.getConnections=function(e){var t,o=this,i=[];return t=d.prototype.comms.lookupTable(e),t.forEach(function(e){o.table!==e&&i.push(e)}),i},m.prototype.send=function(e,t,o,i){var n=this,s=this.getConnections(e);s.forEach(function(e){e.tableComms(n.table.element,t,o,i)}),!s.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)},m.prototype.receive=function(e,t,o,i){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,o,i);console.warn("Inter-table Comms Error - no such module:",t)},d.prototype.registerModule("comms",m);var f=function(e){this.table=e,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};f.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupAccessor(e.definition[r]))&&(o=!0,i[r]={accessor:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.accessor=i)},f.prototype.lookupAccessor=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.accessors[e]?t=this.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t},f.prototype.transformRow=function(e,t){var o=this,i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=d.prototype.helpers.deepClone(e||{});return o.table.columnManager.traverse(function(e){var o,s,r,a;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(o=e.getFieldValue(n))&&(a=e.getComponent(),r="function"==typeof s.params?s.params(o,n,t,a):s.params,e.setFieldValue(n,s.accessor(o,n,t,r,a)))}),n},f.prototype.accessors={},d.prototype.registerModule("accessor",f);var g=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};g.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},g.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},g.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},g.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},g.prototype.getParams=function(){return this.params||{}},g.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},g.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},g.prototype.setUrl=function(e){this.url=e},g.prototype.getUrl=function(){return this.url},g.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},g.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,ei||null===i)&&(i=e)}),null!==i?!1!==n?i.toFixed(n):i:""},min:function(e,t,o){var i=null,n=void 0!==o.precision&&o.precision;return e.forEach(function(e){((e=Number(e))"),o.dataTreeExpandElement?"string"==typeof o.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=o.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=o.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),_typeof(o.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return o.dataTreeStartExpanded};break;case"function":this.startOpen=o.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return o.dataTreeStartExpanded[t]}}},y.prototype.initializeRow=function(e){var t=e.getData()[this.field],o=Array.isArray(t),i=o||!o&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!i&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!i&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!i&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!i)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:i}},y.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],o=t.getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,o),e.element.classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),o.insertBefore(i.branchEl,o.firstChild),i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):o.style.paddingLeft=parseInt(window.getComputedStyle(o,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")},y.prototype.generateControlElement=function(e,t){var o=this,i=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=i.controlEl;!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(t){t.stopPropagation(),o.expandRow(e)})),i.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(i.controlEl,n):t.insertBefore(i.controlEl,t.firstChild))},y.prototype.setDisplayIndex=function(e){this.displayIndex=e},y.prototype.getDisplayIndex=function(){return this.displayIndex},y.prototype.getRows=function(e){var t=this,o=[];return e.forEach(function(e,i){var n,s;o.push(e),e instanceof a&&(n=e.modules.dataTree.children,n.index||!1===n.children||(s=t.getChildren(e),s.forEach(function(e){o.push(e)})))}),o},y.prototype.getChildren=function(e){var t=this,o=e.modules.dataTree,i=[],n=[];return!1!==o.children&&o.open&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),i=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n}, -y.prototype.generateChildren=function(e){var t=this,o=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var n=new a(i||{},t.table.rowManager);n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=t.startOpen(n.getComponent(),n.modules.dataTree.index)),o.push(n)}),o},y.prototype.expandRow=function(e,t){var o=e.modules.dataTree;!1!==o.children&&(o.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},y.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},y.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},y.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},y.prototype.getFilteredTreeChildren=function(e){var t,o=e.modules.dataTree,i=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),t=this.table.modExists("filter")?this.table.modules.filter.filter(o.children):o.children,t.forEach(function(e){e instanceof a&&i.push(e)})),i},y.prototype.rowDelete=function(e){var t,o=e.modules.dataTree.parent;o&&(t=this.findChildIndex(e,o),!1!==t&&o.data[this.field].splice(t,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.addTreeChildRow=function(e,t,o,i){var n=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==i&&!1!==(n=this.findChildIndex(i,e))&&e.data[this.field].splice(o?n:n+1,0,t),!1===n&&(o?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)},y.prototype.findChildIndex=function(e,t){var o=this,i=!1;return"object"==(void 0===e?"undefined":_typeof(e))?e instanceof a?i=e.data:e instanceof r?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find(function(t){return t instanceof a&&t.element===e}))&&(i=i.data):i=void 0!==e&&null!==e&&t.data[this.field].find(function(t){return t.data[o.table.options.index]==e}),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i},y.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,o=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof a&&o.push(e.getComponent())})),o},y.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||e.row.reinitialize()},y.prototype.getChildField=function(){return this.field},y.prototype.redrawNeeded=function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]},d.prototype.registerModule("dataTree",y);var w=function(e){this.table=e};w.prototype.download=function(e,t,o,i,n){function s(o,i){n?!0===n?r.triggerDownload(o,i,e,t,!0):n(o):r.triggerDownload(o,i,e,t)}var r=this,a=!1;if("function"==typeof e?a=e:r.downloaders[e]?a=r.downloaders[e]:console.warn("Download Error - No such download type found: ",e),a){var l=this.generateExportList(i);a.call(this.table,l,o||{},s)}},w.prototype.generateExportList=function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),o=this.table.options.groupHeaderDownload;return o&&!Array.isArray(o)&&(o=[o]),t.forEach(function(e){var t;"group"===e.type&&(t=e.columns[0],o&&o[e.indent]&&(t.value=o[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))}),t},w.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),r=new Blob([e],{type:t}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(r=this.table.options.downloadReady.call(this.table,e,r))&&(n?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,i):(s.setAttribute("href",window.URL.createObjectURL(r)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},w.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},w.prototype.downloaders={csv:function(e,t,o){var i=t&&t.delimiter?t.delimiter:",",n=[],s=[];e.forEach(function(e){var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(function(e,t){e&&1===e.depth&&(s[t]=void 0===e.value||"null"==typeof e.value?"":e.value)});break;case"row":e.columns.forEach(function(e){if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}}),n.push(t.join(i))}}),s.length&&(n=[s].concat(n)),n=n.join("\n"),t.bom&&(n="\ufeff"+n),o(n,"text/csv")},json:function(e,t,o){var i=[];e.forEach(function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach(function(e){e&&(t[e.component.getField()]=e.value)}),i.push(t)}}),i=JSON.stringify(i,null,"\t"),o(i,"application/json")},pdf:function(e,t,o){function i(e,t){var o=[];return e.columns.forEach(function(e){var i;if(e){switch(_typeof(e.value)){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}i={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(i.styles=t),o.push(i)}else o.push("")}),o}var n=[],s=[],r={},a=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=t.jsPDF||{},u=t&&t.title?t.title:"";c.orientation||(c.orientation=t.orientation||"landscape"),c.unit||(c.unit="pt"),e.forEach(function(e){switch(e.type){case"header":n.push(i(e));break;case"group":s.push(i(e,a));break;case"calc":s.push(i(e,l));break;case"row":s.push(i(e))}});var d=new jsPDF(c);t&&t.autoTable&&(r="function"==typeof t.autoTable?t.autoTable(d)||{}:t.autoTable),u&&(r.addPageContent=function(e){d.text(u,40,30)}),r.head=n,r.body=s,d.autoTable(r),t&&t.documentProcessing&&t.documentProcessing(d),o(d.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o){function i(){var t=[],o=[],i={},n={s:{c:0,r:0},e:{c:e[0]?e[0].columns.reduce(function(e,t){return e+(t&&t.width?t.width:1)},0):0,r:e.length}};return e.forEach(function(e,i){var n=[];e.columns.forEach(function(e,t){e?(n.push(e.value instanceof Date||"object"!==_typeof(e.value)?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&o.push({s:{r:i,c:t},e:{r:i+e.height-1,c:t+e.width-1}})):n.push("")}),t.push(n)}),XLSX.utils.sheet_add_aoa(i,t),i["!ref"]=XLSX.utils.encode_range(n),o.length&&(i["!merges"]=o),i}var n,s=this,r=t.sheetName||"Sheet1",a=XLSX.utils.book_new();if(a.SheetNames=[],a.Sheets={},t.sheetOnly)return void o(i());if(t.sheets)for(var l in t.sheets)!0===t.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=i()):(a.SheetNames.push(l),this.table.modules.comms.send(t.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:s.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(r),a.Sheets[r]=i();t.documentProcessing&&(a=t.documentProcessing(a)),n=XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"}),o(function(e){for(var t=new ArrayBuffer(e.length),o=new Uint8Array(t),i=0;i!=e.length;++i)o[i]=255&e.charCodeAt(i);return t}(n),"application/octet-stream")},html:function(e,t,o){this.modExists("export",!0)&&o(this.modules.export.genereateHTMLTable(e),"text/html")}},d.prototype.registerModule("download",w);var E=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};E.prototype.initializeColumn=function(e){var t=this,o={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?o.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":o.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?o.editor=t.editors[e.definition.formatter]:o.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}o.editor&&(e.modules.edit=o)},E.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},E.prototype.clearEditor=function(e){var t,o=this.currentCell;if(this.invalidEdit=!1,o){for(this.currentCell=!1,t=o.getElement(),e?o.validate():t.classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}},E.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},E.prototype.bindEditor=function(e){var t=this,o=e.getElement();o.setAttribute("tabindex",0),o.addEventListener("click",function(e){o.classList.contains("tabulator-editing")||o.focus({preventScroll:!0})}),o.addEventListener("mousedown",function(e){t.mouseClick=!0}),o.addEventListener("focus",function(o){t.recursionBlock||t.edit(e,o,!1)})},E.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},E.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},E.prototype.focusScrollAdjust=function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,o=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=e.row.getElement();i.offsetTop;i.offsetTopo&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-o)}},E.prototype.edit=function(e,t,o){function i(t){if(c.currentCell===e){var o=!0;return e.column.modules.validate&&c.table.modExists("validate")&&"manual"!=c.table.options.validationMode&&(o=c.table.modules.validate.validate(e.column.modules.validate,e,t)),!0===o||"highlight"===c.table.options.validationMode?(c.clearEditor(),e.setValue(t,!0),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==c.editedCells.indexOf(e)&&c.editedCells.push(e),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e),!0===o||(h.classList.add("tabulator-validation-fail"),!1)):(c.invalidEdit=!0,h.classList.add("tabulator-validation-fail"),c.focusCellNoEvent(e,!0),d(),c.table.options.validationFailed.call(c.table,e.getComponent(),t,o),!1)}}function n(){c.currentCell===e&&(c.cancelEdit(),c.table.options.dataTree&&c.table.modExists("dataTree")&&c.table.modules.dataTree.checkForRestyle(e))}function s(e){d=e}var r,a,l,c=this,u=!0,d=function(){},h=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":u=e.column.modules.edit.check(e.getComponent());break;case"boolean":u=e.column.modules.edit.check}if(u||o){if(c.cancelEdit(),c.currentCell=e,this.focusScrollAdjust(e),a=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,a)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,a),c.table.options.cellEditing.call(this.table,a),l="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(a):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(c,a,s,i,n,l)))return h.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),h.blur(),!1;for(h.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(r),d();for(var p=h.children,m=0;m46){if(o>=i.length)return t.preventDefault(),t.stopPropagation(),a=!1,!1;switch(i[o]){case n:if(l.toUpperCase()==l.toLowerCase())return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case s:if(isNaN(l))return t.preventDefault(),t.stopPropagation(),a=!1,!1;break;case r:break;default:if(l!==i[o])return t.preventDefault(),t.stopPropagation(),a=!1,!1}a=!0}}),e.addEventListener("keyup",function(i){i.keyCode>46&&t.maskAutoFill&&o(e.value.length)}),e.placeholder||(e.placeholder=i),t.maskAutoFill&&o(e.value.length)},E.prototype.getEditedCells=function(){var e=[];return this.editedCells.forEach(function(t){e.push(t.getComponent())}),e},E.prototype.clearEdited=function(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.validate.invalid=!1,(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1))},E.prototype.editors={input:function(e,t,o,i,n){function s(e){(null===r||void 0===r)&&""!==a.value||a.value!==r?o(a.value)&&(r=a.value):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",n.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=void 0!==r?r:"",t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("change",s),a.addEventListener("blur",s),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s(e);break;case 27:i()}}),n.mask&&this.table.modules.edit.maskInput(a,n),a},textarea:function(e,t,o,i,n){function s(t){(null===r||void 0===r)&&""!==c.value||c.value!==r?(o(c.value)&&(r=c.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):i()}var r=e.getValue(),a=n.verticalNavigation||"hybrid",l=String(null!==r&&void 0!==r?r:""),c=(l.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),u=0;if(c.style.display="block",c.style.padding="2px",c.style.height="100%",c.style.width="100%",c.style.boxSizing="border-box",c.style.whiteSpace="pre-wrap",c.style.resize="none",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),c.setAttribute(d,c.getAttribute(d)+n.elementAttributes["+"+d])):c.setAttribute(d,n.elementAttributes[d]);return c.value=l,t(function(){c.focus({preventScroll:!0}),c.style.height="100%"}),c.addEventListener("change",s),c.addEventListener("blur",s),c.addEventListener("keyup",function(){c.style.height="";var t=c.scrollHeight;c.style.height=t+"px",t!=u&&(u=t,e.getRow().normalizeHeight())}),c.addEventListener("keydown",function(e){switch(e.keyCode){case 27:i();break;case 38:("editor"==a||"hybrid"==a&&c.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&c.selectionStart!==c.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(c,n),c},number:function(e,t,o,i,n){function s(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==r?o(e)&&(r=e):i()}var r=e.getValue(),a=n.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==n.max&&l.setAttribute("max",n.max),void 0!==n.min&&l.setAttribute("min",n.min),void 0!==n.step&&l.setAttribute("step",n.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var c in n.elementAttributes)"+"==c.charAt(0)?(c=c.slice(1),l.setAttribute(c,l.getAttribute(c)+n.elementAttributes["+"+c])):l.setAttribute(c,n.elementAttributes[c]);l.value=r;var u=function(e){s()};return t(function(){l.removeEventListener("blur",u),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",u)}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}}),n.mask&&this.table.modules.edit.maskInput(l,n),l},range:function(e,t,o,i,n){function s(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!=r?o(e)&&(r=e):i()}var r=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),void 0!==n.max&&a.setAttribute("max",n.max),void 0!==n.min&&a.setAttribute("min",n.min),void 0!==n.step&&a.setAttribute("step",n.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var l in n.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),a.setAttribute(l,a.getAttribute(l)+n.elementAttributes["+"+l])):a.setAttribute(l,n.elementAttributes[l]);return a.value=r,t(function(){a.focus({preventScroll:!0}),a.style.height="100%"}),a.addEventListener("blur",function(e){s()}),a.addEventListener("keydown",function(e){switch(e.keyCode){case 13:s();break;case 27:i()}}),a},select:function(e,t,o,i,n){function s(t){var o,i={},s=w.table.getData();return o=t?w.table.columnManager.getColumnByField(t):e.getColumn()._getSelf(),o?(s.forEach(function(e){var t=o.getFieldValue(e);null!==t&&void 0!==t&&""!==t&&(i[t]=!0)}),i=n.sortValuesList?"asc"==n.sortValuesList?Object.keys(i).sort():Object.keys(i).sort().reverse():Object.keys(i)):console.warn("unable to find matching column to create select lookup list:",t),i}function r(t,o){function i(e){var e={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1};return o.indexOf(e.value)>-1&&c(e),n.push(e),s.push(e),e}var n=[],s=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1},s.push(t),e.options.forEach(function(e){i(e)})):i(e):(t={label:e,value:e,element:!1},o.indexOf(t.value)>-1&&c(t),n.push(t),s.push(t))});else for(var r in t){var l={label:t[r],value:r,element:!1};o.indexOf(l.value)>-1&&c(l),n.push(l),s.push(l)}D=n,S=s,a()}function a(){for(;L.firstChild;)L.removeChild(L.firstChild);S.forEach(function(t){var o=t.element;if(!o){if(o=document.createElement("div"),t.label=n.listItemFormatter?n.listItemFormatter(t.value,t.label,e,o,t.itemParams):t.label,t.group?(o.classList.add("tabulator-edit-select-list-group"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label):(o.classList.add("tabulator-edit-select-list-item"),o.tabIndex=0,o.innerHTML=""===t.label?" ":t.label,o.addEventListener("click",function(){T?(h(t),M.focus()):p(t)}),H.indexOf(t)>-1&&o.classList.add("active")),t.elementAttributes&&"object"==_typeof(t.elementAttributes))for(var i in t.elementAttributes)"+"==i.charAt(0)?(i=i.slice(1),o.setAttribute(i,M.getAttribute(i)+t.elementAttributes["+"+i])):o.setAttribute(i,t.elementAttributes[i]);o.addEventListener("mousedown",function(){z=!1,setTimeout(function(){z=!0},10)}),t.element=o}L.appendChild(o)})}function l(e,t){!T&&k&&k.element&&k.element.classList.remove("active"),k&&k.element&&k.element.classList.remove("focused"),k=e,e.element&&(e.element.classList.add("focused"),t&&e.element.classList.add("active"))}function c(e){-1==H.indexOf(e)&&(H.push(e),l(e,!0)),f()}function u(e){var t=H[e];e>-1&&(H.splice(e,1),t.element&&t.element.classList.remove("active"))}function h(e){e||(e=k);var t=H.indexOf(e);t>-1?u(t):(!0!==T&&H.length>=T&&u(0),c(e)),f()}function p(e){v(),e||(e=k),e&&o(e.value)}function m(){v();var e=[];H.forEach(function(t){e.push(t.value)}),o(e)}function f(){var e=[];H.forEach(function(t){e.push(t.label)}),M.value=e.join(", ")}function g(){v(),i()}function b(){if(!L.parentNode){!0===n.values?r(s(),R):"string"==typeof n.values?r(s(n.values),R):r(n.values||[],R);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",L.addEventListener("mousedown",function(e){z=!1,setTimeout(function(){z=!0},10)}),document.body.appendChild(L)}}function v(){L.parentNode&&L.parentNode.removeChild(L),y()}function y(){w.table.rowManager.element.removeEventListener("scroll",g)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:[],M=document.createElement("input"),L=document.createElement("div"),T=n.multiselect,D=[],k={},S=[],H=[],z=!0;if(this.table.rowManager.element.addEventListener("scroll",g),(Array.isArray(n)||!Array.isArray(n)&&"object"===(void 0===n?"undefined":_typeof(n))&&!n.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),n={values:n}),M.setAttribute("type","text"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",M.style.cursor="default",M.readOnly=0!=this.currentCell,n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var A in n.elementAttributes)"+"==A.charAt(0)?(A=A.slice(1),M.setAttribute(A,M.getAttribute(A)+n.elementAttributes["+"+A])):M.setAttribute(A,n.elementAttributes[A]);return M.value=void 0!==C||null===C?C:"",M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&l(D[t-1],!T));break;case 40:t=D.indexOf(k),("editor"==x||"hybrid"==x&&t-1||String(t.title).toLowerCase().indexOf(String(e).toLowerCase())>-1)&&s.push(t)}),h(s,t))}function l(e){var t=document.createElement("div");u(),!1!==e&&(t.classList.add("tabulator-edit-select-list-notice"),t.tabIndex=0,e instanceof Node?t.appendChild(e):t.innerHTML=e,L.appendChild(t))}function c(e){var t=[];if(Array.isArray(e))e.forEach(function(e){var o={};"object"===(void 0===e?"undefined":_typeof(e))?(o.title=n.listItemFormatter?n.listItemFormatter(e.value,e.label):e.label,o.value=e.value):(o.title=n.listItemFormatter?n.listItemFormatter(e,e):e,o.value=e),t.push(o)});else for(var o in e){var i={title:n.listItemFormatter?n.listItemFormatter(o,e[o]):e[o],value:o};t.push(i)}return t}function u(){for(;L.firstChild;)L.removeChild(L.firstChild)}function h(e,t){e.length?p(e,t):n.emptyPlaceholder&&l(n.emptyPlaceholder)}function p(e,t){var o=!1;u(),T=e,T.forEach(function(e){var i=e.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=e.title,i.addEventListener("click",function(t){g(e),m()}),i.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),e.element=i,t&&e.value==C&&(M.value=e.title,e.element.classList.add("active"),o=!0),e===D&&(e.element.classList.add("active"),o=!0)),L.appendChild(i)}),o||g(!1)}function m(){b(),D?C!==D.value?(C=D.value,M.value=D.title,o(D.value)):i():n.freetext?(C=M.value,o(M.value)):n.allowEmpty&&""===M.value?(C=M.value,o(M.value)):i()}function f(){if(!L.parentNode){for(;L.firstChild;)L.removeChild(L.firstChild);var e=d.prototype.helpers.elOffset(E);L.style.minWidth=E.offsetWidth+"px",L.style.top=e.top+E.offsetHeight+"px",L.style.left=e.left+"px",document.body.appendChild(L)}}function g(e,t){D&&D.element&&D.element.classList.remove("active"),D=e,e&&e.element&&e.element.classList.add("active")}function b(){L.parentNode&&L.parentNode.removeChild(L),y()}function v(){b(),i()}function y(){w.table.rowManager.element.removeEventListener("scroll",v)}var w=this,E=e.getElement(),C=e.getValue(),x=n.verticalNavigation||"editor",R=void 0!==C||null===C?C:void 0!==n.defaultValue?n.defaultValue:"",M=document.createElement("input"),L=document.createElement("div"),T=[],D=!1,k=!0,S=!1;if(this.table.rowManager.element.addEventListener("scroll",v),M.setAttribute("type","search"),M.style.padding="4px",M.style.width="100%",M.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var H in n.elementAttributes)"+"==H.charAt(0)?(H=H.slice(1),M.setAttribute(H,M.getAttribute(H)+n.elementAttributes["+"+H])):M.setAttribute(H,n.elementAttributes[H]);return L.classList.add("tabulator-edit-select-list"),L.addEventListener("mousedown",function(e){k=!1,setTimeout(function(){k=!0},10)}),M.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),g(t>0?T[t-1]:!1));break;case 40:t=T.indexOf(D),("editor"==x||"hybrid"==x&&t'):("ie"==a.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')})}function r(e){c=e,s(e)}var a=this,l=e.getElement(),c=e.getValue(),u=l.getElementsByTagName("svg").length||5,d=l.getElementsByTagName("svg")[0]?l.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],p=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.style.whiteSpace="nowrap",l.style.overflow="hidden",l.style.textOverflow="ellipsis",p.style.verticalAlign="middle",p.style.display="inline-block",p.style.padding="4px",m.setAttribute("width",d),m.setAttribute("height",d),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),p.setAttribute(f,p.getAttribute(f)+n.elementAttributes["+"+f])):p.setAttribute(f,n.elementAttributes[f]);for(var g=1;g<=u;g++)!function(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",function(t){t.stopPropagation(),t.stopImmediatePropagation(),s(e)}),t.addEventListener("mousemove",function(e){e.stopPropagation(),e.stopImmediatePropagation()}),t.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),o(e),l.blur()}),t.appendChild(i),p.appendChild(t)}(g);return c=Math.min(parseInt(c),u),s(c),p.addEventListener("mousemove",function(e){s(0)}),p.addEventListener("click",function(e){o(0)}),l.addEventListener("blur",function(e){i()}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:r(c+1);break;case 37:r(c-1);break;case 13:o(c);break;case 27:i()}}),p},progress:function(e,t,o,i,n){function s(){var e=d*Math.round(m.offsetWidth/(l.clientWidth/100))+u;o(e),l.setAttribute("aria-valuenow",e),l.setAttribute("aria-label",h)}var r,a,l=e.getElement(),c=void 0===n.max?l.getElementsByTagName("div")[0].getAttribute("max")||100:n.max,u=void 0===n.min?l.getElementsByTagName("div")[0].getAttribute("min")||0:n.min,d=(c-u)/100,h=e.getValue()||0,p=document.createElement("div"),m=document.createElement("div");if(p.style.position="absolute",p.style.right="0",p.style.top="0",p.style.bottom="0",p.style.width="5px",p.classList.add("tabulator-progress-handle"),m.style.display="inline-block", -m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var f in n.elementAttributes)"+"==f.charAt(0)?(f=f.slice(1),m.setAttribute(f,m.getAttribute(f)+n.elementAttributes["+"+f])):m.setAttribute(f,n.elementAttributes[f]);return l.style.padding="4px 4px",h=Math.min(parseFloat(h),c),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/d),m.style.width=h+"%",l.setAttribute("aria-valuemin",u),l.setAttribute("aria-valuemax",c),m.appendChild(p),p.addEventListener("mousedown",function(e){r=e.screenX,a=m.offsetWidth}),p.addEventListener("mouseover",function(){p.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(e){r&&(m.style.width=a+e.screenX-r+"px")}),l.addEventListener("mouseup",function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,a=!1,s())}),l.addEventListener("keydown",function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:s();break;case 27:i()}}),l.addEventListener("blur",function(){i()}),m},tickCross:function(e,t,o,i,n){function s(e){return l?e?u?c:a.checked:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,c):(u=!1,a.checked):a.checked}var r=e.getValue(),a=document.createElement("input"),l=n.tristate,c=void 0===n.indeterminateValue?null:n.indeterminateValue,u=!1;if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",n.elementAttributes&&"object"==_typeof(n.elementAttributes))for(var d in n.elementAttributes)"+"==d.charAt(0)?(d=d.slice(1),a.setAttribute(d,a.getAttribute(d)+n.elementAttributes["+"+d])):a.setAttribute(d,n.elementAttributes[d]);return a.value=r,!l||void 0!==r&&r!==c&&""!==r||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){a.focus({preventScroll:!0})}),a.checked=!0===r||"true"===r||"True"===r||1===r,a.addEventListener("change",function(e){o(s())}),a.addEventListener("blur",function(e){o(s(!0))}),a.addEventListener("keydown",function(e){13==e.keyCode&&o(s()),27==e.keyCode&&i()}),a}},d.prototype.registerModule("edit",E);var C=function(e,t,o,i){this.type=e,this.columns=t,this.component=o||!1,this.indent=i||0},x=function(e,t,o,i,n){this.value=e,this.component=t||!1,this.width=o,this.height=i,this.depth=n},R=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};R.prototype.generateExportList=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],s=this.bodyToExportRows(this.rowLookup(o));return n.concat(s)},R.prototype.genereateTable=function(e,t,o,i){var n=this.generateExportList(e,t,o,i);return this.genereateTableElement(n)},R.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach(function(e){(e=t.table.rowManager.findRow(e))&&o.push(e)});else switch(e){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},R.prototype.generateColumnGroupHeaders=function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}),t},R.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n=e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,s={title:n,column:e,depth:1};if(o.length){if(s.subGroups=[],s.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);o&&(s.width+=o.width,s.subGroups.push(o),o.depth>i&&(i=o.depth))}),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s},R.prototype.columnVisCheck=function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])},R.prototype.headersToExportRows=function(e){function t(e,n){var s=i-n;if(void 0===o[n]&&(o[n]=[]),e.height=e.subGroups?1:s-e.depth+1,o[n].push(e),e.height>1)for(var r=1;r1)for(var a=1;ai&&(i=e.depth)}),e.forEach(function(e){t(e,0)}),o.forEach(function(e){var t=[];e.forEach(function(e){e?t.push(new x(e.title,e.column.getComponent(),e.width,e.height,e.depth)):t.push(null)}),n.push(new C("header",t))}),n},R.prototype.bodyToExportRows=function(e){var t=this,o=[],i=[];return this.table.columnManager.columnsByIndex.forEach(function(e){t.columnVisCheck(e)&&o.push(e.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter(function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}),e.forEach(function(e,n){var s=e.getData(t.colVisProp),r=[],a=0;switch(e.type){case"group":a=e.level,r.push(new x(e.key,e.getComponent(),o.length,1));break;case"calc":case"row":o.forEach(function(e){r.push(new x(e._column.getFieldValue(s),e,1,1))}),t.table.options.dataTree&&!1!==t.config.dataTree&&(a=e.modules.dataTree.index)}i.push(new C(e.type,r,e.getComponent(),a))}),i},R.prototype.genereateTableElement=function(e){var t=this,o=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),r=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a={};return a.rowFormatter=null!==r?r:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(a.treeElementField=this.table.modules.dataTree.elementField),a.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a.groupHeader&&!Array.isArray(a.groupHeader)&&(a.groupHeader=[a.groupHeader]),o.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(function(e,o){switch(e.type){case"header":i.appendChild(t.genereateHeaderElement(e,a,s));break;case"group":n.appendChild(t.genereateGroupElement(e,a,s));break;case"calc":n.appendChild(t.genereateCalcElement(e,a,s));break;case"row":var r=t.genereateRowElement(e,a,s);t.mapElementStyles(o%2&&s.evenRow?s.evenRow:s.oddRow,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(r)}}),i.innerHTML&&o.appendChild(i),o.appendChild(n),this.mapElementStyles(this.table.element,o,["border-top","border-left","border-right","border-bottom"]),o},R.prototype.lookupTableStyles=function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e},R.prototype.genereateHeaderElement=function(e,t,o){var i=this,n=document.createElement("tr");return e.columns.forEach(function(e){if(e){var t=document.createElement("th"),o=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,i.cloneTableStyle&&(t.style.boxSizing="border-box"),o.forEach(function(e){t.classList.add(e)}),i.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),i.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?i.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&i.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),n.appendChild(t)}}),n},R.prototype.genereateGroupElement=function(e,t,o){var i=document.createElement("tr"),n=document.createElement("td"),s=e.columns[0];return i.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?s.value=t.groupHeader[e.indent](s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?s.value=s.value:s.value=e.component._group.generator(s.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),n.colSpan=s.width,n.innerHTML=s.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+e.indent),s.component.getVisibility()&&i.classList.add("tabulator-group-visible"),this.mapElementStyles(o.firstGroup,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(o.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),i.appendChild(n),i},R.prototype.genereateCalcElement=function(e,t,o){var i=this.genereateRowElement(e,t,o);return i.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(o.calcRow,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i},R.prototype.genereateRowElement=function(e,t,o){var n=this,s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach(function(r){if(r){var a=document.createElement("td"),l=r.component._column,c=r.value,u={modules:{},getValue:function(){return c},getField:function(){return l.definition.field},getElement:function(){return a},getColumn:function(){return l.getComponent()},getData:function(){return rowData},getRow:function(){return e.getComponent()},getComponent:function(){return u},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach(function(e){a.classList.add(e)}),n.table.modExists("format")&&!1!==n.config.formatCells)c=n.table.modules.format.formatExportValue(u,n.colVisProp);else switch(void 0===c?"undefined":_typeof(c)){case"object":c=JSON.stringify(c);break;case"undefined":case"null":c="";break;default:c=c}if(c instanceof Node?a.appendChild(c):a.innerHTML=c,o.firstCell&&(n.mapElementStyles(o.firstCell,a,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),l.definition.align&&(a.style.textAlign=l.definition.align)),n.table.options.dataTree&&!1!==n.config.dataTree&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&a.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),e.component._row.modules.dataTree.branchEl&&a.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),s.appendChild(a),u.modules.format&&u.modules.format.renderedCallback&&u.modules.format.renderedCallback(),t.rowFormatter&&!1!==n.config.formatCells){var d=e.getComponent();d.getElement=function(){return s},t.rowFormatter(d)}}}),s},R.prototype.genereateHTMLTable=function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML},R.prototype.getHtml=function(e,t,o,i){var n=this.generateExportList(o||this.table.options.htmlOutputConfig,t,e,i||"htmlOutput");return this.genereateHTMLTable(n)},R.prototype.mapElementStyles=function(e,t,o){if(this.cloneTableStyle&&e&&t){var i={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(e);o.forEach(function(e){t.style[i[e]]=n.getPropertyValue(e)})}}},d.prototype.registerModule("export",R);var M=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};M.prototype.initializeColumn=function(e,t){function o(t){var o,r="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",a="",l="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete n.headerFilters[s];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":n.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,o=function(o){var i=e.definition.headerFilterFuncParams||{},s=e.getFieldValue(o);return i="function"==typeof i?i(t,s,o):i,n.filters[e.definition.headerFilterFunc](t,s,o,i)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":o=function(o){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(o);return i="function"==typeof i?i(t,n,o):i,e.definition.headerFilterFunc(t,n,o,i)},a=o}if(!o)switch(r){case"partial":o=function(o){var i=e.getFieldValue(o);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},a="like";break;default:o=function(o){return e.getFieldValue(o)==t},a="="}n.headerFilters[s]={value:t,func:o,type:a,params:i||{}}}l=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==l&&(n.prevHeaderFilterChangeCheck=l,n.changed=!0,n.table.rowManager.filterRefresh())}return!0}var i,n=this,s=e.getField();e.modules.filter={success:o,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},M.prototype.generateHeaderFilterElement=function(e,t,o){function i(){}var n,s,r,a,l,c,u,d=this,h=this,p=e.modules.filter.success,m=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),m){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":h.table.modules.edit.editors[e.definition.headerFilter]?(s=h.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":s=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?s=e.modules.edit.editor:e.definition.formatter&&h.table.modules.edit.editors[e.definition.formatter]?(s=h.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):s=h.table.modules.edit.editors.input}if(s){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(h.table):u,!(r=s.call(this.table.modules.edit,a,function(){},p,i,u)))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(r instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",r);m?h.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){r.setAttribute("placeholder",void 0!==e&&e?e:h.table.modules.localize.getText("headerFilters|default"))}):h.table.modules.localize.bind("headerFilters|default",function(e){r.setAttribute("placeholder",void 0!==h.column.definition.headerFilterPlaceholder&&h.column.definition.headerFilterPlaceholder?h.column.definition.headerFilterPlaceholder:e)}),r.addEventListener("click",function(e){e.stopPropagation(),r.focus()}),r.addEventListener("focus",function(e){var t=d.table.columnManager.element.scrollLeft;t!==d.table.rowManager.element.scrollLeft&&(d.table.rowManager.scrollHorizontal(t),d.table.columnManager.scrollHorizontal(t))}),l=!1,c=function(e){l&&clearTimeout(l),l=setTimeout(function(){p(r.value)},h.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=r,e.modules.filter.attrType=r.hasAttribute("type")?r.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=r.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(r.addEventListener("keyup",c),r.addEventListener("search",c),"number"==e.modules.filter.attrType&&r.addEventListener("change",function(e){p(r.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&r.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||r.addEventListener("mousedown",function(e){e.stopPropagation()})),n.appendChild(r),e.contentElement.appendChild(n),o||h.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},M.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})},M.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})},M.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},M.prototype.getHeaderFilterValue=function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())},M.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},M.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},M.prototype.setFilter=function(e,t,o,i){var n=this;n.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),n.addFilter(e)},M.prototype.addFilter=function(e,t,o,i){var n=this;Array.isArray(e)||(e=[{field:e,type:t,value:o,params:i}]),e.forEach(function(e){(e=n.findFilter(e))&&(n.filterList.push(e),n.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.findFilter=function(e){var t,o=this;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:o.filters[e.type]?(t=o.table.columnManager.getColumnByField(e.field),i=t?function(i){return o.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return o.filters[e.type](e.value,t[e.field],t,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e},M.prototype.findSubFilters=function(e){var t=this,o=[];return e.forEach(function(e){(e=t.findFilter(e))&&o.push(e)}),!!o.length&&o},M.prototype.getFilters=function(e,t){var o=[];return e&&(o=this.getHeaderFilters()),t&&o.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),o=o.concat(this.filtersToArray(this.filterList,t))},M.prototype.filtersToArray=function(e,t){var o=this,i=[];return e.forEach(function(e){var n;Array.isArray(e)?i.push(o.filtersToArray(e,t)):(n={field:e.field,type:e.type,value:e.value},t&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i},M.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},M.prototype.removeFilter=function(e,t,o){var i=this;Array.isArray(e)||(e=[{field:e,type:t,value:o}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?i.filterList.findIndex(function(t){return e===t}):i.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(i.filterList.splice(t,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.clearFilter=function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")},M.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},e.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)}),this.changed=!0},M.prototype.search=function(e,t,o,i){var n=this,s=[],r=[];return Array.isArray(t)||(t=[{field:t,type:o,value:i}]),t.forEach(function(e){(e=n.findFilter(e))&&r.push(e)}),this.table.rowManager.rows.forEach(function(t){var o=!0;r.forEach(function(e){n.filterRecurse(e,t.getData())||(o=!1)}),o&&s.push("data"===e?t.getData("data"):t.getComponent())}),s},M.prototype.filter=function(e,t){var o=this,i=[],n=[];return o.table.options.dataFiltering&&o.table.options.dataFiltering.call(o.table,o.getFilters()),o.table.options.ajaxFiltering||!o.filterList.length&&!Object.keys(o.headerFilters).length?i=e.slice(0):e.forEach(function(e){o.filterRow(e)&&i.push(e)}),o.table.options.dataFiltered&&(i.forEach(function(e){n.push(e.getComponent())}),o.table.options.dataFiltered.call(o.table,o.getFilters(),n)),i},M.prototype.filterRow=function(e,t){var o=this,i=!0,n=e.getData();o.filterList.forEach(function(e){o.filterRecurse(e,n)||(i=!1)});for(var s in o.headerFilters)o.headerFilters[s].func(n)||(i=!1);return i},M.prototype.filterRecurse=function(e,t){var o=this,i=!1;return Array.isArray(e)?e.forEach(function(e){o.filterRecurse(e,t)&&(i=!0)}):i=e.func(t),i},M.prototype.filters={"=":function(e,t,o,i){return t==e},"<":function(e,t,o,i){return t":function(e,t,o,i){return t>e},">=":function(e,t,o,i){return t>=e},"!=":function(e,t,o,i){return t!=e},regex:function(e,t,o,i){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,o,i){var n=e.toLowerCase().split(void 0===i.separator?" ":i.separator),s=String(null===t||void 0===t?"":t).toLowerCase(),r=[];return n.forEach(function(e){s.includes(e)&&r.push(!0)}),i.matchAll?r.length===n.length:!!r.length},starts:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,o,i){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,o,i){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},d.prototype.registerModule("filter",M);var L=function(e){this.table=e};L.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},L.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},i=e.definition["formatter"+t];switch(void 0===i?"undefined":_typeof(i)){case"string":"tick"===i&&(i="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[i]?o.formatter=this.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=i;break;default:o.formatter=this.formatters.plaintext}return o},L.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},L.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,i,t)},L.prototype.formatExportValue=function(e,t){var o,i=e.column.modules.format[t];if(i){var n=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof i.params?i.params(component):i.params,i.formatter.call(this,e.getComponent(),o,n)}return this.formatValue(e)},L.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},L.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},L.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},L.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var i,n,s,r,a=parseFloat(e.getValue()),l=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,h=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(i=!1!==h?a.toFixed(h):a,i=String(i).split("."),n=i[0],s=i.length>1?l+i[1]:"",r=/(\d+)(\d{3})/;r.test(n);)n=n.replace(r,"$1"+c+"$2");return d?n+s+u:u+n+s},link:function(e,t,o){var i,n=e.getValue(),s=t.urlPrefix||"",r=t.download,a=n,l=document.createElement("a");if(t.labelField&&(i=e.getData(),a=i[t.labelField]),t.label)switch(_typeof(t.label)){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(i=e.getData(),n=i[t.urlField]),t.url)switch(_typeof(t.url)){case"string":n=t.url;break;case"function":n=t.url(e)}return l.setAttribute("href",s+n),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,o){var i=document.createElement("img");switch(i.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":i.style.height=t.height+"px";break;case"string":i.style.height=t.height}switch(_typeof(t.width)){case"number":i.style.width=t.width+"px";break;case"string":i.style.width=t.width}return i.addEventListener("load",function(){e.getRow().normalizeHeight()}),i},tickCross:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t.allowEmpty,r=t.allowTruthy,a=void 0!==t.tickElement?t.tickElement:'',l=void 0!==t.crossElement?t.crossElement:'';return r&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(n.setAttribute("aria-checked",!0),a||""):!s||"null"!==i&&""!==i&&null!==i&&void 0!==i?(n.setAttribute("aria-checked",!1),l||""):(n.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=t.outputFormat||"DD/MM/YYYY hh:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=e.getValue(),a=moment(r,i);return a.isValid()?t.timezone?a.tz(t.timezone).format(n):a.format(n):!0===s?r:"function"==typeof s?s(r):s},datetimediff:function(e,t,o){ -var i=t.inputFormat||"YYYY-MM-DD hh:mm:ss",n=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,r=void 0!==t.unit?t.unit:void 0,a=void 0!==t.humanize&&t.humanize,l=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,i);return u.isValid()?a?moment.duration(u.diff(l)).humanize(s):u.diff(l,r)+(s?" "+s:""):!0===n?c:"function"==typeof n?n(c):n},lookup:function(e,t,o){var i=e.getValue();return void 0===t[i]?(console.warn("Missing display value for "+i),i):t[i]},star:function(e,t,o){var i=e.getValue(),n=e.getElement(),s=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,s));for(var l=1;l<=s;l++){var c=a.cloneNode(!0);c.innerHTML=l<=i?'':'',r.appendChild(c)}return n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.textOverflow="ellipsis",n.setAttribute("aria-label",i),r},traffic:function(e,t,o){var i,n,s=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(s)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),n=parseFloat(s)<=a?parseFloat(s):a,n=parseFloat(n)>=l?parseFloat(n):l,i=(a-l)/100,n=Math.round((n-l)/i),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,h=Math.floor(n/d);h=Math.min(h,c.length-1),h=Math.max(h,0),u=c[h];break}}return r.style.backgroundColor=u,r}},progress:function(e,t,o){var i,n,s,r,a,c=this.sanitizeHTML(e.getValue())||0,u=e.getElement(),d=t&&t.max?t.max:100,h=t&&t.min?t.min:0,p=t&&t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(c)<=d?parseFloat(c):d,n=parseFloat(n)>=h?parseFloat(n):h,i=(d-h)/100,n=Math.round((n-h)/i),_typeof(t.color)){case"string":s=t.color;break;case"function":s=t.color(c);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,f=Math.floor(n/m);f=Math.min(f,t.color.length-1),f=Math.max(f,0),s=t.color[f];break}default:s="#2DC214"}switch(_typeof(t.legend)){case"string":r=t.legend;break;case"function":r=t.legend(c);break;case"boolean":r=c;break;default:r=!1}switch(_typeof(t.legendColor)){case"string":a=t.legendColor;break;case"function":a=t.legendColor(c);break;case"object":if(Array.isArray(t.legendColor)){var m=100/t.legendColor.length,f=Math.floor(n/m);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),a=t.legendColor[f]}break;default:a="#000"}u.style.minWidth="30px",u.style.position="relative",u.setAttribute("aria-label",n);var g=document.createElement("div");if(g.style.display="inline-block",g.style.position="relative",g.style.width=n+"%",g.style.backgroundColor=s,g.style.height="100%",g.setAttribute("data-max",d),g.setAttribute("data-min",h),r){var b=document.createElement("div");b.style.position="absolute",b.style.top="4px",b.style.left=0,b.style.textAlign=p,b.style.width="100%",b.style.color=a,b.innerHTML=r}return o(function(){if(!(e instanceof l)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",u.appendChild(t),u=t}u.appendChild(g),r&&u.appendChild(b)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function i(e){var t=s.element;s.open=e,t&&(s.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}var n=document.createElement("div"),s=e.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",function(e){i.toggleSelect()}),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},d.prototype.registerModule("format",L);var T=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};T.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0},T.prototype.initializeColumn=function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")},T.prototype.frozenCheck=function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen},T.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},T.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))},T.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach(function(e){t.layoutElement(e.getElement(),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach(function(e){t.layoutElement(e.getElement(),o)})})},T.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},T.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},T.prototype.layoutRow=function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}),this.rightColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)})},T.prototype.layoutElement=function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))},T.prototype._calcSpace=function(e,t){for(var o=0,i=0;i-1&&t.splice(o,1)}),t},D.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},D.prototype.unfreezeRow=function(e){var t=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var o=e.getElement();o.parentNode.removeChild(o),this.table.rowManager.adjustTableSize(),this.rows.splice(t,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},D.prototype.styleRows=function(e){var t=this;this.rows.forEach(function(e,o){t.table.rowManager.styleRow(e,o)})},d.prototype.registerModule("frozenRows",D);var k=function(e){this._group=e,this.type="GroupComponent"};k.prototype.getKey=function(){return this._group.key},k.prototype.getField=function(){return this._group.field},k.prototype.getElement=function(){return this._group.element},k.prototype.getRows=function(){return this._group.getRows(!0)},k.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},k.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},k.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible},k.prototype.isVisible=function(){return this._group.visible},k.prototype.show=function(){this._group.show()},k.prototype.hide=function(){this._group.hide()},k.prototype.toggle=function(){this._group.toggleVisibility()},k.prototype._getSelf=function(){return this._group},k.prototype.getTable=function(){return this._group.groupManager.table};var S=function(e,t,o,i,n,s,r){this.groupManager=e,this.parent=t,this.key=i,this.level=o,this.field=n,this.hasSubGroups=o-1?o?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):o?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)},S.prototype.scrollHeader=function(e){this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)})},S.prototype.getRowIndex=function(e){},S.prototype.conformRowData=function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e},S.prototype.removeRow=function(e){var t=this.rows.indexOf(e),o=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(o.parentNode&&o.parentNode.removeChild(o),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},S.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],t=this.groupList.indexOf(e),t>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},S.prototype.getHeadersAndRows=function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){t=t.concat(o.getHeadersAndRows(e))}):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t},S.prototype.getData=function(e,t){var o=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(function(e){o.push(e.getData(t||"data"))}),o},S.prototype.getRowCount=function(){var e=0;return this.groupList.length?this.groupList.forEach(function(t){e+=t.getRowCount()}):e=this.rows.length,e},S.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},S.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){e.detachElement()})}):this.rows.forEach(function(e){var t=e.getElement();t.parentNode.removeChild(t)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},S.prototype.show=function(){var e=this;if(e.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=e.getElement();this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o})}):e.rows.forEach(function(e){var o=e.getElement();t.parentNode.insertBefore(o,t.nextSibling),e.initialize(),t=o}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},S.prototype._visSet=function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))},S.prototype.getRowGroup=function(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}):this.rows.find(function(t){return t===e})&&(t=this),t},S.prototype.getSubGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.getRows=function(e){var t=[];return this.rows.forEach(function(o){t.push(e?o.getComponent():o)}),t},S.prototype.generateGroupHeaderContents=function(){var e=[];for(this.rows.forEach(function(t){e.push(t.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},S.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),e.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],e.table.modules.localize.bind("groups|item",function(t,o){e.headerGenerator[0]=function(e,i,n){return(void 0===e?"":e)+"("+i+" "+(1===i?t:o.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var n=this.table.columnManager.getRealColumns();n.forEach(function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(t)||(t=[t]),t.forEach(function(t,o){var i,n;"function"==typeof t?i=t:(n=e.table.columnManager.getColumnByField(t),i=n?function(e){return n.getFieldValue(e)}:function(e){return e[t]}),e.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!e.allowedValues&&e.allowedValues[o]})}),o&&(Array.isArray(o)||(o=[o]),o.forEach(function(e){e="function"==typeof e?e:function(){return!0}}),e.startOpen=o),i&&(e.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},H.prototype.setDisplayIndex=function(e){this.displayIndex=e},H.prototype.getDisplayIndex=function(){return this.displayIndex},H.prototype.getRows=function(e){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(e),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):e.slice(0)},H.prototype.getGroups=function(e){var t=[];return this.groupList.forEach(function(o){t.push(e?o.getComponent():o)}),t},H.prototype.getChildGroups=function(e){var t=this,o=[];return e||(e=this),e.groupList.forEach(function(e){e.groupList.length?o=o.concat(t.getChildGroups(e)):o.push(e)}),o},H.prototype.wipe=function(){this.groupList.forEach(function(e){e.wipe()})},H.prototype.pullGroupListData=function(e){var t=this,o=[];return e.forEach(function(e){var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];e.hasSubGroups?(n=t.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=n.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),o.push(i),o=o.concat(n)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,o.push(i),e.getRows().forEach(function(e){o.push(e.getData("data"))}))}),o},H.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},H.prototype.getRowGroup=function(e){var t=!1;return this.groupList.forEach(function(o){var i=o.getRowGroup(e);i&&(t=i)}),t},H.prototype.countGroups=function(){return this.groupList.length},H.prototype.generateGroups=function(e){var t=this,o=t.groups;t.groups={},t.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(e){t.createGroup(e,0,o)}),e.forEach(function(e){t.assignRowToExistingGroup(e,o)})):e.forEach(function(e){t.assignRowToGroup(e,o)})},H.prototype.createGroup=function(e,t,o){var i,n=t+"_"+e;o=o||[],i=new S(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],o[n]),this.groups[n]=i,this.groupList.push(i)},H.prototype.assignRowToExistingGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i="0_"+o;this.groups[i]&&this.groups[i].addRow(e)},H.prototype.assignRowToGroup=function(e,t){var o=this.groupIDLookups[0].func(e.getData()),i=!this.groups["0_"+o];return i&&this.createGroup(o,0,t),this.groups["0_"+o].addRow(e),!i},H.prototype.updateGroupRows=function(e){var t=this,o=[];if(t.groupList.forEach(function(e){o=o.concat(e.getHeadersAndRows())}),e){var i=t.table.rowManager.setDisplayRows(o,this.getDisplayIndex());!0!==i&&this.setDisplayIndex(i),t.table.rowManager.refreshActiveData("group",!0,!0)}return o},H.prototype.scrollHeaders=function(e){e+="px",this.groupList.forEach(function(t){t.scrollHeader(e)})},H.prototype.removeGroup=function(e){var t,o=e.level+"_"+e.key;this.groups[o]&&(delete this.groups[o],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))},d.prototype.registerModule("groupRows",H);var z=function(e){this.table=e,this.history=[],this.index=-1};z.prototype.clear=function(){this.history=[],this.index=-1},z.prototype.action=function(e,t,o){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:o}),this.index++},z.prototype.getHistoryUndoSize=function(){return this.index+1},z.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},z.prototype.undo=function(){if(this.index>-1){var e=this.history[this.index];return this.undoers[e.type].call(this,e),this.index--,this.table.options.historyUndo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},z.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return this.redoers[e.type].call(this,e),this.table.options.historyRedo.call(this.table,e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},z.prototype.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue)},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){ -this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},z.prototype.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue)},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}},z.prototype._rebindRow=function(e,t){this.history.forEach(function(o){if(o.component instanceof a)o.component===e&&(o.component=t);else if(o.component instanceof c&&o.component.row===e){var i=o.component.column.getField();i&&(o.component=t.getCell(i))}})},d.prototype.registerModule("history",z);var A=function(e){this.table=e,this.fieldIndex=[],this.hasIndex=!1};A.prototype.parseTable=function(){var e=this,t=e.table.element,o=e.table.options,i=(o.columns,t.getElementsByTagName("th")),n=t.getElementsByTagName("tbody")[0],s=[];e.hasIndex=!1,e.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],e._extractOptions(t,o),i.length?e._extractHeaders(i,n):e._generateBlankHeaders(i,n);for(var r=0;r-1&&e.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},_.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},_.prototype.checkBinding=function(e,t){var o=this,i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach(function(e){-1==o.pressedKeys.indexOf(e)&&(i=!1)}),i&&t.action.call(o,e),!0)},_.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},_.prototype.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,o=t.scrollTop-t.height;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o>=0?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,o=t.scrollTop+t.height,i=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(o<=i?t.element.scrollTop=o:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().prev())},navNext:function(e){var t,o=!1,i=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(e.preventDefault(),t=o.nav(),t.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(Object.assign({},i)),i.then(function(){setTimeout(function(){t.next()})})))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().left())},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().right())},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().up())},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().down())},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},d.prototype.registerModule("keybindings",_);var P=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1};P.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="⋮",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},P.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;o.stopImmediatePropagation(),t.loadMenu(o,e,i)})},P.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;t.loadMenu(o,e,i)})},P.prototype.initializeGroup=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.groupContextMenu?t.table.options.groupContextMenu(e.getComponent()):t.table.options.groupContextMenu;t.loadMenu(o,e,i)})},P.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);if(e.preventDefault(),o&&o.length){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout(function(){i.nestedMenuBlock=!1},100);this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach(function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(e){e.stopPropagation()})):o.addEventListener("click",function(o){i.hideMenu(),e.action(o,t.getComponent())})),i.menuEl.appendChild(o)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.addEventListener("keydown",this.escEvent),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px")}},P.prototype.isOpen=function(){return!!this.menuEl.parentNode},P.prototype.escMenu=function(e){27==e.keyCode&&this.hideMenu()},P.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.escEvent&&document.body.removeEventListener("keydown",this.escEvent),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},P.prototype.menus={},d.prototype.registerModule("menu",P);var F=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};F.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},F.prototype.initializeColumn=function(e){var t,o=this,i={};e.modules.frozen||(t=e.getElement(),i.mousemove=function(i){e.parent===o.moving.parent&&((o.touchMove?i.touches[0].pageX:i.pageX)-d.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=i},F.prototype.bindTouchEvents=function(e){var t,o,i,n,s,r,a,l=this,c=e.getElement(),u=!1;c.addEventListener("touchstart",function(c){l.checkTimeout=setTimeout(function(){l.touchMove=!0,t=e,o=e.nextColumn(),n=o?o.getWidth()/2:0,i=e.prevColumn(),s=i?i.getWidth()/2:0,r=0,a=0,u=!1,l.startMove(c,e)},l.checkPeriod)},{passive:!0}),c.addEventListener("touchmove",function(c){var d,h;l.moving&&(l.moveHover(c),u||(u=c.touches[0].pageX),d=c.touches[0].pageX-u,d>0?o&&d-r>n&&(h=o)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveColumn(h,!0)):i&&-d-a>s&&(h=i)!==e&&(u=c.touches[0].pageX,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveColumn(h,!1)),h&&(t=h,o=h.nextColumn(),r=n,n=o?o.getWidth()/2:0,i=h.prevColumn(),a=s,s=i?i.getWidth()/2:0))},{passive:!0}),c.addEventListener("touchend",function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&l.endMove(e)})},F.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)},F.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},F.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i.nextSibling)}):e.getCells().forEach(function(e,t){var i=e.getElement();i.parentNode.insertBefore(o[t].getElement(),i)})},F.prototype.endMove=function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},F.prototype.moveHover=function(e){var t,o=this,i=o.table.columnManager.getElement(),n=i.scrollLeft,s=(o.touchMove?e.touches[0].pageX:e.pageX)-d.prototype.helpers.elOffset(i).left+n;o.hoverElement.style.left=s-o.startX+"px",s-ne.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(t.placeholderElement,i.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var i=e.getElement();i.previousSibling&&(i.parentNode.insertBefore(t.placeholderElement,i),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},N.prototype.initializeRow=function(e){var t,o=this,i={};i.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),i.mousemove=function(t){if(t.pageY-d.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var i=e.getElement();i.parentNode.insertBefore(o.placeholderElement,i),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i},N.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},N.prototype.bindTouchEvents=function(e,t){var o,i,n,s,r,a,l,c=this,u=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,i=e.nextRow(),s=i?i.getHeight()/2:0,n=e.prevRow(),r=n?n.getHeight()/2:0,a=0,l=0,u=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var d,h;c.moving&&(t.preventDefault(),c.moveHover(t),u||(u=t.touches[0].pageY),d=t.touches[0].pageY-u,d>0?i&&d-a>s&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement().nextSibling),c.moveRow(h,!0)):n&&-d-l>r&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(c.placeholderElement,h.getElement()),c.moveRow(h,!1)),h&&(o=h,i=h.nextRow(),a=s,s=i?i.getHeight()/2:0,n=h.prevRow(),l=r,r=n?n.getHeight()/2:0))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},N.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},N.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},N.prototype.setStartPosition=function(e,t){var o,i,n=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY;o=t.getElement(),this.connection?(i=o.getBoundingClientRect(),this.startX=i.left-n+window.pageXOffset,this.startY=i.top-s+window.pageYOffset):this.startY=s-o.getBoundingClientRect().top},N.prototype.endMove=function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},N.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},N.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},N.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,i=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+o;this.hoverElement.style.top=i-this.startY+"px"},N.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"},N.prototype.elementRowDrop=function(e,t,o){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(e,t,!!o&&o.getComponent())},N.prototype.connectToTables=function(e){var t,o=this;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(e){"string"==typeof e?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):o.connectionElements.push(e)}),this.connectionElements.forEach(function(e){var t=function(t){o.elementRowDrop(t,e,o.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")}))},N.prototype.disconnectFromTables=function(){var e;this.connectionSelectorsTables&&(e=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent})},N.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},N.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},N.prototype.dropComplete=function(e,t,o){var i=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},N.prototype.tableRowDrop=function(e,t){var o=!1,i=!1;switch(console.trace("drop"),e.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?i=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:i})},N.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},N.prototype.senders={delete:function(e,t,o){e.delete()}},N.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},d.prototype.registerModule("moveRow",N);var B=function(e){this.table=e,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};B.prototype.initializeColumn=function(e){var t=this,o=!1,i={};this.allowedTypes.forEach(function(n){var s,r="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));e.definition[r]&&(s=t.lookupMutator(e.definition[r]))&&(o=!0,i[r]={mutator:s,params:e.definition[r+"Params"]||{}})}),o&&(e.modules.mutate=i)},B.prototype.lookupMutator=function(e){var t=!1;switch(void 0===e?"undefined":_typeof(e)){case"string":this.mutators[e]?t=this.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t},B.prototype.transformRow=function(e,t,o){var i,n=this,s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&n.table.columnManager.traverse(function(n){var r,a,l;n.modules.mutate&&(r=n.modules.mutate[s]||n.modules.mutate.mutator||!1)&&(i=n.getFieldValue(void 0!==o?o:e),"data"!=t&&void 0===i||(l=n.getComponent(),a="function"==typeof r.params?r.params(i,e,t,l):r.params,n.setFieldValue(e,r.mutator(i,e,t,a,l))))}),e},B.prototype.transformCell=function(e,t){var o=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,i={};return o?(i=Object.assign(i,e.row.getData()),e.column.setFieldValue(i,t),o.mutator(t,i,"edit",o.params,e.getComponent())):t},B.prototype.enable=function(){this.enabled=!0},B.prototype.disable=function(){this.enabled=!1},B.prototype.mutators={},d.prototype.registerModule("mutator",B);var O=function(e){this.table=e,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};O.prototype.createElements=function(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},O.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var o=1;o<5;o++)t.push(this.size*o);this.pageSizes=t}else t=this.pageSizes -;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var o=document.createElement("option");o.value=t,!0===t?e.table.modules.localize.bind("pagination|all",function(e){o.innerHTML=e}):o.innerHTML=t,e.pageSizeSelect.appendChild(o)}),this.pageSizeSelect.value=this.size}},O.prototype.initialize=function(e){var t,o,i,n=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),n.table.modules.localize.bind("pagination|first",function(e){n.firstBut.innerHTML=e}),n.table.modules.localize.bind("pagination|first_title",function(e){n.firstBut.setAttribute("aria-label",e),n.firstBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|prev",function(e){n.prevBut.innerHTML=e}),n.table.modules.localize.bind("pagination|prev_title",function(e){n.prevBut.setAttribute("aria-label",e),n.prevBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|next",function(e){n.nextBut.innerHTML=e}),n.table.modules.localize.bind("pagination|next_title",function(e){n.nextBut.setAttribute("aria-label",e),n.nextBut.setAttribute("title",e)}),n.table.modules.localize.bind("pagination|last",function(e){n.lastBut.innerHTML=e}),n.table.modules.localize.bind("pagination|last_title",function(e){n.lastBut.setAttribute("aria-label",e),n.lastBut.setAttribute("title",e)}),n.firstBut.addEventListener("click",function(){n.setPage(1)}),n.prevBut.addEventListener("click",function(){n.previousPage()}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max)}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(e){n.pageSizeSelect.setAttribute("aria-label",e),n.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),n.element.appendChild(t),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(e){n.setPageSize("true"==n.pageSizeSelect.value||n.pageSizeSelect.value),n.setPage(1).then(function(){}).catch(function(){})})),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||e||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.table.options.paginationSize?n.size=n.table.options.paginationSize:(o=document.createElement("div"),o.classList.add("tabulator-row"),o.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",o.appendChild(i),n.table.rowManager.getTableElement().appendChild(o),n.size=Math.floor(n.table.rowManager.getElement().clientHeight/o.offsetHeight),n.table.rowManager.getTableElement().removeChild(o)),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},O.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},O.prototype.setDisplayIndex=function(e){this.displayIndex=e},O.prototype.getDisplayIndex=function(){return this.displayIndex},O.prototype.setMaxRows=function(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)},O.prototype.reset=function(e,t){return("local"==this.mode||e)&&(this.page=1),t&&(this.initialLoad=!0),!0},O.prototype.setMaxPage=function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())},O.prototype.setPage=function(e){var t=this,o=this;switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return new Promise(function(i,n){e=parseInt(e),e>0&&e<=t.max?(t.page=e,t.trigger().then(function(){i()}).catch(function(){n()}),o.table.options.persistence&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.config.page&&o.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+t.max+":",e),n())})},O.prototype.setPageToRow=function(e){var t=this;return new Promise(function(o,i){var n=t.table.rowManager.getDisplayRows(t.displayIndex-1),s=n.indexOf(e);if(s>-1){var r=!0===t.size?1:Math.ceil((s+1)/t.size);t.setPage(r).then(function(){o()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},O.prototype.setPageSize=function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")},O.prototype._setPageButtons=function(){for(var e=this,t=Math.floor((this.count-1)/2),o=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&s<=e.max&&e.pagesElement.appendChild(e._generatePageButton(s));this.footerRedraw()},O.prototype._generatePageButton=function(e){var t=this,o=document.createElement("button");return o.classList.add("tabulator-page"),e==t.page&&o.classList.add("active"),o.setAttribute("type","button"),o.setAttribute("role","button"),t.table.modules.localize.bind("pagination|page_title",function(t){o.setAttribute("aria-label",t+" "+e),o.setAttribute("title",t+" "+e)}),o.setAttribute("data-page",e),o.textContent=e,o.addEventListener("click",function(o){t.setPage(e)}),o},O.prototype.previousPage=function(){var e=this;return new Promise(function(t,o){e.page>1?(e.page--,e.trigger().then(function(){t()}).catch(function(){o()}),e.table.options.persistence&&e.table.modExists("persistence",!0)&&e.table.modules.persistence.config.page&&e.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),o())})},O.prototype.nextPage=function(){var e=this;return new Promise(function(t,o){e.pagen?i.splice(n,0,e):i.push(e))}),i},I.prototype._findColumn=function(e,t){var o=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(o){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},I.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)},I.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},I.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(data.groupHeader=this.table.options.groupHeader)),data},I.prototype.getPageConfig=function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e},I.prototype.parseColumns=function(e){var t=this,o=[];return e.forEach(function(e){var i,n={},s=e.getDefinition();e.isGroup?(n.title=s.title,n.columns=t.parseColumns(e.getColumns())):(n.field=e.getField(),!0===t.config.columns||void 0==t.config.columns?(i=Object.keys(s),i.push("width")):i=t.config.columns,i.forEach(function(t){switch(t){case"width":n.width=e.getWidth();break;case"visible":n.visible=e.visible;break;default:n[t]=s[t]}})),o.push(n)}),o},I.prototype.readers={local:function(e,t){var o=localStorage.getItem(e+"-"+t);return!!o&&JSON.parse(o)},cookie:function(e,t){var o,i,n=document.cookie,s=e+"-"+t,r=n.indexOf(s+"=");return r>-1&&(n=n.substr(r),o=n.indexOf(";"),o>-1&&(n=n.substr(0,o)),i=n.replace(s+"=","")),!!i&&JSON.parse(i)}},I.prototype.writers={local:function(e,t,o){localStorage.setItem(e+"-"+t,JSON.stringify(o))},cookie:function(e,t,o){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(o)+"; expires="+i.toUTCString()}},d.prototype.registerModule("persistence",I);var j=function(e){this.table=e,this.element=!1,this.manualBlock=!1};j.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},j.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))},j.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")},j.prototype.printFullscreen=function(e,t,o){var i,n,s=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),c=this.table.modules.export.genereateTable(void 0!==o?o:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof i?a.innerHTML=i:a.appendChild(i),this.element.appendChild(a)),this.element.appendChild(c),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),n="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof n?l.innerHTML=n:l.appendChild(n),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,c),window.print(),this.cleanup(),window.scrollTo(s,r),this.manualBlock=!1},d.prototype.registerModule("print",j);var V=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};V.prototype.watchData=function(e){var t,o=this;this.currentVersion++,t=this.currentVersion,o.unwatchData(),o.data=e,o.origFuncs.push=e.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!1)}),o.origFuncs.push.apply(e,arguments)}}),o.origFuncs.unshift=e.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return o.blocked||t!==o.currentVersion||i.forEach(function(e){o.table.rowManager.addRowActual(e,!0)}),o.origFuncs.unshift.apply(e,arguments)}}),o.origFuncs.shift=e.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[0]))&&i.deleteActual(),o.origFuncs.shift.call(e)}}),o.origFuncs.pop=e.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return o.blocked||t!==o.currentVersion||o.data.length&&(i=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]))&&i.deleteActual(),o.origFuncs.pop.call(e)}}),o.origFuncs.splice=e.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,n=Array.from(arguments),s=n[0]<0?e.length+n[0]:n[0],r=n[1],a=!!n[2]&&n.slice(2);if(!o.blocked&&t===o.currentVersion){if(a&&(i=!!e[s]&&o.table.rowManager.getRowFromDataObject(e[s]),i?a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,i,!0)}):(a=a.slice().reverse(),a.forEach(function(e){o.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(s,void 0===n[1]?n[1]:s+r);l.forEach(function(e,t){var i=o.table.rowManager.getRowFromDataObject(e);i&&i.deleteActual(t!==l.length-1)})}(a||0!==r)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(e,arguments)}})},V.prototype.unwatchData=function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},V.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var o in t)this.watchKey(e,t,o);this.blocked=!1},V.prototype.watchKey=function(e,t,o){var i=this,n=Object.getOwnPropertyDescriptor(t,o),s=t[o],r=this.currentVersion;Object.defineProperty(t,o,{set:function(t){if(s=t,!i.blocked&&r===i.currentVersion){var a={};a[o]=t,e.updateData(a)}n.set&&n.set(t)},get:function(){return n.get&&n.get(),s}})},V.prototype.unwatchRow=function(e){var t=e.getData();for(var o in t)Object.defineProperty(t,o,{value:t[o]})},V.prototype.block=function(){this.blocked=!0},V.prototype.unblock=function(){this.blocked=!1},d.prototype.registerModule("reactiveData",V);var W=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};W.prototype.initializeColumn=function(e,t,o){var i=this,n=!1,s=this.table.options.resizableColumns;if("header"===e&&(n="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:n}),!0===s||s==e){var r=document.createElement("div");r.className="tabulator-col-resize-handle";var a=document.createElement("div");a.className="tabulator-col-resize-handle prev",r.addEventListener("click",function(e){e.stopPropagation()});var l=function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(i.startColumn=t,i._mouseDown(e,o,r))};r.addEventListener("mousedown",l),r.addEventListener("touchstart",l,{passive:!0}),r.addEventListener("dblclick",function(e){var o=t.getLastColumn();o&&i._checkResizability(o)&&(e.stopPropagation(),o.reinitializeWidth(!0))}),a.addEventListener("click",function(e){e.stopPropagation()});var c=function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(i.startColumn=t,i._mouseDown(e,s,a)))};a.addEventListener("mousedown",c),a.addEventListener("touchstart",c,{passive:!0}),a.addEventListener("dblclick",function(e){var o,n,s;(o=t.getFirstColumn())&&(n=i.table.columnManager.findColumnIndex(o),(s=n>0&&i.table.columnManager.getColumnByIndex(n-1))&&i._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),o.appendChild(r),o.appendChild(a)}},W.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},W.prototype._mouseDown=function(e,t,o){function i(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeColumns",W);var G=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};G.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",i.addEventListener("click",function(e){e.stopPropagation()});var s=function(o){t.startRow=e,t._mouseDown(o,e,i)};i.addEventListener("mousedown",s),i.addEventListener("touchstart",s,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var i=t.table.rowManager.prevDisplayRow(e);i&&(t.startRow=i,t._mouseDown(o,i,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(i),o.appendChild(n)},G.prototype._mouseDown=function(e,t,o){function i(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",i),document.body.removeEventListener("mousemove",i),o.removeEventListener("touchmove",i),o.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",i,{passive:!0}),o.addEventListener("touchend",n)},d.prototype.registerModule("resizeRows",G);var U=function(e){this.table=e,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};U.prototype.initialize=function(e){var t,o=this,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.tableHeight==t&&o.tableWidth==n||(o.tableHeight=t,o.tableWidth=n,i.element.parentNode&&(o.containerHeight=i.element.parentNode.clientHeight,o.containerWidth=i.element.parentNode.clientWidth),i.redraw())}}),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),n=Math.floor(e[0].contentRect.width);o.containerHeight==t&&o.containerWidth==n||(o.containerHeight=t,o.containerWidth=n,o.tableHeight=i.element.clientHeight,o.tableWidth=i.element.clientWidth,i.redraw()),i.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&i.redraw()},window.addEventListener("resize",this.binding))},U.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},d.prototype.registerModule("resizeTable",U);var Y=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};Y.prototype.initialize=function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(o,i){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=i,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();for(var o=this.table.columnManager.columnsByIndex,i=Array.isArray(o),n=0,o=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var r=s;if("responsiveCollapse"==r.definition.formatter){this.collapseHandleColumn=r;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},Y.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},Y.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},Y.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},Y.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},Y.prototype.hideColumn=function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())},Y.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},Y.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),i=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-o;if(i<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var s=e.columns[e.index-1] -;s&&i>0&&i>=s.getWidth()?(e.showColumn(s),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},Y.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},Y.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},Y.prototype.generateCollapsedRowData=function(e){var t,o=this,i=e.getData(),n=[];return this.hiddenColumns.forEach(function(s){var r=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return r},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return s.getComponent()}},n.push({title:s.definition.title,value:s.modules.format.formatter.call(o.table.modules.format,t,s.modules.format.params)})):n.push({title:s.definition.title,value:r}))}),n},Y.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+=""+e.title+""+e.value+""}),t.innerHTML=o,Object.keys(e).length?t:""},d.prototype.registerModule("responsiveLayout",Y);var q=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};q.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},q.prototype.initializeRow=function(e){var t=this,o=e.getElement(),i=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var i=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),n=t.table.rowManager.getDisplayRowIndex(e),s=i<=n?i:n,r=i>=n?i:n,a=t.table.rowManager.getDisplayRows().slice(0),l=a.splice(s,r-s+1);o.ctrlKey||o.metaKey?(l.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.lengtht.table.options.selectable&&(l=l.slice(0,t.table.options.selectable)),t.selectRows(l)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},q.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},q.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},q.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(e);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),t||this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},q.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},q.prototype.deselectRows=function(e,t){var o,i=this;if(void 0===e){o=i.selectedRows.length;for(var n=0;n-1&&(n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),n.getElement().classList.remove("tabulator-selected"),i.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),t||i.table.options.rowDeselected.call(this.table,n.getComponent()),i._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},q.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},q.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},q.prototype._rowSelectionChanged=function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},q.prototype.registerRowSelectCheckbox=function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t},q.prototype.registerHeaderSelectCheckbox=function(e){this.headerCheckboxElement=e},q.prototype.childRowSelection=function(e,t){var o=this.table.modules.dataTree.getChildren(e);if(t)for(var i=o,n=Array.isArray(i),s=0,i=n?i:i[Symbol.iterator]();;){var r;if(n){if(s>=i.length)break;r=i[s++]}else{if(s=i.next(),s.done)break;r=s.value}var a=r;this._selectRow(a,!0)}else for(var l=o,c=Array.isArray(l),u=0,l=c?l:l[Symbol.iterator]();;){var d;if(c){if(u>=l.length)break;d=l[u++]}else{if(u=l.next(),u.done)break;d=u.value}var h=d;this._deselectRow(h,!0)}},d.prototype.registerModule("selectRow",q);var X=function(e){this.table=e,this.sortList=[],this.changed=!1};X.prototype.initializeColumn=function(e,t){var o,i,n=this,s=!1;switch(_typeof(e.definition.sorter)){case"string":n.sorters[e.definition.sorter]?s=n.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:void 0!==e.definition.headerSortTristate?e.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===e.definition.headerSort?!1!==this.table.options.headerSort:!1!==e.definition.headerSort)&&(o=e.getElement(),o.classList.add("tabulator-sortable"),i=document.createElement("div"),i.classList.add("tabulator-arrow"),t.appendChild(i),o.addEventListener("click",function(t){var o="",i=[],s=!1;if(e.modules.sort){if(e.modules.sort.tristate)o="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(t){return t.field===e.getField()}),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},X.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},X.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},X.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)}),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},X.prototype.clear=function(){this.setSort([])},X.prototype.findSorter=function(e){var t,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),e.getField()))switch(t=e.getFieldValue(o),void 0===t?"undefined":_typeof(t)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},X.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[],n=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table,t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):(o.forEach(function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)}),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&(e.forEach(function(e){n.push(e.getComponent())}),t.table.options.dataSorted.call(t.table,t.getSort(),n))},X.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))})},X.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},X.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort(function(e,n){for(var s,r=i;r>=0;r--){var a=t[r];if(0!==(s=o._sortRow(e,n,a.column,a.dir,a.params)))break}return s})},X.prototype._sortRow=function(e,t,o,i,n){var s,r,a="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(a.getData()),t=o.getFieldValue(l.getData()),e=void 0!==e?e:"",t=void 0!==t?t:"",s=a.getComponent(),r=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,r,o.getComponent(),i,n)},X.prototype.sorters={number:function(e,t,o,i,n,s,r){var a=r.alignEmptyValues,l=r.decimalSeparator||".",c=r.thousandSeparator||",",u=0;if(e=parseFloat(String(e).split(c).join("").split(l).join(".")),t=parseFloat(String(t).split(c).join("").split(l).join(".")),isNaN(e))u=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;u=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(u*=-1),u},string:function(e,t,o,i,n,s,r){var a,l=r.alignEmptyValues,c=0;if(e){if(t){switch(_typeof(r.locale)){case"boolean":r.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}c=1}else c=t?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,r){return r.format||(r.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},time:function(e,t,o,i,n,s,r){return r.format||(r.format="HH:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},datetime:function(e,t,o,i,n,s,r){var a=r.format||"DD/MM/YYYY HH:mm:ss",l=r.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(e=moment(e,a),t=moment(t,a),e.isValid()){if(t.isValid())return e-t;c=1}else c=t.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(e,t,o,i,n,s,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,o,i,n,s,r){function a(e){switch(u){case"length":return e.length;case"sum":return e.reduce(function(e,t){return e+t});case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce(function(e,t){return e+t})/e.length}}var l=0,c=0,u=r.type||"length",d=r.alignEmptyValues,h=0;if(Array.isArray(e)){if(Array.isArray(t))return l=e?a(e):0,c=t?a(t):0,l-c;d=1}else d=Array.isArray(t)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(h*=-1),h},exists:function(e,t,o,i,n,s,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,o,i,n,s,r){var a,l,c,u,d,h=0,p=/(\d+)|(\D+)/g,m=/\d/,f=r.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if(a=String(e).toLowerCase(),l=String(t).toLowerCase(),a===l)return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),d=a.length>l.length?l.length:a.length;hu?1:-1;return a.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===s||"bottom"===f&&"asc"===s)&&(g*=-1),g}},d.prototype.registerModule("sort",X);var K=function(e){this.table=e,this.invalidCells=[]};return K.prototype.initializeColumn=function(e){var t,o=this,i=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(function(e){(t=o._extractValidator(e))&&i.push(t)}):(t=this._extractValidator(e.definition.validator))&&i.push(t),e.modules.validate=!!i.length&&i)},K.prototype._extractValidator=function(e){var t,o,i;switch(void 0===e?"undefined":_typeof(e)){case"string":return i=e.indexOf(":"),i>-1?(t=e.substring(0,i),o=e.substring(i+1)):t=e,this._buildValidator(t,o);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}},K.prototype._buildValidator=function(e,t){var o="function"==typeof e?e:this.validators[e];return o?{type:"function"==typeof e?"function":e,func:o,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)},K.prototype.validate=function(e,t,o){var i=this,n=[],s=this.invalidCells.indexOf(t);return e&&e.forEach(function(e){e.func.call(i,t.getComponent(),o,e.params)||n.push({type:e.type,parameters:e.params})}),n=!n.length||n,t.modules.validate||(t.modules.validate={}),!0===n?(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),s>-1&&this.invalidCells.splice(s,1)):(t.modules.validate.invalid=!0,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==s&&this.invalidCells.push(t)),n},K.prototype.getInvalidCells=function(){var e=[];return this.invalidCells.forEach(function(t){e.push(t.getComponent())}),e},K.prototype.clearValidation=function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.element.classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))},K.prototype.validators={integer:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,o){return""===t||null===t||void 0===t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,o){return""===t||null===t||void 0===t||!isNaN(t)},string:function(e,t,o){return""===t||null===t||void 0===t||isNaN(t)},max:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)<=o},min:function(e,t,o){return""===t||null===t||void 0===t||parseFloat(t)>=o},starts:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().startsWith(String(o).toLowerCase())},ends:function(e,t,o){return""===t||null===t||void 0===t||String(t).toLowerCase().endsWith(String(o).toLowerCase())},minLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length>=o},maxLength:function(e,t,o){return""===t||null===t||void 0===t||String(t).length<=o},in:function(e,t,o){return""===t||null===t||void 0===t||("string"==typeof o&&(o=o.split("|")),""===t||o.indexOf(t)>-1)},regex:function(e,t,o){return""===t||null===t||void 0===t||new RegExp(o).test(t)},unique:function(e,t,o){if(""===t||null===t||void 0===t)return!0;var i=!0,n=e.getData(),s=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(e){var o=e.getData();o!==n&&t==s.getFieldValue(o)&&(i=!1)}),i},required:function(e,t,o){return""!==t&&null!==t&&void 0!==t}},d.prototype.registerModule("validate",K),d}); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/tabulator_core.js b/app/static/vendors/tabulator/js/tabulator_core.js deleted file mode 100644 index 1c4797a..0000000 --- a/app/static/vendors/tabulator/js/tabulator_core.js +++ /dev/null @@ -1,8906 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ - -'use strict'; - -// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -if (!Array.prototype.findIndex) { - - Object.defineProperty(Array.prototype, 'findIndex', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - var k = 0; - - // 6. Repeat, while k < len - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - // b. Let kValue be ? Get(O, Pk). - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - // d. If testResult is true, return k. - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return k; - } - - // e. Increase k by 1. - - k++; - } - - // 7. Return -1. - - return -1; - } - - }); -} - -// https://tc39.github.io/ecma262/#sec-array.prototype.find - -if (!Array.prototype.find) { - - Object.defineProperty(Array.prototype, 'find', { - - value: function value(predicate) { - - // 1. Let O be ? ToObject(this value). - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - - if (typeof predicate !== 'function') { - - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - - var thisArg = arguments[1]; - - // 5. Let k be 0. - - var k = 0; - - // 6. Repeat, while k < len - - while (k < len) { - - // a. Let Pk be ! ToString(k). - - // b. Let kValue be ? Get(O, Pk). - - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - - // d. If testResult is true, return kValue. - - var kValue = o[k]; - - if (predicate.call(thisArg, kValue, k, o)) { - - return kValue; - } - - // e. Increase k by 1. - - k++; - } - - // 7. Return undefined. - - return undefined; - } - - }); -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill - -if (!String.prototype.includes) { - - String.prototype.includes = function (search, start) { - - 'use strict'; - - if (search instanceof RegExp) { - - throw TypeError('first argument must not be a RegExp'); - } - - if (start === undefined) { - start = 0; - } - - return this.indexOf(search, start) !== -1; - }; -} - -// https://tc39.github.io/ecma262/#sec-array.prototype.includes - -if (!Array.prototype.includes) { - - Object.defineProperty(Array.prototype, 'includes', { - - value: function value(searchElement, fromIndex) { - - if (this == null) { - - throw new TypeError('"this" is null or not defined'); - } - - // 1. Let O be ? ToObject(this value). - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - - var len = o.length >>> 0; - - // 3. If len is 0, return false. - - if (len === 0) { - - return false; - } - - // 4. Let n be ? ToInteger(fromIndex). - - // (If fromIndex is undefined, this step produces the value 0.) - - var n = fromIndex | 0; - - // 5. If n ≥ 0, then - - // a. Let k be n. - - // 6. Else n < 0, - - // a. Let k be len + n. - - // b. If k < 0, let k be 0. - - var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - - function sameValueZero(x, y) { - - return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y); - } - - // 7. Repeat, while k < len - - while (k < len) { - - // a. Let elementK be the result of ? Get(O, ! ToString(k)). - - // b. If SameValueZero(searchElement, elementK) is true, return true. - - if (sameValueZero(o[k], searchElement)) { - - return true; - } - - // c. Increase k by 1. - - k++; - } - - // 8. Return false - - return false; - } - - }); -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill - -if (typeof Object.assign !== 'function') { - - // Must be writable: true, enumerable: false, configurable: true - - Object.defineProperty(Object, "assign", { - - value: function assign(target, varArgs) { - // .length of function is 2 - - 'use strict'; - - if (target === null || target === undefined) { - - throw new TypeError('Cannot convert undefined or null to object'); - } - - var to = Object(target); - - for (var index = 1; index < arguments.length; index++) { - - var nextSource = arguments[index]; - - if (nextSource !== null && nextSource !== undefined) { - - for (var nextKey in nextSource) { - - // Avoid bugs when hasOwnProperty is shadowed - - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - - to[nextKey] = nextSource[nextKey]; - } - } - } - } - - return to; - }, - - writable: true, - - configurable: true - - }); -} - -var ColumnManager = function ColumnManager(table) { - - this.table = table; //hold parent table - - this.blockHozScrollEvent = false; - - this.headersElement = this.createHeadersElement(); - - this.element = this.createHeaderElement(); //containing element - - this.rowManager = null; //hold row manager object - - this.columns = []; // column definition object - - this.columnsByIndex = []; //columns by index - - this.columnsByField = {}; //columns by field - - this.scrollLeft = 0; - - this.element.insertBefore(this.headersElement, this.element.firstChild); -}; - -////////////// Setup Functions ///////////////// - - -ColumnManager.prototype.createHeadersElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-headers"); - - return el; -}; - -ColumnManager.prototype.createHeaderElement = function () { - - var el = document.createElement("div"); - - el.classList.add("tabulator-header"); - - if (!this.table.options.headerVisible) { - - el.classList.add("tabulator-header-hidden"); - } - - return el; -}; - -ColumnManager.prototype.initialize = function () { - - var self = this; - - //scroll body along with header - - // self.element.addEventListener("scroll", function(e){ - - // if(!self.blockHozScrollEvent){ - - // self.table.rowManager.scrollHorizontal(self.element.scrollLeft); - - // } - - // }); -}; - -//link to row manager - -ColumnManager.prototype.setRowManager = function (manager) { - - this.rowManager = manager; -}; - -//return containing element - -ColumnManager.prototype.getElement = function () { - - return this.element; -}; - -//return header containing element - -ColumnManager.prototype.getHeadersElement = function () { - - return this.headersElement; -}; - -// ColumnManager.prototype.tempScrollBlock = function(){ - -// clearTimeout(this.blockHozScrollEvent); - -// this.blockHozScrollEvent = setTimeout(() => {this.blockHozScrollEvent = false;}, 50); - -// } - - -//scroll horizontally to match table body - -ColumnManager.prototype.scrollHorizontal = function (left) { - - var hozAdjust = 0, - scrollWidth = this.element.scrollWidth - this.table.element.clientWidth; - - // this.tempScrollBlock(); - - this.element.scrollLeft = left; - - //adjust for vertical scrollbar moving table when present - - if (left > scrollWidth) { - - hozAdjust = left - scrollWidth; - - this.element.style.marginLeft = -hozAdjust + "px"; - } else { - - this.element.style.marginLeft = 0; - } - - //keep frozen columns fixed in position - - //this._calcFrozenColumnsPos(hozAdjust + 3); - - - this.scrollLeft = left; - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.scrollHorizontal(); - } -}; - -///////////// Column Setup Functions ///////////// - - -ColumnManager.prototype.generateColumnsFromRowData = function (data) { - - var cols = [], - row, - sorter; - - if (data && data.length) { - - row = data[0]; - - for (var key in row) { - - var col = { - - field: key, - - title: key - - }; - - var value = row[key]; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - - case "undefined": - - sorter = "string"; - - break; - - case "boolean": - - sorter = "boolean"; - - break; - - case "object": - - if (Array.isArray(value)) { - - sorter = "array"; - } else { - - sorter = "string"; - } - - break; - - default: - - if (!isNaN(value) && value !== "") { - - sorter = "number"; - } else { - - if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) { - - sorter = "alphanum"; - } else { - - sorter = "string"; - } - } - - break; - - } - - col.sorter = sorter; - - cols.push(col); - } - - this.table.options.columns = cols; - - this.setColumns(this.table.options.columns); - } -}; - -ColumnManager.prototype.setColumns = function (cols, row) { - - var self = this; - - while (self.headersElement.firstChild) { - self.headersElement.removeChild(self.headersElement.firstChild); - }self.columns = []; - - self.columnsByIndex = []; - - self.columnsByField = {}; - - //reset frozen columns - - if (self.table.modExists("frozenColumns")) { - - self.table.modules.frozenColumns.reset(); - } - - cols.forEach(function (def, i) { - - self._addColumn(def); - }); - - self._reIndexColumns(); - - if (self.table.options.responsiveLayout && self.table.modExists("responsiveLayout", true)) { - - self.table.modules.responsiveLayout.initialize(); - } - - self.redraw(true); -}; - -ColumnManager.prototype._addColumn = function (definition, before, nextToColumn) { - - var column = new Column(definition, this), - colEl = column.getElement(), - index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn; - - if (nextToColumn && index > -1) { - - var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn()); - - var nextEl = nextToColumn.getElement(); - - if (before) { - - this.columns.splice(parentIndex, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl); - } else { - - this.columns.splice(parentIndex + 1, 0, column); - - nextEl.parentNode.insertBefore(colEl, nextEl.nextSibling); - } - } else { - - if (before) { - - this.columns.unshift(column); - - this.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild); - } else { - - this.columns.push(column); - - this.headersElement.appendChild(column.getElement()); - } - - column.columnRendered(); - } - - return column; -}; - -ColumnManager.prototype.registerColumnField = function (col) { - - if (col.definition.field) { - - this.columnsByField[col.definition.field] = col; - } -}; - -ColumnManager.prototype.registerColumnPosition = function (col) { - - this.columnsByIndex.push(col); -}; - -ColumnManager.prototype._reIndexColumns = function () { - - this.columnsByIndex = []; - - this.columns.forEach(function (column) { - - column.reRegisterPosition(); - }); -}; - -//ensure column headers take up the correct amount of space in column groups - -ColumnManager.prototype._verticalAlignHeaders = function () { - - var self = this, - minHeight = 0; - - self.columns.forEach(function (column) { - - var height; - - column.clearVerticalAlign(); - - height = column.getHeight(); - - if (height > minHeight) { - - minHeight = height; - } - }); - - self.columns.forEach(function (column) { - - column.verticalAlign(self.table.options.columnHeaderVertAlign, minHeight); - }); - - self.rowManager.adjustTableSize(); -}; - -//////////////// Column Details ///////////////// - - -ColumnManager.prototype.findColumn = function (subject) { - - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Column) { - - //subject is column element - - return subject; - } else if (subject instanceof ColumnComponent) { - - //subject is public column component - - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - - //subject is a HTML element of the column header - - var match = self.columns.find(function (column) { - - return column.element === subject; - }); - - return match || false; - } - } else { - - //subject should be treated as the field name of the column - - return this.columnsByField[subject] || false; - } - - //catch all for any other type of input - - - return false; -}; - -ColumnManager.prototype.getColumnByField = function (field) { - - return this.columnsByField[field]; -}; - -ColumnManager.prototype.getColumnsByFieldRoot = function (root) { - var _this = this; - - var matches = []; - - Object.keys(this.columnsByField).forEach(function (field) { - - var fieldRoot = field.split(".")[0]; - - if (fieldRoot === root) { - - matches.push(_this.columnsByField[field]); - } - }); - - return matches; -}; - -ColumnManager.prototype.getColumnByIndex = function (index) { - - return this.columnsByIndex[index]; -}; - -ColumnManager.prototype.getFirstVisibileColumn = function (index) { - - var index = this.columnsByIndex.findIndex(function (col) { - - return col.visible; - }); - - return index > -1 ? this.columnsByIndex[index] : false; -}; - -ColumnManager.prototype.getColumns = function () { - - return this.columns; -}; - -ColumnManager.prototype.findColumnIndex = function (column) { - - return this.columnsByIndex.findIndex(function (col) { - - return column === col; - }); -}; - -//return all columns that are not groups - -ColumnManager.prototype.getRealColumns = function () { - - return this.columnsByIndex; -}; - -//travers across columns and call action - -ColumnManager.prototype.traverse = function (callback) { - - var self = this; - - self.columnsByIndex.forEach(function (column, i) { - - callback(column, i); - }); -}; - -//get defintions of actual columns - -ColumnManager.prototype.getDefinitions = function (active) { - - var self = this, - output = []; - - self.columnsByIndex.forEach(function (column) { - - if (!active || active && column.visible) { - - output.push(column.getDefinition()); - } - }); - - return output; -}; - -//get full nested definition tree - -ColumnManager.prototype.getDefinitionTree = function () { - - var self = this, - output = []; - - self.columns.forEach(function (column) { - - output.push(column.getDefinition(true)); - }); - - return output; -}; - -ColumnManager.prototype.getComponents = function (structured) { - - var self = this, - output = [], - columns = structured ? self.columns : self.columnsByIndex; - - columns.forEach(function (column) { - - output.push(column.getComponent()); - }); - - return output; -}; - -ColumnManager.prototype.getWidth = function () { - - var width = 0; - - this.columnsByIndex.forEach(function (column) { - - if (column.visible) { - - width += column.getWidth(); - } - }); - - return width; -}; - -ColumnManager.prototype.moveColumn = function (from, to, after) { - - this.moveColumnActual(from, to, after); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - to.element.parentNode.insertBefore(from.element, to.element); - - if (after) { - - to.element.parentNode.insertBefore(to.element, from.element); - } - - this._verticalAlignHeaders(); - - this.table.rowManager.reinitialize(); -}; - -ColumnManager.prototype.moveColumnActual = function (from, to, after) { - - if (from.parent.isGroup) { - - this._moveColumnInArray(from.parent.columns, from, to, after); - } else { - - this._moveColumnInArray(this.columns, from, to, after); - } - - this._moveColumnInArray(this.columnsByIndex, from, to, after, true); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - if (this.table.options.columnMoved) { - - this.table.options.columnMoved.call(this.table, from.getComponent(), this.table.columnManager.getComponents()); - } - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } -}; - -ColumnManager.prototype._moveColumnInArray = function (columns, from, to, after, updateRows) { - - var fromIndex = columns.indexOf(from), - toIndex; - - if (fromIndex > -1) { - - columns.splice(fromIndex, 1); - - toIndex = columns.indexOf(to); - - if (toIndex > -1) { - - if (after) { - - toIndex = toIndex + 1; - } - } else { - - toIndex = fromIndex; - } - - columns.splice(toIndex, 0, from); - - if (updateRows) { - - this.table.rowManager.rows.forEach(function (row) { - - if (row.cells.length) { - - var cell = row.cells.splice(fromIndex, 1)[0]; - - row.cells.splice(toIndex, 0, cell); - } - }); - } - } -}; - -ColumnManager.prototype.scrollToColumn = function (column, position, ifVisible) { - var _this2 = this; - - var left = 0, - offset = 0, - adjust = 0, - colEl = column.getElement(); - - return new Promise(function (resolve, reject) { - - if (typeof position === "undefined") { - - position = _this2.table.options.scrollToColumnPosition; - } - - if (typeof ifVisible === "undefined") { - - ifVisible = _this2.table.options.scrollToColumnIfVisible; - } - - if (column.visible) { - - //align to correct position - - switch (position) { - - case "middle": - - case "center": - - adjust = -_this2.element.clientWidth / 2; - - break; - - case "right": - - adjust = colEl.clientWidth - _this2.headersElement.clientWidth; - - break; - - } - - //check column visibility - - if (!ifVisible) { - - offset = colEl.offsetLeft; - - if (offset > 0 && offset + colEl.offsetWidth < _this2.element.clientWidth) { - - return false; - } - } - - //calculate scroll position - - left = colEl.offsetLeft + _this2.element.scrollLeft + adjust; - - left = Math.max(Math.min(left, _this2.table.rowManager.element.scrollWidth - _this2.table.rowManager.element.clientWidth), 0); - - _this2.table.rowManager.scrollHorizontal(left); - - _this2.scrollHorizontal(left); - - resolve(); - } else { - - console.warn("Scroll Error - Column not visible"); - - reject("Scroll Error - Column not visible"); - } - }); -}; - -//////////////// Cell Management ///////////////// - - -ColumnManager.prototype.generateCells = function (row) { - - var self = this; - - var cells = []; - - self.columnsByIndex.forEach(function (column) { - - cells.push(column.generateCell(row)); - }); - - return cells; -}; - -//////////////// Column Management ///////////////// - - -ColumnManager.prototype.getFlexBaseWidth = function () { - - var self = this, - totalWidth = self.table.element.clientWidth, - //table element width - - fixedWidth = 0; - - //adjust for vertical scrollbar if present - - if (self.rowManager.element.scrollHeight > self.rowManager.element.clientHeight) { - - totalWidth -= self.rowManager.element.offsetWidth - self.rowManager.element.clientWidth; - } - - this.columnsByIndex.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width || 0; - - minWidth = typeof column.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(column.minWidth); - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - } - }); - - return fixedWidth; -}; - -ColumnManager.prototype.addColumn = function (definition, before, nextToColumn) { - var _this3 = this; - - return new Promise(function (resolve, reject) { - - var column = _this3._addColumn(definition, before, nextToColumn); - - _this3._reIndexColumns(); - - if (_this3.table.options.responsiveLayout && _this3.table.modExists("responsiveLayout", true)) { - - _this3.table.modules.responsiveLayout.initialize(); - } - - if (_this3.table.modExists("columnCalcs")) { - - _this3.table.modules.columnCalcs.recalc(_this3.table.rowManager.activeRows); - } - - _this3.redraw(); - - if (_this3.table.modules.layout.getMode() != "fitColumns") { - - column.reinitializeWidth(); - } - - _this3._verticalAlignHeaders(); - - _this3.table.rowManager.reinitialize(); - - resolve(column); - }); -}; - -//remove column from system - -ColumnManager.prototype.deregisterColumn = function (column) { - - var field = column.getField(), - index; - - //remove from field list - - if (field) { - - delete this.columnsByField[field]; - } - - //remove from index list - - index = this.columnsByIndex.indexOf(column); - - if (index > -1) { - - this.columnsByIndex.splice(index, 1); - } - - //remove from column list - - index = this.columns.indexOf(column); - - if (index > -1) { - - this.columns.splice(index, 1); - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.initialize(); - } - - this.redraw(); -}; - -//redraw columns - -ColumnManager.prototype.redraw = function (force) { - - if (force) { - - if (Tabulator.prototype.helpers.elVisible(this.element)) { - - this._verticalAlignHeaders(); - } - - this.table.rowManager.resetScroll(); - - this.table.rowManager.reinitialize(); - } - - if (["fitColumns", "fitDataStretch"].indexOf(this.table.modules.layout.getMode()) > -1) { - - this.table.modules.layout.layout(); - } else { - - if (force) { - - this.table.modules.layout.layout(); - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - } - - if (this.table.modExists("frozenColumns")) { - - this.table.modules.frozenColumns.layout(); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (force) { - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - - this.table.modules.persistence.save("columns"); - } - - if (this.table.modExists("columnCalcs")) { - - this.table.modules.columnCalcs.redraw(); - } - } - - this.table.footerManager.redraw(); -}; - -//public column object -var ColumnComponent = function ColumnComponent(column) { - this._column = column; - this.type = "ColumnComponent"; -}; - -ColumnComponent.prototype.getElement = function () { - return this._column.getElement(); -}; - -ColumnComponent.prototype.getDefinition = function () { - return this._column.getDefinition(); -}; - -ColumnComponent.prototype.getField = function () { - return this._column.getField(); -}; - -ColumnComponent.prototype.getCells = function () { - var cells = []; - - this._column.cells.forEach(function (cell) { - cells.push(cell.getComponent()); - }); - - return cells; -}; - -ColumnComponent.prototype.getVisibility = function () { - console.warn("getVisibility function is deprecated, you should now use the isVisible function"); - return this._column.visible; -}; - -ColumnComponent.prototype.isVisible = function () { - return this._column.visible; -}; - -ColumnComponent.prototype.show = function () { - if (this._column.isGroup) { - this._column.columns.forEach(function (column) { - column.show(); - }); - } else { - this._column.show(); - } -}; - -ColumnComponent.prototype.hide = function () { - if (this._column.isGroup) { - this._column.columns.forEach(function (column) { - column.hide(); - }); - } else { - this._column.hide(); - } -}; - -ColumnComponent.prototype.toggle = function () { - if (this._column.visible) { - this.hide(); - } else { - this.show(); - } -}; - -ColumnComponent.prototype.delete = function () { - return this._column.delete(); -}; - -ColumnComponent.prototype.getSubColumns = function () { - var output = []; - - if (this._column.columns.length) { - this._column.columns.forEach(function (column) { - output.push(column.getComponent()); - }); - } - - return output; -}; - -ColumnComponent.prototype.getParentColumn = function () { - return this._column.parent instanceof Column ? this._column.parent.getComponent() : false; -}; - -ColumnComponent.prototype._getSelf = function () { - return this._column; -}; - -ColumnComponent.prototype.scrollTo = function () { - return this._column.table.columnManager.scrollToColumn(this._column); -}; - -ColumnComponent.prototype.getTable = function () { - return this._column.table; -}; - -ColumnComponent.prototype.headerFilterFocus = function () { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.setHeaderFilterFocus(this._column); - } -}; - -ColumnComponent.prototype.reloadHeaderFilter = function () { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.reloadHeaderFilter(this._column); - } -}; - -ColumnComponent.prototype.getHeaderFilterValue = function () { - if (this._column.table.modExists("filter", true)) { - return this._column.table.modules.filter.getHeaderFilterValue(this._column); - } -}; - -ColumnComponent.prototype.setHeaderFilterValue = function (value) { - if (this._column.table.modExists("filter", true)) { - this._column.table.modules.filter.setHeaderFilterValue(this._column, value); - } -}; - -ColumnComponent.prototype.move = function (to, after) { - var toColumn = this._column.table.columnManager.findColumn(to); - - if (toColumn) { - this._column.table.columnManager.moveColumn(this._column, toColumn, after); - } else { - console.warn("Move Error - No matching column found:", toColumn); - } -}; - -ColumnComponent.prototype.getNextColumn = function () { - var nextCol = this._column.nextColumn(); - - return nextCol ? nextCol.getComponent() : false; -}; - -ColumnComponent.prototype.getPrevColumn = function () { - var prevCol = this._column.prevColumn(); - - return prevCol ? prevCol.getComponent() : false; -}; - -ColumnComponent.prototype.updateDefinition = function (updates) { - return this._column.updateDefinition(updates); -}; - -ColumnComponent.prototype.getWidth = function () { - return this._column.getWidth(); -}; - -ColumnComponent.prototype.setWidth = function (width) { - if (width === true) { - return this._column.reinitializeWidth(true); - } else { - return this._column.setWidth(width); - } -}; - -ColumnComponent.prototype.validate = function () { - return this._column.validate(); -}; - -var Column = function Column(def, parent) { - var self = this; - - this.table = parent.table; - this.definition = def; //column definition - this.parent = parent; //hold parent object - this.type = "column"; //type of element - this.columns = []; //child columns - this.cells = []; //cells bound to this column - this.element = this.createElement(); //column header element - this.contentElement = false; - this.titleElement = false; - this.groupElement = this.createGroupElement(); //column group holder element - this.isGroup = false; - this.tooltip = false; //hold column tooltip - this.hozAlign = ""; //horizontal text alignment - this.vertAlign = ""; //vert text alignment - - //multi dimensional filed handling - this.field = ""; - this.fieldStructure = ""; - this.getFieldValue = ""; - this.setFieldValue = ""; - - this.titleFormatterRendered = false; - - this.setField(this.definition.field); - - if (this.table.options.invalidOptionWarnings) { - this.checkDefinition(); - } - - this.modules = {}; //hold module variables; - - this.cellEvents = { - cellClick: false, - cellDblClick: false, - cellContext: false, - cellTap: false, - cellDblTap: false, - cellTapHold: false, - cellMouseEnter: false, - cellMouseLeave: false, - cellMouseOver: false, - cellMouseOut: false, - cellMouseMove: false - }; - - this.width = null; //column width - this.widthStyled = ""; //column width prestyled to improve render efficiency - this.minWidth = null; //column minimum width - this.minWidthStyled = ""; //column minimum prestyled to improve render efficiency - this.widthFixed = false; //user has specified a width for this column - - this.visible = true; //default visible state - - this.component = null; - - this._mapDepricatedFunctionality(); - - //initialize column - if (def.columns) { - - this.isGroup = true; - - def.columns.forEach(function (def, i) { - var newCol = new Column(def, self); - self.attachColumn(newCol); - }); - - self.checkColumnVisibility(); - } else { - parent.registerColumnField(this); - } - - if (def.rowHandle && this.table.options.movableRows !== false && this.table.modExists("moveRow")) { - this.table.modules.moveRow.setHandle(true); - } - - this._buildHeader(); - - this.bindModuleColumns(); -}; - -Column.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col"); - el.setAttribute("role", "columnheader"); - el.setAttribute("aria-sort", "none"); - - return el; -}; - -Column.prototype.createGroupElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-col-group-cols"); - - return el; -}; - -Column.prototype.checkDefinition = function () { - var _this4 = this; - - Object.keys(this.definition).forEach(function (key) { - if (_this4.defaultOptionList.indexOf(key) === -1) { - console.warn("Invalid column definition option in '" + (_this4.field || _this4.definition.title) + "' column:", key); - } - }); -}; - -Column.prototype.setField = function (field) { - this.field = field; - this.fieldStructure = field ? this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field] : []; - this.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData; - this.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData; -}; - -//register column position with column manager -Column.prototype.registerColumnPosition = function (column) { - this.parent.registerColumnPosition(column); -}; - -//register column position with column manager -Column.prototype.registerColumnField = function (column) { - this.parent.registerColumnField(column); -}; - -//trigger position registration -Column.prototype.reRegisterPosition = function () { - if (this.isGroup) { - this.columns.forEach(function (column) { - column.reRegisterPosition(); - }); - } else { - this.registerColumnPosition(this); - } -}; - -Column.prototype._mapDepricatedFunctionality = function () { - if (typeof this.definition.hideInHtml !== "undefined") { - this.definition.htmlOutput = !this.definition.hideInHtml; - console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput"); - } - - if (typeof this.definition.align !== "undefined") { - this.definition.hozAlign = this.definition.align; - console.warn("align column definition property is deprecated, you should now use hozAlign"); - } - - if (typeof this.definition.downloadTitle !== "undefined") { - this.definition.titleDownload = this.definition.downloadTitle; - console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"); - } -}; - -Column.prototype.setTooltip = function () { - var self = this, - def = self.definition; - - //set header tooltips - var tooltip = def.headerTooltip || def.tooltip === false ? def.headerTooltip : self.table.options.tooltipsHeader; - - if (tooltip) { - if (tooltip === true) { - if (def.field) { - self.table.modules.localize.bind("columns|" + def.field, function (value) { - self.element.setAttribute("title", value || def.title); - }); - } else { - self.element.setAttribute("title", def.title); - } - } else { - if (typeof tooltip == "function") { - tooltip = tooltip(self.getComponent()); - - if (tooltip === false) { - tooltip = ""; - } - } - - self.element.setAttribute("title", tooltip); - } - } else { - self.element.setAttribute("title", ""); - } -}; - -//build header element -Column.prototype._buildHeader = function () { - var self = this, - def = self.definition; - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - }if (def.headerVertical) { - self.element.classList.add("tabulator-col-vertical"); - - if (def.headerVertical === "flip") { - self.element.classList.add("tabulator-col-vertical-flip"); - } - } - - self.contentElement = self._bindEvents(); - - self.contentElement = self._buildColumnHeaderContent(); - - self.element.appendChild(self.contentElement); - - if (self.isGroup) { - self._buildGroupHeader(); - } else { - self._buildColumnHeader(); - } - - self.setTooltip(); - - //set resizable handles - if (self.table.options.resizableColumns && self.table.modExists("resizeColumns")) { - self.table.modules.resizeColumns.initializeColumn("header", self, self.element); - } - - //set resizable handles - if (def.headerFilter && self.table.modExists("filter") && self.table.modExists("edit")) { - if (typeof def.headerFilterPlaceholder !== "undefined" && def.field) { - self.table.modules.localize.setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder); - } - - self.table.modules.filter.initializeColumn(self); - } - - //set resizable handles - if (self.table.modExists("frozenColumns")) { - self.table.modules.frozenColumns.initializeColumn(self); - } - - //set movable column - if (self.table.options.movableColumns && !self.isGroup && self.table.modExists("moveColumn")) { - self.table.modules.moveColumn.initializeColumn(self); - } - - //set calcs column - if ((def.topCalc || def.bottomCalc) && self.table.modExists("columnCalcs")) { - self.table.modules.columnCalcs.initializeColumn(self); - } - - //handle persistence - if (self.table.modExists("persistence") && self.table.modules.persistence.config.columns) { - self.table.modules.persistence.initializeColumn(self); - } - - //update header tooltip on mouse enter - self.element.addEventListener("mouseenter", function (e) { - self.setTooltip(); - }); -}; - -Column.prototype._bindEvents = function () { - - var self = this, - def = self.definition, - dblTap, - tapHold, - tap; - - //setup header click event bindings - if (typeof def.headerClick == "function") { - self.element.addEventListener("click", function (e) { - def.headerClick(e, self.getComponent()); - }); - } - - if (typeof def.headerDblClick == "function") { - self.element.addEventListener("dblclick", function (e) { - def.headerDblClick(e, self.getComponent()); - }); - } - - if (typeof def.headerContext == "function") { - self.element.addEventListener("contextmenu", function (e) { - def.headerContext(e, self.getComponent()); - }); - } - - //setup header tap event bindings - if (typeof def.headerTap == "function") { - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - def.headerTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (typeof def.headerDblTap == "function") { - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - def.headerDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (typeof def.headerTapHold == "function") { - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - def.headerTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } - - //store column cell click event bindings - if (typeof def.cellClick == "function") { - self.cellEvents.cellClick = def.cellClick; - } - - if (typeof def.cellDblClick == "function") { - self.cellEvents.cellDblClick = def.cellDblClick; - } - - if (typeof def.cellContext == "function") { - self.cellEvents.cellContext = def.cellContext; - } - - //store column mouse event bindings - if (typeof def.cellMouseEnter == "function") { - self.cellEvents.cellMouseEnter = def.cellMouseEnter; - } - - if (typeof def.cellMouseLeave == "function") { - self.cellEvents.cellMouseLeave = def.cellMouseLeave; - } - - if (typeof def.cellMouseOver == "function") { - self.cellEvents.cellMouseOver = def.cellMouseOver; - } - - if (typeof def.cellMouseOut == "function") { - self.cellEvents.cellMouseOut = def.cellMouseOut; - } - - if (typeof def.cellMouseMove == "function") { - self.cellEvents.cellMouseMove = def.cellMouseMove; - } - - //setup column cell tap event bindings - if (typeof def.cellTap == "function") { - self.cellEvents.cellTap = def.cellTap; - } - - if (typeof def.cellDblTap == "function") { - self.cellEvents.cellDblTap = def.cellDblTap; - } - - if (typeof def.cellTapHold == "function") { - self.cellEvents.cellTapHold = def.cellTapHold; - } - - //setup column cell edit callbacks - if (typeof def.cellEdited == "function") { - self.cellEvents.cellEdited = def.cellEdited; - } - - if (typeof def.cellEditing == "function") { - self.cellEvents.cellEditing = def.cellEditing; - } - - if (typeof def.cellEditCancelled == "function") { - self.cellEvents.cellEditCancelled = def.cellEditCancelled; - } -}; - -//build header element for header -Column.prototype._buildColumnHeader = function () { - var self = this, - def = self.definition, - table = self.table, - sortable; - - //set column sorter - if (table.modExists("sort")) { - table.modules.sort.initializeColumn(self, self.contentElement); - } - - //set column header context menu - if ((def.headerContextMenu || def.headerMenu) && table.modExists("menu")) { - table.modules.menu.initializeColumnHeader(self); - } - - //set column formatter - if (table.modExists("format")) { - table.modules.format.initializeColumn(self); - } - - //set column editor - if (typeof def.editor != "undefined" && table.modExists("edit")) { - table.modules.edit.initializeColumn(self); - } - - //set colum validator - if (typeof def.validator != "undefined" && table.modExists("validate")) { - table.modules.validate.initializeColumn(self); - } - - //set column mutator - if (table.modExists("mutator")) { - table.modules.mutator.initializeColumn(self); - } - - //set column accessor - if (table.modExists("accessor")) { - table.modules.accessor.initializeColumn(self); - } - - //set respoviveLayout - if (_typeof(table.options.responsiveLayout) && table.modExists("responsiveLayout")) { - table.modules.responsiveLayout.initializeColumn(self); - } - - //set column visibility - if (typeof def.visible != "undefined") { - if (def.visible) { - self.show(true); - } else { - self.hide(true); - } - } - - //asign additional css classes to column header - if (def.cssClass) { - var classeNames = def.cssClass.split(" "); - classeNames.forEach(function (className) { - self.element.classList.add(className); - }); - } - - if (def.field) { - this.element.setAttribute("tabulator-field", def.field); - } - - //set min width if present - self.setMinWidth(typeof def.minWidth == "undefined" ? self.table.options.columnMinWidth : parseInt(def.minWidth)); - - self.reinitializeWidth(); - - //set tooltip if present - self.tooltip = self.definition.tooltip || self.definition.tooltip === false ? self.definition.tooltip : self.table.options.tooltips; - - //set orizontal text alignment - self.hozAlign = typeof self.definition.hozAlign == "undefined" ? self.table.options.cellHozAlign : self.definition.hozAlign; - self.vertAlign = typeof self.definition.vertAlign == "undefined" ? self.table.options.cellVertAlign : self.definition.vertAlign; -}; - -Column.prototype._buildColumnHeaderContent = function () { - var def = this.definition, - table = this.table; - - var contentElement = document.createElement("div"); - contentElement.classList.add("tabulator-col-content"); - - this.titleElement = this._buildColumnHeaderTitle(); - - contentElement.appendChild(this.titleElement); - - return contentElement; -}; - -//build title element of column -Column.prototype._buildColumnHeaderTitle = function () { - var self = this, - def = self.definition, - table = self.table, - title; - - var titleHolderElement = document.createElement("div"); - titleHolderElement.classList.add("tabulator-col-title"); - - if (def.editableTitle) { - var titleElement = document.createElement("input"); - titleElement.classList.add("tabulator-title-editor"); - - titleElement.addEventListener("click", function (e) { - e.stopPropagation(); - titleElement.focus(); - }); - - titleElement.addEventListener("change", function () { - def.title = titleElement.value; - table.options.columnTitleChanged.call(self.table, self.getComponent()); - }); - - titleHolderElement.appendChild(titleElement); - - if (def.field) { - table.modules.localize.bind("columns|" + def.field, function (text) { - titleElement.value = text || def.title || " "; - }); - } else { - titleElement.value = def.title || " "; - } - } else { - if (def.field) { - table.modules.localize.bind("columns|" + def.field, function (text) { - self._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); - }); - } else { - self._formatColumnHeaderTitle(titleHolderElement, def.title || " "); - } - } - - return titleHolderElement; -}; - -Column.prototype._formatColumnHeaderTitle = function (el, title) { - var _this5 = this; - - var formatter, contents, params, mockCell, onRendered; - - if (this.definition.titleFormatter && this.table.modExists("format")) { - - formatter = this.table.modules.format.getFormatter(this.definition.titleFormatter); - - onRendered = function onRendered(callback) { - _this5.titleFormatterRendered = callback; - }; - - mockCell = { - getValue: function getValue() { - return title; - }, - getElement: function getElement() { - return el; - } - }; - - params = this.definition.titleFormatterParams || {}; - - params = typeof params === "function" ? params() : params; - - contents = formatter.call(this.table.modules.format, mockCell, params, onRendered); - - switch (typeof contents === 'undefined' ? 'undefined' : _typeof(contents)) { - case "object": - if (contents instanceof Node) { - el.appendChild(contents); - } else { - el.innerHTML = ""; - console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", contents); - } - break; - case "undefined": - case "null": - el.innerHTML = ""; - break; - default: - el.innerHTML = contents; - } - } else { - el.innerHTML = title; - } -}; - -//build header element for column group -Column.prototype._buildGroupHeader = function () { - var _this6 = this; - - this.element.classList.add("tabulator-col-group"); - this.element.setAttribute("role", "columngroup"); - this.element.setAttribute("aria-title", this.definition.title); - - //asign additional css classes to column header - if (this.definition.cssClass) { - var classeNames = this.definition.cssClass.split(" "); - classeNames.forEach(function (className) { - _this6.element.classList.add(className); - }); - } - - //set column header context menu - if ((this.definition.headerContextMenu || this.definition.headerMenu) && this.table.modExists("menu")) { - this.table.modules.menu.initializeColumnHeader(this); - } - - this.element.appendChild(this.groupElement); -}; - -//flat field lookup -Column.prototype._getFlatData = function (data) { - return data[this.field]; -}; - -//nested field lookup -Column.prototype._getNestedData = function (data) { - var dataObj = data, - structure = this.fieldStructure, - length = structure.length, - output; - - for (var i = 0; i < length; i++) { - - dataObj = dataObj[structure[i]]; - - output = dataObj; - - if (!dataObj) { - break; - } - } - - return output; -}; - -//flat field set -Column.prototype._setFlatData = function (data, value) { - if (this.field) { - data[this.field] = value; - } -}; - -//nested field set -Column.prototype._setNestedData = function (data, value) { - var dataObj = data, - structure = this.fieldStructure, - length = structure.length; - - for (var i = 0; i < length; i++) { - - if (i == length - 1) { - dataObj[structure[i]] = value; - } else { - if (!dataObj[structure[i]]) { - if (typeof value !== "undefined") { - dataObj[structure[i]] = {}; - } else { - break; - } - } - - dataObj = dataObj[structure[i]]; - } - } -}; - -//attach column to this group -Column.prototype.attachColumn = function (column) { - var self = this; - - if (self.groupElement) { - self.columns.push(column); - self.groupElement.appendChild(column.getElement()); - } else { - console.warn("Column Warning - Column being attached to another column instead of column group"); - } -}; - -//vertically align header in column -Column.prototype.verticalAlign = function (alignment, height) { - - //calculate height of column header and group holder element - var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : height || this.parent.getHeadersElement().clientHeight; - // var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight; - - this.element.style.height = parentHeight + "px"; - - if (this.isGroup) { - this.groupElement.style.minHeight = parentHeight - this.contentElement.offsetHeight + "px"; - } - - //vertically align cell contents - if (!this.isGroup && alignment !== "top") { - if (alignment === "bottom") { - this.element.style.paddingTop = this.element.clientHeight - this.contentElement.offsetHeight + "px"; - } else { - this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) / 2 + "px"; - } - } - - this.columns.forEach(function (column) { - column.verticalAlign(alignment); - }); -}; - -//clear vertical alignmenet -Column.prototype.clearVerticalAlign = function () { - this.element.style.paddingTop = ""; - this.element.style.height = ""; - this.element.style.minHeight = ""; - this.groupElement.style.minHeight = ""; - - this.columns.forEach(function (column) { - column.clearVerticalAlign(); - }); -}; - -Column.prototype.bindModuleColumns = function () { - //check if rownum formatter is being used on a column - if (this.definition.formatter == "rownum") { - this.table.rowManager.rowNumColumn = this; - } -}; - -//// Retreive Column Information //// - -//return column header element -Column.prototype.getElement = function () { - return this.element; -}; - -//return colunm group element -Column.prototype.getGroupElement = function () { - return this.groupElement; -}; - -//return field name -Column.prototype.getField = function () { - return this.field; -}; - -//return the first column in a group -Column.prototype.getFirstColumn = function () { - if (!this.isGroup) { - return this; - } else { - if (this.columns.length) { - return this.columns[0].getFirstColumn(); - } else { - return false; - } - } -}; - -//return the last column in a group -Column.prototype.getLastColumn = function () { - if (!this.isGroup) { - return this; - } else { - if (this.columns.length) { - return this.columns[this.columns.length - 1].getLastColumn(); - } else { - return false; - } - } -}; - -//return all columns in a group -Column.prototype.getColumns = function () { - return this.columns; -}; - -//return all columns in a group -Column.prototype.getCells = function () { - return this.cells; -}; - -//retreive the top column in a group of columns -Column.prototype.getTopColumn = function () { - if (this.parent.isGroup) { - return this.parent.getTopColumn(); - } else { - return this; - } -}; - -//return column definition object -Column.prototype.getDefinition = function (updateBranches) { - var colDefs = []; - - if (this.isGroup && updateBranches) { - this.columns.forEach(function (column) { - colDefs.push(column.getDefinition(true)); - }); - - this.definition.columns = colDefs; - } - - return this.definition; -}; - -//////////////////// Actions //////////////////// - -Column.prototype.checkColumnVisibility = function () { - var visible = false; - - this.columns.forEach(function (column) { - if (column.visible) { - visible = true; - } - }); - - if (visible) { - this.show(); - this.parent.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } else { - this.hide(); - } -}; - -//show column -Column.prototype.show = function (silent, responsiveToggle) { - if (!this.visible) { - this.visible = true; - - this.element.style.display = ""; - - if (this.parent.isGroup) { - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - cell.show(); - }); - - if (!this.isGroup && this.width === null) { - this.reinitializeWidth(); - } - - this.table.columnManager._verticalAlignHeaders(); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), true); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -//hide column -Column.prototype.hide = function (silent, responsiveToggle) { - if (this.visible) { - this.visible = false; - - this.element.style.display = "none"; - - this.table.columnManager._verticalAlignHeaders(); - - if (this.parent.isGroup) { - this.parent.checkColumnVisibility(); - } - - this.cells.forEach(function (cell) { - cell.hide(); - }); - - if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.columns) { - this.table.modules.persistence.save("columns"); - } - - if (!responsiveToggle && this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - this.table.modules.responsiveLayout.updateColumnVisibility(this, this.visible); - } - - if (!silent) { - this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(), false); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -Column.prototype.matchChildWidths = function () { - var childWidth = 0; - - if (this.contentElement && this.columns.length) { - this.columns.forEach(function (column) { - if (column.visible) { - childWidth += column.getWidth(); - } - }); - - this.contentElement.style.maxWidth = childWidth - 1 + "px"; - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - } -}; - -Column.prototype.setWidth = function (width) { - this.widthFixed = true; - this.setWidthActual(width); -}; - -Column.prototype.setWidthActual = function (width) { - if (isNaN(width)) { - width = Math.floor(this.table.element.clientWidth / 100 * parseInt(width)); - } - - width = Math.max(this.minWidth, width); - - this.width = width; - this.widthStyled = width ? width + "px" : ""; - - this.element.style.width = this.widthStyled; - - if (!this.isGroup) { - this.cells.forEach(function (cell) { - cell.setWidth(); - }); - } - - if (this.parent.isGroup) { - this.parent.matchChildWidths(); - } - - //set resizable handles - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } -}; - -Column.prototype.checkCellHeights = function () { - var rows = []; - - this.cells.forEach(function (cell) { - if (cell.row.heightInitialized) { - if (cell.row.getElement().offsetParent !== null) { - rows.push(cell.row); - cell.row.clearCellHeight(); - } else { - cell.row.heightInitialized = false; - } - } - }); - - rows.forEach(function (row) { - row.calcHeight(); - }); - - rows.forEach(function (row) { - row.setCellHeight(); - }); -}; - -Column.prototype.getWidth = function () { - var width = 0; - - if (this.isGroup) { - this.columns.forEach(function (column) { - if (column.visible) { - width += column.getWidth(); - } - }); - } else { - width = this.width; - } - - return width; -}; - -Column.prototype.getHeight = function () { - return this.element.offsetHeight; -}; - -Column.prototype.setMinWidth = function (minWidth) { - this.minWidth = minWidth; - this.minWidthStyled = minWidth ? minWidth + "px" : ""; - - this.element.style.minWidth = this.minWidthStyled; - - this.cells.forEach(function (cell) { - cell.setMinWidth(); - }); -}; - -Column.prototype.delete = function () { - var _this7 = this; - - return new Promise(function (resolve, reject) { - - if (_this7.isGroup) { - _this7.columns.forEach(function (column) { - column.delete(); - }); - } - - //cancel edit if column is currently being edited - if (_this7.table.modExists("edit")) { - if (_this7.table.modules.edit.currentCell.column === _this7) { - _this7.table.modules.edit.cancelEdit(); - } - } - - var cellCount = _this7.cells.length; - - for (var i = 0; i < cellCount; i++) { - _this7.cells[0].delete(); - } - - _this7.element.parentNode.removeChild(_this7.element); - - _this7.table.columnManager.deregisterColumn(_this7); - - resolve(); - }); -}; - -Column.prototype.columnRendered = function () { - if (this.titleFormatterRendered) { - this.titleFormatterRendered(); - } -}; - -Column.prototype.validate = function () { - var invalid = []; - - this.cells.forEach(function (cell) { - if (!cell.validate()) { - invalid.push(cell.getComponent()); - } - }); - - return invalid.length ? invalid : true; -}; - -//////////////// Cell Management ///////////////// - -//generate cell for this column -Column.prototype.generateCell = function (row) { - var self = this; - - var cell = new Cell(self, row); - - this.cells.push(cell); - - return cell; -}; - -Column.prototype.nextColumn = function () { - var index = this.table.columnManager.findColumnIndex(this); - return index > -1 ? this._nextVisibleColumn(index + 1) : false; -}; - -Column.prototype._nextVisibleColumn = function (index) { - var column = this.table.columnManager.getColumnByIndex(index); - return !column || column.visible ? column : this._nextVisibleColumn(index + 1); -}; - -Column.prototype.prevColumn = function () { - var index = this.table.columnManager.findColumnIndex(this); - return index > -1 ? this._prevVisibleColumn(index - 1) : false; -}; - -Column.prototype._prevVisibleColumn = function (index) { - var column = this.table.columnManager.getColumnByIndex(index); - return !column || column.visible ? column : this._prevVisibleColumn(index - 1); -}; - -Column.prototype.reinitializeWidth = function (force) { - this.widthFixed = false; - - //set width if present - if (typeof this.definition.width !== "undefined" && !force) { - this.setWidth(this.definition.width); - } - - //hide header filters to prevent them altering column width - if (this.table.modExists("filter")) { - this.table.modules.filter.hideHeaderFilterElements(); - } - - this.fitToData(); - - //show header filters again after layout is complete - if (this.table.modExists("filter")) { - this.table.modules.filter.showHeaderFilterElements(); - } -}; - -//set column width to maximum cell width -Column.prototype.fitToData = function () { - var self = this; - - if (!this.widthFixed) { - this.element.style.width = ""; - - self.cells.forEach(function (cell) { - cell.clearWidth(); - }); - } - - var maxWidth = this.element.offsetWidth; - - if (!self.width || !this.widthFixed) { - self.cells.forEach(function (cell) { - var width = cell.getWidth(); - - if (width > maxWidth) { - maxWidth = width; - } - }); - - if (maxWidth) { - self.setWidthActual(maxWidth + 1); - } - } -}; - -Column.prototype.updateDefinition = function (updates) { - var _this8 = this; - - return new Promise(function (resolve, reject) { - var definition; - - if (!_this8.isGroup) { - definition = Object.assign({}, _this8.getDefinition()); - definition = Object.assign(definition, updates); - - _this8.table.columnManager.addColumn(definition, false, _this8).then(function (column) { - - if (definition.field == _this8.field) { - _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays - } - - _this8.delete().then(function () { - resolve(column.getComponent()); - }).catch(function (err) { - reject(err); - }); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - reject("Column Update Error - The updateDefintion function is only available on columns, not column groups"); - } - }); -}; - -Column.prototype.deleteCell = function (cell) { - var index = this.cells.indexOf(cell); - - if (index > -1) { - this.cells.splice(index, 1); - } -}; - -Column.prototype.defaultOptionList = ["title", "field", "columns", "visible", "align", "hozAlign", "vertAlign", "width", "minWidth", "widthGrow", "widthShrink", "resizable", "frozen", "responsive", "tooltip", "cssClass", "rowHandle", "hideInHtml", "print", "htmlOutput", "sorter", "sorterParams", "formatter", "formatterParams", "variableHeight", "editable", "editor", "editorParams", "validator", "mutator", "mutatorParams", "mutatorData", "mutatorDataParams", "mutatorEdit", "mutatorEditParams", "mutatorClipboard", "mutatorClipboardParams", "accessor", "accessorParams", "accessorData", "accessorDataParams", "accessorDownload", "accessorDownloadParams", "accessorClipboard", "accessorClipboardParams", "accessorPrint", "accessorPrintParams", "accessorHtmlOutput", "accessorHtmlOutputParams", "clipboard", "download", "downloadTitle", "topCalc", "topCalcParams", "topCalcFormatter", "topCalcFormatterParams", "bottomCalc", "bottomCalcParams", "bottomCalcFormatter", "bottomCalcFormatterParams", "cellClick", "cellDblClick", "cellContext", "cellTap", "cellDblTap", "cellTapHold", "cellMouseEnter", "cellMouseLeave", "cellMouseOver", "cellMouseOut", "cellMouseMove", "cellEditing", "cellEdited", "cellEditCancelled", "headerSort", "headerSortStartingDir", "headerSortTristate", "headerClick", "headerDblClick", "headerContext", "headerTap", "headerDblTap", "headerTapHold", "headerTooltip", "headerVertical", "editableTitle", "titleFormatter", "titleFormatterParams", "headerFilter", "headerFilterPlaceholder", "headerFilterParams", "headerFilterEmptyCheck", "headerFilterFunc", "headerFilterFuncParams", "headerFilterLiveFilter", "print", "headerContextMenu", "headerMenu", "contextMenu", "formatterPrint", "formatterPrintParams", "formatterClipboard", "formatterClipboardParams", "formatterHtmlOutput", "formatterHtmlOutputParams", "titlePrint", "titleClipboard", "titleHtmlOutput", "titleDownload"]; - -//////////////// Event Bindings ///////////////// - -//////////////// Object Generation ///////////////// -Column.prototype.getComponent = function () { - if (!this.component) { - this.component = new ColumnComponent(this); - } - - return this.component; -}; - -var RowManager = function RowManager(table) { - - this.table = table; - this.element = this.createHolderElement(); //containing element - this.tableElement = this.createTableElement(); //table element - this.heightFixer = this.createTableElement(); //table element - this.columnManager = null; //hold column manager object - this.height = 0; //hold height of table element - - this.firstRender = false; //handle first render - this.renderMode = "virtual"; //current rendering mode - this.fixedHeight = false; //current rendering mode - - this.rows = []; //hold row data objects - this.activeRows = []; //rows currently available to on display in the table - this.activeRowsCount = 0; //count of active rows - - this.displayRows = []; //rows currently on display in the table - this.displayRowsCount = 0; //count of display rows - - this.scrollTop = 0; - this.scrollLeft = 0; - - this.vDomRowHeight = 20; //approximation of row heights for padding - - this.vDomTop = 0; //hold position for first rendered row in the virtual DOM - this.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM - - this.vDomScrollPosTop = 0; //last scroll position of the vDom top; - this.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom; - - this.vDomTopPad = 0; //hold value of padding for top of virtual DOM - this.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM - - this.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go - - this.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling - - this.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows) - this.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin - - this.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed - this.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed - - this.rowNumColumn = false; //hold column component for row number column - - this.redrawBlock = false; //prevent redraws to allow multiple data manipulations becore continuing - this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed - this.redrawBlockRederInPosition = false; //store latest redraw function calls for when redraw is needed -}; - -//////////////// Setup Functions ///////////////// - -RowManager.prototype.createHolderElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-tableHolder"); - el.setAttribute("tabindex", 0); - - return el; -}; - -RowManager.prototype.createTableElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-table"); - - return el; -}; - -//return containing element -RowManager.prototype.getElement = function () { - return this.element; -}; - -//return table element -RowManager.prototype.getTableElement = function () { - return this.tableElement; -}; - -//return position of row in table -RowManager.prototype.getRowPosition = function (row, active) { - if (active) { - return this.activeRows.indexOf(row); - } else { - return this.rows.indexOf(row); - } -}; - -//link to column manager -RowManager.prototype.setColumnManager = function (manager) { - this.columnManager = manager; -}; - -RowManager.prototype.initialize = function () { - var self = this; - - self.setRenderMode(); - - //initialize manager - self.element.appendChild(self.tableElement); - - self.firstRender = true; - - //scroll header along with table body - self.element.addEventListener("scroll", function () { - var left = self.element.scrollLeft; - - //handle horizontal scrolling - if (self.scrollLeft != left) { - self.columnManager.scrollHorizontal(left); - - if (self.table.options.groupBy) { - self.table.modules.groupRows.scrollHeaders(left); - } - - if (self.table.modExists("columnCalcs")) { - self.table.modules.columnCalcs.scrollHorizontal(left); - } - - self.table.options.scrollHorizontal(left); - } - - self.scrollLeft = left; - }); - - //handle virtual dom scrolling - if (this.renderMode === "virtual") { - - self.element.addEventListener("scroll", function () { - var top = self.element.scrollTop; - var dir = self.scrollTop > top; - - //handle verical scrolling - if (self.scrollTop != top) { - self.scrollTop = top; - self.scrollVertical(dir); - - if (self.table.options.ajaxProgressiveLoad == "scroll") { - self.table.modules.ajax.nextPage(self.element.scrollHeight - self.element.clientHeight - top); - } - - self.table.options.scrollVertical(top); - } else { - self.scrollTop = top; - } - }); - } -}; - -////////////////// Row Manipulation ////////////////// - -RowManager.prototype.findRow = function (subject) { - var self = this; - - if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) == "object") { - - if (subject instanceof Row) { - //subject is row element - return subject; - } else if (subject instanceof RowComponent) { - //subject is public row component - return subject._getSelf() || false; - } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - //subject is a HTML element of the row - var match = self.rows.find(function (row) { - return row.element === subject; - }); - - return match || false; - } - } else if (typeof subject == "undefined" || subject === null) { - return false; - } else { - //subject should be treated as the index of the row - var _match = self.rows.find(function (row) { - return row.data[self.table.options.index] == subject; - }); - - return _match || false; - } - - //catch all for any other type of input - - return false; -}; - -RowManager.prototype.getRowFromDataObject = function (data) { - var match = this.rows.find(function (row) { - return row.data === data; - }); - - return match || false; -}; - -RowManager.prototype.getRowFromPosition = function (position, active) { - if (active) { - return this.activeRows[position]; - } else { - return this.rows[position]; - } -}; - -RowManager.prototype.scrollToRow = function (row, position, ifVisible) { - var _this9 = this; - - var rowIndex = this.getDisplayRows().indexOf(row), - rowEl = row.getElement(), - rowTop, - offset = 0; - - return new Promise(function (resolve, reject) { - if (rowIndex > -1) { - - if (typeof position === "undefined") { - position = _this9.table.options.scrollToRowPosition; - } - - if (typeof ifVisible === "undefined") { - ifVisible = _this9.table.options.scrollToRowIfVisible; - } - - if (position === "nearest") { - switch (_this9.renderMode) { - case "classic": - rowTop = Tabulator.prototype.helpers.elOffset(rowEl).top; - position = Math.abs(_this9.element.scrollTop - rowTop) > Math.abs(_this9.element.scrollTop + _this9.element.clientHeight - rowTop) ? "bottom" : "top"; - break; - case "virtual": - position = Math.abs(_this9.vDomTop - rowIndex) > Math.abs(_this9.vDomBottom - rowIndex) ? "bottom" : "top"; - break; - } - } - - //check row visibility - if (!ifVisible) { - if (Tabulator.prototype.helpers.elVisible(rowEl)) { - offset = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top; - - if (offset > 0 && offset < _this9.element.clientHeight - rowEl.offsetHeight) { - return false; - } - } - } - - //scroll to row - switch (_this9.renderMode) { - case "classic": - _this9.element.scrollTop = Tabulator.prototype.helpers.elOffset(rowEl).top - Tabulator.prototype.helpers.elOffset(_this9.element).top + _this9.element.scrollTop; - break; - case "virtual": - _this9._virtualRenderFill(rowIndex, true); - break; - } - - //align to correct position - switch (position) { - case "middle": - case "center": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - _this9.element.scrollTop = _this9.element.scrollTop + (rowEl.offsetTop - _this9.element.scrollTop) - (_this9.element.scrollHeight - rowEl.offsetTop) / 2; - } else { - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight / 2; - } - - break; - - case "bottom": - - if (_this9.element.scrollHeight - _this9.element.scrollTop == _this9.element.clientHeight) { - _this9.element.scrollTop = _this9.element.scrollTop - (_this9.element.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight; - } else { - _this9.element.scrollTop = _this9.element.scrollTop - _this9.element.clientHeight + rowEl.offsetHeight; - } - - break; - } - - resolve(); - } else { - console.warn("Scroll Error - Row not visible"); - reject("Scroll Error - Row not visible"); - } - }); -}; - -////////////////// Data Handling ////////////////// - -RowManager.prototype.setData = function (data, renderInPosition, columnsChanged) { - var _this10 = this; - - var self = this; - - return new Promise(function (resolve, reject) { - if (renderInPosition && _this10.getDisplayRows().length) { - if (self.table.options.pagination) { - self._setDataActual(data, true); - } else { - _this10.reRenderInPosition(function () { - self._setDataActual(data); - }); - } - } else { - if (_this10.table.options.autoColumns && columnsChanged) { - _this10.table.columnManager.generateColumnsFromRowData(data); - } - _this10.resetScroll(); - _this10._setDataActual(data); - } - - resolve(); - }); -}; - -RowManager.prototype._setDataActual = function (data, renderInPosition) { - var self = this; - - self.table.options.dataLoading.call(this.table, data); - - this._wipeElements(); - - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.clear(); - } - - if (Array.isArray(data)) { - - if (this.table.modExists("selectRow")) { - this.table.modules.selectRow.clearSelectionData(); - } - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - this.table.modules.reactiveData.watchData(data); - } - - data.forEach(function (def, i) { - if (def && (typeof def === 'undefined' ? 'undefined' : _typeof(def)) === "object") { - var row = new Row(def, self); - self.rows.push(row); - } else { - console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def); - } - }); - - self.table.options.dataLoaded.call(this.table, data); - - self.refreshActiveData(false, false, renderInPosition); - } else { - console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ", typeof data === 'undefined' ? 'undefined' : _typeof(data), "\nData: ", data); - } -}; - -RowManager.prototype._wipeElements = function () { - this.rows.forEach(function (row) { - row.wipe(); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.wipe(); - } - - this.rows = []; -}; - -RowManager.prototype.deleteRow = function (row, blockRedraw) { - var allIndex = this.rows.indexOf(row), - activeIndex = this.activeRows.indexOf(row); - - if (activeIndex > -1) { - this.activeRows.splice(activeIndex, 1); - } - - if (allIndex > -1) { - this.rows.splice(allIndex, 1); - } - - this.setActiveRows(this.activeRows); - - this.displayRowIterator(function (rows) { - var displayIndex = rows.indexOf(row); - - if (displayIndex > -1) { - rows.splice(displayIndex, 1); - } - }); - - if (!blockRedraw) { - this.reRenderInPosition(); - } - - this.regenerateRowNumbers(); - - this.table.options.rowDeleted.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.updateGroupRows(true); - } else if (this.table.options.pagination && this.table.modExists("page")) { - this.refreshActiveData(false, false, true); - } else { - if (this.table.options.pagination && this.table.modExists("page")) { - this.refreshActiveData("page"); - } - } -}; - -RowManager.prototype.addRow = function (data, pos, index, blockRedraw) { - - var row = this.addRowActual(data, pos, index, blockRedraw); - - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("rowAdd", row, { data: data, pos: pos, index: index }); - } - - return row; -}; - -//add multiple rows -RowManager.prototype.addRows = function (data, pos, index) { - var _this11 = this; - - var self = this, - length = 0, - rows = []; - - return new Promise(function (resolve, reject) { - pos = _this11.findAddRowPos(pos); - - if (!Array.isArray(data)) { - data = [data]; - } - - length = data.length - 1; - - if (typeof index == "undefined" && pos || typeof index !== "undefined" && !pos) { - data.reverse(); - } - - data.forEach(function (item, i) { - var row = self.addRow(item, pos, index, true); - rows.push(row); - }); - - if (_this11.table.options.groupBy && _this11.table.modExists("groupRows")) { - _this11.table.modules.groupRows.updateGroupRows(true); - } else if (_this11.table.options.pagination && _this11.table.modExists("page")) { - _this11.refreshActiveData(false, false, true); - } else { - _this11.reRenderInPosition(); - } - - //recalc column calculations if present - if (_this11.table.modExists("columnCalcs")) { - _this11.table.modules.columnCalcs.recalc(_this11.table.rowManager.activeRows); - } - - _this11.regenerateRowNumbers(); - resolve(rows); - }); -}; - -RowManager.prototype.findAddRowPos = function (pos) { - if (typeof pos === "undefined") { - pos = this.table.options.addRowPos; - } - - if (pos === "pos") { - pos = true; - } - - if (pos === "bottom") { - pos = false; - } - - return pos; -}; - -RowManager.prototype.addRowActual = function (data, pos, index, blockRedraw) { - var row = data instanceof Row ? data : new Row(data || {}, this), - top = this.findAddRowPos(pos), - allIndex = -1, - activeIndex, - dispRows; - - if (!index && this.table.options.pagination && this.table.options.paginationAddRow == "page") { - dispRows = this.getDisplayRows(); - - if (top) { - if (dispRows.length) { - index = dispRows[0]; - } else { - if (this.activeRows.length) { - index = this.activeRows[this.activeRows.length - 1]; - top = false; - } - } - } else { - if (dispRows.length) { - index = dispRows[dispRows.length - 1]; - top = dispRows.length < this.table.modules.page.getPageSize() ? false : true; - } - } - } - - if (typeof index !== "undefined") { - index = this.findRow(index); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.assignRowToGroup(row); - - var groupRows = row.getGroup().rows; - - if (groupRows.length > 1) { - - if (!index || index && groupRows.indexOf(index) == -1) { - if (top) { - if (groupRows[0] !== row) { - index = groupRows[0]; - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } else { - if (groupRows[groupRows.length - 1] !== row) { - index = groupRows[groupRows.length - 1]; - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } else { - this._moveRowInArray(row.getGroup().rows, row, index, !top); - } - } - } - - if (index) { - allIndex = this.rows.indexOf(index); - } - - if (index && allIndex > -1) { - activeIndex = this.activeRows.indexOf(index); - - this.displayRowIterator(function (rows) { - var displayIndex = rows.indexOf(index); - - if (displayIndex > -1) { - rows.splice(top ? displayIndex : displayIndex + 1, 0, row); - } - }); - - if (activeIndex > -1) { - this.activeRows.splice(top ? activeIndex : activeIndex + 1, 0, row); - } - - this.rows.splice(top ? allIndex : allIndex + 1, 0, row); - } else { - - if (top) { - - this.displayRowIterator(function (rows) { - rows.unshift(row); - }); - - this.activeRows.unshift(row); - this.rows.unshift(row); - } else { - this.displayRowIterator(function (rows) { - rows.push(row); - }); - - this.activeRows.push(row); - this.rows.push(row); - } - } - - this.setActiveRows(this.activeRows); - - this.table.options.rowAdded.call(this.table, row.getComponent()); - - this.table.options.dataEdited.call(this.table, this.getData()); - - if (!blockRedraw) { - this.reRenderInPosition(); - } - - return row; -}; - -RowManager.prototype.moveRow = function (from, to, after) { - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("rowMove", from, { posFrom: this.getRowPosition(from), posTo: this.getRowPosition(to), to: to, after: after }); - } - - this.moveRowActual(from, to, after); - - this.regenerateRowNumbers(); - - this.table.options.rowMoved.call(this.table, from.getComponent()); -}; - -RowManager.prototype.moveRowActual = function (from, to, after) { - var _this12 = this; - - this._moveRowInArray(this.rows, from, to, after); - this._moveRowInArray(this.activeRows, from, to, after); - - this.displayRowIterator(function (rows) { - _this12._moveRowInArray(rows, from, to, after); - }); - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (!after && to instanceof Group) { - to = this.table.rowManager.prevDisplayRow(from) || to; - } - - var toGroup = to.getGroup(); - var fromGroup = from.getGroup(); - - if (toGroup === fromGroup) { - this._moveRowInArray(toGroup.rows, from, to, after); - } else { - if (fromGroup) { - fromGroup.removeRow(from); - } - - toGroup.insertRow(from, to, after); - } - } -}; - -RowManager.prototype._moveRowInArray = function (rows, from, to, after) { - var fromIndex, toIndex, start, end; - - if (from !== to) { - - fromIndex = rows.indexOf(from); - - if (fromIndex > -1) { - - rows.splice(fromIndex, 1); - - toIndex = rows.indexOf(to); - - if (toIndex > -1) { - - if (after) { - rows.splice(toIndex + 1, 0, from); - } else { - rows.splice(toIndex, 0, from); - } - } else { - rows.splice(fromIndex, 0, from); - } - } - - //restyle rows - if (rows === this.getDisplayRows()) { - - start = fromIndex < toIndex ? fromIndex : toIndex; - end = toIndex > fromIndex ? toIndex : fromIndex + 1; - - for (var i = start; i <= end; i++) { - if (rows[i]) { - this.styleRow(rows[i], i); - } - } - } - } -}; - -RowManager.prototype.clearData = function () { - this.setData([]); -}; - -RowManager.prototype.getRowIndex = function (row) { - return this.findRowIndex(row, this.rows); -}; - -RowManager.prototype.getDisplayRowIndex = function (row) { - var index = this.getDisplayRows().indexOf(row); - return index > -1 ? index : false; -}; - -RowManager.prototype.nextDisplayRow = function (row, rowOnly) { - var index = this.getDisplayRowIndex(row), - nextRow = false; - - if (index !== false && index < this.displayRowsCount - 1) { - nextRow = this.getDisplayRows()[index + 1]; - } - - if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) { - return this.nextDisplayRow(nextRow, rowOnly); - } - - return nextRow; -}; - -RowManager.prototype.prevDisplayRow = function (row, rowOnly) { - var index = this.getDisplayRowIndex(row), - prevRow = false; - - if (index) { - prevRow = this.getDisplayRows()[index - 1]; - } - - if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) { - return this.prevDisplayRow(prevRow, rowOnly); - } - - return prevRow; -}; - -RowManager.prototype.findRowIndex = function (row, list) { - var rowIndex; - - row = this.findRow(row); - - if (row) { - rowIndex = list.indexOf(row); - - if (rowIndex > -1) { - return rowIndex; - } - } - - return false; -}; - -RowManager.prototype.getData = function (active, transform) { - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - if (row.type == "row") { - output.push(row.getData(transform || "data")); - } - }); - - return output; -}; - -RowManager.prototype.getComponents = function (active) { - var output = [], - rows = this.getRows(active); - - rows.forEach(function (row) { - output.push(row.getComponent()); - }); - - return output; -}; - -RowManager.prototype.getDataCount = function (active) { - var rows = this.getRows(active); - - return rows.length; -}; - -RowManager.prototype._genRemoteRequest = function () { - var _this13 = this; - - var table = this.table, - options = table.options, - params = {}; - - if (table.modExists("page")) { - //set sort data if defined - if (options.ajaxSorting) { - var sorters = this.table.modules.sort.getSort(); - - sorters.forEach(function (item) { - delete item.column; - }); - - params[this.table.modules.page.paginationDataSentNames.sorters] = sorters; - } - - //set filter data if defined - if (options.ajaxFiltering) { - var filters = this.table.modules.filter.getFilters(true, true); - - params[this.table.modules.page.paginationDataSentNames.filters] = filters; - } - - this.table.modules.ajax.setParams(params, true); - } - - table.modules.ajax.sendRequest().then(function (data) { - _this13._setDataActual(data, true); - }).catch(function (e) {}); -}; - -//choose the path to refresh data after a filter update -RowManager.prototype.filterRefresh = function () { - var table = this.table, - options = table.options, - left = this.scrollLeft; - - if (options.ajaxFiltering) { - if (options.pagination == "remote" && table.modExists("page")) { - table.modules.page.reset(true); - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - //assume data is url, make ajax call to url to get data - this._genRemoteRequest(); - } - } else { - this.refreshActiveData("filter"); - } - - this.scrollHorizontal(left); -}; - -//choose the path to refresh data after a sorter update -RowManager.prototype.sorterRefresh = function (loadOrignalData) { - var table = this.table, - options = this.table.options, - left = this.scrollLeft; - - if (options.ajaxSorting) { - if ((options.pagination == "remote" || options.progressiveLoad) && table.modExists("page")) { - table.modules.page.reset(true); - table.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else if (options.ajaxProgressiveLoad) { - table.modules.ajax.loadData().then(function () {}).catch(function () {}); - } else { - //assume data is url, make ajax call to url to get data - this._genRemoteRequest(); - } - } else { - this.refreshActiveData(loadOrignalData ? "filter" : "sort"); - } - - this.scrollHorizontal(left); -}; - -RowManager.prototype.scrollHorizontal = function (left) { - this.scrollLeft = left; - this.element.scrollLeft = left; - - if (this.table.options.groupBy) { - this.table.modules.groupRows.scrollHeaders(left); - } - - if (this.table.modExists("columnCalcs")) { - this.table.modules.columnCalcs.scrollHorizontal(left); - } -}; - -//set active data set -RowManager.prototype.refreshActiveData = function (stage, skipStage, renderInPosition) { - var self = this, - table = this.table, - cascadeOrder = ["all", "filter", "sort", "display", "freeze", "group", "tree", "page"], - displayIndex; - - if (this.redrawBlock) { - - if (!this.redrawBlockRestoreConfig || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage)) { - this.redrawBlockRestoreConfig = { - stage: stage, - skipStage: skipStage, - renderInPosition: renderInPosition - }; - } - - return; - } else { - - if (self.table.modExists("edit")) { - self.table.modules.edit.cancelEdit(); - } - - if (!stage) { - stage = "all"; - } - - if (table.options.selectable && !table.options.selectablePersistence && table.modExists("selectRow")) { - table.modules.selectRow.deselectRows(); - } - - //cascade through data refresh stages - switch (stage) { - case "all": - - case "filter": - if (!skipStage) { - if (table.modExists("filter")) { - self.setActiveRows(table.modules.filter.filter(self.rows)); - } else { - self.setActiveRows(self.rows.slice(0)); - } - } else { - skipStage = false; - } - - case "sort": - if (!skipStage) { - if (table.modExists("sort")) { - table.modules.sort.sort(this.activeRows); - } - } else { - skipStage = false; - } - - //regenerate row numbers for row number formatter if in use - this.regenerateRowNumbers(); - - //generic stage to allow for pipeline trigger after the data manipulation stage - case "display": - this.resetDisplayRows(); - - case "freeze": - if (!skipStage) { - if (this.table.modExists("frozenRows")) { - if (table.modules.frozenRows.isFrozen()) { - if (!table.modules.frozenRows.getDisplayIndex()) { - table.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.frozenRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.frozenRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.frozenRows.setDisplayIndex(displayIndex); - } - } - } - } else { - skipStage = false; - } - - case "group": - if (!skipStage) { - if (table.options.groupBy && table.modExists("groupRows")) { - - if (!table.modules.groupRows.getDisplayIndex()) { - table.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.groupRows.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.groupRows.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.groupRows.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - - case "tree": - - if (!skipStage) { - if (table.options.dataTree && table.modExists("dataTree")) { - if (!table.modules.dataTree.getDisplayIndex()) { - table.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.dataTree.getDisplayIndex(); - - displayIndex = self.setDisplayRows(table.modules.dataTree.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.dataTree.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - - if (table.options.pagination && table.modExists("page") && !renderInPosition) { - if (table.modules.page.getMode() == "local") { - table.modules.page.reset(); - } - } - - case "page": - if (!skipStage) { - if (table.options.pagination && table.modExists("page")) { - - if (!table.modules.page.getDisplayIndex()) { - table.modules.page.setDisplayIndex(this.getNextDisplayIndex()); - } - - displayIndex = table.modules.page.getDisplayIndex(); - - if (table.modules.page.getMode() == "local") { - table.modules.page.setMaxRows(this.getDisplayRows(displayIndex - 1).length); - } - - displayIndex = self.setDisplayRows(table.modules.page.getRows(this.getDisplayRows(displayIndex - 1)), displayIndex); - - if (displayIndex !== true) { - table.modules.page.setDisplayIndex(displayIndex); - } - } - } else { - skipStage = false; - } - } - - if (Tabulator.prototype.helpers.elVisible(self.element)) { - if (renderInPosition) { - self.reRenderInPosition(); - } else { - self.renderTable(); - if (table.options.layoutColumnsOnNewData) { - self.table.columnManager.redraw(true); - } - } - } - - if (table.modExists("columnCalcs")) { - table.modules.columnCalcs.recalc(this.activeRows); - } - } -}; - -//regenerate row numbers for row number formatter if in use -RowManager.prototype.regenerateRowNumbers = function () { - var _this14 = this; - - if (this.rowNumColumn) { - this.activeRows.forEach(function (row) { - var cell = row.getCell(_this14.rowNumColumn); - - if (cell) { - cell._generateContents(); - } - }); - } -}; - -RowManager.prototype.setActiveRows = function (activeRows) { - this.activeRows = activeRows; - this.activeRowsCount = this.activeRows.length; -}; - -//reset display rows array -RowManager.prototype.resetDisplayRows = function () { - this.displayRows = []; - - this.displayRows.push(this.activeRows.slice(0)); - - this.displayRowsCount = this.displayRows[0].length; - - if (this.table.modExists("frozenRows")) { - this.table.modules.frozenRows.setDisplayIndex(0); - } - - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.groupRows.setDisplayIndex(0); - } - - if (this.table.options.pagination && this.table.modExists("page")) { - this.table.modules.page.setDisplayIndex(0); - } -}; - -RowManager.prototype.getNextDisplayIndex = function () { - return this.displayRows.length; -}; - -//set display row pipeline data -RowManager.prototype.setDisplayRows = function (displayRows, index) { - - var output = true; - - if (index && typeof this.displayRows[index] != "undefined") { - this.displayRows[index] = displayRows; - output = true; - } else { - this.displayRows.push(displayRows); - output = index = this.displayRows.length - 1; - } - - if (index == this.displayRows.length - 1) { - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; - } - - return output; -}; - -RowManager.prototype.getDisplayRows = function (index) { - if (typeof index == "undefined") { - return this.displayRows.length ? this.displayRows[this.displayRows.length - 1] : []; - } else { - return this.displayRows[index] || []; - } -}; - -RowManager.prototype.getVisibleRows = function (viewable) { - var topEdge = this.element.scrollTop, - bottomEdge = this.element.clientHeight + topEdge, - topFound = false, - topRow = 0, - bottomRow = 0, - rows = this.getDisplayRows(); - - if (viewable) { - - this.getDisplayRows(); - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - if (rows[i]) { - if (!topFound) { - if (topEdge - rows[i].getElement().offsetTop >= 0) { - topRow = i; - } else { - topFound = true; - - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - bottomRow = i; - } else { - break; - } - } - } else { - if (bottomEdge - rows[i].getElement().offsetTop >= 0) { - bottomRow = i; - } else { - break; - } - } - } - } - } else { - topRow = this.vDomTop; - bottomRow = this.vDomBottom; - } - - return rows.slice(topRow, bottomRow + 1); -}; - -//repeat action accross display rows -RowManager.prototype.displayRowIterator = function (callback) { - this.displayRows.forEach(callback); - - this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length; -}; - -//return only actual rows (not group headers etc) -RowManager.prototype.getRows = function (active) { - var rows; - - switch (active) { - case "active": - rows = this.activeRows; - break; - - case "display": - rows = this.table.rowManager.getDisplayRows(); - break; - - case "visible": - rows = this.getVisibleRows(true); - break; - - default: - rows = this.rows; - } - - return rows; -}; - -///////////////// Table Rendering ///////////////// - -//trigger rerender of table in current position -RowManager.prototype.reRenderInPosition = function (callback) { - if (this.getRenderMode() == "virtual") { - - if (this.redrawBlock) { - if (callback) { - callback(); - } else { - this.redrawBlockRederInPosition = true; - } - } else { - var scrollTop = this.element.scrollTop; - var topRow = false; - var topOffset = false; - - var left = this.scrollLeft; - - var rows = this.getDisplayRows(); - - for (var i = this.vDomTop; i <= this.vDomBottom; i++) { - - if (rows[i]) { - var diff = scrollTop - rows[i].getElement().offsetTop; - - if (topOffset === false || Math.abs(diff) < topOffset) { - topOffset = diff; - topRow = i; - } else { - break; - } - } - } - - if (callback) { - callback(); - } - - this._virtualRenderFill(topRow === false ? this.displayRowsCount - 1 : topRow, true, topOffset || 0); - - this.scrollHorizontal(left); - } - } else { - this.renderTable(); - - if (callback) { - callback(); - } - } -}; - -RowManager.prototype.setRenderMode = function () { - - if (this.table.options.virtualDom) { - - this.renderMode = "virtual"; - - if (this.table.element.clientHeight || this.table.options.height) { - this.fixedHeight = true; - } else { - this.fixedHeight = false; - } - } else { - this.renderMode = "classic"; - } -}; - -RowManager.prototype.getRenderMode = function () { - return this.renderMode; -}; - -RowManager.prototype.renderTable = function () { - - this.table.options.renderStarted.call(this.table); - - this.element.scrollTop = 0; - - switch (this.renderMode) { - case "classic": - this._simpleRender(); - break; - - case "virtual": - this._virtualRenderFill(); - break; - } - - if (this.firstRender) { - if (this.displayRowsCount) { - this.firstRender = false; - this.table.modules.layout.layout(); - } else { - this.renderEmptyScroll(); - } - } - - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layout(); - } - - if (!this.displayRowsCount) { - if (this.table.options.placeholder) { - - this.table.options.placeholder.setAttribute("tabulator-render-mode", this.renderMode); - - this.getElement().appendChild(this.table.options.placeholder); - this.table.options.placeholder.style.width = this.table.columnManager.getWidth() + "px"; - } - } - - this.table.options.renderComplete.call(this.table); -}; - -//simple render on heightless table -RowManager.prototype._simpleRender = function () { - this._clearVirtualDom(); - - if (this.displayRowsCount) { - this.checkClassicModeGroupHeaderWidth(); - } else { - this.renderEmptyScroll(); - } -}; - -RowManager.prototype.checkClassicModeGroupHeaderWidth = function () { - var self = this, - element = this.tableElement, - onlyGroupHeaders = true; - - self.getDisplayRows().forEach(function (row, index) { - self.styleRow(row, index); - element.appendChild(row.getElement()); - row.initialize(true); - - if (row.type !== "group") { - onlyGroupHeaders = false; - } - }); - - if (onlyGroupHeaders) { - element.style.minWidth = self.table.columnManager.getWidth() + "px"; - } else { - element.style.minWidth = ""; - } -}; - -//show scrollbars on empty table div -RowManager.prototype.renderEmptyScroll = function () { - if (this.table.options.placeholder) { - this.tableElement.style.display = "none"; - } else { - this.tableElement.style.minWidth = this.table.columnManager.getWidth() + "px"; - this.tableElement.style.minHeight = "1px"; - this.tableElement.style.visibility = "hidden"; - } -}; - -RowManager.prototype._clearVirtualDom = function () { - var element = this.tableElement; - - if (this.table.options.placeholder && this.table.options.placeholder.parentNode) { - this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder); - } - - // element.children.detach(); - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.style.paddingTop = ""; - element.style.paddingBottom = ""; - element.style.minWidth = ""; - element.style.minHeight = ""; - element.style.display = ""; - element.style.visibility = ""; - - this.scrollTop = 0; - this.scrollLeft = 0; - this.vDomTop = 0; - this.vDomBottom = 0; - this.vDomTopPad = 0; - this.vDomBottomPad = 0; -}; - -RowManager.prototype.styleRow = function (row, index) { - var rowEl = row.getElement(); - - if (index % 2) { - rowEl.classList.add("tabulator-row-even"); - rowEl.classList.remove("tabulator-row-odd"); - } else { - rowEl.classList.add("tabulator-row-odd"); - rowEl.classList.remove("tabulator-row-even"); - } -}; - -//full virtual render -RowManager.prototype._virtualRenderFill = function (position, forceMove, offset) { - var self = this, - element = self.tableElement, - holder = self.element, - topPad = 0, - rowsHeight = 0, - topPadHeight = 0, - i = 0, - onlyGroupHeaders = true, - rows = self.getDisplayRows(); - - position = position || 0; - - offset = offset || 0; - - if (!position) { - self._clearVirtualDom(); - } else { - while (element.firstChild) { - element.removeChild(element.firstChild); - } //check if position is too close to bottom of table - var heightOccupied = (self.displayRowsCount - position + 1) * self.vDomRowHeight; - - if (heightOccupied < self.height) { - position -= Math.ceil((self.height - heightOccupied) / self.vDomRowHeight); - - if (position < 0) { - position = 0; - } - } - - //calculate initial pad - topPad = Math.min(Math.max(Math.floor(self.vDomWindowBuffer / self.vDomRowHeight), self.vDomWindowMinMarginRows), position); - position -= topPad; - } - - if (self.displayRowsCount && Tabulator.prototype.helpers.elVisible(self.element)) { - - self.vDomTop = position; - - self.vDomBottom = position - 1; - - while ((rowsHeight <= self.height + self.vDomWindowBuffer || i < self.vDomWindowMinTotalRows) && self.vDomBottom < self.displayRowsCount - 1) { - var index = self.vDomBottom + 1, - row = rows[index], - rowHeight = 0; - - self.styleRow(row, index); - - element.appendChild(row.getElement()); - if (!row.initialized) { - row.initialize(true); - } else { - if (!row.heightInitialized) { - row.normalizeHeight(true); - } - } - - rowHeight = row.getHeight(); - - if (i < topPad) { - topPadHeight += rowHeight; - } else { - rowsHeight += rowHeight; - } - - if (rowHeight > this.vDomWindowBuffer) { - this.vDomWindowBuffer = rowHeight * 2; - } - - if (row.type !== "group") { - onlyGroupHeaders = false; - } - - self.vDomBottom++; - i++; - } - - if (!position) { - this.vDomTopPad = 0; - //adjust rowheight to match average of rendered elements - self.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i); - self.vDomBottomPad = self.vDomRowHeight * (self.displayRowsCount - self.vDomBottom - 1); - - self.vDomScrollHeight = topPadHeight + rowsHeight + self.vDomBottomPad - self.height; - } else { - self.vDomTopPad = !forceMove ? self.scrollTop - topPadHeight : self.vDomRowHeight * this.vDomTop + offset; - self.vDomBottomPad = self.vDomBottom == self.displayRowsCount - 1 ? 0 : Math.max(self.vDomScrollHeight - self.vDomTopPad - rowsHeight - topPadHeight, 0); - } - - element.style.paddingTop = self.vDomTopPad + "px"; - element.style.paddingBottom = self.vDomBottomPad + "px"; - - if (forceMove) { - this.scrollTop = self.vDomTopPad + topPadHeight + offset - (this.element.scrollWidth > this.element.clientWidth ? this.element.offsetHeight - this.element.clientHeight : 0); - } - - this.scrollTop = Math.min(this.scrollTop, this.element.scrollHeight - this.height); - - //adjust for horizontal scrollbar if present (and not at top of table) - if (this.element.scrollWidth > this.element.offsetWidth && forceMove) { - this.scrollTop += this.element.offsetHeight - this.element.clientHeight; - } - - this.vDomScrollPosTop = this.scrollTop; - this.vDomScrollPosBottom = this.scrollTop; - - holder.scrollTop = this.scrollTop; - - element.style.minWidth = onlyGroupHeaders ? self.table.columnManager.getWidth() + "px" : ""; - - if (self.table.options.groupBy) { - if (self.table.modules.layout.getMode() != "fitDataFill" && self.displayRowsCount == self.table.modules.groupRows.countGroups()) { - self.tableElement.style.minWidth = self.table.columnManager.getWidth(); - } - } - } else { - this.renderEmptyScroll(); - } - - if (!this.fixedHeight) { - this.adjustTableSize(); - } -}; - -//handle vertical scrolling -RowManager.prototype.scrollVertical = function (dir) { - var topDiff = this.scrollTop - this.vDomScrollPosTop; - var bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - var margin = this.vDomWindowBuffer * 2; - - if (-topDiff > margin || bottomDiff > margin) { - //if big scroll redraw table; - var left = this.scrollLeft; - this._virtualRenderFill(Math.floor(this.element.scrollTop / this.element.scrollHeight * this.displayRowsCount)); - this.scrollHorizontal(left); - } else { - - if (dir) { - //scrolling up - if (topDiff < 0) { - - this._addTopRow(-topDiff); - } - - if (bottomDiff < 0) { - - //hide bottom row if needed - if (this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer) { - this._removeBottomRow(-bottomDiff); - } else { - this.vDomScrollPosBottom = this.scrollTop; - } - } - } else { - //scrolling down - if (topDiff >= 0) { - - //hide top row if needed - if (this.scrollTop > this.vDomWindowBuffer) { - - this._removeTopRow(topDiff); - } else { - this.vDomScrollPosTop = this.scrollTop; - } - } - - if (bottomDiff >= 0) { - - this._addBottomRow(bottomDiff); - } - } - } -}; - -RowManager.prototype._addTopRow = function (topDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomTop) { - var index = this.vDomTop - 1, - topRow = rows[index], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - //hide top row if needed - if (topDiff >= topRowHeight) { - this.styleRow(topRow, index); - table.insertBefore(topRow.getElement(), table.firstChild); - if (!topRow.initialized || !topRow.heightInitialized) { - this.vDomTopNewRows.push(topRow); - - if (!topRow.heightInitialized) { - topRow.clearCellHeight(); - } - } - topRow.initialize(); - - this.vDomTopPad -= topRowHeight; - - if (this.vDomTopPad < 0) { - this.vDomTopPad = index * this.vDomRowHeight; - } - - if (!index) { - this.vDomTopPad = 0; - } - - table.style.paddingTop = this.vDomTopPad + "px"; - this.vDomScrollPosTop -= topRowHeight; - this.vDomTop--; - } - - topDiff = -(this.scrollTop - this.vDomScrollPosTop); - - if (topRow.getHeight() > this.vDomWindowBuffer) { - this.vDomWindowBuffer = topRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomTop && topDiff >= (rows[this.vDomTop - 1].getHeight() || this.vDomRowHeight)) { - this._addTopRow(topDiff, i + 1); - } else { - this._quickNormalizeRowHeight(this.vDomTopNewRows); - } - } -}; - -RowManager.prototype._removeTopRow = function (topDiff) { - var table = this.tableElement, - topRow = this.getDisplayRows()[this.vDomTop], - topRowHeight = topRow.getHeight() || this.vDomRowHeight; - - if (topDiff >= topRowHeight) { - - var rowEl = topRow.getElement(); - rowEl.parentNode.removeChild(rowEl); - - this.vDomTopPad += topRowHeight; - table.style.paddingTop = this.vDomTopPad + "px"; - this.vDomScrollPosTop += this.vDomTop ? topRowHeight : topRowHeight + this.vDomWindowBuffer; - this.vDomTop++; - - topDiff = this.scrollTop - this.vDomScrollPosTop; - - this._removeTopRow(topDiff); - } -}; - -RowManager.prototype._addBottomRow = function (bottomDiff) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var table = this.tableElement, - rows = this.getDisplayRows(); - - if (this.vDomBottom < this.displayRowsCount - 1) { - var index = this.vDomBottom + 1, - bottomRow = rows[index], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - //hide bottom row if needed - if (bottomDiff >= bottomRowHeight) { - this.styleRow(bottomRow, index); - table.appendChild(bottomRow.getElement()); - - if (!bottomRow.initialized || !bottomRow.heightInitialized) { - this.vDomBottomNewRows.push(bottomRow); - - if (!bottomRow.heightInitialized) { - bottomRow.clearCellHeight(); - } - } - - bottomRow.initialize(); - - this.vDomBottomPad -= bottomRowHeight; - - if (this.vDomBottomPad < 0 || index == this.displayRowsCount - 1) { - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - this.vDomScrollPosBottom += bottomRowHeight; - this.vDomBottom++; - } - - bottomDiff = this.scrollTop - this.vDomScrollPosBottom; - - if (bottomRow.getHeight() > this.vDomWindowBuffer) { - this.vDomWindowBuffer = bottomRow.getHeight() * 2; - } - - if (i < this.vDomMaxRenderChain && this.vDomBottom < this.displayRowsCount - 1 && bottomDiff >= (rows[this.vDomBottom + 1].getHeight() || this.vDomRowHeight)) { - this._addBottomRow(bottomDiff, i + 1); - } else { - this._quickNormalizeRowHeight(this.vDomBottomNewRows); - } - } -}; - -RowManager.prototype._removeBottomRow = function (bottomDiff) { - var table = this.tableElement, - bottomRow = this.getDisplayRows()[this.vDomBottom], - bottomRowHeight = bottomRow.getHeight() || this.vDomRowHeight; - - if (bottomDiff >= bottomRowHeight) { - - var rowEl = bottomRow.getElement(); - - if (rowEl.parentNode) { - rowEl.parentNode.removeChild(rowEl); - } - - this.vDomBottomPad += bottomRowHeight; - - if (this.vDomBottomPad < 0) { - this.vDomBottomPad = 0; - } - - table.style.paddingBottom = this.vDomBottomPad + "px"; - this.vDomScrollPosBottom -= bottomRowHeight; - this.vDomBottom--; - - bottomDiff = -(this.scrollTop - this.vDomScrollPosBottom); - - this._removeBottomRow(bottomDiff); - } -}; - -RowManager.prototype._quickNormalizeRowHeight = function (rows) { - rows.forEach(function (row) { - row.calcHeight(); - }); - - rows.forEach(function (row) { - row.setCellHeight(); - }); - - rows.length = 0; -}; - -//normalize height of active rows -RowManager.prototype.normalizeHeight = function () { - this.activeRows.forEach(function (row) { - row.normalizeHeight(); - }); -}; - -//adjust the height of the table holder to fit in the Tabulator element -RowManager.prototype.adjustTableSize = function () { - var initialHeight = this.element.clientHeight, - modExists; - - if (this.renderMode === "virtual") { - var otherHeight = this.columnManager.getElement().offsetHeight + (this.table.footerManager && !this.table.footerManager.external ? this.table.footerManager.getElement().offsetHeight : 0); - - if (this.fixedHeight) { - this.element.style.minHeight = "calc(100% - " + otherHeight + "px)"; - this.element.style.height = "calc(100% - " + otherHeight + "px)"; - this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)"; - } else { - this.element.style.height = ""; - this.element.style.height = this.table.element.clientHeight - otherHeight + "px"; - this.element.scrollTop = this.scrollTop; - } - - this.height = this.element.clientHeight; - this.vDomWindowBuffer = this.table.options.virtualDomBuffer || this.height; - - //check if the table has changed size when dealing with variable height tables - if (!this.fixedHeight && initialHeight != this.element.clientHeight) { - modExists = this.table.modExists("resizeTable"); - - if (modExists && !this.table.modules.resizeTable.autoResize || !modExists) { - this.redraw(); - } - } - } -}; - -//renitialize all rows -RowManager.prototype.reinitialize = function () { - this.rows.forEach(function (row) { - row.reinitialize(); - }); -}; - -//prevent table from being redrawn -RowManager.prototype.blockRedraw = function () { - this.redrawBlock = true; - this.redrawBlockRestoreConfig = false; -}; - -//restore table redrawing -RowManager.prototype.restoreRedraw = function () { - this.redrawBlock = false; - - if (this.redrawBlockRestoreConfig) { - this.refreshActiveData(this.redrawBlockRestoreConfig.stage, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition); - - this.redrawBlockRestoreConfig = false; - } else { - if (this.redrawBlockRederInPosition) { - this.reRenderInPosition(); - } - } - - this.redrawBlockRederInPosition = false; -}; - -//redraw table -RowManager.prototype.redraw = function (force) { - var pos = 0, - left = this.scrollLeft; - - this.adjustTableSize(); - - this.table.tableWidth = this.table.element.clientWidth; - - if (!force) { - if (this.renderMode == "classic") { - - if (this.table.options.groupBy) { - this.refreshActiveData("group", false, false); - } else { - this._simpleRender(); - } - } else { - this.reRenderInPosition(); - this.scrollHorizontal(left); - } - - if (!this.displayRowsCount) { - if (this.table.options.placeholder) { - this.getElement().appendChild(this.table.options.placeholder); - } - } - } else { - this.renderTable(); - } -}; - -RowManager.prototype.resetScroll = function () { - this.element.scrollLeft = 0; - this.element.scrollTop = 0; - - if (this.table.browser === "ie") { - var event = document.createEvent("Event"); - event.initEvent("scroll", false, true); - this.element.dispatchEvent(event); - } else { - this.element.dispatchEvent(new Event('scroll')); - } -}; - -//public row object -var RowComponent = function RowComponent(row) { - this._row = row; -}; - -RowComponent.prototype.getData = function (transform) { - return this._row.getData(transform); -}; - -RowComponent.prototype.getElement = function () { - return this._row.getElement(); -}; - -RowComponent.prototype.getCells = function () { - var cells = []; - - this._row.getCells().forEach(function (cell) { - cells.push(cell.getComponent()); - }); - - return cells; -}; - -RowComponent.prototype.getCell = function (column) { - var cell = this._row.getCell(column); - return cell ? cell.getComponent() : false; -}; - -RowComponent.prototype.getIndex = function () { - return this._row.getData("data")[this._row.table.options.index]; -}; - -RowComponent.prototype.getPosition = function (active) { - return this._row.table.rowManager.getRowPosition(this._row, active); -}; - -RowComponent.prototype.delete = function () { - return this._row.delete(); -}; - -RowComponent.prototype.scrollTo = function () { - return this._row.table.rowManager.scrollToRow(this._row); -}; - -RowComponent.prototype.pageTo = function () { - if (this._row.table.modExists("page", true)) { - return this._row.table.modules.page.setPageToRow(this._row); - } -}; - -RowComponent.prototype.move = function (to, after) { - this._row.moveToRow(to, after); -}; - -RowComponent.prototype.update = function (data) { - return this._row.updateData(data); -}; - -RowComponent.prototype.normalizeHeight = function () { - this._row.normalizeHeight(true); -}; - -RowComponent.prototype.select = function () { - this._row.table.modules.selectRow.selectRows(this._row); -}; - -RowComponent.prototype.deselect = function () { - this._row.table.modules.selectRow.deselectRows(this._row); -}; - -RowComponent.prototype.toggleSelect = function () { - this._row.table.modules.selectRow.toggleRow(this._row); -}; - -RowComponent.prototype.isSelected = function () { - return this._row.table.modules.selectRow.isRowSelected(this._row); -}; - -RowComponent.prototype._getSelf = function () { - return this._row; -}; - -RowComponent.prototype.validate = function () { - return this._row.validate(); -}; - -RowComponent.prototype.freeze = function () { - if (this._row.table.modExists("frozenRows", true)) { - this._row.table.modules.frozenRows.freezeRow(this._row); - } -}; - -RowComponent.prototype.unfreeze = function () { - if (this._row.table.modExists("frozenRows", true)) { - this._row.table.modules.frozenRows.unfreezeRow(this._row); - } -}; - -RowComponent.prototype.isFrozen = function () { - if (this._row.table.modExists("frozenRows", true)) { - var index = this._row.table.modules.frozenRows.rows.indexOf(this._row); - return index > -1; - } - - return false; -}; - -RowComponent.prototype.treeCollapse = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.collapseRow(this._row); - } -}; - -RowComponent.prototype.treeExpand = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.expandRow(this._row); - } -}; - -RowComponent.prototype.treeToggle = function () { - if (this._row.table.modExists("dataTree", true)) { - this._row.table.modules.dataTree.toggleRow(this._row); - } -}; - -RowComponent.prototype.getTreeParent = function () { - if (this._row.table.modExists("dataTree", true)) { - return this._row.table.modules.dataTree.getTreeParent(this._row); - } - - return false; -}; - -RowComponent.prototype.getTreeChildren = function () { - if (this._row.table.modExists("dataTree", true)) { - return this._row.table.modules.dataTree.getTreeChildren(this._row); - } - - return false; -}; - -RowComponent.prototype.addTreeChild = function (data, pos, index) { - if (this._row.table.modExists("dataTree", true)) { - return this._row.table.modules.dataTree.addTreeChildRow(this._row, data, pos, index); - } - - return false; -}; - -RowComponent.prototype.reformat = function () { - return this._row.reinitialize(); -}; - -RowComponent.prototype.getGroup = function () { - return this._row.getGroup().getComponent(); -}; - -RowComponent.prototype.getTable = function () { - return this._row.table; -}; - -RowComponent.prototype.getNextRow = function () { - var row = this._row.nextRow(); - return row ? row.getComponent() : row; -}; - -RowComponent.prototype.getPrevRow = function () { - var row = this._row.prevRow(); - return row ? row.getComponent() : row; -}; - -var Row = function Row(data, parent) { - var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "row"; - - this.table = parent.table; - this.parent = parent; - this.data = {}; - this.type = type; //type of element - this.element = this.createElement(); - this.modules = {}; //hold module variables; - this.cells = []; - this.height = 0; //hold element height - this.heightStyled = ""; //hold element height prestyled to improve render efficiency - this.manualHeight = false; //user has manually set row height - this.outerHeight = 0; //holde lements outer height - this.initialized = false; //element has been rendered - this.heightInitialized = false; //element has resized cells to fit - - this.component = null; - - this.setData(data); - this.generateElement(); -}; - -Row.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-row"); - el.setAttribute("role", "row"); - - return el; -}; - -Row.prototype.getElement = function () { - return this.element; -}; - -Row.prototype.detachElement = function () { - if (this.element && this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -Row.prototype.generateElement = function () { - var self = this, - dblTap, - tapHold, - tap; - - //set row selection characteristics - if (self.table.options.selectable !== false && self.table.modExists("selectRow")) { - self.table.modules.selectRow.initializeRow(this); - } - - //setup movable rows - if (self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - self.table.modules.moveRow.initializeRow(this); - } - - //setup data tree - if (self.table.options.dataTree !== false && self.table.modExists("dataTree")) { - self.table.modules.dataTree.initializeRow(this); - } - - //setup column colapse container - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - self.table.modules.responsiveLayout.initializeRow(this); - } - - //set column menu - if (self.table.options.rowContextMenu && this.table.modExists("menu")) { - self.table.modules.menu.initializeRow(this); - } - - //handle row click events - if (self.table.options.rowClick) { - self.element.addEventListener("click", function (e) { - self.table.options.rowClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowDblClick) { - self.element.addEventListener("dblclick", function (e) { - self.table.options.rowDblClick(e, self.getComponent()); - }); - } - - if (self.table.options.rowContext) { - self.element.addEventListener("contextmenu", function (e) { - self.table.options.rowContext(e, self.getComponent()); - }); - } - - //handle mouse events - if (self.table.options.rowMouseEnter) { - self.element.addEventListener("mouseenter", function (e) { - self.table.options.rowMouseEnter(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseLeave) { - self.element.addEventListener("mouseleave", function (e) { - self.table.options.rowMouseLeave(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOver) { - self.element.addEventListener("mouseover", function (e) { - self.table.options.rowMouseOver(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseOut) { - self.element.addEventListener("mouseout", function (e) { - self.table.options.rowMouseOut(e, self.getComponent()); - }); - } - - if (self.table.options.rowMouseMove) { - self.element.addEventListener("mousemove", function (e) { - self.table.options.rowMouseMove(e, self.getComponent()); - }); - } - - if (self.table.options.rowTap) { - - tap = false; - - self.element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - if (tap) { - self.table.options.rowTap(e, self.getComponent()); - } - - tap = false; - }); - } - - if (self.table.options.rowDblTap) { - - dblTap = null; - - self.element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - self.table.options.rowDblTap(e, self.getComponent()); - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (self.table.options.rowTapHold) { - - tapHold = null; - - self.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - self.table.options.rowTapHold(e, self.getComponent()); - }, 1000); - }, { passive: true }); - - self.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } -}; - -Row.prototype.generateCells = function () { - this.cells = this.table.columnManager.generateCells(this); -}; - -//functions to setup on first render -Row.prototype.initialize = function (force) { - var self = this; - - if (!self.initialized || force) { - - self.deleteCells(); - - while (self.element.firstChild) { - self.element.removeChild(self.element.firstChild); - } //handle frozen cells - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layoutRow(this); - } - - this.generateCells(); - - self.cells.forEach(function (cell) { - self.element.appendChild(cell.getElement()); - cell.cellRendered(); - }); - - if (force) { - self.normalizeHeight(); - } - - //setup movable rows - if (self.table.options.dataTree && self.table.modExists("dataTree")) { - self.table.modules.dataTree.layoutRow(this); - } - - //setup column colapse container - if (self.table.options.responsiveLayout === "collapse" && self.table.modExists("responsiveLayout")) { - self.table.modules.responsiveLayout.layoutRow(this); - } - - if (self.table.options.rowFormatter) { - self.table.options.rowFormatter(self.getComponent()); - } - - //set resizable handles - if (self.table.options.resizableRows && self.table.modExists("resizeRows")) { - self.table.modules.resizeRows.initializeRow(self); - } - - self.initialized = true; - } -}; - -Row.prototype.reinitializeHeight = function () { - this.heightInitialized = false; - - if (this.element.offsetParent !== null) { - this.normalizeHeight(true); - } -}; - -Row.prototype.reinitialize = function () { - this.initialized = false; - this.heightInitialized = false; - - if (!this.manualHeight) { - this.height = 0; - this.heightStyled = ""; - } - - if (this.element.offsetParent !== null) { - this.initialize(true); - } -}; - -//get heights when doing bulk row style calcs in virtual DOM -Row.prototype.calcHeight = function (force) { - - var maxHeight = 0, - minHeight = this.table.options.resizableRows ? this.element.clientHeight : 0; - - this.cells.forEach(function (cell) { - var height = cell.getHeight(); - if (height > maxHeight) { - maxHeight = height; - } - }); - - if (force) { - this.height = Math.max(maxHeight, minHeight); - } else { - this.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight); - } - - this.heightStyled = this.height ? this.height + "px" : ""; - this.outerHeight = this.element.offsetHeight; -}; - -//set of cells -Row.prototype.setCellHeight = function () { - this.cells.forEach(function (cell) { - cell.setHeight(); - }); - - this.heightInitialized = true; -}; - -Row.prototype.clearCellHeight = function () { - this.cells.forEach(function (cell) { - cell.clearHeight(); - }); -}; - -//normalize the height of elements in the row -Row.prototype.normalizeHeight = function (force) { - - if (force) { - this.clearCellHeight(); - } - - this.calcHeight(force); - - this.setCellHeight(); -}; - -// Row.prototype.setHeight = function(height){ -// this.height = height; - -// this.setCellHeight(); -// }; - -//set height of rows -Row.prototype.setHeight = function (height, force) { - if (this.height != height || force) { - - this.manualHeight = true; - - this.height = height; - this.heightStyled = height ? height + "px" : ""; - - this.setCellHeight(); - - // this.outerHeight = this.element.outerHeight(); - this.outerHeight = this.element.offsetHeight; - } -}; - -//return rows outer height -Row.prototype.getHeight = function () { - return this.outerHeight; -}; - -//return rows outer Width -Row.prototype.getWidth = function () { - return this.element.offsetWidth; -}; - -//////////////// Cell Management ///////////////// - -Row.prototype.deleteCell = function (cell) { - var index = this.cells.indexOf(cell); - - if (index > -1) { - this.cells.splice(index, 1); - } -}; - -//////////////// Data Management ///////////////// - -Row.prototype.setData = function (data) { - if (this.table.modExists("mutator")) { - data = this.table.modules.mutator.transformRow(data, "data"); - } - - this.data = data; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) { - this.table.modules.reactiveData.watchRow(this); - } -}; - -//update the rows data -Row.prototype.updateData = function (updatedData) { - var _this15 = this; - - var visible = Tabulator.prototype.helpers.elVisible(this.element), - tempData = {}, - newRowData; - - return new Promise(function (resolve, reject) { - - if (typeof updatedData === "string") { - updatedData = JSON.parse(updatedData); - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - _this15.table.modules.reactiveData.block(); - } - - //mutate incomming data if needed - if (_this15.table.modExists("mutator")) { - - tempData = Object.assign(tempData, _this15.data); - tempData = Object.assign(tempData, updatedData); - - newRowData = _this15.table.modules.mutator.transformRow(tempData, "data", updatedData); - } else { - newRowData = updatedData; - } - - //set data - for (var attrname in newRowData) { - _this15.data[attrname] = newRowData[attrname]; - } - - if (_this15.table.options.reactiveData && _this15.table.modExists("reactiveData", true)) { - _this15.table.modules.reactiveData.unblock(); - } - - //update affected cells only - for (var attrname in updatedData) { - - var columns = _this15.table.columnManager.getColumnsByFieldRoot(attrname); - - columns.forEach(function (column) { - var cell = _this15.getCell(column.getField()); - - if (cell) { - var value = column.getFieldValue(newRowData); - if (cell.getValue() != value) { - cell.setValueProcessData(value); - - if (visible) { - cell.cellRendered(); - } - } - } - }); - } - - //Partial reinitialization if visible - if (visible) { - _this15.normalizeHeight(true); - - if (_this15.table.options.rowFormatter) { - _this15.table.options.rowFormatter(_this15.getComponent()); - } - } else { - _this15.initialized = false; - _this15.height = 0; - _this15.heightStyled = ""; - } - - if (_this15.table.options.dataTree !== false && _this15.table.modExists("dataTree") && _this15.table.modules.dataTree.redrawNeeded(updatedData)) { - _this15.table.modules.dataTree.initializeRow(_this15); - _this15.table.modules.dataTree.layoutRow(_this15); - _this15.table.rowManager.refreshActiveData("tree", false, true); - } - - //this.reinitialize(); - - _this15.table.options.rowUpdated.call(_this15.table, _this15.getComponent()); - - resolve(); - }); -}; - -Row.prototype.getData = function (transform) { - var self = this; - - if (transform) { - if (self.table.modExists("accessor")) { - return self.table.modules.accessor.transformRow(self.data, transform); - } - } else { - return this.data; - } -}; - -Row.prototype.getCell = function (column) { - var match = false; - - column = this.table.columnManager.findColumn(column); - - match = this.cells.find(function (cell) { - return cell.column === column; - }); - - return match; -}; - -Row.prototype.getCellIndex = function (findCell) { - return this.cells.findIndex(function (cell) { - return cell === findCell; - }); -}; - -Row.prototype.findNextEditableCell = function (index) { - var nextCell = false; - - if (index < this.cells.length - 1) { - for (var i = index + 1; i < this.cells.length; i++) { - var cell = this.cells[i]; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - var allowEdit = true; - - if (typeof cell.column.modules.edit.check == "function") { - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - nextCell = cell; - break; - } - } - } - } - - return nextCell; -}; - -Row.prototype.findPrevEditableCell = function (index) { - var prevCell = false; - - if (index > 0) { - for (var i = index - 1; i >= 0; i--) { - var cell = this.cells[i], - allowEdit = true; - - if (cell.column.modules.edit && Tabulator.prototype.helpers.elVisible(cell.getElement())) { - if (typeof cell.column.modules.edit.check == "function") { - allowEdit = cell.column.modules.edit.check(cell.getComponent()); - } - - if (allowEdit) { - prevCell = cell; - break; - } - } - } - } - - return prevCell; -}; - -Row.prototype.getCells = function () { - return this.cells; -}; - -Row.prototype.nextRow = function () { - var row = this.table.rowManager.nextDisplayRow(this, true); - return row || false; -}; - -Row.prototype.prevRow = function () { - var row = this.table.rowManager.prevDisplayRow(this, true); - return row || false; -}; - -Row.prototype.moveToRow = function (to, before) { - var toRow = this.table.rowManager.findRow(to); - - if (toRow) { - this.table.rowManager.moveRowActual(this, toRow, !before); - this.table.rowManager.refreshActiveData("display", false, true); - } else { - console.warn("Move Error - No matching row found:", to); - } -}; - -Row.prototype.validate = function () { - var invalid = []; - - this.cells.forEach(function (cell) { - if (!cell.validate()) { - invalid.push(cell.getComponent()); - } - }); - - return invalid.length ? invalid : true; -}; - -///////////////////// Actions ///////////////////// - -Row.prototype.delete = function () { - var _this16 = this; - - return new Promise(function (resolve, reject) { - var index, rows; - - if (_this16.table.options.history && _this16.table.modExists("history")) { - - if (_this16.table.options.groupBy && _this16.table.modExists("groupRows")) { - rows = _this16.getGroup().rows; - index = rows.indexOf(_this16); - - if (index) { - index = rows[index - 1]; - } - } else { - index = _this16.table.rowManager.getRowIndex(_this16); - - if (index) { - index = _this16.table.rowManager.rows[index - 1]; - } - } - - _this16.table.modules.history.action("rowDelete", _this16, { data: _this16.getData(), pos: !index, index: index }); - } - - _this16.deleteActual(); - - resolve(); - }); -}; - -Row.prototype.deleteActual = function (blockRedraw) { - var index = this.table.rowManager.getRowIndex(this); - - //deselect row if it is selected - if (this.table.modExists("selectRow")) { - this.table.modules.selectRow._deselectRow(this, true); - } - - //cancel edit if row is currently being edited - if (this.table.modExists("edit")) { - if (this.table.modules.edit.currentCell.row === this) { - this.table.modules.edit.cancelEdit(); - } - } - - // if(this.table.options.dataTree && this.table.modExists("dataTree")){ - // this.table.modules.dataTree.collapseRow(this, true); - // } - - //remove any reactive data watchers from row object - if (this.table.options.reactiveData && this.table.modExists("reactiveData", true)) {} - // this.table.modules.reactiveData.unwatchRow(this); - - - //remove from group - if (this.modules.group) { - this.modules.group.removeRow(this); - } - - this.table.rowManager.deleteRow(this, blockRedraw); - - this.deleteCells(); - - this.initialized = false; - this.heightInitialized = false; - - if (this.table.options.dataTree && this.table.modExists("dataTree", true)) { - this.table.modules.dataTree.rowDelete(this); - } - - //recalc column calculations if present - if (this.table.modExists("columnCalcs")) { - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - this.table.modules.columnCalcs.recalcRowGroup(this); - } else { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } -}; - -Row.prototype.deleteCells = function () { - var cellCount = this.cells.length; - - for (var i = 0; i < cellCount; i++) { - this.cells[0].delete(); - } -}; - -Row.prototype.wipe = function () { - this.deleteCells(); - - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element = false; - this.modules = {}; - - if (this.element.parentNode) { - this.element.parentNode.removeChild(this.element); - } -}; - -Row.prototype.getGroup = function () { - return this.modules.group || false; -}; - -//////////////// Object Generation ///////////////// -Row.prototype.getComponent = function () { - if (!this.component) { - this.component = new RowComponent(this); - } - - return this.component; -}; - -//public row object -var CellComponent = function CellComponent(cell) { - this._cell = cell; -}; - -CellComponent.prototype.getValue = function () { - return this._cell.getValue(); -}; - -CellComponent.prototype.getOldValue = function () { - return this._cell.getOldValue(); -}; - -CellComponent.prototype.getElement = function () { - return this._cell.getElement(); -}; - -CellComponent.prototype.getRow = function () { - return this._cell.row.getComponent(); -}; - -CellComponent.prototype.getData = function () { - return this._cell.row.getData(); -}; - -CellComponent.prototype.getField = function () { - return this._cell.column.getField(); -}; - -CellComponent.prototype.getColumn = function () { - return this._cell.column.getComponent(); -}; - -CellComponent.prototype.setValue = function (value, mutate) { - if (typeof mutate == "undefined") { - mutate = true; - } - - this._cell.setValue(value, mutate); -}; - -CellComponent.prototype.restoreOldValue = function () { - this._cell.setValueActual(this._cell.getOldValue()); -}; - -CellComponent.prototype.edit = function (force) { - return this._cell.edit(force); -}; - -CellComponent.prototype.cancelEdit = function () { - this._cell.cancelEdit(); -}; - -CellComponent.prototype.isEdited = function () { - return !!this._cell.modules.edit && this._cell.modules.edit.edited; -}; - -CellComponent.prototype.clearEdited = function () { - if (self.table.modExists("edit", true)) { - this._cell.table.modules.edit.clearEdited(this._cell); - } -}; - -CellComponent.prototype.isValid = function () { - return this._cell.modules.validate ? !this._cell.modules.validate.invalid : true; -}; - -CellComponent.prototype.validate = function () { - return this._cell.validate(); -}; - -CellComponent.prototype.clearValidation = function () { - if (self.table.modExists("validate", true)) { - this._cell.table.modules.validate.clearValidation(this._cell); - } -}; - -CellComponent.prototype.nav = function () { - return this._cell.nav(); -}; - -CellComponent.prototype.checkHeight = function () { - this._cell.checkHeight(); -}; - -CellComponent.prototype.getTable = function () { - return this._cell.table; -}; - -CellComponent.prototype._getSelf = function () { - return this._cell; -}; - -var Cell = function Cell(column, row) { - - this.table = column.table; - this.column = column; - this.row = row; - this.element = null; - this.value = null; - this.oldValue = null; - this.modules = {}; - - this.height = null; - this.width = null; - this.minWidth = null; - - this.component = null; - - this.build(); -}; - -//////////////// Setup Functions ///////////////// - -//generate element -Cell.prototype.build = function () { - this.generateElement(); - - this.setWidth(); - - this._configureCell(); - - this.setValueActual(this.column.getFieldValue(this.row.data)); -}; - -Cell.prototype.generateElement = function () { - this.element = document.createElement('div'); - this.element.className = "tabulator-cell"; - this.element.setAttribute("role", "gridcell"); - this.element = this.element; -}; - -Cell.prototype._configureCell = function () { - var self = this, - cellEvents = self.column.cellEvents, - element = self.element, - field = this.column.getField(), - vertAligns = { - top: "flex-start", - bottom: "flex-end", - middle: "center" - }, - hozAligns = { - left: "flex-start", - right: "flex-end", - center: "center" - }; - - //set text alignment - element.style.textAlign = self.column.hozAlign; - - if (self.column.vertAlign) { - element.style.display = "inline-flex"; - - element.style.alignItems = vertAligns[self.column.vertAlign] || ""; - - if (self.column.hozAlign) { - element.style.justifyContent = hozAligns[self.column.hozAlign] || ""; - } - } - - if (field) { - element.setAttribute("tabulator-field", field); - } - - //add class to cell if needed - if (self.column.definition.cssClass) { - var classNames = self.column.definition.cssClass.split(" "); - classNames.forEach(function (className) { - element.classList.add(className); - }); - } - - //update tooltip on mouse enter - if (this.table.options.tooltipGenerationMode === "hover") { - element.addEventListener("mouseenter", function (e) { - self._generateTooltip(); - }); - } - - self._bindClickEvents(cellEvents); - - self._bindTouchEvents(cellEvents); - - self._bindMouseEvents(cellEvents); - - if (self.column.modules.edit) { - self.table.modules.edit.bindEditor(self); - } - - if (self.column.definition.rowHandle && self.table.options.movableRows !== false && self.table.modExists("moveRow")) { - self.table.modules.moveRow.initializeCell(self); - } - - //hide cell if not visible - if (!self.column.visible) { - self.hide(); - } -}; - -Cell.prototype._bindClickEvents = function (cellEvents) { - var self = this, - element = self.element; - - //set event bindings - if (cellEvents.cellClick || self.table.options.cellClick) { - element.addEventListener("click", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellClick) { - cellEvents.cellClick.call(self.table, e, component); - } - - if (self.table.options.cellClick) { - self.table.options.cellClick.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellDblClick || this.table.options.cellDblClick) { - element.addEventListener("dblclick", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellDblClick) { - cellEvents.cellDblClick.call(self.table, e, component); - } - - if (self.table.options.cellDblClick) { - self.table.options.cellDblClick.call(self.table, e, component); - } - }); - } else { - element.addEventListener("dblclick", function (e) { - - if (self.table.modExists("edit")) { - if (self.table.modules.edit.currentCell === self) { - return; //prevent instant selection of editor content - } - } - - e.preventDefault(); - - try { - if (document.selection) { - // IE - var range = document.body.createTextRange(); - range.moveToElementText(self.element); - range.select(); - } else if (window.getSelection) { - var range = document.createRange(); - range.selectNode(self.element); - window.getSelection().removeAllRanges(); - window.getSelection().addRange(range); - } - } catch (e) {} - }); - } - - if (cellEvents.cellContext || this.table.options.cellContext) { - element.addEventListener("contextmenu", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellContext) { - cellEvents.cellContext.call(self.table, e, component); - } - - if (self.table.options.cellContext) { - self.table.options.cellContext.call(self.table, e, component); - } - }); - } -}; - -Cell.prototype._bindMouseEvents = function (cellEvents) { - var self = this, - element = self.element; - - if (cellEvents.cellMouseEnter || self.table.options.cellMouseEnter) { - element.addEventListener("mouseenter", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseEnter) { - cellEvents.cellMouseEnter.call(self.table, e, component); - } - - if (self.table.options.cellMouseEnter) { - self.table.options.cellMouseEnter.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseLeave || self.table.options.cellMouseLeave) { - element.addEventListener("mouseleave", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseLeave) { - cellEvents.cellMouseLeave.call(self.table, e, component); - } - - if (self.table.options.cellMouseLeave) { - self.table.options.cellMouseLeave.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOver || self.table.options.cellMouseOver) { - element.addEventListener("mouseover", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseOver) { - cellEvents.cellMouseOver.call(self.table, e, component); - } - - if (self.table.options.cellMouseOver) { - self.table.options.cellMouseOver.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseOut || self.table.options.cellMouseOut) { - element.addEventListener("mouseout", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseOut) { - cellEvents.cellMouseOut.call(self.table, e, component); - } - - if (self.table.options.cellMouseOut) { - self.table.options.cellMouseOut.call(self.table, e, component); - } - }); - } - - if (cellEvents.cellMouseMove || self.table.options.cellMouseMove) { - element.addEventListener("mousemove", function (e) { - var component = self.getComponent(); - - if (cellEvents.cellMouseMove) { - cellEvents.cellMouseMove.call(self.table, e, component); - } - - if (self.table.options.cellMouseMove) { - self.table.options.cellMouseMove.call(self.table, e, component); - } - }); - } -}; - -Cell.prototype._bindTouchEvents = function (cellEvents) { - var self = this, - element = self.element, - dblTap, - tapHold, - tap; - - if (cellEvents.cellTap || this.table.options.cellTap) { - tap = false; - - element.addEventListener("touchstart", function (e) { - tap = true; - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - if (tap) { - var component = self.getComponent(); - - if (cellEvents.cellTap) { - cellEvents.cellTap.call(self.table, e, component); - } - - if (self.table.options.cellTap) { - self.table.options.cellTap.call(self.table, e, component); - } - } - - tap = false; - }); - } - - if (cellEvents.cellDblTap || this.table.options.cellDblTap) { - dblTap = null; - - element.addEventListener("touchend", function (e) { - - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - - var component = self.getComponent(); - - if (cellEvents.cellDblTap) { - cellEvents.cellDblTap.call(self.table, e, component); - } - - if (self.table.options.cellDblTap) { - self.table.options.cellDblTap.call(self.table, e, component); - } - } else { - - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (cellEvents.cellTapHold || this.table.options.cellTapHold) { - tapHold = null; - - element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - var component = self.getComponent(); - - if (cellEvents.cellTapHold) { - cellEvents.cellTapHold.call(self.table, e, component); - } - - if (self.table.options.cellTapHold) { - self.table.options.cellTapHold.call(self.table, e, component); - } - }, 1000); - }, { passive: true }); - - element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } -}; - -//generate cell contents -Cell.prototype._generateContents = function () { - var val; - - if (this.table.modExists("format")) { - val = this.table.modules.format.formatValue(this); - } else { - val = this.element.innerHTML = this.value; - } - - switch (typeof val === 'undefined' ? 'undefined' : _typeof(val)) { - case "object": - if (val instanceof Node) { - - //clear previous cell contents - while (this.element.firstChild) { - this.element.removeChild(this.element.firstChild); - }this.element.appendChild(val); - } else { - this.element.innerHTML = ""; - - if (val != null) { - console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", val); - } - } - break; - case "undefined": - case "null": - this.element.innerHTML = ""; - break; - default: - this.element.innerHTML = val; - } -}; - -Cell.prototype.cellRendered = function () { - if (this.table.modExists("format") && this.table.modules.format.cellRendered) { - this.table.modules.format.cellRendered(this); - } -}; - -//generate tooltip text -Cell.prototype._generateTooltip = function () { - var tooltip = this.column.tooltip; - - if (tooltip) { - if (tooltip === true) { - tooltip = this.value; - } else if (typeof tooltip == "function") { - tooltip = tooltip(this.getComponent()); - - if (tooltip === false) { - tooltip = ""; - } - } - - if (typeof tooltip === "undefined") { - tooltip = ""; - } - - this.element.setAttribute("title", tooltip); - } else { - this.element.setAttribute("title", ""); - } -}; - -//////////////////// Getters //////////////////// -Cell.prototype.getElement = function () { - return this.element; -}; - -Cell.prototype.getValue = function () { - return this.value; -}; - -Cell.prototype.getOldValue = function () { - return this.oldValue; -}; - -//////////////////// Actions //////////////////// - -Cell.prototype.setValue = function (value, mutate) { - - var changed = this.setValueProcessData(value, mutate), - component; - - if (changed) { - if (this.table.options.history && this.table.modExists("history")) { - this.table.modules.history.action("cellEdit", this, { oldValue: this.oldValue, newValue: this.value }); - } - - component = this.getComponent(); - - if (this.column.cellEvents.cellEdited) { - this.column.cellEvents.cellEdited.call(this.table, component); - } - - this.cellRendered(); - - this.table.options.cellEdited.call(this.table, component); - - this.table.options.dataEdited.call(this.table, this.table.rowManager.getData()); - } -}; - -Cell.prototype.setValueProcessData = function (value, mutate) { - var changed = false; - - if (this.value != value) { - - changed = true; - - if (mutate) { - if (this.column.modules.mutate) { - value = this.table.modules.mutator.transformCell(this, value); - } - } - } - - this.setValueActual(value); - - if (changed && this.table.modExists("columnCalcs")) { - if (this.column.definition.topCalc || this.column.definition.bottomCalc) { - if (this.table.options.groupBy && this.table.modExists("groupRows")) { - - if (this.table.options.columnCalcs == "table" || this.table.options.columnCalcs == "both") { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - - if (this.table.options.columnCalcs != "table") { - this.table.modules.columnCalcs.recalcRowGroup(this.row); - } - } else { - this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows); - } - } - } - - return changed; -}; - -Cell.prototype.setValueActual = function (value) { - this.oldValue = this.value; - - this.value = value; - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - this.table.modules.reactiveData.block(); - } - - this.column.setFieldValue(this.row.data, value); - - if (this.table.options.reactiveData && this.table.modExists("reactiveData")) { - this.table.modules.reactiveData.unblock(); - } - - this._generateContents(); - this._generateTooltip(); - - //set resizable handles - if (this.table.options.resizableColumns && this.table.modExists("resizeColumns")) { - this.table.modules.resizeColumns.initializeColumn("cell", this.column, this.element); - } - - //set column menu - if (this.column.definition.contextMenu && this.table.modExists("menu")) { - this.table.modules.menu.initializeCell(this); - } - - //handle frozen cells - if (this.table.modExists("frozenColumns")) { - this.table.modules.frozenColumns.layoutElement(this.element, this.column); - } -}; - -Cell.prototype.setWidth = function () { - this.width = this.column.width; - this.element.style.width = this.column.widthStyled; -}; - -Cell.prototype.clearWidth = function () { - this.width = ""; - this.element.style.width = ""; -}; - -Cell.prototype.getWidth = function () { - return this.width || this.element.offsetWidth; -}; - -Cell.prototype.setMinWidth = function () { - this.minWidth = this.column.minWidth; - this.element.style.minWidth = this.column.minWidthStyled; -}; - -Cell.prototype.checkHeight = function () { - // var height = this.element.css("height"); - this.row.reinitializeHeight(); -}; - -Cell.prototype.clearHeight = function () { - this.element.style.height = ""; - this.height = null; -}; - -Cell.prototype.setHeight = function () { - this.height = this.row.height; - this.element.style.height = this.row.heightStyled; -}; - -Cell.prototype.getHeight = function () { - return this.height || this.element.offsetHeight; -}; - -Cell.prototype.show = function () { - this.element.style.display = ""; -}; - -Cell.prototype.hide = function () { - this.element.style.display = "none"; -}; - -Cell.prototype.edit = function (force) { - if (this.table.modExists("edit", true)) { - return this.table.modules.edit.editCell(this, force); - } -}; - -Cell.prototype.cancelEdit = function () { - if (this.table.modExists("edit", true)) { - var editing = this.table.modules.edit.getCurrentCell(); - - if (editing && editing._getSelf() === this) { - this.table.modules.edit.cancelEdit(); - } else { - console.warn("Cancel Editor Error - This cell is not currently being edited "); - } - } -}; - -Cell.prototype.validate = function () { - if (this.column.modules.validate && this.table.modExists("validate", true)) { - var valid = this.table.modules.validate.validate(this.column.modules.validate, this, this.getValue()); - - return valid === true; - } else { - return true; - } -}; - -Cell.prototype.delete = function () { - if (!this.table.rowManager.redrawBlock) { - this.element.parentNode.removeChild(this.element); - } - - if (this.modules.validate && this.modules.validate.invalid) { - this.table.modules.validate.clearValidation(this); - } - - if (this.modules.edit && this.modules.edit.edited) { - this.table.modules.edit.clearEdited(this); - } - - this.element = false; - this.column.deleteCell(this); - this.row.deleteCell(this); - this.calcs = {}; -}; - -//////////////// Navigation ///////////////// - -Cell.prototype.nav = function () { - - var self = this, - nextCell = false, - index = this.row.getCellIndex(this); - - return { - next: function next() { - var nextCell = this.right(), - nextRow; - - if (!nextCell) { - nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - nextCell = nextRow.findNextEditableCell(-1); - - if (nextCell) { - nextCell.edit(); - return true; - } - } - } else { - return true; - } - - return false; - }, - prev: function prev() { - var nextCell = this.left(), - prevRow; - - if (!nextCell) { - prevRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (prevRow) { - nextCell = prevRow.findPrevEditableCell(prevRow.cells.length); - - if (nextCell) { - nextCell.edit(); - return true; - } - } - } else { - return true; - } - - return false; - }, - left: function left() { - - nextCell = self.row.findPrevEditableCell(index); - - if (nextCell) { - nextCell.edit(); - return true; - } else { - return false; - } - }, - right: function right() { - nextCell = self.row.findNextEditableCell(index); - - if (nextCell) { - nextCell.edit(); - return true; - } else { - return false; - } - }, - up: function up() { - var nextRow = self.table.rowManager.prevDisplayRow(self.row, true); - - if (nextRow) { - nextRow.cells[index].edit(); - } - }, - down: function down() { - var nextRow = self.table.rowManager.nextDisplayRow(self.row, true); - - if (nextRow) { - nextRow.cells[index].edit(); - } - } - - }; -}; - -Cell.prototype.getIndex = function () { - this.row.getCellIndex(this); -}; - -//////////////// Object Generation ///////////////// -Cell.prototype.getComponent = function () { - - if (!this.component) { - this.component = new CellComponent(this); - } - - return this.component; -}; -var FooterManager = function FooterManager(table) { - this.table = table; - this.active = false; - this.element = this.createElement(); //containing element - this.external = false; - this.links = []; - - this._initialize(); -}; - -FooterManager.prototype.createElement = function () { - var el = document.createElement("div"); - - el.classList.add("tabulator-footer"); - - return el; -}; - -FooterManager.prototype._initialize = function (element) { - if (this.table.options.footerElement) { - - switch (_typeof(this.table.options.footerElement)) { - case "string": - - if (this.table.options.footerElement[0] === "<") { - this.element.innerHTML = this.table.options.footerElement; - } else { - this.external = true; - this.element = document.querySelector(this.table.options.footerElement); - } - break; - default: - this.element = this.table.options.footerElement; - break; - } - } -}; - -FooterManager.prototype.getElement = function () { - return this.element; -}; - -FooterManager.prototype.append = function (element, parent) { - this.activate(parent); - - this.element.appendChild(element); - this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.prepend = function (element, parent) { - this.activate(parent); - - this.element.insertBefore(element, this.element.firstChild); - this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.remove = function (element) { - element.parentNode.removeChild(element); - this.deactivate(); -}; - -FooterManager.prototype.deactivate = function (force) { - if (!this.element.firstChild || force) { - if (!this.external) { - this.element.parentNode.removeChild(this.element); - } - this.active = false; - } - - // this.table.rowManager.adjustTableSize(); -}; - -FooterManager.prototype.activate = function (parent) { - if (!this.active) { - this.active = true; - if (!this.external) { - this.table.element.appendChild(this.getElement()); - this.table.element.style.display = ''; - } - } - - if (parent) { - this.links.push(parent); - } -}; - -FooterManager.prototype.redraw = function () { - this.links.forEach(function (link) { - link.footerRedraw(); - }); -}; - -var Tabulator = function Tabulator(element, options) { - - this.options = {}; - - this.columnManager = null; // hold Column Manager - this.rowManager = null; //hold Row Manager - this.footerManager = null; //holder Footer Manager - this.browser = ""; //hold current browser type - this.browserSlow = false; //handle reduced functionality for slower browsers - this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence - - this.modules = {}; //hold all modules bound to this table - - this.initializeElement(element); - this.initializeOptions(options || {}); - this._create(); - - Tabulator.prototype.comms.register(this); //register table for inderdevice communication -}; - -//default setup options -Tabulator.prototype.defaultOptions = { - - height: false, //height of tabulator - minHeight: false, //minimum height of tabulator - maxHeight: false, //maximum height of tabulator - - layout: "fitData", ///layout type "fitColumns" | "fitData" - layoutColumnsOnNewData: false, //update column widths on setData - - columnMinWidth: 40, //minimum global width for a column - columnHeaderVertAlign: "top", //vertical alignment of column headers - columnVertAlign: false, // DEPRECATED - Left to allow warning - - resizableColumns: true, //resizable columns - resizableRows: false, //resizable rows - autoResize: true, //auto resize table - - columns: [], //store for colum header info - - cellHozAlign: "", //horizontal align columns - cellVertAlign: "", //certical align columns - - - data: [], //default starting data - - autoColumns: false, //build columns from data row structure - - reactiveData: false, //enable data reactivity - - nestedFieldSeparator: ".", //seperatpr for nested data - - tooltips: false, //Tool tip value - tooltipsHeader: false, //Tool tip for headers - tooltipGenerationMode: "load", //when to generate tooltips - - initialSort: false, //initial sorting criteria - initialFilter: false, //initial filtering criteria - initialHeaderFilter: false, //initial header filtering criteria - - columnHeaderSortMulti: true, //multiple or single column sorting - - sortOrderReverse: false, //reverse internal sort ordering - - headerSort: true, //set default global header sort - headerSortTristate: false, //set default tristate header sorting - - footerElement: false, //hold footer element - - index: "id", //filed for row index - - keybindings: [], //array for keybindings - - tabEndNewRow: false, //create new row when tab to end of table - - invalidOptionWarnings: true, //allow toggling of invalid option warnings - - clipboard: false, //enable clipboard - clipboardCopyStyled: true, //formatted table data - clipboardCopyConfig: false, //clipboard config - clipboardCopyFormatter: false, //DEPRICATED - REMOVE in 5.0 - clipboardCopyRowRange: "active", //restrict clipboard to visible rows only - clipboardPasteParser: "table", //convert pasted clipboard data to rows - clipboardPasteAction: "insert", //how to insert pasted data into the table - - clipboardCopied: function clipboardCopied() {}, //data has been copied to the clipboard - clipboardPasted: function clipboardPasted() {}, //data has been pasted into the table - clipboardPasteError: function clipboardPasteError() {}, //data has not successfully been pasted into the table - - downloadDataFormatter: false, //function to manipulate table data before it is downloaded - downloadReady: function downloadReady(data, blob) { - return blob; - }, //function to manipulate download data - downloadComplete: false, //function to manipulate download data - downloadConfig: {}, //download config - downloadRowRange: "active", //restrict download to active rows only - - dataTree: false, //enable data tree - dataTreeElementColumn: false, - dataTreeBranchElement: true, //show data tree branch element - dataTreeChildIndent: 9, //data tree child indent in px - dataTreeChildField: "_children", //data tre column field to look for child rows - dataTreeCollapseElement: false, //data tree row collapse element - dataTreeExpandElement: false, //data tree row expand element - dataTreeStartExpanded: false, - dataTreeRowExpanded: function dataTreeRowExpanded() {}, //row has been expanded - dataTreeRowCollapsed: function dataTreeRowCollapsed() {}, //row has been collapsed - dataTreeChildColumnCalcs: false, //include visible data tree rows in column calculations - dataTreeSelectPropagate: false, //seleccting a parent row selects its children - - printAsHtml: false, //enable print as html - printFormatter: false, //printing page formatter - printHeader: false, //page header contents - printFooter: false, //page footer contents - printCopyStyle: true, //DEPRICATED - REMOVE in 5.0 - printStyled: true, //enable print as html styling - printVisibleRows: true, //DEPRICATED - REMOVE in 5.0 - printRowRange: "visible", //restrict print to visible rows only - printConfig: {}, //print config options - - addRowPos: "bottom", //position to insert blank rows, top|bottom - - selectable: "highlight", //highlight rows on hover - selectableRangeMode: "drag", //highlight rows on hover - selectableRollingSelection: true, //roll selection once maximum number of selectable rows is reached - selectablePersistence: true, // maintain selection when table view is updated - selectableCheck: function selectableCheck(data, row) { - return true; - }, //check wheather row is selectable - - headerFilterLiveFilterDelay: 300, //delay before updating column after user types in header filter - headerFilterPlaceholder: false, //placeholder text to display in header filters - - headerVisible: true, //hide header - - history: false, //enable edit history - - locale: false, //current system language - langs: {}, - - virtualDom: true, //enable DOM virtualization - virtualDomBuffer: 0, // set virtual DOM buffer size - - persistentLayout: false, //DEPRICATED - REMOVE in 5.0 - persistentSort: false, //DEPRICATED - REMOVE in 5.0 - persistentFilter: false, //DEPRICATED - REMOVE in 5.0 - persistenceID: "", //key for persistent storage - persistenceMode: true, //mode for storing persistence information - persistenceReaderFunc: false, //function for handling persistence data reading - persistenceWriterFunc: false, //function for handling persistence data writing - - persistence: false, - - responsiveLayout: false, //responsive layout flags - responsiveLayoutCollapseStartOpen: true, //start showing collapsed data - responsiveLayoutCollapseUseFormatters: true, //responsive layout collapse formatter - responsiveLayoutCollapseFormatter: false, //responsive layout collapse formatter - - pagination: false, //set pagination type - paginationSize: false, //set number of rows to a page - paginationInitialPage: 1, //initail page to show on load - paginationButtonCount: 5, // set count of page button - paginationSizeSelector: false, //add pagination size selector element - paginationElement: false, //element to hold pagination numbers - paginationDataSent: {}, //pagination data sent to the server - paginationDataReceived: {}, //pagination data received from the server - paginationAddRow: "page", //add rows on table or page - - ajaxURL: false, //url for ajax loading - ajaxURLGenerator: false, - ajaxParams: {}, //params for ajax loading - ajaxConfig: "get", //ajax request type - ajaxContentType: "form", //ajax request type - ajaxRequestFunc: false, //promise function - ajaxLoader: true, //show loader - ajaxLoaderLoading: false, //loader element - ajaxLoaderError: false, //loader element - ajaxFiltering: false, - ajaxSorting: false, - ajaxProgressiveLoad: false, //progressive loading - ajaxProgressiveLoadDelay: 0, //delay between requests - ajaxProgressiveLoadScrollMargin: 0, //margin before scroll begins - - groupBy: false, //enable table grouping and set field to group by - groupStartOpen: true, //starting state of group - groupValues: false, - - groupHeader: false, //header generation function - groupHeaderPrint: null, - groupHeaderClipboard: null, - groupHeaderHtmlOutput: null, - groupHeaderDownload: null, - - htmlOutputConfig: false, //html outypu config - - movableColumns: false, //enable movable columns - - movableRows: false, //enable movable rows - movableRowsConnectedTables: false, //tables for movable rows to be connected to - movableRowsConnectedElements: false, //other elements for movable rows to be connected to - movableRowsSender: false, - movableRowsReceiver: "insert", - movableRowsSendingStart: function movableRowsSendingStart() {}, - movableRowsSent: function movableRowsSent() {}, - movableRowsSentFailed: function movableRowsSentFailed() {}, - movableRowsSendingStop: function movableRowsSendingStop() {}, - movableRowsReceivingStart: function movableRowsReceivingStart() {}, - movableRowsReceived: function movableRowsReceived() {}, - movableRowsReceivedFailed: function movableRowsReceivedFailed() {}, - movableRowsReceivingStop: function movableRowsReceivingStop() {}, - movableRowsElementDrop: function movableRowsElementDrop() {}, - - scrollToRowPosition: "top", - scrollToRowIfVisible: true, - - scrollToColumnPosition: "left", - scrollToColumnIfVisible: true, - - rowFormatter: false, - rowFormatterPrint: null, - rowFormatterClipboard: null, - rowFormatterHtmlOutput: null, - - placeholder: false, - - //table building callbacks - tableBuilding: function tableBuilding() {}, - tableBuilt: function tableBuilt() {}, - - //render callbacks - renderStarted: function renderStarted() {}, - renderComplete: function renderComplete() {}, - - //row callbacks - rowClick: false, - rowDblClick: false, - rowContext: false, - rowTap: false, - rowDblTap: false, - rowTapHold: false, - rowMouseEnter: false, - rowMouseLeave: false, - rowMouseOver: false, - rowMouseOut: false, - rowMouseMove: false, - rowContextMenu: false, - rowAdded: function rowAdded() {}, - rowDeleted: function rowDeleted() {}, - rowMoved: function rowMoved() {}, - rowUpdated: function rowUpdated() {}, - rowSelectionChanged: function rowSelectionChanged() {}, - rowSelected: function rowSelected() {}, - rowDeselected: function rowDeselected() {}, - rowResized: function rowResized() {}, - - //cell callbacks - //row callbacks - cellClick: false, - cellDblClick: false, - cellContext: false, - cellTap: false, - cellDblTap: false, - cellTapHold: false, - cellMouseEnter: false, - cellMouseLeave: false, - cellMouseOver: false, - cellMouseOut: false, - cellMouseMove: false, - cellEditing: function cellEditing() {}, - cellEdited: function cellEdited() {}, - cellEditCancelled: function cellEditCancelled() {}, - - //column callbacks - columnMoved: false, - columnResized: function columnResized() {}, - columnTitleChanged: function columnTitleChanged() {}, - columnVisibilityChanged: function columnVisibilityChanged() {}, - - //HTML iport callbacks - htmlImporting: function htmlImporting() {}, - htmlImported: function htmlImported() {}, - - //data callbacks - dataLoading: function dataLoading() {}, - dataLoaded: function dataLoaded() {}, - dataEdited: function dataEdited() {}, - - //ajax callbacks - ajaxRequesting: function ajaxRequesting() {}, - ajaxResponse: false, - ajaxError: function ajaxError() {}, - - //filtering callbacks - dataFiltering: false, - dataFiltered: false, - - //sorting callbacks - dataSorting: function dataSorting() {}, - dataSorted: function dataSorted() {}, - - //grouping callbacks - groupToggleElement: "arrow", - groupClosedShowCalcs: false, - dataGrouping: function dataGrouping() {}, - dataGrouped: false, - groupVisibilityChanged: function groupVisibilityChanged() {}, - groupClick: false, - groupDblClick: false, - groupContext: false, - groupContextMenu: false, - groupTap: false, - groupDblTap: false, - groupTapHold: false, - - columnCalcs: true, - - //pagination callbacks - pageLoaded: function pageLoaded() {}, - - //localization callbacks - localized: function localized() {}, - - //validation callbacks - validationMode: "blocking", - validationFailed: function validationFailed() {}, - - //history callbacks - historyUndo: function historyUndo() {}, - historyRedo: function historyRedo() {}, - - //scroll callbacks - scrollHorizontal: function scrollHorizontal() {}, - scrollVertical: function scrollVertical() {} -}; - -Tabulator.prototype.initializeOptions = function (options) { - - //warn user if option is not available - if (options.invalidOptionWarnings !== false) { - for (var key in options) { - if (typeof this.defaultOptions[key] === "undefined") { - console.warn("Invalid table constructor option:", key); - } - } - } - - //assign options to table - for (var key in this.defaultOptions) { - if (key in options) { - this.options[key] = options[key]; - } else { - if (Array.isArray(this.defaultOptions[key])) { - this.options[key] = []; - } else if (_typeof(this.defaultOptions[key]) === "object" && this.defaultOptions[key] !== null) { - this.options[key] = {}; - } else { - this.options[key] = this.defaultOptions[key]; - } - } - } -}; - -Tabulator.prototype.initializeElement = function (element) { - - if (typeof HTMLElement !== "undefined" && element instanceof HTMLElement) { - this.element = element; - return true; - } else if (typeof element === "string") { - this.element = document.querySelector(element); - - if (this.element) { - return true; - } else { - console.error("Tabulator Creation Error - no element found matching selector: ", element); - return false; - } - } else { - console.error("Tabulator Creation Error - Invalid element provided:", element); - return false; - } -}; - -//convert depricated functionality to new functions -Tabulator.prototype._mapDepricatedFunctionality = function () { - - //map depricated persistance setup options - if (this.options.persistentLayout || this.options.persistentSort || this.options.persistentFilter) { - if (!this.options.persistence) { - this.options.persistence = {}; - } - } - - if (this.options.downloadDataFormatter) { - console.warn("DEPRECATION WARNING - downloadDataFormatter option has been deprecated"); - } - - if (typeof this.options.clipboardCopyHeader !== "undefined") { - this.options.columnHeaders = this.options.clipboardCopyHeader; - console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option"); - } - - if (this.options.printVisibleRows !== true) { - console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"); - - this.options.persistence.printRowRange = "active"; - } - - if (this.options.printCopyStyle !== true) { - console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"); - - this.options.persistence.printStyled = this.options.printCopyStyle; - } - - if (this.options.persistentLayout) { - console.warn("persistentLayout option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.columns === "undefined") { - this.options.persistence.columns = true; - } - } - - if (this.options.persistentSort) { - console.warn("persistentSort option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.sort === "undefined") { - this.options.persistence.sort = true; - } - } - - if (this.options.persistentFilter) { - console.warn("persistentFilter option is deprecated, you should now use the persistence option"); - - if (this.options.persistence !== true && typeof this.options.persistence.filter === "undefined") { - this.options.persistence.filter = true; - } - } - - if (this.options.columnVertAlign) { - console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"); - - this.options.columnHeaderVertAlign = this.options.columnVertAlign; - } -}; - -Tabulator.prototype._clearSelection = function () { - - this.element.classList.add("tabulator-block-select"); - - if (window.getSelection) { - if (window.getSelection().empty) { - // Chrome - window.getSelection().empty(); - } else if (window.getSelection().removeAllRanges) { - // Firefox - window.getSelection().removeAllRanges(); - } - } else if (document.selection) { - // IE? - document.selection.empty(); - } - - this.element.classList.remove("tabulator-block-select"); -}; - -//concreate table -Tabulator.prototype._create = function () { - this._clearObjectPointers(); - - this._mapDepricatedFunctionality(); - - this.bindModules(); - - if (this.element.tagName === "TABLE") { - if (this.modExists("htmlTableImport", true)) { - this.modules.htmlTableImport.parseTable(); - } - } - - this.columnManager = new ColumnManager(this); - this.rowManager = new RowManager(this); - this.footerManager = new FooterManager(this); - - this.columnManager.setRowManager(this.rowManager); - this.rowManager.setColumnManager(this.columnManager); - - this._buildElement(); - - this._loadInitialData(); -}; - -//clear pointers to objects in default config object -Tabulator.prototype._clearObjectPointers = function () { - this.options.columns = this.options.columns.slice(0); - - if (!this.options.reactiveData) { - this.options.data = this.options.data.slice(0); - } -}; - -//build tabulator element -Tabulator.prototype._buildElement = function () { - var _this17 = this; - - var element = this.element, - mod = this.modules, - options = this.options; - - options.tableBuilding.call(this); - - element.classList.add("tabulator"); - element.setAttribute("role", "grid"); - - //empty element - while (element.firstChild) { - element.removeChild(element.firstChild); - } //set table height - if (options.height) { - options.height = isNaN(options.height) ? options.height : options.height + "px"; - element.style.height = options.height; - } - - //set table min height - if (options.minHeight !== false) { - options.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + "px"; - element.style.minHeight = options.minHeight; - } - - //set table maxHeight - if (options.maxHeight !== false) { - options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px"; - element.style.maxHeight = options.maxHeight; - } - - this.columnManager.initialize(); - this.rowManager.initialize(); - - this._detectBrowser(); - - if (this.modExists("layout", true)) { - mod.layout.initialize(options.layout); - } - - //set localization - if (options.headerFilterPlaceholder !== false) { - mod.localize.setHeaderFilterPlaceholder(options.headerFilterPlaceholder); - } - - for (var locale in options.langs) { - mod.localize.installLang(locale, options.langs[locale]); - } - - mod.localize.setLocale(options.locale); - - //configure placeholder element - if (typeof options.placeholder == "string") { - - var el = document.createElement("div"); - el.classList.add("tabulator-placeholder"); - - var span = document.createElement("span"); - span.innerHTML = options.placeholder; - - el.appendChild(span); - - options.placeholder = el; - } - - //build table elements - element.appendChild(this.columnManager.getElement()); - element.appendChild(this.rowManager.getElement()); - - if (options.footerElement) { - this.footerManager.activate(); - } - - if (options.persistence && this.modExists("persistence", true)) { - mod.persistence.initialize(); - } - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.columns) { - options.columns = mod.persistence.load("columns", options.columns); - } - - if (options.movableRows && this.modExists("moveRow")) { - mod.moveRow.initialize(); - } - - if (options.autoColumns && this.options.data) { - this.columnManager.generateColumnsFromRowData(this.options.data); - } - - if (this.modExists("columnCalcs")) { - mod.columnCalcs.initialize(); - } - - this.columnManager.setColumns(options.columns); - - if (options.dataTree && this.modExists("dataTree", true)) { - mod.dataTree.initialize(); - } - - if (this.modExists("frozenRows")) { - this.modules.frozenRows.initialize(); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort || options.initialSort) && this.modExists("sort", true)) { - var sorters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.sort) { - sorters = mod.persistence.load("sort"); - - if (sorters === false && options.initialSort) { - sorters = options.initialSort; - } - } else if (options.initialSort) { - sorters = options.initialSort; - } - - mod.sort.setSort(sorters); - } - - if ((options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter || options.initialFilter) && this.modExists("filter", true)) { - var filters = []; - - if (options.persistence && this.modExists("persistence", true) && mod.persistence.config.filter) { - filters = mod.persistence.load("filter"); - - if (filters === false && options.initialFilter) { - filters = options.initialFilter; - } - } else if (options.initialFilter) { - filters = options.initialFilter; - } - - mod.filter.setFilter(filters); - } - - if (options.initialHeaderFilter && this.modExists("filter", true)) { - options.initialHeaderFilter.forEach(function (item) { - - var column = _this17.columnManager.findColumn(item.field); - - if (column) { - mod.filter.setHeaderFilterValue(column, item.value); - } else { - console.warn("Column Filter Error - No matching column found:", item.field); - return false; - } - }); - } - - if (this.modExists("ajax")) { - mod.ajax.initialize(); - } - - if (options.pagination && this.modExists("page", true)) { - mod.page.initialize(); - } - - if (options.groupBy && this.modExists("groupRows", true)) { - mod.groupRows.initialize(); - } - - if (this.modExists("keybindings")) { - mod.keybindings.initialize(); - } - - if (this.modExists("selectRow")) { - mod.selectRow.clearSelectionData(true); - } - - if (options.autoResize && this.modExists("resizeTable")) { - mod.resizeTable.initialize(); - } - - if (this.modExists("clipboard")) { - mod.clipboard.initialize(); - } - - if (options.printAsHtml && this.modExists("print")) { - mod.print.initialize(); - } - - options.tableBuilt.call(this); -}; - -Tabulator.prototype._loadInitialData = function () { - var self = this; - - if (self.options.pagination && self.modExists("page")) { - self.modules.page.reset(true, true); - - if (self.options.pagination == "local") { - if (self.options.data.length) { - self.rowManager.setData(self.options.data, false, true); - } else { - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () { - if (self.options.paginationInitialPage) { - self.modules.page.setPage(self.options.paginationInitialPage); - } - }); - - return; - } else { - self.rowManager.setData(self.options.data, false, true); - } - } - - if (self.options.paginationInitialPage) { - self.modules.page.setPage(self.options.paginationInitialPage); - } - } else { - if (self.options.ajaxURL) { - self.modules.page.setPage(self.options.paginationInitialPage).then(function () {}).catch(function () {}); - } else { - self.rowManager.setData([], false, true); - } - } - } else { - if (self.options.data.length) { - self.rowManager.setData(self.options.data); - } else { - if ((self.options.ajaxURL || self.options.ajaxURLGenerator) && self.modExists("ajax")) { - self.modules.ajax.loadData(false, true).then(function () {}).catch(function () {}); - } else { - self.rowManager.setData(self.options.data, false, true); - } - } - } -}; - -//deconstructor -Tabulator.prototype.destroy = function () { - var element = this.element; - - Tabulator.prototype.comms.deregister(this); //deregister table from inderdevice communication - - if (this.options.reactiveData && this.modExists("reactiveData", true)) { - this.modules.reactiveData.unwatchData(); - } - - //clear row data - this.rowManager.rows.forEach(function (row) { - row.wipe(); - }); - - this.rowManager.rows = []; - this.rowManager.activeRows = []; - this.rowManager.displayRows = []; - - //clear event bindings - if (this.options.autoResize && this.modExists("resizeTable")) { - this.modules.resizeTable.clearBindings(); - } - - if (this.modExists("keybindings")) { - this.modules.keybindings.clearBindings(); - } - - //clear DOM - while (element.firstChild) { - element.removeChild(element.firstChild); - }element.classList.remove("tabulator"); -}; - -Tabulator.prototype._detectBrowser = function () { - var ua = navigator.userAgent || navigator.vendor || window.opera; - - if (ua.indexOf("Trident") > -1) { - this.browser = "ie"; - this.browserSlow = true; - } else if (ua.indexOf("Edge") > -1) { - this.browser = "edge"; - this.browserSlow = true; - } else if (ua.indexOf("Firefox") > -1) { - this.browser = "firefox"; - this.browserSlow = false; - } else { - this.browser = "other"; - this.browserSlow = false; - } - - this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.substr(0, 4)); -}; - -////////////////// Data Handling ////////////////// - -//block table redrawing -Tabulator.prototype.blockRedraw = function () { - return this.rowManager.blockRedraw(); -}; - -//restore table redrawing -Tabulator.prototype.restoreRedraw = function () { - return this.rowManager.restoreRedraw(); -}; - -//local data from local file -Tabulator.prototype.setDataFromLocalFile = function (extensions) { - var _this18 = this; - - return new Promise(function (resolve, reject) { - var input = document.createElement("input"); - input.type = "file"; - input.accept = extensions || ".json,application/json"; - - input.addEventListener("change", function (e) { - var file = input.files[0], - reader = new FileReader(), - data; - - reader.readAsText(file); - - reader.onload = function (e) { - - try { - data = JSON.parse(reader.result); - } catch (e) { - console.warn("File Load Error - File contents is invalid JSON", e); - reject(e); - return; - } - - _this18._setData(data).then(function (data) { - resolve(data); - }).catch(function (err) { - resolve(err); - }); - }; - - reader.onerror = function (e) { - console.warn("File Load Error - Unable to read file"); - reject(); - }; - }); - - input.click(); - }); -}; - -//load data -Tabulator.prototype.setData = function (data, params, config) { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, false, true); -}; - -Tabulator.prototype._setData = function (data, params, config, inPosition, columnsChanged) { - var self = this; - - if (typeof data === "string") { - if (data.indexOf("{") == 0 || data.indexOf("[") == 0) { - //data is a json encoded string - return self.rowManager.setData(JSON.parse(data), inPosition, columnsChanged); - } else { - - if (self.modExists("ajax", true)) { - if (params) { - self.modules.ajax.setParams(params); - } - - if (config) { - self.modules.ajax.setConfig(config); - } - - self.modules.ajax.setUrl(data); - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - self.modules.page.reset(true, true); - return self.modules.page.setPage(1); - } else { - //assume data is url, make ajax call to url to get data - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } - } - } else { - if (data) { - //asume data is already an object - return self.rowManager.setData(data, inPosition, columnsChanged); - } else { - - //no data provided, check if ajaxURL is present; - if (self.modExists("ajax") && (self.modules.ajax.getUrl || self.options.ajaxURLGenerator)) { - - if (self.options.pagination == "remote" && self.modExists("page", true)) { - self.modules.page.reset(true, true); - return self.modules.page.setPage(1); - } else { - return self.modules.ajax.loadData(inPosition, columnsChanged); - } - } else { - //empty data - return self.rowManager.setData([], inPosition, columnsChanged); - } - } - } -}; - -//clear data -Tabulator.prototype.clearData = function () { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - this.rowManager.clearData(); -}; - -//get table data array -Tabulator.prototype.getData = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getData(active); -}; - -//get table data array count -Tabulator.prototype.getDataCount = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getDataCount(active); -}; - -//search for specific row components -Tabulator.prototype.searchRows = function (field, type, value) { - if (this.modExists("filter", true)) { - return this.modules.filter.search("rows", field, type, value); - } -}; - -//search for specific data -Tabulator.prototype.searchData = function (field, type, value) { - if (this.modExists("filter", true)) { - return this.modules.filter.search("data", field, type, value); - } -}; - -//get table html -Tabulator.prototype.getHtml = function (visible, style, config) { - if (this.modExists("export", true)) { - return this.modules.export.getHtml(visible, style, config); - } -}; - -//get print html -Tabulator.prototype.print = function (visible, style, config) { - if (this.modExists("print", true)) { - return this.modules.print.printFullscreen(visible, style, config); - } -}; - -//retrieve Ajax URL -Tabulator.prototype.getAjaxUrl = function () { - if (this.modExists("ajax", true)) { - return this.modules.ajax.getUrl(); - } -}; - -//replace data, keeping table in position with same sort -Tabulator.prototype.replaceData = function (data, params, config) { - if (this.modExists("ajax")) { - this.modules.ajax.blockActiveRequest(); - } - - return this._setData(data, params, config, true); -}; - -//update table data -Tabulator.prototype.updateData = function (data) { - var _this19 = this; - - var self = this; - var responses = 0; - - return new Promise(function (resolve, reject) { - if (_this19.modExists("ajax")) { - _this19.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - data.forEach(function (item) { - var row = self.rowManager.findRow(item[self.options.index]); - - if (row) { - responses++; - - row.updateData(item).then(function () { - responses--; - - if (!responses) { - resolve(); - } - }); - } - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -Tabulator.prototype.addData = function (data, pos, index) { - var _this20 = this; - - return new Promise(function (resolve, reject) { - if (_this20.modExists("ajax")) { - _this20.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - _this20.rowManager.addRows(data, pos, index).then(function (rows) { - var output = []; - - rows.forEach(function (row) { - output.push(row.getComponent()); - }); - - resolve(output); - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -//update table data -Tabulator.prototype.updateOrAddData = function (data) { - var _this21 = this; - - var self = this, - rows = [], - responses = 0; - - return new Promise(function (resolve, reject) { - if (_this21.modExists("ajax")) { - _this21.modules.ajax.blockActiveRequest(); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (data) { - data.forEach(function (item) { - var row = self.rowManager.findRow(item[self.options.index]); - - responses++; - - if (row) { - row.updateData(item).then(function () { - responses--; - rows.push(row.getComponent()); - - if (!responses) { - resolve(rows); - } - }); - } else { - self.rowManager.addRows(item).then(function (newRows) { - responses--; - rows.push(newRows[0].getComponent()); - - if (!responses) { - resolve(rows); - } - }); - } - }); - } else { - console.warn("Update Error - No data provided"); - reject("Update Error - No data provided"); - } - }); -}; - -//get row object -Tabulator.prototype.getRow = function (index) { - var row = this.rowManager.findRow(index); - - if (row) { - return row.getComponent(); - } else { - console.warn("Find Error - No matching row found:", index); - return false; - } -}; - -//get row object -Tabulator.prototype.getRowFromPosition = function (position, active) { - var row = this.rowManager.getRowFromPosition(position, active); - - if (row) { - return row.getComponent(); - } else { - console.warn("Find Error - No matching row found:", position); - return false; - } -}; - -//delete row from table -Tabulator.prototype.deleteRow = function (index) { - var _this22 = this; - - return new Promise(function (resolve, reject) { - var self = _this22, - count = 0, - successCount = 0, - foundRows = []; - - function doneCheck() { - count++; - - if (count == index.length) { - if (successCount) { - self.rowManager.reRenderInPosition(); - resolve(); - } - } - } - - if (!Array.isArray(index)) { - index = [index]; - } - - //find matching rows - index.forEach(function (item) { - var row = _this22.rowManager.findRow(item, true); - - if (row) { - foundRows.push(row); - } else { - console.warn("Delete Error - No matching row found:", item); - reject("Delete Error - No matching row found"); - doneCheck(); - } - }); - - //sort rows into correct order to ensure smooth delete from table - foundRows.sort(function (a, b) { - return _this22.rowManager.rows.indexOf(a) > _this22.rowManager.rows.indexOf(b) ? 1 : -1; - }); - - foundRows.forEach(function (row) { - row.delete().then(function () { - successCount++; - doneCheck(); - }).catch(function (err) { - doneCheck(); - reject(err); - }); - }); - }); -}; - -//add row to table -Tabulator.prototype.addRow = function (data, pos, index) { - var _this23 = this; - - return new Promise(function (resolve, reject) { - if (typeof data === "string") { - data = JSON.parse(data); - } - - _this23.rowManager.addRows(data, pos, index).then(function (rows) { - //recalc column calculations if present - if (_this23.modExists("columnCalcs")) { - _this23.modules.columnCalcs.recalc(_this23.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }); - }); -}; - -//update a row if it exitsts otherwise create it -Tabulator.prototype.updateOrAddRow = function (index, data) { - var _this24 = this; - - return new Promise(function (resolve, reject) { - var row = _this24.rowManager.findRow(index); - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (row) { - row.updateData(data).then(function () { - //recalc column calculations if present - if (_this24.modExists("columnCalcs")) { - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(row.getComponent()); - }).catch(function (err) { - reject(err); - }); - } else { - row = _this24.rowManager.addRows(data).then(function (rows) { - //recalc column calculations if present - if (_this24.modExists("columnCalcs")) { - _this24.modules.columnCalcs.recalc(_this24.rowManager.activeRows); - } - - resolve(rows[0].getComponent()); - }).catch(function (err) { - reject(err); - }); - } - }); -}; - -//update row data -Tabulator.prototype.updateRow = function (index, data) { - var _this25 = this; - - return new Promise(function (resolve, reject) { - var row = _this25.rowManager.findRow(index); - - if (typeof data === "string") { - data = JSON.parse(data); - } - - if (row) { - row.updateData(data).then(function () { - resolve(row.getComponent()); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Update Error - No matching row found:", index); - reject("Update Error - No matching row found"); - } - }); -}; - -//scroll to row in DOM -Tabulator.prototype.scrollToRow = function (index, position, ifVisible) { - var _this26 = this; - - return new Promise(function (resolve, reject) { - var row = _this26.rowManager.findRow(index); - - if (row) { - _this26.rowManager.scrollToRow(row, position, ifVisible).then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Scroll Error - No matching row found:", index); - reject("Scroll Error - No matching row found"); - } - }); -}; - -Tabulator.prototype.moveRow = function (from, to, after) { - var fromRow = this.rowManager.findRow(from); - - if (fromRow) { - fromRow.moveToRow(to, after); - } else { - console.warn("Move Error - No matching row found:", from); - } -}; - -Tabulator.prototype.getRows = function (active) { - - if (active === true) { - console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"); - active = "active"; - } - - return this.rowManager.getComponents(active); -}; - -//get position of row in table -Tabulator.prototype.getRowPosition = function (index, active) { - var row = this.rowManager.findRow(index); - - if (row) { - return this.rowManager.getRowPosition(row, active); - } else { - console.warn("Position Error - No matching row found:", index); - return false; - } -}; - -//copy table data to clipboard -Tabulator.prototype.copyToClipboard = function (selector) { - if (this.modExists("clipboard", true)) { - this.modules.clipboard.copy(selector); - } -}; - -/////////////// Column Functions /////////////// - -Tabulator.prototype.setColumns = function (definition) { - this.columnManager.setColumns(definition); -}; - -Tabulator.prototype.getColumns = function (structured) { - return this.columnManager.getComponents(structured); -}; - -Tabulator.prototype.getColumn = function (field) { - var col = this.columnManager.findColumn(field); - - if (col) { - return col.getComponent(); - } else { - console.warn("Find Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.getColumnDefinitions = function () { - return this.columnManager.getDefinitionTree(); -}; - -Tabulator.prototype.getColumnLayout = function () { - if (this.modExists("persistence", true)) { - return this.modules.persistence.parseColumns(this.columnManager.getColumns()); - } -}; - -Tabulator.prototype.setColumnLayout = function (layout) { - if (this.modExists("persistence", true)) { - this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns, layout)); - return true; - } - return false; -}; - -Tabulator.prototype.showColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - column.show(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - this.modules.responsiveLayout.update(); - } - } else { - console.warn("Column Show Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.hideColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - column.hide(); - - if (this.options.responsiveLayout && this.modExists("responsiveLayout", true)) { - this.modules.responsiveLayout.update(); - } - } else { - console.warn("Column Hide Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.toggleColumn = function (field) { - var column = this.columnManager.findColumn(field); - - if (column) { - if (column.visible) { - column.hide(); - } else { - column.show(); - } - } else { - console.warn("Column Visibility Toggle Error - No matching column found:", field); - return false; - } -}; - -Tabulator.prototype.addColumn = function (definition, before, field) { - var _this27 = this; - - return new Promise(function (resolve, reject) { - var column = _this27.columnManager.findColumn(field); - - _this27.columnManager.addColumn(definition, before, column).then(function (column) { - resolve(column.getComponent()); - }).catch(function (err) { - reject(err); - }); - }); -}; - -Tabulator.prototype.deleteColumn = function (field) { - var _this28 = this; - - return new Promise(function (resolve, reject) { - var column = _this28.columnManager.findColumn(field); - - if (column) { - column.delete().then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Delete Error - No matching column found:", field); - reject(); - } - }); -}; - -Tabulator.prototype.updateColumnDefinition = function (field, definition) { - var _this29 = this; - - return new Promise(function (resolve, reject) { - var column = _this29.columnManager.findColumn(field); - - if (column) { - column.updateDefinition(definition).then(function (col) { - resolve(col); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Column Update Error - No matching column found:", field); - reject(); - } - }); -}; - -Tabulator.prototype.moveColumn = function (from, to, after) { - var fromColumn = this.columnManager.findColumn(from); - var toColumn = this.columnManager.findColumn(to); - - if (fromColumn) { - if (toColumn) { - this.columnManager.moveColumn(fromColumn, toColumn, after); - } else { - console.warn("Move Error - No matching column found:", toColumn); - } - } else { - console.warn("Move Error - No matching column found:", from); - } -}; - -//scroll to column in DOM -Tabulator.prototype.scrollToColumn = function (field, position, ifVisible) { - var _this30 = this; - - return new Promise(function (resolve, reject) { - var column = _this30.columnManager.findColumn(field); - - if (column) { - _this30.columnManager.scrollToColumn(column, position, ifVisible).then(function () { - resolve(); - }).catch(function (err) { - reject(err); - }); - } else { - console.warn("Scroll Error - No matching column found:", field); - reject("Scroll Error - No matching column found"); - } - }); -}; - -//////////// Localization Functions //////////// -Tabulator.prototype.setLocale = function (locale) { - this.modules.localize.setLocale(locale); -}; - -Tabulator.prototype.getLocale = function () { - return this.modules.localize.getLocale(); -}; - -Tabulator.prototype.getLang = function (locale) { - return this.modules.localize.getLang(locale); -}; - -//////////// General Public Functions //////////// - -//redraw list without updating data -Tabulator.prototype.redraw = function (force) { - this.columnManager.redraw(force); - this.rowManager.redraw(force); -}; - -Tabulator.prototype.setHeight = function (height) { - - if (this.rowManager.renderMode !== "classic") { - this.options.height = isNaN(height) ? height : height + "px"; - this.element.style.height = this.options.height; - this.rowManager.setRenderMode(); - this.rowManager.redraw(); - } else { - console.warn("setHeight function is not available in classic render mode"); - } -}; - -///////////////////// Sorting //////////////////// - -//trigger sort -Tabulator.prototype.setSort = function (sortList, dir) { - if (this.modExists("sort", true)) { - this.modules.sort.setSort(sortList, dir); - this.rowManager.sorterRefresh(); - } -}; - -Tabulator.prototype.getSorters = function () { - if (this.modExists("sort", true)) { - return this.modules.sort.getSort(); - } -}; - -Tabulator.prototype.clearSort = function () { - if (this.modExists("sort", true)) { - this.modules.sort.clear(); - this.rowManager.sorterRefresh(); - } -}; - -///////////////////// Filtering //////////////////// - -//set standard filters -Tabulator.prototype.setFilter = function (field, type, value, params) { - if (this.modExists("filter", true)) { - this.modules.filter.setFilter(field, type, value, params); - this.rowManager.filterRefresh(); - } -}; - -//add filter to array -Tabulator.prototype.addFilter = function (field, type, value, params) { - if (this.modExists("filter", true)) { - this.modules.filter.addFilter(field, type, value, params); - this.rowManager.filterRefresh(); - } -}; - -//get all filters -Tabulator.prototype.getFilters = function (all) { - if (this.modExists("filter", true)) { - return this.modules.filter.getFilters(all); - } -}; - -Tabulator.prototype.setHeaderFilterFocus = function (field) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - this.modules.filter.setHeaderFilterFocus(column); - } else { - console.warn("Column Filter Focus Error - No matching column found:", field); - return false; - } - } -}; - -Tabulator.prototype.getHeaderFilterValue = function (field) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - return this.modules.filter.getHeaderFilterValue(column); - } else { - console.warn("Column Filter Error - No matching column found:", field); - } - } -}; - -Tabulator.prototype.setHeaderFilterValue = function (field, value) { - if (this.modExists("filter", true)) { - var column = this.columnManager.findColumn(field); - - if (column) { - this.modules.filter.setHeaderFilterValue(column, value); - } else { - console.warn("Column Filter Error - No matching column found:", field); - return false; - } - } -}; - -Tabulator.prototype.getHeaderFilters = function () { - if (this.modExists("filter", true)) { - return this.modules.filter.getHeaderFilters(); - } -}; - -//remove filter from array -Tabulator.prototype.removeFilter = function (field, type, value) { - if (this.modExists("filter", true)) { - this.modules.filter.removeFilter(field, type, value); - this.rowManager.filterRefresh(); - } -}; - -//clear filters -Tabulator.prototype.clearFilter = function (all) { - if (this.modExists("filter", true)) { - this.modules.filter.clearFilter(all); - this.rowManager.filterRefresh(); - } -}; - -//clear header filters -Tabulator.prototype.clearHeaderFilter = function () { - if (this.modExists("filter", true)) { - this.modules.filter.clearHeaderFilter(); - this.rowManager.filterRefresh(); - } -}; - -///////////////////// select //////////////////// -Tabulator.prototype.selectRow = function (rows) { - if (this.modExists("selectRow", true)) { - if (rows === true) { - console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"); - rows = "active"; - } - this.modules.selectRow.selectRows(rows); - } -}; - -Tabulator.prototype.deselectRow = function (rows) { - if (this.modExists("selectRow", true)) { - this.modules.selectRow.deselectRows(rows); - } -}; - -Tabulator.prototype.toggleSelectRow = function (row) { - if (this.modExists("selectRow", true)) { - this.modules.selectRow.toggleRow(row); - } -}; - -Tabulator.prototype.getSelectedRows = function () { - if (this.modExists("selectRow", true)) { - return this.modules.selectRow.getSelectedRows(); - } -}; - -Tabulator.prototype.getSelectedData = function () { - if (this.modExists("selectRow", true)) { - return this.modules.selectRow.getSelectedData(); - } -}; - -///////////////////// validation //////////////////// -Tabulator.prototype.getInvalidCells = function () { - if (this.modExists("validate", true)) { - return this.modules.validate.getInvalidCells(); - } -}; - -Tabulator.prototype.clearCellValidation = function (cells) { - var _this31 = this; - - if (this.modExists("validate", true)) { - - if (!cells) { - cells = this.modules.validate.getInvalidCells(); - } - - if (!Array.isArray(cells)) { - cells = [cells]; - } - - cells.forEach(function (cell) { - _this31.modules.validate.clearValidation(cell._getSelf()); - }); - } -}; - -Tabulator.prototype.validate = function (cells) { - var output = []; - - //clear row data - this.rowManager.rows.forEach(function (row) { - var valid = row.validate(); - - if (valid !== true) { - output = output.concat(valid); - } - }); - - return output.length ? output : true; -}; - -//////////// Pagination Functions //////////// - -Tabulator.prototype.setMaxPage = function (max) { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.setMaxPage(max); - } else { - return false; - } -}; - -Tabulator.prototype.setPage = function (page) { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.setPage(page); - } else { - return new Promise(function (resolve, reject) { - reject(); - }); - } -}; - -Tabulator.prototype.setPageToRow = function (row) { - var _this32 = this; - - return new Promise(function (resolve, reject) { - if (_this32.options.pagination && _this32.modExists("page")) { - row = _this32.rowManager.findRow(row); - - if (row) { - _this32.modules.page.setPageToRow(row).then(function () { - resolve(); - }).catch(function () { - reject(); - }); - } else { - reject(); - } - } else { - reject(); - } - }); -}; - -Tabulator.prototype.setPageSize = function (size) { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.setPageSize(size); - this.modules.page.setPage(1).then(function () {}).catch(function () {}); - } else { - return false; - } -}; - -Tabulator.prototype.getPageSize = function () { - if (this.options.pagination && this.modExists("page", true)) { - return this.modules.page.getPageSize(); - } -}; - -Tabulator.prototype.previousPage = function () { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.previousPage(); - } else { - return false; - } -}; - -Tabulator.prototype.nextPage = function () { - if (this.options.pagination && this.modExists("page")) { - this.modules.page.nextPage(); - } else { - return false; - } -}; - -Tabulator.prototype.getPage = function () { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.getPage(); - } else { - return false; - } -}; - -Tabulator.prototype.getPageMax = function () { - if (this.options.pagination && this.modExists("page")) { - return this.modules.page.getPageMax(); - } else { - return false; - } -}; - -///////////////// Grouping Functions /////////////// - -Tabulator.prototype.setGroupBy = function (groups) { - if (this.modExists("groupRows", true)) { - this.options.groupBy = groups; - this.modules.groupRows.initialize(); - this.rowManager.refreshActiveData("display"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - return false; - } -}; - -Tabulator.prototype.setGroupStartOpen = function (values) { - if (this.modExists("groupRows", true)) { - this.options.groupStartOpen = values; - this.modules.groupRows.initialize(); - if (this.options.groupBy) { - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - return false; - } -}; - -Tabulator.prototype.setGroupHeader = function (values) { - if (this.modExists("groupRows", true)) { - this.options.groupHeader = values; - this.modules.groupRows.initialize(); - if (this.options.groupBy) { - this.rowManager.refreshActiveData("group"); - - if (this.options.persistence && this.modExists("persistence", true) && this.modules.persistence.config.group) { - this.modules.persistence.save("group"); - } - } else { - console.warn("Grouping Update - cant refresh view, no groups have been set"); - } - } else { - return false; - } -}; - -Tabulator.prototype.getGroups = function (values) { - if (this.modExists("groupRows", true)) { - return this.modules.groupRows.getGroups(true); - } else { - return false; - } -}; - -// get grouped table data in the same format as getData() -Tabulator.prototype.getGroupedData = function () { - if (this.modExists("groupRows", true)) { - return this.options.groupBy ? this.modules.groupRows.getGroupedData() : this.getData(); - } -}; - -Tabulator.prototype.getEditedCells = function () { - if (this.modExists("edit", true)) { - return this.modules.edit.getEditedCells(); - } -}; - -Tabulator.prototype.clearCellEdited = function (cells) { - var _this33 = this; - - if (this.modExists("edit", true)) { - - if (!cells) { - cells = this.modules.edit.getEditedCells(); - } - - if (!Array.isArray(cells)) { - cells = [cells]; - } - - cells.forEach(function (cell) { - _this33.modules.edit.clearEdited(cell._getSelf()); - }); - } -}; - -///////////////// Column Calculation Functions /////////////// -Tabulator.prototype.getCalcResults = function () { - if (this.modExists("columnCalcs", true)) { - return this.modules.columnCalcs.getResults(); - } else { - return false; - } -}; - -Tabulator.prototype.recalc = function () { - if (this.modExists("columnCalcs", true)) { - this.modules.columnCalcs.recalcAll(this.rowManager.activeRows); - } -}; - -/////////////// Navigation Management ////////////// - -Tabulator.prototype.navigatePrev = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - return cell.nav().prev(); - } - } - - return false; -}; - -Tabulator.prototype.navigateNext = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - return cell.nav().next(); - } - } - - return false; -}; - -Tabulator.prototype.navigateLeft = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().left(); - } - } - - return false; -}; - -Tabulator.prototype.navigateRight = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().right(); - } - } - - return false; -}; - -Tabulator.prototype.navigateUp = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().up(); - } - } - - return false; -}; - -Tabulator.prototype.navigateDown = function () { - var cell = false; - - if (this.modExists("edit", true)) { - cell = this.modules.edit.currentCell; - - if (cell) { - e.preventDefault(); - return cell.nav().down(); - } - } - - return false; -}; - -/////////////// History Management ////////////// -Tabulator.prototype.undo = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.undo(); - } else { - return false; - } -}; - -Tabulator.prototype.redo = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.redo(); - } else { - return false; - } -}; - -Tabulator.prototype.getHistoryUndoSize = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.getHistoryUndoSize(); - } else { - return false; - } -}; - -Tabulator.prototype.getHistoryRedoSize = function () { - if (this.options.history && this.modExists("history", true)) { - return this.modules.history.getHistoryRedoSize(); - } else { - return false; - } -}; - -/////////////// Download Management ////////////// - -Tabulator.prototype.download = function (type, filename, options, active) { - if (this.modExists("download", true)) { - this.modules.download.download(type, filename, options, active); - } -}; - -Tabulator.prototype.downloadToTab = function (type, filename, options, active) { - if (this.modExists("download", true)) { - this.modules.download.download(type, filename, options, active, true); - } -}; - -/////////// Inter Table Communications /////////// - -Tabulator.prototype.tableComms = function (table, module, action, data) { - this.modules.comms.receive(table, module, action, data); -}; - -////////////// Extension Management ////////////// - -//object to hold module -Tabulator.prototype.moduleBindings = {}; - -//extend module -Tabulator.prototype.extendModule = function (name, property, values) { - - if (Tabulator.prototype.moduleBindings[name]) { - var source = Tabulator.prototype.moduleBindings[name].prototype[property]; - - if (source) { - if ((typeof values === 'undefined' ? 'undefined' : _typeof(values)) == "object") { - for (var key in values) { - source[key] = values[key]; - } - } else { - console.warn("Module Error - Invalid value type, it must be an object"); - } - } else { - console.warn("Module Error - property does not exist:", property); - } - } else { - console.warn("Module Error - module does not exist:", name); - } -}; - -//add module to tabulator -Tabulator.prototype.registerModule = function (name, module) { - var self = this; - Tabulator.prototype.moduleBindings[name] = module; -}; - -//ensure that module are bound to instantiated function -Tabulator.prototype.bindModules = function () { - this.modules = {}; - - for (var name in Tabulator.prototype.moduleBindings) { - this.modules[name] = new Tabulator.prototype.moduleBindings[name](this); - } -}; - -//Check for module -Tabulator.prototype.modExists = function (plugin, required) { - if (this.modules[plugin]) { - return true; - } else { - if (required) { - console.error("Tabulator Module Not Installed: " + plugin); - } - return false; - } -}; - -Tabulator.prototype.helpers = { - - elVisible: function elVisible(el) { - return !(el.offsetWidth <= 0 && el.offsetHeight <= 0); - }, - - elOffset: function elOffset(el) { - var box = el.getBoundingClientRect(); - - return { - top: box.top + window.pageYOffset - document.documentElement.clientTop, - left: box.left + window.pageXOffset - document.documentElement.clientLeft - }; - }, - - deepClone: function deepClone(obj) { - var clone = Array.isArray(obj) ? [] : {}; - - for (var i in obj) { - if (obj[i] != null && _typeof(obj[i]) === "object") { - if (obj[i] instanceof Date) { - clone[i] = new Date(obj[i]); - } else { - clone[i] = this.deepClone(obj[i]); - } - } else { - clone[i] = obj[i]; - } - } - return clone; - } -}; - -Tabulator.prototype.comms = { - tables: [], - register: function register(table) { - Tabulator.prototype.comms.tables.push(table); - }, - deregister: function deregister(table) { - var index = Tabulator.prototype.comms.tables.indexOf(table); - - if (index > -1) { - Tabulator.prototype.comms.tables.splice(index, 1); - } - }, - lookupTable: function lookupTable(query, silent) { - var results = [], - matches, - match; - - if (typeof query === "string") { - matches = document.querySelectorAll(query); - - if (matches.length) { - for (var i = 0; i < matches.length; i++) { - match = Tabulator.prototype.comms.matchElement(matches[i]); - - if (match) { - results.push(match); - } - } - } - } else if (typeof HTMLElement !== "undefined" && query instanceof HTMLElement || query instanceof Tabulator) { - match = Tabulator.prototype.comms.matchElement(query); - - if (match) { - results.push(match); - } - } else if (Array.isArray(query)) { - query.forEach(function (item) { - results = results.concat(Tabulator.prototype.comms.lookupTable(item)); - }); - } else { - if (!silent) { - console.warn("Table Connection Error - Invalid Selector", query); - } - } - - return results; - }, - matchElement: function matchElement(element) { - return Tabulator.prototype.comms.tables.find(function (table) { - return element instanceof Tabulator ? table === element : table.element === element; - }); - } -}; - -Tabulator.prototype.findTable = function (query) { - var results = Tabulator.prototype.comms.lookupTable(query, true); - return Array.isArray(results) && !results.length ? false : results; -}; - -var Layout = function Layout(table) { - - this.table = table; - - this.mode = null; -}; - -//initialize layout system - -Layout.prototype.initialize = function (layout) { - - if (this.modes[layout]) { - - this.mode = layout; - } else { - - console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : " + layout); - - this.mode = 'fitData'; - } - - this.table.element.setAttribute("tabulator-layout", this.mode); -}; - -Layout.prototype.getMode = function () { - - return this.mode; -}; - -//trigger table layout - -Layout.prototype.layout = function () { - - this.modes[this.mode].call(this, this.table.columnManager.columnsByIndex); -}; - -//layout render functions - -Layout.prototype.modes = { - - //resize columns to fit data they contain - - "fitData": function fitData(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data they contain and stretch row to fill table - - "fitDataFill": function fitDataFill(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data they contain - - "fitDataTable": function fitDataTable(columns) { - - columns.forEach(function (column) { - - column.reinitializeWidth(); - }); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - }, - - //resize columns to fit data the contain and stretch last column to fill table - - "fitDataStretch": function fitDataStretch(columns) { - var _this34 = this; - - var colsWidth = 0, - tableWidth = this.table.rowManager.element.clientWidth, - gap = 0, - lastCol = false; - - columns.forEach(function (column, i) { - - if (!column.widthFixed) { - - column.reinitializeWidth(); - } - - if (_this34.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible) { - - lastCol = column; - } - - if (column.visible) { - - colsWidth += column.getWidth(); - } - }); - - if (lastCol) { - - gap = tableWidth - colsWidth + lastCol.getWidth(); - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - lastCol.setWidth(0); - - this.table.modules.responsiveLayout.update(); - } - - if (gap > 0) { - - lastCol.setWidth(gap); - } else { - - lastCol.reinitializeWidth(); - } - } else { - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - } - }, - - //resize columns to fit - - "fitColumns": function fitColumns(columns) { - - var self = this; - - var totalWidth = self.table.element.clientWidth; //table element width - - var fixedWidth = 0; //total width of columns with a defined width - - var flexWidth = 0; //total width available to flexible columns - - var flexGrowUnits = 0; //total number of widthGrow blocks accross all columns - - var flexColWidth = 0; //desired width of flexible columns - - var flexColumns = []; //array of flexible width columns - - var fixedShrinkColumns = []; //array of fixed width columns that can shrink - - var flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns - - var overflowWidth = 0; //horizontal overflow width - - var gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps - - - function calcWidth(width) { - - var colWidth; - - if (typeof width == "string") { - - if (width.indexOf("%") > -1) { - - colWidth = totalWidth / 100 * parseInt(width); - } else { - - colWidth = parseInt(width); - } - } else { - - colWidth = width; - } - - return colWidth; - } - - //ensure columns resize to take up the correct amount of space - - function scaleColumns(columns, freeSpace, colWidth, shrinkCols) { - - var oversizeCols = [], - oversizeSpace = 0, - remainingSpace = 0, - nextColWidth = 0, - gap = 0, - changeUnits = 0, - undersizeCols = []; - - function calcGrow(col) { - - return colWidth * (col.column.definition.widthGrow || 1); - } - - function calcShrink(col) { - - return calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0); - } - - columns.forEach(function (col, i) { - - var width = shrinkCols ? calcShrink(col) : calcGrow(col); - - if (col.column.minWidth >= width) { - - oversizeCols.push(col); - } else { - - undersizeCols.push(col); - - changeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1; - } - }); - - if (oversizeCols.length) { - - oversizeCols.forEach(function (col) { - - oversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth; - - col.width = col.column.minWidth; - }); - - remainingSpace = freeSpace - oversizeSpace; - - nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace; - - gap = remainingSpace - nextColWidth * changeUnits; - - gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); - } else { - - gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace; - - undersizeCols.forEach(function (column) { - - column.width = shrinkCols ? calcShrink(column) : calcGrow(column); - }); - } - - return gap; - } - - if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) { - - this.table.modules.responsiveLayout.update(); - } - - //adjust for vertical scrollbar if present - - if (this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight) { - - totalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth; - } - - columns.forEach(function (column) { - - var width, minWidth, colWidth; - - if (column.visible) { - - width = column.definition.width; - - minWidth = parseInt(column.minWidth); - - if (width) { - - colWidth = calcWidth(width); - - fixedWidth += colWidth > minWidth ? colWidth : minWidth; - - if (column.definition.widthShrink) { - - fixedShrinkColumns.push({ - - column: column, - - width: colWidth > minWidth ? colWidth : minWidth - - }); - - flexShrinkUnits += column.definition.widthShrink; - } - } else { - - flexColumns.push({ - - column: column, - - width: 0 - - }); - - flexGrowUnits += column.definition.widthGrow || 1; - } - } - }); - - //calculate available space - - flexWidth = totalWidth - fixedWidth; - - //calculate correct column size - - flexColWidth = Math.floor(flexWidth / flexGrowUnits); - - //generate column widths - - var gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); - - //increase width of last column to account for rounding errors - - if (flexColumns.length && gapFill > 0) { - - flexColumns[flexColumns.length - 1].width += +gapFill; - } - - //caculate space for columns to be shrunk into - - flexColumns.forEach(function (col) { - - flexWidth -= col.width; - }); - - overflowWidth = Math.abs(gapFill) + flexWidth; - - //shrink oversize columns if there is no available space - - if (overflowWidth > 0 && flexShrinkUnits) { - - gapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true); - } - - //decrease width of last column to account for rounding errors - - if (fixedShrinkColumns.length) { - - fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill; - } - - flexColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - - fixedShrinkColumns.forEach(function (col) { - - col.column.setWidth(col.width); - }); - } - -}; - -Tabulator.prototype.registerModule("layout", Layout); -var Localize = function Localize(table) { - this.table = table; //hold Tabulator object - this.locale = "default"; //current locale - this.lang = false; //current language - this.bindings = {}; //update events to call when locale is changed -}; - -//set header placehoder -Localize.prototype.setHeaderFilterPlaceholder = function (placeholder) { - this.langs.default.headerFilters.default = placeholder; -}; - -//set header filter placeholder by column -Localize.prototype.setHeaderFilterColumnPlaceholder = function (column, placeholder) { - this.langs.default.headerFilters.columns[column] = placeholder; - - if (this.lang && !this.lang.headerFilters.columns[column]) { - this.lang.headerFilters.columns[column] = placeholder; - } -}; - -//setup a lang description object -Localize.prototype.installLang = function (locale, lang) { - if (this.langs[locale]) { - this._setLangProp(this.langs[locale], lang); - } else { - this.langs[locale] = lang; - } -}; - -Localize.prototype._setLangProp = function (lang, values) { - for (var key in values) { - if (lang[key] && _typeof(lang[key]) == "object") { - this._setLangProp(lang[key], values[key]); - } else { - lang[key] = values[key]; - } - } -}; - -//set current locale -Localize.prototype.setLocale = function (desiredLocale) { - var self = this; - - desiredLocale = desiredLocale || "default"; - - //fill in any matching languge values - function traverseLang(trans, path) { - for (var prop in trans) { - - if (_typeof(trans[prop]) == "object") { - if (!path[prop]) { - path[prop] = {}; - } - traverseLang(trans[prop], path[prop]); - } else { - path[prop] = trans[prop]; - } - } - } - - //determing correct locale to load - if (desiredLocale === true && navigator.language) { - //get local from system - desiredLocale = navigator.language.toLowerCase(); - } - - if (desiredLocale) { - - //if locale is not set, check for matching top level locale else use default - if (!self.langs[desiredLocale]) { - var prefix = desiredLocale.split("-")[0]; - - if (self.langs[prefix]) { - console.warn("Localization Error - Exact matching locale not found, using closest match: ", desiredLocale, prefix); - desiredLocale = prefix; - } else { - console.warn("Localization Error - Matching locale not found, using default: ", desiredLocale); - desiredLocale = "default"; - } - } - } - - self.locale = desiredLocale; - - //load default lang template - self.lang = Tabulator.prototype.helpers.deepClone(self.langs.default || {}); - - if (desiredLocale != "default") { - traverseLang(self.langs[desiredLocale], self.lang); - } - - self.table.options.localized.call(self.table, self.locale, self.lang); - - self._executeBindings(); -}; - -//get current locale -Localize.prototype.getLocale = function (locale) { - return self.locale; -}; - -//get lang object for given local or current if none provided -Localize.prototype.getLang = function (locale) { - return locale ? this.langs[locale] : this.lang; -}; - -//get text for current locale -Localize.prototype.getText = function (path, value) { - var path = value ? path + "|" + value : path, - pathArray = path.split("|"), - text = this._getLangElement(pathArray, this.locale); - - // if(text === false){ - // console.warn("Localization Error - Matching localized text not found for given path: ", path); - // } - - return text || ""; -}; - -//traverse langs object and find localized copy -Localize.prototype._getLangElement = function (path, locale) { - var self = this; - var root = self.lang; - - path.forEach(function (level) { - var rootPath; - - if (root) { - rootPath = root[level]; - - if (typeof rootPath != "undefined") { - root = rootPath; - } else { - root = false; - } - } - }); - - return root; -}; - -//set update binding -Localize.prototype.bind = function (path, callback) { - if (!this.bindings[path]) { - this.bindings[path] = []; - } - - this.bindings[path].push(callback); - - callback(this.getText(path), this.lang); -}; - -//itterate through bindings and trigger updates -Localize.prototype._executeBindings = function () { - var self = this; - - var _loop = function _loop(path) { - self.bindings[path].forEach(function (binding) { - binding(self.getText(path), self.lang); - }); - }; - - for (var path in self.bindings) { - _loop(path); - } -}; - -//Localized text listings -Localize.prototype.langs = { - "default": { //hold default locale text - "groups": { - "item": "item", - "items": "items" - }, - "columns": {}, - "ajax": { - "loading": "Loading", - "error": "Error" - }, - "pagination": { - "page_size": "Page Size", - "page_title": "Show Page", - "first": "First", - "first_title": "First Page", - "last": "Last", - "last_title": "Last Page", - "prev": "Prev", - "prev_title": "Prev Page", - "next": "Next", - "next_title": "Next Page", - "all": "All" - }, - "headerFilters": { - "default": "filter column...", - "columns": {} - } - } -}; - -Tabulator.prototype.registerModule("localize", Localize); -var Comms = function Comms(table) { - this.table = table; -}; - -Comms.prototype.getConnections = function (selectors) { - var self = this, - connections = [], - connection; - - connection = Tabulator.prototype.comms.lookupTable(selectors); - - connection.forEach(function (con) { - if (self.table !== con) { - connections.push(con); - } - }); - - return connections; -}; - -Comms.prototype.send = function (selectors, module, action, data) { - var self = this, - connections = this.getConnections(selectors); - - connections.forEach(function (connection) { - connection.tableComms(self.table.element, module, action, data); - }); - - if (!connections.length && selectors) { - console.warn("Table Connection Error - No tables matching selector found", selectors); - } -}; - -Comms.prototype.receive = function (table, module, action, data) { - if (this.table.modExists(module)) { - return this.table.modules[module].commsReceived(table, action, data); - } else { - console.warn("Inter-table Comms Error - no such module:", module); - } -}; - -Tabulator.prototype.registerModule("comms", Comms); \ No newline at end of file diff --git a/app/static/vendors/tabulator/js/tabulator_core.min.js b/app/static/vendors/tabulator/js/tabulator_core.min.js deleted file mode 100644 index 92522ab..0000000 --- a/app/static/vendors/tabulator/js/tabulator_core.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/* Tabulator v4.7.0 (c) Oliver Folkerd */ -"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n>>0;if(0===i)return!1;for(var n=0|e,l=Math.max(n>=0?n:i-Math.abs(n),0);lo?(e=t-o,this.element.style.marginLeft=-e+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},ColumnManager.prototype.generateColumnsFromRowData=function(t){var e,o,i=[];if(t&&t.length){e=t[0];for(var n in e){var l={field:n,title:n},s=e[n];switch(void 0===s?"undefined":_typeof(s)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(s)?"array":"string";break;default:o=isNaN(s)||""===s?s.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}l.sorter=o,i.push(l)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},ColumnManager.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},ColumnManager.prototype._addColumn=function(t,e,o){var i=new Column(t,this),n=i.getElement(),l=o?this.findColumnIndex(o):o;if(o&&l>-1){var s=this.columns.indexOf(o.getTopColumn()),a=o.getElement();e?(this.columns.splice(s,0,i),a.parentNode.insertBefore(n,a)):(this.columns.splice(s+1,0,i),a.parentNode.insertBefore(n,a.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},ColumnManager.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},ColumnManager.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},ColumnManager.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},ColumnManager.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)}),t.columns.forEach(function(o){o.verticalAlign(t.table.options.columnHeaderVertAlign,e)}),t.rowManager.adjustTableSize()},ColumnManager.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof Column)return t;if(t instanceof ColumnComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},ColumnManager.prototype.getColumnByField=function(t){return this.columnsByField[t]},ColumnManager.prototype.getColumnsByFieldRoot=function(t){var e=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===t&&o.push(e.columnsByField[i])}),o},ColumnManager.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},ColumnManager.prototype.getFirstVisibileColumn=function(t){var t=this.columnsByIndex.findIndex(function(t){return t.visible});return t>-1&&this.columnsByIndex[t]},ColumnManager.prototype.getColumns=function(){return this.columns},ColumnManager.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},ColumnManager.prototype.getRealColumns=function(){return this.columnsByIndex},ColumnManager.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},ColumnManager.prototype.getDefinitions=function(t){var e=this,o=[];return e.columnsByIndex.forEach(function(e){(!t||t&&e.visible)&&o.push(e.getDefinition())}),o},ColumnManager.prototype.getDefinitionTree=function(){var t=this,e=[];return t.columns.forEach(function(t){e.push(t.getDefinition(!0))}),e},ColumnManager.prototype.getComponents=function(t){var e=this,o=[];return(t?e.columns:e.columnsByIndex).forEach(function(t){o.push(t.getComponent())}),o},ColumnManager.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},ColumnManager.prototype.moveColumn=function(t,e,o){this.moveColumnActual(t,e,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e.element.parentNode.insertBefore(t.element,e.element),o&&e.element.parentNode.insertBefore(e.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},ColumnManager.prototype.moveColumnActual=function(t,e,o){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,o):this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},ColumnManager.prototype._moveColumnInArray=function(t,e,o,i,n){var l,s=t.indexOf(e);s>-1&&(t.splice(s,1),l=t.indexOf(o),l>-1?i&&(l+=1):l=s,t.splice(l,0,e),n&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(s,1)[0];t.cells.splice(l,0,e)}}))},ColumnManager.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,l=0,s=0,a=t.getElement();return new Promise(function(r,u){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":s=-i.element.clientWidth/2;break;case"right":s=a.clientWidth-i.headersElement.clientWidth}if(!o&&(l=a.offsetLeft)>0&&l+a.offsetWidtht.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,l,s;i.visible&&(n=i.definition.width||0,l=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),s="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=s>l?s:l)}),o},ColumnManager.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i._addColumn(t,e,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(),"fitColumns"!=i.table.modules.layout.getMode()&&s.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),n(s)})},ColumnManager.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],e=this.columnsByIndex.indexOf(t),e>-1&&this.columnsByIndex.splice(e,1),e=this.columns.indexOf(t),e>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},ColumnManager.prototype.redraw=function(t){t&&(Tabulator.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var ColumnComponent=function(t){this._column=t,this.type="ColumnComponent"};ColumnComponent.prototype.getElement=function(){return this._column.getElement()},ColumnComponent.prototype.getDefinition=function(){return this._column.getDefinition()},ColumnComponent.prototype.getField=function(){return this._column.getField()},ColumnComponent.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},ColumnComponent.prototype.isVisible=function(){return this._column.visible},ColumnComponent.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},ColumnComponent.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},ColumnComponent.prototype.toggle=function(){this._column.visible?this.hide():this.show()},ColumnComponent.prototype.delete=function(){return this._column.delete()},ColumnComponent.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},ColumnComponent.prototype.getParentColumn=function(){return this._column.parent instanceof Column&&this._column.parent.getComponent()},ColumnComponent.prototype._getSelf=function(){return this._column},ColumnComponent.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},ColumnComponent.prototype.getTable=function(){return this._column.table},ColumnComponent.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},ColumnComponent.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},ColumnComponent.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},ColumnComponent.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},ColumnComponent.prototype.move=function(t,e){var o=this._column.table.columnManager.findColumn(t);o?this._column.table.columnManager.moveColumn(this._column,o,e):console.warn("Move Error - No matching column found:",o)},ColumnComponent.prototype.getNextColumn=function(){var t=this._column.nextColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)},ColumnComponent.prototype.getWidth=function(){return this._column.getWidth()},ColumnComponent.prototype.setWidth=function(t){return!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t)},ColumnComponent.prototype.validate=function(){return this._column.validate()};var Column=function t(e,o){var i=this;this.table=o.table,this.definition=e,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),e.columns?(this.isGroup=!0,e.columns.forEach(function(e,o){var n=new t(e,i);i.attachColumn(n)}),i.checkColumnVisibility()):o.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};Column.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},Column.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},Column.prototype.checkDefinition=function(){var t=this;Object.keys(this.definition).forEach(function(e){-1===t.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",e)})},Column.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},Column.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},Column.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},Column.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},Column.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),void 0!==this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},Column.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.modules.localize.bind("columns|"+e.field,function(o){t.element.setAttribute("title",o||e.title)}):t.element.setAttribute("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.setAttribute("title",o)):t.element.setAttribute("title","")},Column.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",function(e){t.setTooltip()})},Column.prototype._bindEvents=function(){var t,e,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",function(t){n.headerClick(t,i.getComponent())}),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",function(t){n.headerDblClick(t,i.getComponent())}),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",function(t){n.headerContext(t,i.getComponent())}),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&n.headerTap(t,i.getComponent()),o=!1})),"function"==typeof n.headerDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof n.headerTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},Column.prototype._buildColumnHeader=function(){var t=this,e=t.definition,o=t.table;if(o.modExists("sort")&&o.modules.sort.initializeColumn(t,t.contentElement),(e.headerContextMenu||e.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(t),o.modExists("format")&&o.modules.format.initializeColumn(t),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(t),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(t),o.modExists("mutator")&&o.modules.mutator.initializeColumn(t),o.modExists("accessor")&&o.modules.accessor.initializeColumn(t),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass){e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}e.field&&this.element.setAttribute("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:parseInt(e.minWidth)),t.reinitializeWidth(),t.tooltip=t.definition.tooltip||!1===t.definition.tooltip?t.definition.tooltip:t.table.options.tooltips,t.hozAlign=void 0===t.definition.hozAlign?t.table.options.cellHozAlign:t.definition.hozAlign,t.vertAlign=void 0===t.definition.vertAlign?t.table.options.cellVertAlign:t.definition.vertAlign},Column.prototype._buildColumnHeaderContent=function(){var t=(this.definition,this.table,document.createElement("div"));return t.classList.add("tabulator-col-content"),this.titleElement=this._buildColumnHeaderTitle(),t.appendChild(this.titleElement),t},Column.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,o=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",function(t){t.stopPropagation(),n.focus()}),n.addEventListener("change",function(){e.title=n.value,o.options.columnTitleChanged.call(t.table,t.getComponent())}),i.appendChild(n),e.field?o.modules.localize.bind("columns|"+e.field,function(t){n.value=t||e.title||" "}):n.value=e.title||" "}else e.field?o.modules.localize.bind("columns|"+e.field,function(o){t._formatColumnHeaderTitle(i,o||e.title||" ")}):t._formatColumnHeaderTitle(i,e.title||" ");return i},Column.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,l,s,a=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),s=function(t){a.titleFormatterRendered=t},l={getValue:function(){return e},getElement:function(){return t}},n=this.definition.titleFormatterParams||{},n="function"==typeof n?n():n,i=o.call(this.table.modules.format,l,n,s),void 0===i?"undefined":_typeof(i)){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=i}else t.innerHTML=e},Column.prototype._buildGroupHeader=function(){var t=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){this.definition.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)})}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.element.appendChild(this.groupElement)},Column.prototype._getFlatData=function(t){return t[this.field]},Column.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,l=0;l-1&&this._nextVisibleColumn(t+1)},Column.prototype._nextVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)},Column.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)},Column.prototype._prevVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)},Column.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},Column.prototype.fitToData=function(){var t=this;this.widthFixed||(this.element.style.width="",t.cells.forEach(function(t){t.clearWidth()}));var e=this.element.offsetWidth;t.width&&this.widthFixed||(t.cells.forEach(function(t){var o=t.getWidth();o>e&&(e=o)}),e&&t.setWidthActual(e+1))},Column.prototype.updateDefinition=function(t){var e=this;return new Promise(function(o,i){var n;e.isGroup?(console.warn("Column Update Error - The updateDefintion function is only available on columns, not column groups"),i("Column Update Error - The updateDefintion function is only available on columns, not column groups")):(n=Object.assign({},e.getDefinition()),n=Object.assign(n,t),e.table.columnManager.addColumn(n,!1,e).then(function(t){n.field==e.field&&(e.field=!1),e.delete().then(function(){o(t.getComponent())}).catch(function(t){i(t)})}).catch(function(t){i(t)}))})},Column.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Column.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],Column.prototype.getComponent=function(){return this.component||(this.component=new ColumnComponent(this)),this.component};var RowManager=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};RowManager.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},RowManager.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},RowManager.prototype.getElement=function(){return this.element},RowManager.prototype.getTableElement=function(){return this.tableElement},RowManager.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},RowManager.prototype.setColumnManager=function(t){this.columnManager=t},RowManager.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e),t.table.options.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e),t.table.options.scrollVertical(e)):t.scrollTop=e})},RowManager.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof Row)return t;if(t instanceof RowComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.rows.find(function(e){return e.element===t})||!1}return!1},RowManager.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},RowManager.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},RowManager.prototype.scrollToRow=function(t,e,o){var i,n=this,l=this.getDisplayRows().indexOf(t),s=t.getElement(),a=0;return new Promise(function(t,r){if(l>-1){if(void 0===e&&(e=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===e)switch(n.renderMode){case"classic":i=Tabulator.prototype.helpers.elOffset(s).top,e=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(n.vDomTop-l)>Math.abs(n.vDomBottom-l)?"bottom":"top"}if(!o&&Tabulator.prototype.helpers.elVisible(s)&&(a=Tabulator.prototype.helpers.elOffset(s).top-Tabulator.prototype.helpers.elOffset(n.element).top)>0&&a-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)}),e||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},RowManager.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},RowManager.prototype.addRows=function(t,e,o){var i=this,n=this,l=0,s=[];return new Promise(function(a,r){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),l=t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach(function(t,i){var l=n.addRow(t,e,o,!0);s.push(l)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(s)})},RowManager.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},RowManager.prototype.addRowActual=function(t,e,o,i){var n,l,s=t instanceof Row?t:new Row(t||{},this),a=this.findAddRowPos(e),r=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(l=this.getDisplayRows(),a?l.length?o=l[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],a=!1):l.length&&(o=l[l.length-1],a=!(l.length1&&(!o||o&&-1==u.indexOf(o)?a?u[0]!==s&&(o=u[0],this._moveRowInArray(s.getGroup().rows,s,o,!a)):u[u.length-1]!==s&&(o=u[u.length-1],this._moveRowInArray(s.getGroup().rows,s,o,!a)):this._moveRowInArray(s.getGroup().rows,s,o,!a))}return o&&(r=this.rows.indexOf(o)),o&&r>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator(function(t){var e=t.indexOf(o);e>-1&&t.splice(a?e:e+1,0,s)}),n>-1&&this.activeRows.splice(a?n:n+1,0,s),this.rows.splice(a?r:r+1,0,s)):a?(this.displayRowIterator(function(t){t.unshift(s)}),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator(function(t){t.push(s)}),this.activeRows.push(s),this.rows.push(s)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,s.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),s},RowManager.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(e),to:e,after:o}),this.moveRowActual(t,e,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())},RowManager.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator(function(n){i._moveRowInArray(n,t,e,o)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&e instanceof Group&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e.getGroup(),l=t.getGroup();n===l?this._moveRowInArray(n.rows,t,e,o):(l&&l.removeRow(t),n.insertRow(t,e,o))}},RowManager.prototype._moveRowInArray=function(t,e,o,i){var n,l,s,a;if(e!==o&&(n=t.indexOf(e),n>-1&&(t.splice(n,1),l=t.indexOf(o),l>-1?i?t.splice(l+1,0,e):t.splice(l,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){s=nn?l:n+1;for(var r=s;r<=a;r++)t[r]&&this.styleRow(t[r],r)}},RowManager.prototype.clearData=function(){this.setData([])},RowManager.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},RowManager.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},RowManager.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o-1)&&o},RowManager.prototype.getData=function(t,e){var o=[];return this.getRows(t).forEach(function(t){"row"==t.type&&o.push(t.getData(e||"data"))}),o},RowManager.prototype.getComponents=function(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e},RowManager.prototype.getDataCount=function(t){return this.getRows(t).length},RowManager.prototype._genRemoteRequest=function(){var t=this,e=this.table,o=e.options,i={};if(e.modExists("page")){if(o.ajaxSorting){var n=this.table.modules.sort.getSort();n.forEach(function(t){delete t.column}),i[this.table.modules.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var l=this.table.modules.filter.getFilters(!0,!0);i[this.table.modules.page.paginationDataSentNames.filters]=l}this.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t._setDataActual(e,!0)}).catch(function(t){})},RowManager.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):e.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},RowManager.prototype.sorterRefresh=function(t){var e=this.table,o=this.table.options,i=this.scrollLeft;o.ajaxSorting?("remote"==o.pagination||o.progressiveLoad)&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(i)},RowManager.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)},RowManager.prototype.refreshActiveData=function(t,e,o){var i,n=this,l=this.table,s=["all","filter","sort","display","freeze","group","tree","page"];if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||s.indexOf(t)=0))break;l=a}else if(e-s[a].getElement().offsetTop>=0)n=a;else{if(i=!0,!(o-s[a].getElement().offsetTop>=0))break;l=a}}else n=this.vDomTop,l=this.vDomBottom;return s.slice(n,l+1)},RowManager.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},RowManager.prototype.getRows=function(t){var e;switch(t){case"active":e=this.activeRows;break;case"display":e=this.table.rowManager.getDisplayRows();break;case"visible":e=this.getVisibleRows(!0);break;default:e=this.rows}return e},RowManager.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode())if(this.redrawBlock)t?t():this.redrawBlockRederInPosition=!0;else{for(var e=this.element.scrollTop,o=!1,i=!1,n=this.scrollLeft,l=this.getDisplayRows(),s=this.vDomTop;s<=this.vDomBottom;s++)if(l[s]){var a=e-l[s].getElement().offsetTop;if(!(!1===i||Math.abs(a)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*f),"group"!==m.type&&(c=!1),i.vDomBottom++,u++}t?(i.vDomTopPad=e?i.vDomRowHeight*this.vDomTop+o:i.scrollTop-r,i.vDomBottomPad=i.vDomBottom==i.displayRowsCount-1?0:Math.max(i.vDomScrollHeight-i.vDomTopPad-a-r,0)):(this.vDomTopPad=0,i.vDomRowHeight=Math.floor((a+r)/u),i.vDomBottomPad=i.vDomRowHeight*(i.displayRowsCount-i.vDomBottom-1),i.vDomScrollHeight=r+a+i.vDomBottomPad-i.height),n.style.paddingTop=i.vDomTopPad+"px",n.style.paddingBottom=i.vDomBottomPad+"px",e&&(this.scrollTop=i.vDomTopPad+r+o-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&e&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,l.scrollTop=this.scrollTop,n.style.minWidth=c?i.table.columnManager.getWidth()+"px":"",i.table.options.groupBy&&"fitDataFill"!=i.table.modules.layout.getMode()&&i.displayRowsCount==i.table.modules.groupRows.countGroups()&&(i.tableElement.style.minWidth=i.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()},RowManager.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,o=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||o>i){var n=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(n)}else t?(e<0&&this._addTopRow(-e),o<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-o):this.vDomScrollPosBottom=this.scrollTop)):(e>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(e):this.vDomScrollPosTop=this.scrollTop),o>=0&&this._addBottomRow(o))},RowManager.prototype._addTopRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var n=this.vDomTop-1,l=i[n],s=l.getHeight()||this.vDomRowHeight;t>=s&&(this.styleRow(l,n),o.insertBefore(l.getElement(),o.firstChild),l.initialized&&l.heightInitialized||(this.vDomTopNewRows.push(l),l.heightInitialized||l.clearCellHeight()),l.initialize(),this.vDomTopPad-=s,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n||(this.vDomTopPad=0),o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=s,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),l.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l.getHeight()),e=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},RowManager.prototype._removeTopRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomTop],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode.removeChild(n),this.vDomTopPad+=i,e.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}},RowManager.prototype._addBottomRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom=s&&(this.styleRow(l,n),o.appendChild(l.getElement()),l.initialized&&l.heightInitialized||(this.vDomBottomNewRows.push(l),l.heightInitialized||l.clearCellHeight()),l.initialize(),this.vDomBottomPad-=s,(this.vDomBottomPad<0||n==this.displayRowsCount-1)&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=s,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,l.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l.getHeight()),e=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},RowManager.prototype._removeBottomRow=function(t){var e=this.tableElement,o=this.getDisplayRows()[this.vDomBottom],i=o.getHeight()||this.vDomRowHeight;if(t>=i){var n=o.getElement();n.parentNode&&n.parentNode.removeChild(n),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),e.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}},RowManager.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},RowManager.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},RowManager.prototype.adjustTableSize=function(){var t,e=this.element.clientHeight;if("virtual"===this.renderMode){var o=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.fixedHeight?(this.element.style.minHeight="calc(100% - "+o+"px)",this.element.style.height="calc(100% - "+o+"px)",this.element.style.maxHeight="calc(100% - "+o+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-o+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,this.fixedHeight||e==this.element.clientHeight||((t=this.table.modExists("resizeTable"))&&!this.table.modules.resizeTable.autoResize||!t)&&this.redraw()}},RowManager.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},RowManager.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1},RowManager.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1}, -RowManager.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():("classic"==this.renderMode?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},RowManager.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var RowComponent=function(t){this._row=t};RowComponent.prototype.getData=function(t){return this._row.getData(t)},RowComponent.prototype.getElement=function(){return this._row.getElement()},RowComponent.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},RowComponent.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},RowComponent.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},RowComponent.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},RowComponent.prototype.delete=function(){return this._row.delete()},RowComponent.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},RowComponent.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},RowComponent.prototype.move=function(t,e){this._row.moveToRow(t,e)},RowComponent.prototype.update=function(t){return this._row.updateData(t)},RowComponent.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},RowComponent.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},RowComponent.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},RowComponent.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},RowComponent.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},RowComponent.prototype._getSelf=function(){return this._row},RowComponent.prototype.validate=function(){return this._row.validate()},RowComponent.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},RowComponent.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},RowComponent.prototype.isFrozen=function(){if(this._row.table.modExists("frozenRows",!0)){return this._row.table.modules.frozenRows.rows.indexOf(this._row)>-1}return!1},RowComponent.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},RowComponent.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},RowComponent.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},RowComponent.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},RowComponent.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},RowComponent.prototype.addTreeChild=function(t,e,o){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.addTreeChildRow(this._row,t,e,o)},RowComponent.prototype.reformat=function(){return this._row.reinitialize()},RowComponent.prototype.getGroup=function(){return this._row.getGroup().getComponent()},RowComponent.prototype.getTable=function(){return this._row.table},RowComponent.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},RowComponent.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var Row=function(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=e.table,this.parent=e,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.setData(t),this.generateElement()};Row.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},Row.prototype.getElement=function(){return this.element},Row.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},Row.prototype.generateElement=function(){var t,e,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},Row.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},Row.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},Row.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},Row.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},Row.prototype.calcHeight=function(t){var e=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(t){var o=t.getHeight();o>e&&(e=o)}),this.height=t?Math.max(e,o):this.manualHeight?this.height:Math.max(e,o),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},Row.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},Row.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},Row.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},Row.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},Row.prototype.getHeight=function(){return this.outerHeight},Row.prototype.getWidth=function(){return this.element.offsetWidth},Row.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Row.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},Row.prototype.updateData=function(t){var e,o=this,i=Tabulator.prototype.helpers.elVisible(this.element),n={};return new Promise(function(l,s){"string"==typeof t&&(t=JSON.parse(t)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(n=Object.assign(n,o.data),n=Object.assign(n,t),e=o.table.modules.mutator.transformRow(n,"data",t)):e=t;for(var a in e)o.data[a]=e[a];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var a in t){o.table.columnManager.getColumnsByFieldRoot(a).forEach(function(t){var n=o.getCell(t.getField());if(n){var l=t.getFieldValue(e);n.getValue()!=l&&(n.setValueProcessData(l),i&&n.cellRendered())}})}i?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),!1!==o.table.options.dataTree&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(t)&&(o.table.modules.dataTree.initializeRow(o),o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0)),o.table.options.rowUpdated.call(o.table,o.getComponent()),l()})},Row.prototype.getData=function(t){var e=this;return t?e.table.modExists("accessor")?e.table.modules.accessor.transformRow(e.data,t):void 0:this.data},Row.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},Row.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},Row.prototype.findNextEditableCell=function(t){var e=!1;if(t0)for(var o=t-1;o>=0;o--){var i=this.cells[o],n=!0;if(i.column.modules.edit&&Tabulator.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){e=i;break}}return e},Row.prototype.getCells=function(){return this.cells},Row.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},Row.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},Row.prototype.moveToRow=function(t,e){var o=this.table.rowManager.findRow(t);o?(this.table.rowManager.moveRowActual(this,o,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)},Row.prototype.validate=function(){var t=[];return this.cells.forEach(function(e){e.validate()||t.push(e.getComponent())}),!t.length||t},Row.prototype.delete=function(){var t=this;return new Promise(function(e,o){var i,n;t.table.options.history&&t.table.modExists("history")&&(t.table.options.groupBy&&t.table.modExists("groupRows")?(n=t.getGroup().rows,(i=n.indexOf(t))&&(i=n[i-1])):(i=t.table.rowManager.getRowIndex(t))&&(i=t.table.rowManager.rows[i-1]),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})),t.deleteActual(),e()})},Row.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.rowDelete(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},Row.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))},Tabulator.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()},Tabulator.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()},Tabulator.prototype.setDataFromLocalFile=function(t){var e=this;return new Promise(function(o,i){var n=document.createElement("input");n.type="file",n.accept=t||".json,application/json",n.addEventListener("change",function(t){var l,s=n.files[0],a=new FileReader;a.readAsText(s),a.onload=function(t){try{l=JSON.parse(a.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(l).then(function(t){o(t)}).catch(function(t){o(t)})},a.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),n.click()})},Tabulator.prototype.setData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!1,!0)},Tabulator.prototype._setData=function(t,e,o,i,n){var l=this;return"string"!=typeof t?t?l.rowManager.setData(t,i,n):l.modExists("ajax")&&(l.modules.ajax.getUrl||l.options.ajaxURLGenerator)?"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n):l.rowManager.setData([],i,n):0==t.indexOf("{")||0==t.indexOf("[")?l.rowManager.setData(JSON.parse(t),i,n):l.modExists("ajax",!0)?(e&&l.modules.ajax.setParams(e),o&&l.modules.ajax.setConfig(o),l.modules.ajax.setUrl(t),"remote"==l.options.pagination&&l.modExists("page",!0)?(l.modules.page.reset(!0,!0),l.modules.page.setPage(1)):l.modules.ajax.loadData(i,n)):void 0},Tabulator.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},Tabulator.prototype.getData=function(t){return!0===t&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getData(t)},Tabulator.prototype.getDataCount=function(t){return!0===t&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getDataCount(t)},Tabulator.prototype.searchRows=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,o)},Tabulator.prototype.searchData=function(t,e,o){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,o)},Tabulator.prototype.getHtml=function(t,e,o){if(this.modExists("export",!0))return this.modules.export.getHtml(t,e,o)},Tabulator.prototype.print=function(t,e,o){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,e,o)},Tabulator.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},Tabulator.prototype.replaceData=function(t,e,o){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,o,!0)},Tabulator.prototype.updateData=function(t){var e=this,o=this,i=0;return new Promise(function(n,l){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);e&&(i++,e.updateData(t).then(function(){--i||n()}))}):(console.warn("Update Error - No data provided"),l("Update Error - No data provided"))})},Tabulator.prototype.addData=function(t,e,o){var i=this;return new Promise(function(n,l){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?i.rowManager.addRows(t,e,o).then(function(t){var e=[];t.forEach(function(t){e.push(t.getComponent())}),n(e)}):(console.warn("Update Error - No data provided"),l("Update Error - No data provided"))})},Tabulator.prototype.updateOrAddData=function(t){var e=this,o=this,i=[],n=0;return new Promise(function(l,s){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=o.rowManager.findRow(t[o.options.index]);n++,e?e.updateData(t).then(function(){n--,i.push(e.getComponent()),n||l(i)}):o.rowManager.addRows(t).then(function(t){n--,i.push(t[0].getComponent()),n||l(i)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})},Tabulator.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.prototype.getRowFromPosition=function(t,e){var o=this.rowManager.getRowFromPosition(t,e);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},Tabulator.prototype.deleteRow=function(t){var e=this;return new Promise(function(o,i){function n(){++s==t.length&&a&&(l.rowManager.reRenderInPosition(),o())}var l=e,s=0,a=0,r=[];Array.isArray(t)||(t=[t]),t.forEach(function(t){var o=e.rowManager.findRow(t,!0);o?r.push(o):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"),n())}),r.sort(function(t,o){return e.rowManager.rows.indexOf(t)>e.rowManager.rows.indexOf(o)?1:-1}),r.forEach(function(t){t.delete().then(function(){a++,n()}).catch(function(t){n(),i(t)})})})},Tabulator.prototype.addRow=function(t,e,o){var i=this;return new Promise(function(n,l){"string"==typeof t&&(t=JSON.parse(t)),i.rowManager.addRows(t,e,o).then(function(t){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),n(t[0].getComponent())})})},Tabulator.prototype.updateOrAddRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(l.getComponent())}).catch(function(t){n(t)}):l=o.rowManager.addRows(e).then(function(t){o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(o.rowManager.activeRows),i(t[0].getComponent())}).catch(function(t){n(t)})})},Tabulator.prototype.updateRow=function(t,e){var o=this;return new Promise(function(i,n){var l=o.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),l?l.updateData(e).then(function(){i(l.getComponent())}).catch(function(t){n(t)}):(console.warn("Update Error - No matching row found:",t),n("Update Error - No matching row found"))})},Tabulator.prototype.scrollToRow=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.rowManager.findRow(t);s?i.rowManager.scrollToRow(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching row found:",t),l("Scroll Error - No matching row found"))})},Tabulator.prototype.moveRow=function(t,e,o){var i=this.rowManager.findRow(t);i?i.moveToRow(e,o):console.warn("Move Error - No matching row found:",t)},Tabulator.prototype.getRows=function(t){return!0===t&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getComponents(t)},Tabulator.prototype.getRowPosition=function(t,e){var o=this.rowManager.findRow(t);return o?this.rowManager.getRowPosition(o,e):(console.warn("Position Error - No matching row found:",t),!1)},Tabulator.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)},Tabulator.prototype.setColumns=function(t){this.columnManager.setColumns(t)},Tabulator.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},Tabulator.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},Tabulator.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},Tabulator.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},Tabulator.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},Tabulator.prototype.showColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},Tabulator.prototype.hideColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},Tabulator.prototype.toggleColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},Tabulator.prototype.addColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(o);i.columnManager.addColumn(t,e,s).then(function(t){n(t.getComponent())}).catch(function(t){l(t)})})},Tabulator.prototype.deleteColumn=function(t){var e=this;return new Promise(function(o,i){var n=e.columnManager.findColumn(t);n?n.delete().then(function(){o()}).catch(function(t){i(t)}):(console.warn("Column Delete Error - No matching column found:",t),i())})},Tabulator.prototype.updateColumnDefinition=function(t,e){var o=this;return new Promise(function(i,n){var l=o.columnManager.findColumn(t);l?l.updateDefinition(e).then(function(t){i(t)}).catch(function(t){n(t)}):(console.warn("Column Update Error - No matching column found:",t),n())})},Tabulator.prototype.moveColumn=function(t,e,o){var i=this.columnManager.findColumn(t),n=this.columnManager.findColumn(e);i?n?this.columnManager.moveColumn(i,n,o):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",t)},Tabulator.prototype.scrollToColumn=function(t,e,o){var i=this;return new Promise(function(n,l){var s=i.columnManager.findColumn(t);s?i.columnManager.scrollToColumn(s,e,o).then(function(){n()}).catch(function(t){l(t)}):(console.warn("Scroll Error - No matching column found:",t),l("Scroll Error - No matching column found"))})},Tabulator.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},Tabulator.prototype.getLocale=function(){return this.modules.localize.getLocale()},Tabulator.prototype.getLang=function(t){return this.modules.localize.getLang(t)},Tabulator.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},Tabulator.prototype.setHeight=function(t){"classic"!==this.rowManager.renderMode?(this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")},Tabulator.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},Tabulator.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},Tabulator.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},Tabulator.prototype.setFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.addFilter=function(t,e,o,i){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,o,i),this.rowManager.filterRefresh())},Tabulator.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},Tabulator.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterFocus(e)}},Tabulator.prototype.getHeaderFilterValue=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(e)return this.modules.filter.getHeaderFilterValue(e);console.warn("Column Filter Error - No matching column found:",t)}},Tabulator.prototype.setHeaderFilterValue=function(t,e){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(!o)return console.warn("Column Filter Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterValue(o,e)}},Tabulator.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},Tabulator.prototype.removeFilter=function(t,e,o){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,o),this.rowManager.filterRefresh())},Tabulator.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},Tabulator.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},Tabulator.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&(!0===t&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),t="active"),this.modules.selectRow.selectRows(t))},Tabulator.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},Tabulator.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},Tabulator.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},Tabulator.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},Tabulator.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()},Tabulator.prototype.clearCellValidation=function(t){var e=this;this.modExists("validate",!0)&&(t||(t=this.modules.validate.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(function(t){e.modules.validate.clearValidation(t._getSelf())}))},Tabulator.prototype.validate=function(t){var e=[];return this.rowManager.rows.forEach(function(t){var o=t.validate();!0!==o&&(e=e.concat(o))}),!e.length||e},Tabulator.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},Tabulator.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},Tabulator.prototype.setPageToRow=function(t){var e=this;return new Promise(function(o,i){e.options.pagination&&e.modExists("page")?(t=e.rowManager.findRow(t),t?e.modules.page.setPageToRow(t).then(function(){o()}).catch(function(){i()}):i()):i()})},Tabulator.prototype.setPageSize=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){})},Tabulator.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},Tabulator.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},Tabulator.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},Tabulator.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},Tabulator.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},Tabulator.prototype.setGroupBy=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")},Tabulator.prototype.setGroupStartOpen=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},Tabulator.prototype.setGroupHeader=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set")},Tabulator.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},Tabulator.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},Tabulator.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()},Tabulator.prototype.clearCellEdited=function(t){var e=this;this.modExists("edit",!0)&&(t||(t=this.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(function(t){e.modules.edit.clearEdited(t._getSelf())}))},Tabulator.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},Tabulator.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)},Tabulator.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},Tabulator.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},Tabulator.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},Tabulator.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},Tabulator.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},Tabulator.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().down())},Tabulator.prototype.undo=function(){ -return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},Tabulator.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},Tabulator.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},Tabulator.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},Tabulator.prototype.download=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i)},Tabulator.prototype.downloadToTab=function(t,e,o,i){this.modExists("download",!0)&&this.modules.download.download(t,e,o,i,!0)},Tabulator.prototype.tableComms=function(t,e,o,i){this.modules.comms.receive(t,e,o,i)},Tabulator.prototype.moduleBindings={},Tabulator.prototype.extendModule=function(t,e,o){if(Tabulator.prototype.moduleBindings[t]){var i=Tabulator.prototype.moduleBindings[t].prototype[e];if(i)if("object"==(void 0===o?"undefined":_typeof(o)))for(var n in o)i[n]=o[n];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)},Tabulator.prototype.registerModule=function(t,e){Tabulator.prototype.moduleBindings[t]=e},Tabulator.prototype.bindModules=function(){this.modules={};for(var t in Tabulator.prototype.moduleBindings)this.modules[t]=new Tabulator.prototype.moduleBindings[t](this)},Tabulator.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},Tabulator.prototype.helpers={elVisible:function(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)},elOffset:function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(t){var e=Array.isArray(t)?[]:{};for(var o in t)null!=t[o]&&"object"===_typeof(t[o])?t[o]instanceof Date?e[o]=new Date(t[o]):e[o]=this.deepClone(t[o]):e[o]=t[o];return e}},Tabulator.prototype.comms={tables:[],register:function(t){Tabulator.prototype.comms.tables.push(t)},deregister:function(t){var e=Tabulator.prototype.comms.tables.indexOf(t);e>-1&&Tabulator.prototype.comms.tables.splice(e,1)},lookupTable:function(t,e){var o,i,n=[];if("string"==typeof t){if(o=document.querySelectorAll(t),o.length)for(var l=0;l0?l.setWidth(n):l.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t){function e(t){return"string"==typeof t?t.indexOf("%")>-1?n/100*parseInt(t):parseInt(t):t}function o(t,i,n,l){function s(t){return n*(t.column.definition.widthGrow||1)}function a(t){return e(t.width)-n*(t.column.definition.widthShrink||0)}var r=[],u=0,c=0,h=0,d=0,p=0,m=[];return t.forEach(function(t,e){var o=l?a(t):s(t);t.column.minWidth>=o?r.push(t):(m.push(t),p+=l?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),r.length?(r.forEach(function(t){u+=l?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),c=i-u,h=p?Math.floor(c/p):c,d=c-h*p,d+=o(m,c,h,l)):(d=p?i-Math.floor(i/p)*p:i,m.forEach(function(t){t.width=l?a(t):s(t)})),d}var i=this,n=i.table.element.clientWidth,l=0,s=0,a=0,r=0,u=[],c=[],h=0,d=0,p=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),l+=n>i?n:i,t.definition.widthShrink&&(c.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(u.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),s=n-l,r=Math.floor(s/a);var p=o(u,s,r,!1);u.length&&p>0&&(u[u.length-1].width+=+p),u.forEach(function(t){s-=t.width}),d=Math.abs(p)+s,d>0&&h&&(p=o(c,d,Math.floor(d/h),!0)),c.length&&(c[c.length-1].width-=p),u.forEach(function(t){t.column.setWidth(t.width)}),c.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.prototype.registerModule("layout",Layout);var Localize=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};Localize.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},Localize.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},Localize.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},Localize.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},Localize.prototype.setLocale=function(t){function e(t,o){for(var i in t)"object"==_typeof(t[i])?(o[i]||(o[i]={}),e(t[i],o[i])):o[i]=t[i]}var o=this;if(t=t||"default",!0===t&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langs[t]){var i=t.split("-")[0];o.langs[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=Tabulator.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},Localize.prototype.getLocale=function(t){return self.locale},Localize.prototype.getLang=function(t){return t?this.langs[t]:this.lang},Localize.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},Localize.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},Localize.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},Localize.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},Localize.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All"},headerFilters:{default:"filter column...",columns:{}}}},Tabulator.prototype.registerModule("localize",Localize);var Comms=function(t){this.table=t};Comms.prototype.getConnections=function(t){var e,o=this,i=[];return e=Tabulator.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},Comms.prototype.send=function(t,e,o,i){var n=this,l=this.getConnections(t);l.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!l.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},Comms.prototype.receive=function(t,e,o,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such module:",e)},Tabulator.prototype.registerModule("comms",Comms); \ No newline at end of file diff --git a/app/static/vendors/tinymce/changelog.txt b/app/static/vendors/tinymce/changelog.txt deleted file mode 100644 index 6aa1bb4..0000000 --- a/app/static/vendors/tinymce/changelog.txt +++ /dev/null @@ -1,1467 +0,0 @@ -Version 5.1.3 (2019-12-04) - Fixed sticky toolbar not undocking when fullscreen mode is activated #TINY-4390 - Fixed the "Current Window" target not applying when updating links using the link dialog #TINY-4063 - Fixed disabled menu items not highlighting when focused #TINY-4339 - Fixed touch events passing through dialog collection items to the content underneath on Android devices #TINY-4431 - Fixed keyboard navigation of the Help dialog's Keyboard Navigation tab #TINY-4391 - Fixed search and replace dialog disappearing when finding offscreen matches on iOS devices #TINY-4350 - Fixed performance issues where sticky toolbar was jumping while scrolling on slower browsers #TINY-4475 -Version 5.1.2 (2019-11-19) - Fixed desktop touch devices using `mobile` configuration overrides #TINY-4345 - Fixed unable to disable the new scrolling toolbar feature #TINY-4345 - Fixed touch events passing through any pop-up items to the content underneath on Android devices #TINY-4367 - Fixed the table selector handles throwing JavaScript exceptions for non-table selections #TINY-4338 - Fixed `cut` operations not removing selected content on Android devices when the `paste` plugin is enabled #TINY-4362 - Fixed inline toolbar not constrained to the window width by default #TINY-4314 - Fixed context toolbar split button chevrons pointing right when they should be pointing down #TINY-4257 - Fixed unable to access the dialog footer in tabbed dialogs on small screens #TINY-4360 - Fixed mobile table selectors were hard to select with touch by increasing the size #TINY-4366 - Fixed mobile table selectors moving when moving outside the editor #TINY-4366 - Fixed inline toolbars collapsing when using sliding toolbars #TINY-4389 - Fixed block textpatterns not treating NBSPs as spaces #TINY-4378 - Fixed backspace not merging blocks when the last element in the preceding block was a `contenteditable="false"` element #TINY-4235 - Fixed toolbar buttons that only contain text labels overlapping on mobile devices #TINY-4395 - Fixed quickbars quickimage picker not working on mobile #TINY-4377 - Fixed fullscreen not resizing in an iOS WKWebView component #TINY-4413 -Version 5.1.1 (2019-10-28) - Fixed font formats containing spaces being wrapped in `"` entities instead of single quotes #TINY-4275 - Fixed alert and confirm dialogs losing focus when clicked #TINY-4248 - Fixed clicking outside a modal dialog focusing on the document body #TINY-4249 - Fixed the context toolbar not hiding when scrolled out of view #TINY-4265 -Version 5.1.0 (2019-10-17) - Added touch selector handles for table selections on touch devices #TINY-4097 - Added border width field to Table Cell dialog #TINY-4028 - Added touch event listener to media plugin to make embeds playable #TINY-4093 - Added oxide styling options to notifications and tweaked the default variables #TINY-4153 - Added additional padding to split button chevrons on touch devices, to make them easier to interact with #TINY-4223 - Added new platform detection functions to `Env` and deprecated older detection properties #TINY-4184 - Added `inputMode` config field to specify inputmode attribute of `input` dialog components #TINY-4062 - Added new `inputMode` property to relevant plugins/dialogs #TINY-4102 - Added new `toolbar_sticky` setting to allow the iframe menubar/toolbar to stick to the top of the window when scrolling #TINY-3982 - Changed default setting for `toolbar_drawer` to `floating` #TINY-3634 - Changed mobile phones to use the `silver` theme by default #TINY-3634 - Changed some editor settings to default to `false` on touch devices: - - `menubar`(phones only) #TINY-4077 - - `table_grid` #TINY-4075 - - `resize` #TINY-4157 - - `object_resizing` #TINY-4157 - Changed toolbars and context toolbars to sidescroll on mobile #TINY-3894 #TINY-4107 - Changed context menus to render as horizontal menus on touch devices #TINY-4107 - Changed the editor to use the `VisualViewport` API of the browser where possible #TINY-4078 - Changed visualblocks toolbar button icon and renamed `paragraph` icon to `visualchars` #TINY-4074 - Changed Oxide default for `@toolbar-button-chevron-color` to follow toolbar button icon color #TINY-4153 - Changed the `urlinput` dialog component to use the `url` type attribute #TINY-4102 - Fixed Safari desktop visual viewport fires resize on fullscreen breaking the restore function #TINY-3976 - Fixed scroll issues on mobile devices #TINY-3976 - Fixed context toolbar unable to refresh position on iOS12 #TINY-4107 - Fixed ctrl+left click not opening links on readonly mode and the preview dialog #TINY-4138 - Fixed Slider UI component not firing `onChange` event on touch devices #TINY-4092 - Fixed notifications overlapping instead of stacking #TINY-3478 - Fixed inline dialogs positioning incorrectly when the page is scrolled #TINY-4018 - Fixed inline dialogs and menus not repositioning when resizing #TINY-3227 - Fixed inline toolbar incorrectly stretching to the full width when a width value was provided #TINY-4066 - Fixed menu chevrons color to follow the menu text color #TINY-4153 - Fixed table menu selection grid from staying black when using dark skins, now follows border color #TINY-4153 - Fixed Oxide using the wrong text color variable for menubar button focused state #TINY-4146 - Fixed the autoresize plugin not keeping the selection in view when resizing #TINY-4094 - Fixed textpattern plugin throwing exceptions when using `forced_root_block: false` #TINY-4172 - Fixed missing CSS fill styles for toolbar button icon active state #TINY-4147 - Fixed an issue where the editor selection could end up inside a short ended element (such as `br`) #TINY-3999 - Fixed browser selection being lost in inline mode when opening split dropdowns #TINY-4197 - Fixed backspace throwing an exception when using `forced_root_block: false` #TINY-4099 - Fixed floating toolbar drawer expanding outside the bounds of the editor #TINY-3941 - Fixed the autocompleter not activating immediately after a `br` or `contenteditable=false` element #TINY-4194 - Fixed an issue where the autocompleter would incorrectly close on IE 11 in certain edge cases #TINY-4205 -Version 5.0.16 (2019-09-24) - Added new `referrer_policy` setting to add the `referrerpolicy` attribute when loading scripts or stylesheets #TINY-3978 - Added a slight background color to dialog tab links when focused to aid keyboard navigation #TINY-3877 - Fixed media poster value not updating on change #TINY-4013 - Fixed openlink was not registered as a toolbar button #TINY-4024 - Fixed failing to initialize if a script tag was used inside a SVG #TINY-4087 - Fixed double top border showing on toolbar without menubar when toolbar_drawer is enabled #TINY-4118 - Fixed unable to drag inline dialogs to the bottom of the screen when scrolled #TINY-4154 - Fixed notifications appearing on top of the toolbar when scrolled in inline mode #TINY-4159 - Fixed notifications displaying incorrectly on IE 11 #TINY-4169 -Version 5.0.15 (2019-09-02) - Added a dark `content_css` skin to go with the dark UI skin #TINY-3743 - Changed the enabled state on toolbar buttons so they don't get the hover effect #TINY-3974 - Fixed missing CSS active state on toolbar buttons #TINY-3966 - Fixed `onChange` callback not firing for the colorinput dialog component #TINY-3968 - Fixed context toolbars not showing in fullscreen mode #TINY-4023 -Version 5.0.14 (2019-08-19) - Added an API to reload the autocompleter menu with additional fetch metadata #MENTIONS-17 - Fixed missing toolbar button border styling options #TINY-3965 - Fixed image upload progress notification closing before the upload is complete #TINY-3963 - Fixed inline dialogs not closing on escape when no dialog component is in focus #TINY-3936 - Fixed plugins not being filtered when defaulting to mobile on phones #TINY-3537 - Fixed toolbar more drawer showing the content behind it when transitioning between opened and closed states #TINY-3878 - Fixed focus not returning to the dialog after pressing the "Replace all" button in the search and replace dialog #TINY-3961 - Removed Oxide variable `@menubar-select-disabled-border-color` and replaced it with `@menubar-select-disabled-border` #TINY-3965 -Version 5.0.13 (2019-08-06) - Changed modal dialogs to prevent dragging by default and added new `draggable_modal` setting to restore dragging #TINY-3873 - Changed the nonbreaking plugin to insert nbsp characters wrapped in spans to aid in filtering. This can be disabled using the `nonbreaking_wrap` setting #TINY-3647 - Changed backspace behaviour in lists to outdent nested list items when the cursor is at the start of the list item #TINY-3651 - Fixed sidebar growing beyond editor bounds in IE 11 #TINY-3937 - Fixed issue with being unable to keyboard navigate disabled toolbar buttons #TINY-3350 - Fixed issues with backspace and delete in nested contenteditable true and false elements #TINY-3868 - Fixed issue with losing keyboard navigation in dialogs due to disabled buttons #TINY-3914 - Fixed `MouseEvent.mozPressure is deprecated` warning in Firefox #TINY-3919 - Fixed `default_link_target` not being respected when `target_list` is disabled #TINY-3757 - Fixed mobile plugin filter to only apply to the mobile theme, rather than all mobile platforms #TINY-3405 - Fixed focus switching to another editor during mode changes #TINY-3852 - Fixed an exception being thrown when clicking on an uninitialized inline editor #TINY-3925 - Fixed unable to keyboard navigate to dialog menu buttons #TINY-3933 - Fixed dialogs being able to be dragged outside the window viewport #TINY-3787 - Fixed inline dialogs appearing above modal dialogs #TINY-3932 -Version 5.0.12 (2019-07-18) - Added ability to utilize UI dialog panels inside other panels #TINY-3305 - Added help dialog tab explaining keyboard navigation of the editor #TINY-3603 - Changed the "Find and Replace" design to an inline dialog #TINY-3054 - Fixed issue where autolink spacebar event was not being fired on Edge #TINY-3891 - Fixed table selection missing the background color #TINY-3892 - Fixed removing shortcuts not working for function keys #TINY-3871 - Fixed non-descriptive UI component type names #TINY-3349 - Fixed UI registry components rendering as the wrong type when manually specifying a different type #TINY-3385 - Fixed an issue where dialog checkbox, input, selectbox, textarea and urlinput components couldn't be disabled #TINY-3708 - Fixed the context toolbar not using viable screen space in inline/distraction free mode #TINY-3717 - Fixed the context toolbar overlapping the toolbar in various conditions #TINY-3205 - Fixed IE11 edge case where items were being inserted into the wrong location #TINY-3884 -Version 5.0.11 (2019-07-04) - Fixed packaging errors caused by a rollup treeshaking bug (https://github.com/rollup/rollup/issues/2970) #TINY-3866 - Fixed the customeditor component not able to get data from the dialog api #TINY-3866 - Fixed collection component tooltips not being translated #TINY-3855 -Version 5.0.10 (2019-07-02) - Added support for all HTML color formats in `color_map` setting #TINY-3837 - Changed backspace key handling to outdent content in appropriate circumstances #TINY-3685 - Changed default palette for forecolor and backcolor to include some lighter colors suitable for highlights #TINY-2865 - Changed the search and replace plugin to cycle through results #TINY-3800 - Fixed inconsistent types causing some properties to be unable to be used in dialog components #TINY-3778 - Fixed an issue in the Oxide skin where dialog content like outlines and shadows were clipped because of overflow hidden #TINY-3566 - Fixed the search and replace plugin not resetting state when changing the search query #TINY-3800 - Fixed backspace in lists not creating an undo level #TINY-3814 - Fixed the editor to cancel loading in quirks mode where the UI is not supported #TINY-3391 - Fixed applying fonts not working when the name contained spaces and numbers #TINY-3801 - Fixed so that initial content is retained when initializing on list items #TINY-3796 - Fixed inefficient font name and font size current value lookup during rendering #TINY-3813 - Fixed mobile font copied into the wrong folder for the oxide-dark skin #TINY-3816 - Fixed an issue where resizing the width of tables would produce inaccurate results #TINY-3827 - Fixed a memory leak in the Silver theme #TINY-3797 - Fixed alert and confirm dialogs using incorrect markup causing inconsistent padding #TINY-3835 - Fixed an issue in the Table plugin with `table_responsive_width` not enforcing units when resizing #TINY-3790 - Fixed leading, trailing and sequential spaces being lost when pasting plain text #TINY-3726 - Fixed exception being thrown when creating relative URIs #TINY-3851 - Fixed focus is no longer set to the editor content during mode changes unless the editor already had focus #TINY-3852 -Version 5.0.9 (2019-06-26) - Fixed print plugin not working in Firefox #TINY-3834 -Version 5.0.8 (2019-06-18) - Added back support for multiple toolbars #TINY-2195 - Added support for .m4a files to the media plugin #TINY-3750 - Added new base_url and suffix editor init options #TINY-3681 - Fixed incorrect padding for select boxes with visible values #TINY-3780 - Fixed selection incorrectly changing when programmatically setting selection on contenteditable false elements #TINY-3766 - Fixed sidebar background being transparent #TINY-3727 - Fixed the build to remove duplicate iife wrappers #TINY-3689 - Fixed bogus autocompleter span appearing in content when the autocompleter menu is shown #TINY-3752 - Fixed toolbar font size select not working with legacyoutput plugin #TINY-2921 - Fixed the legacyoutput plugin incorrectly aligning images #TINY-3660 - Fixed remove color not working when using the legacyoutput plugin #TINY-3756 - Fixed the font size menu applying incorrect sizes when using the legacyoutput plugin #TINY-3773 - Fixed scrollIntoView not working when the parent window was out of view #TINY-3663 - Fixed the print plugin printing from the wrong window in IE11 #TINY-3762 - Fixed content CSS loaded over CORS not loading in the preview plugin with content_css_cors enabled #TINY-3769 - Fixed the link plugin missing the default "None" option for link list #TINY-3738 - Fixed small dot visible with menubar and toolbar disabled in inline mode #TINY-3623 - Fixed space key properly inserts a nbsp before/after block elements #TINY-3745 - Fixed native context menu not showing with images in IE11 #TINY-3392 - Fixed inconsistent browser context menu image selection #TINY-3789 -Version 5.0.7 (2019-06-05) - Added new toolbar button and menu item for inserting tables via dialog #TINY-3636 - Added new API for adding/removing/changing tabs in the Help dialog #TINY-3535 - Added highlighting of matched text in autocompleter items #TINY-3687 - Added the ability for autocompleters to work with matches that include spaces #TINY-3704 - Added new `imagetools_fetch_image` callback to allow custom implementations for cors loading of images #TINY-3658 - Added `'http'` and `https` options to `link_assume_external_targets` to prepend `http://` or `https://` prefixes when URL does not contain a protocol prefix. Patch contributed by francoisfreitag. #GH-4335 - Changed annotations navigation to work the same as inline boundaries #TINY-3396 - Changed tabpanel API by adding a `name` field and changing relevant methods to use it #TINY-3535 - Fixed text color not updating all color buttons when choosing a color #TINY-3602 - Fixed the autocompleter not working with fragmented text #TINY-3459 - Fixed the autosave plugin no longer overwrites window.onbeforeunload #TINY-3688 - Fixed infinite loop in the paste plugin when IE11 takes a long time to process paste events. Patch contributed by lRawd. #GH-4987 - Fixed image handle locations when using `fixed_toolbar_container`. Patch contributed by t00. #GH-4966 - Fixed the autoresize plugin not firing `ResizeEditor` events #TINY-3587 - Fixed editor in fullscreen mode not extending to the bottom of the screen #TINY-3701 - Fixed list removal when pressing backspace after the start of the list item #TINY-3697 - Fixed autocomplete not triggering from compositionend events #TINY-3711 - Fixed `file_picker_callback` could not set the caption field on the insert image dialog #TINY-3172 - Fixed the autocompleter menu showing up after a selection had been made #TINY-3718 - Fixed an exception being thrown when a file or number input has focus during initialization. Patch contributed by t00 #GH-2194 -Version 5.0.6 (2019-05-22) - Added `icons_url` editor settings to enable icon packs to be loaded from a custom url #TINY-3585 - Added `image_uploadtab` editor setting to control the visibility of the upload tab in the image dialog #TINY-3606 - Added new api endpoints to the wordcount plugin and improved character count logic #TINY-3578 - Changed plugin, language and icon loading errors to log in the console instead of a notification #TINY-3585 - Fixed the textpattern plugin not working with fragmented text #TINY-3089 - Fixed various toolbar drawer accessibility issues and added an animation #TINY-3554 - Fixed issues with selection and ui components when toggling readonly mode #TINY-3592 - Fixed so readonly mode works with inline editors #TINY-3592 - Fixed docked inline toolbar positioning when scrolled #TINY-3621 - Fixed initial value not being set on bespoke select in quickbars and toolbar drawer #TINY-3591 - Fixed so that nbsp entities aren't trimmed in white-space: pre-line elements #TINY-3642 - Fixed `mceInsertLink` command inserting spaces instead of url encoded characters #GH-4990 - Fixed text content floating on top of dialogs in IE11 #TINY-3640 -Version 5.0.5 (2019-05-09) - Added menu items to match the forecolor/backcolor toolbar buttons #TINY-2878 - Added default directionality based on the configured language #TINY-2621 - Added styles, icons and tests for rtl mode #TINY-2621 - Fixed autoresize not working with floating elements or when media elements finished loading #TINY-3545 - Fixed incorrect vertical caret positioning in IE 11 #TINY-3188 - Fixed submenu anchoring hiding overflowed content #TINY-3564 - Removed unused and hidden validation icons to avoid displaying phantom tooltips #TINY-2329 -Version 5.0.4 (2019-04-23) - Added back URL dialog functionality, which is now available via `editor.windowManager.openUrl()` #TINY-3382 - Added the missing throbber functionality when calling `editor.setProgressState(true)` #TINY-3453 - Added function to reset the editor content and undo/dirty state via `editor.resetContent()` #TINY-3435 - Added the ability to set menu buttons as active #TINY-3274 - Added `editor.mode` API, featuring a custom editor mode API #TINY-3406 - Added better styling to floating toolbar drawer #TINY-3479 - Added the new premium plugins to the Help dialog plugins tab #TINY-3496 - Added the linkchecker context menu items to the default configuration #TINY-3543 - Fixed image context menu items showing on placeholder images #TINY-3280 - Fixed dialog labels and text color contrast within notifications/alert banners to satisfy WCAG 4.5:1 contrast ratio for accessibility #TINY-3351 - Fixed selectbox and colorpicker items not being translated #TINY-3546 - Fixed toolbar drawer sliding mode to correctly focus the editor when tabbing via keyboard navigation #TINY-3533 - Fixed positioning of the styleselect menu in iOS while using the mobile theme #TINY-3505 - Fixed the menubutton `onSetup` callback to be correctly executed when rendering the menu buttons #TINY-3547 - Fixed `default_link_target` setting to be correctly utilized when creating a link #TINY-3508 - Fixed colorpicker floating marginally outside its container #TINY-3026 - Fixed disabled menu items displaying as active when hovered #TINY-3027 - Removed redundant mobile wrapper #TINY-3480 -Version 5.0.3 (2019-03-19) - Changed empty nested-menu items within the style formats menu to be disabled or hidden if the value of `style_formats_autohide` is `true` #TINY-3310 - Changed the entire phrase 'Powered by Tiny' in the status bar to be a link instead of just the word 'Tiny' #TINY-3366 - Changed `formatselect`, `styleselect` and `align` menus to use the `mceToggleFormat` command internally #TINY-3428 - Fixed toolbar keyboard navigation to work as expected when `toolbar_drawer` is configured #TINY-3432 - Fixed text direction buttons to display the correct pressed state in selections that have no explicit `dir` property #TINY-3138 - Fixed the mobile editor to clean up properly when removed #TINY-3445 - Fixed quickbar toolbars to add an empty box to the screen when it is set to `false` #TINY-3439 - Fixed an issue where pressing the **Delete/Backspace** key at the edge of tables was creating incorrect selections #TINY-3371 - Fixed an issue where dialog collection items (emoticon and special character dialogs) couldn't be selected with touch devices #TINY-3444 - Fixed a type error introduced in TinyMCE version 5.0.2 when calling `editor.getContent()` with nested bookmarks #TINY-3400 - Fixed an issue that prevented default icons from being overridden #TINY-3449 - Fixed an issue where **Home/End** keys wouldn't move the caret correctly before or after `contenteditable=false` inline elements #TINY-2995 - Fixed styles to be preserved in IE 11 when editing via the `fullpage` plugin #TINY-3464 - Fixed the `link` plugin context toolbar missing the open link button #TINY-3461 - Fixed inconsistent dialog component spacing #TINY-3436 -Version 5.0.2 (2019-03-05) - Added presentation and document presets to `htmlpanel` dialog component #TINY-2694 - Added missing fixed_toolbar_container setting has been reimplemented in the Silver theme #TINY-2712 - Added a new toolbar setting `toolbar_drawer` that moves toolbar groups which overflow the editor width into either a `sliding` or `floating` toolbar section #TINY-2874 - Updated the build process to include package lock files in the dev distribution archive #TINY-2870 - Fixed inline dialogs did not have aria attributes #TINY-2694 - Fixed default icons are now available in the UI registry, allowing use outside of toolbar buttons #TINY-3307 - Fixed a memory leak related to select toolbar items #TINY-2874 - Fixed a memory leak due to format changed listeners that were never unbound #TINY-3191 - Fixed an issue where content may have been lost when using permanent bookmarks #TINY-3400 - Fixed the quicklink toolbar button not rendering in the quickbars plugin #TINY-3125 - Fixed an issue where menus were generating invalid HTML in some cases #TINY-3323 - Fixed an issue that could cause the mobile theme to show a blank white screen when the editor was inside an `overflow:hidden` element #TINY-3407 - Fixed mobile theme using a transparent background and not taking up the full width on iOS #TINY-3414 - Fixed the template plugin dialog missing the description field #TINY-3337 - Fixed input dialog components using an invalid default type attribute #TINY-3424 - Fixed an issue where backspace/delete keys after/before pagebreak elements wouldn't move the caret #TINY-3097 - Fixed an issue in the table plugin where menu items and toolbar buttons weren't showing correctly based on the selection #TINY-3423 - Fixed inconsistent button focus styles in Firefox #TINY-3377 - Fixed the resize icon floating left when all status bar elements were disabled #TINY-3340 - Fixed the resize handle to not show in fullscreen mode #TINY-3404 -Version 5.0.1 (2019-02-21) - Removed paste as text notification banner and paste_plaintext_inform setting #POW-102 - Fixed an issue where adding links to images would replace the image with text #TINY-3356 - Fixed an issue where the inline editor could use fractional pixels for positioning #TINY-3202 - Fixed an issue where uploading non-image files in the Image Plugin upload tab threw an error. #TINY-3244 - Added H1-H6 toggle button registration to the silver theme #TINY-3070 - Fixed an issue in the media plugin that was causing the source url and height/width to be lost in certain circumstances #TINY-2858 - Fixed an issue with the Context Toolbar not being removed when clicking outside of the editor #TINY-2804 - Fixed an issue where clicking 'Remove link' wouldn't remove the link in certain circumstances #TINY-3199 - Added code sample toolbar button will now toggle on when the cursor is in a code section #TINY-3040 - Fixed an issue where the media plugin would fail when parsing dialog data #TINY-3218 - Fixed an issue where retrieving the selected content as text didn't create newlines #TINY-3197 - Fixed incorrect keyboard shortcuts in the Help dialog for Windows #TINY-3292 - Fixed an issue where JSON serialization could produce invalid JSON #TINY-3281 - Fixed production CSS including references to source maps #TINY-3920 - Fixed development CSS was not included in the development zip #TINY-3920 - Fixed the autocompleter matches predicate not matching on the start of words by default #TINY-3306 - Added new settings to the emoticons plugin to allow additional emoticons to be added #TINY-3088 - Fixed an issue where the page could be scrolled with modal dialogs open #TINY-2252 - Fixed an issue where autocomplete menus would show an icon margin when no items had icons #TINY-3329 - Fixed an issue in the quickbars plugin where images incorrectly showed the text selection toolbar #TINY-3338 - Fixed an issue that caused the inline editor to fail to render when the target element already had focus #TINY-3353 -Version 5.0.0 (2019-02-04) - Full documentation for the version 5 features and changes is available at https://www.tiny.cloud/docs/release-notes/ - - Changes since RC2: - Fixed an issue where tab panel heights weren't sizing properly on smaller screens and weren't updating on resize #TINY-3242 - Added links and registered names with * to denote premium plugins in Plugins tab of Help dialog #TINY-3223 - Changed Tiny 5 mobile skin to look more uniform with desktop #TINY-2650 - Fixed image tools not having any padding between the label and slider #TINY-3220 - Blacklisted table, th and td as inline editor target #TINY-717 - Fixed context toolbar toggle buttons not showing the correct state #TINY-3022 - Fixed missing separators in the spellchecker context menu between the suggestions and actions #TINY-3217 - Fixed notification icon positioning in alert banners #TINY-2196 - Fixed a typo in the word count plugin name #TINY-3062 - Fixed charmap and emoticons dialogs not having a primary button #TINY-3233 - Fixed an issue where resizing wouldn't work correctly depending on the box-sizing model #TINY-3278 -Version 5.0.0-rc-2 (2019-01-22) - Fixed the link dialog such that it will now retain class attributes when updating links #TINY-2825 - Added screen reader accessibility for sidebar and statusbar #TINY-2699 - Updated Emoticons and Charmap dialogs to be screen reader accessible #TINY-2693 - Fixed "Find and replace" not showing in the "Edit" menu by default #TINY-3061 - Updated the textpattern plugin to properly support nested patterns and to allow running a command with a value for a pattern with a start and an end #TINY-2991 - Removed unnecessary 'flex' and unused 'colspan' properties from the new dialog APIs #TINY-2973 - Changed checkboxes to use a boolean for its state, instead of a string #TINY-2848 - Fixed dropdown buttons missing the 'type' attribute, which could cause forms to be incorrectly submitted #TINY-2826 - Fixed emoticon and charmap search not returning expected results in certain cases #TINY-3084 - Changed formatting menus so they are registered and made the align toolbar button use an icon instead of text #TINY-2880 - Fixed blank rel_list values throwing an exception in the link plugin #TINY-3149 -Version 5.0.0-rc-1 (2019-01-08) - Updated the font select dropdown logic to try to detect the system font stack and show "System Font" as the font name #TINY-2710 - Fixed readonly mode not fully disabling editing content #TINY-2287 - Updated the autocompleter to only show when it has matched items #TINY-2350 - Added editor settings functionality to specify title attributes for toolbar groups #TINY-2690 - Added icons instead of button text to improve Search and Replace dialog footer appearance #TINY-2654 - Added `tox-dialog__table` instead of `mce-table-striped` class to enhance Help dialog appearance #TINY-2360 - Added title attribute to iframes so, screen readers can announce iframe labels #TINY-2692 - Updated SizeInput labels to "Height" and "Width" instead of Dimensions #TINY-2833 - Fixed accessibility issues with the font select, font size, style select and format select toolbar dropdowns #TINY-2713 - Fixed accessibility issues with split dropdowns #TINY-2697 - Added a wordcount menu item, that defaults to appearing in the tools menu #TINY-2877 - Fixed the legacyoutput plugin to be compatible with TinyMCE 5.0 #TINY-2301 - Updated the build process to minify and generate ASCII only output for the emoticons database #TINY-2744 - Fixed icons not showing correctly in the autocompleter popup #TINY-3029 - Fixed an issue where preview wouldn't show anything in Edge under certain circumstances #TINY-3035 - Fixed the height being incorrectly calculated for the autoresize plugin #TINY-2807 -Version 5.0.0-beta-1 (2018-11-30) - Changed the name of the "inlite" plugin to "quickbars" #TINY-2831 - Fixed an inline mode issue where the save plugin upon saving can cause content loss #TINY-2659 - Changed the background color icon to highlight background icon #TINY-2258 - Added a new `addNestedMenuItem()` UI registry function and changed all nested menu items to use the new registry functions #TINY-2230 - Changed Help dialog to be accessible to screen readers #TINY-2687 - Changed the color swatch to save selected custom colors to local storage for use across sessions #TINY-2722 - Added title attribute to color swatch colors #TINY-2669 - Added anchorbar component to anchor inline toolbar dialogs to instead of the toolbar #TINY-2040 - Added support for toolbar and toolbar array config options to be squashed into a single toolbar and not create multiple toolbars #TINY-2195 - Added error handling for when forced_root_block config option is set to true #TINY-2261 - Added functionality for the removed_menuitems config option #TINY-2184 - Fixed an issue in IE 11 where calling selection.getContent() would return an empty string when the editor didn't have focus #TINY-2325 - Added the ability to use a string to reference menu items in menu buttons and submenu items #TINY-2253 - Removed compat3x plugin #TINY-2815 - Changed `WindowManager` API - methods `getParams`, `setParams` and `getWindows`, and the legacy `windows` property, have been removed. `alert` and `confirm` dialogs are no longer tracked in the window list. #TINY-2603 -Version 5.0.0-preview-4 (2018-11-12) - Fixed distraction free plugin #AP-470 - Removed the tox-custom-editor class that was added to the wrapping element of codemirror #TINY-2211 - Fixed contents of the input field being selected on focus instead of just recieving an outline highlight #AP-464 - Added width and height placeholder text to image and media dialog dimensions input #AP-296 - Fixed styling issues with dialogs and menus in IE 11 #AP-456 - Fixed custom style format control not honoring custom formats #AP-393 - Fixed context menu not appearing when clicking an image with a caption #AP-382 - Fixed directionality of UI when using an RTL language #AP-423 - Fixed page responsiveness with multiple inline editors #AP-430 - Added the ability to keyboard navigate through menus, toolbars, sidebar and the status bar sequentially #AP-381 - Fixed empty toolbar groups appearing through invalid configuration of the `toolbar` property #AP-450 - Fixed text not being retained when updating links through the link dialog #AP-293 - Added translation capability back to the editor's UI #AP-282 - Fixed edit image context menu, context toolbar and toolbar items being incorrectly enabled when selecting invalid images #AP-323 - Fixed emoji type ahead being shown when typing URLs #AP-366 - Fixed toolbar configuration properties incorrectly expecting string arrays instead of strings #AP-342 - Changed the editor resize handle so that it should be disabled when the autoresize plugin is turned on #AP-424 - Fixed the block formatting toolbar item not showing a "Formatting" title when there is no selection #AP-321 - Fixed clicking disabled toolbar buttons hiding the toolbar in inline mode #AP-380 - Fixed `EditorResize` event not being fired upon editor resize #AP-327 - Fixed tables losing styles when updating through the dialog #AP-368 - Fixed context toolbar positioning to be more consistent near the edges of the editor #AP-318 - Added `label` component type for dialogs to group components under a label - Fixed table of contents plugin now works with v5 toolbar APIs correctly #AP-347 - Fixed the `link_context_toolbar` configuration not disabling the context toolbar #AP-458 - Fixed the link context toolbar showing incorrect relative links #AP-435 - Fixed the alignment of the icon in alert banner dialog components #TINY-2220 - Changed UI text for microcopy improvements #TINY-2281 - Fixed the visual blocks and visual char menu options not displaying their toggled state #TINY-2238 - Fixed the editor not displaying as fullscreen when toggled #TINY-2237 -Version 5.0.0-preview-3 (2018-10-18) - Changed editor layout to use modern CSS properties over manually calculating dimensions #AP-324 - Changed `autoresize_min_height` and `autoresize_max_height` configurations to `min_height` and `max_height` #AP-324 - Fixed bugs with editor width jumping when resizing and the iframe not resizing to smaller than 150px in height #AP-324 - Fixed mobile theme bug that prevented the editor from loading #AP-404 - Fixed long toolbar groups extending outside of the editor instead of wrapping - Changed `Whole word` label in Search and Replace dialog to `Find whole words only` #AP-387 - Fixed dialog titles so they are now proper case #AP-384 - Fixed color picker default to be #000000 instead of #ff00ff #AP-216 - Fixed "match case" option on the Find and Replace dialog is no longer selected by default #AP-298 - Fixed vertical alignment of toolbar icons #DES-134 - Fixed toolbar icons not appearing on IE11 #DES-133 -Version 5.0.0-preview-2 (2018-10-10) - Changed configuration of color options has been simplified to `color_map`, `color_cols`, and `custom_colors` #AP-328 - Added swatch is now shown for colorinput fields, instead of the colorpicker directly #AP-328 - Removed `colorpicker` plugin, it is now in the theme #AP-328 - Removed `textcolor` plugin, it is now in the theme #AP-328 - Fixed styleselect not updating the displayed item as the cursor moved #AP-388 - Changed `height` configuration to apply to the editor frame (including menubar, toolbar, status bar) instead of the content area #AP-324 - Added fontformats and fontsizes menu items #AP-390 - Fixed preview iframe not expanding to the dialog size #AP-252 - Fixed 'meta' shortcuts not translated into platform-specific text #AP-270 - Fixed tabbed dialogs (Charmap and Emoticons) shrinking when no search results returned - Fixed a bug where alert banner icons were not retrieved from icon pack. #AP-330 - Fixed component styles to flex so they fill large dialogs. #AP-252 - Fixed editor flashing unstyled during load (still in progress). #AP-349 -Version 5.0.0-preview-1 (2018-10-01) - Developer preview 1 - Initial list of features and changes is available at https://tiny.cloud/docs-preview/release-notes/new-features/ -Version 4.9.3 (2019-01-31) - Added a visualchars_default_state setting to the Visualchars Plugin. Patch contributed by mat3e. - Fixed a bug where scrolling on a page with more than one editor would cause a ResizeWindow event to fire. #TINY-3247 - Fixed a bug where if a plugin threw an error during initialisation the whole editor would fail to load. #TINY-3243 - Fixed a bug where getContent would include bogus elements when valid_elements setting was set up in a specific way. #TINY-3213 - Fixed a bug where only a few function key names could be used when creating keyboard shortcuts. #TINY-3146 - Fixed a bug where it wasn't possible to enter spaces into an editor after pressing shift+enter. #TINY-3099 - Fixed a bug where no caret would be rendered after backspacing to a contenteditable false element. #TINY-2998 - Fixed a bug where deletion to/from indented lists would leave list fragments in the editor. #TINY-2981 -Version 4.9.2 (2018-12-17) - Fixed a bug with pressing the space key on IE 11 would result in nbsp characters being inserted between words at the end of a block. #TINY-2996 - Fixed a bug where character composition using quote and space on US International keyboards would produce a space instead of a quote. #TINY-2999 - Fixed a bug where remove format wouldn't remove the inner most inline element in some situations. #TINY-2982 - Fixed a bug where outdenting an list item would affect attributes on other list items within the same list. #TINY-2971 - Fixed a bug where the DomParser filters wouldn't be applied for elements created when parsing invalid html. #TINY-2978 - Fixed a bug where setProgressState wouldn't automatically close floating ui elements like menus. #TINY-2896 - Fixed a bug where it wasn't possible to navigate out of a figcaption element using the arrow keys. #TINY-2894 - Fixed a bug where enter key before an image inside a link would remove the image. #TINY-2780 -Version 4.9.1 (2018-12-04) - Added functionality to insert html to the replacement feature of the Textpattern Plugin. #TINY-2839 - Fixed a bug where `editor.selection.getContent({format: 'text'})` didn't work as expected in IE11 on an unfocused editor. #TINY-2862 - Fixed a bug in the Textpattern Plugin where the editor would get an incorrect selection after inserting a text pattern on Safari. #TINY-2838 - Fixed a bug where the space bar didn't work correctly in editors with the forced_root_block setting set to false. #TINY-2816 -Version 4.9.0 (2018-11-27) - Added a replace feature to the Textpattern Plugin. #TINY-1908 - Added functionality to the Lists Plugin that improves the indentation logic. #TINY-1790 - Fixed a bug where it wasn't possible to delete/backspace when the caret was between a contentEditable=false element and a BR. #TINY-2372 - Fixed a bug where copying table cells without a text selection would fail to copy anything. #TINY-1789 - Implemented missing `autosave_restore_when_empty` functionality in the Autosave Plugin. Patch contributed by gzzo. #GH-4447 - Reduced insertion of unnecessary nonbreaking spaces in the editor. #TINY-1879 -Version 4.8.5 (2018-10-30) - Added a content_css_cors setting to the editor that adds the crossorigin="anonymous" attribute to link tags added by the StyleSheetLoader. #TINY-1909 - Fixed a bug where trying to remove formatting with a collapsed selection range would throw an exception. #GH-4636 - Fixed a bug in the image plugin that caused updating figures to split contenteditable elements. #GH-4563 - Fixed a bug that was causing incorrect viewport calculations for fixed position UI elements. #TINY-1897 - Fixed a bug where inline formatting would cause the delete key to do nothing. #TINY-1900 -Version 4.8.4 (2018-10-23) - Added support for the HTML5 `main` element. #TINY-1877 - Changed the keyboard shortcut to move focus to contextual toolbars to Ctrl+F9. #TINY-1812 - Fixed a bug where content css could not be loaded from another domain. #TINY-1891 - Fixed a bug on FireFox where the cursor would get stuck between two contenteditable false inline elements located inside of the same block element divided by a BR. #TINY-1878 - Fixed a bug with the insertContent method where nonbreaking spaces would be inserted incorrectly. #TINY-1868 - Fixed a bug where the toolbar of the inline editor would not be visible in some scenarios. #TINY-1862 - Fixed a bug where removing the editor while more than one notification was open would throw an error. #TINY-1845 - Fixed a bug where the menubutton would be rendered on top of the menu if the viewport didn't have enough height. #TINY-1678 - Fixed a bug with the annotations api where annotating collapsed selections caused problems. #TBS-2449 - Fixed a bug where wbr elements were being transformed into whitespace when using the Paste Plugin's paste as text setting. #GH-4638 - Fixed a bug where the Search and Replace didn't replace spaces correctly. #GH-4632 - Fixed a bug with sublist items not persisting selection. #GH-4628 - Fixed a bug with mceInsertRawHTML command not working as expected. #GH-4625 -Version 4.8.3 (2018-09-13) - Fixed a bug where the Wordcount Plugin didn't correctly count words within tables on IE11. #TINY-1770 - Fixed a bug where it wasn't possible to move the caret out of a table on IE11 and Firefox. #TINY-1682 - Fixed a bug where merging empty blocks didn't work as expected, sometimes causing content to be deleted. #TINY-1781 - Fixed a bug where the Textcolor Plugin didn't show the correct current color. #TINY-1810 - Fixed a bug where clear formatting with a collapsed selection would sometimes clear formatting from more content than expected. #TINY-1813 #TINY-1821 - Fixed a bug with the Table Plugin where it wasn't possible to keyboard navigate to the caption. #TINY-1818 -Version 4.8.2 (2018-08-09) - Moved annotator from "experimental" to "annotator" object on editor. #TBS-2398 - Improved the multiclick normalization across browsers. #TINY-1788 - Fixed a bug where running getSelectedBlocks with a collapsed selection between block elements would produce incorrect results. #TINY-1787 - Fixed a bug where the ScriptLoaders loadScript method would not work as expected in FireFox when loaded on the same page as a ShadowDOM polyfill. #TINY-1786 - Removed reference to ShadowDOM event.path as Blink based browsers now support event.composedPath. #TINY-1785 - Fixed a bug where a reference to localStorage would throw an "access denied" error in IE11 with strict security settings. #TINY-1782 - Fixed a bug where pasting using the toolbar button on an inline editor in IE11 would cause a looping behaviour. #TINY-1768 -Version 4.8.1 (2018-07-26) - Fixed a bug where the content of inline editors was being cleaned on every call of `editor.save()`. #TINY-1783 - Fixed a bug where the arrow of the Inlite Theme toolbar was being rendered incorrectly in RTL mode. #TINY-1776 - Fixed a bug with the Paste Plugin where pasting after inline contenteditable false elements moved the caret to the end of the line. #TINY-1758 -Version 4.8.0 (2018-06-27) - Added new "experimental" object in editor, with initial Annotator API. #TBS-2374 - Fixed a bug where deleting paragraphs inside of table cells would delete the whole table cell. #TINY-1759 - Fixed a bug in the Table Plugin where removing row height set on the row properties dialog did not update the table. #TINY-1730 - Fixed a bug with the font select toolbar item didn't update correctly. #TINY-1683 - Fixed a bug where all bogus elements would not be deleted when removing an inline editor. #TINY-1669 -Version 4.7.13 (2018-05-16) - Fixed a bug where Edge 17 wouldn't be able to select images or tables. #TINY-1679 - Fixed issue where whitespace wasn't preserved when the editor was initialized on pre elements. #TINY-1649 - Fixed a bug with the fontselect dropdowns throwing an error if the editor was hidden in Firefox. #TINY-1664 - Fixed a bug where it wasn't possible to merge table cells on IE 11. #TINY-1671 - Fixed a bug where textcolor wasn't applying properly on IE 11 in some situations. #TINY-1663 - Fixed a bug where the justifyfull command state wasn't working correctly. #TINY-1677 - Fixed a bug where the styles wasn't updated correctly when resizing some tables. #TINY-1668 - Added missing code menu item from the default menu config. #TINY-1648 - Added new align button for combining the separate align buttons into a menu button. #TINY-1652 -Version 4.7.12 (2018-05-03) - Added an option to filter out image svg data urls. - Added support for html5 details and summary elements. - Changed so the mce-abs-layout-item css rule targets html instead of body. Patch contributed by nazar-pc. - Fixed a bug where the "read" step on the mobile theme was still present on android mobile browsers. - Fixed a bug where all images in the editor document would reload on any editor change. - Fixed a bug with the Table Plugin where ObjectResized event wasn't being triggered on column resize. - Fixed so the selection is set to the first suitable caret position after editor.setContent called. - Fixed so links with xlink:href attributes are filtered correctly to prevent XSS. - Fixed a bug on IE11 where pasting content into an inline editor initialized on a heading element would create new editable elements. - Fixed a bug where readonly mode would not work as expected when the editor contained contentEditable=true elements. - Fixed a bug where the Link Plugin would throw an error when used together with the webcomponents polyfill. Patch contributed by 4esnog. - Fixed a bug where the "Powered by TinyMCE" branding link would break on XHTML pages. Patch contributed by tistre. - Fixed a bug where the same id would be used in the blobcache for all pasted images. Patch contributed by thorn0. -Version 4.7.11 (2018-04-11) - Added a new imagetools_credentials_hosts option to the Imagetools Plugin. - Fixed a bug where toggling a list containing empty LIs would throw an error. Patch contributed by bradleyke. - Fixed a bug where applying block styles to a text with the caret at the end of the paragraph would select all text in the paragraph. - Fixed a bug where toggling on the Spellchecker Plugin would trigger isDirty on the editor. - Fixed a bug where it was possible to enter content into selection bookmark spans. - Fixed a bug where if a non paragraph block was configured in forced_root_block the editor.getContent method would return incorrect values with an empty editor. - Fixed a bug where dropdown menu panels stayed open and fixed in position when dragging dialog windows. - Fixed a bug where it wasn't possible to extend table cells with the space button in Safari. - Fixed a bug where the setupeditor event would thrown an error when using the Compat3x Plugin. - Fixed a bug where an error was thrown in FontInfo when called on a detached element. -Version 4.7.10 (2018-04-03) - Removed the "read" step from the mobile theme. - Added normalization of triple clicks across browsers in the editor. - Added a `hasFocus` method to the editor that checks if the editor has focus. - Added correct icon to the Nonbreaking Plugin menu item. - Fixed so the `getContent`/`setContent` methods work even if the editor is not initialized. - Fixed a bug with the Media Plugin where query strings were being stripped from youtube links. - Fixed a bug where image styles were changed/removed when opening and closing the Image Plugin dialog. - Fixed a bug in the Table Plugin where some table cell styles were not correctly added to the content html. - Fixed a bug in the Spellchecker Plugin where it wasn't possible to change the spellchecker language. - Fixed so the the unlink action in the Link Plugin has a menu item and can be added to the contextmenu. - Fixed a bug where it wasn't possible to keyboard navigate to the start of an inline element on a new line within the same block element. - Fixed a bug with the Text Color Plugin where if used with an inline editor located at the bottom of the screen the colorpicker could appear off screen. - Fixed a bug with the UndoManager where undo levels were being added for nbzwsp characters. - Fixed a bug with the Table Plugin where the caret would sometimes be lost when keyboard navigating up through a table. - Fixed a bug where FontInfo.getFontFamily would throw an error when called on a removed editor. - Fixed a bug in Firefox where undo levels were not being added correctly for some specific operations. - Fixed a bug where initializing an inline editor inside of a table would make the whole table resizeable. - Fixed a bug where the fake cursor that appears next to tables on Firefox was positioned incorrectly when switching to fullscreen. - Fixed a bug where zwsp's weren't trimmed from the output from `editor.getContent({ format: 'text' })`. - Fixed a bug where the fontsizeselect/fontselect toolbar items showed the body info rather than the first possible caret position info on init. - Fixed a bug where it wasn't possible to select all content if the editor only contained an inline boundary element. - Fixed a bug where `content_css` urls with query strings wasn't working. - Fixed a bug in the Table Plugin where some table row styles were removed when changing other styles in the row properties dialog. -Version 4.7.9 (2018-02-27) - Fixed a bug where the editor target element didn't get the correct style when removing the editor. -Version 4.7.8 (2018-02-26) - Fixed an issue with the Help Plugin where the menuitem name wasn't lowercase. - Fixed an issue on MacOS where text and bold text did not have the same line-height in the autocomplete dropdown in the Link Plugin dialog. - Fixed a bug where the "paste as text" option in the Paste Plugin didn't work. - Fixed a bug where dialog list boxes didn't get positioned correctly in documents with scroll. - Fixed a bug where the Inlite Theme didn't use the Table Plugin api to insert correct tables. - Fixed a bug where the Inlite Theme panel didn't hide on blur in a correct way. - Fixed a bug where placing the cursor before a table in Firefox would scroll to the bottom of the table. - Fixed a bug where selecting partial text in table cells with rowspans and deleting would produce faulty tables. - Fixed a bug where the Preview Plugin didn't work on Safari due to sandbox security. - Fixed a bug where table cell selection using the keyboard threw an error. - Fixed so the font size and font family doesn't toggle the text but only sets the selected format on the selected text. - Fixed so the built-in spellchecking on Chrome and Safari creates an undo level when replacing words. -Version 4.7.7 (2018-02-19) - Added a border style selector to the advanced tab of the Image Plugin. - Added better controls for default table inserted by the Table Plugin. - Added new `table_responsive_width` option to the Table Plugin that controls whether to use pixel or percentage widths. - Fixed a bug where the Link Plugin text didn't update when a URL was pasted using the context menu. - Fixed a bug with the Spellchecker Plugin where using "Add to dictionary" in the context menu threw an error. - Fixed a bug in the Media Plugin where the preview node for iframes got default width and height attributes that interfered with width/height styles. - Fixed a bug where backslashes were being added to some font family names in Firefox in the fontselect toolbar item. - Fixed a bug where errors would be thrown when trying to remove an editor that had not yet been fully initialized. - Fixed a bug where the Imagetools Plugin didn't update the images atomically. - Fixed a bug where the Fullscreen Plugin was throwing errors when being used on an inline editor. - Fixed a bug where drop down menus weren't positioned correctly in inline editors on scroll. - Fixed a bug with a semicolon missing at the end of the bundled javascript files. - Fixed a bug in the Table Plugin with cursor navigation inside of tables where the cursor would sometimes jump into an incorrect table cells. - Fixed a bug where indenting a table that is a list item using the "Increase indent" button would create a nested table. - Fixed a bug where text nodes containing only whitespace were being wrapped by paragraph elements. - Fixed a bug where whitespace was being inserted after br tags inside of paragraph tags. - Fixed a bug where converting an indented paragraph to a list item would cause the list item to have extra padding. - Fixed a bug where Copy/Paste in an editor with a lot of content would cause the editor to scroll to the top of the content in IE11. - Fixed a bug with a memory leak in the DragHelper. Path contributed by ben-mckernan. - Fixed a bug where the advanced tab in the Media Plugin was being shown even if it didn't contain anything. Patch contributed by gabrieeel. - Fixed an outdated eventname in the EventUtils. Patch contributed by nazar-pc. - Fixed an issue where the Json.parse function would throw an error when being used on a page with strict CSP settings. - Fixed so you can place the curser before and after table elements within the editor in Firefox and Edge/IE. -Version 4.7.6 (2018-01-29) - Fixed a bug in the jquery integration where it threw an error saying that "global is not defined". - Fixed a bug where deleting a table cell whose previous sibling was set to contenteditable false would create a corrupted table. - Fixed a bug where highlighting text in an unfocused editor did not work correctly in IE11/Edge. - Fixed a bug where the table resize handles were not being repositioned when activating the Fullscreen Plugin. - Fixed a bug where the Imagetools Plugin dialog didn't honor editor RTL settings. - Fixed a bug where block elements weren't being merged correctly if you deleted from after a contenteditable false element to the beginning of another block element. - Fixed a bug where TinyMCE didn't work with module loaders like webpack. -Version 4.7.5 (2018-01-22) - Fixed bug with the Codesample Plugin where it wasn't possible to edit codesamples when the editor was in inline mode. - Fixed bug where focusing on the status bar broke the keyboard navigation functionality. - Fixed bug where an error would be thrown on Edge by the Table Plugin when pasting using the PowerPaste Plugin. - Fixed bug in the Table Plugin where selecting row border style from the dropdown menu in advanced row properties would throw an error. - Fixed bug with icons being rendered incorrectly on Chrome on Mac OS. - Fixed bug in the Textcolor Plugin where the font color and background color buttons wouldn't trigger an ExecCommand event. - Fixed bug in the Link Plugin where the url field wasn't forced LTR. - Fixed bug where the Nonbreaking Plugin incorrectly inserted spaces into tables. - Fixed bug with the inline theme where the toolbar wasn't repositioned on window resize. -Version 4.7.4 (2017-12-05) - Fixed bug in the Nonbreaking Plugin where the nonbreaking_force_tab setting was being ignored. - Fixed bug in the Table Plugin where changing row height incorrectly converted column widths to pixels. - Fixed bug in the Table Plugin on Edge and IE11 where resizing the last column after resizing the table would cause invalid column heights. - Fixed bug in the Table Plugin where keyboard navigation was not normalized between browsers. - Fixed bug in the Table Plugin where the colorpicker button would show even without defining the colorpicker_callback. - Fixed bug in the Table Plugin where it wasn't possible to set the cell background color. - Fixed bug where Firefox would throw an error when intialising an editor on an element that is hidden or not yet added to the DOM. - Fixed bug where Firefox would throw an error when intialising an editor inside of a hidden iframe. -Version 4.7.3 (2017-11-23) - Added functionality to open the Codesample Plugin dialog when double clicking on a codesample. Patch contributed by dakuzen. - Fixed bug where undo/redo didn't work correctly with some formats and caret positions. - Fixed bug where the color picker didn't show up in Table Plugin dialogs. - Fixed bug where it wasn't possible to change the width of a table through the Table Plugin dialog. - Fixed bug where the Charmap Plugin couldn't insert some special characters. - Fixed bug where editing a newly inserted link would not actually edit the link but insert a new link next to it. - Fixed bug where deleting all content in a table cell made it impossible to place the caret into it. - Fixed bug where the vertical alignment field in the Table Plugin cell properties dialog didn't do anything. - Fixed bug where an image with a caption showed two sets of resize handles in IE11. - Fixed bug where pressing the enter button inside of an h1 with contenteditable set to true would sometimes produce a p tag. - Fixed bug with backspace not working as expected before a noneditable element. - Fixed bug where operating on tables with invalid rowspans would cause an error to be thrown. - Fixed so a real base64 representation of the image is available on the blobInfo that the images_upload_handler gets called with. - Fixed so the image upload tab is available when the images_upload_handler is defined (and not only when the images_upload_url is defined). -Version 4.7.2 (2017-11-07) - Added newly rewritten Table Plugin. - Added support for attributes with colon in valid_elements and addValidElements. - Added support for dailymotion short url in the Media Plugin. Patch contributed by maat8. - Added support for converting to half pt when converting font size from px to pt. Patch contributed by danny6514. - Added support for location hash to the Autosave plugin to make it work better with SPAs using hash routing. - Added support for merging table cells when pasting a table into another table. - Changed so the language packs are only loaded once. Patch contributed by 0xor1. - Simplified the css for inline boundaries selection by switching to an attribute selector. - Fixed bug where an error would be thrown on editor initialization if the window.getSelection() returned null. - Fixed bug where holding down control or alt keys made the keyboard navigation inside an inline boundary not work as expected. - Fixed bug where applying formats in IE11 produced extra, empty paragraphs in the editor. - Fixed bug where the Word Count Plugin didn't count some mathematical operators correctly. - Fixed bug where removing an inline editor removed the element that the editor had been initialized on. - Fixed bug where setting the selection to the end of an editable container caused some formatting problems. - Fixed bug where an error would be thrown sometimes when an editor was removed because of the selection bookmark was being stored asynchronously. - Fixed a bug where an editor initialized on an empty list did not contain any valid cursor positions. - Fixed a bug with the Context Menu Plugin and webkit browsers on Mac where right-clicking inside a table would produce an incorrect selection. - Fixed bug where the Image Plugin constrain proportions setting wasn't working as expected. - Fixed bug where deleting the last character in a span with decorations produced an incorrect element when typing. - Fixed bug where focusing on inline editors made the toolbar flicker when moving between elements quickly. - Fixed bug where the selection would be stored incorrectly in inline editors when the mouseup event was fired outside the editor body. - Fixed bug where toggling bold at the end of an inline boundary would toggle off the whole word. - Fixed bug where setting the skin to false would not stop the loading of some skin css files. - Fixed bug in mobile theme where pinch-to-zoom would break after exiting the editor. - Fixed bug where sublists of a fully selected list would not be switched correctly when changing list style. - Fixed bug where inserting media by source would break the UndoManager. - Fixed bug where inserting some content into the editor with a specific selection would replace some content incorrectly. - Fixed bug where selecting all content with ctrl+a in IE11 caused problems with untoggling some formatting. - Fixed bug where the Search and Replace Plugin left some marker spans in the editor when undoing and redoing after replacing some content. - Fixed bug where the editor would not get a scrollbar when using the Fullscreen and Autoresize plugins together. - Fixed bug where the font selector would stop working correctly after selecting fonts three times. - Fixed so pressing the enter key inside of an inline boundary inserts a br after the inline boundary element. - Fixed a bug where it wasn't possible to use tab navigation inside of a table that was inside of a list. - Fixed bug where end_container_on_empty_block would incorrectly remove elements. - Fixed bug where content_styles weren't added to the Preview Plugin iframe. - Fixed so the beforeSetContent/beforeGetContent events are preventable. - Fixed bug where changing height value in Table Plugin advanced tab didn't do anything. - Fixed bug where it wasn't possible to remove formatting from content in beginning of table cell. -Version 4.7.1 (2017-10-09) - Fixed bug where theme set to false on an inline editor produced an extra div element after the target element. - Fixed bug where the editor drag icon was misaligned with the branding set to false. - Fixed bug where doubled menu items were not being removed as expected with the removed_menuitems setting. - Fixed bug where the Table of contents plugin threw an error when initialized. - Fixed bug where it wasn't possible to add inline formats to text selected right to left. - Fixed bug where the paste from plain text mode did not work as expected. - Fixed so the style previews do not set color and background color when selected. - Fixed bug where the Autolink plugin didn't work as expected with some formats applied on an empty editor. - Fixed bug where the Textpattern plugin were throwing errors on some patterns. - Fixed bug where the Save plugin saved all editors instead of only the active editor. Patch contributed by dannoe. -Version 4.7.0 (2017-10-03) - Added new mobile ui that is specifically designed for mobile devices. - Updated the default skin to be more modern and white since white is preferred by most implementations. - Restructured the default menus to be more similar to common office suites like Google Docs. - Fixed so theme can be set to false on both inline and iframe editor modes. - Fixed bug where inline editor would add/remove the visualblocks css multiple times. - Fixed bug where selection wouldn't be properly restored when editor lost focus and commands where invoked. - Fixed bug where toc plugin would generate id:s for headers even though a toc wasn't inserted into the content. - Fixed bug where is wasn't possible to drag/drop contents within the editor if paste_data_images where set to true. - Fixed bug where getParam and close in WindowManager would get the first opened window instead of the last opened window. - Fixed bug where delete would delete between cells inside a table in Firefox. -Version 4.6.7 (2017-09-18) - Fixed bug where paste wasn't working in IOS. - Fixed bug where the Word Count Plugin didn't count some mathematical operators correctly. - Fixed bug where inserting a list in a table caused the cell to expand in height. - Fixed bug where pressing enter in a list located inside of a table deleted list items instead of inserting new list item. - Fixed bug where copy and pasting table cells produced inconsistent results. - Fixed bug where initializing an editor with an ID of 'length' would throw an exception. - Fixed bug where it was possible to split a non merged table cell. - Fixed bug where copy and pasting a list with a very specific selection into another list would produce a nested list. - Fixed bug where copy and pasting ordered lists sometimes produced unordered lists. - Fixed bug where padded elements inside other elements would be treated as empty. - Added some missing translations to Image, Link and Help plugins. - Fixed so you can resize images inside a figure element. - Fixed bug where an inline TinyMCE editor initialized on a table did not set selection on load in Chrome. - Fixed the positioning of the inlite toolbar when the target element wasn't big enough to fit the toolbar. -Version 4.6.6 (2017-08-30) - Fixed so that notifications wrap long text content instead of bleeding outside the notification element. - Fixed so the content_style css is added after the skin and custom stylesheets. - Fixed bug where it wasn't possible to remove a table with the Cut button. - Fixed bug where the center format wasn't getting the same font size as the other formats in the format preview. - Fixed bug where the wordcount plugin wasn't counting hyphenated words correctly. - Fixed bug where all content pasted into the editor was added to the end of the editor. - Fixed bug where enter keydown on list item selection only deleted content and didn't create a new line. - Fixed bug where destroying the editor while the content css was still loading caused error notifications on Firefox. - Fixed bug where undoing cut operation in IE11 left some unwanted html in the editor content. - Fixed bug where enter keydown would throw an error in IE11. - Fixed bug where duplicate instances of an editor were added to the editors array when using the createEditor API. - Fixed bug where the formatter applied formats on the wrong content when spellchecker was activated. - Fixed bug where switching formats would reset font size on child nodes. - Fixed bug where the table caption element weren't always the first descendant to the table tag. - Fixed bug where pasting some content into the editor on chrome some newlines were removed. - Fixed bug where it wasn't possible to remove a list if a list item was a table element. - Fixed bug where copy/pasting partial selections of tables wouldn't produce a proper table. - Fixed bug where the searchreplace plugin could not find consecutive spaces. - Fixed bug where background color wasn't applied correctly on some partially selected contents. -Version 4.6.5 (2017-08-02) - Added new inline_boundaries_selector that allows you to specify the elements that should have boundaries. - Added new local upload feature this allows the user to upload images directly from the image dialog. - Added a new api for providing meta data for plugins. It will show up in the help dialog if it's provided. - Fixed so that the notifications created by the notification manager are more screen reader accessible. - Fixed bug where changing the list format on multiple selected lists didn't change all of the lists. - Fixed bug where the nonbreaking plugin would insert multiple undo levels when pressing the tab key. - Fixed bug where delete/backspace wouldn't render a caret when all editor contents where deleted. - Fixed bug where delete/backspace wouldn't render a caret if the deleted element was a single contentEditable false element. - Fixed bug where the wordcount plugin wouldn't count words correctly if word where typed after applying a style format. - Fixed bug where the wordcount plugin would count mathematical formulas as multiple words for example 1+1=2. - Fixed bug where formatting of triple clicked blocks on Chrome/Safari would result in styles being added outside the visual selection. - Fixed bug where paste would add the contents to the end of the editor area when inline mode was used. - Fixed bug where toggling off bold formatting on text entered in a new paragraph would add an extra line break. - Fixed bug where autolink plugin would only produce a link on every other consecutive link on Firefox. - Fixed bug where it wasn't possible to select all contents if the content only had one pre element. - Fixed bug where sizzle would produce lagging behavior on some sites due to repaints caused by feature detection. - Fixed bug where toggling off inline formats wouldn't include the space on selected contents with leading or trailing spaces. - Fixed bug where the cut operation in UI wouldn't work in Chrome. - Fixed bug where some legacy editor initialization logic would throw exceptions about editor settings not being defined. - Fixed bug where it wasn't possible to apply text color to links if they where part of a non collapsed selection. - Fixed bug where an exception would be thrown if the user selected a video element and then moved the focus outside the editor. - Fixed bug where list operations didn't work if there where block elements inside the list items. - Fixed bug where applying block formats to lists wrapped in block elements would apply to all elements in that wrapped block. -Version 4.6.4 (2017-06-13) - Fixed bug where the editor would move the caret when clicking on the scrollbar next to a content editable false block. - Fixed bug where the text color select dropdowns wasn't placed correctly when they didn't fit the width of the screen. - Fixed bug where the default editor line height wasn't working for mixed font size contents. - Fixed bug where the content css files for inline editors were loaded multiple times for multiple editor instances. - Fixed bug where the initial value of the font size/font family dropdowns wasn't displayed. - Fixed bug where the I18n api was not supporting arrays as the translation replacement values. - Fixed bug where chrome would display "The given range isn't in document." errors for invalid ranges passed to setRng. - Fixed bug where the compat3x plugin wasn't working since the global tinymce references wasn't resolved correctly. - Fixed bug where the preview plugin wasn't encoding the base url passed into the iframe contents producing a xss bug. - Fixed bug where the dom parser/serializer wasn't handling some special elements like noframes, title and xmp. - Fixed bug where the dom parser/serializer wasn't handling cdata sections with comments inside. - Fixed bug where the editor would scroll to the top of the editable area if a dialog was closed in inline mode. - Fixed bug where the link dialog would not display the right rel value if rel_list was configured. - Fixed bug where the context menu would select images on some platforms but not others. - Fixed bug where the filenames of images were not retained on dragged and drop into the editor from the desktop. - Fixed bug where the paste plugin would misrepresent newlines when pasting plain text and having forced_root_block configured. - Fixed so that the error messages for the imagetools plugin is more human readable. - Fixed so the internal validate setting for the parser/serializer can't be set from editor initialization settings. -Version 4.6.3 (2017-05-30) - Fixed bug where the arrow keys didn't work correctly when navigating on nested inline boundary elements. - Fixed bug where delete/backspace didn't work correctly on nested inline boundary elements. - Fixed bug where image editing didn't work on subsequent edits of the same image. - Fixed bug where charmap descriptions wouldn't properly wrap if they exceeded the width of the box. - Fixed bug where the default image upload handler only accepted 200 as a valid http status code. - Fixed so rel on target=_blank links gets forced with only noopener instead of both noopener and noreferrer. -Version 4.6.2 (2017-05-23) - Fixed bug where the SaxParser would run out of memory on very large documents. - Fixed bug with formatting like font size wasn't applied to del elements. - Fixed bug where various api calls would be throwing exceptions if they where invoked on a removed editor instance. - Fixed bug where the branding position would be incorrect if the editor was inside a hidden tab and then later showed. - Fixed bug where the color levels feature in the imagetools dialog wasn't working properly. - Fixed bug where imagetools dialog wouldn't pre-load images from CORS domains, before trying to prepare them for editing. - Fixed bug where the tab key would move the caret to the next table cell if being pressed inside a list inside a table. - Fixed bug where the cut/copy operations would loose parent context like the current format etc. - Fixed bug with format preview not working on invalid elements excluded by valid_elements. - Fixed bug where blocks would be merged in incorrect order on backspace/delete. - Fixed bug where zero length text nodes would cause issues with the undo logic if there where iframes present. - Fixed bug where the font size/family select lists would throw errors if the first node was a comment. - Fixed bug with csp having to allow local script evaluation since it was used to detect global scope. - Fixed bug where CSP required a relaxed option for javascript: URLs in unsupported legacy browsers. - Fixed bug where a fake caret would be rendered for td with the contenteditable=false. - Fixed bug where typing would be blocked on IE 11 when within a nested contenteditable=true/false structure. -Version 4.6.1 (2017-05-10) - Added configuration option to list plugin to disable tab indentation. - Fixed bug where format change on very specific content could cause the selection to change. - Fixed bug where TinyMCE could not be lazyloaded through jquery integration. - Fixed bug where entities in style attributes weren't decoded correctly on paste in webkit. - Fixed bug where fontsize_formats option had been renamed incorrectly. - Fixed bug with broken backspace/delete behaviour between contenteditable=false blocks. - Fixed bug where it wasn't possible to backspace to the previous line with the inline boundaries functionality turned on. - Fixed bug where is wasn't possible to move caret left and right around a linked image with the inline boundaries functionality turned on. - Fixed bug where pressing enter after/before hr element threw exception. Patch contributed bradleyke. - Fixed so the CSS in the visualblocks plugin doesn't overwrite background color. Patch contributed by Christian Rank. - Fixed bug where multibyte characters weren't encoded correctly. Patch contributed by James Tarkenton. - Fixed bug where shift-click to select within contenteditable=true fields wasn't working. -Version 4.6.0 (2017-05-04) - Dropped support for IE 8-10 due to market share and lack of support from Microsoft. See tinymce docs for details. - Added an inline boundary caret position feature that makes it easier to type at the beginning/end of links/code elements. - Added a help plugin that adds a button and a dialog showing the editor shortcuts and loaded plugins. - Added an inline_boundaries option that allows you to disable the inline boundary feature if it's not desired. - Added a new ScrollIntoView event that allows you to override the default scroll to element behavior. - Added role and aria- attributes as valid elements in the default valid elements config. - Added new internal flag for PastePreProcess/PastePostProcess this is useful to know if the paste was coming from an external source. - Added new ignore function to UndoManager this works similar to transact except that it doesn't add an undo level by default. - Fixed so that urls gets retained for images when being edited. This url is then passed on to the upload handler. - Fixed so that the editors would be initialized on readyState interactive instead of complete. - Fixed so that the init event of the editor gets fired once all contentCSS files have been properly loaded. - Fixed so that width/height of the editor gets taken from the textarea element if it's explicitly specified in styles. - Fixed so that keep_styles set to false no longer clones class/style from the previous paragraph on enter. - Fixed so that the default line-height is 1.2em to avoid zwnbsp characters from producing text rendering glitches on Windows. - Fixed so that loading errors of content css gets presented by a notification message. - Fixed so figure image elements can be linked when selected this wraps the figure image in a anchor element. - Fixed bug where it wasn't possible to copy/paste rows with colspans by using the table copy/paste feature. - Fixed bug where the protect setting wasn't properly applied to header/footer parts when using the fullpage plugin. - Fixed bug where custom formats that specified upper case element names where not applied correctly. - Fixed bug where some screen readers weren't reading buttons due to an aria specific fix for IE 8. - Fixed bug where cut wasn't working correctly on iOS due to it's clipboard API not working correctly. - Fixed bug where Edge would paste div elements instead of paragraphs when pasting plain text. - Fixed bug where the textpattern plugin wasn't dealing with trailing punctuations correctly. - Fixed bug where image editing would some times change the image format from jpg to png. - Fixed bug where some UI elements could be inserted into the toolbar even if they where not registered. - Fixed bug where it was possible to click the TD instead of the character in the character map and that caused an exception. - Fixed bug where the font size/font family dropdowns would sometimes show an incorrect value due to css not being loaded in time. - Fixed bug with the media plugin inserting undefined instead of retaining size when media_dimensions was set to false. - Fixed bug with deleting images when forced_root_blocks where set to false. - Fixed bug where input focus wasn't properly handled on nested content editable elements. - Fixed bug where Chrome/Firefox would throw an exception when selecting images due to recent change of setBaseAndExtent support. - Fixed bug where malformed blobs would throw exceptions now they are simply ignored. - Fixed bug where backspace/delete wouldn't work properly in some cases where all contents was selected in WebKit. - Fixed bug with Angular producing errors since it was expecting events objects to be patched with their custom properties. - Fixed bug where the formatter would apply formatting to spellchecker errors now all bogus elements are excluded. - Fixed bug with backspace/delete inside table caption elements wouldn't behave properly on IE 11. - Fixed bug where typing after a contenteditable false inline element could move the caret to the end of that element. - Fixed bug where backspace before/after contenteditable false blocks wouldn't properly remove the right element. - Fixed bug where backspace before/after contenteditable false inline elements wouldn't properly empty the current block element. - Fixed bug where vertical caret navigation with a custom line-height would sometimes match incorrect positions. - Fixed bug with paste on Edge where character encoding wasn't handled properly due to a browser bug. - Fixed bug with paste on Edge where extra fragment data was inserted into the contents when pasting. - Fixed bug with pasting contents when having a whole block element selected on WebKit could cause WebKit spans to appear. - Fixed bug where the visualchars plugin wasn't working correctly showing invisible nbsp characters. - Fixed bug where browsers would hang if you tried to load some malformed html contents. - Fixed bug where the init call promise wouldn't resolve if the specified selector didn't find any matching elements. - Fixed bug where the Schema isValidChild function was case sensitive. -Version 4.5.3 (2017-02-01) - Added keyboard navigation for menu buttons when the menu is in focus. - Added api to the list plugin for setting custom classes/attributes on lists. - Added validation for the anchor plugin input field according to W3C id naming specifications. - Fixed bug where media placeholders were removed after resize with the forced_root_block setting set to false. - Fixed bug where deleting selections with similar sibling nodes sometimes deleted the whole document. - Fixed bug with inlite theme where several toolbars would appear scrolling when more than one instance of the editor was in use. - Fixed bug where the editor would throw error with the fontselect plugin on hidden editor instances in Firefox. - Fixed bug where the background color would not stretch to the font size. - Fixed bug where font size would be removed when changing background color. - Fixed bug where the undomanager trimmed away whitespace between nodes on undo/redo. - Fixed bug where media_dimensions=false in media plugin caused the editor to throw an error. - Fixed bug where IE was producing font/u elements within links on paste. - Fixed bug where some button tooltips were broken when compat3x was in use. - Fixed bug where backspace/delete/typeover would remove the caption element. - Fixed bug where powerspell failed to function when compat3x was enabled. - Fixed bug where it wasn't possible to apply sub/sup on text with large font size. - Fixed bug where pre tags with spaces weren't treated as content. - Fixed bug where Meta+A would select the entire document instead of all contents in nested ce=true elements. -Version 4.5.2 (2017-01-04) - Added missing keyboard shortcut description for the underline menu item in the format menu. - Fixed bug where external blob urls wasn't properly handled by editor upload logic. Patch contributed by David Oviedo. - Fixed bug where urls wasn't treated as a single word by the wordcount plugin. - Fixed bug where nbsp characters wasn't treated as word delimiters by the wordcount plugin. - Fixed bug where editor instance wasn't properly passed to the format preview logic. Patch contributed by NullQuery. - Fixed bug where the fake caret wasn't hidden when you moved selection to a cE=false element. - Fixed bug where it wasn't possible to edit existing code sample blocks. - Fixed bug where it wasn't possible to delete editor contents if the selection included an empty block. - Fixed bug where the formatter wasn't expanding words on some international characters. Patch contributed by Martin Larochelle. - Fixed bug where the open link feature wasn't working correctly on IE 11. - Fixed bug where enter before/after a cE=false block wouldn't properly padd the paragraph with an br element. - Fixed so font size and font family select boxes always displays a value by using the runtime style as a fallback. - Fixed so missing plugins will be logged to console as warnings rather than halting the initialization of the editor. - Fixed so splitbuttons become normal buttons in advlist plugin if styles are empty. Patch contributed by René Schleusner. - Fixed so you can multi insert rows/cols by selecting table cells and using insert rows/columns. -Version 4.5.1 (2016-12-07) - Fixed bug where the lists plugin wouldn't initialize without the advlist plugins if served from cdn. - Fixed bug where selectors with "*" would cause the style format preview to throw an error. - Fixed bug with toggling lists off on lists with empty list items would throw an error. - Fixed bug where editing images would produce non existing blob uris. - Fixed bug where the offscreen toc selection would be treated as the real toc element. - Fixed bug where the aria level attribute for element path would have an incorrect start index. - Fixed bug where the offscreen selection of cE=false that where very wide would be shown onscreen. Patch contributed by Steven Bufton. - Fixed so the default_link_target gets applied to links created by the autolink plugin. - Fixed so that the name attribute gets removed by the anchor plugin if editing anchors. -Version 4.5.0 (2016-11-23) - Added new toc plugin allows you to insert table of contents based on editor headings. - Added new auto complete menu to all url fields. Adds history, link to anchors etc. - Added new sidebar api that allows you to add custom sidebar panels and buttons to toggle these. - Added new insert menu button that allows you to have multiple insert functions under the same menu button. - Added new open link feature to ctrl+click, alt+enter and context menu. - Added new media_embed_handler option to allow the media plugin to be populated with custom embeds. - Added new support for editing transparent images using the image tools dialog. - Added new images_reuse_filename option to allow filenames of images to be retained for upload. - Added new security feature where links with target="_blank" will by default get rel="noopener noreferrer". - Added new allow_unsafe_link_target to allow you to opt-out of the target="_blank" security feature. - Added new style_formats_autohide option to automatically hide styles based on context. - Added new codesample_content_css option to specify where the code sample prism css is loaded from. - Added new support for Japanese/Chinese word count following the unicode standards on this. - Added new fragmented undo levels this dramatically reduces flicker on contents with iframes. - Added new live previews for complex elements like table or lists. - Fixed bug where it wasn't possible to properly tab between controls in a dialog with a disabled form item control. - Fixed bug where firefox would generate a rectangle on elements produced after/before a cE=false elements. - Fixed bug with advlist plugin not switching list element format properly in some edge cases. - Fixed bug where col/rowspans wasn't correctly computed by the table plugin in some cases. - Fixed bug where the table plugin would thrown an error if object_resizing was disabled. - Fixed bug where some invalid markup would cause issues when running in XHTML mode. Patch contributed by Charles Bourasseau. - Fixed bug where the fullscreen class wouldn't be removed properly when closing dialogs. - Fixed bug where the PastePlainTextToggle event wasn't fired by the paste plugin when the state changed. - Fixed bug where table the row type wasn't properly updated in table row dialog. Patch contributed by Matthias Balmer. - Fixed bug where select all and cut wouldn't place caret focus back to the editor in WebKit. Patch contributed by Daniel Jalkut. - Fixed bug where applying cell/row properties to multiple cells/rows would reset other unchanged properties. - Fixed bug where some elements in the schema would have redundant/incorrect children. - Fixed bug where selector and target options would cause issues if used together. - Fixed bug where drag/drop of images from desktop on chrome would thrown an error. - Fixed bug where cut on WebKit/Blink wouldn't add an undo level. - Fixed bug where IE 11 would scroll to the cE=false elements when they where selected. - Fixed bug where keys like F5 wouldn't work when a cE=false element was selected. - Fixed bug where the undo manager wouldn't stop the typing state when commands where executed. - Fixed bug where unlink on wrapped links wouldn't work properly. - Fixed bug with drag/drop of images on WebKit where the image would be deleted form the source editor. - Fixed bug where the visual characters mode would be disabled when contents was extracted from the editor. - Fixed bug where some browsers would toggle of formats applied to the caret when clicking in the editor toolbar. - Fixed bug where the custom theme function wasn't working correctly. - Fixed bug where image option for custom buttons required you to have icon specified as well. - Fixed bug where the context menu and contextual toolbars would be visible at the same time and sometimes overlapping. - Fixed bug where the noneditable plugin would double wrap elements when using the noneditable_regexp option. - Fixed bug where tables would get padding instead of margin when you used the indent button. - Fixed bug where the charmap plugin wouldn't properly insert non breaking spaces. - Fixed bug where the color previews in color input boxes wasn't properly updated. - Fixed bug where the list items of previous lists wasn't merged in the right order. - Fixed bug where it wasn't possible to drag/drop inline-block cE=false elements on IE 11. - Fixed bug where some table cell merges would produce incorrect rowspan/colspan. - Fixed so the font size of the editor defaults to 14px instead of 11px this can be overridden by custom css. - Fixed so wordcount is debounced to reduce cpu hogging on larger texts. - Fixed so tinymce global gets properly exported as a module when used with some module bundlers. - Fixed so it's possible to specify what css properties you want to preview on specific formats. - Fixed so anchors are contentEditable=false while within the editor. - Fixed so selected contents gets wrapped in a inline code element by the codesample plugin. - Fixed so conditional comments gets properly stripped independent of case. Patch contributed by Georgii Dolzhykov. - Fixed so some escaped css sequences gets properly handled. Patch contributed by Georgii Dolzhykov. - Fixed so notifications with the same message doesn't get displayed at the same time. - Fixed so F10 can be used as an alternative key to focus to the toolbar. - Fixed various api documentation issues and typos. - Removed layer plugin since it wasn't really ported from 3.x and there doesn't seem to be much use for it. - Removed moxieplayer.swf from the media plugin since it wasn't used by the media plugin. - Removed format state from the advlist plugin to be more consistent with common word processors. -Version 4.4.3 (2016-09-01) - Fixed bug where copy would produce an exception on Chrome. - Fixed bug where deleting lists on IE 11 would merge in correct text nodes. - Fixed bug where deleting partial lists with indentation wouldn't cause proper normalization. -Version 4.4.2 (2016-08-25) - Added new importcss_exclusive option to disable unique selectors per group. - Added new group specific selector_converter option to importcss plugin. - Added new codesample_languages option to apply custom languages to codesample plugin. - Added new codesample_dialog_width/codesample_dialog_height options. - Fixed bug where fullscreen button had an incorrect keyboard shortcut. - Fixed bug where backspace/delete wouldn't work correctly from a block to a cE=false element. - Fixed bug where smartpaste wasn't detecting links with special characters in them like tilde. - Fixed bug where the editor wouldn't get proper focus if you clicked on a cE=false element. - Fixed bug where it wasn't possible to copy/paste table rows that had merged cells. - Fixed bug where merging cells could some times produce invalid col/rowspan attibute values. - Fixed bug where getBody would sometimes thrown an exception now it just returns null if the iframe is clobbered. - Fixed bug where drag/drop of cE=false element wasn't properly constrained to viewport. - Fixed bug where contextmenu on Mac would collapse any selection to a caret. - Fixed bug where rtl mode wasn't rendered properly when loading a language pack with the rtl flag. - Fixed bug where Kamer word bounderies would be stripped from contents. - Fixed bug where lists would sometimes render two dots or numbers on the same line. - Fixed bug where the skin_url wasn't used by the inlite theme. - Fixed so data attributes are ignored when comparing formats in the formatter. - Fixed so it's possible to disable inline toolbars in the inlite theme. - Fixed so template dialog gets resized if it doesn't fit the window viewport. -Version 4.4.1 (2016-07-26) - Added smart_paste option to paste plugin to allow disabling the paste behavior if needed. - Fixed bug where png urls wasn't properly detected by the smart paste logic. - Fixed bug where the element path wasn't working properly when multiple editor instances where used. - Fixed bug with creating lists out of multiple paragraphs would just create one list item instead of multiple. - Fixed bug where scroll position wasn't properly handled by the inlite theme to place the toolbar properly. - Fixed bug where multiple instances of the editor using the inlite theme didn't render the toolbar properly. - Fixed bug where the shortcut label for fullscreen mode didn't match the actual shortcut key. - Fixed bug where it wasn't possible to select cE=false blocks using touch devices on for example iOS. - Fixed bug where it was possible to select the child image within a cE=false on IE 11. - Fixed so inserts of html containing lists doesn't merge with any existing lists unless it's a paste operation. -Version 4.4.0 (2016-06-30) - Added new inlite theme this is a more lightweight inline UI. - Added smarter paste logic that auto detects urls in the clipboard and inserts images/links based on that. - Added a better image resize algorithm for better image quality in the imagetools plugin. - Fixed bug where it wasn't possible to drag/dropping cE=false elements on FF. - Fixed bug where backspace/delete before/after a cE=false block would produce a new paragraph. - Fixed bug where list style type css property wasn't preserved when indenting lists. - Fixed bug where merging of lists where done even if the list style type was different. - Fixed bug where the image_dataimg_filter function wasn't used when pasting images. - Fixed bug where nested editable within a non editable element would cause scroll on focus in Chrome. - Fixed so invalid targets for inline mode is blocked on initialization. We only support elements that can have children. -Version 4.3.13 (2016-06-08) - Added characters with a diacritical mark to charmap plugin. Patch contributed by Dominik Schilling. - Added better error handling if the image proxy service would produce errors. - Fixed issue with pasting list items into list items would produce nested list rather than a merged list. - Fixed bug where table selection could get stuck in selection mode for inline editors. - Fixed bug where it was possible to place the caret inside the resize grid elements. - Fixed bug where it wasn't possible to place in elements horizontally adjacent cE=false blocks. - Fixed bug where multiple notifications wouldn't be properly placed on screen. - Fixed bug where multiple editor instance of the same id could be produces in some specific integrations. -Version 4.3.12 (2016-05-10) - Fixed bug where focus calls couldn't be made inside the editors PostRender event handler. - Fixed bug where some translations wouldn't work as expected due to a bug in editor.translate. - Fixed bug where the node change event could fire with a node out side the root of the editor. - Fixed bug where Chrome wouldn't properly present the keyboard paste clipboard details when paste was clicked. - Fixed bug where merged cells in tables couldn't be selected from right to left. - Fixed bug where insert row wouldn't properly update a merged cells rowspan property. - Fixed bug where the color input boxes preview field wasn't properly set on initialization. - Fixed bug where IME composition inside table cells wouldn't work as expected on IE 11. - Fixed so all shadow dom support is under and experimental flag due to flaky browser support. -Version 4.3.11 (2016-04-25) - Fixed bug where it wasn't possible to insert empty blocks though the API unless they where padded. - Fixed bug where you couldn't type the Euro character on Windows. - Fixed bug where backspace/delete from a cE=false element to a text block didn't work properly. - Fixed bug where the text color default grid would render incorrectly. - Fixed bug where the codesample plugin wouldn't load the css in the editor for multiple editors. - Fixed so the codesample plugin textarea gets focused by default. -Version 4.3.10 (2016-04-12) - Fixed bug where the key "y" on WebKit couldn't be entered due to conflict with keycode for F10 on keypress. -Version 4.3.9 (2016-04-12) - Added support for focusing the contextual toolbars using keyboard. - Added keyboard support for slider UI controls. You can no increase/decrease using arrow keys. - Added url pattern matching for Dailymotion to media plugin. Patch contributed by Bertrand Darbon. - Added body_class to template plugin preview. Patch contributed by Milen Petrinski. - Added options to better override textcolor pickers with custom colors. Patch contributed by Xavier Boubert. - Added visual arrows to inline contextual toolbars so that they point to the element being active. - Fixed so toolbars for tables or other larger elements get better positioned below the scrollable viewport. - Fixed bug where it was possible to click links inside cE=false blocks. - Fixed bug where event targets wasn't properly handled in Safari Technical Preview. - Fixed bug where drag/drop text in FF 45 would make the editor caret invisible. - Fixed bug where the remove state wasn't properly set on editor instances when detected as clobbered. - Fixed bug where offscreen selection of some cE=false elements would render onscreen. Patch contributed by Steven Bufton - Fixed bug where enter would clone styles out side the root on editors inside a span. Patch contributed by ChristophKaser. - Fixed bug where drag/drop of images into the editor didn't work correctly in FF. - Fixed so the first item in panels for the imagetools dialog gets proper keyboard focus. - Changed the Meta+Shift+F shortcut to Ctrl+Shift+F since Czech, Slovak, Polish languages used the first one for input. -Version 4.3.8 (2016-03-15) - Fixed bug where inserting HR at the end of a block element would produce an extra empty block. - Fixed bug where links would be clickable when readonly mode was enabled. - Fixed bug where the formatter would normalize to the wrong node on very specific content. - Fixed bug where some nested list items couldn't be indented properly. - Fixed bug where links where clickable in the preview dialog. - Fixed so the alt attribute doesn't get padded with an empty value by default. - Fixed so nested alignment works more correctly. You will now alter the alignment to the closest block parent. -Version 4.3.7 (2016-03-02) - Fixed bug where incorrect icons would be rendered for imagetools edit and color levels. - Fixed bug where navigation using arrow keys inside a SelectBox didn't move up/down. - Fixed bug where the visualblocks plugin would render borders round internal UI elements. -Version 4.3.6 (2016-03-01) - Added new paste_remember_plaintext_info option to allow a global disable of the plain text mode notification. - Added new PastePlainTextToggle event that fires when plain text mode toggles on/off. - Fixed bug where it wasn't possible to select media elements since the drag logic would snap it to mouse cursor. - Fixed bug where it was hard to place the caret inside nested cE=true elements when the outer cE=false element was focused. - Fixed bug where editors wouldn't properly initialize if both selector and mode where used. - Fixed bug where IME input inside table cells would switch the IME off. - Fixed bug where selection inside the first table cell would cause the whole table cell to get selected. - Fixed bug where error handling of images being uploaded wouldn't properly handle faulty statuses. - Fixed bug where inserting contents before a HR would cause an exception to be thrown. - Fixed bug where copy/paste of Excel data would be inserted as an image. - Fixed caret position issues with copy/paste of inline block cE=false elements. - Fixed issues with various menu item focus bugs in Chrome. Where the focused menu bar item wasn't properly blurred. - Fixed so the notifications have a solid background since it would be hard to read if there where text under it. - Fixed so notifications gets animated similar to the ones used by dialogs. - Fixed so larger images that gets pasted is handled better. - Fixed so the window close button is more uniform on various platform and also increased it's hit area. -Version 4.3.5 (2016-02-11) - Npm version bump due to package not being fully updated. -Version 4.3.4 (2016-02-11) - Added new OpenWindow/CloseWindow events that gets fired when windows open/close. - Added new NewCell/NewRow events that gets fired when table cells/rows are created. - Added new Promise return value to tinymce.init makes it easier to handle initialization. - Removed the jQuery version the jQuery plugin is now moved into the main package. - Removed jscs from build process since eslint can now handle code style checking. - Fixed various bugs with drag/drop of contentEditable:false elements. - Fixed bug where deleting of very specific nested list items would result in an odd list. - Fixed bug where lists would get merged with adjacent lists outside the editable inline root. - Fixed bug where MS Edge would crash when closing a dialog then clicking a menu item. - Fixed bug where table cell selection would add undo levels. - Fixed bug where table cell selection wasn't removed when inline editor where removed. - Fixed bug where table cell selection wouldn't work properly on nested tables. - Fixed bug where table merge menu would be available when merging between thead and tbody. - Fixed bug where table row/column resize wouldn't get properly removed when the editor was removed. - Fixed bug where Chrome would scroll to the editor if there where a empty hash value in document url. - Fixed bug where the cache suffix wouldn't work correctly with the importcss plugin. - Fixed bug where selection wouldn't work properly on MS Edge on Windows Phone 10. - Fixed so adjacent pre blocks gets joined into one pre block since that seems like the user intent. - Fixed so events gets properly dispatched in shadow dom. Patch provided by Nazar Mokrynskyi. -Version 4.3.3 (2016-01-14) - Added new table_resize_bars configuration setting. This setting allows you to disable the table resize bars. - Added new beforeInitialize event to tinymce.util.XHR lets you modify XHR properties before open. Patch contributed by Brent Clintel. - Added new autolink_pattern setting to autolink plugin. Enables you to override the default autolink formats. Patch contributed by Ben Tiedt. - Added new charmap option that lets you override the default charmap of the charmap plugin. - Added new charmap_append option that lets you add new characters to the default charmap of the charmap plugin. - Added new insertCustomChar event that gets fired when a character is inserted by the charmap plugin. - Fixed bug where table cells started with a superfluous   in IE10+. - Fixed bug where table plugin would retain all BR tags when cells were merged. - Fixed bug where media plugin would strip underscores from youtube urls. - Fixed bug where IME input would fail on IE 11 if you typed within a table. - Fixed bug where double click selection of a word would remove the space before the word on insert contents. - Fixed bug where table plugin would produce exceptions when hovering tables with invalid structure. - Fixed bug where fullscreen wouldn't scroll back to it's original position when untoggled. - Fixed so the template plugins templates setting can be a function that gets a callback that can provide templates. -Version 4.3.2 (2015-12-14) - Fixed bug where the resize bars for table cells were not affected by the object_resizing property. - Fixed bug where the contextual table toolbar would appear incorrectly if TinyMCE was initialized inline inside a table. - Fixed bug where resizing table cells did not fire a node change event or add an undo level. - Fixed bug where double click selection of text on IE 11 wouldn't work properly. - Fixed bug where codesample plugin would incorrectly produce br elements inside code elements. - Fixed bug where media plugin would strip dashes from youtube urls. - Fixed bug where it was possible to move the caret into the table resize bars. - Fixed bug where drag/drop into a cE=false element was possible on IE. -Version 4.3.1 (2015-11-30) - Fixed so it's possible to disable the table inline toolbar by setting it to false or an empty string. - Fixed bug where it wasn't possible to resize some tables using the drag handles. - Fixed bug where unique id:s would clash for multiple editor instances and cE=false selections. - Fixed bug where the same plugin could be initialized multiple times. - Fixed bug where the table inline toolbars would be displayed at the same time as the image toolbars. - Fixed bug where the table selection rect wouldn't be removed when selecting another control element. -Version 4.3.0 (2015-11-23) - Added new table column/row resize support. Makes it a lot more easy to resize the columns/rows in a table. - Added new table inline toolbar. Makes it easier to for example add new rows or columns to a table. - Added new notification API. Lets you display floating notifications to the end user. - Added new codesample plugin that lets you insert syntax highlighted pre elements into the editor. - Added new image_caption to images. Lets you create images with captions using a HTML5 figure/figcaption elements. - Added new live previews of embeded videos. Lets you play the video right inside the editor. - Added new setDirty method and "dirty" event to the editor. Makes it easier to track the dirty state change. - Added new setMode method to Editor instances that lets you dynamically switch between design/readonly. - Added new core support for contentEditable=false elements within the editor overrides the browsers broken behavior. - Rewrote the noneditable plugin to use the new contentEditable false core logic. - Fixed so the dirty state doesn't set to false automatically when the undo index is set to 0. - Fixed the Selection.placeCaretAt so it works better on IE when the coordinate is between paragraphs. - Fixed bug where data-mce-bogus="all" element contents where counted by the word count plugin. - Fixed bug where contentEditable=false elements would be indented by the indent buttons. - Fixed bug where images within contentEditable=false would be selected in WebKit on mouse click. - Fixed bug in DOMUntils split method where the replacement parameter wouldn't work on specific cases. - Fixed bug where the importcss plugin would import classes from the skin content css file. - Fixed so all button variants have a wrapping span for it's text to make it easier to skin. - Fixed so it's easier to exit pre block using the arrow keys. - Fixed bug where listboxes with fix widths didn't render correctly. -Version 4.2.8 (2015-11-13) - Fixed bug where it was possible to delete tables as the inline root element if all columns where selected. - Fixed bug where the UI buttons active state wasn't properly updated due to recent refactoring of that logic. -Version 4.2.7 (2015-10-27) - Fixed bug where backspace/delete would remove all formats on the last paragraph character in WebKit/Blink. - Fixed bug where backspace within a inline format element with a bogus caret container would move the caret. - Fixed bug where backspace/delete on selected table cells wouldn't add an undo level. - Fixed bug where script tags embedded within the editor could sometimes get a mce- prefix prepended to them - Fixed bug where validate: false option could produce an error to be thrown from the Serialization step. - Fixed bug where inline editing of a table as the root element could let the user delete that table. - Fixed bug where inline editing of a table as the root element wouldn't properly handle enter key. - Fixed bug where inline editing of a table as the root element would normalize the selection incorrectly. - Fixed bug where inline editing of a list as the root element could let the user delete that list. - Fixed bug where inline editing of a list as the root element could let the user split that list. - Fixed bug where resize handles would be rendered on editable root elements such as table. -Version 4.2.6 (2015-09-28) - Added capability to set request headers when using XHRs. - Added capability to upload local images automatically default delay is set to 30 seconds after editing images. - Added commands ids mceEditImage, mceAchor and mceMedia to be avaiable from execCommand. - Added Edge browser to saucelabs grunt task. Patch contributed by John-David Dalton. - Fixed bug where blob uris not produced by tinymce would produce HTML invalid markup. - Fixed bug where selection of contents of a nearly empty editor in Edge would sometimes fail. - Fixed bug where color styles woudln't be retained on copy/paste in Blink/Webkit. - Fixed bug where the table plugin would throw an error when inserting rows after a child table. - Fixed bug where the template plugin wouldn't handle functions as variable replacements. - Fixed bug where undo/redo sometimes wouldn't work properly when applying formatting collapsed ranges. - Fixed bug where shift+delete wouldn't do a cut operation on Blink/WebKit. - Fixed bug where cut action wouldn't properly store the before selection bookmark for the undo level. - Fixed bug where backspace in side an empty list element on IE would loose editor focus. - Fixed bug where the save plugin wouldn't enable the buttons when a change occurred. - Fixed bug where Edge wouldn't initialize the editor if a document.domain was specified. - Fixed bug where enter key before nested images would sometimes not properly expand the previous block. - Fixed bug where the inline toolbars wouldn't get properly hidden when blurring the editor instance. - Fixed bug where Edge would paste Chinese characters on some Windows 10 installations. - Fixed bug where IME would loose focus on IE 11 due to the double trailing br bug fix. - Fixed bug where the proxy url in imagetools was incorrect. Patch contributed by Wong Ho Wang. -Version 4.2.5 (2015-08-31) - Added fullscreen capability to embedded youtube and vimeo videos. - Fixed bug where the uploadImages call didn't work on IE 10. - Fixed bug where image place holders would be uploaded by uploadImages call. - Fixed bug where images marked with bogus would be uploaded by the uploadImages call. - Fixed bug where multiple calls to uploadImages would result in decreased performance. - Fixed bug where pagebreaks were editable to imagetools patch contributed by Rasmus Wallin. - Fixed bug where the element path could cause too much recursion exception. - Fixed bug for domains containing ".min". Patch contributed by Loïc Février. - Fixed so validation of external links to accept a number after www. Patch contributed by Victor Carvalho. - Fixed so the charmap is exposed though execCommand. Patch contributed by Matthew Will. - Fixed so that the image uploads are concurrent for improved performance. - Fixed various grammar problems in inline documentation. Patches provided by nikolas. -Version 4.2.4 (2015-08-17) - Added picture as a valid element to the HTML 5 schema. Patch contributed by Adam Taylor. - Fixed bug where contents would be duplicated on drag/drop within the same editor. - Fixed bug where floating/alignment of images on Edge wouldn't work properly. - Fixed bug where it wasn't possible to drag images on IE 11. - Fixed bug where image selection on Edge would sometimes fail. - Fixed bug where contextual toolbars icons wasn't rendered properly when using the toolbar_items_size. - Fixed bug where searchreplace dialog doesn't get prefilled with the selected text. - Fixed bug where fragmented matches wouldn't get properly replaced by the searchreplace plugin. - Fixed bug where enter key wouldn't place the caret if was after a trailing space within an inline element. - Fixed bug where the autolink plugin could produce multiple links for the same text on Gecko. - Fixed bug where EditorUpload could sometimes throw an exception if the blob wasn't found. - Fixed xss issues with media plugin not properly filtering out some script attributes. -Version 4.2.3 (2015-07-30) - Fixed bug where image selection wasn't possible on Edge due to incompatible setBaseAndExtend API. - Fixed bug where image blobs urls where not properly destroyed by the imagetools plugin. - Fixed bug where keyboard shortcuts wasn't working correctly on IE 8. - Fixed skin issue where the borders of panels where not visible on IE 8. -Version 4.2.2 (2015-07-22) - Fixed bug where float panels were not being hidden on inline editor blur when fixed_toolbar_container config option was in use. - Fixed bug where combobox states wasn't properly updated if contents where updated without keyboard. - Fixed bug where pasting into textbox or combobox would move the caret to the end of text. - Fixed bug where removal of bogus span elements before block elements would remove whitespace between nodes. - Fixed bug where repositioning of inline toolbars where async and producing errors if the editor was removed from DOM to early. Patch by iseulde. - Fixed bug where element path wasn't working correctly. Patch contributed by iseulde. - Fixed bug where menus wasn't rendered correctly when custom images where added to a menu. Patch contributed by Naim Hammadi. -Version 4.2.1 (2015-06-29) - Fixed bug where back/forward buttons in the browser would render blob images as broken images. - Fixed bug where Firefox would throw regexp to big error when replacing huge base64 chunks. - Fixed bug rendering issues with resize and context toolbars not being placed properly until next animation frame. - Fixed bug where the rendering of the image while cropping would some times not be centered correctly. - Fixed bug where listbox items with submenus would me selected as active. - Fixed bug where context menu where throwing an error when rendering. - Fixed bug where resize both option wasn't working due to resent addClass API change. Patch contributed by Jogai. - Fixed bug where a hideAll call for container rendered inline toolbars would throw an error. - Fixed bug where onclick event handler on combobox could cause issues if element.id was a function by some polluting libraries. - Fixed bug where listboxes wouldn't get proper selected sub menu item when using link_list or image_list. - Fixed so the UI controls are as wide as 4.1.x to avoid wrapping controls in toolbars. - Fixed so the imagetools dialog is adaptive for smaller screen sizes. -Version 4.2.0 (2015-06-25) - Added new flat default skin to make the UI more modern. - Added new imagetools plugin, lets you crop/resize and apply filters to images. - Added new contextual toolbars support to the API lets you add floating toolbars for specific CSS selectors. - Added new promise feature fill as tinymce.util.Promise. - Added new built in image upload feature lets you upload any base64 encoded image within the editor as files. - Fixed bug where resize handles would appear in the right position in the wrong editor when switching between resizable content in different inline editors. - Fixed bug where tables would not be inserted in inline mode due to previous float panel fix. - Fixed bug where floating panels would remain open when focus was lost on inline editors. - Fixed bug where cut command on Chrome would thrown a browser security exception. - Fixed bug where IE 11 sometimes would report an incorrect size for images in the image dialog. - Fixed bug where it wasn't possible to remove inline formatting at the end of block elements. - Fixed bug where it wasn't possible to delete table cell contents when cell selection was vertical. - Fixed bug where table cell wasn't emptied from block elements if delete/backspace where pressed in empty cell. - Fixed bug where cmd+shift+arrow didn't work correctly on Firefox mac when selecting to start/end of line. - Fixed bug where removal of bogus elements would sometimes remove whitespace between nodes. - Fixed bug where the resize handles wasn't updated when the main window was resized. - Fixed so script elements gets removed by default to prevent possible XSS issues in default config implementations. - Fixed so the UI doesn't need manual reflows when using non native layout managers. - Fixed so base64 encoded images doesn't slow down the editor on modern browsers while editing. - Fixed so all UI elements uses touch events to improve mobile device support. - Removed the touch click quirks patch for iOS since it did more harm than good. - Removed the non proportional resize handles since. Unproportional resize can still be done by holding the shift key. -Version 4.1.10 (2015-05-05) - Fixed bug where plugins loaded with compat3x would sometimes throw errors when loading using the jQuery version. - Fixed bug where extra empty paragraphs would get deleted in WebKit/Blink due to recent Quriks fix. - Fixed bug where the editor wouldn't work properly on IE 12 due to some required browser sniffing. - Fixed bug where formatting shortcut keys where interfering with Mac OS X screenshot keys. - Fixed bug where the caret wouldn't move to the next/previous line boundary on Cmd+Left/Right on Gecko. - Fixed bug where it wasn't possible to remove formats from very specific nested contents. - Fixed bug where undo levels wasn't produced when typing letters using the shift or alt+ctrl modifiers. - Fixed bug where the dirty state wasn't properly updated when typing using the shift or alt+ctrl modifiers. - Fixed bug where an error would be thrown if an autofocused editor was destroyed quickly after its initialization. Patch provided by thorn0. - Fixed issue with dirty state not being properly updated on redo operation. - Fixed issue with entity decoder not handling incorrectly written numeric entities. - Fixed issue where some PI element values wouldn't be properly encoded. -Version 4.1.9 (2015-03-10) - Fixed bug where indentation wouldn't work properly for non list elements. - Fixed bug with image plugin not pulling the image dimensions out correctly if a custom document_base_url was used. - Fixed bug where ctrl+alt+[1-9] would conflict with the AltGr+[1-9] on Windows. New shortcuts is ctrl+shift+[1-9]. - Fixed bug with removing formatting on nodes in inline mode would sometimes include nodes outside the editor body. - Fixed bug where extra nbsp:s would be inserted when you replaced a word surrounded by spaces using insertContent. - Fixed bug with pasting from Google Docs would produce extra strong elements and line feeds. -Version 4.1.8 (2015-03-05) - Added new html5 sizes attribute to img elements used together with srcset. - Added new elementpath option that makes it possible to disable the element path but keep the statusbar. - Added new option table_style_by_css for the table plugin to set table styling with css rather than table attributes. - Added new link_assume_external_targets option to prompt the user to prepend http:// prefix if the supplied link does not contain a protocol prefix. - Added new image_prepend_url option to allow a custom base path/url to be added to images. - Added new table_appearance_options option to make it possible to disable some options. - Added new image_title option to make it possible to alter the title of the image, disabled by default. - Fixed bug where selection starting from out side of the body wouldn't produce a proper selection range on IE 11. - Fixed bug where pressing enter twice before a table moves the cursor in the table and causes a javascript error. - Fixed bug where advanced image styles were not respected. - Fixed bug where the less common Shift+Delete didn't produce a proper cut operation on WebKit browsers. - Fixed bug where image/media size constrain logic would produce NaN when handling non number values. - Fixed bug where internal classes where removed by the removeformat command. - Fixed bug with creating links table cell contents with a specific selection would throw a exceptions on WebKit/Blink. - Fixed bug where valid_classes option didn't work as expected according to docs. Patch provided by thorn0. - Fixed bug where jQuery plugin would patch the internal methods multiple times. Patch provided by Drew Martin. - Fixed bug where backspace key wouldn't delete the current selection of newly formatted content. - Fixed bug where type over of inline formatting elements wouldn't properly keep the format on WebKit/Blink. - Fixed bug where selection needed to be properly normalized on modern IE versions. - Fixed bug where Command+Backspace didn't properly delete the whole line of text but the previous word. - Fixed bug where UI active states wheren't properly updated on IE if you placed caret within the current range. - Fixed bug where delete/backspace on WebKit/Blink would remove span elements created by the user. - Fixed bug where delete/backspace would produce incorrect results when deleting between two text blocks with br elements. - Fixed bug where captions where removed when pasting from MS Office. - Fixed bug where lists plugin wouldn't properly remove fully selected nested lists. - Fixed bug where the ttf font used for icons would throw an warning message on Gecko on Mac OS X. - Fixed a bug where applying a color to text did not update the undo/redo history. - Fixed so shy entities gets displayed when using the visualchars plugin. - Fixed so removeformat removes ins/del by default since these might be used for strikethough. - Fixed so multiple language packs can be loaded and added to the global I18n data structure. - Fixed so transparent color selection gets treated as a normal color selection. Patch contributed by Alexander Hofbauer. - Fixed so it's possible to disable autoresize_overflow_padding, autoresize_bottom_margin options by setting them to false. - Fixed so the charmap plugin shows the description of the character in the dialog. Patch contributed by Jelle Hissink. - Removed address from the default list of block formats since it tends to be missused. - Fixed so the pre block format is called preformatted to make it more verbose. - Fixed so it's possible to context scope translation strings this isn't needed most of the time. - Fixed so the max length of the width/height input fields of the media dialog is 5 instead of 3. - Fixed so drag/dropped contents gets properly processed by paste plugin since it's basically a paste. Patch contributed by Greg Fairbanks. - Fixed so shortcut keys for headers is ctrl+alt+[1-9] instead of ctrl+[1-9] since these are for switching tabs in the browsers. - Fixed so "u" doesn't get converted into a span element by the legacy input filter. Since this is now a valid HTML5 element. - Fixed font families in order to provide appropriate web-safe fonts. -Version 4.1.7 (2014-11-27) - Added HTML5 schema support for srcset, source and picture. Patch contributed by mattheu. - Added new cache_suffix setting to enable cache busting by producing unique urls. - Added new paste_convert_word_fake_lists option to enable users to disable the fake lists convert logic. - Fixed so advlist style changes adds undo levels for each change. - Fixed bug where WebKit would sometimes produce an exception when the autolink plugin where looking for URLs. - Fixed bug where IE 7 wouldn't be rendered properly due to aggressive css compression. - Fixed bug where DomQuery wouldn't accept window as constructor element. - Fixed bug where the color picker in 3.x dialogs wouldn't work properly. Patch contributed by Callidior. - Fixed bug where the image plugin wouldn't respect the document_base_url. - Fixed bug where the jQuery plugin would fail to append to elements named array prototype names. -Version 4.1.6 (2014-10-08) - Fixed bug with clicking on the scrollbar of the iframe would cause a JS error to be thrown. - Fixed bug where null would produce an exception if you passed it to selection.setRng. - Fixed bug where Ctrl/Cmd+Tab would indent the current list item if you switched tabs in the browser. - Fixed bug where pasting empty cells from Excel would result in a broken table. - Fixed bug where it wasn't possible to switch back to default list style type. - Fixed issue where the select all quirk fix would fire for other modifiers than Ctrl/Cmd combinations. - Replaced jake with grunt since it is more mainstream and has better plugin support. -Version 4.1.5 (2014-09-09) - Fixed bug where sometimes the resize rectangles wouldn't properly render on images on WebKit/Blink. - Fixed bug in list plugin where delete/backspace would merge empty LI elements in lists incorrectly. - Fixed bug where empty list elements would result in empty LI elements without it's parent container. - Fixed bug where backspace in empty caret formatted element could produce an type error exception of Gecko. - Fixed bug where lists pasted from word with a custom start index above 9 wouldn't be properly handled. - Fixed bug where tabfocus plugin would tab out of the editor instance even if the default action was prevented. - Fixed bug where tabfocus wouldn't tab properly to other adjacent editor instances. - Fixed bug where the DOMUtils setStyles wouldn't properly removed or update the data-mce-style attribute. - Fixed bug where dialog select boxes would be placed incorrectly if document.body wasn't statically positioned. - Fixed bug where pasting would sometimes scroll to the top of page if the user was using the autoresize plugin. - Fixed bug where caret wouldn't be properly rendered by Chrome when clicking on the iframes documentElement. - Fixed so custom images for menubutton/splitbutton can be provided. Patch contributed by Naim Hammadi. - Fixed so the default action of windows closing can be prevented by blocking the default action of the close event. - Fixed so nodeChange and focus of the editor isn't automatically performed when opening sub dialogs. -Version 4.1.4 (2014-08-21) - Added new media_filter_html option to media plugin that blocks any conditional comments, scripts etc within a video element. - Added new content_security_policy option allows you to set custom policy for iframe contents. Patch contributed by Francois Chagnon. - Fixed bug where activate/deactivate events wasn't firing properly when switching between editors. - Fixed bug where placing the caret on iOS was difficult due to a WebKit bug with touch events. - Fixed bug where the resize helper wouldn't render properly on older IE versions. - Fixed bug where resizing images inside tables on older IE versions would sometimes fail depending mouse position. - Fixed bug where editor.insertContent would produce an exception when inserting select/option elements. - Fixed bug where extra empty paragraphs would be produced if block elements where inserted inside span elements. - Fixed bug where the spellchecker menu item wouldn't be properly checked if spell checking was started before it was rendered. - Fixed bug where the DomQuery filter function wouldn't remove non elements from collection. - Fixed bug where document with custom document.domain wouldn't properly render the editor. - Fixed bug where IE 8 would throw exception when trying to enter invalid color values into colorboxes. - Fixed bug where undo manager could incorrectly add an extra undo level when custom resize handles was removed. - Fixed bug where it wouldn't be possible to alter cell properties properly on table cells on IE 8. - Fixed so the color picker button in table dialog isn't shown unless you include the colorpicker plugin or add your own custom color picker. - Fixed so activate/deactivate events fire when windowManager opens a window since. - Fixed so the table advtab options isn't separated by an underscore to normalize naming with image_advtab option. - Fixed so the table cell dialog has proper padding when the advanced tab in disabled. -Version 4.1.3 (2014-07-29) - Added event binding logic to tinymce.util.XHR making it possible to override headers and settings before any request is made. - Fixed bug where drag events wasn't fireing properly on older IE versions since the event handlers where bound to document. - Fixed bug where drag/dropping contents within the editor on IE would force the contents into plain text mode even if it was internal content. - Fixed bug where IE 7 wouldn't open menus properly due to a resize bug in the browser auto closing them immediately. - Fixed bug where the DOMUtils getPos logic wouldn't produce a valid coordinate inside the body if the body was positioned non static. - Fixed bug where the element path and format state wasn't properly updated if you had the wordcount plugin enabled. - Fixed bug where a comment at the beginning of source would produce an exception in the formatter logic. - Fixed bug where setAttrib/getAttrib on null would throw exception together with any hooked attributes like style. - Fixed bug where table sizes wasn't properly retained when copy/pasting on WebKit/Blink. - Fixed bug where WebKit/Blink would produce colors in RGB format instead of the forced HEX format when deleting contents. - Fixed bug where the width attribute wasn't updated on tables if you changed the size inside the table dialog. - Fixed bug where control selection wasn't properly handled when the caret was placed directly after an image. - Fixed bug where selecting the contents of table cells using the selection.select method wouldn't place the caret properly. - Fixed bug where the selection state for images wasn't removed when placing the caret right after an image on WebKit/Blink. - Fixed bug where all events wasn't properly unbound when and editor instance was removed or destroyed by some external innerHTML call. - Fixed bug where it wasn't possible or very hard to select images on iOS when the onscreen keyboard was visible. - Fixed so auto_focus can take a boolean argument this will auto focus the last initialized editor might be useful for single inits. - Fixed so word auto detect lists logic works better for faked lists that doesn't have specific markup. - Fixed so nodeChange gets fired on mouseup as it used to before 4.1.1 we optimized that event to fire less often. - Removed the finish menu item from spellchecker menu since it's redundant you can stop spellchecking by toggling menu item or button. -Version 4.1.2 (2014-07-15) - Added offset/grep to DomQuery class works basically the same as it's jQuery equivalent. - Fixed bug where backspace/delete or setContent with an empty string would remove header data when using the fullpage plugin. - Fixed bug where tinymce.remove with a selector not matching any editors would remove all editors. - Fixed bug where resizing of the editor didn't work since the theme was calling setStyles instead of setStyle. - Fixed bug where IE 7 would fail to append html fragments to iframe document when using DomQuery. - Fixed bug where the getStyle DOMUtils method would produce an exception if it was called with null as it's element. - Fixed bug where the paste plugin would remove the element if the none of the paste_webkit_styles rules matched the current style. - Fixed bug where contextmenu table items wouldn't work properly on IE since it would some times fire an incorrect selection change. - Fixed bug where the padding/border values wasn't used in the size calculation for the body size when using autoresize. Patch contributed by Matt Whelan. - Fixed bug where conditional word comments wouldn't be properly removed when pasting plain text. - Fixed bug where resizing would sometime fail on IE 11 when the mouseup occurred inside the resizable element. - Fixed so the iframe gets initialized without any inline event handlers for better CSP support. Patch contributed by Matt Whelan. - Fixed so the tinymce.dom.Sizzle is the latest version of sizzle this resolves the document context bug. -Version 4.1.1 (2014-07-08) - Fixed bug where pasting plain text on some WebKit versions would result in an empty line. - Fixed bug where resizing images inside tables on IE 11 wouldn't work properly. - Fixed bug where IE 11 would sometimes throw "Invalid argument" exception when editor contents was set to an empty string. - Fixed bug where document.activeElement would throw exceptions on IE 9 when that element was hidden or removed from dom. - Fixed bug where WebKit/Blink sometimes produced br elements with the Apple-interchange-newline class. - Fixed bug where table cell selection wasn't properly removed when copy/pasting table cells. - Fixed bug where pasting nested list items from Word wouldn't produce proper semantic nested lists. - Fixed bug where right clicking using the contextmenu plugin on WebKit/Blink on Mac OS X would select the target current word or line. - Fixed bug where it wasn't possible to alter table cell properties on IE 8 using the context menu. - Fixed bug where the resize helper wouldn't be correctly positioned on older IE versions. - Fixed bug where fullpage plugin would produce an error if you didn't specify a doctype encoding. - Fixed bug where anchor plugin would get the name/id of the current element even if it wasn't anchor element. - Fixed bug where visual aids for tables wouldn't be properly disabled when changing the border size. - Fixed bug where some control selection events wasn't properly fired on older IE versions. - Fixed bug where table cell selection on older IE versions would prevent resizing of images. - Fixed bug with paste_data_images paste option not working properly on modern IE versions. - Fixed bug where custom elements with underscores in the name wasn't properly parsed/serialized. - Fixed bug where applying inline formats to nested list elements would produce an incorrect formatting result. - Fixed so it's possible to hide items from elements path by using preventDefault/stopPropagation. - Fixed so inline mode toolbar gets rendered right aligned if the editable element positioned to the documents right edge. - Fixed so empty inline elements inside empty block elements doesn't get removed if configured to be kept intact. - Fixed so DomQuery parentsUntil/prevUntil/nextUntil supports selectors/elements/filters etc. - Fixed so legacyoutput plugin overrides fontselect and fontsizeselect controls and handles font elements properly. -Version 4.1.0 (2014-06-18) - Added new file_picker_callback option to replace the old file_browser_callback the latter will still work though. - Added new custom colors to textcolor plugin will be displayed if a color picker is provided also shows the latest colors. - Added new color_picker_callback option to enable you to add custom color pickers to the editor. - Added new advanced tabs to table/cell/row dialogs to enable you to select colors for border/background. - Added new colorpicker plugin that lets you select colors from a hsv color picker. - Added new tinymce.util.Color class to handle color parsing and converting. - Added new colorpicker UI widget element lets you add a hsv color picker to any form/window. - Added new textpattern plugin that allows you to use markdown like text patterns to format contents. - Added new resize helper element that shows the current width & height while resizing. - Added new "once" method to Editor and EventDispatcher enables since callback execution events. - Added new jQuery like class under tinymce.dom.DomQuery it's exposed on editor instances (editor.$) and globally under (tinymce.$). - Fixed so the default resize method for images are proportional shift/ctrl can be used to make an unproportional size. - Fixed bug where the image_dimensions option of the image plugin would cause exceptions when it tried to update the size. - Fixed bug where table cell dialog class field wasn't properly updated when editing an a table cell with an existing class. - Fixed bug where Safari on Mac would produce webkit-fake-url for pasted images so these are now removed. - Fixed bug where the nodeChange event would get fired before the selection was changed when clicking inside the current selection range. - Fixed bug where valid_classes option would cause exception when it removed internal prefixed classes like mce-item-. - Fixed bug where backspace would cause navigation in IE 8 on an inline element and after a caret formatting was applied. - Fixed so placeholder images produced by the media plugin gets selected when inserted/edited. - Fixed so it's possible to drag in images when the paste_data_images option is enabled. Might be useful for mail clients. - Fixed so images doesn't get a width/height applied if the image_dimensions option is set to false useful for responsive contents. - Fixed so it's possible to pass in an optional arguments object for the nodeChanged function to be passed to all nodechange event listeners. - Fixed bug where media plugin embed code didn't update correctly. diff --git a/app/static/vendors/tinymce/js/tinymce/jquery.tinymce.min.js b/app/static/vendors/tinymce/js/tinymce/jquery.tinymce.min.js deleted file mode 100644 index 5a6ef56..0000000 --- a/app/static/vendors/tinymce/js/tinymce/jquery.tinymce.min.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -/** - * Jquery integration plugin. - * - * @class tinymce.core.JqueryIntegration - * @private - */ -!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;function v(){ -// Reference to tinymce needs to be lazily evaluated since tinymce -// might be loaded through the compressor or other means -return d.tinymce}p.fn.tinymce=function(o){var e,t,i,l=this,r=""; -// No match then just ignore the call -if(!l.length)return l; -// Get editor instance -if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");function n(){var a=[],c=0; -// Apply patches to the jQuery object, only once -u||(m(),u=!0), -// Create an editor instance for each matched node -l.each(function(e,t){var n,i=t.id,r=o.oninit; -// Generate unique id for target element if needed -i||(t.id=i=v().DOM.uniqueId()), -// Only init the editor once -v().get(i)||( -// Create editor instance and render it -n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""), -// Run this if the oninit setting is defined -// this logic will fire the oninit callback ones each -// matched editor instance is initialized -r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)), -// Call the oninit function with the object -t.apply(e||v(),a))}))}), -// Render the editor instances in a separate loop since we -// need to have the full editors array used in the onInit calls -p.each(a,function(e,t){t.render()})} -// Load TinyMCE on demand, if we need to -if(d.tinymce||c||!(e=o.script_url)) -// Delay the init call until tinymce is loaded -1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")), -// Check if it's a dev/src version they want to load then -// make sure that all plugins, themes etc are loaded in source mode as well --1!=e.indexOf(".min")&&(r=".min"), -// Setup tinyMCEPreInit object this will later be used by the TinyMCE -// core script to locate other resources like CSS files, dialogs etc -// You can also predefined a tinyMCEPreInit object and then it will use that instead -d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r}, -// url contains gzip then we assume it's a compressor --1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""), -// Check if compressor script is already loaded otherwise setup a basic one -d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){function n(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))} -// Add core languages -n("langs/"+i+".js"), -// Add themes with languages -n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"), -// Add plugins with languages -p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.readyState)||(v().dom.Event.domLoaded=1,c=2, -// Execute callback after mainscript has been loaded and before the initialization occurs -o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l}, -// Add :tinymce pseudo selector this will select elements that has been converted into editor instances -// it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements. -p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}}); -// This function patches internal jQuery functions so that if -// you for example remove an div element containing an editor it's -// automatically destroyed by the TinyMCE API -var m=function(){function r(e){ -// If the function is remove -"remove"===e&&this.each(function(e,t){var n=u(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})}function o(i){var e,t=this; -// Handle set value -/*jshint eqnull:true */if(null!=i)r.call(t), -// Saves the contents before get/set value of textarea/div -t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}), -// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe -p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return l(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=u(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}), -// Makes sure that the editor instance gets properly destroyed when the parent element is removed -p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr, -// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents -p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!l(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;// return original set for chaining -var r=n[0],a=u(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}(); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/langs/de.js b/app/static/vendors/tinymce/js/tinymce/langs/de.js deleted file mode 100644 index f7a5b00..0000000 --- a/app/static/vendors/tinymce/js/tinymce/langs/de.js +++ /dev/null @@ -1,389 +0,0 @@ -tinymce.addI18n('de',{ -"Redo": "Wiederholen", -"Undo": "R\u00fcckg\u00e4ngig machen", -"Cut": "Ausschneiden", -"Copy": "Kopieren", -"Paste": "Einf\u00fcgen", -"Select all": "Alles ausw\u00e4hlen", -"New document": "Neues Dokument", -"Ok": "Ok", -"Cancel": "Abbrechen", -"Visual aids": "Visuelle Hilfen", -"Bold": "Fett", -"Italic": "Kursiv", -"Underline": "Unterstrichen", -"Strikethrough": "Durchgestrichen", -"Superscript": "Hochgestellt", -"Subscript": "Tiefgestellt", -"Clear formatting": "Formatierung entfernen", -"Align left": "Linksb\u00fcndig ausrichten", -"Align center": "Zentrieren", -"Align right": "Rechtsb\u00fcndig ausrichten", -"Justify": "Blocksatz", -"Bullet list": "Aufz\u00e4hlung", -"Numbered list": "Nummerierte Liste", -"Decrease indent": "Einzug verkleinern", -"Increase indent": "Einzug vergr\u00f6\u00dfern", -"Close": "Schlie\u00dfen", -"Formats": "Formate", -"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Ihr Browser unterst\u00fctzt leider keinen direkten Zugriff auf die Zwischenablage. Bitte benutzen Sie die Tastenkombinationen Strg+X\/C\/V.", -"Headers": "\u00dcberschriften", -"Header 1": "\u00dcberschrift 1", -"Header 2": "\u00dcberschrift 2", -"Header 3": "\u00dcberschrift 3", -"Header 4": "\u00dcberschrift 4", -"Header 5": "\u00dcberschrift 5", -"Header 6": "\u00dcberschrift 6", -"Headings": "\u00dcberschriften", -"Heading 1": "Kopfzeile 1", -"Heading 2": "Kopfzeile 2", -"Heading 3": "Kopfzeile 3", -"Heading 4": "Kopfzeile 4", -"Heading 5": "Kopfzeile 5", -"Heading 6": "Kopfzeile 6", -"Preformatted": "Vorformatiert", -"Div": "Div", -"Pre": "Pre", -"Code": "Code", -"Paragraph": "Absatz", -"Blockquote": "Blockquote", -"Inline": "Zeichenformate", -"Blocks": "Bl\u00f6cke", -"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Einf\u00fcgen ist nun im einfachen Textmodus. Inhalte werden ab jetzt als unformatierter Text eingef\u00fcgt, bis Sie diese Einstellung wieder ausschalten!", -"Fonts": "Schriftarten", -"Font Sizes": "Schriftgr\u00f6\u00dfe", -"Class": "Klasse", -"Browse for an image": "Bild...", -"OR": "ODER", -"Drop an image here": "Bild hier ablegen", -"Upload": "Hochladen", -"Block": "Blocksatz", -"Align": "Ausrichten", -"Default": "Standard", -"Circle": "Kreis", -"Disc": "Punkt", -"Square": "Quadrat", -"Lower Alpha": "Kleinbuchstaben", -"Lower Greek": "Griechische Kleinbuchstaben", -"Lower Roman": "R\u00f6mische Zahlen (Kleinbuchstaben)", -"Upper Alpha": "Gro\u00dfbuchstaben", -"Upper Roman": "R\u00f6mische Zahlen (Gro\u00dfbuchstaben)", -"Anchor...": "Textmarke", -"Name": "Name", -"Id": "Kennung", -"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "Die Kennung sollte mit einem Buchstaben anfangen. Nachfolgend nur Buchstaben, Zahlen, Striche (Minus), Punkte, Kommas und Unterstriche.", -"You have unsaved changes are you sure you want to navigate away?": "Die \u00c4nderungen wurden noch nicht gespeichert, sind Sie sicher, dass Sie diese Seite verlassen wollen?", -"Restore last draft": "Letzten Entwurf wiederherstellen", -"Special characters...": "Sonderzeichen...", -"Source code": "Quelltext", -"Insert\/Edit code sample": "Codebeispiel einf\u00fcgen\/bearbeiten", -"Language": "Sprache", -"Code sample...": "Codebeispiel...", -"Color Picker": "Farbwahl", -"R": "R", -"G": "G", -"B": "B", -"Left to right": "Von links nach rechts", -"Right to left": "Von rechts nach links", -"Emoticons...": "Emoticons...", -"Metadata and Document Properties": "Dokument-Eigenschaften und -Metadaten", -"Title": "Titel", -"Keywords": "Sch\u00fcsselw\u00f6rter", -"Description": "Beschreibung", -"Robots": "Robots", -"Author": "Verfasser", -"Encoding": "Zeichenkodierung", -"Fullscreen": "Vollbild", -"Action": "Aktion", -"Shortcut": "Shortcut", -"Help": "Hilfe", -"Address": "Adresse", -"Focus to menubar": "Fokus auf Men\u00fcleiste", -"Focus to toolbar": "Fokus auf Werkzeugleiste", -"Focus to element path": "Fokus auf Elementpfad", -"Focus to contextual toolbar": "Fokus auf kontextbezogene Werkzeugleiste", -"Insert link (if link plugin activated)": "Link einf\u00fcgen (wenn Link-Plugin aktiviert ist)", -"Save (if save plugin activated)": "Speichern (wenn Save-Plugin aktiviert ist)", -"Find (if searchreplace plugin activated)": "Suchen einf\u00fcgen (wenn Suchen\/Ersetzen-Plugin aktiviert ist)", -"Plugins installed ({0}):": "installierte Plugins ({0}):", -"Premium plugins:": "Premium Plugins:", -"Learn more...": "Erfahren Sie mehr dazu...", -"You are using {0}": "Sie verwenden {0}", -"Plugins": "Plugins", -"Handy Shortcuts": "Praktische Tastenkombinationen", -"Horizontal line": "Horizontale Linie", -"Insert\/edit image": "Bild einf\u00fcgen\/bearbeiten", -"Image description": "Bildbeschreibung", -"Source": "Quelle", -"Dimensions": "Abmessungen", -"Constrain proportions": "Seitenverh\u00e4ltnis beibehalten", -"General": "Allgemein", -"Advanced": "Erweitert", -"Style": "Stil", -"Vertical space": "Vertikaler Abstand", -"Horizontal space": "Horizontaler Abstand", -"Border": "Rahmen", -"Insert image": "Bild einf\u00fcgen", -"Image...": "Bild...", -"Image list": "Bildliste", -"Rotate counterclockwise": "Gegen den Uhrzeigersinn drehen", -"Rotate clockwise": "Im Uhrzeigersinn drehen", -"Flip vertically": "Vertikal spiegeln", -"Flip horizontally": "Horizontal spiegeln", -"Edit image": "Bild bearbeiten", -"Image options": "Bildeigenschaften", -"Zoom in": "Ansicht vergr\u00f6\u00dfern", -"Zoom out": "Ansicht verkleinern", -"Crop": "Bescheiden", -"Resize": "Skalieren", -"Orientation": "Ausrichtung", -"Brightness": "Helligkeit", -"Sharpen": "Sch\u00e4rfen", -"Contrast": "Kontrast", -"Color levels": "Farbwerte", -"Gamma": "Gamma", -"Invert": "Invertieren", -"Apply": "Anwenden", -"Back": "Zur\u00fcck", -"Insert date\/time": "Datum\/Uhrzeit einf\u00fcgen ", -"Date\/time": "Datum\/Uhrzeit", -"Insert\/Edit Link": "Link einf\u00fcgen\/bearbeiten", -"Insert\/edit link": "Link einf\u00fcgen\/bearbeiten", -"Text to display": "Anzuzeigender Text", -"Url": "URL", -"Open link in...": "Link \u00f6ffnen in...", -"Current window": "Aktuelles Fenster", -"None": "Keine", -"New window": "Neues Fenster", -"Remove link": "Link entfernen", -"Anchors": "Textmarken", -"Link...": "Link...", -"Paste or type a link": "Link einf\u00fcgen oder eintippen", -"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?", -"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http:\/\/\" voranstellen?", -"Link list": "Linkliste", -"Insert video": "Video einf\u00fcgen", -"Insert\/edit video": "Video einf\u00fcgen\/bearbeiten", -"Insert\/edit media": "Medien einf\u00fcgen\/bearbeiten", -"Alternative source": "Alternative Quelle", -"Alternative source URL": "URL der alternativen Quelle", -"Media poster (Image URL)": "Medienposter (Bild-URL)", -"Paste your embed code below:": "F\u00fcgen Sie Ihren Einbettungscode hier ein:", -"Embed": "Einbetten", -"Media...": "Medien...", -"Nonbreaking space": "Gesch\u00fctztes Leerzeichen", -"Page break": "Seitenumbruch", -"Paste as text": "Als Text einf\u00fcgen", -"Preview": "Vorschau", -"Print...": "Drucken...", -"Save": "Speichern", -"Find": "Suchen", -"Replace with": "Ersetzen durch", -"Replace": "Ersetzen", -"Replace all": "Alles ersetzen", -"Previous": "Vorherige", -"Next": "Weiter", -"Find and replace...": "Suchen und ersetzen...", -"Could not find the specified string.": "Die Zeichenfolge wurde nicht gefunden.", -"Match case": "Gro\u00df-\/Kleinschreibung beachten", -"Find whole words only": "Nur ganze W\u00f6rter suchen", -"Spell check": "Rechschreibpr\u00fcfung", -"Ignore": "Ignorieren", -"Ignore all": "Alles Ignorieren", -"Finish": "Ende", -"Add to Dictionary": "Zum W\u00f6rterbuch hinzuf\u00fcgen", -"Insert table": "Tabelle einf\u00fcgen", -"Table properties": "Tabelleneigenschaften", -"Delete table": "Tabelle l\u00f6schen", -"Cell": "Zelle", -"Row": "Zeile", -"Column": "Spalte", -"Cell properties": "Zelleneigenschaften", -"Merge cells": "Zellen verbinden", -"Split cell": "Zelle aufteilen", -"Insert row before": "Neue Zeile davor einf\u00fcgen ", -"Insert row after": "Neue Zeile danach einf\u00fcgen", -"Delete row": "Zeile l\u00f6schen", -"Row properties": "Zeileneigenschaften", -"Cut row": "Zeile ausschneiden", -"Copy row": "Zeile kopieren", -"Paste row before": "Zeile davor einf\u00fcgen", -"Paste row after": "Zeile danach einf\u00fcgen", -"Insert column before": "Neue Spalte davor einf\u00fcgen", -"Insert column after": "Neue Spalte danach einf\u00fcgen", -"Delete column": "Spalte l\u00f6schen", -"Cols": "Spalten", -"Rows": "Zeilen", -"Width": "Breite", -"Height": "H\u00f6he", -"Cell spacing": "Zellenabstand", -"Cell padding": "Zelleninnenabstand", -"Show caption": "Beschriftung anzeigen", -"Left": "Linksb\u00fcndig", -"Center": "Zentriert", -"Right": "Rechtsb\u00fcndig", -"Cell type": "Zellentyp", -"Scope": "G\u00fcltigkeitsbereich", -"Alignment": "Ausrichtung", -"H Align": "Horizontale Ausrichtung", -"V Align": "Vertikale Ausrichtung", -"Top": "Oben", -"Middle": "Mitte", -"Bottom": "Unten", -"Header cell": "Kopfzelle", -"Row group": "Zeilengruppe", -"Column group": "Spaltengruppe", -"Row type": "Zeilentyp", -"Header": "Kopfzeile", -"Body": "Inhalt", -"Footer": "Fu\u00dfzeile", -"Border color": "Rahmenfarbe", -"Insert template...": "Vorlage einf\u00fcgen...", -"Templates": "Vorlagen", -"Template": "Vorlage", -"Text color": "Textfarbe", -"Background color": "Hintergrundfarbe", -"Custom...": "Benutzerdefiniert...", -"Custom color": "Benutzerdefinierte Farbe", -"No color": "Keine Farbe", -"Remove color": "Farbauswahl aufheben", -"Table of Contents": "Inhaltsverzeichnis", -"Show blocks": "Bl\u00f6cke anzeigen", -"Show invisible characters": "Unsichtbare Zeichen anzeigen", -"Word count": "Anzahl der W\u00f6rter", -"Words: {0}": "W\u00f6rter: {0}", -"{0} words": "{0} W\u00f6rter", -"File": "Datei", -"Edit": "Bearbeiten", -"Insert": "Einf\u00fcgen", -"View": "Ansicht", -"Format": "Format", -"Table": "Tabelle", -"Tools": "Werkzeuge", -"Powered by {0}": "Betrieben von {0}", -"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich-Text- Area. Dr\u00fccken Sie ALT-F9 f\u00fcr das Men\u00fc. Dr\u00fccken Sie ALT-F10 f\u00fcr Symbolleiste. Dr\u00fccken Sie ALT-0 f\u00fcr Hilfe", -"Image title": "Bildtitel", -"Border width": "Rahmenbreite", -"Border style": "Rahmenstil", -"Error": "Fehler", -"Warn": "Warnung", -"Valid": "G\u00fcltig", -"To open the popup, press Shift+Enter": "Dr\u00fccken Sie Umschalt+Eingabe, um das Popup-Fenster zu \u00f6ffnen.", -"Rich Text Area. Press ALT-0 for help.": "Rich-Text-Bereich. Dr\u00fccken Sie Alt+0 f\u00fcr Hilfe.", -"System Font": "Betriebssystemschriftart", -"Failed to upload image: {0}": "Bild konnte nicht hochgeladen werden: {0}", -"Failed to load plugin: {0} from url {1}": "Plugin konnte nicht geladen werden: {0} von URL {1}", -"Failed to load plugin url: {0}": "Plugin-URL konnte nicht geladen werden: {0}", -"Failed to initialize plugin: {0}": "Plugin konnte nicht initialisiert werden: {0}", -"example": "Beispiel", -"Search": "Suchen", -"All": "Alles", -"Currency": "W\u00e4hrung", -"Text": "Text", -"Quotations": "Anf\u00fchrungszeichen", -"Mathematical": "Mathematisch", -"Extended Latin": "Erweitertes Latein", -"Symbols": "Symbole", -"Arrows": "Pfeile", -"User Defined": "Benutzerdefiniert", -"dollar sign": "Dollarzeichen", -"currency sign": "W\u00e4hrungssymbol", -"euro-currency sign": "Eurozeichen", -"colon sign": "Doppelpunkt", -"cruzeiro sign": "Cruzeirozeichen", -"french franc sign": "Franczeichen", -"lira sign": "Lirezeichen", -"mill sign": "Millzeichen", -"naira sign": "Nairazeichen", -"peseta sign": "Pesetazeichen", -"rupee sign": "Rupiezeichen", -"won sign": "Wonzeichen", -"new sheqel sign": "Schekelzeichen", -"dong sign": "Dongzeichen", -"kip sign": "Kipzeichen", -"tugrik sign": "Tugrikzeichen", -"drachma sign": "Drachmezeichen", -"german penny symbol": "Pfennigzeichen", -"peso sign": "Pesozeichen", -"guarani sign": "Guaranizeichen", -"austral sign": "Australzeichen", -"hryvnia sign": "Hrywnjazeichen", -"cedi sign": "Cedizeichen", -"livre tournois sign": "Livrezeichen", -"spesmilo sign": "Spesmilozeichen", -"tenge sign": "Tengezeichen", -"indian rupee sign": "Indisches Rupiezeichen", -"turkish lira sign": "T\u00fcrkisches Lirazeichen", -"nordic mark sign": "Zeichen nordische Mark", -"manat sign": "Manatzeichen", -"ruble sign": "Rubelzeichen", -"yen character": "Yenzeichen", -"yuan character": "Yuanzeichen", -"yuan character, in hong kong and taiwan": "Yuanzeichen in Hongkong und Taiwan", -"yen\/yuan character variant one": "Yen-\/Yuanzeichen Variante 1", -"Loading emoticons...": "Emoticons werden geladen...", -"Could not load emoticons": "Emoticons konnten nicht geladen werden", -"People": "Menschen", -"Animals and Nature": "Tiere und Natur", -"Food and Drink": "Essen und Trinken", -"Activity": "Aktivit\u00e4t", -"Travel and Places": "Reisen und Orte", -"Objects": "Objekte", -"Flags": "Flaggen", -"Characters": "Zeichen", -"Characters (no spaces)": "Zeichen (ohne Leerzeichen)", -"Error: Form submit field collision.": "Fehler: Kollision der Formularbest\u00e4tigungsfelder.", -"Error: No form element found.": "Fehler: Kein Formularelement gefunden.", -"Update": "Aktualisieren", -"Color swatch": "Farbpalette", -"Turquoise": "T\u00fcrkis", -"Green": "Gr\u00fcn", -"Blue": "Blau", -"Purple": "Violett", -"Navy Blue": "Marineblau", -"Dark Turquoise": "Dunkelt\u00fcrkis", -"Dark Green": "Dunkelgr\u00fcn", -"Medium Blue": "Mittleres Blau", -"Medium Purple": "Mittelviolett", -"Midnight Blue": "Mitternachtsblau", -"Yellow": "Gelb", -"Orange": "Orange", -"Red": "Rot", -"Light Gray": "Hellgrau", -"Gray": "Grau", -"Dark Yellow": "Dunkelgelb", -"Dark Orange": "Dunkelorange", -"Dark Red": "Dunkelrot", -"Medium Gray": "Mittelgrau", -"Dark Gray": "Dunkelgrau", -"Black": "Schwarz", -"White": "Wei\u00df", -"Switch to or from fullscreen mode": "Vollbildmodus umschalten", -"Open help dialog": "Hilfe-Dialog \u00f6ffnen", -"history": "Historie", -"styles": "Stile", -"formatting": "Formatierung", -"alignment": "Ausrichtung", -"indentation": "Einr\u00fcckungen", -"permanent pen": "Textmarker", -"comments": "Anmerkungen", -"Anchor": "Textmarke", -"Special character": "Sonderzeichen", -"Code sample": "Codebeispiel", -"Color": "Farbe", -"Emoticons": "Emoticons", -"Document properties": "Dokumenteigenschaften", -"Image": "Bild", -"Insert link": "Link einf\u00fcgen", -"Target": "Ziel", -"Link": "Link", -"Poster": "Poster", -"Media": "Medium", -"Print": "Drucken", -"Prev": "Zur\u00fcck", -"Find and replace": "Suchen und ersetzen", -"Whole words": "Nur ganze W\u00f6rter", -"Spellcheck": "Rechtschreibpr\u00fcfung", -"Caption": "Beschriftung", -"Insert template": "Vorlage einf\u00fcgen " -}); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/langs/fr_FR.js b/app/static/vendors/tinymce/js/tinymce/langs/fr_FR.js deleted file mode 100644 index 2d074f8..0000000 --- a/app/static/vendors/tinymce/js/tinymce/langs/fr_FR.js +++ /dev/null @@ -1,389 +0,0 @@ -tinymce.addI18n('fr_FR',{ -"Redo": "R\u00e9tablir", -"Undo": "Annuler", -"Cut": "Couper", -"Copy": "Copier", -"Paste": "Coller", -"Select all": "S\u00e9lectionner tout", -"New document": "Nouveau document", -"Ok": "OK", -"Cancel": "Annuler", -"Visual aids": "Aides visuelles", -"Bold": "Gras", -"Italic": "Italique", -"Underline": "Soulign\u00e9", -"Strikethrough": "Barr\u00e9", -"Superscript": "Exposant", -"Subscript": "Indice", -"Clear formatting": "Effacer la mise en forme", -"Align left": "Aligner \u00e0 gauche", -"Align center": "Centrer", -"Align right": "Aligner \u00e0 droite", -"Justify": "Justifier", -"Bullet list": "Liste \u00e0 puces", -"Numbered list": "Liste num\u00e9rot\u00e9e", -"Decrease indent": "R\u00e9duire le retrait", -"Increase indent": "Augmenter le retrait", -"Close": "Fermer", -"Formats": "Formats", -"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Votre navigateur ne supporte pas l\u2019acc\u00e8s direct au presse-papiers. Merci d'utiliser les raccourcis clavier Ctrl+X\/C\/V.", -"Headers": "En-t\u00eates", -"Header 1": "En-t\u00eate 1", -"Header 2": "En-t\u00eate 2", -"Header 3": "En-t\u00eate 3", -"Header 4": "En-t\u00eate 4", -"Header 5": "En-t\u00eate 5", -"Header 6": "En-t\u00eate 6", -"Headings": "Titres", -"Heading 1": "Titre\u00a01", -"Heading 2": "Titre\u00a02", -"Heading 3": "Titre\u00a03", -"Heading 4": "Titre\u00a04", -"Heading 5": "Titre\u00a05", -"Heading 6": "Titre\u00a06", -"Preformatted": "Pr\u00e9format\u00e9", -"Div": "Div", -"Pre": "Pre", -"Code": "Code", -"Paragraph": "Paragraphe", -"Blockquote": "Blockquote", -"Inline": "En ligne", -"Blocks": "Blocs", -"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Le presse-papiers est maintenant en mode \"texte plein\". Les contenus seront coll\u00e9s sans retenir les formatages jusqu'\u00e0 ce que vous d\u00e9sactiviez cette option.", -"Fonts": "Polices", -"Font Sizes": "Tailles de police", -"Class": "Classe", -"Browse for an image": "Rechercher une image", -"OR": "OU", -"Drop an image here": "D\u00e9poser une image ici", -"Upload": "T\u00e9l\u00e9charger", -"Block": "Bloc", -"Align": "Aligner", -"Default": "Par d\u00e9faut", -"Circle": "Cercle", -"Disc": "Disque", -"Square": "Carr\u00e9", -"Lower Alpha": "Alpha minuscule", -"Lower Greek": "Grec minuscule", -"Lower Roman": "Romain minuscule", -"Upper Alpha": "Alpha majuscule", -"Upper Roman": "Romain majuscule", -"Anchor...": "Ancre...", -"Name": "Nom", -"Id": "Id", -"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "L'Id doit commencer par une lettre suivi par des lettres, nombres, tirets, points, deux-points ou underscores", -"You have unsaved changes are you sure you want to navigate away?": "Vous avez des modifications non enregistr\u00e9es, \u00eates-vous s\u00fbr de quitter la page?", -"Restore last draft": "Restaurer le dernier brouillon", -"Special characters...": "Caract\u00e8res sp\u00e9ciaux...", -"Source code": "Code source", -"Insert\/Edit code sample": "Ins\u00e9rer \/ modifier une exemple de code", -"Language": "Langue", -"Code sample...": "Exemple de code...", -"Color Picker": "S\u00e9lecteur de couleurs", -"R": "R", -"G": "V", -"B": "B", -"Left to right": "Gauche \u00e0 droite", -"Right to left": "Droite \u00e0 gauche", -"Emoticons...": "\u00c9motic\u00f4nes...", -"Metadata and Document Properties": "M\u00e9tadonn\u00e9es et propri\u00e9t\u00e9s du document", -"Title": "Titre", -"Keywords": "Mots-cl\u00e9s", -"Description": "Description", -"Robots": "Robots", -"Author": "Auteur", -"Encoding": "Encodage", -"Fullscreen": "Plein \u00e9cran", -"Action": "Action", -"Shortcut": "Raccourci", -"Help": "Aide", -"Address": "Adresse", -"Focus to menubar": "Cibler la barre de menu", -"Focus to toolbar": "Cibler la barre d'outils", -"Focus to element path": "Cibler le chemin vers l'\u00e9l\u00e9ment", -"Focus to contextual toolbar": "Cibler la barre d'outils contextuelle", -"Insert link (if link plugin activated)": "Ins\u00e9rer un lien (si le module link est activ\u00e9)", -"Save (if save plugin activated)": "Enregistrer (si le module save est activ\u00e9)", -"Find (if searchreplace plugin activated)": "Rechercher (si le module searchreplace est activ\u00e9)", -"Plugins installed ({0}):": "Modules install\u00e9s ({0}) : ", -"Premium plugins:": "Modules premium :", -"Learn more...": "En savoir plus...", -"You are using {0}": "Vous utilisez {0}", -"Plugins": "Plugins", -"Handy Shortcuts": "Raccourcis utiles", -"Horizontal line": "Ligne horizontale", -"Insert\/edit image": "Ins\u00e9rer\/modifier une image", -"Image description": "Description de l'image", -"Source": "Source", -"Dimensions": "Dimensions", -"Constrain proportions": "Conserver les proportions", -"General": "G\u00e9n\u00e9ral", -"Advanced": "Avanc\u00e9", -"Style": "Style", -"Vertical space": "Espacement vertical", -"Horizontal space": "Espacement horizontal", -"Border": "Bordure", -"Insert image": "Ins\u00e9rer une image", -"Image...": "Image...", -"Image list": "Liste d'images", -"Rotate counterclockwise": "Rotation anti-horaire", -"Rotate clockwise": "Rotation horaire", -"Flip vertically": "Retournement vertical", -"Flip horizontally": "Retournement horizontal", -"Edit image": "Modifier l'image", -"Image options": "Options de l'image", -"Zoom in": "Zoomer", -"Zoom out": "D\u00e9zoomer", -"Crop": "Rogner", -"Resize": "Redimensionner", -"Orientation": "Orientation", -"Brightness": "Luminosit\u00e9", -"Sharpen": "Affiner", -"Contrast": "Contraste", -"Color levels": "Niveaux de couleur", -"Gamma": "Gamma", -"Invert": "Inverser", -"Apply": "Appliquer", -"Back": "Retour", -"Insert date\/time": "Ins\u00e9rer date\/heure", -"Date\/time": "Date\/heure", -"Insert\/Edit Link": "Ins\u00e9rer\/Modifier lien", -"Insert\/edit link": "Ins\u00e9rer\/modifier un lien", -"Text to display": "Texte \u00e0 afficher", -"Url": "Url", -"Open link in...": "Ouvrir le lien dans...", -"Current window": "Fen\u00eatre active", -"None": "n\/a", -"New window": "Nouvelle fen\u00eatre", -"Remove link": "Enlever le lien", -"Anchors": "Ancres", -"Link...": "Lien...", -"Paste or type a link": "Coller ou taper un lien", -"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre une adresse e-mail. Voulez-vous ajouter le pr\u00e9fixe mailto: n\u00e9cessaire?", -"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre un lien externe. Voulez-vous ajouter le pr\u00e9fixe http:\/\/ n\u00e9cessaire?", -"Link list": "Liste de liens", -"Insert video": "Ins\u00e9rer une vid\u00e9o", -"Insert\/edit video": "Ins\u00e9rer\/modifier une vid\u00e9o", -"Insert\/edit media": "Ins\u00e9rer\/modifier un m\u00e9dia", -"Alternative source": "Source alternative", -"Alternative source URL": "URL de la source alternative", -"Media poster (Image URL)": "Affiche de m\u00e9dia (URL de l'image)", -"Paste your embed code below:": "Collez votre code d'int\u00e9gration ci-dessous :", -"Embed": "Int\u00e9grer", -"Media...": "M\u00e9dia...", -"Nonbreaking space": "Espace ins\u00e9cable", -"Page break": "Saut de page", -"Paste as text": "Coller comme texte", -"Preview": "Pr\u00e9visualiser", -"Print...": "Imprimer...", -"Save": "Enregistrer", -"Find": "Chercher", -"Replace with": "Remplacer par", -"Replace": "Remplacer", -"Replace all": "Tout remplacer", -"Previous": "Pr\u00e9c\u00e9dente", -"Next": "Suiv", -"Find and replace...": "Trouver et remplacer...", -"Could not find the specified string.": "Impossible de trouver la cha\u00eene sp\u00e9cifi\u00e9e.", -"Match case": "Respecter la casse", -"Find whole words only": "Mot entier", -"Spell check": "V\u00e9rification de l'orthographe", -"Ignore": "Ignorer", -"Ignore all": "Tout ignorer", -"Finish": "Finie", -"Add to Dictionary": "Ajouter au dictionnaire", -"Insert table": "Ins\u00e9rer un tableau", -"Table properties": "Propri\u00e9t\u00e9s du tableau", -"Delete table": "Supprimer le tableau", -"Cell": "Cellule", -"Row": "Ligne", -"Column": "Colonne", -"Cell properties": "Propri\u00e9t\u00e9s de la cellule", -"Merge cells": "Fusionner les cellules", -"Split cell": "Diviser la cellule", -"Insert row before": "Ins\u00e9rer une ligne avant", -"Insert row after": "Ins\u00e9rer une ligne apr\u00e8s", -"Delete row": "Effacer la ligne", -"Row properties": "Propri\u00e9t\u00e9s de la ligne", -"Cut row": "Couper la ligne", -"Copy row": "Copier la ligne", -"Paste row before": "Coller la ligne avant", -"Paste row after": "Coller la ligne apr\u00e8s", -"Insert column before": "Ins\u00e9rer une colonne avant", -"Insert column after": "Ins\u00e9rer une colonne apr\u00e8s", -"Delete column": "Effacer la colonne", -"Cols": "Colonnes", -"Rows": "Lignes", -"Width": "Largeur", -"Height": "Hauteur", -"Cell spacing": "Espacement inter-cellulles", -"Cell padding": "Espacement interne cellule", -"Show caption": "Afficher le sous-titrage", -"Left": "Gauche", -"Center": "Centr\u00e9", -"Right": "Droite", -"Cell type": "Type de cellule", -"Scope": "Etendue", -"Alignment": "Alignement", -"H Align": "Alignement H", -"V Align": "Alignement V", -"Top": "Haut", -"Middle": "Milieu", -"Bottom": "Bas", -"Header cell": "Cellule d'en-t\u00eate", -"Row group": "Groupe de lignes", -"Column group": "Groupe de colonnes", -"Row type": "Type de ligne", -"Header": "En-t\u00eate", -"Body": "Corps", -"Footer": "Pied", -"Border color": "Couleur de la bordure", -"Insert template...": "Ins\u00e9rer un mod\u00e8le...", -"Templates": "Th\u00e8mes", -"Template": "Mod\u00e8le", -"Text color": "Couleur du texte", -"Background color": "Couleur d'arri\u00e8re-plan", -"Custom...": "Personnalis\u00e9...", -"Custom color": "Couleur personnalis\u00e9e", -"No color": "Aucune couleur", -"Remove color": "Supprimer la couleur", -"Table of Contents": "Table des mati\u00e8res", -"Show blocks": "Afficher les blocs", -"Show invisible characters": "Afficher les caract\u00e8res invisibles", -"Word count": "Nombre de mots", -"Words: {0}": "Mots : {0}", -"{0} words": "{0} mots", -"File": "Fichier", -"Edit": "Editer", -"Insert": "Ins\u00e9rer", -"View": "Voir", -"Format": "Format", -"Table": "Tableau", -"Tools": "Outils", -"Powered by {0}": "Propuls\u00e9 par {0}", -"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.", -"Image title": "Titre d'image", -"Border width": "\u00c9paisseur de la bordure", -"Border style": "Style de la bordure", -"Error": "Erreur", -"Warn": "Avertir", -"Valid": "Valide", -"To open the popup, press Shift+Enter": "Pour ouvrir la popup, appuyez sur Maj+Entr\u00e9e", -"Rich Text Area. Press ALT-0 for help.": "Zone de texte riche. Appuyez sur ALT-0 pour l'aide.", -"System Font": "Police syst\u00e8me", -"Failed to upload image: {0}": "\u00c9chec d'envoi de l'image\u00a0: {0}", -"Failed to load plugin: {0} from url {1}": "\u00c9chec de chargement du plug-in\u00a0: {0} \u00e0 partir de l\u2019URL {1} ", -"Failed to load plugin url: {0}": "\u00c9chec de chargement de l'URL du plug-in\u00a0: {0}", -"Failed to initialize plugin: {0}": "\u00c9chec d'initialisation du plug-in\u00a0: {0}", -"example": "exemple", -"Search": "Rechercher", -"All": "Tout", -"Currency": "Devise", -"Text": "Texte", -"Quotations": "Citations", -"Mathematical": "Op\u00e9rateurs math\u00e9matiques", -"Extended Latin": "Latin \u00e9tendu", -"Symbols": "Symboles", -"Arrows": "Fl\u00e8ches", -"User Defined": "D\u00e9fini par l'utilisateur", -"dollar sign": "Symbole dollar", -"currency sign": "Symbole devise", -"euro-currency sign": "Symbole euro", -"colon sign": "Symbole col\u00f3n", -"cruzeiro sign": "Symbole cruzeiro", -"french franc sign": "Symbole franc fran\u00e7ais", -"lira sign": "Symbole lire", -"mill sign": "Symbole milli\u00e8me", -"naira sign": "Symbole naira", -"peseta sign": "Symbole peseta", -"rupee sign": "Symbole roupie", -"won sign": "Symbole won", -"new sheqel sign": "Symbole nouveau ch\u00e9kel", -"dong sign": "Symbole dong", -"kip sign": "Symbole kip", -"tugrik sign": "Symbole tougrik", -"drachma sign": "Symbole drachme", -"german penny symbol": "Symbole pfennig", -"peso sign": "Symbole peso", -"guarani sign": "Symbole guarani", -"austral sign": "Symbole austral", -"hryvnia sign": "Symbole hryvnia", -"cedi sign": "Symbole cedi", -"livre tournois sign": "Symbole livre tournois", -"spesmilo sign": "Symbole spesmilo", -"tenge sign": "Symbole tenge", -"indian rupee sign": "Symbole roupie indienne", -"turkish lira sign": "Symbole lire turque", -"nordic mark sign": "Symbole du mark nordique", -"manat sign": "Symbole manat", -"ruble sign": "Symbole rouble", -"yen character": "Sinogramme Yen", -"yuan character": "Sinogramme Yuan", -"yuan character, in hong kong and taiwan": "Sinogramme Yuan, Hong Kong et Taiwan", -"yen\/yuan character variant one": "Sinogramme Yen\/Yuan, premi\u00e8re variante", -"Loading emoticons...": "Chargement des \u00e9motic\u00f4nes en cours...", -"Could not load emoticons": "\u00c9chec de chargement des \u00e9motic\u00f4nes", -"People": "Personnes", -"Animals and Nature": "Animaux & nature", -"Food and Drink": "Nourriture & boissons", -"Activity": "Activit\u00e9", -"Travel and Places": "Voyages & lieux", -"Objects": "Objets", -"Flags": "Drapeaux", -"Characters": "Caract\u00e8res", -"Characters (no spaces)": "Caract\u00e8res (espaces non compris)", -"Error: Form submit field collision.": "Erreur : conflit de champs lors de la soumission du formulaire", -"Error: No form element found.": "Erreur : aucun \u00e9l\u00e9ment de formulaire trouv\u00e9.", -"Update": "Mettre \u00e0 jour", -"Color swatch": "\u00c9chantillon de couleurs", -"Turquoise": "Turquoise", -"Green": "Vert", -"Blue": "Bleu", -"Purple": "Violet", -"Navy Blue": "Bleu marine", -"Dark Turquoise": "Turquoise fonc\u00e9", -"Dark Green": "Vert fonc\u00e9", -"Medium Blue": "Bleu moyen", -"Medium Purple": "Violet moyen", -"Midnight Blue": "Bleu de minuit", -"Yellow": "Jaune", -"Orange": "Orange", -"Red": "Rouge", -"Light Gray": "Gris clair", -"Gray": "Gris", -"Dark Yellow": "Jaune fonc\u00e9", -"Dark Orange": "Orange fonc\u00e9", -"Dark Red": "Rouge fonc\u00e9", -"Medium Gray": "Gris moyen", -"Dark Gray": "Gris fonc\u00e9", -"Black": "Noir", -"White": "Blanc", -"Switch to or from fullscreen mode": "Passer en ou quitter le mode plein \u00e9cran", -"Open help dialog": "Ouvrir la bo\u00eete de dialogue d'aide", -"history": "historique", -"styles": "styles", -"formatting": "mise en forme", -"alignment": "alignement", -"indentation": "retrait", -"permanent pen": "feutre ind\u00e9l\u00e9bile", -"comments": "commentaires", -"Anchor": "Ancre", -"Special character": "Caract\u00e8res sp\u00e9ciaux", -"Code sample": "Extrait de code", -"Color": "Couleur", -"Emoticons": "Emotic\u00f4nes", -"Document properties": "Propri\u00e9t\u00e9 du document", -"Image": "Image", -"Insert link": "Ins\u00e9rer un lien", -"Target": "Cible", -"Link": "Lien", -"Poster": "Publier", -"Media": "M\u00e9dia", -"Print": "Imprimer", -"Prev": "Pr\u00e9c ", -"Find and replace": "Trouver et remplacer", -"Whole words": "Mots entiers", -"Spellcheck": "V\u00e9rification orthographique", -"Caption": "Titre", -"Insert template": "Ajouter un th\u00e8me" -}); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/langs/readme.md b/app/static/vendors/tinymce/js/tinymce/langs/readme.md deleted file mode 100644 index a52bf03..0000000 --- a/app/static/vendors/tinymce/js/tinymce/langs/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -This is where language files should be placed. - -Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/app/static/vendors/tinymce/js/tinymce/license.txt b/app/static/vendors/tinymce/js/tinymce/license.txt deleted file mode 100644 index b17fc90..0000000 --- a/app/static/vendors/tinymce/js/tinymce/license.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/advlist/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/advlist/plugin.min.js deleted file mode 100644 index 9880702..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/advlist/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(){"use strict";function n(){}function o(n){return function(){return n}}function t(){return d}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){l(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){l(e,"OL",t["list-style-type"])})},c=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},s=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},f=o(!1),a=o(!0),d=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:m,getOrThunk:p,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:m,orThunk:p,map:t,each:n,bind:t,exists:f,forall:a,filter:t,equals:g,equals_:g,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(e),e);function g(n){return n.isNone()}function p(n){return n()}function m(n){return n}function y(n,t,e){var r=function(n,t){for(var e=0;ey(e)&&(i=o+g);var l=z(e);if(l&&l]*>((\xa0| |[ \t]|]*>)+?|)|
$","i").test(e)}function i(t){var e=parseInt(v.getItem(o(t)+"time"),10)||0;return!((new Date).getTime()-e>function(t){return r(t.settings.autosave_retention,"20m")}(t))||(g(t,!1),!1)}function u(t){var e=o(t);!a(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),function(t){t.fire("StoreDraft")}(t))}function s(t){var e=o(t);i(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),function(t){t.fire("RestoreDraft")}(t))}function c(t,e){var n=function(t){return r(t.settings.autosave_interval,"30s")}(t);e.get()||(m.setInterval(function(){t.removed||u(t)},n),e.set(!0))}function f(t){t.undoManager.transact(function(){s(t),g(t)}),t.focus()}var l=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return l(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var n=o(t);v.removeItem(n+"draft"),v.removeItem(n+"time"),!1!==e&&function(t){t.fire("RemoveDraft")}(t)};function y(r){for(var o=[],t=1;t(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/(.*?)<\/font>/gi,"$1"),o(//gi,"[img]$1[/img]"),o(/(.*?)<\/span>/gi,"[code]$1[/code]"),o(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/(.*?)<\/span>/gi,"[u]$1[/u]"),o(//gi,"[u]"),o(/]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/
/gi,"\n"),o(//gi,"\n"),o(/
/gi,"\n"),o(/

/gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t},i=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/\n/gi,"
"),o(/\[b\]/gi,""),o(/\[\/b\]/gi,""),o(/\[i\]/gi,""),o(/\[\/i\]/gi,""),o(/\[u\]/gi,""),o(/\[\/u\]/gi,""),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),o(/\[url\](.*?)\[\/url\]/gi,'$1'),o(/\[img\](.*?)\[\/img\]/gi,''),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),o(/\[code\](.*?)\[\/code\]/gi,'$1 '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}(); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/charmap/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/charmap/plugin.min.js deleted file mode 100644 index 9adbda5..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/charmap/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(c){"use strict";function n(){}function i(n){return function(){return n}}function e(){return m}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n,e){return n.fire("insertCustomChar",{chr:e})},u=function(n,e){var r=a(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(n){return n.settings.charmap},l=function(n){return n.settings.charmap_append},f=i(!1),g=i(!0),m=(r={fold:function(n,e){return n()},is:f,isSome:f,isNone:g,getOr:p,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:d,map:e,each:n,bind:e,exists:f,forall:g,filter:e,equals:h,equals_:h,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function h(n){return n.isNone()}function d(n){return n()}function p(n){return n}function y(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}}function w(n,e){for(var r=n.length,t=new Array(r),a=0;ae.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+""},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);function a(){}function o(e){return function(){return e}}function s(){return f}var l,u={isCodeSample:function B(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function M(n){return function(e,t){return n(t)}}},d=o(!1),p=o(!0),f=(l={fold:function(e,t){return e()},is:d,isSome:d,isNone:p,getOr:b,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:b,orThunk:m,map:s,each:a,bind:s,exists:d,forall:p,filter:s,equals:h,equals_:h,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(l),l);function h(e){return e.isNone()}function m(e){return e()}function b(e){return e}function y(e){var t=e.selection?e.selection.getNode():null;return u.isCodeSample(t)?w.some(t):w.none()}var v,k=function(n){function e(){return r}function t(e){return e(n)}var a=o(n),r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:p,isNone:d,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?r:f},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return r},w={some:k,none:s,from:function(e){return null===e||e===undefined?f:k(e)}},x=y,S=function(t,n,a){t.undoManager.transact(function(){var e=y(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('

'+a+"
"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},A=function(e){return y(e).fold(function(){return""},function(e){return e.textContent})},C=function(e){return e.settings.codesample_languages},_=function(e){var t=C(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},N=function(e,n){return x(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},O=(v="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===v}),z=Array.prototype.slice,P=(O(Array.from)&&Array.from,function(n){var e=_(n),t=function(e){return 0===e.length?w.none():w.some(e[0])}(e).fold(function(){return""},function(e){return e.value}),a=N(n,t),r=A(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:a,code:r},onSubmit:function(e){var t=e.getData();S(n,t.language,t.code),e.close()}})}),W=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||u.isCodeSample(e)?P(t):t.formatter.toggle("code")})},j=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(u.trimArg(u.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(u.trimArg(u.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},T=function(n){n.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return P(n)},onSetup:function(e){function t(){e.setActive(function(e){var t=e.selection.getStart();return e.dom.is(t,"pre.language-markup")}(n))}return n.on("NodeChange",t),function(){return n.off("NodeChange",t)}}}),n.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return P(n)}})};!function F(){e.add("codesample",function(t){j(t),T(t),W(t),t.on("dblclick",function(e){u.isCodeSample(e.target)&&P(t)})})}()}(window); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js deleted file mode 100644 index e11153c..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js deleted file mode 100644 index 5443e5c..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/directionality/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/directionality/plugin.min.js deleted file mode 100644 index 513de87..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/directionality/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1Could not load emoticons

"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),a.focus(M),a.unblock()}))},R=function(n,t){function e(){return U(n,t)}n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function B(){r.add("emoticons",function(n,t){var e=E(n,t),r=F(n),o=h(n,e,r);R(n,o),function(r,o){r.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return d(n,t,A.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}(n,o)})}()}(window); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/fullpage/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/fullpage/plugin.min.js deleted file mode 100644 index 8e1f79f..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/fullpage/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(m){"use strict";function f(t){return e({validate:!1,root_name:"#document"}).parse(t)}function g(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})}var o,i=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return i(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),h=tinymce.util.Tools.resolve("tinymce.html.Node"),y=tinymce.util.Tools.resolve("tinymce.html.Serializer"),v=function(t){return t.getParam("fullpage_hide_in_source_view")},r=function(t){return t.getParam("fullpage_default_xml_pi")},a=function(t){return t.getParam("fullpage_default_encoding")},c=function(t){return t.getParam("fullpage_default_font_family")},u=function(t){return t.getParam("fullpage_default_font_size")},s=function(t){return t.getParam("fullpage_default_text_color")},d=function(t){return t.getParam("fullpage_default_title")},_=function(t){return t.getParam("fullpage_default_doctype","")},b=f,n=function(t,e){var n,i,l=f(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=c(t),r.fontsize=u(t),7===(n=l.firstChild).type&&(r.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=i[1])),(n=l.getAll("#doctype")[0])&&(r.doctype=""),(n=l.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),p.each(l.getAll("meta"),function(t){var e,n=t.attr("name"),i=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===i&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=l.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],p.each(l.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=l.getAll("body")[0])&&(r.langdir=o(n,"dir"),r.style=o(n,"style"),r.visited_color=o(n,"vlink"),r.link_color=o(n,"link"),r.active_color=o(n,"alink")),r},x=function(t,r,e){var o,n,i,a,l,c=t.dom;function u(t,e,n){t.attr(e,n||undefined)}function s(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=f(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new h("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(l='version="1.0"',r.docencoding&&(l+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new h("xml",7),o.insert(a,o.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new h("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):s(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,p.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new h("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,s(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():s(a=new h("title",1)),a.append(new h("#text",3)).value=r.title):a&&a.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,i=o.getAll("meta"),l=r[t];for(e=0;e"))},C=Object.prototype.hasOwnProperty,k=(o=function(t,e){return e},function(){for(var t=new Array(arguments.length),e=0;e/g,function(t,e){return unescape(e)})},T=p.each,O=function(t){var e,n="",i="";if(r(t)){var l=a(t);n+='\n'}return n+=_(t),n+="\n\n\n",(e=d(t))&&(n+=""+e+"\n"),(e=a(t))&&(n+='\n'),(e=c(t))&&(i+="font-family: "+e+";"),(e=u(t))&&(i+="font-size: "+e+";"),(e=s(t))&&(i+="color: "+e+";"),n+="\n\n"},D=function(e,n,i){e.on("BeforeSetContent",function(t){!function(t,e,n,i){var l,r,o,a,c="",u=t.dom;if(!(i.selection||(o=A(t.settings.protect,i.content),"raw"===i.format&&e.get()||i.source_view&&v(t)))){0!==o.length||i.source_view||(o=p.trim(e.get())+"\n"+p.trim(o)+"\n"+p.trim(n.get())),-1!==(l=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",l),e.set(g(o.substring(0,l+1))),-1===(r=o.indexOf("\n")),a=b(e.get()),T(a.getAll("style"),function(t){t.firstChild&&(c+=t.firstChild.value)});var s=a.getAll("body")[0];s&&u.setAttribs(t.getBody(),{style:s.attr("style")||"",dir:s.attr("dir")||"",vLink:s.attr("vlink")||"",link:s.attr("link")||"",aLink:s.attr("alink")||""}),u.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];if(c)u.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};p.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),p.each(a.getAll("link"),function(t){var e=t.attr("href");if(!e)return!0;f[e]||"stylesheet"!==t.attr("rel")||u.add(d,"link",{rel:"stylesheet",text:"text/css",href:e,"data-mce-fullpage":"1"}),delete f[e]}),p.each(f,function(t){t.parentNode.removeChild(t)})}}(e,n,i,t)}),e.on("GetContent",function(t){!function(t,e,n,i){i.selection||i.source_view&&v(t)||(i.content=P(p.trim(e)+"\n"+p.trim(i.content)+"\n"+p.trim(n)))}(e,n.get(),i.get(),t)})},E=function(t){t.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}})};!function z(){t.add("fullpage",function(t){var e=i(""),n=i("");w(t,e),E(t),D(t,e,n)})}()}(window); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js deleted file mode 100644 index 5189d40..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(l){"use strict";function e(){}function m(e){return function(){return e}}function n(){return s}var r,t=function(e){function n(){return r}var r=e;return{get:n,set:function(e){r=e},clone:function(){return t(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return{isFullscreen:function(){return null!==e.get()}}},c=m(!1),u=m(!0),s=(r={fold:function(e,n){return e()},is:c,isSome:c,isNone:u,getOr:d,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(undefined),or:d,orThunk:a,map:n,each:e,bind:n,exists:c,forall:u,filter:n,equals:f,equals_:f,toArray:function(){return[]},toString:m("none()")},Object.freeze&&Object.freeze(r),r);function f(e){return e.isNone()}function a(e){return e()}function d(e){return e}function h(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function v(e,n){for(var r=e.length,t=new Array(r),o=0;o${name}');return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'
'+function(t){var e=function(e){var t=F(e.plugins);return e.settings.forced_plugins===undefined?t:function(e,t){for(var n=[],o=0,a=e.length;o"+r(t,e)+""}),o=n.length,a=n.join("");return"

"+U.translate(["Plugins installed ({0}):",o])+"

    "+a+"
"}(n)+"
"),(t=y(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"
  • "+U.translate(e)+"
  • "}).join(""),'

    '+U.translate("Premium plugins:")+"

    ")].join("")}]}},N=tinymce.util.Tools.resolve("tinymce.EditorManager"),L=function(){var e,t,n='TinyMCE '+(e=N.majorVersion,t=N.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+U.translate(["You are using {0}",n])+"

    ",presets:"document"}]}},B=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    "}]}};!function z(){t.add("help",function(e){var t=a({}),n=function(n){return{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}}(t),o=A(e,t);return s(e,o),i(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n})}()}(); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/hr/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/hr/plugin.min.js deleted file mode 100644 index ff41b30..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/hr/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
    ")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}(); \ No newline at end of file diff --git a/app/static/vendors/tinymce/js/tinymce/plugins/image/plugin.min.js b/app/static/vendors/tinymce/js/tinymce/plugins/image/plugin.min.js deleted file mode 100644 index 66c9274..0000000 --- a/app/static/vendors/tinymce/js/tinymce/plugins/image/plugin.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - * - * Version: 5.1.3 (2019-12-04) - */ -!function(s){"use strict";function o(){}function a(t){return function(){return t}}function t(t){return t}function e(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=a(!1),c=a(!0),l=(n={fold:function(t,e){return t()},is:u,isSome:u,isNone:c,getOr:d,getOrThunk:f,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:d,orThunk:f,map:e,each:o,bind:e,exists:u,forall:c,filter:e,equals:i,equals_:i,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(n),n);function i(t){return t.isNone()}function f(t){return t()}function d(t){return t}function m(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}}function v(t){for(var e=[],n=0,r=t.length;n'+n+"")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},fn=R,ln=function(n,t){return function(n){return n.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:n.getContent({format:"text"}))},sn=L,dn=F,mn={sanitize:function(n){return K(q)(n)},sanitizeWith:K,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:q},hn=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return hn(t())}}},pn=function(n,r){function e(n,t){var e=function(n,t){return"link"===t?n.catalogs.link:"anchor"===t?n.catalogs.anchor:J.none()}(r,t.name).getOr([]);return B(o.get(),t.name,e,n)}var o=hn(n.text);return{onChange:function(n,t){return"url"===t.name?function(n){if(o.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return J.some({text:t})}return J.none()}(n()):E(["anchor","link"],t.name)?e(n(),t):("text"===t.name&&o.set(n().text),J.none())}}},gn={},vn={exports:gn};V=undefined,W=gn,H=vn,$=undefined,function(n){"object"==typeof W&&void 0!==H?H.exports=n():"function"==typeof V&&V.amd?V([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function l(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof $&&$;if(!n&&e)return e(t,!0);if(f)return f(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,l,i,u,c)}return u[t].exports}for(var f="function"==typeof $&&$,n=0;ne.length?ne(t,e,n):ee(t,e,n)},[]);return S(n).map(function(e){return e.list})}(e.contentDocument,n).toArray()}function de(e){var n=g(Jn.getSelectedListItems(e),bn.fromDom);return A(N(n,t(re)),N(function(e){var n=Xe.call(e,0);return n.reverse(),n}(n),t(re)),function(e,n){return{start:e,end:n}})}function le(t,e,r){var n=function(e,n){var t=Ge(!1);return g(e,function(e){return{sourceList:e,entries:tt(0,n,t,e)}})}(e,de(t));p(n,function(e){!function(e,n){p(v(e,ie),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(n,e)})}(e.entries,r);var n=function(n,e){return y(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i=e.childNodes.length?t.data.length:0}:t.previousSibling&&Mn(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&Mn(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}}function ve(e,n){var t=g(Jn.getSelectedListRoots(e),bn.fromDom),r=g(Jn.getSelectedDlItems(e),bn.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();le(e,t,n),ge(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(ut(e.selection.getRng())),e.nodeChanged(),o=!0}return o}function he(e){return ve(e,"Indent")}function Ne(e){return ve(e,"Outdent")}function ye(e){return ve(e,"Flatten")}function Se(e){return/\btox\-/.test(e.className)}function Oe(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function Ce(t,e){Pn.each(e,function(e,n){t.setAttribute(n,e)})}function be(e,n,t){!function(e,n,t){var r=t["list-style-type"]?t["list-style-type"]:null;e.setStyle(n,"list-style-type",r)}(e,n,t),function(e,n,t){Ce(n,t["list-attributes"]),Pn.each(e.select("li",n),function(e){Ce(e,t["list-item-attributes"])})}(e,n,t)}function Le(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&qn(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Vn(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Te(r,o,i){void 0===i&&(i={});var e,n=r.selection.getRng(!0),u="LI",t=Jn.getClosestListRootElm(r,r.selection.getStart(!0)),s=r.dom;"false"!==s.getContentEditable(r.selection.getNode())&&("DL"===(o=o.toUpperCase())&&(u="DT"),e=ct(n),Pn.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Le(t,e,!0,r),s=Le(t,e,!1,r),a=[],c=n;c&&(a.push(c),c!==s);c=c.nextSibling);return Pn.each(a,function(e){if(Vn(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||qn(e))return qn(e)&&u.remove(e),void(o=null);var n=e.nextSibling;st.isBookmarkNode(e)&&(Vn(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(r,n,t),function(e){var n,t;(t=e.previousSibling)&&Un(t)&&t.nodeName===o&&function(e,n,t){var r=e.getStyle(n,"list-style-type"),o=t?t["list-style-type"]:"";return r===(o=null===o?"":o)}(s,t,i)?(n=t,e=s.rename(e,u),t.appendChild(e)):(n=s.create(o),e.parentNode.insertBefore(n,e),n.appendChild(e),e=s.rename(e,u)),function(t,r,e){Pn.each(e,function(e){var n;return t.setStyle(r,((n={})[e]="",n))})}(s,e,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),be(s,n,i),dt(r.dom,n)}),r.selection.setRng(ft(e)))}function De(e,n,t){return function(e,n){return e&&n&&Un(e)&&e.nodeName===n.nodeName}(n,t)&&function(e,n,t){return e.getStyle(n,"list-style-type",!0)===e.getStyle(t,"list-style-type",!0)}(e,n,t)&&function(e,n){return e.className===n.className}(n,t)}function Ee(n,e,t,r,o){if(e.nodeName!==r||lt(o)){var i=ct(n.selection.getRng(!0));Pn.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);be(e.dom,o,r),j(e,Oe(t),o)}else be(e.dom,n,r),j(e,Oe(t),n)}(n,e,r,o)}),n.selection.setRng(ft(i))}else ye(n)}function we(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),Xn(e,r)&>.remove(r)):gt.setStyle(r,"listStyleType","none")),Un(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)}function ke(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(Mn(o)&&(t?i"}(n):"application/x-shockwave-flash"===n.source1mime?function(e){var t='';return e.poster&&(t+=''),t+=""}(n):-1!==n.source1mime.indexOf("audio")?function(e,t){return t?t(e):'"}(n,o):"script"===n.type?function(e){return' \ No newline at end of file diff --git a/app/tmpl/block/dlgpassword.tt b/app/tmpl/block/dlgpassword.tt deleted file mode 100644 index 53e80e9..0000000 --- a/app/tmpl/block/dlgpassword.tt +++ /dev/null @@ -1,77 +0,0 @@ - - \ No newline at end of file diff --git a/app/tmpl/block/dlguploadfile.tt b/app/tmpl/block/dlguploadfile.tt deleted file mode 100644 index 836c66e..0000000 --- a/app/tmpl/block/dlguploadfile.tt +++ /dev/null @@ -1,93 +0,0 @@ - - \ No newline at end of file diff --git a/app/tmpl/block/dlgusername.tt b/app/tmpl/block/dlgusername.tt deleted file mode 100644 index 5159cf0..0000000 --- a/app/tmpl/block/dlgusername.tt +++ /dev/null @@ -1,90 +0,0 @@ - - - \ No newline at end of file diff --git a/app/tmpl/block/head.tt b/app/tmpl/block/head.tt deleted file mode 100644 index 24cdfa0..0000000 --- a/app/tmpl/block/head.tt +++ /dev/null @@ -1,30 +0,0 @@ - - - - - [% sitename %] - [% pagename %] - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/tmpl/block/snackbar.tt b/app/tmpl/block/snackbar.tt deleted file mode 100644 index 464a162..0000000 --- a/app/tmpl/block/snackbar.tt +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/app/tmpl/block/toolbars.tt b/app/tmpl/block/toolbars.tt deleted file mode 100644 index 78ca487..0000000 --- a/app/tmpl/block/toolbars.tt +++ /dev/null @@ -1,9 +0,0 @@ -[% MACRO tabletoolbar(ident) BLOCK -%] - -
    - - - - -
    -[% END -%] \ No newline at end of file diff --git a/app/tmpl/file.tt b/app/tmpl/file.tt deleted file mode 100644 index afb2fc5..0000000 --- a/app/tmpl/file.tt +++ /dev/null @@ -1,3 +0,0 @@ -[% USE DBI %] -[% USE dksdb = DBI(dsn, dbuser, dbpassword) %] -[% INCLUDE $page %] diff --git a/app/tmpl/index.tt b/app/tmpl/index.tt deleted file mode 100644 index a4efa99..0000000 --- a/app/tmpl/index.tt +++ /dev/null @@ -1,57 +0,0 @@ -[% USE dksdb = DBI(dsn, dbuser, dbpassword) %] -[% #appaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? group by ap.id,ug.id order by ap.sort;")%] -[% USE date %] -[% vstamp=date.format(date.now, '%d%m%Y%H%M%S') %] - - - - - - [% sitename %] - [% pagename %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - [% INCLUDE $page %] -
    - [% INCLUDE block/snackbar.tt %] - - - - - - - - - - - - - - - diff --git a/app/tmpl/lang/fr.tt b/app/tmpl/lang/fr.tt deleted file mode 100644 index 616ea59..0000000 --- a/app/tmpl/lang/fr.tt +++ /dev/null @@ -1,8 +0,0 @@ -[% lbl = { - loginheading => "LEDF Site Login", - login => "Login", - password => "Mot de passe", - sendlogin => "Connecter", - linkpwdforgotten => "mot de passe oublié?" -} -%] \ No newline at end of file diff --git a/app/tmpl/login.tt b/app/tmpl/login.tt deleted file mode 100644 index 2c232e8..0000000 --- a/app/tmpl/login.tt +++ /dev/null @@ -1,76 +0,0 @@ -[% PROCESS "lang/${lang}.tt" %] - - - - - - [% sitename %] - [% pagename %] - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - logo -
    -
    -
    - [% IF pagename == 'register' && registration_enabled == '1' %] - [% INCLUDE module/login/register.tt %] - [% ELSIF pagename == 'forgotpassword' %] - [% INCLUDE module/login/forgotpassword.tt %] - [% ELSIF pagename == 'message' %] - [% INCLUDE module/login/message.tt %] - [% ELSIF pagename == 'validationcode' %] - [% INCLUDE module/login/validationcode.tt %] - [% ELSE %] - [% INCLUDE module/login/login.tt %] - [% END %] -
    - -
    - - - \ No newline at end of file diff --git a/app/tmpl/macro/fields.tt b/app/tmpl/macro/fields.tt deleted file mode 100644 index 94ba04b..0000000 --- a/app/tmpl/macro/fields.tt +++ /dev/null @@ -1,118 +0,0 @@ -[% MACRO fieldhidden(column,table,ident,value) BLOCK -%] - -[% END -%] -[% MACRO fieldeditbox(column,table,title,size,state,value,plhold) BLOCK -%] -
    - - 0 %][% state %][% END %]/> - -
    -[% END -%] -[% MACRO fieldfile(column,table,title,size,state,value) BLOCK -%] -
    - - 0 %][% state %][% END %]/> - -
    -[% END -%] -[% MACRO fieldpasswordbox(column,table,title,size,state,value) BLOCK -%] -
    - - 0 %][% state %][% END %]/> - -
    -[% END -%] -[% MACRO fieldtagbox(column,table,title,size,state,value) BLOCK -%] -
    - - 0 %][% state %][% END %]/> - -
    -[% END -%] -[% MACRO fieldcheckbox(column,table,title,size,state,value) BLOCK -%] -
    -
    - 0 %][% state %][% END %]> - -
    -[% END -%] - -[% MACRO fieldemailbox(column,table,title,size,state,value) BLOCK -%] -
    - - 0 %][% state %][% END %]/> -
    -[% END -%] - -[% MACRO fieldselectbox(column,table,title,size,state,value) BLOCK -%] - [% IF state.length > 0 %] - [% fieldeditbox(column,table,title,size,state,value) %] - [% ELSE %] -
    - - - -
    - [% END %] -[% END -%] -[% MACRO fieldmultiselectbox(column,table,title,size,state,value) BLOCK -%] - [% IF state.length > 0 %] - [% fieldeditbox(column,table,title,size,state,value) %] - [% ELSE %] -
    - - - -
    - [% END %] -[% END -%] -[% MACRO fielddatebox(column,table,title,size,state,value) BLOCK -%] -
    - - 0 %][% state %][% END %]]/> - -
    -[% END -%] -[% MACRO fieldtextarea(column,table,title,size,state,height,value) BLOCK -%] -
    - - -
    -[% END -%] -[% MACRO fieldrichtextarea(column,table,title,size,state,height,value) BLOCK -%] -
    - - -
    -[% END -%] - -[% MACRO formsavebutton(formname,btnname,clbk) BLOCK -%] -
    - -
    -[% END -%] -[% MACRO formsavetextfilebutton(formname,btnname) BLOCK -%] -
    - -
    -[% END -%] -[% MACRO formdlgsavebutton(formname,btnname,clbk) BLOCK -%] - -[% END -%] -[% MACRO formsavefilebutton(formname,btnname,container) BLOCK -%] -[% IF container.length > 0 %] -
    - [% END %] - -[% IF container.length > 0 %] -
    -[% END %] -[% END -%] - - diff --git a/app/tmpl/module/championship/divisions.js b/app/tmpl/module/championship/divisions.js deleted file mode 100644 index ebf3380..0000000 --- a/app/tmpl/module/championship/divisions.js +++ /dev/null @@ -1,35 +0,0 @@ -function initpage(){ - tbl = new Tabulator("#tbl_divisions", { - height: "95vh", - layout:"fitColumns", - addRowPos:"top", - selectable:1, - columns:[ - {title:"Divisioun", field:"division"}, - {title:"Ranking", field:"ranking"}, - ], -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"divisions"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function add(){ - -} - -function edit(){ - -} - -function remove(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/championship/divisions.tt b/app/tmpl/module/championship/divisions.tt deleted file mode 100644 index 3bf4b84..0000000 --- a/app/tmpl/module/championship/divisions.tt +++ /dev/null @@ -1,26 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% INCLUDE "module/$module/toolbar.tt" %] -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/championship/games.js b/app/tmpl/module/championship/games.js deleted file mode 100644 index 3ac8c66..0000000 --- a/app/tmpl/module/championship/games.js +++ /dev/null @@ -1,211 +0,0 @@ -var sel_id_teamhome = null; -var sel_id_teamguest = null; - -function initpage(){ - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - tbl = new Tabulator("#tbl_csgames", { - height: "95vh", - layout:"fitColumns", - addRowPos:"top", - selectable:1, - columns:[ - {title:"Saison", field:"season",headerFilter:"input"}, - {title:"Division", field:"division",headerFilter:"input"}, - {title:"Spilldag", field:"playday",headerFilter:"input"}, - {title:"Datum", field:"dspplaydate",headerFilter:"input"}, - {title:"Team Home", field:"teamhome",headerFilter:"input"}, - {title:"Team Guest", field:"teamguest",headerFilter:"input"}, - {title:"Sets Team Home", field:"sets_teamhome"}, - {title:"Sets Team Guest", field:"sets_teamguest"}, - {title:"Validéiert",field:"validated"} - ], -}); - gettbldata(); - getdivisions(); - getseasons(); - getteamsbyseasondivision(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"games"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function add(){ - document.getElementById("id").value = ""; - document.getElementById('dlgcsgames').style.display='block'; - return false; -} - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - //console.log(uid); - req.reqdata("POST","db.cgi",{"get":"games","filter":"id=" + uid},fillformgames); - document.getElementById('dlgcsgames').style.display='block'; - return false; -} - -function fillformgames(data){ - console.log("fillformgames"); - console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_csgames'); - for (var f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - //console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - } - return false; -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - if (confirm("Dass du secher dass du déi ausgewielten Rei läschen wëlls?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_csgames_id":udata[0].id},gettbldata); - } - return false; -} - - -function getdivisions(){ - req.reqdata("POST","db.cgi",{"get":"divisions"},filldivisions); - return false; -} -function filldivisions(data){ - var divlist = []; - var dividlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - divlist.push({value:data.sqldata[i].id,label:data.sqldata[i].division}); - dividlist[data.sqldata[i].id] = data.sqldata[i].division; - } - } - if (document.getElementById('id_division').tagName == "SELECT"){ - sel_id_division = new Choices('#id_division',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : divlist, - shouldSort: false, - shouldSortItems: false - }); - sel_id_division.setChoiceByValue(document.getElementById("id_division").dataset.selected); - - } else { - document.getElementById('id_division').value = dividlist[document.getElementById('id_division').value]; - } - document.getElementById("id_division").addEventListener("change",function(){ - getteamsbyseasondivision(); - }); - return false; -} -function getseasons(){ - req.reqdata("POST","db.cgi",{"get":"seasons"},fillseasons); - return false; -} -function fillseasons(data){ - - var seasonlist = []; - var seasonidlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - seasonlist.push({value:data.sqldata[i].id,label:data.sqldata[i].season}); - seasonidlist[data.sqldata[i].id] = data.sqldata[i].season; - } - } - if (document.getElementById('id_season').tagName == "SELECT"){ - sel_id_season = new Choices('#id_season',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : seasonlist, - shouldSort: false, - shouldSortItems: false - }); - sel_id_season.setChoiceByValue(document.getElementById("id_season").dataset.selected); - - } else { - document.getElementById('id_season').value = seasonidlist[document.getElementById('id_season').value]; - } - - document.getElementById("id_season").addEventListener("change",function(){ - getteamsbyseasondivision(); - }); - return false; -} - -function closedlg(){ - gettbldata(); - document.getElementById('dlgcsgames').style.display='none'; -} - -function getteamsbyseasondivision(){ - var id_season = document.getElementById('id_season').value; - var id_division = document.getElementById('id_division').value; - req.reqdata("POST","db.cgi",{"get":"seasonranking","filter":" id_season="+id_season+" and id_division="+id_division},fillteams); - return false; -} - -function fillteams(data){ - var teamlist = []; - var teamidlist = {"":""}; - //console.log(data); - if (data && data.sqldata){ - for (var i in data.sqldata){ - teamlist.push({value:data.sqldata[i].id_team,label:data.sqldata[i].team}); - teamidlist[data.sqldata[i].id] = data.sqldata[i].teams; - } - } - if (sel_id_teamhome){ - sel_id_teamhome.destroy(); - } - if (sel_id_teamguest){ - sel_id_teamguest.destroy(); - } - if (document.getElementById('id_teamhome').tagName == "SELECT"){ - sel_id_teamhome = new Choices('#id_teamhome',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : teamlist - }); - sel_id_teamhome.setChoiceByValue(document.getElementById("id_teamhome").dataset.selected); - - } else { - document.getElementById('id_teamhome').value = teamidlist[document.getElementById('id_teamhome').value]; - } - if (document.getElementById('id_teamguest').tagName == "SELECT"){ - sel_id_teamguest = new Choices('#id_teamguest',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : teamlist - }); - sel_id_teamguest.setChoiceByValue(document.getElementById("id_teamguest").dataset.selected); - - } else { - document.getElementById('id_teamguest').value = teamidlist[document.getElementById('id_teamguest').value]; - } - return false; -} - - diff --git a/app/tmpl/module/championship/games.tt b/app/tmpl/module/championship/games.tt deleted file mode 100644 index 913b1ff..0000000 --- a/app/tmpl/module/championship/games.tt +++ /dev/null @@ -1,33 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% INCLUDE "module/$module/toolbar.tt" %] -
    -
    - diff --git a/app/tmpl/module/championship/highscores.js b/app/tmpl/module/championship/highscores.js deleted file mode 100644 index 1fb1a26..0000000 --- a/app/tmpl/module/championship/highscores.js +++ /dev/null @@ -1,227 +0,0 @@ -var tbl = null; -var tag_highcheck = null; -var tag_highscore = null; -var tag_fastfinish = null; -var sel_id_game = null; -var sel_playday = null; -var sel_id_member = null; -var pdayidlist = []; -var gameidlist = {}; -var clubidbymember = {}; -function initpage(){ - tag_highscore = new Choices('#highscore',{ - removeItems: true, - removeItemButton: true, - searchEnabled: false, - addItems: true, - addItemText: (value) => { - return `Dreck 'Enter' "${value}" baizesetzen`; - }, - }); - tag_fastfinish = new Choices('#fastfinish',{ - removeItems: true, - removeItemButton: true, - searchEnabled: false, - addItems: true, - addItemText: (value) => { - return `Dreck 'Enter' "${value}" baizesetzen`; - }, - }); - tag_highcheck = new Choices('#highcheck',{ - removeItems: true, - removeItemButton: true, - searchEnabled: false, - addItems: true, - addItemText: (value) => { - return `Dreck 'Enter' "${value}" baizesetzen`; - }, - }); - sel_playday = new Choices('#playday',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : [], - shouldSort: false, - shouldSortItems: false - }); - sel_id_game = new Choices('#id_game',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : [], - shouldSort: false, - shouldSortItems: false - }); - sel_id_member = new Choices('#id_member',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : [], - shouldSort: false, - shouldSortItems: false - }); - tbl = new Tabulator("#tbl_cshighscores", { - headerFilterPlaceholder:"filter...", - height: "95vh", - layout:"fitDataFill", - selectable:1, - responsiveLayout:"collapse", - columns:[ - {title:"Spilldag", field:"playday",headerFilter:"number", headerFilterFunc:"=",sorter:"number", width: 50}, - {title:"Match", field:"game",headerFilter:"input",width: 200}, - {title:"Spiller", field:"player",headerFilter:"input",width: 200}, - {title:"Club", field:"club",headerFilter:"input",width: 150}, - {title:"High Score", field:"highscorelist"}, - {title:"Fast Finish", field:"fastfinishlist"}, - {title:"High Check", field:"highchecklist"}, - ], -}); - gettbldata(); - getplaydays(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"highscores","filter":"season='[% season %]'"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function highscoresaved(){ - gettbldata(); - document.getElementById('dlgcshighscores').style.display='none'; -} - -function add(){ - tag_highscore.clearStore(); - tag_fastfinish.clearStore(); - tag_highcheck.clearStore(); - sel_id_member.clearStore(); - document.getElementById("id").value = ""; - document.getElementById("id_member").dataset.selected = ""; - getmembersbyteam(); - document.getElementById('dlgcshighscores').style.display='block'; -} - -function edit(){ - var udata = tbl.getSelectedData(); - if (udata.length == 0){ return; } - var uid = udata[0].id; - //console.log(udata[0]); - sel_playday.setChoiceByValue(udata[0].playday); - document.getElementById("id").value=udata[0].id; - document.getElementById("id_game").dataset.selected = udata[0].id_game; - //document.getElementById("id_club").value = udata[0].id_club; - getgamesbyplayday(); - document.getElementById("id_member").dataset.selected = udata[0].id_member; - getmembersbyteam(); - tag_fastfinish.clearStore(); - tag_highcheck.clearStore(); - tag_highscore.clearStore(); - if ((udata[0].highscore != null) && (udata[0].highscore != '[""]')){ - tag_highscore.setValue(JSON.parse(udata[0].highscore)); - } - if ((udata[0].fastfinish != null) && (udata[0].fastfinish != '[""]')){ - tag_fastfinish.setValue(JSON.parse(udata[0].fastfinish)); - } - if ((udata[0].highcheck != null) && (udata[0].highcheck != '[""]')){ - tag_highcheck.setValue(JSON.parse(udata[0].highcheck)); - } - document.getElementById("id_club").value = udata[0].id_club; - document.getElementById('dlgcshighscores').style.display='block'; -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - if (confirm("Bass du secher dass déi ausgewielten Scores läschen wells?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_cshighscores_id":udata[0].id},gettbldata); - } -} - -function getplaydays(){ - req.reqdata("POST","db.cgi",{"get":"playdays","filter":"season='[% season%]'"},fillplaydays); - return false; -} -function fillplaydays(data){ - var pdaylist = []; - pdayidlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - pdaylist.push({value:data.sqldata[i].playday,label:data.sqldata[i].playday}); - pdayidlist[data.sqldata[i].playday] = data.sqldata[i].d; - } - } - sel_playday.setChoices(pdaylist, 'value', 'label', true); - document.getElementById("playday").addEventListener("change",function(){ - getgamesbyplayday(); - }); - return false; -} - -function getgamesbyplayday(){ - var playday = document.getElementById('playday').value; - req.reqdata("POST","db.cgi",{"get":"gameslist","filter":"season='[% season%]' and playday=" + playday},fillgameslist); -} - -function fillgameslist(data){ - var gamelist = []; - gameidlist = {}; - sel_id_game.clearStore(); - sel_id_member.clearStore(); - document.getElementById("id_club").value = ""; - if (data && data.sqldata){ - for (var i in data.sqldata){ - gamelist.push({value:data.sqldata[i].id,label:data.sqldata[i].game}); - gameidlist[data.sqldata[i].id] = data.sqldata[i]; - } - } - sel_id_game.setChoices(gamelist, 'value', 'label', true); - - document.getElementById("id_game").addEventListener("change",function(){ - getmembersbyteam(); - }); - if (document.getElementById("id_game").dataset.selected){ - sel_id_game.setChoiceByValue(document.getElementById("id_game").dataset.selected); - } - return false; -} - -function getmembersbyteam(){ - var idgame = document.getElementById("id_game").value; - //console.log(gameidlist[idgame]); - if (idgame){ - req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club in (" + gameidlist[idgame].id_clubhome + "," + gameidlist[idgame].id_clubguest + ") and status='aktiv' "},fillmemberslist); - } -} - -function fillmemberslist(data){ - var memberslist = []; - clubidbymember = {}; - sel_id_member.clearStore(); - document.getElementById("id_club").value = ""; - - if (data && data.sqldata){ - for (var i in data.sqldata){ - - memberslist.push({value:data.sqldata[i].id,label:'(' + data.sqldata[i].club + ') ' + data.sqldata[i].surname + ' ' + data.sqldata[i].prename + ''}); - clubidbymember[data.sqldata[i].id] = data.sqldata[i].id_club; - } - } - sel_id_member.setChoices(memberslist, 'value', 'label', true); - - document.getElementById("id_member").addEventListener("change",function(){ - setclubid(); - }); - if (document.getElementById("id_member").dataset.selected){ - sel_id_member.setChoiceByValue(document.getElementById("id_member").dataset.selected); - } - return false; -} - -function setclubid(){ - var idm = document.getElementById("id_member").value; - document.getElementById("id_club").value=clubidbymember[idm]; -} - - diff --git a/app/tmpl/module/championship/highscores.tt b/app/tmpl/module/championship/highscores.tt deleted file mode 100644 index 5cc1fc1..0000000 --- a/app/tmpl/module/championship/highscores.tt +++ /dev/null @@ -1,40 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - - -
    - - - -
    - -
    -
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/championship/index.js b/app/tmpl/module/championship/index.js deleted file mode 100644 index d5e647b..0000000 --- a/app/tmpl/module/championship/index.js +++ /dev/null @@ -1,240 +0,0 @@ -var tbl = null; -var afterformsaved = {}; -/*[% sid = session.id %] -[% IF (session.usergroups.search('championship') != 1) %] -[% qclub = dksdb.query("select id_club from vw_memberlist where id_user=$sid;") %] -[% club = qclub.get_all() %] -[% END %] */ - -var idclub="[% club.0.id_club %]"; -function initpage(){ - tbl = new Tabulator("#tbl_csgames", { - headerFilterPlaceholder:"filter...", - height: "95vh", - layout:"fitDataFill", - selectable:1, - responsiveLayout:"collapse", - columns:[ - {title:"Spilldag", field:"playday",headerFilter:"number", headerFilterFunc:"=",sorter:"number", width: 50}, - {title:"Datum", field:"dspplaydate",headerFilter:"input", width: 120}, - {title:"Doheem", field:"teamhome",headerFilter:"input"}, - {title:"Auswärts", field:"teamguest",headerFilter:"input"}, - {title:"Sets Doheem", field:"sets_teamhome",width: 50}, - {title:"Sets Auswärts", field:"sets_teamguest",width: 50}, - {title:"Validéiert", field:"validated", width: 50,align:"center", formatter:"tickCross", sorter:"boolean"}, - {title:"Resultat Doheem", field:"result_teamhome",width: 100}, - {title:"SpillBou Doheem", field:"file_teamhome",formatter:"html",width: 150}, - {title:"Resultat Auswärts", field:"result_teamguest",width: 100}, - {title:"SpillBou Auswärts", field:"file_teamguest",formatter:"html",width: 150}, - ], -}); - gettbldata(); -} - -function gettbldata(){ - /*[% IF club %]*/ - req.reqdata("POST","db.cgi",{"get":"games","filter":"season='[% season %]' and (id_clubhome=[% club.0.id_club %] or id_clubguest=[% club.0.id_club %])"},loadtbldata); - /*[% ELSE %]*/ - req.reqdata("POST","db.cgi",{"get":"games","filter":"season='[% season %]'"},loadtbldata); - /*[% END %]*/ -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function closedlg(){ - gettbldata(); - document.getElementById('dlgcsgames').style.display='none'; -} - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - if (udata.length == 0){ return; } - document.getElementById("div_teamguest").style.display = 'block'; - document.getElementById("div_teamhome").style.display = 'block'; - document.getElementById("season").value=udata[0].season; - document.getElementById("division").value=udata[0].division; - document.getElementById("playday").value=udata[0].playday; - document.getElementById("dspplaydate").value=udata[0].dspplaydate; - document.getElementById("teamhome").value=udata[0].teamhome; - document.getElementById("teamguest").value=udata[0].teamguest; - document.getElementById("id_clubhome").value=udata[0].id_clubhome; - document.getElementById("id_clubguest").value=udata[0].id_clubguest; - document.getElementById("uploadclub").value=idclub; - document.getElementById("id").value=udata[0].id; - document.getElementById("upload_teamhome").value=""; - document.getElementById("upload_teamguest").value=""; - document.getElementById("result_teamhome").value=""; - document.getElementById("result_teamguest").value=""; - //if (idclub == ''){ - document.getElementById("sets_teamhome").value=udata[0].sets_teamhome; - document.getElementById("sets_teamguest").value=udata[0].sets_teamguest; - //} - - if (udata[0].validated=="1"){ - - if (idclub == ''){ document.getElementById("validated").checked = true;} - if (idclub != ''){ - document.getElementById("div_fld").style.display= 'block'; - document.getElementById("btnsavegame").style.display='none'; - } - - } else { - document.getElementById("btnsavegame").style.display='inline'; - if (idclub == ''){ document.getElementById("validated").checked = false;} - if (idclub != ''){ document.getElementById("div_fld").style.display= 'none'; } - } - - if (idclub != ''){ - if (idclub != '' && idclub== udata[0].id_clubhome && udata[0].id_clubhome!=udata[0].id_clubguest){ - - document.getElementById("div_teamguest").style.display = 'none'; - } - if (idclub != '' && idclub== udata[0].id_clubguest && udata[0].id_clubhome!=udata[0].id_clubguest){ - - document.getElementById("div_teamhome").style.display = 'none'; - } - if (udata[0].validated == 1){ - document.getElementById("div_teamguest").style.display = 'none'; - document.getElementById("div_teamhome").style.display = 'none'; - - } - } else { - document.getElementById("div_teamguest").style.display = 'block'; - document.getElementById("div_teamhome").style.display = 'block'; - } - - document.getElementById('dlgcsgames').style.display='block'; - return false; -} - -function savegame(){ - - var th = false; - var tg = false; - var rt =/\d+-\d+/; - if (idclub != '' && idclub == document.getElementById('id_clubhome').value){ - var rth = document.getElementById('result_teamhome').value; - var fth = document.getElementById('upload_teamhome').value; - rth = rth.replace(' ','','g'); - //console.log("home do match " + rth.match(rt)); - if (rth != '' && fth != '' && (rth.match(rt))){ - th = true; - - } - } - if (idclub != '' && idclub == document.getElementById('id_clubguest').value){ - var rtg = document.getElementById('result_teamguest').value; - var ftg = document.getElementById('upload_teamguest').value; - rtg = rtg.replace(' ','','g'); - //console.log("guest do match " + rtg.match(rt)); - if (rtg != '' && ftg != '' && (rtg.match(rt))){ - tg = true; - // console.log("guest does not match!"); - - } - } - //console.log("TG" + tg + 'TH' + th); - if (idclub == '' || th || tg){ - getformdata('csgames'); - } - - return false; -} - - -function filesaved(data){ - var sb = document.getElementById("snackbar"); - sb.className="show green"; - sb.innerHTML = 'den Spillstand gouf gespaichert!'; - setTimeout(function(){ sb.className = sb.className.replace("show green", ""); }, 3000); - return false; -} -function getformdata(frmid){ - var frm = document.getElementById("frm_" + frmid); - // console.log(frm); - var frmdata = new FormData(); - // flds ={"text":{},"files":{}}; - for (var i = 0; i < frm.elements.length; i++) { - var field = frm.elements[i]; - - if (field.tagName == "INPUT"){ - //console.log(field.id + " => " + field.type); - if ( field.type == "file"){ - if (field.files[0]){ - frmdata.append(field.id,field.files[0]); - } - } else if (field.type == "checkbox"){ - if (field.checked == true){ - frmdata.append(field.id,1); - } else {frmdata.append(field.id,'');} - } - else { - if (field.value){ - frmdata.append(field.id,field.value); - } - - //flds['text'][field.id] = field.value; - } - } - // console.log(field); - } - for (var pair of frmdata.entries()) { - console.log(pair[0]+ ', ' + pair[1]); - } - req.multipartform("upload.cgi",frmdata,multipartformsaved); -} - -function multipartformsaved(data){ - //console.log(data); - var sb = document.getElementById("snackbar"); - sb.className="show green"; - sb.innerHTML = 'Den Fichier gouf gespaichert!'; - setTimeout(function(){ sb.className = sb.className.replace("show green", ""); }, 3000); - - document.getElementById('dlgcsgames').style.display = 'none'; - if (afterformsaved.action){ - afterformsaved.action(data); - } - gettbldata(); - return false; -} - -function show_gameupload(gfile){ - var ts = Math.round((new Date()).getTime() / 1000); - window.open("../data/championship/[% season%]/" + gfile + '?v='+ ts); -} - -/*[% IF (session.usergroups.search('championship') == 1) %]*/ - -function loadhighscores(){ - var udata = tbl.getSelectedData(); - //console.log(udata); - if (udata.length > 0){ - var uid = udata[0].id; - app.loadpage('[% module %]/highscores.html?id_game=' + udata[0].id,'Highscores'); - } else { - app.loadpage('[% module %]/highscores.html','Highscores'); - } -} - -function cleansets(){ - req.reqdata("POST","db.cgi",{"fn":"cleangamesets","params":document.getElementById("id").value},aftercleansets); -} - -function aftercleansets(data){ - console.log(data); - var sb = document.getElementById("snackbar"); - sb.className="show green"; - sb.innerHTML = 'Den Fichier gouf gespaichert!'; - setTimeout(function(){ sb.className = sb.className.replace("show green", ""); }, 3000); - - document.getElementById('dlgcsgames').style.display = 'none'; - gettbldata(); - return false; -} -/*[% END %]*/ \ No newline at end of file diff --git a/app/tmpl/module/championship/index.tt b/app/tmpl/module/championship/index.tt deleted file mode 100644 index 8dcdaac..0000000 --- a/app/tmpl/module/championship/index.tt +++ /dev/null @@ -1,66 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% inputdisabled = 'readonly' %] -[% IF (session.usergroups.search('championship') == 1) %] -[% inputdisabled = '' %] -[% END %] -
    -
    Championnat
    - - [% IF (session.usergroups.search('championship') == 1) %] - - - [% END %] -
    -
    - diff --git a/app/tmpl/module/championship/ranking.js b/app/tmpl/module/championship/ranking.js deleted file mode 100644 index c9b395b..0000000 --- a/app/tmpl/module/championship/ranking.js +++ /dev/null @@ -1,188 +0,0 @@ -var tbl = null; -var sel_id_team = null; -var sel_id_division = null; -var sel_id_season = null; -function initpage(){ - tbl = new Tabulator("#tbl_csseasonranking", { - height: "95vh", - layout:"fitColumns", - addRowPos:"top", - selectable:1, - columns:[ - {title:"Saison", field:"season",headerFilter:"input"}, - {title:"Division", field:"division",headerFilter:"input"}, - {title:"Team", field:"team",headerFilter:"input"}, - {title:"gespillt", field:"played"}, - {title:"Sets gewonnen", field:"setswon"}, - {title:"Sets verluer", field:"setslost"}, - {title:"Punkten", field:"points"} - ], -}); - gettbldata(); - getteams(); - getdivisions(); - getseasons(); -} - - - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"seasonranking"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function add(){ - var frm = document.querySelectorAll('.data_csseasonranking'); - for (var f in frm){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(""); - } else { - frm[f].value=""; - // if (frm[f].id == 'teams'){ - // locations_teams.clearStore(); - // } - } - - } - } - document.getElementById('dlgcsseasonranking').style.display='block'; - return false; -} - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - //console.log(uid); - req.reqdata("POST","db.cgi",{"get":"seasonranking","filter":"id=" + uid},fillformseasonranking); - document.getElementById('dlgcsseasonranking').style.display='block'; - return false; -} - -function fillformseasonranking(data){ - //console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_csseasonranking'); - for (var f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - //console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - } - return false; -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - if (confirm("Dass du secher dass du déi ausgewielten Rei läschen wëlls?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_csseasonranking_id":udata[0].id},gettbldata); - } - return false; -} - -function getteams(){ - req.reqdata("POST","db.cgi",{"get":"teams"},fillteams); - return false; -} - -function fillteams(data){ - var teamlist = []; - var teamidlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - teamlist.push({value:data.sqldata[i].id,label:data.sqldata[i].team}); - teamidlist[data.sqldata[i].id] = data.sqldata[i].teams; - } - } - if (document.getElementById('id_team').tagName == "SELECT"){ - sel_id_team = new Choices('#id_team',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : teamlist - }); - sel_id_team.setChoiceByValue(document.getElementById("id_team").dataset.selected); - - } else { - document.getElementById('id_team').value = teamidlist[document.getElementById('id_team').value]; - } - return false; -} -function getdivisions(){ - req.reqdata("POST","db.cgi",{"get":"divisions"},filldivisions); - return false; -} -function filldivisions(data){ - var divlist = []; - var dividlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - divlist.push({value:data.sqldata[i].id,label:data.sqldata[i].division}); - dividlist[data.sqldata[i].id] = data.sqldata[i].division; - } - } - if (document.getElementById('id_division').tagName == "SELECT"){ - sel_id_division = new Choices('#id_division',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : divlist, - shouldSort: false, - shouldSortItems: false - }); - sel_id_division.setChoiceByValue(document.getElementById("id_division").dataset.selected); - - } else { - document.getElementById('id_division').value = dividlist[document.getElementById('id_division').value]; - } - return false; -} -function getseasons(){ - req.reqdata("POST","db.cgi",{"get":"seasons"},fillseasons); - return false; -} -function fillseasons(data){ - - var seasonlist = []; - var seasonidlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - seasonlist.push({value:data.sqldata[i].id,label:data.sqldata[i].season}); - seasonidlist[data.sqldata[i].id] = data.sqldata[i].season; - } - } - if (document.getElementById('id_season').tagName == "SELECT"){ - sel_id_season = new Choices('#id_season',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : seasonlist, - shouldSort: false, - shouldSortItems: false - }); - sel_id_season.setChoiceByValue(document.getElementById("id_season").dataset.selected); - - } else { - document.getElementById('id_season').value = seasonidlist[document.getElementById('id_season').value]; - } - return false; -} - -function closedlg(){ - gettbldata(); - document.getElementById('dlgcsseasonranking').style.display='none'; -} \ No newline at end of file diff --git a/app/tmpl/module/championship/ranking.tt b/app/tmpl/module/championship/ranking.tt deleted file mode 100644 index ee3e931..0000000 --- a/app/tmpl/module/championship/ranking.tt +++ /dev/null @@ -1,27 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% INCLUDE "module/$module/toolbar.tt" %] -
    -
    - diff --git a/app/tmpl/module/championship/seasons.js b/app/tmpl/module/championship/seasons.js deleted file mode 100644 index 8bf2ebf..0000000 --- a/app/tmpl/module/championship/seasons.js +++ /dev/null @@ -1,34 +0,0 @@ -function initpage(){ - tbl = new Tabulator("#tbl_seasons", { - height: "95vh", - layout:"fitColumns", - addRowPos:"top", - selectable:1, - columns:[ - {title:"Saison", field:"season"}, - ], -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"seasons"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function add(){ - -} - -function edit(){ - -} - -function remove(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/championship/seasons.tt b/app/tmpl/module/championship/seasons.tt deleted file mode 100644 index 254ff02..0000000 --- a/app/tmpl/module/championship/seasons.tt +++ /dev/null @@ -1,25 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% INCLUDE "module/$module/toolbar.tt" %] -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/championship/teams.js b/app/tmpl/module/championship/teams.js deleted file mode 100644 index 68fe756..0000000 --- a/app/tmpl/module/championship/teams.js +++ /dev/null @@ -1,35 +0,0 @@ -function initpage(){ - tbl = new Tabulator("#tbl_teams", { - height: "95vh", - layout:"fitColumns", - addRowPos:"top", - selectable:1, - columns:[ - {title:"Equipe", field:"team"}, - {title:"Club", field:"club"}, - ], -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"teams"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function add(){ - -} - -function edit(){ - -} - -function remove(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/championship/teams.tt b/app/tmpl/module/championship/teams.tt deleted file mode 100644 index 93265cc..0000000 --- a/app/tmpl/module/championship/teams.tt +++ /dev/null @@ -1,26 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% INCLUDE "module/$module/toolbar.tt" %] -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/championship/toolbar.tt b/app/tmpl/module/championship/toolbar.tt deleted file mode 100644 index 4a7fa24..0000000 --- a/app/tmpl/module/championship/toolbar.tt +++ /dev/null @@ -1,27 +0,0 @@ -
    - -
    - - - - - - - - - - - - -
    -
    - - - diff --git a/app/tmpl/module/clubs/club.js b/app/tmpl/module/clubs/club.js deleted file mode 100644 index c1b548c..0000000 --- a/app/tmpl/module/clubs/club.js +++ /dev/null @@ -1,201 +0,0 @@ - - - - - -function initpage() { - club.inittable(); - club.initform(); -} -let club = { - tbl:null, - current_club: "[% session.id_club %]" - choices: {"id_president":null,"id_secretary":null,"id_tresorier":null,"location_teams":null,"club_emails":null}, - inittable: function() { - club.tbl = new Tabulator("#tbl_locations", { - selectable:1, - //selectablePersistence:false, // disable rolling selection - //responsiveLayout:"collapse", - //autoResize:true, - addRowPos:"top", - layout:"fitDataStretch", - //resizableRows:true, - columns:[ - {title:"Numm", field:"location"}, - {title:"Address", field:"fulladdress",formatter:"html"}, - {title:"Equipen", field:"teamlist"}, - ], - }); - club.gettbldata(); - }, - initform: function(){ - club.choices["location_teams"] = new SlimSelect({ - select: "#teams", - //[% IF session.usergroups.search('fld') != 1 %] - disabled : true, - //[% END %] - showSearch: false - }); - club.choices["club_emails"] = new SlimSelect({ - select: "#teams", - //[% IF session.usergroups.search('fld') != 1 %] - disabled : true, - //[% END %] - showSearch: false - }); - club.getclubdata(); - }, - gettbldata: function(){ - req.reqdata("POST","db.cgi",{"get":"locationlist","filter":"id_club=" + club.current_club +""},club.loadtbldata); - }, - loadtbldata: function(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } - }, - getclubdata: function(){ - req.reqdata("POST","db.cgi",{"get":"clublist","filter":"id=" + clubid +""},club.fillformclub); - }, - fillformclub: function(data){ - if (data && data.sqldata){ - form.fillformbydataclass2("clubs"); - var frm = document.querySelectorAll('.data_clubs'); - } - }, - newlocation: function(){ - var frm = document.querySelectorAll('.data_locations'); - for (var f in frm){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(""); - } else { - frm[f].value=""; - if (frm[f].id == 'teams'){ - locations_teams.clearStore(); - } - } - - } - } - document.getElementById("dlglocation").style.display = 'block'; - return false; - }, - editlocation: function(){ - var selectedData = tbl.getSelectedData(); - //console.log(selectedData); - if (selectedData && selectedData.length > 0){ - req.reqdata("POST","db.cgi",{"get":"locationlist","filter":"id=" + selectedData[0].id +""},showeditlocation); - } else { - showsnackbar("orange","Keen Spilluert ausgewielt!"); - } - - return false; - }, - showeditlocation: function(data){ - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_locations'); - for (var f in frm){ - //console.log(frm[f].id); - if (data.sqldata[0][frm[f].id]){ - //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id); - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - //frm[f].flatpickr.setDate(data.sqldata[0][frm[f].id]) - }else { - frm[f].value=data.sqldata[0][frm[f].id]; - if (frm[f].tagName == 'SELECT'){ - frm[f].dataset.selected = data.sqldata[0][frm[f].id]; - } - if (frm[f].id == 'teams'){ - //console.log("is tagedit!"); - locations_teams.clearStore(); - locations_teams.setValue(JSON.parse(data.sqldata[0][frm[f].id])); - - } - } - - } - } - - } - } - document.getElementById("dlglocation").style.display = 'block'; - }, - getclubmembers: function(){ - req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club=" + clubid +" and status='aktiv'"},fillclubmembers); - }, - fillclubmembers: function(data){ - var xlist = [{"value":"","label":""}]; - var idlist = {"":""}; - if (data && data.sqldata){ - for (var i in data.sqldata){ - xlist.push({value:data.sqldata[i].id,label:data.sqldata[i].surname + ' ' + data.sqldata[i].prename}); - idlist[data.sqldata[i].id] = data.sqldata[i].surname + ' ' + data.sqldata[i].prename - } - } - console.log(xlist); - if (document.getElementById('id_president').tagName == "SELECT"){ - sel_id_president = new Choices('#id_president',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : xlist - }); - sel_id_president.setChoiceByValue(document.getElementById("id_president").dataset.selected); - - } else { - document.getElementById('id_president').value = idlist[document.getElementById('id_president').value]; - } - if (document.getElementById('id_secretaire').tagName == "SELECT"){ - sel_id_secretaire = new Choices('#id_secretaire',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices: xlist - }); - sel_id_secretaire.setChoiceByValue(document.getElementById("id_secretaire").dataset.selected); - }else { - document.getElementById('id_secretaire').value = idlist[document.getElementById('id_secretaire').value]; - - } - if (document.getElementById('id_tresorier').tagName == "SELECT"){ - sel_id_tresorier = new Choices('#id_tresorier',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices: xlist - }); - sel_id_tresorier.setChoiceByValue(document.getElementById("id_tresorier").dataset.selected); - }else { - document.getElementById('id_tresorier').value = idlist[document.getElementById('id_tresorier').value]; - } -}, - -deletelocation: function(){ - var selectedData = tbl.getSelectedData(); - console.log(selectedData); - if (selectedData && selectedData.length > 0){ - if (confirm("desen Spilluert wierklech läschen?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_locations_id":selectedData[0].id},afterlocationupdate); - - } - - } else { - showsnackbar("orange","Keen Spilluert ausgewielt!"); - } - - return false; -}, - -savelocation: function(){ - saveform('locations',afterlocationupdate); - document.getElementById('dlglocation').style.display='none'; - return false; -}, - - -afterlocationupdate: function(data){ - gettbldata(); -}, - - - -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/club.tt b/app/tmpl/module/clubs/club.tt deleted file mode 100644 index 63d5caa..0000000 --- a/app/tmpl/module/clubs/club.tt +++ /dev/null @@ -1,109 +0,0 @@ -
    -
    - zerëck -
    Club
    -
    -
    - -[% PROCESS macro/fields.tt %] -[% #INCLUDE "module/$module/toolbar.tt" %] - - -[% puserdef = dksdb.prepare("select ml.id_user from vw_licenselist ll join members ml on (ll.id_member=ml.id) where ll.id_club=? and ml.id_user=? and ll.yearin is not null and ll.yearout is null;") %] -[% FOREACH ruserdef = puserdef.execute(2,session.id) %] -[% IF ruserdef.id_user == session.id %] - [% udef = ruserdef.id_user %] -[% END %] -[% END %] - -[% inputdisabled = 'readonly' %] -[% IF ((session.usergroups.search('club') == 1 && udef == session.id) || (session.usergroups.search('fld') == 1)) %] -[% inputdisabled = '' %] -[% END %] -
    -
    -
    -
    - [% fieldhidden('id','clubs','ident') %] -
    -
    - [% fieldeditbox('club','clubs','Numm vum Club','',inputdisabled) %] -
    -
    -

    Spilluerter

    -
    - [% IF inputdisabled == '' %] - - - - [% END %] -
    -
    -
    -
    -
    -
    -

    Responsabel Memberen

    - [% fieldselectbox('id_president','clubs','President','third',inputdisabled) %] - [% fieldselectbox('id_secretaire','clubs','Sektretär','third',inputdisabled) %] - [% fieldselectbox('id_tresorier','clubs','Trésorier','third',inputdisabled) %] -
    -
    -

    Courrier E-mail-Addressen

    - [% fieldtagbox('emails','clubs','E-Mail-Addressen fir den Courrier','',inputdisabled) %] -

    Courrier Facturations-Address

    - [% fieldeditbox('surname','clubs','Numm','half',inputdisabled) %] - [% fieldeditbox('prename','clubs','Virnumm','half',inputdisabled) %] - [% fieldeditbox('address','clubs','Address','',inputdisabled) %] - [% fieldeditbox('zip','clubs','CP','quarter',inputdisabled) %] - [% fieldeditbox('city','clubs','Uerschaft','half',inputdisabled) %] - [% fieldeditbox('country','clubs','Land','quarter',inputdisabled) %] -
    - [% IF inputdisabled == '' %] -
    - -
    - [% END %] -
    -
    -
    -
    - -
    -
    - -
    - - - - \ No newline at end of file diff --git a/app/tmpl/module/clubs/clubmembers.js b/app/tmpl/module/clubs/clubmembers.js deleted file mode 100644 index 4824d5c..0000000 --- a/app/tmpl/module/clubs/clubmembers.js +++ /dev/null @@ -1,53 +0,0 @@ -function initpage(){ - clubmembers.inittable(); -} - -let clubmembers ={ - tbl: null, - current_club: "[% session.id_club %]", - inittable: function(){ - clubmembers.tbl = new Tabulator("#tbl_clubmembers", { - height: "calc(100vh - 56px)", - selectable:1, - //selectablePersistence:false, // disable rolling selection - //responsiveLayout:"collapse", - //autoResize:true, - //addRowPos:"top", - layout:"fitDataStretch", - resizableRows:true, - columnHeaderSortMulti:false, - rowClick:function(e, row){ - //var data = row.getData(); - //console.log(data); - //idmember=data.id; - //console.log(idmember); - //loadmemberdata(idmember); - //e - the click event object - //row - row component - }, - columns:[ - // {title:"Club", field:"club", sorter:"string",formatter:"html",headerFilter:"input"}, - {title:"Numm", field:"surname", sorter:"string"}, - {title:"Virnumm", field:"prename", sorter:"string"}, - {title:"Lizenz", field:"license", sorter:"string"}, - {title:"E-Mail", field:"username", sorter:"string"}, - - // {title:"Status", field:"status", sorter:"string",headerFilter:"input"}, - ], - //autoColumns:true, - }); - clubmembers.gettbldata(); - }, - gettbldata: function(){ - req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club="+ clubmembers.current_club +" and status='aktiv' "},clubmembers.loadtbldata); - }, - loadtbldata: function(data){ - if (data && data.sqldata){ - clubmembers.tbl.setData(data.sqldata); - } - }, - - initform: function(){ - - } -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/clubmembers.tt b/app/tmpl/module/clubs/clubmembers.tt deleted file mode 100644 index 137e74f..0000000 --- a/app/tmpl/module/clubs/clubmembers.tt +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    - zerëck -
    Club-Memberen
    -
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/clubs/clubs.js b/app/tmpl/module/clubs/clubs.js deleted file mode 100644 index 12e871f..0000000 --- a/app/tmpl/module/clubs/clubs.js +++ /dev/null @@ -1,3 +0,0 @@ -function initpage(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/clubs.tt b/app/tmpl/module/clubs/clubs.tt deleted file mode 100644 index 0650167..0000000 --- a/app/tmpl/module/clubs/clubs.tt +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    - zerëck -
    Clubs
    -
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/clubs/cupreg.js b/app/tmpl/module/clubs/cupreg.js deleted file mode 100644 index a8aa1cb..0000000 --- a/app/tmpl/module/clubs/cupreg.js +++ /dev/null @@ -1,6 +0,0 @@ -function initpage(){ - -} -let cupreg = { - -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/cupreg.tt b/app/tmpl/module/clubs/cupreg.tt deleted file mode 100644 index 36540ef..0000000 --- a/app/tmpl/module/clubs/cupreg.tt +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    - zerëck -
    Club-Umeldung Coupe (Saison YYYY-YYYY)
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/clubs/fldmembers.js b/app/tmpl/module/clubs/fldmembers.js deleted file mode 100644 index 6f97161..0000000 --- a/app/tmpl/module/clubs/fldmembers.js +++ /dev/null @@ -1,52 +0,0 @@ -function initpage(){ - clubmembers.inittable(); -} - -let clubmembers ={ - tbl: null, - //current_club: "[% session.id_club %]", - inittable: function(){ - clubmembers.tbl = new Tabulator("#tbl_fldmembers", { - height: "calc(100vh - 56px)", - selectable:1, - //selectablePersistence:false, // disable rolling selection - //responsiveLayout:"collapse", - //autoResize:true, - //addRowPos:"top", - layout:"fitDataStretch", - resizableRows:true, - columnHeaderSortMulti:false, - rowClick:function(e, row){ - //var data = row.getData(); - //console.log(data); - //idmember=data.id; - //console.log(idmember); - //loadmemberdata(idmember); - //e - the click event object - //row - row component - }, - columns:[ - {title:"Club", field:"club", sorter:"string",formatter:"html",headerFilter:"input"}, - {title:"Numm", field:"surname", sorter:"string",headerFilter:"input"}, - {title:"Virnumm", field:"prename", sorter:"string",headerFilter:"input"}, - {title:"Lizenz", field:"license", sorter:"string",headerFilter:"input"}, - {title:"E-Mail", field:"username", sorter:"string"}, - {title:"Status", field:"status", sorter:"string",headerFilter:"input"}, - ], - //autoColumns:true, - }); - clubmembers.gettbldata(); - }, - gettbldata: function(){ - req.reqdata("POST","db.cgi",{"get":"memberlist"},clubmembers.loadtbldata); - }, - loadtbldata: function(data){ - if (data && data.sqldata){ - clubmembers.tbl.setData(data.sqldata); - } - }, - - initform: function(){ - - } -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/fldmembers.tt b/app/tmpl/module/clubs/fldmembers.tt deleted file mode 100644 index f581aa0..0000000 --- a/app/tmpl/module/clubs/fldmembers.tt +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    - zerëck -
    Club-Memberen
    -
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/clubs/seasonclubreg.js b/app/tmpl/module/clubs/seasonclubreg.js deleted file mode 100644 index 078b8f5..0000000 --- a/app/tmpl/module/clubs/seasonclubreg.js +++ /dev/null @@ -1,7 +0,0 @@ -function initpage(){ - -} - -let clubreg = { - -} \ No newline at end of file diff --git a/app/tmpl/module/clubs/seasonclubreg.tt b/app/tmpl/module/clubs/seasonclubreg.tt deleted file mode 100644 index ffa342e..0000000 --- a/app/tmpl/module/clubs/seasonclubreg.tt +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    - zerëck -
    Club-Umeldung Saison YYYY-YYYY
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/documents.tt b/app/tmpl/module/documents.tt deleted file mode 100644 index 2c84b0e..0000000 --- a/app/tmpl/module/documents.tt +++ /dev/null @@ -1,57 +0,0 @@ -[% PROCESS macro/fields.tt %] -[% USE date %] -[% vstamp=date.format(date.now, '%d%m%Y%H') %] -
    -
    - zerëck -
    Dokumenter
    - [% IF session.usergroups.search('fld') == 1 %] - - [% END %] -
    -
    -
    -
      - [% FOREACH doc=dksdb.query("select * from vw_documentlist order by filename;") %] -
    • - [% IF session.usergroups.search('fld') == 1 %] - - - [% END %] - - -
      - [% doc.filename %]
      - [% doc.description %] -
      -
    • - [% END %] -
    -
    - -[% INCLUDE block/dlguploadfile.tt %] - - \ No newline at end of file diff --git a/app/tmpl/module/documents/documents.js b/app/tmpl/module/documents/documents.js deleted file mode 100644 index 4f28825..0000000 --- a/app/tmpl/module/documents/documents.js +++ /dev/null @@ -1,98 +0,0 @@ -function initpage(){ - documents.init(); -} - -let documents = { - tbl: null, - init: function(){ - - tinymce.init({ - selector: '.richeditarea', - branding: false, - menubar:false, - statusbar: false, - forced_root_block : '', - plugins: 'searchreplace autolink directionality visualblocks visualchars advlist lists textcolor colorpicker textpattern', - toolbar: 'bold italic underline strikethrough forecolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat', - image_advtab: true - // //console.log(editor.getContent()); - }); - documents.tbl = new Tabulator("#tbl_documents", { - height: "calc(100vh - 125px)", - selectable:1, - selectablePersistence:false, // disable rolling selection - // responsiveLayout:"collapse", - autoResize:true, - layout:"fitDataFill", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Thumb", field:"thumbnail",headerSort: false, formatter:"image", formatterParams:{height: 64}}, - {title:"Fichier", field:"filename", headerSort: false, formatter:"link"}, - {title:"Beschreiwung", field:"description",headerSort: false, formatter: "html"} - ] - }); - //documents.gettbldata(); - }, - // gettbldata: function (){ - // req.reqdata("POST","db.cgi",{"get":"documentlist","filter":"folder='documents' "},documents.loadtbldata); - // }, - // loadtbldata:function (data){ - // //console.logconsole.log(data) - // if (data && data.sqldata){ - // documents.tbl.setData(data.sqldata); - // } - // }, - afterformsaved : function (){ - app.loadpage('module/[% module %]/index.html'); - return false; - }, - remove: function(id){ - if (confirm("Bass du secher dass du dëst Document läschen wëlls?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_documents_id":id},documents.closeeditdialog); - } - return false; - }, - edit: function(id){ - req.reqdata("POST","db.cgi",{"get":"documents","filter":"id='"+ id + "'"},documents.openedit); - return false; - }, - add: function(){ - opendlgfileupload('documents','download_document',''); - return false; - }, - openedit: function(data){ - //console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_documents'); - for (var f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - //console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - document.getElementById('dlgeditdocument').style.display='block'; - } - return false; -}, -closeeditdialog: function(){ - document.getElementById('dlgeditdocument').style.display='none'; - app.loadpage('module/[% module %]/index.html'); -}, -thumbformatter: function(cell, formatterParams, onRendered){ - if (cell.getValue()){ - return ''; - } - return ''; -} -} \ No newline at end of file diff --git a/app/tmpl/module/documents/index.js b/app/tmpl/module/documents/index.js deleted file mode 100644 index 0895172..0000000 --- a/app/tmpl/module/documents/index.js +++ /dev/null @@ -1,60 +0,0 @@ -function initpage(){ - tinymce.init({ - selector: '.richeditarea', - branding: false, - menubar:false, - statusbar: false, - forced_root_block : '', - plugins: 'searchreplace autolink directionality visualblocks visualchars advlist lists textcolor colorpicker textpattern', - toolbar: 'bold italic underline strikethrough forecolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat', - image_advtab: true - // //console.log(editor.getContent()); - }); -} - -afterformsaved = function (){ - parent.admin.loadpage('module/[% module %]/index.html'); - return false; -} - -function deletedocument(id){ - if (confirm("Bass du secher dass du dëst Document läschen wëlls?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_documents_id":id},closeeditdialog); - } - return false; -} - -function editdocument(id){ - req.reqdata("POST","db.cgi",{"get":"documents","filter":"id="+ id},openedit); - return false; -} - -function openedit(data){ - //console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_documents'); - for (var f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - //console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - document.getElementById('dlgeditdocument').style.display='block'; - } - return false; -} - -function closeeditdialog(){ - document.getElementById('dlgeditdocument').style.display='none'; - parent.admin.loadpage('module/[% module %]/index.html'); -} \ No newline at end of file diff --git a/app/tmpl/module/events.tt b/app/tmpl/module/events.tt deleted file mode 100644 index d362f2c..0000000 --- a/app/tmpl/module/events.tt +++ /dev/null @@ -1,55 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - zerëck -
    Event-Kalenner
    - - - - - - -
    -
    -
    - - - - - - \ No newline at end of file diff --git a/app/tmpl/module/events/events.js b/app/tmpl/module/events/events.js deleted file mode 100644 index 6e61572..0000000 --- a/app/tmpl/module/events/events.js +++ /dev/null @@ -1,229 +0,0 @@ - -let tbl = null; -let sel_id_eventgroup = null; - -function initpage(){ - - events.inittable(); - events.initform(); -} - -let events = { - tbl: null, - choices:{"id_eventgroup":{},"id_season":{}}, - initform: function(){ - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - tinymce.init({ - selector: '.richeditarea', - plugins: 'paste importcss searchreplace autolink directionality code visualblocks visualchars link charmap advlist lists textpattern noneditable charmap emoticons', - - menubar: false, - statusbar: false, - toolbar: 'undo redo | bold italic underline strikethrough | fontsizeselect | alignleft aligncenter alignright alignjustify | numlist bullist | forecolor removeformat | charmap emoticons | link', - toolbar_sticky: true, - height: 150, - language: 'de', - content_css: [ - '[% abspath %][% staticpath %]css/theme.css' - ], - forced_root_block : '', - branding: false, - importcss_append: true, - contextmenu: "link", - }); - // sel_id_eventgroup = new Choices('#id_eventgroup',{ - // searchEnabled: false, - // itemSelectText: 'auswielen...', - // removeItemButton: true, - // choices :[] - // }); - events.getseasons(); - events.getcategories(); - }, - inittable: function(){ - - events.tbl = new Tabulator("#tbl_calendar", { - headerFilterPlaceholder:"filter...", - height: "calc(100vh - 125px)", - selectable:1, - selectablePersistence:false, // disable rolling selection - // responsiveLayout:"collapse", - autoResize:true, - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Saison", field:"season", sorter:"string",headerFilter:"input", width: 110}, - {title:"Kategorie", field:"groupname", sorter:"string",headerFilter:"input",width: 130}, - {title:"vun", field:"dspstartdate", sorter:"string",headerFilter:"input", width: 115}, - {title:"bis", field:"dspenddate", sorter:"string",headerFilter:"input", width: 115}, - {title:"Titel", field:"title", sorter:"string",headerFilter:"input"}, - {title:"Beschreiwung", field:"description",formatter:"html", sorter:"string",headerFilter:"input"}, - ], - initialHeaderFilter:[ - {field:"season", value:"[% season %]"} //set the initial value of the header filter to "red" - ] - - //autoColumns:true, - }); - - events.gettbldata(); - }, - gettbldata: function (){ - req.reqdata("POST","db.cgi",{"get":"eventlist"},events.loadtbldata); - }, - loadtbldata:function (data){ - //console.logconsole.log(data) - if (data && data.sqldata){ - events.tbl.setData(data.sqldata); - } - }, - closeeditdialog: function(){ - gettbldata(); - document.getElementById('dlgevents').style.display='none'; - gettbldata(); - }, - add:function (){ - let frm = document.querySelectorAll('.data_events'); - for (let f in frm){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || (frm[f].tagName == 'TEXTAREA')){ - if (frm[f].classList.contains("datefield")){ - if (frm[f]._flatpickr){ - frm[f]._flatpickr.clear(); - } - } else if (frm[f].classList.contains("richeditarea")){ - //console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(""); - }else { - frm[f].value=""; - - } - - } - } - - - document.getElementById("dlgevents").style.display = 'block'; - - }, - edit: function (){ - let udata = events.tbl.getSelectedData(); - let uid = udata[0].id; - //console.log(uid); - req.reqdata("POST","db.cgi",{"get":"eventlist","filter":"id=" + uid},events.fillformevents); - - }, - - fillformevents:function (data){ - //console.log(data); - if (data && data.sqldata){ - let frm = document.querySelectorAll('.data_events'); - for (let f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - // console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else if (frm[f].id == 'id_eventgroup'){ - sel_id_eventgroup.setChoiceByValue(data.sqldata[0][frm[f].id]); - } - else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - document.getElementById("dlgevents").style.display = 'block'; - - - } - }, - - - remove: function (){ - let udata = events.tbl.getSelectedData(); - let uid = udata[0].id; - //console.log(tbl.getSelectedData()); - if (confirm("Bass du secher dass déi ausgewielten Event läschen wells?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_event_id":udata[0].id},events.gettbldata); - } - }, - getseasons:function (){ - req.reqdata("POST","db.cgi",{"get":"seasons"},events.fillseasons); - return false; - }, - - fillseasons: function (data){ - - let seasonlist = []; - let seasonidlist = {"":""}; - if (data && data.sqldata){ - for (let i in data.sqldata){ - seasonlist.push({value:data.sqldata[i].season,label:data.sqldata[i].season}); - seasonidlist[data.sqldata[i].id] = data.sqldata[i].season; - } - } - if (document.getElementById('season').tagName == "SELECT"){ - sel_id_season = new Choices('#season',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - choices : seasonlist, - shouldSort: false, - shouldSortItems: false - }); - sel_id_season.setChoiceByValue(document.getElementById("season").dataset.selected); - - } else { - document.getElementById('season').value = seasonidlist[document.getElementById('season').value]; - } - return false; - }, - - getcategories: function (){ - req.reqdata("POST","db.cgi",{"get":"eventgroups"},events.fillcategories); - return false; - }, - - fillcategories:function (data){ - - let catlist = []; - if (data && data.sqldata){ - for (let i in data.sqldata){ - catlist.push({value:data.sqldata[i].id,label:data.sqldata[i].groupname}); - } - } - sel_id_eventgroup.setChoices(catlist, 'value', 'label', true); - - return false; - } -} - -// let seasons = { -// tbl: null, -// init: function(){ - -// }, -// gettbldata: function (){ -// req.reqdata("POST","db.cgi",{"get":"seasons"},seasons.loadtbldata); -// }, -// loadtbldata:function (data){ -// //console.logconsole.log(data) -// if (data && data.sqldata){ -// events.tbl.setData(data.sqldata); -// } -// }, - -// } - - - - - diff --git a/app/tmpl/module/events/vacancies.js b/app/tmpl/module/events/vacancies.js deleted file mode 100644 index 148225e..0000000 --- a/app/tmpl/module/events/vacancies.js +++ /dev/null @@ -1,204 +0,0 @@ - - -let vacanies = { - -} -// var tbl = null; -// var sel_id_eventgroup = null; -// function initpage(){ -// flatpickr(".datefield",{altInput: true, -// altFormat: "d.m.Y", -// dateFormat: "Y-m-d", -// "locale": "fr", -// }); -// sel_id_eventgroup = new Choices('#id_eventgroup',{ -// searchEnabled: false, -// itemSelectText: 'auswielen...', -// removeItemButton: true, -// choices :[] -// }); - -// tinymce.init({ -// selector: '.richeditarea', -// plugins: 'paste importcss searchreplace autolink autoresize directionality code visualblocks visualchars link charmap advlist lists textpattern noneditable charmap emoticons', - -// menubar: false, -// statusbar: false, -// toolbar: 'undo redo | bold italic underline strikethrough | fontsizeselect | alignleft aligncenter alignright alignjustify | numlist bullist | forecolor removeformat | charmap emoticons | link', -// toolbar_sticky: true, -// min_height: 350, -// language: 'de', -// content_css: [ -// '[% abspath %]css/w3pro.css' -// ], -// forced_root_block : '', -// branding: false, -// importcss_append: true, -// contextmenu: "link", -// }); - -// tbl = new Tabulator("#tbl_calendar", { -// headerFilterPlaceholder:"filter...", -// height: "93vh", -// selectable:1, -// selectablePersistence:false, // disable rolling selection -// responsiveLayout:"collapse", -// autoResize:true, -// layout:"fitColumns", -// resizableRows:true, -// columnHeaderSortMulti:false, -// columns:[ -// {title:"Saison", field:"season", sorter:"string",headerFilter:"input", width: 110}, -// {title:"Kategorie", field:"groupname", sorter:"string",headerFilter:"input",width: 130}, -// {title:"vun", field:"dspstartdate", sorter:"string",headerFilter:"input", width: 115}, -// {title:"bis", field:"dspenddate", sorter:"string",headerFilter:"input", width: 115}, -// {title:"Titel", field:"title", sorter:"string",headerFilter:"input"}, -// {title:"Beschreiwung", field:"description",formatter:"html", sorter:"string",headerFilter:"input"}, -// ], -// initialHeaderFilter:[ -// {field:"season", value:"[% season %]"} //set the initial value of the header filter to "red" -// ] - -// //autoColumns:true, -// }); -// getseasons(); -// getcategories(); -// gettbldata(); -// } - -// function gettbldata(){ -// req.reqdata("POST","db.cgi",{"get":"eventlist"},loadtbldata); -// } - -// function loadtbldata(data){ -// //console.logconsole.log(data) -// if (data && data.sqldata){ -// tbl.setData(data.sqldata); -// } -// } - -// function closeeditdialog(){ -// gettbldata(); -// document.getElementById('dlgevents').style.display='none'; -// gettbldata(); -// } - -// function add(){ -// var frm = document.querySelectorAll('.data_events'); -// for (var f in frm){ -// if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || (frm[f].tagName == 'TEXTAREA')){ -// if (frm[f].classList.contains("datefield")){ -// if (frm[f]._flatpickr){ -// frm[f]._flatpickr.clear(); -// } -// } else if (frm[f].classList.contains("richeditarea")){ -// //console.log(frm[f].id + " is richeditarea"); -// tinymce.get(frm[f].id).setContent(""); -// }else { -// frm[f].value=""; - -// } - -// } -// } - - -// document.getElementById("dlgevents").style.display = 'block'; - -// } - -// function edit(){ -// var udata = tbl.getSelectedData(); -// var uid = udata[0].id; -// //console.log(uid); -// req.reqdata("POST","db.cgi",{"get":"eventlist","filter":"id=" + uid},fillformevents); - -// } - -// function fillformevents(data){ -// //console.log(data); -// if (data && data.sqldata){ -// var frm = document.querySelectorAll('.data_events'); -// for (var f in frm){ -// //console.log(frm[f].classList); -// if (data.sqldata[0][frm[f].id]){ -// if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ -// if (frm[f].classList.contains("datefield")){ -// frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); -// } else if (frm[f].classList.contains("richeditarea")){ -// // console.log(frm[f].id + " is richeditarea"); -// tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); -// } else if (frm[f].id == 'id_eventgroup'){ -// sel_id_eventgroup.setChoiceByValue(data.sqldata[0][frm[f].id]); -// } -// else { -// frm[f].value=data.sqldata[0][frm[f].id]; -// } - -// } -// } -// } -// document.getElementById("dlgevents").style.display = 'block'; - - -// } -// } - - -// function remove(){ -// var udata = tbl.getSelectedData(); -// var uid = udata[0].id; -// //console.log(tbl.getSelectedData()); -// if (confirm("Bass du secher dass déi ausgewielten Event läschen wells?")){ -// req.reqdata("POST","db.cgi",{"del":"1","ident_event_id":udata[0].id},gettbldata); -// } -// } - -// function getseasons(){ -// req.reqdata("POST","db.cgi",{"get":"seasons"},fillseasons); -// return false; -// } - -// function fillseasons(data){ - -// var seasonlist = []; -// var seasonidlist = {"":""}; -// if (data && data.sqldata){ -// for (var i in data.sqldata){ -// seasonlist.push({value:data.sqldata[i].season,label:data.sqldata[i].season}); -// seasonidlist[data.sqldata[i].id] = data.sqldata[i].season; -// } -// } -// if (document.getElementById('season').tagName == "SELECT"){ -// sel_id_season = new Choices('#season',{ -// searchEnabled: false, -// itemSelectText: 'auswielen...', -// choices : seasonlist, -// shouldSort: false, -// shouldSortItems: false -// }); -// sel_id_season.setChoiceByValue(document.getElementById("season").dataset.selected); - -// } else { -// document.getElementById('season').value = seasonidlist[document.getElementById('season').value]; -// } -// return false; -// } - -// function getcategories(){ -// req.reqdata("POST","db.cgi",{"get":"eventgroups"},fillcategories); -// return false; -// } - -// function fillcategories(data){ - -// var catlist = []; -// if (data && data.sqldata){ -// for (var i in data.sqldata){ -// catlist.push({value:data.sqldata[i].id,label:data.sqldata[i].groupname}); -// } -// } -// sel_id_eventgroup.setChoices(catlist, 'value', 'label', true); - -// return false; -// } \ No newline at end of file diff --git a/app/tmpl/module/forms.tt b/app/tmpl/module/forms.tt deleted file mode 100644 index 9706767..0000000 --- a/app/tmpl/module/forms.tt +++ /dev/null @@ -1,14 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - - - - - - -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/app/tmpl/module/forms/forms.js b/app/tmpl/module/forms/forms.js deleted file mode 100644 index f27f864..0000000 --- a/app/tmpl/module/forms/forms.js +++ /dev/null @@ -1,50 +0,0 @@ -var tbl = null; -function initpage(){ - tbl = new Tabulator("#tbl_transfer", { - height: "100vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Club", field:"newclub",headerFilter:"input"}, - {title:"Numm", field:"surname",headerFilter:"input"}, - {title:"Virnumm", field:"prename",headerFilter:"input"}, - {title:"Type Demande", field:"documenttype",headerFilter:"input"}, - {title:"Datum", field:"statusdate", sorter:"date"}, - {title:"Status", field:"status", sorter:"string",formatter:"html"} - ] -}); -gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"transferlist"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - - - -function edit(){ - var udata = tbl.getSelectedData(); - //var uid = udata[0].id; - console.log(udata); - app.loadpage('module/[% module %]/transfer.html?doctype=' + udata[0].documenttype + "&id=" + udata[0].id); -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - if (confirm("Bass du secher dass den ausgewielten Transfer läschen wells?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_transfer_id":udata[0].id},gettbldata); - } -} \ No newline at end of file diff --git a/app/tmpl/module/index.tt b/app/tmpl/module/index.tt deleted file mode 100644 index 888f16e..0000000 --- a/app/tmpl/module/index.tt +++ /dev/null @@ -1,60 +0,0 @@ - -
    -
    -
    - -
    Lëtzebuerger Electronique Darts Federation
    - Logout -
    -
    -
    -
    -
    -
    -
    -
    - Site -
    - -
    - -
    -
    -

    Administration

    -
    - -
    - -
    -
    -

    Access

    -
    -
    - Users -
    -
    - - -
    - \ No newline at end of file diff --git a/app/tmpl/module/index/index.js b/app/tmpl/module/index/index.js deleted file mode 100644 index 12e871f..0000000 --- a/app/tmpl/module/index/index.js +++ /dev/null @@ -1,3 +0,0 @@ -function initpage(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/licenses/index.js b/app/tmpl/module/licenses/index.js deleted file mode 100644 index 12e871f..0000000 --- a/app/tmpl/module/licenses/index.js +++ /dev/null @@ -1,3 +0,0 @@ -function initpage(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/licenses/index.tt b/app/tmpl/module/licenses/index.tt deleted file mode 100644 index 9c731f6..0000000 --- a/app/tmpl/module/licenses/index.tt +++ /dev/null @@ -1,33 +0,0 @@ - -
    -
    - zerëck -
    Lizenzen
    -
    -
    - -
    -
    -
      -[% FOREACH clubs=dksdb.query("select cl.id,cl.club,replace(cl.club,'''','\\''') as clublink,cl.link,cl.logo,count(distinct(lic.id)) as licenses,count(distinct(cst.id)) as teams -from vw_clublist cl -left join vw_licenselist lic on (cl.id=lic.id_club) -left join vw_locationlist loc on (cl.id = loc.id_club) -left join (select ct.* from csteams ct join csseasonranking csr on (csr.id_team=ct.id and csr.id_season=2)) cst on (cl.id=cst.id_club) -where lic.status='aktiv' and (cl.status is null or cl.status='individual') -group by cl.id,cl.club,cl.link,cl.logo order by cl.club;"); %] - -
    • - Logo [% clubs.club %] -
      - [% clubs.club %] - Lizenzen: [% clubs.licenses %] Équipen: [% clubs.teams %] -
      -
    • - -[% END %] -
    -
    -
    - - diff --git a/app/tmpl/module/licenses/licenserequests.js b/app/tmpl/module/licenses/licenserequests.js deleted file mode 100644 index e69de29..0000000 diff --git a/app/tmpl/module/licenses/licenserequests.tt b/app/tmpl/module/licenses/licenserequests.tt deleted file mode 100644 index ffb2b1d..0000000 --- a/app/tmpl/module/licenses/licenserequests.tt +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    - zerëck -
    Lizenz-Ufroën
    -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/licenses/licenses.js b/app/tmpl/module/licenses/licenses.js deleted file mode 100644 index 12e871f..0000000 --- a/app/tmpl/module/licenses/licenses.js +++ /dev/null @@ -1,3 +0,0 @@ -function initpage(){ - -} \ No newline at end of file diff --git a/app/tmpl/module/licenses/licenses.tt b/app/tmpl/module/licenses/licenses.tt deleted file mode 100644 index 1004fd2..0000000 --- a/app/tmpl/module/licenses/licenses.tt +++ /dev/null @@ -1,45 +0,0 @@ -
    -
    - -[% qclubs = dksdb.prepare("select ml.id,ml.link,ml.prename,ml.surname,ml.status,ll.license,ml.nationality,to_char(ml.birthday,'DD.MM.YYYY') as dspbirthday,ml.profile_photo,extract(epoch from ml.modified) as modified from vw_licenselist ll join members ml on (ll.id_member=ml.id) where ll.id_club=? and ll.yearin is not null and ll.yearout is null -order by ml.surname,prename;") %] -[% FOREACH cl = qclubs.execute(params.id) %] - -
    -

    [% cl.prename %] [% cl.surname %]

    -
    -
    - - [% IF cl.status == "suspended" %][% END %] - - - - -
    License suspendue
    Lizenz: [% cl.license %]
    Nationalitéit: [% cl.nationality %]
    Geburtsdatum: [% cl.dspbirthday %]
    -
    -
    - - [% licenses = dksdb.prepare("select lic.*,cl.club,cl.status as clubstatus from licenses lic left join clubs cl on (lic.id_club=cl.id) where id_member=? order by lic.yearin desc,lic.yearout desc;") %] - [% FOREACH lic = dksdb.execute(cl.id) %] - - - - - - [% END %] - -
    [% lic.club %][% lic.yearin %] [% IF lic.yearout %] - [% lic.yearout %][% END %]
    -
    -
    -
    - -[% END %] -
    -
    - - - diff --git a/app/tmpl/module/licenses/members.js b/app/tmpl/module/licenses/members.js deleted file mode 100644 index d3ce2ad..0000000 --- a/app/tmpl/module/licenses/members.js +++ /dev/null @@ -1,119 +0,0 @@ -var tbl = null; -var tbllic = null; -var idmember=null; -var iduser="[% session.id %]"; -function initpage(){ - - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - tbl = new Tabulator("#tbl_members", { - height: "100vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - rowClick:function(e, row){ - var data = row.getData(); - //console.log(data); - idmember=data.id; - //console.log(idmember); - loadmemberdata(idmember); - //e - the click event object - //row - row component - }, - columns:[ - // {title:"Club", field:"club", sorter:"string",formatter:"html",headerFilter:"input"}, - {title:"Numm", field:"surname", sorter:"string",headerFilter:"input"}, - {title:"Virnumm", field:"prename", sorter:"string",headerFilter:"input"}, - // {title:"Status", field:"status", sorter:"string",headerFilter:"input"}, - ], - initialHeaderFilter:[ - {field:"status", value:"active"} //set the initial value of the header filter to "red" - ] - - //autoColumns:true, -}); -tbllic = new Tabulator("#tbl_license", { - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - // rowClick:function(e, row){ - // var data = row.getData(); - // console.log(data); - // idmember=row.id; - // loadmemberdata(row.id); - // //e - the click event object - // //row - row component - // }, - columns:[ - {title:"Lizenz", field:"license", sorter:"number"}, - {title:"vun", field:"yearin", sorter:"number"}, - {title:"bis", field:"yearout", sorter:"number"}, - {title:"Club", field:"club", sorter:"string",formatter:"html"} - ], - //autoColumns:true, -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club in (select id_club from vw_memberlist where id="+ iduser +") "},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function loadmemberdata(id){ - //console.log(id); - req.reqdata("POST","db.cgi",{"get":"memberdata","filter":"id="+id},fillformmember); - req.reqdata("POST","db.cgi",{"get":"licenselist","filter":"id_member="+id},filllicensetable); - req.reqdata("POST","db.cgi",{"get":"userstatus","filter":"id="+id},filluserstaus); -} - -function fillformmember(data){ - //console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_members'); - for (var f in frm){ - //console.log(frm[f].id); - if (data.sqldata[0][frm[f].id]){ - //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id); - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - //frm[f].flatpickr.setDate(data.sqldata[0][frm[f].id]) - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - } -} - -function filllicensetable(data){ - //console.log("License DATA"); - //console.log(data.sqldata); - if (data && data.sqldata){ - tbllic.setData(data.sqldata); - } -} - -function filluserstaus(data){ - -} diff --git a/app/tmpl/module/licenses/members.tt b/app/tmpl/module/licenses/members.tt deleted file mode 100644 index eb4939f..0000000 --- a/app/tmpl/module/licenses/members.tt +++ /dev/null @@ -1,74 +0,0 @@ - -[% PROCESS macro/fields.tt %] -
    -
    - zerëck -
    Club-Memberen
    -
    -
    -
    - -
    -
    -
    -
    -
    - [% #tabletoolbar('member') %] -
    -
    -

    Perséinlech Donnéen

    -
    - [% fieldeditbox('surname','members','Numm','half','') %] - [% fieldeditbox('prename','members','Virnumm','half','') %] - [% fieldeditbox('address','members','Address','','') %] - [% fieldeditbox('zip','members','CP','quarter','') %] - [% fieldeditbox('city','members','Uerschaft','threequarter','') %] - [% fieldeditbox('country','members','Land','third','') %] - [% fieldeditbox('email','members','E-Mail','third','','') %] - [% fieldeditbox('phone','members','Telefon','third','') %] - [% fieldeditbox('nationality','members','Nationalitéit','third','') %] - [% fielddatebox('birthday','members','Gebuertsdatum','third','') %] - [% fielddatebox('entrydate','members','Datum 1st Lizenz','third','') %] -
    -
    -
    -

    Photo

    -
    -
    -
    -

    Validéiert Photo

    - -
    - -
    -

    Nei Photo

    - - - -
    -
    -
    -
    -
    -

    Benotzer-Kont

    -
    -
    Status
    - - - -
    -
    -
    -

    Lizenz

    -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/app/tmpl/module/licenses/newlicense.js b/app/tmpl/module/licenses/newlicense.js deleted file mode 100644 index b5a1f75..0000000 --- a/app/tmpl/module/licenses/newlicense.js +++ /dev/null @@ -1,58 +0,0 @@ -function initpage(){ - newlicense.initform(); -} - -let newlicense = { - current_panel: "basedata", - selects:{"id_club":null,"country":null}, - initform: function(){ - newlicense.selects["id_club"] = new SlimSelect({ - select: "#id_club", - //[% IF session.usergroups.search('fld') != 1 %] - disabled : true, - //[% END %] - showSearch: false - }); - newlicense.selects["country"] = new SlimSelect({ - select: "#country", - showSearch: false - }); - flatpickr("#birthday",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - weekNumbers: false - }); - newlicense.getclubs(); - newlicense.fillcountries(); - }, - // viewpanel(pnlname){ - // if (newlicense.current_panel == 'basedata'){ - - // } - // if (newlicense.current_panel == 'photo'){ - - // } - // if (newlicense.current_panel == 'signature'){ - - // } - // newlicense.current_panel = pnlname; - // app.viewpanel(pnlname); - // return false; - // }, - save: function(){ - - }, - - fillcountries: function(){ - let countries = [{"value":"LUX","text":"Lëtzebuerg"},{"value":"DEU","text":"Daitschland"},{"value":"FRA","text":"Frankraich"},{"value":"BEL","text":"Belge"},{"value":"NED","text":"Holland"}]; - form.fillselectlist(newlicense.selects["country"],countries,"value","text"); - }, - getclubs: function(){ - req.reqdata("POST","db.cgi",{"get":"clublist","filter":" status is null;"},newlicense.fillclubs); - }, - fillclubs: function(data){ - console.log(data); - form.fillselectlist(newlicense.selects["id_club"],data.sqldata,"id","club",[% session.id_club %]); - } -} \ No newline at end of file diff --git a/app/tmpl/module/licenses/newlicense.tt b/app/tmpl/module/licenses/newlicense.tt deleted file mode 100644 index 59bfe76..0000000 --- a/app/tmpl/module/licenses/newlicense.tt +++ /dev/null @@ -1,45 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - zerëck -
    Nei Lizenz
    -
    -
    -
    - - [% fieldselectbox('id_club','transfer','Club','','') %] -
    -
    Perséinlech Donnéeen vum Demandeur
    -
    -
    - [% fieldhidden('id','transfer','ident','') %] - [% fieldhidden('documenttype','transfer','','newlicense') %] - [% fieldeditbox('surname','transfer','Numm','half','') %] - [% fieldeditbox('prename','transfer','Virnumm','half','') %] - [% fieldeditbox('address','transfer','Address','','') %] - [% fieldeditbox('zip','transfer','CP','quarter','') %] - [% fieldeditbox('city','transfer','Uerschaft','half','') %] - [% fieldselectbox('country','transfer','Land','quarter','') %] - [% fieldeditbox('phone','transfer','Telefon','half','') %] - [% fieldeditbox('email','transfer','E-Mail','half','') %] - [% fieldeditbox('nationality','transfer','Nationalitéit','half','') %] - [% fielddatebox('birthday','transfer','Gebuertsdatum','half','') %] - -
    - - -
    -
    Photo
    -
    -
    -
    Ennerschrëften
    -
    -
    - - - -
    - - -
    - \ No newline at end of file diff --git a/app/tmpl/module/licenses/toolbar.tt b/app/tmpl/module/licenses/toolbar.tt deleted file mode 100644 index 210c39d..0000000 --- a/app/tmpl/module/licenses/toolbar.tt +++ /dev/null @@ -1,17 +0,0 @@ -[% udef = 0 %] - -[% puserdef = dksdb.prepare("select ml.id_user from vw_licenselist ll join members ml on (ll.id_member=ml.id) where ll.id_club=? and ml.id_user=? and ll.yearin is not null and ll.yearout is null;") %] -[% FOREACH ruserdef = puserdef.execute(params.id,session.id) %] -[% IF ruserdef.id_user == session.id %] - [% udef = ruserdef.id_user %] -[% END %] -[% END %] -
    - - -[% IF (session.othergroups.search('club') == 1 && udef == session.id) %] - - - -[% END %] -
    diff --git a/app/tmpl/module/licenses/transfer.js b/app/tmpl/module/licenses/transfer.js deleted file mode 100644 index 14f1e77..0000000 --- a/app/tmpl/module/licenses/transfer.js +++ /dev/null @@ -1,116 +0,0 @@ - -var editor_id="[% session.id %]"; - - -var sel_newclub; -function initpage(){ - console.log("Init Transfer"); - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - // sel_newclub = new Choices('#id_newclub',{ - // searchEnabled: false, - // itemSelectText: 'auswielen...', - // choices : [] - // }); - if (document.getElementById("id_newclub")){ - var nclid = document.getElementById("id_newclub"); - if (nclid.tagName == "SELECT"){ - getclublist(); - } - } - if (document.getElementById("id").value != ""){ - gettransferdata(document.getElementById("id").value); - } - - -} - -function getclublist(){ - console.log("load clublist 1"); - //req.reqdata("POST","db.cgi","locationlist","filter":"id_club=" + clubid +""},loadtbldata); - req.reqdata("POST","db.cgi",{"get":"clublist","filter":"status is null or status='individual'"},loadclublist); -} -function loadclublist(data){ - document.getElementById("id_newclub").innerHTML =''; - console.log("load clublist"); - var xlist = []; - var strlist = ""; - if (data && data.sqldata){ - for (var i in data.sqldata){ - strlist += ''; - //xlist.push({value:data.sqldata[i].id,label:data.sqldata[i].club }); - } - } - document.getElementById("id_newclub").innerHTML = strlist; - //sel_newclub.setChoices(xlist, 'value', 'label', true); -} - -function gettransferdata(tid){ - req.reqdata("POST","db.cgi",{"get":"transferdata","filter":"id='"+ tid +"'"},filltransferform); -} - -function filltransferform(data){ - console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_transfer'); - for (var f in frm){ - console.log(frm[f].id); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } - else if (frm[f].id == "id_newclub"){ - if (sel_newclub){ - console.log("set choice") - sel_newclub.setChoiceByValue(data.sqldata[0][frm[f].id]); - }else { - console.log("set select value"); - frm[f].value=data.sqldata[0][frm[f].id]; - } - - - } - else if (frm[f].classList.contains("richeditarea")){ - - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - //document.getElementById("title").addEventListener("change", onchangetitle); - } -} - -function saveuserdata(){ - var flds = []; - flds = getformcontent('requesterclub',flds); - flds = getformcontent('userdata',flds); - flds["fn"] = "saveform"; - console.log(flds); - req.reqdata("POST","index.cgi",flds,afteruserdatasaved); - -} - -function afteruserdatasaved(data){ - console.log(data); - if (data && data.id){ - document.getElementById("id").value=data.id; - } - formsaved({}); -} -function getmemberslist(){ - req.reqdata("db.cgi","memberslist","",loadmemberslist); -} - -function aftertransfersaved(data){ - console.log("transfer saved"); - console.log(data); -} - diff --git a/app/tmpl/module/licenses/transfer.tt b/app/tmpl/module/licenses/transfer.tt deleted file mode 100644 index 481c01a..0000000 --- a/app/tmpl/module/licenses/transfer.tt +++ /dev/null @@ -1,211 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - zerëck -
    Transfer
    -
    -
    -
    - -
    -
    -
    - [% fieldselectbox('id_newclub','transfer','Fir den Club','third','') %] - [% IF dtk == 'newlicense' %] - [% #fieldfile('transferfile','transfer','Formulaire Nei Lizenz (PDF)','third','','') %] - [% #fieldfile('transferphoto','transfer','Foto','third','','') %] - [% END %] -
    -
    - [% IF dtk == 'newlicense' %] -
    -
    -

    Perséinlech Donnéen vum Demandeur

    -
    - -
    -
    - [% fieldhidden('id','transfer','ident',tid) %] - [% fieldhidden('documenttype','transfer','',dtk) %] - [% fieldeditbox('surname','transfer','Numm','half','') %] - [% fieldeditbox('prename','transfer','Virnumm','half','') %] - [% fieldeditbox('address','transfer','Address','','') %] - [% fieldeditbox('zip','transfer','CP','quarter','') %] - [% fieldeditbox('city','transfer','Uerschaft','half','') %] - [% fieldeditbox('country','transfer','Land','quarter','') %] -
    -
    - [% fieldeditbox('phone','transfer','Telefon','half','') %] - [% fieldeditbox('email','transfer','E-Mail','half','') %] - [% fieldeditbox('nationality','transfer','Nationalitéit','half','') %] - [% fielddatebox('birthday','transfer','Gebuertsdatum','half','') %] -
    - - -
    - -
    -
    - -
    -

    Accord neien Club

    -
    - [% fieldhidden('newclub_id_president','transfer') %] - [% fieldeditbox('newclub_presidentname','onlydisplay','President','quarter','readonly') %] - [% fielddatebox('newclub_sigdate_president','transfer','Datum','quarter','') %] - [% fieldpasswordbox('newclub_president_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% fieldhidden('newclub_id_tresorier','transfer') %] - [% fieldeditbox('newclub_tresoriername','onlydisplay','Trésorier','quarter','readonly') %] - [% fielddatebox('newclub_sigdate_trresorier','transfer','Datum','quarter','') %] - [% fieldpasswordbox('newclub_tresorier_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% END %] - - - [% IF dtk == 'transfer' || dtk == 'transferfree' || dtk == 'transferwinter' %] -
    -
    - - [% fieldselectbox('id_member','transfer','Auswiel Member','half','') %] - [% fieldeditbox('license','transfer','Lizenz','quarter','readonly') %] -
    - [% fieldrichtextarea('note','member','Remarque (aktuellen Club)','','readonly','100px','') %] -
    -
    -
    -
    -

    Accord neien Club

    -
    - [% fieldhidden('newclub_id_president','transfer') %] - [% fieldeditbox('newclub_presidentname','onlydisplay','President','quarter','readonly') %] - [% fielddatebox('newclub_sigdate_president','transfer','Datum','quarter','') %] - [% fieldpasswordbox('newclub_president_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% fieldhidden('newclub_id_tresorier','transfer') %] - [% fieldeditbox('newclub_tresoriername','onlydisplay','Trésorier','quarter','readonly') %] - [% fielddatebox('newclub_sigdate_trresorier','transfer','Datum','quarter','') %] - [% fieldpasswordbox('newclub_tresorier_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% IF dtk == 'transfer' || dtk == 'transferwinter' %] -
    -

    Accord/Signatur aalen Club

    -
    - [% fieldhidden('oldclub_id_president','transfer') %] - [% fieldeditbox('oldclub_presidentname','onlydisplay','President','quarter','readonly') %] - [% fielddatebox('oldclub_sigdate_president','transfer','Datum','quarter','') %] - [% fieldpasswordbox('oldclub_president_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% fieldhidden('oldclub_id_tresorier','transfer') %] - [% fieldeditbox('oldclub_tresoriername','onlydisplay','Trésorier','quarter','readonly') %] - [% fielddatebox('oldclub_sigdate_trresorier','transfer','Datum','quarter','') %] - [% fieldpasswordbox('oldclub_tresorier_sig','transfer','Passwuert','quarter','') %] -
    - -
    -
    - -
    - [% END %] - [% END %] - - [% #END %] - [% #IF dtk == 'transfer' || dtk == 'freetransfer' || dtk == 'wintertransfer' %] - - [% #END %] - [% fldro = 'readonly' %] - [% IF session.usergroups.search('fld') == 1 %] - [% fldro = '' %] - [% END %] -

    Accord/Signatur FLD

    -
    -
    -
    - [% fieldeditbox('license','transfer','Nei Lizenz-Nummer','quarter',fldro) %] -
    -
    - - [% fielddatebox('fld_sigdate','transfer','Datum','quarter',fldro) %] - - [% fieldselectbox('fld_id_member','transfer','FLD-Member','quarter','readonly') %] - [% fieldpasswordbox('fld_member_sig','transfer',"Passwuert",'quarter',fldro) %] -
    - -
    -
    - [% fieldcheckbox('refused_fld','transfer','Refus','',fldro) %] - [% fieldtextarea('fld_note','transfer','Note (obligatoresch beim Refus)','','','100px',fldro) %] -
    -
    -
    - [% IF fldro == '' %] -
    - -
    - [% END %] -
    - - - - - \ No newline at end of file diff --git a/app/tmpl/module/login/forgotpassword.tt b/app/tmpl/module/login/forgotpassword.tt deleted file mode 100644 index b0c50e1..0000000 --- a/app/tmpl/module/login/forgotpassword.tt +++ /dev/null @@ -1,20 +0,0 @@ -
    -

    Passwuert vergiess?

    -
    Een Neit Passwuert ufroën
    -
    -
    -
    - - - - -
    - -
    - -
    - - -
    \ No newline at end of file diff --git a/app/tmpl/module/login/login.tt b/app/tmpl/module/login/login.tt deleted file mode 100644 index 84b38c7..0000000 --- a/app/tmpl/module/login/login.tt +++ /dev/null @@ -1,26 +0,0 @@ - -
    -

    [% lbl.loginheading %]

    - -
    -
    -
    - - -
    -
    - - -
    -
    - -
    - - [% IF registration_enabled == '1' %] -
    - Du hues dain Kont nach net aktivéiert?
    Kont aktivéieren -
    - [% END %] -
    \ No newline at end of file diff --git a/app/tmpl/module/login/message.tt b/app/tmpl/module/login/message.tt deleted file mode 100644 index e904c90..0000000 --- a/app/tmpl/module/login/message.tt +++ /dev/null @@ -1,12 +0,0 @@ -
    [% message %]
    - - [% IF registration_enabled == '1' %] - - [% END %] - \ No newline at end of file diff --git a/app/tmpl/module/login/register.tt b/app/tmpl/module/login/register.tt deleted file mode 100644 index 03416b7..0000000 --- a/app/tmpl/module/login/register.tt +++ /dev/null @@ -1,50 +0,0 @@ -
    -

    Du hues dain Kont nach nët aktivéiert?

    -
    Wanns du bei der FLD eng Lizenz hues, kruten déi Responsabel vun dengem Club Donnéen gescheckt, déi's du brauchs fir dain Kont ze aktivéieren!
    -
    -
    -
    - - - -
    - -
    - - - -
    -
    - - - -
    -
    - - -
    -
    - -
    -
    - du hues dain Kont schon aktivéiert? Zrëck zum Login -
    -
    - - \ No newline at end of file diff --git a/app/tmpl/module/login/validationcode.tt b/app/tmpl/module/login/validationcode.tt deleted file mode 100644 index 5513f24..0000000 --- a/app/tmpl/module/login/validationcode.tt +++ /dev/null @@ -1,23 +0,0 @@ - -
    -

    E-Mail Validatioun

    -
    Mir hun dir eng E-Mail matt engem Code gescheckt, fir deng E-Mail-Address ze bestätegen!
    -
    -
    [% message %]
    -
    -
    - - - - -
    - -
    - -
    -
    - - - \ No newline at end of file diff --git a/app/tmpl/module/medialibrary/dlgeditdocument.tt b/app/tmpl/module/medialibrary/dlgeditdocument.tt deleted file mode 100644 index 214468c..0000000 --- a/app/tmpl/module/medialibrary/dlgeditdocument.tt +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/app/tmpl/module/medialibrary/index.js b/app/tmpl/module/medialibrary/index.js deleted file mode 100644 index 3648ad2..0000000 --- a/app/tmpl/module/medialibrary/index.js +++ /dev/null @@ -1,108 +0,0 @@ -var tbl = null; -var cfolder = 'media'; -function initpage(){ - tbl = new Tabulator("#tbl_media", { - headerFilterPlaceholder:"filter...", - height: "93vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - rowDblClick:function(e, row){ - var r = row.getData(); - if (r.type == 'dir'){ - cfolder= r.path; - gettbldata(cfolder); - } - }, - columns:[ - {title:'', field:"thumb",headerSort:false, titleFormatter:"html",width: 50,formatter:"html"}, - {title:"Name", field:"name", sorter:"string",headerFilter:"input"}, - {title:"Gréisst", field:"hrsize",headerSort:false,align:"right", sorter:"number",width: 110}, - {title:"Typ", field:"mimetype", sorter:"string",headerFilter:"input", width: 115}, - {title:"Dimensioun", field:"dimension", sorter:"number", width: 100}, - ], - - //autoColumns:true, -}); -gettbldata(cfolder); - // tinymce.init({ - // selector: '.richeditarea', - // branding: false, - // menubar:false, - // statusbar: false, - // plugins: 'searchreplace autolink directionality visualblocks visualchars advlist lists textcolor colorpicker textpattern', - // toolbar: 'bold italic underline strikethrough forecolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat', - // image_advtab: true - // // //console.log(editor.getContent()); - // }); -} - -function gettbldata(folder){ - req.reqdata("POST","file.cgi",{"fn":"list","folder":folder},loadtbldata); -} - -function loadtbldata(data){ - if (data){ - tbl.setData(data); - } -} - -function folderup(){ - console.log("folderup"); - var p = cfolder.lastIndexOf('/'); - if (p > 0){ - cfolder = cfolder.substring(0,cfolder.lastIndexOf('/')); - console.log("Folder up: " + cfolder); - gettbldata(cfolder); - } -} -// afterformsaved = function (){ -// app.loadpage('module/[% module %]/index.html'); -// return false; -// } - -// function deletedocument(id){ -// if (confirm("Bass du secher dass du dëst Document läschen wëlls?")){ -// req.reqdata("POST","db.cgi",{"del":"1","ident_documents_id":id},closeeditdialog); -// } -// return false; -// } - -// function editdocument(id){ -// req.reqdata("POST","db.cgi",{"get":"documents","filter":"id="+ id},openedit); -// return false; -// } - -// function openedit(data){ -// //console.log(data); -// if (data && data.sqldata){ -// var frm = document.querySelectorAll('.data_documents'); -// for (var f in frm){ -// //console.log(frm[f].classList); -// if (data.sqldata[0][frm[f].id]){ -// if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ -// if (frm[f].classList.contains("datefield")){ -// frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); -// } else if (frm[f].classList.contains("richeditarea")){ -// //console.log(frm[f].id + " is richeditarea"); -// tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); -// } else { -// frm[f].value=data.sqldata[0][frm[f].id]; -// } - -// } -// } -// } -// document.getElementById('dlgeditdocument').style.display='block'; -// } -// return false; -// } - -// function closeeditdialog(){ -// document.getElementById('dlgeditdocument').style.display='none'; -// app.loadpage('module/[% module %]/index.html'); -// } \ No newline at end of file diff --git a/app/tmpl/module/medialibrary/index.tt b/app/tmpl/module/medialibrary/index.tt deleted file mode 100644 index 990a310..0000000 --- a/app/tmpl/module/medialibrary/index.tt +++ /dev/null @@ -1,15 +0,0 @@ -[% PROCESS macro/fields.tt %] - -
    -
    - - - - - - -
    -
    -
    -[% INCLUDE block/dlguploadfile.tt %] -[% INCLUDE "module/$module/dlgeditdocument.tt" %] \ No newline at end of file diff --git a/app/tmpl/module/members/club.tt b/app/tmpl/module/members/club.tt deleted file mode 100644 index e69de29..0000000 diff --git a/app/tmpl/module/members/clubmembers.tt b/app/tmpl/module/members/clubmembers.tt deleted file mode 100644 index e69de29..0000000 diff --git a/app/tmpl/module/members/index.js b/app/tmpl/module/members/index.js deleted file mode 100644 index 20d6453..0000000 --- a/app/tmpl/module/members/index.js +++ /dev/null @@ -1,143 +0,0 @@ -var tbl = null; -var tbllic = null; -var idmember=null; -function initpage(){ - - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - tbl = new Tabulator("#tbl_members", { - height: "100vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - rowDblClick:function(e, row){ - var data = row.getData(); - //console.log(data); - idmember=data.id; - //console.log(idmember); - loadmemberdata(idmember); - - //e - the click event object - //row - row component - }, - columns:[ - {title:"Club", field:"club", sorter:"string",formatter:"html",headerFilter:"input"}, - {title:"Numm", field:"surname", sorter:"string",headerFilter:"input"}, - {title:"Virnumm", field:"prename", sorter:"string",headerFilter:"input"}, - {title:"Status Lizenz", field:"status", sorter:"string",headerFilter:"input"}, - ], - initialHeaderFilter:[ - {field:"status", value:"aktiv"} //set the initial value of the header filter to "red" - ] - - //autoColumns:true, -}); -tbllic = new Tabulator("#tbl_license", { - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - // rowClick:function(e, row){ - // var data = row.getData(); - // console.log(data); - // idmember=row.id; - // loadmemberdata(row.id); - // //e - the click event object - // //row - row component - // }, - columns:[ - {title:"Lizenz", field:"license", sorter:"number"}, - {title:"vun", field:"yearin", sorter:"number"}, - {title:"bis", field:"yearout", sorter:"number"}, - {title:"Club", field:"club", sorter:"string",formatter:"html"} - ], - //autoColumns:true, -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"memberlist"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function loadmemberdata(id){ - //console.log(id); - document.getElementById("member_toolbar").style.display = 'block'; - document.getElementById("pnlmemberlist").style.display = 'none'; - document.getElementById("pnlmemberdata").style.display = 'block'; - req.reqdata("POST","db.cgi",{"get":"memberdata","filter":"id="+id},fillformmember); - req.reqdata("POST","db.cgi",{"get":"licenselist","filter":"id_member="+id},filllicensetable); - req.reqdata("POST","db.cgi",{"get":"userstatus","filter":"id="+id},filluserstaus); -} - -function fillformmember(data){ - //console.log(data); - if (data && data.sqldata){ - for (var i in data.sqldata[0]){ - if (document.getElementById("members_" + i)){ - document.getElementById("members_" + i).value - } - } - var frm = document.querySelectorAll('.data_members'); - for (var f in frm){ - //console.log(frm[f].id); - if (data.sqldata[0][frm[f].id]){ - //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id); - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - //frm[f].flatpickr.setDate(data.sqldata[0][frm[f].id]) - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - - // if frm[f].id - // if (data.sqldata[0][]) - // frm[f].value= - } - if (document.getElementById("profile_photo").value != ""){ - document.getElementById('img_profile_photo').src='../../data/members/' + document.getElementById("profile_photo").value; - } - // console.log(frm); - } -} - -function filllicensetable(data){ - //console.log("License DATA"); - //console.log(data.sqldata); - if (data && data.sqldata){ - tbllic.setData(data.sqldata); - } -} - -function filluserstaus(data){ - -} - -function loadlist(){ - document.getElementById("member_toolbar").style.display = 'none'; - document.getElementById("pnlmemberdata").style.display = 'none'; - document.getElementById("pnlmemberlist").style.display = 'block'; - -} - diff --git a/app/tmpl/module/members/index.tt b/app/tmpl/module/members/index.tt deleted file mode 100644 index 9a505fb..0000000 --- a/app/tmpl/module/members/index.tt +++ /dev/null @@ -1,102 +0,0 @@ - -[% PROCESS macro/fields.tt %] -
    - -
    -
    -
    - -
    - - -
    -
    -

    Perséinlech Donnéen

    -
    -
    - - [% fieldhidden('id','members','ident') %] - [% fieldeditbox('surname','members','Numm','half','') %] - [% fieldeditbox('prename','members','Virnumm','half','') %] - [% fieldeditbox('address','members','Address','','') %] - [% fieldeditbox('zip','members','CP','quarter','') %] - [% fieldeditbox('city','members','Uerschaft','half','') %] - [% fieldeditbox('country','members','Land','quarter','') %] -
    -
    - [% fieldeditbox('phone','members','Telefon','third','') %] - [% fieldeditbox('nationality','members','Nationalitéit','third','') %] - [% fielddatebox('birthday','members','Gebuertsdatum','third','') %] -
    -
    - -
    -
    -
    -
    -
    -
    -

    Benotzer-Kont

    - -
    - [% fieldhidden('users','id','ident') %] - [% fieldemailbox('username','users','E-Mail (Login)','','','','') %] -
    -
    -

    Accès Status: aktiv

    -
    -
    - - -
    -
    - - -
    -
    -
    - - - - -
    -
    -
    -
    -
    -

    Photo

    -
    -
    - [% fieldhidden('profile_photo','members') %] - [% fieldhidden('members','link','ident') %] -
    -

    Aktuell (validéiert) Photo

    - -
    - -
    -

    Nei Photo

    - - - - - - -
    -
    -
    -
    - [% INCLUDE block/dlgcropper.tt %] -
    -

    Lizenz

    -
    -
    -
    -
    - -
    - -
    diff --git a/app/tmpl/module/newsletter/index.js b/app/tmpl/module/newsletter/index.js deleted file mode 100644 index 9e4eaf0..0000000 --- a/app/tmpl/module/newsletter/index.js +++ /dev/null @@ -1,90 +0,0 @@ -var tbl = null; -function initpage(){ - // flatpickr(".datefield",{altInput: true, - // altFormat: "d.m.Y", - // dateFormat: "Y-m-d", - // "locale": "fr", - // }); - tinymce.init({ - selector: '.richeditarea', - branding: false, - menubar:false, - statusbar: false, - plugins: 'searchreplace autolink directionality visualblocks visualchars advlist lists textcolor colorpicker textpattern', - toolbar: 'bold italic underline strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat', - image_advtab: true, - forced_root_block : '', - // init_instance_callback: function (editor) { - // editor.on('blur', function (e) { - // //console.log('Editor was blurred!'); - // //console.log(e.target.id); - // $("#" + e.target.id).html(editor.getContent()); - // //console.log(editor.getContent()); - // // if (savefield){ - // // savefield(e.target.id); - // // } - // }); - // } - }); - tbl = new Tabulator("#tbl_mailings", { - height: "100vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Sujet", field:"title"}, - {title:"Datum verscheckt", field:"dspsendate"}, - {title:"Sender", field:"sender"}, - {title:"Empfänger", field:"receipients"} - ], - //autoColumns:true, -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"mailinglist"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function viewtable(){ - document.getElementById("mailingform").style.display = 'none'; - document.getElementById("mailingtable").style.display = 'block'; -} - -function add(){ - document.getElementById("mailingtable").style.display = 'none'; - document.getElementById("mailingform").style.display = 'block'; - - //app.loadpage('module/[% module %]/form_webnews.html','Neien Member'); -} - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - document.getElementById("mailingtable").style.display = 'none'; - document.getElementById("mialingform").style.display = 'block'; - //app.loadpage('module/[% module %]/form_webnews.html?id='+uid,'News éditeieren'); - //console.log(tbl.getSelectedData()); -} - -function duplicate(){ - //console.log(tbl.getSelectedData()); -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - //console.log(tbl.getSelectedData()); -} - \ No newline at end of file diff --git a/app/tmpl/module/newsletter/index.tt b/app/tmpl/module/newsletter/index.tt deleted file mode 100644 index 94f3bc8..0000000 --- a/app/tmpl/module/newsletter/index.tt +++ /dev/null @@ -1,34 +0,0 @@ -[% INCLUDE "module/$module/tbltoolbar.tt" %] -[% PROCESS macro/fields.tt %] -
    - - - - - - - - - - - - - -
    SujetVerscheckt denSenderEmpfänger
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/newsletter/tbltoolbar.tt b/app/tmpl/module/newsletter/tbltoolbar.tt deleted file mode 100644 index 25ee70b..0000000 --- a/app/tmpl/module/newsletter/tbltoolbar.tt +++ /dev/null @@ -1,11 +0,0 @@ -
    - -
    - - - - - - -
    -
    \ No newline at end of file diff --git a/app/tmpl/module/profile.tt b/app/tmpl/module/profile.tt deleted file mode 100644 index 31d15ab..0000000 --- a/app/tmpl/module/profile.tt +++ /dev/null @@ -1,79 +0,0 @@ - -[% PROCESS macro/fields.tt %] -
    -
    Profil
    -
    -
    -
    -
    -

    Benotzer-Kont

    -
    -
    - [% #fieldhidden('users','id','ident') %] - [% fieldeditbox('username','users','E-Mail (Login)','','readonly','') %] -
    - -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -

    Perséinlech Donnéen

    -
    -
    - - [% fieldhidden('id','members','ident') %] - [% fieldeditbox('surname','members','Numm','half','readonly') %] - [% fieldeditbox('prename','members','Virnumm','half','readonly') %] - [% fieldeditbox('address','members','Address','','readonly') %] - [% fieldeditbox('zip','members','CP','quarter','readonly') %] - [% fieldeditbox('city','members','Uerschaft','half','readonly') %] - [% fieldeditbox('country','members','Land','quarter','readonly') %] -
    -
    - [% fieldeditbox('phone','members','Telefon','third','readonly') %] - [% fieldeditbox('nationality','members','Nationalitéit','third','readonly') %] - [% fielddatebox('birthday','members','Gebuertsdatum','third','readonly') %] -
    - -
    -
    -
    -
    -

    Photo

    -
    -
    - [% fieldhidden('profile_photo','members') %] - [% fieldhidden('members','link','ident') %] -
    -

    Aktuell Photo

    - -
    - -
    -

    Nei Photo

    -
    Fir d'Photo auszetauschen, scheckt w.e.g. är nei Photo via E-Mail un
    webmaster@fld.
    lu

    Vergiesst w.e.g. Net Lizenz-Nummer an Numm vum Spiller matt unzegin
    - -
    -
    -
    -
    -
    - [% #INCLUDE block/dlgcropper.tt %] - [% INCLUDE block/dlgpassword.tt %] - [% INCLUDE block/dlgusername.tt %] - - - diff --git a/app/tmpl/module/profile/profile.js b/app/tmpl/module/profile/profile.js deleted file mode 100644 index 3ec4bb0..0000000 --- a/app/tmpl/module/profile/profile.js +++ /dev/null @@ -1,64 +0,0 @@ -var iduser="[% session.id %]"; - -function initpage(){ - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - "locale": "fr", - }); - loadmemberdata(iduser); - loadaccountdata(iduser); -} - -function loadaccountdata(id){ - req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id="+id},fillformaccount); -} -function loadmemberdata(id){ - req.reqdata("POST","db.cgi",{"get":"memberdata","filter":"id_user="+id},fillformmember); -} -function fillformaccount(data){ - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_users'); - for (var f in frm){ - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - } - } - } - } -} - - -function fillformmember(data){ - // console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_members'); - for (var f in frm){ - // console.log(frm[f].tagName); - // console.log(frm[f].id); - if (data.sqldata[0][frm[f].id]){ - //console.log(frm[f].tagName + " " + frm[f].type + " " + frm[f].id); - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - - } - if (document.getElementById("profile_photo").value != ""){ - document.getElementById("img_profile_photo").src = '../../data/members/' + document.getElementById("profile_photo").value+ "?upd="+ data.sqldata[0].modified; - } - // console.log(frm); - } -} - - diff --git a/app/tmpl/module/ranking/index.js b/app/tmpl/module/ranking/index.js deleted file mode 100644 index b1922e1..0000000 --- a/app/tmpl/module/ranking/index.js +++ /dev/null @@ -1,128 +0,0 @@ -var tbl = null; - -function initpage(){ - // flatpickr(".datefield",{altInput: true, - // altFormat: "d.m.Y", - // dateFormat: "Y-m-d", - // "locale": "fr", - // }); - - tbl = new Tabulator("#tbl_rankings", { - height: "95vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Positioun", field:"seasonrank", sorter:"number"}, - {title:"surname", field:"Numm", sorter:"string",editor:"input",headerFilter:"input"}, - {title:"prename", field:"virnumm", storter:"html",editor:"input",headerFilter:"input"}, - {title:"saison", field:"season", storter:"html",editor:"input",headerFilter:"input"}, - {title:"1 Ranglëscht", field:"rl1", sorter:"number",editor:"input",width: 100}, - {title:"2 Ranglëscht", field:"rl2", sorter:"number",editor:"input",width: 100}, - {title:"3 Ranglëscht", field:"rl3", sorter:"number",editor:"input",width: 100}, - {title:"4 Ranglëscht", field:"rl4", sorter:"number",editor:"input",width: 100}, - {title:"5 Ranglëscht", field:"rl5", sorter:"number",editor:"input",width: 100}, - {title:"6 Ranglëscht", field:"rl6", sorter:"number",editor:"input",width: 100}, - {title:"7 Ranglëscht", field:"rl7", sorter:"number",editor:"input",width: 100}, - {title:"Total", field:"total", sorter:"number",width: 100} - ], - //autoColumns:true, -}); - gettbldata(); -} - -// function getrankingscategories(){ -// req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club=" + clubid +" and status='aktiv'"},fillclubmembers); -// } - - - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"rankings"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function viewtable(){ - document.getElementById("rankingsform").style.display = 'none'; - document.getElementById("rankingstable").style.display = 'block'; -} - -function add(){ - - // var frm = document.querySelectorAll('.data_rankings'); - // for (var f in frm){ - // if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ - // if (frm[f].classList.contains("datefield")){ - // frm[f]._flatpickr.setDate(""); - // } else { - // frm[f].value=""; - // // if (frm[f].id == 'teams'){ - // // locations_teams.clearStore(); - // // } - // } - - // } - // } - // document.getElementById("rankingstable").style.display = 'none'; - // document.getElementById("rankingsform").style.display = 'block'; - // displayeditbuttons('block'); -} - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - console.log(uid); - req.reqdata("POST","db.cgi",{"get":"rankingslist","filter":"id=" + uid},fillformrankings); - document.getElementById("rankingstable").style.display = 'none'; - document.getElementById("rankingsform").style.display = 'block'; - displayeditbuttons('block'); - //app.loadpage('module/[% module %]/form_webrankings.html?id='+uid,'rankings éditeieren'); - //console.log(tbl.getSelectedData()); -} - -function fillformrankings(data){ - console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_rankings'); - for (var f in frm){ - console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - } -} - -function duplicate(){ - console.log(tbl.getSelectedData()); -} - -function remove(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - console.log(tbl.getSelectedData()); - if (confirm("Bass du secher dass déi ausgewielten rankings läschen wells?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_rankings_id":udata[0].id},gettbldata); - } -} - \ No newline at end of file diff --git a/app/tmpl/module/ranking/index.tt b/app/tmpl/module/ranking/index.tt deleted file mode 100644 index a5bd541..0000000 --- a/app/tmpl/module/ranking/index.tt +++ /dev/null @@ -1,8 +0,0 @@ - - [% INCLUDE "module/$module/tbltoolbar.tt" %] -
    - - -
    -
    - diff --git a/app/tmpl/module/ranking/tbltoolbar.tt b/app/tmpl/module/ranking/tbltoolbar.tt deleted file mode 100644 index 6ee331f..0000000 --- a/app/tmpl/module/ranking/tbltoolbar.tt +++ /dev/null @@ -1,21 +0,0 @@ -
    - -
    - - - - - - -
    -
    - \ No newline at end of file diff --git a/app/tmpl/module/users.tt b/app/tmpl/module/users.tt deleted file mode 100644 index 409a997..0000000 --- a/app/tmpl/module/users.tt +++ /dev/null @@ -1,82 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    -
    Memberen
    - - - - [% IF (session.usergroups.search('fld') == 1) %] - - - - [% END %] -
    -
    -
    -[% FOREACH cl=dksdb.query("select * from vw_clublist;") %] -
    -
    -
    -

    [% cl.club %]

    -
    -
    - -
    Lizenzen: [% cl.licenses %]
    - -
    - -
    -
    -[% END %] -
    -
    -
    -[% IF (session.usergroups.search('fld') == 1) %] - - -[% END %] diff --git a/app/tmpl/module/users/users.js b/app/tmpl/module/users/users.js deleted file mode 100644 index 54676d2..0000000 --- a/app/tmpl/module/users/users.js +++ /dev/null @@ -1,260 +0,0 @@ - -/* [% sid = session.id %] -[% IF (session.usergroups.search('fld') != 1) %] -[% qclub = dksdb.query("select id_club from vw_userlist where id=$sid;") %] -[% club = qclub.get_all() %] -[% END %] */ -var tbl= null; -var sid = "[% session.id %]"; -var sel_usergroups = null; - -//var idclub="[% club.0.id_club %]"; -function initpage(){ - /* [% IF (session.usergroups.search('fld') == 1) %] */ - sel_usergroups = new Choices('#usergroup_ids',{ - searchEnabled: false, - itemSelectText: 'auswielen...', - removeItemButton: true, - choices : [] - }); - tbl = new Tabulator("#tbl_users", { - height: "calc(100vh - 170px)", - headerFilterPlaceholder:"filter...", - layout:"fitDataFill", - selectable:1, - initialSort:[ - {column:"club", dir:"asc"} //then sort by this second - ], - groupBy:["club"], - groupStartOpen:[false], - groupHeader:[function(value, count, data){ return value;}], - - //responsiveLayout:"collapse", - columns:[ - {title:"Club", field:"club",headerFilter:"input",download:true,visible: false}, - {title:"Numm", field:"surname",headerFilter:"input",download:true}, - {title:"Virnumm", field:"prename",headerFilter:"input",download:true}, - {title:"Lizenz",field:"license",download:true, headerSort: false}, - {title:"Accès",field:"group_ids",download:true,headerFilter:"input", headerSort: false}, - {title:"E-mail",field:"username",download:true, headerSort: false}, - {title:"Reg.Code", field:"regcode",download:true, headerSort: false}, - {title:"Blockéiert", field:"blocked", headerSort: false,formatter:"tickCross", formatterParams:{ - allowEmpty:true, - allowTruthy:true, - crossElement:"", - }}, - ], -}); - - getusergroups(); - /* [% ELSE %] */ - tbl = new Tabulator("#tbl_users", { - headerFilterPlaceholder:"filter...", - height: "calc(100vh - 200px);", - layout:"fitDataFill", - selectable:1, - responsiveLayout:"collapse", - columns:[ - {title:"Club", field:"club"}, - {title:"Numm", field:"surname",headerFilter:"input",download:true}, - {title:"Virnumm", field:"prename",headerFilter:"input",download:true}, - {title:"Lizenz",field:"license",download:true}, - {title:"Accès",field:"group_ids",download:true}, - {title:"E-mail",field:"username",download:true}, - {title:"Reg.Code", field:"regcode",download:true}, - ], -}); - /* [% END %] */ - gettbldata(); -} - -function gettbldata(){ - // [% IF (session.usergroups.search('fld') == 1) %] - req.reqdata("POST","db.cgi",{"get":"userlist","filter":"status='aktiv'"},loadtbldata); - // [% ELSE %] - req.reqdata("POST","db.cgi",{"get":"userlist","filter":"status='aktiv' and id_club=[% club.0.id_club %]"},loadtbldata); - // [% END %] -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -// function xlsxexport(){ -// tbl.download("xlsx", "fld.lu_Benotzer.xlsx", {sheetName:"Memberen"}); -// } - -// function pdfexport(){ -// tbl.download("pdf", "fld.lu_Benotzer.pdf", { -// orientation:"landscape", - -// jsPDF:{ -// unit:"mm", -// }, -// autoTable(doc){ -// doc.text("Benotzer Site fld.lu", 10, 10); -// // styles: { -// // fillColor: [100, 255, 255] -// // }, -// // columnStyles: { -// // id: {fillColor: 255} -// // }, -// return { -// margin: {top: 20}, -// } - -// }, -// documentProcessing:function(doc){ -// //carry out an action on the doc object -// } -// }); -// } - -// [% IF (session.usergroups.search('fld') == 1) %] - function setusergroups(){ - var udata = tbl.getSelectedData(); - if (udata[0]){ - var uid = udata[0].id; - req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id=" + uid},fillusergroupform); - } - } - function fillusergroupform(data){ - - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_users,.data_display,.data_useringroups'); - for (var f in frm){ - - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')) { - if (frm[f].id == "usergroup_ids"){ - - var argrp = data.sqldata[0][frm[f].id].split(","); - //console.log(argrp); - sel_usergroups.setChoiceByValue(argrp); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - } - } - } - document.getElementById('dlgusergroups').style.display='block'; - } - - } - - function getusergroups(){ - req.reqdata("POST","db.cgi",{"get":"usergroups"},fillusergroups); - return false; - } - function fillusergroups(data){ - var pug = []; - if (data && data.sqldata){ - for (var i in data.sqldata){ - pug.push({value:data.sqldata[i].id,label:data.sqldata[i].groupname}); - } - } - sel_usergroups.setChoices(pug, 'value', 'label', true); - - return false; - } - - function saveusergroupsform(){ - var flds = getformcontent("usergroups",{}); - //console.log(flds); - - req.reqdata("POST","db.cgi",{"fn":"setgroupaccess","params": flds.ident_users_id + ",'{" + flds.useringroups_usergroup_ids.join(',') +"}'"},ugsaved); - return false; - } - - function ugsaved(data){ - //console.log(data); - gettbldata(); - document.getElementById('dlgusergroups').style.display='none'; - formsaved(null); - } - - function setlogin(){ - var udata = tbl.getSelectedData(); - document.getElementById("nunmsg").innerHTML = '' - if (udata[0]){ - var uid = udata[0].id; - req.reqdata("POST","db.cgi",{"get":"userdata","filter":"id=" + uid},fillloginform); - } - } - function fillloginform(data){ - document.getElementById("blocked").checked = false; - document.getElementById("username").value = ""; - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_users,.data_display,.data_useringroups'); - for (var f in frm){ - - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')) { - - if (frm[f].type == "checkbox"){ - document.getElementById("blocked").checked = true; - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - } - } - } - document.getElementById('dlglogin').style.display='block'; - } - } - - function setusername(){ - var flds = getformcontent("users",{}); - //console.log(flds); - flds["set"] = 1; - req.reqdata("POST","db.cgi",flds,loginsaved); - return false; - } - - function loginsaved(data){ - //console.log(data); - gettbldata(); - document.getElementById('dlglogin').style.display='none'; - formsaved(null); - } - function ugsaved(data){ - //console.log(data); - gettbldata(); - document.getElementById('dlgusergroups').style.display='none'; - formsaved(null); - } - - function sendnewpassword(){ - var flds = getformcontent("login",{}); - //console.log(flds); - return false; - } - - function checkemail(){ - var newusername = document.getElementById("username").value; - //console.log("username: " + newusername); - if (validateEmail(newusername)){ - req.reqdata("POST","db.cgi",{"get":"userdata","filter":"username='"+ newusername+ "' and id != " + document.getElementById("id").value},checkmailreturn); - }else { - document.getElementById("nunmsg").innerHTML= '
    w.e.g. eng richteg email agin!
    '; - } - return false; - } - - function checkmailreturn(data){ - console.log(data); - if (data && data.sqldata.length > 0){ - document.getElementById("nunmsg").innerHTML= '
    Et existéiert schon een aaneren Kont matt deser E-mail!
    '; - } else { - setusername(); - } - return false; - } - - function validateEmail(email) { - var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; - return re.test(String(email).toLowerCase()); - } -// [% END %] \ No newline at end of file diff --git a/app/tmpl/module/webnews.tt b/app/tmpl/module/webnews.tt deleted file mode 100644 index de2be95..0000000 --- a/app/tmpl/module/webnews.tt +++ /dev/null @@ -1,36 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    -
    - zerëck -
    Websait News
    - [% IF (session.usergroups.search('fld') == 1) %] - - - - [% END %] -
    -
    -
    - -[% INCLUDE block/dlguploadfile.tt %] - \ No newline at end of file diff --git a/app/tmpl/module/webnews/webnews.js b/app/tmpl/module/webnews/webnews.js deleted file mode 100644 index ec3705b..0000000 --- a/app/tmpl/module/webnews/webnews.js +++ /dev/null @@ -1,224 +0,0 @@ -var tbl = null; -var sel_category=null; -function initpage(){ - webnews.inittable(); - webnews.initform(); -} -let webnews = { - tbl: null, - choices: {"categories":null}, - inittable: function(){ - webnews.tbl = new Tabulator("#tbl_news", { - height: "calc(100vh - 65px)", - selectable:1, - // selectablePersistence:false, - // responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitDataFill", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - - {title:"Titel", field:"title", formatter:"html",responsive:0, width: 400}, - {title:"Datum vun", field:"dsppublishdate",headerSort:"datetime",width: 100}, - {title:"Datum bis", field:"dspunpublishdate",headerSort:"datetime",width: 100}, - {title:"Kategorie", field:"categorylist", headerSort:false,width: 140}, - ], - }); - webnews.gettbldata(); - }, - initform: function(){ - flatpickr(".datefield",{altInput: true, - altFormat: "d.m.Y", - dateFormat: "Y-m-d", - allowInput: true, - "locale": "fr", - }); - tinymce.init({ - selector: '.richeditarea', - plugins: 'preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template table charmap hr nonbreaking anchor advlist lists wordcount imagetools textpattern noneditable charmap emoticons autoresize ', - imagetools_cors_hosts: ['picsum.photos'], - menubar: 'file edit view insert format tools table', - toolbar: 'undo redo | bold italic underline strikethrough | fontsizeselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor removeformat | charmap emoticons | fullscreen preview | insertfile image media link anchor', - toolbar_sticky: true, - language: 'de', - // content_css: [ - // '[% abspath %]/backoffice/css/w3pro.css' - // ], - forced_root_block : '', - min_height: 350, - branding: false, - importcss_append: true, - image_advtab: true, - image_title: true, - automatic_uploads: true, - file_picker_types: 'image', - file_picker_callback: function (cb, value, meta) { - var input = document.createElement('input'); - input.setAttribute('type', 'file'); - input.setAttribute('accept', 'image/*'); - input.onchange = function () { - var file = this.files[0]; - - var reader = new FileReader(); - reader.onload = function () { - var id = 'blobid' + (new Date()).getTime(); - var blobCache = tinymce.activeEditor.editorUpload.blobCache; - var base64 = reader.result.split(',')[1]; - var blobInfo = blobCache.create(id, file, base64); - blobCache.add(blobInfo); - cb(blobInfo.blobUri(), { title: file.name }); - }; - reader.readAsDataURL(file); - }; - - input.click(); - - }, - image_caption: true, - noneditable_noneditable_class: "mceNonEditable", - contextmenu: "link image imagetools table", - }); - webnews.choices["categories"] = new SlimSelect({ - select: "#categories", - showSearch: false, - data: [{ value: 'News', text: 'News' }, - { value: 'Frontpage', text: 'Frontpage' }] - }); - // webnews.choices["categories"] = sel_category = new Choices('#categories',{ - // searchEnabled: false, - // itemSelectText: 'auswielen...', - // removeItemButton: true, - // choices : [{ value: 'News', label: 'News' }, - // { value: 'Frontpage', label: 'Frontpage' }] - // }); - }, - gettbldata: function (){ - req.reqdata("POST","db.cgi",{"get":"newslist"},webnews.loadtbldata); - }, - loadtbldata: function (data){ - if (data && data.sqldata){ - webnews.tbl.setData(data.sqldata); - } - }, - // getnewscategories: function(){ - // req.reqdata("POST","db.cgi",{"get":"memberlist","filter":"id_club=" + clubid +" and status='aktiv'"},fillclubmembers); - // }, - viewtable: function(){ - gettbldata(); - document.getElementById("newsform").style.display = 'none'; - document.getElementById("newstable").style.display = 'block'; - displayeditbuttons('block'); - }, - - add: function(){ - var frm = document.querySelectorAll('.data_news'); - for (var f in frm){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || (frm[f].tagName == 'TEXTAREA')){ - if (frm[f].classList.contains("datefield")){ - if (frm[f]._flatpickr){ - frm[f]._flatpickr.clear(); - } - } else if (frm[f].id == "categories"){ - //sel_category.clearStore(); - - sel_category.setChoiceByValue(['News','Frontpage']); - }else if (frm[f].classList.contains("richeditarea")){ - tinymce.get(frm[f].id).setContent(""); - }else { - frm[f].value=""; - } - - } - } - document.getElementById("title").addEventListener("change", onchangetitle); - document.getElementById("newstable").style.display = 'none'; - document.getElementById("newsform").style.display = 'block'; - //displayeditbuttons('none'); - }, - - edit: function(){ - var udata = webnews.tbl.getSelectedData(); - if (udata[0]){ - req.reqdata("POST","db.cgi",{"get":"newslist","filter":"id=" + udata[0].id},webnews.fillformnews); - app.viewpanel("newsform"); - } - }, - - fillformnews: function(data){ - //console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_news'); - for (var f in frm){ - //console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].id == "categories"){ - //sel_category.setChoiceByValue(JSON.parse(data.sqldata[0][frm[f].id])); - } else if (frm[f].classList.contains("richeditarea")){ - - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - document.getElementById("title").addEventListener("change", webnews.onchangetitle); - } - }, - - onchangetitle: function(){ - var link = document.getElementById("link"); - link.value = unaccent(document.getElementById("title").value); - }, - - remove: function(){ - var udata = tbl.getSelectedData(); - if (udata[0]){ - if (confirm("Bass du secher dass déi ausgewielten News läschen wells?")){ - req.reqdata("POST","db.cgi",{"del":"1","ident_news_id":udata[0].id},webnews.gettbldata); - } - } - }, - unaccent: function(text){ - text = text.toLowerCase(); - text = text.replace(/[á|à|â|ã|ä|å|ā|ă|ą]/g,"a"); - text = text.replace(/[è|é|ê|ë|ē|ĕ|ė|ę|ě]/g,"e"); - text = text.replace(/[ì|í|î|ï|ì|ĩ|ī|ĭ]/g,"i"); - text = text.replace(/[ò|ó|ô|õ|ö|ō|ŏ|ő]/g,"o"); - text = text.replace(/[ù|ú|û|ü|ũ|ū|ŭ|ů]/g,"u"); - text = text.replace(/ß/g,"ss"); - text = text.replace(/ç/g,"c"); - text = text.replace(/œ/g,"oe"); - text = text.replace(/[\W]+/g,"-"); - return text; - } -} - - - - -// var afterformsaved = { -// action: function(data){ -// //console.log(data); -// if (data.result.p.relpath){ -// document.getElementById('image').value=data.result.p.relpath; -// if (document.getElementById("image").value != ''){ -// document.getElementById("slider_img").src='../../../' + document.getElementById("image").value; -// } -// } - -// } -// } - - - - - - - diff --git a/app/tmpl/module/websites.tt b/app/tmpl/module/websites.tt deleted file mode 100644 index b1aebdb..0000000 --- a/app/tmpl/module/websites.tt +++ /dev/null @@ -1,55 +0,0 @@ -[% PROCESS macro/fields.tt %] -
    - -
    - - - - - - -
    -
    - - -
    -
    -
    - - \ No newline at end of file diff --git a/app/tmpl/module/websites/websites.js b/app/tmpl/module/websites/websites.js deleted file mode 100644 index 416e0d8..0000000 --- a/app/tmpl/module/websites/websites.js +++ /dev/null @@ -1,122 +0,0 @@ -var tbl = null; -var sel_category=null; -function initpage(){ - - tbl = new Tabulator("#tbl_websites", { - height: "95vh", - selectable:1, - selectablePersistence:false, // disable rolling selection - responsiveLayout:"collapse", - autoResize:true, - addRowPos:"top", - layout:"fitColumns", - resizableRows:true, - columnHeaderSortMulti:false, - columns:[ - {title:"Titel", field:"title", formatter:"html"}, - {title:"Menu", field:"dspmenu", formatter:"html",width: 250}, - {title:"Positioun", field:"menuorder", formatter:"html",width: 50}, - {title:"Frontpage", field:"is_frontpage",formatter:"tickCross", width:50}, - {title:"Aktiv", field:"active",formatter:"boolean",formatter:"tickCross", width:50} - ], - //autoColumns:true, -}); - gettbldata(); -} - -function gettbldata(){ - req.reqdata("POST","db.cgi",{"get":"websiteslist"},loadtbldata); -} - -function loadtbldata(data){ - if (data && data.sqldata){ - tbl.setData(data.sqldata); - } -} - -function viewtable(){ - document.getElementById("websitesform").style.display = 'none'; - document.getElementById("websitestable").style.display = 'block'; - displayeditbuttons('block'); -} - -// function add(){ -// var frm = document.querySelectorAll('.data_websites'); -// for (var f in frm){ -// if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT')){ -// if (frm[f].classList.contains("datefield")){ -// frm[f]._flatpickr.setDate(""); -// } else { -// frm[f].value=""; -// // if (frm[f].id == 'teams'){ -// // locations_teams.clearStore(); -// // } -// } - -// } -// } -// document.getElementById("websitestable").style.display = 'none'; -// document.getElementById("websitesform").style.display = 'block'; -// displayeditbuttons('none'); -// } - -function edit(){ - var udata = tbl.getSelectedData(); - var uid = udata[0].id; - console.log(uid); - req.reqdata("POST","db.cgi",{"get":"websiteslist","filter":"id=" + uid},fillformwebsites); - document.getElementById("websitestable").style.display = 'none'; - document.getElementById("websitesform").style.display = 'block'; - displayeditbuttons('none'); - //app.loadpage('module/[% module %]/form_webwebsites.html?id='+uid,'websites éditeieren'); - //console.log(tbl.getSelectedData()); -} - -function fillformwebsites(data){ - console.log(data); - if (data && data.sqldata){ - var frm = document.querySelectorAll('.data_websites.data_websites'); - for (var f in frm){ - console.log(frm[f].classList); - if (data.sqldata[0][frm[f].id]){ - if ((frm[f].tagName == 'INPUT') || (frm[f].tagName == 'SELECT') || frm[f].tagName == 'TEXTAREA'){ - if (frm[f].classList.contains("datefield")){ - frm[f]._flatpickr.setDate(data.sqldata[0][frm[f].id]); - } else if (frm[f].classList.contains("richeditarea")){ - console.log(frm[f].id + " is richeditarea"); - tinymce.get(frm[f].id).setContent(data.sqldata[0][frm[f].id]); - } else if (frm[f].tagName == 'TEXTAREA'){ - frm[f].innerHTML = data.sqldata[0][frm[f].id]; - } else if (frm[f].type == 'checkbox'){ - if (data.sqldata[0][frm[f].id] == '1'){ - frm[f].checked = true; - } else { - frm[f].checked = false; - } - } - else { - frm[f].value=data.sqldata[0][frm[f].id]; - } - - } - } - } - } -} - - -// function remove(){ -// var udata = tbl.getSelectedData(); -// var uid = udata[0].id; -// console.log(tbl.getSelectedData()); -// } - -// function viewcode(){ -// var udata = tbl.getSelectedData(); -// var uid = udata[0].id; -// console.log(uid); -// document.getElementById("websitestable").style.display = 'none'; -// document.getElementById("websitesfile").style.display = 'block'; -// displayeditbuttons('none'); -// } - diff --git a/app/upload.cgi b/app/upload.cgi deleted file mode 100644 index c9d67e1..0000000 --- a/app/upload.cgi +++ /dev/null @@ -1,250 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -use lib ($RealBin.'/lib/perl5'); -use lib ($RealBin.'/lib'); -use lib ($RealBin.'/backoffice/lib/perl5'); -use lib ($RealBin.'/backoffice/lib'); -use CGI; -use CGI::Cookie; -#use CGI::Carp qw/fatalsToBrowser/; -use File::Basename; -use File::Path qw/make_path/; -use JSON::PP; -use Image::Size; -use dksconfig qw/$sitecfg/; -use dksdb; - -use session; -use sendemail; -my $cgi = new CGI(); -my $scriptpath = $cgi->url(-absolute => 1); -my $p = (); -my @params = $cgi->param(); -if ($cgi->request_method() eq "POST"){ - foreach my $pe (@params){ - $p->{$pe} = $cgi->param($pe); - } -} -my $html->{result} = (); -$p->{sid} = $cgi->cookie($sitecfg->{cookiename}); -my $se = session->new(); -my $sess = $se->getsession($p->{sid}); -print $cgi->header(-type=>"application/json", -charset => "utf-8"); -if ($sess == undef){ - $html->{error} = "No Authorisation"; - print JSON::PP::encode_json($html); - exit(0); -} -my $utime = time(); -my $db = dksdb->new(); - -if (exists($p->{file}) && exists($p->{filetype})){ - - my $basepath = dirname(dirname($ENV{SCRIPT_FILENAME})); - my $filepath = ""; - my $suffix = substr($p->{file},rindex($p->{file},'.')+1); - if ($p->{filetype} eq "download_document"){ - $filepath = 'data/documents/'.$p->{file}; - } - if ($p->{filetype} eq "news_image"){ - if ($suffix eq 'jpg' || $suffix eq 'png'){ - $filepath = '../media/news/'.$p->{file}; - $p->{relpath} = 'media/news/'.$p->{file}; - } - } - if ($p->{filetype} eq "rankinglist_result"){ - if ($suffix eq 'xlsx'){ - $filepath = 'data/rankinglist/'.$p->{file}; - } - } - #mogrify -thumbnail x300 -background white *.png - #ls -1 members_sized/*.png | awk -F\/ '{print "composite -gravity southeast wm_fld.png members_sized/"$(NF)" members/"$(NF)}' | sh - # if ($p->{upload_filetype} eq "new_profile_photo"){ - # my $sql = "select link from members where id=".$p->{id_member}.";"; - # my $ml = $db->dbquerysorted($sql); - # $filepath = 'data/members/'.$ml->{0}->{link}.'/'.$ml->{0}->{link}.'_new.'.$suffix; - # } elsif ($p->{upload_filetype} eq "profile_photo"){ - # my $sql = "select link from members where id=".$p->{id_member}.";"; - # my $ml = $db->dbquerysorted($sql); - # $filepath = 'data/members/'.$ml->{0}->{link}.'/'.$ml->{0}->{link}.'_new.'.$suffix; - # } elsif ($p->{upload_filetype} eq "spillbou"){ - # $filepath = 'data/championnat/'.$p->{season}.'_'.$p->{playday}.'_'.$p->{team}.'.'.$suffix; - # } elsif ($p->{upload_filetype} eq "member_document"){ - # my $sql = "select link from members where id=".$p->{id_member}.";"; - # my $ml = $db->dbquerysorted($sql); - # $filepath = 'data/members/'.$ml->{0}->{link}.'/'.$p->{upload_file}.'_'.$utime.$suffix; - # } elsif ($p->{upload_filetype} eq "clublogo_new"){ - # my $sql = "select link from clubs where id=".$p->{id_club}.";"; - # my $cl = $db->dbquerysorted($sql); - # $filepath = 'data/clubs/'.$cl->{0}->{link}.'/'.$cl->{0}->{link}.'_new.'.$suffix; - # } elsif ($p->{upload_filetype} eq "clublogo"){ - # my $sql = "select link from clubs where id=".$p->{id_club}.";"; - # my $cl = $db->dbquerysorted($sql); - # $filepath = 'data/clubs/'.$cl->{0}->{link}.'/'.$cl->{0}->{link}.'.'.$suffix; - # }elsif ($p->{upload_filetype} eq "website_image"){ - # $basepath = $ENV{"DOCUMENT_ROOT"}; - # $filepath = 'images/'.$p->{folder}.'/'.$p->{upload_file}; - if ($filepath ne ""){ - $p->{path} = $basepath.'/'.$filepath; - $p->{suffix} = $suffix; - my $fh = $cgi->upload('file'); - open(NF,">".$basepath.'/'.$filepath); - binmode NF; - while (<$fh>) { - print NF; - } - close(NF); - if ($p->{filetype} eq "download_document"){ - if ($suffix eq 'png' || $suffix eq 'jpg' || $suffix eq 'pdf'){ - system('convert -thumbnail x128 -background white -alpha remove "'.$basepath.'/'.$filepath.'" "'.$basepath.'/thumb/'.$filepath.'.thumb.png"'); - } - - if ($p->{row_id} eq ""){ - my $dx = $db->dbquerysorted("select id from documents where filename='".basename($filepath)."' and folder='documents'"); - if (keys(%{$dx}) == 0){ - my $sql = "INSERT INTO documents (filename,folder,filetype) VALUES ('".basename($filepath)."','documents','".$suffix."');"; - $db->dbexec($sql); - } - } - } - if ($p->{filetype} eq "news_image"){ - my ($pwidth,$pheight) =imgsize($p->{path}); - my $width=0; - my $height =0; - my $density = 72; - if ($pwidth>700){ - $width = 700; - } elsif ($height > 380) { - $height = 380; - } - if ($height == 0){ - $height = ($pheight/$pwidth) * $width; - } - elsif ($width == 0) { - $width = ($pwidth/$pheight) * $height; - } - if ($height > 380){ - $height = 380; - $width = ($width/$height) * $height; - } - system("mogrify -resize ".$width."x".$height." -density ".$density." ".$p->{path}); - } - if ($p->{filetype} eq "rankinglist_result"){ - - } - - # if ($p->{upload_filetype} eq "new_profile_photo"){ - # #convert! - # $db->dbexec("update members set new_profile_photo='".$filepath."' where id=".$p->{id_member}.";"); - # $html->{result}->{new_profile_photo}= $filepath; - # } elsif ($p->{upload_filetype} eq "profile_photo"){ - # #convert! - # $db->dbexec("update members set profile_photo='".$filepath."' where id=".$p->{id_member}.";"); - # $html->{result}->{new_profile_photo}= $filepath; - # } elsif ($p->{upload_filetype} eq "spillbou"){ - # $db->dbexec("update csresult set upload_team".$p->{team}."='".$filepath."' where id=;"); - # } elsif ($p->{upload_filetype} eq "member_document"){ - - # } elsif ($p->{upload_filetype} eq "clublogo_new"){ - - # } elsif ($p->{upload_filetype} eq "clublogo"){ - - # } elsif ($p->{upload_filetype} eq "website_image"){ - - # } els - } -} -if (exists($p->{gameresult})){ - my $basepath = dirname(dirname($ENV{SCRIPT_FILENAME})); - my $csdir = "data/championship/"; - my $gmid = $p->{id}; - my $cdata = $db->dbquerybykey("id","select * from vw_games where id=".$gmid); - if (exists($p->{upload_teamhome}) && $p->{upload_teamhome} ne ""){ - my $suffix = substr($p->{upload_teamhome},rindex($p->{upload_teamhome},'.')+1); - my $fh = $cgi->upload('upload_teamhome'); - my $filepath = $basepath.'/'.$csdir.'/'.$cdata->{$gmid}->{season}.'/'.$cdata->{$gmid}->{playday}.'_'.$cdata->{$gmid}->{link_teamhome}.'.'.$suffix; - open(NF,">".$filepath); - binmode NF; - while (<$fh>) { - print NF; - } - close(NF); - if (($sess->{usergroups} !~ /championship/ ) && ($p->{result_teamhome})){ - $db->dbexec("UPDATE csgames set upload_teamhome='".basename($filepath)."',result_teamhome='".$p->{result_teamhome}."' WHERE id=".$gmid); - } elsif ($sess->{usergroups} =~ /championship/ ){ - $db->dbexec("UPDATE csgames set upload_teamhome='".basename($filepath)."' WHERE id=".$gmid); - } - } - if (exists($p->{upload_teamguest}) && $p->{upload_teamguest} ne ""){ - my $suffix = substr($p->{upload_teamguest},rindex($p->{upload_teamguest},'.')+1); - my $fh = $cgi->upload('upload_teamguest'); - my $filepath = $basepath.'/'.$csdir.'/'.$cdata->{$gmid}->{season}.'/'.$cdata->{$gmid}->{playday}.'_'.$cdata->{$gmid}->{link_teamguest}.'.'.$suffix; - open(NF,">".$filepath); - binmode NF; - while (<$fh>) { - print NF; - } - close(NF); - if (($sess->{usergroups} !~ /championship/ ) && ($p->{result_teamguest})){ - $db->dbexec("UPDATE csgames set upload_teamguest='".basename($filepath)."',result_teamguest='".$p->{result_teamguest}."' WHERE id=".$gmid); - } elsif ($sess->{usergroups} =~ /championship/ ){ - $db->dbexec("UPDATE csgames set upload_teamguest='".basename($filepath)."' WHERE id=".$gmid); - } - } - if ($sess->{usergroups} =~ /championship/ ){ - my @upd = (); - if (exists($p->{validated})){ - if ($p->{validated} eq "1"){push(@upd,"validated=true");} else {push(@upd,"validated=null");} - } - if (exists($p->{result_teamhome})){ - push(@upd,"result_teamhome='".$p->{result_teamhome}."'"); - } - if (exists($p->{result_teamguest})){ - push(@upd,"result_teamguest='".$p->{result_teamguest}."'"); - } - if (exists($p->{sets_teamhome})){ - push(@upd,"sets_teamhome='".$p->{sets_teamhome}."'"); - } - if (exists($p->{sets_teamguest})){ - push(@upd,"sets_teamguest='".$p->{sets_teamguest}."'"); - } - $db->dbexec("UPDATE csgames set ".join(",",@upd)." where id=".$gmid); - } - $cdata = $db->dbquerybykey("id","select * from vw_games where id=".$gmid); - if (($sess->{usergroups} !~ /championship/ ) && ($cdata->{$gmid}->{result_teamhome} eq $cdata->{$gmid}->{result_teamguest}) && ($cdata->{$gmid}->{validated} ne "1")){ - - # my $pth = "null"; - # my $ptg = "null"; - my @x = (); - if (($p->{sets_teamhome} ne "") && ($p->{sets_teamguest} ne "")){ - push(@x,$p->{sets_teamhome}); - push(@x,$p->{sets_teamguest}); - } else { - @x= split("-",$cdata->{$gmid}->{result_teamhome}); - } - - $db->dbexec("update csgames set sets_teamhome=".$x[0].", sets_teamguest=".$x[1]." WHERE id=".$gmid.";"); - } - - $cdata = $db->dbquerybykey("id","select * from vw_games where id=".$gmid); - if (($cdata->{$gmid}->{sets_teamhome} eq "") || ($cdata->{$gmid}->{sets_teamguest} eq "")){ - $db->dbexec("update csgames set sets_teamhome=null, sets_teamguest=null,points_teamhome=null,points_teamguest=null,validated=null WHERE id=".$gmid.";"); - }else { - my $pth = "null"; - my $ptg = "null"; - if (int($cdata->{$gmid}->{sets_teamhome}) > int($cdata->{$gmid}->{sets_teamguest})){$pth = 3;$ptg=0;} else {$pth = 0;$ptg=3;} - if (int($cdata->{$gmid}->{sets_teamhome}) == int($cdata->{$gmid}->{sets_teamguest})){$pth = 1; $ptg = 1;} - $db->dbexec("update csgames set points_teamhome=".$pth.",points_teamguest=".$ptg." WHERE id=".$gmid.";"); - } - $db->dbexec("select * from setcsranking('".$cdata->{$gmid}->{id_season}."','".$cdata->{$gmid}->{id_division}."');"); -} -my $js = JSON::PP->new(); -$js->allow_blessed(1); -# open(NF,">upload.txt"); -# print NF $js->utf8->encode($p); -# print NF $js->utf8->encode($sess); -# close(NF); -$html->{result}->{p} = $p; -print $js->utf8->encode($p); \ No newline at end of file diff --git a/test.pl b/test.pl deleted file mode 100644 index 65072f6..0000000 --- a/test.pl +++ /dev/null @@ -1,29 +0,0 @@ -#!C:\Strawberry\perl\bin\perl.exe - -use strict; -use warnings; - -use Crypt::CBC; -use MIME::Base64; -use Digest::MD5 qw(md5_hex md5); - -my $plainText = "testtest"; -my $id = "aabb"; - -my $iv = substr(md5_hex($id), 0, 16); -print $iv."\n"; -my $cipher = Crypt::CBC->new( - -key => substr(md5($id),0,16), - -iv => $iv, - -cipher => 'Cipher::AES', - -literal_key => 1, - -header => "none", - -padding => "standard", - -keysize => 16 - ); - - -my $encrypted = $cipher->encrypt($plainText); -my $base64 = encode_base64($encrypted); -print "Enc:".$encrypted."\n"; -print("Ciphertext(b64):$base64\n"); diff --git a/website/.htaccess b/website/.htaccess deleted file mode 100644 index d15b083..0000000 --- a/website/.htaccess +++ /dev/null @@ -1,7 +0,0 @@ -#SetEnv PERL5LIB "/usr/home/dksalu/public_html/perl5" -RewriteEngine on -DirectoryIndex index.php index.html -AddHandler cgi-script .cgi -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule "^(.*)$" "index.php" [NC,L,QSA] diff --git a/website/css/fonts/ledf.svg b/website/css/fonts/ledf.svg deleted file mode 100644 index 30121bb..0000000 --- a/website/css/fonts/ledf.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - \ No newline at end of file diff --git a/website/css/fonts/ledf.ttf b/website/css/fonts/ledf.ttf deleted file mode 100644 index ac8e4b1..0000000 Binary files a/website/css/fonts/ledf.ttf and /dev/null differ diff --git a/website/css/fonts/ledf.woff b/website/css/fonts/ledf.woff deleted file mode 100644 index ba03696..0000000 Binary files a/website/css/fonts/ledf.woff and /dev/null differ diff --git a/website/css/icons.css b/website/css/icons.css deleted file mode 100644 index 787a144..0000000 --- a/website/css/icons.css +++ /dev/null @@ -1,41 +0,0 @@ -@font-face { - font-family: 'ledf'; - src: - url('fonts/ledf.ttf?d9kavb') format('truetype'), - url('fonts/ledf.woff?d9kavb') format('woff'), - url('fonts/ledf.svg?d9kavb#ledf') format('svg'); - font-weight: normal; - font-style: normal; - font-display: block; -} - -[class^="icon-"], [class*=" icon-"] { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'ledf' !important; - speak: never; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.icon-envelop:before { - content: "\e945"; -} -.icon-location:before { - content: "\e947"; -} -.icon-map2:before { - content: "\e94c"; -} -.icon-calendar:before { - content: "\e953"; -} -.icon-menu:before { - content: "\e9bd"; -} diff --git a/website/css/theme.css b/website/css/theme.css deleted file mode 100644 index 2b61b8b..0000000 --- a/website/css/theme.css +++ /dev/null @@ -1,990 +0,0 @@ -/* W3PRO.CSS 4.13 June 2019 by Jan Egil and Borge Refsnes */ -html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} -/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ -html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} -html,body {-webkit-user-select: none;-ms-user-select: none;user-select: none;-moz-user-select:none;} -article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item} -audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} -audio:not([controls]){display:none;height:0}[hidden],template{display:none} -a{background-color:transparent}a:active,a:hover{outline-width:0} -abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} -b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000} -small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none} -code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible} -button,input,select,textarea,optgroup{font:inherit;margin:0}optgroup{font-weight:bold} -button,input{overflow:visible}button,select{text-transform:none} -button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button} -button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0} -button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} -[type=checkbox],[type=radio]{padding:0} -[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} -[type=search]{-webkit-appearance:textfield;outline-offset:-2px} -[type=search]::-webkit-search-decoration{-webkit-appearance:none} -::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} -/* End extract */ -/* html,body { - background-color: #52638e; -} */ -html,body{font-family:Verdana,sans-serif;font-size:9pt;line-height:1.5}html{overflow-x:hidden} -h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.serif{font-family:serif} -h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin: 0}.wide{letter-spacing:4px} -hr{border:0;border-top:1px solid #eee;margin:20px 0} -.img{max-width:100%;height:auto; vertical-align:middle}a{color:inherit} -.table,.table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.table-all{border:1px solid #ccc} -.bordered tr,.table-all tr{border-bottom:1px solid #ddd}.striped tbody tr:nth-child(even){background-color:#f1f1f1} -.table-all tr:nth-child(odd){background-color:#fff}.table-all tr:nth-child(even){background-color:#f1f1f1} -.hoverable tbody tr:hover,.ul.hoverable li:hover{background-color:#ccc}.centered tr th,.centered tr td{text-align:center} -.table td,.table th,.table-all td,.table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} -.table th:first-child,.table td:first-child,.table-all th:first-child,.table-all td:first-child{padding-left:16px} -.btn,.button{border:none;display:inline-block;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap ;border-radius: 3px;} -.btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} -.btn,.button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.disabled,.btn:disabled,.button:disabled{cursor:not-allowed;opacity:0.3}.disabled *,:disabled *{pointer-events:none} -.btn.disabled:hover,.btn:disabled:hover{box-shadow:none} -.badge,.tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.badge{border-radius:50%} -.ul{list-style-type:none;padding:0;margin:0}.ul li{padding:8px 16px;border-bottom:1px solid #ddd}.ul li:last-child{border-bottom:none} -.tooltip,.display-container{position:relative}.tooltip .text{display:none}.tooltip:hover .text{display:inline-block} -.ripple:active{opacity:0.5}.ripple{transition:opacity 0s} -.input{padding:2px;display:block;border: 0;border-bottom: 1px solid #ccc;width:100%;background-color: #fff;}/*#e8f0fe*/ -.select{padding:2px 0; display:block;width:100%;border:1px solid #ccc;background-color: #fff;} -.dropdown-click,.dropdown-hover{position:relative;display:inline-block;cursor:pointer} -.dropdown-hover:hover .dropdown-content{display:block; } -.dropdown-hover:first-child,.dropdown-click:hover{background-color:#ccc;color:#000} -.dropdown-hover:hover > .button:first-child,.dropdown-click:hover > .button:first-child{background-color:#ccc;color:#000} -.dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0;z-index:1} -.check,.radio{width:24px;height:24px;position:relative;top:6px} -.sidebar{height:100%;width:160px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} -.bar-block .dropdown-hover,.bar-block .dropdown-click{width:100%} -.bar-block .dropdown-hover .dropdown-content,.bar-block .dropdown-click .dropdown-content{min-width:100%} -.bar-block .dropdown-hover .button,.bar-block .dropdown-click .button{width:100%;text-align:left;padding:8px 16px} -.main,#main{transition:margin-left .4s} -.modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} -.modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} -.bar{width:100%;overflow:hidden}.center .bar{display:inline-block;width:auto} -.bar .bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0} -.bar .dropdown-hover,.bar .dropdown-click{position:static;float:left} -.bar .button{white-space:normal} -.bar-block .bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0} -.bar-block.center .bar-item{text-align:center}.block{display:block;width:100%} -.responsive{display:block;overflow-x:auto} -.container:after,.container:before,.datapanel:after,.datapanel:before,.row:after,.row:before,.row-padding:after,.row-padding:before, -.cell-row:before,.cell-row:after,.clear:after,.clear:before,.bar:before,.bar:after{content:"";display:table;clear:both} -.col,.half,.third,.twothird,.threequarter,.quarter,.fifth,.twofifth,.threefifth,.fourfifth{float:left;width:100%} -.col.s1{width:8.33333%}.col.s2{width:16.66666%}.col.s3{width:24.99999%}.col.s4{width:33.33333%} -.col.s5{width:41.66666%}.col.s6{width:49.99999%}.col.s7{width:58.33333%}.col.s8{width:66.66666%} -.col.s9{width:74.99999%}.col.s10{width:83.33333%}.col.s11{width:91.66666%}.col.s12{width:99.99999%} -@media (min-width:601px){.col.m1{width:8.33333%}.col.m2{width:16.66666%}.col.m3,.quarter{width:24.99999%}.col.m4,.third{width:33.33333%}.fifth{width:20%;min-width:100px} -.col.m5{width:41.66666%}.col.m6,.half{width:49.99999%}.col.m7{width:58.33333%}.col.m8,.twothird{width:66.66666%} -.col.m9,.threequarter{width:74.99999%}.col.m10{width:83.33333%}.col.m11{width:91.66666%}.col.m12{width:99.99999%}.twofifth{width:40%}.threefifth{width:60%}.fourfifth{width:80%}} -@media (min-width:993px){.col.l1{width:8.33333%}.col.l2{width:16.66666%}.col.l3{width:24.99999%}.col.l4{width:33.33333%} -.col.l5{width:41.66666%}.col.l6{width:49.99999%}.col.l7{width:58.33333%}.col.l8{width:66.66666%} -.col.l9{width:74.99999%}.col.l10{width:83.33333%}.col.l11{width:91.66666%}.col.l12{width:99.99999%}} -.rest{overflow:hidden}.stretch{margin-left:-16px;margin-right:-16px} -.content,.auto{margin-left:auto;margin-right:auto}.content{max-width:980px}.auto{max-width:1140px} -.cell-row{display:table;width:100%}.cell{display:table-cell} -.cell-top{vertical-align:top}.cell-middle{vertical-align:middle}.cell-bottom{vertical-align:bottom} -.hide{display:none!important}.show-block,.show{display:block!important}.show-inline-block{display:inline-block!important} -@media (max-width:1205px){.auto{max-width:95%}} -@media (max-width:600px){.modal-content{margin:0 10px;width:auto!important}.modal{padding-top:30px} -.dropdown-hover.mobile .dropdown-content,.dropdown-click.mobile .dropdown-content{position:relative} -.hide-small{display:none!important}.mobile{display:block;width:100%!important}.bar-item.mobile,.dropdown-hover.mobile,.dropdown-click.mobile{text-align:center} -.dropdown-hover.mobile,.dropdown-hover.mobile .btn,.dropdown-hover.mobile .button,.dropdown-click.mobile,.dropdown-click.mobile .btn,.dropdown-click.mobile .button{width:100%}} -@media (max-width:768px){.modal-content{width:500px}.modal{padding-top:50px}} -@media (min-width:993px){.modal-content{width:900px}.hide-large{display:none!important}.sidebar.collapse{display:block!important}} -@media (max-width:992px) and (min-width:601px){.hide-medium{display:none!important}} -@media (max-width:992px){.sidebar.collapse{display:none}.main{margin-left:0!important;margin-right:0!important}.auto{max-width:100%}} -.top,.bottom{position:fixed;width:100%;z-index:1}.top{top:0}.bottom{bottom:0} -.overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} -.display-topleft{position:absolute;left:0;top:0}.display-topright{position:absolute;right:0;top:0} -.display-bottomleft{position:absolute;left:0;bottom:0}.display-bottomright{position:absolute;right:0;bottom:0} -.display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} -.display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} -.display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} -.display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} -.display-container:hover .display-hover{display:block}.display-container:hover span.display-hover{display:inline-block}.display-hover{display:none} -.display-position{position:absolute} -.circle{border-radius:50%} -.round-small{border-radius:2px}.round,.round-medium{border-radius:4px}.round-large{border-radius:8px}.round-xlarge{border-radius:16px}.round-xxlarge{border-radius:32px} -.row-padding,.row-padding>.half,.row-padding>.third,.row-padding>.twothird,.row-padding>.threequarter,.row-padding>.quarter,.row-padding>.col{padding:0 8px} -.container,.datapanel{padding:0.01em 8px}.datapanel{margin-top:8px;margin-bottom:8px} -.code,.codespan{font-family:Consolas,"courier new";font-size:16px} -.code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} -.codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} -/* .card,.card-2{} */ -.card-4,.hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)} -.spin{animation:spin 2s infinite linear}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} -.animate-fading{animation:fading 2s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -.animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}} -.animate-top{position:relative;animation:animatetop 1s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -.animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -.animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -.animate-bottom{position:relative;animation:animatebottom 1s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} -.animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} -.animate-input{transition:width 0.4s ease-in-out}.animate-input:focus{width:100%!important} -.opacity,.hover-opacity:hover{opacity:0.60}.opacity-off,.hover-opacity-off:hover{opacity:1} -.opacity-max{opacity:0.25}.opacity-min{opacity:0.75} -.greyscale-max,.grayscale-max,.hover-greyscale:hover,.hover-grayscale:hover{filter:grayscale(100%)} -.greyscale,.grayscale{filter:grayscale(75%)}.greyscale-min,.grayscale-min{filter:grayscale(50%)} -.sepia{filter:sepia(75%)}.sepia-max,.hover-sepia:hover{filter:sepia(100%)}.sepia-min{filter:sepia(50%)} -.tiny{font-size:10px!important}.small{font-size:12px!important}.medium{font-size:15px!important}.large{font-size:18px!important} -.xlarge{font-size:24px!important}.xxlarge{font-size:36px!important}.xxxlarge{font-size:48px!important}.jumbo{font-size:64px!important} -.left-align{text-align:left!important}.right-align{text-align:right!important}.justify{text-align:justify!important}.center{text-align:center!important} -.border-0{border:0!important}.border{border:1px solid #ccc!important} -.border-top{border-top:1px solid #ccc!important}.border-bottom{border-bottom:1px solid #ccc!important} -.border-left{border-left:1px solid #ccc!important}.border-right{border-right:1px solid #ccc!important} -.topbar{border-top:6px solid #ccc!important}.bottombar{border-bottom:6px solid #ccc!important} -.leftbar{border-left:6px solid #ccc!important}.rightbar{border-right:6px solid #ccc!important} -.section,.code{margin-top:16px!important;margin-bottom:16px!important} -.margin{margin:16px!important}.margin-top{margin-top:16px!important}.margin-bottom{margin-bottom:16px!important} -.margin-left{margin-left:16px!important}.margin-right{margin-right:16px!important} -.padding-small{padding:4px 8px!important}.padding{padding:8px 16px!important}.padding-large{padding:12px 24px!important} -.padding-16{padding-top:16px!important;padding-bottom:16px!important}.padding-24{padding-top:24px!important;padding-bottom:24px!important} -.padding-32{padding-top:32px!important;padding-bottom:32px!important}.padding-48{padding-top:48px!important;padding-bottom:48px!important} -.padding-64{padding-top:64px!important;padding-bottom:64px!important} -.left{float:left!important}.right{float:right!important} -.button:hover{color:#fff!important;background-color:#343434!important} -.transparent,.hover-none:hover{background-color:transparent!important} -.hover-none:hover{box-shadow:none!important} -/* DEFAULT COLORS */ -.amber,.hover-amber:hover{color:#000!important;background-color:#ffc107!important} -.aqua,.hover-aqua:hover{color:#000!important;background-color:#00ffff!important} -.blue,.hover-blue:hover{color:#fff!important;background-color:#2196F3!important} -.light-blue,.hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} -.brown,.hover-brown:hover{color:#fff!important;background-color:#795548!important} -.cyan,.hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} -.blue-grey,.hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important} -.green,.hover-green:hover{color:#fff!important;background-color:#4CAF50!important} -.light-green,.hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} -.indigo,.hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} -.khaki,.hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} -.lime,.hover-lime:hover{color:#000!important;background-color:#cddc39!important} -.orange,.hover-orange:hover{color:#000!important;background-color:#ff9800!important} -.deep-orange,.hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} -.pink,.hover-pink:hover{color:#fff!important;background-color:#e91e63!important} -.purple,.hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} -.deep-purple,.hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} -.red,.hover-red:hover{color:#fff!important;background-color:#f44336!important} -.sand,.hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} -.teal,.hover-teal:hover{color:#fff!important;background-color:#009688!important} -.yellow,.hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} -.white,.hover-white:hover{color:#000!important;background-color:#fff!important} -.black,.hover-black:hover{color:#fff!important;background-color:#000!important} -.grey,.hover-grey:hover{color:#000!important;background-color:#c6c6c6!important} -.light-grey,.hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important} -.dark-grey,.hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} -.pale-red,.hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.pale-green,.hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} -.pale-yellow,.hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.pale-blue,.hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} -.text-align-right { text-align: right;} -.text-amber,.hover-text-amber:hover{color:#ffc107!important} -.text-aqua,.hover-text-aqua:hover{color:#00ffff!important} -.text-blue,.hover-text-blue:hover{color:#2196F3!important} -.text-light-blue,.hover-text-light-blue:hover{color:#87CEEB!important} -.text-brown,.hover-text-brown:hover{color:#795548!important} -.text-cyan,.hover-text-cyan:hover{color:#00bcd4!important} -.text-blue-grey,.hover-text-blue-grey:hover{color:#607d8b!important} -.text-green,.hover-text-green:hover{color:#4CAF50!important} -.text-light-green,.hover-text-light-green:hover{color:#8bc34a!important} -.text-indigo,.hover-text-indigo:hover{color:#3f51b5!important} -.text-khaki,.hover-text-khaki:hover{color:#b4aa50!important} -.text-lime,.hover-text-lime:hover{color:#cddc39!important} -.text-orange,.hover-text-orange:hover{color:#ff9800!important} -.text-deep-orange,.hover-text-deep-orange:hover{color:#ff5722!important} -.text-pink,.hover-text-pink:hover{color:#e91e63!important} -.text-purple,.hover-text-purple:hover{color:#9c27b0!important} -.text-deep-purple,.hover-text-deep-purple:hover{color:#673ab7!important} -.text-red,.hover-text-red:hover{color:#f44336!important} -.text-sand,.hover-text-sand:hover{color:#fdf5e6!important} -.text-teal,.hover-text-teal:hover{color:#009688!important} -.text-yellow,.hover-text-yellow:hover{color:#d2be0e!important} -.text-white,.hover-text-white:hover{color:#fff!important} -.text-black,.hover-text-black:hover{color:#000!important} -.text-grey,.hover-text-grey:hover{color:#757575!important} -.text-light-grey,.hover-text-light-grey:hover{color:#f1f1f1!important} -.text-dark-grey,.hover-text-dark-grey:hover{color:#3a3a3a!important} -.border-amber,.hover-border-amber:hover{border-color:#ffc107!important} -.border-aqua,.hover-border-aqua:hover{border-color:#00ffff!important} -.border-blue,.hover-border-blue:hover{border-color:#2196F3!important} -.border-light-blue,.hover-border-light-blue:hover{border-color:#87CEEB!important} -.border-brown,.hover-border-brown:hover{border-color:#795548!important} -.border-cyan,.hover-border-cyan:hover{border-color:#00bcd4!important} -.border-blue-grey,.hover-blue-grey:hover{border-color:#607d8b!important} -.border-green,.hover-border-green:hover{border-color:#4CAF50!important} -.border-light-green,.hover-border-light-green:hover{border-color:#8bc34a!important} -.border-indigo,.hover-border-indigo:hover{border-color:#3f51b5!important} -.border-khaki,.hover-border-khaki:hover{border-color:#f0e68c!important} -.border-lime,.hover-border-lime:hover{border-color:#cddc39!important} -.border-orange,.hover-border-orange:hover{border-color:#ff9800!important} -.border-deep-orange,.hover-border-deep-orange:hover{border-color:#ff5722!important} -.border-pink,.hover-border-pink:hover{border-color:#e91e63!important} -.border-purple,.hover-border-purple:hover{border-color:#9c27b0!important} -.border-deep-purple,.hover-border-deep-purple:hover{border-color:#673ab7!important} -.border-red,.hover-border-red:hover{border-color:#f44336!important} -.border-sand,.hover-border-sand:hover{border-color:#fdf5e6!important} -.border-teal,.hover-border-teal:hover{border-color:#009688!important} -.border-yellow,.hover-border-yellow:hover{border-color:#ffeb3b!important} -.border-white,.hover-border-white:hover{border-color:#fff!important} -.border-black,.hover-border-black:hover{border-color:#000!important} -.border-grey,.hover-border-grey:hover{border-color:#9e9e9e!important} -.border-light-grey,.hover-border-light-grey:hover{border-color:#f1f1f1!important} -.border-dark-grey,.hover-border-dark-grey:hover{border-color:#616161!important} -.border-pale-red,.hover-border-pale-red:hover{border-color:#ffe7e7!important}.border-pale-green,.hover-border-pale-green:hover{border-color:#e7ffe7!important} -.border-pale-yellow,.hover-border-pale-yellow:hover{border-color:#ffffd7!important}.border-pale-blue,.hover-border-pale-blue:hover{border-color:#e7ffff!important} -/* DEFAULT THEME */ -.theme-l5 {color:#000 !important; background-color:#f6f8fc !important} -.theme-l4 {color:#000 !important; background-color:#e1e9f6 !important} -.theme-l3 {color:#000 !important; background-color:#c3d3ed !important} -.theme-l2 {color:#000 !important; background-color:#a5bee4 !important} -.theme-l1 {color:#fff !important; background-color:#88a8db !important} -.theme-d1 {color:#fff !important; background-color:#5180cb !important} -.theme-d2 {color:#fff !important; background-color:#3a6fc3 !important} -.theme-d3 {color:#fff !important; background-color:#3361aa !important} -.theme-d4 {color:#fff !important; background-color:#2c5392 !important} -.theme-d5 {color:#fff !important; background-color:#24457a !important} - -.theme-light {color:#000 !important; background-color:#f6f8fc !important} -.theme-dark {color:#fff !important; background-color:#24457a !important} -.theme-action {color:#fff !important; background-color:#24457a !important} - -.theme {color:#fff !important; background-color:#6a92d3 !important} -.text-theme {color:#6a92d3 !important} -.border-theme {border-color:#6a92d3 !important} - -.hover-theme:hover {color:#fff !important; background-color:#6a92d3 !important} -.hover-text-theme:hover {color:#6a92d3 !important} -.hover-border-theme:hover {border-color:#6a92d3 !important} - -/* .label { color: #000; font-size: 8pt;} */ -/* #main {margin-left: 210px;} */ -/* @media (max-width:768px){ - #sidebar { display: none;} - #main { margin-left: 0px;} -} */ - -.table { - table-layout: fixed; -} - -.text-line-through { text-decoration: line-through; } - -#snackbar { - visibility: hidden; - min-width: 250px; - margin-left: -125px; - background-color: #333; - color: #fff; - text-align: center; - - padding: 16px; - position: fixed; - z-index: 1; - left: 50%; - bottom: 30px; - font-size: 17px; -} - -#snackbar.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; -} - -@-webkit-keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} -} - -@-webkit-keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -@keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} - -.tabulator-header-filter > input { - background-color: #fff; - border: 1px solid #ccc; - font-weight: normal; -} - -.readonly { - pointer-events:none; - color: #000!important; - background-color: #d3d3d3!important; -} - - - -.right-side-bg { - background: url("../img/bg1.jpg"); - background-size: cover; - min-height: 100vh; -} - - - - -/* .mceContentBody { - background: #fff; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - - -button -{ - background-color: #f4f4f4; - border: 1pt solid #cccccc; - font-size: 10pt; - color: #000; - line-height: 1line; - text-align: center; -} -button:hover -{ - background-color: #343434; -} -button:pressed -{ - background-color: #343434; -} -button:focus -{ - background-color: #343434; -} - -header -{ - background-color: #fff; - box-sizing: border-box; -} - - - - -::-webkit-input-placeholder -{ - color: rgba(60.3922%,60.3922%,60.3922%,1); -} - - -textarea -{ - background-color: #fff; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-size: 11pt; - color: #000; - line-height: 1line; - text-align: left; - /* margin-top: 0.88em; - margin-right: 0.75em; - margin-bottom: 0.63em; - margin-left: 0.75em; - top: 0pt; - right: 30pt; - bottom: 0pt; - left: 0pt; - position: absolute; - box-sizing: border-box; */ -} -textarea:focus -{ - border-top-color: rgba(0%,43.9216%,81.1765%,1); - border-right-color: rgba(0%,43.9216%,81.1765%,1); - border-bottom-color: rgba(0%,43.9216%,81.1765%,1); - border-left-color: rgba(0%,43.9216%,81.1765%,1); -} -textarea:placeholder -{ - color: rgba(80%,80%,80%,1); -} -/* textarea .text -{ - -} */ -textarea .scrollbar_track -{ - width: 30pt; - top: 0pt; - right: 0pt; - bottom: 0pt; - position: absolute; - box-sizing: border-box; -} - - -footer -{ - background-color: #fff; - box-sizing: border-box; -} - - -div.group_container -{ - background-color: #e3e3e3; - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - padding-top: 4px; - padding-bottom: 8px; -} - -/* Custom Styles */ -.ListView_Default -{ - - background-color: rgba(0%,0%,0%,0); - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - - color: #000; - text-align: left; - margin-top: 2pt; - margin-right: 2pt; - margin-bottom: 2pt; - margin-left: 2pt; -} - - -button.btnNavigation -{ - - background-color: rgba(0%,0%,0%,0); - - - font-weight: bold; - font-size: 10pt; - color: #fff; - padding-top: 0pt; - padding-right: 0pt; - padding-bottom: 0pt; - padding-left: 0pt; -} - -div.PageListHeader -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - color: #fff; - -} -div.PageListHeader .inner_border -{ - padding-top: 5pt; - padding-right: 5pt; - padding-bottom: 5pt; - padding-left: 5pt; -} - -.moduletoolbar -{ - background-color: #293146; - color: #fff; -} - -div.BodySectionHeader -{ - - font-weight: bold; -} - -button.Button_ImgPlacer -{ - - background-color: rgba(0%,0%,0%,0); - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - - - font-weight: bold; - font-size: 10pt; - color: #fff; -} -button.Button_ImgPlacer .inner_border -{ - padding-top: 0pt; - padding-right: 0pt; - padding-bottom: 0pt; - padding-left: 0pt; -} - - -div.PageHeadTitle -{ - font-size: 18pt; - color: #fff; -} - -div.ListView_SectionHeader -{ - - background-color: rgba(22.3529%,26.6667%,38.4314%,1); - -} - -button.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - - background-color: rgba(0%,0%,0%,0); - - color: #fff; -} -button.toolbarbtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -button.toolbarbtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -button.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -a.toolbarbtn -{ - border: 0.5px solid #c6c6c6; - background-color: rgba(0%,0%,0%,0); - color: #fff; - text-decoration: none!important; - font-size: 13pt!important; -} -a.toolbarbtn:hover -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -a.toolbarbtn:pressed -{ - - background-color: rgba(20.3922%,20.3922%,20.3922%,1); - -} -butaton.toolbarbtn:focus -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); -} - - -div.ListView_Header -{ - border-top-color: rgba(80%,80%,80%,1); - border-right-color: rgba(80%,80%,80%,1); - border-bottom-color: rgba(80%,80%,80%,1); - border-left-color: rgba(80%,80%,80%,1); - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-width: 1pt; - border-right-width: 1pt; - border-bottom-width: 1pt; - border-left-width: 1pt; - font-weight: normal; - color: #fff; - -} -div.ListView_Header .inner_border -{ - padding-top: 2pt; - padding-right: 2pt; - padding-bottom: 2pt; - padding-left: 2pt; -} - -div.toolbar -{ - /* */ - /* background-color: rgba(32.1569%,38.8235%,55.6863%,1); */ - background-color: #003268; - /* */ -} - -div.FooterLabel -{ - color: #fff; -} - -button.Buttom_BodyNav:hover -{ - - background-color: rgb(141, 141, 141); - - /* color: #fff; */ -} - - -/* div.portalpanel { - display: -webkit-box; - width: 100%; -} */ - -/* .portal{ - width: 100%; - table-layout: fixed; - border-collapse: collapse; -} - -.portal tbody{ -display:block; -width: 100%; -overflow-y: scroll; - -} - -.portal thead tr,.portal tfoot tr { - display: block; - width: 100%; - -} - -.portal thead,.portal tfoot { -background: #384462; -color:#fff; -} - -.portal th, .portal td { -padding: 5px; -text-align: left; -width: 100%; - border: 1px solid #c6c6c6; - -} - -.portal tbody tr:nth-child(even) { - background-color: rgb(247, 247, 247); -} - -.portal tbody tr:hover{ - background-color: #959fb9; -} - -.portal_selected { - background-color: #acacac!important; -} */ - - - - -::-webkit-scrollbar { --webkit-appearance: none; -width: 10px; -} - -::-webkit-scrollbar-track { - background-color: rgba(80%, 80%, 80%, .5); -} - -::-webkit-scrollbar-thumb { -border-radius: 0px; -background-color: rgba(0, 0, 0, .5); --webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5); -} - -div.portaltextheader { - padding: 2px; - border: 1px solid white; -} - - - - - -select { - /* -webkit-appearance: none; */ - display: block; - color: #000; - line-height: 1line; - text-align: left; - padding: 3.5px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 0; - border-bottom: 1px solid #cccccc; - /* box-shadow: 0 1px 0 1px rgba(0,0,0,.04); */ - border-radius: 0px; - font-weight: normal; - font-size: 11pt; - background-color: #fff; - /* background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right .7em top 50%, 0 0; - background-size: .65em auto, 100%; */ -} - - -/* option { - appearance: none; - border: 1px solid 0070cf; - padding: 2px; -} */ -select:focus -{ - outline: 1px solid #3a6fc3; - /* border: 1px solid #3a6fc3; */ - /* border-radius: unset; */ -} - - -::-webkit-select-placeholder -{ - color: #9a9a9a; -} - -div.DataFooter{ - background: #384462; -} -.input-sum{padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D; } - - -.currency-sum {padding:2px;display:block;border: 1px solid #ccc;width:100%;background-color: #4D4D4D;} - -.currency-sum,.currency-sum:read-only { - display: block; - color: #fff; - padding: 2px; - padding-right: 12px; - width: 100%; - max-width: 100%; - box-sizing: border-box; - margin: 0; - border: 1px solid #ccc; - border-radius: unset; - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: #4D4D4D; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20fill=%22white%22%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%3C/svg%3E'); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - - - -/* input[type=date]::-webkit-inner-spin-button, -input[type=date]::-webkit-outer-spin-button { - display: none; -} */ - -:focus { - outline: unset; -} - -input -{ - background-color: #ffffff; - border: 0; - border-bottom: 1px solid #cccccc; - font-weight: normal; - font-size: 11pt; - color: #000000; - line-height: 1line; - text-align: left; - width:100%; - padding:2px; - display:block; - border-radius: 3px; -} -/* input:focus -{ - border: #0070cf; -} */ - -input:focus { - border: 1px solid #3a6fc3; - border-radius: unset; -} - -input[readonly=true]{ - color: #000!important; - background-color: #d3d3d3!important; -} - -/* input[type=number]::-webkit-inner-spin-button, -input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} */ -/* input[type=checkbox]{ - appearance: none; - display:inline-block; - font-size: 24px!important; - border: 1px solid green; -} */ - -input[class=currency] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - -input[class=currency]:read-only { - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22225%22%20height=%22300%22%3E%3Cpath%20stroke=%22none%22%20d=%22m%20224.99996,16.22698%20-8.11342,36.41161%20q%20-24.14255,-19.78892%20-54.61741,-19.78892%20-41.3588,0%20-65.00658,23.74671%20-23.647774,23.7467%20-28.397115,53.23215%20l%20134.960355,0%20-5.14505,26.71508%20-132.981532,0%20-0.395848,7.71771%200.395848,18.20566%20127.242642,0%20-5.14505,26.71508%20-117.941954,0%20q%207.519719,40.17154%2032.552754,59.06997%2025.03303,18.89844%2056.49745,18.89844%2037.20302,0%2057.98149,-19.59107%20l%200,40.9631%20Q%20192.34828,300%20162.26913,300%2053.034301,300%2030.474864,189.18206%20l%20-30.474864,0%205.738751,-26.71508%2020.580475,0%20q%20-0.395708,-4.74934%20-0.395708,-17.80995%20l%200,-8.11342%20-25.923518,0%205.738751,-26.71508%2023.152999,0%20Q%2039.181988,55.21112%2076.583149,27.60556%20113.98417,0%20163.06069,0%20199.868,0%20224.99996,16.22698%20z%22%20/%3E%0A%3C/svg%3E'), - linear-gradient(to bottom, #d3d3d3 0%,#d3d3d3 100%); -} - -input[class=percent] { - padding: 2px; - padding-right: 12px; - text-align: right; - background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22256%22%20height=%22232%22%20version=%221.0%22%3E%3Cg%20transform=%22translate(-112.3674,-128.3649)%22%3E%3Cpath%20style=%22fill:black;fill-opacity:1;stroke:none%22%20d=%22M%20317.1674,257.53698%20C%20308.53463,257.53708%20301.73774,261.20839%20296.77671,268.55094%20C%20291.91449,275.89365%20289.48349,286.1138%20289.48368,299.2114%20C%20289.48349,312.11067%20291.91449,322.2812%20296.77671,329.72303%20C%20301.73774,337.06568%20308.53463,340.737%20317.1674,340.73698%20C%20325.60128,340.737%20332.24934,337.06568%20337.11159,329.72303%20C%20342.07258,322.2812%20344.5532,312.11067%20344.55345,299.2114%20C%20344.5532,286.21302%20342.07258,276.04249%20337.11159,268.69977%20C%20332.24934,261.25801%20325.60128,257.53708%20317.1674,257.53698%20M%20317.1674,238.63466%20C%20332.84469,238.63477%20345.29739,244.09213%20354.52554,255.00675%20C%20363.75318,265.92157%20368.36713,280.65644%20368.3674,299.2114%20C%20368.36713,317.76648%20363.70357,332.50135%20354.37671,343.41605%20C%20345.14855,354.23156%20332.74546,359.6393%20317.1674,359.63931%20C%20301.29123,359.6393%20288.7393,354.23156%20279.51159,343.41605%20C%20270.28351,332.50135%20265.66956,317.76648%20265.66973,299.2114%20C%20265.66956,280.55721%20270.28351,265.82234%20279.51159,255.00675%20C%20288.83853,244.09213%20301.39045,238.63477%20317.1674,238.63466%20M%20163.5674,147.9928%20C%20155.03401,147.993%20148.28673,151.71393%20143.32554,159.15559%20C%20138.46349,166.49841%20136.03248,176.61933%20136.03252,189.51838%20C%20136.03248,202.61621%20138.46349,212.83635%20143.32554,220.17884%20C%20148.18751,227.52161%20154.93479,231.19292%20163.5674,231.1928%20C%20172.19989,231.19292%20178.94717,227.52161%20183.80926,220.17884%20C%20188.77041,212.83635%20191.25103,202.61621%20191.25113,189.51838%20C%20191.25103,176.71856%20188.77041,166.59764%20183.80926,159.15559%20C%20178.84794,151.71393%20172.10066,147.993%20163.5674,147.9928%20M%20297.9674,129.09047%20L%20321.78136,129.09047%20L%20182.7674,359.63931%20L%20158.95345,359.63931%20L%20297.9674,129.09047%20M%20163.5674,129.09047%20C%20179.24484,129.0907%20191.74715,134.54806%20201.07438,145.46256%20C%20210.4014,156.27827%20215.06496,170.96352%20215.06508,189.51838%20C%20215.06496,208.27201%20210.4014,223.05649%20201.07438,233.87187%20C%20191.84638,244.68748%20179.34406,250.09523%20163.5674,250.09512%20C%20147.79061,250.09523%20135.28829,244.68748%20126.06043,233.87187%20C%20116.93172,222.95727%20112.36739,208.17279%20112.3674,189.51838%20C%20112.36739,171.06275%20116.98134,156.37749%20126.20926,145.46256%20C%20135.43713,134.54806%20147.88983,129.0907%20163.5674,129.09047%22%20/%3E%3C/g%3E%3C/svg%3E'), - linear-gradient(to bottom, #fff 0%,#fff 100%); - background-repeat: no-repeat, repeat; - background-position: right 2px top 50%, 0 0; - background-size: 9px auto, 100%; -} - - -label { - height: 12.8px!important; - color: #757575; - font-size: 8pt; -} - - - -input[type="checkbox"] { - display: block; - -webkit-appearance:none;/* Hides the default checkbox style */ - height:29.66px; - width:29.66px; - cursor:pointer; - position:relative; - -webkit-transition: .15s; - border-radius: unset; - border: 1px solid #cccccc; - background-color:#fff; - } - - input[type="checkbox"]:checked { - background-color:green; - } - - input[type="checkbox"]:before, input[type="checkbox"]:checked:before { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - line-height:2em; - text-align:center; - color:#fff; - content: ''; - } - - input[type="checkbox"]:checked:before { - font-size: 11pt; - content: '✔'; - } - - input[type="checkbox"]:hover:before { - background:rgba(255,255,255,0.3); - } - - - body.mceContentBody { - background:#e8f0fe; - color:#000; -} - -/* .mceContentBody { - background: #e8f0fe; - color:#000; -} */ - -/* .tabulator-row-even { - background-color: #757575; -} */ - - -input:hover:enabled , select:hover:enabled { - outline: 1px solid #607d8b; - outline-offset: -1px; - /* Opera/IE 8+ */ -} -input:focus:enabled, select:focus:enabled { - outline: 1px solid #607d8b; - outline-offset: -1px; - /* Opera/IE 8+ */ -} - -input[type="time"]::-webkit-calendar-picker-indicator { - display: none; -} - -.border-bottom { - border-bottom: 2px solid #00bcd4; -} \ No newline at end of file diff --git a/website/img/bg.png b/website/img/bg.png deleted file mode 100644 index 7f32c97..0000000 Binary files a/website/img/bg.png and /dev/null differ diff --git a/website/img/club.png b/website/img/club.png deleted file mode 100644 index a80ec28..0000000 Binary files a/website/img/club.png and /dev/null differ diff --git a/website/img/favicon/android-icon-144x144.png b/website/img/favicon/android-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/website/img/favicon/android-icon-144x144.png and /dev/null differ diff --git a/website/img/favicon/android-icon-192x192.png b/website/img/favicon/android-icon-192x192.png deleted file mode 100644 index c156ad7..0000000 Binary files a/website/img/favicon/android-icon-192x192.png and /dev/null differ diff --git a/website/img/favicon/android-icon-36x36.png b/website/img/favicon/android-icon-36x36.png deleted file mode 100644 index 747aa84..0000000 Binary files a/website/img/favicon/android-icon-36x36.png and /dev/null differ diff --git a/website/img/favicon/android-icon-48x48.png b/website/img/favicon/android-icon-48x48.png deleted file mode 100644 index 8db5eec..0000000 Binary files a/website/img/favicon/android-icon-48x48.png and /dev/null differ diff --git a/website/img/favicon/android-icon-72x72.png b/website/img/favicon/android-icon-72x72.png deleted file mode 100644 index 15bcb2e..0000000 Binary files a/website/img/favicon/android-icon-72x72.png and /dev/null differ diff --git a/website/img/favicon/android-icon-96x96.png b/website/img/favicon/android-icon-96x96.png deleted file mode 100644 index f100597..0000000 Binary files a/website/img/favicon/android-icon-96x96.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-114x114.png b/website/img/favicon/apple-icon-114x114.png deleted file mode 100644 index 0750044..0000000 Binary files a/website/img/favicon/apple-icon-114x114.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-120x120.png b/website/img/favicon/apple-icon-120x120.png deleted file mode 100644 index 3877b6b..0000000 Binary files a/website/img/favicon/apple-icon-120x120.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-144x144.png b/website/img/favicon/apple-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/website/img/favicon/apple-icon-144x144.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-152x152.png b/website/img/favicon/apple-icon-152x152.png deleted file mode 100644 index 4a86c7a..0000000 Binary files a/website/img/favicon/apple-icon-152x152.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-180x180.png b/website/img/favicon/apple-icon-180x180.png deleted file mode 100644 index dbb3bba..0000000 Binary files a/website/img/favicon/apple-icon-180x180.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-57x57.png b/website/img/favicon/apple-icon-57x57.png deleted file mode 100644 index 951ada5..0000000 Binary files a/website/img/favicon/apple-icon-57x57.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-60x60.png b/website/img/favicon/apple-icon-60x60.png deleted file mode 100644 index bcc7174..0000000 Binary files a/website/img/favicon/apple-icon-60x60.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-72x72.png b/website/img/favicon/apple-icon-72x72.png deleted file mode 100644 index 15bcb2e..0000000 Binary files a/website/img/favicon/apple-icon-72x72.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-76x76.png b/website/img/favicon/apple-icon-76x76.png deleted file mode 100644 index b9b0895..0000000 Binary files a/website/img/favicon/apple-icon-76x76.png and /dev/null differ diff --git a/website/img/favicon/apple-icon-precomposed.png b/website/img/favicon/apple-icon-precomposed.png deleted file mode 100644 index f64a9a7..0000000 Binary files a/website/img/favicon/apple-icon-precomposed.png and /dev/null differ diff --git a/website/img/favicon/apple-icon.png b/website/img/favicon/apple-icon.png deleted file mode 100644 index f64a9a7..0000000 Binary files a/website/img/favicon/apple-icon.png and /dev/null differ diff --git a/website/img/favicon/browserconfig.xml b/website/img/favicon/browserconfig.xml deleted file mode 100644 index c554148..0000000 --- a/website/img/favicon/browserconfig.xml +++ /dev/null @@ -1,2 +0,0 @@ - -#ffffff \ No newline at end of file diff --git a/website/img/favicon/favicon-16x16.png b/website/img/favicon/favicon-16x16.png deleted file mode 100644 index 0281448..0000000 Binary files a/website/img/favicon/favicon-16x16.png and /dev/null differ diff --git a/website/img/favicon/favicon-32x32.png b/website/img/favicon/favicon-32x32.png deleted file mode 100644 index 9eb08e9..0000000 Binary files a/website/img/favicon/favicon-32x32.png and /dev/null differ diff --git a/website/img/favicon/favicon-96x96.png b/website/img/favicon/favicon-96x96.png deleted file mode 100644 index f100597..0000000 Binary files a/website/img/favicon/favicon-96x96.png and /dev/null differ diff --git a/website/img/favicon/favicon.ico b/website/img/favicon/favicon.ico deleted file mode 100644 index efacd69..0000000 Binary files a/website/img/favicon/favicon.ico and /dev/null differ diff --git a/website/img/favicon/manifest.json b/website/img/favicon/manifest.json deleted file mode 100644 index 013d4a6..0000000 --- a/website/img/favicon/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "App", - "icons": [ - { - "src": "\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -} \ No newline at end of file diff --git a/website/img/favicon/ms-icon-144x144.png b/website/img/favicon/ms-icon-144x144.png deleted file mode 100644 index 86c76eb..0000000 Binary files a/website/img/favicon/ms-icon-144x144.png and /dev/null differ diff --git a/website/img/favicon/ms-icon-150x150.png b/website/img/favicon/ms-icon-150x150.png deleted file mode 100644 index d81670d..0000000 Binary files a/website/img/favicon/ms-icon-150x150.png and /dev/null differ diff --git a/website/img/favicon/ms-icon-310x310.png b/website/img/favicon/ms-icon-310x310.png deleted file mode 100644 index 3693385..0000000 Binary files a/website/img/favicon/ms-icon-310x310.png and /dev/null differ diff --git a/website/img/favicon/ms-icon-70x70.png b/website/img/favicon/ms-icon-70x70.png deleted file mode 100644 index 54d9f3e..0000000 Binary files a/website/img/favicon/ms-icon-70x70.png and /dev/null differ diff --git a/website/img/logo.png b/website/img/logo.png deleted file mode 100644 index 605f989..0000000 Binary files a/website/img/logo.png and /dev/null differ diff --git a/website/img/news.png b/website/img/news.png deleted file mode 100644 index d769cc7..0000000 Binary files a/website/img/news.png and /dev/null differ diff --git a/website/img/person.jpg b/website/img/person.jpg deleted file mode 100644 index 5388cb8..0000000 Binary files a/website/img/person.jpg and /dev/null differ diff --git a/website/index.cgi b/website/index.cgi deleted file mode 100644 index 9c00d6d..0000000 --- a/website/index.cgi +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use FindBin qw/$Bin $RealBin/; -#use lib ('app/lib/perl5'); -use lib ($RealBin.'/website/lib'); -use lib ($RealBin.'/lib'); -use File::Basename; -use Template; -# use Template::Constants qw( :debug ); -use CGI; -use CGI::Carp qw/fatalsToBrowser/; -use dksconfig qw($sitecfg); -#use FindBin qw($Bin $RealBin); - -use Data::Dumper; -use JSON::PP; -use URI::Encode qw /uri_encode/; - - -my $cgi = new CGI(); -my $p=(); -my $vars = $sitecfg; -my @params = $cgi->param(); -foreach my $pp (@params){ - $p->{$pp} = $cgi->param($pp); -} - -$vars->{filepath} = substr($cgi->url({-absolute=>1}),length($vars->{basepath})+1); -$vars->{baseurl} = $cgi->url({-base=>1}).$vars->{basepath}; -$vars->{url} = $cgi->url({-full=>1}); -$vars->{encodedurl} = uri_encode($vars->{url},{encode_reserved => 1}); - -if ($vars->{filepath} ne ""){ - $vars->{page} = $vars->{filepath}; - $vars->{page} =~ s/html$/tt/; - -} -$vars->{abspath} = ""; -$vars->{pagelink} = basename($vars->{page}); -$vars->{pagelink} =~ s/\.tt$//; - - -#} -#$p->{dirname} = dirname($0); -#if (!exists($p)) -#$p->{baseurl} = $cgi->url({-base=>1}); -#$p->{pathinfo} = -#$p->{basepath} = ; - -# if (!exists($p->{sid})) -# { -# $p->{sid} = $cgi->cookie('juridig'); -# } -# my $se = session->new(); -# my $sesdata = $se->getsession($p->{sid}); -# if (!exists($sesdata->{usersession})){ -# $p->{page} = "login"; -# } -print $cgi->header(-type=>'text/html', -charset=>"utf-8"); -my $template = Template->new({INCLUDE_PATH => [$sitecfg->{tmplpath}]}); -my @lv = split(/\//,$vars->{filepath}); -my $absnum = scalar(@lv)-1; -$vars->{abspath} = ""; -for (my $i=0;$i<$absnum;$i++){ - $vars->{abspath} .= "../"; -} -$vars->{params} = $p; -$vars->{pageshort} = $vars->{page}; -$vars->{page} = 'page/'.$vars->{page}; - -$vars->{pagename} = basename($vars->{page}); - -# $vars->{dbconn} = 'DBI:SQLite:dbname=fld.sqlite'; -$vars->{pagename} =~ s/\.tt$//; -#print Dumper($vars); -if (! -e $sitecfg->{tmplpath}.'/'.$vars->{page}){ - mkdir(dirname(dirname($0).'/tmpl/'.$vars->{page})); - open(NP,">".dirname($0).'/tmpl/'.$vars->{page}); - print NP $vars->{page}; - close(NP); -} -#print Dumper($vars); -my $skl = "index.tt";#dirname($vars->{page}); -if (-e $sitecfg->{tmplpath}.'/'.basename($vars->{page})){ - $skl = basename($vars->{page}); -} -# print Dumper($template); -$template->process($skl,$vars) || die "Template process failed: ", $template->error(), "\n"; - - diff --git a/website/index.php b/website/index.php deleted file mode 100644 index 0feadc8..0000000 --- a/website/index.php +++ /dev/null @@ -1,61 +0,0 @@ - $value) { - if ($value["sql"]){ - if ($value["sqltype"] == "query"){ - $vars["data"][$key] = $db->query($value["sql"]); - } elseif ($value["sqltype"] == "queryarray"){ - $vars["data"][$key] = $db->queryarray($value["sql"]); - } - } - } - } catch(JsonException $je){ - fwrite(STDERR, "JSON ERROR: ".$je->getMessage()."\n"); - } - - } - $vars["page"] = 'pages/'.$vars["page"]; - $m = new Mustache_Engine(array( - 'loader' => new Mustache_Loader_FilesystemLoader($cfg["templatepath"]), - 'partials_loader' => new Mustache_Loader_FilesystemLoader($cfg["templatepath"].'/blocks'), - 'escape' => function($value) { - return $value; - }, - 'entity_flags' => ENT_HTML5 - - )); - - $vars["pagedata"] = $m->render($vars["page"],$vars); - - $mainsite = $m->render('index.html',$vars); - echo $mainsite; - // echo "
    ".print_r($vars).print_r($_SERVER["REQUEST_URI"])."
    "; -?> \ No newline at end of file diff --git a/website/js/site.js b/website/js/site.js deleted file mode 100644 index 952426e..0000000 --- a/website/js/site.js +++ /dev/null @@ -1,8 +0,0 @@ -function togglemenu(){ - var mnu = document.getElementById("mobilemenu"); - if (mnu.style.display == 'none'){ - mnu.style.display = 'block'; - } else { - mnu.style.display = 'none'; - } -} \ No newline at end of file diff --git a/website/lib/composer.json b/website/lib/composer.json deleted file mode 100644 index d40c2ef..0000000 --- a/website/lib/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require":{ - "mustache/mustache":"2.13.0" - } -} \ No newline at end of file diff --git a/website/lib/composer.lock b/website/lib/composer.lock deleted file mode 100644 index 0b1a613..0000000 --- a/website/lib/composer.lock +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "92525a9a1d7680bb4e3111b321d46087", - "packages": [ - { - "name": "mustache/mustache", - "version": "v2.13.0", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "phpunit/phpunit": "~3.7|~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Mustache": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "A Mustache implementation in PHP.", - "homepage": "https://github.com/bobthecow/mustache.php", - "keywords": [ - "mustache", - "templating" - ], - "time": "2019-11-23T21:40:31+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "1.1.0" -} diff --git a/website/lib/config.php b/website/lib/config.php deleted file mode 100644 index c02f016..0000000 --- a/website/lib/config.php +++ /dev/null @@ -1,13 +0,0 @@ - "/ledf_lu/", - "templatepath" => "tmpl/", - "db"=> array( - "type" => "pgsql", - "host" => "sql12.your-server.de", - "dbname" => "ledflu_db", - "user" => "ledflu_user", - "password" => "znWA9s3cgjEsRsWZ", - ), - ); -?> \ No newline at end of file diff --git a/website/lib/database.php b/website/lib/database.php deleted file mode 100644 index fd635a1..0000000 --- a/website/lib/database.php +++ /dev/null @@ -1,68 +0,0 @@ -dbconf = $pdbconf; - try { - //'mysql:host=;dbname=', $user, password - //'sqlite:/opt/databases/mydb.sq3 - //pgsql:host=localhost;port=5432;dbname=testdb;user=bruce;password=mypass - $this->conn = new PDO($this->dbconf["type"].':host='.$this->dbconf["host"].';port=5432;dbname='.$this->dbconf["dbname"],$this->dbconf["user"],$this->dbconf["password"]); - } catch(PDOException $e){ - fwrite(STDERR, "Connectio Error: ".$e->getMessage()."\n"); - } - } - - protected function securetext($text){ - return str_replace("'","''",$text); - } - protected function value($text){ - if (($text == "") || ($text == null)){ - return 'null'; - } - return "'".$text."'"; - } - - protected function query($sql){ - try { - if ($this->conn){ - return $this->conn->query($sql); - } - } catch(PDOException $e){ - fwrite(STDERR, "QUERY ERROR: ".$sql."\n"); - } - return null; - } - - protected function queryarray($sql){ - $result = null; - try { - if ($this->conn){ - $sth = $this->link->prepare($sql); - $sth->execute(); - $result = $sth->fetchAll(PDO::FETCH_ASSOC); - return $result; - } - } catch (PDOException $e){ - fwrite(STDERR, "QUERYARRAY ERROR: ".$sql."\n"); - } - return $result; - } - - protected function exec($sql){ - try { - if ($this->conn){ - return $this->exec($sql); - } - } catch (PDOException $e){ - fwrite(STDERR, "EXEC ERROR: ".$sql."\n"); - } - return -1; - } - - protected function __destruct(){ - $this->conn = null; - } -} -?> \ No newline at end of file diff --git a/website/lib/dksconfig.pm b/website/lib/dksconfig.pm deleted file mode 100644 index fb2ceb7..0000000 --- a/website/lib/dksconfig.pm +++ /dev/null @@ -1,43 +0,0 @@ -package dksconfig; - -use strict; -# use lib ('./lib/perl5'); -# use lib ('./lib'); -# use lib ('./'); -use File::Basename; -use Exporter 'import'; -our @EXPORT_OK = qw($sitecfg); - -our $sitecfg ={ - # cookiename => 'potlu', - # dbtype => 'PgPP', - dsn => 'DBI:PgPP:dbname=websites_db;host=localhost', - dbschema => 'ledf', - dbuser => 'websites_user', - dbpassword => 'websites_pwd', - page => 'index.tt', - pagename => 'index', - basepath => substr(dirname($0),length($ENV{"DOCUMENT_ROOT"})), - # datapath => substr((exists($ENV{"SCRIPT_FILENAME"})?dirname($ENV{"SCRIPT_FILENAME"}):dirname($0)),length($ENV{"DOCUMENT_ROOT"})).'/data/', - # apidatapath => substr((exists($ENV{"SCRIPT_FILENAME"})?dirname(dirname($ENV{"SCRIPT_FILENAME"})):dirname(dirname($0))),length($ENV{"DOCUMENT_ROOT"})).'/data/', - docroot => $ENV{"DOCUMENT_ROOT"}, - # registration_enabled => '0', - # default_group => 'users', - tmplpath => dirname($0).'/tmpl' - # sitename => 'Accès - Client', - # mail => { - # server => "mail.your-server.de", - # port => "587", - # user => 'ksaffran@dks.lu', - # password => "FB1ia1ka", - # from => 'support@dks.lu', - # templates => { - # user_registration => "Confirmation requis pour votre création de compte sur pot.lu", - # user_forgotpasswd => "Nouveau mot de passe pour le site pot.lu", - # user_verification => "Validation de votre Email pour le site pot.lu", - # user_newpassword => "coordonnées d'accès de votre compte sur pot.lu" - # } - # } -}; - -1; \ No newline at end of file diff --git a/website/tmpl/commingsoon.tt b/website/tmpl/commingsoon.tt deleted file mode 100644 index 7f15250..0000000 --- a/website/tmpl/commingsoon.tt +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - LEDF - Letzebuerger Elecronique Darts Federation - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    L.E.D.F.
    Lëtzebuerger Electronique Darts Federation
    -
    -
    -
    -
    -
    L.E.D.F.
    Lëtzebuerger Electronique Darts Federation
    - -
    - -
    -
    -
    -

    Comming Soon - Site Under Construction

    -
    -
    -
    -
    Lëtzebuerger Electronique Darts Federation ASBL
    - 6, rue des Alliés
    -L-4412 Belvaux
    -
    -
    -
    - Powered by DKS s.à r.l. -
    -
    - - - - - - diff --git a/website/tmpl/index.html.mustache b/website/tmpl/index.html.mustache deleted file mode 100644 index 9df4f49..0000000 --- a/website/tmpl/index.html.mustache +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - LEDF - Letzebuerger Elecronique Darts Federation - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    L.E.D.F.
    Lëtzebuerger Electronique Darts Federation
    - Home - Nouveautés - Calendrier - Clubs - Championnat - Liste de Rang - Coupe -
    -
    -
    -
    -
    L.E.D.F.
    Lëtzebuerger Electronique Darts Federation
    - -
    - -
    -
    -
    - {{pagedata}} -
    -
    -
    -
    Lëtzebuerger Electronique Darts Federation ASBL
    - 6, rue des Alliés
    -L-4412 Belvaux
    -
    - - -
    -
    - Powered by DKS s.à r.l. -
    -
    - - - - - - diff --git a/website/tmpl/lists/labels.tt b/website/tmpl/lists/labels.tt deleted file mode 100644 index b07b2b7..0000000 --- a/website/tmpl/lists/labels.tt +++ /dev/null @@ -1,3 +0,0 @@ -[% FOREACH ilbl= dksdb.query("select id,${lang} as lbl from labels;") %] -[% lbl.${ilbl.item('id')} = ilbl.item('lbl') %] -[% END %] \ No newline at end of file diff --git a/website/tmpl/pages/calendrier.html.json b/website/tmpl/pages/calendrier.html.json deleted file mode 100644 index 3e1694b..0000000 --- a/website/tmpl/pages/calendrier.html.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "dayscol1":{"sqltype":"queryarray","sql":"SELECT id, to_char(daydate,'DD.MM.YYYY') as daydate, calendar, calgroup, calpublisstart, calpublishend, to_char(calstartime,'HH24:MI') as calstarttime, to_char(calendtime,'HH24:MI') as calendtime, caltitle, caldescription, callocation, callocationaddress FROM calendar WHERE calendar=(select prefvalue from config where pref='season') and calgroup='aller' order by daydate asc;"}, - "dayscol2":{"sqltype":"queryarray","sql":"SELECT id, to_char(daydate,'DD.MM.YYYY') as daydate, calendar, calgroup, calpublisstart, calpublishend, to_char(calstartime,'HH24:MI') as calstarttime, to_char(calendtime,'HH24:MI') as calendtime, caltitle, caldescription, callocation, callocationaddress FROM calendar WHERE calendar=(select prefvalue from config where pref='season') and calgroup='retoour' order by daydate asc;"} -} diff --git a/website/tmpl/pages/calendrier.html.mustache b/website/tmpl/pages/calendrier.html.mustache deleted file mode 100644 index df37498..0000000 --- a/website/tmpl/pages/calendrier.html.mustache +++ /dev/null @@ -1,110 +0,0 @@ -
    -
    -

    Calendrier Saison 2020-2021

    -
    -
    - -
    -
    -
    -
    DD.MM.YYYY ( location)
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY ( location)
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    -
    -
    -
    -
    DD.MM.YYYY ( location)
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY ( location)
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    diff --git a/website/tmpl/pages/championnat.html.mustache b/website/tmpl/pages/championnat.html.mustache deleted file mode 100644 index c8f80b9..0000000 --- a/website/tmpl/pages/championnat.html.mustache +++ /dev/null @@ -1,535 +0,0 @@ - -
    -
    -
    -
    Résultats (Jounée X)
    -
    -
    -
    -
    division nationale
    -
    - - - - - - - - - - - - - - -
    Team homeTeam visiteurRésultat
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    -
    -
    division d'honneur
    -
    - - - - - - - - - - - - - - -
    Team homeTeam visiteurRésultat
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    -
    -
    division 1
    -
    - - - - - - - - - - - - - - -
    Team homeTeam visiteurRésultat
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    Team 1Team 200 - 00
    -
    -
    -
    -
    -
    Classement
    -
    -
    -
    -
    division nationale
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PLTEAMGESPGEWGLVRLSCOREDIFSETSDIFPKT
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    -
    -
    division nationale
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PLTEAMGESPGEWGLVRLSCOREDIFSETSDIFPKT
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    -
    -
    division nationale
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PLTEAMGESPGEWGLVRLSCOREDIFSETSDIFPKT
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    1 Team name0000000000 - 000000000 - 000000000 - 000
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - diff --git a/website/tmpl/pages/clubs.html.mustache b/website/tmpl/pages/clubs.html.mustache deleted file mode 100644 index f2d8685..0000000 --- a/website/tmpl/pages/clubs.html.mustache +++ /dev/null @@ -1,210 +0,0 @@ -
    -
    -

    Clubs

    -
    -
    - -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    -
    -
    -

    EDC Club

    -
    -
    - club -
    -
    -

    Salle de jeu

    -
    Café Nom du café
    1, rue Principale
    L-0000 Ville -
    -
    - -
    -
    -
    -
    \ No newline at end of file diff --git a/website/tmpl/pages/coupe.html.mustache b/website/tmpl/pages/coupe.html.mustache deleted file mode 100644 index e69de29..0000000 diff --git a/website/tmpl/pages/documents.html.mustache b/website/tmpl/pages/documents.html.mustache deleted file mode 100644 index f8f2e84..0000000 --- a/website/tmpl/pages/documents.html.mustache +++ /dev/null @@ -1 +0,0 @@ -page/documents.tt \ No newline at end of file diff --git a/website/tmpl/pages/error.html.mustache b/website/tmpl/pages/error.html.mustache deleted file mode 100644 index 6c461af..0000000 --- a/website/tmpl/pages/error.html.mustache +++ /dev/null @@ -1 +0,0 @@ -

    Sorry Site does not exist!

    \ No newline at end of file diff --git a/website/tmpl/pages/federation.html.mustache b/website/tmpl/pages/federation.html.mustache deleted file mode 100644 index ddc8eba..0000000 --- a/website/tmpl/pages/federation.html.mustache +++ /dev/null @@ -1,119 +0,0 @@ -
    -
    -

    Le Comité

    -
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Président
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Vize-Président
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Secrétaire
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Trésorier
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Directeur Sportif
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Membre
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Membre
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Membre
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    Membre
    -
    -
    -
    -
    -
    -
    -

    Le Tribunal

    -
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    -
    -
    -
    -
    -
    - -
    -
    Nom Prénom
    -
    -
    -
    \ No newline at end of file diff --git a/website/tmpl/pages/home.html.mustache b/website/tmpl/pages/home.html.mustache deleted file mode 100644 index 6eb0aa3..0000000 --- a/website/tmpl/pages/home.html.mustache +++ /dev/null @@ -1,40 +0,0 @@ - -
    -
    -
    la féderation vous invite:
    -
    -
    - -
    -
    -
    -
    -
    prochaines événements:
    -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    DD.MM.YYYY
    -
    - Championnnat -
    -
    -
    -
    diff --git a/website/tmpl/pages/impressum.html.mustache b/website/tmpl/pages/impressum.html.mustache deleted file mode 100644 index 5f5e013..0000000 --- a/website/tmpl/pages/impressum.html.mustache +++ /dev/null @@ -1 +0,0 @@ -page/impressum.tt \ No newline at end of file diff --git a/website/tmpl/pages/listederang.html.mustache b/website/tmpl/pages/listederang.html.mustache deleted file mode 100644 index 06f9c7c..0000000 --- a/website/tmpl/pages/listederang.html.mustache +++ /dev/null @@ -1,443 +0,0 @@ -
    -
    -

    Saison 2020-2021

    -
    -
    -
    -
    -
    -
    Liste de rang Hommes
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #NomRL1RL2RL3RL4RL5RL6RL7Points
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    -
    -
    -
    -
    -
    -
    -
    Liste de rang Dammes
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #NomRL1RL2RL3RL4RL5RL6RL7Points
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    #Nom Prénom00000000
    -
    -
    -
    \ No newline at end of file diff --git a/website/tmpl/pages/news.html.mustache b/website/tmpl/pages/news.html.mustache deleted file mode 100644 index a52c543..0000000 --- a/website/tmpl/pages/news.html.mustache +++ /dev/null @@ -1,11 +0,0 @@ -
    -
    -

    TEST News

    -
    Publié le:
    00.00.0000
    -
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla condimentum interdum mauris et laoreet. Curabitur ut aliquam neque. Nam tristique tempor ex eu semper. Quisque efficitur dictum justo nec viverra. Cras est eros, rhoncus id nulla nec, dignissim iaculis magna. Donec laoreet mattis dolor, sit amet convallis elit efficitur ac. Ut sed sollicitudin ante. Donec id felis in justo condimentum ultrices vel quis metus. Duis finibus facilisis viverra. Vestibulum vestibulum justo ac ex ultrices vehicula. Duis pulvinar, purus sed varius sollicitudin, ligula risus cursus urna, sit amet cursus eros quam in lacus. Aenean volutpat, erat ut finibus gravida, dui quam suscipit lectus, sed vestibulum arcu diam a augue. Donec id eros id velit molestie rhoncus. Sed eu erat blandit, hendrerit turpis pulvinar, tincidunt mi. Quisque tincidunt sem quis neque aliquet, nec dictum nunc rhoncus. Mauris at elit facilisis, lacinia lectus ut, luctus ex.

    - -

    Curabitur euismod purus quis ipsum volutpat, sit amet dapibus quam eleifend. Sed dictum, ante fringilla suscipit condimentum, metus lorem feugiat quam, sit amet tristique enim nulla id turpis. Ut vitae elementum ligula, at egestas metus. Etiam fermentum efficitur eros, feugiat tempor ligula accumsan id. Fusce sed aliquet nibh, et sagittis ante. Quisque in tincidunt sapien. Nulla fermentum leo blandit velit semper, ut vehicula quam vestibulum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam congue, est nec dictum tempor, tortor nisl vestibulum tellus, quis sollicitudin ipsum arcu id nibh. Ut ut arcu malesuada, imperdiet tellus quis, ornare est. Nulla luctus lobortis commodo. Sed id ex placerat purus consequat lobortis.

    -
    -
    \ No newline at end of file diff --git a/website/tmpl/pages/privacy.html.mustache b/website/tmpl/pages/privacy.html.mustache deleted file mode 100644 index 47ff6c7..0000000 --- a/website/tmpl/pages/privacy.html.mustache +++ /dev/null @@ -1,55 +0,0 @@ -
    -

    Privacy Policy of ledf.lu

    - -

    At L.E.D.F., we collect and manage user data according to the following Privacy Policy.

    - -

    Data Collected

    - -

    We collect information you provide directly to us. For example, we collect information when you create an account, subscribe, participate in any interactive features of our services, fill out a form, request customer support or otherwise communicate with us. The types of information we may collect include your name, email address, postal address, credit card information and other contact or identifying information you choose to provide.

    - -

    We collect anonymous data from every visitor of the Website to monitor traffic and fix bugs. For example, we collect information like web requests, the data sent in response to such requests, the Internet Protocol address, the browser type, the browser language, and a timestamp for the request.

    - -

    We also use various technologies to collect information, and this may include sending cookies to your computer. Cookies are small data files stored on your hard drive or in your device memory that helps us to improve our services and your experience, see which areas and features of our services are popular and count visits. We may also collect information using web beacons (also known as "tracking pixels"). Web beacons are electronic images that may be used in our services or emails and to track count visits or understand usage and campaign effectiveness.

    - -

    Use of the Data

    - -

    We only use your personal information to provide you the L.E.D.F. services or to communicate with you about the Website or the services.

    - -

    We employ industry standard techniques to protect against unauthorized access of data about you that we store, including personal information.

    - -

    We do not share personal information you have provided to us without your consent, unless:

    - -
      -
    • Doing so is appropriate to carry out your own request
    • -
    • We believe it's needed to enforce our legal agreements or that is legally required
    • -
    • We believe it's needed to detect, prevent or address fraud, security or technical issues
    • -
    - -

    Sharing of Data

    - -

    We don't share your personal information with third parties. Aggregated, anonymized data is periodically transmitted to external services to help us improve the Website and service.

    - -

    We may allow third parties to provide analytics services. These third parties may use cookies, web beacons and other technologies to collect information about your use of the services and other websites, including your IP address, web browser, pages viewed, time spent on pages, links clicked and conversion information.

    - -

    We also use social buttons provided by services like Twitter, Google+, LinkedIn and Facebook. Your use of these third party services is entirely optional. We are not responsible for the privacy policies and/or practices of these third party services, and you are responsible for reading and understanding those third party services' privacy policies.

    - -

    Cookies

    - -

    We may use cookies on our site to remember your preferences.

    - -

    For more general information on cookies, please read "What Are Cookies".

    - -

    Opt-Out, Communication Preferences

    - -

    You may modify your communication preferences and/or opt-out from specific communications at any time. Please specify and adjust your preferences.

    - -

    Security

    - -

    We take reasonable steps to protect personally identifiable information from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. But, you should keep in mind that no Internet transmission is ever completely secure or error-free. In particular, email sent to or from the Sites may not be secure.

    - -

    Changes to the Privacy Policy

    - -

    We may amend this Privacy Policy from time to time. Use of information we collect now is subject to the Privacy Policy in effect at the time such information is used.

    - -

    If we make major changes in the way we collect or use information, we will notify you by posting an announcement on the Website or sending you an email.

    -
    \ No newline at end of file diff --git a/website/tmpl/pages/terms.html.mustache b/website/tmpl/pages/terms.html.mustache deleted file mode 100644 index aa79677..0000000 --- a/website/tmpl/pages/terms.html.mustache +++ /dev/null @@ -1,58 +0,0 @@ -
    -

    Terms of Use of ledf.lu

    - -

    Welcome to the L.E.D.F. website (the "Website").

    - -

    L.E.D.F. provides this Website and Services (located at ledf.lu) to you subject to the notices, terms, and conditions set forth in these terms (the "Terms of Use"). In addition, when you use any of our Services, you will be subject to the rules, guidelines, policies, terms, and conditions applicable to such service, and they are incorporated into this Terms of Use by this reference.

    - -

    These Terms of Use are effective as of [DATE].

    - -

    Your eligibility for use of the Website is contingent upon meeting the following conditions:

    - -
      -
    • You are at least 18 years of age
    • -
    • You use the Website and Services according to these Terms of Use and all applicable laws and regulations determined by the state and country of residence
    • -
    • You provide complete and accurate registration information and maintain accurate registration information on the Webite
    • -
    • You agree and understand that L.E.D.F. may, at any time, and without prior notice, revoke and/or cancel your access if you fail to meet these criteria or violate any portion of these Terms of Use
    • -
    - -

    Use of this Website

    - -

    In connection with your use of our Website, you must act responsibly and exercise good judgment. Without limiting the foregoing, you will not:

    - -
      -
    • Violate any local, state, provincial, national, or other law or regulation, or any order of a court
    • -
    • Infringe the rights of any person or entity, including without limitation, their intellectual property, privacy, publicity or contractual rights
    • -
    • Interfere with or damage our Services, including, without limitation, through the use of viruses, cancel bots, Trojan horses, harmful code, flood pings, denial-of-service attacks, packet or IP spoofing, forged routing or electronic mail address information or similar methods or technology
    • -
    • Use automated scripts to collect information or otherwise interact with the Services or the Website
    • -
    • Enter into this agreement on behalf of another person or entity without consent or the legal capacity to make such agreements as a representative of an organization or entity
    • -
    - -

    Intellectual Property

    - -

    All code, text, software, scripts, graphics, files, photos, images, logos, and materials contained on this Website, or within the Services, are the sole property of L.E.D.F..

    - -

    Unauthorized use of any materials contained on this Website or within the Service may violate copyright laws, trademark laws, the laws of privacy and publicity, and/or other regulations and statutes. If you believe that any of the materials infringe on any third party's rights, please contact L.E.D.F. immediately at the address provided below.

    - -

    Third Party Websites

    - -

    Our Website may link you to other sites on the Internet or otherwise include references to information, documents, software, materials and/or services provided by other parties. These websites may contain information or material that some people may find inappropriate or offensive.

    - -

    These other websites and parties are not under our control, and you acknowledge that we are not responsible for the accuracy, copyright compliance, legality, decency, or any other aspect of the content of such sites, nor are we responsible for errors or omissions in any references to other parties or their products and services. The inclusion of such a link or reference is provided merely as a convenience and does not imply endorsement of, or association with, the Website or party by us, or any warranty of any kind, either express or implied.

    - -

    Disclaimer of Warranty and Limitation of Liability

    - -

    The Website is provided "AS IS." appfigures, its suppliers, officers, directors, employees, and agents exclude and disclaim all representations and warranties, express or implied, related to this Website or in connection with the Services. You exclude L.E.D.F. from all liability for damages related to or arising out of the use of this Website.

    - -

    Changes to these Terms of Use

    - -

    L.E.D.F. retains the right to, at any time, modify or discontinue, any or all parts of the Website without notice.

    - -

    Additionally, L.E.D.F. reserves the right, in its sole discretion, to modify these Terms of Use at any time, effective by posting new terms on the Website with the date of modification. You are responsible for reading and understanding the terms of this agreement prior to registering with, or using the Service. Your use of the Website and/or Services after any such modification has been published constitutes your acceptance of the new terms as modified in these Terms of Use.

    - -

    Governing Law

    - -

    These Terms of Use and any dispute or claim arising out of, or related to them, shall be governed by and construed in accordance with the internal laws of the lu without giving effect to any choice or conflict of law provision or rule.

    - -

    Any legal suit, action or proceeding arising out of, or related to, these Terms of Use or the Website shall be instituted exclusively in the federal courts of lu.

    -
    \ No newline at end of file