diff --git a/composer.json b/composer.json index fb37c32..9a3473c 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,9 @@ "type": "project", "require": { "catfan/medoo": "^1.5", - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^6.2", + "league/csv": "^9.1", + "lapinator/ods-php-generator": "^0.0.3" }, "license": "MPL-2.0", "authors": [ diff --git a/composer.lock b/composer.lock index f6f5538..590de35 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "577921e9d14ff39571692f88476151ee", - "content-hash": "1c8b61c5d506ae016285b99b20040cf0", + "hash": "0e5db12408080dd084cad072b8cfd599", + "content-hash": "348006dfc1d25121fcc3b4cb32bc3369", "packages": [ { "name": "catfan/medoo", @@ -247,6 +247,116 @@ ], "time": "2017-03-20 17:10:46" }, + { + "name": "lapinator/ods-php-generator", + "version": "v0.0.3", + "source": { + "type": "git", + "url": "https://github.com/Lapinator/odsPhpGenerator.git", + "reference": "575314c003c2ec3032813bedcc1d27032b7b7ab2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Lapinator/odsPhpGenerator/zipball/575314c003c2ec3032813bedcc1d27032b7b7ab2", + "reference": "575314c003c2ec3032813bedcc1d27032b7b7ab2", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Laurent VUIBERT", + "email": "lapinator@gmx.fr", + "homepage": "http://lapinator.net", + "role": "Developer" + } + ], + "description": "Open Document Spreadsheet (.ods) generator ", + "homepage": "https://odsphpgenerator.lapinator.net/", + "keywords": [ + "LibreOffice", + "ods" + ], + "time": "2016-04-14 21:51:27" + }, + { + "name": "league/csv", + "version": "9.1.4", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/csv.git", + "reference": "9c8ad06fb5d747c149875beb6133566c00eaa481" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/9c8ad06fb5d747c149875beb6133566c00eaa481", + "reference": "9c8ad06fb5d747c149875beb6133566c00eaa481", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.0.10" + }, + "require-dev": { + "ext-curl": "*", + "friendsofphp/php-cs-fixer": "^2.0", + "phpstan/phpstan": "^0.9.2", + "phpstan/phpstan-phpunit": "^0.9.4", + "phpstan/phpstan-strict-rules": "^0.9.0", + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Csv\\": "src" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://github.com/nyamsprod/", + "role": "Developer" + } + ], + "description": "Csv data manipulation made easy in PHP", + "homepage": "http://csv.thephpleague.com", + "keywords": [ + "csv", + "export", + "filter", + "import", + "read", + "write" + ], + "time": "2018-05-01 18:32:48" + }, { "name": "psr/http-message", "version": "1.0.1", diff --git a/database.mwb b/database.mwb index 0dad56f..ce72d53 100644 Binary files a/database.mwb and b/database.mwb differ diff --git a/lang/en_us.php b/lang/en_us.php index f06e796..19f44ba 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -89,4 +89,19 @@ define("STRINGS", [ "cash closed" => "Cash closed.", "register set" => "Register set.", "change register" => "Change register", -]); \ No newline at end of file + "reports" => "Reports", + "report type" => "Report Type", + "format" => "Format", + "filter" => "Filter", + "generate report" => "Generate Report", + "cashflow" => "Cash Flow", + "z report" => "Z Report", + "csv file" => "CSV text file", + "ods file" => "ODS spreadsheet", + "html file" => "HTML web page", + "register" => "Register", + "all" => "All", + "date range" => "Date Range", + "start" => "Start", + "end" => "End" +]); diff --git a/lib/reports.php b/lib/reports.php new file mode 100644 index 0000000..7fce0e0 --- /dev/null +++ b/lib/reports.php @@ -0,0 +1,297 @@ +has('report_access_codes', ["AND" => ['code' => $VARS['code'], 'expires[>]' => $date]])) { + dieifnotloggedin(); + $requester = $_SESSION['uid']; + } else { + $requester = $database->get('report_access_codes', 'uid', ['code' => $VARS['code']]); + } +} else { + dieifnotloggedin(); + $requester = $_SESSION['uid']; +} + +if (account_has_permission($_SESSION['username'], "ADMIN")) { + $allowed_users = true; +} else { + if (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")) { + $allowed_users = getManagedUIDs($requester); + } + + if (account_has_permission($_SESSION['username'], "QWIKCLOCK_EDITSELF")) { + $allowed_users[] = $_SESSION['uid']; + } +} + +// Delete old DB entries +$database->delete('report_access_codes', ['expires[<=]' => $date]); + +if (LOADED) { + $user = null; + if (isset($VARS['type']) && isset($VARS['format'])) { + generateReport($VARS['type'], $VARS['format'], $VARS['register'], $VARS['startdate'], $VARS['enddate']); + die(); + } else { + lang("invalid parameters"); + die(); + } +} + +function getCashFlowReport($register = null, $start = null, $end = null) { + global $database; + $where = []; + + if (!is_null($register) && $database->has('registers', ['registerid' => $register])) { + $where["registers.registerid"] = $register; + } + + if ((bool) strtotime($start) == TRUE) { + $where["OR #open"] = [ + "open[>=]" => date("Y-m-d", strtotime($start)), + "close[>=]" => date("Y-m-d", strtotime($start)) + ]; + } + if ((bool) strtotime($end) == TRUE) { + // Make the date be the end of the day, not the start + $where["close[<=]"] = date("Y-m-d", strtotime($end)) . " 23:59:59"; + } + + if (count($where) > 1) { + $where = ["AND" => $where]; + } + $cash = $database->select( + "cash_drawer", [ + '[>]registers' => ['cash_drawer.registerid' => 'registerid'], + '[>]transactions' => ['cash_drawer.cashid' => 'cashid'], + '[>]payments' => ['transactions.txid' => 'txid'], + '[>]payment_types' => ['payments.type' => 'typeid'] + ], [ + "cash_drawer.cashid", + "registers.registername", + "cash_drawer.registerid", + "open", + "close", + "payments.type", + "payments.amount", + "payment_types.typename" + ], $where + ); + $header = [lang("register", false), lang("open", false), lang("close", false), lang("cash", false), lang("card", false), lang("check", false), lang("crypto", false), lang("gift card", false), lang("free", false)]; + $out = [$header]; + + $registers = []; + + foreach ($cash as $c) { + $registers[$c['registerid']]['name'] = $c['registername']; + $registers[$c['registerid']]['id'] = $c['registerid']; + $registers[$c['registerid']]['open'] = date(DATETIME_FORMAT, strtotime($c['open'])); + if (is_null($c['close'])) { + $registers[$c['registerid']]['close'] = date(DATETIME_FORMAT); + } else { + $registers[$c['registerid']]['close'] = date(DATETIME_FORMAT, strtotime($c['close'])); + } + if (!isset($registers[$c['registerid']][$c['typename']])) { + $registers[$c['registerid']][$c['typename']] = 0.0; + } + $registers[$c['registerid']][$c['typename']] += $c['amount']; + } + + foreach ($registers as $r) { + $types = $database->select('payment_types', 'typename'); + foreach ($types as $t) { + if (!isset($r[$t])) { + $r[$t] = 0.0; + } + } + $out[] = [ + $r['name'], + $r['open'], + $r['close'], + $r['cash'] . "", + $r['card'] . "", + $r['check'] . "", + $r['crypto'] . "", + $r['giftcard'] . "", + $r['free'] . "" + ]; + } + + return $out; +} + +function getReportData($type, $register = null, $start = null, $end = null) { + switch ($type) { + case "cashflow": + return getCashFlowReport($register, $start, $end); + default: + return [["error"]]; + } +} + +function dataToCSV($data, $name = "report", $register = null, $start = null, $end = null) { + $csv = Writer::createFromString(''); + $usernotice = ""; + $usertitle = ""; + $datetitle = ""; + if ($start != null && (bool) strtotime($start)) { + $datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false); + $datetitle = "_" . date(DATE_FORMAT, strtotime($start)); + $csv->insertOne([$datenotice]); + } + if ($end != null && (bool) strtotime($end)) { + $datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false); + $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end)); + $csv->insertOne([$datenotice]); + } + $csv->insertAll($data); + header('Content-type: text/csv'); + header('Content-Disposition: attachment; filename="' . $name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".csv" . '"'); + echo $csv; + die(); +} + +function dataToODS($data, $name = "report", $register = null, $start = null, $end = null) { + $ods = new ods(); + $styleColumn = new odsStyleTableColumn(); + $styleColumn->setUseOptimalColumnWidth(true); + $headerstyle = new odsStyleTableCell(); + $headerstyle->setFontWeight("bold"); + $table = new odsTable($name); + + for ($i = 0; $i < count($data[0]); $i++) { + $table->addTableColumn(new odsTableColumn($styleColumn)); + } + + $usernotice = ""; + $usertitle = ""; + $datetitle = ""; + if ($user != null && array_key_exists('username', $user) && array_key_exists('name', $user)) { + $usernotice = lang2("report filtered to user", ["name" => $user['name'], "username" => $user['username']], false); + $usertitle = "_" . $user['username']; + $row = new odsTableRow(); + $row->addCell(new odsTableCellString($usernotice)); + $table->addRow($row); + } + if ($start != null && (bool) strtotime($start)) { + $datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false); + $datetitle = "_" . date(DATE_FORMAT, strtotime($start)); + $row = new odsTableRow(); + $row->addCell(new odsTableCellString($datenotice)); + $table->addRow($row); + } + if ($end != null && (bool) strtotime($end)) { + $datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false); + $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end)); + $row = new odsTableRow(); + $row->addCell(new odsTableCellString($datenotice)); + $table->addRow($row); + } + + $rowid = 0; + foreach ($data as $datarow) { + $row = new odsTableRow(); + foreach ($datarow as $cell) { + if ($rowid == 0) { + $row->addCell(new odsTableCellString($cell, $headerstyle)); + } else { + $row->addCell(new odsTableCellString($cell)); + } + } + $table->addRow($row); + $rowid++; + } + $ods->addTable($table); + $ods->downloadOdsFile($name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".ods"); +} + +function dataToHTML($data, $name = "report", $register = null, $start = null, $end = null) { + global $SECURE_NONCE; + // HTML exporter doesn't like null values + for ($i = 0; $i < count($data); $i++) { + for ($j = 0; $j < count($data[$i]); $j++) { + if (is_null($data[$i][$j])) { + $data[$i][$j] = ''; + } + } + } + $datenotice = ""; + $datetitle = ""; + if ($start != null && (bool) strtotime($start)) { + $datenotice = "" . lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false) . "
"; + $datetitle = "_" . date(DATE_FORMAT, strtotime($start)); + } + if ($end != null && (bool) strtotime($end)) { + $datenotice .= "" . lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false) . "
"; + $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end)); + } + header('Content-type: text/html'); + $converter = new HTMLConverter(); + $out = "\n" + . "\n" + . "\n" + . "" . $name . $datetitle . "_" . date("Y-m-d_Hi") . "\n" + . << +STYLE + . $datenotice + . $converter->convert($data); + echo $out; +} + +function generateReport($type, $format, $register = null, $start = null, $end = null, $deleted = true) { + $data = getReportData($type, $register, $start, $end, $deleted); + switch ($format) { + case "ods": + dataToODS($data, $type, $register, $start, $end); + break; + case "html": + dataToHTML($data, $type, $register, $start, $end); + break; + case "csv": + default: + echo dataToCSV($data, $type, $register, $start, $end); + break; + } +} diff --git a/pages.php b/pages.php index 57de716..d15b4a4 100644 --- a/pages.php +++ b/pages.php @@ -69,6 +69,21 @@ define("PAGES", [ "static/js/registers.js" ], ], + "reports" => [ + "title" => "reports", + "navbar" => true, + "icon" => "fas fa-download", + "styles" => [ + "static/css/tempusdominus-bootstrap-4.min.css", + "static/css/easy-autocomplete.min.css" + ], + "scripts" => [ + "static/js/moment.min.js", + "static/js/tempusdominus-bootstrap-4.min.js", + "static/js/jquery.easy-autocomplete.min.js", + "static/js/reports.js" + ] + ], "404" => [ "title" => "404 error" ] diff --git a/pages/reports.php b/pages/reports.php new file mode 100644 index 0000000..da84939 --- /dev/null +++ b/pages/reports.php @@ -0,0 +1,91 @@ + +
+ +
+
+
+
+
+
+
+

+ +
+
+
+
+
+
+

+ +
+
+
+
+ +
+
+
+
+
+
+
+
+

+
+
+
+ + + +
+
+
+ + +
+
+
+
+
+ insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes"))]); + ?> + + + +
+
+
+
+
+ \ No newline at end of file diff --git a/static/css/easy-autocomplete.min.css b/static/css/easy-autocomplete.min.css new file mode 100644 index 0000000..b5c0875 --- /dev/null +++ b/static/css/easy-autocomplete.min.css @@ -0,0 +1,11 @@ +/* + * easy-autocomplete + * jQuery plugin for autocompletion + * + * @author Łukasz Pawełczak (http://github.com/pawelczak) + * @version 1.3.5 + * Copyright License: + */ + +.easy-autocomplete{position:relative}.easy-autocomplete input{border-color:#ccc;border-radius:4px;border-style:solid;border-width:1px;box-shadow:0 1px 2px rgba(0,0,0,0.1) inset;color:#555;float:none;padding:6px 12px}.easy-autocomplete input:hover,.easy-autocomplete input:focus{box-shadow:none}.easy-autocomplete a{display:block}.easy-autocomplete.eac-blue-light input:hover,.easy-autocomplete.eac-blue-light input:focus{border-color:#66afe9;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(102,175,233,0.6)}.easy-autocomplete.eac-blue-light ul{border-color:#66afe9;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(102,175,233,0.6)}.easy-autocomplete.eac-blue-light ul li,.easy-autocomplete.eac-blue-light ul .eac-category{border-color:#66afe9}.easy-autocomplete.eac-blue-light ul li.selected,.easy-autocomplete.eac-blue-light ul .eac-category.selected{background-color:#ecf5fc}.easy-autocomplete.eac-green-light input:hover,.easy-autocomplete.eac-green-light input:focus{border-color:#41DB00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(146,237,107,0.6)}.easy-autocomplete.eac-green-light ul{border-color:#41DB00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(146,237,107,0.6)}.easy-autocomplete.eac-green-light ul li,.easy-autocomplete.eac-green-light ul .eac-category{border-color:#41DB00}.easy-autocomplete.eac-green-light ul li.selected,.easy-autocomplete.eac-green-light ul .eac-category.selected{background-color:#9eff75}.easy-autocomplete.eac-red-light input:hover,.easy-autocomplete.eac-red-light input:focus{border-color:#ff5b5b;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,90,90,0.6)}.easy-autocomplete.eac-red-light ul{border-color:#ff5b5b;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,90,90,0.6)}.easy-autocomplete.eac-red-light ul li,.easy-autocomplete.eac-red-light ul .eac-category{border-color:#ff5b5b}.easy-autocomplete.eac-red-light ul li.selected,.easy-autocomplete.eac-red-light ul .eac-category.selected{background-color:#ff8e8e}.easy-autocomplete.eac-yellow-light input:hover,.easy-autocomplete.eac-yellow-light input:focus{border-color:#ffdb00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,231,84,0.6)}.easy-autocomplete.eac-yellow-light ul{border-color:#ffdb00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,231,84,0.6)}.easy-autocomplete.eac-yellow-light ul li,.easy-autocomplete.eac-yellow-light ul .eac-category{border-color:#ffdb00}.easy-autocomplete.eac-yellow-light ul li.selected,.easy-autocomplete.eac-yellow-light ul .eac-category.selected{background-color:#ffe233}.easy-autocomplete.eac-dark-light input:hover,.easy-autocomplete.eac-dark-light input:focus{border-color:#333;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(55,55,55,0.6)}.easy-autocomplete.eac-dark-light ul{border-color:#333;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(55,55,55,0.6)}.easy-autocomplete.eac-dark-light ul li,.easy-autocomplete.eac-dark-light ul .eac-category{border-color:#333}.easy-autocomplete.eac-dark-light ul li.selected,.easy-autocomplete.eac-dark-light ul .eac-category.selected{background-color:#4d4d4d;color:#fff}.easy-autocomplete.eac-dark{color:#fff}.easy-autocomplete.eac-dark input{background-color:#404040;border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-dark input:hover,.easy-autocomplete.eac-dark input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-dark ul{border-color:#333}.easy-autocomplete.eac-dark ul li,.easy-autocomplete.eac-dark ul .eac-category{background-color:#404040;border-color:#333}.easy-autocomplete.eac-dark ul li.selected,.easy-autocomplete.eac-dark ul .eac-category.selected{background-color:#737373;color:#f6f6f6}.easy-autocomplete.eac-dark-glass{color:#fff}.easy-autocomplete.eac-dark-glass input{background-color:rgba(0,0,0,0.8);border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-dark-glass input:hover,.easy-autocomplete.eac-dark-glass input:focus{border-color:rgba(0,0,0,0.8);box-shadow:0}.easy-autocomplete.eac-dark-glass ul{border-color:rgba(0,0,0,0.8)}.easy-autocomplete.eac-dark-glass ul li,.easy-autocomplete.eac-dark-glass ul .eac-category{background-color:rgba(0,0,0,0.8);border-color:rgba(0,0,0,0.8)}.easy-autocomplete.eac-dark-glass ul li.selected,.easy-autocomplete.eac-dark-glass ul .eac-category.selected{background-color:rgba(64,64,64,0.8);color:#f6f6f6}.easy-autocomplete.eac-dark-glass ul li:last-child,.easy-autocomplete.eac-dark-glass ul .eac-category:last-child{border-radius:0 0 4px 4px}.easy-autocomplete.eac-blue{color:#fff}.easy-autocomplete.eac-blue input{background-color:#6d9ed1;border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-blue input::-webkit-input-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:-moz-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input::-moz-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:-ms-input-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:hover,.easy-autocomplete.eac-blue input:focus{border-color:#5A91CB;box-shadow:0}.easy-autocomplete.eac-blue ul{border-color:#5A91CB}.easy-autocomplete.eac-blue ul li,.easy-autocomplete.eac-blue ul .eac-category{background-color:#6d9ed1;border-color:#5A91CB}.easy-autocomplete.eac-blue ul li.selected,.easy-autocomplete.eac-blue ul .eac-category.selected{background-color:#94b8dd;color:#f6f6f6}.easy-autocomplete.eac-yellow{color:#333}.easy-autocomplete.eac-yellow input{background-color:#ffdb7e;border-color:#333;border-radius:4px;box-shadow:0;color:#333}.easy-autocomplete.eac-yellow input:hover,.easy-autocomplete.eac-yellow input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-yellow ul{border-color:#333}.easy-autocomplete.eac-yellow ul li,.easy-autocomplete.eac-yellow ul .eac-category{background-color:#ffdb7e;border-color:#333}.easy-autocomplete.eac-yellow ul li.selected,.easy-autocomplete.eac-yellow ul .eac-category.selected{background-color:#ffe9b1;color:#333}.easy-autocomplete.eac-purple{color:#333}.easy-autocomplete.eac-purple input{background-color:#d6d1e7;border-color:#b8afd5;box-shadow:0;color:#333}.easy-autocomplete.eac-purple input:hover,.easy-autocomplete.eac-purple input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-purple ul{border-color:#333}.easy-autocomplete.eac-purple ul li,.easy-autocomplete.eac-purple ul .eac-category{background-color:#d6d1e7;border-color:#333}.easy-autocomplete.eac-purple ul li.selected,.easy-autocomplete.eac-purple ul .eac-category.selected{background-color:#ebe8f3;color:#333}.easy-autocomplete.eac-bootstrap input{border-color:#ccc;border-radius:4px;border-style:solid;border-width:1px;color:#555;padding:6px 12px}.easy-autocomplete-container{left:0;position:absolute;width:100%;z-index:2}.easy-autocomplete-container ul{background:none repeat scroll 0 0 #ffffff;border-top:1px dotted #ccc;display:none;margin-top:0;padding-bottom:0;padding-left:0;position:relative;top:-1px}.easy-autocomplete-container ul li,.easy-autocomplete-container ul .eac-category{background:inherit;border-color:#ccc;border-image:none;border-style:solid;border-width:0 1px;display:block;font-size:14px;font-weight:normal;padding:4px 12px}.easy-autocomplete-container ul li:last-child{border-radius:0 0 2px 2px;border-width:0 1px 1px}.easy-autocomplete-container ul li.selected{background:none repeat scroll 0 0 #ebebeb;cursor:pointer}.easy-autocomplete-container ul li.selected div{font-weight:normal}.easy-autocomplete-container ul li div{display:block;font-weight:normal;word-break:break-all}.easy-autocomplete-container ul li b{font-weight:bold}.easy-autocomplete-container ul .eac-category{font-color:#aaa;font-style:italic}.eac-description .eac-item span{color:#aaa;font-style:italic;font-size:0.9em}.eac-icon-left .eac-item img{margin-right:4px;max-height:30px}.eac-icon-right .eac-item{margin-top:8px;min-height:24px;position:relative}.eac-icon-right .eac-item img{margin-left:4px;max-height:30px;position:absolute;right:-4px;top:-8px} +/*# sourceMappingURL=easy-autocomplete.min.css.map */ diff --git a/static/css/easy-autocomplete.themes.min.css b/static/css/easy-autocomplete.themes.min.css new file mode 100644 index 0000000..37ac693 --- /dev/null +++ b/static/css/easy-autocomplete.themes.min.css @@ -0,0 +1,11 @@ +/* + * easy-autocomplete + * jQuery plugin for autocompletion + * + * @author Łukasz Pawełczak (http://github.com/pawelczak) + * @version 1.3.5 + * Copyright License: + */ + +.easy-autocomplete.eac-square{font-family:"Roboto", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-square input{border:1px solid #7f8c8d;border-radius:0;color:#7f8c8d;font-family:inherit;font-size:18px;font-style:italic;font-weight:300;margin:0;min-width:350px;padding:12px 43px 12px 15px}.easy-autocomplete.eac-square ul{border-color:#7f8c8d;border-top:0;box-shadow:none;top:0}.easy-autocomplete.eac-square ul li,.easy-autocomplete.eac-square ul .eac-category{border-color:#7f8c8d;font-family:inherit;font-size:16px;font-weight:300;padding:6px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-square ul li *,.easy-autocomplete.eac-square ul .eac-category *{font-weight:300}.easy-autocomplete.eac-square ul li.selected,.easy-autocomplete.eac-square ul .eac-category.selected{background-color:#f1f1f1;font-weight:300}.easy-autocomplete.eac-square ul li b,.easy-autocomplete.eac-square ul .eac-category b{font-weight:600}.easy-autocomplete.eac-round{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-round input{border:2px solid #888;border-radius:10px;color:#888;font-family:inherit;font-size:16px;font-weight:400;margin:0;min-width:300px;padding:10px}.easy-autocomplete.eac-round input:hover,.easy-autocomplete.eac-round input:focus{border-color:#3079ed}.easy-autocomplete.eac-round ul{background:none;border-color:#888;border-width:0;box-shadow:none;min-width:300px;top:20px}.easy-autocomplete.eac-round ul li,.easy-autocomplete.eac-round ul .eac-category{background:#fff;border-color:#3079ed;border-width:0 2px;font-size:14px;padding:8px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-round ul li.selected,.easy-autocomplete.eac-round ul .eac-category.selected{background-color:#d4e3fb}.easy-autocomplete.eac-round ul li:first-child,.easy-autocomplete.eac-round ul .eac-category:first-child{border-radius:10px 10px 0 0;border-width:2px 2px 0}.easy-autocomplete.eac-round ul li:last-child,.easy-autocomplete.eac-round ul .eac-category:last-child{border-radius:0 0 10px 10px;border-width:0 2px 2px}.easy-autocomplete.eac-round ul li b,.easy-autocomplete.eac-round ul .eac-category b{font-weight:700}.easy-autocomplete.eac-funky{font-family:"Inconsolata", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-funky input{background:#07ED89;border:0;border-radius:0;color:#ED076B;font-family:inherit;font-size:18px;min-width:240px;padding:12px}.easy-autocomplete.eac-funky ul{background:transparent;border:0}.easy-autocomplete.eac-funky ul li,.easy-autocomplete.eac-funky ul .eac-category{background:transparent;border:0;color:#ED076B;font-size:18px;padding:4px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-funky ul li.selected,.easy-autocomplete.eac-funky ul .eac-category.selected{color:#8907ED}.easy-autocomplete.eac-solid input{box-shadow:0 1px 2px rgba(0,0,0,0.15) inset;border-color:#ddd;color:#666;font-size:13px;min-height:0;padding:6px 12px}.easy-autocomplete.eac-solid ul li,.easy-autocomplete.eac-solid ul .eac-category{transition:all 0.4s ease 0s}.easy-autocomplete.eac-solid ul li.selected,.easy-autocomplete.eac-solid ul .eac-category.selected{background-color:#f2f2f2}.easy-autocomplete.eac-plate{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-plate input{font-size:13px;padding:6px 12px}.easy-autocomplete.eac-plate ul{background:#b5b5b5;border-radius:6px;border-width:0;top:10px}.easy-autocomplete.eac-plate ul li,.easy-autocomplete.eac-plate ul .eac-category{background:#b5b5b5;color:#FAFAFA;font-size:12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-plate ul li b,.easy-autocomplete.eac-plate ul .eac-category b{color:#ffd464}.easy-autocomplete.eac-plate ul li.selected,.easy-autocomplete.eac-plate ul .eac-category.selected{background:#656565}.easy-autocomplete.eac-plate ul li:first-child,.easy-autocomplete.eac-plate ul .eac-category:first-child{border-radius:6px 6px 0 0}.easy-autocomplete.eac-plate ul li:last-child,.easy-autocomplete.eac-plate ul .eac-category:last-child{border-radius:0 0 6px 6px}.easy-autocomplete.eac-plate-dark{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-plate-dark input{font-size:13px;padding:6px 12px}.easy-autocomplete.eac-plate-dark ul{background:#212121;border-radius:6px;border-width:0;top:10px}.easy-autocomplete.eac-plate-dark ul li,.easy-autocomplete.eac-plate-dark ul .eac-category{background:#212121;color:#FAFAFA;font-size:12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-plate-dark ul li b,.easy-autocomplete.eac-plate-dark ul .eac-category b{color:#ffd464}.easy-autocomplete.eac-plate-dark ul li.selected,.easy-autocomplete.eac-plate-dark ul .eac-category.selected{background:#656565}.easy-autocomplete.eac-plate-dark ul li:first-child,.easy-autocomplete.eac-plate-dark ul .eac-category:first-child{border-radius:6px 6px 0 0}.easy-autocomplete.eac-plate-dark ul li:last-child,.easy-autocomplete.eac-plate-dark ul .eac-category:last-child{border-radius:0 0 6px 6px} +/*# sourceMappingURL=easy-autocomplete.themes.min.css.map */ diff --git a/static/css/tempusdominus-bootstrap-4.min.css b/static/css/tempusdominus-bootstrap-4.min.css new file mode 100644 index 0000000..65ae800 --- /dev/null +++ b/static/css/tempusdominus-bootstrap-4.min.css @@ -0,0 +1,204 @@ +/*@preserve + * Tempus Dominus Bootstrap4 v5.0.0-alpha16 (https://tempusdominus.github.io/bootstrap-4/) + * Copyright 2016-2018 Jonathan Peterson + * Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE) + */ + +.sr-only, .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after, .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after, .bootstrap-datetimepicker-widget .btn[data-action="today"]::after, .bootstrap-datetimepicker-widget .picker-switch::after, .bootstrap-datetimepicker-widget table th.prev::after, .bootstrap-datetimepicker-widget table th.next::after { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; } + +.bootstrap-datetimepicker-widget { + list-style: none; } + .bootstrap-datetimepicker-widget.dropdown-menu { + display: block; + margin: 2px 0; + padding: 4px; + width: 14rem; } + @media (min-width: 576px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; } } + @media (min-width: 768px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; } } + @media (min-width: 992px) { + .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { + width: 38em; } } + .bootstrap-datetimepicker-widget.dropdown-menu:before, .bootstrap-datetimepicker-widget.dropdown-menu:after { + content: ''; + display: inline-block; + position: absolute; } + .bootstrap-datetimepicker-widget.dropdown-menu.bottom:before { + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + top: -7px; + left: 7px; } + .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid white; + top: -6px; + left: 8px; } + .bootstrap-datetimepicker-widget.dropdown-menu.top:before { + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-top: 7px solid #ccc; + border-top-color: rgba(0, 0, 0, 0.2); + bottom: -7px; + left: 6px; } + .bootstrap-datetimepicker-widget.dropdown-menu.top:after { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid white; + bottom: -6px; + left: 7px; } + .bootstrap-datetimepicker-widget.dropdown-menu.float-right:before { + left: auto; + right: 6px; } + .bootstrap-datetimepicker-widget.dropdown-menu.float-right:after { + left: auto; + right: 7px; } + .bootstrap-datetimepicker-widget .list-unstyled { + margin: 0; } + .bootstrap-datetimepicker-widget a[data-action] { + padding: 6px 0; } + .bootstrap-datetimepicker-widget a[data-action]:active { + box-shadow: none; } + .bootstrap-datetimepicker-widget .timepicker-hour, .bootstrap-datetimepicker-widget .timepicker-minute, .bootstrap-datetimepicker-widget .timepicker-second { + width: 54px; + font-weight: bold; + font-size: 1.2em; + margin: 0; } + .bootstrap-datetimepicker-widget button[data-action] { + padding: 6px; } + .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after { + content: "Increment Hours"; } + .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after { + content: "Increment Minutes"; } + .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after { + content: "Decrement Hours"; } + .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after { + content: "Decrement Minutes"; } + .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after { + content: "Show Hours"; } + .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after { + content: "Show Minutes"; } + .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after { + content: "Toggle AM/PM"; } + .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after { + content: "Clear the picker"; } + .bootstrap-datetimepicker-widget .btn[data-action="today"]::after { + content: "Set the date to today"; } + .bootstrap-datetimepicker-widget .picker-switch { + text-align: center; } + .bootstrap-datetimepicker-widget .picker-switch::after { + content: "Toggle Date and Time Screens"; } + .bootstrap-datetimepicker-widget .picker-switch td { + padding: 0; + margin: 0; + height: auto; + width: auto; + line-height: inherit; } + .bootstrap-datetimepicker-widget .picker-switch td span { + line-height: 2.5; + height: 2.5em; + width: 100%; } + .bootstrap-datetimepicker-widget table { + width: 100%; + margin: 0; } + .bootstrap-datetimepicker-widget table td, + .bootstrap-datetimepicker-widget table th { + text-align: center; + border-radius: 0.25rem; } + .bootstrap-datetimepicker-widget table th { + height: 20px; + line-height: 20px; + width: 20px; } + .bootstrap-datetimepicker-widget table th.picker-switch { + width: 145px; } + .bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover { + background: none; + color: #868e96; + cursor: not-allowed; } + .bootstrap-datetimepicker-widget table th.prev::after { + content: "Previous Month"; } + .bootstrap-datetimepicker-widget table th.next::after { + content: "Next Month"; } + .bootstrap-datetimepicker-widget table thead tr:first-child th { + cursor: pointer; } + .bootstrap-datetimepicker-widget table thead tr:first-child th:hover { + background: #e9ecef; } + .bootstrap-datetimepicker-widget table td { + height: 54px; + line-height: 54px; + width: 54px; } + .bootstrap-datetimepicker-widget table td.cw { + font-size: .8em; + height: 20px; + line-height: 20px; + color: #868e96; } + .bootstrap-datetimepicker-widget table td.day { + height: 20px; + line-height: 20px; + width: 20px; } + .bootstrap-datetimepicker-widget table td.day:hover, .bootstrap-datetimepicker-widget table td.hour:hover, .bootstrap-datetimepicker-widget table td.minute:hover, .bootstrap-datetimepicker-widget table td.second:hover { + background: #e9ecef; + cursor: pointer; } + .bootstrap-datetimepicker-widget table td.old, .bootstrap-datetimepicker-widget table td.new { + color: #868e96; } + .bootstrap-datetimepicker-widget table td.today { + position: relative; } + .bootstrap-datetimepicker-widget table td.today:before { + content: ''; + display: inline-block; + border: solid transparent; + border-width: 0 0 7px 7px; + border-bottom-color: #007bff; + border-top-color: rgba(0, 0, 0, 0.2); + position: absolute; + bottom: 4px; + right: 4px; } + .bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { + background-color: #007bff; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } + .bootstrap-datetimepicker-widget table td.active.today:before { + border-bottom-color: #fff; } + .bootstrap-datetimepicker-widget table td.disabled, .bootstrap-datetimepicker-widget table td.disabled:hover { + background: none; + color: #868e96; + cursor: not-allowed; } + .bootstrap-datetimepicker-widget table td span { + display: inline-block; + width: 54px; + height: 54px; + line-height: 54px; + margin: 2px 1.5px; + cursor: pointer; + border-radius: 0.25rem; } + .bootstrap-datetimepicker-widget table td span:hover { + background: #e9ecef; } + .bootstrap-datetimepicker-widget table td span.active { + background-color: #007bff; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } + .bootstrap-datetimepicker-widget table td span.old { + color: #868e96; } + .bootstrap-datetimepicker-widget table td span.disabled, .bootstrap-datetimepicker-widget table td span.disabled:hover { + background: none; + color: #868e96; + cursor: not-allowed; } + .bootstrap-datetimepicker-widget.usetwentyfour td.hour { + height: 27px; + line-height: 27px; } + +.input-group [data-toggle="datetimepicker"] { + cursor: pointer; } diff --git a/static/js/jquery.easy-autocomplete.min.js b/static/js/jquery.easy-autocomplete.min.js new file mode 100644 index 0000000..926b946 --- /dev/null +++ b/static/js/jquery.easy-autocomplete.min.js @@ -0,0 +1,10 @@ +/* + * easy-autocomplete + * jQuery plugin for autocompletion + * + * @author Łukasz Pawełczak (http://github.com/pawelczak) + * @version 1.3.5 + * Copyright License: + */ + +var EasyAutocomplete=function(a){return a.Configuration=function(a){function b(){if("xml"===a.dataType&&(a.getValue||(a.getValue=function(a){return $(a).text()}),a.list||(a.list={}),a.list.sort||(a.list.sort={}),a.list.sort.method=function(b,c){return b=a.getValue(b),c=a.getValue(c),c>b?-1:b>c?1:0},a.list.match||(a.list.match={}),a.list.match.method=function(a,b){return a.search(b)>-1}),void 0!==a.categories&&a.categories instanceof Array){for(var b=[],c=0,d=a.categories.length;d>c;c+=1){var e=a.categories[c];for(var f in h.categories[0])void 0===e[f]&&(e[f]=h.categories[0][f]);b.push(e)}a.categories=b}}function c(){function b(a,c){var d=a||{};for(var e in a)void 0!==c[e]&&null!==c[e]&&("object"!=typeof c[e]||c[e]instanceof Array?d[e]=c[e]:b(a[e],c[e]));return void 0!==c.data&&null!==c.data&&"object"==typeof c.data&&(d.data=c.data),d}h=b(h,a)}function d(){if("list-required"!==h.url&&"function"!=typeof h.url){var b=h.url;h.url=function(){return b}}if(void 0!==h.ajaxSettings.url&&"function"!=typeof h.ajaxSettings.url){var b=h.ajaxSettings.url;h.ajaxSettings.url=function(){return b}}if("string"==typeof h.listLocation){var c=h.listLocation;"XML"===h.dataType.toUpperCase()?h.listLocation=function(a){return $(a).find(c)}:h.listLocation=function(a){return a[c]}}if("string"==typeof h.getValue){var d=h.getValue;h.getValue=function(a){return a[d]}}void 0!==a.categories&&(h.categoriesAssigned=!0)}function e(){void 0!==a.ajaxSettings&&"object"==typeof a.ajaxSettings?h.ajaxSettings=a.ajaxSettings:h.ajaxSettings={}}function f(a){return void 0!==h[a]&&null!==h[a]}function g(a,b){function c(b,d){for(var e in d)void 0===b[e]&&a.log("Property '"+e+"' does not exist in EasyAutocomplete options API."),"object"==typeof b[e]&&-1===$.inArray(e,i)&&c(b[e],d[e])}c(h,b)}var h={data:"list-required",url:"list-required",dataType:"json",listLocation:function(a){return a},xmlElementName:"",getValue:function(a){return a},autocompleteOff:!0,placeholder:!1,ajaxCallback:function(){},matchResponseProperty:!1,list:{sort:{enabled:!1,method:function(a,b){return a=h.getValue(a),b=h.getValue(b),b>a?-1:a>b?1:0}},maxNumberOfElements:6,hideOnEmptyPhrase:!0,match:{enabled:!1,caseSensitive:!1,method:function(a,b){return a.search(b)>-1}},showAnimation:{type:"normal",time:400,callback:function(){}},hideAnimation:{type:"normal",time:400,callback:function(){}},onClickEvent:function(){},onSelectItemEvent:function(){},onLoadEvent:function(){},onChooseEvent:function(){},onKeyEnterEvent:function(){},onMouseOverEvent:function(){},onMouseOutEvent:function(){},onShowListEvent:function(){},onHideListEvent:function(){}},highlightPhrase:!0,theme:"",cssClasses:"",minCharNumber:0,requestDelay:0,adjustWidth:!0,ajaxSettings:{},preparePostData:function(a,b){return a},loggerEnabled:!0,template:"",categoriesAssigned:!1,categories:[{maxNumberOfElements:4}]},i=["ajaxSettings","template"];this.get=function(a){return h[a]},this.equals=function(a,b){return!(!f(a)||h[a]!==b)},this.checkDataUrlProperties=function(){return"list-required"!==h.url||"list-required"!==h.data},this.checkRequiredProperties=function(){for(var a in h)if("required"===h[a])return logger.error("Option "+a+" must be defined"),!1;return!0},this.printPropertiesThatDoesntExist=function(a,b){g(a,b)},b(),c(),h.loggerEnabled===!0&&g(console,a),e(),d()},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Logger=function(){this.error=function(a){console.log("ERROR: "+a)},this.warning=function(a){console.log("WARNING: "+a)}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Constans=function(){var a={CONTAINER_CLASS:"easy-autocomplete-container",CONTAINER_ID:"eac-container-",WRAPPER_CSS_CLASS:"easy-autocomplete"};this.getValue=function(b){return a[b]}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.ListBuilderService=function(a,b){function c(b,c){function d(){var d,e={};return void 0!==b.xmlElementName&&(e.xmlElementName=b.xmlElementName),void 0!==b.listLocation?d=b.listLocation:void 0!==a.get("listLocation")&&(d=a.get("listLocation")),void 0!==d?"string"==typeof d?e.data=$(c).find(d):"function"==typeof d&&(e.data=d(c)):e.data=c,e}function e(){var a={};return void 0!==b.listLocation?"string"==typeof b.listLocation?a.data=c[b.listLocation]:"function"==typeof b.listLocation&&(a.data=b.listLocation(c)):a.data=c,a}var f={};if(f="XML"===a.get("dataType").toUpperCase()?d():e(),void 0!==b.header&&(f.header=b.header),void 0!==b.maxNumberOfElements&&(f.maxNumberOfElements=b.maxNumberOfElements),void 0!==a.get("list").maxNumberOfElements&&(f.maxListSize=a.get("list").maxNumberOfElements),void 0!==b.getValue)if("string"==typeof b.getValue){var g=b.getValue;f.getValue=function(a){return a[g]}}else"function"==typeof b.getValue&&(f.getValue=b.getValue);else f.getValue=a.get("getValue");return f}function d(b){var c=[];return void 0===b.xmlElementName&&(b.xmlElementName=a.get("xmlElementName")),$(b.data).find(b.xmlElementName).each(function(){c.push(this)}),c}this.init=function(b){var c=[],d={};return d.data=a.get("listLocation")(b),d.getValue=a.get("getValue"),d.maxListSize=a.get("list").maxNumberOfElements,c.push(d),c},this.updateCategories=function(b,d){if(a.get("categoriesAssigned")){b=[];for(var e=0;ee;e+=1)c[e].data=b(a,c[e],d);return c},this.checkIfDataExists=function(a){for(var b=0,c=a.length;c>b;b+=1)if(void 0!==a[b].data&&a[b].data instanceof Array&&a[b].data.length>0)return!0;return!1}},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.proccess=function(b,c,d){function e(a,c){var d=[],e="";if(b.get("list").match.enabled)for(var g=0,h=a.length;h>g;g+=1)e=b.get("getValue")(a[g]),f(e,c)&&d.push(a[g]);else d=a;return d}function f(a,c){return b.get("list").match.caseSensitive||("string"==typeof a&&(a=a.toLowerCase()),c=c.toLowerCase()),!!b.get("list").match.method(a,c)}function g(a){return void 0!==c.maxNumberOfElements&&a.length>c.maxNumberOfElements&&(a=a.slice(0,c.maxNumberOfElements)),a}function h(a){return b.get("list").sort.enabled&&a.sort(b.get("list").sort.method),a}a.proccess.match=f;var i=c.data,j=d;return i=e(i,j),i=g(i),i=h(i)},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.Template=function(a){var b={basic:{type:"basic",method:function(a){return a},cssClass:""},description:{type:"description",fields:{description:"description"},method:function(a){return a+" - description"},cssClass:"eac-description"},iconLeft:{type:"iconLeft",fields:{icon:""},method:function(a){return a},cssClass:"eac-icon-left"},iconRight:{type:"iconRight",fields:{iconSrc:""},method:function(a){return a},cssClass:"eac-icon-right"},links:{type:"links",fields:{link:""},method:function(a){return a},cssClass:""},custom:{type:"custom",method:function(){},cssClass:""}},c=function(a){var c,d=a.fields;return"description"===a.type?(c=b.description.method,"string"==typeof d.description?c=function(a,b){return a+" - "+b[d.description]+""}:"function"==typeof d.description&&(c=function(a,b){return a+" - "+d.description(b)+""}),c):"iconRight"===a.type?("string"==typeof d.iconSrc?c=function(a,b){return a+""}:"function"==typeof d.iconSrc&&(c=function(a,b){return a+""}),c):"iconLeft"===a.type?("string"==typeof d.iconSrc?c=function(a,b){return""+a}:"function"==typeof d.iconSrc&&(c=function(a,b){return""+a}),c):"links"===a.type?("string"==typeof d.link?c=function(a,b){return""+a+""}:"function"==typeof d.link&&(c=function(a,b){return""+a+""}),c):"custom"===a.type?a.method:b.basic.method},d=function(a){return a&&a.type&&a.type&&b[a.type]?c(a):b.basic.method},e=function(a){var c=function(){return""};return a&&a.type&&a.type&&b[a.type]?function(){var c=b[a.type].cssClass;return function(){return c}}():c};this.getTemplateClass=e(a),this.build=d(a)},a}(EasyAutocomplete||{}),EasyAutocomplete=function(a){return a.main=function(b,c){function d(){return 0===t.length?void p.error("Input field doesn't exist."):o.checkDataUrlProperties()?o.checkRequiredProperties()?(e(),void g()):void p.error("Will not work without mentioned properties."):void p.error("One of options variables 'data' or 'url' must be defined.")}function e(){function a(){var a=$("
"),c=n.getValue("WRAPPER_CSS_CLASS");o.get("theme")&&""!==o.get("theme")&&(c+=" eac-"+o.get("theme")),o.get("cssClasses")&&""!==o.get("cssClasses")&&(c+=" "+o.get("cssClasses")),""!==q.getTemplateClass()&&(c+=" "+q.getTemplateClass()),a.addClass(c),t.wrap(a),o.get("adjustWidth")===!0&&b()}function b(){var a=t.outerWidth();t.parent().css("width",a)}function c(){t.unwrap()}function d(){var a=$("
").addClass(n.getValue("CONTAINER_CLASS"));a.attr("id",f()).prepend($("