From aee337e75e0addfe025e96e4b85c513c44cbd40c Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 18 Aug 2025 12:11:26 +0200 Subject: [PATCH] tabulator-table --- app/Filament/Pages/Monitor.php | 2 + app/Providers/AppServiceProvider.php | 10 +- app/Providers/Filament/AdminPanelProvider.php | 2 +- bin/build.js | 71 - composer.lock | 10 +- package-lock.json | 166 +- package.json | 2 +- public/css/app/tabulator-css.css | 2 + public/css/app/tabulator-custom-css.css | 211 + public/css/app/tabulator-stylesheet.css | 2 - public/js/app/tabulator-js.js | 3 + resources/css/tabulator-custom.css | 211 + resources/js/dist/components/tabulator.js | 24898 ---------------- resources/js/tabulator-js.js | 29 + .../views/filament/pages/monitor.blade.php | 129 +- 15 files changed, 639 insertions(+), 25109 deletions(-) delete mode 100644 bin/build.js create mode 100644 public/css/app/tabulator-css.css create mode 100644 public/css/app/tabulator-custom-css.css delete mode 100644 public/css/app/tabulator-stylesheet.css create mode 100644 public/js/app/tabulator-js.js create mode 100644 resources/css/tabulator-custom.css delete mode 100644 resources/js/dist/components/tabulator.js create mode 100644 resources/js/tabulator-js.js diff --git a/app/Filament/Pages/Monitor.php b/app/Filament/Pages/Monitor.php index 0da9a454..7745dbce 100644 --- a/app/Filament/Pages/Monitor.php +++ b/app/Filament/Pages/Monitor.php @@ -18,5 +18,7 @@ class Monitor extends Page protected static ?string $pluralLabel = 'Monitor'; + protected static ?string $title = ''; + // protected static string|UnitEnum|null $navigationGroup = 'Administration'; } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7ca028ca..960280a4 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Filament\Support\Assets\AlpineComponent; use Filament\Support\Assets\Css; +use Filament\Support\Assets\Js; use Filament\Support\Facades\FilamentAsset; use Illuminate\Support\ServiceProvider; @@ -23,8 +23,12 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { FilamentAsset::register([ - Css::make('tabulator-stylesheet', __DIR__.'/../../node_modules/tabulator-tables/dist/css/tabulator.min.css')->loadedOnRequest(), - AlpineComponent::make('tabulator', __DIR__.'/../../resources/js/dist/components/tabulator.js'), + Css::make('tabulator-css', __DIR__.'/../../node_modules/tabulator-tables/dist/css/tabulator_semanticui.min.css') + ->loadedOnRequest(), + Css::make('tabulator-custom-css', __DIR__.'/../../resources/css/tabulator-custom.css') + ->loadedOnRequest(), + Js::make('tabulator-js', __DIR__.'/../../node_modules/tabulator-tables/dist/js/tabulator_esm.min.mjs') + ->loadedOnRequest(), ]); } } diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index fa754248..bdd03f34 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -3,8 +3,8 @@ namespace App\Providers\Filament; use Awcodes\LightSwitch\Enums\Alignment; -use BezhanSalleh\FilamentShield\FilamentShieldPlugin; use Awcodes\LightSwitch\LightSwitchPlugin; +use BezhanSalleh\FilamentShield\FilamentShieldPlugin; use Filament\Actions\Action; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\AuthenticateSession; diff --git a/bin/build.js b/bin/build.js deleted file mode 100644 index 18723ce3..00000000 --- a/bin/build.js +++ /dev/null @@ -1,71 +0,0 @@ -import * as esbuild from "esbuild"; - -const isDev = process.argv.includes("--dev"); - -async function compile(options) { - const context = await esbuild.context(options); - - if (isDev) { - await context.watch(); - } else { - await context.rebuild(); - await context.dispose(); - } -} - -const defaultOptions = { - define: { - "process.env.NODE_ENV": isDev ? `'development'` : `'production'`, - }, - bundle: true, - mainFields: ["module", "main"], - platform: "neutral", - sourcemap: isDev ? "inline" : false, - sourcesContent: isDev, - treeShaking: true, - target: ["es2020"], - minify: !isDev, - plugins: [ - { - name: "watchPlugin", - setup(build) { - build.onStart(() => { - console.log( - `Build started at ${new Date( - Date.now() - ).toLocaleTimeString()}: ${ - build.initialOptions.outfile - }` - ); - }); - - build.onEnd((result) => { - if (result.errors.length > 0) { - console.log( - `Build failed at ${new Date( - Date.now() - ).toLocaleTimeString()}: ${ - build.initialOptions.outfile - }`, - result.errors - ); - } else { - console.log( - `Build finished at ${new Date( - Date.now() - ).toLocaleTimeString()}: ${ - build.initialOptions.outfile - }` - ); - } - }); - }, - }, - ], -}; - -compile({ - ...defaultOptions, - entryPoints: ["./node_modules/tabulator-tables/dist/js/tabulator.min.js"], - outfile: "./resources/js/dist/components/tabulator.js", -}); diff --git a/composer.lock b/composer.lock index e7a34aa2..caaac6d0 100644 --- a/composer.lock +++ b/composer.lock @@ -2391,16 +2391,16 @@ }, { "name": "joaopaulolndev/filament-edit-profile", - "version": "v2.0.5", + "version": "v2.0.6", "source": { "type": "git", "url": "https://github.com/joaopaulolndev/filament-edit-profile.git", - "reference": "cba566fe51418df01a166ab2b55927b5186282a4" + "reference": "a29e364ea47b16208413cf74268c7d3c8025148d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joaopaulolndev/filament-edit-profile/zipball/cba566fe51418df01a166ab2b55927b5186282a4", - "reference": "cba566fe51418df01a166ab2b55927b5186282a4", + "url": "https://api.github.com/repos/joaopaulolndev/filament-edit-profile/zipball/a29e364ea47b16208413cf74268c7d3c8025148d", + "reference": "a29e364ea47b16208413cf74268c7d3c8025148d", "shasum": "" }, "require": { @@ -2460,7 +2460,7 @@ "type": "github" } ], - "time": "2025-08-16T19:29:48+00:00" + "time": "2025-08-17T23:39:01+00:00" }, { "name": "kirschbaum-development/eloquent-power-joins", diff --git a/package-lock.json b/package-lock.json index cdd76850..df3a68b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -523,9 +523,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.2.tgz", - "integrity": "sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.3.tgz", + "integrity": "sha512-UmTdvXnLlqQNOCJnyksjPs1G4GqXNGW1LrzCe8+8QoaLhhDeTXYBgJ3k6x61WIhlHX2U+VzEJ55TtIjR/HTySA==", "cpu": [ "arm" ], @@ -537,9 +537,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.2.tgz", - "integrity": "sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.3.tgz", + "integrity": "sha512-8NoxqLpXm7VyeI0ocidh335D6OKT0UJ6fHdnIxf3+6oOerZZc+O7r+UhvROji6OspyPm+rrIdb1gTXtVIqn+Sg==", "cpu": [ "arm64" ], @@ -551,9 +551,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.2.tgz", - "integrity": "sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.3.tgz", + "integrity": "sha512-csnNavqZVs1+7/hUKtgjMECsNG2cdB8F7XBHP6FfQjqhjF8rzMzb3SLyy/1BG7YSfQ+bG75Ph7DyedbUqwq1rA==", "cpu": [ "arm64" ], @@ -565,9 +565,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.2.tgz", - "integrity": "sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.3.tgz", + "integrity": "sha512-r2MXNjbuYabSIX5yQqnT8SGSQ26XQc8fmp6UhlYJd95PZJkQD1u82fWP7HqvGUf33IsOC6qsiV+vcuD4SDP6iw==", "cpu": [ "x64" ], @@ -579,9 +579,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.2.tgz", - "integrity": "sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.3.tgz", + "integrity": "sha512-uluObTmgPJDuJh9xqxyr7MV61Imq+0IvVsAlWyvxAaBSNzCcmZlhfYcRhCdMaCsy46ccZa7vtDDripgs9Jkqsw==", "cpu": [ "arm64" ], @@ -593,9 +593,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.2.tgz", - "integrity": "sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.3.tgz", + "integrity": "sha512-AVJXEq9RVHQnejdbFvh1eWEoobohUYN3nqJIPI4mNTMpsyYN01VvcAClxflyk2HIxvLpRcRggpX1m9hkXkpC/A==", "cpu": [ "x64" ], @@ -607,9 +607,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.2.tgz", - "integrity": "sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.3.tgz", + "integrity": "sha512-byyflM+huiwHlKi7VHLAYTKr67X199+V+mt1iRgJenAI594vcmGGddWlu6eHujmcdl6TqSNnvqaXJqZdnEWRGA==", "cpu": [ "arm" ], @@ -621,9 +621,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.2.tgz", - "integrity": "sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.3.tgz", + "integrity": "sha512-aLm3NMIjr4Y9LklrH5cu7yybBqoVCdr4Nvnm8WB7PKCn34fMCGypVNpGK0JQWdPAzR/FnoEoFtlRqZbBBLhVoQ==", "cpu": [ "arm" ], @@ -635,9 +635,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.2.tgz", - "integrity": "sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.3.tgz", + "integrity": "sha512-VtilE6eznJRDIoFOzaagQodUksTEfLIsvXymS+UdJiSXrPW7Ai+WG4uapAc3F7Hgs791TwdGh4xyOzbuzIZrnw==", "cpu": [ "arm64" ], @@ -649,9 +649,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.2.tgz", - "integrity": "sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.3.tgz", + "integrity": "sha512-dG3JuS6+cRAL0GQ925Vppafi0qwZnkHdPeuZIxIPXqkCLP02l7ka+OCyBoDEv8S+nKHxfjvjW4OZ7hTdHkx8/w==", "cpu": [ "arm64" ], @@ -663,9 +663,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.2.tgz", - "integrity": "sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.3.tgz", + "integrity": "sha512-iU8DxnxEKJptf8Vcx4XvAUdpkZfaz0KWfRrnIRrOndL0SvzEte+MTM7nDH4A2Now4FvTZ01yFAgj6TX/mZl8hQ==", "cpu": [ "loong64" ], @@ -677,9 +677,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.2.tgz", - "integrity": "sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.3.tgz", + "integrity": "sha512-VrQZp9tkk0yozJoQvQcqlWiqaPnLM6uY1qPYXvukKePb0fqaiQtOdMJSxNFUZFsGw5oA5vvVokjHrx8a9Qsz2A==", "cpu": [ "ppc64" ], @@ -691,9 +691,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.2.tgz", - "integrity": "sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.3.tgz", + "integrity": "sha512-uf2eucWSUb+M7b0poZ/08LsbcRgaDYL8NCGjUeFMwCWFwOuFcZ8D9ayPl25P3pl+D2FH45EbHdfyUesQ2Lt9wA==", "cpu": [ "riscv64" ], @@ -705,9 +705,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.2.tgz", - "integrity": "sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.3.tgz", + "integrity": "sha512-7tnUcDvN8DHm/9ra+/nF7lLzYHDeODKKKrh6JmZejbh1FnCNZS8zMkZY5J4sEipy2OW1d1Ncc4gNHUd0DLqkSg==", "cpu": [ "riscv64" ], @@ -719,9 +719,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.2.tgz", - "integrity": "sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.3.tgz", + "integrity": "sha512-MUpAOallJim8CsJK+4Lc9tQzlfPbHxWDrGXZm2z6biaadNpvh3a5ewcdat478W+tXDoUiHwErX/dOql7ETcLqg==", "cpu": [ "s390x" ], @@ -733,9 +733,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.2.tgz", - "integrity": "sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.3.tgz", + "integrity": "sha512-F42IgZI4JicE2vM2PWCe0N5mR5vR0gIdORPqhGQ32/u1S1v3kLtbZ0C/mi9FFk7C5T0PgdeyWEPajPjaUpyoKg==", "cpu": [ "x64" ], @@ -747,9 +747,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.2.tgz", - "integrity": "sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.3.tgz", + "integrity": "sha512-oLc+JrwwvbimJUInzx56Q3ujL3Kkhxehg7O1gWAYzm8hImCd5ld1F2Gry5YDjR21MNb5WCKhC9hXgU7rRlyegQ==", "cpu": [ "x64" ], @@ -761,9 +761,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.2.tgz", - "integrity": "sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.3.tgz", + "integrity": "sha512-lOrQ+BVRstruD1fkWg9yjmumhowR0oLAAzavB7yFSaGltY8klttmZtCLvOXCmGE9mLIn8IBV/IFrQOWz5xbFPg==", "cpu": [ "arm64" ], @@ -775,9 +775,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.2.tgz", - "integrity": "sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.3.tgz", + "integrity": "sha512-vvrVKPRS4GduGR7VMH8EylCBqsDcw6U+/0nPDuIjXQRbHJc6xOBj+frx8ksfZAh6+Fptw5wHrN7etlMmQnPQVg==", "cpu": [ "ia32" ], @@ -789,9 +789,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.2.tgz", - "integrity": "sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.3.tgz", + "integrity": "sha512-fi3cPxCnu3ZeM3EwKZPgXbWoGzm2XHgB/WShKI81uj8wG0+laobmqy5wbgEwzstlbLu4MyO8C19FyhhWseYKNQ==", "cpu": [ "x64" ], @@ -2072,9 +2072,9 @@ } }, "node_modules/rollup": { - "version": "4.46.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.2.tgz", - "integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==", + "version": "4.46.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.3.tgz", + "integrity": "sha512-RZn2XTjXb8t5g13f5YclGoilU/kwT696DIkY3sywjdZidNSi3+vseaQov7D7BZXVJCPv3pDWUN69C78GGbXsKw==", "dev": true, "license": "MIT", "dependencies": { @@ -2088,26 +2088,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.46.2", - "@rollup/rollup-android-arm64": "4.46.2", - "@rollup/rollup-darwin-arm64": "4.46.2", - "@rollup/rollup-darwin-x64": "4.46.2", - "@rollup/rollup-freebsd-arm64": "4.46.2", - "@rollup/rollup-freebsd-x64": "4.46.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.46.2", - "@rollup/rollup-linux-arm-musleabihf": "4.46.2", - "@rollup/rollup-linux-arm64-gnu": "4.46.2", - "@rollup/rollup-linux-arm64-musl": "4.46.2", - "@rollup/rollup-linux-loongarch64-gnu": "4.46.2", - "@rollup/rollup-linux-ppc64-gnu": "4.46.2", - "@rollup/rollup-linux-riscv64-gnu": "4.46.2", - "@rollup/rollup-linux-riscv64-musl": "4.46.2", - "@rollup/rollup-linux-s390x-gnu": "4.46.2", - "@rollup/rollup-linux-x64-gnu": "4.46.2", - "@rollup/rollup-linux-x64-musl": "4.46.2", - "@rollup/rollup-win32-arm64-msvc": "4.46.2", - "@rollup/rollup-win32-ia32-msvc": "4.46.2", - "@rollup/rollup-win32-x64-msvc": "4.46.2", + "@rollup/rollup-android-arm-eabi": "4.46.3", + "@rollup/rollup-android-arm64": "4.46.3", + "@rollup/rollup-darwin-arm64": "4.46.3", + "@rollup/rollup-darwin-x64": "4.46.3", + "@rollup/rollup-freebsd-arm64": "4.46.3", + "@rollup/rollup-freebsd-x64": "4.46.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.46.3", + "@rollup/rollup-linux-arm-musleabihf": "4.46.3", + "@rollup/rollup-linux-arm64-gnu": "4.46.3", + "@rollup/rollup-linux-arm64-musl": "4.46.3", + "@rollup/rollup-linux-loongarch64-gnu": "4.46.3", + "@rollup/rollup-linux-ppc64-gnu": "4.46.3", + "@rollup/rollup-linux-riscv64-gnu": "4.46.3", + "@rollup/rollup-linux-riscv64-musl": "4.46.3", + "@rollup/rollup-linux-s390x-gnu": "4.46.3", + "@rollup/rollup-linux-x64-gnu": "4.46.3", + "@rollup/rollup-linux-x64-musl": "4.46.3", + "@rollup/rollup-win32-arm64-msvc": "4.46.3", + "@rollup/rollup-win32-ia32-msvc": "4.46.3", + "@rollup/rollup-win32-x64-msvc": "4.46.3", "fsevents": "~2.3.2" } }, diff --git a/package.json b/package.json index cb9358d2..27ce0f7d 100644 --- a/package.json +++ b/package.json @@ -18,4 +18,4 @@ "dependencies": { "tabulator-tables": "^6.3.1" } -} +} \ No newline at end of file diff --git a/public/css/app/tabulator-css.css b/public/css/app/tabulator-css.css new file mode 100644 index 00000000..22766200 --- /dev/null +++ b/public/css/app/tabulator-css.css @@ -0,0 +1,2 @@ +.tabulator{background-color:#fff;font-size:14px;overflow:hidden;position:relative;text-align:left;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-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,.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){user-select:none}.tabulator .tabulator-header{border-bottom:1px solid #999;box-sizing:border-box;outline:none;overflow:hidden;position:relative;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap;width:100%}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{background:#f9fafb;border-right:1px solid #ddd;box-sizing:border-box;display:inline-flex;flex-direction:column;justify-content:flex-start;overflow:hidden;position:relative;text-align:left;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col.tabulator-moving{background:#dae1e7;border:1px solid #999;pointer-events:none;position:absolute}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#d6d6d6;color:#000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;padding:4px;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{text-overflow:clip;white-space:normal}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{background:#fff;border:1px solid #999;box-sizing:border-box;padding:1px;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{align-items:center;bottom:0;display:flex;position:absolute;right:4px;top:0}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-left:6px solid transparent;border-right:6px solid transparent;height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #ddd;display:flex;margin-right:-1px;overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{box-sizing:border-box;margin-top:2px;position:relative;text-align:center;width:100%}.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{height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:#dae1e7;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #666;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-top:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{align-items:center;display:flex;justify-content:center;text-orientation:mixed;writing-mode:vertical-rl}.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-bottom:20px;padding-right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{bottom:auto;justify-content:center;left:0;right:0;top:4px}.tabulator .tabulator-header .tabulator-frozen{left:0;position:sticky;z-index:11}.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{background:#fff!important;border-bottom:1px solid #ddd;border-top:1px solid #ddd;box-sizing:border-box;display:inline-block}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#fff!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{display:inline-block}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{-webkit-overflow-scrolling:touch;overflow:auto;position:relative;white-space:nowrap;width:100%}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{color:#ccc;display:inline-block;font-size:20px;font-weight:700;padding:10px;text-align:center;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{background-color:#fff;color:#333;display:inline-block;overflow:visible;position:relative;white-space:nowrap}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{background:#e2e2e2!important;font-weight:700}.tabulator .tabulator-tableholder .tabulator-range-overlay{inset:0;pointer-events:none;position:absolute;z-index:10}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{border:1px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;position:absolute;right:-3px;width:6px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{border:2px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-footer{background-color:#fff;border-top:1px solid #999;color:#555;font-weight:700;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap}.tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:-5px;overflow-x:auto}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab{border:1px solid rgba(34,36,38,.15);border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:none;display:inline-block;font-size:.9em;padding:5px}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab:hover{cursor:pointer;opacity:.7}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{background:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder{border-bottom:1px solid #ddd;border-top:1px solid #ddd;box-sizing:border-box;overflow:hidden;text-align:left;width:100%}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{display:inline-block}.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}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{color:#555;flex:1;font-family:inherit;font-size:inherit;font-weight:inherit;text-align:right}.tabulator .tabulator-footer .tabulator-page-size{border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 5px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{background:hsla(0,0%,100%,.2);border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 2px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{background:rgba(0,0,0,.2);color:#fff;cursor:pointer}}.tabulator .tabulator-col-resize-handle{display:inline-block;margin-left:-3px;margin-right:-3px;position:relative;vertical-align:middle;width:6px;z-index:11}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{margin-right:0;width:3px}.tabulator .tabulator-col-resize-guide{background-color:#999;height:100%;margin-left:-.5px;opacity:.5;position:absolute;top:0;width:4px}.tabulator .tabulator-row-resize-guide{background-color:#999;height:4px;left:0;margin-top:-.5px;opacity:.5;position:absolute;width:100%}.tabulator .tabulator-alert{align-items:center;background:rgba(0,0,0,.4);display:flex;height:100%;left:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.tabulator .tabulator-alert .tabulator-alert-msg{background:#fff;border-radius:10px;display:inline-block;font-size:16px;font-weight:700;margin:0 auto;padding:10px 20px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{background-color:#fff;box-sizing:border-box;min-height:22px;position:relative}.tabulator-row.tabulator-row-even{background-color:#efefef}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9abcea}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}}.tabulator-row.tabulator-row-moving{background:#fff;border:1px solid #000}.tabulator-row.tabulator-moving{border-bottom:1px solid #ddd;border-top:1px solid #ddd;pointer-events:none;position:absolute;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#d6d6d6;color:#000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header,.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#fff}.tabulator-row .tabulator-row-resize-handle{bottom:0;height:5px;left:0;position:absolute;right:0}.tabulator-row .tabulator-row-resize-handle.prev{bottom:auto;top:0}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{border-bottom:1px solid #ddd;border-top:1px solid #ddd;box-sizing:border-box;padding:5px}.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{border-right:1px solid #ddd;box-sizing:border-box;display:inline-block;outline:none;overflow:hidden;padding:4px;position:relative;text-overflow:ellipsis;white-space:nowrap}.tabulator-row .tabulator-cell.tabulator-row-header{background:#f9fafb;border-bottom:1px solid #ddd;border-right:1px solid rgba(34,36,38,.15)}.tabulator-row .tabulator-cell.tabulator-frozen{background-color:inherit;display:inline-block;left:0;position:sticky;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #ddd}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #ddd}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{background:transparent;border:1px;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #db2828}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{background:transparent;border:1px;color:#db2828}.tabulator-row .tabulator-cell.tabulator-row-handle{align-items:center;display:inline-flex;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{background:#666;height:3px;margin-top:2px;width:100%}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9abcea}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom:2px solid #ddd;border-bottom-left-radius:1px;border-left:2px solid #ddd;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{align-items:center;background:#666;border-radius:20px;display:inline-flex;font-size:1.1em;font-weight:700;height:15px;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;width:15px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{cursor:pointer;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 svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{border-radius:14px;display:inline-block;height:14px;width:14px}.tabulator-row.tabulator-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #ddd;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.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{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-row.tabulator-group span{color:#d00;margin-left:10px}.tabulator-toggle{background:#dcdcdc;border:1px solid #ccc;box-sizing:border-box;display:flex;flex-direction:row}.tabulator-toggle.tabulator-toggle-on{background:#1c6cc2}.tabulator-toggle .tabulator-toggle-switch{background:#fff;border:1px solid #ccc;box-sizing:border-box}.tabulator-popup-container{-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #ddd;box-shadow:0 0 5px 0 rgba(0,0,0,.2);box-sizing:border-box;display:inline-block;font-size:14px;overflow-y:auto;position:absolute;z-index:10000}.tabulator-popup{border-radius:3px;padding:5px}.tabulator-tooltip{border-radius:2px;box-shadow:none;font-size:12px;max-width:Min(500px,100%);padding:3px 5px;pointer-events:none}.tabulator-menu .tabulator-menu-item{box-sizing:border-box;padding:5px 10px;position:relative;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#efefef;cursor:pointer}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{border-color:#ddd;border-style:solid;border-width:1px 1px 0 0;content:"";display:inline-block;height:7px;position:absolute;right:10px;top:calc(5px + .4em);transform:rotate(45deg);vertical-align:top;width:7px}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #ddd}.tabulator-edit-list{-webkit-overflow-scrolling:touch;font-size:14px;max-height:200px;overflow-y:auto}.tabulator-edit-list .tabulator-edit-list-item{color:#333;outline:none;padding:4px}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd;color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}@media (hover:hover) and (pointer:fine){.tabulator-edit-list .tabulator-edit-list-item:hover{background:#1d68cd;color:#fff;cursor:pointer}}.tabulator-edit-list .tabulator-edit-list-placeholder{color:#333;padding:4px;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #ddd;color:#333;font-weight:700;padding:6px 4px 4px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{direction:rtl;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #ddd;border-right:initial;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-left:-1px;margin-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-left:25px;padding-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;left:-3px;position:absolute;right:auto;width:6px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-left:1px solid #ddd;border-right:initial}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #ddd;margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #ddd}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #ddd}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{margin-left:0;margin-right:-3px;width:3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{bottom:0;left:0;position:absolute;right:0;top: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{border-bottom:2px solid #ddd;border-bottom-left-radius:1px;border-left:2px solid #ddd;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-print-table .tabulator-print-table-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #ddd;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-print-table-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.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{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-print-table .tabulator-print-table-group span{color:#d00;margin-left:10px}.tabulator-print-table .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator{border:1px solid rgba(34,36,38,.15);border-radius:.28571rem;box-shadow:none;color:rgba(0,0,0,.87);margin:1em 0;width:100%}.tabulator .tabulator-header{border-bottom:1px solid rgba(34,36,38,.1);box-shadow:none;color:rgba(0,0,0,.87);font-style:none;font-weight:700;text-transform:none}.tabulator .tabulator-header,.tabulator .tabulator-header .tabulator-col{background-color:#f9fafb;border-right:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:.92857em .78571em}.tabulator .tabulator-tableholder .tabulator-table{background-color:transparent}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{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-footer{background:#f9fafb;border-top:1px solid rgba(34,36,38,.15);box-shadow:none;color:rgba(0,0,0,.87);font-style:normal;font-weight:400;padding:.78571em;text-align:right;text-transform:none}.tabulator .tabulator-footer .tabulator-calcs-holder{background:#fff!important;margin:-.78571em -.78571em .78571em}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#fff!important}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{border-bottom:none;margin-bottom:-.78571em}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:calc(-.78571em - 5px)}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{color:#d00}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive{background:#fcfff5!important;box-shadow:inset 0 0 0 #a3c293;color:#21ba45!important}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive:hover,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive:hover{background:#f7ffe6!important;color:#13ae38!important}}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative{background:#fff6f6!important;box-shadow:inset 0 0 0 #e0b4b4;color:#db2828!important}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative:hover,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative:hover{background:#ffe7e7!important;color:#d41616!important}}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error{background:#fff6f6!important;box-shadow:inset 0 0 0 #e0b4b4;color:#db2828!important}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error:hover,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error:hover{background:#ffe7e7!important;color:#d12323!important}}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning{background:#fffaf3!important;box-shadow:inset 0 0 0 #c9ba9b;color:#f2c037!important}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning:hover,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning:hover{background:#fff4e4!important;color:#f1bb29!important}}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.active,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.active{background:#e0e0e0!important;box-shadow:inset 0 0 0 rgba(0,0,0,.87);color:rgba(0,0,0,.87)!important}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.active:hover,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.active:hover{background:#f7ffe6!important;color:#13ae38!important}}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.active,.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.active{color:rgba(0,0,0,.2);pointer-events:none}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.disabled:hover{color:rgba(0,0,0,.2);pointer-events:none}}.tabulator.inverted{background:#333;border:none;color:hsla(0,0%,100%,.9)}.tabulator.inverted .tabulator-header{background-color:rgba(0,0,0,.15);color:hsla(0,0%,100%,.9)}.tabulator.inverted .tabulator-header,.tabulator.inverted .tabulator-header .tabulator-col{border-color:hsla(0,0%,100%,.1)!important}.tabulator.inverted .tabulator-tableholder .tabulator-table .tabulator-row{border:none;color:hsla(0,0%,100%,.9)}.tabulator.inverted .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-color:hsla(0,0%,100%,.1)!important}.tabulator.inverted .tabulator-footer{background:#fff}.tabulator.striped .tabulator-row:nth-child(2n){background-color:#f2f2f2}.tabulator.celled{border:1px solid rgba(34,36,38,.15)}.tabulator.celled .tabulator-header .tabulator-col,.tabulator.celled .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid rgba(34,36,38,.1)}.tabulator[class*="single line"] .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:none}.tabulator.red{border-top:.2em solid #db2828}.tabulator.inverted.red{background-color:#db2828!important;color:#fff!important}.tabulator.orange{border-top:.2em solid #f2711c}.tabulator.inverted.orange{background-color:#f2711c!important;color:#fff!important}.tabulator.yellow{border-top:.2em solid #fbbd08}.tabulator.inverted.yellow{background-color:#fbbd08!important;color:#fff!important}.tabulator.olive{border-top:.2em solid #b5cc18}.tabulator.inverted.olive{background-color:#b5cc18!important;color:#fff!important}.tabulator.green{border-top:.2em solid #21ba45}.tabulator.inverted.green{background-color:#21ba45!important;color:#fff!important}.tabulator.teal{border-top:.2em solid #00b5ad}.tabulator.inverted.teal{background-color:#00b5ad!important;color:#fff!important}.tabulator.blue{border-top:.2em solid #2185d0}.tabulator.inverted.blue{background-color:#2185d0!important;color:#fff!important}.tabulator.violet{border-top:.2em solid #6435c9}.tabulator.inverted.violet{background-color:#6435c9!important;color:#fff!important}.tabulator.purple{border-top:.2em solid #a333c8}.tabulator.inverted.purple{background-color:#a333c8!important;color:#fff!important}.tabulator.pink{border-top:.2em solid #e03997}.tabulator.inverted.pink{background-color:#e03997!important;color:#fff!important}.tabulator.brown{border-top:.2em solid #a5673f}.tabulator.inverted.brown{background-color:#a5673f!important;color:#fff!important}.tabulator.grey{border-top:.2em solid #767676}.tabulator.inverted.grey{background-color:#767676!important;color:#fff!important}.tabulator.black{border-top:.2em solid #1b1c1d}.tabulator.inverted.black{background-color:#1b1c1d!important;color:#fff!important}.tabulator.padded .tabulator-header .tabulator-col .tabulator-col-content{padding:1em}.tabulator.padded .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{top:20px}.tabulator.padded .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:1em}.tabulator.padded.very .tabulator-header .tabulator-col .tabulator-col-content{padding:1.5em}.tabulator.padded.very .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{top:26px}.tabulator.padded.very .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:1.5em}.tabulator.compact .tabulator-header .tabulator-col .tabulator-col-content{padding:.5em .7em}.tabulator.compact .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{top:12px}.tabulator.compact .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:.5em .7em}.tabulator.compact.very .tabulator-header .tabulator-col .tabulator-col-content{padding:.4em .6em}.tabulator.compact.very .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{top:10px}.tabulator.compact.very .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:.4em .6em}.tabulator-row{border-bottom:1px solid rgba(34,36,38,.1)}.tabulator-row.tabulator-row-even{background-color:#fff}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background:#e0e0e0!important;box-shadow:inset 0 0 0 rgba(0,0,0,.87);color:rgba(0,0,0,.87)!important}}.tabulator-row.tabulator-selected{background-color:#9abcea!important}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc!important;cursor:pointer}}.tabulator-row.tabulator-moving{pointer-events:none!important}.tabulator-row .tabulator-cell{border-right:none;padding:.78571em;vertical-align:middle}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell.tabulator-row-header{border-bottom:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{color:#fff}.tabulator-row.tabulator-group{background:#fafafa}.tabulator-row.tabulator-group span{color:#666}.tabulator-menu{background:#fff}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#f9fafb}}.tabulator-edit-select-list{background:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}@media (hover:hover) and (pointer:fine){.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:#fff}}.tabulator-edit-select-list .tabulator-edit-select-list-notice{color:inherit}.tabulator-print-table .tabulator-print-table-group{background:#fafafa}.tabulator-print-table .tabulator-print-table-group span{color:#666} +/*# sourceMappingURL=tabulator_semanticui.min.css.map */ \ No newline at end of file diff --git a/public/css/app/tabulator-custom-css.css b/public/css/app/tabulator-custom-css.css new file mode 100644 index 00000000..23398219 --- /dev/null +++ b/public/css/app/tabulator-custom-css.css @@ -0,0 +1,211 @@ +.dark { + border: 1px solid #282828; + background-color: #111111; +} + +.dark[tabulator-layout="fitColumns"] .tabulator-header .tabulator-col:last-child { + border-right: none; +} + +.dark .tabulator-header { + background-color: #080808; +} + +.dark .tabulator-header .tabulator-calcs-holder { + border-top: 1px solid #393838; +} + +.dark .tabulator-header .tabulator-calcs-holder .tabulator-row { + background-color: #292929 !important; +} + +.dark .tabulator-header .tabulator-col { + border-right-color: #393838; + background-color: #101010; +} + +.dark .tabulator-header .tabulator-col.tabulator-row-header { + border-right: 1px solid #393838 !important; +} + +.dark .tabulator-header .tabulator-col.range-header-col { + border-right: 2px solid #3FB449; +} + + +.dark .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { + border-top-color: #393838; + border-bottom-color: #393838; +} + +.dark .tabulator-header .tabulator-col input, +.dark .tabulator-header .tabulator-col select { + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 4px 10px; + border: 1px solid #4b4b4b; + border-radius: 2px; + background: #1f1f1f; + color: #fff; + outline: none; +} + +.dark .tabulator-header .tabulator-col input:focus, +.dark .tabulator-header .tabulator-col select:focus { + border-color: #3FB449; +} + +.dark .tabulator-header .tabulator-col input+input { + margin-left: 5px; +} + +.dark .tabulator-header .tabulator-cell { + color: #ccc !important; +} + +.dark .tabulator-tableholder::-webkit-scrollbar { + width: 12px; + /* width of the entire scrollbar */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-track { + background: #333; + /* color of the tracking area */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-thumb { + background-color: #666; + /* color of the scroll thumb */ + border-radius: 20px; + /* roundness of the scroll thumb */ + border: 3px solid #333; + /* creates padding around scroll thumb */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-corner { + background: #222; +} + +.dark .tabulator-tableholder .tabulator-table { + color: #fff; + background-color: #111111; +} + +.dark .tabulator-row { + background-color: #151515; +} + +.dark .tabulator-row.tabulator-row-even { + background-color: #202020; +} + +.dark .tabulator-row.tabulator-selectable:hover { + background-color: #000; +} + +.dark .tabulator-row.tabulator-selected { + background-color: #009136; +} + +.dark .tabulator-row.tabulator-selected:hover { + background-color: #00531f; +} + +.dark .tabulator-row.tabulator-group { + border-right-color: #393838; +} + +.dark .tabulator-row .tabulator-cell { + border-right-color: #393838; +} + +.dark .tabulator-row .tabulator-cell.tabulator-editing { + border: 1px solid #3FB449; +} + +.dark .tabulator-row .tabulator-cell input, +.dark .tabulator-row .tabulator-cell select, +.dark .tabulator-row .tabulator-cell textarea { + background-color: #121212; + color: #ccc; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control { + height: 14px; + width: 14px; + border: 2px solid #3FB449 !important; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { + position: absolute; + content: ""; + left: -3px; + top: 2px; + height: 2px; + width: 6px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { + height: 8px; + width: 2px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { + position: absolute; + content: ""; + left: -3px; + top: 3px; + height: 2px; + width: 8px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-branch { + border-left: 2px solid #3FB449; + border-bottom: 2px solid #3FB449; +} + +.dark .tabulator-row .tabulator-responsive-collapse { + border-top: 1px solid #393838; + border-bottom: 1px solid #393838; +} + +.dark .tabulator-footer { + background-color: #101010; +} + +.dark .tabulator-footer .tabulator-calcs-holder { + border-bottom: 1px solid #393838; +} + +.dark .tabulator-footer .tabulator-calcs-holder .tabulator-row { + background-color: #292929 !important; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs { + margin-bottom: -2px; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab { + padding: 4px 10px; + border-width: 0 1px 1px 1px; + background-color: #000; + color: #ececec; + font-weight: normal; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active { + font-weight: bold; +} + +.dark .tabulator-footer .tabulator-page, +.dark .tabulator-footer .tabulator-page-size { + background: #ebebeb; +} + +.dark .tabulator-popup, +.dark .tabulator-tooltip { + color: #000; +} \ No newline at end of file diff --git a/public/css/app/tabulator-stylesheet.css b/public/css/app/tabulator-stylesheet.css deleted file mode 100644 index 474c2c1c..00000000 --- a/public/css/app/tabulator-stylesheet.css +++ /dev/null @@ -1,2 +0,0 @@ -.tabulator{background-color:#888;border:1px solid #999;font-size:14px;overflow:hidden;position:relative;text-align:left;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-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,.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){user-select:none}.tabulator .tabulator-header{background-color:#e6e6e6;border-bottom:1px solid #999;box-sizing:border-box;color:#555;font-weight:700;outline:none;overflow:hidden;position:relative;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap;width:100%}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{background:#e6e6e6;border-right:1px solid #aaa;box-sizing:border-box;display:inline-flex;flex-direction:column;justify-content:flex-start;overflow:hidden;position:relative;text-align:left;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col.tabulator-moving{background:#cdcdcd;border:1px solid #999;pointer-events:none;position:absolute}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#d6d6d6;color:#000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;padding:4px;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{text-overflow:clip;white-space:normal}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{background:#fff;border:1px solid #999;box-sizing:border-box;padding:1px;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{align-items:center;bottom:0;display:flex;position:absolute;right:4px;top:0}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-left:6px solid transparent;border-right:6px solid transparent;height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #aaa;display:flex;margin-right:-1px;overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{box-sizing:border-box;margin-top:2px;position:relative;text-align:center;width:100%}.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{height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:#cdcdcd;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #666;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-top:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{align-items:center;display:flex;justify-content:center;text-orientation:mixed;writing-mode:vertical-rl}.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-bottom:20px;padding-right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{bottom:auto;justify-content:center;left:0;right:0;top:4px}.tabulator .tabulator-header .tabulator-frozen{left:0;position:sticky;z-index:11}.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{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;display:inline-block}.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{display:inline-block}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{-webkit-overflow-scrolling:touch;overflow:auto;position:relative;white-space:nowrap;width:100%}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{color:#ccc;display:inline-block;font-size:20px;font-weight:700;padding:10px;text-align:center;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{background-color:#fff;color:#333;display:inline-block;overflow:visible;position:relative;white-space:nowrap}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{background:#e2e2e2!important;font-weight:700}.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-tableholder .tabulator-range-overlay{inset:0;pointer-events:none;position:absolute;z-index:10}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{border:1px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;position:absolute;right:-3px;width:6px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{border:2px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-footer{background-color:#e6e6e6;border-top:1px solid #999;color:#555;font-weight:700;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap}.tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:-5px;overflow-x:auto}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab{border:1px solid #999;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:none;display:inline-block;font-size:.9em;padding:5px}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab:hover{cursor:pointer;opacity:.7}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{background:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;overflow:hidden;text-align:left;width:100%}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important;display:inline-block}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{border-bottom:none;margin-bottom:-5px}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{color:#555;flex:1;font-family:inherit;font-size:inherit;font-weight:inherit;text-align:right}.tabulator .tabulator-footer .tabulator-page-size{border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 5px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{background:hsla(0,0%,100%,.2);border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 2px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{background:rgba(0,0,0,.2);color:#fff;cursor:pointer}}.tabulator .tabulator-col-resize-handle{display:inline-block;margin-left:-3px;margin-right:-3px;position:relative;vertical-align:middle;width:6px;z-index:11}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{margin-right:0;width:3px}.tabulator .tabulator-col-resize-guide{background-color:#999;height:100%;margin-left:-.5px;opacity:.5;position:absolute;top:0;width:4px}.tabulator .tabulator-row-resize-guide{background-color:#999;height:4px;left:0;margin-top:-.5px;opacity:.5;position:absolute;width:100%}.tabulator .tabulator-alert{align-items:center;background:rgba(0,0,0,.4);display:flex;height:100%;left:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.tabulator .tabulator-alert .tabulator-alert-msg{background:#fff;border-radius:10px;display:inline-block;font-size:16px;font-weight:700;margin:0 auto;padding:10px 20px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{background-color:#fff;box-sizing:border-box;min-height:22px;position:relative}.tabulator-row.tabulator-row-even{background-color:#efefef}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9abcea}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}}.tabulator-row.tabulator-row-moving{background:#fff;border:1px solid #000}.tabulator-row.tabulator-moving{border-bottom:1px solid #aaa;border-top:1px solid #aaa;pointer-events:none;position:absolute;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#d6d6d6;color:#000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header,.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#fff}.tabulator-row .tabulator-row-resize-handle{bottom:0;height:5px;left:0;position:absolute;right:0}.tabulator-row .tabulator-row-resize-handle.prev{bottom:auto;top:0}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;padding:5px}.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{border-right:1px solid #aaa;box-sizing:border-box;display:inline-block;outline:none;overflow:hidden;padding:4px;position:relative;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.tabulator-row .tabulator-cell.tabulator-row-header{background:#e6e6e6;border-bottom:1px solid #aaa;border-right:1px solid #999}.tabulator-row .tabulator-cell.tabulator-frozen{background-color:inherit;display:inline-block;left:0;position:sticky;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{background:transparent;border:1px;outline:none}.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{background:transparent;border:1px;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{align-items:center;display:inline-flex;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{background:#666;height:3px;margin-top:2px;width:100%}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9abcea}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{align-items:center;background:#666;border-radius:20px;color:#fff;display:inline-flex;font-size:1.1em;font-weight:700;height:15px;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;width:15px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{cursor:pointer;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 svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{border-radius:14px;display:inline-block;height:14px;width:14px}.tabulator-row.tabulator-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.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{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-row.tabulator-group span{color:#d00;margin-left:10px}.tabulator-toggle{background:#dcdcdc;border:1px solid #ccc;box-sizing:border-box;display:flex;flex-direction:row}.tabulator-toggle.tabulator-toggle-on{background:#1c6cc2}.tabulator-toggle .tabulator-toggle-switch{background:#fff;border:1px solid #ccc;box-sizing:border-box}.tabulator-popup-container{-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);box-sizing:border-box;display:inline-block;font-size:14px;overflow-y:auto;position:absolute;z-index:10000}.tabulator-popup{border-radius:3px;padding:5px}.tabulator-tooltip{border-radius:2px;box-shadow:none;font-size:12px;max-width:Min(500px,100%);padding:3px 5px;pointer-events:none}.tabulator-menu .tabulator-menu-item{box-sizing:border-box;padding:5px 10px;position:relative;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#efefef;cursor:pointer}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{border-color:#aaa;border-style:solid;border-width:1px 1px 0 0;content:"";display:inline-block;height:7px;position:absolute;right:10px;top:calc(5px + .4em);transform:rotate(45deg);vertical-align:top;width:7px}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{-webkit-overflow-scrolling:touch;font-size:14px;max-height:200px;overflow-y:auto}.tabulator-edit-list .tabulator-edit-list-item{color:#333;outline:none;padding:4px}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd;color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}@media (hover:hover) and (pointer:fine){.tabulator-edit-list .tabulator-edit-list-item:hover{background:#1d68cd;color:#fff;cursor:pointer}}.tabulator-edit-list .tabulator-edit-list-placeholder{color:#333;padding:4px;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;color:#333;font-weight:700;padding:6px 4px 4px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{direction:rtl;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-left:-1px;margin-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-left:25px;padding-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;left:-3px;position:absolute;right:auto;width:6px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa;margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{margin-left:0;margin-right:-3px;width:3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{bottom:0;left:0;position:absolute;right:0;top: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{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-print-table .tabulator-print-table-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-print-table-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.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{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-print-table .tabulator-print-table-group span{color:#d00;margin-left:10px}.tabulator-print-table .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px} -/*# sourceMappingURL=tabulator.min.css.map */ \ No newline at end of file diff --git a/public/js/app/tabulator-js.js b/public/js/app/tabulator-js.js new file mode 100644 index 00000000..b4e39776 --- /dev/null +++ b/public/js/app/tabulator-js.js @@ -0,0 +1,3 @@ +/* Tabulator v6.3.1 (c) Oliver Folkerd 2025 */ +class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s,o=e?t.split(e):[t],n=o.length;for(let e=0;ee.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}let i=class i extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight;break;case"left":o=r.left,n=r.top-1;break;case"top":o=r.left,n=r.top;break;case"center":o=r.left+e.offsetWidth/2,n=r.top+e.offsetHeight/2}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(e=>{e.stopPropagation()}))),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0);let r=Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0);if(t+this.element.offsetHeight>r)if(i)if("bottom"===o)this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px";else this.element.style.height=r+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new i(this.table,e,this),this.childPopup}};class s extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((e=>e.handler===this._handler)))>-1&&(i=t),e&&(i+=e),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new i(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var o={rownum:function(e,t,i,s,o,n){return n.getPosition()}};class n extends s{static moduleName="accessor";static accessors=o;constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":n.accessors[e]?t=n.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,i){var s="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),o=e.getComponent(),n=t.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var t,r,a,l;e.modules.accessor&&(r=e.modules.accessor[s]||e.modules.accessor.accessor||!1)&&"undefined"!=(t=e.getFieldValue(n))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(t,n,i,l,o):r.params,e.setFieldValue(n,r.accessor(t,n,i,a,l,o)))})),n}}var r={method:"GET"};function a(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(a(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(a(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function l(e){var t=a(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function h(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+l(i))),e}function d(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))}function c(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(c(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(c(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var u={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=c(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class m extends s{static moduleName="ajax";static defaultConfig=r;static defaultURLGenerator=h;static defaultLoaderPromise=d;static contentTypeFormatters=u;constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=m.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||m.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||m.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(Object.assign({},o),s)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},m.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}var p={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},g={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}},b={keybindings:{bindings:{copyToClipboard:["ctrl + 67","meta + 67"]},actions:{copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}}}};class f extends s{static moduleName="clipboard";static moduleExtensions=b;static pasteActions=p;static pasteParsers=g;constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),t=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=f.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=f.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPasteOrigin(e){var t=!0;return!this.confirm("clipboard-paste",[e])&&["DIV","SPAN"].includes(e.target.tagName)||(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}class v{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class w{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class C extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&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:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new w(this)),this.component}}class E{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var y={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class R extends e{static defaultOptionList=y;constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new R(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(R.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===R.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(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}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("mousedown",(e=>{e.stopPropagation()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(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":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(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((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e{t.push(e),t=t.concat(e.getColumns(!0))})):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach((function(e){t.push(e.getDefinition(!0))})),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach((function(t){t.visible&&(e=!0)})),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.show()})),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.hide()})),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;e?this.setWidth(i):(this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i))}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new E(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof R&&this.parent.getComponent()}}class x{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class T extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach((e=>{e.cellRendered()}))}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),this.height=e?Math.max(t,i):this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach((function(t){var i=t.getHeight();i>e&&(e=i)})),e}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var i,s=this.element&&t.elVisible(this.element),o={};return new Promise(((t,n)=>{"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(o=Object.assign(o,this.data),o=Object.assign(o,e)),i=this.chain("row-data-changing",[this,o,e],null,e);for(let e in i)this.data[e]=i[e];this.dispatch("row-data-save-after",this);for(let t in e){this.table.columnManager.getColumnsByFieldRoot(t).forEach((e=>{let t=this.getCell(e.getField());if(t){let o=e.getFieldValue(i);t.getValue()!==o&&(t.setValueProcessData(o),s&&t.cellRendered())}}))}s?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,s,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),t()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||0!==this.cells.length||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||0!==this.cells.length||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{e(this.position)})))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new x(this)),this.component}}var M={avg:function(e,t,i){var s=0,o=void 0!==i.precision?i.precision:2;return e.length&&(s=e.reduce((function(e,t){return Number(e)+Number(t)})),s/=e.length,s=!1!==o?s.toFixed(o):s),parseFloat(s).toString()},max:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>s||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))(e||0===t)&&e.indexOf(t)===i)).length}};class k extends s{static moduleName="columnCalcs";static calculations=M;constructor(e){super(e),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.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new R({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?("table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs||this.recalcActiveRows(),"table"!=this.table.options.columnCalcs&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":k.calculations[t.topCalc]?i.topCalc=k.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":k.calculations[t.bottomCalc]?i.botCalc=k.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){(this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalcActiveRows(),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs&&this.table.modules.groupRows.getChildGroups().forEach((e=>{this.recalcGroup(e)})))}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach((e=>{t.push(e.getData()),i&&e.modules.dataTree?.open&&this.rowsToData(s.getFilteredTreeChildren(e)).forEach((i=>{t.push(e)}))})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new T(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new v(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var o=new C(this.genColumn,i);o.getElement(),o.column=s,o.setWidth(),s.cells.push(o),t.push(o),s.visible||o.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}}class L extends s{static moduleName="dataTree";constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&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:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).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,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof T&&(e.create(),(s=e.modules.dataTree).index||!1===s.children||this.getChildren(e,!1,!0).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t,i){var s=e.modules.dataTree,o=[],n=[];return!1!==s.children&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),o=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(s.children):s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(o,i),o.forEach((e=>{n.push(e),this.getChildren(e,!1,!0).forEach((e=>{n.push(e)}))}))),n}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new T(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof T&&i.push(e)}))),i}rowDeleting(e){var t=e.modules.dataTree;t&&t.children&&Array.isArray(t.children)&&t.children.forEach((e=>{e instanceof T&&e.wipe()}))}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!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!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof T?i=e.data:e instanceof x?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof T&&t.element===e)))&&(i=i.data):null===e&&(i=!1):i=void 0!==e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof T&&(o.push(t?e.getComponent():e),i&&this.getTreeChildren(e,t,i).forEach((e=>{o.push(e)})))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}var S={csv:function(e,t={},i){var s=t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((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(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((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((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const 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((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t={},i){var s,o,n=[],r=[],a={},l=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},d=t.jsPDF||{},c=t.title?t.title:"";function u(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}d.orientation||(d.orientation=t.orientation||"landscape"),d.unit||(d.unit="pt"),e.forEach((e=>{switch(e.type){case"header":n.push(u(e));break;case"group":r.push(u(e,l));break;case"calc":r.push(u(e,h));break;case"row":r.push(u(e))}})),s=this.dependencyRegistry.lookup("jspdf","jsPDF"),o=new s(d),t.autoTable&&(a="function"==typeof t.autoTable?t.autoTable(o)||{}:t.autoTable),c&&(a.didDrawPage=function(e){o.text(c,40,30)}),a.head=n,a.body=r,o.autoTable(a),t.documentProcessing&&t.documentProcessing(o),i(o.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=this.dependencyRegistry.lookup("XLSX"),r=n.utils.book_new(),a=new e(this),l=!("compress"in i)||i.compress,h=i.writeOptions||{bookType:"xlsx",bookSST:!0,compression:l};function d(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),n.utils.sheet_add_aoa(s,e),s["!ref"]=n.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(h.type="binary",r.SheetNames=[],r.Sheets={},i.sheetOnly)s(d());else{if(i.sheets)for(var c in i.sheets)!0===i.sheets[c]?(r.SheetNames.push(c),r.Sheets[c]=d()):(r.SheetNames.push(c),a.commsSend(i.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){r.Sheets[c]=e}}));else r.SheetNames.push(o),r.Sheets[o]=d();i.documentProcessing&&(r=i.documentProcessing(r)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(n.write(r,h)),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}};class D extends s{static moduleName="download";static downloaders=S;constructor(e){super(e),this.registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:D.downloaders[e]?n=D.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=this.table.options.downloadEncoder(e,t);r&&(o?window.open(window.URL.createObjectURL(r)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){if("intercept"===t)this.download(i.type,"",i.options,i.active,i.intercept)}}function z(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46&&!t.ctrlKey&&!t.metaKey){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}let P=class{constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter="header"===t.getType(),this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:o},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&z(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:this._keyTab(e);break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout((()=>{this.popup&&this.popup.restoreHide()}),10)}_preventBlur(){this.blurable=!1,setTimeout((()=>{this.blurable=!0}),10)}_keyTab(e){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=h(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);this._emptyValueCheck(s)||(this.params.multiselect&&Array.isArray(s)?s.forEach((e=>{this._emptyValueCheck(e)||(i[e]=!0)})):i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_emptyValueCheck(e){return null==e||""===e}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;an?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout((()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}),10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}};var F={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){"cell"===e.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select())})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&z(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){"cell"===e.getType()&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select())})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&o.shiftEnterSubmit&&d();break;case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&z(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){"cell"===e.getType()&&(a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&z(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){"cell"===e.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%")})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},date:function(e,t,i,s,o){var n=o.format,r=o.verticalNavigation||"editor",a=n?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");function d(e){return(a.isDateTime(e)?e:"iso"===n?a.fromISO(String(e)):a.fromFormat(String(e),n)).toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.max&&h.setAttribute("max",n?d(o.max):o.max),o.min&&h.setAttribute("min",n?d(o.min):o.min),o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=h.value;if(null==l&&""!==t||t!==l){if(t&&n)switch(e=a.fromFormat(String(t),"yyyy-MM-dd"),n){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(n)}i(t)&&(l=h.value)}else s()}return l=void 0!==l?l:"",n&&(a?l=d(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,t((function(){"cell"===e.getType()&&(h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select())})),h.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==h)&&c()})),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation())}})),h},time:function(e,t,i,s,o){var n,r=o.format,a=o.verticalNavigation||"editor",l=r?window.DateTime||luxon.DateTime:null,h=e.getValue(),d=document.createElement("input");if(d.type="time",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),d.setAttribute(e,d.getAttribute(e)+o.elementAttributes["+"+e])):d.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=d.value;if(null==h&&""!==t||t!==h){if(t&&r)switch(e=l.fromFormat(String(t),"hh:mm"),r){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(r)}i(t)&&(h=d.value)}else s()}return h=void 0!==h?h:"",r&&(l?(n=l.isDateTime(h)?h:"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=n.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,t((function(){"cell"==e.getType()&&(d.focus({preventScroll:!0}),d.style.height="100%",o.selectContents&&d.select())})),d.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==d)&&c()})),d.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}})),d},datetime:function(e,t,i,s,o){var n,r=o.format,a=o.verticalNavigation||"editor",l=r?this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"):null,h=e.getValue(),d=document.createElement("input");if(d.type="datetime-local",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),d.setAttribute(e,d.getAttribute(e)+o.elementAttributes["+"+e])):d.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=d.value;if(null==h&&""!==t||t!==h){if(t&&r)switch(e=l.fromISO(String(t)),r){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(r)}i(t)&&(h=d.value)}else s()}return h=void 0!==h?h:"",r&&(l?(n=l.isDateTime(h)?h:"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=n.toFormat("yyyy-MM-dd")+"T"+n.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,t((function(){"cell"===e.getType()&&(d.focus({preventScroll:!0}),d.style.height="100%",o.selectContents&&d.select())})),d.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==d)&&c()})),d.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}})),d},list:function(e,t,i,s,o){return new P(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(e){d.forEach((function(t,i){i'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function p(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,m(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)p(b);return m(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){m(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),m=document.createElement("div");function p(){var e=window.getComputedStyle(a,null),t=d*Math.round(m.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.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%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),m.setAttribute(e,m.getAttribute(e)+o.elementAttributes["+"+e])):m.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),m.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=m.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(m.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,p())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),m},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return d&&t?t=o.trueValue:c&&!t&&(t=o.falseValue),a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&t((function(){"cell"===e.getType()&&r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r},adaptable:function(e,t,i,s,o){var n,r,a=e._getSelf().column;return n=o.editorLookup?o.editorLookup(e):function(e){var t=e.getValue(),i="input";switch(typeof t){case"number":i="number";break;case"boolean":i="tickCross";break;case"string":t.includes("\n")&&(i="textarea")}return i}(e),o.paramsLookup&&(r="function"==typeof o.paramsLookup?o.paramsLookup(n,e):o.paramsLookup[n]),this.table.modules.edit.lookupEditor(n,a).call(this,e,t,i,s,r||{})}};class H extends s{static moduleName="edit";static editors=F;constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=H.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(e){if(this.currentCell)return!0}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),this.invalidEdit||(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findPrevEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,i){var s=!1;if(i0)for(var o=i-1;o>=0;o--){let i=e.cells[o];if(i.column.modules.edit&&t.elVisible(i.getElement())){if(this.allowEdit(i)){s=i;break}}}return s}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}rowEditableCheck(e){e.getCells().forEach((e=>{e.column.modules.edit&&"function"==typeof e.column.modules.edit.check&&this.updateCellClass(e)}))}initializeColumn(e){var t=Object.keys(e.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{},convertEmptyValues:t,editorEmptyValue:e.definition.editorEmptyValue,editorEmptyValueFunc:e.definition.editorEmptyValueFunc};i.editor=this.lookupEditor(e.definition.editor,e),i.editor&&(e.modules.edit=i)}lookupEditor(e,t){var i;switch(typeof e){case"string":this.editors[e]?i=this.editors[e]:console.warn("Editor Error - No such editor found: ",e);break;case"function":i=e;break;case"boolean":!0===e&&("function"!=typeof t.definition.formatter?i=this.editors[t.definition.formatter]?this.editors[t.definition.formatter]:this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}return i}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),"dblclick"===this.options("editTriggerEvent")&&i.addEventListener("dblclick",(function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))})),"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")||i.addEventListener("click",(function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))})),"focus"===this.options("editTriggerEvent")&&i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(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,s=e.row.getElement();s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin||0),n-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeftn&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":e.row.initialized&&(t=e.column.modules.edit.check(e.getComponent()));break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check}return t}edit(e,t,i){var s,o,n,r=this,a=function(){},l=e.getElement(),h=!1;if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(l),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,s=e.column.modules.edit.editor.call(r,o,(function(e){a=e}),(function(t){if(r.currentCell===e&&!h){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(h=!0,r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),t=r.transformEmptyValues(t,e),e.setValue(t,!0),!0===i):(h=!0,r.invalidEdit=!0,r.focusCellNoEvent(e,!0),a(),setTimeout((()=>{h=!1}),10),!1)}}),(function(){r.currentCell!==e||h||r.cancelEdit()}),n),!this.currentCell||!1===s)return this.blur(l),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),this.blur(l),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),a();for(var d=l.children,c=0;c{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}class _{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class O{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}var A={},B={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};class V extends s{static moduleName="export";static columnLookups=A;static rowLookups=B;constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){var o,n,r,a;return this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),(a=V.columnLookups[i])&&(r=(r=a.call(this.table)).filter((e=>this.columnVisCheck(e)))),o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders(r)):[],r&&(r=r.map((e=>e.getComponent()))),n=this.bodyToExportRows(this.rowLookup(i),r),o.concat(n)}generateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.generateTableElement(o)}rowLookup(e){var t,i=[];return"function"==typeof e?e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&i.push(e)})):(t=V.rowLookups[e]||V.rowLookups.active,i=t.call(this.table)),Object.assign([],i)}generateColumnGroupHeaders(e){var t=[];return e||(e=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),e.forEach((e=>{var i=this.processColumnGroup(e);i&&t.push(i)})),t}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+this.colVisPropAttach]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){var t=e.definition[this.colVisProp];return(!1!==this.config.rowHeaders||!e.isRowHeader)&&("function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1===t||!0===t?t:e.visible&&e.field)}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i1)for(let i=1;ii&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new O(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new _("header",t))})),s}bodyToExportRows(e,t=[]){var i=[];return 0===t.length&&this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.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((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new O(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new O(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new _(e.type,n,e.getComponent(),r))})),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+this.colVisPropAttach],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.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(((e,t)=>{let n;switch(e.type){case"header":i.appendChild(this.generateHeaderElement(e,r,o));break;case"group":s.appendChild(this.generateGroupElement(e,r,o));break;case"calc":s.appendChild(this.generateCalcElement(e,r,o));break;case"row":n=this.generateRowElement(e,r,o),this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){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.styleRowHeader=e.firstRow.getElementsByClassName("tabulator-row-header")[0],e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&e.component._column.parent.isGroup?this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]):this.mapElementStyles(e.component.getElement(),t,["border-top"]),e.component._column.isGroup?this.mapElementStyles(e.component.getElement(),t,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),t,["border-bottom"]),s.appendChild(t)}})),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");if(s.classList.add("tabulator-print-table-row"),e.columns.forEach(((o,n)=>{if(o){var r,a,l=document.createElement("td"),h=o.component._column,d=this.table,c=d.columnManager.findColumnIndex(h),u=o.value,m={modules:{},getValue:function(){return u},getField:function(){return h.definition.field},getElement:function(){return l},getType:function(){return"cell"},getColumn:function(){return h.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getTable:function(){return d},getComponent:function(){return m},column:h};if((h.definition.cssClass?h.definition.cssClass.split(" "):[]).forEach((function(e){l.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)u=this.table.modules.format.formatExportValue(m,this.colVisProp);else switch(typeof u){case"object":u=null!==u?JSON.stringify(u):"";break;case"undefined":u=""}u instanceof Node?l.appendChild(u):l.innerHTML=u,a=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],h.isRowHeader?(r=i.styleRowHeader,a.push("background-color")):r=i.styleCells&&i.styleCells[c]?i.styleCells[c]:i.firstCell,r&&(this.mapElementStyles(r,l,a),h.definition.align&&(l.style.textAlign=h.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==h.field||!t.treeElementField&&0==n)&&(e.component._row.modules.dataTree.controlEl&&l.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),e.component._row.modules.dataTree.branchEl&&l.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),s.appendChild(l),m.modules.format&&m.modules.format.renderedCallback&&m.modules.format.renderedCallback()}})),t.rowFormatter&&"row"===e.type&&!1!==this.config.formatCells){Object.assign(e.component).getElement=function(){return s},t.rowFormatter(e.component)}return s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"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 o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]||(t.style[s[e]]=o.getPropertyValue(e))}))}}}}var I={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class N extends s{static moduleName="filter";static filters=I;constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}generatePlaceholder(e){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){e.definition.headerFilter&&this.initializeColumn(e)}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="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[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":N.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,N.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)if("partial"===n)o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";else o=function(i){return e.getFieldValue(i)==t},r="=";i.headerFilters[s]={value:t,func:o,type:r}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d,c=this,u=e.modules.filter.success,m=e.getField();if(e.modules.filter.value=t,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},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":c.table.modules.edit.editors[e.definition.headerFilter]?(o=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":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&c.table.modules.edit.editors[e.definition.formatter]?(o=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})):o=c.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(c.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(e){d=e}),u,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",n);c.langBind("headerFilters|columns|"+e.definition.field,(function(t){n.setAttribute("placeholder",void 0!==t&&t?t:e.definition.headerFilterPlaceholder||c.langText("headerFilters|default"))})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.contentsElement.scrollLeft;t!==this.table.rowManager.element.scrollLeft&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){u(n.value)}),c.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.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)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){u(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||c.headerFilterColumns.push(e),d&&d()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(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())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(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()))}reloadHeaderFilter(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()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;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||{})}:N.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return N.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return N.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}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}var W={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a,l=parseFloat(e.getValue()),h="",d=t.decimal||".",c=t.thousand||",",u=t.negativeSign||"-",m=t.symbol||"",p=!!t.symbolAfter,g=void 0!==t.precision?t.precision:2;if(isNaN(l))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(l<0&&(l=Math.abs(l),h=u),s=!1!==g?l.toFixed(g):l,o=(s=String(s).split("."))[0],n=s.length>1?d+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+c+"$2");return a=o+n,!0===h?(a="("+a+")",p?a+m:m+a):p?h+a+m:h+m+a},link:function(e,i,s){var o,n=e.getValue(),r=i.urlPrefix||"",a=i.download,l=n,h=document.createElement("a");if(i.labelField&&(o=e.getData(),l=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(i.labelField.split(this.table.options.nestedFieldSeparator),o)),i.label)switch(typeof i.label){case"string":l=i.label;break;case"function":l=i.label(e)}if(l){if(i.urlField&&(o=e.getData(),n=t.retrieveNestedData(this.table.options.nestedFieldSeparator,i.urlField,o)),i.url)switch(typeof i.url){case"string":n=i.url;break;case"function":n=i.url(e)}return h.setAttribute("href",r+n),i.target&&h.setAttribute("target",i.target),i.download&&(a="function"==typeof a?a(e):!0===a?"":a,h.setAttribute("download",a)),h.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),h}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',h=void 0!==t.crossElement?t.crossElement:'';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=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",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'':'',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t={},i){var s,o,n,r,a,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),d=t.max?t.max:100,c=t.min?t.min:0,u=t.legendAlign?t.legendAlign:"center";switch(o=parseFloat(l)<=d?parseFloat(l):d,o=parseFloat(o)>=c?parseFloat(o):c,s=(d-c)/100,o=Math.round((o-c)/s),typeof t.color){case"string":n=t.color;break;case"function":n=t.color(l);break;case"object":if(Array.isArray(t.color)){let e=100/t.color.length,i=Math.floor(o/e);i=Math.min(i,t.color.length-1),i=Math.max(i,0),n=t.color[i];break}default:n="#2DC214"}switch(typeof t.legend){case"string":r=t.legend;break;case"function":r=t.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof t.legendColor){case"string":a=t.legendColor;break;case"function":a=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){let e=100/t.legendColor.length,i=Math.floor(o/e);i=Math.min(i,t.legendColor.length-1),i=Math.max(i,0),a=t.legendColor[i]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",o);var m=document.createElement("div");m.style.display="inline-block",m.style.width=o+"%",m.style.backgroundColor=n,m.style.height="100%",m.setAttribute("data-max",d),m.setAttribute("data-min",c);var p=document.createElement("div");if(p.style.position="relative",p.style.width="100%",p.style.height="100%",r){var g=document.createElement("div");g.style.position="absolute",g.style.top=0,g.style.left=0,g.style.textAlign=u,g.style.width="100%",g.style.color=a,g.innerHTML=r}return i((function(){if(!(e instanceof w)){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",h.appendChild(t),h=t}h.appendChild(p),p.appendChild(m),r&&p.appendChild(g)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},toggle:function(e,t,i){var s,o,n=e.getValue(),r=t.size||15,a=r+"px",l=!t.hasOwnProperty("onValue")||t.onValue,h=!!t.hasOwnProperty("offValue")&&t.offValue,d=t.onTruthy?n:n===l;return(s=document.createElement("div")).classList.add("tabulator-toggle"),d?(s.classList.add("tabulator-toggle-on"),s.style.flexDirection="row-reverse",t.onColor&&(s.style.background=t.onColor)):t.offColor&&(s.style.background=t.offColor),s.style.width=2.5*r+"px",s.style.borderRadius=a,t.clickable&&s.addEventListener("click",(t=>{e.setValue(d?h:l)})),(o=document.createElement("div")).classList.add("tabulator-toggle-switch"),o.style.height=a,o.style.width=a,o.style.borderRadius=a,s.appendChild(o),s},rownum:function(e,t,i){var s=document.createElement("span"),o=e.getRow(),n=e.getTable();return o.watchPosition((e=>{t.relativeToPage&&(e+=n.modules.page.getPageSize()*(n.modules.page.getPage()-1)),s.innerText=e})),s},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},adaptable:function(e,t,i){var s,o;return s=t.formatterLookup?t.formatterLookup(e):function(e){var t=e.getValue(),i="plaintext";switch(typeof t){case"boolean":i="tickCross";break;case"string":t.includes("\n")&&(i="textarea")}return i}(e),t.paramsLookup&&(o="function"==typeof t.paramsLookup?t.paramsLookup(s,e):t.paramsLookup[s]),this.table.modules.format.lookupFormatter(s).call(this,e,o||{},i)},array:function(e,i,s){var o,n=i.delimiter||",",r=e.getValue(),a=this.table;return i.valueMap&&(o="string"==typeof i.valueMap?function(e){return e.map((e=>t.retrieveNestedData(a.options.nestedFieldSeparator,i.valueMap,e)))}:i.valueMap),Array.isArray(r)?(o&&(r=o(r)),r.join(n)):r},json:function(e,t,i){var s=t.indent||"\t",o=void 0===t.multiline||t.multiline,n=t.replacer||null,r=e.getValue();return o&&(e.getElement().style.whiteSpace="pre-wrap"),JSON.stringify(r,n,s)}};class j extends s{static moduleName="format";static formatters=W;constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupTypeFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupTypeFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupTypeFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupTypeFormatter(e,"HtmlOutput"))}lookupTypeFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];return i.formatter=this.lookupFormatter(s),i}lookupFormatter(e){var t;switch(typeof e){case"string":j.formatters[e]?t=j.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),t=j.formatters.plaintext);break;case"function":t=e;break;default:t=j.formatters.plaintext}return t}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.lookupFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return e.getComponent()},getTable:()=>this.table},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){function o(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}return i="function"==typeof s.params?s.params(e.getComponent()):s.params,s.formatter.call(this,e.getComponent(),i,o)}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}}class G extends s{static moduleName="frozenColumns";constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)})),this.layout()}initializeColumn(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")}frozenCheck(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}layoutCalcRows(){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),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),n.classList.toggle("tabulator-frozen-left",s.modules.frozen.edge&&"left"===s.modules.frozen.position),n.classList.toggle("tabulator-frozen-right",s.modules.frozen.edge&&"right"===s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.modules.frozen.marginValue=s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",t.visible&&(s+=t.getWidth()),i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){var i;t.modules.frozen&&e&&(e.style.position="sticky",i=this.table.rtl?"left"===t.modules.frozen.position?"right":"left":t.modules.frozen.position,e.style[i]=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),e.classList.toggle("tabulator-frozen-left",t.modules.frozen.edge&&"left"===t.modules.frozen.position),e.classList.toggle("tabulator-frozen-right",t.modules.frozen.edge&&"right"===t.modules.frozen.position))}adjustForScrollbar(e){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+e+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(e,t){var i=0;for(let s=0;s{this.initializeRow(e)}))}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;"number"===i?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):"function"===i?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){return this.rows.indexOf(e)>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(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.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}class J{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("group",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(e,t){return this._group.groupManager.table.rowManager.scrollToRow(this._group,e,t)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class X{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i{e.modules&&delete e.modules.group}))),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.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(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{"arrow"===this.groupManager.table.options.groupToggleElement&&(e.stopPropagation(),e.stopImmediatePropagation()),setTimeout((()=>{this.toggleVisibility()}))}))}_createGroup(e,t){var i=t+"_"+e,s=new X(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(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}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(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))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var e=[];return e.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach((function(t){e=e.concat(t.getHeadersAndRows())})):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){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()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e,t){var i=[];return t&&this.groupList.length?this.groupList.forEach((s=>{i=i.concat(s.getRows(e,t))})):this.rows.forEach((function(t){i.push(e?t.getComponent():t)})),i}generateGroupHeaderContents(){var e=[];for(this.getRows(!1,!0).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)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!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"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"("+s+" "+(1===s?e:t.groups.items)+")"})),this.groupIDLookups=[],e)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)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),!e&&this.table.modExists("columnCalcs")&&!0===this.table.options.columnCalcs&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof X&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof X?t:t.modules.group,o=e instanceof X?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.table.options.groupBy&&(this.groupList.forEach((function(e){e.wipe()})),this.groupList=[],this.groups={})}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)})),Object.values(t).forEach((e=>{e.wipe(!0)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new X(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.blockRedraw||(this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0)),t}scrollHeaders(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)})))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach(((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}}var q={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual(),this.table.rowManager.checkPlaceholder()},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),this.table.rowManager.checkPlaceholder()},rowMove:function(e){var t=e.data.posFrom-e.data.posTo>0;this.table.rowManager.moveRowActual(e.component,this.table.rowManager.getRowFromPosition(e.data.posFrom),t),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Y={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},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),this.table.rowManager.checkPlaceholder()},rowDelete:function(e){e.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.getRowFromPosition(e.data.posTo),e.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},$={keybindings:{bindings:{undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},actions:{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()))}}}};class Q extends s{static moduleName="history";static moduleExtensions=$;static undoers=q;static redoers=Y;constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return Q.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return Q.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof T)i.component===e&&(i.component=t);else if(i.component instanceof C&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}class Z extends s{static moduleName="htmlTableImport";constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?te.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t,i){var s=this.lookupImporter(e);if(s)return this.pickFile(t,i).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.mutateData.bind(this)).then(this.validateData.bind(this)).then(this.setData.bind(this)).catch((e=>(this.dispatch("import-error",e),this.dispatchExternal("importError",e),console.error("Import Error:",e||"Unable to import file"),this.table.dataLoader.alertError(),setTimeout((()=>{this.table.dataLoader.clearAlert()}),3e3),Promise.reject(e))))}pickFile(e,t){return new Promise(((i,s)=>{var o=document.createElement("input");o.type="file",o.accept=e,o.addEventListener("change",(e=>{var n=o.files[0],r=new FileReader,a=this.validateFile(n);if(!0===a){switch(this.dispatch("import-importing",o.files),this.dispatchExternal("importImporting",o.files),t||this.table.options.importReader){case"buffer":r.readAsArrayBuffer(n);break;case"binary":r.readAsBinaryString(n);break;case"url":r.readAsDataURL(n);break;default:r.readAsText(n)}r.onload=e=>{i(r.result)},r.onerror=e=>{console.warn("File Load Error - Unable to read file"),s(e)}}else s(a)})),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),o.click()}))}importData(e,t){var i;return this.table.dataLoader.alertLoader(),new Promise(((s,o)=>{setTimeout((()=>{(i=e.call(this.table,t))instanceof Promise||i?s(i):o()}),10)}))}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"import"))})):t=e,t}transformHeader(e){var t=[];return this.table.options.importHeaderTransform?(e.forEach((i=>{t.push(this.table.options.importHeaderTransform.call(this.table,i,e))})),t):e}transformData(e){var t=[];return this.table.options.importValueTransform?(e.forEach((i=>{t.push(this.table.options.importValueTransform.call(this.table,i,e))})),t):e}structureArrayToObject(e){var t=this.transformHeader(e.shift());return e.map((e=>{var i={};return e=this.transformData(e),t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.transformHeader(e[0]),s=this.table.getColumns();return s[0]&&i[0]&&s[0].getDefinition().title===i[0]&&e.shift(),e.forEach((e=>{var i={};(e=this.transformData(e)).forEach(((e,t)=>{var o=s[t];o&&(i[o.getField()]=e)})),t.push(i)})),t}validateFile(e){return!this.table.options.importFileValidator||this.table.options.importFileValidator.call(this.table,e)}validateData(e){var t;return this.table.options.importDataValidator?!0===(t=this.table.options.importDataValidator.call(this.table,e))?e:Promise.reject(t):e}setData(e){return this.dispatch("import-imported",e),this.dispatchExternal("importImported",e),this.table.dataLoader.clearAlert(),this.table.setData(e)}}class ie extends s{static moduleName="interaction";constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){Object.values(this.touchWatchers).forEach((e=>{for(let t in e)e[t]=null}))}cellContentsSelectionFixer(e,t){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==t){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(t.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,o=i.getComponent();this.columnSubscribers[e]&&(i instanceof C?s=i.column.definition[e]:i instanceof R&&(s=i.definition[e]),s&&s(t,o)),this.dispatchExternal(e,t,o)}}var se={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},oe={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i: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){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)}};class ne extends s{static moduleName="keybindings";static bindings=se;static actions=oe;constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,ne.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)ne.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:ne.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}class re extends s{static moduleName="menu";constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),t.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup&&this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,n),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatch("menu-opened",i,n),this.dispatchExternal("menuOpened",t.getComponent()))}}}class ae extends s{static moduleName="moveColumn";constructor(e){super(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),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(e){var i,s=this,o={};e.modules.frozen||e.isGroup||e.isRowHeader||(i=e.getElement(),o.mousemove=function(o){e.parent===s.moving.parent&&((s.touchMove?o.touches[0].pageX:o.pageX)-t.elOffset(i).left+s.table.columnManager.contentsElement.scrollLeft>e.getWidth()/2?s.toCol===e&&s.toColAfter||(i.parentNode.insertBefore(s.placeholderElement,i.nextSibling),s.moveColumn(e,!0)):(s.toCol!==e||s.toColAfter)&&(i.parentNode.insertBefore(s.placeholderElement,i),s.moveColumn(e,!1)))}.bind(s),i.addEventListener("mousedown",(function(t){s.touchMove=!1,1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),s.bindTouchEvents(e)),e.modules.moveColumn=o}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,i){var s=i.getElement(),o=this.table.columnManager.getContentsElement(),n=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&"column"===this.table.modules.selectRange.selecting||(this.moving=i,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=i.getWidth()+"px",this.placeholderElement.style.height=i.getHeight()+"px",s.parentNode.insertBefore(this.placeholderElement,s),s.parentNode.removeChild(s),this.hoverElement=s.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),o.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=o.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e),this.dispatch("column-moving",e,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(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)))}moveHover(e){var i,s=this.table.columnManager.getContentsElement(),o=s.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left+o;this.hoverElement.style.left=n-this.startX+"px",n-o{i=Math.max(0,o-5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1))),o+s.clientWidth-n{i=Math.min(s.clientWidth,o+5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1)))}}var le={delete:function(e,t,i){e.delete()}},he={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}};class de extends s{static moduleName="moveRow";static senders=le;static receivers=he;constructor(e){super(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,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var i=this,s={};s.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),s.mousemove=function(s){var o;s.pageY-t.elOffset(e.element).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||((o=e.getElement()).parentNode.insertBefore(i.placeholderElement,o.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(o=e.getElement()).previousSibling&&(o.parentNode.insertBefore(i.placeholderElement,o),i.moveRow(e,!1))}.bind(i),e.modules.moveRow=s}initializeRow(e){var i,s=this,o={};o.mouseup=function(t){s.tableRowDrop(t,e)}.bind(s),o.mousemove=function(i){var o=e.getElement();i.pageY-t.elOffset(o).top+s.table.rowManager.element.scrollTop>e.getHeight()/2?s.toRow===e&&s.toRowAfter||(o.parentNode.insertBefore(s.placeholderElement,o.nextSibling),s.moveRow(e,!0)):(s.toRow!==e||s.toRowAfter)&&(o.parentNode.insertBefore(s.placeholderElement,o),s.moveRow(e,!1))}.bind(s),this.hasHandle||((i=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=o}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=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)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.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.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(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.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),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()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(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"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){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"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=de.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=de.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.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),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}var ce={};class ue extends s{static moduleName="mutator";static mutators=ce;constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard","import"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutatorImport"),this.registerColumnOption("mutatorImportParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":ue.mutators[e]?t=ue.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),("data"==t&&!i||void 0!==s)&&(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}var me={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class pe extends s{static moduleName="page";static pageCounters=me;constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("paginationOutOfRange",!1),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){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")).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"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:pe.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1,this.trackChanges())}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){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(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t,i;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()}))}return!1}if(this.page>this.max&&(console.warn("Remote Pagination Error - Server returned last page value lower than the current page"),i=this.options("paginationOutOfRange")))return this.setPage("function"==typeof i?i.call(this,this.page,this.max):i);this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}var ge={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&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},be={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()}};class fe extends s{static moduleName="persistence";static moduleInitOrder=-10;static readers=ge;static writers=be;constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){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:fe.readers[this.table.options.persistenceReaderFunc]?this.readFunc=fe.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):fe.readers[this.mode]?this.readFunc=fe.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:fe.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=fe.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):fe.writers[this.mode]?this.writeFunc=fe.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,headerFilter:!0===this.table.options.persistence||this.table.options.persistence.headerFilter,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.retrieveData("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.retrieveData("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)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t,i;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t),this.config.headerFilter&&!1==!(i=this.load("headerFilter"))&&(this.table.options.initialHeaderFilter=i)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e,!0)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:e=>{s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:()=>(i.get&&i.get(),s)})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t,i){var s=[];return(t=t||[]).forEach(((t,o)=>{var n,r=this._findColumn(e,t);r&&(i?n=Object.keys(t):!0===this.config.columns||null==this.config.columns?(n=Object.keys(r)).push("width"):n=this.config.columns,n.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(r[e]=t[e])})),r.columns&&(r.columns=this.mergeDefinition(r.columns,t.columns)),s.push(r))})),e.forEach(((e,i)=>{this._findColumn(t,e)||(s.length>i?s.splice(i,0,e):s.push(e))})),s}_findColumn(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}}))}save(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"headerFilter":t=this.table.modules.filter.getHeaderFilters();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)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){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}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}class ve extends s{static moduleName="popup";constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(e,t,i){this.loadPopupEvent(t,null,e,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),t.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i,s){var o;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){o=e})):e,this.loadPopup(t,i,e,o,s)}loadPopup(e,t,i,s,o){var n,r,a=!(e instanceof MouseEvent);i instanceof HTMLElement?n=i:(n=document.createElement("div")).innerHTML=i,n.classList.add("tabulator-popup"),n.addEventListener("click",(e=>{e.stopPropagation()})),a||e.preventDefault(),r=this.popup(n),"function"==typeof s&&r.renderCallback(s),e?r.show(e):r.show(t.getElement(),o||"center"),r.hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}class we extends s{static moduleName="print";constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(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))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"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"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),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,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}class Ce extends s{static moduleName="reactiveData";constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),s=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),s=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o,n=Array.from(arguments),r=n[0]<0?e.length+n[0]:n[0],a=n[1],l=!!n[2]&&n.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((s=!!e[r]&&i.table.rowManager.getRowFromDataObject(e[r]))?l.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(l=l.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==a){var h=e.slice(r,void 0===n[1]?n[1]:r+a);h.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==h.length-1)}))}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}unwatchData(){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})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var o=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return o}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var o=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return o}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var o=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return o}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var o=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return o}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var o=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return o}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,o=Object.getOwnPropertyDescriptor(t,i),n=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(n=t,!s.blocked&&r===s.currentVersion){s.block("key");var a={};a[i]=t,e.updateData(a),s.unblock("key")}o.set&&o.set(t)},get:()=>(o.get&&o.get(),n)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}class Ee extends s{static moduleName="resizeColumns";constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}frozenColumnOffset(e){var t=!1;return e.modules.frozen&&(t=e.modules.frozen.marginValue,"left"===e.modules.frozen.position?t+=e.getWidth()-3:t&&(t-=3)),!1!==t&&t+"px"}reinitializeColumn(e){var t=this.frozenColumnOffset(e);e.cells.forEach((i=>{i.modules.resize&&i.modules.resize.handleEl&&(t&&(i.modules.resize.handleEl.style[e.modules.frozen.position]=t,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style[e.modules.frozen.position]=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.dispatchExternal("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="sticky",l.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}resize(e,t){var i,s,o=void 0===e.clientX?e.touches[0].clientX:e.clientX,n=o-this.startX,r=o-this.latestX;if(this.latestX=o,this.table.rtl&&(n=-n,r=-r),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(this.startWidth+n),s=t.width==t.minWidth||t.width==t.maxWidth,r<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&(!i||!s)){let e=this.nextColumn.getWidth();r>0&&e<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-r)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}calcGuidePosition(e,t,i){var s=void 0===e.clientX?e.touches[0].clientX:e.clientX,o=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,n=this.table.element.getBoundingClientRect().x,r=t.element.getBoundingClientRect().left-n,a=s-this.startX,l=Math.max(o+a,r+t.minWidth);return t.maxWidth&&(l=Math.min(l,r+t.maxWidth)),l}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s,o=this;function n(e){o.table.options.resizableColumnGuide?s.style.left=o.calcGuidePosition(e,t,i)+"px":o.resize(e,t)}function r(e){o.table.options.resizableColumnGuide&&(o.resize(e,t),s.remove()),o.startColumn.modules.edit&&(o.startColumn.modules.edit.blocked=!1),o.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",n),i.removeEventListener("touchmove",n),i.removeEventListener("touchend",r),o.table.element.classList.remove("tabulator-block-select"),o.startWidth!==t.getWidth()&&(o.table.columnManager.verticalAlignHeaders(),o.dispatch("column-resized",t),o.dispatchExternal("columnResized",t.getComponent()))}this.dispatchExternal("columnResizing",t.getComponent()),o.table.options.resizableColumnGuide&&((s=document.createElement("span")).classList.add("tabulator-col-resize-guide"),o.table.element.appendChild(s),setTimeout((()=>{s.style.left=o.calcGuidePosition(e,t,i)+"px"}))),o.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),o.startColumn.modules.edit&&(o.startColumn.modules.edit.blocked=!0),o.startX=void 0===e.clientX?e.touches[0].clientX:e.clientX,o.latestX=o.startX,o.startWidth=t.getWidth(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",n,{passive:!0}),i.addEventListener("touchend",r)}}class ye extends s{static moduleName="resizeRows";constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}resize(e,t){t.setHeight(this.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-this.startY))}calcGuidePosition(e,t,i){var s=void 0===e.screenY?e.touches[0].screenY:e.screenY,o=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,n=this.table.element.getBoundingClientRect().y,r=t.element.getBoundingClientRect().top-n,a=s-this.startY;return Math.max(o+a,r)}_mouseDown(e,t,i){var s,o=this;function n(e){o.table.options.resizableRowGuide?s.style.top=o.calcGuidePosition(e,t,i)+"px":o.resize(e,t)}function r(e){o.table.options.resizableRowGuide&&(o.resize(e,t),s.remove()),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",n),i.removeEventListener("touchmove",n),i.removeEventListener("touchend",r),o.table.element.classList.remove("tabulator-block-select"),o.dispatchExternal("rowResized",t.getComponent())}o.dispatchExternal("rowResizing",t.getComponent()),o.table.options.resizableRowGuide&&((s=document.createElement("span")).classList.add("tabulator-row-resize-guide"),o.table.element.appendChild(s),setTimeout((()=>{s.style.top=o.calcGuidePosition(e,t,i)+"px"}))),o.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),o.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,o.startHeight=t.getHeight(),document.body.addEventListener("mousemove",n),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",n,{passive:!0}),i.addEventListener("touchend",r)}}class Re extends s{static moduleName="resizeTable";constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.redrawTable())}})),this.resizeObserver.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),this.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell))&&(t.columnManager.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver((e=>{this.visible=e[0].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)})),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}var xe={format:{formatters:{responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML='\n \n \n\n\n\n \n',e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(t){t.stopImmediatePropagation(),n(!o.open),e.getTable().rowManager.adjustTableSize()})),n(o.open),s}}}};class Te extends s{static moduleName="responsiveLayout";static moduleExtensions=xe;constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(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())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=!0;e;){let t="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-t;if(i<0){let t=this.columns[this.index];t?(this.hideColumn(t),this.index++):e=!1}else{let t=this.columns[this.index-1];t&&i>0&&i>=t.getWidth()?(this.showColumn(t),this.index--):e=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){this.table.rowManager.getDisplayRows().forEach((e=>{this.generateCollapsedRowContent(e)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i),e.calcHeight(!0)}}generateCollapsedRowData(e){var t,i=e.getData(),s=[];return this.hiddenColumns.forEach((o=>{var n=o.getFieldValue(i);if(o.definition.title&&o.field)if(o.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){function r(e){e()}t={value:!1,data:{},getValue:function(){return n},getData:function(){return i},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return o.getComponent()},getTable:()=>this.table},s.push({field:o.field,title:o.definition.title,value:o.modules.format.formatter.call(this.table.modules.format,t,o.modules.format.params,r)})}else s.push({field:o.field,title:o.definition.title,value:n})})),s}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((e=>{var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.modules.localize.bind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)})),Object.keys(e).length?t:""}}var Me={format:{formatters:{rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof x?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRowsRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRowsRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}}}};class ke extends s{static moduleName="selectRow";static moduleExtensions=Me;constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),"highlight"===this.table.options.selectableRows&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),!1!==this.table.options.selectableRows&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){var t=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t&&!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=t.checkRowSelectability(e),s=e.getElement(),o=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",o)};e.modules.select={selected:!1},s.classList.toggle("tabulator-selectable",i),s.classList.toggle("tabulator-unselectable",!i),t.checkRowSelectability(e)&&t.table.options.selectableRows&&"highlight"!=t.table.options.selectableRows&&("click"===t.table.options.selectableRowsRangeMode?s.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(s.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),s.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",o),document.body.addEventListener("keyup",o),t.toggleRow(e),!1})),s.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),s.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectableRows||this.isRowSelected(e)||this.selectedRows.lengththis.table.options.selectableRows&&(r=r.slice(0,this.table.options.selectableRows)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}checkRowSelectability(e){return!(!e||"row"!==e.type)&&this.table.options.selectableRowsCheck.call(this.table,e.getComponent())}toggleRow(e){this.checkRowSelectability(e)&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t,i,s=[];switch(typeof e){case"undefined":t=this.table.rowManager.rows;break;case"number":t=this.table.rowManager.findRow(e);break;case"string":(t=this.table.rowManager.findRow(e))||(t=this.table.rowManager.getRows(e));break;default:t=e}Array.isArray(t)?t.length&&(t.forEach((e=>{(i=this._selectRow(e,!0,!0))&&s.push(i)})),this._rowSelectionChanged(!1,s)):t&&this._selectRow(t,!1,!0)}_selectRow(e,t,i){if(!isNaN(this.table.options.selectableRows)&&!0!==this.table.options.selectableRows&&!i&&this.selectedRows.length>=this.table.options.selectableRows){if(!this.table.options.selectableRowsRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);if(s){if(-1==this.selectedRows.indexOf(s))return s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t,s),s}else t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s,o=[];switch(typeof e){case"undefined":i=Object.assign([],this.selectedRows);break;case"number":i=this.table.rowManager.findRow(e);break;case"string":(i=this.table.rowManager.findRow(e))||(i=this.table.rowManager.getRows(e));break;default:i=e}Array.isArray(i)?i.length&&(i.forEach((e=>{(s=this._deselectRow(e,!0,!0))&&o.push(s)})),this._rowSelectionChanged(t,[],o)):i&&this._deselectRow(i,t,!0)}_deselectRow(e,t){var i,s,o=this,n=o.table.rowManager.findRow(e);if(n){if((i=o.selectedRows.findIndex((function(e){return e==n})))>-1)return(s=n.getElement())&&s.classList.remove("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!1,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!1),o.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!1),this.dispatchExternal("rowDeselected",n.getComponent()),o._rowSelectionChanged(t,void 0,n),n}else t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e,t=[],i=[]){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||(Array.isArray(t)||(t=[t]),t=t.map((e=>e.getComponent())),Array.isArray(i)||(i=[i]),i=i.map((e=>e.getComponent())),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),t,i))}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}class Le{constructor(e){return this._range=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._range.table.componentFunctionBinder.handle("range",e._range,t)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map((e=>e.getComponent()))}getColumns(){return this._range.getColumns().map((e=>e.getComponent()))}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(e,t){this._range.destroyedGuard("setBounds")&&this._range.setBounds(e?e._cell:e,t?t._cell:t)}setStartBound(e){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(e?e._cell:e),this._range.rangeManager.layoutElement())}setEndBound(e){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(e?e._cell:e),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class Se extends e{constructor(e,t,i,s){super(e),this.rangeManager=t,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=e,this.start={row:0,col:0},this.end={row:0,col:0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout((()=>{this.initBounds(i,s)}))}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(e,t){this._updateMinMax(),e&&this.setBounds(e,t||e)}setStart(e,t){this.start.row===e&&this.start.col===t||(this.start.row=e,this.start.col=t,this.initializing.start=!0,this._updateMinMax())}setEnd(e,t){this.end.row===e&&this.end.col===t||(this.end.row=e,this.end.col=t,this.initializing.end=!0,this._updateMinMax())}setBounds(e,t,i){e&&this.setStartBound(e),this.setEndBound(t||e),this.rangeManager.layoutElement(i)}setStartBound(e){var t,i;"column"===e.type?this.rangeManager.columnSelection&&this.setStart(0,e.getPosition()-1):(t=e.row.position-1,i=e.column.getPosition()-1,e.column===this.rangeManager.rowHeader?this.setStart(t,1):this.setStart(t,i))}setEndBound(e){var t,i,s,o=this._getTableRows().length;"column"===e.type?this.rangeManager.columnSelection&&("column"===this.rangeManager.selecting?this.setEnd(o-1,e.getPosition()-1):"cell"===this.rangeManager.selecting&&this.setEnd(0,e.getPosition()-1)):(t=e.row.position-1,i=e.column.getPosition()-1,s=e.column===this.rangeManager.rowHeader,"row"===this.rangeManager.selecting?this.setEnd(t,this._getTableColumns().length-1):"row"!==this.rangeManager.selecting&&s?this.setEnd(t,0):"column"===this.rangeManager.selecting?this.setEnd(o-1,i):this.setEnd(t,i))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter((e=>"row"===e.type))}layout(){var e,t,i,s,o,n,r,a,l,h,d=this.table.rowManager.renderer.vDomTop,c=this.table.rowManager.renderer.vDomBottom,u=this.table.columnManager.renderer.leftCol,m=this.table.columnManager.renderer.rightCol;"virtual"===this.table.options.renderHorizontal&&this.rangeManager.rowHeader&&(m+=1),null==d&&(d=0),null==c&&(c=1/0),null==u&&(u=0),null==m&&(m=1/0),this.overlaps(u,d,m,c)&&(e=Math.max(this.top,d),t=Math.min(this.bottom,c),i=Math.max(this.left,u),s=Math.min(this.right,m),o=this.rangeManager.getCell(e,i),n=this.rangeManager.getCell(t,s),r=o.getElement(),a=n.getElement(),l=o.row.getElement(),h=n.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=l.offsetWidth-r.offsetLeft-r.offsetWidth+"px",this.element.style.width=r.offsetLeft+r.offsetWidth-a.offsetLeft+"px"):(this.element.style.left=l.offsetLeft+r.offsetLeft+"px",this.element.style.width=a.offsetLeft+a.offsetWidth-r.offsetLeft+"px"),this.element.style.top=l.offsetTop+"px",this.element.style.height=h.offsetTop+h.offsetHeight-l.offsetTop+"px")}atTopLeft(e){return e.row.position-1===this.top&&e.column.getPosition()-1===this.left}atBottomRight(e){return e.row.position-1===this.bottom&&e.column.getPosition()-1===this.right}occupies(e){return this.occupiesRow(e.row)&&this.occupiesColumn(e.column)}occupiesRow(e){return this.top<=e.position-1&&e.position-1<=this.bottom}occupiesColumn(e){return this.left<=e.getPosition()-1&&e.getPosition()-1<=this.right}overlaps(e,t,i,s){return!(this.left>i||e>this.right||this.top>s||t>this.bottom)}getData(){var e=[],t=this.getRows(),i=this.getColumns();return t.forEach((t=>{var s=t.getData(),o={};i.forEach((e=>{o[e.field]=s[e.field]})),e.push(o)})),e}getCells(e,t){var i=[],s=this.getRows(),o=this.getColumns();return e?i=s.map((e=>{var i=[];return e.getCells().forEach((e=>{o.includes(e.column)&&i.push(t?e.getComponent():e)})),i})):s.forEach((e=>{e.getCells().forEach((e=>{o.includes(e.column)&&i.push(t?e.getComponent():e)}))})),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var e=this.getCells(),t=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),e.forEach((e=>{e.setValue(t)})),this.table.restoreRedraw()}getBounds(e){var t=this.getCells(!1,e),i={start:null,end:null};return t.length?(i.start=t[0],i.end=t[t.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new Le(this)),this.component}destroy(e){this.destroyed=!0,this.element.remove(),e&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(e){return this.destroyed&&console.warn("You cannot call the "+e+" function on a destroyed range"),!this.destroyed}}var De={keybindings:{bindings:{rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},actions:{rangeJumpLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!0,!1)},rangeJumpRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!0,!1)},rangeJumpUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!0,!1)},rangeJumpDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!0,!1)},rangeExpandLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!1,!0)},rangeExpandRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!1,!0)},rangeExpandUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!1,!0)},rangeExpandDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!1,!0)},rangeExpandJumpLeft:function(e){this.dispatch("keybinding-nav-range",e,"left",!0,!0)},rangeExpandJumpRight:function(e){this.dispatch("keybinding-nav-range",e,"right",!0,!0)},rangeExpandJumpUp:function(e){this.dispatch("keybinding-nav-range",e,"up",!0,!0)},rangeExpandJumpDown:function(e){this.dispatch("keybinding-nav-range",e,"down",!0,!0)}}},clipboard:{pasteActions:{range:function(e){var t,i,s,o,n,r=[],a=this.table.modules.selectRange.activeRange,l=!1;return n=e.length,a&&(i=(t=a.getBounds()).start,t.start===t.end&&(l=!0),i&&(s=(r=this.table.rowManager.activeRows.slice()).indexOf(i.row),o=l?e.length:r.indexOf(t.end.row)-s+1,s>-1&&(this.table.blockRedraw(),(r=r.slice(s,s+o)).forEach(((t,i)=>{t.updateData(e[i%n])})),this.table.restoreRedraw()))),r}},pasteParsers:{range:function(e){var t,i,s,o,n,r=[],a=[],l=this.table.modules.selectRange.activeRange,h=!1;return!!(l&&(i=(t=l.getBounds()).start,t.start===t.end&&(h=!0),i&&((e=e.split("\n")).forEach((function(e){r.push(e.split("\t"))})),r.length&&(n=(o=this.table.columnManager.getVisibleColumnsByIndex()).indexOf(i.column))>-1)))&&(s=h?r[0].length:o.indexOf(t.end.column)-n+1,o=o.slice(n,n+s),r.forEach((e=>{var t={},i=e.length;o.forEach((function(s,o){t[s.field]=e[o%i]})),a.push(t)})),a)}}},export:{columnLookups:{range:function(){var e=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&e.unshift(this.columnManager.rowHeader),e}},rowLookups:{range:function(){return this.modules.selectRange.selectedRows()}}}};class ze extends s{static moduleName="selectRange";static moduleInitOrder=1;static moduleExtensions=De;constructor(e){super(e),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableOption("selectableRangeAutoFocus",!0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex((e=>e.frozen))>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter((e=>e.frozen))>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior."))}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.resetRanges(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.resetRanges.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(e){this.columnSelection&&e.definition.headerSort&&"icon"!==this.options("headerSortClickElement")&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'."),e.modules.edit}updateHeaderColumn(){var e;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&((e=this.table.modules.frozenColumns.getFrozenColumns()).length>1||1===e.length&&e[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior")}getRanges(){return this.ranges.map((e=>e.getComponent()))}getRangesData(){return this.ranges.map((e=>e.getData()))}addRangeFromComponent(e,t){return e=e?e._cell:null,t=t?t._cell:null,this.addRange(e,t)}cellGetRanges(e){var t=[];return t=e.column===this.rowHeader?this.ranges.filter((t=>t.occupiesRow(e.row))):this.ranges.filter((t=>t.occupies(e))),t.map((e=>e.getComponent()))}rowGetRanges(e){var t=this.ranges.filter((t=>t.occupiesRow(e)));return t.map((e=>e.getComponent()))}colGetRanges(e){var t=this.ranges.filter((t=>t.occupiesColumn(e)));return t.map((e=>e.getComponent()))}_handleMouseUp(e){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(e){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if("Enter"===e.key){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;this.table.modules.edit.editCell(this.getActiveCell()),e.preventDefault()}"Backspace"!==e.key&&"Delete"!==e.key||!this.options("selectableRangeClearCells")||this.activeRange&&this.activeRange.clearValues()}}initializeFocus(e){var t;this.restoreFocus();try{document.selection?((t=document.body.createTextRange()).moveToElementText(e.getElement()),t.select()):window.getSelection&&((t=document.createRange()).selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(t))}catch(e){}}restoreFocus(e){return this.table.rowManager.element.focus(),!0}handleColumnResized(e){var t;"column"!==this.selecting&&"all"!==this.selecting||(t=this.ranges.some((t=>t.occupiesColumn(e))),t&&this.ranges.forEach((t=>{t.getColumns(!0).forEach((t=>{t!==e&&t.setWidth(e.width)}))})))}handleColumnMoving(e,t){this.resetRanges().setBounds(t),this.overlay.style.visibility="hidden"}handleColumnMoved(e,t,i){this.activeRange.setBounds(e),this.layoutElement()}handleColumnMouseDown(e,t){(2!==e.button||"column"!==this.selecting&&"all"!==this.selecting||!this.activeRange.occupiesColumn(t))&&(this.table.options.movableColumns&&"column"===this.selecting&&this.activeRange.occupiesColumn(t)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t)))}handleColumnMouseMove(e,t){t!==this.rowHeader&&this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,t,!0)}renderCell(e){var t=e.getElement(),i=this.ranges.findIndex((t=>t.occupies(e)));t.classList.toggle("tabulator-range-selected",-1!==i),t.classList.toggle("tabulator-range-only-cell-selected",1===this.ranges.length&&this.ranges[0].atTopLeft(e)&&this.ranges[0].atBottomRight(e)),t.dataset.range=i}handleCellMouseDown(e,t){2===e.button&&(this.activeRange.occupies(t)||("row"===this.selecting||"all"===this.selecting)&&this.activeRange.occupiesRow(t.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleCellMouseMove(e,t){this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,t,!0)}handleCellClick(e,t){this.initializeFocus(t)}handleEditingCell(e){this.activeRange&&this.activeRange.setBounds(e)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout((()=>{this.blockKeydown=!1}),10)}keyNavigate(e,t){this.navigate(!1,!1,e),t.preventDefault()}keyNavigateRange(e,t,i,s){this.navigate(i,s,t),e.preventDefault()}navigate(e,t,i){var s,o,n,r,a,l,h,d,c,u,m;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter((e=>e===this.activeRange?(e.setEnd(e.start.row,e.start.col),!0):(e.destroy(),!1)))),n={top:(s=this.activeRange).top,bottom:s.bottom,left:s.left,right:s.right},r=(o=t?s.end:s.start).row,a=o.col,e)switch(i){case"left":a=this.findJumpCellLeft(s.start.row,o.col);break;case"right":a=this.findJumpCellRight(s.start.row,o.col);break;case"up":r=this.findJumpCellUp(o.row,s.start.col);break;case"down":r=this.findJumpCellDown(o.row,s.start.col)}else{if(t&&("row"===this.selecting&&("left"===i||"right"===i)||"column"===this.selecting&&("up"===i||"down"===i)))return;switch(i){case"left":a=Math.max(a-1,0);break;case"right":a=Math.min(a+1,this.getTableColumns().length-1);break;case"up":r=Math.max(r-1,0);break;case"down":r=Math.min(r+1,this.getTableRows().length-1)}}return this.rowHeader&&0===a&&(a=1),t||s.setStart(r,a),s.setEnd(r,a),t||(this.selecting="cell"),n.top!==s.top||n.bottom!==s.bottom||n.left!==s.left||n.right!==s.right?(l=this.getRowByRangePos(s.end.row),h=this.getColumnByRangePos(s.end.col),d=l.getElement().getBoundingClientRect(),u=h.getElement().getBoundingClientRect(),c=this.table.rowManager.getElement().getBoundingClientRect(),m=this.table.columnManager.getElement().getBoundingClientRect(),d.top>=c.top&&d.bottom<=c.bottom||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):l.getComponent().scrollTo(void 0,!1)),u.left>=m.left+this.getRowHeaderWidth()&&u.right<=m.right||(l.getElement().parentNode&&h.getElement().parentNode?this.autoScroll(s,l.getElement(),h.getElement()):h.getComponent().scrollTo(void 0,!1)),this.layoutElement(),!0):void 0}rangeRemoved(e){this.ranges=this.ranges.filter((t=>t!==e)),this.activeRange===e&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement()}findJumpRow(e,t,i,s,o){return i&&(t=t.reverse()),this.findJumpItem(s,o,t,(function(t){return t.getData()[e.getField()]}))}findJumpCol(e,t,i,s,o){return i&&(t=t.reverse()),this.findJumpItem(s,o,t,(function(t){return e.getData()[t.getField()]}))}findJumpItem(e,t,i,s){var o;for(let n of i){let i=s(n);if(e){if(o=n,i)break}else if(t){if(o=n,i)break}else{if(!i)break;o=n}}return o}findJumpCellLeft(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),o=this.isEmpty(i.getData()[s[t].getField()]),n=!!s[t-1]&&this.isEmpty(i.getData()[s[t-1].getField()]),r=this.rowHeader?s.slice(1,t):s.slice(0,t),a=this.findJumpCol(i,r,!0,o,n);return a?a.getPosition()-1:t}findJumpCellRight(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),o=this.isEmpty(i.getData()[s[t].getField()]),n=!!s[t+1]&&this.isEmpty(i.getData()[s[t+1].getField()]),r=this.findJumpCol(i,s.slice(t+1,s.length),!1,o,n);return r?r.getPosition()-1:t}findJumpCellUp(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),o=this.isEmpty(s[e].getData()[i.getField()]),n=!!s[e-1]&&this.isEmpty(s[e-1].getData()[i.getField()]),r=this.findJumpRow(i,s.slice(0,e),!0,o,n);return r?r.position-1:e}findJumpCellDown(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),o=this.isEmpty(s[e].getData()[i.getField()]),n=!!s[e+1]&&this.isEmpty(s[e+1].getData()[i.getField()]),r=this.findJumpRow(i,s.slice(e+1,s.length),!1,o,n);return r?r.position-1:e}newSelection(e,t){var i;if("column"===t.type){if(!this.columnSelection)return;if(t===this.rowHeader){i=this.resetRanges(),this.selecting="all";var s,o=this.getCell(-1,-1);return s=this.rowHeader?this.getCell(0,1):this.getCell(0,0),void i.setBounds(s,o)}this.selecting="column"}else t.column===this.rowHeader?this.selecting="row":this.selecting="cell";e.shiftKey?this.activeRange.setBounds(!1,t):e.ctrlKey?this.addRange().setBounds(t):this.resetRanges().setBounds(t)}autoScroll(e,t,i){var s,o,n,r=this.table.rowManager.element;void 0===t&&(t=this.getRowByRangePos(e.end.row).getElement()),void 0===i&&(i=this.getColumnByRangePos(e.end.col).getElement()),s={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight},n=(o={left:r.scrollLeft+this.getRowHeaderWidth(),right:Math.ceil(r.scrollLeft+r.clientWidth),top:r.scrollTop,bottom:r.scrollTop+r.offsetHeight-this.table.rowManager.scrollbarWidth}).topo.right&&(r.scrollLeft=Math.min(s.right-r.clientWidth,s.left-this.getRowHeaderWidth()))),n||(s.topo.bottom&&(r.scrollTop=s.bottom-r.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(e){e&&(this.selecting="cell",this.resetRanges(),this.layoutElement())}layoutElement(e){(e?this.table.rowManager.getVisibleRows(!0):this.table.rowManager.getRows()).forEach((e=>{"row"===e.type&&(this.layoutRow(e),e.cells.forEach((e=>this.renderCell(e))))})),this.getTableColumns().forEach((e=>{this.layoutColumn(e)})),this.layoutRanges()}layoutRow(e){var t=e.getElement(),i=!1,s=this.ranges.some((t=>t.occupiesRow(e)));"row"===this.selecting?i=s:"all"===this.selecting&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutColumn(e){var t=e.getElement(),i=!1,s=this.ranges.some((t=>t.occupiesColumn(e)));"column"===this.selecting?i=s:"all"===this.selecting&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var e,t,i;this.table.initialized&&(e=this.getActiveCell())&&(t=e.getElement(),i=e.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-t.offsetLeft-t.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+t.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=t.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach((e=>e.layout())),this.overlay.style.visibility="visible")}getCell(e,t){var i;return t<0&&(t=this.getTableColumns().length+t)<0?null:(e<0&&(e=this.getTableRows().length+e),(i=this.table.rowManager.getRowFromPosition(e+1))?i.getCells(!1,!0).filter((e=>e.column.visible))[t]:null)}getActiveCell(){return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(e){return this.getTableRows()[e]}getColumnByRangePos(e){return this.getTableColumns()[e]}getTableRows(){return this.table.rowManager.getDisplayRows().filter((e=>"row"===e.type))}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(e,t){var i;return!0!==this.maxRanges&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new Se(this.table,this,e,t),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}resetRanges(){var e,t,i;return this.ranges.forEach((e=>e.destroy())),this.ranges=[],e=this.addRange(),this.table.rowManager.activeRows.length&&(i=this.table.rowManager.activeRows[0].cells.filter((e=>e.column.visible)),(t=i[this.rowHeader?1:0])&&(e.setBounds(t),this.options("selectableRangeAutoFocus")&&this.initializeFocus(t))),e}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(e){return e?this.activeRange.getRows().map((e=>e.getComponent())):this.activeRange.getRows()}selectedColumns(e){return e?this.activeRange.getColumns().map((e=>e.getComponent())):this.activeRange.getColumns()}getRowHeaderWidth(){return this.rowHeader?this.rowHeader.getElement().offsetWidth:0}isEmpty(e){return null==e||""===e}}function Pe(e,t,i,s,o,n,r){var a=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"),l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l)),a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}var Fe={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),Pe.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),Pe.call(this,e,t,i,s,o,n,r)},datetime:Pe,boolean:function(e,t,i,s,o,n,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,i,s,o,n,r,a){var l,h=a.type||"length",d=a.alignEmptyValues,c=0,u=this.table;function m(e){var t;switch(l&&(e=l(e)),h){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length;break;case"string":t=e.join("")}return t}if(a.valueMap&&(l="string"==typeof a.valueMap?function(e){return e.map((e=>t.retrieveNestedData(u.options.nestedFieldSeparator,a.valueMap,e)))}:a.valueMap),Array.isArray(e)){if(Array.isArray(i))return"string"===h?String(m(e)).toLowerCase().localeCompare(String(m(i)).toLowerCase()):m(i)-m(e);c=1}else c=Array.isArray(i)?-1:0;return("top"===d&&"desc"===r||"bottom"===d&&"asc"===r)&&(c*=-1),c},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,m=/(\d+)|(\D+)/g,p=/\d/,g=r.alignEmptyValues,b=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()))return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(m),l=l.match(m),c=a.length>l.length?l.length:a.length;ud?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class He extends s{static moduleName="sort";static sorters=Fe;constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":He.sorters[e.definition.sorter]?s=He.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}if(e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort){if((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement)i.classList.add("tabulator-col-sorter-element");else t.classList.add("tabulator-col-sorter-element");switch(this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(i),e.modules.sort.element=i,this.setColumnHeaderSortIcon(e,"none"),"icon"===this.table.options.headerSortClickElement&&i.addEventListener("mousedown",(e=>{e.stopPropagation()})),("icon"===this.table.options.headerSortClickElement?i:t).addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="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":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(o=(s=this.getSort()).findIndex((t=>t.field===e.getField())),o>-1?(s[o].dir=i,o=s.splice(o,1)[0],"none"!=i&&s.push(o)):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}}))}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return He.sorters[s]}sort(e,t){var i=this,s=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,o=[],n=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),t||i.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(s.forEach((function(e,s){var n;e.column&&((n=e.column.modules.sort)&&(n.sorter||(n.sorter=i.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,o.push(e)),t||i.setColumnHeader(e.column,e.dir))})),o.length&&i._sortItems(e,o)):t||s.forEach((function(e,t){i.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{n.push(e.getComponent())})),this.dispatchExternal("dataSorted",i.getSort(),n)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i,s=e.modules.sort.element;if(e.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,e.getComponent(),t))?s.appendChild(i):s.innerHTML=i}}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}class _e{constructor(e,t){this.columnCount=e,this.rowCount=t,this.columnString=[],this.columns=[],this.rows=[]}genColumns(e){var t=Math.max(this.columnCount,Math.max(...e.map((e=>e.length))));this.columnString=[],this.columns=[];for(let e=1;e<=t;e++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(e){var t=Math.max(this.rowCount,e.length);this.rows=[];for(let e=1;e<=t;e++)this.rows.push(e);return this.rows}incrementChar(e){let t=this.columnString[e];t?"Z"!==t?this.columnString[e]=String.fromCharCode(this.columnString[e].charCodeAt(0)+1):(this.columnString[e]="A",e?this.incrementChar(e-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(e){this.rowCount=e}setColumnCount(e){this.columnCount=e}}class Oe{constructor(e){return this._sheet=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._sheet.table.componentFunctionBinder.handle("sheet",e._sheet,t)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(e){return this._sheet.setData(e)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(e){return this._sheet.setTitle(e)}setRows(e){return this._sheet.setRows(e)}setColumns(e){return this._sheet.setColumns(e)}}class Ae extends e{constructor(e,t){super(e.table),this.spreadsheetManager=e,this.definition=t,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new _e(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",(()=>{this.spreadsheetManager.loadSheet(this)}))}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach((e=>{var t=Object.assign({},this.columnDefinition);t.field=e,t.title=e,this.columnDefs.push(t)}))}initializeRows(){var e;this.grid.setRowCount(this.rowCount),e=this.grid.genRows(this.data),this.rowDefs=[],e.forEach(((e,t)=>{var i={_id:e},s=this.data[t];s&&s.forEach(((e,t)=>{var s=this.columnFields[t];s&&(i[s]=e)})),this.rowDefs.push(i)}))}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var e=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),e&&null!==this.scrollTop&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new Oe(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(e){var t,i,s,o=[];return this.rowDefs.forEach((e=>{var t=[];this.columnFields.forEach((i=>{t.push(e[i])})),o.push(t)})),e||this.options("spreadsheetOutputFull")||(t=o.map((e=>e.findLastIndex((e=>void 0!==e))+1)),i=Math.max(...t),s=t.findLastIndex((e=>e>0))+1,o=(o=o.slice(0,s)).map((e=>e.slice(0,i)))),o}setData(e){this.data=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(e){this.title=e,this.element.innerText=e,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(e){this.rowCount=e,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(e){this.columnCount=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}class Be extends s{static moduleName="spreadsheet";constructor(e){super(e),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var e=this.options("spreadsheetSheetTabsElement");!e||e instanceof HTMLElement||(e=document.querySelector(e))||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement")),e?e.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(e,t,i){return console.log("data",e,t,i),Array.isArray(e)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",e),!e.length||Array.isArray(e[0])?this.loadData(e):this.loadSheets(e)):console.error("Spreadsheet Loading Error - Unable to process remote data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e),!1}loadData(e){var t={data:e};this.loadSheet(this.newSheet(t))}destroySheets(){this.sheets.forEach((e=>{e.destroy()})),this.sheets=[],this.activeSheet=null}loadSheets(e){Array.isArray(e)||(e=[]),this.destroySheets(),e.forEach((e=>{this.newSheet(e)})),this.loadSheet(this.sheets[0])}loadSheet(e){this.activeSheet!==e&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=e,e.load())}newSheet(e={}){var t;return e.rows||(e.rows=this.options("spreadsheetRows")),e.columns||(e.columns=this.options("spreadsheetColumns")),t=new Ae(this,e),this.sheets.push(t),this.element&&this.element.appendChild(t.element),t}removeSheet(e){var t,i=this.sheets.indexOf(e);this.sheets.length>1?i>-1&&(this.sheets.splice(i,1),e.destroy(),this.activeSheet===e&&((t=this.sheets[i-1]||this.sheets[0])?this.loadSheet(t):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(e){return e?e instanceof Ae?e:e instanceof Oe?e._sheet:this.sheets.find((t=>t.key===e))||!1:this.activeSheet}setSheets(e){return this.loadSheets(e),this.getSheets()}addSheet(e){return this.newSheet(e).getComponent()}getSheetDefinitions(){return this.sheets.map((e=>e.getDefinition()))}getSheets(){return this.sheets.map((e=>e.getComponent()))}getSheet(e){var t=this.lookupSheet(e);return!!t&&t.getComponent()}setSheetData(e,t){e&&!t&&(t=e,e=!1);var i=this.lookupSheet(e);return!!i&&i.setData(t)}getSheetData(e){var t=this.lookupSheet(e);return!!t&&t.getData()}clearSheet(e){var t=this.lookupSheet(e);return!!t&&t.clear()}removeSheetFunc(e){var t=this.lookupSheet(e);t&&this.removeSheet(t)}activeSheetFunc(e){var t=this.lookupSheet(e);return!!t&&this.loadSheet(t)}}class Ve extends s{static moduleName="tooltip";constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,o,n;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof C?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof o&&this.popupInstance.renderCallback(o),n=this.popupInstance.containerEventCoords(e),this.popupInstance.show(n.x+15,n.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}var Ie={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},alphanumeric:function(e,t,i){return""===t||null==t||new RegExp(/^[a-z0-9]+$/i).test(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class Ne extends s{static moduleName="validate";static validators=Ie;constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:Ne.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}var We=Object.freeze({__proto__:null,AccessorModule:n,AjaxModule:m,ClipboardModule:f,ColumnCalcsModule:k,DataTreeModule:L,DownloadModule:D,EditModule:H,ExportModule:V,FilterModule:N,FormatModule:j,FrozenColumnsModule:G,FrozenRowsModule:U,GroupRowsModule:K,HistoryModule:Q,HtmlTableImportModule:Z,ImportModule:te,InteractionModule:ie,KeybindingsModule:ne,MenuModule:re,MoveColumnsModule:ae,MoveRowsModule:de,MutatorModule:ue,PageModule:pe,PersistenceModule:fe,PopupModule:ve,PrintModule:we,ReactiveDataModule:Ce,ResizeColumnsModule:Ee,ResizeRowsModule:ye,ResizeTableModule:Re,ResponsiveLayoutModule:Te,SelectRangeModule:ze,SelectRowModule:ke,SortModule:He,SpreadsheetModule:Be,TooltipModule:Ve,ValidateModule:Ne}),je={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{},dependencies:{}};class Ge{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||!0===t.debugInvalidOptions;Object.assign(i,e);for(let e in t)i.hasOwnProperty(e)||(s&&console.warn("Invalid "+this.msgType+" option:",e),i[e]=t.key);for(let e in i)e in t?i[e]=t[e]:Array.isArray(i[e])?i[e]=Object.assign([],i[e]):"object"==typeof i[e]&&null!==i[e]?i[e]=Object.assign({},i[e]):void 0===i[e]&&delete i[e];return i}}class Ue extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,i,s){var o=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise(((a,l)=>{if(o>-1){if(void 0===s&&(s=this.table.options.scrollToRowIfVisible),!s&&t.elVisible(n)&&(r=t.elOffset(n).top-t.elOffset(this.elementVertical).top)>0&&r{i.appendChild(e.getElement())})),e.element.appendChild(i),t||e.cells.forEach((e=>{e.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class Xe extends Ue{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){"fitDataTable"==this.options("layout")&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t,i={};e.visible&&(e.modules.frozen||(t=e.getWidth(),i.leftPos=s,i.rightPos=s+t,i.width=t,this.isFitData&&(i.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+t>this.vDomScrollPosLeft&&s{t.appendChild(e.getElement())})),e.element.appendChild(t),e.cells.forEach((e=>{e.cellRendered()}))}}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++){let t=this.columns[e];t&&t.reinitializeWidth()}}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,e=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){t=e.getElement(),e.generateCells(),this.tableElement.appendChild(t);for(let i=0;i{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){var e=this.getVisibleRows(),t=this.table.rowManager.getRows().filter((t=>!e.includes(t)));e.forEach((e=>{this.reinitializeRow(e,!0)})),t.forEach((e=>{e.deinitialize()}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.rightCol]).getElement().nextSibling),t.cellRendered()}})),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)})),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.leftCol]).getElement()),t.cellRendered()}})),this.leftCol--,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)})),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let t=this.fitDataColActualWidthCheck(i);t&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+t,this.vDomPadRight-=t)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)}))):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)}))):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach((t=>{this.appendCell(e,t)}));for(let t=this.leftCol;t<=this.rightCol;t++)this.appendCell(e,this.columns[t]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach((t=>{this.appendCell(e,t)}))}}appendCell(e,t){if(t&&t.visible){let i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class Ke extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new Ge(this.table,"column definition",y),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(e){this.table.rtl?this.headersElement.style.marginLeft=e+"px":this.headersElement.style.marginRight=e+"px"}initializeRenderer(){var e,t={virtual:Xe,basic:Je};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderContentsElement(){var e=document.createElement("div");return e.classList.add("tabulator-header-contents"),e.setAttribute("role","rowgroup"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(e){this.contentsElement.scrollLeft=e,this.scrollLeft=e,this.renderer.scrollColumns(e)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",(e=>{var t;e.deltaX&&(t=this.contentsElement.scrollLeft+e.deltaX,this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))}))}generateColumnsFromRowData(e){var t=[],i={},s="full"===this.table.options.autoColumns?e:[e[0]],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){if(s.forEach((e=>{Object.keys(e).forEach(((s,o)=>{let n,r=e[s];i[s]?!0!==i[s]&&void 0!==r&&(i[s].sorter=this.calculateSorterFromValue(r),i[s]=!0):(n={field:s,title:s,sorter:this.calculateSorterFromValue(r)},t.splice(o,0,n),i[s]=void 0!==r||n)}))})),o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,t);break;case"object":Array.isArray(o)?t.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):t.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=t}else this.table.options.columns=t;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(e){var t;switch(typeof e){case"undefined":t="string";break;case"boolean":t="boolean";break;case"number":t="number";break;case"object":t=Array.isArray(e)?"array":"string";break;default:t=isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}return t}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new R(!0===this.table.options.rowHeader?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new R(e,this),o=s.getElement(),n=i?this.findColumnIndex(i):i;if(!t||!this.rowHeader||i&&i!==this.rowHeader||(t=!1,i=this.rowHeader,n=0),i&&n>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(a,0,s),l.parentNode.insertBefore(o,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),this.headersElement.style.height=e+"px",this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize())}findColumn(e){var t;if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof R)return e;if(e instanceof E)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t=[],this.columns.forEach((e=>{t.push(e),t=t.concat(e.getColumns(!0))})),t.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{(this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i)===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex((e=>e.visible));return e>-1&&this.columnsByIndex[e]}getVisibleColumnsByIndex(){return this.columnsByIndex.filter((e=>e.visible))}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=e.getLeftOffset(),n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&o>0&&o+r.offsetWidth{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){t.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class qe extends Ue{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0,i=document.createDocumentFragment(),s=this.rows();s.forEach(((e,s)=>{this.styleRow(e,s),e.initialize(!1,!0),"group"!==e.type&&(t=!1),i.appendChild(e.getElement())})),e.appendChild(i),s.forEach((e=>{e.rendered(),e.heightInitialized||e.calcHeight(!0)})),s.forEach((e=>{e.heightInitialized||e.setCellHeight()})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),e&&e(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(e){var i=t.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(e){var i=e.getElement();this.elementVertical.scrollTop=t.elOffset(i).top-t.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class Ye extends Ue{constructor(e){super(e),this.verticalFillMode="fill",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=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a){e.deinitializeHeight()})),e&&e(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,i,s){var o,n,r=this.tableElement,a=this.elementVertical,l=0,h=0,d=0,c=0,u=0,m=0,p=this.rows(),g=p.length,b=0,f=[],v=0,w=0,C=this.table.rowManager.fixedHeight,E=this.elementVertical.clientHeight,y=this.table.options.rowHeight,R=!0;if(s=s||0,e=e||0){for(;r.firstChild;)r.removeChild(r.firstChild);(c=(g-e+1)*this.vDomRowHeight){e.rendered(),e.heightInitialized||e.calcHeight(!0)})),f.forEach((e=>{e.heightInitialized||e.setCellHeight()})),f.forEach((e=>{d=e.getHeight(),vthis.vDomWindowBuffer&&(this.vDomWindowBuffer=2*d),v++})),R=this.table.rowManager.adjustTableSize(),E=this.elementVertical.clientHeight,R&&(C||this.table.options.maxHeight)&&(y=h/v,w=Math.max(this.vDomWindowMinTotalRows,Math.ceil(E/y+this.vDomWindowBuffer/y)))}e?(this.vDomTopPad=i?this.vDomRowHeight*this.vDomTop+s:this.scrollTop-u,this.vDomBottomPad=this.vDomBottom==g-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-h-u,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((h+u)/v),this.vDomBottomPad=this.vDomRowHeight*(g-this.vDomBottom-1),this.vDomScrollHeight=u+h+this.vDomBottomPad-E),r.style.paddingTop=this.vDomTopPad+"px",r.style.paddingBottom=this.vDomBottomPad+"px",i&&(this.scrollTop=this.vDomTopPad+u+s-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-E:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-E),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&i&&(this.scrollTop+=this.elementVertical.offsetHeight-E),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,a.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.insertBefore(d.getElement(),i.firstChild),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomTop--,n--,r++):a=!1):a=!1}else a=!1;for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomTop];a&&o=r?(this.vDomTop++,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0,a=!0;a;){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.appendChild(d.getElement()),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomBottom++,n++,r++):a=!1):a=!1}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomBottom];a&&o=r?(this.vDomBottom--,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class $e extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){var e=this.table.options.placeholder;if("function"==typeof e&&(e=e.call(this.table)),e=this.chain("placeholder",[e],e,e)||e){let t=document.createElement("div");if(t.classList.add("tabulator-placeholder"),"string"==typeof e){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=e,t.appendChild(i),this.placeholderContents=i}else"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(t.appendChild(e),this.placeholderContents=e):(console.warn("Invalid placeholder provided, must be string or HTML Element",e),this.el=null);this.placeholder=t}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(void 0===e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof T)return e;if(e instanceof x)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e){return this.getDisplayRows().find((t=>"row"===t.type&&t.getPosition()===e&&t.isDisplayed()))}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new T(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i,s){var o=[];return new Promise(((n,r)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((e,s)=>{var n=this.addRow(e,t,i,!0);o.push(n),this.dispatch("row-added",n,e,t,i)})),this.refreshActiveData(!!s&&"displayPipeline",!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),n(o)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof T?e:new T(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(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.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,i,s){var o=this.table,n="",r=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((r=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)n="dataPipeline",i&&(r==this.dataPipeline.length-1?n="display":r++);else{if(!((r=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",i&&(r==this.displayPipeline.length-1?n="end":r++)}else n=e||"all",r=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{"row"===e.type&&(e.setPosition(t),t++)}))}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:Ye,basic:qe};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),!this.table.element.clientHeight&&!this.table.options.height||this.table.options.minHeight&&this.table.options.maxHeight?this.fixedHeight=!1:this.fixedHeight=!0):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(e){this.activeRows.forEach((function(t){t.normalizeHeight(e)}))}adjustTableSize(){let e,t=this.element.clientHeight,i=!1;if("fill"===this.renderer.verticalFillMode){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const t="calc(100% - "+s+"px)";this.element.style.minHeight=e||"calc(100% - "+s+"px)",this.element.style.height=t,this.element.style.maxHeight=t}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-s+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){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"))}}class Qe extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)if("string"==typeof this.table.options.footerElement)"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));else this.element=this.table.options.footerElement}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Ze extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]||(t[this.componentMap[e]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={},n={},r={};for(let e of i){let i,n=t[e],a=this.previousTargets[e];if(a&&a.target===n)i=a.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===n)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(n));break;case"cell":s.components.includes("cell")&&(o.row instanceof T?i=o.row.findCell(n):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(o[e]=i,r[e]={target:n,component:i})}return this.previousTargets=r,Object.keys(t).forEach((e=>{let t=o[e];n[e]=t})),n}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class et{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class tt extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.table.destroyed?Promise.resolve():(this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",[e],null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve()))}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class it{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class st{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class ot extends e{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t,i){var s="";return void 0===this.options(e)||(s="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(s=s+", Please use the %c"+t+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[t]=this.table.options[e])):this._warnUser(s,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(e){this._warnUser(e)}}class nt extends e{constructor(e){super(e),this.deps={},this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(e,t,i){if(!Array.isArray(e))return t?this.lookupProp(e,t,i):this.lookupKey(e,i);for(const i of e){var s=this.lookup(i,t,!0);if(s)break}if(s)return s;this.error(e)}lookupProp(e,t,i){var s;return this.props[e]&&this.props[e][t]?this.props[e][t]:(s=this.lookupKey(e,i))?(this.props[e]||(this.props[e]={}),this.props[e][t]=s[t]||s,this.props[e][t]):void 0}lookupKey(e,t){var i;return this.deps[e]?i=this.deps[e]:window[e]?(this.deps[e]=window[e],i=this.deps[e]):t||this.error(e),i}error(e){console.error("Unable to find dependency",e,"Please check documentation and ensure you have imported the required library into your project")}}function rt(e,t){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var at={fitData:function(e,t){t&&this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:rt,fitDataTable:rt,fitDataStretch:function(e,t){var i=0,s=this.table.rowManager.element.clientWidth,o=0,n=!1;e.forEach(((e,t)=>{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(n=e),e.visible&&(i+=e.getWidth())})),n?(o=s-i+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?n.setWidth(o):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,s,o=this.table.rowManager.element.getBoundingClientRect().width,n=0,r=0,a=0,l=[],h=[],d=0,c=0;function u(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function m(e,t,i,s){var o=[],n=0,r=0,l=0,h=a,d=0,c=0,p=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return u(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=u(t),n+=s>i?s:i,e.definition.widthShrink&&(h.push({column:e,width:s>i?s:i}),d+=e.definition.widthShrink)):(l.push({column:e,width:0}),a+=e.definition.widthGrow||1))})),r=o-n,i=Math.floor(r/a),c=m(l,r,i,!1),l.length&&c>0&&(l[l.length-1].width+=c),l.forEach((function(e){r-=e.width})),(s=Math.abs(c)+r)>0&&d&&(c=m(h,s,Math.floor(s/d),!0)),c&&h.length&&(h[h.length-1].width-=c),l.forEach((function(e){e.column.setWidth(e.width)})),h.forEach((function(e){e.column.setWidth(e.width)}))}};class lt extends s{static moduleName="layout";static modes=at;constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;lt.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){e.definition.widthGrow&&(e.definition.widthGrow=Number(e.definition.widthGrow)),e.definition.widthShrink&&(e.definition.widthShrink=Number(e.definition.widthShrink))}getMode(){return this.mode}layout(e){var t=this.table.columnManager.columnsByIndex.find((e=>e.definition.variableHeight||"textarea"===e.definition.formatter));this.dispatch("layout-refreshing"),lt.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),t&&this.table.rowManager.normalizeHeight(!0),this.dispatch("layout-refreshed")}}var ht={default:{groups:{item:"item",items:"items"},columns:{},data:{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",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class dt extends s{static moduleName="localize";static langs=ht;constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=t.deepClone(dt.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=t.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}var ct=Object.freeze({__proto__:null,CommsModule:class extends s{static moduleName="comms";constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return this.table.constructor.registry.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}},LayoutModule:lt,LocalizeModule:dt});class ut{static registry={tables:[],register(e){ut.registry.tables.push(e)},deregister(e){var t=ut.registry.tables.indexOf(e);t>-1&&ut.registry.tables.splice(t,1)},lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;nut.registry.tables.find((function(t){return e instanceof ut?t===e:t.element===e}))};static findTable(e){var t=ut.registry.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t}}class mt extends ut{static moduleBindings={};static moduleExtensions={};static modulesRegistered=!1;static defaultModules=!1;constructor(){super()}static initializeModuleBinder(e){mt.modulesRegistered||(mt.modulesRegistered=!0,mt._registerModules(ct,!0),e&&mt._registerModules(e))}static _extendModule(e,t,i){if(mt.moduleBindings[e]){var s=mt.moduleBindings[e][t];if(s)if("object"==typeof i)for(let e in i)s[e]=i[e];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)}static _registerModules(e,t){var i=Object.values(e);t&&i.forEach((e=>{e.prototype.moduleCore=!0})),mt._registerModule(i)}static _registerModule(e){Array.isArray(e)||(e=[e]),e.forEach((e=>{mt._registerModuleBinding(e),mt._registerModuleExtensions(e)}))}static _registerModuleBinding(e){e.moduleName?mt.moduleBindings[e.moduleName]=e:console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let e in t){let i=t[e];if(mt.moduleBindings[e])for(let t in i)mt._extendModule(e,t,i[t]);else{mt.moduleExtensions[e]||(mt.moduleExtensions[e]={});for(let t in i)mt.moduleExtensions[e][t]||(mt.moduleExtensions[e][t]={}),Object.assign(mt.moduleExtensions[e][t],i[t])}}mt._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=mt.moduleExtensions[e.moduleName];if(t)for(let i in t)mt._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];for(var s in this.modules={},mt.moduleBindings){let o=mt.moduleBindings[s],n=new o(this);this.modules[s]=n,o.prototype.moduleCore?this.modulesCore.push(n):o.moduleInitOrder?o.moduleInitOrder<0?e.push(n):t.push(n):i.push(n)}e.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=e.concat(i.concat(t))}}class pt extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.dispatch("alert-show",t),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class gt extends mt{static defaultOptions=je;static extendModule(){gt.initializeModuleBinder(),gt._extendModule(...arguments)}static registerModule(){gt.initializeModuleBinder(),gt._registerModule(...arguments)}constructor(e,t,i){super(),gt.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new et(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new ot(this),this.optionsList=new Ge(this,"table constructor"),this.dependencyRegistry=new nt(this),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),this.constructor.registry.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new Ke(this),this.rowManager=new $e(this),this.footerManager=new Qe(this),this.dataLoader=new tt(this),this.alertManager=new pt(this),this._bindModules(),this.options=this.optionsList.generate(gt.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new it(this,this.options,this.options.debugEventsExternal),this.eventBus=new st(this.options.debugEventsInternal),this.interactionMonitor=new Ze(this),this.dataLoader.initialize(),this.footerManager.initialize(),this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally((()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")}))}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally((()=>{this.columnManager.verticalAlignHeaders()}))}destroy(){var e=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-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):e.indexOf("Mac OS")>-1?(this.browser="safari",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.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);o?(t++,o.updateData(e).then((()=>{--t||i()})).catch((t=>{s("Update Error - Unable to update row",e,t)}))):s("Update Error - Unable to find row",e)})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}var bt=gt;var ft=class extends bt{static extendModule(){bt.initializeModuleBinder(We),bt._extendModule(...arguments)}static registerModule(){bt.initializeModuleBinder(We),bt._registerModule(...arguments)}constructor(e,t,i){super(e,t,We)}};class vt{constructor(e){this.type=e,this.element=this._createElement()}_createElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}rendered(){}}export{n as AccessorModule,m as AjaxModule,v as CalcComponent,w as CellComponent,f as ClipboardModule,k as ColumnCalcsModule,E as ColumnComponent,L as DataTreeModule,D as DownloadModule,H as EditModule,V as ExportModule,N as FilterModule,j as FormatModule,G as FrozenColumnsModule,U as FrozenRowsModule,J as GroupComponent,K as GroupRowsModule,Q as HistoryModule,Z as HtmlTableImportModule,te as ImportModule,ie as InteractionModule,ne as KeybindingsModule,re as MenuModule,s as Module,ae as MoveColumnsModule,de as MoveRowsModule,ue as MutatorModule,pe as PageModule,fe as PersistenceModule,ve as PopupModule,we as PrintModule,vt as PseudoRow,Le as RangeComponent,Ce as ReactiveDataModule,Ue as Renderer,Ee as ResizeColumnsModule,ye as ResizeRowsModule,Re as ResizeTableModule,Te as ResponsiveLayoutModule,x as RowComponent,ze as SelectRangeModule,ke as SelectRowModule,Oe as SheetComponent,He as SortModule,Be as SpreadsheetModule,bt as Tabulator,ft as TabulatorFull,Ve as TooltipModule,Ne as ValidateModule}; +//# sourceMappingURL=tabulator_esm.min.mjs.map diff --git a/resources/css/tabulator-custom.css b/resources/css/tabulator-custom.css new file mode 100644 index 00000000..23398219 --- /dev/null +++ b/resources/css/tabulator-custom.css @@ -0,0 +1,211 @@ +.dark { + border: 1px solid #282828; + background-color: #111111; +} + +.dark[tabulator-layout="fitColumns"] .tabulator-header .tabulator-col:last-child { + border-right: none; +} + +.dark .tabulator-header { + background-color: #080808; +} + +.dark .tabulator-header .tabulator-calcs-holder { + border-top: 1px solid #393838; +} + +.dark .tabulator-header .tabulator-calcs-holder .tabulator-row { + background-color: #292929 !important; +} + +.dark .tabulator-header .tabulator-col { + border-right-color: #393838; + background-color: #101010; +} + +.dark .tabulator-header .tabulator-col.tabulator-row-header { + border-right: 1px solid #393838 !important; +} + +.dark .tabulator-header .tabulator-col.range-header-col { + border-right: 2px solid #3FB449; +} + + +.dark .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols { + border-top-color: #393838; + border-bottom-color: #393838; +} + +.dark .tabulator-header .tabulator-col input, +.dark .tabulator-header .tabulator-col select { + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 4px 10px; + border: 1px solid #4b4b4b; + border-radius: 2px; + background: #1f1f1f; + color: #fff; + outline: none; +} + +.dark .tabulator-header .tabulator-col input:focus, +.dark .tabulator-header .tabulator-col select:focus { + border-color: #3FB449; +} + +.dark .tabulator-header .tabulator-col input+input { + margin-left: 5px; +} + +.dark .tabulator-header .tabulator-cell { + color: #ccc !important; +} + +.dark .tabulator-tableholder::-webkit-scrollbar { + width: 12px; + /* width of the entire scrollbar */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-track { + background: #333; + /* color of the tracking area */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-thumb { + background-color: #666; + /* color of the scroll thumb */ + border-radius: 20px; + /* roundness of the scroll thumb */ + border: 3px solid #333; + /* creates padding around scroll thumb */ +} + +.dark .tabulator-tableholder::-webkit-scrollbar-corner { + background: #222; +} + +.dark .tabulator-tableholder .tabulator-table { + color: #fff; + background-color: #111111; +} + +.dark .tabulator-row { + background-color: #151515; +} + +.dark .tabulator-row.tabulator-row-even { + background-color: #202020; +} + +.dark .tabulator-row.tabulator-selectable:hover { + background-color: #000; +} + +.dark .tabulator-row.tabulator-selected { + background-color: #009136; +} + +.dark .tabulator-row.tabulator-selected:hover { + background-color: #00531f; +} + +.dark .tabulator-row.tabulator-group { + border-right-color: #393838; +} + +.dark .tabulator-row .tabulator-cell { + border-right-color: #393838; +} + +.dark .tabulator-row .tabulator-cell.tabulator-editing { + border: 1px solid #3FB449; +} + +.dark .tabulator-row .tabulator-cell input, +.dark .tabulator-row .tabulator-cell select, +.dark .tabulator-row .tabulator-cell textarea { + background-color: #121212; + color: #ccc; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control { + height: 14px; + width: 14px; + border: 2px solid #3FB449 !important; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after { + position: absolute; + content: ""; + left: -3px; + top: 2px; + height: 2px; + width: 6px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand { + height: 8px; + width: 2px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after { + position: absolute; + content: ""; + left: -3px; + top: 3px; + height: 2px; + width: 8px; + background: #3FB449; +} + +.dark .tabulator-row .tabulator-cell .tabulator-data-tree-branch { + border-left: 2px solid #3FB449; + border-bottom: 2px solid #3FB449; +} + +.dark .tabulator-row .tabulator-responsive-collapse { + border-top: 1px solid #393838; + border-bottom: 1px solid #393838; +} + +.dark .tabulator-footer { + background-color: #101010; +} + +.dark .tabulator-footer .tabulator-calcs-holder { + border-bottom: 1px solid #393838; +} + +.dark .tabulator-footer .tabulator-calcs-holder .tabulator-row { + background-color: #292929 !important; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs { + margin-bottom: -2px; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab { + padding: 4px 10px; + border-width: 0 1px 1px 1px; + background-color: #000; + color: #ececec; + font-weight: normal; +} + +.dark .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active { + font-weight: bold; +} + +.dark .tabulator-footer .tabulator-page, +.dark .tabulator-footer .tabulator-page-size { + background: #ebebeb; +} + +.dark .tabulator-popup, +.dark .tabulator-tooltip { + color: #000; +} \ No newline at end of file diff --git a/resources/js/dist/components/tabulator.js b/resources/js/dist/components/tabulator.js deleted file mode 100644 index e12b52c6..00000000 --- a/resources/js/dist/components/tabulator.js +++ /dev/null @@ -1,24898 +0,0 @@ -var yi = Object.defineProperty; -var Ri = (P, C, j) => - C in P - ? yi(P, C, { enumerable: !0, configurable: !0, writable: !0, value: j }) - : (P[C] = j); -var xi = (P, C) => () => (C || P((C = { exports: {} }).exports, C), C.exports); -var b = (P, C, j) => Ri(P, typeof C != "symbol" ? C + "" : C, j); -var Ti = xi((oe, ne) => { - (function (P, C) { - typeof oe == "object" && typeof ne < "u" - ? (ne.exports = C()) - : typeof define == "function" && define.amd - ? define(C) - : ((P = - typeof globalThis < "u" ? globalThis : P || self).Tabulator = - C()); - })(oe, function () { - "use strict"; - var It, - Nt, - Wt, - jt, - Gt, - Ut, - Jt, - qt, - Xt, - Kt, - Yt, - Qt, - Zt, - $t, - te, - ct, - at, - ut, - ee, - ie; - var P = { - debugEventsExternal: !1, - debugEventsInternal: !1, - debugInvalidOptions: !0, - debugInvalidComponentFuncs: !0, - debugInitialization: !0, - debugDeprecation: !0, - height: !1, - minHeight: !1, - maxHeight: !1, - columnHeaderVertAlign: "top", - popupContainer: !1, - columns: [], - columnDefaults: {}, - rowHeader: !1, - data: !1, - autoColumns: !1, - autoColumnsDefinitions: !1, - nestedFieldSeparator: ".", - footerElement: !1, - index: "id", - textDirection: "auto", - addRowPos: "bottom", - headerVisible: !0, - renderVertical: "virtual", - renderHorizontal: "basic", - renderVerticalBuffer: 0, - scrollToRowPosition: "top", - scrollToRowIfVisible: !0, - scrollToColumnPosition: "left", - scrollToColumnIfVisible: !0, - rowFormatter: !1, - rowFormatterPrint: null, - rowFormatterClipboard: null, - rowFormatterHtmlOutput: null, - rowHeight: null, - placeholder: !1, - dataLoader: !0, - dataLoaderLoading: !1, - dataLoaderError: !1, - dataLoaderErrorTimeout: 3e3, - dataSendParams: {}, - dataReceiveParams: {}, - dependencies: {}, - }; - class C { - constructor(t) { - this.table = t; - } - reloadData(t, e, i) { - return this.table.dataLoader.load( - t, - void 0, - void 0, - void 0, - e, - i - ); - } - langText() { - return this.table.modules.localize.getText(...arguments); - } - langBind() { - return this.table.modules.localize.bind(...arguments); - } - langLocale() { - return this.table.modules.localize.getLocale(...arguments); - } - commsConnections() { - return this.table.modules.comms.getConnections(...arguments); - } - commsSend() { - return this.table.modules.comms.send(...arguments); - } - layoutMode() { - return this.table.modules.layout.getMode(); - } - layoutRefresh(t) { - return this.table.modules.layout.layout(t); - } - subscribe() { - return this.table.eventBus.subscribe(...arguments); - } - unsubscribe() { - return this.table.eventBus.unsubscribe(...arguments); - } - subscribed(t) { - return this.table.eventBus.subscribed(t); - } - subscriptionChange() { - return this.table.eventBus.subscriptionChange(...arguments); - } - dispatch() { - return this.table.eventBus.dispatch(...arguments); - } - chain() { - return this.table.eventBus.chain(...arguments); - } - confirm() { - return this.table.eventBus.confirm(...arguments); - } - dispatchExternal() { - return this.table.externalEvents.dispatch(...arguments); - } - subscribedExternal(t) { - return this.table.externalEvents.subscribed(t); - } - subscriptionChangeExternal() { - return this.table.externalEvents.subscriptionChange( - ...arguments - ); - } - options(t) { - return this.table.options[t]; - } - setOption(t, e) { - return ( - e !== void 0 && (this.table.options[t] = e), - this.table.options[t] - ); - } - deprecationCheck(t, e, i) { - return this.table.deprecationAdvisor.check(t, e, i); - } - deprecationCheckMsg(t, e) { - return this.table.deprecationAdvisor.checkMsg(t, e); - } - deprecationMsg(t) { - return this.table.deprecationAdvisor.msg(t); - } - module(t) { - return this.table.module(t); - } - } - class j { - constructor(t) { - return ( - (this._column = t), - (this.type = "ColumnComponent"), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._column.table.componentFunctionBinder.handle( - "column", - e._column, - i - ); - }, - }) - ); - } - getElement() { - return this._column.getElement(); - } - getDefinition() { - return this._column.getDefinition(); - } - getField() { - return this._column.getField(); - } - getTitleDownload() { - return this._column.getTitleDownload(); - } - getCells() { - var t = []; - return ( - this._column.cells.forEach(function (e) { - t.push(e.getComponent()); - }), - t - ); - } - isVisible() { - return this._column.visible; - } - show() { - this._column.isGroup - ? this._column.columns.forEach(function (t) { - t.show(); - }) - : this._column.show(); - } - hide() { - this._column.isGroup - ? this._column.columns.forEach(function (t) { - t.hide(); - }) - : this._column.hide(); - } - toggle() { - this._column.visible ? this.hide() : this.show(); - } - delete() { - return this._column.delete(); - } - getSubColumns() { - var t = []; - return ( - this._column.columns.length && - this._column.columns.forEach(function (e) { - t.push(e.getComponent()); - }), - t - ); - } - getParentColumn() { - return this._column.getParentComponent(); - } - _getSelf() { - return this._column; - } - scrollTo(t, e) { - return this._column.table.columnManager.scrollToColumn( - this._column, - t, - e - ); - } - getTable() { - return this._column.table; - } - move(t, e) { - var i = this._column.table.columnManager.findColumn(t); - i - ? this._column.table.columnManager.moveColumn( - this._column, - i, - e - ) - : console.warn("Move Error - No matching column found:", i); - } - getNextColumn() { - var t = this._column.nextColumn(); - return !!t && t.getComponent(); - } - getPrevColumn() { - var t = this._column.prevColumn(); - return !!t && t.getComponent(); - } - updateDefinition(t) { - return this._column.updateDefinition(t); - } - getWidth() { - return this._column.getWidth(); - } - setWidth(t) { - var e; - return ( - (e = - t === !0 - ? this._column.reinitializeWidth(!0) - : this._column.setWidth(t)), - this._column.table.columnManager.rerenderColumns(!0), - e - ); - } - } - var re = { - title: void 0, - field: void 0, - columns: void 0, - visible: void 0, - hozAlign: void 0, - vertAlign: void 0, - width: void 0, - minWidth: 40, - maxWidth: void 0, - maxInitialWidth: void 0, - cssClass: void 0, - variableHeight: void 0, - headerVertical: void 0, - headerHozAlign: void 0, - headerWordWrap: !1, - editableTitle: void 0, - }; - class ae { - constructor(t) { - return ( - (this._cell = t), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._cell.table.componentFunctionBinder.handle( - "cell", - e._cell, - i - ); - }, - }) - ); - } - getValue() { - return this._cell.getValue(); - } - getOldValue() { - return this._cell.getOldValue(); - } - getInitialValue() { - return this._cell.initialValue; - } - getElement() { - return this._cell.getElement(); - } - getRow() { - return this._cell.row.getComponent(); - } - getData(t) { - return this._cell.row.getData(t); - } - getType() { - return "cell"; - } - getField() { - return this._cell.column.getField(); - } - getColumn() { - return this._cell.column.getComponent(); - } - setValue(t, e) { - e === void 0 && (e = !0), this._cell.setValue(t, e); - } - restoreOldValue() { - this._cell.setValueActual(this._cell.getOldValue()); - } - restoreInitialValue() { - this._cell.setValueActual(this._cell.initialValue); - } - checkHeight() { - this._cell.checkHeight(); - } - getTable() { - return this._cell.table; - } - _getSelf() { - return this._cell; - } - } - class et extends C { - constructor(t, e) { - super(t.table), - (this.table = t.table), - (this.column = t), - (this.row = e), - (this.element = null), - (this.value = null), - this.initialValue, - (this.oldValue = null), - (this.modules = {}), - (this.height = null), - (this.width = null), - (this.minWidth = null), - (this.component = null), - (this.loaded = !1), - this.build(); - } - build() { - this.generateElement(), - this.setWidth(), - this._configureCell(), - this.setValueActual( - this.column.getFieldValue(this.row.data) - ), - (this.initialValue = this.value); - } - generateElement() { - (this.element = document.createElement("div")), - (this.element.className = "tabulator-cell"), - this.element.setAttribute("role", "gridcell"), - this.column.isRowHeader && - this.element.classList.add("tabulator-row-header"); - } - _configureCell() { - var t = this.element, - e = this.column.getField(); - (t.style.textAlign = this.column.hozAlign), - this.column.vertAlign && - ((t.style.display = "inline-flex"), - (t.style.alignItems = - { - top: "flex-start", - bottom: "flex-end", - middle: "center", - }[this.column.vertAlign] || ""), - this.column.hozAlign && - (t.style.justifyContent = - { - left: "flex-start", - right: "flex-end", - center: "center", - }[this.column.hozAlign] || "")), - e && t.setAttribute("tabulator-field", e), - this.column.definition.cssClass && - this.column.definition.cssClass - .split(" ") - .forEach((i) => { - t.classList.add(i); - }), - this.dispatch("cell-init", this), - this.column.visible || this.hide(); - } - _generateContents() { - var t; - switch ( - typeof (t = this.chain( - "cell-format", - this, - null, - () => (this.element.innerHTML = this.value) - )) - ) { - case "object": - if (t instanceof Node) { - for (; this.element.firstChild; ) - this.element.removeChild( - this.element.firstChild - ); - this.element.appendChild(t); - } else (this.element.innerHTML = ""), t != 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:", t); - break; - case "undefined": - this.element.innerHTML = ""; - break; - default: - this.element.innerHTML = t; - } - } - cellRendered() { - this.dispatch("cell-rendered", this); - } - getElement(t) { - return ( - this.loaded || - ((this.loaded = !0), t || this.layoutElement()), - this.element - ); - } - getValue() { - return this.value; - } - getOldValue() { - return this.oldValue; - } - setValue(t, e, i) { - this.setValueProcessData(t, e, i) && - (this.dispatch("cell-value-updated", this), - this.cellRendered(), - this.column.definition.cellEdited && - this.column.definition.cellEdited.call( - this.table, - this.getComponent() - ), - this.dispatchExternal("cellEdited", this.getComponent()), - this.subscribedExternal("dataChanged") && - this.dispatchExternal( - "dataChanged", - this.table.rowManager.getData() - )); - } - setValueProcessData(t, e, i) { - var o = !1; - return ( - (this.value !== t || i) && - ((o = !0), - e && - (t = this.chain( - "cell-value-changing", - [this, t], - null, - t - ))), - this.setValueActual(t), - o && this.dispatch("cell-value-changed", this), - o - ); - } - setValueActual(t) { - (this.oldValue = this.value), - (this.value = t), - this.dispatch("cell-value-save-before", this), - this.column.setFieldValue(this.row.data, t), - this.dispatch("cell-value-save-after", this), - this.loaded && this.layoutElement(); - } - layoutElement() { - this._generateContents(), this.dispatch("cell-layout", this); - } - setWidth() { - (this.width = this.column.width), - (this.element.style.width = this.column.widthStyled); - } - clearWidth() { - (this.width = ""), (this.element.style.width = ""); - } - getWidth() { - return this.width || this.element.offsetWidth; - } - setMinWidth() { - (this.minWidth = this.column.minWidth), - (this.element.style.minWidth = this.column.minWidthStyled); - } - setMaxWidth() { - (this.maxWidth = this.column.maxWidth), - (this.element.style.maxWidth = this.column.maxWidthStyled); - } - checkHeight() { - this.row.reinitializeHeight(); - } - clearHeight() { - (this.element.style.height = ""), - (this.height = null), - this.dispatch("cell-height", this, ""); - } - setHeight() { - (this.height = this.row.height), - (this.element.style.height = this.row.heightStyled), - this.dispatch("cell-height", this, this.row.heightStyled); - } - getHeight() { - return this.height || this.element.offsetHeight; - } - show() { - this.element.style.display = this.column.vertAlign - ? "inline-flex" - : ""; - } - hide() { - this.element.style.display = "none"; - } - delete() { - this.dispatch("cell-delete", this), - !this.table.rowManager.redrawBlock && - this.element.parentNode && - this.element.parentNode.removeChild(this.element), - (this.element = !1), - this.column.deleteCell(this), - this.row.deleteCell(this), - (this.calcs = {}); - } - getIndex() { - return this.row.getCellIndex(this); - } - getComponent() { - return ( - this.component || (this.component = new ae(this)), - this.component - ); - } - } - let J = class J extends C { - constructor(t, e, i) { - super(e.table), - (this.definition = t), - (this.parent = e), - (this.type = "column"), - (this.columns = []), - (this.cells = []), - (this.isGroup = !1), - (this.isRowHeader = i), - (this.element = this.createElement()), - (this.contentElement = !1), - (this.titleHolderElement = !1), - (this.titleElement = !1), - (this.groupElement = this.createGroupElement()), - (this.hozAlign = ""), - (this.vertAlign = ""), - (this.field = ""), - (this.fieldStructure = ""), - (this.getFieldValue = ""), - (this.setFieldValue = ""), - (this.titleDownload = null), - (this.titleFormatterRendered = !1), - this.mapDefinitions(), - this.setField(this.definition.field), - (this.modules = {}), - (this.width = null), - (this.widthStyled = ""), - (this.maxWidth = null), - (this.maxWidthStyled = ""), - (this.maxInitialWidth = null), - (this.minWidth = null), - (this.minWidthStyled = ""), - (this.widthFixed = !1), - (this.visible = !0), - (this.component = null), - this.definition.columns - ? ((this.isGroup = !0), - this.definition.columns.forEach((o, n) => { - var r = new J(o, this); - this.attachColumn(r); - }), - this.checkColumnVisibility()) - : e.registerColumnField(this), - this._initialize(); - } - createElement() { - var t = document.createElement("div"); - switch ( - (t.classList.add("tabulator-col"), - t.setAttribute("role", "columnheader"), - t.setAttribute("aria-sort", "none"), - this.isRowHeader && t.classList.add("tabulator-row-header"), - this.table.options.columnHeaderVertAlign) - ) { - case "middle": - t.style.justifyContent = "center"; - break; - case "bottom": - t.style.justifyContent = "flex-end"; - } - return t; - } - createGroupElement() { - var t = document.createElement("div"); - return t.classList.add("tabulator-col-group-cols"), t; - } - mapDefinitions() { - var t = this.table.options.columnDefaults; - if (t) - for (let e in t) - this.definition[e] === void 0 && - (this.definition[e] = t[e]); - this.definition = this.table.columnManager.optionsList.generate( - J.defaultOptionList, - this.definition - ); - } - checkDefinition() { - Object.keys(this.definition).forEach((t) => { - J.defaultOptionList.indexOf(t) === -1 && - console.warn( - "Invalid column definition option in '" + - (this.field || this.definition.title) + - "' column:", - t - ); - }); - } - setField(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); - } - registerColumnPosition(t) { - this.parent.registerColumnPosition(t); - } - registerColumnField(t) { - this.parent.registerColumnField(t); - } - reRegisterPosition() { - this.isGroup - ? this.columns.forEach(function (t) { - t.reRegisterPosition(); - }) - : this.registerColumnPosition(this); - } - _initialize() { - for (var t = this.definition; this.element.firstChild; ) - this.element.removeChild(this.element.firstChild); - t.headerVertical && - (this.element.classList.add("tabulator-col-vertical"), - t.headerVertical === "flip" && - this.element.classList.add( - "tabulator-col-vertical-flip" - )), - (this.contentElement = this._buildColumnHeaderContent()), - this.element.appendChild(this.contentElement), - this.isGroup - ? this._buildGroupHeader() - : this._buildColumnHeader(), - this.dispatch("column-init", this); - } - _buildColumnHeader() { - var t = this.definition; - this.dispatch("column-layout", this), - t.visible !== void 0 && - (t.visible ? this.show(!0) : this.hide(!0)), - t.cssClass && - t.cssClass.split(" ").forEach((e) => { - this.element.classList.add(e); - }), - t.field && - this.element.setAttribute("tabulator-field", t.field), - this.setMinWidth(parseInt(t.minWidth)), - t.maxInitialWidth && - (this.maxInitialWidth = parseInt(t.maxInitialWidth)), - t.maxWidth && this.setMaxWidth(parseInt(t.maxWidth)), - this.reinitializeWidth(), - (this.hozAlign = this.definition.hozAlign), - (this.vertAlign = this.definition.vertAlign), - (this.titleElement.style.textAlign = - this.definition.headerHozAlign); - } - _buildColumnHeaderContent() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-col-content"), - (this.titleHolderElement = document.createElement("div")), - this.titleHolderElement.classList.add( - "tabulator-col-title-holder" - ), - t.appendChild(this.titleHolderElement), - (this.titleElement = this._buildColumnHeaderTitle()), - this.titleHolderElement.appendChild(this.titleElement), - t - ); - } - _buildColumnHeaderTitle() { - var t = this.definition, - e = document.createElement("div"); - if ( - (e.classList.add("tabulator-col-title"), - t.headerWordWrap && - e.classList.add("tabulator-col-title-wrap"), - t.editableTitle) - ) { - var i = document.createElement("input"); - i.classList.add("tabulator-title-editor"), - i.addEventListener("click", (o) => { - o.stopPropagation(), i.focus(); - }), - i.addEventListener("mousedown", (o) => { - o.stopPropagation(); - }), - i.addEventListener("change", () => { - (t.title = i.value), - this.dispatchExternal( - "columnTitleChanged", - this.getComponent() - ); - }), - e.appendChild(i), - t.field - ? this.langBind("columns|" + t.field, (o) => { - i.value = o || t.title || " "; - }) - : (i.value = t.title || " "); - } else - t.field - ? this.langBind("columns|" + t.field, (o) => { - this._formatColumnHeaderTitle( - e, - o || t.title || " " - ); - }) - : this._formatColumnHeaderTitle(e, t.title || " "); - return e; - } - _formatColumnHeaderTitle(t, e) { - var i = this.chain( - "column-format", - [this, e, t], - null, - () => e - ); - switch (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": - t.innerHTML = ""; - break; - default: - t.innerHTML = i; - } - } - _buildGroupHeader() { - 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((t) => { - this.element.classList.add(t); - }), - (this.titleElement.style.textAlign = - this.definition.headerHozAlign), - this.element.appendChild(this.groupElement); - } - _getFlatData(t) { - return t[this.field]; - } - _getNestedData(t) { - var e, - i = t, - o = this.fieldStructure, - n = o.length; - for (let r = 0; r < n && ((e = i = i[o[r]]), i); r++); - return e; - } - _setFlatData(t, e) { - this.field && (t[this.field] = e); - } - _setNestedData(t, e) { - var i = t, - o = this.fieldStructure, - n = o.length; - for (let r = 0; r < n; r++) - if (r == n - 1) i[o[r]] = e; - else { - if (!i[o[r]]) { - if (e === void 0) break; - i[o[r]] = {}; - } - i = i[o[r]]; - } - } - attachColumn(t) { - this.groupElement - ? (this.columns.push(t), - this.groupElement.appendChild(t.getElement()), - t.columnRendered()) - : console.warn( - "Column Warning - Column being attached to another column instead of column group" - ); - } - verticalAlign(t, e) { - var i = this.parent.isGroup - ? this.parent.getGroupElement().clientHeight - : e || this.parent.getHeadersElement().clientHeight; - (this.element.style.height = i + "px"), - this.dispatch( - "column-height", - this, - this.element.style.height - ), - this.isGroup && - (this.groupElement.style.minHeight = - i - this.contentElement.offsetHeight + "px"), - this.columns.forEach(function (o) { - o.verticalAlign(t); - }); - } - clearVerticalAlign() { - (this.element.style.paddingTop = ""), - (this.element.style.height = ""), - (this.element.style.minHeight = ""), - (this.groupElement.style.minHeight = ""), - this.columns.forEach(function (t) { - t.clearVerticalAlign(); - }), - this.dispatch("column-height", this, ""); - } - getElement() { - return this.element; - } - getGroupElement() { - return this.groupElement; - } - getField() { - return this.field; - } - getTitleDownload() { - return this.titleDownload; - } - getFirstColumn() { - return this.isGroup - ? !!this.columns.length && this.columns[0].getFirstColumn() - : this; - } - getLastColumn() { - return this.isGroup - ? !!this.columns.length && - this.columns[this.columns.length - 1].getLastColumn() - : this; - } - getColumns(t) { - var e = []; - return ( - t - ? this.columns.forEach((i) => { - e.push(i), (e = e.concat(i.getColumns(!0))); - }) - : (e = this.columns), - e - ); - } - getCells() { - return this.cells; - } - getTopColumn() { - return this.parent.isGroup ? this.parent.getTopColumn() : this; - } - getDefinition(t) { - var e = []; - return ( - this.isGroup && - t && - (this.columns.forEach(function (i) { - e.push(i.getDefinition(!0)); - }), - (this.definition.columns = e)), - this.definition - ); - } - checkColumnVisibility() { - var t = !1; - this.columns.forEach(function (e) { - e.visible && (t = !0); - }), - t - ? (this.show(), - this.dispatchExternal( - "columnVisibilityChanged", - this.getComponent(), - !1 - )) - : this.hide(); - } - show(t, e) { - this.visible || - ((this.visible = !0), - (this.element.style.display = ""), - this.parent.isGroup && this.parent.checkColumnVisibility(), - this.cells.forEach(function (i) { - i.show(); - }), - this.isGroup || - this.width !== null || - this.reinitializeWidth(), - this.table.columnManager.verticalAlignHeaders(), - this.dispatch("column-show", this, e), - t || - this.dispatchExternal( - "columnVisibilityChanged", - this.getComponent(), - !0 - ), - this.parent.isGroup && this.parent.matchChildWidths(), - this.silent || this.table.columnManager.rerenderColumns()); - } - hide(t, e) { - this.visible && - ((this.visible = !1), - (this.element.style.display = "none"), - this.table.columnManager.verticalAlignHeaders(), - this.parent.isGroup && this.parent.checkColumnVisibility(), - this.cells.forEach(function (i) { - i.hide(); - }), - this.dispatch("column-hide", this, e), - t || - this.dispatchExternal( - "columnVisibilityChanged", - this.getComponent(), - !1 - ), - this.parent.isGroup && this.parent.matchChildWidths(), - this.silent || this.table.columnManager.rerenderColumns()); - } - matchChildWidths() { - var t = 0; - this.contentElement && - this.columns.length && - (this.columns.forEach(function (e) { - e.visible && (t += e.getWidth()); - }), - (this.contentElement.style.maxWidth = t - 1 + "px"), - this.table.initialized && - (this.element.style.width = t + "px"), - this.parent.isGroup && this.parent.matchChildWidths()); - } - removeChild(t) { - var e = this.columns.indexOf(t); - e > -1 && this.columns.splice(e, 1), - this.columns.length || this.delete(); - } - setWidth(t) { - (this.widthFixed = !0), this.setWidthActual(t); - } - setWidthActual(t) { - isNaN(t) && - (t = Math.floor( - (this.table.element.clientWidth / 100) * parseInt(t) - )), - (t = Math.max(this.minWidth, t)), - this.maxWidth && (t = Math.min(this.maxWidth, t)), - (this.width = t), - (this.widthStyled = t ? t + "px" : ""), - (this.element.style.width = this.widthStyled), - this.isGroup || - this.cells.forEach(function (e) { - e.setWidth(); - }), - this.parent.isGroup && this.parent.matchChildWidths(), - this.dispatch("column-width", this), - this.subscribedExternal("columnWidth") && - this.dispatchExternal( - "columnWidth", - this.getComponent() - ); - } - checkCellHeights() { - var t = []; - this.cells.forEach(function (e) { - e.row.heightInitialized && - (e.row.getElement().offsetParent !== null - ? (t.push(e.row), e.row.clearCellHeight()) - : (e.row.heightInitialized = !1)); - }), - t.forEach(function (e) { - e.calcHeight(); - }), - t.forEach(function (e) { - e.setCellHeight(); - }); - } - getWidth() { - var t = 0; - return ( - this.isGroup - ? this.columns.forEach(function (e) { - e.visible && (t += e.getWidth()); - }) - : (t = this.width), - t - ); - } - getLeftOffset() { - var t = this.element.offsetLeft; - return ( - this.parent.isGroup && (t += this.parent.getLeftOffset()), t - ); - } - getHeight() { - return Math.ceil(this.element.getBoundingClientRect().height); - } - setMinWidth(t) { - this.maxWidth && - t > this.maxWidth && - ((t = this.maxWidth), - console.warn( - "the minWidth (" + - t + - "px) for column '" + - this.field + - "' cannot be bigger that its maxWidth (" + - this.maxWidthStyled + - ")" - )), - (this.minWidth = t), - (this.minWidthStyled = t ? t + "px" : ""), - (this.element.style.minWidth = this.minWidthStyled), - this.cells.forEach(function (e) { - e.setMinWidth(); - }); - } - setMaxWidth(t) { - this.minWidth && - t < this.minWidth && - ((t = this.minWidth), - console.warn( - "the maxWidth (" + - t + - "px) for column '" + - this.field + - "' cannot be smaller that its minWidth (" + - this.minWidthStyled + - ")" - )), - (this.maxWidth = t), - (this.maxWidthStyled = t ? t + "px" : ""), - (this.element.style.maxWidth = this.maxWidthStyled), - this.cells.forEach(function (e) { - e.setMaxWidth(); - }); - } - delete() { - return new Promise((t, e) => { - this.isGroup && - this.columns.forEach(function (o) { - o.delete(); - }), - this.dispatch("column-delete", this); - var i = this.cells.length; - for (let o = 0; o < i; o++) this.cells[0].delete(); - this.element.parentNode && - this.element.parentNode.removeChild(this.element), - (this.element = !1), - (this.contentElement = !1), - (this.titleElement = !1), - (this.groupElement = !1), - this.parent.isGroup && this.parent.removeChild(this), - this.table.columnManager.deregisterColumn(this), - this.table.columnManager.rerenderColumns(!0), - this.dispatch("column-deleted", this), - t(); - }); - } - columnRendered() { - this.titleFormatterRendered && this.titleFormatterRendered(), - this.dispatch("column-rendered", this); - } - generateCell(t) { - var e = new et(this, t); - return this.cells.push(e), e; - } - nextColumn() { - var t = this.table.columnManager.findColumnIndex(this); - return t > -1 && this._nextVisibleColumn(t + 1); - } - _nextVisibleColumn(t) { - var e = this.table.columnManager.getColumnByIndex(t); - return !e || e.visible ? e : this._nextVisibleColumn(t + 1); - } - prevColumn() { - var t = this.table.columnManager.findColumnIndex(this); - return t > -1 && this._prevVisibleColumn(t - 1); - } - _prevVisibleColumn(t) { - var e = this.table.columnManager.getColumnByIndex(t); - return !e || e.visible ? e : this._prevVisibleColumn(t - 1); - } - reinitializeWidth(t) { - (this.widthFixed = !1), - this.definition.width === void 0 || - t || - this.setWidth(this.definition.width), - this.dispatch("column-width-fit-before", this), - this.fitToData(t), - this.dispatch("column-width-fit-after", this); - } - fitToData(t) { - if (!this.isGroup) { - this.widthFixed || - ((this.element.style.width = ""), - this.cells.forEach((o) => { - o.clearWidth(); - })); - var e = this.element.offsetWidth; - if ( - (!this.width || !this.widthFixed) && - (this.cells.forEach((o) => { - var n = o.getWidth(); - n > e && (e = n); - }), - e) - ) { - var i = e + 1; - t - ? this.setWidth(i) - : (this.maxInitialWidth && - !t && - (i = Math.min(i, this.maxInitialWidth)), - this.setWidthActual(i)); - } - } - } - updateDefinition(t) { - var e; - return this.isGroup || this.parent.isGroup - ? (console.error( - "Column Update Error - The updateDefinition function is only available on ungrouped columns" - ), - Promise.reject( - "Column Update Error - The updateDefinition function is only available on columns, not column groups" - )) - : ((e = Object.assign({}, this.getDefinition())), - (e = Object.assign(e, t)), - this.table.columnManager - .addColumn(e, !1, this) - .then( - (i) => ( - e.field == this.field && (this.field = !1), - this.delete().then(() => i.getComponent()) - ) - )); - } - deleteCell(t) { - var e = this.cells.indexOf(t); - e > -1 && this.cells.splice(e, 1); - } - getComponent() { - return ( - this.component || (this.component = new j(this)), - this.component - ); - } - getPosition() { - return ( - this.table.columnManager - .getVisibleColumnsByIndex() - .indexOf(this) + 1 - ); - } - getParentComponent() { - return this.parent instanceof J && this.parent.getComponent(); - } - }; - b(J, "defaultOptionList", re); - let G = J; - class x { - static elVisible(t) { - return !(t.offsetWidth <= 0 && t.offsetHeight <= 0); - } - static elOffset(t) { - var e = t.getBoundingClientRect(); - return { - top: - e.top + - window.pageYOffset - - document.documentElement.clientTop, - left: - e.left + - window.pageXOffset - - document.documentElement.clientLeft, - }; - } - static retrieveNestedData(t, e, i) { - var o, - n = t ? e.split(t) : [e], - r = n.length; - for (let a = 0; a < r && ((o = i = i[n[a]]), i); a++); - return o; - } - static deepClone(t, e, i = []) { - var o = {}.__proto__, - n = [].__proto__; - for (var r in (e || - (e = Object.assign(Array.isArray(t) ? [] : {}, t)), - t)) { - let a, - l, - h = t[r]; - h == null || - typeof h != "object" || - (h.__proto__ !== o && h.__proto__ !== n) || - ((a = i.findIndex((d) => d.subject === h)), - a > -1 - ? (e[r] = i[a].copy) - : ((l = Object.assign( - Array.isArray(h) ? [] : {}, - h - )), - i.unshift({ subject: h, copy: l }), - (e[r] = this.deepClone(h, l, i)))); - } - return e; - } - } - class le { - constructor(t, e, i = {}) { - (this.table = t), - (this.msgType = e), - (this.registeredDefaults = Object.assign({}, i)); - } - register(t, e) { - this.registeredDefaults[t] = e; - } - generate(t, e = {}) { - var i = Object.assign({}, this.registeredDefaults), - o = - this.table.options.debugInvalidOptions || - e.debugInvalidOptions === !0; - Object.assign(i, t); - for (let n in e) - i.hasOwnProperty(n) || - (o && - console.warn( - "Invalid " + this.msgType + " option:", - n - ), - (i[n] = e.key)); - for (let n in i) - n in e - ? (i[n] = e[n]) - : Array.isArray(i[n]) - ? (i[n] = Object.assign([], i[n])) - : typeof i[n] == "object" && i[n] !== null - ? (i[n] = Object.assign({}, i[n])) - : i[n] === void 0 && delete i[n]; - return i; - } - } - class lt extends C { - constructor(t) { - super(t), - (this.elementVertical = t.rowManager.element), - (this.elementHorizontal = t.columnManager.element), - (this.tableElement = t.rowManager.tableElement), - (this.verticalFillMode = "fit"); - } - initialize() {} - clearRows() {} - clearColumns() {} - reinitializeColumnWidths(t) {} - renderRows() {} - renderColumns() {} - rerenderRows(t) { - t && t(); - } - rerenderColumns(t, e) {} - renderRowCells(t) {} - rerenderRowCells(t, e) {} - scrollColumns(t, e) {} - scrollRows(t, e) {} - resize() {} - scrollToRow(t) {} - scrollToRowNearestTop(t) {} - visibleRows(t) { - return []; - } - rows() { - return this.table.rowManager.getDisplayRows(); - } - styleRow(t, e) { - var i = t.getElement(); - e % 2 - ? (i.classList.add("tabulator-row-even"), - i.classList.remove("tabulator-row-odd")) - : (i.classList.add("tabulator-row-odd"), - i.classList.remove("tabulator-row-even")); - } - clear() { - this.clearRows(), this.clearColumns(); - } - render() { - this.renderRows(), this.renderColumns(); - } - rerender(t) { - this.rerenderRows(), this.rerenderColumns(); - } - scrollToRowPosition(t, e, i) { - var o = this.rows().indexOf(t), - n = t.getElement(), - r = 0; - return new Promise((a, l) => { - if (o > -1) { - if ( - (i === void 0 && - (i = this.table.options.scrollToRowIfVisible), - !i && - x.elVisible(n) && - (r = - x.elOffset(n).top - - x.elOffset(this.elementVertical).top) > 0 && - r < - this.elementVertical.clientHeight - - n.offsetHeight) - ) - return a(), !1; - switch ( - (e === void 0 && - (e = this.table.options.scrollToRowPosition), - e === "nearest" && - (e = this.scrollToRowNearestTop(t) - ? "top" - : "bottom"), - this.scrollToRow(t), - e) - ) { - case "middle": - case "center": - this.elementVertical.scrollHeight - - this.elementVertical.scrollTop == - this.elementVertical.clientHeight - ? (this.elementVertical.scrollTop = - this.elementVertical.scrollTop + - (n.offsetTop - - this.elementVertical.scrollTop) - - (this.elementVertical.scrollHeight - - n.offsetTop) / - 2) - : (this.elementVertical.scrollTop = - this.elementVertical.scrollTop - - this.elementVertical.clientHeight / - 2); - break; - case "bottom": - this.elementVertical.scrollHeight - - this.elementVertical.scrollTop == - this.elementVertical.clientHeight - ? (this.elementVertical.scrollTop = - this.elementVertical.scrollTop - - (this.elementVertical.scrollHeight - - n.offsetTop) + - n.offsetHeight) - : (this.elementVertical.scrollTop = - this.elementVertical.scrollTop - - this.elementVertical.clientHeight + - n.offsetHeight); - break; - case "top": - this.elementVertical.scrollTop = n.offsetTop; - } - a(); - } else - console.warn("Scroll Error - Row not visible"), - l("Scroll Error - Row not visible"); - }); - } - } - class ve extends lt { - constructor(t) { - super(t); - } - renderRowCells(t, e) { - let i = document.createDocumentFragment(); - t.cells.forEach((o) => { - i.appendChild(o.getElement()); - }), - t.element.appendChild(i), - e || - t.cells.forEach((o) => { - o.cellRendered(); - }); - } - reinitializeColumnWidths(t) { - t.forEach(function (e) { - e.reinitializeWidth(); - }); - } - } - class we extends lt { - constructor(t) { - super(t), - (this.leftCol = 0), - (this.rightCol = 0), - (this.scrollLeft = 0), - (this.vDomScrollPosLeft = 0), - (this.vDomScrollPosRight = 0), - (this.vDomPadLeft = 0), - (this.vDomPadRight = 0), - (this.fitDataColAvg = 0), - (this.windowBuffer = 200), - (this.visibleRows = null), - (this.initialized = !1), - (this.isFitData = !1), - (this.columns = []); - } - initialize() { - this.compatibilityCheck(), - this.layoutCheck(), - this.vertScrollListen(); - } - compatibilityCheck() { - this.options("layout") == "fitDataTable" && - console.warn( - "Horizontal Virtual DOM is not compatible with fitDataTable layout mode" - ), - this.options("responsiveLayout") && - console.warn( - "Horizontal Virtual DOM is not compatible with responsive columns" - ), - this.options("rtl") && - console.warn( - "Horizontal Virtual DOM is not currently compatible with RTL text direction" - ); - } - layoutCheck() { - this.isFitData = this.options("layout").startsWith("fitData"); - } - vertScrollListen() { - this.subscribe( - "scroll-vertical", - this.clearVisRowCache.bind(this) - ), - this.subscribe( - "data-refreshed", - this.clearVisRowCache.bind(this) - ); - } - clearVisRowCache() { - this.visibleRows = null; - } - renderColumns(t, e) { - this.dataChange(); - } - scrollColumns(t, e) { - this.scrollLeft != t && - ((this.scrollLeft = t), - this.scroll( - t - (this.vDomScrollPosLeft + this.windowBuffer) - )); - } - calcWindowBuffer() { - var t = this.elementVertical.clientWidth; - this.table.columnManager.columnsByIndex.forEach((e) => { - if (e.visible) { - var i = e.getWidth(); - i > t && (t = i); - } - }), - (this.windowBuffer = 2 * t); - } - rerenderColumns(t, e) { - var i = { - cols: this.columns, - leftCol: this.leftCol, - rightCol: this.rightCol, - }, - o = 0; - (t && !this.initialized) || - (this.clear(), - this.calcWindowBuffer(), - (this.scrollLeft = this.elementVertical.scrollLeft), - (this.vDomScrollPosLeft = - this.scrollLeft - this.windowBuffer), - (this.vDomScrollPosRight = - this.scrollLeft + - this.elementVertical.clientWidth + - this.windowBuffer), - this.table.columnManager.columnsByIndex.forEach((n) => { - var r, - a = {}; - n.visible && - (n.modules.frozen || - ((r = n.getWidth()), - (a.leftPos = o), - (a.rightPos = o + r), - (a.width = r), - this.isFitData && - (a.fitDataCheck = - !n.modules.vdomHoz || - n.modules.vdomHoz.fitDataCheck), - o + r > this.vDomScrollPosLeft && - o < this.vDomScrollPosRight - ? (this.leftCol == -1 && - ((this.leftCol = this.columns.length), - (this.vDomPadLeft = o)), - (this.rightCol = this.columns.length)) - : this.leftCol !== -1 && - (this.vDomPadRight += r), - this.columns.push(n), - (n.modules.vdomHoz = a), - (o += r))); - }), - (this.tableElement.style.paddingLeft = - this.vDomPadLeft + "px"), - (this.tableElement.style.paddingRight = - this.vDomPadRight + "px"), - (this.initialized = !0), - e || - (t && !this.reinitChanged(i)) || - this.reinitializeRows(), - (this.elementVertical.scrollLeft = this.scrollLeft)); - } - renderRowCells(t) { - if (this.initialized) this.initializeRow(t); - else { - let e = document.createDocumentFragment(); - t.cells.forEach((i) => { - e.appendChild(i.getElement()); - }), - t.element.appendChild(e), - t.cells.forEach((i) => { - i.cellRendered(); - }); - } - } - rerenderRowCells(t, e) { - this.reinitializeRow(t, e); - } - reinitializeColumnWidths(t) { - for (let e = this.leftCol; e <= this.rightCol; e++) { - let i = this.columns[e]; - i && i.reinitializeWidth(); - } - } - deinitialize() { - this.initialized = !1; - } - clear() { - (this.columns = []), - (this.leftCol = -1), - (this.rightCol = 0), - (this.vDomScrollPosLeft = 0), - (this.vDomScrollPosRight = 0), - (this.vDomPadLeft = 0), - (this.vDomPadRight = 0); - } - dataChange() { - var t, - e, - i = !1; - if (this.isFitData) { - if ( - (this.table.columnManager.columnsByIndex.forEach( - (o) => { - !o.definition.width && o.visible && (i = !0); - } - ), - i && - this.table.rowManager.getDisplayRows().length && - ((this.vDomScrollPosRight = - this.scrollLeft + - this.elementVertical.clientWidth + - this.windowBuffer), - (t = this.chain("rows-sample", [1], [], () => - this.table.rowManager.getDisplayRows() - )[0]))) - ) { - (e = t.getElement()), - t.generateCells(), - this.tableElement.appendChild(e); - for (let o = 0; o < t.cells.length; o++) { - let n = t.cells[o]; - e.appendChild(n.getElement()), - n.column.reinitializeWidth(); - } - e.parentNode.removeChild(e), - this.rerenderColumns(!1, !0); - } - } else this.options("layout") === "fitColumns" && (this.layoutRefresh(), this.rerenderColumns(!1, !0)); - } - reinitChanged(t) { - var e = !0; - return ( - t.cols.length !== this.columns.length || - t.leftCol !== this.leftCol || - t.rightCol !== this.rightCol || - (t.cols.forEach((i, o) => { - i !== this.columns[o] && (e = !1); - }), - !e) - ); - } - reinitializeRows() { - var t = this.getVisibleRows(), - e = this.table.rowManager - .getRows() - .filter((i) => !t.includes(i)); - t.forEach((i) => { - this.reinitializeRow(i, !0); - }), - e.forEach((i) => { - i.deinitialize(); - }); - } - getVisibleRows() { - return ( - this.visibleRows || - (this.visibleRows = - this.table.rowManager.getVisibleRows()), - this.visibleRows - ); - } - scroll(t) { - (this.vDomScrollPosLeft += t), - (this.vDomScrollPosRight += t), - Math.abs(t) > this.windowBuffer / 2 - ? this.rerenderColumns() - : t > 0 - ? (this.addColRight(), this.removeColLeft()) - : (this.addColLeft(), this.removeColRight()); - } - colPositionAdjust(t, e, i) { - for (let o = t; o < e; o++) { - let n = this.columns[o]; - (n.modules.vdomHoz.leftPos += i), - (n.modules.vdomHoz.rightPos += i); - } - } - addColRight() { - for (var t = !1, e = !0; e; ) { - let i = this.columns[this.rightCol + 1]; - i && i.modules.vdomHoz.leftPos <= this.vDomScrollPosRight - ? ((t = !0), - this.getVisibleRows().forEach((o) => { - if (o.type !== "group") { - var n = o.getCell(i); - o - .getElement() - .insertBefore( - n.getElement(), - o - .getCell( - this.columns[this.rightCol] - ) - .getElement().nextSibling - ), - n.cellRendered(); - } - }), - this.fitDataColActualWidthCheck(i), - this.rightCol++, - this.getVisibleRows().forEach((o) => { - o.type !== "group" && - (o.modules.vdomHoz.rightCol = this.rightCol); - }), - this.rightCol >= this.columns.length - 1 - ? (this.vDomPadRight = 0) - : (this.vDomPadRight -= i.getWidth())) - : (e = !1); - } - t && - (this.tableElement.style.paddingRight = - this.vDomPadRight + "px"); - } - addColLeft() { - for (var t = !1, e = !0; e; ) { - let i = this.columns[this.leftCol - 1]; - if (i) - if ( - i.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft - ) { - (t = !0), - this.getVisibleRows().forEach((n) => { - if (n.type !== "group") { - var r = n.getCell(i); - n - .getElement() - .insertBefore( - r.getElement(), - n - .getCell( - this.columns[ - this.leftCol - ] - ) - .getElement() - ), - r.cellRendered(); - } - }), - this.leftCol--, - this.getVisibleRows().forEach((n) => { - n.type !== "group" && - (n.modules.vdomHoz.leftCol = - this.leftCol); - }), - this.leftCol <= 0 - ? (this.vDomPadLeft = 0) - : (this.vDomPadLeft -= i.getWidth()); - let o = this.fitDataColActualWidthCheck(i); - o && - ((this.scrollLeft = - this.elementVertical.scrollLeft = - this.elementVertical.scrollLeft + o), - (this.vDomPadRight -= o)); - } else e = !1; - else e = !1; - } - t && - (this.tableElement.style.paddingLeft = - this.vDomPadLeft + "px"); - } - removeColRight() { - for (var t = !1, e = !0; e; ) { - let i = this.columns[this.rightCol]; - i && i.modules.vdomHoz.leftPos > this.vDomScrollPosRight - ? ((t = !0), - this.getVisibleRows().forEach((o) => { - if (o.type !== "group") { - var n = o.getCell(i); - try { - o.getElement().removeChild( - n.getElement() - ); - } catch (r) { - console.warn( - "Could not removeColRight", - r.message - ); - } - } - }), - (this.vDomPadRight += i.getWidth()), - this.rightCol--, - this.getVisibleRows().forEach((o) => { - o.type !== "group" && - (o.modules.vdomHoz.rightCol = this.rightCol); - })) - : (e = !1); - } - t && - (this.tableElement.style.paddingRight = - this.vDomPadRight + "px"); - } - removeColLeft() { - for (var t = !1, e = !0; e; ) { - let i = this.columns[this.leftCol]; - i && i.modules.vdomHoz.rightPos < this.vDomScrollPosLeft - ? ((t = !0), - this.getVisibleRows().forEach((o) => { - if (o.type !== "group") { - var n = o.getCell(i); - try { - o.getElement().removeChild( - n.getElement() - ); - } catch (r) { - console.warn( - "Could not removeColLeft", - r.message - ); - } - } - }), - (this.vDomPadLeft += i.getWidth()), - this.leftCol++, - this.getVisibleRows().forEach((o) => { - o.type !== "group" && - (o.modules.vdomHoz.leftCol = this.leftCol); - })) - : (e = !1); - } - t && - (this.tableElement.style.paddingLeft = - this.vDomPadLeft + "px"); - } - fitDataColActualWidthCheck(t) { - var e, i; - return ( - t.modules.vdomHoz.fitDataCheck && - (t.reinitializeWidth(), - (i = (e = t.getWidth()) - t.modules.vdomHoz.width) && - ((t.modules.vdomHoz.rightPos += i), - (t.modules.vdomHoz.width = e), - this.colPositionAdjust( - this.columns.indexOf(t) + 1, - this.columns.length, - i - )), - (t.modules.vdomHoz.fitDataCheck = !1)), - i - ); - } - initializeRow(t) { - if (t.type !== "group") { - (t.modules.vdomHoz = { - leftCol: this.leftCol, - rightCol: this.rightCol, - }), - this.table.modules.frozenColumns && - this.table.modules.frozenColumns.leftColumns.forEach( - (e) => { - this.appendCell(t, e); - } - ); - for (let e = this.leftCol; e <= this.rightCol; e++) - this.appendCell(t, this.columns[e]); - this.table.modules.frozenColumns && - this.table.modules.frozenColumns.rightColumns.forEach( - (e) => { - this.appendCell(t, e); - } - ); - } - } - appendCell(t, e) { - if (e && e.visible) { - let i = t.getCell(e); - t.getElement().appendChild(i.getElement()), - i.cellRendered(); - } - } - reinitializeRow(t, e) { - if ( - t.type !== "group" && - (e || - !t.modules.vdomHoz || - t.modules.vdomHoz.leftCol !== this.leftCol || - t.modules.vdomHoz.rightCol !== this.rightCol) - ) { - for (var i = t.getElement(); i.firstChild; ) - i.removeChild(i.firstChild); - this.initializeRow(t); - } - } - } - class Ce extends C { - constructor(t) { - super(t), - (this.blockHozScrollEvent = !1), - (this.headersElement = null), - (this.contentsElement = null), - (this.rowHeader = null), - (this.element = null), - (this.columns = []), - (this.columnsByIndex = []), - (this.columnsByField = {}), - (this.scrollLeft = 0), - (this.optionsList = new le( - this.table, - "column definition", - re - )), - (this.redrawBlock = !1), - (this.redrawBlockUpdate = null), - (this.renderer = null); - } - initialize() { - this.initializeRenderer(), - (this.headersElement = this.createHeadersElement()), - (this.contentsElement = this.createHeaderContentsElement()), - (this.element = this.createHeaderElement()), - this.contentsElement.insertBefore( - this.headersElement, - this.contentsElement.firstChild - ), - this.element.insertBefore( - this.contentsElement, - this.element.firstChild - ), - this.initializeScrollWheelWatcher(), - this.subscribe( - "scroll-horizontal", - this.scrollHorizontal.bind(this) - ), - this.subscribe( - "scrollbar-vertical", - this.padVerticalScrollbar.bind(this) - ); - } - padVerticalScrollbar(t) { - this.table.rtl - ? (this.headersElement.style.marginLeft = t + "px") - : (this.headersElement.style.marginRight = t + "px"); - } - initializeRenderer() { - var t, - e = { virtual: we, basic: ve }; - (t = - typeof this.table.options.renderHorizontal == "string" - ? e[this.table.options.renderHorizontal] - : this.table.options.renderHorizontal) - ? ((this.renderer = new t( - this.table, - this.element, - this.tableElement - )), - this.renderer.initialize()) - : console.error( - "Unable to find matching renderer:", - this.table.options.renderHorizontal - ); - } - createHeadersElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-headers"), - t.setAttribute("role", "row"), - t - ); - } - createHeaderContentsElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-header-contents"), - t.setAttribute("role", "rowgroup"), - t - ); - } - createHeaderElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-header"), - t.setAttribute("role", "rowgroup"), - this.table.options.headerVisible || - t.classList.add("tabulator-header-hidden"), - t - ); - } - getElement() { - return this.element; - } - getContentsElement() { - return this.contentsElement; - } - getHeadersElement() { - return this.headersElement; - } - scrollHorizontal(t) { - (this.contentsElement.scrollLeft = t), - (this.scrollLeft = t), - this.renderer.scrollColumns(t); - } - initializeScrollWheelWatcher() { - this.contentsElement.addEventListener("wheel", (t) => { - var e; - t.deltaX && - ((e = this.contentsElement.scrollLeft + t.deltaX), - this.table.rowManager.scrollHorizontal(e), - this.table.columnManager.scrollHorizontal(e)); - }); - } - generateColumnsFromRowData(t) { - var e = [], - i = {}, - o = this.table.options.autoColumns === "full" ? t : [t[0]], - n = this.table.options.autoColumnsDefinitions; - if (t && t.length) { - if ( - (o.forEach((r) => { - Object.keys(r).forEach((a, l) => { - let h, - d = r[a]; - i[a] - ? i[a] !== !0 && - d !== void 0 && - ((i[a].sorter = - this.calculateSorterFromValue(d)), - (i[a] = !0)) - : ((h = { - field: a, - title: a, - sorter: this.calculateSorterFromValue( - d - ), - }), - e.splice(l, 0, h), - (i[a] = d !== void 0 || h)); - }); - }), - n) - ) - switch (typeof n) { - case "function": - this.table.options.columns = n.call( - this.table, - e - ); - break; - case "object": - Array.isArray(n) - ? e.forEach((r) => { - var a = n.find( - (l) => l.field === r.field - ); - a && Object.assign(r, a); - }) - : e.forEach((r) => { - n[r.field] && - Object.assign(r, n[r.field]); - }), - (this.table.options.columns = e); - } - else this.table.options.columns = e; - this.setColumns(this.table.options.columns); - } - } - calculateSorterFromValue(t) { - var e; - switch (typeof t) { - case "undefined": - e = "string"; - break; - case "boolean": - e = "boolean"; - break; - case "number": - e = "number"; - break; - case "object": - e = Array.isArray(t) ? "array" : "string"; - break; - default: - e = - isNaN(t) || t === "" - ? t.match( - /((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i - ) - ? "alphanum" - : "string" - : "number"; - } - return e; - } - setColumns(t, e) { - for (; this.headersElement.firstChild; ) - this.headersElement.removeChild( - this.headersElement.firstChild - ); - (this.columns = []), - (this.columnsByIndex = []), - (this.columnsByField = {}), - this.dispatch("columns-loading"), - this.dispatchExternal("columnsLoading"), - this.table.options.rowHeader && - ((this.rowHeader = new G( - this.table.options.rowHeader === !0 - ? {} - : this.table.options.rowHeader, - this, - !0 - )), - this.columns.push(this.rowHeader), - this.headersElement.appendChild( - this.rowHeader.getElement() - ), - this.rowHeader.columnRendered()), - t.forEach((i, o) => { - this._addColumn(i); - }), - this._reIndexColumns(), - this.dispatch("columns-loaded"), - this.subscribedExternal("columnsLoaded") && - this.dispatchExternal( - "columnsLoaded", - this.getComponents() - ), - this.rerenderColumns(!1, !0), - this.redraw(!0); - } - _addColumn(t, e, i) { - var o = new G(t, this), - n = o.getElement(), - r = i && this.findColumnIndex(i); - if ( - (!e || - !this.rowHeader || - (i && i !== this.rowHeader) || - ((e = !1), (i = this.rowHeader), (r = 0)), - i && r > -1) - ) { - var a = i.getTopColumn(), - l = this.columns.indexOf(a), - h = a.getElement(); - e - ? (this.columns.splice(l, 0, o), - h.parentNode.insertBefore(n, h)) - : (this.columns.splice(l + 1, 0, o), - h.parentNode.insertBefore(n, h.nextSibling)); - } else e ? (this.columns.unshift(o), this.headersElement.insertBefore(o.getElement(), this.headersElement.firstChild)) : (this.columns.push(o), this.headersElement.appendChild(o.getElement())); - return o.columnRendered(), o; - } - registerColumnField(t) { - t.definition.field && - (this.columnsByField[t.definition.field] = t); - } - registerColumnPosition(t) { - this.columnsByIndex.push(t); - } - _reIndexColumns() { - (this.columnsByIndex = []), - this.columns.forEach(function (t) { - t.reRegisterPosition(); - }); - } - verticalAlignHeaders() { - var t = 0; - this.redrawBlock || - ((this.headersElement.style.height = ""), - this.columns.forEach((e) => { - e.clearVerticalAlign(); - }), - this.columns.forEach((e) => { - var i = e.getHeight(); - i > t && (t = i); - }), - (this.headersElement.style.height = t + "px"), - this.columns.forEach((e) => { - e.verticalAlign( - this.table.options.columnHeaderVertAlign, - t - ); - }), - this.table.rowManager.adjustTableSize()); - } - findColumn(t) { - var e; - return typeof t != "object" - ? this.columnsByField[t] || !1 - : t instanceof G - ? t - : t instanceof j - ? t._getSelf() || !1 - : typeof HTMLElement < "u" && t instanceof HTMLElement - ? ((e = []), - this.columns.forEach((i) => { - e.push(i), (e = e.concat(i.getColumns(!0))); - }), - e.find((i) => i.element === t) || !1) - : !1; - } - getColumnByField(t) { - return this.columnsByField[t]; - } - getColumnsByFieldRoot(t) { - var e = []; - return ( - Object.keys(this.columnsByField).forEach((i) => { - (this.table.options.nestedFieldSeparator - ? i.split( - this.table.options.nestedFieldSeparator - )[0] - : i) === t && e.push(this.columnsByField[i]); - }), - e - ); - } - getColumnByIndex(t) { - return this.columnsByIndex[t]; - } - getFirstVisibleColumn() { - var t = this.columnsByIndex.findIndex((e) => e.visible); - return t > -1 && this.columnsByIndex[t]; - } - getVisibleColumnsByIndex() { - return this.columnsByIndex.filter((t) => t.visible); - } - getColumns() { - return this.columns; - } - findColumnIndex(t) { - return this.columnsByIndex.findIndex((e) => t === e); - } - getRealColumns() { - return this.columnsByIndex; - } - traverse(t) { - this.columnsByIndex.forEach((e, i) => { - t(e, i); - }); - } - getDefinitions(t) { - var e = []; - return ( - this.columnsByIndex.forEach((i) => { - (!t || (t && i.visible)) && e.push(i.getDefinition()); - }), - e - ); - } - getDefinitionTree() { - var t = []; - return ( - this.columns.forEach((e) => { - t.push(e.getDefinition(!0)); - }), - t - ); - } - getComponents(t) { - var e = []; - return ( - (t ? this.columns : this.columnsByIndex).forEach((i) => { - e.push(i.getComponent()); - }), - e - ); - } - getWidth() { - var t = 0; - return ( - this.columnsByIndex.forEach((e) => { - e.visible && (t += e.getWidth()); - }), - t - ); - } - moveColumn(t, e, i) { - e.element.parentNode.insertBefore(t.element, e.element), - i && - e.element.parentNode.insertBefore(e.element, t.element), - this.moveColumnActual(t, e, i), - this.verticalAlignHeaders(), - this.table.rowManager.reinitialize(); - } - moveColumnActual(t, e, i) { - t.parent.isGroup - ? this._moveColumnInArray(t.parent.columns, t, e, i) - : this._moveColumnInArray(this.columns, t, e, i), - this._moveColumnInArray(this.columnsByIndex, t, e, i, !0), - this.rerenderColumns(!0), - this.dispatch("column-moved", t, e, i), - this.subscribedExternal("columnMoved") && - this.dispatchExternal( - "columnMoved", - t.getComponent(), - this.table.columnManager.getComponents() - ); - } - _moveColumnInArray(t, e, i, o, n) { - var r, - a = t.indexOf(e); - a > -1 && - (t.splice(a, 1), - (r = t.indexOf(i)) > -1 ? o && (r += 1) : (r = a), - t.splice(r, 0, e), - n && - ( - this.chain( - "column-moving-rows", - [e, i, o], - null, - [] - ) || [] - ) - .concat(this.table.rowManager.rows) - .forEach(function (l) { - if (l.cells.length) { - var h = l.cells.splice(a, 1)[0]; - l.cells.splice(r, 0, h); - } - })); - } - scrollToColumn(t, e, i) { - var o = 0, - n = t.getLeftOffset(), - r = 0, - a = t.getElement(); - return new Promise((l, h) => { - if ( - (e === void 0 && - (e = this.table.options.scrollToColumnPosition), - i === void 0 && - (i = this.table.options.scrollToColumnIfVisible), - t.visible) - ) { - switch (e) { - case "middle": - case "center": - r = -this.element.clientWidth / 2; - break; - case "right": - r = - a.clientWidth - - this.headersElement.clientWidth; - } - if ( - !i && - n > 0 && - n + a.offsetWidth < this.element.clientWidth - ) - return !1; - (o = n + r), - (o = Math.max( - Math.min( - o, - this.table.rowManager.element.scrollWidth - - this.table.rowManager.element - .clientWidth - ), - 0 - )), - this.table.rowManager.scrollHorizontal(o), - this.scrollHorizontal(o), - l(); - } else - console.warn("Scroll Error - Column not visible"), - h("Scroll Error - Column not visible"); - }); - } - generateCells(t) { - var e = []; - return ( - this.columnsByIndex.forEach((i) => { - e.push(i.generateCell(t)); - }), - e - ); - } - getFlexBaseWidth() { - var t = this.table.element.clientWidth, - e = 0; - return ( - this.table.rowManager.element.scrollHeight > - this.table.rowManager.element.clientHeight && - (t -= - this.table.rowManager.element.offsetWidth - - this.table.rowManager.element.clientWidth), - this.columnsByIndex.forEach(function (i) { - var o, n, r; - i.visible && - ((o = i.definition.width || 0), - (n = parseInt(i.minWidth)), - (r = - typeof o == "string" - ? o.indexOf("%") > -1 - ? (t / 100) * parseInt(o) - : parseInt(o) - : o), - (e += r > n ? r : n)); - }), - e - ); - } - addColumn(t, e, i) { - return new Promise((o, n) => { - var r = this._addColumn(t, e, i); - this._reIndexColumns(), - this.dispatch("column-add", t, e, i), - this.layoutMode() != "fitColumns" && - r.reinitializeWidth(), - this.redraw(!0), - this.table.rowManager.reinitialize(), - this.rerenderColumns(), - o(r); - }); - } - deregisterColumn(t) { - var e, - i = t.getField(); - i && delete this.columnsByField[i], - (e = this.columnsByIndex.indexOf(t)) > -1 && - this.columnsByIndex.splice(e, 1), - (e = this.columns.indexOf(t)) > -1 && - this.columns.splice(e, 1), - this.verticalAlignHeaders(), - this.redraw(); - } - rerenderColumns(t, e) { - this.redrawBlock - ? (t === !1 || - (t === !0 && this.redrawBlockUpdate === null)) && - (this.redrawBlockUpdate = t) - : this.renderer.rerenderColumns(t, e); - } - blockRedraw() { - (this.redrawBlock = !0), (this.redrawBlockUpdate = null); - } - restoreRedraw() { - (this.redrawBlock = !1), - this.verticalAlignHeaders(), - this.renderer.rerenderColumns(this.redrawBlockUpdate); - } - redraw(t) { - x.elVisible(this.element) && this.verticalAlignHeaders(), - t && - (this.table.rowManager.resetScroll(), - this.table.rowManager.reinitialize()), - this.confirm("table-redrawing", t) || this.layoutRefresh(t), - this.dispatch("table-redraw", t), - this.table.footerManager.redraw(); - } - } - class ht { - constructor(t) { - return ( - (this._row = t), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._row.table.componentFunctionBinder.handle( - "row", - e._row, - i - ); - }, - }) - ); - } - getData(t) { - return this._row.getData(t); - } - getElement() { - return this._row.getElement(); - } - getCells() { - var t = []; - return ( - this._row.getCells().forEach(function (e) { - t.push(e.getComponent()); - }), - t - ); - } - getCell(t) { - var e = this._row.getCell(t); - return !!e && e.getComponent(); - } - getIndex() { - return this._row.getData("data")[this._row.table.options.index]; - } - getPosition() { - return this._row.getPosition(); - } - watchPosition(t) { - return this._row.watchPosition(t); - } - delete() { - return this._row.delete(); - } - scrollTo(t, e) { - return this._row.table.rowManager.scrollToRow(this._row, t, e); - } - move(t, e) { - this._row.moveToRow(t, e); - } - update(t) { - return this._row.updateData(t); - } - normalizeHeight() { - this._row.normalizeHeight(!0); - } - _getSelf() { - return this._row; - } - reformat() { - return this._row.reinitialize(); - } - getTable() { - return this._row.table; - } - getNextRow() { - var t = this._row.nextRow(); - return t && t.getComponent(); - } - getPrevRow() { - var t = this._row.prevRow(); - return t && t.getComponent(); - } - } - class k extends C { - constructor(t, e, i = "row") { - super(e.table), - (this.parent = e), - (this.data = {}), - (this.type = i), - (this.element = !1), - (this.modules = {}), - (this.cells = []), - (this.height = 0), - (this.heightStyled = ""), - (this.manualHeight = !1), - (this.outerHeight = 0), - (this.initialized = !1), - (this.heightInitialized = !1), - (this.position = 0), - (this.positionWatchers = []), - (this.component = null), - (this.created = !1), - this.setData(t); - } - create() { - this.created || ((this.created = !0), this.generateElement()); - } - createElement() { - var t = document.createElement("div"); - t.classList.add("tabulator-row"), - t.setAttribute("role", "row"), - (this.element = t); - } - getElement() { - return this.create(), this.element; - } - detachElement() { - this.element && - this.element.parentNode && - this.element.parentNode.removeChild(this.element); - } - generateElement() { - this.createElement(), this.dispatch("row-init", this); - } - generateCells() { - this.cells = this.table.columnManager.generateCells(this); - } - initialize(t, e) { - if ((this.create(), !this.initialized || t)) { - for (this.deleteCells(); this.element.firstChild; ) - this.element.removeChild(this.element.firstChild); - this.dispatch("row-layout-before", this), - this.generateCells(), - (this.initialized = !0), - this.table.columnManager.renderer.renderRowCells( - this, - e - ), - t && this.normalizeHeight(), - this.dispatch("row-layout", this), - this.table.options.rowFormatter && - this.table.options.rowFormatter( - this.getComponent() - ), - this.dispatch("row-layout-after", this); - } else this.table.columnManager.renderer.rerenderRowCells(this, e); - } - rendered() { - this.cells.forEach((t) => { - t.cellRendered(); - }); - } - reinitializeHeight() { - (this.heightInitialized = !1), - this.element && - this.element.offsetParent !== null && - this.normalizeHeight(!0); - } - deinitialize() { - this.initialized = !1; - } - deinitializeHeight() { - this.heightInitialized = !1; - } - reinitialize(t) { - (this.initialized = !1), - (this.heightInitialized = !1), - this.manualHeight || - ((this.height = 0), (this.heightStyled = "")), - this.element && - this.element.offsetParent !== null && - this.initialize(!0), - this.dispatch("row-relayout", this); - } - calcHeight(t) { - var e = 0, - i = 0; - this.table.options.rowHeight - ? (this.height = this.table.options.rowHeight) - : ((i = this.calcMinHeight()), - (e = this.calcMaxHeight()), - (this.height = t - ? Math.max(e, i) - : this.manualHeight - ? this.height - : Math.max(e, i))), - (this.heightStyled = this.height ? this.height + "px" : ""), - (this.outerHeight = this.element.offsetHeight); - } - calcMinHeight() { - return this.table.options.resizableRows - ? this.element.clientHeight - : 0; - } - calcMaxHeight() { - var t = 0; - return ( - this.cells.forEach(function (e) { - var i = e.getHeight(); - i > t && (t = i); - }), - t - ); - } - setCellHeight() { - this.cells.forEach(function (t) { - t.setHeight(); - }), - (this.heightInitialized = !0); - } - clearCellHeight() { - this.cells.forEach(function (t) { - t.clearHeight(); - }); - } - normalizeHeight(t) { - t && !this.table.options.rowHeight && this.clearCellHeight(), - this.calcHeight(t), - this.setCellHeight(); - } - setHeight(t, e) { - (this.height != t || e) && - ((this.manualHeight = !0), - (this.height = t), - (this.heightStyled = t ? t + "px" : ""), - this.setCellHeight(), - (this.outerHeight = this.element.offsetHeight), - this.subscribedExternal("rowHeight") && - this.dispatchExternal( - "rowHeight", - this.getComponent() - )); - } - getHeight() { - return this.outerHeight; - } - getWidth() { - return this.element.offsetWidth; - } - deleteCell(t) { - var e = this.cells.indexOf(t); - e > -1 && this.cells.splice(e, 1); - } - setData(t) { - (this.data = this.chain( - "row-data-init-before", - [this, t], - void 0, - t - )), - this.dispatch("row-data-init-after", this); - } - updateData(t) { - var e, - i = this.element && x.elVisible(this.element), - o = {}; - return new Promise((n, r) => { - typeof t == "string" && (t = JSON.parse(t)), - this.dispatch("row-data-save-before", this), - this.subscribed("row-data-changing") && - ((o = Object.assign(o, this.data)), - (o = Object.assign(o, t))), - (e = this.chain( - "row-data-changing", - [this, o, t], - null, - t - )); - for (let a in e) this.data[a] = e[a]; - this.dispatch("row-data-save-after", this); - for (let a in t) - this.table.columnManager - .getColumnsByFieldRoot(a) - .forEach((l) => { - let h = this.getCell(l.getField()); - if (h) { - let d = l.getFieldValue(e); - h.getValue() !== d && - (h.setValueProcessData(d), - i && h.cellRendered()); - } - }); - i - ? (this.normalizeHeight(!0), - this.table.options.rowFormatter && - this.table.options.rowFormatter( - this.getComponent() - )) - : ((this.initialized = !1), - (this.height = 0), - (this.heightStyled = "")), - this.dispatch("row-data-changed", this, i, t), - this.dispatchExternal( - "rowUpdated", - this.getComponent() - ), - this.subscribedExternal("dataChanged") && - this.dispatchExternal( - "dataChanged", - this.table.rowManager.getData() - ), - n(); - }); - } - getData(t) { - return t - ? this.chain( - "row-data-retrieve", - [this, t], - null, - this.data - ) - : this.data; - } - getCell(t) { - return ( - (t = this.table.columnManager.findColumn(t)), - this.initialized || - this.cells.length !== 0 || - this.generateCells(), - this.cells.find(function (e) { - return e.column === t; - }) - ); - } - getCellIndex(t) { - return this.cells.findIndex(function (e) { - return e === t; - }); - } - findCell(t) { - return this.cells.find((e) => e.element === t); - } - getCells() { - return ( - this.initialized || - this.cells.length !== 0 || - this.generateCells(), - this.cells - ); - } - nextRow() { - return this.table.rowManager.nextDisplayRow(this, !0) || !1; - } - prevRow() { - return this.table.rowManager.prevDisplayRow(this, !0) || !1; - } - moveToRow(t, e) { - var i = this.table.rowManager.findRow(t); - i - ? (this.table.rowManager.moveRowActual(this, i, !e), - this.table.rowManager.refreshActiveData( - "display", - !1, - !0 - )) - : console.warn("Move Error - No matching row found:", t); - } - delete() { - return ( - this.dispatch("row-delete", this), - this.deleteActual(), - Promise.resolve() - ); - } - deleteActual(t) { - this.detachModules(), - this.table.rowManager.deleteRow(this, t), - this.deleteCells(), - (this.initialized = !1), - (this.heightInitialized = !1), - (this.element = !1), - this.dispatch("row-deleted", this); - } - detachModules() { - this.dispatch("row-deleting", this); - } - deleteCells() { - var t = this.cells.length; - for (let e = 0; e < t; e++) this.cells[0].delete(); - } - wipe() { - if ((this.detachModules(), this.deleteCells(), this.element)) { - for (; this.element.firstChild; ) - this.element.removeChild(this.element.firstChild); - this.element.parentNode && - this.element.parentNode.removeChild(this.element); - } - (this.element = !1), (this.modules = {}); - } - isDisplayed() { - return this.table.rowManager.getDisplayRows().includes(this); - } - getPosition() { - return !!this.isDisplayed() && this.position; - } - setPosition(t) { - t != this.position && - ((this.position = t), - this.positionWatchers.forEach((e) => { - e(this.position); - })); - } - watchPosition(t) { - this.positionWatchers.push(t), t(this.position); - } - getGroup() { - return this.modules.group || !1; - } - getComponent() { - return ( - this.component || (this.component = new ht(this)), - this.component - ); - } - } - class Ee extends lt { - constructor(t) { - super(t), - (this.verticalFillMode = "fill"), - (this.scrollTop = 0), - (this.scrollLeft = 0), - (this.scrollTop = 0), - (this.scrollLeft = 0); - } - clearRows() { - for (var t = this.tableElement; t.firstChild; ) - t.removeChild(t.firstChild); - (t.scrollTop = 0), - (t.scrollLeft = 0), - (t.style.minWidth = ""), - (t.style.minHeight = ""), - (t.style.display = ""), - (t.style.visibility = ""); - } - renderRows() { - var t = this.tableElement, - e = !0, - i = document.createDocumentFragment(), - o = this.rows(); - o.forEach((n, r) => { - this.styleRow(n, r), - n.initialize(!1, !0), - n.type !== "group" && (e = !1), - i.appendChild(n.getElement()); - }), - t.appendChild(i), - o.forEach((n) => { - n.rendered(), n.heightInitialized || n.calcHeight(!0); - }), - o.forEach((n) => { - n.heightInitialized || n.setCellHeight(); - }), - (t.style.minWidth = e - ? this.table.columnManager.getWidth() + "px" - : ""); - } - rerenderRows(t) { - this.clearRows(), - t && t(), - this.renderRows(), - this.rows().length || this.table.rowManager.tableEmpty(); - } - scrollToRowNearestTop(t) { - var e = x.elOffset(t.getElement()).top; - return !( - Math.abs(this.elementVertical.scrollTop - e) > - Math.abs( - this.elementVertical.scrollTop + - this.elementVertical.clientHeight - - e - ) - ); - } - scrollToRow(t) { - var e = t.getElement(); - this.elementVertical.scrollTop = - x.elOffset(e).top - - x.elOffset(this.elementVertical).top + - this.elementVertical.scrollTop; - } - visibleRows(t) { - return this.rows(); - } - } - class ye extends lt { - constructor(t) { - super(t), - (this.verticalFillMode = "fill"), - (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 = []); - } - clearRows() { - for (var t = this.tableElement; t.firstChild; ) - t.removeChild(t.firstChild); - (t.style.paddingTop = ""), - (t.style.paddingBottom = ""), - (t.style.minHeight = ""), - (t.style.display = ""), - (t.style.visibility = ""), - (this.elementVertical.scrollTop = 0), - (this.elementVertical.scrollLeft = 0), - (this.scrollTop = 0), - (this.scrollLeft = 0), - (this.vDomTop = 0), - (this.vDomBottom = 0), - (this.vDomTopPad = 0), - (this.vDomBottomPad = 0), - (this.vDomScrollPosTop = 0), - (this.vDomScrollPosBottom = 0); - } - renderRows() { - this._virtualRenderFill(); - } - rerenderRows(t) { - for ( - var e = this.elementVertical.scrollTop, - i = !1, - o = !1, - n = this.table.rowManager.scrollLeft, - r = this.rows(), - a = this.vDomTop; - a <= this.vDomBottom; - a++ - ) - if (r[a]) { - var l = e - r[a].getElement().offsetTop; - if (!(o === !1 || Math.abs(l) < o)) break; - (o = l), (i = a); - } - r.forEach((h) => { - h.deinitializeHeight(); - }), - t && t(), - this.rows().length - ? this._virtualRenderFill( - i === !1 ? this.rows.length - 1 : i, - !0, - o || 0 - ) - : (this.clear(), this.table.rowManager.tableEmpty()), - this.scrollColumns(n); - } - scrollColumns(t) { - this.table.rowManager.scrollHorizontal(t); - } - scrollRows(t, e) { - var i = t - this.vDomScrollPosTop, - o = t - this.vDomScrollPosBottom, - n = 2 * this.vDomWindowBuffer, - r = this.rows(); - if (((this.scrollTop = t), -i > n || o > n)) { - var a = this.table.rowManager.scrollLeft; - this._virtualRenderFill( - Math.floor( - (this.elementVertical.scrollTop / - this.elementVertical.scrollHeight) * - r.length - ) - ), - this.scrollColumns(a); - } else e ? (i < 0 && this._addTopRow(r, -i), o < 0 && (this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer ? this._removeBottomRow(r, -o) : (this.vDomScrollPosBottom = this.scrollTop))) : (o >= 0 && this._addBottomRow(r, o), i >= 0 && (this.scrollTop > this.vDomWindowBuffer ? this._removeTopRow(r, i) : (this.vDomScrollPosTop = this.scrollTop))); - } - resize() { - this.vDomWindowBuffer = - this.table.options.renderVerticalBuffer || - this.elementVertical.clientHeight; - } - scrollToRowNearestTop(t) { - var e = this.rows().indexOf(t); - return !( - Math.abs(this.vDomTop - e) > Math.abs(this.vDomBottom - e) - ); - } - scrollToRow(t) { - var e = this.rows().indexOf(t); - e > -1 && this._virtualRenderFill(e, !0); - } - visibleRows(t) { - var e = this.elementVertical.scrollTop, - i = this.elementVertical.clientHeight + e, - o = !1, - n = 0, - r = 0, - a = this.rows(); - if (t) (n = this.vDomTop), (r = this.vDomBottom); - else - for (var l = this.vDomTop; l <= this.vDomBottom; l++) - if (a[l]) - if (o) { - if (!(i - a[l].getElement().offsetTop >= 0)) - break; - r = l; - } else if (e - a[l].getElement().offsetTop >= 0) - n = l; - else { - if ( - ((o = !0), - !(i - a[l].getElement().offsetTop >= 0)) - ) - break; - r = l; - } - return a.slice(n, r + 1); - } - _virtualRenderFill(t, e, i) { - var o, - n, - r = this.tableElement, - a = this.elementVertical, - l = 0, - h = 0, - d = 0, - c = 0, - u = 0, - m = 0, - p = this.rows(), - g = p.length, - f = 0, - v = [], - E = 0, - T = 0, - M = this.table.rowManager.fixedHeight, - z = this.elementVertical.clientHeight, - A = this.table.options.rowHeight, - tt = !0; - if (((i = i || 0), (t = t || 0))) { - for (; r.firstChild; ) r.removeChild(r.firstChild); - (c = (g - t + 1) * this.vDomRowHeight) < z && - (t -= Math.ceil((z - c) / this.vDomRowHeight)) < 0 && - (t = 0), - (t -= l = - Math.min( - Math.max( - Math.floor( - this.vDomWindowBuffer / - this.vDomRowHeight - ), - this.vDomWindowMinMarginRows - ), - t - )); - } else this.clear(); - if (g && x.elVisible(this.elementVertical)) { - for ( - this.vDomTop = t, - this.vDomBottom = t - 1, - M || this.table.options.maxHeight - ? (A && (T = z / A + this.vDomWindowBuffer / A), - (T = Math.max( - this.vDomWindowMinTotalRows, - Math.ceil(T) - ))) - : (T = g); - (T == g || - h <= z + this.vDomWindowBuffer || - E < this.vDomWindowMinTotalRows) && - this.vDomBottom < g - 1; - - ) { - for ( - v = [], - n = document.createDocumentFragment(), - m = 0; - m < T && this.vDomBottom < g - 1; - - ) - (o = p[(f = this.vDomBottom + 1)]), - this.styleRow(o, f), - o.initialize(!1, !0), - o.heightInitialized || - this.table.options.rowHeight || - o.clearCellHeight(), - n.appendChild(o.getElement()), - v.push(o), - this.vDomBottom++, - m++; - if (!v.length) break; - r.appendChild(n), - v.forEach((L) => { - L.rendered(), - L.heightInitialized || L.calcHeight(!0); - }), - v.forEach((L) => { - L.heightInitialized || L.setCellHeight(); - }), - v.forEach((L) => { - (d = L.getHeight()), - E < l ? (u += d) : (h += d), - d > this.vDomWindowBuffer && - (this.vDomWindowBuffer = 2 * d), - E++; - }), - (tt = this.table.rowManager.adjustTableSize()), - (z = this.elementVertical.clientHeight), - tt && - (M || this.table.options.maxHeight) && - ((A = h / E), - (T = Math.max( - this.vDomWindowMinTotalRows, - Math.ceil(z / A + this.vDomWindowBuffer / A) - ))); - } - t - ? ((this.vDomTopPad = e - ? this.vDomRowHeight * this.vDomTop + i - : this.scrollTop - u), - (this.vDomBottomPad = - this.vDomBottom == g - 1 - ? 0 - : Math.max( - this.vDomScrollHeight - - this.vDomTopPad - - h - - u, - 0 - ))) - : ((this.vDomTopPad = 0), - (this.vDomRowHeight = Math.floor((h + u) / E)), - (this.vDomBottomPad = - this.vDomRowHeight * (g - this.vDomBottom - 1)), - (this.vDomScrollHeight = - u + h + this.vDomBottomPad - z)), - (r.style.paddingTop = this.vDomTopPad + "px"), - (r.style.paddingBottom = this.vDomBottomPad + "px"), - e && - (this.scrollTop = - this.vDomTopPad + - u + - i - - (this.elementVertical.scrollWidth > - this.elementVertical.clientWidth - ? this.elementVertical.offsetHeight - z - : 0)), - (this.scrollTop = Math.min( - this.scrollTop, - this.elementVertical.scrollHeight - z - )), - this.elementVertical.scrollWidth > - this.elementVertical.clientWidth && - e && - (this.scrollTop += - this.elementVertical.offsetHeight - z), - (this.vDomScrollPosTop = this.scrollTop), - (this.vDomScrollPosBottom = this.scrollTop), - (a.scrollTop = this.scrollTop), - this.dispatch("render-virtual-fill"); - } - } - _addTopRow(t, e) { - for ( - var i = this.tableElement, - o = [], - n = 0, - r = this.vDomTop - 1, - a = 0, - l = !0; - l; - - ) - if (this.vDomTop) { - let h, - d, - c = t[r]; - c && a < this.vDomMaxRenderChain - ? ((h = c.getHeight() || this.vDomRowHeight), - (d = c.initialized), - e >= h - ? (this.styleRow(c, r), - i.insertBefore( - c.getElement(), - i.firstChild - ), - (c.initialized && c.heightInitialized) || - o.push(c), - c.initialize(), - d || - ((h = c.getElement().offsetHeight), - h > this.vDomWindowBuffer && - (this.vDomWindowBuffer = 2 * h)), - (e -= h), - (n += h), - this.vDomTop--, - r--, - a++) - : (l = !1)) - : (l = !1); - } else l = !1; - for (let h of o) h.clearCellHeight(); - this._quickNormalizeRowHeight(o), - n && - ((this.vDomTopPad -= n), - this.vDomTopPad < 0 && - (this.vDomTopPad = r * this.vDomRowHeight), - r < 1 && (this.vDomTopPad = 0), - (i.style.paddingTop = this.vDomTopPad + "px"), - (this.vDomScrollPosTop -= n)); - } - _removeTopRow(t, e) { - for (var i = [], o = 0, n = 0, r = !0; r; ) { - let a, - l = t[this.vDomTop]; - l && n < this.vDomMaxRenderChain - ? ((a = l.getHeight() || this.vDomRowHeight), - e >= a - ? (this.vDomTop++, - (e -= a), - (o += a), - i.push(l), - n++) - : (r = !1)) - : (r = !1); - } - for (let a of i) { - let l = a.getElement(); - l.parentNode && l.parentNode.removeChild(l); - } - o && - ((this.vDomTopPad += o), - (this.tableElement.style.paddingTop = - this.vDomTopPad + "px"), - (this.vDomScrollPosTop += this.vDomTop - ? o - : o + this.vDomWindowBuffer)); - } - _addBottomRow(t, e) { - for ( - var i = this.tableElement, - o = [], - n = 0, - r = this.vDomBottom + 1, - a = 0, - l = !0; - l; - - ) { - let h, - d, - c = t[r]; - c && a < this.vDomMaxRenderChain - ? ((h = c.getHeight() || this.vDomRowHeight), - (d = c.initialized), - e >= h - ? (this.styleRow(c, r), - i.appendChild(c.getElement()), - (c.initialized && c.heightInitialized) || - o.push(c), - c.initialize(), - d || - ((h = c.getElement().offsetHeight), - h > this.vDomWindowBuffer && - (this.vDomWindowBuffer = 2 * h)), - (e -= h), - (n += h), - this.vDomBottom++, - r++, - a++) - : (l = !1)) - : (l = !1); - } - for (let h of o) h.clearCellHeight(); - this._quickNormalizeRowHeight(o), - n && - ((this.vDomBottomPad -= n), - (this.vDomBottomPad < 0 || r == t.length - 1) && - (this.vDomBottomPad = 0), - (i.style.paddingBottom = this.vDomBottomPad + "px"), - (this.vDomScrollPosBottom += n)); - } - _removeBottomRow(t, e) { - for (var i = [], o = 0, n = 0, r = !0; r; ) { - let a, - l = t[this.vDomBottom]; - l && n < this.vDomMaxRenderChain - ? ((a = l.getHeight() || this.vDomRowHeight), - e >= a - ? (this.vDomBottom--, - (e -= a), - (o += a), - i.push(l), - n++) - : (r = !1)) - : (r = !1); - } - for (let a of i) { - let l = a.getElement(); - l.parentNode && l.parentNode.removeChild(l); - } - o && - ((this.vDomBottomPad += o), - this.vDomBottomPad < 0 && (this.vDomBottomPad = 0), - (this.tableElement.style.paddingBottom = - this.vDomBottomPad + "px"), - (this.vDomScrollPosBottom -= o)); - } - _quickNormalizeRowHeight(t) { - for (let e of t) e.calcHeight(); - for (let e of t) e.setCellHeight(); - } - } - class Re extends C { - constructor(t) { - super(t), - (this.element = this.createHolderElement()), - (this.tableElement = this.createTableElement()), - (this.heightFixer = this.createTableElement()), - (this.placeholder = null), - (this.placeholderContents = null), - (this.firstRender = !1), - (this.renderMode = "virtual"), - (this.fixedHeight = !1), - (this.rows = []), - (this.activeRowsPipeline = []), - (this.activeRows = []), - (this.activeRowsCount = 0), - (this.displayRows = []), - (this.displayRowsCount = 0), - (this.scrollTop = 0), - (this.scrollLeft = 0), - (this.redrawBlock = !1), - (this.redrawBlockRestoreConfig = !1), - (this.redrawBlockRenderInPosition = !1), - (this.dataPipeline = []), - (this.displayPipeline = []), - (this.scrollbarWidth = 0), - (this.renderer = null); - } - createHolderElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-tableholder"), - t.setAttribute("tabindex", 0), - t - ); - } - createTableElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-table"), - t.setAttribute("role", "rowgroup"), - t - ); - } - initializePlaceholder() { - var t = this.table.options.placeholder; - if ( - (typeof t == "function" && (t = t.call(this.table)), - (t = this.chain("placeholder", [t], t, t) || t)) - ) { - let e = document.createElement("div"); - if ( - (e.classList.add("tabulator-placeholder"), - typeof t == "string") - ) { - let i = document.createElement("div"); - i.classList.add("tabulator-placeholder-contents"), - (i.innerHTML = t), - e.appendChild(i), - (this.placeholderContents = i); - } else - typeof HTMLElement < "u" && t instanceof HTMLElement - ? (e.appendChild(t), (this.placeholderContents = t)) - : (console.warn( - "Invalid placeholder provided, must be string or HTML Element", - t - ), - (this.el = null)); - this.placeholder = e; - } - } - getElement() { - return this.element; - } - getTableElement() { - return this.tableElement; - } - initialize() { - this.initializePlaceholder(), - this.initializeRenderer(), - this.element.appendChild(this.tableElement), - (this.firstRender = !0), - this.element.addEventListener("scroll", () => { - var t = this.element.scrollLeft, - e = this.scrollLeft > t, - i = this.element.scrollTop, - o = this.scrollTop > i; - this.scrollLeft != t && - ((this.scrollLeft = t), - this.dispatch("scroll-horizontal", t, e), - this.dispatchExternal("scrollHorizontal", t, e), - this._positionPlaceholder()), - this.scrollTop != i && - ((this.scrollTop = i), - this.renderer.scrollRows(i, o), - this.dispatch("scroll-vertical", i, o), - this.dispatchExternal("scrollVertical", i, o)); - }); - } - findRow(t) { - return typeof t != "object" - ? t === void 0 - ? !1 - : this.rows.find( - (e) => e.data[this.table.options.index] == t - ) || !1 - : t instanceof k - ? t - : t instanceof ht - ? t._getSelf() || !1 - : (typeof HTMLElement < "u" && - t instanceof HTMLElement && - this.rows.find((e) => e.getElement() === t)) || - !1; - } - getRowFromDataObject(t) { - return this.rows.find((e) => e.data === t) || !1; - } - getRowFromPosition(t) { - return this.getDisplayRows().find( - (e) => - e.type === "row" && - e.getPosition() === t && - e.isDisplayed() - ); - } - scrollToRow(t, e, i) { - return this.renderer.scrollToRowPosition(t, e, i); - } - setData(t, e, i) { - return new Promise((o, n) => { - e && this.getDisplayRows().length - ? this.table.options.pagination - ? this._setDataActual(t, !0) - : this.reRenderInPosition(() => { - this._setDataActual(t); - }) - : (this.table.options.autoColumns && - i && - this.table.initialized && - this.table.columnManager.generateColumnsFromRowData( - t - ), - this.resetScroll(), - this._setDataActual(t)), - o(); - }); - } - _setDataActual(t, e) { - this.dispatchExternal("dataProcessing", t), - this._wipeElements(), - Array.isArray(t) - ? (this.dispatch("data-processing", t), - t.forEach((i, o) => { - if (i && typeof i == "object") { - var n = new k(i, this); - this.rows.push(n); - } else - console.warn( - "Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", - i - ); - }), - this.refreshActiveData(!1, !1, e), - this.dispatch("data-processed", t), - this.dispatchExternal("dataProcessed", t)) - : console.error( - `Data Loading Error - Unable to process data due to invalid data type -Expecting: array -Received: `, - typeof t, - ` -Data: `, - t - ); - } - _wipeElements() { - this.dispatch("rows-wipe"), - this.destroy(), - this.adjustTableSize(), - this.dispatch("rows-wiped"); - } - destroy() { - this.rows.forEach((t) => { - t.wipe(); - }), - (this.rows = []), - (this.activeRows = []), - (this.activeRowsPipeline = []), - (this.activeRowsCount = 0), - (this.displayRows = []), - (this.displayRowsCount = 0); - } - deleteRow(t, e) { - var i = this.rows.indexOf(t), - o = this.activeRows.indexOf(t); - o > -1 && this.activeRows.splice(o, 1), - i > -1 && this.rows.splice(i, 1), - this.setActiveRows(this.activeRows), - this.displayRowIterator((n) => { - var r = n.indexOf(t); - r > -1 && n.splice(r, 1); - }), - e || this.reRenderInPosition(), - this.regenerateRowPositions(), - this.dispatchExternal("rowDeleted", t.getComponent()), - this.displayRowsCount || this.tableEmpty(), - this.subscribedExternal("dataChanged") && - this.dispatchExternal("dataChanged", this.getData()); - } - addRow(t, e, i, o) { - return this.addRowActual(t, e, i, o); - } - addRows(t, e, i, o) { - var n = []; - return new Promise((r, a) => { - (e = this.findAddRowPos(e)), - Array.isArray(t) || (t = [t]), - ((i === void 0 && e) || (i !== void 0 && !e)) && - t.reverse(), - t.forEach((l, h) => { - var d = this.addRow(l, e, i, !0); - n.push(d), this.dispatch("row-added", d, l, e, i); - }), - this.refreshActiveData( - !!o && "displayPipeline", - !1, - !0 - ), - this.regenerateRowPositions(), - this.displayRowsCount && this._clearPlaceholder(), - r(n); - }); - } - findAddRowPos(t) { - return ( - t === void 0 && (t = this.table.options.addRowPos), - t === "pos" && (t = !0), - t === "bottom" && (t = !1), - t - ); - } - addRowActual(t, e, i, o) { - var n, - r, - a = t instanceof k ? t : new k(t || {}, this), - l = this.findAddRowPos(e), - h = -1; - return ( - i || - ((r = this.chain("row-adding-position", [a, l], null, { - index: i, - top: l, - })), - (i = r.index), - (l = r.top)), - i !== void 0 && (i = this.findRow(i)), - (i = this.chain("row-adding-index", [a, i, l], null, i)) && - (h = this.rows.indexOf(i)), - i && h > -1 - ? ((n = this.activeRows.indexOf(i)), - this.displayRowIterator(function (d) { - var c = d.indexOf(i); - c > -1 && d.splice(l ? c : c + 1, 0, a); - }), - n > -1 && this.activeRows.splice(l ? n : n + 1, 0, a), - this.rows.splice(l ? h : h + 1, 0, a)) - : l - ? (this.displayRowIterator(function (d) { - d.unshift(a); - }), - this.activeRows.unshift(a), - this.rows.unshift(a)) - : (this.displayRowIterator(function (d) { - d.push(a); - }), - this.activeRows.push(a), - this.rows.push(a)), - this.setActiveRows(this.activeRows), - this.dispatchExternal("rowAdded", a.getComponent()), - this.subscribedExternal("dataChanged") && - this.dispatchExternal( - "dataChanged", - this.table.rowManager.getData() - ), - o || this.reRenderInPosition(), - a - ); - } - moveRow(t, e, i) { - this.dispatch("row-move", t, e, i), - this.moveRowActual(t, e, i), - this.regenerateRowPositions(), - this.dispatch("row-moved", t, e, i), - this.dispatchExternal("rowMoved", t.getComponent()); - } - moveRowActual(t, e, i) { - this.moveRowInArray(this.rows, t, e, i), - this.moveRowInArray(this.activeRows, t, e, i), - this.displayRowIterator((o) => { - this.moveRowInArray(o, t, e, i); - }), - this.dispatch("row-moving", t, e, i); - } - moveRowInArray(t, e, i, o) { - var n, r, a; - if ( - e !== i && - ((n = t.indexOf(e)) > -1 && - (t.splice(n, 1), - (r = t.indexOf(i)) > -1 - ? o - ? t.splice(r + 1, 0, e) - : t.splice(r, 0, e) - : t.splice(n, 0, e)), - t === this.getDisplayRows()) - ) { - a = r > n ? r : n + 1; - for (let l = n < r ? n : r; l <= a; l++) - t[l] && this.styleRow(t[l], l); - } - } - clearData() { - this.setData([]); - } - getRowIndex(t) { - return this.findRowIndex(t, this.rows); - } - getDisplayRowIndex(t) { - var e = this.getDisplayRows().indexOf(t); - return e > -1 && e; - } - nextDisplayRow(t, e) { - var i = this.getDisplayRowIndex(t), - o = !1; - return ( - i !== !1 && - i < this.displayRowsCount - 1 && - (o = this.getDisplayRows()[i + 1]), - !o || (o instanceof k && o.type == "row") - ? o - : this.nextDisplayRow(o, e) - ); - } - prevDisplayRow(t, e) { - var i = this.getDisplayRowIndex(t), - o = !1; - return ( - i && (o = this.getDisplayRows()[i - 1]), - !e || !o || (o instanceof k && o.type == "row") - ? o - : this.prevDisplayRow(o, e) - ); - } - findRowIndex(t, e) { - var i; - return ( - !!((t = this.findRow(t)) && (i = e.indexOf(t)) > -1) && i - ); - } - getData(t, e) { - var i = []; - return ( - this.getRows(t).forEach(function (o) { - o.type == "row" && i.push(o.getData(e || "data")); - }), - i - ); - } - getComponents(t) { - var e = []; - return ( - this.getRows(t).forEach(function (i) { - e.push(i.getComponent()); - }), - e - ); - } - getDataCount(t) { - return this.getRows(t).length; - } - scrollHorizontal(t) { - (this.scrollLeft = t), - (this.element.scrollLeft = t), - this.dispatch("scroll-horizontal", t); - } - registerDataPipelineHandler(t, e) { - e !== void 0 - ? (this.dataPipeline.push({ handler: t, priority: e }), - this.dataPipeline.sort((i, o) => i.priority - o.priority)) - : console.error( - "Data pipeline handlers must have a priority in order to be registered" - ); - } - registerDisplayPipelineHandler(t, e) { - e !== void 0 - ? (this.displayPipeline.push({ handler: t, priority: e }), - this.displayPipeline.sort( - (i, o) => i.priority - o.priority - )) - : console.error( - "Display pipeline handlers must have a priority in order to be registered" - ); - } - refreshActiveData(t, e, i) { - var o = this.table, - n = "", - r = 0, - a = [ - "all", - "dataPipeline", - "display", - "displayPipeline", - "end", - ]; - if (!this.table.destroyed) { - if (typeof t == "function") - if ( - (r = this.dataPipeline.findIndex( - (l) => l.handler === t - )) > -1 - ) - (n = "dataPipeline"), - e && - (r == this.dataPipeline.length - 1 - ? (n = "display") - : r++); - else { - if ( - !( - (r = this.displayPipeline.findIndex( - (l) => l.handler === t - )) > -1 - ) - ) - return void console.error( - "Unable to refresh data, invalid handler provided", - t - ); - (n = "displayPipeline"), - e && - (r == this.displayPipeline.length - 1 - ? (n = "end") - : r++); - } - else (n = t || "all"), (r = 0); - if (this.redrawBlock) - return void ( - (!this.redrawBlockRestoreConfig || - (this.redrawBlockRestoreConfig && - ((this.redrawBlockRestoreConfig.stage === - n && - r < - this.redrawBlockRestoreConfig - .index) || - a.indexOf(n) < - a.indexOf( - this.redrawBlockRestoreConfig - .stage - )))) && - (this.redrawBlockRestoreConfig = { - handler: t, - skipStage: e, - renderInPosition: i, - stage: n, - index: r, - }) - ); - x.elVisible(this.element) - ? i - ? this.reRenderInPosition( - this.refreshPipelines.bind(this, t, n, r, i) - ) - : (this.refreshPipelines(t, n, r, i), - t || - this.table.columnManager.renderer.renderColumns(), - this.renderTable(), - o.options.layoutColumnsOnNewData && - this.table.columnManager.redraw(!0)) - : this.refreshPipelines(t, n, r, i), - this.dispatch("data-refreshed"); - } - } - refreshPipelines(t, e, i, o) { - switch ( - (this.dispatch("data-refreshing"), - (t && this.activeRowsPipeline[0]) || - (this.activeRowsPipeline[0] = this.rows.slice(0)), - e) - ) { - case "all": - case "dataPipeline": - for (let n = i; n < this.dataPipeline.length; n++) { - let r = this.dataPipeline[n].handler( - this.activeRowsPipeline[n].slice(0) - ); - this.activeRowsPipeline[n + 1] = - r || this.activeRowsPipeline[n].slice(0); - } - this.setActiveRows( - this.activeRowsPipeline[this.dataPipeline.length] - ); - case "display": - (i = 0), this.resetDisplayRows(); - case "displayPipeline": - for (let n = i; n < this.displayPipeline.length; n++) { - let r = this.displayPipeline[n].handler( - (n - ? this.getDisplayRows(n - 1) - : this.activeRows - ).slice(0), - o - ); - this.setDisplayRows( - r || this.getDisplayRows(n - 1).slice(0), - n - ); - } - case "end": - this.regenerateRowPositions(); - } - this.getDisplayRows().length && this._clearPlaceholder(); - } - regenerateRowPositions() { - var t = this.getDisplayRows(), - e = 1; - t.forEach((i) => { - i.type === "row" && (i.setPosition(e), e++); - }); - } - setActiveRows(t) { - (this.activeRows = this.activeRows = Object.assign([], t)), - (this.activeRowsCount = this.activeRows.length); - } - resetDisplayRows() { - (this.displayRows = []), - this.displayRows.push(this.activeRows.slice(0)), - (this.displayRowsCount = this.displayRows[0].length); - } - setDisplayRows(t, e) { - (this.displayRows[e] = t), - e == this.displayRows.length - 1 && - (this.displayRowsCount = - this.displayRows[ - this.displayRows.length - 1 - ].length); - } - getDisplayRows(t) { - return t === void 0 - ? this.displayRows.length - ? this.displayRows[this.displayRows.length - 1] - : [] - : this.displayRows[t] || []; - } - getVisibleRows(t, e) { - var i = Object.assign([], this.renderer.visibleRows(!e)); - return t && (i = this.chain("rows-visible", [e], i, i)), i; - } - displayRowIterator(t) { - this.activeRowsPipeline.forEach(t), - this.displayRows.forEach(t), - (this.displayRowsCount = - this.displayRows[this.displayRows.length - 1].length); - } - getRows(t) { - var e = []; - switch (t) { - case "active": - e = this.activeRows; - break; - case "display": - e = this.table.rowManager.getDisplayRows(); - break; - case "visible": - e = this.getVisibleRows(!1, !0); - break; - default: - e = - this.chain("rows-retrieve", t, null, this.rows) || - this.rows; - } - return e; - } - reRenderInPosition(t) { - this.redrawBlock - ? t - ? t() - : (this.redrawBlockRenderInPosition = !0) - : (this.dispatchExternal("renderStarted"), - this.renderer.rerenderRows(t), - this.fixedHeight || this.adjustTableSize(), - this.scrollBarCheck(), - this.dispatchExternal("renderComplete")); - } - scrollBarCheck() { - var t = 0; - this.element.scrollHeight > this.element.clientHeight && - (t = this.element.offsetWidth - this.element.clientWidth), - t !== this.scrollbarWidth && - ((this.scrollbarWidth = t), - this.dispatch("scrollbar-vertical", t)); - } - initializeRenderer() { - var t, - e = { virtual: ye, basic: Ee }; - (t = - typeof this.table.options.renderVertical == "string" - ? e[this.table.options.renderVertical] - : this.table.options.renderVertical) - ? ((this.renderMode = this.table.options.renderVertical), - (this.renderer = new t( - this.table, - this.element, - this.tableElement - )), - this.renderer.initialize(), - (!this.table.element.clientHeight && - !this.table.options.height) || - (this.table.options.minHeight && - this.table.options.maxHeight) - ? (this.fixedHeight = !1) - : (this.fixedHeight = !0)) - : console.error( - "Unable to find matching renderer:", - this.table.options.renderVertical - ); - } - getRenderMode() { - return this.renderMode; - } - renderTable() { - this.dispatchExternal("renderStarted"), - (this.element.scrollTop = 0), - this._clearTable(), - this.displayRowsCount - ? (this.renderer.renderRows(), - this.firstRender && - ((this.firstRender = !1), - this.fixedHeight || this.adjustTableSize(), - this.layoutRefresh(!0))) - : this.renderEmptyScroll(), - this.fixedHeight || this.adjustTableSize(), - this.dispatch("table-layout"), - this.displayRowsCount || this._showPlaceholder(), - this.scrollBarCheck(), - this.dispatchExternal("renderComplete"); - } - renderEmptyScroll() { - this.placeholder - ? (this.tableElement.style.display = "none") - : (this.tableElement.style.minWidth = - this.table.columnManager.getWidth() + "px"); - } - _clearTable() { - this._clearPlaceholder(), - (this.scrollTop = 0), - (this.scrollLeft = 0), - this.renderer.clearRows(); - } - tableEmpty() { - this.renderEmptyScroll(), this._showPlaceholder(); - } - checkPlaceholder() { - this.displayRowsCount - ? this._clearPlaceholder() - : this.tableEmpty(); - } - _showPlaceholder() { - this.placeholder && - (this.placeholder && - this.placeholder.parentNode && - this.placeholder.parentNode.removeChild( - this.placeholder - ), - this.initializePlaceholder(), - this.placeholder.setAttribute( - "tabulator-render-mode", - this.renderMode - ), - this.getElement().appendChild(this.placeholder), - this._positionPlaceholder(), - this.adjustTableSize()); - } - _clearPlaceholder() { - this.placeholder && - this.placeholder.parentNode && - this.placeholder.parentNode.removeChild(this.placeholder), - (this.tableElement.style.minWidth = ""), - (this.tableElement.style.display = ""); - } - _positionPlaceholder() { - this.placeholder && - this.placeholder.parentNode && - ((this.placeholder.style.width = - this.table.columnManager.getWidth() + "px"), - (this.placeholderContents.style.width = - this.table.rowManager.element.clientWidth + "px"), - (this.placeholderContents.style.marginLeft = - this.scrollLeft + "px")); - } - styleRow(t, e) { - var i = t.getElement(); - e % 2 - ? (i.classList.add("tabulator-row-even"), - i.classList.remove("tabulator-row-odd")) - : (i.classList.add("tabulator-row-odd"), - i.classList.remove("tabulator-row-even")); - } - normalizeHeight(t) { - this.activeRows.forEach(function (e) { - e.normalizeHeight(t); - }); - } - adjustTableSize() { - let t, - e = this.element.clientHeight, - i = !1; - if (this.renderer.verticalFillMode === "fill") { - let o = Math.floor( - this.table.columnManager - .getElement() - .getBoundingClientRect().height + - (this.table.footerManager && - this.table.footerManager.active && - !this.table.footerManager.external - ? this.table.footerManager - .getElement() - .getBoundingClientRect().height - : 0) - ); - if (this.fixedHeight) { - t = isNaN(this.table.options.minHeight) - ? this.table.options.minHeight - : this.table.options.minHeight + "px"; - let n = "calc(100% - " + o + "px)"; - (this.element.style.minHeight = - t || "calc(100% - " + o + "px)"), - (this.element.style.height = n), - (this.element.style.maxHeight = n); - } else - (this.element.style.height = ""), - (this.element.style.height = - this.table.element.clientHeight - o + "px"), - (this.element.scrollTop = this.scrollTop); - this.renderer.resize(), - this.fixedHeight || - e == this.element.clientHeight || - ((i = !0), - this.subscribed("table-resize") - ? this.dispatch("table-resize") - : this.redraw()), - this.scrollBarCheck(); - } - return this._positionPlaceholder(), i; - } - reinitialize() { - this.rows.forEach(function (t) { - t.reinitialize(!0); - }); - } - blockRedraw() { - (this.redrawBlock = !0), (this.redrawBlockRestoreConfig = !1); - } - restoreRedraw() { - (this.redrawBlock = !1), - this.redrawBlockRestoreConfig - ? (this.refreshActiveData( - this.redrawBlockRestoreConfig.handler, - this.redrawBlockRestoreConfig.skipStage, - this.redrawBlockRestoreConfig.renderInPosition - ), - (this.redrawBlockRestoreConfig = !1)) - : this.redrawBlockRenderInPosition && - this.reRenderInPosition(), - (this.redrawBlockRenderInPosition = !1); - } - redraw(t) { - this.adjustTableSize(), - (this.table.tableWidth = this.table.element.clientWidth), - t - ? this.renderTable() - : (this.reRenderInPosition(), - this.scrollHorizontal(this.scrollLeft)); - } - resetScroll() { - if ( - ((this.element.scrollLeft = 0), - (this.element.scrollTop = 0), - this.table.browser === "ie") - ) { - var t = document.createEvent("Event"); - t.initEvent("scroll", !1, !0), - this.element.dispatchEvent(t); - } else this.element.dispatchEvent(new Event("scroll")); - } - } - class xe extends C { - constructor(t) { - super(t), - (this.active = !1), - (this.element = this.createElement()), - (this.containerElement = this.createContainerElement()), - (this.external = !1); - } - initialize() { - this.initializeElement(); - } - createElement() { - var t = document.createElement("div"); - return t.classList.add("tabulator-footer"), t; - } - createContainerElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-footer-contents"), - this.element.appendChild(t), - t - ); - } - initializeElement() { - this.table.options.footerElement && - (typeof this.table.options.footerElement == "string" - ? this.table.options.footerElement[0] === "<" - ? (this.containerElement.innerHTML = - this.table.options.footerElement) - : ((this.external = !0), - (this.containerElement = document.querySelector( - this.table.options.footerElement - ))) - : (this.element = this.table.options.footerElement)); - } - getElement() { - return this.element; - } - append(t) { - this.activate(), - this.containerElement.appendChild(t), - this.table.rowManager.adjustTableSize(); - } - prepend(t) { - this.activate(), - this.element.insertBefore(t, this.element.firstChild), - this.table.rowManager.adjustTableSize(); - } - remove(t) { - t.parentNode.removeChild(t), this.deactivate(); - } - deactivate(t) { - (this.element.firstChild && !t) || - (this.external || - this.element.parentNode.removeChild(this.element), - (this.active = !1)); - } - activate() { - this.active || - ((this.active = !0), - this.external || - (this.table.element.appendChild(this.getElement()), - (this.table.element.style.display = ""))); - } - redraw() { - this.dispatch("footer-redraw"); - } - } - class Te extends C { - constructor(t) { - super(t), - (this.el = null), - (this.abortClasses = [ - "tabulator-headers", - "tabulator-table", - ]), - (this.previousTargets = {}), - (this.listeners = [ - "click", - "dblclick", - "contextmenu", - "mouseenter", - "mouseleave", - "mouseover", - "mouseout", - "mousemove", - "mouseup", - "mousedown", - "touchstart", - "touchend", - ]), - (this.componentMap = { - "tabulator-cell": "cell", - "tabulator-row": "row", - "tabulator-group": "group", - "tabulator-col": "column", - }), - (this.pseudoTrackers = { - row: { subscriber: null, target: null }, - cell: { subscriber: null, target: null }, - group: { subscriber: null, target: null }, - column: { subscriber: null, target: null }, - }), - (this.pseudoTracking = !1); - } - initialize() { - (this.el = this.table.element), - this.buildListenerMap(), - this.bindSubscriptionWatchers(); - } - buildListenerMap() { - var t = {}; - this.listeners.forEach((e) => { - t[e] = { handler: null, components: [] }; - }), - (this.listeners = t); - } - bindPseudoEvents() { - Object.keys(this.pseudoTrackers).forEach((t) => { - (this.pseudoTrackers[t].subscriber = - this.pseudoMouseEnter.bind(this, t)), - this.subscribe( - t + "-mouseover", - this.pseudoTrackers[t].subscriber - ); - }), - (this.pseudoTracking = !0); - } - pseudoMouseEnter(t, e, i) { - this.pseudoTrackers[t].target !== i && - (this.pseudoTrackers[t].target && - this.dispatch( - t + "-mouseleave", - e, - this.pseudoTrackers[t].target - ), - this.pseudoMouseLeave(t, e), - (this.pseudoTrackers[t].target = i), - this.dispatch(t + "-mouseenter", e, i)); - } - pseudoMouseLeave(t, e) { - var i = Object.keys(this.pseudoTrackers), - o = { row: ["cell"], cell: ["row"] }; - (i = i.filter((n) => { - var r = o[t]; - return n !== t && (!r || (r && !r.includes(n))); - })).forEach((n) => { - var r = this.pseudoTrackers[n].target; - this.pseudoTrackers[n].target && - (this.dispatch(n + "-mouseleave", e, r), - (this.pseudoTrackers[n].target = null)); - }); - } - bindSubscriptionWatchers() { - var t = Object.keys(this.listeners), - e = Object.values(this.componentMap); - for (let i of e) - for (let o of t) { - let n = i + "-" + o; - this.subscriptionChange( - n, - this.subscriptionChanged.bind(this, i, o) - ); - } - this.subscribe("table-destroy", this.clearWatchers.bind(this)); - } - subscriptionChanged(t, e, i) { - var o = this.listeners[e].components, - n = o.indexOf(t), - r = !1; - i - ? n === -1 && (o.push(t), (r = !0)) - : this.subscribed(t + "-" + e) || - (n > -1 && (o.splice(n, 1), (r = !0))), - (e !== "mouseenter" && e !== "mouseleave") || - this.pseudoTracking || - this.bindPseudoEvents(), - r && this.updateEventListeners(); - } - updateEventListeners() { - for (let t in this.listeners) { - let e = this.listeners[t]; - e.components.length - ? e.handler || - ((e.handler = this.track.bind(this, t)), - this.el.addEventListener(t, e.handler)) - : e.handler && - (this.el.removeEventListener(t, e.handler), - (e.handler = null)); - } - } - track(t, e) { - var i = (e.composedPath && e.composedPath()) || e.path, - o = this.findTargets(i); - (o = this.bindComponents(t, o)), - this.triggerEvents(t, e, o), - !this.pseudoTracking || - (t != "mouseover" && t != "mouseleave") || - Object.keys(o).length || - this.pseudoMouseLeave("none", e); - } - findTargets(t) { - var e = {}; - let i = Object.keys(this.componentMap); - for (let o of t) { - let n = o.classList ? [...o.classList] : []; - if (n.filter((a) => this.abortClasses.includes(a)).length) - break; - let r = n.filter((a) => i.includes(a)); - for (let a of r) - e[this.componentMap[a]] || - (e[this.componentMap[a]] = o); - } - return e.group && e.group === e.row && delete e.row, e; - } - bindComponents(t, e) { - var i = Object.keys(e).reverse(), - o = this.listeners[t], - n = {}, - r = {}, - a = {}; - for (let l of i) { - let h, - d = e[l], - c = this.previousTargets[l]; - if (c && c.target === d) h = c.component; - else - switch (l) { - case "row": - case "group": - (o.components.includes("row") || - o.components.includes("cell") || - o.components.includes("group")) && - ((h = this.table.rowManager - .getVisibleRows(!0) - .find((u) => u.getElement() === d)), - e.row && - e.row.parentNode && - e.row.parentNode.closest( - ".tabulator-row" - ) && - (e[l] = !1)); - break; - case "column": - o.components.includes("column") && - (h = - this.table.columnManager.findColumn(d)); - break; - case "cell": - o.components.includes("cell") && - (n.row instanceof k - ? (h = n.row.findCell(d)) - : e.row && - console.warn( - "Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?" - )); - } - h && ((n[l] = h), (a[l] = { target: d, component: h })); - } - return ( - (this.previousTargets = a), - Object.keys(e).forEach((l) => { - let h = n[l]; - r[l] = h; - }), - r - ); - } - triggerEvents(t, e, i) { - var o = this.listeners[t]; - for (let n in i) - i[n] && - o.components.includes(n) && - this.dispatch(n + "-" + t, e, i[n]); - } - clearWatchers() { - for (let t in this.listeners) { - let e = this.listeners[t]; - e.handler && - (this.el.removeEventListener(t, e.handler), - (e.handler = null)); - } - } - } - class ke { - constructor(t) { - (this.table = t), (this.bindings = {}); - } - bind(t, e, i) { - this.bindings[t] || (this.bindings[t] = {}), - this.bindings[t][e] - ? console.warn( - "Unable to bind component handler, a matching function name is already bound", - t, - e, - i - ) - : (this.bindings[t][e] = i); - } - handle(t, e, i) { - if ( - this.bindings[t] && - this.bindings[t][i] && - typeof this.bindings[t][i].bind == "function" - ) - return this.bindings[t][i].bind(null, e); - i === "then" || - typeof i != "string" || - i.startsWith("_") || - (this.table.options.debugInvalidComponentFuncs && - console.error( - "The " + - t + - " component does not have a " + - i + - " function, have you checked that you have the correct Tabulator module installed?" - )); - } - } - class Me extends C { - constructor(t) { - super(t), (this.requestOrder = 0), (this.loading = !1); - } - initialize() {} - load(t, e, i, o, n, r) { - var a = ++this.requestOrder; - return this.table.destroyed - ? Promise.resolve() - : (this.dispatchExternal("dataLoading", t), - !t || - (t.indexOf("{") != 0 && t.indexOf("[") != 0) || - (t = JSON.parse(t)), - this.confirm("data-loading", [t, e, i, n]) - ? ((this.loading = !0), - n || this.alertLoader(), - (e = this.chain( - "data-params", - [t, i, n], - e || {}, - e || {} - )), - (e = this.mapParams( - e, - this.table.options.dataSendParams - )), - this.chain( - "data-load", - [t, e, i, n], - !1, - Promise.resolve([]) - ) - .then((l) => { - if (this.table.destroyed) - console.warn( - "Data Load Response Blocked - Table has been destroyed" - ); - else { - Array.isArray(l) || - typeof l != "object" || - (l = this.mapParams( - l, - this.objectInvert( - this.table.options - .dataReceiveParams - ) - )); - var h = this.chain( - "data-loaded", - [l], - null, - l - ); - a == this.requestOrder - ? (this.clearAlert(), - h !== !1 && - (this.dispatchExternal( - "dataLoaded", - h - ), - this.table.rowManager.setData( - h, - o, - r === void 0 ? !o : r - ))) - : console.warn( - "Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made" - ); - } - }) - .catch((l) => { - console.error("Data Load Error: ", l), - this.dispatchExternal( - "dataLoadError", - l - ), - n || this.alertError(), - setTimeout(() => { - this.clearAlert(); - }, this.table.options.dataLoaderErrorTimeout); - }) - .finally(() => { - this.loading = !1; - })) - : (this.dispatchExternal("dataLoaded", t), - t || (t = []), - this.table.rowManager.setData( - t, - o, - r === void 0 ? !o : r - ), - Promise.resolve())); - } - mapParams(t, e) { - var i = {}; - for (let o in t) i[e.hasOwnProperty(o) ? e[o] : o] = t[o]; - return i; - } - objectInvert(t) { - var e = {}; - for (let i in t) e[t[i]] = i; - return e; - } - blockActiveLoad() { - this.requestOrder++; - } - alertLoader() { - (typeof this.table.options.dataLoader == "function" - ? this.table.options.dataLoader() - : this.table.options.dataLoader) && - this.table.alertManager.alert( - this.table.options.dataLoaderLoading || - this.langText("data|loading") - ); - } - alertError() { - this.table.alertManager.alert( - this.table.options.dataLoaderError || - this.langText("data|error"), - "error" - ); - } - clearAlert() { - this.table.alertManager.clear(); - } - } - class Le { - constructor(t, e, i) { - (this.table = t), - (this.events = {}), - (this.optionsList = e || {}), - (this.subscriptionNotifiers = {}), - (this.dispatch = i - ? this._debugDispatch.bind(this) - : this._dispatch.bind(this)), - (this.debug = i); - } - subscriptionChange(t, e) { - this.subscriptionNotifiers[t] || - (this.subscriptionNotifiers[t] = []), - this.subscriptionNotifiers[t].push(e), - this.subscribed(t) && this._notifySubscriptionChange(t, !0); - } - subscribe(t, e) { - this.events[t] || (this.events[t] = []), - this.events[t].push(e), - this._notifySubscriptionChange(t, !0); - } - unsubscribe(t, e) { - var i; - if (this.events[t]) { - if (e) { - if ( - !( - (i = this.events[t].findIndex((o) => o === e)) > - -1 - ) - ) - return void console.warn( - "Cannot remove event, no matching event found:", - t, - e - ); - this.events[t].splice(i, 1); - } else delete this.events[t]; - this._notifySubscriptionChange(t, !1); - } else console.warn("Cannot remove event, no events set on:", t); - } - subscribed(t) { - return this.events[t] && this.events[t].length; - } - _notifySubscriptionChange(t, e) { - var i = this.subscriptionNotifiers[t]; - i && - i.forEach((o) => { - o(e); - }); - } - _dispatch() { - var t, - e = Array.from(arguments), - i = e.shift(); - return ( - this.events[i] && - this.events[i].forEach((o, n) => { - let r = o.apply(this.table, e); - n || (t = r); - }), - t - ); - } - _debugDispatch() { - var t = Array.from(arguments), - e = t[0]; - return ( - (t[0] = "ExternalEvent:" + t[0]), - (this.debug === !0 || this.debug.includes(e)) && - console.log(...t), - this._dispatch(...arguments) - ); - } - } - class Se { - constructor(t) { - (this.events = {}), - (this.subscriptionNotifiers = {}), - (this.dispatch = t - ? this._debugDispatch.bind(this) - : this._dispatch.bind(this)), - (this.chain = t - ? this._debugChain.bind(this) - : this._chain.bind(this)), - (this.confirm = t - ? this._debugConfirm.bind(this) - : this._confirm.bind(this)), - (this.debug = t); - } - subscriptionChange(t, e) { - this.subscriptionNotifiers[t] || - (this.subscriptionNotifiers[t] = []), - this.subscriptionNotifiers[t].push(e), - this.subscribed(t) && this._notifySubscriptionChange(t, !0); - } - subscribe(t, e, i = 1e4) { - this.events[t] || (this.events[t] = []), - this.events[t].push({ callback: e, priority: i }), - this.events[t].sort((o, n) => o.priority - n.priority), - this._notifySubscriptionChange(t, !0); - } - unsubscribe(t, e) { - var i; - if (this.events[t]) { - if (e) { - if ( - !( - (i = this.events[t].findIndex( - (o) => o.callback === e - )) > -1 - ) - ) - return void console.warn( - "Cannot remove event, no matching event found:", - t, - e - ); - this.events[t].splice(i, 1); - } - this._notifySubscriptionChange(t, !1); - } else console.warn("Cannot remove event, no events set on:", t); - } - subscribed(t) { - return this.events[t] && this.events[t].length; - } - _chain(t, e, i, o) { - var n = i; - return ( - Array.isArray(e) || (e = [e]), - this.subscribed(t) - ? (this.events[t].forEach((r, a) => { - n = r.callback.apply(this, e.concat([n])); - }), - n) - : typeof o == "function" - ? o() - : o - ); - } - _confirm(t, e) { - var i = !1; - return ( - Array.isArray(e) || (e = [e]), - this.subscribed(t) && - this.events[t].forEach((o, n) => { - o.callback.apply(this, e) && (i = !0); - }), - i - ); - } - _notifySubscriptionChange(t, e) { - var i = this.subscriptionNotifiers[t]; - i && - i.forEach((o) => { - o(e); - }); - } - _dispatch() { - var t = Array.from(arguments), - e = t.shift(); - this.events[e] && - this.events[e].forEach((i) => { - i.callback.apply(this, t); - }); - } - _debugDispatch() { - var t = Array.from(arguments), - e = t[0]; - return ( - (t[0] = "InternalEvent:" + e), - (this.debug === !0 || this.debug.includes(e)) && - console.log(...t), - this._dispatch(...arguments) - ); - } - _debugChain() { - var t = Array.from(arguments), - e = t[0]; - return ( - (t[0] = "InternalEvent:" + e), - (this.debug === !0 || this.debug.includes(e)) && - console.log(...t), - this._chain(...arguments) - ); - } - _debugConfirm() { - var t = Array.from(arguments), - e = t[0]; - return ( - (t[0] = "InternalEvent:" + e), - (this.debug === !0 || this.debug.includes(e)) && - console.log(...t), - this._confirm(...arguments) - ); - } - } - class De extends C { - constructor(t) { - super(t); - } - _warnUser() { - this.options("debugDeprecation") && console.warn(...arguments); - } - check(t, e, i) { - var o = ""; - return ( - this.options(t) === void 0 || - ((o = - "Deprecated Setup Option - Use of the %c" + - t + - "%c option is now deprecated"), - e - ? ((o = - o + - ", Please use the %c" + - e + - "%c option instead"), - this._warnUser( - o, - "font-weight: bold;", - "font-weight: normal;", - "font-weight: bold;", - "font-weight: normal;" - ), - i && (this.table.options[e] = this.table.options[t])) - : this._warnUser( - o, - "font-weight: bold;", - "font-weight: normal;" - ), - !1) - ); - } - checkMsg(t, e) { - return ( - this.options(t) === void 0 || - (this._warnUser( - "%cDeprecated Setup Option - Use of the %c" + - t + - " %c option is now deprecated, " + - e, - "font-weight: normal;", - "font-weight: bold;", - "font-weight: normal;" - ), - !1) - ); - } - msg(t) { - this._warnUser(t); - } - } - class ze extends C { - constructor(t) { - super(t), (this.deps = {}), (this.props = {}); - } - initialize() { - this.deps = Object.assign({}, this.options("dependencies")); - } - lookup(t, e, i) { - if (!Array.isArray(t)) - return e ? this.lookupProp(t, e, i) : this.lookupKey(t, i); - for (let n of t) { - var o = this.lookup(n, e, !0); - if (o) break; - } - if (o) return o; - this.error(t); - } - lookupProp(t, e, i) { - var o; - return this.props[t] && this.props[t][e] - ? this.props[t][e] - : (o = this.lookupKey(t, i)) - ? (this.props[t] || (this.props[t] = {}), - (this.props[t][e] = o[e] || o), - this.props[t][e]) - : void 0; - } - lookupKey(t, e) { - var i; - return ( - this.deps[t] - ? (i = this.deps[t]) - : window[t] - ? ((this.deps[t] = window[t]), (i = this.deps[t])) - : e || this.error(t), - i - ); - } - error(t) { - console.error( - "Unable to find dependency", - t, - "Please check documentation and ensure you have imported the required library into your project" - ); - } - } - let Pe = class fe extends C { - constructor(t, e, i) { - super(t), - (this.element = e), - (this.container = this._lookupContainer()), - (this.parent = i), - (this.reversedX = !1), - (this.childPopup = null), - (this.blurable = !1), - (this.blurCallback = null), - (this.blurEventsBound = !1), - (this.renderedCallback = null), - (this.visible = !1), - (this.hideable = !0), - this.element.classList.add("tabulator-popup-container"), - (this.blurEvent = this.hide.bind(this, !1)), - (this.escEvent = this._escapeCheck.bind(this)), - (this.destroyBinding = this.tableDestroyed.bind(this)), - (this.destroyed = !1); - } - tableDestroyed() { - (this.destroyed = !0), this.hide(!0); - } - _lookupContainer() { - var t = this.table.options.popupContainer; - return ( - typeof t == "string" - ? (t = document.querySelector(t)) || - console.warn( - "Menu Error - no container element found matching selector:", - this.table.options.popupContainer, - "(defaulting to document body)" - ) - : t === !0 && (t = this.table.element), - t && - !this._checkContainerIsParent(t) && - ((t = !1), - console.warn( - "Menu Error - container element does not contain this table:", - this.table.options.popupContainer, - "(defaulting to document body)" - )), - t || (t = document.body), - t - ); - } - _checkContainerIsParent(t, e = this.table.element) { - return ( - t === e || - (!!e.parentNode && - this._checkContainerIsParent(t, e.parentNode)) - ); - } - renderCallback(t) { - this.renderedCallback = t; - } - containerEventCoords(t) { - var e = !(t instanceof MouseEvent), - i = e ? t.touches[0].pageX : t.pageX, - o = e ? t.touches[0].pageY : t.pageY; - if (this.container !== document.body) { - let n = x.elOffset(this.container); - (i -= n.left), (o -= n.top); - } - return { x: i, y: o }; - } - elementPositionCoords(t, e = "right") { - var i, - o, - n, - r = x.elOffset(t); - switch ( - (this.container !== document.body && - ((i = x.elOffset(this.container)), - (r.left -= i.left), - (r.top -= i.top)), - e) - ) { - case "right": - (o = r.left + t.offsetWidth), (n = r.top - 1); - break; - case "bottom": - (o = r.left), (n = r.top + t.offsetHeight); - break; - case "left": - (o = r.left), (n = r.top - 1); - break; - case "top": - (o = r.left), (n = r.top); - break; - case "center": - (o = r.left + t.offsetWidth / 2), - (n = r.top + t.offsetHeight / 2); - } - return { x: o, y: n, offset: r }; - } - show(t, e) { - var i, o, n, r, a; - return ( - this.destroyed || - this.table.destroyed || - (t instanceof HTMLElement - ? ((n = t), - (r = (a = this.elementPositionCoords(t, e)) - .offset), - (i = a.x), - (o = a.y)) - : typeof t == "number" - ? ((r = { top: 0, left: 0 }), (i = t), (o = e)) - : ((i = (a = this.containerEventCoords(t)).x), - (o = a.y), - (this.reversedX = !1)), - (this.element.style.top = o + "px"), - (this.element.style.left = i + "px"), - this.container.appendChild(this.element), - typeof this.renderedCallback == "function" && - this.renderedCallback(), - this._fitToScreen(i, o, n, r, e), - (this.visible = !0), - this.subscribe("table-destroy", this.destroyBinding), - this.element.addEventListener("mousedown", (l) => { - l.stopPropagation(); - })), - this - ); - } - _fitToScreen(t, e, i, o, n) { - var r = - this.container === document.body - ? document.documentElement.scrollTop - : this.container.scrollTop; - (t + this.element.offsetWidth >= this.container.offsetWidth || - this.reversedX) && - ((this.element.style.left = ""), - (this.element.style.right = i - ? this.container.offsetWidth - o.left + "px" - : this.container.offsetWidth - t + "px"), - (this.reversedX = !0)); - let a = Math.max( - this.container.offsetHeight, - r ? this.container.scrollHeight : 0 - ); - e + this.element.offsetHeight > a && - (i - ? n === "bottom" - ? (this.element.style.top = - parseInt(this.element.style.top) - - this.element.offsetHeight - - i.offsetHeight - - 1 + - "px") - : (this.element.style.top = - parseInt(this.element.style.top) - - this.element.offsetHeight + - i.offsetHeight + - 1 + - "px") - : (this.element.style.height = a + "px")); - } - isVisible() { - return this.visible; - } - hideOnBlur(t) { - return ( - (this.blurable = !0), - this.visible && - (setTimeout(() => { - this.visible && - (this.table.rowManager.element.addEventListener( - "scroll", - this.blurEvent - ), - this.subscribe("cell-editing", this.blurEvent), - document.body.addEventListener( - "click", - this.blurEvent - ), - document.body.addEventListener( - "contextmenu", - this.blurEvent - ), - document.body.addEventListener( - "mousedown", - this.blurEvent - ), - window.addEventListener( - "resize", - this.blurEvent - ), - document.body.addEventListener( - "keydown", - this.escEvent - ), - (this.blurEventsBound = !0)); - }, 100), - (this.blurCallback = t)), - this - ); - } - _escapeCheck(t) { - t.keyCode == 27 && this.hide(); - } - blockHide() { - this.hideable = !1; - } - restoreHide() { - this.hideable = !0; - } - hide(t = !1) { - return ( - this.visible && - this.hideable && - (this.blurable && - this.blurEventsBound && - (document.body.removeEventListener( - "keydown", - this.escEvent - ), - document.body.removeEventListener( - "click", - this.blurEvent - ), - document.body.removeEventListener( - "contextmenu", - this.blurEvent - ), - document.body.removeEventListener( - "mousedown", - this.blurEvent - ), - window.removeEventListener( - "resize", - this.blurEvent - ), - this.table.rowManager.element.removeEventListener( - "scroll", - this.blurEvent - ), - this.unsubscribe("cell-editing", this.blurEvent), - (this.blurEventsBound = !1)), - this.childPopup && this.childPopup.hide(), - this.parent && (this.parent.childPopup = null), - this.element.parentNode && - this.element.parentNode.removeChild(this.element), - (this.visible = !1), - this.blurCallback && !t && this.blurCallback(), - this.unsubscribe("table-destroy", this.destroyBinding)), - this - ); - } - child(t) { - return ( - this.childPopup && this.childPopup.hide(), - (this.childPopup = new fe(this.table, t, this)), - this.childPopup - ); - } - }; - class w extends C { - constructor(t, e) { - super(t), (this._handler = null); - } - initialize() {} - registerTableOption(t, e) { - this.table.optionsList.register(t, e); - } - registerColumnOption(t, e) { - this.table.columnManager.optionsList.register(t, e); - } - registerTableFunction(t, e) { - this.table[t] === void 0 - ? (this.table[t] = (...i) => ( - this.table.initGuard(t), e(...i) - )) - : console.warn( - "Unable to bind table function, name already in use", - t - ); - } - registerComponentFunction(t, e, i) { - return this.table.componentFunctionBinder.bind(t, e, i); - } - registerDataHandler(t, e) { - this.table.rowManager.registerDataPipelineHandler(t, e), - (this._handler = t); - } - registerDisplayHandler(t, e) { - this.table.rowManager.registerDisplayPipelineHandler(t, e), - (this._handler = t); - } - displayRows(t) { - var e, - i = this.table.rowManager.displayRows.length - 1; - if ( - (this._handler && - (e = this.table.rowManager.displayPipeline.findIndex( - (o) => o.handler === this._handler - )) > -1 && - (i = e), - t && (i += t), - this._handler) - ) - return i > -1 - ? this.table.rowManager.getDisplayRows(i) - : this.activeRows(); - } - activeRows() { - return this.table.rowManager.activeRows; - } - refreshData(t, e) { - e || (e = this._handler), - e && this.table.rowManager.refreshActiveData(e, !1, t); - } - footerAppend(t) { - return this.table.footerManager.append(t); - } - footerPrepend(t) { - return this.table.footerManager.prepend(t); - } - footerRemove(t) { - return this.table.footerManager.remove(t); - } - popup(t, e) { - return new Pe(this.table, t, e); - } - alert(t, e) { - return this.table.alertManager.alert(t, e); - } - clearAlert() { - return this.table.alertManager.clear(); - } - } - function he(s, t) { - s.forEach(function (e) { - e.reinitializeWidth(); - }), - this.table.options.responsiveLayout && - this.table.modExists("responsiveLayout", !0) && - this.table.modules.responsiveLayout.update(); - } - var Fe = { - fitData: function (s, t) { - t && - this.table.columnManager.renderer.reinitializeColumnWidths( - s - ), - this.table.options.responsiveLayout && - this.table.modExists("responsiveLayout", !0) && - this.table.modules.responsiveLayout.update(); - }, - fitDataFill: he, - fitDataTable: he, - fitDataStretch: function (s, t) { - var e = 0, - i = this.table.rowManager.element.clientWidth, - o = 0, - n = !1; - s.forEach((r, a) => { - r.widthFixed || r.reinitializeWidth(), - (this.table.options.responsiveLayout - ? r.modules.responsive.visible - : r.visible) && (n = r), - r.visible && (e += r.getWidth()); - }), - n - ? ((o = i - e + n.getWidth()), - this.table.options.responsiveLayout && - this.table.modExists("responsiveLayout", !0) && - (n.setWidth(0), - this.table.modules.responsiveLayout.update()), - o > 0 ? n.setWidth(o) : n.reinitializeWidth()) - : this.table.options.responsiveLayout && - this.table.modExists("responsiveLayout", !0) && - this.table.modules.responsiveLayout.update(); - }, - fitColumns: function (s, t) { - var e, - i, - o = - this.table.rowManager.element.getBoundingClientRect() - .width, - n = 0, - r = 0, - a = 0, - l = [], - h = [], - d = 0, - c = 0; - function u(p) { - return typeof p == "string" - ? p.indexOf("%") > -1 - ? (o / 100) * parseInt(p) - : parseInt(p) - : p; - } - function m(p, g, f, v) { - var E = [], - T = 0, - M = 0, - z = 0, - A = a, - tt = 0, - L = 0, - se = []; - function pe(y) { - return f * (y.column.definition.widthGrow || 1); - } - function ge(y) { - return ( - u(y.width) - - f * (y.column.definition.widthShrink || 0) - ); - } - return ( - p.forEach(function (y, ki) { - var be = v ? ge(y) : pe(y); - y.column.minWidth >= be - ? E.push(y) - : y.column.maxWidth && y.column.maxWidth < be - ? ((y.width = y.column.maxWidth), - (g -= y.column.maxWidth), - (A -= v - ? y.column.definition.widthShrink || 1 - : y.column.definition.widthGrow || 1) && - (f = Math.floor(g / A))) - : (se.push(y), - (L += v - ? y.column.definition.widthShrink || 1 - : y.column.definition.widthGrow || 1)); - }), - E.length - ? (E.forEach(function (y) { - (T += v - ? y.width - y.column.minWidth - : y.column.minWidth), - (y.width = y.column.minWidth); - }), - (M = g - T), - (z = L ? Math.floor(M / L) : M), - (tt = m(se, M, z, v))) - : ((tt = L ? g - Math.floor(g / L) * L : g), - se.forEach(function (y) { - y.width = v ? ge(y) : pe(y); - })), - tt - ); - } - this.table.options.responsiveLayout && - this.table.modExists("responsiveLayout", !0) && - this.table.modules.responsiveLayout.update(), - this.table.rowManager.element.scrollHeight > - this.table.rowManager.element.clientHeight && - (o -= - this.table.rowManager.element.offsetWidth - - this.table.rowManager.element.clientWidth), - s.forEach(function (p) { - var g, f, v; - p.visible && - ((g = p.definition.width), - (f = parseInt(p.minWidth)), - g - ? ((v = u(g)), - (n += v > f ? v : f), - p.definition.widthShrink && - (h.push({ - column: p, - width: v > f ? v : f, - }), - (d += p.definition.widthShrink))) - : (l.push({ column: p, width: 0 }), - (a += p.definition.widthGrow || 1))); - }), - (r = o - n), - (e = Math.floor(r / a)), - (c = m(l, r, e, !1)), - l.length && c > 0 && (l[l.length - 1].width += c), - l.forEach(function (p) { - r -= p.width; - }), - (i = Math.abs(c) + r) > 0 && - d && - (c = m(h, i, Math.floor(i / d), !0)), - c && h.length && (h[h.length - 1].width -= c), - l.forEach(function (p) { - p.column.setWidth(p.width); - }), - h.forEach(function (p) { - p.column.setWidth(p.width); - }); - }, - }; - let Y = class Y extends w { - constructor(t) { - super(t, "layout"), - (this.mode = null), - this.registerTableOption("layout", "fitData"), - this.registerTableOption("layoutColumnsOnNewData", !1), - this.registerColumnOption("widthGrow"), - this.registerColumnOption("widthShrink"); - } - initialize() { - var t = this.table.options.layout; - Y.modes[t] - ? (this.mode = t) - : (console.warn( - "Layout Error - invalid mode set, defaulting to 'fitData' : " + - t - ), - (this.mode = "fitData")), - this.table.element.setAttribute( - "tabulator-layout", - this.mode - ), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ); - } - initializeColumn(t) { - t.definition.widthGrow && - (t.definition.widthGrow = Number(t.definition.widthGrow)), - t.definition.widthShrink && - (t.definition.widthShrink = Number( - t.definition.widthShrink - )); - } - getMode() { - return this.mode; - } - layout(t) { - var e = this.table.columnManager.columnsByIndex.find( - (i) => - i.definition.variableHeight || - i.definition.formatter === "textarea" - ); - this.dispatch("layout-refreshing"), - Y.modes[this.mode].call( - this, - this.table.columnManager.columnsByIndex, - t - ), - e && this.table.rowManager.normalizeHeight(!0), - this.dispatch("layout-refreshed"); - } - }; - b(Y, "moduleName", "layout"), b(Y, "modes", Fe); - let mt = Y; - var He = { - default: { - groups: { item: "item", items: "items" }, - columns: {}, - data: { 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", - counter: { - showing: "Showing", - of: "of", - rows: "rows", - pages: "pages", - }, - }, - headerFilters: { default: "filter column...", columns: {} }, - }, - }; - let it = class it extends w { - constructor(t) { - super(t), - (this.locale = "default"), - (this.lang = !1), - (this.bindings = {}), - (this.langList = {}), - this.registerTableOption("locale", !1), - this.registerTableOption("langs", {}); - } - initialize() { - (this.langList = x.deepClone(it.langs)), - this.table.options.columnDefaults - .headerFilterPlaceholder !== !1 && - this.setHeaderFilterPlaceholder( - this.table.options.columnDefaults - .headerFilterPlaceholder - ); - for (let t in this.table.options.langs) - this.installLang(t, this.table.options.langs[t]); - this.setLocale(this.table.options.locale), - this.registerTableFunction( - "setLocale", - this.setLocale.bind(this) - ), - this.registerTableFunction( - "getLocale", - this.getLocale.bind(this) - ), - this.registerTableFunction( - "getLang", - this.getLang.bind(this) - ); - } - setHeaderFilterPlaceholder(t) { - this.langList.default.headerFilters.default = t; - } - installLang(t, e) { - this.langList[t] - ? this._setLangProp(this.langList[t], e) - : (this.langList[t] = e); - } - _setLangProp(t, e) { - for (let i in e) - t[i] && typeof t[i] == "object" - ? this._setLangProp(t[i], e[i]) - : (t[i] = e[i]); - } - setLocale(t) { - if ( - ((t = t || "default") === !0 && - navigator.language && - (t = navigator.language.toLowerCase()), - t && !this.langList[t]) - ) { - let e = t.split("-")[0]; - this.langList[e] - ? (console.warn( - "Localization Error - Exact matching locale not found, using closest match: ", - t, - e - ), - (t = e)) - : (console.warn( - "Localization Error - Matching locale not found, using default: ", - t - ), - (t = "default")); - } - (this.locale = t), - (this.lang = x.deepClone(this.langList.default || {})), - t != "default" && - (function e(i, o) { - for (var n in i) - typeof i[n] == "object" - ? (o[n] || (o[n] = {}), e(i[n], o[n])) - : (o[n] = i[n]); - })(this.langList[t], this.lang), - this.dispatchExternal("localized", this.locale, this.lang), - this._executeBindings(); - } - getLocale(t) { - return this.locale; - } - getLang(t) { - return t ? this.langList[t] : this.lang; - } - getText(t, e) { - var i = (e ? t + "|" + e : t).split("|"); - return this._getLangElement(i, this.locale) || ""; - } - _getLangElement(t, e) { - var i = this.lang; - return ( - t.forEach(function (o) { - var n; - i && ((n = i[o]), (i = n !== void 0 && n)); - }), - i - ); - } - bind(t, e) { - this.bindings[t] || (this.bindings[t] = []), - this.bindings[t].push(e), - e(this.getText(t), this.lang); - } - _executeBindings() { - for (let t in this.bindings) - this.bindings[t].forEach((e) => { - e(this.getText(t), this.lang); - }); - } - }; - b(it, "moduleName", "localize"), b(it, "langs", He); - let pt = it; - var Oe = Object.freeze({ - __proto__: null, - CommsModule: - ((It = class extends w { - constructor(s) { - super(s); - } - initialize() { - this.registerTableFunction( - "tableComms", - this.receive.bind(this) - ); - } - getConnections(s) { - var t = []; - return ( - this.table.constructor.registry - .lookupTable(s) - .forEach((e) => { - this.table !== e && t.push(e); - }), - t - ); - } - send(s, t, e, i) { - var o = this.getConnections(s); - o.forEach((n) => { - n.tableComms(this.table.element, t, e, i); - }), - !o.length && - s && - console.warn( - "Table Connection Error - No tables matching selector found", - s - ); - } - receive(s, t, e, i) { - if (this.table.modExists(t)) - return this.table.modules[t].commsReceived(s, e, i); - console.warn( - "Inter-table Comms Error - no such module:", - t - ); - } - }), - b(It, "moduleName", "comms"), - It), - LayoutModule: mt, - LocalizeModule: pt, - }); - let D = class D { - static findTable(t) { - var e = D.registry.lookupTable(t, !0); - return !(Array.isArray(e) && !e.length) && e; - } - }; - b(D, "registry", { - tables: [], - register(t) { - D.registry.tables.push(t); - }, - deregister(t) { - var e = D.registry.tables.indexOf(t); - e > -1 && D.registry.tables.splice(e, 1); - }, - lookupTable(t, e) { - var i, - o, - n = []; - if (typeof t == "string") { - if ((i = document.querySelectorAll(t)).length) - for (var r = 0; r < i.length; r++) - (o = D.registry.matchElement(i[r])) && n.push(o); - } else - (typeof HTMLElement < "u" && t instanceof HTMLElement) || - t instanceof D - ? (o = D.registry.matchElement(t)) && n.push(o) - : Array.isArray(t) - ? t.forEach(function (a) { - n = n.concat(D.registry.lookupTable(a)); - }) - : e || - console.warn( - "Table Connection Error - Invalid Selector", - t - ); - return n; - }, - matchElement: (t) => - D.registry.tables.find(function (e) { - return t instanceof D ? e === t : e.element === t; - }), - }); - let gt = D, - R = class R extends gt { - constructor() { - super(); - } - static initializeModuleBinder(t) { - R.modulesRegistered || - ((R.modulesRegistered = !0), - R._registerModules(Oe, !0), - t && R._registerModules(t)); - } - static _extendModule(t, e, i) { - if (R.moduleBindings[t]) { - var o = R.moduleBindings[t][e]; - if (o) - if (typeof i == "object") - for (let n in i) o[n] = i[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 - ); - } - static _registerModules(t, e) { - var i = Object.values(t); - e && - i.forEach((o) => { - o.prototype.moduleCore = !0; - }), - R._registerModule(i); - } - static _registerModule(t) { - Array.isArray(t) || (t = [t]), - t.forEach((e) => { - R._registerModuleBinding(e), - R._registerModuleExtensions(e); - }); - } - static _registerModuleBinding(t) { - t.moduleName - ? (R.moduleBindings[t.moduleName] = t) - : console.error( - "Unable to bind module, no moduleName defined", - t.moduleName - ); - } - static _registerModuleExtensions(t) { - var e = t.moduleExtensions; - if (t.moduleExtensions) - for (let i in e) { - let o = e[i]; - if (R.moduleBindings[i]) - for (let n in o) R._extendModule(i, n, o[n]); - else { - R.moduleExtensions[i] || - (R.moduleExtensions[i] = {}); - for (let n in o) - R.moduleExtensions[i][n] || - (R.moduleExtensions[i][n] = {}), - Object.assign( - R.moduleExtensions[i][n], - o[n] - ); - } - } - R._extendModuleFromQueue(t); - } - static _extendModuleFromQueue(t) { - var e = R.moduleExtensions[t.moduleName]; - if (e) - for (let i in e) R._extendModule(t.moduleName, i, e[i]); - } - _bindModules() { - var t = [], - e = [], - i = []; - for (var o in ((this.modules = {}), R.moduleBindings)) { - let n = R.moduleBindings[o], - r = new n(this); - (this.modules[o] = r), - n.prototype.moduleCore - ? this.modulesCore.push(r) - : n.moduleInitOrder - ? n.moduleInitOrder < 0 - ? t.push(r) - : e.push(r) - : i.push(r); - } - t.sort((n, r) => - n.moduleInitOrder > r.moduleInitOrder ? 1 : -1 - ), - e.sort((n, r) => - n.moduleInitOrder > r.moduleInitOrder ? 1 : -1 - ), - (this.modulesRegular = t.concat(i.concat(e))); - } - }; - b(R, "moduleBindings", {}), - b(R, "moduleExtensions", {}), - b(R, "modulesRegistered", !1), - b(R, "defaultModules", !1); - let bt = R; - class Ae extends C { - constructor(t) { - super(t), - (this.element = this._createAlertElement()), - (this.msgElement = this._createMsgElement()), - (this.type = null), - this.element.appendChild(this.msgElement); - } - _createAlertElement() { - var t = document.createElement("div"); - return t.classList.add("tabulator-alert"), t; - } - _createMsgElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-alert-msg"), - t.setAttribute("role", "alert"), - t - ); - } - _typeClass() { - return "tabulator-alert-state-" + this.type; - } - alert(t, e = "msg") { - if (t) { - for ( - this.clear(), - this.dispatch("alert-show", e), - this.type = e; - this.msgElement.firstChild; - - ) - this.msgElement.removeChild(this.msgElement.firstChild); - this.msgElement.classList.add(this._typeClass()), - typeof t == "function" && (t = t()), - t instanceof HTMLElement - ? this.msgElement.appendChild(t) - : (this.msgElement.innerHTML = t), - this.table.element.appendChild(this.element); - } - } - clear() { - this.dispatch("alert-hide", this.type), - this.element.parentNode && - this.element.parentNode.removeChild(this.element), - this.msgElement.classList.remove(this._typeClass()); - } - } - let H = class H extends bt { - static extendModule() { - H.initializeModuleBinder(), H._extendModule(...arguments); - } - static registerModule() { - H.initializeModuleBinder(), H._registerModule(...arguments); - } - constructor(t, e, i) { - super(), - H.initializeModuleBinder(i), - (this.options = {}), - (this.columnManager = null), - (this.rowManager = null), - (this.footerManager = null), - (this.alertManager = null), - (this.vdomHoz = null), - (this.externalEvents = null), - (this.eventBus = null), - (this.interactionMonitor = !1), - (this.browser = ""), - (this.browserSlow = !1), - (this.browserMobile = !1), - (this.rtl = !1), - (this.originalElement = null), - (this.componentFunctionBinder = new ke(this)), - (this.dataLoader = !1), - (this.modules = {}), - (this.modulesCore = []), - (this.modulesRegular = []), - (this.deprecationAdvisor = new De(this)), - (this.optionsList = new le(this, "table constructor")), - (this.dependencyRegistry = new ze(this)), - (this.initialized = !1), - (this.destroyed = !1), - this.initializeElement(t) && - (this.initializeCoreSystems(e), - setTimeout(() => { - this._create(); - })), - this.constructor.registry.register(this); - } - initializeElement(t) { - return typeof HTMLElement < "u" && t instanceof HTMLElement - ? ((this.element = t), !0) - : typeof t == "string" - ? ((this.element = document.querySelector(t)), - !!this.element || - (console.error( - "Tabulator Creation Error - no element found matching selector: ", - t - ), - !1)) - : (console.error( - "Tabulator Creation Error - Invalid element provided:", - t - ), - !1); - } - initializeCoreSystems(t) { - (this.columnManager = new Ce(this)), - (this.rowManager = new Re(this)), - (this.footerManager = new xe(this)), - (this.dataLoader = new Me(this)), - (this.alertManager = new Ae(this)), - this._bindModules(), - (this.options = this.optionsList.generate( - H.defaultOptions, - t - )), - this._clearObjectPointers(), - this._mapDeprecatedFunctionality(), - (this.externalEvents = new Le( - this, - this.options, - this.options.debugEventsExternal - )), - (this.eventBus = new Se(this.options.debugEventsInternal)), - (this.interactionMonitor = new Te(this)), - this.dataLoader.initialize(), - this.footerManager.initialize(), - this.dependencyRegistry.initialize(); - } - _mapDeprecatedFunctionality() {} - _clearSelection() { - this.element.classList.add("tabulator-block-select"), - window.getSelection - ? window.getSelection().empty - ? window.getSelection().empty() - : window.getSelection().removeAllRanges && - window.getSelection().removeAllRanges() - : document.selection && document.selection.empty(), - this.element.classList.remove("tabulator-block-select"); - } - _create() { - this.externalEvents.dispatch("tableBuilding"), - this.eventBus.dispatch("table-building"), - this._rtlCheck(), - this._buildElement(), - this._initializeTable(), - (this.initialized = !0), - this._loadInitialData().finally(() => { - this.eventBus.dispatch("table-initialized"), - this.externalEvents.dispatch("tableBuilt"); - }); - } - _rtlCheck() { - var t = window.getComputedStyle(this.element); - switch (this.options.textDirection) { - case "auto": - if (t.direction !== "rtl") break; - case "rtl": - this.element.classList.add("tabulator-rtl"), - (this.rtl = !0); - break; - case "ltr": - this.element.classList.add("tabulator-ltr"); - default: - this.rtl = !1; - } - } - _clearObjectPointers() { - (this.options.columns = this.options.columns.slice(0)), - Array.isArray(this.options.data) && - !this.options.reactiveData && - (this.options.data = this.options.data.slice(0)); - } - _buildElement() { - var t, - e = this.element, - i = this.options; - if (e.tagName === "TABLE") { - (this.originalElement = this.element), - (t = document.createElement("div")); - var o = e.attributes; - for (var n in o) - typeof o[n] == "object" && - t.setAttribute(o[n].name, o[n].value); - e.parentNode.replaceChild(t, e), (this.element = e = t); - } - for ( - e.classList.add("tabulator"), - e.setAttribute("role", "grid"); - e.firstChild; - - ) - e.removeChild(e.firstChild); - i.height && - ((i.height = isNaN(i.height) ? i.height : i.height + "px"), - (e.style.height = i.height)), - i.minHeight !== !1 && - ((i.minHeight = isNaN(i.minHeight) - ? i.minHeight - : i.minHeight + "px"), - (e.style.minHeight = i.minHeight)), - i.maxHeight !== !1 && - ((i.maxHeight = isNaN(i.maxHeight) - ? i.maxHeight - : i.maxHeight + "px"), - (e.style.maxHeight = i.maxHeight)); - } - _initializeTable() { - var t = this.element, - e = this.options; - this.interactionMonitor.initialize(), - this.columnManager.initialize(), - this.rowManager.initialize(), - this._detectBrowser(), - this.modulesCore.forEach((i) => { - i.initialize(); - }), - t.appendChild(this.columnManager.getElement()), - t.appendChild(this.rowManager.getElement()), - e.footerElement && this.footerManager.activate(), - e.autoColumns && - e.data && - this.columnManager.generateColumnsFromRowData( - this.options.data - ), - this.modulesRegular.forEach((i) => { - i.initialize(); - }), - this.columnManager.setColumns(e.columns), - this.eventBus.dispatch("table-built"); - } - _loadInitialData() { - return this.dataLoader.load(this.options.data).finally(() => { - this.columnManager.verticalAlignHeaders(); - }); - } - destroy() { - var t = this.element; - for ( - this.destroyed = !0, - this.constructor.registry.deregister(this), - this.eventBus.dispatch("table-destroy"), - this.rowManager.destroy(); - t.firstChild; - - ) - t.removeChild(t.firstChild); - t.classList.remove("tabulator"), - this.externalEvents.dispatch("tableDestroyed"); - } - _detectBrowser() { - var t = navigator.userAgent || navigator.vendor || window.opera; - t.indexOf("Trident") > -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)) - : t.indexOf("Mac OS") > -1 - ? ((this.browser = "safari"), (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.slice(0, 4) - )); - } - initGuard(t, e) { - var i, o; - return ( - this.options.debugInitialization && - !this.initialized && - (t || - (t = - (o = - (i = new Error().stack.split(` -`))[0] == "Error" - ? i[2] - : i[1])[0] == " " - ? o.trim().split(" ")[1].split(".")[1] - : o.trim().split("@")[0]), - console.warn( - "Table Not Initialized - Calling the " + - t + - " function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function." + - (e ? " " + e : "") - )), - this.initialized - ); - } - blockRedraw() { - this.initGuard(), - this.eventBus.dispatch("redraw-blocking"), - this.rowManager.blockRedraw(), - this.columnManager.blockRedraw(), - this.eventBus.dispatch("redraw-blocked"); - } - restoreRedraw() { - this.initGuard(), - this.eventBus.dispatch("redraw-restoring"), - this.rowManager.restoreRedraw(), - this.columnManager.restoreRedraw(), - this.eventBus.dispatch("redraw-restored"); - } - setData(t, e, i) { - return ( - this.initGuard( - !1, - "To set initial data please use the 'data' property in the table constructor." - ), - this.dataLoader.load(t, e, i, !1) - ); - } - clearData() { - this.initGuard(), - this.dataLoader.blockActiveLoad(), - this.rowManager.clearData(); - } - getData(t) { - return this.rowManager.getData(t); - } - getDataCount(t) { - return this.rowManager.getDataCount(t); - } - replaceData(t, e, i) { - return this.initGuard(), this.dataLoader.load(t, e, i, !0, !0); - } - updateData(t) { - var e = 0; - return ( - this.initGuard(), - new Promise((i, o) => { - this.dataLoader.blockActiveLoad(), - typeof t == "string" && (t = JSON.parse(t)), - t && t.length > 0 - ? t.forEach((n) => { - var r = this.rowManager.findRow( - n[this.options.index] - ); - r - ? (e++, - r - .updateData(n) - .then(() => { - --e || i(); - }) - .catch((a) => { - o( - "Update Error - Unable to update row", - n, - a - ); - })) - : o( - "Update Error - Unable to find row", - n - ); - }) - : (console.warn( - "Update Error - No data provided" - ), - o("Update Error - No data provided")); - }) - ); - } - addData(t, e, i) { - return ( - this.initGuard(), - new Promise((o, n) => { - this.dataLoader.blockActiveLoad(), - typeof t == "string" && (t = JSON.parse(t)), - t - ? this.rowManager.addRows(t, e, i).then((r) => { - var a = []; - r.forEach(function (l) { - a.push(l.getComponent()); - }), - o(a); - }) - : (console.warn( - "Update Error - No data provided" - ), - n("Update Error - No data provided")); - }) - ); - } - updateOrAddData(t) { - var e = [], - i = 0; - return ( - this.initGuard(), - new Promise((o, n) => { - this.dataLoader.blockActiveLoad(), - typeof t == "string" && (t = JSON.parse(t)), - t && t.length > 0 - ? t.forEach((r) => { - var a = this.rowManager.findRow( - r[this.options.index] - ); - i++, - a - ? a.updateData(r).then(() => { - i--, - e.push( - a.getComponent() - ), - i || o(e); - }) - : this.rowManager - .addRows(r) - .then((l) => { - i--, - e.push( - l[0].getComponent() - ), - i || o(e); - }); - }) - : (console.warn( - "Update Error - No data provided" - ), - n("Update Error - No data provided")); - }) - ); - } - getRow(t) { - var e = this.rowManager.findRow(t); - return e - ? e.getComponent() - : (console.warn("Find Error - No matching row found:", t), - !1); - } - getRowFromPosition(t) { - var e = this.rowManager.getRowFromPosition(t); - return e - ? e.getComponent() - : (console.warn("Find Error - No matching row found:", t), - !1); - } - deleteRow(t) { - var e = []; - this.initGuard(), Array.isArray(t) || (t = [t]); - for (let i of t) { - let o = this.rowManager.findRow(i, !0); - if (!o) - return ( - console.error( - "Delete Error - No matching row found:", - i - ), - Promise.reject( - "Delete Error - No matching row found" - ) - ); - e.push(o); - } - return ( - e.sort((i, o) => - this.rowManager.rows.indexOf(i) > - this.rowManager.rows.indexOf(o) - ? 1 - : -1 - ), - e.forEach((i) => { - i.delete(); - }), - this.rowManager.reRenderInPosition(), - Promise.resolve() - ); - } - addRow(t, e, i) { - return ( - this.initGuard(), - typeof t == "string" && (t = JSON.parse(t)), - this.rowManager - .addRows(t, e, i, !0) - .then((o) => o[0].getComponent()) - ); - } - updateOrAddRow(t, e) { - var i = this.rowManager.findRow(t); - return ( - this.initGuard(), - typeof e == "string" && (e = JSON.parse(e)), - i - ? i.updateData(e).then(() => i.getComponent()) - : this.rowManager - .addRows(e) - .then((o) => o[0].getComponent()) - ); - } - updateRow(t, e) { - var i = this.rowManager.findRow(t); - return ( - this.initGuard(), - typeof e == "string" && (e = JSON.parse(e)), - i - ? i - .updateData(e) - .then(() => Promise.resolve(i.getComponent())) - : (console.warn( - "Update Error - No matching row found:", - t - ), - Promise.reject( - "Update Error - No matching row found" - )) - ); - } - scrollToRow(t, e, i) { - var o = this.rowManager.findRow(t); - return o - ? this.rowManager.scrollToRow(o, e, i) - : (console.warn("Scroll Error - No matching row found:", t), - Promise.reject("Scroll Error - No matching row found")); - } - moveRow(t, e, i) { - var o = this.rowManager.findRow(t); - this.initGuard(), - o - ? o.moveToRow(e, i) - : console.warn( - "Move Error - No matching row found:", - t - ); - } - getRows(t) { - return this.rowManager.getComponents(t); - } - getRowPosition(t) { - var e = this.rowManager.findRow(t); - return e - ? e.getPosition() - : (console.warn( - "Position Error - No matching row found:", - t - ), - !1); - } - setColumns(t) { - this.initGuard( - !1, - "To set initial columns please use the 'columns' property in the table constructor" - ), - this.columnManager.setColumns(t); - } - getColumns(t) { - return this.columnManager.getComponents(t); - } - getColumn(t) { - var e = this.columnManager.findColumn(t); - return e - ? e.getComponent() - : (console.warn( - "Find Error - No matching column found:", - t - ), - !1); - } - getColumnDefinitions() { - return this.columnManager.getDefinitionTree(); - } - showColumn(t) { - var e = this.columnManager.findColumn(t); - if ((this.initGuard(), !e)) - return ( - console.warn( - "Column Show Error - No matching column found:", - t - ), - !1 - ); - e.show(); - } - hideColumn(t) { - var e = this.columnManager.findColumn(t); - if ((this.initGuard(), !e)) - return ( - console.warn( - "Column Hide Error - No matching column found:", - t - ), - !1 - ); - e.hide(); - } - toggleColumn(t) { - var e = this.columnManager.findColumn(t); - if ((this.initGuard(), !e)) - return ( - console.warn( - "Column Visibility Toggle Error - No matching column found:", - t - ), - !1 - ); - e.visible ? e.hide() : e.show(); - } - addColumn(t, e, i) { - var o = this.columnManager.findColumn(i); - return ( - this.initGuard(), - this.columnManager - .addColumn(t, e, o) - .then((n) => n.getComponent()) - ); - } - deleteColumn(t) { - var e = this.columnManager.findColumn(t); - return ( - this.initGuard(), - e - ? e.delete() - : (console.warn( - "Column Delete Error - No matching column found:", - t - ), - Promise.reject()) - ); - } - updateColumnDefinition(t, e) { - var i = this.columnManager.findColumn(t); - return ( - this.initGuard(), - i - ? i.updateDefinition(e) - : (console.warn( - "Column Update Error - No matching column found:", - t - ), - Promise.reject()) - ); - } - moveColumn(t, e, i) { - var o = this.columnManager.findColumn(t), - n = this.columnManager.findColumn(e); - this.initGuard(), - o - ? n - ? this.columnManager.moveColumn(o, n, i) - : console.warn( - "Move Error - No matching column found:", - n - ) - : console.warn( - "Move Error - No matching column found:", - t - ); - } - scrollToColumn(t, e, i) { - return new Promise((o, n) => { - var r = this.columnManager.findColumn(t); - return r - ? this.columnManager.scrollToColumn(r, e, i) - : (console.warn( - "Scroll Error - No matching column found:", - t - ), - Promise.reject( - "Scroll Error - No matching column found" - )); - }); - } - redraw(t) { - this.initGuard(), - this.columnManager.redraw(t), - this.rowManager.redraw(t); - } - setHeight(t) { - (this.options.height = isNaN(t) ? t : t + "px"), - (this.element.style.height = this.options.height), - this.rowManager.initializeRenderer(), - this.rowManager.redraw(!0); - } - on(t, e) { - this.externalEvents.subscribe(t, e); - } - off(t, e) { - this.externalEvents.unsubscribe(t, e); - } - dispatchEvent() { - Array.from(arguments).shift(), - this.externalEvents.dispatch(...arguments); - } - alert(t, e) { - this.initGuard(), this.alertManager.alert(t, e); - } - clearAlert() { - this.initGuard(), this.alertManager.clear(); - } - modExists(t, e) { - return ( - !!this.modules[t] || - (e && console.error("Tabulator Module Not Installed: " + t), - !1) - ); - } - module(t) { - var e = this.modules[t]; - return ( - e || console.error("Tabulator module not installed: " + t), - e - ); - } - }; - b(H, "defaultOptions", P); - let U = H; - var Be = { - rownum: function (s, t, e, i, o, n) { - return n.getPosition(); - }, - }; - let Q = class Q extends w { - constructor(t) { - super(t), - (this.allowedTypes = [ - "", - "data", - "download", - "clipboard", - "print", - "htmlOutput", - ]), - this.registerColumnOption("accessor"), - this.registerColumnOption("accessorParams"), - this.registerColumnOption("accessorData"), - this.registerColumnOption("accessorDataParams"), - this.registerColumnOption("accessorDownload"), - this.registerColumnOption("accessorDownloadParams"), - this.registerColumnOption("accessorClipboard"), - this.registerColumnOption("accessorClipboardParams"), - this.registerColumnOption("accessorPrint"), - this.registerColumnOption("accessorPrintParams"), - this.registerColumnOption("accessorHtmlOutput"), - this.registerColumnOption("accessorHtmlOutputParams"); - } - initialize() { - this.subscribe( - "column-layout", - this.initializeColumn.bind(this) - ), - this.subscribe( - "row-data-retrieve", - this.transformRow.bind(this) - ); - } - initializeColumn(t) { - var e = !1, - i = {}; - this.allowedTypes.forEach((o) => { - var n, - r = - "accessor" + - (o.charAt(0).toUpperCase() + o.slice(1)); - t.definition[r] && - (n = this.lookupAccessor(t.definition[r])) && - ((e = !0), - (i[r] = { - accessor: n, - params: t.definition[r + "Params"] || {}, - })); - }), - e && (t.modules.accessor = i); - } - lookupAccessor(t) { - var e = !1; - switch (typeof t) { - case "string": - Q.accessors[t] - ? (e = Q.accessors[t]) - : console.warn( - "Accessor Error - No such accessor found, ignoring: ", - t - ); - break; - case "function": - e = t; - } - return e; - } - transformRow(t, e) { - var i = "accessor" + (e.charAt(0).toUpperCase() + e.slice(1)), - o = t.getComponent(), - n = x.deepClone(t.data || {}); - return ( - this.table.columnManager.traverse(function (r) { - var a, l, h, d; - r.modules.accessor && - (l = - r.modules.accessor[i] || - r.modules.accessor.accessor || - !1) && - (a = r.getFieldValue(n)) != "undefined" && - ((d = r.getComponent()), - (h = - typeof l.params == "function" - ? l.params(a, n, e, d, o) - : l.params), - r.setFieldValue(n, l.accessor(a, n, e, h, d, o))); - }), - n - ); - } - }; - b(Q, "moduleName", "accessor"), b(Q, "accessors", Be); - let ft = Q; - var _e = { method: "GET" }; - function vt(s, t) { - var e = []; - if (((t = t || ""), Array.isArray(s))) - s.forEach((o, n) => { - e = e.concat(vt(o, t ? t + "[" + n + "]" : n)); - }); - else if (typeof s == "object") - for (var i in s) - e = e.concat(vt(s[i], t ? t + "[" + i + "]" : i)); - else e.push({ key: t, value: s }); - return e; - } - function Ve(s) { - var t = vt(s), - e = []; - return ( - t.forEach(function (i) { - e.push( - encodeURIComponent(i.key) + - "=" + - encodeURIComponent(i.value) - ); - }), - e.join("&") - ); - } - function de(s, t, e) { - return ( - s && - e && - Object.keys(e).length && - ((t.method && t.method.toLowerCase() != "get") || - ((t.method = "get"), - (s += (s.includes("?") ? "&" : "?") + Ve(e)))), - s - ); - } - function Ie(s, t, e) { - var i; - return new Promise((o, n) => { - if ( - ((s = this.urlGenerator.call(this.table, s, t, e)), - t.method.toUpperCase() != "GET") - ) - if ( - (i = - typeof this.table.options.ajaxContentType == - "object" - ? this.table.options.ajaxContentType - : this.contentTypeFormatters[ - this.table.options.ajaxContentType - ]) - ) { - for (var r in i.headers) - t.headers || (t.headers = {}), - t.headers[r] === void 0 && - (t.headers[r] = i.headers[r]); - t.body = i.body.call(this, s, t, e); - } else - console.warn( - "Ajax Error - Invalid ajaxContentType value:", - this.table.options.ajaxContentType - ); - s - ? (t.headers === void 0 && (t.headers = {}), - t.headers.Accept === void 0 && - (t.headers.Accept = "application/json"), - t.headers["X-Requested-With"] === void 0 && - (t.headers["X-Requested-With"] = "XMLHttpRequest"), - t.mode === void 0 && (t.mode = "cors"), - t.mode == "cors" - ? (t.headers.Origin === void 0 && - (t.headers.Origin = window.location.origin), - t.credentials === void 0 && - (t.credentials = "same-origin")) - : t.credentials === void 0 && - (t.credentials = "include"), - fetch(s, t) - .then((a) => { - a.ok - ? a - .json() - .then((l) => { - o(l); - }) - .catch((l) => { - n(l), - console.warn( - "Ajax Load Error - Invalid JSON returned", - l - ); - }) - : (console.error( - "Ajax Load Error - Connection Error: " + - a.status, - a.statusText - ), - n(a)); - }) - .catch((a) => { - console.error( - "Ajax Load Error - Connection Error: ", - a - ), - n(a); - })) - : (console.warn("Ajax Load Error - No URL Set"), o([])); - }); - } - function wt(s, t) { - var e = []; - if (((t = t || ""), Array.isArray(s))) - s.forEach((o, n) => { - e = e.concat(wt(o, t ? t + "[" + n + "]" : n)); - }); - else if (typeof s == "object") - for (var i in s) - e = e.concat(wt(s[i], t ? t + "[" + i + "]" : i)); - else e.push({ key: t, value: s }); - return e; - } - var Ne = { - json: { - headers: { "Content-Type": "application/json" }, - body: function (s, t, e) { - return JSON.stringify(e); - }, - }, - form: { - headers: {}, - body: function (s, t, e) { - var i = wt(e), - o = new FormData(); - return ( - i.forEach(function (n) { - o.append(n.key, n.value); - }), - o - ); - }, - }, - }; - let F = class F extends w { - constructor(t) { - super(t), - (this.config = {}), - (this.url = ""), - (this.urlGenerator = !1), - (this.params = !1), - (this.loaderPromise = !1), - this.registerTableOption("ajaxURL", !1), - this.registerTableOption("ajaxURLGenerator", !1), - this.registerTableOption("ajaxParams", {}), - this.registerTableOption("ajaxConfig", "get"), - this.registerTableOption("ajaxContentType", "form"), - this.registerTableOption("ajaxRequestFunc", !1), - this.registerTableOption("ajaxRequesting", function () {}), - this.registerTableOption("ajaxResponse", !1), - (this.contentTypeFormatters = F.contentTypeFormatters); - } - initialize() { - (this.loaderPromise = - this.table.options.ajaxRequestFunc || - F.defaultLoaderPromise), - (this.urlGenerator = - this.table.options.ajaxURLGenerator || - F.defaultURLGenerator), - this.table.options.ajaxURL && - this.setUrl(this.table.options.ajaxURL), - this.setDefaultConfig(this.table.options.ajaxConfig), - this.registerTableFunction( - "getAjaxUrl", - this.getUrl.bind(this) - ), - this.subscribe( - "data-loading", - this.requestDataCheck.bind(this) - ), - this.subscribe( - "data-params", - this.requestParams.bind(this) - ), - this.subscribe("data-load", this.requestData.bind(this)); - } - requestParams(t, e, i, o) { - var n = this.table.options.ajaxParams; - return ( - n && - (typeof n == "function" && (n = n.call(this.table)), - (o = Object.assign(Object.assign({}, n), o))), - o - ); - } - requestDataCheck(t, e, i, o) { - return !((t || !this.url) && typeof t != "string"); - } - requestData(t, e, i, o, n) { - var r; - return !n && this.requestDataCheck(t) - ? (t && this.setUrl(t), - (r = this.generateConfig(i)), - this.sendRequest(this.url, e, r)) - : n; - } - setDefaultConfig(t = {}) { - (this.config = Object.assign({}, F.defaultConfig)), - typeof t == "string" - ? (this.config.method = t) - : Object.assign(this.config, t); - } - generateConfig(t = {}) { - var e = Object.assign({}, this.config); - return ( - typeof t == "string" ? (e.method = t) : Object.assign(e, t), - e - ); - } - setUrl(t) { - this.url = t; - } - getUrl() { - return this.url; - } - sendRequest(t, e, i) { - return this.table.options.ajaxRequesting.call( - this.table, - t, - e - ) !== !1 - ? this.loaderPromise(t, i, e).then( - (o) => ( - this.table.options.ajaxResponse && - (o = this.table.options.ajaxResponse.call( - this.table, - t, - e, - o - )), - o - ) - ) - : Promise.reject(); - } - }; - b(F, "moduleName", "ajax"), - b(F, "defaultConfig", _e), - b(F, "defaultURLGenerator", de), - b(F, "defaultLoaderPromise", Ie), - b(F, "contentTypeFormatters", Ne); - let Ct = F; - var We = { - replace: function (s) { - return this.table.setData(s); - }, - update: function (s) { - return this.table.updateOrAddData(s); - }, - insert: function (s) { - return this.table.addData(s); - }, - }, - je = { - table: function (s) { - var t = [], - e = !0, - i = this.table.columnManager.columns, - o = [], - n = []; - return ( - (s = s.split(` -`)).forEach(function (r) { - t.push(r.split(" ")); - }), - !(!t.length || (t.length === 1 && t[0].length < 2)) && - (t[0].forEach(function (r) { - var a = i.find(function (l) { - return ( - r && - l.definition.title && - r.trim() && - l.definition.title.trim() === r.trim() - ); - }); - a ? o.push(a) : (e = !1); - }), - e || - ((e = !0), - (o = []), - t[0].forEach(function (r) { - var a = i.find(function (l) { - return ( - r && - l.field && - r.trim() && - l.field.trim() === r.trim() - ); - }); - a ? o.push(a) : (e = !1); - }), - e || - (o = - this.table.columnManager - .columnsByIndex)), - e && t.shift(), - t.forEach(function (r) { - var a = {}; - r.forEach(function (l, h) { - o[h] && (a[o[h].field] = l); - }), - n.push(a); - }), - n) - ); - }, - }, - Ge = { - keybindings: { - bindings: { copyToClipboard: ["ctrl + 67", "meta + 67"] }, - actions: { - copyToClipboard: function (s) { - this.table.modules.edit.currentCell || - (this.table.modExists("clipboard", !0) && - this.table.modules.clipboard.copy(!1, !0)); - }, - }, - }, - }; - let B = class B extends w { - constructor(t) { - super(t), - (this.mode = !0), - (this.pasteParser = function () {}), - (this.pasteAction = function () {}), - (this.customSelection = !1), - (this.rowRange = !1), - (this.blocked = !0), - this.registerTableOption("clipboard", !1), - this.registerTableOption("clipboardCopyStyled", !0), - this.registerTableOption("clipboardCopyConfig", !1), - this.registerTableOption("clipboardCopyFormatter", !1), - this.registerTableOption("clipboardCopyRowRange", "active"), - this.registerTableOption("clipboardPasteParser", "table"), - this.registerTableOption("clipboardPasteAction", "insert"), - this.registerColumnOption("clipboard"), - this.registerColumnOption("titleClipboard"); - } - initialize() { - (this.mode = this.table.options.clipboard), - (this.rowRange = this.table.options.clipboardCopyRowRange), - (this.mode !== !0 && this.mode !== "copy") || - this.table.element.addEventListener("copy", (t) => { - var e, i, o; - this.blocked || - (t.preventDefault(), - this.customSelection - ? ((e = this.customSelection), - this.table.options - .clipboardCopyFormatter && - (e = - this.table.options.clipboardCopyFormatter( - "plain", - e - ))) - : ((o = - this.table.modules.export.generateExportList( - this.table.options - .clipboardCopyConfig, - this.table.options - .clipboardCopyStyled, - this.rowRange, - "clipboard" - )), - (e = (i = - this.table.modules.export.generateHTMLTable( - o - )) - ? this.generatePlainContent(o) - : ""), - this.table.options - .clipboardCopyFormatter && - ((e = - this.table.options.clipboardCopyFormatter( - "plain", - e - )), - (i = - this.table.options.clipboardCopyFormatter( - "html", - i - )))), - window.clipboardData && - window.clipboardData.setData - ? window.clipboardData.setData("Text", e) - : t.clipboardData && t.clipboardData.setData - ? (t.clipboardData.setData("text/plain", e), - i && - t.clipboardData.setData( - "text/html", - i - )) - : t.originalEvent && - t.originalEvent.clipboardData.setData && - (t.originalEvent.clipboardData.setData( - "text/plain", - e - ), - i && - t.originalEvent.clipboardData.setData( - "text/html", - i - )), - this.dispatchExternal("clipboardCopied", e, i), - this.reset()); - }), - (this.mode !== !0 && this.mode !== "paste") || - this.table.element.addEventListener("paste", (t) => { - this.paste(t); - }), - this.setPasteParser( - this.table.options.clipboardPasteParser - ), - this.setPasteAction( - this.table.options.clipboardPasteAction - ), - this.registerTableFunction( - "copyToClipboard", - this.copy.bind(this) - ); - } - reset() { - (this.blocked = !0), (this.customSelection = !1); - } - generatePlainContent(t) { - var e = []; - return ( - t.forEach((i) => { - var o = []; - i.columns.forEach((n) => { - var r = ""; - if (n) - if ( - (i.type === "group" && - (n.value = n.component.getKey()), - n.value === null) - ) - r = ""; - else - switch (typeof n.value) { - case "object": - r = JSON.stringify(n.value); - break; - case "undefined": - r = ""; - break; - default: - r = n.value; - } - o.push(r); - }), - e.push(o.join(" ")); - }), - e.join(` -`) - ); - } - copy(t, e) { - var i, o; - (this.blocked = !1), - (this.customSelection = !1), - (this.mode !== !0 && this.mode !== "copy") || - ((this.rowRange = - t || this.table.options.clipboardCopyRowRange), - window.getSelection !== void 0 && - document.createRange !== void 0 - ? ((t = document.createRange()).selectNodeContents( - this.table.element - ), - (i = window.getSelection()).toString() && - e && - (this.customSelection = i.toString()), - i.removeAllRanges(), - i.addRange(t)) - : document.selection !== void 0 && - document.body.createTextRange !== void 0 && - ((o = - document.body.createTextRange()).moveToElementText( - this.table.element - ), - o.select()), - document.execCommand("copy"), - i && i.removeAllRanges()); - } - setPasteAction(t) { - switch (typeof t) { - case "string": - (this.pasteAction = B.pasteActions[t]), - this.pasteAction || - console.warn( - "Clipboard Error - No such paste action found:", - t - ); - break; - case "function": - this.pasteAction = t; - } - } - setPasteParser(t) { - switch (typeof t) { - case "string": - (this.pasteParser = B.pasteParsers[t]), - this.pasteParser || - console.warn( - "Clipboard Error - No such paste parser found:", - t - ); - break; - case "function": - this.pasteParser = t; - } - } - paste(t) { - var e, i, o; - this.checkPasteOrigin(t) && - ((e = this.getPasteData(t)), - (i = this.pasteParser.call(this, e)) - ? (t.preventDefault(), - this.table.modExists("mutator") && - (i = this.mutateData(i)), - (o = this.pasteAction.call(this, i)), - this.dispatchExternal("clipboardPasted", e, i, o)) - : this.dispatchExternal("clipboardPasteError", e)); - } - mutateData(t) { - var e = []; - return ( - Array.isArray(t) - ? t.forEach((i) => { - e.push( - this.table.modules.mutator.transformRow( - i, - "clipboard" - ) - ); - }) - : (e = t), - e - ); - } - checkPasteOrigin(t) { - var e = !0; - return ( - (!this.confirm("clipboard-paste", [t]) && - ["DIV", "SPAN"].includes(t.target.tagName)) || - (e = !1), - e - ); - } - getPasteData(t) { - var e; - return ( - window.clipboardData && window.clipboardData.getData - ? (e = window.clipboardData.getData("Text")) - : t.clipboardData && t.clipboardData.getData - ? (e = t.clipboardData.getData("text/plain")) - : t.originalEvent && - t.originalEvent.clipboardData.getData && - (e = - t.originalEvent.clipboardData.getData( - "text/plain" - )), - e - ); - } - }; - b(B, "moduleName", "clipboard"), - b(B, "moduleExtensions", Ge), - b(B, "pasteActions", We), - b(B, "pasteParsers", je); - let Et = B; - class Ue { - constructor(t) { - return ( - (this._row = t), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._row.table.componentFunctionBinder.handle( - "row", - e._row, - i - ); - }, - }) - ); - } - getData(t) { - return this._row.getData(t); - } - getElement() { - return this._row.getElement(); - } - getTable() { - return this._row.table; - } - getCells() { - var t = []; - return ( - this._row.getCells().forEach(function (e) { - t.push(e.getComponent()); - }), - t - ); - } - getCell(t) { - var e = this._row.getCell(t); - return !!e && e.getComponent(); - } - _getSelf() { - return this._row; - } - } - var Je = { - avg: function (s, t, e) { - var i = 0, - o = e.precision !== void 0 ? e.precision : 2; - return ( - s.length && - ((i = s.reduce(function (n, r) { - return Number(n) + Number(r); - })), - (i /= s.length), - (i = o !== !1 ? i.toFixed(o) : i)), - parseFloat(i).toString() - ); - }, - max: function (s, t, e) { - var i = null, - o = e.precision !== void 0 && e.precision; - return ( - s.forEach(function (n) { - ((n = Number(n)) > i || i === null) && (i = n); - }), - i !== null ? (o !== !1 ? i.toFixed(o) : i) : "" - ); - }, - min: function (s, t, e) { - var i = null, - o = e.precision !== void 0 && e.precision; - return ( - s.forEach(function (n) { - ((n = Number(n)) < i || i === null) && (i = n); - }), - i !== null ? (o !== !1 ? i.toFixed(o) : i) : "" - ); - }, - sum: function (s, t, e) { - var i = 0, - o = e.precision !== void 0 && e.precision; - return ( - s.length && - s.forEach(function (n) { - (n = Number(n)), (i += isNaN(n) ? 0 : Number(n)); - }), - o !== !1 ? i.toFixed(o) : i - ); - }, - concat: function (s, t, e) { - var i = 0; - return ( - s.length && - (i = s.reduce(function (o, n) { - return String(o) + String(n); - })), - i - ); - }, - count: function (s, t, e) { - var i = 0; - return ( - s.length && - s.forEach(function (o) { - o && i++; - }), - i - ); - }, - unique: function (s, t, e) { - return s.filter((i, o) => (s || i === 0) && s.indexOf(i) === o) - .length; - }, - }; - let _ = class _ extends w { - constructor(t) { - super(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.blocked = !1), - (this.recalcAfterBlock = !1), - this.registerTableOption("columnCalcs", !0), - this.registerColumnOption("topCalc"), - this.registerColumnOption("topCalcParams"), - this.registerColumnOption("topCalcFormatter"), - this.registerColumnOption("topCalcFormatterParams"), - this.registerColumnOption("bottomCalc"), - this.registerColumnOption("bottomCalcParams"), - this.registerColumnOption("bottomCalcFormatter"), - this.registerColumnOption("bottomCalcFormatterParams"); - } - createElement() { - var t = document.createElement("div"); - return t.classList.add("tabulator-calcs-holder"), t; - } - initialize() { - (this.genColumn = new G({ field: "value" }, this)), - this.subscribe( - "cell-value-changed", - this.cellValueChanged.bind(this) - ), - this.subscribe( - "column-init", - this.initializeColumnCheck.bind(this) - ), - this.subscribe("row-deleted", this.rowsUpdated.bind(this)), - this.subscribe( - "scroll-horizontal", - this.scrollHorizontal.bind(this) - ), - this.subscribe("row-added", this.rowsUpdated.bind(this)), - this.subscribe( - "column-moved", - this.recalcActiveRows.bind(this) - ), - this.subscribe( - "column-add", - this.recalcActiveRows.bind(this) - ), - this.subscribe( - "data-refreshed", - this.recalcActiveRowsRefresh.bind(this) - ), - this.subscribe("table-redraw", this.tableRedraw.bind(this)), - this.subscribe("rows-visible", this.visibleRows.bind(this)), - this.subscribe( - "scrollbar-vertical", - this.adjustForScrollbar.bind(this) - ), - this.subscribe( - "redraw-blocked", - this.blockRedraw.bind(this) - ), - this.subscribe( - "redraw-restored", - this.restoreRedraw.bind(this) - ), - this.subscribe( - "table-redrawing", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-resized", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-show", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-hide", - this.resizeHolderWidth.bind(this) - ), - this.registerTableFunction( - "getCalcResults", - this.getResults.bind(this) - ), - this.registerTableFunction( - "recalc", - this.userRecalc.bind(this) - ), - this.resizeHolderWidth(); - } - resizeHolderWidth() { - this.topElement.style.minWidth = - this.table.columnManager.headersElement.offsetWidth + "px"; - } - tableRedraw(t) { - this.recalc(this.table.rowManager.activeRows), - t && this.redraw(); - } - blockRedraw() { - (this.blocked = !0), (this.recalcAfterBlock = !1); - } - restoreRedraw() { - (this.blocked = !1), - this.recalcAfterBlock && - ((this.recalcAfterBlock = !1), - this.recalcActiveRowsRefresh()); - } - userRecalc() { - this.recalc(this.table.rowManager.activeRows); - } - blockCheck() { - return ( - this.blocked && (this.recalcAfterBlock = !0), this.blocked - ); - } - visibleRows(t, e) { - return ( - this.topRow && e.unshift(this.topRow), - this.botRow && e.push(this.botRow), - e - ); - } - rowsUpdated(t) { - this.table.options.groupBy - ? this.recalcRowGroup(t) - : this.recalcActiveRows(); - } - recalcActiveRowsRefresh() { - this.table.options.groupBy && - this.table.options.dataTreeStartExpanded && - this.table.options.dataTree - ? this.recalcAll() - : this.recalcActiveRows(); - } - recalcActiveRows() { - this.recalc(this.table.rowManager.activeRows); - } - cellValueChanged(t) { - (t.column.definition.topCalc || - t.column.definition.bottomCalc) && - (this.table.options.groupBy - ? ((this.table.options.columnCalcs != "table" && - this.table.options.columnCalcs != "both") || - this.recalcActiveRows(), - this.table.options.columnCalcs != "table" && - this.recalcRowGroup(t.row)) - : this.recalcActiveRows()); - } - initializeColumnCheck(t) { - (t.definition.topCalc || t.definition.bottomCalc) && - this.initializeColumn(t); - } - initializeColumn(t) { - var e = t.definition, - i = { - topCalcParams: e.topCalcParams || {}, - botCalcParams: e.bottomCalcParams || {}, - }; - if (e.topCalc) { - switch (typeof e.topCalc) { - case "string": - _.calculations[e.topCalc] - ? (i.topCalc = _.calculations[e.topCalc]) - : console.warn( - "Column Calc Error - No such calculation found, ignoring: ", - e.topCalc - ); - break; - case "function": - i.topCalc = e.topCalc; - } - i.topCalc && - ((t.modules.columnCalcs = i), - this.topCalcs.push(t), - this.table.options.columnCalcs != "group" && - this.initializeTopRow()); - } - if (e.bottomCalc) { - switch (typeof e.bottomCalc) { - case "string": - _.calculations[e.bottomCalc] - ? (i.botCalc = _.calculations[e.bottomCalc]) - : console.warn( - "Column Calc Error - No such calculation found, ignoring: ", - e.bottomCalc - ); - break; - case "function": - i.botCalc = e.bottomCalc; - } - i.botCalc && - ((t.modules.columnCalcs = i), - this.botCalcs.push(t), - this.table.options.columnCalcs != "group" && - this.initializeBottomRow()); - } - } - registerColumnField() {} - removeCalcs() { - var t = !1; - this.topInitialized && - ((this.topInitialized = !1), - this.topElement.parentNode.removeChild(this.topElement), - (t = !0)), - this.botInitialized && - ((this.botInitialized = !1), - this.footerRemove(this.botElement), - (t = !0)), - t && this.table.rowManager.adjustTableSize(); - } - reinitializeCalcs() { - this.topCalcs.length && this.initializeTopRow(), - this.botCalcs.length && this.initializeBottomRow(); - } - initializeTopRow() { - var t = document.createDocumentFragment(); - this.topInitialized || - (t.appendChild(document.createElement("br")), - t.appendChild(this.topElement), - this.table.columnManager - .getContentsElement() - .insertBefore( - t, - this.table.columnManager.headersElement.nextSibling - ), - (this.topInitialized = !0)); - } - initializeBottomRow() { - this.botInitialized || - (this.footerPrepend(this.botElement), - (this.botInitialized = !0)); - } - scrollHorizontal(t) { - this.botInitialized && - this.botRow && - (this.botElement.scrollLeft = t); - } - recalc(t) { - var e, i; - if ( - !this.blockCheck() && - (this.topInitialized || this.botInitialized) - ) { - if (((e = this.rowsToData(t)), this.topInitialized)) { - for ( - this.topRow && this.topRow.deleteCells(), - i = this.generateRow("top", e), - this.topRow = i; - this.topElement.firstChild; - - ) - this.topElement.removeChild( - this.topElement.firstChild - ); - this.topElement.appendChild(i.getElement()), - i.initialize(!0); - } - if (this.botInitialized) { - for ( - this.botRow && this.botRow.deleteCells(), - i = this.generateRow("bottom", e), - this.botRow = i; - this.botElement.firstChild; - - ) - this.botElement.removeChild( - this.botElement.firstChild - ); - this.botElement.appendChild(i.getElement()), - i.initialize(!0); - } - this.table.rowManager.adjustTableSize(), - this.table.modExists("frozenColumns") && - this.table.modules.frozenColumns.layout(); - } - } - recalcRowGroup(t) { - this.recalcGroup(this.table.modules.groupRows.getRowGroup(t)); - } - recalcAll() { - (this.topCalcs.length || this.botCalcs.length) && - (this.table.options.columnCalcs !== "group" && - this.recalcActiveRows(), - this.table.options.groupBy && - this.table.options.columnCalcs !== "table" && - this.table.modules.groupRows - .getChildGroups() - .forEach((t) => { - this.recalcGroup(t); - })); - } - recalcGroup(t) { - var e, i; - this.blockCheck() || - (t && - t.calcs && - (t.calcs.bottom && - ((e = this.rowsToData(t.rows)), - (i = this.generateRowData("bottom", e)), - t.calcs.bottom.updateData(i), - t.calcs.bottom.reinitialize()), - t.calcs.top && - ((e = this.rowsToData(t.rows)), - (i = this.generateRowData("top", e)), - t.calcs.top.updateData(i), - t.calcs.top.reinitialize()))); - } - generateTopRow(t) { - return this.generateRow("top", this.rowsToData(t)); - } - generateBottomRow(t) { - return this.generateRow("bottom", this.rowsToData(t)); - } - rowsToData(t) { - var e = [], - i = - this.table.options.dataTree && - this.table.options.dataTreeChildColumnCalcs, - o = this.table.modules.dataTree; - return ( - t.forEach((n) => { - e.push(n.getData()), - i && - n.modules.dataTree?.open && - this.rowsToData( - o.getFilteredTreeChildren(n) - ).forEach((r) => { - e.push(n); - }); - }), - e - ); - } - generateRow(t, e) { - var i, - o = this.generateRowData(t, e); - return ( - this.table.modExists("mutator") && - this.table.modules.mutator.disable(), - (i = new k(o, this, "calc")), - this.table.modExists("mutator") && - this.table.modules.mutator.enable(), - i - .getElement() - .classList.add( - "tabulator-calcs", - "tabulator-calcs-" + t - ), - (i.component = !1), - (i.getComponent = () => ( - i.component || (i.component = new Ue(i)), i.component - )), - (i.generateCells = () => { - var n = []; - this.table.columnManager.columnsByIndex.forEach((r) => { - this.genColumn.setField(r.getField()), - (this.genColumn.hozAlign = r.hozAlign), - r.definition[t + "CalcFormatter"] && - this.table.modExists("format") - ? (this.genColumn.modules.format = { - formatter: - this.table.modules.format.lookupFormatter( - r.definition[ - t + "CalcFormatter" - ] - ), - params: - r.definition[ - t + "CalcFormatterParams" - ] || {}, - }) - : (this.genColumn.modules.format = { - formatter: - this.table.modules.format.lookupFormatter( - "plaintext" - ), - params: {}, - }), - (this.genColumn.definition.cssClass = - r.definition.cssClass); - var a = new et(this.genColumn, i); - a.getElement(), - (a.column = r), - a.setWidth(), - r.cells.push(a), - n.push(a), - r.visible || a.hide(); - }), - (i.cells = n); - }), - i - ); - } - generateRowData(t, e) { - var i, - o, - n = {}, - r = t == "top" ? this.topCalcs : this.botCalcs, - a = t == "top" ? "topCalc" : "botCalc"; - return ( - r.forEach(function (l) { - var h = []; - l.modules.columnCalcs && - l.modules.columnCalcs[a] && - (e.forEach(function (d) { - h.push(l.getFieldValue(d)); - }), - (o = a + "Params"), - (i = - typeof l.modules.columnCalcs[o] == "function" - ? l.modules.columnCalcs[o](h, e) - : l.modules.columnCalcs[o]), - l.setFieldValue( - n, - l.modules.columnCalcs[a](h, e, i) - )); - }), - n - ); - } - hasTopCalcs() { - return !!this.topCalcs.length; - } - hasBottomCalcs() { - return !!this.botCalcs.length; - } - redraw() { - this.topRow && this.topRow.normalizeHeight(!0), - this.botRow && this.botRow.normalizeHeight(!0); - } - getResults() { - var t = {}; - return ( - this.table.options.groupBy && - this.table.modExists("groupRows") - ? this.table.modules.groupRows - .getGroups(!0) - .forEach((e) => { - t[e.getKey()] = this.getGroupResults(e); - }) - : (t = { - top: this.topRow ? this.topRow.getData() : {}, - bottom: this.botRow ? this.botRow.getData() : {}, - }), - t - ); - } - getGroupResults(t) { - var e = t._getSelf(), - i = t.getSubGroups(), - o = {}; - return ( - i.forEach((n) => { - o[n.getKey()] = this.getGroupResults(n); - }), - { - top: e.calcs.top ? e.calcs.top.getData() : {}, - bottom: e.calcs.bottom ? e.calcs.bottom.getData() : {}, - groups: o, - } - ); - } - adjustForScrollbar(t) { - this.botRow && - (this.table.rtl - ? (this.botElement.style.paddingLeft = t + "px") - : (this.botElement.style.paddingRight = t + "px")); - } - }; - b(_, "moduleName", "columnCalcs"), b(_, "calculations", Je); - let yt = _; - var qe = { - csv: function (s, t = {}, e) { - var i = t.delimiter ? t.delimiter : ",", - o = [], - n = []; - s.forEach((r) => { - var a = []; - switch (r.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": - r.columns.forEach((l, h) => { - l && - l.depth === 1 && - (n[h] = - l.value === void 0 || l.value === null - ? "" - : '"' + - String(l.value) - .split('"') - .join('""') + - '"'); - }); - break; - case "row": - r.columns.forEach((l) => { - if (l) { - switch (typeof l.value) { - case "object": - l.value = - l.value !== null - ? JSON.stringify(l.value) - : ""; - break; - case "undefined": - l.value = ""; - } - a.push( - '"' + - String(l.value) - .split('"') - .join('""') + - '"' - ); - } - }), - o.push(a.join(i)); - } - }), - n.length && o.unshift(n.join(i)), - (o = o.join(` -`)), - t.bom && (o = "\uFEFF" + o), - e(o, "text/csv"); - }, - json: function (s, t, e) { - var i = []; - s.forEach((o) => { - var n = {}; - switch (o.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": - o.columns.forEach((r) => { - r && - (n[ - r.component.getTitleDownload() || - r.component.getField() - ] = r.value); - }), - i.push(n); - } - }), - e((i = JSON.stringify(i, null, " ")), "application/json"); - }, - jsonLines: function (s, t, e) { - let i = []; - s.forEach((o) => { - let n = {}; - switch (o.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": - o.columns.forEach((r) => { - r && - (n[ - r.component.getTitleDownload() || - r.component.getField() - ] = r.value); - }), - i.push(JSON.stringify(n)); - } - }), - e( - i.join(` -`), - "application/x-ndjson" - ); - }, - pdf: function (s, t = {}, e) { - var i, - o, - n = [], - r = [], - a = {}, - l = t.rowGroupStyles || { - fontStyle: "bold", - fontSize: 12, - cellPadding: 6, - fillColor: 220, - }, - h = t.rowCalcStyles || { - fontStyle: "bold", - fontSize: 10, - cellPadding: 4, - fillColor: 232, - }, - d = t.jsPDF || {}, - c = t.title ? t.title : ""; - function u(m, p) { - var g = []; - return ( - m.columns.forEach((f) => { - var v; - if (f) { - switch (typeof f.value) { - case "object": - f.value = - f.value !== null - ? JSON.stringify(f.value) - : ""; - break; - case "undefined": - f.value = ""; - } - (v = { - content: f.value, - colSpan: f.width, - rowSpan: f.height, - }), - p && (v.styles = p), - g.push(v); - } - }), - g - ); - } - d.orientation || (d.orientation = t.orientation || "landscape"), - d.unit || (d.unit = "pt"), - s.forEach((m) => { - switch (m.type) { - case "header": - n.push(u(m)); - break; - case "group": - r.push(u(m, l)); - break; - case "calc": - r.push(u(m, h)); - break; - case "row": - r.push(u(m)); - } - }), - (i = this.dependencyRegistry.lookup("jspdf", "jsPDF")), - (o = new i(d)), - t.autoTable && - (a = - typeof t.autoTable == "function" - ? t.autoTable(o) || {} - : t.autoTable), - c && - (a.didDrawPage = function (m) { - o.text(c, 40, 30); - }), - (a.head = n), - (a.body = r), - o.autoTable(a), - t.documentProcessing && t.documentProcessing(o), - e(o.output("arraybuffer"), "application/pdf"); - }, - xlsx: function (s, t, e) { - var i = t.sheetName || "Sheet1", - o = this.dependencyRegistry.lookup("XLSX"), - n = o.utils.book_new(), - r = new C(this), - a = !("compress" in t) || t.compress, - l = t.writeOptions || { - bookType: "xlsx", - bookSST: !0, - compression: a, - }; - function h() { - var c = [], - u = [], - m = {}, - p = { - s: { c: 0, r: 0 }, - e: { - c: s[0] - ? s[0].columns.reduce( - (g, f) => - g + (f && f.width ? f.width : 1), - 0 - ) - : 0, - r: s.length, - }, - }; - return ( - s.forEach((g, f) => { - var v = []; - g.columns.forEach(function (E, T) { - E - ? (v.push( - E.value instanceof Date || - typeof E.value != "object" - ? E.value - : JSON.stringify(E.value) - ), - (E.width > 1 || E.height > -1) && - (E.height > 1 || E.width > 1) && - u.push({ - s: { r: f, c: T }, - e: { - r: f + E.height - 1, - c: T + E.width - 1, - }, - })) - : v.push(""); - }), - c.push(v); - }), - o.utils.sheet_add_aoa(m, c), - (m["!ref"] = o.utils.encode_range(p)), - u.length && (m["!merges"] = u), - m - ); - } - if ( - ((l.type = "binary"), - (n.SheetNames = []), - (n.Sheets = {}), - t.sheetOnly) - ) - e(h()); - else { - if (t.sheets) - for (var d in t.sheets) - t.sheets[d] === !0 - ? (n.SheetNames.push(d), (n.Sheets[d] = h())) - : (n.SheetNames.push(d), - r.commsSend( - t.sheets[d], - "download", - "intercept", - { - type: "xlsx", - options: { sheetOnly: !0 }, - active: this.active, - intercept: function (c) { - n.Sheets[d] = c; - }, - } - )); - else n.SheetNames.push(i), (n.Sheets[i] = h()); - t.documentProcessing && (n = t.documentProcessing(n)), - e( - (function (c) { - for ( - var u = new ArrayBuffer(c.length), - m = new Uint8Array(u), - p = 0; - p != c.length; - ++p - ) - m[p] = 255 & c.charCodeAt(p); - return u; - })(o.write(n, l)), - "application/octet-stream" - ); - } - }, - html: function (s, t, e) { - this.modExists("export", !0) && - e(this.modules.export.generateHTMLTable(s), "text/html"); - }, - }; - let Z = class Z extends w { - constructor(t) { - super(t), - this.registerTableOption( - "downloadEncoder", - function (e, i) { - return new Blob([e], { type: i }); - } - ), - this.registerTableOption("downloadConfig", {}), - this.registerTableOption("downloadRowRange", "active"), - this.registerColumnOption("download"), - this.registerColumnOption("titleDownload"); - } - initialize() { - this.deprecatedOptionsCheck(), - this.registerTableFunction( - "download", - this.download.bind(this) - ), - this.registerTableFunction( - "downloadToTab", - this.downloadToTab.bind(this) - ); - } - deprecatedOptionsCheck() {} - downloadToTab(t, e, i, o) { - this.download(t, e, i, o, !0); - } - download(t, e, i, o, n) { - var r = !1; - if ( - (typeof t == "function" - ? (r = t) - : Z.downloaders[t] - ? (r = Z.downloaders[t]) - : console.warn( - "Download Error - No such download type found: ", - t - ), - r) - ) { - var a = this.generateExportList(o); - r.call( - this.table, - a, - i || {}, - function (l, h) { - n - ? n === !0 - ? this.triggerDownload(l, h, t, e, !0) - : n(l) - : this.triggerDownload(l, h, t, e); - }.bind(this) - ); - } - } - generateExportList(t) { - var e = this.table.modules.export.generateExportList( - this.table.options.downloadConfig, - !1, - t || this.table.options.downloadRowRange, - "download" - ), - i = this.table.options.groupHeaderDownload; - return ( - i && !Array.isArray(i) && (i = [i]), - e.forEach((o) => { - var n; - o.type === "group" && - ((n = o.columns[0]), - i && - i[o.indent] && - (n.value = i[o.indent]( - n.value, - o.component._group.getRowCount(), - o.component._group.getData(), - o.component - ))); - }), - e - ); - } - triggerDownload(t, e, i, o, n) { - var r = document.createElement("a"), - a = this.table.options.downloadEncoder(t, e); - a && - (n - ? window.open(window.URL.createObjectURL(a)) - : ((o = - o || - "Tabulator." + - (typeof i == "function" ? "txt" : i)), - navigator.msSaveOrOpenBlob - ? navigator.msSaveOrOpenBlob(a, o) - : (r.setAttribute( - "href", - window.URL.createObjectURL(a) - ), - r.setAttribute("download", o), - (r.style.display = "none"), - document.body.appendChild(r), - r.click(), - document.body.removeChild(r))), - this.dispatchExternal("downloadComplete")); - } - commsReceived(t, e, i) { - e === "intercept" && - this.download(i.type, "", i.options, i.active, i.intercept); - } - }; - b(Z, "moduleName", "download"), b(Z, "downloaders", qe); - let Rt = Z; - function dt(s, t) { - var e = t.mask, - i = t.maskLetterChar !== void 0 ? t.maskLetterChar : "A", - o = t.maskNumberChar !== void 0 ? t.maskNumberChar : "9", - n = t.maskWildcardChar !== void 0 ? t.maskWildcardChar : "*"; - function r(a) { - var l = e[a]; - l !== void 0 && - l !== n && - l !== i && - l !== o && - ((s.value = s.value + "" + l), r(a + 1)); - } - s.addEventListener("keydown", (a) => { - var l = s.value.length, - h = a.key; - if (a.keyCode > 46 && !a.ctrlKey && !a.metaKey) { - if (l >= e.length) - return a.preventDefault(), a.stopPropagation(), !1; - switch (e[l]) { - case i: - if (h.toUpperCase() == h.toLowerCase()) - return ( - a.preventDefault(), a.stopPropagation(), !1 - ); - break; - case o: - if (isNaN(h)) - return ( - a.preventDefault(), a.stopPropagation(), !1 - ); - break; - case n: - break; - default: - if (h !== e[l]) - return ( - a.preventDefault(), a.stopPropagation(), !1 - ); - } - } - }), - s.addEventListener("keyup", (a) => { - a.keyCode > 46 && t.maskAutoFill && r(s.value.length); - }), - s.placeholder || (s.placeholder = e), - t.maskAutoFill && r(s.value.length); - } - let Xe = class { - constructor(s, t, e, i, o, n) { - (this.edit = s), - (this.table = s.table), - (this.cell = t), - (this.params = this._initializeParams(n)), - (this.data = []), - (this.displayItems = []), - (this.currentItems = []), - (this.focusedItem = null), - (this.input = this._createInputElement()), - (this.listEl = this._createListElement()), - (this.initialValues = null), - (this.isFilter = t.getType() === "header"), - (this.filterTimeout = null), - (this.filtered = !1), - (this.typing = !1), - (this.values = []), - (this.popup = null), - (this.listIteration = 0), - (this.lastAction = ""), - (this.filterTerm = ""), - (this.blurable = !0), - (this.actions = { success: i, cancel: o }), - this._deprecatedOptionsCheck(), - this._initializeValue(), - e(this._onRendered.bind(this)); - } - _deprecatedOptionsCheck() {} - _initializeValue() { - var s = this.cell.getValue(); - s === void 0 && - this.params.defaultValue !== void 0 && - (s = this.params.defaultValue), - (this.initialValues = this.params.multiselect ? s : [s]), - this.isFilter && - ((this.input.value = this.initialValues - ? this.initialValues.join(",") - : ""), - this.headerFilterInitialListGen()); - } - _onRendered() { - var s = this.cell.getElement(); - function t(e) { - e.stopPropagation(); - } - this.isFilter || - ((this.input.style.height = "100%"), - this.input.focus({ preventScroll: !0 })), - s.addEventListener("click", t), - setTimeout(() => { - s.removeEventListener("click", t); - }, 1e3), - this.input.addEventListener( - "mousedown", - this._preventPopupBlur.bind(this) - ); - } - _createListElement() { - var s = document.createElement("div"); - return ( - s.classList.add("tabulator-edit-list"), - s.addEventListener( - "mousedown", - this._preventBlur.bind(this) - ), - s.addEventListener( - "keydown", - this._inputKeyDown.bind(this) - ), - s - ); - } - _setListWidth() { - var s = this.isFilter ? this.input : this.cell.getElement(); - (this.listEl.style.minWidth = s.offsetWidth + "px"), - this.params.maxWidth && - (this.params.maxWidth === !0 - ? (this.listEl.style.maxWidth = - s.offsetWidth + "px") - : typeof this.params.maxWidth == "number" - ? (this.listEl.style.maxWidth = - this.params.maxWidth + "px") - : (this.listEl.style.maxWidth = - this.params.maxWidth)); - } - _createInputElement() { - var s = this.params.elementAttributes, - t = document.createElement("input"); - if ( - (t.setAttribute( - "type", - this.params.clearable ? "search" : "text" - ), - (t.style.padding = "4px"), - (t.style.width = "100%"), - (t.style.boxSizing = "border-box"), - this.params.autocomplete || - ((t.style.cursor = "default"), - (t.style.caretColor = "transparent")), - s && typeof s == "object") - ) - for (let e in s) - e.charAt(0) == "+" - ? ((e = e.slice(1)), - t.setAttribute(e, t.getAttribute(e) + s["+" + e])) - : t.setAttribute(e, s[e]); - return ( - this.params.mask && dt(t, this.params), - this._bindInputEvents(t), - t - ); - } - _initializeParams(s) { - var t, - e = ["values", "valuesURL", "valuesLookup"]; - return ( - ((s = Object.assign({}, s)).verticalNavigation = - s.verticalNavigation || "editor"), - (s.placeholderLoading = - s.placeholderLoading === void 0 - ? "Searching ..." - : s.placeholderLoading), - (s.placeholderEmpty = - s.placeholderEmpty === void 0 - ? "No Results Found" - : s.placeholderEmpty), - (s.filterDelay = - s.filterDelay === void 0 ? 300 : s.filterDelay), - (s.emptyValue = Object.keys(s).includes("emptyValue") - ? s.emptyValue - : ""), - (t = Object.keys(s).filter((i) => e.includes(i)).length) - ? t > 1 && - console.warn( - "list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor" - ) - : console.warn( - "list editor config error - either the values, valuesURL, or valuesLookup option must be set" - ), - s.autocomplete - ? s.multiselect && - ((s.multiselect = !1), - console.warn( - "list editor config error - multiselect option is not available when autocomplete is enabled" - )) - : (s.freetext && - ((s.freetext = !1), - console.warn( - "list editor config error - freetext option is only available when autocomplete is enabled" - )), - s.filterFunc && - ((s.filterFunc = !1), - console.warn( - "list editor config error - filterFunc option is only available when autocomplete is enabled" - )), - s.filterRemote && - ((s.filterRemote = !1), - console.warn( - "list editor config error - filterRemote option is only available when autocomplete is enabled" - )), - s.mask && - ((s.mask = !1), - console.warn( - "list editor config error - mask option is only available when autocomplete is enabled" - )), - s.allowEmpty && - ((s.allowEmpty = !1), - console.warn( - "list editor config error - allowEmpty option is only available when autocomplete is enabled" - )), - s.listOnEmpty && - ((s.listOnEmpty = !1), - console.warn( - "list editor config error - listOnEmpty option is only available when autocomplete is enabled" - ))), - s.filterRemote && - typeof s.valuesLookup != "function" && - !s.valuesURL && - ((s.filterRemote = !1), - console.warn( - "list editor config error - filterRemote option should only be used when values list is populated from a remote source" - )), - s - ); - } - _bindInputEvents(s) { - s.addEventListener("focus", this._inputFocus.bind(this)), - s.addEventListener("click", this._inputClick.bind(this)), - s.addEventListener("blur", this._inputBlur.bind(this)), - s.addEventListener( - "keydown", - this._inputKeyDown.bind(this) - ), - s.addEventListener("search", this._inputSearch.bind(this)), - this.params.autocomplete && - s.addEventListener( - "keyup", - this._inputKeyUp.bind(this) - ); - } - _inputFocus(s) { - this.rebuildOptionsList(); - } - _filter() { - this.params.filterRemote - ? (clearTimeout(this.filterTimeout), - (this.filterTimeout = setTimeout(() => { - this.rebuildOptionsList(); - }, this.params.filterDelay))) - : this._filterList(); - } - _inputClick(s) { - s.stopPropagation(); - } - _inputBlur(s) { - this.blurable && - (this.popup ? this.popup.hide() : this._resolveValue(!0)); - } - _inputSearch() { - this._clearChoices(); - } - _inputKeyDown(s) { - switch (s.keyCode) { - case 38: - this._keyUp(s); - break; - case 40: - this._keyDown(s); - break; - case 37: - case 39: - this._keySide(s); - break; - case 13: - this._keyEnter(); - break; - case 27: - this._keyEsc(); - break; - case 36: - case 35: - this._keyHomeEnd(s); - break; - case 9: - this._keyTab(s); - break; - default: - this._keySelectLetter(s); - } - } - _inputKeyUp(s) { - switch (s.keyCode) { - case 38: - case 37: - case 39: - case 40: - case 13: - case 27: - break; - default: - this._keyAutoCompLetter(s); - } - } - _preventPopupBlur() { - this.popup && this.popup.blockHide(), - setTimeout(() => { - this.popup && this.popup.restoreHide(); - }, 10); - } - _preventBlur() { - (this.blurable = !1), - setTimeout(() => { - this.blurable = !0; - }, 10); - } - _keyTab(s) { - this.params.autocomplete && this.lastAction === "typing" - ? this._resolveValue(!0) - : this.focusedItem && - this._chooseItem(this.focusedItem, !0); - } - _keyUp(s) { - var t = this.displayItems.indexOf(this.focusedItem); - (this.params.verticalNavigation == "editor" || - (this.params.verticalNavigation == "hybrid" && t)) && - (s.stopImmediatePropagation(), - s.stopPropagation(), - s.preventDefault(), - t > 0 && this._focusItem(this.displayItems[t - 1])); - } - _keyDown(s) { - var t = this.displayItems.indexOf(this.focusedItem); - (this.params.verticalNavigation == "editor" || - (this.params.verticalNavigation == "hybrid" && - t < this.displayItems.length - 1)) && - (s.stopImmediatePropagation(), - s.stopPropagation(), - s.preventDefault(), - t < this.displayItems.length - 1 && - (t == -1 - ? this._focusItem(this.displayItems[0]) - : this._focusItem(this.displayItems[t + 1]))); - } - _keySide(s) { - this.params.autocomplete || - (s.stopImmediatePropagation(), - s.stopPropagation(), - s.preventDefault()); - } - _keyEnter(s) { - this.params.autocomplete && this.lastAction === "typing" - ? this._resolveValue(!0) - : this.focusedItem && this._chooseItem(this.focusedItem); - } - _keyEsc(s) { - this._cancel(); - } - _keyHomeEnd(s) { - this.params.autocomplete && s.stopImmediatePropagation(); - } - _keySelectLetter(s) { - this.params.autocomplete || - (s.preventDefault(), - s.keyCode >= 38 && - s.keyCode <= 90 && - this._scrollToValue(s.keyCode)); - } - _keyAutoCompLetter(s) { - this._filter(), - (this.lastAction = "typing"), - (this.typing = !0); - } - _scrollToValue(s) { - clearTimeout(this.filterTimeout); - var t = String.fromCharCode(s).toLowerCase(); - this.filterTerm += t.toLowerCase(); - var e = this.displayItems.find( - (i) => - i.label !== void 0 && - i.label.toLowerCase().startsWith(this.filterTerm) - ); - e && this._focusItem(e), - (this.filterTimeout = setTimeout(() => { - this.filterTerm = ""; - }, 800)); - } - _focusItem(s) { - (this.lastAction = "focus"), - this.focusedItem && - this.focusedItem.element && - this.focusedItem.element.classList.remove("focused"), - (this.focusedItem = s), - s && - s.element && - (s.element.classList.add("focused"), - s.element.scrollIntoView({ - behavior: "smooth", - block: "nearest", - inline: "start", - })); - } - headerFilterInitialListGen() { - this._generateOptions(!0); - } - rebuildOptionsList() { - this._generateOptions() - .then(this._sortOptions.bind(this)) - .then(this._buildList.bind(this)) - .then(this._showList.bind(this)) - .catch((s) => { - Number.isInteger(s) || - console.error("List generation error", s); - }); - } - _filterList() { - this._buildList(this._filterOptions()), this._showList(); - } - _generateOptions(s) { - var t = [], - e = ++this.listIteration; - return ( - (this.filtered = !1), - this.params.values - ? (t = this.params.values) - : this.params.valuesURL - ? (t = this._ajaxRequest( - this.params.valuesURL, - this.input.value - )) - : typeof this.params.valuesLookup == "function" - ? (t = this.params.valuesLookup( - this.cell, - this.input.value - )) - : this.params.valuesLookup && - (t = this._uniqueColumnValues( - this.params.valuesLookupField - )), - t instanceof Promise - ? (s || - this._addPlaceholder( - this.params.placeholderLoading - ), - t - .then() - .then((i) => - this.listIteration === e - ? this._parseList(i) - : Promise.reject(e) - )) - : Promise.resolve(this._parseList(t)) - ); - } - _addPlaceholder(s) { - var t = document.createElement("div"); - typeof s == "function" && - (s = s(this.cell.getComponent(), this.listEl)), - s && - (this._clearList(), - s instanceof HTMLElement - ? (t = s) - : (t.classList.add( - "tabulator-edit-list-placeholder" - ), - (t.innerHTML = s)), - this.listEl.appendChild(t), - this._showList()); - } - _ajaxRequest(s, t) { - return ( - (s = de( - s, - {}, - this.params.filterRemote ? { term: t } : {} - )), - fetch(s) - .then((e) => - e.ok - ? e - .json() - .catch( - (i) => ( - console.warn( - "List Ajax Load Error - Invalid JSON returned", - i - ), - Promise.reject(i) - ) - ) - : (console.error( - "List Ajax Load Error - Connection Error: " + - e.status, - e.statusText - ), - Promise.reject(e)) - ) - .catch( - (e) => ( - console.error( - "List Ajax Load Error - Connection Error: ", - e - ), - Promise.reject(e) - ) - ) - ); - } - _uniqueColumnValues(s) { - var t, - e = {}, - i = this.table.getData(this.params.valuesLookup); - return ( - (t = s - ? this.table.columnManager.getColumnByField(s) - : this.cell.getColumn()._getSelf()) - ? i.forEach((o) => { - var n = t.getFieldValue(o); - this._emptyValueCheck(n) || - (this.params.multiselect && Array.isArray(n) - ? n.forEach((r) => { - this._emptyValueCheck(r) || - (e[r] = !0); - }) - : (e[n] = !0)); - }) - : (console.warn( - "unable to find matching column to create select lookup list:", - s - ), - (e = [])), - Object.keys(e) - ); - } - _emptyValueCheck(s) { - return s == null || s === ""; - } - _parseList(s) { - var t = []; - return ( - Array.isArray(s) || - (s = Object.entries(s).map(([e, i]) => ({ - label: i, - value: e, - }))), - s.forEach((e) => { - typeof e != "object" && (e = { label: e, value: e }), - this._parseListItem(e, t, 0); - }), - !this.currentItems.length && - this.params.freetext && - ((this.input.value = this.initialValues), - (this.typing = !0), - (this.lastAction = "typing")), - (this.data = t), - t - ); - } - _parseListItem(s, t, e) { - var i = {}; - s.options - ? (i = this._parseListGroup(s, e + 1)) - : ((i = { - label: s.label, - value: s.value, - itemParams: s.itemParams, - elementAttributes: s.elementAttributes, - element: !1, - selected: !1, - visible: !0, - level: e, - original: s, - }), - this.initialValues && - this.initialValues.indexOf(s.value) > -1 && - this._chooseItem(i, !0)), - t.push(i); - } - _parseListGroup(s, t) { - var e = { - label: s.label, - group: !0, - itemParams: s.itemParams, - elementAttributes: s.elementAttributes, - element: !1, - visible: !0, - level: t, - options: [], - original: s, - }; - return ( - s.options.forEach((i) => { - this._parseListItem(i, e.options, t); - }), - e - ); - } - _sortOptions(s) { - var t; - return ( - this.params.sort && - ((t = - typeof this.params.sort == "function" - ? this.params.sort - : this._defaultSortFunction.bind(this)), - this._sortGroup(t, s)), - s - ); - } - _sortGroup(s, t) { - t.sort((e, i) => - s( - e.label, - i.label, - e.value, - i.value, - e.original, - i.original - ) - ), - t.forEach((e) => { - e.group && this._sortGroup(s, e.options); - }); - } - _defaultSortFunction(s, t) { - var e, - i, - o, - n, - r, - a = 0, - l = /(\d+)|(\D+)/g, - h = /\d/, - d = 0; - if ( - (this.params.sort === "desc" && ([s, t] = [t, s]), - s || s === 0) - ) { - if (t || t === 0) { - if (isFinite(s) && isFinite(t)) return s - t; - if ( - (e = String(s).toLowerCase()) === - (i = String(t).toLowerCase()) - ) - return 0; - if (!h.test(e) || !h.test(i)) return e > i ? 1 : -1; - for ( - e = e.match(l), - i = i.match(l), - r = e.length > i.length ? i.length : e.length; - a < r; - - ) - if ((o = e[a]) !== (n = i[a++])) - return isFinite(o) && isFinite(n) - ? (o.charAt(0) === "0" && (o = "." + o), - n.charAt(0) === "0" && (n = "." + n), - o - n) - : o > n - ? 1 - : -1; - return e.length > i.length; - } - d = 1; - } else d = t || t === 0 ? -1 : 0; - return d; - } - _filterOptions() { - var s = this.params.filterFunc || this._defaultFilterFunc, - t = this.input.value; - return ( - t - ? ((this.filtered = !0), - this.data.forEach((e) => { - this._filterItem(s, t, e); - })) - : (this.filtered = !1), - this.data - ); - } - _filterItem(s, t, e) { - var i = !1; - return ( - e.group - ? (e.options.forEach((o) => { - this._filterItem(s, t, o) && (i = !0); - }), - (e.visible = i)) - : (e.visible = s(t, e.label, e.value, e.original)), - e.visible - ); - } - _defaultFilterFunc(s, t, e, i) { - return ( - (s = String(s).toLowerCase()), - t != null && - (String(t).toLowerCase().indexOf(s) > -1 || - String(e).toLowerCase().indexOf(s) > -1) - ); - } - _clearList() { - for (; this.listEl.firstChild; ) - this.listEl.removeChild(this.listEl.firstChild); - this.displayItems = []; - } - _buildList(s) { - this._clearList(), - s.forEach((t) => { - this._buildItem(t); - }), - this.displayItems.length || - this._addPlaceholder(this.params.placeholderEmpty); - } - _buildItem(s) { - var t, - e = s.element; - if (!this.filtered || s.visible) { - if (!e) { - if ( - (((e = document.createElement("div")).tabIndex = 0), - (t = this.params.itemFormatter - ? this.params.itemFormatter( - s.label, - s.value, - s.original, - e - ) - : s.label) instanceof HTMLElement - ? e.appendChild(t) - : (e.innerHTML = t), - s.group - ? e.classList.add("tabulator-edit-list-group") - : e.classList.add("tabulator-edit-list-item"), - e.classList.add( - "tabulator-edit-list-group-level-" + s.level - ), - s.elementAttributes && - typeof s.elementAttributes == "object") - ) - for (let i in s.elementAttributes) - i.charAt(0) == "+" - ? ((i = i.slice(1)), - e.setAttribute( - i, - this.input.getAttribute(i) + - s.elementAttributes["+" + i] - )) - : e.setAttribute(i, s.elementAttributes[i]); - s.group - ? e.addEventListener( - "click", - this._groupClick.bind(this, s) - ) - : e.addEventListener( - "click", - this._itemClick.bind(this, s) - ), - e.addEventListener( - "mousedown", - this._preventBlur.bind(this) - ), - (s.element = e); - } - this._styleItem(s), - this.listEl.appendChild(e), - s.group - ? s.options.forEach((i) => { - this._buildItem(i); - }) - : this.displayItems.push(s); - } - } - _showList() { - var s = this.popup && this.popup.isVisible(); - if (this.input.parentNode) { - if ( - this.params.autocomplete && - this.input.value === "" && - !this.params.listOnEmpty - ) - return void (this.popup && this.popup.hide(!0)); - this._setListWidth(), - this.popup || - (this.popup = this.edit.popup(this.listEl)), - this.popup.show(this.cell.getElement(), "bottom"), - s || - setTimeout(() => { - this.popup.hideOnBlur( - this._resolveValue.bind(this, !0) - ); - }, 10); - } - } - _styleItem(s) { - s && - s.element && - (s.selected - ? s.element.classList.add("active") - : s.element.classList.remove("active")); - } - _itemClick(s, t) { - t.stopPropagation(), this._chooseItem(s); - } - _groupClick(s, t) { - t.stopPropagation(); - } - _cancel() { - this.popup.hide(!0), this.actions.cancel(); - } - _clearChoices() { - (this.typing = !0), - this.currentItems.forEach((s) => { - (s.selected = !1), this._styleItem(s); - }), - (this.currentItems = []), - (this.focusedItem = null); - } - _chooseItem(s, t) { - var e; - (this.typing = !1), - this.params.multiselect - ? ((e = this.currentItems.indexOf(s)) > -1 - ? (this.currentItems.splice(e, 1), - (s.selected = !1)) - : (this.currentItems.push(s), (s.selected = !0)), - (this.input.value = this.currentItems - .map((i) => i.label) - .join(",")), - this._styleItem(s)) - : ((this.currentItems = [s]), - (s.selected = !0), - (this.input.value = s.label), - this._styleItem(s), - t || this._resolveValue()), - this._focusItem(s); - } - _resolveValue(s) { - var t, e; - if ( - (this.popup && this.popup.hide(!0), this.params.multiselect) - ) - t = this.currentItems.map((i) => i.value); - else if (s && this.params.autocomplete && this.typing) { - if ( - !( - this.params.freetext || - (this.params.allowEmpty && this.input.value === "") - ) - ) - return void this.actions.cancel(); - t = this.input.value; - } else - t = this.currentItems[0] - ? this.currentItems[0].value - : (e = Array.isArray(this.initialValues) - ? this.initialValues[0] - : this.initialValues) == null || e === "" - ? e - : this.params.emptyValue; - t === "" && (t = this.params.emptyValue), - this.actions.success(t), - this.isFilter && - ((this.initialValues = - t && !Array.isArray(t) ? [t] : t), - (this.currentItems = [])); - } - }; - var Ke = { - input: function (s, t, e, i, o) { - var n = s.getValue(), - r = document.createElement("input"); - if ( - (r.setAttribute("type", o.search ? "search" : "text"), - (r.style.padding = "4px"), - (r.style.width = "100%"), - (r.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let l in o.elementAttributes) - l.charAt(0) == "+" - ? ((l = l.slice(1)), - r.setAttribute( - l, - r.getAttribute(l) + - o.elementAttributes["+" + l] - )) - : r.setAttribute(l, o.elementAttributes[l]); - function a(l) { - (n == null && r.value !== "") || r.value !== n - ? e(r.value) && (n = r.value) - : i(); - } - return ( - (r.value = n !== void 0 ? n : ""), - t(function () { - s.getType() === "cell" && - (r.focus({ preventScroll: !0 }), - (r.style.height = "100%"), - o.selectContents && r.select()); - }), - r.addEventListener("change", a), - r.addEventListener("blur", a), - r.addEventListener("keydown", function (l) { - switch (l.keyCode) { - case 13: - a(); - break; - case 27: - i(); - break; - case 35: - case 36: - l.stopPropagation(); - } - }), - o.mask && dt(r, o), - r - ); - }, - textarea: function (s, t, e, i, o) { - var n = s.getValue(), - r = o.verticalNavigation || "hybrid", - a = String(n ?? ""), - l = document.createElement("textarea"), - h = 0; - if ( - ((l.style.display = "block"), - (l.style.padding = "2px"), - (l.style.height = "100%"), - (l.style.width = "100%"), - (l.style.boxSizing = "border-box"), - (l.style.whiteSpace = "pre-wrap"), - (l.style.resize = "none"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let 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]); - function d(c) { - (n == null && l.value !== "") || l.value !== n - ? (e(l.value) && (n = l.value), - setTimeout(function () { - s.getRow().normalizeHeight(); - }, 300)) - : i(); - } - return ( - (l.value = a), - t(function () { - s.getType() === "cell" && - (l.focus({ preventScroll: !0 }), - (l.style.height = "100%"), - l.scrollHeight, - (l.style.height = l.scrollHeight + "px"), - s.getRow().normalizeHeight(), - o.selectContents && l.select()); - }), - l.addEventListener("change", d), - l.addEventListener("blur", d), - l.addEventListener("keyup", function () { - l.style.height = ""; - var c = l.scrollHeight; - (l.style.height = c + "px"), - c != h && ((h = c), s.getRow().normalizeHeight()); - }), - l.addEventListener("keydown", function (c) { - switch (c.keyCode) { - case 13: - c.shiftKey && o.shiftEnterSubmit && d(); - break; - case 27: - i(); - break; - case 38: - (r == "editor" || - (r == "hybrid" && l.selectionStart)) && - (c.stopImmediatePropagation(), - c.stopPropagation()); - break; - case 40: - (r == "editor" || - (r == "hybrid" && - l.selectionStart !== l.value.length)) && - (c.stopImmediatePropagation(), - c.stopPropagation()); - break; - case 35: - case 36: - c.stopPropagation(); - } - }), - o.mask && dt(l, o), - l - ); - }, - number: function (s, t, e, i, o) { - var n = s.getValue(), - r = o.verticalNavigation || "editor", - a = document.createElement("input"); - if ( - (a.setAttribute("type", "number"), - o.max !== void 0 && a.setAttribute("max", o.max), - o.min !== void 0 && a.setAttribute("min", o.min), - o.step !== void 0 && a.setAttribute("step", o.step), - (a.style.padding = "4px"), - (a.style.width = "100%"), - (a.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let d in o.elementAttributes) - d.charAt(0) == "+" - ? ((d = d.slice(1)), - a.setAttribute( - d, - a.getAttribute(d) + - o.elementAttributes["+" + d] - )) - : a.setAttribute(d, o.elementAttributes[d]); - a.value = n; - var l = function (d) { - h(); - }; - function h() { - var d = a.value; - isNaN(d) || d === "" || (d = Number(d)), - d !== n ? e(d) && (n = d) : i(); - } - return ( - t(function () { - s.getType() === "cell" && - (a.removeEventListener("blur", l), - a.focus({ preventScroll: !0 }), - (a.style.height = "100%"), - a.addEventListener("blur", l), - o.selectContents && a.select()); - }), - a.addEventListener("keydown", function (d) { - switch (d.keyCode) { - case 13: - h(); - break; - case 27: - i(); - break; - case 38: - case 40: - r == "editor" && - (d.stopImmediatePropagation(), - d.stopPropagation()); - break; - case 35: - case 36: - d.stopPropagation(); - } - }), - o.mask && dt(a, o), - a - ); - }, - range: function (s, t, e, i, o) { - var n = s.getValue(), - r = document.createElement("input"); - if ( - (r.setAttribute("type", "range"), - o.max !== void 0 && r.setAttribute("max", o.max), - o.min !== void 0 && r.setAttribute("min", o.min), - o.step !== void 0 && r.setAttribute("step", o.step), - (r.style.padding = "4px"), - (r.style.width = "100%"), - (r.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let l in o.elementAttributes) - l.charAt(0) == "+" - ? ((l = l.slice(1)), - r.setAttribute( - l, - r.getAttribute(l) + - o.elementAttributes["+" + l] - )) - : r.setAttribute(l, o.elementAttributes[l]); - function a() { - var l = r.value; - isNaN(l) || l === "" || (l = Number(l)), - l != n ? e(l) && (n = l) : i(); - } - return ( - (r.value = n), - t(function () { - s.getType() === "cell" && - (r.focus({ preventScroll: !0 }), - (r.style.height = "100%")); - }), - r.addEventListener("blur", function (l) { - a(); - }), - r.addEventListener("keydown", function (l) { - switch (l.keyCode) { - case 13: - a(); - break; - case 27: - i(); - } - }), - r - ); - }, - date: function (s, t, e, i, o) { - var n = o.format, - r = o.verticalNavigation || "editor", - a = n ? window.DateTime || luxon.DateTime : null, - l = s.getValue(), - h = document.createElement("input"); - function d(u) { - return ( - a.isDateTime(u) - ? u - : n === "iso" - ? a.fromISO(String(u)) - : a.fromFormat(String(u), n) - ).toFormat("yyyy-MM-dd"); - } - if ( - ((h.type = "date"), - (h.style.padding = "4px"), - (h.style.width = "100%"), - (h.style.boxSizing = "border-box"), - o.max && h.setAttribute("max", n ? d(o.max) : o.max), - o.min && h.setAttribute("min", n ? d(o.min) : o.min), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let u in o.elementAttributes) - u.charAt(0) == "+" - ? ((u = u.slice(1)), - h.setAttribute( - u, - h.getAttribute(u) + - o.elementAttributes["+" + u] - )) - : h.setAttribute(u, o.elementAttributes[u]); - function c() { - var u, - m = h.value; - if ((l == null && m !== "") || m !== l) { - if (m && n) - switch ( - ((u = a.fromFormat(String(m), "yyyy-MM-dd")), n) - ) { - case !0: - m = u; - break; - case "iso": - m = u.toISO(); - break; - default: - m = u.toFormat(n); - } - e(m) && (l = h.value); - } else i(); - } - return ( - (l = l !== void 0 ? l : ""), - n && - (a - ? (l = d(l)) - : console.error( - "Editor Error - 'date' editor 'format' param is dependant on luxon.js" - )), - (h.value = l), - t(function () { - s.getType() === "cell" && - (h.focus({ preventScroll: !0 }), - (h.style.height = "100%"), - o.selectContents && h.select()); - }), - h.addEventListener("blur", function (u) { - (u.relatedTarget || - u.rangeParent || - u.explicitOriginalTarget !== h) && - c(); - }), - h.addEventListener("keydown", function (u) { - switch (u.keyCode) { - case 13: - c(); - break; - case 27: - i(); - break; - case 35: - case 36: - u.stopPropagation(); - break; - case 38: - case 40: - r == "editor" && - (u.stopImmediatePropagation(), - u.stopPropagation()); - } - }), - h - ); - }, - time: function (s, t, e, i, o) { - var n, - r = o.format, - a = o.verticalNavigation || "editor", - l = r ? window.DateTime || luxon.DateTime : null, - h = s.getValue(), - d = document.createElement("input"); - if ( - ((d.type = "time"), - (d.style.padding = "4px"), - (d.style.width = "100%"), - (d.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let u in o.elementAttributes) - u.charAt(0) == "+" - ? ((u = u.slice(1)), - d.setAttribute( - u, - d.getAttribute(u) + - o.elementAttributes["+" + u] - )) - : d.setAttribute(u, o.elementAttributes[u]); - function c() { - var u, - m = d.value; - if ((h == null && m !== "") || m !== h) { - if (m && r) - switch ( - ((u = l.fromFormat(String(m), "hh:mm")), r) - ) { - case !0: - m = u; - break; - case "iso": - m = u.toISO(); - break; - default: - m = u.toFormat(r); - } - e(m) && (h = d.value); - } else i(); - } - return ( - (h = h !== void 0 ? h : ""), - r && - (l - ? ((n = l.isDateTime(h) - ? h - : r === "iso" - ? l.fromISO(String(h)) - : l.fromFormat(String(h), r)), - (h = n.toFormat("HH:mm"))) - : console.error( - "Editor Error - 'date' editor 'format' param is dependant on luxon.js" - )), - (d.value = h), - t(function () { - s.getType() == "cell" && - (d.focus({ preventScroll: !0 }), - (d.style.height = "100%"), - o.selectContents && d.select()); - }), - d.addEventListener("blur", function (u) { - (u.relatedTarget || - u.rangeParent || - u.explicitOriginalTarget !== d) && - c(); - }), - d.addEventListener("keydown", function (u) { - switch (u.keyCode) { - case 13: - c(); - break; - case 27: - i(); - break; - case 35: - case 36: - u.stopPropagation(); - break; - case 38: - case 40: - a == "editor" && - (u.stopImmediatePropagation(), - u.stopPropagation()); - } - }), - d - ); - }, - datetime: function (s, t, e, i, o) { - var n, - r = o.format, - a = o.verticalNavigation || "editor", - l = r - ? this.table.dependencyRegistry.lookup( - ["luxon", "DateTime"], - "DateTime" - ) - : null, - h = s.getValue(), - d = document.createElement("input"); - if ( - ((d.type = "datetime-local"), - (d.style.padding = "4px"), - (d.style.width = "100%"), - (d.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let u in o.elementAttributes) - u.charAt(0) == "+" - ? ((u = u.slice(1)), - d.setAttribute( - u, - d.getAttribute(u) + - o.elementAttributes["+" + u] - )) - : d.setAttribute(u, o.elementAttributes[u]); - function c() { - var u, - m = d.value; - if ((h == null && m !== "") || m !== h) { - if (m && r) - switch (((u = l.fromISO(String(m))), r)) { - case !0: - m = u; - break; - case "iso": - m = u.toISO(); - break; - default: - m = u.toFormat(r); - } - e(m) && (h = d.value); - } else i(); - } - return ( - (h = h !== void 0 ? h : ""), - r && - (l - ? ((n = l.isDateTime(h) - ? h - : r === "iso" - ? l.fromISO(String(h)) - : l.fromFormat(String(h), r)), - (h = - n.toFormat("yyyy-MM-dd") + - "T" + - n.toFormat("HH:mm"))) - : console.error( - "Editor Error - 'date' editor 'format' param is dependant on luxon.js" - )), - (d.value = h), - t(function () { - s.getType() === "cell" && - (d.focus({ preventScroll: !0 }), - (d.style.height = "100%"), - o.selectContents && d.select()); - }), - d.addEventListener("blur", function (u) { - (u.relatedTarget || - u.rangeParent || - u.explicitOriginalTarget !== d) && - c(); - }), - d.addEventListener("keydown", function (u) { - switch (u.keyCode) { - case 13: - c(); - break; - case 27: - i(); - break; - case 35: - case 36: - u.stopPropagation(); - break; - case 38: - case 40: - a == "editor" && - (u.stopImmediatePropagation(), - u.stopPropagation()); - } - }), - d - ); - }, - list: function (s, t, e, i, o) { - return new Xe(this, s, t, e, i, o).input; - }, - star: function (s, t, e, i, o) { - var n = this, - r = s.getElement(), - a = s.getValue(), - l = r.getElementsByTagName("svg").length || 5, - h = r.getElementsByTagName("svg")[0] - ? r.getElementsByTagName("svg")[0].getAttribute("width") - : 14, - d = [], - c = document.createElement("div"), - u = document.createElementNS( - "http://www.w3.org/2000/svg", - "svg" - ); - function m(v) { - d.forEach(function (E, T) { - T < v - ? (n.table.browser == "ie" - ? E.setAttribute( - "class", - "tabulator-star-active" - ) - : E.classList.replace( - "tabulator-star-inactive", - "tabulator-star-active" - ), - (E.innerHTML = - '')) - : (n.table.browser == "ie" - ? E.setAttribute( - "class", - "tabulator-star-inactive" - ) - : E.classList.replace( - "tabulator-star-active", - "tabulator-star-inactive" - ), - (E.innerHTML = - '')); - }); - } - function p(v) { - var E = document.createElement("span"), - T = u.cloneNode(!0); - d.push(T), - E.addEventListener("mouseenter", function (M) { - M.stopPropagation(), - M.stopImmediatePropagation(), - m(v); - }), - E.addEventListener("mousemove", function (M) { - M.stopPropagation(), M.stopImmediatePropagation(); - }), - E.addEventListener("click", function (M) { - M.stopPropagation(), - M.stopImmediatePropagation(), - e(v), - r.blur(); - }), - E.appendChild(T), - c.appendChild(E); - } - function g(v) { - (a = v), m(v); - } - if ( - ((r.style.whiteSpace = "nowrap"), - (r.style.overflow = "hidden"), - (r.style.textOverflow = "ellipsis"), - (c.style.verticalAlign = "middle"), - (c.style.display = "inline-block"), - (c.style.padding = "4px"), - u.setAttribute("width", h), - u.setAttribute("height", h), - u.setAttribute("viewBox", "0 0 512 512"), - u.setAttribute("xml:space", "preserve"), - (u.style.padding = "0 1px"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let v in o.elementAttributes) - v.charAt(0) == "+" - ? ((v = v.slice(1)), - c.setAttribute( - v, - c.getAttribute(v) + - o.elementAttributes["+" + v] - )) - : c.setAttribute(v, o.elementAttributes[v]); - for (var f = 1; f <= l; f++) p(f); - return ( - m((a = Math.min(parseInt(a), l))), - c.addEventListener("mousemove", function (v) { - m(0); - }), - c.addEventListener("click", function (v) { - e(0); - }), - r.addEventListener("blur", function (v) { - i(); - }), - r.addEventListener("keydown", function (v) { - switch (v.keyCode) { - case 39: - g(a + 1); - break; - case 37: - g(a - 1); - break; - case 13: - e(a); - break; - case 27: - i(); - } - }), - c - ); - }, - progress: function (s, t, e, i, o) { - var n, - r, - a = s.getElement(), - l = - o.max === void 0 - ? (a.getElementsByTagName("div")[0] && - a - .getElementsByTagName("div")[0] - .getAttribute("max")) || - 100 - : o.max, - h = - o.min === void 0 - ? (a.getElementsByTagName("div")[0] && - a - .getElementsByTagName("div")[0] - .getAttribute("min")) || - 0 - : o.min, - d = (l - h) / 100, - c = s.getValue() || 0, - u = document.createElement("div"), - m = document.createElement("div"); - function p() { - var g = window.getComputedStyle(a, null), - f = - d * - Math.round( - m.offsetWidth / - ((a.clientWidth - - parseInt( - g.getPropertyValue( - "padding-left" - ) - ) - - parseInt( - g.getPropertyValue( - "padding-right" - ) - )) / - 100) - ) + - h; - e(f), - a.setAttribute("aria-valuenow", f), - a.setAttribute("aria-label", c); - } - if ( - ((u.style.position = "absolute"), - (u.style.right = "0"), - (u.style.top = "0"), - (u.style.bottom = "0"), - (u.style.width = "5px"), - u.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%"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let g in o.elementAttributes) - g.charAt(0) == "+" - ? ((g = g.slice(1)), - m.setAttribute( - g, - m.getAttribute(g) + - o.elementAttributes["+" + g] - )) - : m.setAttribute(g, o.elementAttributes[g]); - return ( - (a.style.padding = "4px 4px"), - (c = Math.min(parseFloat(c), l)), - (c = Math.max(parseFloat(c), h)), - (c = Math.round((c - h) / d)), - (m.style.width = c + "%"), - a.setAttribute("aria-valuemin", h), - a.setAttribute("aria-valuemax", l), - m.appendChild(u), - u.addEventListener("mousedown", function (g) { - (n = g.screenX), (r = m.offsetWidth); - }), - u.addEventListener("mouseover", function () { - u.style.cursor = "ew-resize"; - }), - a.addEventListener("mousemove", function (g) { - n && (m.style.width = r + g.screenX - n + "px"); - }), - a.addEventListener("mouseup", function (g) { - n && - (g.stopPropagation(), - g.stopImmediatePropagation(), - (n = !1), - (r = !1), - p()); - }), - a.addEventListener("keydown", function (g) { - switch (g.keyCode) { - case 39: - g.preventDefault(), - (m.style.width = - m.clientWidth + - a.clientWidth / 100 + - "px"); - break; - case 37: - g.preventDefault(), - (m.style.width = - m.clientWidth - - a.clientWidth / 100 + - "px"); - break; - case 9: - case 13: - p(); - break; - case 27: - i(); - } - }), - a.addEventListener("blur", function () { - i(); - }), - m - ); - }, - tickCross: function (s, t, e, i, o) { - var n = s.getValue(), - r = document.createElement("input"), - a = o.tristate, - l = - o.indeterminateValue === void 0 - ? null - : o.indeterminateValue, - h = !1, - d = Object.keys(o).includes("trueValue"), - c = Object.keys(o).includes("falseValue"); - if ( - (r.setAttribute("type", "checkbox"), - (r.style.marginTop = "5px"), - (r.style.boxSizing = "border-box"), - o.elementAttributes && - typeof o.elementAttributes == "object") - ) - for (let m in o.elementAttributes) - m.charAt(0) == "+" - ? ((m = m.slice(1)), - r.setAttribute( - m, - r.getAttribute(m) + - o.elementAttributes["+" + m] - )) - : r.setAttribute(m, o.elementAttributes[m]); - function u(m) { - var p = r.checked; - return ( - d && p - ? (p = o.trueValue) - : c && !p && (p = o.falseValue), - a - ? m - ? h - ? l - : p - : r.checked && !h - ? ((r.checked = !1), - (r.indeterminate = !0), - (h = !0), - l) - : ((h = !1), p) - : p - ); - } - return ( - (r.value = n), - !a || - (n !== void 0 && n !== l && n !== "") || - ((h = !0), (r.indeterminate = !0)), - this.table.browser != "firefox" && - this.table.browser != "safari" && - t(function () { - s.getType() === "cell" && - r.focus({ preventScroll: !0 }); - }), - (r.checked = d - ? n === o.trueValue - : n === !0 || n === "true" || n === "True" || n === 1), - r.addEventListener("change", function (m) { - e(u()); - }), - r.addEventListener("blur", function (m) { - e(u(!0)); - }), - r.addEventListener("keydown", function (m) { - m.keyCode == 13 && e(u()), m.keyCode == 27 && i(); - }), - r - ); - }, - adaptable: function (s, t, e, i, o) { - var n, - r, - a = s._getSelf().column; - return ( - (n = o.editorLookup - ? o.editorLookup(s) - : (function (l) { - var h = l.getValue(), - d = "input"; - switch (typeof h) { - case "number": - d = "number"; - break; - case "boolean": - d = "tickCross"; - break; - case "string": - h.includes(` -`) && (d = "textarea"); - } - return d; - })(s)), - o.paramsLookup && - (r = - typeof o.paramsLookup == "function" - ? o.paramsLookup(n, s) - : o.paramsLookup[n]), - this.table.modules.edit - .lookupEditor(n, a) - .call(this, s, t, e, i, r || {}) - ); - }, - }; - let st = class st extends w { - constructor(t) { - super(t), - (this.currentCell = !1), - (this.mouseClick = !1), - (this.recursionBlock = !1), - (this.invalidEdit = !1), - (this.editedCells = []), - (this.convertEmptyValues = !1), - (this.editors = st.editors), - this.registerTableOption("editTriggerEvent", "focus"), - this.registerTableOption("editorEmptyValue"), - this.registerTableOption( - "editorEmptyValueFunc", - this.emptyValueCheck.bind(this) - ), - this.registerColumnOption("editable"), - this.registerColumnOption("editor"), - this.registerColumnOption("editorParams"), - this.registerColumnOption("editorEmptyValue"), - this.registerColumnOption("editorEmptyValueFunc"), - this.registerColumnOption("cellEditing"), - this.registerColumnOption("cellEdited"), - this.registerColumnOption("cellEditCancelled"), - this.registerTableFunction( - "getEditedCells", - this.getEditedCells.bind(this) - ), - this.registerTableFunction( - "clearCellEdited", - this.clearCellEdited.bind(this) - ), - this.registerTableFunction( - "navigatePrev", - this.navigatePrev.bind(this) - ), - this.registerTableFunction( - "navigateNext", - this.navigateNext.bind(this) - ), - this.registerTableFunction( - "navigateLeft", - this.navigateLeft.bind(this) - ), - this.registerTableFunction( - "navigateRight", - this.navigateRight.bind(this) - ), - this.registerTableFunction( - "navigateUp", - this.navigateUp.bind(this) - ), - this.registerTableFunction( - "navigateDown", - this.navigateDown.bind(this) - ), - this.registerComponentFunction( - "cell", - "isEdited", - this.cellIsEdited.bind(this) - ), - this.registerComponentFunction( - "cell", - "clearEdited", - this.clearEdited.bind(this) - ), - this.registerComponentFunction( - "cell", - "edit", - this.editCell.bind(this) - ), - this.registerComponentFunction( - "cell", - "cancelEdit", - this.cellCancelEdit.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigatePrev", - this.navigatePrev.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigateNext", - this.navigateNext.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigateLeft", - this.navigateLeft.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigateRight", - this.navigateRight.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigateUp", - this.navigateUp.bind(this) - ), - this.registerComponentFunction( - "cell", - "navigateDown", - this.navigateDown.bind(this) - ); - } - initialize() { - this.subscribe("cell-init", this.bindEditor.bind(this)), - this.subscribe("cell-delete", this.clearEdited.bind(this)), - this.subscribe( - "cell-value-changed", - this.updateCellClass.bind(this) - ), - this.subscribe( - "column-layout", - this.initializeColumnCheck.bind(this) - ), - this.subscribe( - "column-delete", - this.columnDeleteCheck.bind(this) - ), - this.subscribe( - "row-deleting", - this.rowDeleteCheck.bind(this) - ), - this.subscribe( - "row-layout", - this.rowEditableCheck.bind(this) - ), - this.subscribe( - "data-refreshing", - this.cancelEdit.bind(this) - ), - this.subscribe( - "clipboard-paste", - this.pasteBlocker.bind(this) - ), - this.subscribe( - "keybinding-nav-prev", - this.navigatePrev.bind(this, void 0) - ), - this.subscribe( - "keybinding-nav-next", - this.keybindingNavigateNext.bind(this) - ), - this.subscribe( - "keybinding-nav-up", - this.navigateUp.bind(this, void 0) - ), - this.subscribe( - "keybinding-nav-down", - this.navigateDown.bind(this, void 0) - ), - Object.keys(this.table.options).includes( - "editorEmptyValue" - ) && (this.convertEmptyValues = !0); - } - pasteBlocker(t) { - if (this.currentCell) return !0; - } - keybindingNavigateNext(t) { - var e = this.currentCell, - i = this.options("tabEndNewRow"); - e && - (this.navigateNext(e, t) || - (i && - (e.getElement().firstChild.blur(), - this.invalidEdit || - (i = - i === !0 - ? this.table.addRow({}) - : typeof i == "function" - ? this.table.addRow( - i(e.row.getComponent()) - ) - : this.table.addRow( - Object.assign({}, i) - )).then(() => { - setTimeout(() => { - e.getComponent().navigateNext(); - }); - })))); - } - cellIsEdited(t) { - return !!t.modules.edit && t.modules.edit.edited; - } - cellCancelEdit(t) { - t === this.currentCell - ? this.table.modules.edit.cancelEdit() - : console.warn( - "Cancel Editor Error - This cell is not currently being edited " - ); - } - updateCellClass(t) { - this.allowEdit(t) - ? t.getElement().classList.add("tabulator-editable") - : t.getElement().classList.remove("tabulator-editable"); - } - clearCellEdited(t) { - t || (t = this.table.modules.edit.getEditedCells()), - Array.isArray(t) || (t = [t]), - t.forEach((e) => { - this.table.modules.edit.clearEdited(e._getSelf()); - }); - } - navigatePrev(t = this.currentCell, e) { - var i, o; - if (t) { - if ((e && e.preventDefault(), (i = this.navigateLeft()))) - return !0; - if ( - (o = this.table.rowManager.prevDisplayRow(t.row, !0)) && - (i = this.findPrevEditableCell(o, o.cells.length)) - ) - return i.getComponent().edit(), !0; - } - return !1; - } - navigateNext(t = this.currentCell, e) { - var i, o; - if (t) { - if ((e && e.preventDefault(), (i = this.navigateRight()))) - return !0; - if ( - (o = this.table.rowManager.nextDisplayRow(t.row, !0)) && - (i = this.findNextEditableCell(o, -1)) - ) - return i.getComponent().edit(), !0; - } - return !1; - } - navigateLeft(t = this.currentCell, e) { - var i, o; - return ( - !!( - t && - (e && e.preventDefault(), - (i = t.getIndex()), - (o = this.findPrevEditableCell(t.row, i))) - ) && (o.getComponent().edit(), !0) - ); - } - navigateRight(t = this.currentCell, e) { - var i, o; - return ( - !!( - t && - (e && e.preventDefault(), - (i = t.getIndex()), - (o = this.findNextEditableCell(t.row, i))) - ) && (o.getComponent().edit(), !0) - ); - } - navigateUp(t = this.currentCell, e) { - var i, o; - return ( - !!( - t && - (e && e.preventDefault(), - (i = t.getIndex()), - (o = this.table.rowManager.prevDisplayRow(t.row, !0))) - ) && (o.cells[i].getComponent().edit(), !0) - ); - } - navigateDown(t = this.currentCell, e) { - var i, o; - return ( - !!( - t && - (e && e.preventDefault(), - (i = t.getIndex()), - (o = this.table.rowManager.nextDisplayRow(t.row, !0))) - ) && (o.cells[i].getComponent().edit(), !0) - ); - } - findNextEditableCell(t, e) { - var i = !1; - if (e < t.cells.length - 1) - for (var o = e + 1; o < t.cells.length; o++) { - let n = t.cells[o]; - if ( - n.column.modules.edit && - x.elVisible(n.getElement()) && - this.allowEdit(n) - ) { - i = n; - break; - } - } - return i; - } - findPrevEditableCell(t, e) { - var i = !1; - if (e > 0) - for (var o = e - 1; o >= 0; o--) { - let n = t.cells[o]; - if ( - n.column.modules.edit && - x.elVisible(n.getElement()) && - this.allowEdit(n) - ) { - i = n; - break; - } - } - return i; - } - initializeColumnCheck(t) { - t.definition.editor !== void 0 && this.initializeColumn(t); - } - columnDeleteCheck(t) { - this.currentCell && - this.currentCell.column === t && - this.cancelEdit(); - } - rowDeleteCheck(t) { - this.currentCell && - this.currentCell.row === t && - this.cancelEdit(); - } - rowEditableCheck(t) { - t.getCells().forEach((e) => { - e.column.modules.edit && - typeof e.column.modules.edit.check == "function" && - this.updateCellClass(e); - }); - } - initializeColumn(t) { - var e = Object.keys(t.definition).includes("editorEmptyValue"), - i = { - editor: !1, - blocked: !1, - check: t.definition.editable, - params: t.definition.editorParams || {}, - convertEmptyValues: e, - editorEmptyValue: t.definition.editorEmptyValue, - editorEmptyValueFunc: t.definition.editorEmptyValueFunc, - }; - (i.editor = this.lookupEditor(t.definition.editor, t)), - i.editor && (t.modules.edit = i); - } - lookupEditor(t, e) { - var i; - switch (typeof t) { - case "string": - this.editors[t] - ? (i = this.editors[t]) - : console.warn( - "Editor Error - No such editor found: ", - t - ); - break; - case "function": - i = t; - break; - case "boolean": - t === !0 && - (typeof e.definition.formatter != "function" - ? (i = this.editors[e.definition.formatter] - ? this.editors[e.definition.formatter] - : this.editors.input) - : console.warn( - "Editor Error - Cannot auto lookup editor for a custom formatter: ", - e.definition.formatter - )); - } - return i; - } - getCurrentCell() { - return !!this.currentCell && this.currentCell.getComponent(); - } - clearEditor(t) { - var e, - i = this.currentCell; - if (((this.invalidEdit = !1), i)) { - for ( - this.currentCell = !1, - e = i.getElement(), - this.dispatch("edit-editor-clear", i, t), - e.classList.remove("tabulator-editing"); - e.firstChild; - - ) - e.removeChild(e.firstChild); - i.row.getElement().classList.remove("tabulator-editing"), - i.table.element.classList.remove("tabulator-editing"); - } - } - cancelEdit() { - if (this.currentCell) { - var t = this.currentCell, - e = this.currentCell.getComponent(); - this.clearEditor(!0), - t.setValueActual(t.getValue()), - t.cellRendered(), - (t.column.definition.editor == "textarea" || - t.column.definition.variableHeight) && - t.row.normalizeHeight(!0), - t.column.definition.cellEditCancelled && - t.column.definition.cellEditCancelled.call( - this.table, - e - ), - this.dispatch("edit-cancelled", t), - this.dispatchExternal("cellEditCancelled", e); - } - } - bindEditor(t) { - if (t.column.modules.edit) { - var e = this, - i = t.getElement(!0); - this.updateCellClass(t), - i.setAttribute("tabindex", 0), - i.addEventListener("mousedown", function (o) { - o.button === 2 - ? o.preventDefault() - : (e.mouseClick = !0); - }), - this.options("editTriggerEvent") === "dblclick" && - i.addEventListener("dblclick", function (o) { - i.classList.contains("tabulator-editing") || - (i.focus({ preventScroll: !0 }), - e.edit(t, o, !1)); - }), - (this.options("editTriggerEvent") !== "focus" && - this.options("editTriggerEvent") !== "click") || - i.addEventListener("click", function (o) { - i.classList.contains("tabulator-editing") || - (i.focus({ preventScroll: !0 }), - e.edit(t, o, !1)); - }), - this.options("editTriggerEvent") === "focus" && - i.addEventListener("focus", function (o) { - e.recursionBlock || e.edit(t, o, !1); - }); - } - } - focusCellNoEvent(t, e) { - (this.recursionBlock = !0), - (e && this.table.browser === "ie") || - t.getElement().focus({ preventScroll: !0 }), - (this.recursionBlock = !1); - } - editCell(t, e) { - this.focusCellNoEvent(t), this.edit(t, !1, e); - } - focusScrollAdjust(t) { - if (this.table.rowManager.getRenderMode() == "virtual") { - var e = this.table.rowManager.element.scrollTop, - i = - this.table.rowManager.element.clientHeight + - this.table.rowManager.element.scrollTop, - o = t.row.getElement(); - o.offsetTop < e - ? (this.table.rowManager.element.scrollTop -= - e - o.offsetTop) - : o.offsetTop + o.offsetHeight > i && - (this.table.rowManager.element.scrollTop += - o.offsetTop + o.offsetHeight - i); - var n = this.table.rowManager.element.scrollLeft, - r = - this.table.rowManager.element.clientWidth + - this.table.rowManager.element.scrollLeft, - a = t.getElement(); - this.table.modExists("frozenColumns") && - ((n += parseInt( - this.table.modules.frozenColumns.leftMargin || 0 - )), - (r -= parseInt( - this.table.modules.frozenColumns.rightMargin || 0 - ))), - this.table.options.renderHorizontal === "virtual" && - ((n -= parseInt( - this.table.columnManager.renderer.vDomPadLeft - )), - (r -= parseInt( - this.table.columnManager.renderer.vDomPadLeft - ))), - a.offsetLeft < n - ? (this.table.rowManager.element.scrollLeft -= - n - a.offsetLeft) - : a.offsetLeft + a.offsetWidth > r && - (this.table.rowManager.element.scrollLeft += - a.offsetLeft + a.offsetWidth - r); - } - } - allowEdit(t) { - var e = !!t.column.modules.edit; - if (t.column.modules.edit) - switch (typeof t.column.modules.edit.check) { - case "function": - t.row.initialized && - (e = t.column.modules.edit.check( - t.getComponent() - )); - break; - case "string": - e = !!t.row.data[t.column.modules.edit.check]; - break; - case "boolean": - e = t.column.modules.edit.check; - } - return e; - } - edit(t, e, i) { - var o, - n, - r, - a = this, - l = function () {}, - h = t.getElement(), - d = !1; - if (!this.currentCell) { - if (t.column.modules.edit.blocked) - return (this.mouseClick = !1), this.blur(h), !1; - if ((e && e.stopPropagation(), this.allowEdit(t) || i)) { - if ( - (a.cancelEdit(), - (a.currentCell = t), - this.focusScrollAdjust(t), - (n = t.getComponent()), - this.mouseClick && - ((this.mouseClick = !1), - t.column.definition.cellClick && - t.column.definition.cellClick.call( - this.table, - e, - n - )), - t.column.definition.cellEditing && - t.column.definition.cellEditing.call( - this.table, - n - ), - this.dispatch("cell-editing", t), - this.dispatchExternal("cellEditing", n), - (r = - typeof t.column.modules.edit.params == - "function" - ? t.column.modules.edit.params(n) - : t.column.modules.edit.params), - (o = t.column.modules.edit.editor.call( - a, - n, - function (m) { - l = m; - }, - function (m) { - if (a.currentCell === t && !d) { - var p = a.chain( - "edit-success", - [t, m], - !0, - !0 - ); - return p === !0 || - a.table.options.validationMode === - "highlight" - ? ((d = !0), - a.clearEditor(), - t.modules.edit || - (t.modules.edit = {}), - (t.modules.edit.edited = !0), - a.editedCells.indexOf(t) == -1 && - a.editedCells.push(t), - (m = a.transformEmptyValues( - m, - t - )), - t.setValue(m, !0), - p === !0) - : ((d = !0), - (a.invalidEdit = !0), - a.focusCellNoEvent(t, !0), - l(), - setTimeout(() => { - d = !1; - }, 10), - !1); - } - }, - function () { - a.currentCell !== t || d || a.cancelEdit(); - }, - r - )), - !this.currentCell || o === !1) - ) - return this.blur(h), !1; - if (!(o instanceof Node)) - return ( - console.warn( - "Edit Error - Editor should return an instance of Node, the editor returned:", - o - ), - this.blur(h), - !1 - ); - for ( - h.classList.add("tabulator-editing"), - t.row - .getElement() - .classList.add("tabulator-editing"), - t.table.element.classList.add( - "tabulator-editing" - ); - h.firstChild; - - ) - h.removeChild(h.firstChild); - h.appendChild(o), l(); - for (var c = h.children, u = 0; u < c.length; u++) - c[u].addEventListener("click", function (m) { - m.stopPropagation(); - }); - return !0; - } - return (this.mouseClick = !1), this.blur(h), !1; - } - this.invalidEdit || this.currentCell === t || this.cancelEdit(); - } - emptyValueCheck(t) { - return t === "" || t == null; - } - transformEmptyValues(t, e) { - var i, - o = e.column.modules.edit; - return ( - (o.convertEmptyValues || this.convertEmptyValues) && - (i = - o.editorEmptyValueFunc || - this.options("editorEmptyValueFunc")) && - i(t) && - (t = o.convertEmptyValues - ? o.editorEmptyValue - : this.options("editorEmptyValue")), - t - ); - } - blur(t) { - this.confirm("edit-blur", [t]) || t.blur(); - } - getEditedCells() { - var t = []; - return ( - this.editedCells.forEach((e) => { - t.push(e.getComponent()); - }), - t - ); - } - clearEdited(t) { - var e; - t.modules.edit && - t.modules.edit.edited && - ((t.modules.edit.edited = !1), - this.dispatch("edit-edited-clear", t)), - (e = this.editedCells.indexOf(t)) > -1 && - this.editedCells.splice(e, 1); - } - }; - b(st, "moduleName", "edit"), b(st, "editors", Ke); - let xt = st; - class ce { - constructor(t, e, i, o) { - (this.type = t), - (this.columns = e), - (this.component = i || !1), - (this.indent = o || 0); - } - } - class Tt { - constructor(t, e, i, o, n) { - (this.value = t), - (this.component = e || !1), - (this.width = i), - (this.height = o), - (this.depth = n); - } - } - var Ye = {}, - Qe = { - visible: function () { - return this.rowManager.getVisibleRows(!1, !0); - }, - all: function () { - return this.rowManager.rows; - }, - selected: function () { - return this.modules.selectRow.selectedRows; - }, - active: function () { - return this.options.pagination - ? this.rowManager.getDisplayRows( - this.rowManager.displayRows.length - 2 - ) - : this.rowManager.getDisplayRows(); - }, - }; - let V = class V extends w { - constructor(t) { - super(t), - (this.config = {}), - (this.cloneTableStyle = !0), - (this.colVisProp = ""), - (this.colVisPropAttach = ""), - this.registerTableOption("htmlOutputConfig", !1), - this.registerColumnOption("htmlOutput"), - this.registerColumnOption("titleHtmlOutput"); - } - initialize() { - this.registerTableFunction("getHtml", this.getHtml.bind(this)); - } - generateExportList(t, e, i, o) { - var n, r, a, l; - return ( - (this.cloneTableStyle = e), - (this.config = t || {}), - (this.colVisProp = o), - (this.colVisPropAttach = - this.colVisProp.charAt(0).toUpperCase() + - this.colVisProp.slice(1)), - (l = V.columnLookups[i]) && - (a = (a = l.call(this.table)).filter((h) => - this.columnVisCheck(h) - )), - (n = - this.config.columnHeaders !== !1 - ? this.headersToExportRows( - this.generateColumnGroupHeaders(a) - ) - : []), - a && (a = a.map((h) => h.getComponent())), - (r = this.bodyToExportRows(this.rowLookup(i), a)), - n.concat(r) - ); - } - generateTable(t, e, i, o) { - var n = this.generateExportList(t, e, i, o); - return this.generateTableElement(n); - } - rowLookup(t) { - var e, - i = []; - return ( - typeof t == "function" - ? t.call(this.table).forEach((o) => { - (o = this.table.rowManager.findRow(o)) && - i.push(o); - }) - : ((e = V.rowLookups[t] || V.rowLookups.active), - (i = e.call(this.table))), - Object.assign([], i) - ); - } - generateColumnGroupHeaders(t) { - var e = []; - return ( - t || - (t = - this.config.columnGroups !== !1 - ? this.table.columnManager.columns - : this.table.columnManager.columnsByIndex), - t.forEach((i) => { - var o = this.processColumnGroup(i); - o && e.push(o); - }), - e - ); - } - processColumnGroup(t) { - var e = t.columns, - i = 0, - o = { - title: - t.definition["title" + this.colVisPropAttach] || - t.definition.title, - column: t, - depth: 1, - }; - if (e.length) { - if ( - ((o.subGroups = []), - (o.width = 0), - e.forEach((n) => { - var r = this.processColumnGroup(n); - r && - ((o.width += r.width), - o.subGroups.push(r), - r.depth > i && (i = r.depth)); - }), - (o.depth += i), - !o.width) - ) - return !1; - } else { - if (!this.columnVisCheck(t)) return !1; - o.width = 1; - } - return o; - } - columnVisCheck(t) { - var e = t.definition[this.colVisProp]; - return ( - (this.config.rowHeaders !== !1 || !t.isRowHeader) && - (typeof e == "function" && - (e = e.call(this.table, t.getComponent())), - e === !1 || e === !0 ? e : t.visible && t.field) - ); - } - headersToExportRows(t) { - var e = [], - i = 0, - o = []; - function n(r, a) { - var l = i - a; - if ( - (e[a] === void 0 && (e[a] = []), - (r.height = r.subGroups ? 1 : l - r.depth + 1), - e[a].push(r), - r.height > 1) - ) - for (let h = 1; h < r.height; h++) - e[a + h] === void 0 && (e[a + h] = []), - e[a + h].push(!1); - if (r.width > 1) - for (let h = 1; h < r.width; h++) e[a].push(!1); - r.subGroups && - r.subGroups.forEach(function (h) { - n(h, a + 1); - }); - } - return ( - t.forEach(function (r) { - r.depth > i && (i = r.depth); - }), - t.forEach(function (r) { - n(r, 0); - }), - e.forEach((r) => { - var a = []; - r.forEach((l) => { - if (l) { - let h = l.title === void 0 ? "" : l.title; - a.push( - new Tt( - h, - l.column.getComponent(), - l.width, - l.height, - l.depth - ) - ); - } else a.push(null); - }), - o.push(new ce("header", a)); - }), - o - ); - } - bodyToExportRows(t, e = []) { - var i = []; - return ( - e.length === 0 && - this.table.columnManager.columnsByIndex.forEach((o) => { - this.columnVisCheck(o) && e.push(o.getComponent()); - }), - this.config.columnCalcs !== !1 && - 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((o) => { - switch (o.type) { - case "group": - return this.config.rowGroups !== !1; - case "calc": - return this.config.columnCalcs !== !1; - case "row": - return !( - this.table.options.dataTree && - this.config.dataTree === !1 && - o.modules.dataTree.parent - ); - } - return !0; - })).forEach((o, n) => { - var r = o.getData(this.colVisProp), - a = [], - l = 0; - switch (o.type) { - case "group": - (l = o.level), - a.push( - new Tt( - o.key, - o.getComponent(), - e.length, - 1 - ) - ); - break; - case "calc": - case "row": - e.forEach((h) => { - a.push( - new Tt( - h._column.getFieldValue(r), - h, - 1, - 1 - ) - ); - }), - this.table.options.dataTree && - this.config.dataTree !== !1 && - (l = o.modules.dataTree.index); - } - i.push(new ce(o.type, a, o.getComponent(), l)); - }), - i - ); - } - generateTableElement(t) { - var e = document.createElement("table"), - i = document.createElement("thead"), - o = document.createElement("tbody"), - n = this.lookupTableStyles(), - r = - this.table.options[ - "rowFormatter" + this.colVisPropAttach - ], - a = {}; - return ( - (a.rowFormatter = - r !== null ? r : this.table.options.rowFormatter), - this.table.options.dataTree && - this.config.dataTree !== !1 && - this.table.modExists("columnCalcs") && - (a.treeElementField = - this.table.modules.dataTree.elementField), - (a.groupHeader = - this.table.options[ - "groupHeader" + this.colVisPropAttach - ]), - a.groupHeader && - !Array.isArray(a.groupHeader) && - (a.groupHeader = [a.groupHeader]), - e.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", - ] - ), - t.length > 1e3 && - console.warn( - "It may take a long time to render an HTML table with more than 1000 rows" - ), - t.forEach((l, h) => { - let d; - switch (l.type) { - case "header": - i.appendChild( - this.generateHeaderElement(l, a, n) - ); - break; - case "group": - o.appendChild( - this.generateGroupElement(l, a, n) - ); - break; - case "calc": - o.appendChild( - this.generateCalcElement(l, a, n) - ); - break; - case "row": - (d = this.generateRowElement(l, a, n)), - this.mapElementStyles( - h % 2 && n.evenRow - ? n.evenRow - : n.oddRow, - d, - [ - "border-top", - "border-left", - "border-right", - "border-bottom", - "color", - "font-weight", - "font-family", - "font-size", - "background-color", - ] - ), - o.appendChild(d); - } - }), - i.innerHTML && e.appendChild(i), - e.appendChild(o), - this.mapElementStyles(this.table.element, e, [ - "border-top", - "border-left", - "border-right", - "border-bottom", - ]), - e - ); - } - lookupTableStyles() { - 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.styleRowHeader = - t.firstRow.getElementsByClassName( - "tabulator-row-header" - )[0]), - (t.firstCell = t.styleCells[0]), - (t.lastCell = - t.styleCells[t.styleCells.length - 1]))), - t - ); - } - generateHeaderElement(t, e, i) { - var o = document.createElement("tr"); - return ( - t.columns.forEach((n) => { - if (n) { - var r = document.createElement("th"), - a = n.component._column.definition.cssClass - ? n.component._column.definition.cssClass.split( - " " - ) - : []; - (r.colSpan = n.width), - (r.rowSpan = n.height), - (r.innerHTML = n.value), - this.cloneTableStyle && - (r.style.boxSizing = "border-box"), - a.forEach(function (l) { - r.classList.add(l); - }), - this.mapElementStyles( - n.component.getElement(), - r, - [ - "text-align", - "border-left", - "border-right", - "background-color", - "color", - "font-weight", - "font-family", - "font-size", - ] - ), - this.mapElementStyles( - n.component._column.contentElement, - r, - [ - "padding-top", - "padding-left", - "padding-right", - "padding-bottom", - ] - ), - n.component._column.visible - ? this.mapElementStyles( - n.component.getElement(), - r, - ["width"] - ) - : n.component._column.definition.width && - (r.style.width = - n.component._column.definition.width + - "px"), - n.component._column.parent && - n.component._column.parent.isGroup - ? this.mapElementStyles( - n.component._column.parent - .groupElement, - r, - ["border-top"] - ) - : this.mapElementStyles( - n.component.getElement(), - r, - ["border-top"] - ), - n.component._column.isGroup - ? this.mapElementStyles( - n.component.getElement(), - r, - ["border-bottom"] - ) - : this.mapElementStyles( - this.table.columnManager.getElement(), - r, - ["border-bottom"] - ), - o.appendChild(r); - } - }), - o - ); - } - generateGroupElement(t, e, i) { - var o = document.createElement("tr"), - n = document.createElement("td"), - r = t.columns[0]; - return ( - o.classList.add("tabulator-print-table-row"), - e.groupHeader && e.groupHeader[t.indent] - ? (r.value = e.groupHeader[t.indent]( - r.value, - t.component._group.getRowCount(), - t.component._group.getData(), - t.component - )) - : e.groupHeader !== !1 && - (r.value = t.component._group.generator( - r.value, - t.component._group.getRowCount(), - t.component._group.getData(), - t.component - )), - (n.colSpan = r.width), - (n.innerHTML = r.value), - o.classList.add("tabulator-print-table-group"), - o.classList.add("tabulator-group-level-" + t.indent), - r.component.isVisible() && - o.classList.add("tabulator-group-visible"), - this.mapElementStyles(i.firstGroup, o, [ - "border-top", - "border-left", - "border-right", - "border-bottom", - "color", - "font-weight", - "font-family", - "font-size", - "background-color", - ]), - this.mapElementStyles(i.firstGroup, n, [ - "padding-top", - "padding-left", - "padding-right", - "padding-bottom", - ]), - o.appendChild(n), - o - ); - } - generateCalcElement(t, e, i) { - var o = this.generateRowElement(t, e, i); - return ( - o.classList.add("tabulator-print-table-calcs"), - this.mapElementStyles(i.calcRow, o, [ - "border-top", - "border-left", - "border-right", - "border-bottom", - "color", - "font-weight", - "font-family", - "font-size", - "background-color", - ]), - o - ); - } - generateRowElement(t, e, i) { - var o = document.createElement("tr"); - return ( - o.classList.add("tabulator-print-table-row"), - t.columns.forEach((n, r) => { - if (n) { - var a, - l, - h = document.createElement("td"), - d = n.component._column, - c = this.table, - u = c.columnManager.findColumnIndex(d), - m = n.value, - p = { - modules: {}, - getValue: function () { - return m; - }, - getField: function () { - return d.definition.field; - }, - getElement: function () { - return h; - }, - getType: function () { - return "cell"; - }, - getColumn: function () { - return d.getComponent(); - }, - getData: function () { - return t.component.getData(); - }, - getRow: function () { - return t.component; - }, - getTable: function () { - return c; - }, - getComponent: function () { - return p; - }, - column: d, - }; - if ( - ((d.definition.cssClass - ? d.definition.cssClass.split(" ") - : [] - ).forEach(function (g) { - h.classList.add(g); - }), - this.table.modExists("format") && - this.config.formatCells !== !1) - ) - m = this.table.modules.format.formatExportValue( - p, - this.colVisProp - ); - else - switch (typeof m) { - case "object": - m = m !== null ? JSON.stringify(m) : ""; - break; - case "undefined": - m = ""; - } - m instanceof Node - ? h.appendChild(m) - : (h.innerHTML = m), - (l = [ - "padding-top", - "padding-left", - "padding-right", - "padding-bottom", - "border-top", - "border-left", - "border-right", - "border-bottom", - "color", - "font-weight", - "font-family", - "font-size", - "text-align", - ]), - d.isRowHeader - ? ((a = i.styleRowHeader), - l.push("background-color")) - : (a = - i.styleCells && i.styleCells[u] - ? i.styleCells[u] - : i.firstCell), - a && - (this.mapElementStyles(a, h, l), - d.definition.align && - (h.style.textAlign = - d.definition.align)), - this.table.options.dataTree && - this.config.dataTree !== !1 && - ((e.treeElementField && - e.treeElementField == d.field) || - (!e.treeElementField && r == 0)) && - (t.component._row.modules.dataTree - .controlEl && - h.insertBefore( - t.component._row.modules.dataTree.controlEl.cloneNode( - !0 - ), - h.firstChild - ), - t.component._row.modules.dataTree - .branchEl && - h.insertBefore( - t.component._row.modules.dataTree.branchEl.cloneNode( - !0 - ), - h.firstChild - )), - o.appendChild(h), - p.modules.format && - p.modules.format.renderedCallback && - p.modules.format.renderedCallback(); - } - }), - e.rowFormatter && - t.type === "row" && - this.config.formatCells !== !1 && - ((Object.assign(t.component).getElement = function () { - return o; - }), - e.rowFormatter(t.component)), - o - ); - } - generateHTMLTable(t) { - var e = document.createElement("div"); - return e.appendChild(this.generateTableElement(t)), e.innerHTML; - } - getHtml(t, e, i, o) { - var n = this.generateExportList( - i || this.table.options.htmlOutputConfig, - e, - t, - o || "htmlOutput" - ); - return this.generateHTMLTable(n); - } - mapElementStyles(t, e, i) { - if (this.cloneTableStyle && t && e) { - var o = { - "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); - i.forEach(function (r) { - e.style[o[r]] || - (e.style[o[r]] = n.getPropertyValue(r)); - }); - } - } - } - }; - b(V, "moduleName", "export"), - b(V, "columnLookups", Ye), - b(V, "rowLookups", Qe); - let kt = V; - var Ze = { - "=": function (s, t, e, i) { - return t == s; - }, - "<": function (s, t, e, i) { - return t < s; - }, - "<=": function (s, t, e, i) { - return t <= s; - }, - ">": function (s, t, e, i) { - return t > s; - }, - ">=": function (s, t, e, i) { - return t >= s; - }, - "!=": function (s, t, e, i) { - return t != s; - }, - regex: function (s, t, e, i) { - return typeof s == "string" && (s = new RegExp(s)), s.test(t); - }, - like: function (s, t, e, i) { - return s == null - ? t === s - : t != null && - String(t).toLowerCase().indexOf(s.toLowerCase()) > -1; - }, - keywords: function (s, t, e, i) { - var o = s - .toLowerCase() - .split(i.separator === void 0 ? " " : i.separator), - n = String(t ?? "").toLowerCase(), - r = []; - return ( - o.forEach((a) => { - n.includes(a) && r.push(!0); - }), - i.matchAll ? r.length === o.length : !!r.length - ); - }, - starts: function (s, t, e, i) { - return s == null - ? t === s - : t != null && - String(t).toLowerCase().startsWith(s.toLowerCase()); - }, - ends: function (s, t, e, i) { - return s == null - ? t === s - : t != null && - String(t).toLowerCase().endsWith(s.toLowerCase()); - }, - in: function (s, t, e, i) { - return Array.isArray(s) - ? !s.length || s.indexOf(t) > -1 - : (console.warn( - "Filter Error - filter value is not an array:", - s - ), - !1); - }, - }; - let O = class O extends w { - constructor(t) { - super(t), - (this.filterList = []), - (this.headerFilters = {}), - (this.headerFilterColumns = []), - (this.prevHeaderFilterChangeCheck = ""), - (this.prevHeaderFilterChangeCheck = "{}"), - (this.changed = !1), - (this.tableInitialized = !1), - this.registerTableOption("filterMode", "local"), - this.registerTableOption("initialFilter", !1), - this.registerTableOption("initialHeaderFilter", !1), - this.registerTableOption( - "headerFilterLiveFilterDelay", - 300 - ), - this.registerTableOption("placeholderHeaderFilter", !1), - this.registerColumnOption("headerFilter"), - this.registerColumnOption("headerFilterPlaceholder"), - this.registerColumnOption("headerFilterParams"), - this.registerColumnOption("headerFilterEmptyCheck"), - this.registerColumnOption("headerFilterFunc"), - this.registerColumnOption("headerFilterFuncParams"), - this.registerColumnOption("headerFilterLiveFilter"), - this.registerTableFunction( - "searchRows", - this.searchRows.bind(this) - ), - this.registerTableFunction( - "searchData", - this.searchData.bind(this) - ), - this.registerTableFunction( - "setFilter", - this.userSetFilter.bind(this) - ), - this.registerTableFunction( - "refreshFilter", - this.userRefreshFilter.bind(this) - ), - this.registerTableFunction( - "addFilter", - this.userAddFilter.bind(this) - ), - this.registerTableFunction( - "getFilters", - this.getFilters.bind(this) - ), - this.registerTableFunction( - "setHeaderFilterFocus", - this.userSetHeaderFilterFocus.bind(this) - ), - this.registerTableFunction( - "getHeaderFilterValue", - this.userGetHeaderFilterValue.bind(this) - ), - this.registerTableFunction( - "setHeaderFilterValue", - this.userSetHeaderFilterValue.bind(this) - ), - this.registerTableFunction( - "getHeaderFilters", - this.getHeaderFilters.bind(this) - ), - this.registerTableFunction( - "removeFilter", - this.userRemoveFilter.bind(this) - ), - this.registerTableFunction( - "clearFilter", - this.userClearFilter.bind(this) - ), - this.registerTableFunction( - "clearHeaderFilter", - this.userClearHeaderFilter.bind(this) - ), - this.registerComponentFunction( - "column", - "headerFilterFocus", - this.setHeaderFilterFocus.bind(this) - ), - this.registerComponentFunction( - "column", - "reloadHeaderFilter", - this.reloadHeaderFilter.bind(this) - ), - this.registerComponentFunction( - "column", - "getHeaderFilterValue", - this.getHeaderFilterValue.bind(this) - ), - this.registerComponentFunction( - "column", - "setHeaderFilterValue", - this.setHeaderFilterValue.bind(this) - ); - } - initialize() { - this.subscribe( - "column-init", - this.initializeColumnHeaderFilter.bind(this) - ), - this.subscribe( - "column-width-fit-before", - this.hideHeaderFilterElements.bind(this) - ), - this.subscribe( - "column-width-fit-after", - this.showHeaderFilterElements.bind(this) - ), - this.subscribe("table-built", this.tableBuilt.bind(this)), - this.subscribe( - "placeholder", - this.generatePlaceholder.bind(this) - ), - this.table.options.filterMode === "remote" && - this.subscribe( - "data-params", - this.remoteFilterParams.bind(this) - ), - this.registerDataHandler(this.filter.bind(this), 10); - } - tableBuilt() { - this.table.options.initialFilter && - this.setFilter(this.table.options.initialFilter), - this.table.options.initialHeaderFilter && - this.table.options.initialHeaderFilter.forEach((t) => { - var e = this.table.columnManager.findColumn( - t.field - ); - if (!e) - return ( - console.warn( - "Column Filter Error - No matching column found:", - t.field - ), - !1 - ); - this.setHeaderFilterValue(e, t.value); - }), - (this.tableInitialized = !0); - } - remoteFilterParams(t, e, i, o) { - return (o.filter = this.getFilters(!0, !0)), o; - } - generatePlaceholder(t) { - if ( - this.table.options.placeholderHeaderFilter && - Object.keys(this.headerFilters).length - ) - return this.table.options.placeholderHeaderFilter; - } - userSetFilter(t, e, i, o) { - this.setFilter(t, e, i, o), this.refreshFilter(); - } - userRefreshFilter() { - this.refreshFilter(); - } - userAddFilter(t, e, i, o) { - this.addFilter(t, e, i, o), this.refreshFilter(); - } - userSetHeaderFilterFocus(t) { - var e = this.table.columnManager.findColumn(t); - if (!e) - return ( - console.warn( - "Column Filter Focus Error - No matching column found:", - t - ), - !1 - ); - this.setHeaderFilterFocus(e); - } - userGetHeaderFilterValue(t) { - var e = this.table.columnManager.findColumn(t); - if (e) return this.getHeaderFilterValue(e); - console.warn( - "Column Filter Error - No matching column found:", - t - ); - } - userSetHeaderFilterValue(t, e) { - var i = this.table.columnManager.findColumn(t); - if (!i) - return ( - console.warn( - "Column Filter Error - No matching column found:", - t - ), - !1 - ); - this.setHeaderFilterValue(i, e); - } - userRemoveFilter(t, e, i) { - this.removeFilter(t, e, i), this.refreshFilter(); - } - userClearFilter(t) { - this.clearFilter(t), this.refreshFilter(); - } - userClearHeaderFilter() { - this.clearHeaderFilter(), this.refreshFilter(); - } - searchRows(t, e, i) { - return this.search("rows", t, e, i); - } - searchData(t, e, i) { - return this.search("data", t, e, i); - } - initializeColumnHeaderFilter(t) { - t.definition.headerFilter && this.initializeColumn(t); - } - initializeColumn(t, e) { - var i = this, - o = t.getField(); - (t.modules.filter = { - success: function (n) { - var r, - a = - (t.modules.filter.tagType == "input" && - t.modules.filter.attrType == "text") || - t.modules.filter.tagType == "textarea" - ? "partial" - : "match", - l = "", - h = ""; - if ( - t.modules.filter.prevSuccess === void 0 || - t.modules.filter.prevSuccess !== n - ) { - if ( - ((t.modules.filter.prevSuccess = n), - t.modules.filter.emptyFunc(n)) - ) - delete i.headerFilters[o]; - else { - switch ( - ((t.modules.filter.value = n), - typeof t.definition.headerFilterFunc) - ) { - case "string": - O.filters[t.definition.headerFilterFunc] - ? ((l = - t.definition - .headerFilterFunc), - (r = function (d) { - var c = - t.definition - .headerFilterFuncParams || - {}, - u = t.getFieldValue(d); - return ( - (c = - typeof c == "function" - ? c(n, u, d) - : c), - O.filters[ - t.definition - .headerFilterFunc - ](n, u, d, c) - ); - })) - : console.warn( - "Header Filter Error - Matching filter function not found: ", - t.definition.headerFilterFunc - ); - break; - case "function": - l = r = function (d) { - var c = - t.definition - .headerFilterFuncParams || - {}, - u = t.getFieldValue(d); - return ( - (c = - typeof c == "function" - ? c(n, u, d) - : c), - t.definition.headerFilterFunc( - n, - u, - d, - c - ) - ); - }; - } - r || - (a === "partial" - ? ((r = function (d) { - var c = t.getFieldValue(d); - return ( - c != null && - String(c) - .toLowerCase() - .indexOf( - String( - n - ).toLowerCase() - ) > -1 - ); - }), - (l = "like")) - : ((r = function (d) { - return t.getFieldValue(d) == n; - }), - (l = "="))), - (i.headerFilters[o] = { - value: n, - func: r, - type: l, - }); - } - (t.modules.filter.value = n), - (h = JSON.stringify(i.headerFilters)), - i.prevHeaderFilterChangeCheck !== h && - ((i.prevHeaderFilterChangeCheck = h), - i.trackChanges(), - i.refreshFilter()); - } - return !0; - }, - attrType: !1, - tagType: !1, - emptyFunc: !1, - }), - this.generateHeaderFilterElement(t); - } - generateHeaderFilterElement(t, e, i) { - var o, - n, - r, - a, - l, - h, - d, - c, - u = this, - m = t.modules.filter.success, - p = t.getField(); - if ( - ((t.modules.filter.value = e), - t.modules.filter.headerElement && - t.modules.filter.headerElement.parentNode && - t.contentElement.removeChild( - t.modules.filter.headerElement.parentNode - ), - p) - ) { - switch ( - ((t.modules.filter.emptyFunc = - t.definition.headerFilterEmptyCheck || - function (g) { - return !g && g !== 0; - }), - (o = document.createElement("div")).classList.add( - "tabulator-header-filter" - ), - typeof t.definition.headerFilter) - ) { - case "string": - u.table.modules.edit.editors[ - t.definition.headerFilter - ] - ? ((n = - u.table.modules.edit.editors[ - t.definition.headerFilter - ]), - (t.definition.headerFilter !== "tick" && - t.definition.headerFilter !== - "tickCross") || - t.definition.headerFilterEmptyCheck || - (t.modules.filter.emptyFunc = function ( - g - ) { - return g !== !0 && g !== !1; - })) - : console.warn( - "Filter Error - Cannot build header filter, No such editor found: ", - t.definition.editor - ); - break; - case "function": - n = t.definition.headerFilter; - break; - case "boolean": - t.modules.edit && t.modules.edit.editor - ? (n = t.modules.edit.editor) - : t.definition.formatter && - u.table.modules.edit.editors[ - t.definition.formatter - ] - ? ((n = - u.table.modules.edit.editors[ - t.definition.formatter - ]), - (t.definition.formatter !== "tick" && - t.definition.formatter !== "tickCross") || - t.definition.headerFilterEmptyCheck || - (t.modules.filter.emptyFunc = function ( - g - ) { - return g !== !0 && g !== !1; - })) - : (n = u.table.modules.edit.editors.input); - } - if (n) { - if ( - ((a = { - getValue: function () { - return e !== void 0 ? e : ""; - }, - getField: function () { - return t.definition.field; - }, - getElement: function () { - return o; - }, - getColumn: function () { - return t.getComponent(); - }, - getTable: () => this.table, - getType: () => "header", - getRow: function () { - return { normalizeHeight: function () {} }; - }, - }), - (d = - typeof (d = - t.definition.headerFilterParams || {}) == - "function" - ? d.call(u.table, a) - : d), - !(r = n.call( - this.table.modules.edit, - a, - function (g) { - c = g; - }, - m, - function () {}, - d - ))) - ) - return void console.warn( - "Filter Error - Cannot add filter to " + - p + - " column, editor returned a value of false" - ); - if (!(r instanceof Node)) - return void console.warn( - "Filter Error - Cannot add filter to " + - p + - " column, editor should return an instance of Node, the editor returned:", - r - ); - u.langBind( - "headerFilters|columns|" + t.definition.field, - function (g) { - r.setAttribute( - "placeholder", - g !== void 0 && g - ? g - : t.definition - .headerFilterPlaceholder || - u.langText( - "headerFilters|default" - ) - ); - } - ), - r.addEventListener("click", function (g) { - g.stopPropagation(), r.focus(); - }), - r.addEventListener("focus", (g) => { - var f = - this.table.columnManager.contentsElement - .scrollLeft; - f !== - this.table.rowManager.element.scrollLeft && - (this.table.rowManager.scrollHorizontal(f), - this.table.columnManager.scrollHorizontal( - f - )); - }), - (l = !1), - (h = function (g) { - l && clearTimeout(l), - (l = setTimeout(function () { - m(r.value); - }, u - .table.options.headerFilterLiveFilterDelay)); - }), - (t.modules.filter.headerElement = r), - (t.modules.filter.attrType = r.hasAttribute("type") - ? r.getAttribute("type").toLowerCase() - : ""), - (t.modules.filter.tagType = - r.tagName.toLowerCase()), - t.definition.headerFilterLiveFilter !== !1 && - (t.definition.headerFilter !== "autocomplete" && - t.definition.headerFilter !== "tickCross" && - ((t.definition.editor !== "autocomplete" && - t.definition.editor !== "tickCross") || - t.definition.headerFilter !== !0) && - (r.addEventListener("keyup", h), - r.addEventListener("search", h), - t.modules.filter.attrType == "number" && - r.addEventListener( - "change", - function (g) { - m(r.value); - } - ), - t.modules.filter.attrType == "text" && - this.table.browser !== "ie" && - r.setAttribute("type", "search")), - (t.modules.filter.tagType != "input" && - t.modules.filter.tagType != "select" && - t.modules.filter.tagType != "textarea") || - r.addEventListener( - "mousedown", - function (g) { - g.stopPropagation(); - } - )), - o.appendChild(r), - t.contentElement.appendChild(o), - i || u.headerFilterColumns.push(t), - c && c(); - } - } else - console.warn( - "Filter Error - Cannot add header filter, column has no field set:", - t.definition.title - ); - } - hideHeaderFilterElements() { - this.headerFilterColumns.forEach(function (t) { - t.modules.filter && - t.modules.filter.headerElement && - (t.modules.filter.headerElement.style.display = "none"); - }); - } - showHeaderFilterElements() { - this.headerFilterColumns.forEach(function (t) { - t.modules.filter && - t.modules.filter.headerElement && - (t.modules.filter.headerElement.style.display = ""); - }); - } - setHeaderFilterFocus(t) { - t.modules.filter && t.modules.filter.headerElement - ? t.modules.filter.headerElement.focus() - : console.warn( - "Column Filter Focus Error - No header filter set on column:", - t.getField() - ); - } - getHeaderFilterValue(t) { - if (t.modules.filter && t.modules.filter.headerElement) - return t.modules.filter.value; - console.warn( - "Column Filter Error - No header filter set on column:", - t.getField() - ); - } - setHeaderFilterValue(t, e) { - t && - (t.modules.filter && t.modules.filter.headerElement - ? (this.generateHeaderFilterElement(t, e, !0), - t.modules.filter.success(e)) - : console.warn( - "Column Filter Error - No header filter set on column:", - t.getField() - )); - } - reloadHeaderFilter(t) { - t && - (t.modules.filter && t.modules.filter.headerElement - ? this.generateHeaderFilterElement( - t, - t.modules.filter.value, - !0 - ) - : console.warn( - "Column Filter Error - No header filter set on column:", - t.getField() - )); - } - refreshFilter() { - this.tableInitialized && - (this.table.options.filterMode === "remote" - ? this.reloadData(null, !1, !1) - : this.refreshData(!0)); - } - trackChanges() { - (this.changed = !0), this.dispatch("filter-changed"); - } - hasChanged() { - var t = this.changed; - return (this.changed = !1), t; - } - setFilter(t, e, i, o) { - (this.filterList = []), - Array.isArray(t) || - (t = [{ field: t, type: e, value: i, params: o }]), - this.addFilter(t); - } - addFilter(t, e, i, o) { - var n = !1; - Array.isArray(t) || - (t = [{ field: t, type: e, value: i, params: o }]), - t.forEach((r) => { - (r = this.findFilter(r)) && - (this.filterList.push(r), (n = !0)); - }), - n && this.trackChanges(); - } - findFilter(t) { - var e; - if (Array.isArray(t)) return this.findSubFilters(t); - var i = !1; - return ( - typeof t.field == "function" - ? (i = function (o) { - return t.field(o, t.type || {}); - }) - : O.filters[t.type] - ? (i = (e = this.table.columnManager.getColumnByField( - t.field - )) - ? function (o) { - return O.filters[t.type]( - t.value, - e.getFieldValue(o), - o, - t.params || {} - ); - } - : function (o) { - return O.filters[t.type]( - t.value, - o[t.field], - o, - t.params || {} - ); - }) - : console.warn( - "Filter Error - No such filter type found, ignoring: ", - t.type - ), - (t.func = i), - !!t.func && t - ); - } - findSubFilters(t) { - var e = []; - return ( - t.forEach((i) => { - (i = this.findFilter(i)) && e.push(i); - }), - !!e.length && e - ); - } - getFilters(t, e) { - var i = []; - return ( - t && (i = this.getHeaderFilters()), - e && - i.forEach(function (o) { - typeof o.type == "function" && - (o.type = "function"); - }), - (i = i.concat(this.filtersToArray(this.filterList, e))) - ); - } - filtersToArray(t, e) { - var i = []; - return ( - t.forEach((o) => { - var n; - Array.isArray(o) - ? i.push(this.filtersToArray(o, e)) - : ((n = { - field: o.field, - type: o.type, - value: o.value, - }), - e && - typeof n.type == "function" && - (n.type = "function"), - i.push(n)); - }), - i - ); - } - getHeaderFilters() { - var t = []; - for (var e in this.headerFilters) - t.push({ - field: e, - type: this.headerFilters[e].type, - value: this.headerFilters[e].value, - }); - return t; - } - removeFilter(t, e, i) { - Array.isArray(t) || (t = [{ field: t, type: e, value: i }]), - t.forEach((o) => { - var n = -1; - (n = - typeof o.field == "object" - ? this.filterList.findIndex((r) => o === r) - : this.filterList.findIndex( - (r) => - o.field === r.field && - o.type === r.type && - o.value === r.value - )) > -1 - ? this.filterList.splice(n, 1) - : console.warn( - "Filter Error - No matching filter type found, ignoring: ", - o.type - ); - }), - this.trackChanges(); - } - clearFilter(t) { - (this.filterList = []), - t && this.clearHeaderFilter(), - this.trackChanges(); - } - clearHeaderFilter() { - (this.headerFilters = {}), - (this.prevHeaderFilterChangeCheck = "{}"), - this.headerFilterColumns.forEach((t) => { - t.modules.filter.value !== void 0 && - delete t.modules.filter.value, - (t.modules.filter.prevSuccess = void 0), - this.reloadHeaderFilter(t); - }), - this.trackChanges(); - } - search(t, e, i, o) { - var n = [], - r = []; - return ( - Array.isArray(e) || (e = [{ field: e, type: i, value: o }]), - e.forEach((a) => { - (a = this.findFilter(a)) && r.push(a); - }), - this.table.rowManager.rows.forEach((a) => { - var l = !0; - r.forEach((h) => { - this.filterRecurse(h, a.getData()) || (l = !1); - }), - l && - n.push( - t === "data" - ? a.getData("data") - : a.getComponent() - ); - }), - n - ); - } - filter(t, e) { - var i = [], - o = []; - return ( - this.subscribedExternal("dataFiltering") && - this.dispatchExternal( - "dataFiltering", - this.getFilters(!0) - ), - this.table.options.filterMode !== "remote" && - (this.filterList.length || - Object.keys(this.headerFilters).length) - ? t.forEach((n) => { - this.filterRow(n) && i.push(n); - }) - : (i = t.slice(0)), - this.subscribedExternal("dataFiltered") && - (i.forEach((n) => { - o.push(n.getComponent()); - }), - this.dispatchExternal( - "dataFiltered", - this.getFilters(!0), - o - )), - i - ); - } - filterRow(t, e) { - var i = !0, - o = t.getData(); - for (var n in (this.filterList.forEach((r) => { - this.filterRecurse(r, o) || (i = !1); - }), - this.headerFilters)) - this.headerFilters[n].func(o) || (i = !1); - return i; - } - filterRecurse(t, e) { - var i = !1; - return ( - Array.isArray(t) - ? t.forEach((o) => { - this.filterRecurse(o, e) && (i = !0); - }) - : (i = t.func(e)), - i - ); - } - }; - b(O, "moduleName", "filter"), b(O, "filters", Ze); - let Mt = O; - var $e = { - plaintext: function (s, t, e) { - return this.emptyToSpace(this.sanitizeHTML(s.getValue())); - }, - html: function (s, t, e) { - return s.getValue(); - }, - textarea: function (s, t, e) { - return ( - (s.getElement().style.whiteSpace = "pre-wrap"), - this.emptyToSpace(this.sanitizeHTML(s.getValue())) - ); - }, - money: function (s, t, e) { - var i, - o, - n, - r, - a, - l = parseFloat(s.getValue()), - h = "", - d = t.decimal || ".", - c = t.thousand || ",", - u = t.negativeSign || "-", - m = t.symbol || "", - p = !!t.symbolAfter, - g = t.precision !== void 0 ? t.precision : 2; - if (isNaN(l)) - return this.emptyToSpace(this.sanitizeHTML(s.getValue())); - if ( - (l < 0 && ((l = Math.abs(l)), (h = u)), - (i = g !== !1 ? l.toFixed(g) : l), - (o = (i = String(i).split("."))[0]), - (n = i.length > 1 ? d + i[1] : ""), - t.thousand !== !1) - ) - for (r = /(\d+)(\d{3})/; r.test(o); ) - o = o.replace(r, "$1" + c + "$2"); - return ( - (a = o + n), - h === !0 - ? ((a = "(" + a + ")"), p ? a + m : m + a) - : p - ? h + a + m - : h + m + a - ); - }, - link: function (s, t, e) { - var i, - o = s.getValue(), - n = t.urlPrefix || "", - r = t.download, - a = o, - l = document.createElement("a"); - if ( - (t.labelField && - ((i = s.getData()), - (a = (function h(d, c) { - var u = c[d.shift()]; - return d.length && typeof u == "object" - ? h(d, u) - : u; - })( - t.labelField.split( - this.table.options.nestedFieldSeparator - ), - i - ))), - t.label) - ) - switch (typeof t.label) { - case "string": - a = t.label; - break; - case "function": - a = t.label(s); - } - if (a) { - if ( - (t.urlField && - ((i = s.getData()), - (o = x.retrieveNestedData( - this.table.options.nestedFieldSeparator, - t.urlField, - i - ))), - t.url) - ) - switch (typeof t.url) { - case "string": - o = t.url; - break; - case "function": - o = t.url(s); - } - return ( - l.setAttribute("href", n + o), - t.target && l.setAttribute("target", t.target), - t.download && - ((r = - typeof r == "function" - ? r(s) - : r === !0 - ? "" - : r), - l.setAttribute("download", r)), - (l.innerHTML = this.emptyToSpace(this.sanitizeHTML(a))), - l - ); - } - return " "; - }, - image: function (s, t, e) { - var i = document.createElement("img"), - o = s.getValue(); - switch ( - (t.urlPrefix && (o = t.urlPrefix + s.getValue()), - t.urlSuffix && (o += t.urlSuffix), - i.setAttribute("src", o), - 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 () { - s.getRow().normalizeHeight(); - }), - i - ); - }, - tickCross: function (s, t, e) { - var i = s.getValue(), - o = s.getElement(), - n = t.allowEmpty, - r = t.allowTruthy, - a = Object.keys(t).includes("trueValue"), - l = - t.tickElement !== void 0 - ? t.tickElement - : '', - h = - t.crossElement !== void 0 - ? t.crossElement - : ''; - return (a && i === t.trueValue) || - (!a && - ((r && i) || - i === !0 || - i === "true" || - i === "True" || - i === 1 || - i === "1")) - ? (o.setAttribute("aria-checked", !0), l || "") - : !n || (i !== "null" && i !== "" && i != null) - ? (o.setAttribute("aria-checked", !1), h || "") - : (o.setAttribute("aria-checked", "mixed"), ""); - }, - datetime: function (s, t, e) { - var i, - o = this.table.dependencyRegistry.lookup( - ["luxon", "DateTime"], - "DateTime" - ), - n = t.inputFormat || "yyyy-MM-dd HH:mm:ss", - r = t.outputFormat || "dd/MM/yyyy HH:mm:ss", - a = - t.invalidPlaceholder !== void 0 - ? t.invalidPlaceholder - : "", - l = s.getValue(); - if (o !== void 0) - return (i = o.isDateTime(l) - ? l - : n === "iso" - ? o.fromISO(String(l)) - : o.fromFormat(String(l), n)).isValid - ? (t.timezone && (i = i.setZone(t.timezone)), - i.toFormat(r)) - : a !== !0 && l - ? typeof a == "function" - ? a(l) - : a - : l; - console.error( - "Format Error - 'datetime' formatter is dependant on luxon.js" - ); - }, - datetimediff: function (s, t, e) { - var i, - o = this.table.dependencyRegistry.lookup( - ["luxon", "DateTime"], - "DateTime" - ), - n = t.inputFormat || "yyyy-MM-dd HH:mm:ss", - r = - t.invalidPlaceholder !== void 0 - ? t.invalidPlaceholder - : "", - a = t.suffix !== void 0 && t.suffix, - l = t.unit !== void 0 ? t.unit : "days", - h = t.humanize !== void 0 && t.humanize, - d = t.date !== void 0 ? t.date : o.now(), - c = s.getValue(); - if (o !== void 0) - return (i = o.isDateTime(c) - ? c - : n === "iso" - ? o.fromISO(String(c)) - : o.fromFormat(String(c), n)).isValid - ? h - ? i.diff(d, l).toHuman() + (a ? " " + a : "") - : parseInt(i.diff(d, l)[l]) + (a ? " " + a : "") - : r === !0 - ? c - : typeof r == "function" - ? r(c) - : r; - console.error( - "Format Error - 'datetimediff' formatter is dependant on luxon.js" - ); - }, - lookup: function (s, t, e) { - var i = s.getValue(); - return t[i] === void 0 - ? (console.warn("Missing display value for " + i), i) - : t[i]; - }, - star: function (s, t, e) { - var i = s.getValue(), - o = s.getElement(), - n = 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, n))); - for (var l = 1; l <= n; l++) { - var h = a.cloneNode(!0); - (h.innerHTML = - l <= i - ? '' - : ''), - r.appendChild(h); - } - return ( - (o.style.whiteSpace = "nowrap"), - (o.style.overflow = "hidden"), - (o.style.textOverflow = "ellipsis"), - o.setAttribute("aria-label", i), - r - ); - }, - traffic: function (s, t, e) { - var i, - o, - n = this.sanitizeHTML(s.getValue()) || 0, - r = document.createElement("span"), - a = t && t.max ? t.max : 100, - l = t && t.min ? t.min : 0, - h = - t && t.color !== void 0 - ? t.color - : ["red", "orange", "green"], - d = "#666666"; - if (!isNaN(n) && s.getValue() !== void 0) { - switch ( - (r.classList.add("tabulator-traffic-light"), - (o = parseFloat(n) <= a ? parseFloat(n) : a), - (o = parseFloat(o) >= l ? parseFloat(o) : l), - (i = (a - l) / 100), - (o = Math.round((o - l) / i)), - typeof h) - ) { - case "string": - d = h; - break; - case "function": - d = h(n); - break; - case "object": - if (Array.isArray(h)) { - var c = 100 / h.length, - u = Math.floor(o / c); - (u = Math.min(u, h.length - 1)), - (d = h[(u = Math.max(u, 0))]); - break; - } - } - return (r.style.backgroundColor = d), r; - } - }, - progress: function (s, t = {}, e) { - var i, - o, - n, - r, - a, - l = this.sanitizeHTML(s.getValue()) || 0, - h = s.getElement(), - d = t.max ? t.max : 100, - c = t.min ? t.min : 0, - u = t.legendAlign ? t.legendAlign : "center"; - switch ( - ((o = parseFloat(l) <= d ? parseFloat(l) : d), - (o = parseFloat(o) >= c ? parseFloat(o) : c), - (i = (d - c) / 100), - (o = Math.round((o - c) / i)), - typeof t.color) - ) { - case "string": - n = t.color; - break; - case "function": - n = t.color(l); - break; - case "object": - if (Array.isArray(t.color)) { - let f = 100 / t.color.length, - v = Math.floor(o / f); - (v = Math.min(v, t.color.length - 1)), - (v = Math.max(v, 0)), - (n = t.color[v]); - break; - } - default: - n = "#2DC214"; - } - switch (typeof t.legend) { - case "string": - r = t.legend; - break; - case "function": - r = t.legend(l); - break; - case "boolean": - r = l; - break; - default: - r = !1; - } - switch (typeof t.legendColor) { - case "string": - a = t.legendColor; - break; - case "function": - a = t.legendColor(l); - break; - case "object": - if (Array.isArray(t.legendColor)) { - let f = 100 / t.legendColor.length, - v = Math.floor(o / f); - (v = Math.min(v, t.legendColor.length - 1)), - (v = Math.max(v, 0)), - (a = t.legendColor[v]); - } - break; - default: - a = "#000"; - } - (h.style.minWidth = "30px"), - (h.style.position = "relative"), - h.setAttribute("aria-label", o); - var m = document.createElement("div"); - (m.style.display = "inline-block"), - (m.style.width = o + "%"), - (m.style.backgroundColor = n), - (m.style.height = "100%"), - m.setAttribute("data-max", d), - m.setAttribute("data-min", c); - var p = document.createElement("div"); - if ( - ((p.style.position = "relative"), - (p.style.width = "100%"), - (p.style.height = "100%"), - r) - ) { - var g = document.createElement("div"); - (g.style.position = "absolute"), - (g.style.top = 0), - (g.style.left = 0), - (g.style.textAlign = u), - (g.style.width = "100%"), - (g.style.color = a), - (g.innerHTML = r); - } - return ( - e(function () { - if (!(s instanceof ae)) { - var f = document.createElement("div"); - (f.style.position = "absolute"), - (f.style.top = "4px"), - (f.style.bottom = "4px"), - (f.style.left = "4px"), - (f.style.right = "4px"), - h.appendChild(f), - (h = f); - } - h.appendChild(p), - p.appendChild(m), - r && p.appendChild(g); - }), - "" - ); - }, - color: function (s, t, e) { - return ( - (s.getElement().style.backgroundColor = this.sanitizeHTML( - s.getValue() - )), - "" - ); - }, - buttonTick: function (s, t, e) { - return ''; - }, - buttonCross: function (s, t, e) { - return ''; - }, - toggle: function (s, t, e) { - var i, - o, - n = s.getValue(), - r = t.size || 15, - a = r + "px", - l = !t.hasOwnProperty("onValue") || t.onValue, - h = !!t.hasOwnProperty("offValue") && t.offValue, - d = t.onTruthy ? n : n === l; - return ( - (i = document.createElement("div")).classList.add( - "tabulator-toggle" - ), - d - ? (i.classList.add("tabulator-toggle-on"), - (i.style.flexDirection = "row-reverse"), - t.onColor && (i.style.background = t.onColor)) - : t.offColor && (i.style.background = t.offColor), - (i.style.width = 2.5 * r + "px"), - (i.style.borderRadius = a), - t.clickable && - i.addEventListener("click", (c) => { - s.setValue(d ? h : l); - }), - (o = document.createElement("div")).classList.add( - "tabulator-toggle-switch" - ), - (o.style.height = a), - (o.style.width = a), - (o.style.borderRadius = a), - i.appendChild(o), - i - ); - }, - rownum: function (s, t, e) { - var i = document.createElement("span"), - o = s.getRow(), - n = s.getTable(); - return ( - o.watchPosition((r) => { - t.relativeToPage && - (r += - n.modules.page.getPageSize() * - (n.modules.page.getPage() - 1)), - (i.innerText = r); - }), - i - ); - }, - handle: function (s, t, e) { - return ( - s.getElement().classList.add("tabulator-row-handle"), - "
" - ); - }, - adaptable: function (s, t, e) { - var i, o; - return ( - (i = t.formatterLookup - ? t.formatterLookup(s) - : (function (n) { - var r = n.getValue(), - a = "plaintext"; - switch (typeof r) { - case "boolean": - a = "tickCross"; - break; - case "string": - r.includes(` -`) && (a = "textarea"); - } - return a; - })(s)), - t.paramsLookup && - (o = - typeof t.paramsLookup == "function" - ? t.paramsLookup(i, s) - : t.paramsLookup[i]), - this.table.modules.format - .lookupFormatter(i) - .call(this, s, o || {}, e) - ); - }, - array: function (s, t, e) { - var i, - o = t.delimiter || ",", - n = s.getValue(), - r = this.table; - return ( - t.valueMap && - (i = - typeof t.valueMap == "string" - ? function (a) { - return a.map((l) => - x.retrieveNestedData( - r.options.nestedFieldSeparator, - t.valueMap, - l - ) - ); - } - : t.valueMap), - Array.isArray(n) ? (i && (n = i(n)), n.join(o)) : n - ); - }, - json: function (s, t, e) { - var i = t.indent || " ", - o = t.multiline === void 0 || t.multiline, - n = t.replacer || null, - r = s.getValue(); - return ( - o && (s.getElement().style.whiteSpace = "pre-wrap"), - JSON.stringify(r, n, i) - ); - }, - }; - let I = class I extends w { - constructor(t) { - super(t), - this.registerColumnOption("formatter"), - this.registerColumnOption("formatterParams"), - this.registerColumnOption("formatterPrint"), - this.registerColumnOption("formatterPrintParams"), - this.registerColumnOption("formatterClipboard"), - this.registerColumnOption("formatterClipboardParams"), - this.registerColumnOption("formatterHtmlOutput"), - this.registerColumnOption("formatterHtmlOutputParams"), - this.registerColumnOption("titleFormatter"), - this.registerColumnOption("titleFormatterParams"); - } - initialize() { - this.subscribe("cell-format", this.formatValue.bind(this)), - this.subscribe( - "cell-rendered", - this.cellRendered.bind(this) - ), - this.subscribe( - "column-layout", - this.initializeColumn.bind(this) - ), - this.subscribe( - "column-format", - this.formatHeader.bind(this) - ); - } - initializeColumn(t) { - (t.modules.format = this.lookupTypeFormatter(t, "")), - t.definition.formatterPrint !== void 0 && - (t.modules.format.print = this.lookupTypeFormatter( - t, - "Print" - )), - t.definition.formatterClipboard !== void 0 && - (t.modules.format.clipboard = this.lookupTypeFormatter( - t, - "Clipboard" - )), - t.definition.formatterHtmlOutput !== void 0 && - (t.modules.format.htmlOutput = this.lookupTypeFormatter( - t, - "HtmlOutput" - )); - } - lookupTypeFormatter(t, e) { - var i = { - params: t.definition["formatter" + e + "Params"] || {}, - }, - o = t.definition["formatter" + e]; - return (i.formatter = this.lookupFormatter(o)), i; - } - lookupFormatter(t) { - var e; - switch (typeof t) { - case "string": - I.formatters[t] - ? (e = I.formatters[t]) - : (console.warn( - "Formatter Error - No such formatter found: ", - t - ), - (e = I.formatters.plaintext)); - break; - case "function": - e = t; - break; - default: - e = I.formatters.plaintext; - } - return e; - } - cellRendered(t) { - t.modules.format && - t.modules.format.renderedCallback && - !t.modules.format.rendered && - (t.modules.format.renderedCallback(), - (t.modules.format.rendered = !0)); - } - formatHeader(t, e, i) { - var o, n, r, a; - return t.definition.titleFormatter - ? ((o = this.lookupFormatter(t.definition.titleFormatter)), - (r = (l) => { - t.titleFormatterRendered = l; - }), - (a = { - getValue: function () { - return e; - }, - getElement: function () { - return i; - }, - getType: function () { - return "header"; - }, - getColumn: function () { - return t.getComponent(); - }, - getTable: () => this.table, - }), - (n = - typeof (n = - t.definition.titleFormatterParams || {}) == - "function" - ? n() - : n), - o.call(this, a, n, r)) - : e; - } - formatValue(t) { - var e = t.getComponent(), - i = - typeof t.column.modules.format.params == "function" - ? t.column.modules.format.params(e) - : t.column.modules.format.params; - return t.column.modules.format.formatter.call( - this, - e, - i, - function (o) { - t.modules.format || (t.modules.format = {}), - (t.modules.format.renderedCallback = o), - (t.modules.format.rendered = !1); - } - ); - } - formatExportValue(t, e) { - var i, - o = t.column.modules.format[e]; - if (o) { - let n = function (r) { - t.modules.format || (t.modules.format = {}), - (t.modules.format.renderedCallback = r), - (t.modules.format.rendered = !1); - }; - return ( - (i = - typeof o.params == "function" - ? o.params(t.getComponent()) - : o.params), - o.formatter.call(this, t.getComponent(), i, n) - ); - } - return this.formatValue(t); - } - sanitizeHTML(t) { - if (t) { - var e = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "/": "/", - "`": "`", - "=": "=", - }; - return String(t).replace(/[&<>"'`=/]/g, function (i) { - return e[i]; - }); - } - return t; - } - emptyToSpace(t) { - return t == null || t === "" ? " " : t; - } - }; - b(I, "moduleName", "format"), b(I, "formatters", $e); - let Lt = I; - class ti { - constructor(t) { - return ( - (this._group = t), - (this.type = "GroupComponent"), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._group.groupManager.table.componentFunctionBinder.handle( - "group", - e._group, - i - ); - }, - }) - ); - } - getKey() { - return this._group.key; - } - getField() { - return this._group.field; - } - getElement() { - return this._group.element; - } - getRows() { - return this._group.getRows(!0); - } - getSubGroups() { - return this._group.getSubGroups(!0); - } - getParentGroup() { - return ( - !!this._group.parent && this._group.parent.getComponent() - ); - } - isVisible() { - return this._group.visible; - } - show() { - this._group.show(); - } - hide() { - this._group.hide(); - } - toggle() { - this._group.toggleVisibility(); - } - scrollTo(t, e) { - return this._group.groupManager.table.rowManager.scrollToRow( - this._group, - t, - e - ); - } - _getSelf() { - return this._group; - } - getTable() { - return this._group.groupManager.table; - } - } - class K { - constructor(t, e, i, o, n, r, a) { - (this.groupManager = t), - (this.parent = e), - (this.key = o), - (this.level = i), - (this.field = n), - (this.hasSubGroups = i < t.groupIDLookups.length - 1), - (this.addRow = this.hasSubGroups - ? this._addRowToGroup - : this._addRow), - (this.type = "group"), - (this.old = a), - (this.rows = []), - (this.groups = []), - (this.groupList = []), - (this.generator = r), - (this.element = !1), - (this.elementContents = !1), - (this.height = 0), - (this.outerHeight = 0), - (this.initialized = !1), - (this.calcs = {}), - (this.initialized = !1), - (this.modules = {}), - (this.arrowElement = !1), - (this.visible = a - ? a.visible - : t.startOpen[i] !== void 0 - ? t.startOpen[i] - : t.startOpen[0]), - (this.component = null), - this.createElements(), - this.addBindings(), - this.createValueGroups(); - } - wipe(t) { - t || - (this.groupList.length - ? this.groupList.forEach(function (e) { - e.wipe(); - }) - : this.rows.forEach((e) => { - e.modules && delete e.modules.group; - })), - (this.element = !1), - (this.arrowElement = !1), - (this.elementContents = !1); - } - createElements() { - var t = document.createElement("div"); - t.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(t), - this.groupManager.table.options.movableRows !== !1 && - this.groupManager.table.modExists("moveRow") && - this.groupManager.table.modules.moveRow.initializeGroupHeader( - this - ); - } - createValueGroups() { - var t = this.level + 1; - this.groupManager.allowedValues && - this.groupManager.allowedValues[t] && - this.groupManager.allowedValues[t].forEach((e) => { - this._createGroup(e, t); - }); - } - addBindings() { - this.groupManager.table.options.groupToggleElement && - (this.groupManager.table.options.groupToggleElement == - "arrow" - ? this.arrowElement - : this.element - ).addEventListener("click", (t) => { - this.groupManager.table.options.groupToggleElement === - "arrow" && - (t.stopPropagation(), t.stopImmediatePropagation()), - setTimeout(() => { - this.toggleVisibility(); - }); - }); - } - _createGroup(t, e) { - var i = e + "_" + t, - o = new K( - this.groupManager, - this, - e, - t, - this.groupManager.groupIDLookups[e].field, - this.groupManager.headerGenerator[e] || - this.groupManager.headerGenerator[0], - !!this.old && this.old.groups[i] - ); - (this.groups[i] = o), this.groupList.push(o); - } - _addRowToGroup(t) { - var e = this.level + 1; - if (this.hasSubGroups) { - var i = this.groupManager.groupIDLookups[e].func( - t.getData() - ), - o = e + "_" + i; - this.groupManager.allowedValues && - this.groupManager.allowedValues[e] - ? this.groups[o] && this.groups[o].addRow(t) - : (this.groups[o] || this._createGroup(i, e), - this.groups[o].addRow(t)); - } - } - _addRow(t) { - this.rows.push(t), (t.modules.group = this); - } - insertRow(t, e, i) { - var o = this.conformRowData({}); - t.updateData(o); - var n = this.rows.indexOf(e); - n > -1 - ? i - ? this.rows.splice(n + 1, 0, t) - : this.rows.splice(n, 0, t) - : i - ? this.rows.push(t) - : this.rows.unshift(t), - (t.modules.group = this), - this.groupManager.table.modExists("columnCalcs") && - this.groupManager.table.options.columnCalcs != - "table" && - this.groupManager.table.modules.columnCalcs.recalcGroup( - this - ), - this.groupManager.updateGroupRows(!0); - } - scrollHeader(t) { - this.arrowElement && - ((this.arrowElement.style.marginLeft = t), - this.groupList.forEach(function (e) { - e.scrollHeader(t); - })); - } - getRowIndex(t) {} - conformRowData(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 - ); - } - removeRow(t) { - var e = this.rows.indexOf(t), - i = t.getElement(); - e > -1 && this.rows.splice(e, 1), - this.groupManager.table.options.groupValues || - this.rows.length - ? (i.parentNode && i.parentNode.removeChild(i), - this.groupManager.blockRedraw || - (this.generateGroupHeaderContents(), - this.groupManager.table.modExists( - "columnCalcs" - ) && - this.groupManager.table.options.columnCalcs != - "table" && - this.groupManager.table.modules.columnCalcs.recalcGroup( - this - ))) - : (this.parent - ? this.parent.removeGroup(this) - : this.groupManager.removeGroup(this), - this.groupManager.updateGroupRows(!0)); - } - removeGroup(t) { - var e, - i = t.level + "_" + t.key; - this.groups[i] && - (delete this.groups[i], - (e = this.groupList.indexOf(t)) > -1 && - this.groupList.splice(e, 1), - this.groupList.length || - (this.parent - ? this.parent.removeGroup(this) - : this.groupManager.removeGroup(this))); - } - getHeadersAndRows() { - var t = []; - return ( - t.push(this), - this._visSet(), - this.calcs.top && - (this.calcs.top.detachElement(), - this.calcs.top.deleteCells()), - this.calcs.bottom && - (this.calcs.bottom.detachElement(), - this.calcs.bottom.deleteCells()), - this.visible - ? this.groupList.length - ? this.groupList.forEach(function (e) { - t = t.concat(e.getHeadersAndRows()); - }) - : (this.groupManager.table.options.columnCalcs != - "table" && - this.groupManager.table.modExists( - "columnCalcs" - ) && - this.groupManager.table.modules.columnCalcs.hasTopCalcs() && - ((this.calcs.top = - this.groupManager.table.modules.columnCalcs.generateTopRow( - this.rows - )), - t.push(this.calcs.top)), - (t = t.concat(this.rows)), - this.groupManager.table.options.columnCalcs != - "table" && - this.groupManager.table.modExists( - "columnCalcs" - ) && - this.groupManager.table.modules.columnCalcs.hasBottomCalcs() && - ((this.calcs.bottom = - this.groupManager.table.modules.columnCalcs.generateBottomRow( - this.rows - )), - t.push(this.calcs.bottom))) - : this.groupList.length || - this.groupManager.table.options.columnCalcs == - "table" || - (this.groupManager.table.modExists("columnCalcs") && - (this.groupManager.table.modules.columnCalcs.hasTopCalcs() && - this.groupManager.table.options - .groupClosedShowCalcs && - ((this.calcs.top = - this.groupManager.table.modules.columnCalcs.generateTopRow( - this.rows - )), - t.push(this.calcs.top)), - this.groupManager.table.modules.columnCalcs.hasBottomCalcs() && - this.groupManager.table.options - .groupClosedShowCalcs && - ((this.calcs.bottom = - this.groupManager.table.modules.columnCalcs.generateBottomRow( - this.rows - )), - t.push(this.calcs.bottom)))), - t - ); - } - getData(t, e) { - var i = []; - return ( - this._visSet(), - (!t || (t && this.visible)) && - this.rows.forEach((o) => { - i.push(o.getData(e || "data")); - }), - i - ); - } - getRowCount() { - var t = 0; - return ( - this.groupList.length - ? this.groupList.forEach((e) => { - t += e.getRowCount(); - }) - : (t = this.rows.length), - t - ); - } - toggleVisibility() { - this.visible ? this.hide() : this.show(); - } - hide() { - (this.visible = !1), - this.groupManager.table.rowManager.getRenderMode() != - "basic" || - this.groupManager.table.options.pagination || - (this.element.classList.remove( - "tabulator-group-visible" - ), - this.groupList.length - ? this.groupList.forEach((t) => { - t.getHeadersAndRows().forEach((e) => { - e.detachElement(); - }); - }) - : this.rows.forEach((t) => { - var e = t.getElement(); - e.parentNode.removeChild(e); - })), - this.groupManager.updateGroupRows(!0), - this.groupManager.table.externalEvents.dispatch( - "groupVisibilityChanged", - this.getComponent(), - !1 - ); - } - show() { - if ( - ((this.visible = !0), - this.groupManager.table.rowManager.getRenderMode() != - "basic" || this.groupManager.table.options.pagination) - ) - this.groupManager.updateGroupRows(!0); - else { - this.element.classList.add("tabulator-group-visible"); - var t = this.generateElement(); - this.groupList.length - ? this.groupList.forEach((e) => { - e.getHeadersAndRows().forEach((i) => { - var o = i.getElement(); - t.parentNode.insertBefore(o, t.nextSibling), - i.initialize(), - (t = o); - }); - }) - : this.rows.forEach((e) => { - var i = e.getElement(); - t.parentNode.insertBefore(i, t.nextSibling), - e.initialize(), - (t = i); - }), - this.groupManager.updateGroupRows(!0); - } - this.groupManager.table.externalEvents.dispatch( - "groupVisibilityChanged", - this.getComponent(), - !0 - ); - } - _visSet() { - var t = []; - typeof this.visible == "function" && - (this.rows.forEach(function (e) { - t.push(e.getData()); - }), - (this.visible = this.visible( - this.key, - this.getRowCount(), - t, - this.getComponent() - ))); - } - getRowGroup(t) { - var e = !1; - return ( - this.groupList.length - ? this.groupList.forEach(function (i) { - var o = i.getRowGroup(t); - o && (e = o); - }) - : this.rows.find(function (i) { - return i === t; - }) && (e = this), - e - ); - } - getSubGroups(t) { - var e = []; - return ( - this.groupList.forEach(function (i) { - e.push(t ? i.getComponent() : i); - }), - e - ); - } - getRows(t, e) { - var i = []; - return ( - e && this.groupList.length - ? this.groupList.forEach((o) => { - i = i.concat(o.getRows(t, e)); - }) - : this.rows.forEach(function (o) { - i.push(t ? o.getComponent() : o); - }), - i - ); - } - generateGroupHeaderContents() { - var t = []; - for ( - this.getRows(!1, !0).forEach(function (e) { - t.push(e.getData()); - }), - this.elementContents = this.generator( - this.key, - this.getRowCount(), - t, - this.getComponent() - ); - this.element.firstChild; - - ) - this.element.removeChild(this.element.firstChild); - typeof this.elementContents == "string" - ? (this.element.innerHTML = this.elementContents) - : this.element.appendChild(this.elementContents), - this.element.insertBefore( - this.arrowElement, - this.element.firstChild - ); - } - getPath(t = []) { - return ( - t.unshift(this.key), - this.parent && this.parent.getPath(t), - t - ); - } - getElement() { - return this.elementContents - ? this.element - : this.generateElement(); - } - generateElement() { - (this.addBindings = !1), - this._visSet(), - this.visible - ? this.element.classList.add("tabulator-group-visible") - : this.element.classList.remove( - "tabulator-group-visible" - ); - for (var t = 0; t < this.element.childNodes.length; ++t) - this.element.childNodes[t].parentNode.removeChild( - this.element.childNodes[t] - ); - return this.generateGroupHeaderContents(), this.element; - } - detachElement() { - this.element && - this.element.parentNode && - this.element.parentNode.removeChild(this.element); - } - normalizeHeight() { - this.setHeight(this.element.clientHeight); - } - initialize(t) { - (this.initialized && !t) || - (this.normalizeHeight(), (this.initialized = !0)); - } - reinitialize() { - (this.initialized = !1), - (this.height = 0), - x.elVisible(this.element) && this.initialize(!0); - } - setHeight(t) { - this.height != t && - ((this.height = t), - (this.outerHeight = this.element.offsetHeight)); - } - getHeight() { - return this.outerHeight; - } - getGroup() { - return this; - } - reinitializeHeight() {} - calcHeight() {} - setCellHeight() {} - clearCellHeight() {} - deinitializeHeight() {} - rendered() {} - getComponent() { - return ( - this.component || (this.component = new ti(this)), - this.component - ); - } - } - var ei = { - cellEdit: function (s) { - s.component.setValueProcessData(s.data.oldValue), - s.component.cellRendered(); - }, - rowAdd: function (s) { - s.component.deleteActual(), - this.table.rowManager.checkPlaceholder(); - }, - rowDelete: function (s) { - var t = this.table.rowManager.addRowActual( - s.data.data, - s.data.pos, - s.data.index - ); - this.table.options.groupBy && - this.table.modExists("groupRows") && - this.table.modules.groupRows.updateGroupRows(!0), - this._rebindRow(s.component, t), - this.table.rowManager.checkPlaceholder(); - }, - rowMove: function (s) { - var t = s.data.posFrom - s.data.posTo > 0; - this.table.rowManager.moveRowActual( - s.component, - this.table.rowManager.getRowFromPosition( - s.data.posFrom - ), - t - ), - this.table.rowManager.regenerateRowPositions(), - this.table.rowManager.reRenderInPosition(); - }, - }, - ii = { - cellEdit: function (s) { - s.component.setValueProcessData(s.data.newValue), - s.component.cellRendered(); - }, - rowAdd: function (s) { - var t = this.table.rowManager.addRowActual( - s.data.data, - s.data.pos, - s.data.index - ); - this.table.options.groupBy && - this.table.modExists("groupRows") && - this.table.modules.groupRows.updateGroupRows(!0), - this._rebindRow(s.component, t), - this.table.rowManager.checkPlaceholder(); - }, - rowDelete: function (s) { - s.component.deleteActual(), - this.table.rowManager.checkPlaceholder(); - }, - rowMove: function (s) { - this.table.rowManager.moveRowActual( - s.component, - this.table.rowManager.getRowFromPosition(s.data.posTo), - s.data.after - ), - this.table.rowManager.regenerateRowPositions(), - this.table.rowManager.reRenderInPosition(); - }, - }, - si = { - keybindings: { - bindings: { - undo: ["ctrl + 90", "meta + 90"], - redo: ["ctrl + 89", "meta + 89"], - }, - actions: { - undo: function (s) { - this.table.options.history && - this.table.modExists("history") && - this.table.modExists("edit") && - (this.table.modules.edit.currentCell || - (s.preventDefault(), - this.table.modules.history.undo())); - }, - redo: function (s) { - this.table.options.history && - this.table.modExists("history") && - this.table.modExists("edit") && - (this.table.modules.edit.currentCell || - (s.preventDefault(), - this.table.modules.history.redo())); - }, - }, - }, - }; - let N = class N extends w { - constructor(t) { - super(t), - (this.history = []), - (this.index = -1), - this.registerTableOption("history", !1); - } - initialize() { - this.table.options.history && - (this.subscribe( - "cell-value-updated", - this.cellUpdated.bind(this) - ), - this.subscribe( - "cell-delete", - this.clearComponentHistory.bind(this) - ), - this.subscribe("row-delete", this.rowDeleted.bind(this)), - this.subscribe("rows-wipe", this.clear.bind(this)), - this.subscribe("row-added", this.rowAdded.bind(this)), - this.subscribe("row-move", this.rowMoved.bind(this))), - this.registerTableFunction("undo", this.undo.bind(this)), - this.registerTableFunction("redo", this.redo.bind(this)), - this.registerTableFunction( - "getHistoryUndoSize", - this.getHistoryUndoSize.bind(this) - ), - this.registerTableFunction( - "getHistoryRedoSize", - this.getHistoryRedoSize.bind(this) - ), - this.registerTableFunction( - "clearHistory", - this.clear.bind(this) - ); - } - rowMoved(t, e, i) { - this.action("rowMove", t, { - posFrom: t.getPosition(), - posTo: e.getPosition(), - to: e, - after: i, - }); - } - rowAdded(t, e, i, o) { - this.action("rowAdd", t, { data: e, pos: i, index: o }); - } - rowDeleted(t) { - var e, i; - this.table.options.groupBy - ? (e = (i = t - .getComponent() - .getGroup() - ._getSelf().rows).indexOf(t)) && (e = i[e - 1]) - : (e = t.table.rowManager.getRowIndex(t)) && - (e = t.table.rowManager.rows[e - 1]), - this.action("rowDelete", t, { - data: t.getData(), - pos: !e, - index: e, - }); - } - cellUpdated(t) { - this.action("cellEdit", t, { - oldValue: t.oldValue, - newValue: t.value, - }); - } - clear() { - (this.history = []), (this.index = -1); - } - action(t, e, i) { - (this.history = this.history.slice(0, this.index + 1)), - this.history.push({ type: t, component: e, data: i }), - this.index++; - } - getHistoryUndoSize() { - return this.index + 1; - } - getHistoryRedoSize() { - return this.history.length - (this.index + 1); - } - clearComponentHistory(t) { - var e = this.history.findIndex(function (i) { - return i.component === t; - }); - e > -1 && - (this.history.splice(e, 1), - e <= this.index && this.index--, - this.clearComponentHistory(t)); - } - undo() { - if (this.index > -1) { - let t = this.history[this.index]; - return ( - N.undoers[t.type].call(this, t), - this.index--, - this.dispatchExternal( - "historyUndo", - t.type, - t.component.getComponent(), - t.data - ), - !0 - ); - } - return ( - console.warn( - this.options("history") - ? "History Undo Error - No more history to undo" - : "History module not enabled" - ), - !1 - ); - } - redo() { - if (this.history.length - 1 > this.index) { - this.index++; - let t = this.history[this.index]; - return ( - N.redoers[t.type].call(this, t), - this.dispatchExternal( - "historyRedo", - t.type, - t.component.getComponent(), - t.data - ), - !0 - ); - } - return ( - console.warn( - this.options("history") - ? "History Redo Error - No more history to redo" - : "History module not enabled" - ), - !1 - ); - } - _rebindRow(t, e) { - this.history.forEach(function (i) { - if (i.component instanceof k) - i.component === t && (i.component = e); - else if ( - i.component instanceof et && - i.component.row === t - ) { - var o = i.component.column.getField(); - o && (i.component = e.getCell(o)); - } - }); - } - }; - b(N, "moduleName", "history"), - b(N, "moduleExtensions", si), - b(N, "undoers", ei), - b(N, "redoers", ii); - let St = N; - var oi = { - csv: function (s) { - var t = [], - e = 0, - i = 0, - o = !1; - for (let n = 0; n < s.length; n++) { - let r = s[n], - a = s[n + 1]; - t[e] || (t[e] = []), - t[e][i] || (t[e][i] = ""), - r == '"' && o && a == '"' - ? ((t[e][i] += r), n++) - : r != '"' - ? r != "," || o - ? r != "\r" || - a != - ` -` || - o - ? (r != "\r" && - r != - ` -`) || - o - ? (t[e][i] += r) - : ((i = 0), e++) - : ((i = 0), e++, n++) - : i++ - : (o = !o); - } - return t; - }, - json: function (s) { - try { - return JSON.parse(s); - } catch (t) { - return ( - console.warn( - "JSON Import Error - File contents is invalid JSON", - t - ), - Promise.reject() - ); - } - }, - array: function (s) { - return s; - }, - xlsx: function (s) { - var t = this.dependencyRegistry.lookup("XLSX"), - e = t.read(s), - i = e.Sheets[e.SheetNames[0]]; - return t.utils.sheet_to_json(i, { header: 1 }); - }, - }; - let ot = class ot extends w { - constructor(t) { - super(t), - this.registerTableOption("importFormat"), - this.registerTableOption("importReader", "text"), - this.registerTableOption("importHeaderTransform"), - this.registerTableOption("importValueTransform"), - this.registerTableOption("importDataValidator"), - this.registerTableOption("importFileValidator"); - } - initialize() { - this.registerTableFunction( - "import", - this.importFromFile.bind(this) - ), - this.table.options.importFormat && - (this.subscribe( - "data-loading", - this.loadDataCheck.bind(this), - 10 - ), - this.subscribe( - "data-load", - this.loadData.bind(this), - 10 - )); - } - loadDataCheck(t) { - return ( - this.table.options.importFormat && - (typeof t == "string" || - (Array.isArray(t) && t.length && Array.isArray(t))) - ); - } - loadData(t, e, i, o, n) { - return this.importData(this.lookupImporter(), t) - .then(this.structureData.bind(this)) - .catch( - (r) => ( - console.error( - "Import Error:", - r || "Unable to import data" - ), - Promise.reject(r) - ) - ); - } - lookupImporter(t) { - var e; - return ( - t || (t = this.table.options.importFormat), - (e = typeof t == "string" ? ot.importers[t] : t) || - console.error("Import Error - Importer not found:", t), - e - ); - } - importFromFile(t, e, i) { - var o = this.lookupImporter(t); - if (o) - return this.pickFile(e, i) - .then(this.importData.bind(this, o)) - .then(this.structureData.bind(this)) - .then(this.mutateData.bind(this)) - .then(this.validateData.bind(this)) - .then(this.setData.bind(this)) - .catch( - (n) => ( - this.dispatch("import-error", n), - this.dispatchExternal("importError", n), - console.error( - "Import Error:", - n || "Unable to import file" - ), - this.table.dataLoader.alertError(), - setTimeout(() => { - this.table.dataLoader.clearAlert(); - }, 3e3), - Promise.reject(n) - ) - ); - } - pickFile(t, e) { - return new Promise((i, o) => { - var n = document.createElement("input"); - (n.type = "file"), - (n.accept = t), - n.addEventListener("change", (r) => { - var a = n.files[0], - l = new FileReader(), - h = this.validateFile(a); - if (h === !0) { - switch ( - (this.dispatch("import-importing", n.files), - this.dispatchExternal( - "importImporting", - n.files - ), - e || this.table.options.importReader) - ) { - case "buffer": - l.readAsArrayBuffer(a); - break; - case "binary": - l.readAsBinaryString(a); - break; - case "url": - l.readAsDataURL(a); - break; - default: - l.readAsText(a); - } - (l.onload = (d) => { - i(l.result); - }), - (l.onerror = (d) => { - console.warn( - "File Load Error - Unable to read file" - ), - o(d); - }); - } else o(h); - }), - this.dispatch("import-choose"), - this.dispatchExternal("importChoose"), - n.click(); - }); - } - importData(t, e) { - var i; - return ( - this.table.dataLoader.alertLoader(), - new Promise((o, n) => { - setTimeout(() => { - (i = t.call(this.table, e)) instanceof Promise || i - ? o(i) - : n(); - }, 10); - }) - ); - } - structureData(t) { - return Array.isArray(t) && t.length && Array.isArray(t[0]) - ? this.table.options.autoColumns - ? this.structureArrayToObject(t) - : this.structureArrayToColumns(t) - : t; - } - mutateData(t) { - var e = []; - return ( - Array.isArray(t) - ? t.forEach((i) => { - e.push( - this.table.modules.mutator.transformRow( - i, - "import" - ) - ); - }) - : (e = t), - e - ); - } - transformHeader(t) { - var e = []; - return this.table.options.importHeaderTransform - ? (t.forEach((i) => { - e.push( - this.table.options.importHeaderTransform.call( - this.table, - i, - t - ) - ); - }), - e) - : t; - } - transformData(t) { - var e = []; - return this.table.options.importValueTransform - ? (t.forEach((i) => { - e.push( - this.table.options.importValueTransform.call( - this.table, - i, - t - ) - ); - }), - e) - : t; - } - structureArrayToObject(t) { - var e = this.transformHeader(t.shift()); - return t.map((i) => { - var o = {}; - return ( - (i = this.transformData(i)), - e.forEach((n, r) => { - o[n] = i[r]; - }), - o - ); - }); - } - structureArrayToColumns(t) { - var e = [], - i = this.transformHeader(t[0]), - o = this.table.getColumns(); - return ( - o[0] && - i[0] && - o[0].getDefinition().title === i[0] && - t.shift(), - t.forEach((n) => { - var r = {}; - (n = this.transformData(n)).forEach((a, l) => { - var h = o[l]; - h && (r[h.getField()] = a); - }), - e.push(r); - }), - e - ); - } - validateFile(t) { - return ( - !this.table.options.importFileValidator || - this.table.options.importFileValidator.call(this.table, t) - ); - } - validateData(t) { - var e; - return this.table.options.importDataValidator - ? (e = this.table.options.importDataValidator.call( - this.table, - t - )) === !0 - ? t - : Promise.reject(e) - : t; - } - setData(t) { - return ( - this.dispatch("import-imported", t), - this.dispatchExternal("importImported", t), - this.table.dataLoader.clearAlert(), - this.table.setData(t) - ); - } - }; - b(ot, "moduleName", "import"), b(ot, "importers", oi); - let Dt = ot; - var ni = { - navPrev: "shift + 9", - navNext: 9, - navUp: 38, - navDown: 40, - navLeft: 37, - navRight: 39, - scrollPageUp: 33, - scrollPageDown: 34, - scrollToStart: 36, - scrollToEnd: 35, - }, - ri = { - keyBlock: function (s) { - s.stopPropagation(), s.preventDefault(); - }, - scrollPageUp: function (s) { - var t = this.table.rowManager, - e = t.scrollTop - t.element.clientHeight; - s.preventDefault(), - t.displayRowsCount && - (e >= 0 - ? (t.element.scrollTop = e) - : t.scrollToRow(t.getDisplayRows()[0])), - this.table.element.focus(); - }, - scrollPageDown: function (s) { - var t = this.table.rowManager, - e = t.scrollTop + t.element.clientHeight, - i = t.element.scrollHeight; - s.preventDefault(), - t.displayRowsCount && - (e <= i - ? (t.element.scrollTop = e) - : t.scrollToRow( - t.getDisplayRows()[t.displayRowsCount - 1] - )), - this.table.element.focus(); - }, - scrollToStart: function (s) { - var t = this.table.rowManager; - s.preventDefault(), - t.displayRowsCount && - t.scrollToRow(t.getDisplayRows()[0]), - this.table.element.focus(); - }, - scrollToEnd: function (s) { - var t = this.table.rowManager; - s.preventDefault(), - t.displayRowsCount && - t.scrollToRow( - t.getDisplayRows()[t.displayRowsCount - 1] - ), - this.table.element.focus(); - }, - navPrev: function (s) { - this.dispatch("keybinding-nav-prev", s); - }, - navNext: function (s) { - this.dispatch("keybinding-nav-next", s); - }, - navLeft: function (s) { - this.dispatch("keybinding-nav-left", s); - }, - navRight: function (s) { - this.dispatch("keybinding-nav-right", s); - }, - navUp: function (s) { - this.dispatch("keybinding-nav-up", s); - }, - navDown: function (s) { - this.dispatch("keybinding-nav-down", s); - }, - }; - let W = class W extends w { - constructor(t) { - super(t), - (this.watchKeys = null), - (this.pressedKeys = null), - (this.keyupBinding = !1), - (this.keydownBinding = !1), - this.registerTableOption("keybindings", {}), - this.registerTableOption("tabEndNewRow", !1); - } - initialize() { - var t = this.table.options.keybindings, - e = {}; - (this.watchKeys = {}), - (this.pressedKeys = []), - t !== !1 && - (Object.assign(e, W.bindings), - Object.assign(e, t), - this.mapBindings(e), - this.bindEvents()), - this.subscribe( - "table-destroy", - this.clearBindings.bind(this) - ); - } - mapBindings(t) { - for (let e in t) - W.actions[e] - ? t[e] && - (typeof t[e] != "object" && (t[e] = [t[e]]), - t[e].forEach((i) => { - (Array.isArray(i) ? i : [i]).forEach((o) => { - this.mapBinding(e, o); - }); - })) - : console.warn( - "Key Binding Error - no such action:", - e - ); - } - mapBinding(t, e) { - var i = { - action: W.actions[t], - keys: [], - ctrl: !1, - shift: !1, - meta: !1, - }; - e.toString() - .toLowerCase() - .split(" ") - .join("") - .split("+") - .forEach((o) => { - switch (o) { - case "ctrl": - i.ctrl = !0; - break; - case "shift": - i.shift = !0; - break; - case "meta": - i.meta = !0; - break; - default: - (o = isNaN(o) - ? o.toUpperCase().charCodeAt(0) - : parseInt(o)), - i.keys.push(o), - this.watchKeys[o] || - (this.watchKeys[o] = []), - this.watchKeys[o].push(i); - } - }); - } - bindEvents() { - var t = this; - (this.keyupBinding = function (e) { - var i = e.keyCode, - o = t.watchKeys[i]; - o && - (t.pressedKeys.push(i), - o.forEach(function (n) { - t.checkBinding(e, n); - })); - }), - (this.keydownBinding = function (e) { - var i = e.keyCode; - if (t.watchKeys[i]) { - var o = t.pressedKeys.indexOf(i); - o > -1 && t.pressedKeys.splice(o, 1); - } - }), - this.table.element.addEventListener( - "keydown", - this.keyupBinding - ), - this.table.element.addEventListener( - "keyup", - this.keydownBinding - ); - } - clearBindings() { - this.keyupBinding && - this.table.element.removeEventListener( - "keydown", - this.keyupBinding - ), - this.keydownBinding && - this.table.element.removeEventListener( - "keyup", - this.keydownBinding - ); - } - checkBinding(t, e) { - var i = !0; - return ( - t.ctrlKey == e.ctrl && - t.shiftKey == e.shift && - t.metaKey == e.meta && - (e.keys.forEach((o) => { - this.pressedKeys.indexOf(o) == -1 && (i = !1); - }), - i && e.action.call(this, t), - !0) - ); - } - }; - b(W, "moduleName", "keybindings"), - b(W, "bindings", ni), - b(W, "actions", ri); - let zt = W; - var ai = { - delete: function (s, t, e) { - s.delete(); - }, - }, - li = { - insert: function (s, t, e) { - return this.table.addRow(s.getData(), void 0, t), !0; - }, - add: function (s, t, e) { - return this.table.addRow(s.getData()), !0; - }, - update: function (s, t, e) { - return !!t && (t.update(s.getData()), !0); - }, - replace: function (s, t, e) { - return ( - !!t && - (this.table.addRow(s.getData(), void 0, t), - t.delete(), - !0) - ); - }, - }; - let q = class q extends w { - constructor(t) { - super(t), - (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), - this.registerTableOption("movableRows", !1), - this.registerTableOption("movableRowsConnectedTables", !1), - this.registerTableOption( - "movableRowsConnectedElements", - !1 - ), - this.registerTableOption("movableRowsSender", !1), - this.registerTableOption("movableRowsReceiver", "insert"), - this.registerColumnOption("rowHandle"); - } - createPlaceholderElement() { - var t = document.createElement("div"); - return ( - t.classList.add("tabulator-row"), - t.classList.add("tabulator-row-placeholder"), - t - ); - } - initialize() { - this.table.options.movableRows && - ((this.connectionSelectorsTables = - this.table.options.movableRowsConnectedTables), - (this.connectionSelectorsElements = - this.table.options.movableRowsConnectedElements), - (this.connection = - this.connectionSelectorsTables || - this.connectionSelectorsElements), - this.subscribe("cell-init", this.initializeCell.bind(this)), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe("row-init", this.initializeRow.bind(this))); - } - initializeGroupHeader(t) { - var e = this, - i = {}; - (i.mouseup = function (o) { - e.tableRowDrop(o, t); - }.bind(e)), - (i.mousemove = function (o) { - var n; - o.pageY - - x.elOffset(t.element).top + - e.table.rowManager.element.scrollTop > - t.getHeight() / 2 - ? (e.toRow === t && e.toRowAfter) || - ((n = t.getElement()).parentNode.insertBefore( - e.placeholderElement, - n.nextSibling - ), - e.moveRow(t, !0)) - : (e.toRow !== t || e.toRowAfter) && - (n = t.getElement()).previousSibling && - (n.parentNode.insertBefore( - e.placeholderElement, - n - ), - e.moveRow(t, !1)); - }.bind(e)), - (t.modules.moveRow = i); - } - initializeRow(t) { - var e, - i = this, - o = {}; - (o.mouseup = function (n) { - i.tableRowDrop(n, t); - }.bind(i)), - (o.mousemove = function (n) { - var r = t.getElement(); - n.pageY - - x.elOffset(r).top + - i.table.rowManager.element.scrollTop > - t.getHeight() / 2 - ? (i.toRow === t && i.toRowAfter) || - (r.parentNode.insertBefore( - i.placeholderElement, - r.nextSibling - ), - i.moveRow(t, !0)) - : (i.toRow !== t || i.toRowAfter) && - (r.parentNode.insertBefore( - i.placeholderElement, - r - ), - i.moveRow(t, !1)); - }.bind(i)), - this.hasHandle || - ((e = t.getElement()).addEventListener( - "mousedown", - function (n) { - n.which === 1 && - (i.checkTimeout = setTimeout(function () { - i.startMove(n, t); - }, i.checkPeriod)); - } - ), - e.addEventListener("mouseup", function (n) { - n.which === 1 && - i.checkTimeout && - clearTimeout(i.checkTimeout); - }), - this.bindTouchEvents(t, t.getElement())), - (t.modules.moveRow = o); - } - initializeColumn(t) { - t.definition.rowHandle && - this.table.options.movableRows !== !1 && - (this.hasHandle = !0); - } - initializeCell(t) { - if ( - t.column.definition.rowHandle && - this.table.options.movableRows !== !1 - ) { - var e = this, - i = t.getElement(!0); - i.addEventListener("mousedown", function (o) { - o.which === 1 && - (e.checkTimeout = setTimeout(function () { - e.startMove(o, t.row); - }, e.checkPeriod)); - }), - i.addEventListener("mouseup", function (o) { - o.which === 1 && - e.checkTimeout && - clearTimeout(e.checkTimeout); - }), - this.bindTouchEvents(t.row, i); - } - } - bindTouchEvents(t, e) { - var i, - o, - n, - r, - a, - l, - h = !1; - e.addEventListener( - "touchstart", - (d) => { - this.checkTimeout = setTimeout(() => { - (this.touchMove = !0), - (i = t.nextRow()), - (n = i ? i.getHeight() / 2 : 0), - (o = t.prevRow()), - (r = o ? o.getHeight() / 2 : 0), - (a = 0), - (l = 0), - (h = !1), - this.startMove(d, t); - }, this.checkPeriod); - }, - { passive: !0 } - ), - this.moving, - this.toRow, - this.toRowAfter, - e.addEventListener("touchmove", (d) => { - var c, u; - this.moving && - (d.preventDefault(), - this.moveHover(d), - h || (h = d.touches[0].pageY), - (c = d.touches[0].pageY - h) > 0 - ? i && - c - a > n && - (u = i) !== t && - ((h = d.touches[0].pageY), - u - .getElement() - .parentNode.insertBefore( - this.placeholderElement, - u.getElement().nextSibling - ), - this.moveRow(u, !0)) - : o && - -c - l > r && - (u = o) !== t && - ((h = d.touches[0].pageY), - u - .getElement() - .parentNode.insertBefore( - this.placeholderElement, - u.getElement() - ), - this.moveRow(u, !1)), - u && - ((i = u.nextRow()), - (a = n), - (n = i ? i.getHeight() / 2 : 0), - (o = u.prevRow()), - (l = r), - (r = o ? o.getHeight() / 2 : 0))); - }), - e.addEventListener("touchend", (d) => { - this.checkTimeout && clearTimeout(this.checkTimeout), - this.moving && - (this.endMove(d), (this.touchMove = !1)); - }); - } - _bindMouseMove() { - this.table.rowManager.getDisplayRows().forEach((t) => { - (t.type === "row" || t.type === "group") && - t.modules.moveRow && - t.modules.moveRow.mousemove && - t - .getElement() - .addEventListener( - "mousemove", - t.modules.moveRow.mousemove - ); - }); - } - _unbindMouseMove() { - this.table.rowManager.getDisplayRows().forEach((t) => { - (t.type === "row" || t.type === "group") && - t.modules.moveRow && - t.modules.moveRow.mousemove && - t - .getElement() - .removeEventListener( - "mousemove", - t.modules.moveRow.mousemove - ); - }); - } - startMove(t, e) { - var i = e.getElement(); - this.setStartPosition(t, e), - (this.moving = e), - this.table.element.classList.add("tabulator-block-select"), - (this.placeholderElement.style.width = e.getWidth() + "px"), - (this.placeholderElement.style.height = - e.getHeight() + "px"), - this.connection - ? (this.table.element.classList.add( - "tabulator-movingrow-sending" - ), - this.connectToTables(e)) - : (i.parentNode.insertBefore( - this.placeholderElement, - i - ), - i.parentNode.removeChild(i)), - (this.hoverElement = i.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.dispatchExternal("rowMoving", e.getComponent()), - this.moveHover(t); - } - setStartPosition(t, e) { - var i, - o, - n = this.touchMove ? t.touches[0].pageX : t.pageX, - r = this.touchMove ? t.touches[0].pageY : t.pageY; - (i = e.getElement()), - this.connection - ? ((o = i.getBoundingClientRect()), - (this.startX = o.left - n + window.pageXOffset), - (this.startY = o.top - r + window.pageYOffset)) - : (this.startY = r - i.getBoundingClientRect().top); - } - endMove(t) { - (t && t.which !== 1 && !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.dispatchExternal( - "rowMoveCancelled", - this.moving.getComponent() - ), - (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())); - } - moveRow(t, e) { - (this.toRow = t), (this.toRowAfter = e); - } - moveHover(t) { - this.connection - ? this.moveHoverConnections.call(this, t) - : this.moveHoverTable.call(this, t); - } - moveHoverTable(t) { - var e = this.table.rowManager.getElement(), - i = e.scrollTop, - o = - (this.touchMove ? t.touches[0].pageY : t.pageY) - - e.getBoundingClientRect().top + - i; - this.hoverElement.style.top = - Math.min( - o - this.startY, - this.table.rowManager.element.scrollHeight - - this.hoverElement.offsetHeight - ) + "px"; - } - moveHoverConnections(t) { - (this.hoverElement.style.left = - this.startX + - (this.touchMove ? t.touches[0].pageX : t.pageX) + - "px"), - (this.hoverElement.style.top = - this.startY + - (this.touchMove ? t.touches[0].pageY : t.pageY) + - "px"); - } - elementRowDrop(t, e, i) { - this.dispatchExternal( - "movableRowsElementDrop", - t, - e, - !!i && i.getComponent() - ); - } - connectToTables(t) { - var e; - this.connectionSelectorsTables && - ((e = this.commsConnections( - this.connectionSelectorsTables - )), - this.dispatchExternal("movableRowsSendingStart", e), - this.commsSend( - this.connectionSelectorsTables, - "moveRow", - "connect", - { row: t } - )), - this.connectionSelectorsElements && - ((this.connectionElements = []), - Array.isArray(this.connectionSelectorsElements) || - (this.connectionSelectorsElements = [ - this.connectionSelectorsElements, - ]), - this.connectionSelectorsElements.forEach((i) => { - typeof i == "string" - ? (this.connectionElements = - this.connectionElements.concat( - Array.prototype.slice.call( - document.querySelectorAll(i) - ) - )) - : this.connectionElements.push(i); - }), - this.connectionElements.forEach((i) => { - var o = (n) => { - this.elementRowDrop(n, i, this.moving); - }; - i.addEventListener("mouseup", o), - (i.tabulatorElementDropEvent = o), - i.classList.add( - "tabulator-movingrow-receiving" - ); - })); - } - disconnectFromTables() { - var t; - this.connectionSelectorsTables && - ((t = this.commsConnections( - this.connectionSelectorsTables - )), - this.dispatchExternal("movableRowsSendingStop", t), - this.commsSend( - this.connectionSelectorsTables, - "moveRow", - "disconnect" - )), - this.connectionElements.forEach((e) => { - e.classList.remove("tabulator-movingrow-receiving"), - e.removeEventListener( - "mouseup", - e.tabulatorElementDropEvent - ), - delete e.tabulatorElementDropEvent; - }); - } - connect(t, e) { - return this.connectedTable - ? (console.warn( - "Move Row Error - Table cannot accept connection, already connected to table:", - this.connectedTable - ), - !1) - : ((this.connectedTable = t), - (this.connectedRow = e), - this.table.element.classList.add( - "tabulator-movingrow-receiving" - ), - this.table.rowManager.getDisplayRows().forEach((i) => { - i.type === "row" && - i.modules.moveRow && - i.modules.moveRow.mouseup && - i - .getElement() - .addEventListener( - "mouseup", - i.modules.moveRow.mouseup - ); - }), - (this.tableRowDropEvent = this.tableRowDrop.bind(this)), - this.table.element.addEventListener( - "mouseup", - this.tableRowDropEvent - ), - this.dispatchExternal("movableRowsReceivingStart", e, t), - !0); - } - disconnect(t) { - t === this.connectedTable - ? ((this.connectedTable = !1), - (this.connectedRow = !1), - this.table.element.classList.remove( - "tabulator-movingrow-receiving" - ), - this.table.rowManager.getDisplayRows().forEach((e) => { - e.type === "row" && - e.modules.moveRow && - e.modules.moveRow.mouseup && - e - .getElement() - .removeEventListener( - "mouseup", - e.modules.moveRow.mouseup - ); - }), - this.table.element.removeEventListener( - "mouseup", - this.tableRowDropEvent - ), - this.dispatchExternal("movableRowsReceivingStop", t)) - : console.warn( - "Move Row Error - trying to disconnect from non connected table" - ); - } - dropComplete(t, e, i) { - var o = !1; - if (i) { - switch (typeof this.table.options.movableRowsSender) { - case "string": - o = q.senders[this.table.options.movableRowsSender]; - break; - case "function": - o = this.table.options.movableRowsSender; - } - o - ? o.call( - this, - this.moving ? this.moving.getComponent() : void 0, - e ? e.getComponent() : void 0, - t - ) - : this.table.options.movableRowsSender && - console.warn( - "Mover Row Error - no matching sender found:", - this.table.options.movableRowsSender - ), - this.dispatchExternal( - "movableRowsSent", - this.moving.getComponent(), - e ? e.getComponent() : void 0, - t - ); - } else - this.dispatchExternal( - "movableRowsSentFailed", - this.moving.getComponent(), - e ? e.getComponent() : void 0, - t - ); - this.endMove(); - } - tableRowDrop(t, e) { - var i = !1, - o = !1; - switch ( - (t.stopImmediatePropagation(), - typeof this.table.options.movableRowsReceiver) - ) { - case "string": - i = q.receivers[this.table.options.movableRowsReceiver]; - break; - case "function": - i = this.table.options.movableRowsReceiver; - } - i - ? (o = i.call( - this, - this.connectedRow.getComponent(), - e ? e.getComponent() : void 0, - this.connectedTable - )) - : console.warn( - "Mover Row Error - no matching receiver found:", - this.table.options.movableRowsReceiver - ), - o - ? this.dispatchExternal( - "movableRowsReceived", - this.connectedRow.getComponent(), - e ? e.getComponent() : void 0, - this.connectedTable - ) - : this.dispatchExternal( - "movableRowsReceivedFailed", - this.connectedRow.getComponent(), - e ? e.getComponent() : void 0, - this.connectedTable - ), - this.commsSend( - this.connectedTable, - "moveRow", - "dropcomplete", - { row: e, success: o } - ); - } - commsReceived(t, e, i) { - switch (e) { - case "connect": - return this.connect(t, i.row); - case "disconnect": - return this.disconnect(t); - case "dropcomplete": - return this.dropComplete(t, i.row, i.success); - } - } - }; - b(q, "moduleName", "moveRow"), - b(q, "senders", ai), - b(q, "receivers", li); - let Pt = q; - var hi = {}; - let $ = class $ extends w { - constructor(t) { - super(t), - (this.allowedTypes = [ - "", - "data", - "edit", - "clipboard", - "import", - ]), - (this.enabled = !0), - this.registerColumnOption("mutator"), - this.registerColumnOption("mutatorParams"), - this.registerColumnOption("mutatorData"), - this.registerColumnOption("mutatorDataParams"), - this.registerColumnOption("mutatorEdit"), - this.registerColumnOption("mutatorEditParams"), - this.registerColumnOption("mutatorClipboard"), - this.registerColumnOption("mutatorClipboardParams"), - this.registerColumnOption("mutatorImport"), - this.registerColumnOption("mutatorImportParams"), - this.registerColumnOption("mutateLink"); - } - initialize() { - this.subscribe( - "cell-value-changing", - this.transformCell.bind(this) - ), - this.subscribe( - "cell-value-changed", - this.mutateLink.bind(this) - ), - this.subscribe( - "column-layout", - this.initializeColumn.bind(this) - ), - this.subscribe( - "row-data-init-before", - this.rowDataChanged.bind(this) - ), - this.subscribe( - "row-data-changing", - this.rowDataChanged.bind(this) - ); - } - rowDataChanged(t, e, i) { - return this.transformRow(e, "data", i); - } - initializeColumn(t) { - var e = !1, - i = {}; - this.allowedTypes.forEach((o) => { - var n, - r = - "mutator" + - (o.charAt(0).toUpperCase() + o.slice(1)); - t.definition[r] && - (n = this.lookupMutator(t.definition[r])) && - ((e = !0), - (i[r] = { - mutator: n, - params: t.definition[r + "Params"] || {}, - })); - }), - e && (t.modules.mutate = i); - } - lookupMutator(t) { - var e = !1; - switch (typeof t) { - case "string": - $.mutators[t] - ? (e = $.mutators[t]) - : console.warn( - "Mutator Error - No such mutator found, ignoring: ", - t - ); - break; - case "function": - e = t; - } - return e; - } - transformRow(t, e, i) { - var o, - n = "mutator" + (e.charAt(0).toUpperCase() + e.slice(1)); - return ( - this.enabled && - this.table.columnManager.traverse((r) => { - var a, l, h; - r.modules.mutate && - (a = - r.modules.mutate[n] || - r.modules.mutate.mutator || - !1) && - ((o = r.getFieldValue(i !== void 0 ? i : t)), - ((e == "data" && !i) || o !== void 0) && - ((h = r.getComponent()), - (l = - typeof a.params == "function" - ? a.params(o, t, e, h) - : a.params), - r.setFieldValue( - t, - a.mutator(o, t, e, l, h) - ))); - }), - t - ); - } - transformCell(t, e) { - if (t.column.modules.mutate) { - var i = - t.column.modules.mutate.mutatorEdit || - t.column.modules.mutate.mutator || - !1, - o = {}; - if (i) - return ( - (o = Object.assign(o, t.row.getData())), - t.column.setFieldValue(o, e), - i.mutator(e, o, "edit", i.params, t.getComponent()) - ); - } - return e; - } - mutateLink(t) { - var e = t.column.definition.mutateLink; - e && - (Array.isArray(e) || (e = [e]), - e.forEach((i) => { - var o = t.row.getCell(i); - o && o.setValue(o.getValue(), !0, !0); - })); - } - enable() { - this.enabled = !0; - } - disable() { - this.enabled = !1; - } - }; - b($, "moduleName", "mutator"), b($, "mutators", hi); - let Ft = $; - var di = { - rows: function (s, t, e, i, o) { - var n = document.createElement("span"), - r = document.createElement("span"), - a = document.createElement("span"), - l = document.createElement("span"), - h = document.createElement("span"), - d = document.createElement("span"); - return ( - this.table.modules.localize.langBind( - "pagination|counter|showing", - (c) => { - r.innerHTML = c; - } - ), - this.table.modules.localize.langBind( - "pagination|counter|of", - (c) => { - l.innerHTML = c; - } - ), - this.table.modules.localize.langBind( - "pagination|counter|rows", - (c) => { - d.innerHTML = c; - } - ), - i - ? ((a.innerHTML = - " " + t + "-" + Math.min(t + s - 1, i) + " "), - (h.innerHTML = " " + i + " "), - n.appendChild(r), - n.appendChild(a), - n.appendChild(l), - n.appendChild(h), - n.appendChild(d)) - : ((a.innerHTML = " 0 "), - n.appendChild(r), - n.appendChild(a), - n.appendChild(d)), - n - ); - }, - pages: function (s, t, e, i, o) { - var n = document.createElement("span"), - r = document.createElement("span"), - a = document.createElement("span"), - l = document.createElement("span"), - h = document.createElement("span"), - d = document.createElement("span"); - return ( - this.table.modules.localize.langBind( - "pagination|counter|showing", - (c) => { - r.innerHTML = c; - } - ), - (a.innerHTML = " " + e + " "), - this.table.modules.localize.langBind( - "pagination|counter|of", - (c) => { - l.innerHTML = c; - } - ), - (h.innerHTML = " " + o + " "), - this.table.modules.localize.langBind( - "pagination|counter|pages", - (c) => { - d.innerHTML = c; - } - ), - n.appendChild(r), - n.appendChild(a), - n.appendChild(l), - n.appendChild(h), - n.appendChild(d), - n - ); - }, - }; - let nt = class nt extends w { - constructor(t) { - super(t), - (this.mode = "local"), - (this.progressiveLoad = !1), - (this.element = null), - (this.pageCounterElement = null), - (this.pageCounter = null), - (this.size = 0), - (this.page = 1), - (this.count = 5), - (this.max = 1), - (this.remoteRowCountEstimate = null), - (this.initialLoad = !0), - (this.dataChanging = !1), - (this.pageSizes = []), - this.registerTableOption("pagination", !1), - this.registerTableOption("paginationMode", "local"), - this.registerTableOption("paginationSize", !1), - this.registerTableOption("paginationInitialPage", 1), - this.registerTableOption("paginationCounter", !1), - this.registerTableOption("paginationCounterElement", !1), - this.registerTableOption("paginationButtonCount", 5), - this.registerTableOption("paginationSizeSelector", !1), - this.registerTableOption("paginationElement", !1), - this.registerTableOption("paginationAddRow", "page"), - this.registerTableOption("paginationOutOfRange", !1), - this.registerTableOption("progressiveLoad", !1), - this.registerTableOption("progressiveLoadDelay", 0), - this.registerTableOption("progressiveLoadScrollMargin", 0), - this.registerTableFunction( - "setMaxPage", - this.setMaxPage.bind(this) - ), - this.registerTableFunction( - "setPage", - this.setPage.bind(this) - ), - this.registerTableFunction( - "setPageToRow", - this.userSetPageToRow.bind(this) - ), - this.registerTableFunction( - "setPageSize", - this.userSetPageSize.bind(this) - ), - this.registerTableFunction( - "getPageSize", - this.getPageSize.bind(this) - ), - this.registerTableFunction( - "previousPage", - this.previousPage.bind(this) - ), - this.registerTableFunction( - "nextPage", - this.nextPage.bind(this) - ), - this.registerTableFunction( - "getPage", - this.getPage.bind(this) - ), - this.registerTableFunction( - "getPageMax", - this.getPageMax.bind(this) - ), - this.registerComponentFunction( - "row", - "pageTo", - this.setPageToRow.bind(this) - ); - } - initialize() { - this.table.options.pagination - ? (this.subscribe( - "row-deleted", - this.rowsUpdated.bind(this) - ), - this.subscribe("row-added", this.rowsUpdated.bind(this)), - this.subscribe( - "data-processed", - this.initialLoadComplete.bind(this) - ), - this.subscribe( - "table-built", - this.calculatePageSizes.bind(this) - ), - this.subscribe( - "footer-redraw", - this.footerRedraw.bind(this) - ), - this.table.options.paginationAddRow == "page" && - this.subscribe( - "row-adding-position", - this.rowAddingPosition.bind(this) - ), - this.table.options.paginationMode === "remote" && - (this.subscribe( - "data-params", - this.remotePageParams.bind(this) - ), - this.subscribe( - "data-loaded", - this._parseRemoteData.bind(this) - )), - this.table.options.progressiveLoad && - console.error( - "Progressive Load Error - Pagination and progressive load cannot be used at the same time" - ), - this.registerDisplayHandler( - this.restOnRenderBefore.bind(this), - 40 - ), - this.registerDisplayHandler(this.getRows.bind(this), 50), - this.createElements(), - this.initializePageCounter(), - this.initializePaginator()) - : this.table.options.progressiveLoad && - (this.subscribe( - "data-params", - this.remotePageParams.bind(this) - ), - this.subscribe( - "data-loaded", - this._parseRemoteData.bind(this) - ), - this.subscribe( - "table-built", - this.calculatePageSizes.bind(this) - ), - this.subscribe( - "data-processed", - this.initialLoadComplete.bind(this) - ), - this.initializeProgressive( - this.table.options.progressiveLoad - ), - this.table.options.progressiveLoad === "scroll" && - this.subscribe( - "scroll-vertical", - this.scrollVertical.bind(this) - )); - } - rowAddingPosition(t, e) { - var i, - o = this.table.rowManager, - n = o.getDisplayRows(); - return ( - e - ? n.length - ? (i = n[0]) - : o.activeRows.length && - ((i = o.activeRows[o.activeRows.length - 1]), - (e = !1)) - : n.length && - ((i = n[n.length - 1]), - (e = !(n.length < this.size))), - { index: i, top: e } - ); - } - calculatePageSizes() { - var t, e; - this.table.options.paginationSize - ? (this.size = this.table.options.paginationSize) - : ((t = document.createElement("div")).classList.add( - "tabulator-row" - ), - (t.style.visibility = "hidden"), - (e = document.createElement("div")).classList.add( - "tabulator-cell" - ), - (e.innerHTML = "Page Row Test"), - t.appendChild(e), - this.table.rowManager.getTableElement().appendChild(t), - (this.size = Math.floor( - this.table.rowManager.getElement().clientHeight / - t.offsetHeight - )), - this.table.rowManager.getTableElement().removeChild(t)), - this.dispatchExternal("pageSizeChanged", this.size), - this.generatePageSizeSelectList(); - } - initialLoadComplete() { - this.initialLoad = !1; - } - remotePageParams(t, e, i, o) { - return ( - this.initialLoad || - (((this.progressiveLoad && !i) || - (!this.progressiveLoad && !this.dataChanging)) && - this.reset(!0)), - (o.page = this.page), - this.size && (o.size = this.size), - o - ); - } - userSetPageToRow(t) { - return this.table.options.pagination && - (t = this.table.rowManager.findRow(t)) - ? this.setPageToRow(t) - : Promise.reject(); - } - userSetPageSize(t) { - return ( - !!this.table.options.pagination && - (this.setPageSize(t), this.setPage(1)) - ); - } - scrollVertical(t, e) { - var i; - e || - this.table.dataLoader.loading || - ((i = this.table.rowManager.getElement()).scrollHeight - - i.clientHeight - - t < - (this.table.options.progressiveLoadScrollMargin || - 2 * i.clientHeight) && - this.nextPage().catch(() => {})); - } - restOnRenderBefore(t, e) { - return e || (this.mode === "local" && this.reset()), t; - } - rowsUpdated() { - this.refreshData(!0, "all"); - } - createElements() { - var t; - (this.element = document.createElement("span")), - this.element.classList.add("tabulator-paginator"), - (this.pagesElement = document.createElement("span")), - this.pagesElement.classList.add("tabulator-pages"), - (t = document.createElement("button")).classList.add( - "tabulator-page" - ), - t.setAttribute("type", "button"), - t.setAttribute("role", "button"), - t.setAttribute("aria-label", ""), - t.setAttribute("title", ""), - (this.firstBut = t.cloneNode(!0)), - this.firstBut.setAttribute("data-page", "first"), - (this.prevBut = t.cloneNode(!0)), - this.prevBut.setAttribute("data-page", "prev"), - (this.nextBut = t.cloneNode(!0)), - this.nextBut.setAttribute("data-page", "next"), - (this.lastBut = t.cloneNode(!0)), - this.lastBut.setAttribute("data-page", "last"), - this.table.options.paginationSizeSelector && - ((this.pageSizeSelect = - document.createElement("select")), - this.pageSizeSelect.classList.add( - "tabulator-page-size" - )); - } - generatePageSizeSelectList() { - var t = []; - if (this.pageSizeSelect) { - if ( - Array.isArray(this.table.options.paginationSizeSelector) - ) - (t = this.table.options.paginationSizeSelector), - (this.pageSizes = t), - this.pageSizes.indexOf(this.size) == -1 && - t.unshift(this.size); - else if (this.pageSizes.indexOf(this.size) == -1) { - t = []; - for (let e = 1; e < 5; e++) t.push(this.size * e); - this.pageSizes = t; - } else t = this.pageSizes; - for (; this.pageSizeSelect.firstChild; ) - this.pageSizeSelect.removeChild( - this.pageSizeSelect.firstChild - ); - t.forEach((e) => { - var i = document.createElement("option"); - (i.value = e), - e === !0 - ? this.langBind("pagination|all", function (o) { - i.innerHTML = o; - }) - : (i.innerHTML = e), - this.pageSizeSelect.appendChild(i); - }), - (this.pageSizeSelect.value = this.size); - } - } - initializePageCounter() { - var t = this.table.options.paginationCounter, - e = null; - t && - ((e = typeof t == "function" ? t : nt.pageCounters[t]) - ? ((this.pageCounter = e), - (this.pageCounterElement = - document.createElement("span")), - this.pageCounterElement.classList.add( - "tabulator-page-counter" - )) - : console.warn( - "Pagination Error - No such page counter found: ", - t - )); - } - initializePaginator(t) { - var e, i; - t || - (this.langBind("pagination|first", (o) => { - this.firstBut.innerHTML = o; - }), - this.langBind("pagination|first_title", (o) => { - this.firstBut.setAttribute("aria-label", o), - this.firstBut.setAttribute("title", o); - }), - this.langBind("pagination|prev", (o) => { - this.prevBut.innerHTML = o; - }), - this.langBind("pagination|prev_title", (o) => { - this.prevBut.setAttribute("aria-label", o), - this.prevBut.setAttribute("title", o); - }), - this.langBind("pagination|next", (o) => { - this.nextBut.innerHTML = o; - }), - this.langBind("pagination|next_title", (o) => { - this.nextBut.setAttribute("aria-label", o), - this.nextBut.setAttribute("title", o); - }), - this.langBind("pagination|last", (o) => { - this.lastBut.innerHTML = o; - }), - this.langBind("pagination|last_title", (o) => { - this.lastBut.setAttribute("aria-label", o), - this.lastBut.setAttribute("title", o); - }), - this.firstBut.addEventListener("click", () => { - this.setPage(1); - }), - this.prevBut.addEventListener("click", () => { - this.previousPage(); - }), - this.nextBut.addEventListener("click", () => { - this.nextPage(); - }), - this.lastBut.addEventListener("click", () => { - this.setPage(this.max); - }), - this.table.options.paginationElement && - (this.element = this.table.options.paginationElement), - this.pageSizeSelect && - ((e = document.createElement("label")), - this.langBind("pagination|page_size", (o) => { - this.pageSizeSelect.setAttribute("aria-label", o), - this.pageSizeSelect.setAttribute("title", o), - (e.innerHTML = o); - }), - this.element.appendChild(e), - this.element.appendChild(this.pageSizeSelect), - this.pageSizeSelect.addEventListener("change", (o) => { - this.setPageSize( - this.pageSizeSelect.value == "true" || - this.pageSizeSelect.value - ), - this.setPage(1); - })), - this.element.appendChild(this.firstBut), - this.element.appendChild(this.prevBut), - this.element.appendChild(this.pagesElement), - this.element.appendChild(this.nextBut), - this.element.appendChild(this.lastBut), - this.table.options.paginationElement || - (this.table.options.paginationCounter && - (this.table.options.paginationCounterElement - ? this.table.options - .paginationCounterElement instanceof - HTMLElement - ? this.table.options.paginationCounterElement.appendChild( - this.pageCounterElement - ) - : typeof this.table.options - .paginationCounterElement == - "string" && - ((i = document.querySelector( - this.table.options - .paginationCounterElement - )) - ? i.appendChild( - this.pageCounterElement - ) - : console.warn( - "Pagination Error - Unable to find element matching paginationCounterElement selector:", - this.table.options - .paginationCounterElement - )) - : this.footerAppend(this.pageCounterElement)), - this.footerAppend(this.element)), - (this.page = this.table.options.paginationInitialPage), - (this.count = this.table.options.paginationButtonCount)), - (this.mode = this.table.options.paginationMode); - } - initializeProgressive(t) { - this.initializePaginator(!0), - (this.mode = "progressive_" + t), - (this.progressiveLoad = !0); - } - trackChanges() { - this.dispatch("page-changed"); - } - setMaxRows(t) { - (this.max = t - ? this.size === !0 - ? 1 - : Math.ceil(t / this.size) - : 1), - this.page > this.max && (this.page = this.max); - } - reset(t) { - this.initialLoad || - ((this.mode == "local" || t) && - ((this.page = 1), this.trackChanges())); - } - setMaxPage(t) { - (t = parseInt(t)), - (this.max = t || 1), - this.page > this.max && - ((this.page = this.max), this.trigger()); - } - setPage(t) { - switch (t) { - case "first": - return this.setPage(1); - case "prev": - return this.previousPage(); - case "next": - return this.nextPage(); - case "last": - return this.setPage(this.max); - } - return ((t = parseInt(t)) > 0 && t <= this.max) || - this.mode !== "local" - ? ((this.page = t), this.trackChanges(), this.trigger()) - : (console.warn( - "Pagination Error - Requested page is out of range of 1 - " + - this.max + - ":", - t - ), - Promise.reject()); - } - setPageToRow(t) { - var e = this.displayRows(-1).indexOf(t); - if (e > -1) { - var i = - this.size === !0 ? 1 : Math.ceil((e + 1) / this.size); - return this.setPage(i); - } - return ( - console.warn( - "Pagination Error - Requested row is not visible" - ), - Promise.reject() - ); - } - setPageSize(t) { - t !== !0 && (t = parseInt(t)), - t > 0 && - ((this.size = t), - this.dispatchExternal("pageSizeChanged", t)), - this.pageSizeSelect && this.generatePageSizeSelectList(), - this.trackChanges(); - } - _setPageCounter(t, e, i) { - var o; - if (this.pageCounter) - switch ( - (this.mode === "remote" && - ((e = this.size), - (i = (this.page - 1) * this.size + 1), - (t = this.remoteRowCountEstimate)), - typeof (o = this.pageCounter.call( - this, - e, - i, - this.page, - t, - this.max - ))) - ) { - case "object": - if (o instanceof Node) { - for (; this.pageCounterElement.firstChild; ) - this.pageCounterElement.removeChild( - this.pageCounterElement.firstChild - ); - this.pageCounterElement.appendChild(o); - } else - (this.pageCounterElement.innerHTML = ""), - o != null && - console.warn( - "Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:", - o - ); - break; - case "undefined": - this.pageCounterElement.innerHTML = ""; - break; - default: - this.pageCounterElement.innerHTML = o; - } - } - _setPageButtons() { - let t = Math.floor((this.count - 1) / 2), - e = Math.ceil((this.count - 1) / 2), - i = - this.max - this.page + t + 1 < this.count - ? this.max - this.count + 1 - : Math.max(this.page - t, 1), - o = - this.page <= e - ? Math.min(this.count, this.max) - : Math.min(this.page + e, this.max); - for (; this.pagesElement.firstChild; ) - this.pagesElement.removeChild(this.pagesElement.firstChild); - this.page == 1 - ? ((this.firstBut.disabled = !0), - (this.prevBut.disabled = !0)) - : ((this.firstBut.disabled = !1), - (this.prevBut.disabled = !1)), - this.page == this.max - ? ((this.lastBut.disabled = !0), - (this.nextBut.disabled = !0)) - : ((this.lastBut.disabled = !1), - (this.nextBut.disabled = !1)); - for (let n = i; n <= o; n++) - n > 0 && - n <= this.max && - this.pagesElement.appendChild( - this._generatePageButton(n) - ); - this.footerRedraw(); - } - _generatePageButton(t) { - var e = document.createElement("button"); - return ( - e.classList.add("tabulator-page"), - t == this.page && e.classList.add("active"), - e.setAttribute("type", "button"), - e.setAttribute("role", "button"), - this.langBind("pagination|page_title", (i) => { - e.setAttribute("aria-label", i + " " + t), - e.setAttribute("title", i + " " + t); - }), - e.setAttribute("data-page", t), - (e.textContent = t), - e.addEventListener("click", (i) => { - this.setPage(t); - }), - e - ); - } - previousPage() { - return this.page > 1 - ? (this.page--, this.trackChanges(), this.trigger()) - : (console.warn( - "Pagination Error - Previous page would be less than page 1:", - 0 - ), - Promise.reject()); - } - nextPage() { - return this.page < this.max - ? (this.page++, this.trackChanges(), this.trigger()) - : (this.progressiveLoad || - console.warn( - "Pagination Error - Next page would be greater than maximum page of " + - this.max + - ":", - this.max + 1 - ), - Promise.reject()); - } - getPage() { - return this.page; - } - getPageMax() { - return this.max; - } - getPageSize(t) { - return this.size; - } - getMode() { - return this.mode; - } - getRows(t) { - var e, - i, - o, - n, - r = 0, - a = t.filter((l) => l.type === "row"); - if (this.mode == "local") { - (e = []), - this.setMaxRows(t.length), - this.size === !0 - ? ((i = 0), (o = t.length)) - : (o = - (i = this.size * (this.page - 1)) + - parseInt(this.size)), - this._setPageButtons(); - for (let l = i; l < o; l++) { - let h = t[l]; - h && - (e.push(h), - h.type === "row" && (n || (n = h), r++)); - } - return ( - this._setPageCounter( - a.length, - r, - n ? a.indexOf(n) + 1 : 0 - ), - e - ); - } - return ( - this._setPageButtons(), - this._setPageCounter(a.length), - t.slice(0) - ); - } - trigger() { - var t; - switch (this.mode) { - case "local": - return ( - (t = this.table.rowManager.scrollLeft), - this.refreshData(), - this.table.rowManager.scrollHorizontal(t), - this.dispatchExternal("pageLoaded", this.getPage()), - Promise.resolve() - ); - case "remote": - return ( - (this.dataChanging = !0), - this.reloadData(null).finally(() => { - this.dataChanging = !1; - }) - ); - case "progressive_load": - case "progressive_scroll": - return this.reloadData(null, !0); - default: - return ( - console.warn( - "Pagination Error - no such pagination mode:", - this.mode - ), - Promise.reject() - ); - } - } - _parseRemoteData(t) { - var e, i; - if ( - (t.last_page === void 0 && - console.warn( - "Remote Pagination Error - Server response missing '" + - (this.options("dataReceiveParams").last_page || - "last_page") + - "' property" - ), - t.data) - ) { - if ( - ((this.max = parseInt(t.last_page) || 1), - (this.remoteRowCountEstimate = - t.last_row !== void 0 - ? t.last_row - : t.last_page * this.size - - (this.page == t.last_page - ? this.size - t.data.length - : 0)), - this.progressiveLoad) - ) { - switch (this.mode) { - case "progressive_load": - this.page == 1 - ? this.table.rowManager.setData( - t.data, - !1, - this.page == 1 - ) - : this.table.rowManager.addRows(t.data), - this.page < this.max && - setTimeout(() => { - this.nextPage(); - }, this.table.options.progressiveLoadDelay); - break; - case "progressive_scroll": - (t = - this.page === 1 - ? t.data - : this.table.rowManager - .getData() - .concat(t.data)), - this.table.rowManager.setData( - t, - this.page !== 1, - this.page == 1 - ), - (e = - this.table.options - .progressiveLoadScrollMargin || - 2 * - this.table.rowManager.element - .clientHeight), - this.table.rowManager.element - .scrollHeight <= - this.table.rowManager.element - .clientHeight + - e && - this.page < this.max && - setTimeout(() => { - this.nextPage(); - }); - } - return !1; - } - if ( - this.page > this.max && - (console.warn( - "Remote Pagination Error - Server returned last page value lower than the current page" - ), - (i = this.options("paginationOutOfRange"))) - ) - return this.setPage( - typeof i == "function" - ? i.call(this, this.page, this.max) - : i - ); - this.dispatchExternal("pageLoaded", this.getPage()); - } else - console.warn( - "Remote Pagination Error - Server response missing '" + - (this.options("dataReceiveParams").data || "data") + - "' property" - ); - return t.data; - } - footerRedraw() { - var t = this.table.footerManager.containerElement; - Math.ceil(t.clientWidth) - t.scrollWidth < 0 - ? (this.pagesElement.style.display = "none") - : ((this.pagesElement.style.display = ""), - Math.ceil(t.clientWidth) - t.scrollWidth < 0 && - (this.pagesElement.style.display = "none")); - } - }; - b(nt, "moduleName", "page"), b(nt, "pageCounters", di); - let Ht = nt; - var ci = { - local: function (s, t) { - var e = localStorage.getItem(s + "-" + t); - return !!e && JSON.parse(e); - }, - cookie: function (s, t) { - var e, - i, - o = document.cookie, - n = s + "-" + t, - r = o.indexOf(n + "="); - return ( - r > -1 && - ((e = (o = o.slice(r)).indexOf(";")) > -1 && - (o = o.slice(0, e)), - (i = o.replace(n + "=", ""))), - !!i && JSON.parse(i) - ); - }, - }, - ui = { - local: function (s, t, e) { - localStorage.setItem(s + "-" + t, JSON.stringify(e)); - }, - cookie: function (s, t, e) { - var i = new Date(); - i.setDate(i.getDate() + 1e4), - (document.cookie = - s + - "-" + - t + - "=" + - JSON.stringify(e) + - "; expires=" + - i.toUTCString()); - }, - }; - let S = class S extends w { - constructor(t) { - super(t), - (this.mode = ""), - (this.id = ""), - (this.defWatcherBlock = !1), - (this.config = {}), - (this.readFunc = !1), - (this.writeFunc = !1), - this.registerTableOption("persistence", !1), - this.registerTableOption("persistenceID", ""), - this.registerTableOption("persistenceMode", !0), - this.registerTableOption("persistenceReaderFunc", !1), - this.registerTableOption("persistenceWriterFunc", !1); - } - localStorageTest() { - var t = "_tabulator_test"; - try { - return ( - window.localStorage.setItem(t, t), - window.localStorage.removeItem(t), - !0 - ); - } catch { - return !1; - } - } - initialize() { - if (this.table.options.persistence) { - var t, - e = this.table.options.persistenceMode, - i = this.table.options.persistenceID; - (this.mode = - e !== !0 - ? e - : this.localStorageTest() - ? "local" - : "cookie"), - this.table.options.persistenceReaderFunc - ? typeof this.table.options.persistenceReaderFunc == - "function" - ? (this.readFunc = - this.table.options.persistenceReaderFunc) - : S.readers[ - this.table.options.persistenceReaderFunc - ] - ? (this.readFunc = - S.readers[ - this.table.options.persistenceReaderFunc - ]) - : console.warn( - "Persistence Read Error - invalid reader set", - this.table.options.persistenceReaderFunc - ) - : S.readers[this.mode] - ? (this.readFunc = S.readers[this.mode]) - : console.warn( - "Persistence Read Error - invalid reader set", - this.mode - ), - this.table.options.persistenceWriterFunc - ? typeof this.table.options.persistenceWriterFunc == - "function" - ? (this.writeFunc = - this.table.options.persistenceWriterFunc) - : S.writers[ - this.table.options.persistenceWriterFunc - ] - ? (this.writeFunc = - S.writers[ - this.table.options.persistenceWriterFunc - ]) - : console.warn( - "Persistence Write Error - invalid reader set", - this.table.options.persistenceWriterFunc - ) - : S.writers[this.mode] - ? (this.writeFunc = S.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: - this.table.options.persistence === !0 || - this.table.options.persistence.sort, - filter: - this.table.options.persistence === !0 || - this.table.options.persistence.filter, - headerFilter: - this.table.options.persistence === !0 || - this.table.options.persistence.headerFilter, - group: - this.table.options.persistence === !0 || - this.table.options.persistence.group, - page: - this.table.options.persistence === !0 || - this.table.options.persistence.page, - columns: - this.table.options.persistence === !0 - ? ["title", "width", "visible"] - : this.table.options.persistence.columns, - }), - this.config.page && - (t = this.retrieveData("page")) && - (t.paginationSize === void 0 || - (this.config.page !== !0 && - !this.config.page.size) || - (this.table.options.paginationSize = - t.paginationSize), - t.paginationInitialPage === void 0 || - (this.config.page !== !0 && - !this.config.page.page) || - (this.table.options.paginationInitialPage = - t.paginationInitialPage)), - this.config.group && - (t = this.retrieveData("group")) && - (t.groupBy === void 0 || - (this.config.group !== !0 && - !this.config.group.groupBy) || - (this.table.options.groupBy = t.groupBy), - t.groupStartOpen === void 0 || - (this.config.group !== !0 && - !this.config.group.groupStartOpen) || - (this.table.options.groupStartOpen = - t.groupStartOpen), - t.groupHeader === void 0 || - (this.config.group !== !0 && - !this.config.group.groupHeader) || - (this.table.options.groupHeader = - t.groupHeader)), - this.config.columns && - ((this.table.options.columns = this.load( - "columns", - this.table.options.columns - )), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe( - "column-show", - this.save.bind(this, "columns") - ), - this.subscribe( - "column-hide", - this.save.bind(this, "columns") - ), - this.subscribe( - "column-moved", - this.save.bind(this, "columns") - )), - this.subscribe( - "table-built", - this.tableBuilt.bind(this), - 0 - ), - this.subscribe( - "table-redraw", - this.tableRedraw.bind(this) - ), - this.subscribe( - "filter-changed", - this.eventSave.bind(this, "filter") - ), - this.subscribe( - "filter-changed", - this.eventSave.bind(this, "headerFilter") - ), - this.subscribe( - "sort-changed", - this.eventSave.bind(this, "sort") - ), - this.subscribe( - "group-changed", - this.eventSave.bind(this, "group") - ), - this.subscribe( - "page-changed", - this.eventSave.bind(this, "page") - ), - this.subscribe( - "column-resized", - this.eventSave.bind(this, "columns") - ), - this.subscribe( - "column-width", - this.eventSave.bind(this, "columns") - ), - this.subscribe( - "layout-refreshed", - this.eventSave.bind(this, "columns") - ); - } - this.registerTableFunction( - "getColumnLayout", - this.getColumnLayout.bind(this) - ), - this.registerTableFunction( - "setColumnLayout", - this.setColumnLayout.bind(this) - ); - } - eventSave(t) { - this.config[t] && this.save(t); - } - tableBuilt() { - var t, e, i; - this.config.sort && - (t = this.load("sort")) && - (this.table.options.initialSort = t), - this.config.filter && - (e = this.load("filter")) && - (this.table.options.initialFilter = e), - this.config.headerFilter && - (i = this.load("headerFilter")) && - (this.table.options.initialHeaderFilter = i); - } - tableRedraw(t) { - t && this.config.columns && this.save("columns"); - } - getColumnLayout() { - return this.parseColumns(this.table.columnManager.getColumns()); - } - setColumnLayout(t) { - return ( - this.table.columnManager.setColumns( - this.mergeDefinition(this.table.options.columns, t, !0) - ), - !0 - ); - } - initializeColumn(t) { - var e; - this.config.columns && - ((this.defWatcherBlock = !0), - (e = t.getDefinition()), - (this.config.columns === !0 - ? Object.keys(e) - : this.config.columns - ).forEach((i) => { - var o = Object.getOwnPropertyDescriptor(e, i), - n = e[i]; - o && - Object.defineProperty(e, i, { - set: (r) => { - (n = r), - this.defWatcherBlock || - this.save("columns"), - o.set && o.set(r); - }, - get: () => (o.get && o.get(), n), - }); - }), - (this.defWatcherBlock = !1)); - } - load(t, e) { - var i = this.retrieveData(t); - return e && (i = i ? this.mergeDefinition(e, i) : e), i; - } - retrieveData(t) { - return !!this.readFunc && this.readFunc(this.id, t); - } - mergeDefinition(t, e, i) { - var o = []; - return ( - (e = e || []).forEach((n, r) => { - var a, - l = this._findColumn(t, n); - l && - (i - ? (a = Object.keys(n)) - : this.config.columns === !0 || - this.config.columns == null - ? (a = Object.keys(l)).push("width") - : (a = this.config.columns), - a.forEach((h) => { - h !== "columns" && - n[h] !== void 0 && - (l[h] = n[h]); - }), - l.columns && - (l.columns = this.mergeDefinition( - l.columns, - n.columns - )), - o.push(l)); - }), - t.forEach((n, r) => { - this._findColumn(e, n) || - (o.length > r ? o.splice(r, 0, n) : o.push(n)); - }), - o - ); - } - _findColumn(t, e) { - var i = e.columns ? "group" : e.field ? "field" : "object"; - return t.find(function (o) { - switch (i) { - case "group": - return ( - o.title === e.title && - o.columns.length === e.columns.length - ); - case "field": - return o.field === e.field; - case "object": - return o === e; - } - }); - } - save(t) { - var e = {}; - switch (t) { - case "columns": - e = this.parseColumns( - this.table.columnManager.getColumns() - ); - break; - case "filter": - e = this.table.modules.filter.getFilters(); - break; - case "headerFilter": - e = this.table.modules.filter.getHeaderFilters(); - break; - case "sort": - e = this.validateSorters( - this.table.modules.sort.getSort() - ); - break; - case "group": - e = this.getGroupConfig(); - break; - case "page": - e = this.getPageConfig(); - } - this.writeFunc && this.writeFunc(this.id, t, e); - } - validateSorters(t) { - return ( - t.forEach(function (e) { - (e.column = e.field), delete e.field; - }), - t - ); - } - getGroupConfig() { - var t = {}; - return ( - this.config.group && - ((this.config.group === !0 || - this.config.group.groupBy) && - (t.groupBy = this.table.options.groupBy), - (this.config.group === !0 || - this.config.group.groupStartOpen) && - (t.groupStartOpen = - this.table.options.groupStartOpen), - (this.config.group === !0 || - this.config.group.groupHeader) && - (t.groupHeader = this.table.options.groupHeader)), - t - ); - } - getPageConfig() { - var t = {}; - return ( - this.config.page && - ((this.config.page === !0 || this.config.page.size) && - (t.paginationSize = - this.table.modules.page.getPageSize()), - (this.config.page === !0 || this.config.page.page) && - (t.paginationInitialPage = - this.table.modules.page.getPage())), - t - ); - } - parseColumns(t) { - var e = [], - i = [ - "headerContextMenu", - "headerMenu", - "contextMenu", - "clickMenu", - ]; - return ( - t.forEach((o) => { - var n, - r = {}, - a = o.getDefinition(); - o.isGroup - ? ((r.title = a.title), - (r.columns = this.parseColumns(o.getColumns()))) - : ((r.field = o.getField()), - this.config.columns === !0 || - this.config.columns == null - ? ((n = Object.keys(a)).push("width"), - n.push("visible")) - : (n = this.config.columns), - n.forEach((l) => { - switch (l) { - case "width": - r.width = o.getWidth(); - break; - case "visible": - r.visible = o.visible; - break; - default: - typeof a[l] != "function" && - i.indexOf(l) === -1 && - (r[l] = a[l]); - } - })), - e.push(r); - }), - e - ); - } - }; - b(S, "moduleName", "persistence"), - b(S, "moduleInitOrder", -10), - b(S, "readers", ci), - b(S, "writers", ui); - let Ot = S; - var mi = { - format: { - formatters: { - responsiveCollapse: function (s, t, e) { - var i = document.createElement("div"), - o = s.getRow()._row.modules.responsiveLayout; - function n(r) { - var a = o.element; - (o.open = r), - a && - (o.open - ? (i.classList.add("open"), - (a.style.display = "")) - : (i.classList.remove("open"), - (a.style.display = "none"))); - } - return ( - i.classList.add( - "tabulator-responsive-collapse-toggle" - ), - (i.innerHTML = ` - - - - - - -`), - s - .getElement() - .classList.add("tabulator-row-handle"), - i.addEventListener("click", function (r) { - r.stopImmediatePropagation(), - n(!o.open), - s - .getTable() - .rowManager.adjustTableSize(); - }), - n(o.open), - i - ); - }, - }, - }, - }, - pi = { - format: { - formatters: { - rowSelection: function (s, t, e) { - var i = document.createElement("input"), - o = !1; - if ( - ((i.type = "checkbox"), - i.setAttribute("aria-label", "Select Row"), - this.table.modExists("selectRow", !0)) - ) - if ( - (i.addEventListener("click", (r) => { - r.stopPropagation(); - }), - typeof s.getRow == "function") - ) { - var n = s.getRow(); - n instanceof ht - ? (i.addEventListener("change", (r) => { - this.table.options - .selectableRowsRangeMode === - "click" && o - ? (o = !1) - : n.toggleSelect(); - }), - this.table.options - .selectableRowsRangeMode === - "click" && - i.addEventListener( - "click", - (r) => { - (o = !0), - this.table.modules.selectRow.handleComplexRowClick( - n._row, - r - ); - } - ), - (i.checked = - n.isSelected && n.isSelected()), - this.table.modules.selectRow.registerRowSelectCheckbox( - n, - i - )) - : (i = ""); - } else - i.addEventListener("change", (r) => { - this.table.modules.selectRow - .selectedRows.length - ? this.table.deselectRow() - : this.table.selectRow(t.rowRange); - }), - this.table.modules.selectRow.registerHeaderSelectCheckbox( - i - ); - return i; - }, - }, - }, - }; - class gi { - constructor(t) { - return ( - (this._range = t), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._range.table.componentFunctionBinder.handle( - "range", - e._range, - i - ); - }, - }) - ); - } - getElement() { - return this._range.element; - } - getData() { - return this._range.getData(); - } - getCells() { - return this._range.getCells(!0, !0); - } - getStructuredCells() { - return this._range.getStructuredCells(); - } - getRows() { - return this._range.getRows().map((t) => t.getComponent()); - } - getColumns() { - return this._range.getColumns().map((t) => t.getComponent()); - } - getBounds() { - return this._range.getBounds(); - } - getTopEdge() { - return this._range.top; - } - getBottomEdge() { - return this._range.bottom; - } - getLeftEdge() { - return this._range.left; - } - getRightEdge() { - return this._range.right; - } - setBounds(t, e) { - this._range.destroyedGuard("setBounds") && - this._range.setBounds(t && t._cell, e && e._cell); - } - setStartBound(t) { - this._range.destroyedGuard("setStartBound") && - (this._range.setEndBound(t && t._cell), - this._range.rangeManager.layoutElement()); - } - setEndBound(t) { - this._range.destroyedGuard("setEndBound") && - (this._range.setEndBound(t && t._cell), - this._range.rangeManager.layoutElement()); - } - clearValues() { - this._range.destroyedGuard("clearValues") && - this._range.clearValues(); - } - remove() { - this._range.destroyedGuard("remove") && this._range.destroy(!0); - } - } - class bi extends C { - constructor(t, e, i, o) { - super(t), - (this.rangeManager = e), - (this.element = null), - (this.initialized = !1), - (this.initializing = { start: !1, end: !1 }), - (this.destroyed = !1), - (this.top = 0), - (this.bottom = 0), - (this.left = 0), - (this.right = 0), - (this.table = t), - (this.start = { row: 0, col: 0 }), - (this.end = { row: 0, col: 0 }), - this.rangeManager.rowHeader && - ((this.left = 1), - (this.right = 1), - (this.start.col = 1), - (this.end.col = 1)), - this.initElement(), - setTimeout(() => { - this.initBounds(i, o); - }); - } - initElement() { - (this.element = document.createElement("div")), - this.element.classList.add("tabulator-range"); - } - initBounds(t, e) { - this._updateMinMax(), t && this.setBounds(t, e || t); - } - setStart(t, e) { - (this.start.row === t && this.start.col === e) || - ((this.start.row = t), - (this.start.col = e), - (this.initializing.start = !0), - this._updateMinMax()); - } - setEnd(t, e) { - (this.end.row === t && this.end.col === e) || - ((this.end.row = t), - (this.end.col = e), - (this.initializing.end = !0), - this._updateMinMax()); - } - setBounds(t, e, i) { - t && this.setStartBound(t), - this.setEndBound(e || t), - this.rangeManager.layoutElement(i); - } - setStartBound(t) { - var e, i; - t.type === "column" - ? this.rangeManager.columnSelection && - this.setStart(0, t.getPosition() - 1) - : ((e = t.row.position - 1), - (i = t.column.getPosition() - 1), - t.column === this.rangeManager.rowHeader - ? this.setStart(e, 1) - : this.setStart(e, i)); - } - setEndBound(t) { - var e, - i, - o, - n = this._getTableRows().length; - t.type === "column" - ? this.rangeManager.columnSelection && - (this.rangeManager.selecting === "column" - ? this.setEnd(n - 1, t.getPosition() - 1) - : this.rangeManager.selecting === "cell" && - this.setEnd(0, t.getPosition() - 1)) - : ((e = t.row.position - 1), - (i = t.column.getPosition() - 1), - (o = t.column === this.rangeManager.rowHeader), - this.rangeManager.selecting === "row" - ? this.setEnd(e, this._getTableColumns().length - 1) - : this.rangeManager.selecting !== "row" && o - ? this.setEnd(e, 0) - : this.rangeManager.selecting === "column" - ? this.setEnd(n - 1, i) - : this.setEnd(e, i)); - } - _updateMinMax() { - (this.top = Math.min(this.start.row, this.end.row)), - (this.bottom = Math.max(this.start.row, this.end.row)), - (this.left = Math.min(this.start.col, this.end.col)), - (this.right = Math.max(this.start.col, this.end.col)), - this.initialized - ? this.dispatchExternal( - "rangeChanged", - this.getComponent() - ) - : this.initializing.start && - this.initializing.end && - ((this.initialized = !0), - this.dispatchExternal( - "rangeAdded", - this.getComponent() - )); - } - _getTableColumns() { - return this.table.columnManager.getVisibleColumnsByIndex(); - } - _getTableRows() { - return this.table.rowManager - .getDisplayRows() - .filter((t) => t.type === "row"); - } - layout() { - var t, - e, - i, - o, - n, - r, - a, - l, - h, - d, - c = this.table.rowManager.renderer.vDomTop, - u = this.table.rowManager.renderer.vDomBottom, - m = this.table.columnManager.renderer.leftCol, - p = this.table.columnManager.renderer.rightCol; - this.table.options.renderHorizontal === "virtual" && - this.rangeManager.rowHeader && - (p += 1), - c == null && (c = 0), - u == null && (u = 1 / 0), - m == null && (m = 0), - p == null && (p = 1 / 0), - this.overlaps(m, c, p, u) && - ((t = Math.max(this.top, c)), - (e = Math.min(this.bottom, u)), - (i = Math.max(this.left, m)), - (o = Math.min(this.right, p)), - (n = this.rangeManager.getCell(t, i)), - (r = this.rangeManager.getCell(e, o)), - (a = n.getElement()), - (l = r.getElement()), - (h = n.row.getElement()), - (d = r.row.getElement()), - this.element.classList.add("tabulator-range-active"), - this.table.rtl - ? ((this.element.style.right = - h.offsetWidth - - a.offsetLeft - - a.offsetWidth + - "px"), - (this.element.style.width = - a.offsetLeft + - a.offsetWidth - - l.offsetLeft + - "px")) - : ((this.element.style.left = - h.offsetLeft + a.offsetLeft + "px"), - (this.element.style.width = - l.offsetLeft + - l.offsetWidth - - a.offsetLeft + - "px")), - (this.element.style.top = h.offsetTop + "px"), - (this.element.style.height = - d.offsetTop + d.offsetHeight - h.offsetTop + "px")); - } - atTopLeft(t) { - return ( - t.row.position - 1 === this.top && - t.column.getPosition() - 1 === this.left - ); - } - atBottomRight(t) { - return ( - t.row.position - 1 === this.bottom && - t.column.getPosition() - 1 === this.right - ); - } - occupies(t) { - return this.occupiesRow(t.row) && this.occupiesColumn(t.column); - } - occupiesRow(t) { - return ( - this.top <= t.position - 1 && t.position - 1 <= this.bottom - ); - } - occupiesColumn(t) { - return ( - this.left <= t.getPosition() - 1 && - t.getPosition() - 1 <= this.right - ); - } - overlaps(t, e, i, o) { - return !( - this.left > i || - t > this.right || - this.top > o || - e > this.bottom - ); - } - getData() { - var t = [], - e = this.getRows(), - i = this.getColumns(); - return ( - e.forEach((o) => { - var n = o.getData(), - r = {}; - i.forEach((a) => { - r[a.field] = n[a.field]; - }), - t.push(r); - }), - t - ); - } - getCells(t, e) { - var i = [], - o = this.getRows(), - n = this.getColumns(); - return ( - t - ? (i = o.map((r) => { - var a = []; - return ( - r.getCells().forEach((l) => { - n.includes(l.column) && - a.push(e ? l.getComponent() : l); - }), - a - ); - })) - : o.forEach((r) => { - r.getCells().forEach((a) => { - n.includes(a.column) && - i.push(e ? a.getComponent() : a); - }); - }), - i - ); - } - getStructuredCells() { - return this.getCells(!0, !0); - } - getRows() { - return this._getTableRows().slice(this.top, this.bottom + 1); - } - getColumns() { - return this._getTableColumns().slice(this.left, this.right + 1); - } - clearValues() { - var t = this.getCells(), - e = this.table.options.selectableRangeClearCellsValue; - this.table.blockRedraw(), - t.forEach((i) => { - i.setValue(e); - }), - this.table.restoreRedraw(); - } - getBounds(t) { - var e = this.getCells(!1, t), - i = { start: null, end: null }; - return ( - e.length - ? ((i.start = e[0]), (i.end = e[e.length - 1])) - : console.warn("No bounds defined on range"), - i - ); - } - getComponent() { - return ( - this.component || (this.component = new gi(this)), - this.component - ); - } - destroy(t) { - (this.destroyed = !0), - this.element.remove(), - t && this.rangeManager.rangeRemoved(this), - this.initialized && - this.dispatchExternal( - "rangeRemoved", - this.getComponent() - ); - } - destroyedGuard(t) { - return ( - this.destroyed && - console.warn( - "You cannot call the " + - t + - " function on a destroyed range" - ), - !this.destroyed - ); - } - } - var fi = { - keybindings: { - bindings: { - rangeJumpUp: ["ctrl + 38", "meta + 38"], - rangeJumpDown: ["ctrl + 40", "meta + 40"], - rangeJumpLeft: ["ctrl + 37", "meta + 37"], - rangeJumpRight: ["ctrl + 39", "meta + 39"], - rangeExpandUp: "shift + 38", - rangeExpandDown: "shift + 40", - rangeExpandLeft: "shift + 37", - rangeExpandRight: "shift + 39", - rangeExpandJumpUp: [ - "ctrl + shift + 38", - "meta + shift + 38", - ], - rangeExpandJumpDown: [ - "ctrl + shift + 40", - "meta + shift + 40", - ], - rangeExpandJumpLeft: [ - "ctrl + shift + 37", - "meta + shift + 37", - ], - rangeExpandJumpRight: [ - "ctrl + shift + 39", - "meta + shift + 39", - ], - }, - actions: { - rangeJumpLeft: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "left", - !0, - !1 - ); - }, - rangeJumpRight: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "right", - !0, - !1 - ); - }, - rangeJumpUp: function (s) { - this.dispatch("keybinding-nav-range", s, "up", !0, !1); - }, - rangeJumpDown: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "down", - !0, - !1 - ); - }, - rangeExpandLeft: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "left", - !1, - !0 - ); - }, - rangeExpandRight: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "right", - !1, - !0 - ); - }, - rangeExpandUp: function (s) { - this.dispatch("keybinding-nav-range", s, "up", !1, !0); - }, - rangeExpandDown: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "down", - !1, - !0 - ); - }, - rangeExpandJumpLeft: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "left", - !0, - !0 - ); - }, - rangeExpandJumpRight: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "right", - !0, - !0 - ); - }, - rangeExpandJumpUp: function (s) { - this.dispatch("keybinding-nav-range", s, "up", !0, !0); - }, - rangeExpandJumpDown: function (s) { - this.dispatch( - "keybinding-nav-range", - s, - "down", - !0, - !0 - ); - }, - }, - }, - clipboard: { - pasteActions: { - range: function (s) { - var t, - e, - i, - o, - n, - r = [], - a = this.table.modules.selectRange.activeRange, - l = !1; - return ( - (n = s.length), - a && - ((e = (t = a.getBounds()).start), - t.start === t.end && (l = !0), - e && - ((i = (r = - this.table.rowManager.activeRows.slice()).indexOf( - e.row - )), - (o = l - ? s.length - : r.indexOf(t.end.row) - i + 1), - i > -1 && - (this.table.blockRedraw(), - (r = r.slice(i, i + o)).forEach( - (h, d) => { - h.updateData(s[d % n]); - } - ), - this.table.restoreRedraw()))), - r - ); - }, - }, - pasteParsers: { - range: function (s) { - var t, - e, - i, - o, - n, - r = [], - a = [], - l = this.table.modules.selectRange.activeRange, - h = !1; - return ( - !!( - l && - ((e = (t = l.getBounds()).start), - t.start === t.end && (h = !0), - e && - ((s = s.split(` -`)).forEach(function (d) { - r.push(d.split(" ")); - }), - r.length && - (n = (o = - this.table.columnManager.getVisibleColumnsByIndex()).indexOf( - e.column - )) > -1)) - ) && - ((i = h - ? r[0].length - : o.indexOf(t.end.column) - n + 1), - (o = o.slice(n, n + i)), - r.forEach((d) => { - var c = {}, - u = d.length; - o.forEach(function (m, p) { - c[m.field] = d[p % u]; - }), - a.push(c); - }), - a) - ); - }, - }, - }, - export: { - columnLookups: { - range: function () { - var s = this.modules.selectRange.selectedColumns(); - return ( - this.columnManager.rowHeader && - s.unshift(this.columnManager.rowHeader), - s - ); - }, - }, - rowLookups: { - range: function () { - return this.modules.selectRange.selectedRows(); - }, - }, - }, - }; - function At(s, t, e, i, o, n, r) { - var a = this.table.dependencyRegistry.lookup( - ["luxon", "DateTime"], - "DateTime" - ), - l = r.format || "dd/MM/yyyy HH:mm:ss", - h = r.alignEmptyValues, - d = 0; - if (a !== void 0) { - if ( - (a.isDateTime(s) || - (s = - l === "iso" - ? a.fromISO(String(s)) - : a.fromFormat(String(s), l)), - a.isDateTime(t) || - (t = - l === "iso" - ? a.fromISO(String(t)) - : a.fromFormat(String(t), l)), - s.isValid) - ) { - if (t.isValid) return s - t; - d = 1; - } else d = t.isValid ? -1 : 0; - return ( - ((h === "top" && n === "desc") || - (h === "bottom" && n === "asc")) && - (d *= -1), - d - ); - } - console.error( - "Sort Error - 'datetime' sorter is dependant on luxon.js" - ); - } - var vi = { - number: function (s, t, e, i, o, n, r) { - var a = r.alignEmptyValues, - l = r.decimalSeparator, - h = r.thousandSeparator, - d = 0; - if ( - ((s = String(s)), - (t = String(t)), - h && ((s = s.split(h).join("")), (t = t.split(h).join(""))), - l && - ((s = s.split(l).join(".")), - (t = t.split(l).join("."))), - (s = parseFloat(s)), - (t = parseFloat(t)), - isNaN(s)) - ) - d = isNaN(t) ? 0 : -1; - else { - if (!isNaN(t)) return s - t; - d = 1; - } - return ( - ((a === "top" && n === "desc") || - (a === "bottom" && n === "asc")) && - (d *= -1), - d - ); - }, - string: function (s, t, e, i, o, n, r) { - var a, - l = r.alignEmptyValues, - h = 0; - if (s) { - if (t) { - switch (typeof r.locale) { - case "boolean": - r.locale && (a = this.langLocale()); - break; - case "string": - a = r.locale; - } - return String(s) - .toLowerCase() - .localeCompare(String(t).toLowerCase(), a); - } - h = 1; - } else h = t ? -1 : 0; - return ( - ((l === "top" && n === "desc") || - (l === "bottom" && n === "asc")) && - (h *= -1), - h - ); - }, - date: function (s, t, e, i, o, n, r) { - return ( - r.format || (r.format = "dd/MM/yyyy"), - At.call(this, s, t, e, i, o, n, r) - ); - }, - time: function (s, t, e, i, o, n, r) { - return ( - r.format || (r.format = "HH:mm"), - At.call(this, s, t, e, i, o, n, r) - ); - }, - datetime: At, - boolean: function (s, t, e, i, o, n, r) { - return ( - (s === !0 || s === "true" || s === "True" || s === 1 - ? 1 - : 0) - - (t === !0 || t === "true" || t === "True" || t === 1 - ? 1 - : 0) - ); - }, - array: function (s, t, e, i, o, n, r) { - var a, - l = r.type || "length", - h = r.alignEmptyValues, - d = 0, - c = this.table; - function u(m) { - var p; - switch ((a && (m = a(m)), l)) { - case "length": - p = m.length; - break; - case "sum": - p = m.reduce(function (g, f) { - return g + f; - }); - break; - case "max": - p = Math.max.apply(null, m); - break; - case "min": - p = Math.min.apply(null, m); - break; - case "avg": - p = - m.reduce(function (g, f) { - return g + f; - }) / m.length; - break; - case "string": - p = m.join(""); - } - return p; - } - if ( - (r.valueMap && - (a = - typeof r.valueMap == "string" - ? function (m) { - return m.map((p) => - x.retrieveNestedData( - c.options.nestedFieldSeparator, - r.valueMap, - p - ) - ); - } - : r.valueMap), - Array.isArray(s)) - ) { - if (Array.isArray(t)) - return l === "string" - ? String(u(s)) - .toLowerCase() - .localeCompare(String(u(t)).toLowerCase()) - : u(t) - u(s); - d = 1; - } else d = Array.isArray(t) ? -1 : 0; - return ( - ((h === "top" && n === "desc") || - (h === "bottom" && n === "asc")) && - (d *= -1), - d - ); - }, - exists: function (s, t, e, i, o, n, r) { - return (s === void 0 ? 0 : 1) - (t === void 0 ? 0 : 1); - }, - alphanum: function (s, t, e, i, o, n, r) { - var a, - l, - h, - d, - c, - u = 0, - m = /(\d+)|(\D+)/g, - p = /\d/, - g = r.alignEmptyValues, - f = 0; - if (s || s === 0) { - if (t || t === 0) { - if (isFinite(s) && isFinite(t)) return s - t; - if ( - (a = String(s).toLowerCase()) === - (l = String(t).toLowerCase()) - ) - return 0; - if (!p.test(a) || !p.test(l)) return a > l ? 1 : -1; - for ( - a = a.match(m), - l = l.match(m), - c = a.length > l.length ? l.length : a.length; - u < c; - - ) - if ((h = a[u]) !== (d = l[u++])) - return isFinite(h) && isFinite(d) - ? (h.charAt(0) === "0" && (h = "." + h), - d.charAt(0) === "0" && (d = "." + d), - h - d) - : h > d - ? 1 - : -1; - return a.length > l.length; - } - f = 1; - } else f = t || t === 0 ? -1 : 0; - return ( - ((g === "top" && n === "desc") || - (g === "bottom" && n === "asc")) && - (f *= -1), - f - ); - }, - }; - let X = class X extends w { - constructor(t) { - super(t), - (this.sortList = []), - (this.changed = !1), - this.registerTableOption("sortMode", "local"), - this.registerTableOption("initialSort", !1), - this.registerTableOption("columnHeaderSortMulti", !0), - this.registerTableOption("sortOrderReverse", !1), - this.registerTableOption( - "headerSortElement", - "
" - ), - this.registerTableOption( - "headerSortClickElement", - "header" - ), - this.registerColumnOption("sorter"), - this.registerColumnOption("sorterParams"), - this.registerColumnOption("headerSort", !0), - this.registerColumnOption("headerSortStartingDir"), - this.registerColumnOption("headerSortTristate"); - } - initialize() { - this.subscribe( - "column-layout", - this.initializeColumn.bind(this) - ), - this.subscribe("table-built", this.tableBuilt.bind(this)), - this.registerDataHandler(this.sort.bind(this), 20), - this.registerTableFunction( - "setSort", - this.userSetSort.bind(this) - ), - this.registerTableFunction( - "getSorters", - this.getSort.bind(this) - ), - this.registerTableFunction( - "clearSort", - this.clearSort.bind(this) - ), - this.table.options.sortMode === "remote" && - this.subscribe( - "data-params", - this.remoteSortParams.bind(this) - ); - } - tableBuilt() { - this.table.options.initialSort && - this.setSort(this.table.options.initialSort); - } - remoteSortParams(t, e, i, o) { - var n = this.getSort(); - return ( - n.forEach((r) => { - delete r.column; - }), - (o.sort = n), - o - ); - } - userSetSort(t, e) { - this.setSort(t, e), this.refreshSort(); - } - clearSort() { - this.clear(), this.refreshSort(); - } - initializeColumn(t) { - var e, - i, - o = !1; - switch (typeof t.definition.sorter) { - case "string": - X.sorters[t.definition.sorter] - ? (o = X.sorters[t.definition.sorter]) - : console.warn( - "Sort Error - No such sorter found: ", - t.definition.sorter - ); - break; - case "function": - o = t.definition.sorter; - } - if ( - ((t.modules.sort = { - sorter: o, - dir: "none", - params: t.definition.sorterParams || {}, - startingDir: - t.definition.headerSortStartingDir || "asc", - tristate: t.definition.headerSortTristate, - }), - t.definition.headerSort !== !1) - ) { - switch ( - ((e = t.getElement()).classList.add( - "tabulator-sortable" - ), - (i = document.createElement("div")).classList.add( - "tabulator-col-sorter" - ), - this.table.options.headerSortClickElement === "icon" - ? i.classList.add("tabulator-col-sorter-element") - : e.classList.add("tabulator-col-sorter-element"), - this.table.options.headerSortElement) - ) { - case "function": - break; - case "object": - i.appendChild(this.table.options.headerSortElement); - break; - default: - i.innerHTML = this.table.options.headerSortElement; - } - t.titleHolderElement.appendChild(i), - (t.modules.sort.element = i), - this.setColumnHeaderSortIcon(t, "none"), - this.table.options.headerSortClickElement === "icon" && - i.addEventListener("mousedown", (n) => { - n.stopPropagation(); - }), - (this.table.options.headerSortClickElement === "icon" - ? i - : e - ).addEventListener("click", (n) => { - var r = "", - a = [], - l = !1; - if (t.modules.sort) { - if (t.modules.sort.tristate) - r = - t.modules.sort.dir == "none" - ? t.modules.sort.startingDir - : t.modules.sort.dir == - t.modules.sort.startingDir - ? t.modules.sort.dir == "asc" - ? "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; - } - this.table.options.columnHeaderSortMulti && - (n.shiftKey || n.ctrlKey) - ? ((l = (a = this.getSort()).findIndex( - (h) => h.field === t.getField() - )), - l > -1 - ? ((a[l].dir = r), - (l = a.splice(l, 1)[0]), - r != "none" && a.push(l)) - : r != "none" && - a.push({ column: t, dir: r }), - this.setSort(a)) - : r == "none" - ? this.clear() - : this.setSort(t, r), - this.refreshSort(); - } - }); - } - } - refreshSort() { - this.table.options.sortMode === "remote" - ? this.reloadData(null, !1, !1) - : this.refreshData(!0); - } - hasChanged() { - var t = this.changed; - return (this.changed = !1), t; - } - getSort() { - var t = []; - return ( - this.sortList.forEach(function (e) { - e.column && - t.push({ - column: e.column.getComponent(), - field: e.column.getField(), - dir: e.dir, - }); - }), - t - ); - } - setSort(t, e) { - var i = this, - o = []; - Array.isArray(t) || (t = [{ column: t, dir: e }]), - t.forEach(function (n) { - var r; - (r = i.table.columnManager.findColumn(n.column)) - ? ((n.column = r), o.push(n), (i.changed = !0)) - : console.warn( - "Sort Warning - Sort field does not exist and is being ignored: ", - n.column - ); - }), - (i.sortList = o), - this.dispatch("sort-changed"); - } - clear() { - this.setSort([]); - } - findSorter(t) { - var e, - i = this.table.rowManager.activeRows[0], - o = "string"; - if (i && ((i = i.getData()), t.getField())) - switch (typeof (e = t.getFieldValue(i))) { - 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 X.sorters[o]; - } - sort(t, e) { - var i = this, - o = this.table.options.sortOrderReverse - ? i.sortList.slice().reverse() - : i.sortList, - n = [], - r = []; - return ( - this.subscribedExternal("dataSorting") && - this.dispatchExternal("dataSorting", i.getSort()), - e || i.clearColumnHeaders(), - this.table.options.sortMode !== "remote" - ? (o.forEach(function (a, l) { - var h; - a.column && - ((h = a.column.modules.sort) && - (h.sorter || - (h.sorter = i.findSorter(a.column)), - (a.params = - typeof h.params == "function" - ? h.params( - a.column.getComponent(), - a.dir - ) - : h.params), - n.push(a)), - e || i.setColumnHeader(a.column, a.dir)); - }), - n.length && i._sortItems(t, n)) - : e || - o.forEach(function (a, l) { - i.setColumnHeader(a.column, a.dir); - }), - this.subscribedExternal("dataSorted") && - (t.forEach((a) => { - r.push(a.getComponent()); - }), - this.dispatchExternal("dataSorted", i.getSort(), r)), - t - ); - } - clearColumnHeaders() { - this.table.columnManager.getRealColumns().forEach((t) => { - t.modules.sort && - ((t.modules.sort.dir = "none"), - t.getElement().setAttribute("aria-sort", "none"), - this.setColumnHeaderSortIcon(t, "none")); - }); - } - setColumnHeader(t, e) { - (t.modules.sort.dir = e), - t - .getElement() - .setAttribute( - "aria-sort", - e === "asc" ? "ascending" : "descending" - ), - this.setColumnHeaderSortIcon(t, e); - } - setColumnHeaderSortIcon(t, e) { - var i, - o = t.modules.sort.element; - if ( - t.definition.headerSort && - typeof this.table.options.headerSortElement == "function" - ) { - for (; o.firstChild; ) o.removeChild(o.firstChild); - typeof (i = this.table.options.headerSortElement.call( - this.table, - t.getComponent(), - e - )) == "object" - ? o.appendChild(i) - : (o.innerHTML = i); - } - } - _sortItems(t, e) { - var i = e.length - 1; - t.sort((o, n) => { - for (var r, a = i; a >= 0; a--) { - let l = e[a]; - if ( - (r = this._sortRow( - o, - n, - l.column, - l.dir, - l.params - )) !== 0 - ) - break; - } - return r; - }); - } - _sortRow(t, e, i, o, n) { - var r, - a, - l = o == "asc" ? t : e, - h = o == "asc" ? e : t; - return ( - (t = - (t = i.getFieldValue(l.getData())) !== void 0 ? t : ""), - (e = - (e = i.getFieldValue(h.getData())) !== void 0 ? e : ""), - (r = l.getComponent()), - (a = h.getComponent()), - i.modules.sort.sorter.call( - this, - t, - e, - r, - a, - i.getComponent(), - o, - n - ) - ); - } - }; - b(X, "moduleName", "sort"), b(X, "sorters", vi); - let Bt = X; - class wi { - constructor(t, e) { - (this.columnCount = t), - (this.rowCount = e), - (this.columnString = []), - (this.columns = []), - (this.rows = []); - } - genColumns(t) { - var e = Math.max( - this.columnCount, - Math.max(...t.map((i) => i.length)) - ); - (this.columnString = []), (this.columns = []); - for (let i = 1; i <= e; i++) - this.incrementChar(this.columnString.length - 1), - this.columns.push(this.columnString.join("")); - return this.columns; - } - genRows(t) { - var e = Math.max(this.rowCount, t.length); - this.rows = []; - for (let i = 1; i <= e; i++) this.rows.push(i); - return this.rows; - } - incrementChar(t) { - let e = this.columnString[t]; - e - ? e !== "Z" - ? (this.columnString[t] = String.fromCharCode( - this.columnString[t].charCodeAt(0) + 1 - )) - : ((this.columnString[t] = "A"), - t - ? this.incrementChar(t - 1) - : this.columnString.push("A")) - : this.columnString.push("A"); - } - setRowCount(t) { - this.rowCount = t; - } - setColumnCount(t) { - this.columnCount = t; - } - } - class ue { - constructor(t) { - return ( - (this._sheet = t), - new Proxy(this, { - get: function (e, i, o) { - return e[i] !== void 0 - ? e[i] - : e._sheet.table.componentFunctionBinder.handle( - "sheet", - e._sheet, - i - ); - }, - }) - ); - } - getTitle() { - return this._sheet.title; - } - getKey() { - return this._sheet.key; - } - getDefinition() { - return this._sheet.getDefinition(); - } - getData() { - return this._sheet.getData(); - } - setData(t) { - return this._sheet.setData(t); - } - clear() { - return this._sheet.clear(); - } - remove() { - return this._sheet.remove(); - } - active() { - return this._sheet.active(); - } - setTitle(t) { - return this._sheet.setTitle(t); - } - setRows(t) { - return this._sheet.setRows(t); - } - setColumns(t) { - return this._sheet.setColumns(t); - } - } - class me extends C { - constructor(t, e) { - super(t.table), - (this.spreadsheetManager = t), - (this.definition = e), - (this.title = this.definition.title || ""), - (this.key = this.definition.key || this.definition.title), - (this.rowCount = this.definition.rows), - (this.columnCount = this.definition.columns), - (this.data = this.definition.data || []), - (this.element = null), - (this.isActive = !1), - (this.grid = new wi(this.columnCount, this.rowCount)), - (this.defaultColumnDefinition = { - width: 100, - headerHozAlign: "center", - headerSort: !1, - }), - (this.columnDefinition = Object.assign( - this.defaultColumnDefinition, - this.options("spreadsheetColumnDefinition") - )), - (this.columnDefs = []), - (this.rowDefs = []), - (this.columnFields = []), - (this.columns = []), - (this.rows = []), - (this.scrollTop = null), - (this.scrollLeft = null), - this.initialize(), - this.dispatchExternal("sheetAdded", this.getComponent()); - } - initialize() { - this.initializeElement(), - this.initializeColumns(), - this.initializeRows(); - } - reinitialize() { - this.initializeColumns(), this.initializeRows(); - } - initializeElement() { - (this.element = document.createElement("div")), - this.element.classList.add("tabulator-spreadsheet-tab"), - (this.element.innerText = this.title), - this.element.addEventListener("click", () => { - this.spreadsheetManager.loadSheet(this); - }); - } - initializeColumns() { - this.grid.setColumnCount(this.columnCount), - (this.columnFields = this.grid.genColumns(this.data)), - (this.columnDefs = []), - this.columnFields.forEach((t) => { - var e = Object.assign({}, this.columnDefinition); - (e.field = t), (e.title = t), this.columnDefs.push(e); - }); - } - initializeRows() { - var t; - this.grid.setRowCount(this.rowCount), - (t = this.grid.genRows(this.data)), - (this.rowDefs = []), - t.forEach((e, i) => { - var o = { _id: e }, - n = this.data[i]; - n && - n.forEach((r, a) => { - var l = this.columnFields[a]; - l && (o[l] = r); - }), - this.rowDefs.push(o); - }); - } - unload() { - (this.isActive = !1), - (this.scrollTop = this.table.rowManager.scrollTop), - (this.scrollLeft = this.table.rowManager.scrollLeft), - (this.data = this.getData(!0)), - this.element.classList.remove( - "tabulator-spreadsheet-tab-active" - ); - } - load() { - var t = !this.isActive; - (this.isActive = !0), - this.table.blockRedraw(), - this.table.setData([]), - this.table.setColumns(this.columnDefs), - this.table.setData(this.rowDefs), - this.table.restoreRedraw(), - t && - this.scrollTop !== null && - ((this.table.rowManager.element.scrollLeft = - this.scrollLeft), - (this.table.rowManager.element.scrollTop = - this.scrollTop)), - this.element.classList.add( - "tabulator-spreadsheet-tab-active" - ), - this.dispatchExternal("sheetLoaded", this.getComponent()); - } - getComponent() { - return new ue(this); - } - getDefinition() { - return { - title: this.title, - key: this.key, - rows: this.rowCount, - columns: this.columnCount, - data: this.getData(), - }; - } - getData(t) { - var e, - i, - o, - n = []; - return ( - this.rowDefs.forEach((r) => { - var a = []; - this.columnFields.forEach((l) => { - a.push(r[l]); - }), - n.push(a); - }), - t || - this.options("spreadsheetOutputFull") || - ((e = n.map( - (r) => r.findLastIndex((a) => a !== void 0) + 1 - )), - (i = Math.max(...e)), - (o = e.findLastIndex((r) => r > 0) + 1), - (n = (n = n.slice(0, o)).map((r) => r.slice(0, i)))), - n - ); - } - setData(t) { - (this.data = t), - this.reinitialize(), - this.dispatchExternal("sheetUpdated", this.getComponent()), - this.isActive && this.load(); - } - clear() { - this.setData([]); - } - setTitle(t) { - (this.title = t), - (this.element.innerText = t), - this.dispatchExternal("sheetUpdated", this.getComponent()); - } - setRows(t) { - (this.rowCount = t), - this.initializeRows(), - this.dispatchExternal("sheetUpdated", this.getComponent()), - this.isActive && this.load(); - } - setColumns(t) { - (this.columnCount = t), - this.reinitialize(), - this.dispatchExternal("sheetUpdated", this.getComponent()), - this.isActive && this.load(); - } - remove() { - this.spreadsheetManager.removeSheet(this); - } - destroy() { - this.element.parentNode && - this.element.parentNode.removeChild(this.element), - this.dispatchExternal("sheetRemoved", this.getComponent()); - } - active() { - this.spreadsheetManager.loadSheet(this); - } - } - var Ci = { - integer: function (s, t, e) { - return ( - t === "" || - t == null || - ((t = Number(t)), - !isNaN(t) && isFinite(t) && Math.floor(t) === t) - ); - }, - float: function (s, t, e) { - return ( - t === "" || - t == null || - ((t = Number(t)), !isNaN(t) && isFinite(t) && t % 1 != 0) - ); - }, - numeric: function (s, t, e) { - return t === "" || t == null || !isNaN(t); - }, - string: function (s, t, e) { - return t === "" || t == null || isNaN(t); - }, - alphanumeric: function (s, t, e) { - return ( - t === "" || t == null || new RegExp(/^[a-z0-9]+$/i).test(t) - ); - }, - max: function (s, t, e) { - return t === "" || t == null || parseFloat(t) <= e; - }, - min: function (s, t, e) { - return t === "" || t == null || parseFloat(t) >= e; - }, - starts: function (s, t, e) { - return ( - t === "" || - t == null || - String(t).toLowerCase().startsWith(String(e).toLowerCase()) - ); - }, - ends: function (s, t, e) { - return ( - t === "" || - t == null || - String(t).toLowerCase().endsWith(String(e).toLowerCase()) - ); - }, - minLength: function (s, t, e) { - return t === "" || t == null || String(t).length >= e; - }, - maxLength: function (s, t, e) { - return t === "" || t == null || String(t).length <= e; - }, - in: function (s, t, e) { - return ( - t === "" || - t == null || - (typeof e == "string" && (e = e.split("|")), - e.indexOf(t) > -1) - ); - }, - regex: function (s, t, e) { - return t === "" || t == null || new RegExp(e).test(t); - }, - unique: function (s, t, e) { - if (t === "" || t == null) return !0; - var i = !0, - o = s.getData(), - n = s.getColumn()._getSelf(); - return ( - this.table.rowManager.rows.forEach(function (r) { - var a = r.getData(); - a !== o && t == n.getFieldValue(a) && (i = !1); - }), - i - ); - }, - required: function (s, t, e) { - return t !== "" && t != null; - }, - }; - let rt = class rt extends w { - constructor(t) { - super(t), - (this.invalidCells = []), - this.registerTableOption("validationMode", "blocking"), - this.registerColumnOption("validator"), - this.registerTableFunction( - "getInvalidCells", - this.getInvalidCells.bind(this) - ), - this.registerTableFunction( - "clearCellValidation", - this.userClearCellValidation.bind(this) - ), - this.registerTableFunction( - "validate", - this.userValidate.bind(this) - ), - this.registerComponentFunction( - "cell", - "isValid", - this.cellIsValid.bind(this) - ), - this.registerComponentFunction( - "cell", - "clearValidation", - this.clearValidation.bind(this) - ), - this.registerComponentFunction( - "cell", - "validate", - this.cellValidate.bind(this) - ), - this.registerComponentFunction( - "column", - "validate", - this.columnValidate.bind(this) - ), - this.registerComponentFunction( - "row", - "validate", - this.rowValidate.bind(this) - ); - } - initialize() { - this.subscribe("cell-delete", this.clearValidation.bind(this)), - this.subscribe( - "column-layout", - this.initializeColumnCheck.bind(this) - ), - this.subscribe( - "edit-success", - this.editValidate.bind(this) - ), - this.subscribe( - "edit-editor-clear", - this.editorClear.bind(this) - ), - this.subscribe( - "edit-edited-clear", - this.editedClear.bind(this) - ); - } - editValidate(t, e, i) { - var o = - this.table.options.validationMode === "manual" || - this.validate(t.column.modules.validate, t, e); - return ( - o !== !0 && - setTimeout(() => { - t - .getElement() - .classList.add("tabulator-validation-fail"), - this.dispatchExternal( - "validationFailed", - t.getComponent(), - e, - o - ); - }), - o - ); - } - editorClear(t, e) { - e && t.column.modules.validate && this.cellValidate(t), - t - .getElement() - .classList.remove("tabulator-validation-fail"); - } - editedClear(t) { - t.modules.validate && (t.modules.validate.invalid = !1); - } - cellIsValid(t) { - return (t.modules.validate && t.modules.validate.invalid) || !0; - } - cellValidate(t) { - return this.validate( - t.column.modules.validate, - t, - t.getValue() - ); - } - columnValidate(t) { - var e = []; - return ( - t.cells.forEach((i) => { - this.cellValidate(i) !== !0 && e.push(i.getComponent()); - }), - !e.length || e - ); - } - rowValidate(t) { - var e = []; - return ( - t.cells.forEach((i) => { - this.cellValidate(i) !== !0 && e.push(i.getComponent()); - }), - !e.length || e - ); - } - userClearCellValidation(t) { - t || (t = this.getInvalidCells()), - Array.isArray(t) || (t = [t]), - t.forEach((e) => { - this.clearValidation(e._getSelf()); - }); - } - userValidate(t) { - var e = []; - return ( - this.table.rowManager.rows.forEach((i) => { - var o = (i = i.getComponent()).validate(); - o !== !0 && (e = e.concat(o)); - }), - !e.length || e - ); - } - initializeColumnCheck(t) { - t.definition.validator !== void 0 && this.initializeColumn(t); - } - initializeColumn(t) { - var e, - i = this, - o = []; - t.definition.validator && - (Array.isArray(t.definition.validator) - ? t.definition.validator.forEach((n) => { - (e = i._extractValidator(n)) && o.push(e); - }) - : (e = this._extractValidator( - t.definition.validator - )) && o.push(e), - (t.modules.validate = !!o.length && o)); - } - _extractValidator(t) { - var e, i, o; - switch (typeof t) { - case "string": - return ( - (o = t.indexOf(":")) > -1 - ? ((e = t.substring(0, o)), - (i = t.substring(o + 1))) - : (e = t), - this._buildValidator(e, i) - ); - case "function": - return this._buildValidator(t); - case "object": - return this._buildValidator(t.type, t.parameters); - } - } - _buildValidator(t, e) { - var i = typeof t == "function" ? t : rt.validators[t]; - return i - ? { - type: typeof t == "function" ? "function" : t, - func: i, - params: e, - } - : (console.warn( - "Validator Setup Error - No matching validator found:", - t - ), - !1); - } - validate(t, e, i) { - var o = this, - n = [], - r = this.invalidCells.indexOf(e); - return ( - t && - t.forEach((a) => { - a.func.call(o, e.getComponent(), i, a.params) || - n.push({ type: a.type, parameters: a.params }); - }), - e.modules.validate || (e.modules.validate = {}), - n.length - ? ((e.modules.validate.invalid = n), - this.table.options.validationMode !== "manual" && - e - .getElement() - .classList.add("tabulator-validation-fail"), - r == -1 && this.invalidCells.push(e)) - : ((e.modules.validate.invalid = !1), - e - .getElement() - .classList.remove("tabulator-validation-fail"), - r > -1 && this.invalidCells.splice(r, 1)), - !n.length || n - ); - } - getInvalidCells() { - var t = []; - return ( - this.invalidCells.forEach((e) => { - t.push(e.getComponent()); - }), - t - ); - } - clearValidation(t) { - var e; - t.modules.validate && - t.modules.validate.invalid && - (t - .getElement() - .classList.remove("tabulator-validation-fail"), - (t.modules.validate.invalid = !1), - (e = this.invalidCells.indexOf(t)) > -1 && - this.invalidCells.splice(e, 1)); - } - }; - b(rt, "moduleName", "validate"), b(rt, "validators", Ci); - let _t = rt; - var Vt = Object.freeze({ - __proto__: null, - AccessorModule: ft, - AjaxModule: Ct, - ClipboardModule: Et, - ColumnCalcsModule: yt, - DataTreeModule: - ((Nt = class extends w { - constructor(s) { - super(s), - (this.indent = 10), - (this.field = ""), - (this.collapseEl = null), - (this.expandEl = null), - (this.branchEl = null), - (this.elementField = !1), - (this.startOpen = function () {}), - this.registerTableOption("dataTree", !1), - this.registerTableOption("dataTreeFilter", !0), - this.registerTableOption("dataTreeSort", !0), - this.registerTableOption( - "dataTreeElementColumn", - !1 - ), - this.registerTableOption( - "dataTreeBranchElement", - !0 - ), - this.registerTableOption( - "dataTreeChildIndent", - 9 - ), - this.registerTableOption( - "dataTreeChildField", - "_children" - ), - this.registerTableOption( - "dataTreeCollapseElement", - !1 - ), - this.registerTableOption( - "dataTreeExpandElement", - !1 - ), - this.registerTableOption( - "dataTreeStartExpanded", - !1 - ), - this.registerTableOption( - "dataTreeChildColumnCalcs", - !1 - ), - this.registerTableOption( - "dataTreeSelectPropagate", - !1 - ), - this.registerComponentFunction( - "row", - "treeCollapse", - this.collapseRow.bind(this) - ), - this.registerComponentFunction( - "row", - "treeExpand", - this.expandRow.bind(this) - ), - this.registerComponentFunction( - "row", - "treeToggle", - this.toggleRow.bind(this) - ), - this.registerComponentFunction( - "row", - "getTreeParent", - this.getTreeParent.bind(this) - ), - this.registerComponentFunction( - "row", - "getTreeChildren", - this.getRowChildren.bind(this) - ), - this.registerComponentFunction( - "row", - "addTreeChild", - this.addTreeChildRow.bind(this) - ), - this.registerComponentFunction( - "row", - "isTreeExpanded", - this.isRowExpanded.bind(this) - ); - } - initialize() { - if (this.table.options.dataTree) { - var s = null, - t = this.table.options; - switch ( - ((this.field = t.dataTreeChildField), - (this.indent = t.dataTreeChildIndent), - this.options("movableRows") && - console.warn( - "The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior" - ), - t.dataTreeBranchElement - ? t.dataTreeBranchElement === !0 - ? ((this.branchEl = - document.createElement( - "div" - )), - this.branchEl.classList.add( - "tabulator-data-tree-branch" - )) - : typeof t.dataTreeBranchElement == - "string" - ? (((s = - document.createElement( - "div" - )).innerHTML = - t.dataTreeBranchElement), - (this.branchEl = s.firstChild)) - : (this.branchEl = - t.dataTreeBranchElement) - : ((this.branchEl = - document.createElement("div")), - this.branchEl.classList.add( - "tabulator-data-tree-branch-empty" - )), - t.dataTreeCollapseElement - ? typeof t.dataTreeCollapseElement == - "string" - ? (((s = - document.createElement( - "div" - )).innerHTML = - t.dataTreeCollapseElement), - (this.collapseEl = s.firstChild)) - : (this.collapseEl = - t.dataTreeCollapseElement) - : ((this.collapseEl = - document.createElement("div")), - this.collapseEl.classList.add( - "tabulator-data-tree-control" - ), - (this.collapseEl.tabIndex = 0), - (this.collapseEl.innerHTML = - "
")), - t.dataTreeExpandElement - ? typeof t.dataTreeExpandElement == - "string" - ? (((s = - document.createElement( - "div" - )).innerHTML = - t.dataTreeExpandElement), - (this.expandEl = s.firstChild)) - : (this.expandEl = - t.dataTreeExpandElement) - : ((this.expandEl = - document.createElement("div")), - this.expandEl.classList.add( - "tabulator-data-tree-control" - ), - (this.expandEl.tabIndex = 0), - (this.expandEl.innerHTML = - "
")), - typeof t.dataTreeStartExpanded) - ) { - case "boolean": - this.startOpen = function (e, i) { - return t.dataTreeStartExpanded; - }; - break; - case "function": - this.startOpen = - t.dataTreeStartExpanded; - break; - default: - this.startOpen = function (e, i) { - return t.dataTreeStartExpanded[i]; - }; - } - this.subscribe( - "row-init", - this.initializeRow.bind(this) - ), - this.subscribe( - "row-layout-after", - this.layoutRow.bind(this) - ), - this.subscribe( - "row-deleting", - this.rowDeleting.bind(this) - ), - this.subscribe( - "row-deleted", - this.rowDelete.bind(this), - 0 - ), - this.subscribe( - "row-data-changed", - this.rowDataChanged.bind(this), - 10 - ), - this.subscribe( - "cell-value-updated", - this.cellValueChanged.bind(this) - ), - this.subscribe( - "edit-cancelled", - this.cellValueChanged.bind(this) - ), - this.subscribe( - "column-moving-rows", - this.columnMoving.bind(this) - ), - this.subscribe( - "table-built", - this.initializeElementField.bind(this) - ), - this.subscribe( - "table-redrawing", - this.tableRedrawing.bind(this) - ), - this.registerDisplayHandler( - this.getRows.bind(this), - 30 - ); - } - } - tableRedrawing(s) { - s && - this.table.rowManager.getRows().forEach((t) => { - this.reinitializeRowChildren(t); - }); - } - initializeElementField() { - var s = - this.table.columnManager.getFirstVisibleColumn(); - this.elementField = - this.table.options.dataTreeElementColumn || - (!!s && s.field); - } - getRowChildren(s) { - return this.getTreeChildren(s, !0); - } - columnMoving() { - var s = []; - return ( - this.table.rowManager.rows.forEach((t) => { - s = s.concat( - this.getTreeChildren(t, !1, !0) - ); - }), - s - ); - } - rowDataChanged(s, t, e) { - this.redrawNeeded(e) && - (this.initializeRow(s), - t && (this.layoutRow(s), this.refreshData(!0))); - } - cellValueChanged(s) { - s.column.getField() === this.elementField && - this.layoutRow(s.row); - } - initializeRow(s) { - var t = s.getData()[this.field], - e = Array.isArray(t), - i = - e || - (!e && typeof t == "object" && t !== null); - !i && - s.modules.dataTree && - s.modules.dataTree.branchEl && - s.modules.dataTree.branchEl.parentNode.removeChild( - s.modules.dataTree.branchEl - ), - !i && - s.modules.dataTree && - s.modules.dataTree.controlEl && - s.modules.dataTree.controlEl.parentNode.removeChild( - s.modules.dataTree.controlEl - ), - (s.modules.dataTree = { - index: s.modules.dataTree - ? s.modules.dataTree.index - : 0, - open: - !!i && - (s.modules.dataTree - ? s.modules.dataTree.open - : this.startOpen( - s.getComponent(), - 0 - )), - controlEl: - !(!s.modules.dataTree || !i) && - s.modules.dataTree.controlEl, - branchEl: - !(!s.modules.dataTree || !i) && - s.modules.dataTree.branchEl, - parent: - !!s.modules.dataTree && - s.modules.dataTree.parent, - children: i, - }); - } - reinitializeRowChildren(s) { - this.getTreeChildren(s, !1, !0).forEach(function ( - t - ) { - t.reinitialize(!0); - }); - } - layoutRow(s) { - var t = ( - this.elementField - ? s.getCell(this.elementField) - : s.getCells()[0] - ).getElement(), - e = s.modules.dataTree; - e.branchEl && - (e.branchEl.parentNode && - e.branchEl.parentNode.removeChild( - e.branchEl - ), - (e.branchEl = !1)), - e.controlEl && - (e.controlEl.parentNode && - e.controlEl.parentNode.removeChild( - e.controlEl - ), - (e.controlEl = !1)), - this.generateControlElement(s, t), - s - .getElement() - .classList.add( - "tabulator-tree-level-" + e.index - ), - e.index && - (this.branchEl - ? ((e.branchEl = - this.branchEl.cloneNode(!0)), - t.insertBefore( - e.branchEl, - t.firstChild - ), - this.table.rtl - ? (e.branchEl.style.marginRight = - (e.branchEl.offsetWidth + - e.branchEl.style - .marginLeft) * - (e.index - 1) + - e.index * this.indent + - "px") - : (e.branchEl.style.marginLeft = - (e.branchEl.offsetWidth + - e.branchEl.style - .marginRight) * - (e.index - 1) + - e.index * this.indent + - "px")) - : this.table.rtl - ? (t.style.paddingRight = - parseInt( - window - .getComputedStyle(t, null) - .getPropertyValue( - "padding-right" - ) - ) + - e.index * this.indent + - "px") - : (t.style.paddingLeft = - parseInt( - window - .getComputedStyle(t, null) - .getPropertyValue( - "padding-left" - ) - ) + - e.index * this.indent + - "px")); - } - generateControlElement(s, t) { - var e = s.modules.dataTree, - i = e.controlEl; - (t = t || s.getCells()[0].getElement()), - e.children !== !1 && - (e.open - ? ((e.controlEl = - this.collapseEl.cloneNode(!0)), - e.controlEl.addEventListener( - "click", - (o) => { - o.stopPropagation(), - this.collapseRow(s); - } - )) - : ((e.controlEl = - this.expandEl.cloneNode(!0)), - e.controlEl.addEventListener( - "click", - (o) => { - o.stopPropagation(), - this.expandRow(s); - } - )), - e.controlEl.addEventListener( - "mousedown", - (o) => { - o.stopPropagation(); - } - ), - i && i.parentNode === t - ? i.parentNode.replaceChild( - e.controlEl, - i - ) - : t.insertBefore( - e.controlEl, - t.firstChild - )); - } - getRows(s) { - var t = []; - return ( - s.forEach((e, i) => { - var o; - t.push(e), - e instanceof k && - (e.create(), - (o = e.modules.dataTree).index || - o.children === !1 || - this.getChildren( - e, - !1, - !0 - ).forEach((n) => { - n.create(), t.push(n); - })); - }), - t - ); - } - getChildren(s, t, e) { - var i = s.modules.dataTree, - o = [], - n = []; - return ( - i.children !== !1 && - (i.open || t) && - (Array.isArray(i.children) || - (i.children = this.generateChildren(s)), - (o = - this.table.modExists("filter") && - this.table.options.dataTreeFilter - ? this.table.modules.filter.filter( - i.children - ) - : i.children), - this.table.modExists("sort") && - this.table.options.dataTreeSort && - this.table.modules.sort.sort(o, e), - o.forEach((r) => { - n.push(r), - this.getChildren(r, !1, !0).forEach( - (a) => { - n.push(a); - } - ); - })), - n - ); - } - generateChildren(s) { - var t = [], - e = s.getData()[this.field]; - return ( - Array.isArray(e) || (e = [e]), - e.forEach((i) => { - var o = new k( - i || {}, - this.table.rowManager - ); - o.create(), - (o.modules.dataTree.index = - s.modules.dataTree.index + 1), - (o.modules.dataTree.parent = s), - o.modules.dataTree.children && - (o.modules.dataTree.open = - this.startOpen( - o.getComponent(), - o.modules.dataTree.index - )), - t.push(o); - }), - t - ); - } - expandRow(s, t) { - var e = s.modules.dataTree; - e.children !== !1 && - ((e.open = !0), - s.reinitialize(), - this.refreshData(!0), - this.dispatchExternal( - "dataTreeRowExpanded", - s.getComponent(), - s.modules.dataTree.index - )); - } - collapseRow(s) { - var t = s.modules.dataTree; - t.children !== !1 && - ((t.open = !1), - s.reinitialize(), - this.refreshData(!0), - this.dispatchExternal( - "dataTreeRowCollapsed", - s.getComponent(), - s.modules.dataTree.index - )); - } - toggleRow(s) { - var t = s.modules.dataTree; - t.children !== !1 && - (t.open - ? this.collapseRow(s) - : this.expandRow(s)); - } - isRowExpanded(s) { - return s.modules.dataTree.open; - } - getTreeParent(s) { - return ( - !!s.modules.dataTree.parent && - s.modules.dataTree.parent.getComponent() - ); - } - getTreeParentRoot(s) { - return s.modules.dataTree && - s.modules.dataTree.parent - ? this.getTreeParentRoot( - s.modules.dataTree.parent - ) - : s; - } - getFilteredTreeChildren(s) { - var t = s.modules.dataTree, - e = []; - return ( - t.children && - (Array.isArray(t.children) || - (t.children = this.generateChildren(s)), - (this.table.modExists("filter") && - this.table.options.dataTreeFilter - ? this.table.modules.filter.filter( - t.children - ) - : t.children - ).forEach((i) => { - i instanceof k && e.push(i); - })), - e - ); - } - rowDeleting(s) { - var t = s.modules.dataTree; - t && - t.children && - Array.isArray(t.children) && - t.children.forEach((e) => { - e instanceof k && e.wipe(); - }); - } - rowDelete(s) { - var t, - e = s.modules.dataTree.parent; - e && - ((t = this.findChildIndex(s, e)) !== !1 && - e.data[this.field].splice(t, 1), - e.data[this.field].length || - delete e.data[this.field], - this.initializeRow(e), - this.layoutRow(e)), - this.refreshData(!0); - } - addTreeChildRow(s, t, e, i) { - var o = !1; - typeof t == "string" && (t = JSON.parse(t)), - Array.isArray(s.data[this.field]) || - ((s.data[this.field] = []), - (s.modules.dataTree.open = this.startOpen( - s.getComponent(), - s.modules.dataTree.index - ))), - i !== void 0 && - (o = this.findChildIndex(i, s)) !== !1 && - s.data[this.field].splice( - e ? o : o + 1, - 0, - t - ), - o === !1 && - (e - ? s.data[this.field].unshift(t) - : s.data[this.field].push(t)), - this.initializeRow(s), - this.layoutRow(s), - this.refreshData(!0); - } - findChildIndex(s, t) { - var e = !1; - return ( - typeof s == "object" - ? s instanceof k - ? (e = s.data) - : s instanceof ht - ? (e = s._getSelf().data) - : typeof HTMLElement < "u" && - s instanceof HTMLElement - ? t.modules.dataTree && - (e = t.modules.dataTree.children.find( - (i) => - i instanceof k && - i.element === s - )) && - (e = e.data) - : s === null && (e = !1) - : (e = - s !== void 0 && - t.data[this.field].find( - (i) => - i.data[ - this.table.options.index - ] == s - )), - e && - (Array.isArray(t.data[this.field]) && - (e = t.data[this.field].indexOf(e)), - e == -1 && (e = !1)), - e - ); - } - getTreeChildren(s, t, e) { - var i = s.modules.dataTree, - o = []; - return ( - i && - i.children && - (Array.isArray(i.children) || - (i.children = this.generateChildren(s)), - i.children.forEach((n) => { - n instanceof k && - (o.push(t ? n.getComponent() : n), - e && - this.getTreeChildren( - n, - t, - e - ).forEach((r) => { - o.push(r); - })); - })), - o - ); - } - getChildField() { - return this.field; - } - redrawNeeded(s) { - return ( - (!!this.field && s[this.field] !== void 0) || - (!!this.elementField && - s[this.elementField] !== void 0) - ); - } - }), - b(Nt, "moduleName", "dataTree"), - Nt), - DownloadModule: Rt, - EditModule: xt, - ExportModule: kt, - FilterModule: Mt, - FormatModule: Lt, - FrozenColumnsModule: - ((Wt = class extends w { - constructor(s) { - super(s), - (this.leftColumns = []), - (this.rightColumns = []), - (this.initializationMode = "left"), - (this.active = !1), - (this.blocked = !0), - this.registerColumnOption("frozen"); - } - reset() { - (this.initializationMode = "left"), - (this.leftColumns = []), - (this.rightColumns = []), - (this.active = !1); - } - initialize() { - this.subscribe( - "cell-layout", - this.layoutCell.bind(this) - ), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe( - "column-width", - this.layout.bind(this) - ), - this.subscribe( - "row-layout-after", - this.layoutRow.bind(this) - ), - this.subscribe( - "table-layout", - this.layout.bind(this) - ), - this.subscribe( - "columns-loading", - this.reset.bind(this) - ), - this.subscribe( - "column-add", - this.reinitializeColumns.bind(this) - ), - this.subscribe( - "column-deleted", - this.reinitializeColumns.bind(this) - ), - this.subscribe( - "column-hide", - this.reinitializeColumns.bind(this) - ), - this.subscribe( - "column-show", - this.reinitializeColumns.bind(this) - ), - this.subscribe( - "columns-loaded", - this.reinitializeColumns.bind(this) - ), - this.subscribe( - "table-redraw", - this.layout.bind(this) - ), - this.subscribe( - "layout-refreshing", - this.blockLayout.bind(this) - ), - this.subscribe( - "layout-refreshed", - this.unblockLayout.bind(this) - ), - this.subscribe( - "scrollbar-vertical", - this.adjustForScrollbar.bind(this) - ); - } - blockLayout() { - this.blocked = !0; - } - unblockLayout() { - this.blocked = !1; - } - layoutCell(s) { - this.layoutElement(s.element, s.column); - } - reinitializeColumns() { - this.reset(), - this.table.columnManager.columnsByIndex.forEach( - (s) => { - this.initializeColumn(s); - } - ), - this.layout(); - } - initializeColumn(s) { - var t = { margin: 0, edge: !1 }; - s.isGroup || - (this.frozenCheck(s) - ? ((t.position = this.initializationMode), - this.initializationMode == "left" - ? this.leftColumns.push(s) - : this.rightColumns.unshift(s), - (this.active = !0), - (s.modules.frozen = t)) - : (this.initializationMode = "right")); - } - frozenCheck(s) { - return ( - s.parent.isGroup && - s.definition.frozen && - console.warn( - "Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups" - ), - s.parent.isGroup - ? this.frozenCheck(s.parent) - : s.definition.frozen - ); - } - layoutCalcRows() { - 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 - ), - this.table.modExists("groupRows") && - this.layoutGroupCalcs( - this.table.modules.groupRows.getGroups() - )); - } - layoutGroupCalcs(s) { - s.forEach((t) => { - t.calcs.top && this.layoutRow(t.calcs.top), - t.calcs.bottom && - this.layoutRow(t.calcs.bottom), - t.groupList && - t.groupList.length && - this.layoutGroupCalcs(t.groupList); - }); - } - layoutColumnPosition(s) { - var t = [], - e = 0, - i = 0; - this.leftColumns.forEach((o, n) => { - if ( - ((o.modules.frozen.marginValue = e), - (o.modules.frozen.margin = - o.modules.frozen.marginValue + "px"), - o.visible && (e += o.getWidth()), - n == this.leftColumns.length - 1 - ? (o.modules.frozen.edge = !0) - : (o.modules.frozen.edge = !1), - o.parent.isGroup) - ) { - var r = this.getColGroupParentElement(o); - t.includes(r) || - (this.layoutElement(r, o), t.push(r)), - r.classList.toggle( - "tabulator-frozen-left", - o.modules.frozen.edge && - o.modules.frozen.position === - "left" - ), - r.classList.toggle( - "tabulator-frozen-right", - o.modules.frozen.edge && - o.modules.frozen.position === - "right" - ); - } else this.layoutElement(o.getElement(), o); - s && - o.cells.forEach((a) => { - this.layoutElement(a.getElement(!0), o); - }); - }), - this.rightColumns.forEach((o, n) => { - (o.modules.frozen.marginValue = i), - (o.modules.frozen.margin = - o.modules.frozen.marginValue + - "px"), - o.visible && (i += o.getWidth()), - n == this.rightColumns.length - 1 - ? (o.modules.frozen.edge = !0) - : (o.modules.frozen.edge = !1), - o.parent.isGroup - ? this.layoutElement( - this.getColGroupParentElement( - o - ), - o - ) - : this.layoutElement( - o.getElement(), - o - ), - s && - o.cells.forEach((r) => { - this.layoutElement( - r.getElement(!0), - o - ); - }); - }); - } - getColGroupParentElement(s) { - return s.parent.isGroup - ? this.getColGroupParentElement(s.parent) - : s.getElement(); - } - layout() { - this.active && - !this.blocked && - (this.layoutColumnPosition(), - this.reinitializeRows(), - this.layoutCalcRows()); - } - reinitializeRows() { - var s = this.table.rowManager.getVisibleRows(!0); - this.table.rowManager - .getRows() - .filter((t) => !s.includes(t)) - .forEach((t) => { - t.deinitialize(); - }), - s.forEach((t) => { - t.type === "row" && this.layoutRow(t); - }); - } - layoutRow(s) { - this.table.options.layout === "fitDataFill" && - this.rightColumns.length && - (this.table.rowManager.getTableElement().style.minWidth = - "calc(100% - " + this.rightMargin + ")"), - this.leftColumns.forEach((t) => { - var e = s.getCell(t); - e && - this.layoutElement(e.getElement(!0), t); - }), - this.rightColumns.forEach((t) => { - var e = s.getCell(t); - e && - this.layoutElement(e.getElement(!0), t); - }); - } - layoutElement(s, t) { - var e; - t.modules.frozen && - s && - ((s.style.position = "sticky"), - (e = this.table.rtl - ? t.modules.frozen.position === "left" - ? "right" - : "left" - : t.modules.frozen.position), - (s.style[e] = t.modules.frozen.margin), - s.classList.add("tabulator-frozen"), - s.classList.toggle( - "tabulator-frozen-left", - t.modules.frozen.edge && - t.modules.frozen.position === "left" - ), - s.classList.toggle( - "tabulator-frozen-right", - t.modules.frozen.edge && - t.modules.frozen.position === "right" - )); - } - adjustForScrollbar(s) { - this.rightColumns.length && - (this.table.columnManager.getContentsElement().style.width = - "calc(100% - " + s + "px)"); - } - getFrozenColumns() { - return this.leftColumns.concat(this.rightColumns); - } - _calcSpace(s, t) { - var e = 0; - for (let i = 0; i < t; i++) - s[i].visible && (e += s[i].getWidth()); - return e; - } - }), - b(Wt, "moduleName", "frozenColumns"), - Wt), - FrozenRowsModule: - ((jt = class extends w { - constructor(s) { - super(s), - (this.topElement = - document.createElement("div")), - (this.rows = []), - this.registerComponentFunction( - "row", - "freeze", - this.freezeRow.bind(this) - ), - this.registerComponentFunction( - "row", - "unfreeze", - this.unfreezeRow.bind(this) - ), - this.registerComponentFunction( - "row", - "isFrozen", - this.isRowFrozen.bind(this) - ), - this.registerTableOption( - "frozenRowsField", - "id" - ), - this.registerTableOption("frozenRows", !1); - } - initialize() { - var s = document.createDocumentFragment(); - (this.rows = []), - this.topElement.classList.add( - "tabulator-frozen-rows-holder" - ), - s.appendChild(document.createElement("br")), - s.appendChild(this.topElement), - this.table.columnManager - .getContentsElement() - .insertBefore( - s, - this.table.columnManager.headersElement - .nextSibling - ), - this.subscribe( - "row-deleting", - this.detachRow.bind(this) - ), - this.subscribe( - "rows-visible", - this.visibleRows.bind(this) - ), - this.registerDisplayHandler( - this.getRows.bind(this), - 10 - ), - this.table.options.frozenRows && - (this.subscribe( - "data-processed", - this.initializeRows.bind(this) - ), - this.subscribe( - "row-added", - this.initializeRow.bind(this) - ), - this.subscribe( - "table-redrawing", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-resized", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-show", - this.resizeHolderWidth.bind(this) - ), - this.subscribe( - "column-hide", - this.resizeHolderWidth.bind(this) - )), - this.resizeHolderWidth(); - } - resizeHolderWidth() { - this.topElement.style.minWidth = - this.table.columnManager.headersElement - .offsetWidth + "px"; - } - initializeRows() { - this.table.rowManager.getRows().forEach((s) => { - this.initializeRow(s); - }); - } - initializeRow(s) { - var t = this.table.options.frozenRows, - e = typeof t; - e === "number" - ? s.getPosition() && - s.getPosition() + this.rows.length <= t && - this.freezeRow(s) - : e === "function" - ? t.call(this.table, s.getComponent()) && - this.freezeRow(s) - : Array.isArray(t) && - t.includes( - s.data[this.options("frozenRowsField")] - ) && - this.freezeRow(s); - } - isRowFrozen(s) { - return this.rows.indexOf(s) > -1; - } - isFrozen() { - return !!this.rows.length; - } - visibleRows(s, t) { - return ( - this.rows.forEach((e) => { - t.push(e); - }), - t - ); - } - getRows(s) { - var t = s.slice(0); - return ( - this.rows.forEach(function (e) { - var i = t.indexOf(e); - i > -1 && t.splice(i, 1); - }), - t - ); - } - freezeRow(s) { - s.modules.frozen - ? console.warn( - "Freeze Error - Row is already frozen" - ) - : ((s.modules.frozen = !0), - this.topElement.appendChild(s.getElement()), - s.initialize(), - s.normalizeHeight(), - this.rows.push(s), - this.refreshData(!1, "display"), - this.table.rowManager.adjustTableSize(), - this.styleRows()); - } - unfreezeRow(s) { - s.modules.frozen - ? ((s.modules.frozen = !1), - this.detachRow(s), - this.table.rowManager.adjustTableSize(), - this.refreshData(!1, "display"), - this.rows.length && this.styleRows()) - : console.warn( - "Freeze Error - Row is already unfrozen" - ); - } - detachRow(s) { - var t = this.rows.indexOf(s); - if (t > -1) { - var e = s.getElement(); - e.parentNode && e.parentNode.removeChild(e), - this.rows.splice(t, 1); - } - } - styleRows(s) { - this.rows.forEach((t, e) => { - this.table.rowManager.styleRow(t, e); - }); - } - }), - b(jt, "moduleName", "frozenRows"), - jt), - GroupRowsModule: - ((Gt = class extends w { - constructor(s) { - super(s), - (this.groupIDLookups = !1), - (this.startOpen = [ - function () { - return !1; - }, - ]), - (this.headerGenerator = [ - function () { - return ""; - }, - ]), - (this.groupList = []), - (this.allowedValues = !1), - (this.groups = {}), - (this.displayHandler = this.getRows.bind(this)), - (this.blockRedraw = !1), - this.registerTableOption("groupBy", !1), - this.registerTableOption("groupStartOpen", !0), - this.registerTableOption("groupValues", !1), - this.registerTableOption( - "groupUpdateOnCellEdit", - !1 - ), - this.registerTableOption("groupHeader", !1), - this.registerTableOption( - "groupHeaderPrint", - null - ), - this.registerTableOption( - "groupHeaderClipboard", - null - ), - this.registerTableOption( - "groupHeaderHtmlOutput", - null - ), - this.registerTableOption( - "groupHeaderDownload", - null - ), - this.registerTableOption( - "groupToggleElement", - "arrow" - ), - this.registerTableOption( - "groupClosedShowCalcs", - !1 - ), - this.registerTableFunction( - "setGroupBy", - this.setGroupBy.bind(this) - ), - this.registerTableFunction( - "setGroupValues", - this.setGroupValues.bind(this) - ), - this.registerTableFunction( - "setGroupStartOpen", - this.setGroupStartOpen.bind(this) - ), - this.registerTableFunction( - "setGroupHeader", - this.setGroupHeader.bind(this) - ), - this.registerTableFunction( - "getGroups", - this.userGetGroups.bind(this) - ), - this.registerTableFunction( - "getGroupedData", - this.userGetGroupedData.bind(this) - ), - this.registerComponentFunction( - "row", - "getGroup", - this.rowGetGroup.bind(this) - ); - } - initialize() { - this.subscribe( - "table-destroy", - this._blockRedrawing.bind(this) - ), - this.subscribe( - "rows-wipe", - this._blockRedrawing.bind(this) - ), - this.subscribe( - "rows-wiped", - this._restore_redrawing.bind(this) - ), - this.table.options.groupBy && - (this.table.options.groupUpdateOnCellEdit && - (this.subscribe( - "cell-value-updated", - this.cellUpdated.bind(this) - ), - this.subscribe( - "row-data-changed", - this.reassignRowToGroup.bind(this), - 0 - )), - this.subscribe( - "table-built", - this.configureGroupSetup.bind(this) - ), - this.subscribe( - "row-deleting", - this.rowDeleting.bind(this) - ), - this.subscribe( - "row-deleted", - this.rowsUpdated.bind(this) - ), - this.subscribe( - "scroll-horizontal", - this.scrollHeaders.bind(this) - ), - this.subscribe( - "rows-wipe", - this.wipe.bind(this) - ), - this.subscribe( - "rows-added", - this.rowsUpdated.bind(this) - ), - this.subscribe( - "row-moving", - this.rowMoving.bind(this) - ), - this.subscribe( - "row-adding-index", - this.rowAddingIndex.bind(this) - ), - this.subscribe( - "rows-sample", - this.rowSample.bind(this) - ), - this.subscribe( - "render-virtual-fill", - this.virtualRenderFill.bind(this) - ), - this.registerDisplayHandler( - this.displayHandler, - 20 - ), - (this.initialized = !0)); - } - _blockRedrawing() { - this.blockRedraw = !0; - } - _restore_redrawing() { - this.blockRedraw = !1; - } - configureGroupSetup() { - if (this.table.options.groupBy) { - var s = this.table.options.groupBy, - t = this.table.options.groupStartOpen, - e = this.table.options.groupHeader; - (this.allowedValues = - this.table.options.groupValues), - Array.isArray(s) && - Array.isArray(e) && - s.length > e.length && - console.warn( - "Error creating group headers, groupHeader array is shorter than groupBy array" - ), - (this.headerGenerator = [ - function () { - return ""; - }, - ]), - (this.startOpen = [ - function () { - return !1; - }, - ]), - this.langBind("groups|item", (i, o) => { - this.headerGenerator[0] = (n, r, a) => - (n === void 0 ? "" : n) + - "(" + - r + - " " + - (r === 1 ? i : o.groups.items) + - ")"; - }), - (this.groupIDLookups = []), - s - ? this.table.modExists("columnCalcs") && - this.table.options.columnCalcs != - "table" && - this.table.options.columnCalcs != - "both" && - this.table.modules.columnCalcs.removeCalcs() - : this.table.modExists("columnCalcs") && - this.table.options.columnCalcs != - "group" && - this.table.columnManager - .getRealColumns() - .forEach((i) => { - i.definition.topCalc && - this.table.modules.columnCalcs.initializeTopRow(), - i.definition.bottomCalc && - this.table.modules.columnCalcs.initializeBottomRow(); - }), - Array.isArray(s) || (s = [s]), - s.forEach((i, o) => { - var n, r; - (n = - typeof i == "function" - ? i - : (r = - this.table.columnManager.getColumnByField( - i - )) - ? function (a) { - return r.getFieldValue(a); - } - : function (a) { - return a[i]; - }), - this.groupIDLookups.push({ - field: - typeof i != "function" && i, - func: n, - values: - !!this.allowedValues && - this.allowedValues[o], - }); - }), - t && - (Array.isArray(t) || (t = [t]), - t.forEach((i) => {}), - (this.startOpen = t)), - e && - (this.headerGenerator = Array.isArray(e) - ? e - : [e]); - } else (this.groupList = []), (this.groups = {}); - } - rowSample(s, t) { - if (this.table.options.groupBy) { - var e = this.getGroups(!1)[0]; - t.push(e.getRows(!1)[0]); - } - return t; - } - virtualRenderFill() { - var s = this.table.rowManager.tableElement, - t = this.table.rowManager.getVisibleRows(); - if (!this.table.options.groupBy) return t; - (t = t.filter((e) => e.type !== "group")), - (s.style.minWidth = t.length - ? "" - : this.table.columnManager.getWidth() + - "px"); - } - rowAddingIndex(s, t, e) { - if (this.table.options.groupBy) { - this.assignRowToGroup(s); - var i = s.modules.group.rows; - return ( - i.length > 1 && - (!t || (t && i.indexOf(t) == -1) - ? e - ? i[0] !== s && - ((t = i[0]), - this.table.rowManager.moveRowInArray( - s.modules.group.rows, - s, - t, - !e - )) - : i[i.length - 1] !== s && - ((t = i[i.length - 1]), - this.table.rowManager.moveRowInArray( - s.modules.group.rows, - s, - t, - !e - )) - : this.table.rowManager.moveRowInArray( - s.modules.group.rows, - s, - t, - !e - )), - t - ); - } - } - trackChanges() { - this.dispatch("group-changed"); - } - setGroupBy(s) { - (this.table.options.groupBy = s), - this.initialized || this.initialize(), - this.configureGroupSetup(), - !s && - this.table.modExists("columnCalcs") && - this.table.options.columnCalcs === !0 && - this.table.modules.columnCalcs.reinitializeCalcs(), - this.refreshData(), - this.trackChanges(); - } - setGroupValues(s) { - (this.table.options.groupValues = s), - this.configureGroupSetup(), - this.refreshData(), - this.trackChanges(); - } - setGroupStartOpen(s) { - (this.table.options.groupStartOpen = s), - this.configureGroupSetup(), - this.table.options.groupBy - ? (this.refreshData(), this.trackChanges()) - : console.warn( - "Grouping Update - cant refresh view, no groups have been set" - ); - } - setGroupHeader(s) { - (this.table.options.groupHeader = s), - this.configureGroupSetup(), - this.table.options.groupBy - ? (this.refreshData(), this.trackChanges()) - : console.warn( - "Grouping Update - cant refresh view, no groups have been set" - ); - } - userGetGroups(s) { - return this.getGroups(!0); - } - userGetGroupedData() { - return this.table.options.groupBy - ? this.getGroupedData() - : this.getData(); - } - rowGetGroup(s) { - return ( - !!s.modules.group && - s.modules.group.getComponent() - ); - } - rowMoving(s, t, e) { - if (this.table.options.groupBy) { - !e && - t instanceof K && - (t = - this.table.rowManager.prevDisplayRow( - s - ) || t); - var i = t instanceof K ? t : t.modules.group, - o = s instanceof K ? s : s.modules.group; - i === o - ? this.table.rowManager.moveRowInArray( - i.rows, - s, - t, - e - ) - : (o && o.removeRow(s), - i.insertRow(s, t, e)); - } - } - rowDeleting(s) { - this.table.options.groupBy && - s.modules.group && - s.modules.group.removeRow(s); - } - rowsUpdated(s) { - this.table.options.groupBy && - this.updateGroupRows(!0); - } - cellUpdated(s) { - this.table.options.groupBy && - this.reassignRowToGroup(s.row); - } - getRows(s) { - return this.table.options.groupBy && - this.groupIDLookups.length - ? (this.dispatchExternal("dataGrouping"), - this.generateGroups(s), - this.subscribedExternal("dataGrouped") && - this.dispatchExternal( - "dataGrouped", - this.getGroups(!0) - ), - this.updateGroupRows()) - : s.slice(0); - } - getGroups(s) { - var t = []; - return ( - this.groupList.forEach(function (e) { - t.push(s ? e.getComponent() : e); - }), - t - ); - } - getChildGroups(s) { - var t = []; - return ( - s || (s = this), - s.groupList.forEach((e) => { - e.groupList.length - ? (t = t.concat(this.getChildGroups(e))) - : t.push(e); - }), - t - ); - } - wipe() { - this.table.options.groupBy && - (this.groupList.forEach(function (s) { - s.wipe(); - }), - (this.groupList = []), - (this.groups = {})); - } - pullGroupListData(s) { - var t = []; - return ( - s.forEach((e) => { - var i = { - level: 0, - rowCount: 0, - headerContent: "", - }, - o = []; - e.hasSubGroups - ? ((o = this.pullGroupListData( - e.groupList - )), - (i.level = e.level), - (i.rowCount = - o.length - e.groupList.length), - (i.headerContent = e.generator( - e.key, - i.rowCount, - e.rows, - e - )), - t.push(i), - (t = t.concat(o))) - : ((i.level = e.level), - (i.headerContent = e.generator( - e.key, - e.rows.length, - e.rows, - e - )), - (i.rowCount = e.getRows().length), - t.push(i), - e.getRows().forEach((n) => { - t.push(n.getData("data")); - })); - }), - t - ); - } - getGroupedData() { - return this.pullGroupListData(this.groupList); - } - getRowGroup(s) { - var t = !1; - return ( - this.options("dataTree") && - (s = - this.table.modules.dataTree.getTreeParentRoot( - s - )), - this.groupList.forEach((e) => { - var i = e.getRowGroup(s); - i && (t = i); - }), - t - ); - } - countGroups() { - return this.groupList.length; - } - generateGroups(s) { - var t = this.groups; - (this.groups = {}), - (this.groupList = []), - this.allowedValues && this.allowedValues[0] - ? (this.allowedValues[0].forEach((e) => { - this.createGroup(e, 0, t); - }), - s.forEach((e) => { - this.assignRowToExistingGroup(e, t); - })) - : s.forEach((e) => { - this.assignRowToGroup(e, t); - }), - Object.values(t).forEach((e) => { - e.wipe(!0); - }); - } - createGroup(s, t, e) { - var i, - o = t + "_" + s; - (e = e || []), - (i = new K( - this, - !1, - t, - s, - this.groupIDLookups[0].field, - this.headerGenerator[0], - e[o] - )), - (this.groups[o] = i), - this.groupList.push(i); - } - assignRowToExistingGroup(s, t) { - var e = - "0_" + this.groupIDLookups[0].func(s.getData()); - this.groups[e] && this.groups[e].addRow(s); - } - assignRowToGroup(s, t) { - var e = this.groupIDLookups[0].func(s.getData()), - i = !this.groups["0_" + e]; - return ( - i && this.createGroup(e, 0, t), - this.groups["0_" + e].addRow(s), - !i - ); - } - reassignRowToGroup(s) { - if (s.type === "row") { - var t = s.modules.group, - e = t.getPath(), - i = this.getExpectedPath(s); - (e.length == i.length && - e.every((o, n) => o === i[n])) || - (t.removeRow(s), - this.assignRowToGroup(s, this.groups), - this.refreshData(!0)); - } - } - getExpectedPath(s) { - var t = [], - e = s.getData(); - return ( - this.groupIDLookups.forEach((i) => { - t.push(i.func(e)); - }), - t - ); - } - updateGroupRows(s) { - var t = []; - return ( - this.blockRedraw || - (this.groupList.forEach((e) => { - t = t.concat(e.getHeadersAndRows()); - }), - s && this.refreshData(!0)), - t - ); - } - scrollHeaders(s) { - this.table.options.groupBy && - (this.table.options.renderHorizontal === - "virtual" && - (s -= - this.table.columnManager.renderer - .vDomPadLeft), - (s += "px"), - this.groupList.forEach((t) => { - t.scrollHeader(s); - })); - } - removeGroup(s) { - var t, - e = s.level + "_" + s.key; - this.groups[e] && - (delete this.groups[e], - (t = this.groupList.indexOf(s)) > -1 && - this.groupList.splice(t, 1)); - } - checkBasicModeGroupHeaderWidth() { - var s = this.table.rowManager.tableElement, - t = !0; - this.table.rowManager - .getDisplayRows() - .forEach((e, i) => { - this.table.rowManager.styleRow(e, i), - s.appendChild(e.getElement()), - e.initialize(!0), - e.type !== "group" && (t = !1); - }), - (s.style.minWidth = t - ? this.table.columnManager.getWidth() + "px" - : ""); - } - }), - b(Gt, "moduleName", "groupRows"), - Gt), - HistoryModule: St, - HtmlTableImportModule: - ((Ut = class extends w { - constructor(s) { - super(s), - (this.fieldIndex = []), - (this.hasIndex = !1); - } - initialize() { - this.tableElementCheck(); - } - tableElementCheck() { - this.table.originalElement && - this.table.originalElement.tagName === - "TABLE" && - (this.table.originalElement.childNodes.length - ? this.parseTable() - : console.warn( - "Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element." - )); - } - parseTable() { - var s = this.table.originalElement, - t = this.table.options, - e = s.getElementsByTagName("th"), - i = s.getElementsByTagName("tbody")[0], - o = []; - (this.hasIndex = !1), - this.dispatchExternal("htmlImporting"), - (i = i ? i.getElementsByTagName("tr") : []), - this._extractOptions(s, t), - e.length - ? this._extractHeaders(e, i) - : this._generateBlankHeaders(e, i); - for (var n = 0; n < i.length; n++) { - var r = i[n].getElementsByTagName("td"), - a = {}; - this.hasIndex || (a[t.index] = n); - for (var l = 0; l < r.length; l++) { - var h = r[l]; - this.fieldIndex[l] !== void 0 && - (a[this.fieldIndex[l]] = h.innerHTML); - } - o.push(a); - } - (t.data = o), this.dispatchExternal("htmlImported"); - } - _extractOptions(s, t, e) { - var i = s.attributes, - o = Object.keys(e || t), - n = {}; - for (var r in (o.forEach((h) => { - n[h.toLowerCase()] = h; - }), - i)) { - var a, - l = i[r]; - l && - typeof l == "object" && - l.name && - l.name.indexOf("tabulator-") === 0 && - ((a = l.name.replace("tabulator-", "")), - n[a] !== void 0 && - (t[n[a]] = this._attribValue(l.value))); - } - } - _attribValue(s) { - return s === "true" || (s !== "false" && s); - } - _findCol(s) { - return ( - this.table.options.columns.find( - (t) => t.title === s - ) || !1 - ); - } - _extractHeaders(s, t) { - for (var e = 0; e < s.length; e++) { - var i, - o = s[e], - n = !1, - r = this._findCol(o.textContent); - r - ? (n = !0) - : (r = { title: o.textContent.trim() }), - r.field || - (r.field = o.textContent - .trim() - .toLowerCase() - .replaceAll(" ", "_")), - (i = o.getAttribute("width")) && - !r.width && - (r.width = i), - this._extractOptions( - o, - r, - this.table.columnManager.optionsList - .registeredDefaults - ), - (this.fieldIndex[e] = r.field), - r.field == this.table.options.index && - (this.hasIndex = !0), - n || this.table.options.columns.push(r); - } - } - _generateBlankHeaders(s, t) { - for (var e = 0; e < s.length; e++) { - var i = s[e], - o = { title: "", field: "col" + e }; - this.fieldIndex[e] = o.field; - var n = i.getAttribute("width"); - n && (o.width = n), - this.table.options.columns.push(o); - } - } - }), - b(Ut, "moduleName", "htmlTableImport"), - Ut), - ImportModule: Dt, - InteractionModule: - ((Jt = class extends w { - constructor(s) { - super(s), - (this.eventMap = { - rowClick: "row-click", - rowDblClick: "row-dblclick", - rowContext: "row-contextmenu", - rowMouseEnter: "row-mouseenter", - rowMouseLeave: "row-mouseleave", - rowMouseOver: "row-mouseover", - rowMouseOut: "row-mouseout", - rowMouseMove: "row-mousemove", - rowMouseDown: "row-mousedown", - rowMouseUp: "row-mouseup", - rowTap: "row", - rowDblTap: "row", - rowTapHold: "row", - cellClick: "cell-click", - cellDblClick: "cell-dblclick", - cellContext: "cell-contextmenu", - cellMouseEnter: "cell-mouseenter", - cellMouseLeave: "cell-mouseleave", - cellMouseOver: "cell-mouseover", - cellMouseOut: "cell-mouseout", - cellMouseMove: "cell-mousemove", - cellMouseDown: "cell-mousedown", - cellMouseUp: "cell-mouseup", - cellTap: "cell", - cellDblTap: "cell", - cellTapHold: "cell", - headerClick: "column-click", - headerDblClick: "column-dblclick", - headerContext: "column-contextmenu", - headerMouseEnter: "column-mouseenter", - headerMouseLeave: "column-mouseleave", - headerMouseOver: "column-mouseover", - headerMouseOut: "column-mouseout", - headerMouseMove: "column-mousemove", - headerMouseDown: "column-mousedown", - headerMouseUp: "column-mouseup", - headerTap: "column", - headerDblTap: "column", - headerTapHold: "column", - groupClick: "group-click", - groupDblClick: "group-dblclick", - groupContext: "group-contextmenu", - groupMouseEnter: "group-mouseenter", - groupMouseLeave: "group-mouseleave", - groupMouseOver: "group-mouseover", - groupMouseOut: "group-mouseout", - groupMouseMove: "group-mousemove", - groupMouseDown: "group-mousedown", - groupMouseUp: "group-mouseup", - groupTap: "group", - groupDblTap: "group", - groupTapHold: "group", - }), - (this.subscribers = {}), - (this.touchSubscribers = {}), - (this.columnSubscribers = {}), - (this.touchWatchers = { - row: { - tap: null, - tapDbl: null, - tapHold: null, - }, - cell: { - tap: null, - tapDbl: null, - tapHold: null, - }, - column: { - tap: null, - tapDbl: null, - tapHold: null, - }, - group: { - tap: null, - tapDbl: null, - tapHold: null, - }, - }), - this.registerColumnOption("headerClick"), - this.registerColumnOption("headerDblClick"), - this.registerColumnOption("headerContext"), - this.registerColumnOption("headerMouseEnter"), - this.registerColumnOption("headerMouseLeave"), - this.registerColumnOption("headerMouseOver"), - this.registerColumnOption("headerMouseOut"), - this.registerColumnOption("headerMouseMove"), - this.registerColumnOption("headerMouseDown"), - this.registerColumnOption("headerMouseUp"), - this.registerColumnOption("headerTap"), - this.registerColumnOption("headerDblTap"), - this.registerColumnOption("headerTapHold"), - this.registerColumnOption("cellClick"), - this.registerColumnOption("cellDblClick"), - this.registerColumnOption("cellContext"), - this.registerColumnOption("cellMouseEnter"), - this.registerColumnOption("cellMouseLeave"), - this.registerColumnOption("cellMouseOver"), - this.registerColumnOption("cellMouseOut"), - this.registerColumnOption("cellMouseMove"), - this.registerColumnOption("cellMouseDown"), - this.registerColumnOption("cellMouseUp"), - this.registerColumnOption("cellTap"), - this.registerColumnOption("cellDblTap"), - this.registerColumnOption("cellTapHold"); - } - initialize() { - this.initializeExternalEvents(), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe( - "cell-dblclick", - this.cellContentsSelectionFixer.bind(this) - ), - this.subscribe( - "scroll-horizontal", - this.clearTouchWatchers.bind(this) - ), - this.subscribe( - "scroll-vertical", - this.clearTouchWatchers.bind(this) - ); - } - clearTouchWatchers() { - Object.values(this.touchWatchers).forEach((s) => { - for (let t in s) s[t] = null; - }); - } - cellContentsSelectionFixer(s, t) { - var e; - if ( - !this.table.modExists("edit") || - this.table.modules.edit.currentCell !== t - ) { - s.preventDefault(); - try { - document.selection - ? ((e = - document.body.createTextRange()).moveToElementText( - t.getElement() - ), - e.select()) - : window.getSelection && - ((e = - document.createRange()).selectNode( - t.getElement() - ), - window - .getSelection() - .removeAllRanges(), - window.getSelection().addRange(e)); - } catch {} - } - } - initializeExternalEvents() { - for (let s in this.eventMap) - this.subscriptionChangeExternal( - s, - this.subscriptionChanged.bind(this, s) - ); - } - subscriptionChanged(s, t) { - t - ? this.subscribers[s] || - (this.eventMap[s].includes("-") - ? ((this.subscribers[s] = - this.handle.bind(this, s)), - this.subscribe( - this.eventMap[s], - this.subscribers[s] - )) - : this.subscribeTouchEvents(s)) - : this.eventMap[s].includes("-") - ? !this.subscribers[s] || - this.columnSubscribers[s] || - this.subscribedExternal(s) || - (this.unsubscribe( - this.eventMap[s], - this.subscribers[s] - ), - delete this.subscribers[s]) - : this.unsubscribeTouchEvents(s); - } - subscribeTouchEvents(s) { - var t = this.eventMap[s]; - this.touchSubscribers[t + "-touchstart"] || - ((this.touchSubscribers[t + "-touchstart"] = - this.handleTouch.bind(this, t, "start")), - (this.touchSubscribers[t + "-touchend"] = - this.handleTouch.bind(this, t, "end")), - this.subscribe( - t + "-touchstart", - this.touchSubscribers[t + "-touchstart"] - ), - this.subscribe( - t + "-touchend", - this.touchSubscribers[t + "-touchend"] - )), - (this.subscribers[s] = !0); - } - unsubscribeTouchEvents(s) { - var t = !0, - e = this.eventMap[s]; - if ( - this.subscribers[s] && - !this.subscribedExternal(s) - ) { - delete this.subscribers[s]; - for (let i in this.eventMap) - this.eventMap[i] === e && - this.subscribers[i] && - (t = !1); - t && - (this.unsubscribe( - e + "-touchstart", - this.touchSubscribers[e + "-touchstart"] - ), - this.unsubscribe( - e + "-touchend", - this.touchSubscribers[e + "-touchend"] - ), - delete this.touchSubscribers[ - e + "-touchstart" - ], - delete this.touchSubscribers[ - e + "-touchend" - ]); - } - } - initializeColumn(s) { - var t = s.definition; - for (let e in this.eventMap) - t[e] && - (this.subscriptionChanged(e, !0), - this.columnSubscribers[e] || - (this.columnSubscribers[e] = []), - this.columnSubscribers[e].push(s)); - } - handle(s, t, e) { - this.dispatchEvent(s, t, e); - } - handleTouch(s, t, e, i) { - var o = this.touchWatchers[s]; - switch ((s === "column" && (s = "header"), t)) { - case "start": - (o.tap = !0), - clearTimeout(o.tapHold), - (o.tapHold = setTimeout(() => { - clearTimeout(o.tapHold), - (o.tapHold = null), - (o.tap = null), - clearTimeout(o.tapDbl), - (o.tapDbl = null), - this.dispatchEvent( - s + "TapHold", - e, - i - ); - }, 1e3)); - break; - case "end": - o.tap && - ((o.tap = null), - this.dispatchEvent(s + "Tap", e, i)), - o.tapDbl - ? (clearTimeout(o.tapDbl), - (o.tapDbl = null), - this.dispatchEvent( - s + "DblTap", - e, - i - )) - : (o.tapDbl = setTimeout(() => { - clearTimeout(o.tapDbl), - (o.tapDbl = null); - }, 300)), - clearTimeout(o.tapHold), - (o.tapHold = null); - } - } - dispatchEvent(s, t, e) { - var i, - o = e.getComponent(); - this.columnSubscribers[s] && - (e instanceof et - ? (i = e.column.definition[s]) - : e instanceof G && (i = e.definition[s]), - i && i(t, o)), - this.dispatchExternal(s, t, o); - } - }), - b(Jt, "moduleName", "interaction"), - Jt), - KeybindingsModule: zt, - MenuModule: - ((qt = class extends w { - constructor(s) { - super(s), - (this.menuContainer = null), - (this.nestedMenuBlock = !1), - (this.currentComponent = null), - (this.rootPopup = null), - (this.columnSubscribers = {}), - this.registerTableOption("rowContextMenu", !1), - this.registerTableOption("rowClickMenu", !1), - this.registerTableOption("rowDblClickMenu", !1), - this.registerTableOption( - "groupContextMenu", - !1 - ), - this.registerTableOption("groupClickMenu", !1), - this.registerTableOption( - "groupDblClickMenu", - !1 - ), - this.registerColumnOption("headerContextMenu"), - this.registerColumnOption("headerClickMenu"), - this.registerColumnOption("headerDblClickMenu"), - this.registerColumnOption("headerMenu"), - this.registerColumnOption("headerMenuIcon"), - this.registerColumnOption("contextMenu"), - this.registerColumnOption("clickMenu"), - this.registerColumnOption("dblClickMenu"); - } - initialize() { - this.deprecatedOptionsCheck(), - this.initializeRowWatchers(), - this.initializeGroupWatchers(), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ); - } - deprecatedOptionsCheck() {} - initializeRowWatchers() { - this.table.options.rowContextMenu && - (this.subscribe( - "row-contextmenu", - this.loadMenuEvent.bind( - this, - this.table.options.rowContextMenu - ) - ), - this.table.on( - "rowTapHold", - this.loadMenuEvent.bind( - this, - this.table.options.rowContextMenu - ) - )), - this.table.options.rowClickMenu && - this.subscribe( - "row-click", - this.loadMenuEvent.bind( - this, - this.table.options.rowClickMenu - ) - ), - this.table.options.rowDblClickMenu && - this.subscribe( - "row-dblclick", - this.loadMenuEvent.bind( - this, - this.table.options.rowDblClickMenu - ) - ); - } - initializeGroupWatchers() { - this.table.options.groupContextMenu && - (this.subscribe( - "group-contextmenu", - this.loadMenuEvent.bind( - this, - this.table.options.groupContextMenu - ) - ), - this.table.on( - "groupTapHold", - this.loadMenuEvent.bind( - this, - this.table.options.groupContextMenu - ) - )), - this.table.options.groupClickMenu && - this.subscribe( - "group-click", - this.loadMenuEvent.bind( - this, - this.table.options.groupClickMenu - ) - ), - this.table.options.groupDblClickMenu && - this.subscribe( - "group-dblclick", - this.loadMenuEvent.bind( - this, - this.table.options.groupDblClickMenu - ) - ); - } - initializeColumn(s) { - var t = s.definition; - t.headerContextMenu && - !this.columnSubscribers.headerContextMenu && - ((this.columnSubscribers.headerContextMenu = - this.loadMenuTableColumnEvent.bind( - this, - "headerContextMenu" - )), - this.subscribe( - "column-contextmenu", - this.columnSubscribers.headerContextMenu - ), - this.table.on( - "headerTapHold", - this.loadMenuTableColumnEvent.bind( - this, - "headerContextMenu" - ) - )), - t.headerClickMenu && - !this.columnSubscribers.headerClickMenu && - ((this.columnSubscribers.headerClickMenu = - this.loadMenuTableColumnEvent.bind( - this, - "headerClickMenu" - )), - this.subscribe( - "column-click", - this.columnSubscribers.headerClickMenu - )), - t.headerDblClickMenu && - !this.columnSubscribers - .headerDblClickMenu && - ((this.columnSubscribers.headerDblClickMenu = - this.loadMenuTableColumnEvent.bind( - this, - "headerDblClickMenu" - )), - this.subscribe( - "column-dblclick", - this.columnSubscribers - .headerDblClickMenu - )), - t.headerMenu && - this.initializeColumnHeaderMenu(s), - t.contextMenu && - !this.columnSubscribers.contextMenu && - ((this.columnSubscribers.contextMenu = - this.loadMenuTableCellEvent.bind( - this, - "contextMenu" - )), - this.subscribe( - "cell-contextmenu", - this.columnSubscribers.contextMenu - ), - this.table.on( - "cellTapHold", - this.loadMenuTableCellEvent.bind( - this, - "contextMenu" - ) - )), - t.clickMenu && - !this.columnSubscribers.clickMenu && - ((this.columnSubscribers.clickMenu = - this.loadMenuTableCellEvent.bind( - this, - "clickMenu" - )), - this.subscribe( - "cell-click", - this.columnSubscribers.clickMenu - )), - t.dblClickMenu && - !this.columnSubscribers.dblClickMenu && - ((this.columnSubscribers.dblClickMenu = - this.loadMenuTableCellEvent.bind( - this, - "dblClickMenu" - )), - this.subscribe( - "cell-dblclick", - this.columnSubscribers.dblClickMenu - )); - } - initializeColumnHeaderMenu(s) { - var t, - e = s.definition.headerMenuIcon; - (t = document.createElement("span")).classList.add( - "tabulator-header-popup-button" - ), - e - ? (typeof e == "function" && - (e = e(s.getComponent())), - e instanceof HTMLElement - ? t.appendChild(e) - : (t.innerHTML = e)) - : (t.innerHTML = "⋮"), - t.addEventListener("click", (i) => { - i.stopPropagation(), - i.preventDefault(), - this.loadMenuEvent( - s.definition.headerMenu, - i, - s - ); - }), - s.titleElement.insertBefore( - t, - s.titleElement.firstChild - ); - } - loadMenuTableCellEvent(s, t, e) { - e._cell && (e = e._cell), - e.column.definition[s] && - this.loadMenuEvent( - e.column.definition[s], - t, - e - ); - } - loadMenuTableColumnEvent(s, t, e) { - e._column && (e = e._column), - e.definition[s] && - this.loadMenuEvent(e.definition[s], t, e); - } - loadMenuEvent(s, t, e) { - e._group ? (e = e._group) : e._row && (e = e._row), - (s = - typeof s == "function" - ? s.call( - this.table, - t, - e.getComponent() - ) - : s), - this.loadMenu(t, e, s); - } - loadMenu(s, t, e, i, o) { - var n, - r = !(s instanceof MouseEvent), - a = document.createElement("div"); - if ( - (a.classList.add("tabulator-menu"), - r || s.preventDefault(), - e && e.length) - ) { - if (i) n = o.child(a); - else { - if (this.nestedMenuBlock) { - if (this.rootPopup) return; - } else - this.nestedMenuBlock = setTimeout( - () => { - this.nestedMenuBlock = !1; - }, - 100 - ); - this.rootPopup && this.rootPopup.hide(), - (this.rootPopup = n = this.popup(a)); - } - e.forEach((l) => { - var h = document.createElement("div"), - d = l.label, - c = l.disabled; - l.separator - ? h.classList.add( - "tabulator-menu-separator" - ) - : (h.classList.add( - "tabulator-menu-item" - ), - typeof d == "function" && - (d = d.call( - this.table, - t.getComponent() - )), - d instanceof Node - ? h.appendChild(d) - : (h.innerHTML = d), - typeof c == "function" && - (c = c.call( - this.table, - t.getComponent() - )), - c - ? (h.classList.add( - "tabulator-menu-item-disabled" - ), - h.addEventListener( - "click", - (u) => { - u.stopPropagation(); - } - )) - : l.menu && l.menu.length - ? h.addEventListener( - "click", - (u) => { - u.stopPropagation(), - this.loadMenu( - u, - t, - l.menu, - h, - n - ); - } - ) - : l.action && - h.addEventListener( - "click", - (u) => { - l.action( - u, - t.getComponent() - ); - } - ), - l.menu && - l.menu.length && - h.classList.add( - "tabulator-menu-item-submenu" - )), - a.appendChild(h); - }), - a.addEventListener("click", (l) => { - this.rootPopup && this.rootPopup.hide(); - }), - n.show(i || s), - n === this.rootPopup && - (this.rootPopup.hideOnBlur(() => { - (this.rootPopup = null), - this.currentComponent && - (this.dispatch( - "menu-closed", - e, - n - ), - this.dispatchExternal( - "menuClosed", - this.currentComponent.getComponent() - ), - (this.currentComponent = - null)); - }), - (this.currentComponent = t), - this.dispatch("menu-opened", e, n), - this.dispatchExternal( - "menuOpened", - t.getComponent() - )); - } - } - }), - b(qt, "moduleName", "menu"), - qt), - MoveColumnsModule: - ((Xt = class extends w { - constructor(s) { - super(s), - (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)), - this.registerTableOption("movableColumns", !1); - } - createPlaceholderElement() { - var s = document.createElement("div"); - return ( - s.classList.add("tabulator-col"), - s.classList.add("tabulator-col-placeholder"), - s - ); - } - initialize() { - this.table.options.movableColumns && - (this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe( - "alert-show", - this.abortMove.bind(this) - )); - } - abortMove() { - clearTimeout(this.checkTimeout); - } - initializeColumn(s) { - var t, - e = this, - i = {}; - s.modules.frozen || - s.isGroup || - s.isRowHeader || - ((t = s.getElement()), - (i.mousemove = function (o) { - s.parent === e.moving.parent && - ((e.touchMove - ? o.touches[0].pageX - : o.pageX) - - x.elOffset(t).left + - e.table.columnManager - .contentsElement.scrollLeft > - s.getWidth() / 2 - ? (e.toCol === s && e.toColAfter) || - (t.parentNode.insertBefore( - e.placeholderElement, - t.nextSibling - ), - e.moveColumn(s, !0)) - : (e.toCol !== s || e.toColAfter) && - (t.parentNode.insertBefore( - e.placeholderElement, - t - ), - e.moveColumn(s, !1))); - }.bind(e)), - t.addEventListener("mousedown", function (o) { - (e.touchMove = !1), - o.which === 1 && - (e.checkTimeout = setTimeout( - function () { - e.startMove(o, s); - }, - e.checkPeriod - )); - }), - t.addEventListener("mouseup", function (o) { - o.which === 1 && - e.checkTimeout && - clearTimeout(e.checkTimeout); - }), - e.bindTouchEvents(s)), - (s.modules.moveColumn = i); - } - bindTouchEvents(s) { - var t, - e, - i, - o, - n, - r, - a = s.getElement(), - l = !1; - a.addEventListener( - "touchstart", - (h) => { - this.checkTimeout = setTimeout(() => { - (this.touchMove = !0), - (t = s.nextColumn()), - (i = t ? t.getWidth() / 2 : 0), - (e = s.prevColumn()), - (o = e ? e.getWidth() / 2 : 0), - (n = 0), - (r = 0), - (l = !1), - this.startMove(h, s); - }, this.checkPeriod); - }, - { passive: !0 } - ), - a.addEventListener( - "touchmove", - (h) => { - var d, c; - this.moving && - (this.moveHover(h), - l || (l = h.touches[0].pageX), - (d = h.touches[0].pageX - l) > 0 - ? t && - d - n > i && - (c = t) !== s && - ((l = h.touches[0].pageX), - c - .getElement() - .parentNode.insertBefore( - this - .placeholderElement, - c.getElement() - .nextSibling - ), - this.moveColumn(c, !0)) - : e && - -d - r > o && - (c = e) !== s && - ((l = h.touches[0].pageX), - c - .getElement() - .parentNode.insertBefore( - this - .placeholderElement, - c.getElement() - ), - this.moveColumn(c, !1)), - c && - ((t = c.nextColumn()), - (n = i), - (i = t ? t.getWidth() / 2 : 0), - (e = c.prevColumn()), - (r = o), - (o = e - ? e.getWidth() / 2 - : 0))); - }, - { passive: !0 } - ), - a.addEventListener("touchend", (h) => { - this.checkTimeout && - clearTimeout(this.checkTimeout), - this.moving && this.endMove(h); - }); - } - startMove(s, t) { - var e = t.getElement(), - i = - this.table.columnManager.getContentsElement(), - o = - this.table.columnManager.getHeadersElement(); - (this.table.modules.selectRange && - this.table.modules.selectRange - .columnSelection && - this.table.modules.selectRange.mousedown && - this.table.modules.selectRange.selecting === - "column") || - ((this.moving = t), - (this.startX = - (this.touchMove - ? s.touches[0].pageX - : s.pageX) - x.elOffset(e).left), - this.table.element.classList.add( - "tabulator-block-select" - ), - (this.placeholderElement.style.width = - t.getWidth() + "px"), - (this.placeholderElement.style.height = - t.getHeight() + "px"), - e.parentNode.insertBefore( - this.placeholderElement, - e - ), - e.parentNode.removeChild(e), - (this.hoverElement = e.cloneNode(!0)), - this.hoverElement.classList.add( - "tabulator-moving" - ), - i.appendChild(this.hoverElement), - (this.hoverElement.style.left = "0"), - (this.hoverElement.style.bottom = - i.clientHeight - o.offsetHeight + "px"), - this.touchMove || - (this._bindMouseMove(), - document.body.addEventListener( - "mousemove", - this.moveHover - ), - document.body.addEventListener( - "mouseup", - this.endMove - )), - this.moveHover(s), - this.dispatch("column-moving", s, this.moving)); - } - _bindMouseMove() { - this.table.columnManager.columnsByIndex.forEach( - function (s) { - s.modules.moveColumn.mousemove && - s - .getElement() - .addEventListener( - "mousemove", - s.modules.moveColumn.mousemove - ); - } - ); - } - _unbindMouseMove() { - this.table.columnManager.columnsByIndex.forEach( - function (s) { - s.modules.moveColumn.mousemove && - s - .getElement() - .removeEventListener( - "mousemove", - s.modules.moveColumn.mousemove - ); - } - ); - } - moveColumn(s, t) { - var e = this.moving.getCells(); - (this.toCol = s), - (this.toColAfter = t), - t - ? s.getCells().forEach(function (i, o) { - var n = i.getElement(!0); - n.parentNode && - e[o] && - n.parentNode.insertBefore( - e[o].getElement(), - n.nextSibling - ); - }) - : s.getCells().forEach(function (i, o) { - var n = i.getElement(!0); - n.parentNode && - e[o] && - n.parentNode.insertBefore( - e[o].getElement(), - n - ); - }); - } - endMove(s) { - (s.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" - ), - 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 - ))); - } - moveHover(s) { - var t, - e = - this.table.columnManager.getContentsElement(), - i = e.scrollLeft, - o = - (this.touchMove - ? s.touches[0].pageX - : s.pageX) - - x.elOffset(e).left + - i; - (this.hoverElement.style.left = - o - this.startX + "px"), - o - i < this.autoScrollMargin && - (this.autoScrollTimeout || - (this.autoScrollTimeout = setTimeout( - () => { - (t = Math.max(0, i - 5)), - (this.table.rowManager.getElement().scrollLeft = - t), - (this.autoScrollTimeout = - !1); - }, - 1 - ))), - i + e.clientWidth - o < this.autoScrollMargin && - (this.autoScrollTimeout || - (this.autoScrollTimeout = setTimeout( - () => { - (t = Math.min( - e.clientWidth, - i + 5 - )), - (this.table.rowManager.getElement().scrollLeft = - t), - (this.autoScrollTimeout = - !1); - }, - 1 - ))); - } - }), - b(Xt, "moduleName", "moveColumn"), - Xt), - MoveRowsModule: Pt, - MutatorModule: Ft, - PageModule: Ht, - PersistenceModule: Ot, - PopupModule: - ((Kt = class extends w { - constructor(s) { - super(s), - (this.columnSubscribers = {}), - this.registerTableOption("rowContextPopup", !1), - this.registerTableOption("rowClickPopup", !1), - this.registerTableOption( - "rowDblClickPopup", - !1 - ), - this.registerTableOption( - "groupContextPopup", - !1 - ), - this.registerTableOption("groupClickPopup", !1), - this.registerTableOption( - "groupDblClickPopup", - !1 - ), - this.registerColumnOption("headerContextPopup"), - this.registerColumnOption("headerClickPopup"), - this.registerColumnOption( - "headerDblClickPopup" - ), - this.registerColumnOption("headerPopup"), - this.registerColumnOption("headerPopupIcon"), - this.registerColumnOption("contextPopup"), - this.registerColumnOption("clickPopup"), - this.registerColumnOption("dblClickPopup"), - this.registerComponentFunction( - "cell", - "popup", - this._componentPopupCall.bind(this) - ), - this.registerComponentFunction( - "column", - "popup", - this._componentPopupCall.bind(this) - ), - this.registerComponentFunction( - "row", - "popup", - this._componentPopupCall.bind(this) - ), - this.registerComponentFunction( - "group", - "popup", - this._componentPopupCall.bind(this) - ); - } - initialize() { - this.initializeRowWatchers(), - this.initializeGroupWatchers(), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ); - } - _componentPopupCall(s, t, e) { - this.loadPopupEvent(t, null, s, e); - } - initializeRowWatchers() { - this.table.options.rowContextPopup && - (this.subscribe( - "row-contextmenu", - this.loadPopupEvent.bind( - this, - this.table.options.rowContextPopup - ) - ), - this.table.on( - "rowTapHold", - this.loadPopupEvent.bind( - this, - this.table.options.rowContextPopup - ) - )), - this.table.options.rowClickPopup && - this.subscribe( - "row-click", - this.loadPopupEvent.bind( - this, - this.table.options.rowClickPopup - ) - ), - this.table.options.rowDblClickPopup && - this.subscribe( - "row-dblclick", - this.loadPopupEvent.bind( - this, - this.table.options.rowDblClickPopup - ) - ); - } - initializeGroupWatchers() { - this.table.options.groupContextPopup && - (this.subscribe( - "group-contextmenu", - this.loadPopupEvent.bind( - this, - this.table.options.groupContextPopup - ) - ), - this.table.on( - "groupTapHold", - this.loadPopupEvent.bind( - this, - this.table.options.groupContextPopup - ) - )), - this.table.options.groupClickPopup && - this.subscribe( - "group-click", - this.loadPopupEvent.bind( - this, - this.table.options.groupClickPopup - ) - ), - this.table.options.groupDblClickPopup && - this.subscribe( - "group-dblclick", - this.loadPopupEvent.bind( - this, - this.table.options - .groupDblClickPopup - ) - ); - } - initializeColumn(s) { - var t = s.definition; - t.headerContextPopup && - !this.columnSubscribers.headerContextPopup && - ((this.columnSubscribers.headerContextPopup = - this.loadPopupTableColumnEvent.bind( - this, - "headerContextPopup" - )), - this.subscribe( - "column-contextmenu", - this.columnSubscribers.headerContextPopup - ), - this.table.on( - "headerTapHold", - this.loadPopupTableColumnEvent.bind( - this, - "headerContextPopup" - ) - )), - t.headerClickPopup && - !this.columnSubscribers.headerClickPopup && - ((this.columnSubscribers.headerClickPopup = - this.loadPopupTableColumnEvent.bind( - this, - "headerClickPopup" - )), - this.subscribe( - "column-click", - this.columnSubscribers.headerClickPopup - )), - t.headerDblClickPopup && - !this.columnSubscribers - .headerDblClickPopup && - ((this.columnSubscribers.headerDblClickPopup = - this.loadPopupTableColumnEvent.bind( - this, - "headerDblClickPopup" - )), - this.subscribe( - "column-dblclick", - this.columnSubscribers - .headerDblClickPopup - )), - t.headerPopup && - this.initializeColumnHeaderPopup(s), - t.contextPopup && - !this.columnSubscribers.contextPopup && - ((this.columnSubscribers.contextPopup = - this.loadPopupTableCellEvent.bind( - this, - "contextPopup" - )), - this.subscribe( - "cell-contextmenu", - this.columnSubscribers.contextPopup - ), - this.table.on( - "cellTapHold", - this.loadPopupTableCellEvent.bind( - this, - "contextPopup" - ) - )), - t.clickPopup && - !this.columnSubscribers.clickPopup && - ((this.columnSubscribers.clickPopup = - this.loadPopupTableCellEvent.bind( - this, - "clickPopup" - )), - this.subscribe( - "cell-click", - this.columnSubscribers.clickPopup - )), - t.dblClickPopup && - !this.columnSubscribers.dblClickPopup && - ((this.columnSubscribers.dblClickPopup = - this.loadPopupTableCellEvent.bind( - this, - "dblClickPopup" - )), - this.subscribe( - "cell-click", - this.columnSubscribers.dblClickPopup - )); - } - initializeColumnHeaderPopup(s) { - var t, - e = s.definition.headerPopupIcon; - (t = document.createElement("span")).classList.add( - "tabulator-header-popup-button" - ), - e - ? (typeof e == "function" && - (e = e(s.getComponent())), - e instanceof HTMLElement - ? t.appendChild(e) - : (t.innerHTML = e)) - : (t.innerHTML = "⋮"), - t.addEventListener("click", (i) => { - i.stopPropagation(), - i.preventDefault(), - this.loadPopupEvent( - s.definition.headerPopup, - i, - s - ); - }), - s.titleElement.insertBefore( - t, - s.titleElement.firstChild - ); - } - loadPopupTableCellEvent(s, t, e) { - e._cell && (e = e._cell), - e.column.definition[s] && - this.loadPopupEvent( - e.column.definition[s], - t, - e - ); - } - loadPopupTableColumnEvent(s, t, e) { - e._column && (e = e._column), - e.definition[s] && - this.loadPopupEvent(e.definition[s], t, e); - } - loadPopupEvent(s, t, e, i) { - var o; - e._group ? (e = e._group) : e._row && (e = e._row), - (s = - typeof s == "function" - ? s.call( - this.table, - t, - e.getComponent(), - function (n) { - o = n; - } - ) - : s), - this.loadPopup(t, e, s, o, i); - } - loadPopup(s, t, e, i, o) { - var n, - r, - a = !(s instanceof MouseEvent); - e instanceof HTMLElement - ? (n = e) - : ((n = - document.createElement("div")).innerHTML = - e), - n.classList.add("tabulator-popup"), - n.addEventListener("click", (l) => { - l.stopPropagation(); - }), - a || s.preventDefault(), - (r = this.popup(n)), - typeof i == "function" && r.renderCallback(i), - s - ? r.show(s) - : r.show(t.getElement(), o || "center"), - r.hideOnBlur(() => { - this.dispatchExternal( - "popupClosed", - t.getComponent() - ); - }), - this.dispatchExternal( - "popupOpened", - t.getComponent() - ); - } - }), - b(Kt, "moduleName", "popup"), - Kt), - PrintModule: - ((Yt = class extends w { - constructor(s) { - super(s), - (this.element = !1), - (this.manualBlock = !1), - (this.beforeprintEventHandler = null), - (this.afterprintEventHandler = null), - this.registerTableOption("printAsHtml", !1), - this.registerTableOption("printFormatter", !1), - this.registerTableOption("printHeader", !1), - this.registerTableOption("printFooter", !1), - this.registerTableOption("printStyled", !0), - this.registerTableOption( - "printRowRange", - "visible" - ), - this.registerTableOption("printConfig", {}), - this.registerColumnOption("print"), - this.registerColumnOption("titlePrint"); - } - initialize() { - this.table.options.printAsHtml && - ((this.beforeprintEventHandler = - this.replaceTable.bind(this)), - (this.afterprintEventHandler = - this.cleanup.bind(this)), - window.addEventListener( - "beforeprint", - this.beforeprintEventHandler - ), - window.addEventListener( - "afterprint", - this.afterprintEventHandler - ), - this.subscribe( - "table-destroy", - this.destroy.bind(this) - )), - this.registerTableFunction( - "print", - this.printFullscreen.bind(this) - ); - } - destroy() { - this.table.options.printAsHtml && - (window.removeEventListener( - "beforeprint", - this.beforeprintEventHandler - ), - window.removeEventListener( - "afterprint", - this.afterprintEventHandler - )); - } - replaceTable() { - this.manualBlock || - ((this.element = document.createElement("div")), - this.element.classList.add( - "tabulator-print-table" - ), - this.element.appendChild( - this.table.modules.export.generateTable( - 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 - )); - } - cleanup() { - document.body.classList.remove( - "tabulator-print-fullscreen-hide" - ), - this.element && - this.element.parentNode && - (this.element.parentNode.removeChild( - this.element - ), - (this.table.element.style.display = "")); - } - printFullscreen(s, t, e) { - var i, - o, - n = window.scrollX, - r = window.scrollY, - a = document.createElement("div"), - l = document.createElement("div"), - h = this.table.modules.export.generateTable( - e !== void 0 - ? e - : this.table.options.printConfig, - t !== void 0 - ? t - : this.table.options.printStyled, - s || this.table.options.printRowRange, - "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"), - typeof (i = - typeof this.table.options.printHeader == - "function" - ? this.table.options.printHeader.call( - this.table - ) - : this.table.options.printHeader) == - "string" - ? (a.innerHTML = i) - : a.appendChild(i), - this.element.appendChild(a)), - this.element.appendChild(h), - this.table.options.printFooter && - (l.classList.add("tabulator-print-footer"), - typeof (o = - typeof this.table.options.printFooter == - "function" - ? this.table.options.printFooter.call( - this.table - ) - : this.table.options.printFooter) == - "string" - ? (l.innerHTML = o) - : l.appendChild(o), - 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, - h - ), - window.print(), - this.cleanup(), - window.scrollTo(n, r), - (this.manualBlock = !1); - } - }), - b(Yt, "moduleName", "print"), - Yt), - ReactiveDataModule: - ((Qt = class extends w { - constructor(s) { - super(s), - (this.data = !1), - (this.blocked = !1), - (this.origFuncs = {}), - (this.currentVersion = 0), - this.registerTableOption("reactiveData", !1); - } - initialize() { - this.table.options.reactiveData && - (this.subscribe( - "cell-value-save-before", - this.block.bind(this, "cellsave") - ), - this.subscribe( - "cell-value-save-after", - this.unblock.bind(this, "cellsave") - ), - this.subscribe( - "row-data-save-before", - this.block.bind(this, "rowsave") - ), - this.subscribe( - "row-data-save-after", - this.unblock.bind(this, "rowsave") - ), - this.subscribe( - "row-data-init-after", - this.watchRow.bind(this) - ), - this.subscribe( - "data-processing", - this.watchData.bind(this) - ), - this.subscribe( - "table-destroy", - this.unwatchData.bind(this) - )); - } - watchData(s) { - var t, - e = this; - this.currentVersion++, - (t = this.currentVersion), - this.unwatchData(), - (this.data = s), - (this.origFuncs.push = s.push), - Object.defineProperty(this.data, "push", { - enumerable: !1, - configurable: !0, - value: function () { - var i, - o = Array.from(arguments); - return ( - e.blocked || - t !== e.currentVersion || - (e.block("data-push"), - o.forEach((n) => { - e.table.rowManager.addRowActual( - n, - !1 - ); - }), - (i = e.origFuncs.push.apply( - s, - arguments - )), - e.unblock("data-push")), - i - ); - }, - }), - (this.origFuncs.unshift = s.unshift), - Object.defineProperty(this.data, "unshift", { - enumerable: !1, - configurable: !0, - value: function () { - var i, - o = Array.from(arguments); - return ( - e.blocked || - t !== e.currentVersion || - (e.block("data-unshift"), - o.forEach((n) => { - e.table.rowManager.addRowActual( - n, - !0 - ); - }), - (i = e.origFuncs.unshift.apply( - s, - arguments - )), - e.unblock("data-unshift")), - i - ); - }, - }), - (this.origFuncs.shift = s.shift), - Object.defineProperty(this.data, "shift", { - enumerable: !1, - configurable: !0, - value: function () { - var i, o; - return ( - e.blocked || - t !== e.currentVersion || - (e.block("data-shift"), - e.data.length && - (i = - e.table.rowManager.getRowFromDataObject( - e.data[0] - )) && - i.deleteActual(), - (o = e.origFuncs.shift.call(s)), - e.unblock("data-shift")), - o - ); - }, - }), - (this.origFuncs.pop = s.pop), - Object.defineProperty(this.data, "pop", { - enumerable: !1, - configurable: !0, - value: function () { - var i, o; - return ( - e.blocked || - t !== e.currentVersion || - (e.block("data-pop"), - e.data.length && - (i = - e.table.rowManager.getRowFromDataObject( - e.data[ - e.data.length - - 1 - ] - )) && - i.deleteActual(), - (o = e.origFuncs.pop.call(s)), - e.unblock("data-pop")), - o - ); - }, - }), - (this.origFuncs.splice = s.splice), - Object.defineProperty(this.data, "splice", { - enumerable: !1, - configurable: !0, - value: function () { - var i, - o, - n = Array.from(arguments), - r = - n[0] < 0 - ? s.length + n[0] - : n[0], - a = n[1], - l = !!n[2] && n.slice(2); - if ( - !e.blocked && - t === e.currentVersion - ) { - if ( - (e.block("data-splice"), - l && - ((i = - !!s[r] && - e.table.rowManager.getRowFromDataObject( - s[r] - )) - ? l.forEach((d) => { - e.table.rowManager.addRowActual( - d, - !0, - i, - !0 - ); - }) - : (l = l - .slice() - .reverse()).forEach( - (d) => { - e.table.rowManager.addRowActual( - d, - !0, - !1, - !0 - ); - } - )), - a !== 0) - ) { - var h = s.slice( - r, - n[1] === void 0 - ? n[1] - : r + a - ); - h.forEach((d, c) => { - var u = - e.table.rowManager.getRowFromDataObject( - d - ); - u && - u.deleteActual( - c !== h.length - 1 - ); - }); - } - (l || a !== 0) && - e.table.rowManager.reRenderInPosition(), - (o = e.origFuncs.splice.apply( - s, - arguments - )), - e.unblock("data-splice"); - } - return o; - }, - }); - } - unwatchData() { - if (this.data !== !1) - for (var s in this.origFuncs) - Object.defineProperty(this.data, s, { - enumerable: !0, - configurable: !0, - writable: !0, - value: this.origFuncs.key, - }); - } - watchRow(s) { - var t = s.getData(); - for (var e in t) this.watchKey(s, t, e); - this.table.options.dataTree && - this.watchTreeChildren(s); - } - watchTreeChildren(s) { - var t = this, - e = - s.getData()[ - this.table.options.dataTreeChildField - ], - i = {}; - e && - ((i.push = e.push), - Object.defineProperty(e, "push", { - enumerable: !1, - configurable: !0, - value: () => { - if (!t.blocked) { - t.block("tree-push"); - var o = i.push.apply(e, arguments); - this.rebuildTree(s), - t.unblock("tree-push"); - } - return o; - }, - }), - (i.unshift = e.unshift), - Object.defineProperty(e, "unshift", { - enumerable: !1, - configurable: !0, - value: () => { - if (!t.blocked) { - t.block("tree-unshift"); - var o = i.unshift.apply( - e, - arguments - ); - this.rebuildTree(s), - t.unblock("tree-unshift"); - } - return o; - }, - }), - (i.shift = e.shift), - Object.defineProperty(e, "shift", { - enumerable: !1, - configurable: !0, - value: () => { - if (!t.blocked) { - t.block("tree-shift"); - var o = i.shift.call(e); - this.rebuildTree(s), - t.unblock("tree-shift"); - } - return o; - }, - }), - (i.pop = e.pop), - Object.defineProperty(e, "pop", { - enumerable: !1, - configurable: !0, - value: () => { - if (!t.blocked) { - t.block("tree-pop"); - var o = i.pop.call(e); - this.rebuildTree(s), - t.unblock("tree-pop"); - } - return o; - }, - }), - (i.splice = e.splice), - Object.defineProperty(e, "splice", { - enumerable: !1, - configurable: !0, - value: () => { - if (!t.blocked) { - t.block("tree-splice"); - var o = i.splice.apply( - e, - arguments - ); - this.rebuildTree(s), - t.unblock("tree-splice"); - } - return o; - }, - })); - } - rebuildTree(s) { - this.table.modules.dataTree.initializeRow(s), - this.table.modules.dataTree.layoutRow(s), - this.table.rowManager.refreshActiveData( - "tree", - !1, - !0 - ); - } - watchKey(s, t, e) { - var i = this, - o = Object.getOwnPropertyDescriptor(t, e), - n = t[e], - r = this.currentVersion; - Object.defineProperty(t, e, { - set: (a) => { - if ( - ((n = a), - !i.blocked && r === i.currentVersion) - ) { - i.block("key"); - var l = {}; - (l[e] = a), - s.updateData(l), - i.unblock("key"); - } - o.set && o.set(a); - }, - get: () => (o.get && o.get(), n), - }); - } - unwatchRow(s) { - var t = s.getData(); - for (var e in t) - Object.defineProperty(t, e, { value: t[e] }); - } - block(s) { - this.blocked || (this.blocked = s); - } - unblock(s) { - this.blocked === s && (this.blocked = !1); - } - }), - b(Qt, "moduleName", "reactiveData"), - Qt), - ResizeColumnsModule: - ((Zt = class extends w { - constructor(s) { - super(s), - (this.startColumn = !1), - (this.startX = !1), - (this.startWidth = !1), - (this.latestX = !1), - (this.handle = null), - (this.initialNextColumn = null), - (this.nextColumn = null), - (this.initialized = !1), - this.registerColumnOption("resizable", !0), - this.registerTableOption( - "resizableColumnFit", - !1 - ), - this.registerTableOption( - "resizableColumnGuide", - !1 - ); - } - initialize() { - this.subscribe( - "column-rendered", - this.layoutColumnHeader.bind(this) - ); - } - initializeEventWatchers() { - this.initialized || - (this.subscribe( - "cell-rendered", - this.layoutCellHandles.bind(this) - ), - this.subscribe( - "cell-delete", - this.deInitializeComponent.bind(this) - ), - this.subscribe( - "cell-height", - this.resizeHandle.bind(this) - ), - this.subscribe( - "column-moved", - this.columnLayoutUpdated.bind(this) - ), - this.subscribe( - "column-hide", - this.deInitializeColumn.bind(this) - ), - this.subscribe( - "column-show", - this.columnLayoutUpdated.bind(this) - ), - this.subscribe( - "column-width", - this.columnWidthUpdated.bind(this) - ), - this.subscribe( - "column-delete", - this.deInitializeComponent.bind(this) - ), - this.subscribe( - "column-height", - this.resizeHandle.bind(this) - ), - (this.initialized = !0)); - } - layoutCellHandles(s) { - s.row.type === "row" && - (this.deInitializeComponent(s), - this.initializeColumn( - "cell", - s, - s.column, - s.element - )); - } - layoutColumnHeader(s) { - s.definition.resizable && - (this.initializeEventWatchers(), - this.deInitializeComponent(s), - this.initializeColumn( - "header", - s, - s, - s.element - )); - } - columnLayoutUpdated(s) { - var t = s.prevColumn(); - this.reinitializeColumn(s), - t && this.reinitializeColumn(t); - } - columnWidthUpdated(s) { - s.modules.frozen && - (this.table.modules.frozenColumns.leftColumns.includes( - s - ) - ? this.table.modules.frozenColumns.leftColumns.forEach( - (t) => { - this.reinitializeColumn(t); - } - ) - : this.table.modules.frozenColumns.rightColumns.includes( - s - ) && - this.table.modules.frozenColumns.rightColumns.forEach( - (t) => { - this.reinitializeColumn(t); - } - )); - } - frozenColumnOffset(s) { - var t = !1; - return ( - s.modules.frozen && - ((t = s.modules.frozen.marginValue), - s.modules.frozen.position === "left" - ? (t += s.getWidth() - 3) - : t && (t -= 3)), - t !== !1 && t + "px" - ); - } - reinitializeColumn(s) { - var t = this.frozenColumnOffset(s); - s.cells.forEach((e) => { - e.modules.resize && - e.modules.resize.handleEl && - (t && - ((e.modules.resize.handleEl.style[ - s.modules.frozen.position - ] = t), - (e.modules.resize.handleEl.style[ - "z-index" - ] = 11)), - e.element.after(e.modules.resize.handleEl)); - }), - s.modules.resize && - s.modules.resize.handleEl && - (t && - (s.modules.resize.handleEl.style[ - s.modules.frozen.position - ] = t), - s.element.after(s.modules.resize.handleEl)); - } - initializeColumn(s, t, e, i) { - var o = this, - n = e.definition.resizable, - r = {}, - a = e.getLastColumn(); - if ( - (s === "header" && - (r = { - variableHeight: - e.definition.formatter == - "textarea" || - e.definition.variableHeight, - }), - (n === !0 || n == s) && - this._checkResizability(a)) - ) { - var l = document.createElement("span"); - (l.className = "tabulator-col-resize-handle"), - l.addEventListener("click", function (d) { - d.stopPropagation(); - }); - var h = function (d) { - (o.startColumn = e), - (o.initialNextColumn = o.nextColumn = - a.nextColumn()), - o._mouseDown(d, a, l); - }; - l.addEventListener("mousedown", h), - l.addEventListener("touchstart", h, { - passive: !0, - }), - l.addEventListener("dblclick", (d) => { - var c = a.getWidth(); - d.stopPropagation(), - a.reinitializeWidth(!0), - c !== a.getWidth() && - (o.dispatch( - "column-resized", - a - ), - o.dispatchExternal( - "columnResized", - a.getComponent() - )); - }), - e.modules.frozen && - ((l.style.position = "sticky"), - (l.style[e.modules.frozen.position] = - this.frozenColumnOffset(e))), - (r.handleEl = l), - i.parentNode && e.visible && i.after(l); - } - t.modules.resize = r; - } - deInitializeColumn(s) { - this.deInitializeComponent(s), - s.cells.forEach((t) => { - this.deInitializeComponent(t); - }); - } - deInitializeComponent(s) { - var t; - s.modules.resize && - (t = s.modules.resize.handleEl) && - t.parentElement && - t.parentElement.removeChild(t); - } - resizeHandle(s, t) { - s.modules.resize && - s.modules.resize.handleEl && - (s.modules.resize.handleEl.style.height = t); - } - resize(s, t) { - var e, - i, - o = - s.clientX === void 0 - ? s.touches[0].clientX - : s.clientX, - n = o - this.startX, - r = o - this.latestX; - if ( - ((this.latestX = o), - this.table.rtl && ((n = -n), (r = -r)), - (e = - t.width == t.minWidth || - t.width == t.maxWidth), - t.setWidth(this.startWidth + n), - (i = - t.width == t.minWidth || - t.width == t.maxWidth), - r < 0 && - (this.nextColumn = this.initialNextColumn), - this.table.options.resizableColumnFit && - this.nextColumn && - (!e || !i)) - ) { - let a = this.nextColumn.getWidth(); - r > 0 && - a <= this.nextColumn.minWidth && - (this.nextColumn = - this.nextColumn.nextColumn()), - this.nextColumn && - this.nextColumn.setWidth( - this.nextColumn.getWidth() - r - ); - } - this.table.columnManager.rerenderColumns(!0), - !this.table.browserSlow && - t.modules.resize && - t.modules.resize.variableHeight && - t.checkCellHeights(); - } - calcGuidePosition(s, t, e) { - var i = - s.clientX === void 0 - ? s.touches[0].clientX - : s.clientX, - o = - e.getBoundingClientRect().x - - this.table.element.getBoundingClientRect() - .x, - n = - this.table.element.getBoundingClientRect() - .x, - r = t.element.getBoundingClientRect().left - n, - a = i - this.startX, - l = Math.max(o + a, r + t.minWidth); - return ( - t.maxWidth && (l = Math.min(l, r + t.maxWidth)), - l - ); - } - _checkResizability(s) { - return s.definition.resizable; - } - _mouseDown(s, t, e) { - var i, - o = this; - function n(a) { - o.table.options.resizableColumnGuide - ? (i.style.left = - o.calcGuidePosition(a, t, e) + "px") - : o.resize(a, t); - } - function r(a) { - o.table.options.resizableColumnGuide && - (o.resize(a, t), i.remove()), - o.startColumn.modules.edit && - (o.startColumn.modules.edit.blocked = - !1), - o.table.browserSlow && - t.modules.resize && - t.modules.resize.variableHeight && - t.checkCellHeights(), - document.body.removeEventListener( - "mouseup", - r - ), - document.body.removeEventListener( - "mousemove", - n - ), - e.removeEventListener("touchmove", n), - e.removeEventListener("touchend", r), - o.table.element.classList.remove( - "tabulator-block-select" - ), - o.startWidth !== t.getWidth() && - (o.table.columnManager.verticalAlignHeaders(), - o.dispatch("column-resized", t), - o.dispatchExternal( - "columnResized", - t.getComponent() - )); - } - this.dispatchExternal( - "columnResizing", - t.getComponent() - ), - o.table.options.resizableColumnGuide && - ((i = - document.createElement( - "span" - )).classList.add( - "tabulator-col-resize-guide" - ), - o.table.element.appendChild(i), - setTimeout(() => { - i.style.left = - o.calcGuidePosition(s, t, e) + "px"; - })), - o.table.element.classList.add( - "tabulator-block-select" - ), - s.stopPropagation(), - o.startColumn.modules.edit && - (o.startColumn.modules.edit.blocked = !0), - (o.startX = - s.clientX === void 0 - ? s.touches[0].clientX - : s.clientX), - (o.latestX = o.startX), - (o.startWidth = t.getWidth()), - document.body.addEventListener("mousemove", n), - document.body.addEventListener("mouseup", r), - e.addEventListener("touchmove", n, { - passive: !0, - }), - e.addEventListener("touchend", r); - } - }), - b(Zt, "moduleName", "resizeColumns"), - Zt), - ResizeRowsModule: - (($t = class extends w { - constructor(s) { - super(s), - (this.startColumn = !1), - (this.startY = !1), - (this.startHeight = !1), - (this.handle = null), - (this.prevHandle = null), - this.registerTableOption("resizableRows", !1), - this.registerTableOption( - "resizableRowGuide", - !1 - ); - } - initialize() { - this.table.options.resizableRows && - this.subscribe( - "row-layout-after", - this.initializeRow.bind(this) - ); - } - initializeRow(s) { - var t = this, - e = s.getElement(), - i = document.createElement("div"); - i.className = "tabulator-row-resize-handle"; - var o = document.createElement("div"); - (o.className = "tabulator-row-resize-handle prev"), - i.addEventListener("click", function (a) { - a.stopPropagation(); - }); - var n = function (a) { - (t.startRow = s), t._mouseDown(a, s, i); - }; - i.addEventListener("mousedown", n), - i.addEventListener("touchstart", n, { - passive: !0, - }), - o.addEventListener("click", function (a) { - a.stopPropagation(); - }); - var r = function (a) { - var l = t.table.rowManager.prevDisplayRow(s); - l && ((t.startRow = l), t._mouseDown(a, l, o)); - }; - o.addEventListener("mousedown", r), - o.addEventListener("touchstart", r, { - passive: !0, - }), - e.appendChild(i), - e.appendChild(o); - } - resize(s, t) { - t.setHeight( - this.startHeight + - ((s.screenY === void 0 - ? s.touches[0].screenY - : s.screenY) - - this.startY) - ); - } - calcGuidePosition(s, t, e) { - var i = - s.screenY === void 0 - ? s.touches[0].screenY - : s.screenY, - o = - e.getBoundingClientRect().y - - this.table.element.getBoundingClientRect() - .y, - n = - this.table.element.getBoundingClientRect() - .y, - r = t.element.getBoundingClientRect().top - n, - a = i - this.startY; - return Math.max(o + a, r); - } - _mouseDown(s, t, e) { - var i, - o = this; - function n(a) { - o.table.options.resizableRowGuide - ? (i.style.top = - o.calcGuidePosition(a, t, e) + "px") - : o.resize(a, t); - } - function r(a) { - o.table.options.resizableRowGuide && - (o.resize(a, t), i.remove()), - document.body.removeEventListener( - "mouseup", - n - ), - document.body.removeEventListener( - "mousemove", - n - ), - e.removeEventListener("touchmove", n), - e.removeEventListener("touchend", r), - o.table.element.classList.remove( - "tabulator-block-select" - ), - o.dispatchExternal( - "rowResized", - t.getComponent() - ); - } - o.dispatchExternal("rowResizing", t.getComponent()), - o.table.options.resizableRowGuide && - ((i = - document.createElement( - "span" - )).classList.add( - "tabulator-row-resize-guide" - ), - o.table.element.appendChild(i), - setTimeout(() => { - i.style.top = - o.calcGuidePosition(s, t, e) + "px"; - })), - o.table.element.classList.add( - "tabulator-block-select" - ), - s.stopPropagation(), - (o.startY = - s.screenY === void 0 - ? s.touches[0].screenY - : s.screenY), - (o.startHeight = t.getHeight()), - document.body.addEventListener("mousemove", n), - document.body.addEventListener("mouseup", r), - e.addEventListener("touchmove", n, { - passive: !0, - }), - e.addEventListener("touchend", r); - } - }), - b($t, "moduleName", "resizeRows"), - $t), - ResizeTableModule: - ((te = class extends w { - constructor(s) { - super(s), - (this.binding = !1), - (this.visibilityObserver = !1), - (this.resizeObserver = !1), - (this.containerObserver = !1), - (this.tableHeight = 0), - (this.tableWidth = 0), - (this.containerHeight = 0), - (this.containerWidth = 0), - (this.autoResize = !1), - (this.visible = !1), - (this.initialized = !1), - (this.initialRedraw = !1), - this.registerTableOption("autoResize", !0); - } - initialize() { - if (this.table.options.autoResize) { - var s, - t = this.table; - (this.tableHeight = t.element.clientHeight), - (this.tableWidth = t.element.clientWidth), - t.element.parentNode && - ((this.containerHeight = - t.element.parentNode.clientHeight), - (this.containerWidth = - t.element.parentNode.clientWidth)), - typeof IntersectionObserver < "u" && - typeof ResizeObserver < "u" && - t.rowManager.getRenderMode() === "virtual" - ? (this.initializeVisibilityObserver(), - (this.autoResize = !0), - (this.resizeObserver = - new ResizeObserver((e) => { - if ( - !t.browserMobile || - (t.browserMobile && - (!t.modules.edit || - (t.modules.edit && - !t.modules - .edit - .currentCell))) - ) { - var i = Math.floor( - e[0].contentRect - .height - ), - o = Math.floor( - e[0].contentRect - .width - ); - (this.tableHeight == i && - this.tableWidth == - o) || - ((this.tableHeight = - i), - (this.tableWidth = o), - t.element - .parentNode && - ((this.containerHeight = - t.element.parentNode.clientHeight), - (this.containerWidth = - t.element.parentNode.clientWidth)), - this.redrawTable()); - } - })), - this.resizeObserver.observe( - t.element - ), - (s = window.getComputedStyle( - t.element - )), - this.table.element.parentNode && - !this.table.rowManager - .fixedHeight && - (s.getPropertyValue( - "max-height" - ) || - s.getPropertyValue( - "min-height" - )) && - ((this.containerObserver = - new ResizeObserver((e) => { - if ( - !t.browserMobile || - (t.browserMobile && - (!t.modules - .edit || - (t.modules - .edit && - !t.modules - .edit - .currentCell))) - ) { - var i = Math.floor( - e[0] - .contentRect - .height - ), - o = Math.floor( - e[0] - .contentRect - .width - ); - (this - .containerHeight == - i && - this - .containerWidth == - o) || - ((this.containerHeight = - i), - (this.containerWidth = - o), - (this.tableHeight = - t.element.clientHeight), - (this.tableWidth = - t.element.clientWidth)), - this.redrawTable(); - } - })), - this.containerObserver.observe( - this.table.element.parentNode - )), - this.subscribe( - "table-resize", - this.tableResized.bind(this) - )) - : ((this.binding = function () { - (!t.browserMobile || - (t.browserMobile && - (!t.modules.edit || - (t.modules.edit && - !t.modules.edit - .currentCell)))) && - (t.columnManager.rerenderColumns( - !0 - ), - t.redraw()); - }), - window.addEventListener( - "resize", - this.binding - )), - this.subscribe( - "table-destroy", - this.clearBindings.bind(this) - ); - } - } - initializeVisibilityObserver() { - (this.visibilityObserver = new IntersectionObserver( - (s) => { - (this.visible = s[0].isIntersecting), - this.initialized - ? this.visible && - (this.redrawTable( - this.initialRedraw - ), - (this.initialRedraw = !1)) - : ((this.initialized = !0), - (this.initialRedraw = - !this.visible)); - } - )), - this.visibilityObserver.observe( - this.table.element - ); - } - redrawTable(s) { - this.initialized && - this.visible && - (this.table.columnManager.rerenderColumns(!0), - this.table.redraw(s)); - } - tableResized() { - this.table.rowManager.redraw(); - } - clearBindings() { - this.binding && - window.removeEventListener( - "resize", - this.binding - ), - this.resizeObserver && - this.resizeObserver.unobserve( - this.table.element - ), - this.visibilityObserver && - this.visibilityObserver.unobserve( - this.table.element - ), - this.containerObserver && - this.containerObserver.unobserve( - this.table.element.parentNode - ); - } - }), - b(te, "moduleName", "resizeTable"), - te), - ResponsiveLayoutModule: - ((ct = class extends w { - constructor(s) { - super(s), - (this.columns = []), - (this.hiddenColumns = []), - (this.mode = ""), - (this.index = 0), - (this.collapseFormatter = []), - (this.collapseStartOpen = !0), - (this.collapseHandleColumn = !1), - this.registerTableOption( - "responsiveLayout", - !1 - ), - this.registerTableOption( - "responsiveLayoutCollapseStartOpen", - !0 - ), - this.registerTableOption( - "responsiveLayoutCollapseUseFormatters", - !0 - ), - this.registerTableOption( - "responsiveLayoutCollapseFormatter", - !1 - ), - this.registerColumnOption("responsive"); - } - initialize() { - this.table.options.responsiveLayout && - (this.subscribe( - "column-layout", - this.initializeColumn.bind(this) - ), - this.subscribe( - "column-show", - this.updateColumnVisibility.bind(this) - ), - this.subscribe( - "column-hide", - this.updateColumnVisibility.bind(this) - ), - this.subscribe( - "columns-loaded", - this.initializeResponsivity.bind(this) - ), - this.subscribe( - "column-moved", - this.initializeResponsivity.bind(this) - ), - this.subscribe( - "column-add", - this.initializeResponsivity.bind(this) - ), - this.subscribe( - "column-delete", - this.initializeResponsivity.bind(this) - ), - this.subscribe( - "table-redrawing", - this.tableRedraw.bind(this) - ), - this.table.options.responsiveLayout === - "collapse" && - (this.subscribe( - "row-data-changed", - this.generateCollapsedRowContent.bind( - this - ) - ), - this.subscribe( - "row-init", - this.initializeRow.bind(this) - ), - this.subscribe( - "row-layout", - this.layoutRow.bind(this) - ))); - } - tableRedraw(s) { - ["fitColumns", "fitDataStretch"].indexOf( - this.layoutMode() - ) === -1 && - (s || this.update()); - } - initializeResponsivity() { - var s = []; - (this.mode = this.table.options.responsiveLayout), - (this.collapseFormatter = - this.table.options - .responsiveLayoutCollapseFormatter || - this.formatCollapsedData), - (this.collapseStartOpen = - this.table.options.responsiveLayoutCollapseStartOpen), - (this.hiddenColumns = []), - this.collapseFormatter && - (this.collapseFormatter = - this.collapseFormatter.bind( - this.table - )), - this.table.columnManager.columnsByIndex.forEach( - (t, e) => { - t.modules.responsive && - t.modules.responsive.order && - t.modules.responsive.visible && - ((t.modules.responsive.index = e), - s.push(t), - t.visible || - this.mode !== "collapse" || - this.hiddenColumns.push(t)); - } - ), - (s = (s = s.reverse()).sort( - (t, e) => - e.modules.responsive.order - - t.modules.responsive.order || - e.modules.responsive.index - - t.modules.responsive.index - )), - (this.columns = s), - this.mode === "collapse" && - this.generateCollapsedContent(); - for (let t of this.table.columnManager - .columnsByIndex) - if ( - t.definition.formatter == - "responsiveCollapse" - ) { - this.collapseHandleColumn = t; - break; - } - this.collapseHandleColumn && - (this.hiddenColumns.length - ? this.collapseHandleColumn.show() - : this.collapseHandleColumn.hide()); - } - initializeColumn(s) { - var t = s.getDefinition(); - s.modules.responsive = { - order: - t.responsive === void 0 ? 1 : t.responsive, - visible: t.visible !== !1, - }; - } - initializeRow(s) { - var t; - s.type !== "calc" && - ((t = - document.createElement( - "div" - )).classList.add( - "tabulator-responsive-collapse" - ), - (s.modules.responsiveLayout = { - element: t, - open: this.collapseStartOpen, - }), - this.collapseStartOpen || - (t.style.display = "none")); - } - layoutRow(s) { - var t = s.getElement(); - s.modules.responsiveLayout && - (t.appendChild( - s.modules.responsiveLayout.element - ), - this.generateCollapsedRowContent(s)); - } - updateColumnVisibility(s, t) { - !t && - s.modules.responsive && - ((s.modules.responsive.visible = s.visible), - this.initializeResponsivity()); - } - hideColumn(s) { - var t = this.hiddenColumns.length; - s.hide(!1, !0), - this.mode === "collapse" && - (this.hiddenColumns.unshift(s), - this.generateCollapsedContent(), - this.collapseHandleColumn && - !t && - this.collapseHandleColumn.show()); - } - showColumn(s) { - var t; - s.show(!1, !0), - s.setWidth(s.getWidth()), - this.mode === "collapse" && - ((t = this.hiddenColumns.indexOf(s)) > -1 && - this.hiddenColumns.splice(t, 1), - this.generateCollapsedContent(), - this.collapseHandleColumn && - !this.hiddenColumns.length && - this.collapseHandleColumn.hide()); - } - update() { - for (var s = !0; s; ) { - let t = - this.table.modules.layout.getMode() == - "fitColumns" - ? this.table.columnManager.getFlexBaseWidth() - : this.table.columnManager.getWidth(), - e = - (this.table.options.headerVisible - ? this.table.columnManager.element - .clientWidth - : this.table.element.clientWidth) - - t; - if (e < 0) { - let i = this.columns[this.index]; - i - ? (this.hideColumn(i), this.index++) - : (s = !1); - } else { - let i = this.columns[this.index - 1]; - i && e > 0 && e >= i.getWidth() - ? (this.showColumn(i), this.index--) - : (s = !1); - } - this.table.rowManager.activeRowsCount || - this.table.rowManager.renderEmptyScroll(); - } - } - generateCollapsedContent() { - this.table.rowManager - .getDisplayRows() - .forEach((s) => { - this.generateCollapsedRowContent(s); - }); - } - generateCollapsedRowContent(s) { - var t, e; - if (s.modules.responsiveLayout) { - for ( - t = s.modules.responsiveLayout.element; - t.firstChild; - - ) - t.removeChild(t.firstChild); - (e = this.collapseFormatter( - this.generateCollapsedRowData(s) - )) && t.appendChild(e), - s.calcHeight(!0); - } - } - generateCollapsedRowData(s) { - var t, - e = s.getData(), - i = []; - return ( - this.hiddenColumns.forEach((o) => { - var n = o.getFieldValue(e); - if (o.definition.title && o.field) - if ( - o.modules.format && - this.table.options - .responsiveLayoutCollapseUseFormatters - ) { - let r = function (a) { - a(); - }; - (t = { - value: !1, - data: {}, - getValue: function () { - return n; - }, - getData: function () { - return e; - }, - getType: function () { - return "cell"; - }, - getElement: function () { - return document.createElement( - "div" - ); - }, - getRow: function () { - return s.getComponent(); - }, - getColumn: function () { - return o.getComponent(); - }, - getTable: () => this.table, - }), - i.push({ - field: o.field, - title: o.definition.title, - value: o.modules.format.formatter.call( - this.table.modules - .format, - t, - o.modules.format.params, - r - ), - }); - } else - i.push({ - field: o.field, - title: o.definition.title, - value: n, - }); - }), - i - ); - } - formatCollapsedData(s) { - var t = document.createElement("table"); - return ( - s.forEach((e) => { - var i, - o = document.createElement("tr"), - n = document.createElement("td"), - r = document.createElement("td"), - a = document.createElement("strong"); - n.appendChild(a), - this.modules.localize.bind( - "columns|" + e.field, - function (l) { - a.innerHTML = l || e.title; - } - ), - e.value instanceof Node - ? ((i = - document.createElement( - "div" - )).appendChild(e.value), - r.appendChild(i)) - : (r.innerHTML = e.value), - o.appendChild(n), - o.appendChild(r), - t.appendChild(o); - }), - Object.keys(s).length ? t : "" - ); - } - }), - b(ct, "moduleName", "responsiveLayout"), - b(ct, "moduleExtensions", mi), - ct), - SelectRangeModule: - ((at = class extends w { - constructor(s) { - super(s), - (this.selecting = "cell"), - (this.mousedown = !1), - (this.ranges = []), - (this.overlay = null), - (this.rowHeader = null), - (this.layoutChangeTimeout = null), - (this.columnSelection = !1), - (this.rowSelection = !1), - (this.maxRanges = 0), - (this.activeRange = !1), - (this.blockKeydown = !1), - (this.keyDownEvent = - this._handleKeyDown.bind(this)), - (this.mouseUpEvent = - this._handleMouseUp.bind(this)), - this.registerTableOption("selectableRange", !1), - this.registerTableOption( - "selectableRangeColumns", - !1 - ), - this.registerTableOption( - "selectableRangeRows", - !1 - ), - this.registerTableOption( - "selectableRangeClearCells", - !1 - ), - this.registerTableOption( - "selectableRangeClearCellsValue", - void 0 - ), - this.registerTableOption( - "selectableRangeAutoFocus", - !0 - ), - this.registerTableFunction( - "getRangesData", - this.getRangesData.bind(this) - ), - this.registerTableFunction( - "getRanges", - this.getRanges.bind(this) - ), - this.registerTableFunction( - "addRange", - this.addRangeFromComponent.bind(this) - ), - this.registerComponentFunction( - "cell", - "getRanges", - this.cellGetRanges.bind(this) - ), - this.registerComponentFunction( - "row", - "getRanges", - this.rowGetRanges.bind(this) - ), - this.registerComponentFunction( - "column", - "getRanges", - this.colGetRanges.bind(this) - ); - } - initialize() { - this.options("selectableRange") && - (this.options("selectableRows") - ? console.warn( - "SelectRange functionality cannot be used in conjunction with row selection" - ) - : ((this.maxRanges = - this.options("selectableRange")), - this.initializeTable(), - this.initializeWatchers()), - this.options("columns").findIndex( - (s) => s.frozen - ) > 0 && - console.warn( - "Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior." - ), - this.options("columns").filter( - (s) => s.frozen - ) > 1 && - console.warn( - "Having multiple frozen columns with selectRange option may result in unpredictable behavior." - )); - } - initializeTable() { - (this.overlay = document.createElement("div")), - this.overlay.classList.add( - "tabulator-range-overlay" - ), - (this.rangeContainer = - document.createElement("div")), - this.rangeContainer.classList.add( - "tabulator-range-container" - ), - (this.activeRangeCellElement = - document.createElement("div")), - this.activeRangeCellElement.classList.add( - "tabulator-range-cell-active" - ), - this.overlay.appendChild(this.rangeContainer), - this.overlay.appendChild( - this.activeRangeCellElement - ), - this.table.rowManager.element.addEventListener( - "keydown", - this.keyDownEvent - ), - this.resetRanges(), - this.table.rowManager.element.appendChild( - this.overlay - ), - this.table.columnManager.element.setAttribute( - "tabindex", - 0 - ), - this.table.element.classList.add( - "tabulator-ranges" - ); - } - initializeWatchers() { - (this.columnSelection = this.options( - "selectableRangeColumns" - )), - (this.rowSelection = this.options( - "selectableRangeRows" - )), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ), - this.subscribe( - "column-mousedown", - this.handleColumnMouseDown.bind(this) - ), - this.subscribe( - "column-mousemove", - this.handleColumnMouseMove.bind(this) - ), - this.subscribe( - "column-resized", - this.handleColumnResized.bind(this) - ), - this.subscribe( - "column-moving", - this.handleColumnMoving.bind(this) - ), - this.subscribe( - "column-moved", - this.handleColumnMoved.bind(this) - ), - this.subscribe( - "column-width", - this.layoutChange.bind(this) - ), - this.subscribe( - "column-height", - this.layoutChange.bind(this) - ), - this.subscribe( - "column-resized", - this.layoutChange.bind(this) - ), - this.subscribe( - "columns-loaded", - this.updateHeaderColumn.bind(this) - ), - this.subscribe( - "cell-height", - this.layoutChange.bind(this) - ), - this.subscribe( - "cell-rendered", - this.renderCell.bind(this) - ), - this.subscribe( - "cell-mousedown", - this.handleCellMouseDown.bind(this) - ), - this.subscribe( - "cell-mousemove", - this.handleCellMouseMove.bind(this) - ), - this.subscribe( - "cell-click", - this.handleCellClick.bind(this) - ), - this.subscribe( - "cell-editing", - this.handleEditingCell.bind(this) - ), - this.subscribe( - "page-changed", - this.redraw.bind(this) - ), - this.subscribe( - "scroll-vertical", - this.layoutChange.bind(this) - ), - this.subscribe( - "scroll-horizontal", - this.layoutChange.bind(this) - ), - this.subscribe( - "data-destroy", - this.tableDestroyed.bind(this) - ), - this.subscribe( - "data-processed", - this.resetRanges.bind(this) - ), - this.subscribe( - "table-layout", - this.layoutElement.bind(this) - ), - this.subscribe( - "table-redraw", - this.redraw.bind(this) - ), - this.subscribe( - "table-destroy", - this.tableDestroyed.bind(this) - ), - this.subscribe( - "edit-editor-clear", - this.finishEditingCell.bind(this) - ), - this.subscribe( - "edit-blur", - this.restoreFocus.bind(this) - ), - this.subscribe( - "keybinding-nav-prev", - this.keyNavigate.bind(this, "left") - ), - this.subscribe( - "keybinding-nav-next", - this.keyNavigate.bind(this, "right") - ), - this.subscribe( - "keybinding-nav-left", - this.keyNavigate.bind(this, "left") - ), - this.subscribe( - "keybinding-nav-right", - this.keyNavigate.bind(this, "right") - ), - this.subscribe( - "keybinding-nav-up", - this.keyNavigate.bind(this, "up") - ), - this.subscribe( - "keybinding-nav-down", - this.keyNavigate.bind(this, "down") - ), - this.subscribe( - "keybinding-nav-range", - this.keyNavigateRange.bind(this) - ); - } - initializeColumn(s) { - this.columnSelection && - s.definition.headerSort && - this.options("headerSortClickElement") !== - "icon" && - console.warn( - "Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'." - ), - s.modules.edit; - } - updateHeaderColumn() { - var s; - this.rowSelection && - ((this.rowHeader = - this.table.columnManager.getVisibleColumnsByIndex()[0]), - this.rowHeader && - ((this.rowHeader.definition.cssClass = - this.rowHeader.definition.cssClass + - " tabulator-range-row-header"), - this.rowHeader.definition.headerSort && - console.warn( - "Using column headerSort with selectableRangeRows option may result in unpredictable behavior" - ), - this.rowHeader.definition.editor && - console.warn( - "Using column editor with selectableRangeRows option may result in unpredictable behavior" - ))), - this.table.modules.frozenColumns && - this.table.modules.frozenColumns.active && - ((s = - this.table.modules.frozenColumns.getFrozenColumns()) - .length > 1 || - (s.length === 1 && - s[0] !== this.rowHeader)) && - console.warn( - "Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior" - ); - } - getRanges() { - return this.ranges.map((s) => s.getComponent()); - } - getRangesData() { - return this.ranges.map((s) => s.getData()); - } - addRangeFromComponent(s, t) { - return ( - (s = s ? s._cell : null), - (t = t ? t._cell : null), - this.addRange(s, t) - ); - } - cellGetRanges(s) { - var t = []; - return ( - (t = - s.column === this.rowHeader - ? this.ranges.filter((e) => - e.occupiesRow(s.row) - ) - : this.ranges.filter((e) => - e.occupies(s) - )), - t.map((e) => e.getComponent()) - ); - } - rowGetRanges(s) { - var t = this.ranges.filter((e) => e.occupiesRow(s)); - return t.map((e) => e.getComponent()); - } - colGetRanges(s) { - var t = this.ranges.filter((e) => - e.occupiesColumn(s) - ); - return t.map((e) => e.getComponent()); - } - _handleMouseUp(s) { - (this.mousedown = !1), - document.removeEventListener( - "mouseup", - this.mouseUpEvent - ); - } - _handleKeyDown(s) { - if ( - !this.blockKeydown && - (!this.table.modules.edit || - (this.table.modules.edit && - !this.table.modules.edit.currentCell)) - ) { - if (s.key === "Enter") { - if ( - this.table.modules.edit && - this.table.modules.edit.currentCell - ) - return; - this.table.modules.edit.editCell( - this.getActiveCell() - ), - s.preventDefault(); - } - (s.key !== "Backspace" && s.key !== "Delete") || - !this.options( - "selectableRangeClearCells" - ) || - (this.activeRange && - this.activeRange.clearValues()); - } - } - initializeFocus(s) { - var t; - this.restoreFocus(); - try { - document.selection - ? ((t = - document.body.createTextRange()).moveToElementText( - s.getElement() - ), - t.select()) - : window.getSelection && - ((t = document.createRange()).selectNode( - s.getElement() - ), - window.getSelection().removeAllRanges(), - window.getSelection().addRange(t)); - } catch {} - } - restoreFocus(s) { - return this.table.rowManager.element.focus(), !0; - } - handleColumnResized(s) { - var t; - (this.selecting !== "column" && - this.selecting !== "all") || - ((t = this.ranges.some((e) => - e.occupiesColumn(s) - )), - t && - this.ranges.forEach((e) => { - e.getColumns(!0).forEach((i) => { - i !== s && i.setWidth(s.width); - }); - })); - } - handleColumnMoving(s, t) { - this.resetRanges().setBounds(t), - (this.overlay.style.visibility = "hidden"); - } - handleColumnMoved(s, t, e) { - this.activeRange.setBounds(s), this.layoutElement(); - } - handleColumnMouseDown(s, t) { - (s.button !== 2 || - (this.selecting !== "column" && - this.selecting !== "all") || - !this.activeRange.occupiesColumn(t)) && - ((this.table.options.movableColumns && - this.selecting === "column" && - this.activeRange.occupiesColumn(t)) || - ((this.mousedown = !0), - document.addEventListener( - "mouseup", - this.mouseUpEvent - ), - this.newSelection(s, t))); - } - handleColumnMouseMove(s, t) { - t !== this.rowHeader && - this.mousedown && - this.selecting !== "all" && - this.activeRange.setBounds(!1, t, !0); - } - renderCell(s) { - var t = s.getElement(), - e = this.ranges.findIndex((i) => i.occupies(s)); - t.classList.toggle( - "tabulator-range-selected", - e !== -1 - ), - t.classList.toggle( - "tabulator-range-only-cell-selected", - this.ranges.length === 1 && - this.ranges[0].atTopLeft(s) && - this.ranges[0].atBottomRight(s) - ), - (t.dataset.range = e); - } - handleCellMouseDown(s, t) { - (s.button === 2 && - (this.activeRange.occupies(t) || - ((this.selecting === "row" || - this.selecting === "all") && - this.activeRange.occupiesRow( - t.row - )))) || - ((this.mousedown = !0), - document.addEventListener( - "mouseup", - this.mouseUpEvent - ), - this.newSelection(s, t)); - } - handleCellMouseMove(s, t) { - this.mousedown && - this.selecting !== "all" && - this.activeRange.setBounds(!1, t, !0); - } - handleCellClick(s, t) { - this.initializeFocus(t); - } - handleEditingCell(s) { - this.activeRange && this.activeRange.setBounds(s); - } - finishEditingCell() { - (this.blockKeydown = !0), - this.table.rowManager.element.focus(), - setTimeout(() => { - this.blockKeydown = !1; - }, 10); - } - keyNavigate(s, t) { - this.navigate(!1, !1, s), t.preventDefault(); - } - keyNavigateRange(s, t, e, i) { - this.navigate(e, i, t), s.preventDefault(); - } - navigate(s, t, e) { - var i, o, n, r, a, l, h, d, c, u, m; - if ( - this.table.modules.edit && - this.table.modules.edit.currentCell - ) - return !1; - if ( - (this.ranges.length > 1 && - (this.ranges = this.ranges.filter((p) => - p === this.activeRange - ? (p.setEnd( - p.start.row, - p.start.col - ), - !0) - : (p.destroy(), !1) - )), - (n = { - top: (i = this.activeRange).top, - bottom: i.bottom, - left: i.left, - right: i.right, - }), - (r = (o = t ? i.end : i.start).row), - (a = o.col), - s) - ) - switch (e) { - case "left": - a = this.findJumpCellLeft( - i.start.row, - o.col - ); - break; - case "right": - a = this.findJumpCellRight( - i.start.row, - o.col - ); - break; - case "up": - r = this.findJumpCellUp( - o.row, - i.start.col - ); - break; - case "down": - r = this.findJumpCellDown( - o.row, - i.start.col - ); - } - else { - if ( - t && - ((this.selecting === "row" && - (e === "left" || e === "right")) || - (this.selecting === "column" && - (e === "up" || e === "down"))) - ) - return; - switch (e) { - case "left": - a = Math.max(a - 1, 0); - break; - case "right": - a = Math.min( - a + 1, - this.getTableColumns().length - 1 - ); - break; - case "up": - r = Math.max(r - 1, 0); - break; - case "down": - r = Math.min( - r + 1, - this.getTableRows().length - 1 - ); - } - } - return ( - this.rowHeader && a === 0 && (a = 1), - t || i.setStart(r, a), - i.setEnd(r, a), - t || (this.selecting = "cell"), - n.top !== i.top || - n.bottom !== i.bottom || - n.left !== i.left || - n.right !== i.right - ? ((l = this.getRowByRangePos(i.end.row)), - (h = this.getColumnByRangePos(i.end.col)), - (d = l - .getElement() - .getBoundingClientRect()), - (u = h - .getElement() - .getBoundingClientRect()), - (c = this.table.rowManager - .getElement() - .getBoundingClientRect()), - (m = this.table.columnManager - .getElement() - .getBoundingClientRect()), - (d.top >= c.top && - d.bottom <= c.bottom) || - (l.getElement().parentNode && - h.getElement().parentNode - ? this.autoScroll( - i, - l.getElement(), - h.getElement() - ) - : l - .getComponent() - .scrollTo(void 0, !1)), - (u.left >= - m.left + this.getRowHeaderWidth() && - u.right <= m.right) || - (l.getElement().parentNode && - h.getElement().parentNode - ? this.autoScroll( - i, - l.getElement(), - h.getElement() - ) - : h - .getComponent() - .scrollTo(void 0, !1)), - this.layoutElement(), - !0) - : void 0 - ); - } - rangeRemoved(s) { - (this.ranges = this.ranges.filter((t) => t !== s)), - this.activeRange === s && - (this.ranges.length - ? (this.activeRange = - this.ranges[ - this.ranges.length - 1 - ]) - : this.addRange()), - this.layoutElement(); - } - findJumpRow(s, t, e, i, o) { - return ( - e && (t = t.reverse()), - this.findJumpItem(i, o, t, function (n) { - return n.getData()[s.getField()]; - }) - ); - } - findJumpCol(s, t, e, i, o) { - return ( - e && (t = t.reverse()), - this.findJumpItem(i, o, t, function (n) { - return s.getData()[n.getField()]; - }) - ); - } - findJumpItem(s, t, e, i) { - var o; - for (let n of e) { - let r = i(n); - if (s) { - if (((o = n), r)) break; - } else if (t) { - if (((o = n), r)) break; - } else { - if (!r) break; - o = n; - } - } - return o; - } - findJumpCellLeft(s, t) { - var e = this.getRowByRangePos(s), - i = this.getTableColumns(), - o = this.isEmpty(e.getData()[i[t].getField()]), - n = - !!i[t - 1] && - this.isEmpty( - e.getData()[i[t - 1].getField()] - ), - r = this.rowHeader - ? i.slice(1, t) - : i.slice(0, t), - a = this.findJumpCol(e, r, !0, o, n); - return a ? a.getPosition() - 1 : t; - } - findJumpCellRight(s, t) { - var e = this.getRowByRangePos(s), - i = this.getTableColumns(), - o = this.isEmpty(e.getData()[i[t].getField()]), - n = - !!i[t + 1] && - this.isEmpty( - e.getData()[i[t + 1].getField()] - ), - r = this.findJumpCol( - e, - i.slice(t + 1, i.length), - !1, - o, - n - ); - return r ? r.getPosition() - 1 : t; - } - findJumpCellUp(s, t) { - var e = this.getColumnByRangePos(t), - i = this.getTableRows(), - o = this.isEmpty(i[s].getData()[e.getField()]), - n = - !!i[s - 1] && - this.isEmpty( - i[s - 1].getData()[e.getField()] - ), - r = this.findJumpRow( - e, - i.slice(0, s), - !0, - o, - n - ); - return r ? r.position - 1 : s; - } - findJumpCellDown(s, t) { - var e = this.getColumnByRangePos(t), - i = this.getTableRows(), - o = this.isEmpty(i[s].getData()[e.getField()]), - n = - !!i[s + 1] && - this.isEmpty( - i[s + 1].getData()[e.getField()] - ), - r = this.findJumpRow( - e, - i.slice(s + 1, i.length), - !1, - o, - n - ); - return r ? r.position - 1 : s; - } - newSelection(s, t) { - var e; - if (t.type === "column") { - if (!this.columnSelection) return; - if (t === this.rowHeader) { - (e = this.resetRanges()), - (this.selecting = "all"); - var i, - o = this.getCell(-1, -1); - return ( - (i = this.rowHeader - ? this.getCell(0, 1) - : this.getCell(0, 0)), - void e.setBounds(i, o) - ); - } - this.selecting = "column"; - } else - t.column === this.rowHeader - ? (this.selecting = "row") - : (this.selecting = "cell"); - s.shiftKey - ? this.activeRange.setBounds(!1, t) - : s.ctrlKey - ? this.addRange().setBounds(t) - : this.resetRanges().setBounds(t); - } - autoScroll(s, t, e) { - var i, - o, - n, - r = this.table.rowManager.element; - t === void 0 && - (t = this.getRowByRangePos( - s.end.row - ).getElement()), - e === void 0 && - (e = this.getColumnByRangePos( - s.end.col - ).getElement()), - (i = { - left: e.offsetLeft, - right: e.offsetLeft + e.offsetWidth, - top: t.offsetTop, - bottom: t.offsetTop + t.offsetHeight, - }), - (n = - (o = { - left: - r.scrollLeft + - this.getRowHeaderWidth(), - right: Math.ceil( - r.scrollLeft + r.clientWidth - ), - top: r.scrollTop, - bottom: - r.scrollTop + - r.offsetHeight - - this.table.rowManager - .scrollbarWidth, - }).top < i.top && - i.top < o.bottom && - o.top < i.bottom && - i.bottom < o.bottom), - (o.left < i.left && - i.left < o.right && - o.left < i.right && - i.right < o.right) || - (i.left < o.left - ? (r.scrollLeft = - i.left - this.getRowHeaderWidth()) - : i.right > o.right && - (r.scrollLeft = Math.min( - i.right - r.clientWidth, - i.left - this.getRowHeaderWidth() - ))), - n || - (i.top < o.top - ? (r.scrollTop = i.top) - : i.bottom > o.bottom && - (r.scrollTop = - i.bottom - r.clientHeight)); - } - layoutChange() { - (this.overlay.style.visibility = "hidden"), - clearTimeout(this.layoutChangeTimeout), - (this.layoutChangeTimeout = setTimeout( - this.layoutRanges.bind(this), - 200 - )); - } - redraw(s) { - s && - ((this.selecting = "cell"), - this.resetRanges(), - this.layoutElement()); - } - layoutElement(s) { - (s - ? this.table.rowManager.getVisibleRows(!0) - : this.table.rowManager.getRows() - ).forEach((t) => { - t.type === "row" && - (this.layoutRow(t), - t.cells.forEach((e) => this.renderCell(e))); - }), - this.getTableColumns().forEach((t) => { - this.layoutColumn(t); - }), - this.layoutRanges(); - } - layoutRow(s) { - var t = s.getElement(), - e = !1, - i = this.ranges.some((o) => o.occupiesRow(s)); - this.selecting === "row" - ? (e = i) - : this.selecting === "all" && (e = !0), - t.classList.toggle( - "tabulator-range-selected", - e - ), - t.classList.toggle( - "tabulator-range-highlight", - i - ); - } - layoutColumn(s) { - var t = s.getElement(), - e = !1, - i = this.ranges.some((o) => - o.occupiesColumn(s) - ); - this.selecting === "column" - ? (e = i) - : this.selecting === "all" && (e = !0), - t.classList.toggle( - "tabulator-range-selected", - e - ), - t.classList.toggle( - "tabulator-range-highlight", - i - ); - } - layoutRanges() { - var s, t, e; - this.table.initialized && - (s = this.getActiveCell()) && - ((t = s.getElement()), - (e = s.row.getElement()), - this.table.rtl - ? (this.activeRangeCellElement.style.right = - e.offsetWidth - - t.offsetLeft - - t.offsetWidth + - "px") - : (this.activeRangeCellElement.style.left = - e.offsetLeft + t.offsetLeft + "px"), - (this.activeRangeCellElement.style.top = - e.offsetTop + "px"), - (this.activeRangeCellElement.style.width = - t.offsetWidth + "px"), - (this.activeRangeCellElement.style.height = - e.offsetHeight + "px"), - this.ranges.forEach((i) => i.layout()), - (this.overlay.style.visibility = "visible")); - } - getCell(s, t) { - var e; - return t < 0 && - (t = this.getTableColumns().length + t) < 0 - ? null - : (s < 0 && - (s = this.getTableRows().length + s), - (e = this.table.rowManager.getRowFromPosition( - s + 1 - )) - ? e - .getCells(!1, !0) - .filter((i) => i.column.visible)[t] - : null); - } - getActiveCell() { - return this.getCell( - this.activeRange.start.row, - this.activeRange.start.col - ); - } - getRowByRangePos(s) { - return this.getTableRows()[s]; - } - getColumnByRangePos(s) { - return this.getTableColumns()[s]; - } - getTableRows() { - return this.table.rowManager - .getDisplayRows() - .filter((s) => s.type === "row"); - } - getTableColumns() { - return this.table.columnManager.getVisibleColumnsByIndex(); - } - addRange(s, t) { - var e; - return ( - this.maxRanges !== !0 && - this.ranges.length >= this.maxRanges && - this.ranges.shift().destroy(), - (e = new bi(this.table, this, s, t)), - (this.activeRange = e), - this.ranges.push(e), - this.rangeContainer.appendChild(e.element), - e - ); - } - resetRanges() { - var s, t, e; - return ( - this.ranges.forEach((i) => i.destroy()), - (this.ranges = []), - (s = this.addRange()), - this.table.rowManager.activeRows.length && - ((e = - this.table.rowManager.activeRows[0].cells.filter( - (i) => i.column.visible - )), - (t = e[this.rowHeader ? 1 : 0]) && - (s.setBounds(t), - this.options( - "selectableRangeAutoFocus" - ) && this.initializeFocus(t))), - s - ); - } - tableDestroyed() { - document.removeEventListener( - "mouseup", - this.mouseUpEvent - ), - this.table.rowManager.element.removeEventListener( - "keydown", - this.keyDownEvent - ); - } - selectedRows(s) { - return s - ? this.activeRange - .getRows() - .map((t) => t.getComponent()) - : this.activeRange.getRows(); - } - selectedColumns(s) { - return s - ? this.activeRange - .getColumns() - .map((t) => t.getComponent()) - : this.activeRange.getColumns(); - } - getRowHeaderWidth() { - return this.rowHeader - ? this.rowHeader.getElement().offsetWidth - : 0; - } - isEmpty(s) { - return s == null || s === ""; - } - }), - b(at, "moduleName", "selectRange"), - b(at, "moduleInitOrder", 1), - b(at, "moduleExtensions", fi), - at), - SelectRowModule: - ((ut = class extends w { - constructor(s) { - super(s), - (this.selecting = !1), - (this.lastClickedRow = !1), - (this.selectPrev = []), - (this.selectedRows = []), - (this.headerCheckboxElement = null), - this.registerTableOption( - "selectableRows", - "highlight" - ), - this.registerTableOption( - "selectableRowsRangeMode", - "drag" - ), - this.registerTableOption( - "selectableRowsRollingSelection", - !0 - ), - this.registerTableOption( - "selectableRowsPersistence", - !0 - ), - this.registerTableOption( - "selectableRowsCheck", - function (t, e) { - return !0; - } - ), - this.registerTableFunction( - "selectRow", - this.selectRows.bind(this) - ), - this.registerTableFunction( - "deselectRow", - this.deselectRows.bind(this) - ), - this.registerTableFunction( - "toggleSelectRow", - this.toggleRow.bind(this) - ), - this.registerTableFunction( - "getSelectedRows", - this.getSelectedRows.bind(this) - ), - this.registerTableFunction( - "getSelectedData", - this.getSelectedData.bind(this) - ), - this.registerComponentFunction( - "row", - "select", - this.selectRows.bind(this) - ), - this.registerComponentFunction( - "row", - "deselect", - this.deselectRows.bind(this) - ), - this.registerComponentFunction( - "row", - "toggleSelect", - this.toggleRow.bind(this) - ), - this.registerComponentFunction( - "row", - "isSelected", - this.isRowSelected.bind(this) - ); - } - initialize() { - this.deprecatedOptionsCheck(), - this.table.options.selectableRows === - "highlight" && - this.table.options.selectableRange && - (this.table.options.selectableRows = !1), - this.table.options.selectableRows !== !1 && - (this.subscribe( - "row-init", - this.initializeRow.bind(this) - ), - this.subscribe( - "row-deleting", - this.rowDeleted.bind(this) - ), - this.subscribe( - "rows-wipe", - this.clearSelectionData.bind(this) - ), - this.subscribe( - "rows-retrieve", - this.rowRetrieve.bind(this) - ), - this.table.options.selectableRows && - !this.table.options - .selectableRowsPersistence && - this.subscribe( - "data-refreshing", - this.deselectRows.bind(this) - )); - } - deprecatedOptionsCheck() {} - rowRetrieve(s, t) { - return s === "selected" ? this.selectedRows : t; - } - rowDeleted(s) { - this._deselectRow(s, !0); - } - clearSelectionData(s) { - var t = this.selectedRows.length; - (this.selecting = !1), - (this.lastClickedRow = !1), - (this.selectPrev = []), - (this.selectedRows = []), - t && s !== !0 && this._rowSelectionChanged(); - } - initializeRow(s) { - var t = this, - e = t.checkRowSelectability(s), - i = s.getElement(), - o = function () { - setTimeout(function () { - t.selecting = !1; - }, 50), - document.body.removeEventListener( - "mouseup", - o - ); - }; - (s.modules.select = { selected: !1 }), - i.classList.toggle("tabulator-selectable", e), - i.classList.toggle( - "tabulator-unselectable", - !e - ), - t.checkRowSelectability(s) && - t.table.options.selectableRows && - t.table.options.selectableRows != - "highlight" && - (t.table.options.selectableRowsRangeMode === - "click" - ? i.addEventListener( - "click", - this.handleComplexRowClick.bind( - this, - s - ) - ) - : (i.addEventListener( - "click", - function (n) { - (t.table.modExists("edit") && - t.table.modules.edit.getCurrentCell()) || - t.table._clearSelection(), - t.selecting || - t.toggleRow(s); - } - ), - i.addEventListener( - "mousedown", - function (n) { - if (n.shiftKey) - return ( - t.table._clearSelection(), - (t.selecting = !0), - (t.selectPrev = []), - document.body.addEventListener( - "mouseup", - o - ), - document.body.addEventListener( - "keyup", - o - ), - t.toggleRow(s), - !1 - ); - } - ), - i.addEventListener( - "mouseenter", - function (n) { - t.selecting && - (t.table._clearSelection(), - t.toggleRow(s), - t.selectPrev[1] == s && - t.toggleRow( - t.selectPrev[0] - )); - } - ), - i.addEventListener( - "mouseout", - function (n) { - t.selecting && - (t.table._clearSelection(), - t.selectPrev.unshift(s)); - } - ))); - } - handleComplexRowClick(s, t) { - if (t.shiftKey) { - this.table._clearSelection(), - (this.lastClickedRow = - this.lastClickedRow || s); - var e = - this.table.rowManager.getDisplayRowIndex( - this.lastClickedRow - ), - i = - this.table.rowManager.getDisplayRowIndex( - s - ), - o = e <= i ? e : i, - n = e >= i ? e : i, - r = this.table.rowManager - .getDisplayRows() - .slice(0) - .splice(o, n - o + 1); - t.ctrlKey || t.metaKey - ? (r.forEach((a) => { - a !== this.lastClickedRow && - (this.table.options - .selectableRows === !0 || - this.isRowSelected(s) || - this.selectedRows.length < - this.table.options - .selectableRows) && - this.toggleRow(a); - }), - (this.lastClickedRow = s)) - : (this.deselectRows(void 0, !0), - this.table.options.selectableRows !== - !0 && - r.length > - this.table.options - .selectableRows && - (r = r.slice( - 0, - this.table.options.selectableRows - )), - this.selectRows(r)), - this.table._clearSelection(); - } else - t.ctrlKey || t.metaKey - ? (this.toggleRow(s), - (this.lastClickedRow = s)) - : (this.deselectRows(void 0, !0), - this.selectRows(s), - (this.lastClickedRow = s)); - } - checkRowSelectability(s) { - return ( - !(!s || s.type !== "row") && - this.table.options.selectableRowsCheck.call( - this.table, - s.getComponent() - ) - ); - } - toggleRow(s) { - this.checkRowSelectability(s) && - (s.modules.select && s.modules.select.selected - ? this._deselectRow(s) - : this._selectRow(s)); - } - selectRows(s) { - var t, - e, - i = []; - switch (typeof s) { - case "undefined": - t = this.table.rowManager.rows; - break; - case "number": - t = this.table.rowManager.findRow(s); - break; - case "string": - (t = this.table.rowManager.findRow(s)) || - (t = this.table.rowManager.getRows(s)); - break; - default: - t = s; - } - Array.isArray(t) - ? t.length && - (t.forEach((o) => { - (e = this._selectRow(o, !0, !0)) && - i.push(e); - }), - this._rowSelectionChanged(!1, i)) - : t && this._selectRow(t, !1, !0); - } - _selectRow(s, t, e) { - if ( - !isNaN(this.table.options.selectableRows) && - this.table.options.selectableRows !== !0 && - !e && - this.selectedRows.length >= - this.table.options.selectableRows - ) { - if ( - !this.table.options - .selectableRowsRollingSelection - ) - return !1; - this._deselectRow(this.selectedRows[0]); - } - var i = this.table.rowManager.findRow(s); - if (i) { - if (this.selectedRows.indexOf(i) == -1) - return ( - i - .getElement() - .classList.add( - "tabulator-selected" - ), - i.modules.select || - (i.modules.select = {}), - (i.modules.select.selected = !0), - i.modules.select.checkboxEl && - (i.modules.select.checkboxEl.checked = - !0), - this.selectedRows.push(i), - this.table.options - .dataTreeSelectPropagate && - this.childRowSelection(i, !0), - this.dispatchExternal( - "rowSelected", - i.getComponent() - ), - this._rowSelectionChanged(t, i), - i - ); - } else - t || - console.warn( - "Selection Error - No such row found, ignoring selection:" + - s - ); - } - isRowSelected(s) { - return this.selectedRows.indexOf(s) !== -1; - } - deselectRows(s, t) { - var e, - i, - o = []; - switch (typeof s) { - case "undefined": - e = Object.assign([], this.selectedRows); - break; - case "number": - e = this.table.rowManager.findRow(s); - break; - case "string": - (e = this.table.rowManager.findRow(s)) || - (e = this.table.rowManager.getRows(s)); - break; - default: - e = s; - } - Array.isArray(e) - ? e.length && - (e.forEach((n) => { - (i = this._deselectRow(n, !0, !0)) && - o.push(i); - }), - this._rowSelectionChanged(t, [], o)) - : e && this._deselectRow(e, t, !0); - } - _deselectRow(s, t) { - var e, - i, - o = this, - n = o.table.rowManager.findRow(s); - if (n) { - if ( - (e = o.selectedRows.findIndex(function (r) { - return r == n; - })) > -1 - ) - return ( - (i = n.getElement()) && - i.classList.remove( - "tabulator-selected" - ), - n.modules.select || - (n.modules.select = {}), - (n.modules.select.selected = !1), - n.modules.select.checkboxEl && - (n.modules.select.checkboxEl.checked = - !1), - o.selectedRows.splice(e, 1), - this.table.options - .dataTreeSelectPropagate && - this.childRowSelection(n, !1), - this.dispatchExternal( - "rowDeselected", - n.getComponent() - ), - o._rowSelectionChanged(t, void 0, n), - n - ); - } else - t || - console.warn( - "Deselection Error - No such row found, ignoring selection:" + - s - ); - } - getSelectedData() { - var s = []; - return ( - this.selectedRows.forEach(function (t) { - s.push(t.getData()); - }), - s - ); - } - getSelectedRows() { - var s = []; - return ( - this.selectedRows.forEach(function (t) { - s.push(t.getComponent()); - }), - s - ); - } - _rowSelectionChanged(s, t = [], e = []) { - this.headerCheckboxElement && - (this.selectedRows.length === 0 - ? ((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))), - s || - (Array.isArray(t) || (t = [t]), - (t = t.map((i) => i.getComponent())), - Array.isArray(e) || (e = [e]), - (e = e.map((i) => i.getComponent())), - this.dispatchExternal( - "rowSelectionChanged", - this.getSelectedData(), - this.getSelectedRows(), - t, - e - )); - } - registerRowSelectCheckbox(s, t) { - s._row.modules.select || - (s._row.modules.select = {}), - (s._row.modules.select.checkboxEl = t); - } - registerHeaderSelectCheckbox(s) { - this.headerCheckboxElement = s; - } - childRowSelection(s, t) { - var e = this.table.modules.dataTree.getChildren( - s, - !0, - !0 - ); - if (t) for (let i of e) this._selectRow(i, !0); - else for (let i of e) this._deselectRow(i, !0); - } - }), - b(ut, "moduleName", "selectRow"), - b(ut, "moduleExtensions", pi), - ut), - SortModule: Bt, - SpreadsheetModule: - ((ee = class extends w { - constructor(s) { - super(s), - (this.sheets = []), - (this.element = null), - this.registerTableOption("spreadsheet", !1), - this.registerTableOption("spreadsheetRows", 50), - this.registerTableOption( - "spreadsheetColumns", - 50 - ), - this.registerTableOption( - "spreadsheetColumnDefinition", - {} - ), - this.registerTableOption( - "spreadsheetOutputFull", - !1 - ), - this.registerTableOption("spreadsheetData", !1), - this.registerTableOption( - "spreadsheetSheets", - !1 - ), - this.registerTableOption( - "spreadsheetSheetTabs", - !1 - ), - this.registerTableOption( - "spreadsheetSheetTabsElement", - !1 - ), - this.registerTableFunction( - "setSheets", - this.setSheets.bind(this) - ), - this.registerTableFunction( - "addSheet", - this.addSheet.bind(this) - ), - this.registerTableFunction( - "getSheets", - this.getSheets.bind(this) - ), - this.registerTableFunction( - "getSheetDefinitions", - this.getSheetDefinitions.bind(this) - ), - this.registerTableFunction( - "setSheetData", - this.setSheetData.bind(this) - ), - this.registerTableFunction( - "getSheet", - this.getSheet.bind(this) - ), - this.registerTableFunction( - "getSheetData", - this.getSheetData.bind(this) - ), - this.registerTableFunction( - "clearSheet", - this.clearSheet.bind(this) - ), - this.registerTableFunction( - "removeSheet", - this.removeSheetFunc.bind(this) - ), - this.registerTableFunction( - "activeSheet", - this.activeSheetFunc.bind(this) - ); - } - initialize() { - this.options("spreadsheet") && - (this.subscribe( - "table-initialized", - this.tableInitialized.bind(this) - ), - this.subscribe( - "data-loaded", - this.loadRemoteData.bind(this) - ), - (this.table.options.index = "_id"), - this.options("spreadsheetData") && - this.options("spreadsheetSheets") && - (console.warn( - "You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData" - ), - (this.table.options.spreadsheetData = !1)), - this.compatibilityCheck(), - this.options("spreadsheetSheetTabs") && - this.initializeTabset()); - } - compatibilityCheck() { - this.options("data") && - console.warn( - "Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table" - ), - this.options("pagination") && - console.warn( - "The spreadsheet module is not compatible with the pagination module" - ), - this.options("groupBy") && - console.warn( - "The spreadsheet module is not compatible with the row grouping module" - ), - this.options("responsiveCollapse") && - console.warn( - "The spreadsheet module is not compatible with the responsive collapse module" - ); - } - initializeTabset() { - (this.element = document.createElement("div")), - this.element.classList.add( - "tabulator-spreadsheet-tabs" - ); - var s = this.options("spreadsheetSheetTabsElement"); - !s || - s instanceof HTMLElement || - (s = document.querySelector(s)) || - console.warn( - "Unable to find element matching spreadsheetSheetTabsElement selector:", - this.options("spreadsheetSheetTabsElement") - ), - s - ? s.appendChild(this.element) - : this.footerAppend(this.element); - } - tableInitialized() { - this.sheets.length - ? this.loadSheet(this.sheets[0]) - : this.options("spreadsheetSheets") - ? this.loadSheets( - this.options("spreadsheetSheets") - ) - : this.options("spreadsheetData") && - this.loadData( - this.options("spreadsheetData") - ); - } - loadRemoteData(s, t, e) { - return ( - console.log("data", s, t, e), - Array.isArray(s) - ? (this.table.dataLoader.clearAlert(), - this.dispatchExternal("dataLoaded", s), - !s.length || Array.isArray(s[0]) - ? this.loadData(s) - : this.loadSheets(s)) - : console.error( - `Spreadsheet Loading Error - Unable to process remote data due to invalid data type -Expecting: array -Received: `, - typeof s, - ` -Data: `, - s - ), - !1 - ); - } - loadData(s) { - var t = { data: s }; - this.loadSheet(this.newSheet(t)); - } - destroySheets() { - this.sheets.forEach((s) => { - s.destroy(); - }), - (this.sheets = []), - (this.activeSheet = null); - } - loadSheets(s) { - Array.isArray(s) || (s = []), - this.destroySheets(), - s.forEach((t) => { - this.newSheet(t); - }), - this.loadSheet(this.sheets[0]); - } - loadSheet(s) { - this.activeSheet !== s && - (this.activeSheet && this.activeSheet.unload(), - (this.activeSheet = s), - s.load()); - } - newSheet(s = {}) { - var t; - return ( - s.rows || - (s.rows = this.options("spreadsheetRows")), - s.columns || - (s.columns = - this.options("spreadsheetColumns")), - (t = new me(this, s)), - this.sheets.push(t), - this.element && - this.element.appendChild(t.element), - t - ); - } - removeSheet(s) { - var t, - e = this.sheets.indexOf(s); - this.sheets.length > 1 - ? e > -1 && - (this.sheets.splice(e, 1), - s.destroy(), - this.activeSheet === s && - ((t = - this.sheets[e - 1] || this.sheets[0]) - ? this.loadSheet(t) - : (this.activeSheet = null))) - : console.warn( - "Unable to remove sheet, at least one sheet must be active" - ); - } - lookupSheet(s) { - return s - ? s instanceof me - ? s - : s instanceof ue - ? s._sheet - : this.sheets.find((t) => t.key === s) || !1 - : this.activeSheet; - } - setSheets(s) { - return this.loadSheets(s), this.getSheets(); - } - addSheet(s) { - return this.newSheet(s).getComponent(); - } - getSheetDefinitions() { - return this.sheets.map((s) => s.getDefinition()); - } - getSheets() { - return this.sheets.map((s) => s.getComponent()); - } - getSheet(s) { - var t = this.lookupSheet(s); - return !!t && t.getComponent(); - } - setSheetData(s, t) { - s && !t && ((t = s), (s = !1)); - var e = this.lookupSheet(s); - return !!e && e.setData(t); - } - getSheetData(s) { - var t = this.lookupSheet(s); - return !!t && t.getData(); - } - clearSheet(s) { - var t = this.lookupSheet(s); - return !!t && t.clear(); - } - removeSheetFunc(s) { - var t = this.lookupSheet(s); - t && this.removeSheet(t); - } - activeSheetFunc(s) { - var t = this.lookupSheet(s); - return !!t && this.loadSheet(t); - } - }), - b(ee, "moduleName", "spreadsheet"), - ee), - TooltipModule: - ((ie = class extends w { - constructor(s) { - super(s), - (this.tooltipSubscriber = null), - (this.headerSubscriber = null), - (this.timeout = null), - (this.popupInstance = null), - this.registerTableOption("tooltipDelay", 300), - this.registerColumnOption("tooltip"), - this.registerColumnOption("headerTooltip"); - } - initialize() { - this.deprecatedOptionsCheck(), - this.subscribe( - "column-init", - this.initializeColumn.bind(this) - ); - } - deprecatedOptionsCheck() {} - initializeColumn(s) { - s.definition.headerTooltip && - !this.headerSubscriber && - ((this.headerSubscriber = !0), - this.subscribe( - "column-mousemove", - this.mousemoveCheck.bind( - this, - "headerTooltip" - ) - ), - this.subscribe( - "column-mouseout", - this.mouseoutCheck.bind( - this, - "headerTooltip" - ) - )), - s.definition.tooltip && - !this.tooltipSubscriber && - ((this.tooltipSubscriber = !0), - this.subscribe( - "cell-mousemove", - this.mousemoveCheck.bind( - this, - "tooltip" - ) - ), - this.subscribe( - "cell-mouseout", - this.mouseoutCheck.bind(this, "tooltip") - )); - } - mousemoveCheck(s, t, e) { - var i = - s === "tooltip" - ? e.column.definition.tooltip - : e.definition.headerTooltip; - i && - (this.clearPopup(), - (this.timeout = setTimeout( - this.loadTooltip.bind(this, t, e, i), - this.table.options.tooltipDelay - ))); - } - mouseoutCheck(s, t, e) { - this.popupInstance || this.clearPopup(); - } - clearPopup(s, t, e) { - clearTimeout(this.timeout), - (this.timeout = null), - this.popupInstance && this.popupInstance.hide(); - } - loadTooltip(s, t, e) { - var i, o, n; - typeof e == "function" && - (e = e(s, t.getComponent(), function (r) { - o = r; - })), - e instanceof HTMLElement - ? (i = e) - : ((i = document.createElement("div")), - e === !0 && - (t instanceof et - ? (e = t.value) - : t.definition.field - ? this.langBind( - "columns|" + - t.definition.field, - (r) => { - i.innerHTML = e = - r || - t.definition.title; - } - ) - : (e = t.definition.title)), - (i.innerHTML = e)), - (e || e === 0 || e === !1) && - (i.classList.add("tabulator-tooltip"), - i.addEventListener("mousemove", (r) => - r.preventDefault() - ), - (this.popupInstance = this.popup(i)), - typeof o == "function" && - this.popupInstance.renderCallback(o), - (n = - this.popupInstance.containerEventCoords( - s - )), - this.popupInstance - .show(n.x + 15, n.y + 15) - .hideOnBlur(() => { - this.dispatchExternal( - "TooltipClosed", - t.getComponent() - ), - (this.popupInstance = null); - }), - this.dispatchExternal( - "TooltipOpened", - t.getComponent() - )); - } - }), - b(ie, "moduleName", "tooltip"), - ie), - ValidateModule: _t, - }), - Ei = class extends U { - static extendModule() { - U.initializeModuleBinder(Vt), U._extendModule(...arguments); - } - static registerModule() { - U.initializeModuleBinder(Vt), - U._registerModule(...arguments); - } - constructor(s, t, e) { - super(s, t, Vt); - } - }; - return Ei; - }); -}); -export default Ti(); diff --git a/resources/js/tabulator-js.js b/resources/js/tabulator-js.js new file mode 100644 index 00000000..78ccf0e7 --- /dev/null +++ b/resources/js/tabulator-js.js @@ -0,0 +1,29 @@ +var tabledata = [ + { id: 1, name: "Oli Bob", age: "12", col: "red", dob: "" }, + { id: 2, name: "Mary May", age: "1", col: "blue", dob: "14/05/1982" }, + { id: 3, name: "Christine Lobowski", age: "42", col: "green", dob: "22/05/1982" }, + { id: 4, name: "Brendon Philips", age: "125", col: "orange", dob: "01/08/1980" }, + { id: 5, name: "Margret Marmajuke", age: "16", col: "yellow", dob: "31/01/1999" }, +]; + + +// console.log('tabledata', tabledata); +import { TabulatorFull as Tabulator } from 'tabulator-tables'; + +var table = new Tabulator("#example-table", { + height: "311px", + data: tabledata, //assign data to table + layout: "fitColumns", //fit columns to width of table (optional) + columns: [ + { title: "Name", field: "name" }, + { title: "Progress", field: "progress", sorter: "number" }, + { title: "Gender", field: "gender" }, + { title: "Rating", field: "rating" }, + { title: "Favourite Color", field: "col" }, + { title: "Date Of Birth", field: "dob", hozAlign: "center" }, + ], +}); + +table.on("rowClick", function (e, row) { + alert("Row " + row.getData().id + " Clicked!!!!"); +}); \ No newline at end of file diff --git a/resources/views/filament/pages/monitor.blade.php b/resources/views/filament/pages/monitor.blade.php index 4e99db4b..40a565de 100644 --- a/resources/views/filament/pages/monitor.blade.php +++ b/resources/views/filament/pages/monitor.blade.php @@ -1,48 +1,87 @@ -@push('head') - - // - - - var table = new Tabulator("#example-table", { - layout: "fitDataFill", - height: "311px", - columns: [{ - title: "Name", - field: "name" - }, - { - title: "Progress", - field: "progress", - hozAlign: "right", - sorter: "number" - }, - { - title: "Gender", - field: "gender" - }, - { - title: "Rating", - field: "rating", - hozAlign: "center" - }, - { - title: "Favourite Color", - field: "col" - }, - ], - }); - // - -@endpush + + +
+ +
+