@kumologica/sdk 3.2.0-beta9 → 4.0.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/kl.js +1 -1
- package/cli/cli.js +0 -2
- package/cli/commands/create-commands/create-project-iteratively.js +14 -7
- package/cli/commands/create.js +16 -15
- package/cli/commands/open.js +12 -5
- package/cli/commands/start.js +165 -0
- package/cli/commands/test/TestSuiteRunner.js +76 -0
- package/cli/commands/test.js +92 -120
- package/cli/utils/fs/parse.js +1 -1
- package/cli/utils/logger.js +9 -3
- package/package.json +12 -114
- package/src/api/core/comms.js +141 -0
- package/src/api/core/context.js +296 -0
- package/src/api/core/flows.js +286 -0
- package/src/api/core/index.js +29 -0
- package/src/api/core/library.js +106 -0
- package/src/api/core/nodes.js +476 -0
- package/src/api/core/projects.js +426 -0
- package/src/{app/ui/editor-api/lib/admin → api/core/rest}/context.js +1 -1
- package/src/{app/ui/editor-api/lib/admin → api/core/rest}/flow.js +2 -4
- package/src/{app/ui/editor-api/lib/admin → api/core/rest}/flows.js +1 -1
- package/src/{app/ui/editor-api/lib/admin → api/core/rest}/index.js +43 -27
- package/src/{app/ui/editor-api/lib/admin → api/core/rest}/nodes.js +1 -1
- package/src/{app/ui/editor-api/lib → api/core/rest}/util.js +6 -4
- package/src/api/core/settings.js +287 -0
- package/src/api/tools/base/DesignerTool.js +108 -0
- package/src/api/tools/core/flow.js +58 -0
- package/src/api/tools/core/index.js +18 -0
- package/src/api/tools/core/node.js +77 -0
- package/src/api/tools/debugger/index.js +193 -0
- package/src/api/tools/filemanager/index.js +127 -0
- package/src/api/tools/git/index.js +103 -0
- package/src/api/tools/index.js +13 -0
- package/src/api/tools/test/index.js +56 -0
- package/src/api/tools/test/lib/TestCaseRunner.js +105 -0
- package/src/api/tools/test/lib/reporters/index.js +120 -0
- package/src/server/DesignerServer.js +141 -0
- package/cli/.DS_Store +0 -0
- package/cli/commands/test-utils/TestSuiteController.js +0 -363
- package/cli/commands/test-utils/TestSuiteController.test.js +0 -171
- package/cli/commands/test-utils/util/output.js +0 -14
- package/cli/commands/test-utils/util/updates/index.js +0 -17
- package/cli/commands/test-utils/util/updates/pkg.js +0 -13
- package/cli/commands/test-utils/util/updates/templates/default-settings.js +0 -209
- package/src/app/lib/aws/aws-profile.js +0 -43
- package/src/app/lib/aws/ca-alexa-api.js +0 -29
- package/src/app/lib/aws/ca-apigw-api.js +0 -216
- package/src/app/lib/aws/ca-cloudwatch-api.js +0 -78
- package/src/app/lib/aws/ca-codecommit-api.js +0 -63
- package/src/app/lib/aws/ca-dynamodb-api.js +0 -27
- package/src/app/lib/aws/ca-elb-api.js +0 -44
- package/src/app/lib/aws/ca-events-api.js +0 -27
- package/src/app/lib/aws/ca-iot-api.js +0 -105
- package/src/app/lib/aws/ca-s3-api.js +0 -115
- package/src/app/lib/aws/ca-sns-api.js +0 -38
- package/src/app/lib/aws/ca-sqs-api.js +0 -51
- package/src/app/lib/aws/cf.js +0 -449
- package/src/app/lib/aws/index.js +0 -988
- package/src/app/lib/aws/kl-iam-api.js +0 -27
- package/src/app/lib/aws/kl-rekognition-api.js +0 -66
- package/src/app/lib/aws/kl-ssm-api.js +0 -24
- package/src/app/lib/azure/index.js +0 -80
- package/src/app/lib/dependencies.js +0 -50
- package/src/app/lib/kumohub/index.js +0 -201
- package/src/app/lib/runtime-loader/index.js +0 -42
- package/src/app/lib/serverless/index.js +0 -318
- package/src/app/lib/stores/aws-cloud-config-store.js +0 -35
- package/src/app/lib/stores/azure-config-store.js +0 -24
- package/src/app/lib/stores/kumohub-config-store.js +0 -24
- package/src/app/lib/stores/project-info-config-store.js +0 -26
- package/src/app/lib/stores/settings-cloud-store.js +0 -120
- package/src/app/lib/stores/settings-cloud-store.spec.js +0 -26
- package/src/app/lib/stores/settings-network-store.js +0 -118
- package/src/app/lib/stores/settings-network-store.spec.js +0 -27
- package/src/app/lib/stores/store.js +0 -97
- package/src/app/lib/stores/test-config-store.js +0 -159
- package/src/app/lib/stores/user-preference-store.js +0 -44
- package/src/app/lib/stores/util/iniParser.js +0 -46
- package/src/app/lib/stores/util/iniParser.spec.js +0 -72
- package/src/app/lib/utils/editor.js +0 -98
- package/src/app/lib/utils/fix-path.js +0 -15
- package/src/app/main-process/editor-manager.js +0 -177
- package/src/app/main-process/favicon.ico +0 -0
- package/src/app/main-process/main-window.js +0 -214
- package/src/app/main-process/menu.js +0 -420
- package/src/app/main-process/modal-home.js +0 -122
- package/src/app/main-process/modal-newproject.js +0 -123
- package/src/app/main-process/modal-newtab.js +0 -96
- package/src/app/main-process/modal-nodelibrary.js +0 -94
- package/src/app/main-process/modal-welcome.js +0 -119
- package/src/app/main.js +0 -620
- package/src/app/preload.js +0 -649
- package/src/app/ui/editor-api/lib/auth/clients.js +0 -17
- package/src/app/ui/editor-api/lib/auth/index.js +0 -269
- package/src/app/ui/editor-api/lib/auth/permissions.js +0 -51
- package/src/app/ui/editor-api/lib/auth/strategies.js +0 -144
- package/src/app/ui/editor-api/lib/auth/tokens.js +0 -138
- package/src/app/ui/editor-api/lib/auth/users.js +0 -122
- package/src/app/ui/editor-api/lib/editor/comms.js +0 -247
- package/src/app/ui/editor-api/lib/editor/credentials.js +0 -22
- package/src/app/ui/editor-api/lib/editor/index.js +0 -242
- package/src/app/ui/editor-api/lib/editor/library.js +0 -69
- package/src/app/ui/editor-api/lib/editor/locales.js +0 -37
- package/src/app/ui/editor-api/lib/editor/projects.js +0 -497
- package/src/app/ui/editor-api/lib/editor/settings.js +0 -118
- package/src/app/ui/editor-api/lib/editor/sshkeys.js +0 -87
- package/src/app/ui/editor-api/lib/editor/theme.js +0 -184
- package/src/app/ui/editor-api/lib/editor/ui.js +0 -170
- package/src/app/ui/editor-api/lib/index.js +0 -149
- package/src/app/ui/editor-api/lib/runner/index.js +0 -81
- package/src/app/ui/editor-client/README.md +0 -10
- package/src/app/ui/editor-client/constants.js +0 -5
- package/src/app/ui/editor-client/index.js +0 -3
- package/src/app/ui/editor-client/public/favicon.ico +0 -0
- package/src/app/ui/editor-client/public/red/images/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/public/red/images/grip.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/public/red/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-icon-black.svg +0 -9
- package/src/app/ui/editor-client/public/red/images/node-red-icon.svg +0 -33
- package/src/app/ui/editor-client/public/red/images/node-red.png +0 -0
- package/src/app/ui/editor-client/public/red/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/public/red/images/spin.svg +0 -41
- package/src/app/ui/editor-client/public/red/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/public/red/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/public/red/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/public/red/keymap.json +0 -54
- package/src/app/ui/editor-client/public/red/main-modals.js +0 -14
- package/src/app/ui/editor-client/public/red/main-modals.min.js +0 -1
- package/src/app/ui/editor-client/public/red/main.js +0 -10
- package/src/app/ui/editor-client/public/red/main.min.js +0 -1
- package/src/app/ui/editor-client/public/red/red.js +0 -45913
- package/src/app/ui/editor-client/public/red/red.min.js +0 -19
- package/src/app/ui/editor-client/public/red/style.min.css +0 -9
- package/src/app/ui/editor-client/public/vendor/ace/LICENSE +0 -24
- package/src/app/ui/editor-client/public/vendor/ace/ace.js +0 -17
- package/src/app/ui/editor-client/public/vendor/ace/ext-language_tools.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/ext-searchbox.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-css.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-handlebars.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-html.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-javascript.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-json.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-jsonata.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/mode-markdown.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-properties.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-python.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-sql.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-swift.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-text.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-xml.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/mode-yaml.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/css.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/handlebars.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/html.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/javascript.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/json.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/jsonata.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/snippets/markdown.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/properties.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/python.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/sql.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/swift.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/text.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/xml.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/snippets/yaml.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/theme-chrome.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/theme-tomorrow.js +0 -8
- package/src/app/ui/editor-client/public/vendor/ace/worker-css.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/worker-html.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/worker-javascript.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/worker-json.js +0 -1
- package/src/app/ui/editor-client/public/vendor/ace/worker-jsonata.js +0 -2140
- package/src/app/ui/editor-client/public/vendor/ace/worker-xml.js +0 -1
- package/src/app/ui/editor-client/public/vendor/beautifyjs/beautify.min.js +0 -1
- package/src/app/ui/editor-client/public/vendor/bootstrap/css/bootstrap.min.css +0 -9
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/active-line.js +0 -72
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/coffeescript-lint.js +0 -47
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-hint.js +0 -157
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-lint.js +0 -63
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/jshint.js +0 -29591
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.css +0 -73
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.js +0 -252
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.css +0 -36
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.js +0 -460
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/sql-hint.js +0 -304
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.css +0 -350
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.js +0 -9800
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/javascript.js +0 -927
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/sql.js +0 -494
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/base16-dark.css +0 -38
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/monokai.css +0 -42
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/solarized.css +0 -168
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.css +0 -43
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.js +0 -86
- package/src/app/ui/editor-client/public/vendor/easy-json-schema/index.js +0 -88
- package/src/app/ui/editor-client/public/vendor/electron-tabs/electron-tabs.js +0 -2907
- package/src/app/ui/editor-client/public/vendor/font-awesome/css/font-awesome.min.css +0 -4
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.svg +0 -2105
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/icofont.min.css +0 -7
- package/src/app/ui/editor-client/public/vendor/jqtree/tree.jquery.js +0 -119
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +0 -5
- package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +0 -190
- package/src/app/ui/editor-client/public/vendor/kumologica/http-test-case.js +0 -131
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.css +0 -181
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.js +0 -48
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.css +0 -7
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.js +0 -15
- package/src/app/ui/editor-client/public/vendor/vendor.css +0 -517
- package/src/app/ui/editor-client/public/vendor/vendor.js +0 -2769
- package/src/app/ui/editor-client/public/vendor/xterm/lib/xterm.js +0 -2
- package/src/app/ui/editor-client/src/ace/README.md +0 -50
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript.js +0 -35
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript_worker.js +0 -189
- package/src/app/ui/editor-client/src/favicon.ico +0 -0
- package/src/app/ui/editor-client/src/images/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/src/images/grip.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/src/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-icon-black.svg +0 -9
- package/src/app/ui/editor-client/src/images/node-red-icon.svg +0 -33
- package/src/app/ui/editor-client/src/images/node-red.png +0 -0
- package/src/app/ui/editor-client/src/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/src/images/spin.svg +0 -41
- package/src/app/ui/editor-client/src/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/src/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/src/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/src/js/comms.js +0 -174
- package/src/app/ui/editor-client/src/js/events.js +0 -39
- package/src/app/ui/editor-client/src/js/font-awesome.js +0 -818
- package/src/app/ui/editor-client/src/js/history.js +0 -337
- package/src/app/ui/editor-client/src/js/i18n.js +0 -81
- package/src/app/ui/editor-client/src/js/jquery-addons.js +0 -21
- package/src/app/ui/editor-client/src/js/keymap.json +0 -54
- package/src/app/ui/editor-client/src/js/main-modals.js +0 -14
- package/src/app/ui/editor-client/src/js/main.js +0 -10
- package/src/app/ui/editor-client/src/js/modals/modal-home.js +0 -162
- package/src/app/ui/editor-client/src/js/modals/modal-new-project.js +0 -86
- package/src/app/ui/editor-client/src/js/modals/modal-new-tab.js +0 -58
- package/src/app/ui/editor-client/src/js/modals/modal-node-library.js +0 -255
- package/src/app/ui/editor-client/src/js/modals/modal-welcome.js +0 -102
- package/src/app/ui/editor-client/src/js/nodes.js +0 -1762
- package/src/app/ui/editor-client/src/js/red.js +0 -707
- package/src/app/ui/editor-client/src/js/settings.js +0 -275
- package/src/app/ui/editor-client/src/js/text/bidi.js +0 -116
- package/src/app/ui/editor-client/src/js/text/format.js +0 -1316
- package/src/app/ui/editor-client/src/js/ui/actions.js +0 -39
- package/src/app/ui/editor-client/src/js/ui/clipboard.js +0 -510
- package/src/app/ui/editor-client/src/js/ui/common/checkboxSet.js +0 -117
- package/src/app/ui/editor-client/src/js/ui/common/editableList.js +0 -322
- package/src/app/ui/editor-client/src/js/ui/common/menu.js +0 -277
- package/src/app/ui/editor-client/src/js/ui/common/panels.js +0 -104
- package/src/app/ui/editor-client/src/js/ui/common/popover.js +0 -268
- package/src/app/ui/editor-client/src/js/ui/common/searchBox.js +0 -98
- package/src/app/ui/editor-client/src/js/ui/common/stack.js +0 -184
- package/src/app/ui/editor-client/src/js/ui/common/tabs.js +0 -805
- package/src/app/ui/editor-client/src/js/ui/common/treeList.js +0 -170
- package/src/app/ui/editor-client/src/js/ui/common/typedInput.js +0 -819
- package/src/app/ui/editor-client/src/js/ui/common/typedInputLong.js +0 -829
- package/src/app/ui/editor-client/src/js/ui/deploy.js +0 -422
- package/src/app/ui/editor-client/src/js/ui/diff.js +0 -2225
- package/src/app/ui/editor-client/src/js/ui/editor.js +0 -3021
- package/src/app/ui/editor-client/src/js/ui/editors/buffer.js +0 -195
- package/src/app/ui/editor-client/src/js/ui/editors/expression.js +0 -655
- package/src/app/ui/editor-client/src/js/ui/editors/js.js +0 -90
- package/src/app/ui/editor-client/src/js/ui/editors/json.js +0 -107
- package/src/app/ui/editor-client/src/js/ui/editors/markdown.js +0 -267
- package/src/app/ui/editor-client/src/js/ui/editors/string.js +0 -75
- package/src/app/ui/editor-client/src/js/ui/event-log.js +0 -107
- package/src/app/ui/editor-client/src/js/ui/header.js +0 -373
- package/src/app/ui/editor-client/src/js/ui/keyboard.js +0 -565
- package/src/app/ui/editor-client/src/js/ui/library.js +0 -570
- package/src/app/ui/editor-client/src/js/ui/logviewer.js +0 -137
- package/src/app/ui/editor-client/src/js/ui/notifications.js +0 -282
- package/src/app/ui/editor-client/src/js/ui/palette-editor.js +0 -1061
- package/src/app/ui/editor-client/src/js/ui/palette-navigator.js +0 -144
- package/src/app/ui/editor-client/src/js/ui/palette-nodes.js +0 -789
- package/src/app/ui/editor-client/src/js/ui/palette.js +0 -62
- package/src/app/ui/editor-client/src/js/ui/project-info.js +0 -234
- package/src/app/ui/editor-client/src/js/ui/projects/projectSettings.js +0 -1651
- package/src/app/ui/editor-client/src/js/ui/projects/projectUserSettings.js +0 -404
- package/src/app/ui/editor-client/src/js/ui/projects/projects.js +0 -2395
- package/src/app/ui/editor-client/src/js/ui/projects/tab-versionControl.js +0 -1383
- package/src/app/ui/editor-client/src/js/ui/search.js +0 -374
- package/src/app/ui/editor-client/src/js/ui/sidebar.js +0 -341
- package/src/app/ui/editor-client/src/js/ui/state.js +0 -14
- package/src/app/ui/editor-client/src/js/ui/subflow.js +0 -748
- package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +0 -1427
- package/src/app/ui/editor-client/src/js/ui/tab-azure.js +0 -852
- package/src/app/ui/editor-client/src/js/ui/tab-config.js +0 -452
- package/src/app/ui/editor-client/src/js/ui/tab-context.js +0 -406
- package/src/app/ui/editor-client/src/js/ui/tab-git.js +0 -320
- package/src/app/ui/editor-client/src/js/ui/tab-info.js +0 -661
- package/src/app/ui/editor-client/src/js/ui/tab-kumohub.js +0 -827
- package/src/app/ui/editor-client/src/js/ui/tab-nodeInfo.js +0 -60
- package/src/app/ui/editor-client/src/js/ui/tab-test.js +0 -987
- package/src/app/ui/editor-client/src/js/ui/terminal.js +0 -240
- package/src/app/ui/editor-client/src/js/ui/touch/radialMenu.js +0 -170
- package/src/app/ui/editor-client/src/js/ui/tray.js +0 -411
- package/src/app/ui/editor-client/src/js/ui/typeSearch.js +0 -411
- package/src/app/ui/editor-client/src/js/ui/ui-settings.js +0 -499
- package/src/app/ui/editor-client/src/js/ui/update-panel.js +0 -84
- package/src/app/ui/editor-client/src/js/ui/userSettings.js +0 -673
- package/src/app/ui/editor-client/src/js/ui/utils.js +0 -1287
- package/src/app/ui/editor-client/src/js/ui/view-navigator.js +0 -169
- package/src/app/ui/editor-client/src/js/ui/view-tools.js +0 -123
- package/src/app/ui/editor-client/src/js/ui/view.js +0 -5428
- package/src/app/ui/editor-client/src/js/ui/workspaces.js +0 -555
- package/src/app/ui/editor-client/src/js/user.js +0 -282
- package/src/app/ui/editor-client/src/js/validators.js +0 -54
- package/src/app/ui/editor-client/src/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/sass/ace.scss +0 -29
- package/src/app/ui/editor-client/src/sass/bootstrap.scss +0 -21
- package/src/app/ui/editor-client/src/sass/colors.scss +0 -78
- package/src/app/ui/editor-client/src/sass/debug.scss +0 -383
- package/src/app/ui/editor-client/src/sass/diff.scss +0 -695
- package/src/app/ui/editor-client/src/sass/dragdrop.scss +0 -37
- package/src/app/ui/editor-client/src/sass/dropdownMenu.scss +0 -93
- package/src/app/ui/editor-client/src/sass/editor.scss +0 -691
- package/src/app/ui/editor-client/src/sass/flow.scss +0 -330
- package/src/app/ui/editor-client/src/sass/forms.scss +0 -1093
- package/src/app/ui/editor-client/src/sass/header.scss +0 -524
- package/src/app/ui/editor-client/src/sass/jquery.scss +0 -152
- package/src/app/ui/editor-client/src/sass/keyboard.scss +0 -136
- package/src/app/ui/editor-client/src/sass/library.scss +0 -54
- package/src/app/ui/editor-client/src/sass/mixins.scss +0 -283
- package/src/app/ui/editor-client/src/sass/modals/modalHome.scss +0 -138
- package/src/app/ui/editor-client/src/sass/modals/modalNewProject.scss +0 -96
- package/src/app/ui/editor-client/src/sass/modals/modalNewTab.scss +0 -96
- package/src/app/ui/editor-client/src/sass/modals/modalNodeLibrary.scss +0 -131
- package/src/app/ui/editor-client/src/sass/modals/modalWelcome.scss +0 -102
- package/src/app/ui/editor-client/src/sass/notifications.scss +0 -118
- package/src/app/ui/editor-client/src/sass/palette-editor.scss +0 -275
- package/src/app/ui/editor-client/src/sass/palette.scss +0 -383
- package/src/app/ui/editor-client/src/sass/panels.scss +0 -61
- package/src/app/ui/editor-client/src/sass/popover.scss +0 -166
- package/src/app/ui/editor-client/src/sass/project-info.scss +0 -74
- package/src/app/ui/editor-client/src/sass/projects.scss +0 -875
- package/src/app/ui/editor-client/src/sass/search.scss +0 -201
- package/src/app/ui/editor-client/src/sass/sidebar.scss +0 -201
- package/src/app/ui/editor-client/src/sass/style.scss +0 -172
- package/src/app/ui/editor-client/src/sass/tab-azure.scss +0 -68
- package/src/app/ui/editor-client/src/sass/tab-cloud.scss +0 -67
- package/src/app/ui/editor-client/src/sass/tab-config.scss +0 -100
- package/src/app/ui/editor-client/src/sass/tab-context.scss +0 -54
- package/src/app/ui/editor-client/src/sass/tab-git.scss +0 -54
- package/src/app/ui/editor-client/src/sass/tab-info.scss +0 -307
- package/src/app/ui/editor-client/src/sass/tab-kumohub.scss +0 -68
- package/src/app/ui/editor-client/src/sass/tab-test.scss +0 -262
- package/src/app/ui/editor-client/src/sass/tabs.scss +0 -420
- package/src/app/ui/editor-client/src/sass/terminal.scss +0 -247
- package/src/app/ui/editor-client/src/sass/ui/common/checkboxSet.scss +0 -29
- package/src/app/ui/editor-client/src/sass/ui/common/editableList.scss +0 -81
- package/src/app/ui/editor-client/src/sass/ui/common/nodeList.scss +0 -65
- package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +0 -78
- package/src/app/ui/editor-client/src/sass/ui/common/stack.scss +0 -26
- package/src/app/ui/editor-client/src/sass/ui/common/treeList.scss +0 -108
- package/src/app/ui/editor-client/src/sass/ui/common/typedInput.scss +0 -181
- package/src/app/ui/editor-client/src/sass/ui/common/typedInputLong.scss +0 -183
- package/src/app/ui/editor-client/src/sass/ui-settings.scss +0 -125
- package/src/app/ui/editor-client/src/sass/update-panel.scss +0 -18
- package/src/app/ui/editor-client/src/sass/userSettings.scss +0 -93
- package/src/app/ui/editor-client/src/sass/widgetStyle.scss +0 -23
- package/src/app/ui/editor-client/src/sass/workspace.scss +0 -123
- package/src/app/ui/editor-client/src/sass/workspaceToolbar.scss +0 -85
- package/src/app/ui/editor-client/src/vendor/ace/LICENSE +0 -24
- package/src/app/ui/editor-client/src/vendor/ace/ace.js +0 -17
- package/src/app/ui/editor-client/src/vendor/ace/ext-language_tools.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/ext-searchbox.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-css.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-handlebars.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-html.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-javascript.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-json.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-markdown.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-properties.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-python.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-sql.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-swift.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-text.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-xml.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/mode-yaml.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/css.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/handlebars.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/html.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/javascript.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/json.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/markdown.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/properties.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/python.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/sql.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/swift.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/text.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/xml.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/snippets/yaml.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/theme-chrome.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/theme-tomorrow.js +0 -8
- package/src/app/ui/editor-client/src/vendor/ace/worker-css.js +0 -1
- package/src/app/ui/editor-client/src/vendor/ace/worker-html.js +0 -1
- package/src/app/ui/editor-client/src/vendor/ace/worker-javascript.js +0 -1
- package/src/app/ui/editor-client/src/vendor/ace/worker-json.js +0 -1
- package/src/app/ui/editor-client/src/vendor/ace/worker-xml.js +0 -1
- package/src/app/ui/editor-client/src/vendor/beautifyjs/beautify.min.js +0 -1
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.css +0 -5406
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.min.css +0 -9
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/js/bootstrap.min.js +0 -6
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/active-line.js +0 -72
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/coffeescript-lint.js +0 -47
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-hint.js +0 -157
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-lint.js +0 -63
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/jshint.js +0 -29591
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.css +0 -73
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.js +0 -252
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.css +0 -36
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.js +0 -460
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/sql-hint.js +0 -304
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.css +0 -350
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.js +0 -9800
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/javascript.js +0 -927
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/sql.js +0 -494
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/base16-dark.css +0 -38
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/monokai.css +0 -42
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/solarized.css +0 -168
- package/src/app/ui/editor-client/src/vendor/d3/d3.v3.min.js +0 -4
- package/src/app/ui/editor-client/src/vendor/d3/d3.v4.min.js +0 -2
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.css +0 -43
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.js +0 -86
- package/src/app/ui/editor-client/src/vendor/easy-json-schema/index.js +0 -88
- package/src/app/ui/editor-client/src/vendor/electron-tabs/electron-tabs.js +0 -2907
- package/src/app/ui/editor-client/src/vendor/font-awesome/css/font-awesome.min.css +0 -4
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/i18next/i18next.min.js +0 -5
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.svg +0 -2105
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/icofont.min.css +0 -7
- package/src/app/ui/editor-client/src/vendor/jqtree/jqTreeContextMenu.js +0 -98
- package/src/app/ui/editor-client/src/vendor/jqtree/jqtree.css +0 -209
- package/src/app/ui/editor-client/src/vendor/jqtree/tree.jquery.js +0 -21
- package/src/app/ui/editor-client/src/vendor/jqtree/tree.jquery.js.map +0 -1
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +0 -5
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-1.11.3.min.js +0 -5
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js +0 -7
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js +0 -11
- package/src/app/ui/editor-client/src/vendor/jquery-contextMenu/jquery-contextMenu.css +0 -309
- package/src/app/ui/editor-client/src/vendor/jquery-contextMenu/jquery-contextMenu.js +0 -2134
- package/src/app/ui/editor-client/src/vendor/jquery-contextMenu/jquery-ui-position.js +0 -513
- package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +0 -190
- package/src/app/ui/editor-client/src/vendor/jsonata/mode-jsonata.js +0 -134
- package/src/app/ui/editor-client/src/vendor/jsonata/snippets-jsonata.js +0 -11
- package/src/app/ui/editor-client/src/vendor/jsonata/worker-jsonata.js +0 -2140
- package/src/app/ui/editor-client/src/vendor/kumologica/http-test-case.js +0 -131
- package/src/app/ui/editor-client/src/vendor/marked/marked.min.js +0 -6
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.css +0 -181
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.js +0 -48
- package/src/app/ui/editor-client/templates/index.mst +0 -284
- package/src/app/ui/editor-client/templates/modals/modalHome.mst +0 -107
- package/src/app/ui/editor-client/templates/modals/modalNewProject.mst +0 -104
- package/src/app/ui/editor-client/templates/modals/modalNewTab.mst +0 -78
- package/src/app/ui/editor-client/templates/modals/modalNodeLibrary.mst +0 -72
- package/src/app/ui/editor-client/templates/modals/modalWelcome.mst +0 -111
- package/src/app/util.js +0 -9
- package/src/assets/eula.txt +0 -170
- package/src/assets/icon.icns +0 -0
- package/src/assets/kumologica-app.png +0 -0
- package/src/assets/license_en.txt +0 -170
- /package/{cli/commands/test-utils → src/api/tools/test/lib}/fixtures/example3-flow.json +0 -0
- /package/{cli/commands/test-utils → src/api/tools/test/lib}/fixtures/package.json +0 -0
- /package/{cli/commands/test-utils → src/api/tools/test/lib}/fixtures/s3-event.js +0 -0
|
@@ -1,2907 +0,0 @@
|
|
|
1
|
-
function $parcel$interopDefault(a) {
|
|
2
|
-
return a && a.__esModule ? a.default : a;
|
|
3
|
-
}
|
|
4
|
-
/**!
|
|
5
|
-
* Sortable 1.15.0
|
|
6
|
-
* @author RubaXa <trash@rubaxa.org>
|
|
7
|
-
* @author owenm <owen23355@gmail.com>
|
|
8
|
-
* @license MIT
|
|
9
|
-
*/ function $64afbd09cd65a300$var$ownKeys(object, enumerableOnly) {
|
|
10
|
-
var keys = Object.keys(object);
|
|
11
|
-
if (Object.getOwnPropertySymbols) {
|
|
12
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
-
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
14
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
15
|
-
});
|
|
16
|
-
keys.push.apply(keys, symbols);
|
|
17
|
-
}
|
|
18
|
-
return keys;
|
|
19
|
-
}
|
|
20
|
-
function $64afbd09cd65a300$var$_objectSpread2(target) {
|
|
21
|
-
for(var i = 1; i < arguments.length; i++){
|
|
22
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
23
|
-
if (i % 2) $64afbd09cd65a300$var$ownKeys(Object(source), true).forEach(function(key) {
|
|
24
|
-
$64afbd09cd65a300$var$_defineProperty(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
27
|
-
else $64afbd09cd65a300$var$ownKeys(Object(source)).forEach(function(key) {
|
|
28
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
}
|
|
33
|
-
function $64afbd09cd65a300$var$_typeof(obj1) {
|
|
34
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") $64afbd09cd65a300$var$_typeof = function(obj) {
|
|
35
|
-
return typeof obj;
|
|
36
|
-
};
|
|
37
|
-
else $64afbd09cd65a300$var$_typeof = function(obj) {
|
|
38
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39
|
-
};
|
|
40
|
-
return $64afbd09cd65a300$var$_typeof(obj1);
|
|
41
|
-
}
|
|
42
|
-
function $64afbd09cd65a300$var$_defineProperty(obj, key, value) {
|
|
43
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
44
|
-
value: value,
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true
|
|
48
|
-
});
|
|
49
|
-
else obj[key] = value;
|
|
50
|
-
return obj;
|
|
51
|
-
}
|
|
52
|
-
function $64afbd09cd65a300$var$_extends() {
|
|
53
|
-
$64afbd09cd65a300$var$_extends = Object.assign || function(target) {
|
|
54
|
-
for(var i = 1; i < arguments.length; i++){
|
|
55
|
-
var source = arguments[i];
|
|
56
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
57
|
-
}
|
|
58
|
-
return target;
|
|
59
|
-
};
|
|
60
|
-
return $64afbd09cd65a300$var$_extends.apply(this, arguments);
|
|
61
|
-
}
|
|
62
|
-
function $64afbd09cd65a300$var$_objectWithoutPropertiesLoose(source, excluded) {
|
|
63
|
-
if (source == null) return {};
|
|
64
|
-
var target = {};
|
|
65
|
-
var sourceKeys = Object.keys(source);
|
|
66
|
-
var key, i;
|
|
67
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
68
|
-
key = sourceKeys[i];
|
|
69
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
70
|
-
target[key] = source[key];
|
|
71
|
-
}
|
|
72
|
-
return target;
|
|
73
|
-
}
|
|
74
|
-
function $64afbd09cd65a300$var$_objectWithoutProperties(source, excluded) {
|
|
75
|
-
if (source == null) return {};
|
|
76
|
-
var target = $64afbd09cd65a300$var$_objectWithoutPropertiesLoose(source, excluded);
|
|
77
|
-
var key, i;
|
|
78
|
-
if (Object.getOwnPropertySymbols) {
|
|
79
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
80
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
81
|
-
key = sourceSymbolKeys[i];
|
|
82
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
83
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
84
|
-
target[key] = source[key];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return target;
|
|
88
|
-
}
|
|
89
|
-
function $64afbd09cd65a300$var$_toConsumableArray(arr) {
|
|
90
|
-
return $64afbd09cd65a300$var$_arrayWithoutHoles(arr) || $64afbd09cd65a300$var$_iterableToArray(arr) || $64afbd09cd65a300$var$_unsupportedIterableToArray(arr) || $64afbd09cd65a300$var$_nonIterableSpread();
|
|
91
|
-
}
|
|
92
|
-
function $64afbd09cd65a300$var$_arrayWithoutHoles(arr) {
|
|
93
|
-
if (Array.isArray(arr)) return $64afbd09cd65a300$var$_arrayLikeToArray(arr);
|
|
94
|
-
}
|
|
95
|
-
function $64afbd09cd65a300$var$_iterableToArray(iter) {
|
|
96
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
97
|
-
}
|
|
98
|
-
function $64afbd09cd65a300$var$_unsupportedIterableToArray(o, minLen) {
|
|
99
|
-
if (!o) return;
|
|
100
|
-
if (typeof o === "string") return $64afbd09cd65a300$var$_arrayLikeToArray(o, minLen);
|
|
101
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
102
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
103
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
104
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $64afbd09cd65a300$var$_arrayLikeToArray(o, minLen);
|
|
105
|
-
}
|
|
106
|
-
function $64afbd09cd65a300$var$_arrayLikeToArray(arr, len) {
|
|
107
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
108
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
109
|
-
return arr2;
|
|
110
|
-
}
|
|
111
|
-
function $64afbd09cd65a300$var$_nonIterableSpread() {
|
|
112
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
113
|
-
}
|
|
114
|
-
var $64afbd09cd65a300$var$version = "1.15.0";
|
|
115
|
-
function $64afbd09cd65a300$var$userAgent(pattern) {
|
|
116
|
-
if (typeof window !== 'undefined' && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);
|
|
117
|
-
}
|
|
118
|
-
var $64afbd09cd65a300$var$IE11OrLess = $64afbd09cd65a300$var$userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
119
|
-
var $64afbd09cd65a300$var$Edge = $64afbd09cd65a300$var$userAgent(/Edge/i);
|
|
120
|
-
var $64afbd09cd65a300$var$FireFox = $64afbd09cd65a300$var$userAgent(/firefox/i);
|
|
121
|
-
var $64afbd09cd65a300$var$Safari = $64afbd09cd65a300$var$userAgent(/safari/i) && !$64afbd09cd65a300$var$userAgent(/chrome/i) && !$64afbd09cd65a300$var$userAgent(/android/i);
|
|
122
|
-
var $64afbd09cd65a300$var$IOS = $64afbd09cd65a300$var$userAgent(/iP(ad|od|hone)/i);
|
|
123
|
-
var $64afbd09cd65a300$var$ChromeForAndroid = $64afbd09cd65a300$var$userAgent(/chrome/i) && $64afbd09cd65a300$var$userAgent(/android/i);
|
|
124
|
-
var $64afbd09cd65a300$var$captureMode = {
|
|
125
|
-
capture: false,
|
|
126
|
-
passive: false
|
|
127
|
-
};
|
|
128
|
-
function $64afbd09cd65a300$var$on(el, event, fn) {
|
|
129
|
-
el.addEventListener(event, fn, !$64afbd09cd65a300$var$IE11OrLess && $64afbd09cd65a300$var$captureMode);
|
|
130
|
-
}
|
|
131
|
-
function $64afbd09cd65a300$var$off(el, event, fn) {
|
|
132
|
-
el.removeEventListener(event, fn, !$64afbd09cd65a300$var$IE11OrLess && $64afbd09cd65a300$var$captureMode);
|
|
133
|
-
}
|
|
134
|
-
function $64afbd09cd65a300$var$matches(/**HTMLElement*/ el, /**String*/ selector) {
|
|
135
|
-
if (!selector) return;
|
|
136
|
-
selector[0] === '>' && (selector = selector.substring(1));
|
|
137
|
-
if (el) try {
|
|
138
|
-
if (el.matches) return el.matches(selector);
|
|
139
|
-
else if (el.msMatchesSelector) return el.msMatchesSelector(selector);
|
|
140
|
-
else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
|
|
141
|
-
} catch (_) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
function $64afbd09cd65a300$var$getParentOrHost(el) {
|
|
147
|
-
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
|
148
|
-
}
|
|
149
|
-
function $64afbd09cd65a300$var$closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx, includeCTX) {
|
|
150
|
-
if (el) {
|
|
151
|
-
ctx = ctx || document;
|
|
152
|
-
do {
|
|
153
|
-
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && $64afbd09cd65a300$var$matches(el, selector) : $64afbd09cd65a300$var$matches(el, selector)) || includeCTX && el === ctx) return el;
|
|
154
|
-
if (el === ctx) break;
|
|
155
|
-
/* jshint boss:true */ }while (el = $64afbd09cd65a300$var$getParentOrHost(el))
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
var $64afbd09cd65a300$var$R_SPACE = /\s+/g;
|
|
160
|
-
function $64afbd09cd65a300$var$toggleClass(el, name, state) {
|
|
161
|
-
if (el && name) {
|
|
162
|
-
if (el.classList) el.classList[state ? 'add' : 'remove'](name);
|
|
163
|
-
else {
|
|
164
|
-
var className = (' ' + el.className + ' ').replace($64afbd09cd65a300$var$R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
|
165
|
-
el.className = (className + (state ? ' ' + name : '')).replace($64afbd09cd65a300$var$R_SPACE, ' ');
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function $64afbd09cd65a300$var$css(el, prop, val) {
|
|
170
|
-
var style = el && el.style;
|
|
171
|
-
if (style) {
|
|
172
|
-
if (val === void 0) {
|
|
173
|
-
if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, '');
|
|
174
|
-
else if (el.currentStyle) val = el.currentStyle;
|
|
175
|
-
return prop === void 0 ? val : val[prop];
|
|
176
|
-
} else {
|
|
177
|
-
if (!(prop in style) && prop.indexOf('webkit') === -1) prop = '-webkit-' + prop;
|
|
178
|
-
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function $64afbd09cd65a300$var$matrix(el, selfOnly) {
|
|
183
|
-
var appliedTransforms = '';
|
|
184
|
-
if (typeof el === 'string') appliedTransforms = el;
|
|
185
|
-
else do {
|
|
186
|
-
var transform = $64afbd09cd65a300$var$css(el, 'transform');
|
|
187
|
-
if (transform && transform !== 'none') appliedTransforms = transform + ' ' + appliedTransforms;
|
|
188
|
-
/* jshint boss:true */ }while (!selfOnly && (el = el.parentNode))
|
|
189
|
-
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
190
|
-
/*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms);
|
|
191
|
-
}
|
|
192
|
-
function $64afbd09cd65a300$var$find(ctx, tagName, iterator) {
|
|
193
|
-
if (ctx) {
|
|
194
|
-
var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
|
|
195
|
-
if (iterator) for(; i < n; i++)iterator(list[i], i);
|
|
196
|
-
return list;
|
|
197
|
-
}
|
|
198
|
-
return [];
|
|
199
|
-
}
|
|
200
|
-
function $64afbd09cd65a300$var$getWindowScrollingElement() {
|
|
201
|
-
var scrollingElement = document.scrollingElement;
|
|
202
|
-
if (scrollingElement) return scrollingElement;
|
|
203
|
-
else return document.documentElement;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Returns the "bounding client rect" of given element
|
|
207
|
-
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
|
208
|
-
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
|
209
|
-
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
|
210
|
-
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
|
211
|
-
* @param {[HTMLElement]} container The parent the element will be placed in
|
|
212
|
-
* @return {Object} The boundingClientRect of el, with specified adjustments
|
|
213
|
-
*/ function $64afbd09cd65a300$var$getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
|
214
|
-
if (!el.getBoundingClientRect && el !== window) return;
|
|
215
|
-
var elRect, top, left, bottom, right, height, width;
|
|
216
|
-
if (el !== window && el.parentNode && el !== $64afbd09cd65a300$var$getWindowScrollingElement()) {
|
|
217
|
-
elRect = el.getBoundingClientRect();
|
|
218
|
-
top = elRect.top;
|
|
219
|
-
left = elRect.left;
|
|
220
|
-
bottom = elRect.bottom;
|
|
221
|
-
right = elRect.right;
|
|
222
|
-
height = elRect.height;
|
|
223
|
-
width = elRect.width;
|
|
224
|
-
} else {
|
|
225
|
-
top = 0;
|
|
226
|
-
left = 0;
|
|
227
|
-
bottom = window.innerHeight;
|
|
228
|
-
right = window.innerWidth;
|
|
229
|
-
height = window.innerHeight;
|
|
230
|
-
width = window.innerWidth;
|
|
231
|
-
}
|
|
232
|
-
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
|
233
|
-
// Adjust for translate()
|
|
234
|
-
container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
|
235
|
-
// Not needed on <= IE11
|
|
236
|
-
if (!$64afbd09cd65a300$var$IE11OrLess) {
|
|
237
|
-
do if (container && container.getBoundingClientRect && ($64afbd09cd65a300$var$css(container, 'transform') !== 'none' || relativeToNonStaticParent && $64afbd09cd65a300$var$css(container, 'position') !== 'static')) {
|
|
238
|
-
var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
|
|
239
|
-
top -= containerRect.top + parseInt($64afbd09cd65a300$var$css(container, 'border-top-width'));
|
|
240
|
-
left -= containerRect.left + parseInt($64afbd09cd65a300$var$css(container, 'border-left-width'));
|
|
241
|
-
bottom = top + elRect.height;
|
|
242
|
-
right = left + elRect.width;
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
while (container = container.parentNode)
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (undoScale && el !== window) {
|
|
249
|
-
// Adjust for scale()
|
|
250
|
-
var elMatrix = $64afbd09cd65a300$var$matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
|
|
251
|
-
if (elMatrix) {
|
|
252
|
-
top /= scaleY;
|
|
253
|
-
left /= scaleX;
|
|
254
|
-
width /= scaleX;
|
|
255
|
-
height /= scaleY;
|
|
256
|
-
bottom = top + height;
|
|
257
|
-
right = left + width;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
top: top,
|
|
262
|
-
left: left,
|
|
263
|
-
bottom: bottom,
|
|
264
|
-
right: right,
|
|
265
|
-
width: width,
|
|
266
|
-
height: height
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Checks if a side of an element is scrolled past a side of its parents
|
|
271
|
-
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
|
272
|
-
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
|
273
|
-
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
|
274
|
-
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
|
275
|
-
*/ function $64afbd09cd65a300$var$isScrolledPast(el, elSide, parentSide) {
|
|
276
|
-
var parent = $64afbd09cd65a300$var$getParentAutoScrollElement(el, true), elSideVal = $64afbd09cd65a300$var$getRect(el)[elSide];
|
|
277
|
-
/* jshint boss:true */ while(parent){
|
|
278
|
-
var parentSideVal = $64afbd09cd65a300$var$getRect(parent)[parentSide], visible = void 0;
|
|
279
|
-
if (parentSide === 'top' || parentSide === 'left') visible = elSideVal >= parentSideVal;
|
|
280
|
-
else visible = elSideVal <= parentSideVal;
|
|
281
|
-
if (!visible) return parent;
|
|
282
|
-
if (parent === $64afbd09cd65a300$var$getWindowScrollingElement()) break;
|
|
283
|
-
parent = $64afbd09cd65a300$var$getParentAutoScrollElement(parent, false);
|
|
284
|
-
}
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
|
289
|
-
* and non-draggable elements
|
|
290
|
-
* @param {HTMLElement} el The parent element
|
|
291
|
-
* @param {Number} childNum The index of the child
|
|
292
|
-
* @param {Object} options Parent Sortable's options
|
|
293
|
-
* @return {HTMLElement} The child at index childNum, or null if not found
|
|
294
|
-
*/ function $64afbd09cd65a300$var$getChild(el, childNum, options, includeDragEl) {
|
|
295
|
-
var currentChild = 0, i = 0, children = el.children;
|
|
296
|
-
while(i < children.length){
|
|
297
|
-
if (children[i].style.display !== 'none' && children[i] !== $64afbd09cd65a300$export$31b3ca70d8f57423.ghost && (includeDragEl || children[i] !== $64afbd09cd65a300$export$31b3ca70d8f57423.dragged) && $64afbd09cd65a300$var$closest(children[i], options.draggable, el, false)) {
|
|
298
|
-
if (currentChild === childNum) return children[i];
|
|
299
|
-
currentChild++;
|
|
300
|
-
}
|
|
301
|
-
i++;
|
|
302
|
-
}
|
|
303
|
-
return null;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
|
307
|
-
* @param {HTMLElement} el Parent element
|
|
308
|
-
* @param {selector} selector Any other elements that should be ignored
|
|
309
|
-
* @return {HTMLElement} The last child, ignoring ghostEl
|
|
310
|
-
*/ function $64afbd09cd65a300$var$lastChild(el, selector) {
|
|
311
|
-
var last = el.lastElementChild;
|
|
312
|
-
while(last && (last === $64afbd09cd65a300$export$31b3ca70d8f57423.ghost || $64afbd09cd65a300$var$css(last, 'display') === 'none' || selector && !$64afbd09cd65a300$var$matches(last, selector)))last = last.previousElementSibling;
|
|
313
|
-
return last || null;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Returns the index of an element within its parent for a selected set of
|
|
317
|
-
* elements
|
|
318
|
-
* @param {HTMLElement} el
|
|
319
|
-
* @param {selector} selector
|
|
320
|
-
* @return {number}
|
|
321
|
-
*/ function $64afbd09cd65a300$var$index(el, selector) {
|
|
322
|
-
var index = 0;
|
|
323
|
-
if (!el || !el.parentNode) return -1;
|
|
324
|
-
/* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== $64afbd09cd65a300$export$31b3ca70d8f57423.clone && (!selector || $64afbd09cd65a300$var$matches(el, selector))) index++;
|
|
325
|
-
return index;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
|
329
|
-
* The value is returned in real pixels.
|
|
330
|
-
* @param {HTMLElement} el
|
|
331
|
-
* @return {Array} Offsets in the format of [left, top]
|
|
332
|
-
*/ function $64afbd09cd65a300$var$getRelativeScrollOffset(el) {
|
|
333
|
-
var offsetLeft = 0, offsetTop = 0, winScroller = $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
334
|
-
if (el) do {
|
|
335
|
-
var elMatrix = $64afbd09cd65a300$var$matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;
|
|
336
|
-
offsetLeft += el.scrollLeft * scaleX;
|
|
337
|
-
offsetTop += el.scrollTop * scaleY;
|
|
338
|
-
}while (el !== winScroller && (el = el.parentNode))
|
|
339
|
-
return [
|
|
340
|
-
offsetLeft,
|
|
341
|
-
offsetTop
|
|
342
|
-
];
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Returns the index of the object within the given array
|
|
346
|
-
* @param {Array} arr Array that may or may not hold the object
|
|
347
|
-
* @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
|
|
348
|
-
* @return {Number} The index of the object in the array, or -1
|
|
349
|
-
*/ function $64afbd09cd65a300$var$indexOfObject(arr, obj) {
|
|
350
|
-
for(var i in arr){
|
|
351
|
-
if (!arr.hasOwnProperty(i)) continue;
|
|
352
|
-
for(var key in obj){
|
|
353
|
-
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return -1;
|
|
357
|
-
}
|
|
358
|
-
function $64afbd09cd65a300$var$getParentAutoScrollElement(el, includeSelf) {
|
|
359
|
-
// skip to window
|
|
360
|
-
if (!el || !el.getBoundingClientRect) return $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
361
|
-
var elem = el;
|
|
362
|
-
var gotSelf = false;
|
|
363
|
-
do // we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
|
364
|
-
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
|
365
|
-
var elemCSS = $64afbd09cd65a300$var$css(elem);
|
|
366
|
-
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
|
367
|
-
if (!elem.getBoundingClientRect || elem === document.body) return $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
368
|
-
if (gotSelf || includeSelf) return elem;
|
|
369
|
-
gotSelf = true;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
while (elem = elem.parentNode)
|
|
373
|
-
return $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
374
|
-
}
|
|
375
|
-
function $64afbd09cd65a300$var$extend(dst, src) {
|
|
376
|
-
if (dst && src) {
|
|
377
|
-
for(var key in src)if (src.hasOwnProperty(key)) dst[key] = src[key];
|
|
378
|
-
}
|
|
379
|
-
return dst;
|
|
380
|
-
}
|
|
381
|
-
function $64afbd09cd65a300$var$isRectEqual(rect1, rect2) {
|
|
382
|
-
return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
|
|
383
|
-
}
|
|
384
|
-
var $64afbd09cd65a300$var$_throttleTimeout;
|
|
385
|
-
function $64afbd09cd65a300$var$throttle(callback, ms) {
|
|
386
|
-
return function() {
|
|
387
|
-
if (!$64afbd09cd65a300$var$_throttleTimeout) {
|
|
388
|
-
var args = arguments, _this = this;
|
|
389
|
-
if (args.length === 1) callback.call(_this, args[0]);
|
|
390
|
-
else callback.apply(_this, args);
|
|
391
|
-
$64afbd09cd65a300$var$_throttleTimeout = setTimeout(function() {
|
|
392
|
-
$64afbd09cd65a300$var$_throttleTimeout = void 0;
|
|
393
|
-
}, ms);
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
function $64afbd09cd65a300$var$cancelThrottle() {
|
|
398
|
-
clearTimeout($64afbd09cd65a300$var$_throttleTimeout);
|
|
399
|
-
$64afbd09cd65a300$var$_throttleTimeout = void 0;
|
|
400
|
-
}
|
|
401
|
-
function $64afbd09cd65a300$var$scrollBy(el, x, y) {
|
|
402
|
-
el.scrollLeft += x;
|
|
403
|
-
el.scrollTop += y;
|
|
404
|
-
}
|
|
405
|
-
function $64afbd09cd65a300$var$clone(el) {
|
|
406
|
-
var Polymer = window.Polymer;
|
|
407
|
-
var $ = window.jQuery || window.Zepto;
|
|
408
|
-
if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);
|
|
409
|
-
else if ($) return $(el).clone(true)[0];
|
|
410
|
-
else return el.cloneNode(true);
|
|
411
|
-
}
|
|
412
|
-
function $64afbd09cd65a300$var$setRect(el, rect) {
|
|
413
|
-
$64afbd09cd65a300$var$css(el, 'position', 'absolute');
|
|
414
|
-
$64afbd09cd65a300$var$css(el, 'top', rect.top);
|
|
415
|
-
$64afbd09cd65a300$var$css(el, 'left', rect.left);
|
|
416
|
-
$64afbd09cd65a300$var$css(el, 'width', rect.width);
|
|
417
|
-
$64afbd09cd65a300$var$css(el, 'height', rect.height);
|
|
418
|
-
}
|
|
419
|
-
function $64afbd09cd65a300$var$unsetRect(el) {
|
|
420
|
-
$64afbd09cd65a300$var$css(el, 'position', '');
|
|
421
|
-
$64afbd09cd65a300$var$css(el, 'top', '');
|
|
422
|
-
$64afbd09cd65a300$var$css(el, 'left', '');
|
|
423
|
-
$64afbd09cd65a300$var$css(el, 'width', '');
|
|
424
|
-
$64afbd09cd65a300$var$css(el, 'height', '');
|
|
425
|
-
}
|
|
426
|
-
var $64afbd09cd65a300$var$expando = 'Sortable' + new Date().getTime();
|
|
427
|
-
function $64afbd09cd65a300$var$AnimationStateManager() {
|
|
428
|
-
var animationStates = [], animationCallbackId;
|
|
429
|
-
return {
|
|
430
|
-
captureAnimationState: function captureAnimationState() {
|
|
431
|
-
animationStates = [];
|
|
432
|
-
if (!this.options.animation) return;
|
|
433
|
-
var children = [].slice.call(this.el.children);
|
|
434
|
-
children.forEach(function(child) {
|
|
435
|
-
if ($64afbd09cd65a300$var$css(child, 'display') === 'none' || child === $64afbd09cd65a300$export$31b3ca70d8f57423.ghost) return;
|
|
436
|
-
animationStates.push({
|
|
437
|
-
target: child,
|
|
438
|
-
rect: $64afbd09cd65a300$var$getRect(child)
|
|
439
|
-
});
|
|
440
|
-
var fromRect = $64afbd09cd65a300$var$_objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
|
|
441
|
-
if (child.thisAnimationDuration) {
|
|
442
|
-
var childMatrix = $64afbd09cd65a300$var$matrix(child, true);
|
|
443
|
-
if (childMatrix) {
|
|
444
|
-
fromRect.top -= childMatrix.f;
|
|
445
|
-
fromRect.left -= childMatrix.e;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
child.fromRect = fromRect;
|
|
449
|
-
});
|
|
450
|
-
},
|
|
451
|
-
addAnimationState: function addAnimationState(state) {
|
|
452
|
-
animationStates.push(state);
|
|
453
|
-
},
|
|
454
|
-
removeAnimationState: function removeAnimationState(target) {
|
|
455
|
-
animationStates.splice($64afbd09cd65a300$var$indexOfObject(animationStates, {
|
|
456
|
-
target: target
|
|
457
|
-
}), 1);
|
|
458
|
-
},
|
|
459
|
-
animateAll: function animateAll(callback) {
|
|
460
|
-
var _this = this;
|
|
461
|
-
if (!this.options.animation) {
|
|
462
|
-
clearTimeout(animationCallbackId);
|
|
463
|
-
if (typeof callback === 'function') callback();
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
var animating = false, animationTime = 0;
|
|
467
|
-
animationStates.forEach(function(state) {
|
|
468
|
-
var time = 0, target = state.target, fromRect = target.fromRect, toRect = $64afbd09cd65a300$var$getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = $64afbd09cd65a300$var$matrix(target, true);
|
|
469
|
-
if (targetMatrix) {
|
|
470
|
-
// Compensate for current animation
|
|
471
|
-
toRect.top -= targetMatrix.f;
|
|
472
|
-
toRect.left -= targetMatrix.e;
|
|
473
|
-
}
|
|
474
|
-
target.toRect = toRect;
|
|
475
|
-
if (target.thisAnimationDuration) // Could also check if animatingRect is between fromRect and toRect
|
|
476
|
-
{
|
|
477
|
-
if ($64afbd09cd65a300$var$isRectEqual(prevFromRect, toRect) && !$64afbd09cd65a300$var$isRectEqual(fromRect, toRect) && (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) // If returning to same place as started from animation and on same axis
|
|
478
|
-
time = $64afbd09cd65a300$var$calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
|
479
|
-
} // if fromRect != toRect: animate
|
|
480
|
-
if (!$64afbd09cd65a300$var$isRectEqual(toRect, fromRect)) {
|
|
481
|
-
target.prevFromRect = fromRect;
|
|
482
|
-
target.prevToRect = toRect;
|
|
483
|
-
if (!time) time = _this.options.animation;
|
|
484
|
-
_this.animate(target, animatingRect, toRect, time);
|
|
485
|
-
}
|
|
486
|
-
if (time) {
|
|
487
|
-
animating = true;
|
|
488
|
-
animationTime = Math.max(animationTime, time);
|
|
489
|
-
clearTimeout(target.animationResetTimer);
|
|
490
|
-
target.animationResetTimer = setTimeout(function() {
|
|
491
|
-
target.animationTime = 0;
|
|
492
|
-
target.prevFromRect = null;
|
|
493
|
-
target.fromRect = null;
|
|
494
|
-
target.prevToRect = null;
|
|
495
|
-
target.thisAnimationDuration = null;
|
|
496
|
-
}, time);
|
|
497
|
-
target.thisAnimationDuration = time;
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
clearTimeout(animationCallbackId);
|
|
501
|
-
if (!animating) {
|
|
502
|
-
if (typeof callback === 'function') callback();
|
|
503
|
-
} else animationCallbackId = setTimeout(function() {
|
|
504
|
-
if (typeof callback === 'function') callback();
|
|
505
|
-
}, animationTime);
|
|
506
|
-
animationStates = [];
|
|
507
|
-
},
|
|
508
|
-
animate: function animate(target, currentRect, toRect, duration) {
|
|
509
|
-
if (duration) {
|
|
510
|
-
$64afbd09cd65a300$var$css(target, 'transition', '');
|
|
511
|
-
$64afbd09cd65a300$var$css(target, 'transform', '');
|
|
512
|
-
var elMatrix = $64afbd09cd65a300$var$matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
513
|
-
target.animatingX = !!translateX;
|
|
514
|
-
target.animatingY = !!translateY;
|
|
515
|
-
$64afbd09cd65a300$var$css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
|
516
|
-
this.forRepaintDummy = $64afbd09cd65a300$var$repaint(target); // repaint
|
|
517
|
-
$64afbd09cd65a300$var$css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
|
518
|
-
$64afbd09cd65a300$var$css(target, 'transform', 'translate3d(0,0,0)');
|
|
519
|
-
typeof target.animated === 'number' && clearTimeout(target.animated);
|
|
520
|
-
target.animated = setTimeout(function() {
|
|
521
|
-
$64afbd09cd65a300$var$css(target, 'transition', '');
|
|
522
|
-
$64afbd09cd65a300$var$css(target, 'transform', '');
|
|
523
|
-
target.animated = false;
|
|
524
|
-
target.animatingX = false;
|
|
525
|
-
target.animatingY = false;
|
|
526
|
-
}, duration);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
function $64afbd09cd65a300$var$repaint(target) {
|
|
532
|
-
return target.offsetWidth;
|
|
533
|
-
}
|
|
534
|
-
function $64afbd09cd65a300$var$calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
535
|
-
return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
|
|
536
|
-
}
|
|
537
|
-
var $64afbd09cd65a300$var$plugins = [];
|
|
538
|
-
var $64afbd09cd65a300$var$defaults = {
|
|
539
|
-
initializeByDefault: true
|
|
540
|
-
};
|
|
541
|
-
var $64afbd09cd65a300$var$PluginManager = {
|
|
542
|
-
mount: function mount(plugin) {
|
|
543
|
-
// Set default static properties
|
|
544
|
-
for(var option in $64afbd09cd65a300$var$defaults)if ($64afbd09cd65a300$var$defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = $64afbd09cd65a300$var$defaults[option];
|
|
545
|
-
$64afbd09cd65a300$var$plugins.forEach(function(p) {
|
|
546
|
-
if (p.pluginName === plugin.pluginName) throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
|
547
|
-
});
|
|
548
|
-
$64afbd09cd65a300$var$plugins.push(plugin);
|
|
549
|
-
},
|
|
550
|
-
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
|
551
|
-
var _this = this;
|
|
552
|
-
this.eventCanceled = false;
|
|
553
|
-
evt.cancel = function() {
|
|
554
|
-
_this.eventCanceled = true;
|
|
555
|
-
};
|
|
556
|
-
var eventNameGlobal = eventName + 'Global';
|
|
557
|
-
$64afbd09cd65a300$var$plugins.forEach(function(plugin) {
|
|
558
|
-
if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
|
|
559
|
-
if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal]($64afbd09cd65a300$var$_objectSpread2({
|
|
560
|
-
sortable: sortable
|
|
561
|
-
}, evt));
|
|
562
|
-
// Only fire plugin event if plugin is enabled in this sortable,
|
|
563
|
-
// and plugin has event defined
|
|
564
|
-
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName]($64afbd09cd65a300$var$_objectSpread2({
|
|
565
|
-
sortable: sortable
|
|
566
|
-
}, evt));
|
|
567
|
-
});
|
|
568
|
-
},
|
|
569
|
-
initializePlugins: function initializePlugins(sortable, el, defaults, options) {
|
|
570
|
-
$64afbd09cd65a300$var$plugins.forEach(function(plugin) {
|
|
571
|
-
var pluginName = plugin.pluginName;
|
|
572
|
-
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
|
573
|
-
var initialized = new plugin(sortable, el, sortable.options);
|
|
574
|
-
initialized.sortable = sortable;
|
|
575
|
-
initialized.options = sortable.options;
|
|
576
|
-
sortable[pluginName] = initialized; // Add default options from plugin
|
|
577
|
-
$64afbd09cd65a300$var$_extends(defaults, initialized.defaults);
|
|
578
|
-
});
|
|
579
|
-
for(var option in sortable.options){
|
|
580
|
-
if (!sortable.options.hasOwnProperty(option)) continue;
|
|
581
|
-
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
582
|
-
if (typeof modified !== 'undefined') sortable.options[option] = modified;
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
getEventProperties: function getEventProperties(name, sortable) {
|
|
586
|
-
var eventProperties = {};
|
|
587
|
-
$64afbd09cd65a300$var$plugins.forEach(function(plugin) {
|
|
588
|
-
if (typeof plugin.eventProperties !== 'function') return;
|
|
589
|
-
$64afbd09cd65a300$var$_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
|
590
|
-
});
|
|
591
|
-
return eventProperties;
|
|
592
|
-
},
|
|
593
|
-
modifyOption: function modifyOption(sortable, name, value) {
|
|
594
|
-
var modifiedValue;
|
|
595
|
-
$64afbd09cd65a300$var$plugins.forEach(function(plugin) {
|
|
596
|
-
// Plugin must exist on the Sortable
|
|
597
|
-
if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
|
598
|
-
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
|
599
|
-
});
|
|
600
|
-
return modifiedValue;
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
function $64afbd09cd65a300$var$dispatchEvent(_ref) {
|
|
604
|
-
var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
|
|
605
|
-
sortable = sortable || rootEl && rootEl[$64afbd09cd65a300$var$expando];
|
|
606
|
-
if (!sortable) return;
|
|
607
|
-
var evt, options = sortable.options, onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
|
|
608
|
-
if (window.CustomEvent && !$64afbd09cd65a300$var$IE11OrLess && !$64afbd09cd65a300$var$Edge) evt = new CustomEvent(name, {
|
|
609
|
-
bubbles: true,
|
|
610
|
-
cancelable: true
|
|
611
|
-
});
|
|
612
|
-
else {
|
|
613
|
-
evt = document.createEvent('Event');
|
|
614
|
-
evt.initEvent(name, true, true);
|
|
615
|
-
}
|
|
616
|
-
evt.to = toEl || rootEl;
|
|
617
|
-
evt.from = fromEl || rootEl;
|
|
618
|
-
evt.item = targetEl || rootEl;
|
|
619
|
-
evt.clone = cloneEl;
|
|
620
|
-
evt.oldIndex = oldIndex;
|
|
621
|
-
evt.newIndex = newIndex;
|
|
622
|
-
evt.oldDraggableIndex = oldDraggableIndex;
|
|
623
|
-
evt.newDraggableIndex = newDraggableIndex;
|
|
624
|
-
evt.originalEvent = originalEvent;
|
|
625
|
-
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
|
626
|
-
var allEventProperties = $64afbd09cd65a300$var$_objectSpread2($64afbd09cd65a300$var$_objectSpread2({}, extraEventProperties), $64afbd09cd65a300$var$PluginManager.getEventProperties(name, sortable));
|
|
627
|
-
for(var option in allEventProperties)evt[option] = allEventProperties[option];
|
|
628
|
-
if (rootEl) rootEl.dispatchEvent(evt);
|
|
629
|
-
if (options[onName]) options[onName].call(sortable, evt);
|
|
630
|
-
}
|
|
631
|
-
var $64afbd09cd65a300$var$_excluded = [
|
|
632
|
-
"evt"
|
|
633
|
-
];
|
|
634
|
-
var $64afbd09cd65a300$var$pluginEvent = function pluginEvent(eventName, sortable) {
|
|
635
|
-
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = $64afbd09cd65a300$var$_objectWithoutProperties(_ref, $64afbd09cd65a300$var$_excluded);
|
|
636
|
-
$64afbd09cd65a300$var$PluginManager.pluginEvent.bind($64afbd09cd65a300$export$31b3ca70d8f57423)(eventName, sortable, $64afbd09cd65a300$var$_objectSpread2({
|
|
637
|
-
dragEl: $64afbd09cd65a300$var$dragEl,
|
|
638
|
-
parentEl: $64afbd09cd65a300$var$parentEl,
|
|
639
|
-
ghostEl: $64afbd09cd65a300$var$ghostEl,
|
|
640
|
-
rootEl: $64afbd09cd65a300$var$rootEl,
|
|
641
|
-
nextEl: $64afbd09cd65a300$var$nextEl,
|
|
642
|
-
lastDownEl: $64afbd09cd65a300$var$lastDownEl,
|
|
643
|
-
cloneEl: $64afbd09cd65a300$var$cloneEl,
|
|
644
|
-
cloneHidden: $64afbd09cd65a300$var$cloneHidden,
|
|
645
|
-
dragStarted: $64afbd09cd65a300$var$moved,
|
|
646
|
-
putSortable: $64afbd09cd65a300$var$putSortable,
|
|
647
|
-
activeSortable: $64afbd09cd65a300$export$31b3ca70d8f57423.active,
|
|
648
|
-
originalEvent: originalEvent,
|
|
649
|
-
oldIndex: $64afbd09cd65a300$var$oldIndex,
|
|
650
|
-
oldDraggableIndex: $64afbd09cd65a300$var$oldDraggableIndex,
|
|
651
|
-
newIndex: $64afbd09cd65a300$var$newIndex,
|
|
652
|
-
newDraggableIndex: $64afbd09cd65a300$var$newDraggableIndex,
|
|
653
|
-
hideGhostForTarget: $64afbd09cd65a300$var$_hideGhostForTarget,
|
|
654
|
-
unhideGhostForTarget: $64afbd09cd65a300$var$_unhideGhostForTarget,
|
|
655
|
-
cloneNowHidden: function cloneNowHidden() {
|
|
656
|
-
$64afbd09cd65a300$var$cloneHidden = true;
|
|
657
|
-
},
|
|
658
|
-
cloneNowShown: function cloneNowShown() {
|
|
659
|
-
$64afbd09cd65a300$var$cloneHidden = false;
|
|
660
|
-
},
|
|
661
|
-
dispatchSortableEvent: function dispatchSortableEvent(name) {
|
|
662
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
663
|
-
sortable: sortable,
|
|
664
|
-
name: name,
|
|
665
|
-
originalEvent: originalEvent
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
}, data));
|
|
669
|
-
};
|
|
670
|
-
function $64afbd09cd65a300$var$_dispatchEvent(info) {
|
|
671
|
-
$64afbd09cd65a300$var$dispatchEvent($64afbd09cd65a300$var$_objectSpread2({
|
|
672
|
-
putSortable: $64afbd09cd65a300$var$putSortable,
|
|
673
|
-
cloneEl: $64afbd09cd65a300$var$cloneEl,
|
|
674
|
-
targetEl: $64afbd09cd65a300$var$dragEl,
|
|
675
|
-
rootEl: $64afbd09cd65a300$var$rootEl,
|
|
676
|
-
oldIndex: $64afbd09cd65a300$var$oldIndex,
|
|
677
|
-
oldDraggableIndex: $64afbd09cd65a300$var$oldDraggableIndex,
|
|
678
|
-
newIndex: $64afbd09cd65a300$var$newIndex,
|
|
679
|
-
newDraggableIndex: $64afbd09cd65a300$var$newDraggableIndex
|
|
680
|
-
}, info));
|
|
681
|
-
}
|
|
682
|
-
var $64afbd09cd65a300$var$dragEl, $64afbd09cd65a300$var$parentEl, $64afbd09cd65a300$var$ghostEl, $64afbd09cd65a300$var$rootEl, $64afbd09cd65a300$var$nextEl, $64afbd09cd65a300$var$lastDownEl, $64afbd09cd65a300$var$cloneEl, $64afbd09cd65a300$var$cloneHidden, $64afbd09cd65a300$var$oldIndex, $64afbd09cd65a300$var$newIndex, $64afbd09cd65a300$var$oldDraggableIndex, $64afbd09cd65a300$var$newDraggableIndex, $64afbd09cd65a300$var$activeGroup, $64afbd09cd65a300$var$putSortable, $64afbd09cd65a300$var$awaitingDragStarted = false, $64afbd09cd65a300$var$ignoreNextClick = false, $64afbd09cd65a300$var$sortables = [], $64afbd09cd65a300$var$tapEvt, $64afbd09cd65a300$var$touchEvt, $64afbd09cd65a300$var$lastDx, $64afbd09cd65a300$var$lastDy, $64afbd09cd65a300$var$tapDistanceLeft, $64afbd09cd65a300$var$tapDistanceTop, $64afbd09cd65a300$var$moved, $64afbd09cd65a300$var$lastTarget, $64afbd09cd65a300$var$lastDirection, $64afbd09cd65a300$var$pastFirstInvertThresh = false, $64afbd09cd65a300$var$isCircumstantialInvert = false, $64afbd09cd65a300$var$targetMoveDistance, // For positioning ghost absolutely
|
|
683
|
-
$64afbd09cd65a300$var$ghostRelativeParent, $64afbd09cd65a300$var$ghostRelativeParentInitialScroll = [], // (left, top)
|
|
684
|
-
$64afbd09cd65a300$var$_silent = false, $64afbd09cd65a300$var$savedInputChecked = [];
|
|
685
|
-
/** @const */ var $64afbd09cd65a300$var$documentExists = typeof document !== 'undefined', $64afbd09cd65a300$var$PositionGhostAbsolutely = $64afbd09cd65a300$var$IOS, $64afbd09cd65a300$var$CSSFloatProperty = $64afbd09cd65a300$var$Edge || $64afbd09cd65a300$var$IE11OrLess ? 'cssFloat' : 'float', // This will not pass for IE9, because IE9 DnD only works on anchors
|
|
686
|
-
$64afbd09cd65a300$var$supportDraggable = $64afbd09cd65a300$var$documentExists && !$64afbd09cd65a300$var$ChromeForAndroid && !$64afbd09cd65a300$var$IOS && 'draggable' in document.createElement('div'), $64afbd09cd65a300$var$supportCssPointerEvents = function() {
|
|
687
|
-
if (!$64afbd09cd65a300$var$documentExists) return; // false when <= IE11
|
|
688
|
-
if ($64afbd09cd65a300$var$IE11OrLess) return false;
|
|
689
|
-
var el = document.createElement('x');
|
|
690
|
-
el.style.cssText = 'pointer-events:auto';
|
|
691
|
-
return el.style.pointerEvents === 'auto';
|
|
692
|
-
}(), $64afbd09cd65a300$var$_detectDirection = function _detectDirection(el, options) {
|
|
693
|
-
var elCSS = $64afbd09cd65a300$var$css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = $64afbd09cd65a300$var$getChild(el, 0, options), child2 = $64afbd09cd65a300$var$getChild(el, 1, options), firstChildCSS = child1 && $64afbd09cd65a300$var$css(child1), secondChildCSS = child2 && $64afbd09cd65a300$var$css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + $64afbd09cd65a300$var$getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + $64afbd09cd65a300$var$getRect(child2).width;
|
|
694
|
-
if (elCSS.display === 'flex') return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
|
695
|
-
if (elCSS.display === 'grid') return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
|
696
|
-
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
|
697
|
-
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
|
698
|
-
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
|
699
|
-
}
|
|
700
|
-
return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[$64afbd09cd65a300$var$CSSFloatProperty] === 'none' || child2 && elCSS[$64afbd09cd65a300$var$CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
|
|
701
|
-
}, $64afbd09cd65a300$var$_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
|
702
|
-
var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;
|
|
703
|
-
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
|
704
|
-
}, /**
|
|
705
|
-
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
|
706
|
-
* @param {Number} x X position
|
|
707
|
-
* @param {Number} y Y position
|
|
708
|
-
* @return {HTMLElement} Element of the first found nearest Sortable
|
|
709
|
-
*/ $64afbd09cd65a300$var$_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
710
|
-
var ret;
|
|
711
|
-
$64afbd09cd65a300$var$sortables.some(function(sortable) {
|
|
712
|
-
var threshold = sortable[$64afbd09cd65a300$var$expando].options.emptyInsertThreshold;
|
|
713
|
-
if (!threshold || $64afbd09cd65a300$var$lastChild(sortable)) return;
|
|
714
|
-
var rect = $64afbd09cd65a300$var$getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
|
715
|
-
if (insideHorizontally && insideVertically) return ret = sortable;
|
|
716
|
-
});
|
|
717
|
-
return ret;
|
|
718
|
-
}, $64afbd09cd65a300$var$_prepareGroup = function _prepareGroup(options) {
|
|
719
|
-
function toFn(value, pull) {
|
|
720
|
-
return function(to, from, dragEl, evt) {
|
|
721
|
-
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
|
722
|
-
if (value == null && (pull || sameGroup)) // Default pull value
|
|
723
|
-
// Default pull and put value if same group
|
|
724
|
-
return true;
|
|
725
|
-
else if (value == null || value === false) return false;
|
|
726
|
-
else if (pull && value === 'clone') return value;
|
|
727
|
-
else if (typeof value === 'function') return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
|
728
|
-
else {
|
|
729
|
-
var otherGroup = (pull ? to : from).options.group.name;
|
|
730
|
-
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
var group = {};
|
|
735
|
-
var originalGroup = options.group;
|
|
736
|
-
if (!originalGroup || $64afbd09cd65a300$var$_typeof(originalGroup) != 'object') originalGroup = {
|
|
737
|
-
name: originalGroup
|
|
738
|
-
};
|
|
739
|
-
group.name = originalGroup.name;
|
|
740
|
-
group.checkPull = toFn(originalGroup.pull, true);
|
|
741
|
-
group.checkPut = toFn(originalGroup.put);
|
|
742
|
-
group.revertClone = originalGroup.revertClone;
|
|
743
|
-
options.group = group;
|
|
744
|
-
}, $64afbd09cd65a300$var$_hideGhostForTarget = function _hideGhostForTarget() {
|
|
745
|
-
if (!$64afbd09cd65a300$var$supportCssPointerEvents && $64afbd09cd65a300$var$ghostEl) $64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'display', 'none');
|
|
746
|
-
}, $64afbd09cd65a300$var$_unhideGhostForTarget = function _unhideGhostForTarget() {
|
|
747
|
-
if (!$64afbd09cd65a300$var$supportCssPointerEvents && $64afbd09cd65a300$var$ghostEl) $64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'display', '');
|
|
748
|
-
}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
|
749
|
-
if ($64afbd09cd65a300$var$documentExists && !$64afbd09cd65a300$var$ChromeForAndroid) document.addEventListener('click', function(evt) {
|
|
750
|
-
if ($64afbd09cd65a300$var$ignoreNextClick) {
|
|
751
|
-
evt.preventDefault();
|
|
752
|
-
evt.stopPropagation && evt.stopPropagation();
|
|
753
|
-
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
|
754
|
-
$64afbd09cd65a300$var$ignoreNextClick = false;
|
|
755
|
-
return false;
|
|
756
|
-
}
|
|
757
|
-
}, true);
|
|
758
|
-
var $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
|
759
|
-
if ($64afbd09cd65a300$var$dragEl) {
|
|
760
|
-
evt = evt.touches ? evt.touches[0] : evt;
|
|
761
|
-
var nearest = $64afbd09cd65a300$var$_detectNearestEmptySortable(evt.clientX, evt.clientY);
|
|
762
|
-
if (nearest) {
|
|
763
|
-
// Create imitation event
|
|
764
|
-
var event = {};
|
|
765
|
-
for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i];
|
|
766
|
-
event.target = event.rootEl = nearest;
|
|
767
|
-
event.preventDefault = void 0;
|
|
768
|
-
event.stopPropagation = void 0;
|
|
769
|
-
nearest[$64afbd09cd65a300$var$expando]._onDragOver(event);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
|
-
var $64afbd09cd65a300$var$_checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
|
774
|
-
if ($64afbd09cd65a300$var$dragEl) $64afbd09cd65a300$var$dragEl.parentNode[$64afbd09cd65a300$var$expando]._isOutsideThisEl(evt.target);
|
|
775
|
-
};
|
|
776
|
-
/**
|
|
777
|
-
* @class Sortable
|
|
778
|
-
* @param {HTMLElement} el
|
|
779
|
-
* @param {Object} [options]
|
|
780
|
-
*/ function $64afbd09cd65a300$export$31b3ca70d8f57423(el, options) {
|
|
781
|
-
if (!(el && el.nodeType && el.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(el));
|
|
782
|
-
this.el = el; // root element
|
|
783
|
-
this.options = options = $64afbd09cd65a300$var$_extends({}, options); // Export instance
|
|
784
|
-
el[$64afbd09cd65a300$var$expando] = this;
|
|
785
|
-
var defaults = {
|
|
786
|
-
group: null,
|
|
787
|
-
sort: true,
|
|
788
|
-
disabled: false,
|
|
789
|
-
store: null,
|
|
790
|
-
handle: null,
|
|
791
|
-
draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
|
|
792
|
-
swapThreshold: 1,
|
|
793
|
-
// percentage; 0 <= x <= 1
|
|
794
|
-
invertSwap: false,
|
|
795
|
-
// invert always
|
|
796
|
-
invertedSwapThreshold: null,
|
|
797
|
-
// will be set to same as swapThreshold if default
|
|
798
|
-
removeCloneOnHide: true,
|
|
799
|
-
direction: function direction() {
|
|
800
|
-
return $64afbd09cd65a300$var$_detectDirection(el, this.options);
|
|
801
|
-
},
|
|
802
|
-
ghostClass: 'sortable-ghost',
|
|
803
|
-
chosenClass: 'sortable-chosen',
|
|
804
|
-
dragClass: 'sortable-drag',
|
|
805
|
-
ignore: 'a, img',
|
|
806
|
-
filter: null,
|
|
807
|
-
preventOnFilter: true,
|
|
808
|
-
animation: 0,
|
|
809
|
-
easing: null,
|
|
810
|
-
setData: function setData(dataTransfer, dragEl) {
|
|
811
|
-
dataTransfer.setData('Text', dragEl.textContent);
|
|
812
|
-
},
|
|
813
|
-
dropBubble: false,
|
|
814
|
-
dragoverBubble: false,
|
|
815
|
-
dataIdAttr: 'data-id',
|
|
816
|
-
delay: 0,
|
|
817
|
-
delayOnTouchOnly: false,
|
|
818
|
-
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
819
|
-
forceFallback: false,
|
|
820
|
-
fallbackClass: 'sortable-fallback',
|
|
821
|
-
fallbackOnBody: false,
|
|
822
|
-
fallbackTolerance: 0,
|
|
823
|
-
fallbackOffset: {
|
|
824
|
-
x: 0,
|
|
825
|
-
y: 0
|
|
826
|
-
},
|
|
827
|
-
supportPointer: $64afbd09cd65a300$export$31b3ca70d8f57423.supportPointer !== false && 'PointerEvent' in window && !$64afbd09cd65a300$var$Safari,
|
|
828
|
-
emptyInsertThreshold: 5
|
|
829
|
-
};
|
|
830
|
-
$64afbd09cd65a300$var$PluginManager.initializePlugins(this, el, defaults); // Set default options
|
|
831
|
-
for(var name in defaults)!(name in options) && (options[name] = defaults[name]);
|
|
832
|
-
$64afbd09cd65a300$var$_prepareGroup(options); // Bind all private methods
|
|
833
|
-
for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this);
|
|
834
|
-
// Setup drag mode
|
|
835
|
-
this.nativeDraggable = options.forceFallback ? false : $64afbd09cd65a300$var$supportDraggable;
|
|
836
|
-
if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold
|
|
837
|
-
this.options.touchStartThreshold = 1;
|
|
838
|
-
// Bind events
|
|
839
|
-
if (options.supportPointer) $64afbd09cd65a300$var$on(el, 'pointerdown', this._onTapStart);
|
|
840
|
-
else {
|
|
841
|
-
$64afbd09cd65a300$var$on(el, 'mousedown', this._onTapStart);
|
|
842
|
-
$64afbd09cd65a300$var$on(el, 'touchstart', this._onTapStart);
|
|
843
|
-
}
|
|
844
|
-
if (this.nativeDraggable) {
|
|
845
|
-
$64afbd09cd65a300$var$on(el, 'dragover', this);
|
|
846
|
-
$64afbd09cd65a300$var$on(el, 'dragenter', this);
|
|
847
|
-
}
|
|
848
|
-
$64afbd09cd65a300$var$sortables.push(this.el); // Restore sorting
|
|
849
|
-
options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
|
|
850
|
-
$64afbd09cd65a300$var$_extends(this, $64afbd09cd65a300$var$AnimationStateManager());
|
|
851
|
-
}
|
|
852
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.prototype = /** @lends Sortable.prototype */ {
|
|
853
|
-
constructor: $64afbd09cd65a300$export$31b3ca70d8f57423,
|
|
854
|
-
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
|
855
|
-
if (!this.el.contains(target) && target !== this.el) $64afbd09cd65a300$var$lastTarget = null;
|
|
856
|
-
},
|
|
857
|
-
_getDirection: function _getDirection(evt, target) {
|
|
858
|
-
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, $64afbd09cd65a300$var$dragEl) : this.options.direction;
|
|
859
|
-
},
|
|
860
|
-
_onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) {
|
|
861
|
-
if (!evt.cancelable) return;
|
|
862
|
-
var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
|
|
863
|
-
$64afbd09cd65a300$var$_saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
|
864
|
-
if ($64afbd09cd65a300$var$dragEl) return;
|
|
865
|
-
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled
|
|
866
|
-
// cancel dnd if original target is content editable
|
|
867
|
-
if (originalTarget.isContentEditable) return;
|
|
868
|
-
// Safari ignores further event handling after mousedown
|
|
869
|
-
if (!this.nativeDraggable && $64afbd09cd65a300$var$Safari && target && target.tagName.toUpperCase() === 'SELECT') return;
|
|
870
|
-
target = $64afbd09cd65a300$var$closest(target, options.draggable, el, false);
|
|
871
|
-
if (target && target.animated) return;
|
|
872
|
-
if ($64afbd09cd65a300$var$lastDownEl === target) // Ignoring duplicate `down`
|
|
873
|
-
return;
|
|
874
|
-
// Get the index of the dragged element within its parent
|
|
875
|
-
$64afbd09cd65a300$var$oldIndex = $64afbd09cd65a300$var$index(target);
|
|
876
|
-
$64afbd09cd65a300$var$oldDraggableIndex = $64afbd09cd65a300$var$index(target, options.draggable); // Check filter
|
|
877
|
-
if (typeof filter === 'function') {
|
|
878
|
-
if (filter.call(this, evt, target, this)) {
|
|
879
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
880
|
-
sortable: _this,
|
|
881
|
-
rootEl: originalTarget,
|
|
882
|
-
name: 'filter',
|
|
883
|
-
targetEl: target,
|
|
884
|
-
toEl: el,
|
|
885
|
-
fromEl: el
|
|
886
|
-
});
|
|
887
|
-
$64afbd09cd65a300$var$pluginEvent('filter', _this, {
|
|
888
|
-
evt: evt
|
|
889
|
-
});
|
|
890
|
-
preventOnFilter && evt.cancelable && evt.preventDefault();
|
|
891
|
-
return; // cancel dnd
|
|
892
|
-
}
|
|
893
|
-
} else if (filter) {
|
|
894
|
-
filter = filter.split(',').some(function(criteria) {
|
|
895
|
-
criteria = $64afbd09cd65a300$var$closest(originalTarget, criteria.trim(), el, false);
|
|
896
|
-
if (criteria) {
|
|
897
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
898
|
-
sortable: _this,
|
|
899
|
-
rootEl: criteria,
|
|
900
|
-
name: 'filter',
|
|
901
|
-
targetEl: target,
|
|
902
|
-
fromEl: el,
|
|
903
|
-
toEl: el
|
|
904
|
-
});
|
|
905
|
-
$64afbd09cd65a300$var$pluginEvent('filter', _this, {
|
|
906
|
-
evt: evt
|
|
907
|
-
});
|
|
908
|
-
return true;
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
|
-
if (filter) {
|
|
912
|
-
preventOnFilter && evt.cancelable && evt.preventDefault();
|
|
913
|
-
return; // cancel dnd
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
if (options.handle && !$64afbd09cd65a300$var$closest(originalTarget, options.handle, el, false)) return;
|
|
917
|
-
// Prepare `dragstart`
|
|
918
|
-
this._prepareDragStart(evt, touch, target);
|
|
919
|
-
},
|
|
920
|
-
_prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) {
|
|
921
|
-
var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;
|
|
922
|
-
if (target && !$64afbd09cd65a300$var$dragEl && target.parentNode === el) {
|
|
923
|
-
var dragRect = $64afbd09cd65a300$var$getRect(target);
|
|
924
|
-
$64afbd09cd65a300$var$rootEl = el;
|
|
925
|
-
$64afbd09cd65a300$var$dragEl = target;
|
|
926
|
-
$64afbd09cd65a300$var$parentEl = $64afbd09cd65a300$var$dragEl.parentNode;
|
|
927
|
-
$64afbd09cd65a300$var$nextEl = $64afbd09cd65a300$var$dragEl.nextSibling;
|
|
928
|
-
$64afbd09cd65a300$var$lastDownEl = target;
|
|
929
|
-
$64afbd09cd65a300$var$activeGroup = options.group;
|
|
930
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.dragged = $64afbd09cd65a300$var$dragEl;
|
|
931
|
-
$64afbd09cd65a300$var$tapEvt = {
|
|
932
|
-
target: $64afbd09cd65a300$var$dragEl,
|
|
933
|
-
clientX: (touch || evt).clientX,
|
|
934
|
-
clientY: (touch || evt).clientY
|
|
935
|
-
};
|
|
936
|
-
$64afbd09cd65a300$var$tapDistanceLeft = $64afbd09cd65a300$var$tapEvt.clientX - dragRect.left;
|
|
937
|
-
$64afbd09cd65a300$var$tapDistanceTop = $64afbd09cd65a300$var$tapEvt.clientY - dragRect.top;
|
|
938
|
-
this._lastX = (touch || evt).clientX;
|
|
939
|
-
this._lastY = (touch || evt).clientY;
|
|
940
|
-
$64afbd09cd65a300$var$dragEl.style['will-change'] = 'all';
|
|
941
|
-
dragStartFn = function dragStartFn() {
|
|
942
|
-
$64afbd09cd65a300$var$pluginEvent('delayEnded', _this, {
|
|
943
|
-
evt: evt
|
|
944
|
-
});
|
|
945
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
946
|
-
_this._onDrop();
|
|
947
|
-
return;
|
|
948
|
-
} // Delayed drag has been triggered
|
|
949
|
-
// we can re-enable the events: touchmove/mousemove
|
|
950
|
-
_this._disableDelayedDragEvents();
|
|
951
|
-
if (!$64afbd09cd65a300$var$FireFox && _this.nativeDraggable) $64afbd09cd65a300$var$dragEl.draggable = true;
|
|
952
|
-
// Bind the events: dragstart/dragend
|
|
953
|
-
_this._triggerDragStart(evt, touch); // Drag start event
|
|
954
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
955
|
-
sortable: _this,
|
|
956
|
-
name: 'choose',
|
|
957
|
-
originalEvent: evt
|
|
958
|
-
}); // Chosen item
|
|
959
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, options.chosenClass, true);
|
|
960
|
-
}; // Disable "draggable"
|
|
961
|
-
options.ignore.split(',').forEach(function(criteria) {
|
|
962
|
-
$64afbd09cd65a300$var$find($64afbd09cd65a300$var$dragEl, criteria.trim(), $64afbd09cd65a300$var$_disableDraggable);
|
|
963
|
-
});
|
|
964
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'dragover', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
965
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'mousemove', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
966
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchmove', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
967
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'mouseup', _this._onDrop);
|
|
968
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchend', _this._onDrop);
|
|
969
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
|
|
970
|
-
if ($64afbd09cd65a300$var$FireFox && this.nativeDraggable) {
|
|
971
|
-
this.options.touchStartThreshold = 4;
|
|
972
|
-
$64afbd09cd65a300$var$dragEl.draggable = true;
|
|
973
|
-
}
|
|
974
|
-
$64afbd09cd65a300$var$pluginEvent('delayStart', this, {
|
|
975
|
-
evt: evt
|
|
976
|
-
}); // Delay is impossible for native DnD in Edge or IE
|
|
977
|
-
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !($64afbd09cd65a300$var$Edge || $64afbd09cd65a300$var$IE11OrLess))) {
|
|
978
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
979
|
-
this._onDrop();
|
|
980
|
-
return;
|
|
981
|
-
} // If the user moves the pointer or let go the click or touch
|
|
982
|
-
// before the delay has been reached:
|
|
983
|
-
// disable the delayed drag
|
|
984
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
|
985
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
|
986
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
|
987
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
|
|
988
|
-
$64afbd09cd65a300$var$on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
|
|
989
|
-
options.supportPointer && $64afbd09cd65a300$var$on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
|
|
990
|
-
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
|
991
|
-
} else dragStartFn();
|
|
992
|
-
}
|
|
993
|
-
},
|
|
994
|
-
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(/** TouchEvent|PointerEvent **/ e) {
|
|
995
|
-
var touch = e.touches ? e.touches[0] : e;
|
|
996
|
-
if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();
|
|
997
|
-
},
|
|
998
|
-
_disableDelayedDrag: function _disableDelayedDrag() {
|
|
999
|
-
$64afbd09cd65a300$var$dragEl && $64afbd09cd65a300$var$_disableDraggable($64afbd09cd65a300$var$dragEl);
|
|
1000
|
-
clearTimeout(this._dragStartTimer);
|
|
1001
|
-
this._disableDelayedDragEvents();
|
|
1002
|
-
},
|
|
1003
|
-
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
|
1004
|
-
var ownerDocument = this.el.ownerDocument;
|
|
1005
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
|
1006
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
|
1007
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
|
1008
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
|
|
1009
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
|
1010
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
|
1011
|
-
},
|
|
1012
|
-
_triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) {
|
|
1013
|
-
touch = touch || evt.pointerType == 'touch' && evt;
|
|
1014
|
-
if (!this.nativeDraggable || touch) {
|
|
1015
|
-
if (this.options.supportPointer) $64afbd09cd65a300$var$on(document, 'pointermove', this._onTouchMove);
|
|
1016
|
-
else if (touch) $64afbd09cd65a300$var$on(document, 'touchmove', this._onTouchMove);
|
|
1017
|
-
else $64afbd09cd65a300$var$on(document, 'mousemove', this._onTouchMove);
|
|
1018
|
-
} else {
|
|
1019
|
-
$64afbd09cd65a300$var$on($64afbd09cd65a300$var$dragEl, 'dragend', this);
|
|
1020
|
-
$64afbd09cd65a300$var$on($64afbd09cd65a300$var$rootEl, 'dragstart', this._onDragStart);
|
|
1021
|
-
}
|
|
1022
|
-
try {
|
|
1023
|
-
if (document.selection) // Timeout neccessary for IE9
|
|
1024
|
-
$64afbd09cd65a300$var$_nextTick(function() {
|
|
1025
|
-
document.selection.empty();
|
|
1026
|
-
});
|
|
1027
|
-
else window.getSelection().removeAllRanges();
|
|
1028
|
-
} catch (err) {}
|
|
1029
|
-
},
|
|
1030
|
-
_dragStarted: function _dragStarted(fallback, evt) {
|
|
1031
|
-
$64afbd09cd65a300$var$awaitingDragStarted = false;
|
|
1032
|
-
if ($64afbd09cd65a300$var$rootEl && $64afbd09cd65a300$var$dragEl) {
|
|
1033
|
-
$64afbd09cd65a300$var$pluginEvent('dragStarted', this, {
|
|
1034
|
-
evt: evt
|
|
1035
|
-
});
|
|
1036
|
-
if (this.nativeDraggable) $64afbd09cd65a300$var$on(document, 'dragover', $64afbd09cd65a300$var$_checkOutsideTargetEl);
|
|
1037
|
-
var options = this.options; // Apply effect
|
|
1038
|
-
!fallback && $64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, options.dragClass, false);
|
|
1039
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, options.ghostClass, true);
|
|
1040
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.active = this;
|
|
1041
|
-
fallback && this._appendGhost(); // Drag start event
|
|
1042
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1043
|
-
sortable: this,
|
|
1044
|
-
name: 'start',
|
|
1045
|
-
originalEvent: evt
|
|
1046
|
-
});
|
|
1047
|
-
} else this._nulling();
|
|
1048
|
-
},
|
|
1049
|
-
_emulateDragOver: function _emulateDragOver() {
|
|
1050
|
-
if ($64afbd09cd65a300$var$touchEvt) {
|
|
1051
|
-
this._lastX = $64afbd09cd65a300$var$touchEvt.clientX;
|
|
1052
|
-
this._lastY = $64afbd09cd65a300$var$touchEvt.clientY;
|
|
1053
|
-
$64afbd09cd65a300$var$_hideGhostForTarget();
|
|
1054
|
-
var target = document.elementFromPoint($64afbd09cd65a300$var$touchEvt.clientX, $64afbd09cd65a300$var$touchEvt.clientY);
|
|
1055
|
-
var parent = target;
|
|
1056
|
-
while(target && target.shadowRoot){
|
|
1057
|
-
target = target.shadowRoot.elementFromPoint($64afbd09cd65a300$var$touchEvt.clientX, $64afbd09cd65a300$var$touchEvt.clientY);
|
|
1058
|
-
if (target === parent) break;
|
|
1059
|
-
parent = target;
|
|
1060
|
-
}
|
|
1061
|
-
$64afbd09cd65a300$var$dragEl.parentNode[$64afbd09cd65a300$var$expando]._isOutsideThisEl(target);
|
|
1062
|
-
if (parent) do {
|
|
1063
|
-
if (parent[$64afbd09cd65a300$var$expando]) {
|
|
1064
|
-
var inserted = void 0;
|
|
1065
|
-
inserted = parent[$64afbd09cd65a300$var$expando]._onDragOver({
|
|
1066
|
-
clientX: $64afbd09cd65a300$var$touchEvt.clientX,
|
|
1067
|
-
clientY: $64afbd09cd65a300$var$touchEvt.clientY,
|
|
1068
|
-
target: target,
|
|
1069
|
-
rootEl: parent
|
|
1070
|
-
});
|
|
1071
|
-
if (inserted && !this.options.dragoverBubble) break;
|
|
1072
|
-
}
|
|
1073
|
-
target = parent; // store last element
|
|
1074
|
-
}while (parent = parent.parentNode)
|
|
1075
|
-
$64afbd09cd65a300$var$_unhideGhostForTarget();
|
|
1076
|
-
}
|
|
1077
|
-
},
|
|
1078
|
-
_onTouchMove: function _onTouchMove(/**TouchEvent*/ evt) {
|
|
1079
|
-
if ($64afbd09cd65a300$var$tapEvt) {
|
|
1080
|
-
var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = $64afbd09cd65a300$var$ghostEl && $64afbd09cd65a300$var$matrix($64afbd09cd65a300$var$ghostEl, true), scaleX = $64afbd09cd65a300$var$ghostEl && ghostMatrix && ghostMatrix.a, scaleY = $64afbd09cd65a300$var$ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = $64afbd09cd65a300$var$PositionGhostAbsolutely && $64afbd09cd65a300$var$ghostRelativeParent && $64afbd09cd65a300$var$getRelativeScrollOffset($64afbd09cd65a300$var$ghostRelativeParent), dx = (touch.clientX - $64afbd09cd65a300$var$tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - $64afbd09cd65a300$var$ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - $64afbd09cd65a300$var$tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - $64afbd09cd65a300$var$ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging
|
|
1081
|
-
if (!$64afbd09cd65a300$export$31b3ca70d8f57423.active && !$64afbd09cd65a300$var$awaitingDragStarted) {
|
|
1082
|
-
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;
|
|
1083
|
-
this._onDragStart(evt, true);
|
|
1084
|
-
}
|
|
1085
|
-
if ($64afbd09cd65a300$var$ghostEl) {
|
|
1086
|
-
if (ghostMatrix) {
|
|
1087
|
-
ghostMatrix.e += dx - ($64afbd09cd65a300$var$lastDx || 0);
|
|
1088
|
-
ghostMatrix.f += dy - ($64afbd09cd65a300$var$lastDy || 0);
|
|
1089
|
-
} else ghostMatrix = {
|
|
1090
|
-
a: 1,
|
|
1091
|
-
b: 0,
|
|
1092
|
-
c: 0,
|
|
1093
|
-
d: 1,
|
|
1094
|
-
e: dx,
|
|
1095
|
-
f: dy
|
|
1096
|
-
};
|
|
1097
|
-
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
|
1098
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'webkitTransform', cssMatrix);
|
|
1099
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'mozTransform', cssMatrix);
|
|
1100
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'msTransform', cssMatrix);
|
|
1101
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'transform', cssMatrix);
|
|
1102
|
-
$64afbd09cd65a300$var$lastDx = dx;
|
|
1103
|
-
$64afbd09cd65a300$var$lastDy = dy;
|
|
1104
|
-
$64afbd09cd65a300$var$touchEvt = touch;
|
|
1105
|
-
}
|
|
1106
|
-
evt.cancelable && evt.preventDefault();
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
_appendGhost: function _appendGhost() {
|
|
1110
|
-
// Bug if using scale(): https://stackoverflow.com/questions/2637058
|
|
1111
|
-
// Not being adjusted for
|
|
1112
|
-
if (!$64afbd09cd65a300$var$ghostEl) {
|
|
1113
|
-
var container = this.options.fallbackOnBody ? document.body : $64afbd09cd65a300$var$rootEl, rect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$dragEl, true, $64afbd09cd65a300$var$PositionGhostAbsolutely, true, container), options = this.options; // Position absolutely
|
|
1114
|
-
if ($64afbd09cd65a300$var$PositionGhostAbsolutely) {
|
|
1115
|
-
// Get relatively positioned parent
|
|
1116
|
-
$64afbd09cd65a300$var$ghostRelativeParent = container;
|
|
1117
|
-
while($64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostRelativeParent, 'position') === 'static' && $64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostRelativeParent, 'transform') === 'none' && $64afbd09cd65a300$var$ghostRelativeParent !== document)$64afbd09cd65a300$var$ghostRelativeParent = $64afbd09cd65a300$var$ghostRelativeParent.parentNode;
|
|
1118
|
-
if ($64afbd09cd65a300$var$ghostRelativeParent !== document.body && $64afbd09cd65a300$var$ghostRelativeParent !== document.documentElement) {
|
|
1119
|
-
if ($64afbd09cd65a300$var$ghostRelativeParent === document) $64afbd09cd65a300$var$ghostRelativeParent = $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
1120
|
-
rect.top += $64afbd09cd65a300$var$ghostRelativeParent.scrollTop;
|
|
1121
|
-
rect.left += $64afbd09cd65a300$var$ghostRelativeParent.scrollLeft;
|
|
1122
|
-
} else $64afbd09cd65a300$var$ghostRelativeParent = $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
1123
|
-
$64afbd09cd65a300$var$ghostRelativeParentInitialScroll = $64afbd09cd65a300$var$getRelativeScrollOffset($64afbd09cd65a300$var$ghostRelativeParent);
|
|
1124
|
-
}
|
|
1125
|
-
$64afbd09cd65a300$var$ghostEl = $64afbd09cd65a300$var$dragEl.cloneNode(true);
|
|
1126
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$ghostEl, options.ghostClass, false);
|
|
1127
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$ghostEl, options.fallbackClass, true);
|
|
1128
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$ghostEl, options.dragClass, true);
|
|
1129
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'transition', '');
|
|
1130
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'transform', '');
|
|
1131
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'box-sizing', 'border-box');
|
|
1132
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'margin', 0);
|
|
1133
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'top', rect.top);
|
|
1134
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'left', rect.left);
|
|
1135
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'width', rect.width);
|
|
1136
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'height', rect.height);
|
|
1137
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'opacity', '0.8');
|
|
1138
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'position', $64afbd09cd65a300$var$PositionGhostAbsolutely ? 'absolute' : 'fixed');
|
|
1139
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'zIndex', '100000');
|
|
1140
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'pointerEvents', 'none');
|
|
1141
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.ghost = $64afbd09cd65a300$var$ghostEl;
|
|
1142
|
-
container.appendChild($64afbd09cd65a300$var$ghostEl); // Set transform-origin
|
|
1143
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$ghostEl, 'transform-origin', $64afbd09cd65a300$var$tapDistanceLeft / parseInt($64afbd09cd65a300$var$ghostEl.style.width) * 100 + '% ' + $64afbd09cd65a300$var$tapDistanceTop / parseInt($64afbd09cd65a300$var$ghostEl.style.height) * 100 + '%');
|
|
1144
|
-
}
|
|
1145
|
-
},
|
|
1146
|
-
_onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) {
|
|
1147
|
-
var _this = this;
|
|
1148
|
-
var dataTransfer = evt.dataTransfer;
|
|
1149
|
-
var options = _this.options;
|
|
1150
|
-
$64afbd09cd65a300$var$pluginEvent('dragStart', this, {
|
|
1151
|
-
evt: evt
|
|
1152
|
-
});
|
|
1153
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
1154
|
-
this._onDrop();
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
$64afbd09cd65a300$var$pluginEvent('setupClone', this);
|
|
1158
|
-
if (!$64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
1159
|
-
$64afbd09cd65a300$var$cloneEl = $64afbd09cd65a300$var$clone($64afbd09cd65a300$var$dragEl);
|
|
1160
|
-
$64afbd09cd65a300$var$cloneEl.removeAttribute("id");
|
|
1161
|
-
$64afbd09cd65a300$var$cloneEl.draggable = false;
|
|
1162
|
-
$64afbd09cd65a300$var$cloneEl.style['will-change'] = '';
|
|
1163
|
-
this._hideClone();
|
|
1164
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$cloneEl, this.options.chosenClass, false);
|
|
1165
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.clone = $64afbd09cd65a300$var$cloneEl;
|
|
1166
|
-
} // #1143: IFrame support workaround
|
|
1167
|
-
_this.cloneId = $64afbd09cd65a300$var$_nextTick(function() {
|
|
1168
|
-
$64afbd09cd65a300$var$pluginEvent('clone', _this);
|
|
1169
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) return;
|
|
1170
|
-
if (!_this.options.removeCloneOnHide) $64afbd09cd65a300$var$rootEl.insertBefore($64afbd09cd65a300$var$cloneEl, $64afbd09cd65a300$var$dragEl);
|
|
1171
|
-
_this._hideClone();
|
|
1172
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1173
|
-
sortable: _this,
|
|
1174
|
-
name: 'clone'
|
|
1175
|
-
});
|
|
1176
|
-
});
|
|
1177
|
-
!fallback && $64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, options.dragClass, true); // Set proper drop events
|
|
1178
|
-
if (fallback) {
|
|
1179
|
-
$64afbd09cd65a300$var$ignoreNextClick = true;
|
|
1180
|
-
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
|
1181
|
-
} else {
|
|
1182
|
-
// Undo what was set in _prepareDragStart before drag started
|
|
1183
|
-
$64afbd09cd65a300$var$off(document, 'mouseup', _this._onDrop);
|
|
1184
|
-
$64afbd09cd65a300$var$off(document, 'touchend', _this._onDrop);
|
|
1185
|
-
$64afbd09cd65a300$var$off(document, 'touchcancel', _this._onDrop);
|
|
1186
|
-
if (dataTransfer) {
|
|
1187
|
-
dataTransfer.effectAllowed = 'move';
|
|
1188
|
-
options.setData && options.setData.call(_this, dataTransfer, $64afbd09cd65a300$var$dragEl);
|
|
1189
|
-
}
|
|
1190
|
-
$64afbd09cd65a300$var$on(document, 'drop', _this); // #1276 fix:
|
|
1191
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$dragEl, 'transform', 'translateZ(0)');
|
|
1192
|
-
}
|
|
1193
|
-
$64afbd09cd65a300$var$awaitingDragStarted = true;
|
|
1194
|
-
_this._dragStartId = $64afbd09cd65a300$var$_nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
|
1195
|
-
$64afbd09cd65a300$var$on(document, 'selectstart', _this);
|
|
1196
|
-
$64afbd09cd65a300$var$moved = true;
|
|
1197
|
-
if ($64afbd09cd65a300$var$Safari) $64afbd09cd65a300$var$css(document.body, 'user-select', 'none');
|
|
1198
|
-
},
|
|
1199
|
-
// Returns true - if no further action is needed (either inserted or another condition)
|
|
1200
|
-
_onDragOver: function _onDragOver(/**Event*/ evt) {
|
|
1201
|
-
var el = this.el, target1 = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = $64afbd09cd65a300$export$31b3ca70d8f57423.active, isOwner = $64afbd09cd65a300$var$activeGroup === group, canSort = options.sort, fromSortable = $64afbd09cd65a300$var$putSortable || activeSortable, vertical, _this = this, completedFired = false;
|
|
1202
|
-
if ($64afbd09cd65a300$var$_silent) return;
|
|
1203
|
-
function dragOverEvent(name, extra) {
|
|
1204
|
-
$64afbd09cd65a300$var$pluginEvent(name, _this, $64afbd09cd65a300$var$_objectSpread2({
|
|
1205
|
-
evt: evt,
|
|
1206
|
-
isOwner: isOwner,
|
|
1207
|
-
axis: vertical ? 'vertical' : 'horizontal',
|
|
1208
|
-
revert: revert,
|
|
1209
|
-
dragRect: dragRect,
|
|
1210
|
-
targetRect: targetRect,
|
|
1211
|
-
canSort: canSort,
|
|
1212
|
-
fromSortable: fromSortable,
|
|
1213
|
-
target: target1,
|
|
1214
|
-
completed: completed,
|
|
1215
|
-
onMove: function onMove(target, after) {
|
|
1216
|
-
return $64afbd09cd65a300$var$_onMove($64afbd09cd65a300$var$rootEl, el, $64afbd09cd65a300$var$dragEl, dragRect, target, $64afbd09cd65a300$var$getRect(target), evt, after);
|
|
1217
|
-
},
|
|
1218
|
-
changed: changed
|
|
1219
|
-
}, extra));
|
|
1220
|
-
} // Capture animation state
|
|
1221
|
-
function capture() {
|
|
1222
|
-
dragOverEvent('dragOverAnimationCapture');
|
|
1223
|
-
_this.captureAnimationState();
|
|
1224
|
-
if (_this !== fromSortable) fromSortable.captureAnimationState();
|
|
1225
|
-
} // Return invocation when dragEl is inserted (or completed)
|
|
1226
|
-
function completed(insertion) {
|
|
1227
|
-
dragOverEvent('dragOverCompleted', {
|
|
1228
|
-
insertion: insertion
|
|
1229
|
-
});
|
|
1230
|
-
if (insertion) {
|
|
1231
|
-
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
|
1232
|
-
if (isOwner) activeSortable._hideClone();
|
|
1233
|
-
else activeSortable._showClone(_this);
|
|
1234
|
-
if (_this !== fromSortable) {
|
|
1235
|
-
// Set ghost class to new sortable's ghost class
|
|
1236
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, $64afbd09cd65a300$var$putSortable ? $64afbd09cd65a300$var$putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
|
1237
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, options.ghostClass, true);
|
|
1238
|
-
}
|
|
1239
|
-
if ($64afbd09cd65a300$var$putSortable !== _this && _this !== $64afbd09cd65a300$export$31b3ca70d8f57423.active) $64afbd09cd65a300$var$putSortable = _this;
|
|
1240
|
-
else if (_this === $64afbd09cd65a300$export$31b3ca70d8f57423.active && $64afbd09cd65a300$var$putSortable) $64afbd09cd65a300$var$putSortable = null;
|
|
1241
|
-
// Animation
|
|
1242
|
-
if (fromSortable === _this) _this._ignoreWhileAnimating = target1;
|
|
1243
|
-
_this.animateAll(function() {
|
|
1244
|
-
dragOverEvent('dragOverAnimationComplete');
|
|
1245
|
-
_this._ignoreWhileAnimating = null;
|
|
1246
|
-
});
|
|
1247
|
-
if (_this !== fromSortable) {
|
|
1248
|
-
fromSortable.animateAll();
|
|
1249
|
-
fromSortable._ignoreWhileAnimating = null;
|
|
1250
|
-
}
|
|
1251
|
-
} // Null lastTarget if it is not inside a previously swapped element
|
|
1252
|
-
if (target1 === $64afbd09cd65a300$var$dragEl && !$64afbd09cd65a300$var$dragEl.animated || target1 === el && !target1.animated) $64afbd09cd65a300$var$lastTarget = null;
|
|
1253
|
-
// no bubbling and not fallback
|
|
1254
|
-
if (!options.dragoverBubble && !evt.rootEl && target1 !== document) {
|
|
1255
|
-
$64afbd09cd65a300$var$dragEl.parentNode[$64afbd09cd65a300$var$expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
|
|
1256
|
-
!insertion && $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent(evt);
|
|
1257
|
-
}
|
|
1258
|
-
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
|
1259
|
-
return completedFired = true;
|
|
1260
|
-
} // Call when dragEl has been inserted
|
|
1261
|
-
function changed() {
|
|
1262
|
-
$64afbd09cd65a300$var$newIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl);
|
|
1263
|
-
$64afbd09cd65a300$var$newDraggableIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl, options.draggable);
|
|
1264
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1265
|
-
sortable: _this,
|
|
1266
|
-
name: 'change',
|
|
1267
|
-
toEl: el,
|
|
1268
|
-
newIndex: $64afbd09cd65a300$var$newIndex,
|
|
1269
|
-
newDraggableIndex: $64afbd09cd65a300$var$newDraggableIndex,
|
|
1270
|
-
originalEvent: evt
|
|
1271
|
-
});
|
|
1272
|
-
}
|
|
1273
|
-
if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();
|
|
1274
|
-
target1 = $64afbd09cd65a300$var$closest(target1, options.draggable, el, true);
|
|
1275
|
-
dragOverEvent('dragOver');
|
|
1276
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) return completedFired;
|
|
1277
|
-
if ($64afbd09cd65a300$var$dragEl.contains(evt.target) || target1.animated && target1.animatingX && target1.animatingY || _this._ignoreWhileAnimating === target1) return completed(false);
|
|
1278
|
-
$64afbd09cd65a300$var$ignoreNextClick = false;
|
|
1279
|
-
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = $64afbd09cd65a300$var$parentEl !== $64afbd09cd65a300$var$rootEl // Reverting item into the original list
|
|
1280
|
-
) : $64afbd09cd65a300$var$putSortable === this || (this.lastPutMode = $64afbd09cd65a300$var$activeGroup.checkPull(this, activeSortable, $64afbd09cd65a300$var$dragEl, evt)) && group.checkPut(this, activeSortable, $64afbd09cd65a300$var$dragEl, evt))) {
|
|
1281
|
-
vertical = this._getDirection(evt, target1) === 'vertical';
|
|
1282
|
-
dragRect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$dragEl);
|
|
1283
|
-
dragOverEvent('dragOverValid');
|
|
1284
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) return completedFired;
|
|
1285
|
-
if (revert) {
|
|
1286
|
-
$64afbd09cd65a300$var$parentEl = $64afbd09cd65a300$var$rootEl; // actualization
|
|
1287
|
-
capture();
|
|
1288
|
-
this._hideClone();
|
|
1289
|
-
dragOverEvent('revert');
|
|
1290
|
-
if (!$64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
1291
|
-
if ($64afbd09cd65a300$var$nextEl) $64afbd09cd65a300$var$rootEl.insertBefore($64afbd09cd65a300$var$dragEl, $64afbd09cd65a300$var$nextEl);
|
|
1292
|
-
else $64afbd09cd65a300$var$rootEl.appendChild($64afbd09cd65a300$var$dragEl);
|
|
1293
|
-
}
|
|
1294
|
-
return completed(true);
|
|
1295
|
-
}
|
|
1296
|
-
var elLastChild = $64afbd09cd65a300$var$lastChild(el, options.draggable);
|
|
1297
|
-
if (!elLastChild || $64afbd09cd65a300$var$_ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
|
1298
|
-
// Insert to end of list
|
|
1299
|
-
// If already at end of list: Do not insert
|
|
1300
|
-
if (elLastChild === $64afbd09cd65a300$var$dragEl) return completed(false);
|
|
1301
|
-
// if there is a last element, it is the target
|
|
1302
|
-
if (elLastChild && el === evt.target) target1 = elLastChild;
|
|
1303
|
-
if (target1) targetRect = $64afbd09cd65a300$var$getRect(target1);
|
|
1304
|
-
if ($64afbd09cd65a300$var$_onMove($64afbd09cd65a300$var$rootEl, el, $64afbd09cd65a300$var$dragEl, dragRect, target1, targetRect, evt, !!target1) !== false) {
|
|
1305
|
-
capture();
|
|
1306
|
-
if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node
|
|
1307
|
-
el.insertBefore($64afbd09cd65a300$var$dragEl, elLastChild.nextSibling);
|
|
1308
|
-
else el.appendChild($64afbd09cd65a300$var$dragEl);
|
|
1309
|
-
$64afbd09cd65a300$var$parentEl = el; // actualization
|
|
1310
|
-
changed();
|
|
1311
|
-
return completed(true);
|
|
1312
|
-
}
|
|
1313
|
-
} else if (elLastChild && $64afbd09cd65a300$var$_ghostIsFirst(evt, vertical, this)) {
|
|
1314
|
-
// Insert to start of list
|
|
1315
|
-
var firstChild = $64afbd09cd65a300$var$getChild(el, 0, options, true);
|
|
1316
|
-
if (firstChild === $64afbd09cd65a300$var$dragEl) return completed(false);
|
|
1317
|
-
target1 = firstChild;
|
|
1318
|
-
targetRect = $64afbd09cd65a300$var$getRect(target1);
|
|
1319
|
-
if ($64afbd09cd65a300$var$_onMove($64afbd09cd65a300$var$rootEl, el, $64afbd09cd65a300$var$dragEl, dragRect, target1, targetRect, evt, false) !== false) {
|
|
1320
|
-
capture();
|
|
1321
|
-
el.insertBefore($64afbd09cd65a300$var$dragEl, firstChild);
|
|
1322
|
-
$64afbd09cd65a300$var$parentEl = el; // actualization
|
|
1323
|
-
changed();
|
|
1324
|
-
return completed(true);
|
|
1325
|
-
}
|
|
1326
|
-
} else if (target1.parentNode === el) {
|
|
1327
|
-
targetRect = $64afbd09cd65a300$var$getRect(target1);
|
|
1328
|
-
var direction = 0, targetBeforeFirstSwap, differentLevel = $64afbd09cd65a300$var$dragEl.parentNode !== el, differentRowCol = !$64afbd09cd65a300$var$_dragElInRowColumn($64afbd09cd65a300$var$dragEl.animated && $64afbd09cd65a300$var$dragEl.toRect || dragRect, target1.animated && target1.toRect || targetRect, vertical), side1 = vertical ? 'top' : 'left', scrolledPastTop = $64afbd09cd65a300$var$isScrolledPast(target1, 'top', 'top') || $64afbd09cd65a300$var$isScrolledPast($64afbd09cd65a300$var$dragEl, 'top', 'top'), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
|
1329
|
-
if ($64afbd09cd65a300$var$lastTarget !== target1) {
|
|
1330
|
-
targetBeforeFirstSwap = targetRect[side1];
|
|
1331
|
-
$64afbd09cd65a300$var$pastFirstInvertThresh = false;
|
|
1332
|
-
$64afbd09cd65a300$var$isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
|
1333
|
-
}
|
|
1334
|
-
direction = $64afbd09cd65a300$var$_getSwapDirection(evt, target1, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, $64afbd09cd65a300$var$isCircumstantialInvert, $64afbd09cd65a300$var$lastTarget === target1);
|
|
1335
|
-
var sibling;
|
|
1336
|
-
if (direction !== 0) {
|
|
1337
|
-
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
|
1338
|
-
var dragIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl);
|
|
1339
|
-
do {
|
|
1340
|
-
dragIndex -= direction;
|
|
1341
|
-
sibling = $64afbd09cd65a300$var$parentEl.children[dragIndex];
|
|
1342
|
-
}while (sibling && ($64afbd09cd65a300$var$css(sibling, 'display') === 'none' || sibling === $64afbd09cd65a300$var$ghostEl))
|
|
1343
|
-
} // If dragEl is already beside target: Do not insert
|
|
1344
|
-
if (direction === 0 || sibling === target1) return completed(false);
|
|
1345
|
-
$64afbd09cd65a300$var$lastTarget = target1;
|
|
1346
|
-
$64afbd09cd65a300$var$lastDirection = direction;
|
|
1347
|
-
var nextSibling = target1.nextElementSibling, after1 = false;
|
|
1348
|
-
after1 = direction === 1;
|
|
1349
|
-
var moveVector = $64afbd09cd65a300$var$_onMove($64afbd09cd65a300$var$rootEl, el, $64afbd09cd65a300$var$dragEl, dragRect, target1, targetRect, evt, after1);
|
|
1350
|
-
if (moveVector !== false) {
|
|
1351
|
-
if (moveVector === 1 || moveVector === -1) after1 = moveVector === 1;
|
|
1352
|
-
$64afbd09cd65a300$var$_silent = true;
|
|
1353
|
-
setTimeout($64afbd09cd65a300$var$_unsilent, 30);
|
|
1354
|
-
capture();
|
|
1355
|
-
if (after1 && !nextSibling) el.appendChild($64afbd09cd65a300$var$dragEl);
|
|
1356
|
-
else target1.parentNode.insertBefore($64afbd09cd65a300$var$dragEl, after1 ? nextSibling : target1);
|
|
1357
|
-
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
|
1358
|
-
if (scrolledPastTop) $64afbd09cd65a300$var$scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
|
1359
|
-
$64afbd09cd65a300$var$parentEl = $64afbd09cd65a300$var$dragEl.parentNode; // actualization
|
|
1360
|
-
// must be done before animation
|
|
1361
|
-
if (targetBeforeFirstSwap !== undefined && !$64afbd09cd65a300$var$isCircumstantialInvert) $64afbd09cd65a300$var$targetMoveDistance = Math.abs(targetBeforeFirstSwap - $64afbd09cd65a300$var$getRect(target1)[side1]);
|
|
1362
|
-
changed();
|
|
1363
|
-
return completed(true);
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
if (el.contains($64afbd09cd65a300$var$dragEl)) return completed(false);
|
|
1367
|
-
}
|
|
1368
|
-
return false;
|
|
1369
|
-
},
|
|
1370
|
-
_ignoreWhileAnimating: null,
|
|
1371
|
-
_offMoveEvents: function _offMoveEvents() {
|
|
1372
|
-
$64afbd09cd65a300$var$off(document, 'mousemove', this._onTouchMove);
|
|
1373
|
-
$64afbd09cd65a300$var$off(document, 'touchmove', this._onTouchMove);
|
|
1374
|
-
$64afbd09cd65a300$var$off(document, 'pointermove', this._onTouchMove);
|
|
1375
|
-
$64afbd09cd65a300$var$off(document, 'dragover', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
1376
|
-
$64afbd09cd65a300$var$off(document, 'mousemove', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
1377
|
-
$64afbd09cd65a300$var$off(document, 'touchmove', $64afbd09cd65a300$var$nearestEmptyInsertDetectEvent);
|
|
1378
|
-
},
|
|
1379
|
-
_offUpEvents: function _offUpEvents() {
|
|
1380
|
-
var ownerDocument = this.el.ownerDocument;
|
|
1381
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'mouseup', this._onDrop);
|
|
1382
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'touchend', this._onDrop);
|
|
1383
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'pointerup', this._onDrop);
|
|
1384
|
-
$64afbd09cd65a300$var$off(ownerDocument, 'touchcancel', this._onDrop);
|
|
1385
|
-
$64afbd09cd65a300$var$off(document, 'selectstart', this);
|
|
1386
|
-
},
|
|
1387
|
-
_onDrop: function _onDrop(/**Event*/ evt) {
|
|
1388
|
-
var el = this.el, options = this.options; // Get the index of the dragged element within its parent
|
|
1389
|
-
$64afbd09cd65a300$var$newIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl);
|
|
1390
|
-
$64afbd09cd65a300$var$newDraggableIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl, options.draggable);
|
|
1391
|
-
$64afbd09cd65a300$var$pluginEvent('drop', this, {
|
|
1392
|
-
evt: evt
|
|
1393
|
-
});
|
|
1394
|
-
$64afbd09cd65a300$var$parentEl = $64afbd09cd65a300$var$dragEl && $64afbd09cd65a300$var$dragEl.parentNode; // Get again after plugin event
|
|
1395
|
-
$64afbd09cd65a300$var$newIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl);
|
|
1396
|
-
$64afbd09cd65a300$var$newDraggableIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl, options.draggable);
|
|
1397
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) {
|
|
1398
|
-
this._nulling();
|
|
1399
|
-
return;
|
|
1400
|
-
}
|
|
1401
|
-
$64afbd09cd65a300$var$awaitingDragStarted = false;
|
|
1402
|
-
$64afbd09cd65a300$var$isCircumstantialInvert = false;
|
|
1403
|
-
$64afbd09cd65a300$var$pastFirstInvertThresh = false;
|
|
1404
|
-
clearInterval(this._loopId);
|
|
1405
|
-
clearTimeout(this._dragStartTimer);
|
|
1406
|
-
$64afbd09cd65a300$var$_cancelNextTick(this.cloneId);
|
|
1407
|
-
$64afbd09cd65a300$var$_cancelNextTick(this._dragStartId); // Unbind events
|
|
1408
|
-
if (this.nativeDraggable) {
|
|
1409
|
-
$64afbd09cd65a300$var$off(document, 'drop', this);
|
|
1410
|
-
$64afbd09cd65a300$var$off(el, 'dragstart', this._onDragStart);
|
|
1411
|
-
}
|
|
1412
|
-
this._offMoveEvents();
|
|
1413
|
-
this._offUpEvents();
|
|
1414
|
-
if ($64afbd09cd65a300$var$Safari) $64afbd09cd65a300$var$css(document.body, 'user-select', '');
|
|
1415
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$dragEl, 'transform', '');
|
|
1416
|
-
if (evt) {
|
|
1417
|
-
if ($64afbd09cd65a300$var$moved) {
|
|
1418
|
-
evt.cancelable && evt.preventDefault();
|
|
1419
|
-
!options.dropBubble && evt.stopPropagation();
|
|
1420
|
-
}
|
|
1421
|
-
$64afbd09cd65a300$var$ghostEl && $64afbd09cd65a300$var$ghostEl.parentNode && $64afbd09cd65a300$var$ghostEl.parentNode.removeChild($64afbd09cd65a300$var$ghostEl);
|
|
1422
|
-
if ($64afbd09cd65a300$var$rootEl === $64afbd09cd65a300$var$parentEl || $64afbd09cd65a300$var$putSortable && $64afbd09cd65a300$var$putSortable.lastPutMode !== 'clone') // Remove clone(s)
|
|
1423
|
-
$64afbd09cd65a300$var$cloneEl && $64afbd09cd65a300$var$cloneEl.parentNode && $64afbd09cd65a300$var$cloneEl.parentNode.removeChild($64afbd09cd65a300$var$cloneEl);
|
|
1424
|
-
if ($64afbd09cd65a300$var$dragEl) {
|
|
1425
|
-
if (this.nativeDraggable) $64afbd09cd65a300$var$off($64afbd09cd65a300$var$dragEl, 'dragend', this);
|
|
1426
|
-
$64afbd09cd65a300$var$_disableDraggable($64afbd09cd65a300$var$dragEl);
|
|
1427
|
-
$64afbd09cd65a300$var$dragEl.style['will-change'] = ''; // Remove classes
|
|
1428
|
-
// ghostClass is added in dragStarted
|
|
1429
|
-
if ($64afbd09cd65a300$var$moved && !$64afbd09cd65a300$var$awaitingDragStarted) $64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, $64afbd09cd65a300$var$putSortable ? $64afbd09cd65a300$var$putSortable.options.ghostClass : this.options.ghostClass, false);
|
|
1430
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl, this.options.chosenClass, false); // Drag stop event
|
|
1431
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1432
|
-
sortable: this,
|
|
1433
|
-
name: 'unchoose',
|
|
1434
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1435
|
-
newIndex: null,
|
|
1436
|
-
newDraggableIndex: null,
|
|
1437
|
-
originalEvent: evt
|
|
1438
|
-
});
|
|
1439
|
-
if ($64afbd09cd65a300$var$rootEl !== $64afbd09cd65a300$var$parentEl) {
|
|
1440
|
-
if ($64afbd09cd65a300$var$newIndex >= 0) {
|
|
1441
|
-
// Add event
|
|
1442
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1443
|
-
rootEl: $64afbd09cd65a300$var$parentEl,
|
|
1444
|
-
name: 'add',
|
|
1445
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1446
|
-
fromEl: $64afbd09cd65a300$var$rootEl,
|
|
1447
|
-
originalEvent: evt
|
|
1448
|
-
}); // Remove event
|
|
1449
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1450
|
-
sortable: this,
|
|
1451
|
-
name: 'remove',
|
|
1452
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1453
|
-
originalEvent: evt
|
|
1454
|
-
}); // drag from one list and drop into another
|
|
1455
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1456
|
-
rootEl: $64afbd09cd65a300$var$parentEl,
|
|
1457
|
-
name: 'sort',
|
|
1458
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1459
|
-
fromEl: $64afbd09cd65a300$var$rootEl,
|
|
1460
|
-
originalEvent: evt
|
|
1461
|
-
});
|
|
1462
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1463
|
-
sortable: this,
|
|
1464
|
-
name: 'sort',
|
|
1465
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1466
|
-
originalEvent: evt
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
$64afbd09cd65a300$var$putSortable && $64afbd09cd65a300$var$putSortable.save();
|
|
1470
|
-
} else {
|
|
1471
|
-
if ($64afbd09cd65a300$var$newIndex !== $64afbd09cd65a300$var$oldIndex) {
|
|
1472
|
-
if ($64afbd09cd65a300$var$newIndex >= 0) {
|
|
1473
|
-
// drag & drop within the same list
|
|
1474
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1475
|
-
sortable: this,
|
|
1476
|
-
name: 'update',
|
|
1477
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1478
|
-
originalEvent: evt
|
|
1479
|
-
});
|
|
1480
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1481
|
-
sortable: this,
|
|
1482
|
-
name: 'sort',
|
|
1483
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1484
|
-
originalEvent: evt
|
|
1485
|
-
});
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.active) {
|
|
1490
|
-
/* jshint eqnull:true */ if ($64afbd09cd65a300$var$newIndex == null || $64afbd09cd65a300$var$newIndex === -1) {
|
|
1491
|
-
$64afbd09cd65a300$var$newIndex = $64afbd09cd65a300$var$oldIndex;
|
|
1492
|
-
$64afbd09cd65a300$var$newDraggableIndex = $64afbd09cd65a300$var$oldDraggableIndex;
|
|
1493
|
-
}
|
|
1494
|
-
$64afbd09cd65a300$var$_dispatchEvent({
|
|
1495
|
-
sortable: this,
|
|
1496
|
-
name: 'end',
|
|
1497
|
-
toEl: $64afbd09cd65a300$var$parentEl,
|
|
1498
|
-
originalEvent: evt
|
|
1499
|
-
}); // Save sorting
|
|
1500
|
-
this.save();
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
this._nulling();
|
|
1505
|
-
},
|
|
1506
|
-
_nulling: function _nulling() {
|
|
1507
|
-
$64afbd09cd65a300$var$pluginEvent('nulling', this);
|
|
1508
|
-
$64afbd09cd65a300$var$rootEl = $64afbd09cd65a300$var$dragEl = $64afbd09cd65a300$var$parentEl = $64afbd09cd65a300$var$ghostEl = $64afbd09cd65a300$var$nextEl = $64afbd09cd65a300$var$cloneEl = $64afbd09cd65a300$var$lastDownEl = $64afbd09cd65a300$var$cloneHidden = $64afbd09cd65a300$var$tapEvt = $64afbd09cd65a300$var$touchEvt = $64afbd09cd65a300$var$moved = $64afbd09cd65a300$var$newIndex = $64afbd09cd65a300$var$newDraggableIndex = $64afbd09cd65a300$var$oldIndex = $64afbd09cd65a300$var$oldDraggableIndex = $64afbd09cd65a300$var$lastTarget = $64afbd09cd65a300$var$lastDirection = $64afbd09cd65a300$var$putSortable = $64afbd09cd65a300$var$activeGroup = $64afbd09cd65a300$export$31b3ca70d8f57423.dragged = $64afbd09cd65a300$export$31b3ca70d8f57423.ghost = $64afbd09cd65a300$export$31b3ca70d8f57423.clone = $64afbd09cd65a300$export$31b3ca70d8f57423.active = null;
|
|
1509
|
-
$64afbd09cd65a300$var$savedInputChecked.forEach(function(el) {
|
|
1510
|
-
el.checked = true;
|
|
1511
|
-
});
|
|
1512
|
-
$64afbd09cd65a300$var$savedInputChecked.length = $64afbd09cd65a300$var$lastDx = $64afbd09cd65a300$var$lastDy = 0;
|
|
1513
|
-
},
|
|
1514
|
-
handleEvent: function handleEvent(/**Event*/ evt) {
|
|
1515
|
-
switch(evt.type){
|
|
1516
|
-
case 'drop':
|
|
1517
|
-
case 'dragend':
|
|
1518
|
-
this._onDrop(evt);
|
|
1519
|
-
break;
|
|
1520
|
-
case 'dragenter':
|
|
1521
|
-
case 'dragover':
|
|
1522
|
-
if ($64afbd09cd65a300$var$dragEl) {
|
|
1523
|
-
this._onDragOver(evt);
|
|
1524
|
-
$64afbd09cd65a300$var$_globalDragOver(evt);
|
|
1525
|
-
}
|
|
1526
|
-
break;
|
|
1527
|
-
case 'selectstart':
|
|
1528
|
-
evt.preventDefault();
|
|
1529
|
-
break;
|
|
1530
|
-
}
|
|
1531
|
-
},
|
|
1532
|
-
/**
|
|
1533
|
-
* Serializes the item into an array of string.
|
|
1534
|
-
* @returns {String[]}
|
|
1535
|
-
*/ toArray: function toArray() {
|
|
1536
|
-
var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
|
|
1537
|
-
for(; i < n; i++){
|
|
1538
|
-
el = children[i];
|
|
1539
|
-
if ($64afbd09cd65a300$var$closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || $64afbd09cd65a300$var$_generateId(el));
|
|
1540
|
-
}
|
|
1541
|
-
return order;
|
|
1542
|
-
},
|
|
1543
|
-
/**
|
|
1544
|
-
* Sorts the elements according to the array.
|
|
1545
|
-
* @param {String[]} order order of the items
|
|
1546
|
-
*/ sort: function sort(order, useAnimation) {
|
|
1547
|
-
var items = {}, rootEl = this.el;
|
|
1548
|
-
this.toArray().forEach(function(id, i) {
|
|
1549
|
-
var el = rootEl.children[i];
|
|
1550
|
-
if ($64afbd09cd65a300$var$closest(el, this.options.draggable, rootEl, false)) items[id] = el;
|
|
1551
|
-
}, this);
|
|
1552
|
-
useAnimation && this.captureAnimationState();
|
|
1553
|
-
order.forEach(function(id) {
|
|
1554
|
-
if (items[id]) {
|
|
1555
|
-
rootEl.removeChild(items[id]);
|
|
1556
|
-
rootEl.appendChild(items[id]);
|
|
1557
|
-
}
|
|
1558
|
-
});
|
|
1559
|
-
useAnimation && this.animateAll();
|
|
1560
|
-
},
|
|
1561
|
-
/**
|
|
1562
|
-
* Save the current sorting
|
|
1563
|
-
*/ save: function save() {
|
|
1564
|
-
var store = this.options.store;
|
|
1565
|
-
store && store.set && store.set(this);
|
|
1566
|
-
},
|
|
1567
|
-
/**
|
|
1568
|
-
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
|
1569
|
-
* @param {HTMLElement} el
|
|
1570
|
-
* @param {String} [selector] default: `options.draggable`
|
|
1571
|
-
* @returns {HTMLElement|null}
|
|
1572
|
-
*/ closest: function closest$1(el, selector) {
|
|
1573
|
-
return $64afbd09cd65a300$var$closest(el, selector || this.options.draggable, this.el, false);
|
|
1574
|
-
},
|
|
1575
|
-
/**
|
|
1576
|
-
* Set/get option
|
|
1577
|
-
* @param {string} name
|
|
1578
|
-
* @param {*} [value]
|
|
1579
|
-
* @returns {*}
|
|
1580
|
-
*/ option: function option(name, value) {
|
|
1581
|
-
var options = this.options;
|
|
1582
|
-
if (value === void 0) return options[name];
|
|
1583
|
-
else {
|
|
1584
|
-
var modifiedValue = $64afbd09cd65a300$var$PluginManager.modifyOption(this, name, value);
|
|
1585
|
-
if (typeof modifiedValue !== 'undefined') options[name] = modifiedValue;
|
|
1586
|
-
else options[name] = value;
|
|
1587
|
-
if (name === 'group') $64afbd09cd65a300$var$_prepareGroup(options);
|
|
1588
|
-
}
|
|
1589
|
-
},
|
|
1590
|
-
/**
|
|
1591
|
-
* Destroy
|
|
1592
|
-
*/ destroy: function destroy() {
|
|
1593
|
-
$64afbd09cd65a300$var$pluginEvent('destroy', this);
|
|
1594
|
-
var el1 = this.el;
|
|
1595
|
-
el1[$64afbd09cd65a300$var$expando] = null;
|
|
1596
|
-
$64afbd09cd65a300$var$off(el1, 'mousedown', this._onTapStart);
|
|
1597
|
-
$64afbd09cd65a300$var$off(el1, 'touchstart', this._onTapStart);
|
|
1598
|
-
$64afbd09cd65a300$var$off(el1, 'pointerdown', this._onTapStart);
|
|
1599
|
-
if (this.nativeDraggable) {
|
|
1600
|
-
$64afbd09cd65a300$var$off(el1, 'dragover', this);
|
|
1601
|
-
$64afbd09cd65a300$var$off(el1, 'dragenter', this);
|
|
1602
|
-
} // Remove draggable attributes
|
|
1603
|
-
Array.prototype.forEach.call(el1.querySelectorAll('[draggable]'), function(el) {
|
|
1604
|
-
el.removeAttribute('draggable');
|
|
1605
|
-
});
|
|
1606
|
-
this._onDrop();
|
|
1607
|
-
this._disableDelayedDragEvents();
|
|
1608
|
-
$64afbd09cd65a300$var$sortables.splice($64afbd09cd65a300$var$sortables.indexOf(this.el), 1);
|
|
1609
|
-
this.el = el1 = null;
|
|
1610
|
-
},
|
|
1611
|
-
_hideClone: function _hideClone() {
|
|
1612
|
-
if (!$64afbd09cd65a300$var$cloneHidden) {
|
|
1613
|
-
$64afbd09cd65a300$var$pluginEvent('hideClone', this);
|
|
1614
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) return;
|
|
1615
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$cloneEl, 'display', 'none');
|
|
1616
|
-
if (this.options.removeCloneOnHide && $64afbd09cd65a300$var$cloneEl.parentNode) $64afbd09cd65a300$var$cloneEl.parentNode.removeChild($64afbd09cd65a300$var$cloneEl);
|
|
1617
|
-
$64afbd09cd65a300$var$cloneHidden = true;
|
|
1618
|
-
}
|
|
1619
|
-
},
|
|
1620
|
-
_showClone: function _showClone(putSortable) {
|
|
1621
|
-
if (putSortable.lastPutMode !== 'clone') {
|
|
1622
|
-
this._hideClone();
|
|
1623
|
-
return;
|
|
1624
|
-
}
|
|
1625
|
-
if ($64afbd09cd65a300$var$cloneHidden) {
|
|
1626
|
-
$64afbd09cd65a300$var$pluginEvent('showClone', this);
|
|
1627
|
-
if ($64afbd09cd65a300$export$31b3ca70d8f57423.eventCanceled) return; // show clone at dragEl or original position
|
|
1628
|
-
if ($64afbd09cd65a300$var$dragEl.parentNode == $64afbd09cd65a300$var$rootEl && !this.options.group.revertClone) $64afbd09cd65a300$var$rootEl.insertBefore($64afbd09cd65a300$var$cloneEl, $64afbd09cd65a300$var$dragEl);
|
|
1629
|
-
else if ($64afbd09cd65a300$var$nextEl) $64afbd09cd65a300$var$rootEl.insertBefore($64afbd09cd65a300$var$cloneEl, $64afbd09cd65a300$var$nextEl);
|
|
1630
|
-
else $64afbd09cd65a300$var$rootEl.appendChild($64afbd09cd65a300$var$cloneEl);
|
|
1631
|
-
if (this.options.group.revertClone) this.animate($64afbd09cd65a300$var$dragEl, $64afbd09cd65a300$var$cloneEl);
|
|
1632
|
-
$64afbd09cd65a300$var$css($64afbd09cd65a300$var$cloneEl, 'display', '');
|
|
1633
|
-
$64afbd09cd65a300$var$cloneHidden = false;
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
};
|
|
1637
|
-
function $64afbd09cd65a300$var$_globalDragOver(/**Event*/ evt) {
|
|
1638
|
-
if (evt.dataTransfer) evt.dataTransfer.dropEffect = 'move';
|
|
1639
|
-
evt.cancelable && evt.preventDefault();
|
|
1640
|
-
}
|
|
1641
|
-
function $64afbd09cd65a300$var$_onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
|
1642
|
-
var evt, sortable = fromEl[$64afbd09cd65a300$var$expando], onMoveFn = sortable.options.onMove, retVal; // Support for new CustomEvent feature
|
|
1643
|
-
if (window.CustomEvent && !$64afbd09cd65a300$var$IE11OrLess && !$64afbd09cd65a300$var$Edge) evt = new CustomEvent('move', {
|
|
1644
|
-
bubbles: true,
|
|
1645
|
-
cancelable: true
|
|
1646
|
-
});
|
|
1647
|
-
else {
|
|
1648
|
-
evt = document.createEvent('Event');
|
|
1649
|
-
evt.initEvent('move', true, true);
|
|
1650
|
-
}
|
|
1651
|
-
evt.to = toEl;
|
|
1652
|
-
evt.from = fromEl;
|
|
1653
|
-
evt.dragged = dragEl;
|
|
1654
|
-
evt.draggedRect = dragRect;
|
|
1655
|
-
evt.related = targetEl || toEl;
|
|
1656
|
-
evt.relatedRect = targetRect || $64afbd09cd65a300$var$getRect(toEl);
|
|
1657
|
-
evt.willInsertAfter = willInsertAfter;
|
|
1658
|
-
evt.originalEvent = originalEvent;
|
|
1659
|
-
fromEl.dispatchEvent(evt);
|
|
1660
|
-
if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);
|
|
1661
|
-
return retVal;
|
|
1662
|
-
}
|
|
1663
|
-
function $64afbd09cd65a300$var$_disableDraggable(el) {
|
|
1664
|
-
el.draggable = false;
|
|
1665
|
-
}
|
|
1666
|
-
function $64afbd09cd65a300$var$_unsilent() {
|
|
1667
|
-
$64afbd09cd65a300$var$_silent = false;
|
|
1668
|
-
}
|
|
1669
|
-
function $64afbd09cd65a300$var$_ghostIsFirst(evt, vertical, sortable) {
|
|
1670
|
-
var rect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$getChild(sortable.el, 0, sortable.options, true));
|
|
1671
|
-
var spacer = 10;
|
|
1672
|
-
return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;
|
|
1673
|
-
}
|
|
1674
|
-
function $64afbd09cd65a300$var$_ghostIsLast(evt, vertical, sortable) {
|
|
1675
|
-
var rect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$lastChild(sortable.el, sortable.options.draggable));
|
|
1676
|
-
var spacer = 10;
|
|
1677
|
-
return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
|
|
1678
|
-
}
|
|
1679
|
-
function $64afbd09cd65a300$var$_getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
|
1680
|
-
var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;
|
|
1681
|
-
if (!invertSwap) {
|
|
1682
|
-
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
|
1683
|
-
if (isLastTarget && $64afbd09cd65a300$var$targetMoveDistance < targetLength * swapThreshold) {
|
|
1684
|
-
// multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
|
|
1685
|
-
// check if past first invert threshold on side opposite of lastDirection
|
|
1686
|
-
if (!$64afbd09cd65a300$var$pastFirstInvertThresh && ($64afbd09cd65a300$var$lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) // past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
|
1687
|
-
$64afbd09cd65a300$var$pastFirstInvertThresh = true;
|
|
1688
|
-
if (!$64afbd09cd65a300$var$pastFirstInvertThresh) {
|
|
1689
|
-
// dragEl shadow (target move distance shadow)
|
|
1690
|
-
if ($64afbd09cd65a300$var$lastDirection === 1 ? mouseOnAxis < targetS1 + $64afbd09cd65a300$var$targetMoveDistance // over dragEl shadow
|
|
1691
|
-
: mouseOnAxis > targetS2 - $64afbd09cd65a300$var$targetMoveDistance) return -$64afbd09cd65a300$var$lastDirection;
|
|
1692
|
-
} else invert = true;
|
|
1693
|
-
} else {
|
|
1694
|
-
// Regular
|
|
1695
|
-
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return $64afbd09cd65a300$var$_getInsertDirection(target);
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
invert = invert || invertSwap;
|
|
1699
|
-
if (invert) {
|
|
1700
|
-
// Invert of regular
|
|
1701
|
-
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
|
1702
|
-
}
|
|
1703
|
-
return 0;
|
|
1704
|
-
}
|
|
1705
|
-
/**
|
|
1706
|
-
* Gets the direction dragEl must be swapped relative to target in order to make it
|
|
1707
|
-
* seem that dragEl has been "inserted" into that element's position
|
|
1708
|
-
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
|
1709
|
-
* @return {Number} Direction dragEl must be swapped
|
|
1710
|
-
*/ function $64afbd09cd65a300$var$_getInsertDirection(target) {
|
|
1711
|
-
if ($64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl) < $64afbd09cd65a300$var$index(target)) return 1;
|
|
1712
|
-
else return -1;
|
|
1713
|
-
}
|
|
1714
|
-
/**
|
|
1715
|
-
* Generate id
|
|
1716
|
-
* @param {HTMLElement} el
|
|
1717
|
-
* @returns {String}
|
|
1718
|
-
* @private
|
|
1719
|
-
*/ function $64afbd09cd65a300$var$_generateId(el) {
|
|
1720
|
-
var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;
|
|
1721
|
-
while(i--)sum += str.charCodeAt(i);
|
|
1722
|
-
return sum.toString(36);
|
|
1723
|
-
}
|
|
1724
|
-
function $64afbd09cd65a300$var$_saveInputCheckedState(root) {
|
|
1725
|
-
$64afbd09cd65a300$var$savedInputChecked.length = 0;
|
|
1726
|
-
var inputs = root.getElementsByTagName('input');
|
|
1727
|
-
var idx = inputs.length;
|
|
1728
|
-
while(idx--){
|
|
1729
|
-
var el = inputs[idx];
|
|
1730
|
-
el.checked && $64afbd09cd65a300$var$savedInputChecked.push(el);
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
function $64afbd09cd65a300$var$_nextTick(fn) {
|
|
1734
|
-
return setTimeout(fn, 0);
|
|
1735
|
-
}
|
|
1736
|
-
function $64afbd09cd65a300$var$_cancelNextTick(id) {
|
|
1737
|
-
return clearTimeout(id);
|
|
1738
|
-
} // Fixed #973:
|
|
1739
|
-
if ($64afbd09cd65a300$var$documentExists) $64afbd09cd65a300$var$on(document, 'touchmove', function(evt) {
|
|
1740
|
-
if (($64afbd09cd65a300$export$31b3ca70d8f57423.active || $64afbd09cd65a300$var$awaitingDragStarted) && evt.cancelable) evt.preventDefault();
|
|
1741
|
-
});
|
|
1742
|
-
// Export utils
|
|
1743
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.utils = {
|
|
1744
|
-
on: $64afbd09cd65a300$var$on,
|
|
1745
|
-
off: $64afbd09cd65a300$var$off,
|
|
1746
|
-
css: $64afbd09cd65a300$var$css,
|
|
1747
|
-
find: $64afbd09cd65a300$var$find,
|
|
1748
|
-
is: function is(el, selector) {
|
|
1749
|
-
return !!$64afbd09cd65a300$var$closest(el, selector, el, false);
|
|
1750
|
-
},
|
|
1751
|
-
extend: $64afbd09cd65a300$var$extend,
|
|
1752
|
-
throttle: $64afbd09cd65a300$var$throttle,
|
|
1753
|
-
closest: $64afbd09cd65a300$var$closest,
|
|
1754
|
-
toggleClass: $64afbd09cd65a300$var$toggleClass,
|
|
1755
|
-
clone: $64afbd09cd65a300$var$clone,
|
|
1756
|
-
index: $64afbd09cd65a300$var$index,
|
|
1757
|
-
nextTick: $64afbd09cd65a300$var$_nextTick,
|
|
1758
|
-
cancelNextTick: $64afbd09cd65a300$var$_cancelNextTick,
|
|
1759
|
-
detectDirection: $64afbd09cd65a300$var$_detectDirection,
|
|
1760
|
-
getChild: $64afbd09cd65a300$var$getChild
|
|
1761
|
-
};
|
|
1762
|
-
/**
|
|
1763
|
-
* Get the Sortable instance of an element
|
|
1764
|
-
* @param {HTMLElement} element The element
|
|
1765
|
-
* @return {Sortable|undefined} The instance of Sortable
|
|
1766
|
-
*/ $64afbd09cd65a300$export$31b3ca70d8f57423.get = function(element) {
|
|
1767
|
-
return element[$64afbd09cd65a300$var$expando];
|
|
1768
|
-
};
|
|
1769
|
-
/**
|
|
1770
|
-
* Mount a plugin to Sortable
|
|
1771
|
-
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
|
1772
|
-
*/ $64afbd09cd65a300$export$31b3ca70d8f57423.mount = function() {
|
|
1773
|
-
for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key];
|
|
1774
|
-
if (plugins[0].constructor === Array) plugins = plugins[0];
|
|
1775
|
-
plugins.forEach(function(plugin) {
|
|
1776
|
-
if (!plugin.prototype || !plugin.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat(({}).toString.call(plugin));
|
|
1777
|
-
if (plugin.utils) $64afbd09cd65a300$export$31b3ca70d8f57423.utils = $64afbd09cd65a300$var$_objectSpread2($64afbd09cd65a300$var$_objectSpread2({}, $64afbd09cd65a300$export$31b3ca70d8f57423.utils), plugin.utils);
|
|
1778
|
-
$64afbd09cd65a300$var$PluginManager.mount(plugin);
|
|
1779
|
-
});
|
|
1780
|
-
};
|
|
1781
|
-
/**
|
|
1782
|
-
* Create sortable instance
|
|
1783
|
-
* @param {HTMLElement} el
|
|
1784
|
-
* @param {Object} [options]
|
|
1785
|
-
*/ $64afbd09cd65a300$export$31b3ca70d8f57423.create = function(el, options) {
|
|
1786
|
-
return new $64afbd09cd65a300$export$31b3ca70d8f57423(el, options);
|
|
1787
|
-
}; // Export
|
|
1788
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.version = $64afbd09cd65a300$var$version;
|
|
1789
|
-
var $64afbd09cd65a300$var$autoScrolls = [], $64afbd09cd65a300$var$scrollEl, $64afbd09cd65a300$var$scrollRootEl, $64afbd09cd65a300$var$scrolling = false, $64afbd09cd65a300$var$lastAutoScrollX, $64afbd09cd65a300$var$lastAutoScrollY, $64afbd09cd65a300$var$touchEvt$1, $64afbd09cd65a300$var$pointerElemChangedInterval;
|
|
1790
|
-
function $64afbd09cd65a300$var$AutoScrollPlugin() {
|
|
1791
|
-
function AutoScroll() {
|
|
1792
|
-
this.defaults = {
|
|
1793
|
-
scroll: true,
|
|
1794
|
-
forceAutoScrollFallback: false,
|
|
1795
|
-
scrollSensitivity: 30,
|
|
1796
|
-
scrollSpeed: 10,
|
|
1797
|
-
bubbleScroll: true
|
|
1798
|
-
}; // Bind all private methods
|
|
1799
|
-
for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this);
|
|
1800
|
-
}
|
|
1801
|
-
AutoScroll.prototype = {
|
|
1802
|
-
dragStarted: function dragStarted(_ref) {
|
|
1803
|
-
var originalEvent = _ref.originalEvent;
|
|
1804
|
-
if (this.sortable.nativeDraggable) $64afbd09cd65a300$var$on(document, 'dragover', this._handleAutoScroll);
|
|
1805
|
-
else {
|
|
1806
|
-
if (this.options.supportPointer) $64afbd09cd65a300$var$on(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
1807
|
-
else if (originalEvent.touches) $64afbd09cd65a300$var$on(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
1808
|
-
else $64afbd09cd65a300$var$on(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
1809
|
-
}
|
|
1810
|
-
},
|
|
1811
|
-
dragOverCompleted: function dragOverCompleted(_ref2) {
|
|
1812
|
-
var originalEvent = _ref2.originalEvent;
|
|
1813
|
-
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
|
1814
|
-
if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);
|
|
1815
|
-
},
|
|
1816
|
-
drop: function drop() {
|
|
1817
|
-
if (this.sortable.nativeDraggable) $64afbd09cd65a300$var$off(document, 'dragover', this._handleAutoScroll);
|
|
1818
|
-
else {
|
|
1819
|
-
$64afbd09cd65a300$var$off(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
1820
|
-
$64afbd09cd65a300$var$off(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
1821
|
-
$64afbd09cd65a300$var$off(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
1822
|
-
}
|
|
1823
|
-
$64afbd09cd65a300$var$clearPointerElemChangedInterval();
|
|
1824
|
-
$64afbd09cd65a300$var$clearAutoScrolls();
|
|
1825
|
-
$64afbd09cd65a300$var$cancelThrottle();
|
|
1826
|
-
},
|
|
1827
|
-
nulling: function nulling() {
|
|
1828
|
-
$64afbd09cd65a300$var$touchEvt$1 = $64afbd09cd65a300$var$scrollRootEl = $64afbd09cd65a300$var$scrollEl = $64afbd09cd65a300$var$scrolling = $64afbd09cd65a300$var$pointerElemChangedInterval = $64afbd09cd65a300$var$lastAutoScrollX = $64afbd09cd65a300$var$lastAutoScrollY = null;
|
|
1829
|
-
$64afbd09cd65a300$var$autoScrolls.length = 0;
|
|
1830
|
-
},
|
|
1831
|
-
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
|
1832
|
-
this._handleAutoScroll(evt, true);
|
|
1833
|
-
},
|
|
1834
|
-
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
|
1835
|
-
var _this = this;
|
|
1836
|
-
var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);
|
|
1837
|
-
$64afbd09cd65a300$var$touchEvt$1 = evt; // IE does not seem to have native autoscroll,
|
|
1838
|
-
// Edge's autoscroll seems too conditional,
|
|
1839
|
-
// MACOS Safari does not have autoscroll,
|
|
1840
|
-
// Firefox and Chrome are good
|
|
1841
|
-
if (fallback || this.options.forceAutoScrollFallback || $64afbd09cd65a300$var$Edge || $64afbd09cd65a300$var$IE11OrLess || $64afbd09cd65a300$var$Safari) {
|
|
1842
|
-
$64afbd09cd65a300$var$autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
|
|
1843
|
-
var ogElemScroller = $64afbd09cd65a300$var$getParentAutoScrollElement(elem, true);
|
|
1844
|
-
if ($64afbd09cd65a300$var$scrolling && (!$64afbd09cd65a300$var$pointerElemChangedInterval || x !== $64afbd09cd65a300$var$lastAutoScrollX || y !== $64afbd09cd65a300$var$lastAutoScrollY)) {
|
|
1845
|
-
$64afbd09cd65a300$var$pointerElemChangedInterval && $64afbd09cd65a300$var$clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
|
|
1846
|
-
$64afbd09cd65a300$var$pointerElemChangedInterval = setInterval(function() {
|
|
1847
|
-
var newElem = $64afbd09cd65a300$var$getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
1848
|
-
if (newElem !== ogElemScroller) {
|
|
1849
|
-
ogElemScroller = newElem;
|
|
1850
|
-
$64afbd09cd65a300$var$clearAutoScrolls();
|
|
1851
|
-
}
|
|
1852
|
-
$64afbd09cd65a300$var$autoScroll(evt, _this.options, newElem, fallback);
|
|
1853
|
-
}, 10);
|
|
1854
|
-
$64afbd09cd65a300$var$lastAutoScrollX = x;
|
|
1855
|
-
$64afbd09cd65a300$var$lastAutoScrollY = y;
|
|
1856
|
-
}
|
|
1857
|
-
} else {
|
|
1858
|
-
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
|
1859
|
-
if (!this.options.bubbleScroll || $64afbd09cd65a300$var$getParentAutoScrollElement(elem, true) === $64afbd09cd65a300$var$getWindowScrollingElement()) {
|
|
1860
|
-
$64afbd09cd65a300$var$clearAutoScrolls();
|
|
1861
|
-
return;
|
|
1862
|
-
}
|
|
1863
|
-
$64afbd09cd65a300$var$autoScroll(evt, this.options, $64afbd09cd65a300$var$getParentAutoScrollElement(elem, false), false);
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
};
|
|
1867
|
-
return $64afbd09cd65a300$var$_extends(AutoScroll, {
|
|
1868
|
-
pluginName: 'scroll',
|
|
1869
|
-
initializeByDefault: true
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
function $64afbd09cd65a300$var$clearAutoScrolls() {
|
|
1873
|
-
$64afbd09cd65a300$var$autoScrolls.forEach(function(autoScroll) {
|
|
1874
|
-
clearInterval(autoScroll.pid);
|
|
1875
|
-
});
|
|
1876
|
-
$64afbd09cd65a300$var$autoScrolls = [];
|
|
1877
|
-
}
|
|
1878
|
-
function $64afbd09cd65a300$var$clearPointerElemChangedInterval() {
|
|
1879
|
-
clearInterval($64afbd09cd65a300$var$pointerElemChangedInterval);
|
|
1880
|
-
}
|
|
1881
|
-
var $64afbd09cd65a300$var$autoScroll = $64afbd09cd65a300$var$throttle(function(evt, options, rootEl, isFallback) {
|
|
1882
|
-
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
|
1883
|
-
if (!options.scroll) return;
|
|
1884
|
-
var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = $64afbd09cd65a300$var$getWindowScrollingElement();
|
|
1885
|
-
var scrollThisInstance = false, scrollCustomFn; // New scroll root, set scrollEl
|
|
1886
|
-
if ($64afbd09cd65a300$var$scrollRootEl !== rootEl) {
|
|
1887
|
-
$64afbd09cd65a300$var$scrollRootEl = rootEl;
|
|
1888
|
-
$64afbd09cd65a300$var$clearAutoScrolls();
|
|
1889
|
-
$64afbd09cd65a300$var$scrollEl = options.scroll;
|
|
1890
|
-
scrollCustomFn = options.scrollFn;
|
|
1891
|
-
if ($64afbd09cd65a300$var$scrollEl === true) $64afbd09cd65a300$var$scrollEl = $64afbd09cd65a300$var$getParentAutoScrollElement(rootEl, true);
|
|
1892
|
-
}
|
|
1893
|
-
var layersOut = 0;
|
|
1894
|
-
var currentParent = $64afbd09cd65a300$var$scrollEl;
|
|
1895
|
-
do {
|
|
1896
|
-
var el = currentParent, rect = $64afbd09cd65a300$var$getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = $64afbd09cd65a300$var$css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
|
|
1897
|
-
if (el === winScroller) {
|
|
1898
|
-
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
|
1899
|
-
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
|
1900
|
-
} else {
|
|
1901
|
-
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
|
1902
|
-
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
|
1903
|
-
}
|
|
1904
|
-
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
|
1905
|
-
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
|
1906
|
-
if (!$64afbd09cd65a300$var$autoScrolls[layersOut]) {
|
|
1907
|
-
for(var i = 0; i <= layersOut; i++)if (!$64afbd09cd65a300$var$autoScrolls[i]) $64afbd09cd65a300$var$autoScrolls[i] = {};
|
|
1908
|
-
}
|
|
1909
|
-
if ($64afbd09cd65a300$var$autoScrolls[layersOut].vx != vx || $64afbd09cd65a300$var$autoScrolls[layersOut].vy != vy || $64afbd09cd65a300$var$autoScrolls[layersOut].el !== el) {
|
|
1910
|
-
$64afbd09cd65a300$var$autoScrolls[layersOut].el = el;
|
|
1911
|
-
$64afbd09cd65a300$var$autoScrolls[layersOut].vx = vx;
|
|
1912
|
-
$64afbd09cd65a300$var$autoScrolls[layersOut].vy = vy;
|
|
1913
|
-
clearInterval($64afbd09cd65a300$var$autoScrolls[layersOut].pid);
|
|
1914
|
-
if (vx != 0 || vy != 0) {
|
|
1915
|
-
scrollThisInstance = true;
|
|
1916
|
-
/* jshint loopfunc:true */ $64afbd09cd65a300$var$autoScrolls[layersOut].pid = setInterval((function() {
|
|
1917
|
-
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
|
1918
|
-
if (isFallback && this.layer === 0) $64afbd09cd65a300$export$31b3ca70d8f57423.active._onTouchMove($64afbd09cd65a300$var$touchEvt$1); // To move ghost if it is positioned absolutely
|
|
1919
|
-
var scrollOffsetY = $64afbd09cd65a300$var$autoScrolls[this.layer].vy ? $64afbd09cd65a300$var$autoScrolls[this.layer].vy * speed : 0;
|
|
1920
|
-
var scrollOffsetX = $64afbd09cd65a300$var$autoScrolls[this.layer].vx ? $64afbd09cd65a300$var$autoScrolls[this.layer].vx * speed : 0;
|
|
1921
|
-
if (typeof scrollCustomFn === 'function') {
|
|
1922
|
-
if (scrollCustomFn.call($64afbd09cd65a300$export$31b3ca70d8f57423.dragged.parentNode[$64afbd09cd65a300$var$expando], scrollOffsetX, scrollOffsetY, evt, $64afbd09cd65a300$var$touchEvt$1, $64afbd09cd65a300$var$autoScrolls[this.layer].el) !== 'continue') return;
|
|
1923
|
-
}
|
|
1924
|
-
$64afbd09cd65a300$var$scrollBy($64afbd09cd65a300$var$autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
1925
|
-
}).bind({
|
|
1926
|
-
layer: layersOut
|
|
1927
|
-
}), 24);
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
layersOut++;
|
|
1931
|
-
}while (options.bubbleScroll && currentParent !== winScroller && (currentParent = $64afbd09cd65a300$var$getParentAutoScrollElement(currentParent, false)))
|
|
1932
|
-
$64afbd09cd65a300$var$scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
|
1933
|
-
}, 30);
|
|
1934
|
-
var $64afbd09cd65a300$var$drop = function drop(_ref) {
|
|
1935
|
-
var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
|
|
1936
|
-
if (!originalEvent) return;
|
|
1937
|
-
var toSortable = putSortable || activeSortable;
|
|
1938
|
-
hideGhostForTarget();
|
|
1939
|
-
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
|
1940
|
-
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
1941
|
-
unhideGhostForTarget();
|
|
1942
|
-
if (toSortable && !toSortable.el.contains(target)) {
|
|
1943
|
-
dispatchSortableEvent('spill');
|
|
1944
|
-
this.onSpill({
|
|
1945
|
-
dragEl: dragEl,
|
|
1946
|
-
putSortable: putSortable
|
|
1947
|
-
});
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
function $64afbd09cd65a300$var$Revert() {}
|
|
1951
|
-
$64afbd09cd65a300$var$Revert.prototype = {
|
|
1952
|
-
startIndex: null,
|
|
1953
|
-
dragStart: function dragStart(_ref2) {
|
|
1954
|
-
var oldDraggableIndex = _ref2.oldDraggableIndex;
|
|
1955
|
-
this.startIndex = oldDraggableIndex;
|
|
1956
|
-
},
|
|
1957
|
-
onSpill: function onSpill(_ref3) {
|
|
1958
|
-
var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;
|
|
1959
|
-
this.sortable.captureAnimationState();
|
|
1960
|
-
if (putSortable) putSortable.captureAnimationState();
|
|
1961
|
-
var nextSibling = $64afbd09cd65a300$var$getChild(this.sortable.el, this.startIndex, this.options);
|
|
1962
|
-
if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);
|
|
1963
|
-
else this.sortable.el.appendChild(dragEl);
|
|
1964
|
-
this.sortable.animateAll();
|
|
1965
|
-
if (putSortable) putSortable.animateAll();
|
|
1966
|
-
},
|
|
1967
|
-
drop: $64afbd09cd65a300$var$drop
|
|
1968
|
-
};
|
|
1969
|
-
$64afbd09cd65a300$var$_extends($64afbd09cd65a300$var$Revert, {
|
|
1970
|
-
pluginName: 'revertOnSpill'
|
|
1971
|
-
});
|
|
1972
|
-
function $64afbd09cd65a300$var$Remove() {}
|
|
1973
|
-
$64afbd09cd65a300$var$Remove.prototype = {
|
|
1974
|
-
onSpill: function onSpill(_ref4) {
|
|
1975
|
-
var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable;
|
|
1976
|
-
var parentSortable = putSortable || this.sortable;
|
|
1977
|
-
parentSortable.captureAnimationState();
|
|
1978
|
-
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
|
1979
|
-
parentSortable.animateAll();
|
|
1980
|
-
},
|
|
1981
|
-
drop: $64afbd09cd65a300$var$drop
|
|
1982
|
-
};
|
|
1983
|
-
$64afbd09cd65a300$var$_extends($64afbd09cd65a300$var$Remove, {
|
|
1984
|
-
pluginName: 'removeOnSpill'
|
|
1985
|
-
});
|
|
1986
|
-
var $64afbd09cd65a300$var$lastSwapEl;
|
|
1987
|
-
function $64afbd09cd65a300$export$bdb5f0a1b77546f4() {
|
|
1988
|
-
function Swap() {
|
|
1989
|
-
this.defaults = {
|
|
1990
|
-
swapClass: 'sortable-swap-highlight'
|
|
1991
|
-
};
|
|
1992
|
-
}
|
|
1993
|
-
Swap.prototype = {
|
|
1994
|
-
dragStart: function dragStart(_ref) {
|
|
1995
|
-
var dragEl = _ref.dragEl;
|
|
1996
|
-
$64afbd09cd65a300$var$lastSwapEl = dragEl;
|
|
1997
|
-
},
|
|
1998
|
-
dragOverValid: function dragOverValid(_ref2) {
|
|
1999
|
-
var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel;
|
|
2000
|
-
if (!activeSortable.options.swap) return;
|
|
2001
|
-
var el = this.sortable.el, options = this.options;
|
|
2002
|
-
if (target && target !== el) {
|
|
2003
|
-
var prevSwapEl = $64afbd09cd65a300$var$lastSwapEl;
|
|
2004
|
-
if (onMove(target) !== false) {
|
|
2005
|
-
$64afbd09cd65a300$var$toggleClass(target, options.swapClass, true);
|
|
2006
|
-
$64afbd09cd65a300$var$lastSwapEl = target;
|
|
2007
|
-
} else $64afbd09cd65a300$var$lastSwapEl = null;
|
|
2008
|
-
if (prevSwapEl && prevSwapEl !== $64afbd09cd65a300$var$lastSwapEl) $64afbd09cd65a300$var$toggleClass(prevSwapEl, options.swapClass, false);
|
|
2009
|
-
}
|
|
2010
|
-
changed();
|
|
2011
|
-
completed(true);
|
|
2012
|
-
cancel();
|
|
2013
|
-
},
|
|
2014
|
-
drop: function drop(_ref3) {
|
|
2015
|
-
var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl;
|
|
2016
|
-
var toSortable = putSortable || this.sortable;
|
|
2017
|
-
var options = this.options;
|
|
2018
|
-
$64afbd09cd65a300$var$lastSwapEl && $64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$lastSwapEl, options.swapClass, false);
|
|
2019
|
-
if ($64afbd09cd65a300$var$lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {
|
|
2020
|
-
if (dragEl !== $64afbd09cd65a300$var$lastSwapEl) {
|
|
2021
|
-
toSortable.captureAnimationState();
|
|
2022
|
-
if (toSortable !== activeSortable) activeSortable.captureAnimationState();
|
|
2023
|
-
$64afbd09cd65a300$var$swapNodes(dragEl, $64afbd09cd65a300$var$lastSwapEl);
|
|
2024
|
-
toSortable.animateAll();
|
|
2025
|
-
if (toSortable !== activeSortable) activeSortable.animateAll();
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
},
|
|
2029
|
-
nulling: function nulling() {
|
|
2030
|
-
$64afbd09cd65a300$var$lastSwapEl = null;
|
|
2031
|
-
}
|
|
2032
|
-
};
|
|
2033
|
-
return $64afbd09cd65a300$var$_extends(Swap, {
|
|
2034
|
-
pluginName: 'swap',
|
|
2035
|
-
eventProperties: function eventProperties() {
|
|
2036
|
-
return {
|
|
2037
|
-
swapItem: $64afbd09cd65a300$var$lastSwapEl
|
|
2038
|
-
};
|
|
2039
|
-
}
|
|
2040
|
-
});
|
|
2041
|
-
}
|
|
2042
|
-
function $64afbd09cd65a300$var$swapNodes(n1, n2) {
|
|
2043
|
-
var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2;
|
|
2044
|
-
if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
|
|
2045
|
-
i1 = $64afbd09cd65a300$var$index(n1);
|
|
2046
|
-
i2 = $64afbd09cd65a300$var$index(n2);
|
|
2047
|
-
if (p1.isEqualNode(p2) && i1 < i2) i2++;
|
|
2048
|
-
p1.insertBefore(n2, p1.children[i1]);
|
|
2049
|
-
p2.insertBefore(n1, p2.children[i2]);
|
|
2050
|
-
}
|
|
2051
|
-
var $64afbd09cd65a300$var$multiDragElements = [], $64afbd09cd65a300$var$multiDragClones = [], $64afbd09cd65a300$var$lastMultiDragSelect, // for selection with modifier key down (SHIFT)
|
|
2052
|
-
$64afbd09cd65a300$var$multiDragSortable, $64afbd09cd65a300$var$initialFolding = false, // Initial multi-drag fold when drag started
|
|
2053
|
-
$64afbd09cd65a300$var$folding = false, // Folding any other time
|
|
2054
|
-
$64afbd09cd65a300$var$dragStarted = false, $64afbd09cd65a300$var$dragEl$1, $64afbd09cd65a300$var$clonesFromRect, $64afbd09cd65a300$var$clonesHidden;
|
|
2055
|
-
function $64afbd09cd65a300$export$18e5d2a5d1df842d() {
|
|
2056
|
-
function MultiDrag(sortable) {
|
|
2057
|
-
// Bind all private methods
|
|
2058
|
-
for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this);
|
|
2059
|
-
if (!sortable.options.avoidImplicitDeselect) {
|
|
2060
|
-
if (sortable.options.supportPointer) $64afbd09cd65a300$var$on(document, 'pointerup', this._deselectMultiDrag);
|
|
2061
|
-
else {
|
|
2062
|
-
$64afbd09cd65a300$var$on(document, 'mouseup', this._deselectMultiDrag);
|
|
2063
|
-
$64afbd09cd65a300$var$on(document, 'touchend', this._deselectMultiDrag);
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
$64afbd09cd65a300$var$on(document, 'keydown', this._checkKeyDown);
|
|
2067
|
-
$64afbd09cd65a300$var$on(document, 'keyup', this._checkKeyUp);
|
|
2068
|
-
this.defaults = {
|
|
2069
|
-
selectedClass: 'sortable-selected',
|
|
2070
|
-
multiDragKey: null,
|
|
2071
|
-
avoidImplicitDeselect: false,
|
|
2072
|
-
setData: function setData(dataTransfer, dragEl) {
|
|
2073
|
-
var data = '';
|
|
2074
|
-
if ($64afbd09cd65a300$var$multiDragElements.length && $64afbd09cd65a300$var$multiDragSortable === sortable) $64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement, i) {
|
|
2075
|
-
data += (!i ? '' : ', ') + multiDragElement.textContent;
|
|
2076
|
-
});
|
|
2077
|
-
else data = dragEl.textContent;
|
|
2078
|
-
dataTransfer.setData('Text', data);
|
|
2079
|
-
}
|
|
2080
|
-
};
|
|
2081
|
-
}
|
|
2082
|
-
MultiDrag.prototype = {
|
|
2083
|
-
multiDragKeyDown: false,
|
|
2084
|
-
isMultiDrag: false,
|
|
2085
|
-
delayStartGlobal: function delayStartGlobal(_ref) {
|
|
2086
|
-
var dragged = _ref.dragEl;
|
|
2087
|
-
$64afbd09cd65a300$var$dragEl$1 = dragged;
|
|
2088
|
-
},
|
|
2089
|
-
delayEnded: function delayEnded() {
|
|
2090
|
-
this.isMultiDrag = ~$64afbd09cd65a300$var$multiDragElements.indexOf($64afbd09cd65a300$var$dragEl$1);
|
|
2091
|
-
},
|
|
2092
|
-
setupClone: function setupClone(_ref2) {
|
|
2093
|
-
var sortable = _ref2.sortable, cancel = _ref2.cancel;
|
|
2094
|
-
if (!this.isMultiDrag) return;
|
|
2095
|
-
for(var i = 0; i < $64afbd09cd65a300$var$multiDragElements.length; i++){
|
|
2096
|
-
$64afbd09cd65a300$var$multiDragClones.push($64afbd09cd65a300$var$clone($64afbd09cd65a300$var$multiDragElements[i]));
|
|
2097
|
-
$64afbd09cd65a300$var$multiDragClones[i].sortableIndex = $64afbd09cd65a300$var$multiDragElements[i].sortableIndex;
|
|
2098
|
-
$64afbd09cd65a300$var$multiDragClones[i].draggable = false;
|
|
2099
|
-
$64afbd09cd65a300$var$multiDragClones[i].style['will-change'] = '';
|
|
2100
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$multiDragClones[i], this.options.selectedClass, false);
|
|
2101
|
-
$64afbd09cd65a300$var$multiDragElements[i] === $64afbd09cd65a300$var$dragEl$1 && $64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$multiDragClones[i], this.options.chosenClass, false);
|
|
2102
|
-
}
|
|
2103
|
-
sortable._hideClone();
|
|
2104
|
-
cancel();
|
|
2105
|
-
},
|
|
2106
|
-
clone: function clone(_ref3) {
|
|
2107
|
-
var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel;
|
|
2108
|
-
if (!this.isMultiDrag) return;
|
|
2109
|
-
if (!this.options.removeCloneOnHide) {
|
|
2110
|
-
if ($64afbd09cd65a300$var$multiDragElements.length && $64afbd09cd65a300$var$multiDragSortable === sortable) {
|
|
2111
|
-
$64afbd09cd65a300$var$insertMultiDragClones(true, rootEl);
|
|
2112
|
-
dispatchSortableEvent('clone');
|
|
2113
|
-
cancel();
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
},
|
|
2117
|
-
showClone: function showClone(_ref4) {
|
|
2118
|
-
var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel;
|
|
2119
|
-
if (!this.isMultiDrag) return;
|
|
2120
|
-
$64afbd09cd65a300$var$insertMultiDragClones(false, rootEl);
|
|
2121
|
-
$64afbd09cd65a300$var$multiDragClones.forEach(function(clone) {
|
|
2122
|
-
$64afbd09cd65a300$var$css(clone, 'display', '');
|
|
2123
|
-
});
|
|
2124
|
-
cloneNowShown();
|
|
2125
|
-
$64afbd09cd65a300$var$clonesHidden = false;
|
|
2126
|
-
cancel();
|
|
2127
|
-
},
|
|
2128
|
-
hideClone: function hideClone(_ref5) {
|
|
2129
|
-
var _this = this;
|
|
2130
|
-
var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel;
|
|
2131
|
-
if (!this.isMultiDrag) return;
|
|
2132
|
-
$64afbd09cd65a300$var$multiDragClones.forEach(function(clone) {
|
|
2133
|
-
$64afbd09cd65a300$var$css(clone, 'display', 'none');
|
|
2134
|
-
if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone);
|
|
2135
|
-
});
|
|
2136
|
-
cloneNowHidden();
|
|
2137
|
-
$64afbd09cd65a300$var$clonesHidden = true;
|
|
2138
|
-
cancel();
|
|
2139
|
-
},
|
|
2140
|
-
dragStartGlobal: function dragStartGlobal(_ref6) {
|
|
2141
|
-
var sortable = _ref6.sortable;
|
|
2142
|
-
if (!this.isMultiDrag && $64afbd09cd65a300$var$multiDragSortable) $64afbd09cd65a300$var$multiDragSortable.multiDrag._deselectMultiDrag();
|
|
2143
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2144
|
-
multiDragElement.sortableIndex = $64afbd09cd65a300$var$index(multiDragElement);
|
|
2145
|
-
}); // Sort multi-drag elements
|
|
2146
|
-
$64afbd09cd65a300$var$multiDragElements = $64afbd09cd65a300$var$multiDragElements.sort(function(a, b) {
|
|
2147
|
-
return a.sortableIndex - b.sortableIndex;
|
|
2148
|
-
});
|
|
2149
|
-
$64afbd09cd65a300$var$dragStarted = true;
|
|
2150
|
-
},
|
|
2151
|
-
dragStarted: function dragStarted(_ref7) {
|
|
2152
|
-
var _this2 = this;
|
|
2153
|
-
var sortable = _ref7.sortable;
|
|
2154
|
-
if (!this.isMultiDrag) return;
|
|
2155
|
-
if (this.options.sort) {
|
|
2156
|
-
// Capture rects,
|
|
2157
|
-
// hide multi drag elements (by positioning them absolute),
|
|
2158
|
-
// set multi drag elements rects to dragRect,
|
|
2159
|
-
// show multi drag elements,
|
|
2160
|
-
// animate to rects,
|
|
2161
|
-
// unset rects & remove from DOM
|
|
2162
|
-
sortable.captureAnimationState();
|
|
2163
|
-
if (this.options.animation) {
|
|
2164
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2165
|
-
if (multiDragElement === $64afbd09cd65a300$var$dragEl$1) return;
|
|
2166
|
-
$64afbd09cd65a300$var$css(multiDragElement, 'position', 'absolute');
|
|
2167
|
-
});
|
|
2168
|
-
var dragRect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$dragEl$1, false, true, true);
|
|
2169
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2170
|
-
if (multiDragElement === $64afbd09cd65a300$var$dragEl$1) return;
|
|
2171
|
-
$64afbd09cd65a300$var$setRect(multiDragElement, dragRect);
|
|
2172
|
-
});
|
|
2173
|
-
$64afbd09cd65a300$var$folding = true;
|
|
2174
|
-
$64afbd09cd65a300$var$initialFolding = true;
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
sortable.animateAll(function() {
|
|
2178
|
-
$64afbd09cd65a300$var$folding = false;
|
|
2179
|
-
$64afbd09cd65a300$var$initialFolding = false;
|
|
2180
|
-
if (_this2.options.animation) $64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2181
|
-
$64afbd09cd65a300$var$unsetRect(multiDragElement);
|
|
2182
|
-
});
|
|
2183
|
-
// Remove all auxiliary multidrag items from el, if sorting enabled
|
|
2184
|
-
if (_this2.options.sort) $64afbd09cd65a300$var$removeMultiDragElements();
|
|
2185
|
-
});
|
|
2186
|
-
},
|
|
2187
|
-
dragOver: function dragOver(_ref8) {
|
|
2188
|
-
var target = _ref8.target, completed = _ref8.completed, cancel = _ref8.cancel;
|
|
2189
|
-
if ($64afbd09cd65a300$var$folding && ~$64afbd09cd65a300$var$multiDragElements.indexOf(target)) {
|
|
2190
|
-
completed(false);
|
|
2191
|
-
cancel();
|
|
2192
|
-
}
|
|
2193
|
-
},
|
|
2194
|
-
revert: function revert(_ref9) {
|
|
2195
|
-
var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect;
|
|
2196
|
-
if ($64afbd09cd65a300$var$multiDragElements.length > 1) {
|
|
2197
|
-
// Setup unfold animation
|
|
2198
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2199
|
-
sortable.addAnimationState({
|
|
2200
|
-
target: multiDragElement,
|
|
2201
|
-
rect: $64afbd09cd65a300$var$folding ? $64afbd09cd65a300$var$getRect(multiDragElement) : dragRect
|
|
2202
|
-
});
|
|
2203
|
-
$64afbd09cd65a300$var$unsetRect(multiDragElement);
|
|
2204
|
-
multiDragElement.fromRect = dragRect;
|
|
2205
|
-
fromSortable.removeAnimationState(multiDragElement);
|
|
2206
|
-
});
|
|
2207
|
-
$64afbd09cd65a300$var$folding = false;
|
|
2208
|
-
$64afbd09cd65a300$var$insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);
|
|
2209
|
-
}
|
|
2210
|
-
},
|
|
2211
|
-
dragOverCompleted: function dragOverCompleted(_ref10) {
|
|
2212
|
-
var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable;
|
|
2213
|
-
var options = this.options;
|
|
2214
|
-
if (insertion) {
|
|
2215
|
-
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
|
2216
|
-
if (isOwner) activeSortable._hideClone();
|
|
2217
|
-
$64afbd09cd65a300$var$initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location
|
|
2218
|
-
if (options.animation && $64afbd09cd65a300$var$multiDragElements.length > 1 && ($64afbd09cd65a300$var$folding || !isOwner && !activeSortable.options.sort && !putSortable)) {
|
|
2219
|
-
// Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible
|
|
2220
|
-
var dragRectAbsolute = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$dragEl$1, false, true, true);
|
|
2221
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2222
|
-
if (multiDragElement === $64afbd09cd65a300$var$dragEl$1) return;
|
|
2223
|
-
$64afbd09cd65a300$var$setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted
|
|
2224
|
-
// while folding, and so that we can capture them again because old sortable will no longer be fromSortable
|
|
2225
|
-
parentEl.appendChild(multiDragElement);
|
|
2226
|
-
});
|
|
2227
|
-
$64afbd09cd65a300$var$folding = true;
|
|
2228
|
-
} // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out
|
|
2229
|
-
if (!isOwner) {
|
|
2230
|
-
// Only remove if not folding (folding will remove them anyways)
|
|
2231
|
-
if (!$64afbd09cd65a300$var$folding) $64afbd09cd65a300$var$removeMultiDragElements();
|
|
2232
|
-
if ($64afbd09cd65a300$var$multiDragElements.length > 1) {
|
|
2233
|
-
var clonesHiddenBefore = $64afbd09cd65a300$var$clonesHidden;
|
|
2234
|
-
activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden
|
|
2235
|
-
if (activeSortable.options.animation && !$64afbd09cd65a300$var$clonesHidden && clonesHiddenBefore) $64afbd09cd65a300$var$multiDragClones.forEach(function(clone) {
|
|
2236
|
-
activeSortable.addAnimationState({
|
|
2237
|
-
target: clone,
|
|
2238
|
-
rect: $64afbd09cd65a300$var$clonesFromRect
|
|
2239
|
-
});
|
|
2240
|
-
clone.fromRect = $64afbd09cd65a300$var$clonesFromRect;
|
|
2241
|
-
clone.thisAnimationDuration = null;
|
|
2242
|
-
});
|
|
2243
|
-
} else activeSortable._showClone(sortable);
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
},
|
|
2247
|
-
dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {
|
|
2248
|
-
var dragRect = _ref11.dragRect, isOwner = _ref11.isOwner, activeSortable = _ref11.activeSortable;
|
|
2249
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2250
|
-
multiDragElement.thisAnimationDuration = null;
|
|
2251
|
-
});
|
|
2252
|
-
if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {
|
|
2253
|
-
$64afbd09cd65a300$var$clonesFromRect = $64afbd09cd65a300$var$_extends({}, dragRect);
|
|
2254
|
-
var dragMatrix = $64afbd09cd65a300$var$matrix($64afbd09cd65a300$var$dragEl$1, true);
|
|
2255
|
-
$64afbd09cd65a300$var$clonesFromRect.top -= dragMatrix.f;
|
|
2256
|
-
$64afbd09cd65a300$var$clonesFromRect.left -= dragMatrix.e;
|
|
2257
|
-
}
|
|
2258
|
-
},
|
|
2259
|
-
dragOverAnimationComplete: function dragOverAnimationComplete() {
|
|
2260
|
-
if ($64afbd09cd65a300$var$folding) {
|
|
2261
|
-
$64afbd09cd65a300$var$folding = false;
|
|
2262
|
-
$64afbd09cd65a300$var$removeMultiDragElements();
|
|
2263
|
-
}
|
|
2264
|
-
},
|
|
2265
|
-
drop: function drop(_ref12) {
|
|
2266
|
-
var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable;
|
|
2267
|
-
var toSortable = putSortable || this.sortable;
|
|
2268
|
-
if (!evt) return;
|
|
2269
|
-
var options = this.options, children = parentEl.children; // Multi-drag selection
|
|
2270
|
-
if (!$64afbd09cd65a300$var$dragStarted) {
|
|
2271
|
-
if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag();
|
|
2272
|
-
$64afbd09cd65a300$var$toggleClass($64afbd09cd65a300$var$dragEl$1, options.selectedClass, !~$64afbd09cd65a300$var$multiDragElements.indexOf($64afbd09cd65a300$var$dragEl$1));
|
|
2273
|
-
if (!~$64afbd09cd65a300$var$multiDragElements.indexOf($64afbd09cd65a300$var$dragEl$1)) {
|
|
2274
|
-
$64afbd09cd65a300$var$multiDragElements.push($64afbd09cd65a300$var$dragEl$1);
|
|
2275
|
-
$64afbd09cd65a300$var$dispatchEvent({
|
|
2276
|
-
sortable: sortable,
|
|
2277
|
-
rootEl: rootEl,
|
|
2278
|
-
name: 'select',
|
|
2279
|
-
targetEl: $64afbd09cd65a300$var$dragEl$1,
|
|
2280
|
-
originalEvent: evt
|
|
2281
|
-
}); // Modifier activated, select from last to dragEl
|
|
2282
|
-
if (evt.shiftKey && $64afbd09cd65a300$var$lastMultiDragSelect && sortable.el.contains($64afbd09cd65a300$var$lastMultiDragSelect)) {
|
|
2283
|
-
var lastIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$lastMultiDragSelect), currentIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl$1);
|
|
2284
|
-
if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
|
|
2285
|
-
// Must include lastMultiDragSelect (select it), in case modified selection from no selection
|
|
2286
|
-
// (but previous selection existed)
|
|
2287
|
-
var n, i;
|
|
2288
|
-
if (currentIndex > lastIndex) {
|
|
2289
|
-
i = lastIndex;
|
|
2290
|
-
n = currentIndex;
|
|
2291
|
-
} else {
|
|
2292
|
-
i = currentIndex;
|
|
2293
|
-
n = lastIndex + 1;
|
|
2294
|
-
}
|
|
2295
|
-
for(; i < n; i++){
|
|
2296
|
-
if (~$64afbd09cd65a300$var$multiDragElements.indexOf(children[i])) continue;
|
|
2297
|
-
$64afbd09cd65a300$var$toggleClass(children[i], options.selectedClass, true);
|
|
2298
|
-
$64afbd09cd65a300$var$multiDragElements.push(children[i]);
|
|
2299
|
-
$64afbd09cd65a300$var$dispatchEvent({
|
|
2300
|
-
sortable: sortable,
|
|
2301
|
-
rootEl: rootEl,
|
|
2302
|
-
name: 'select',
|
|
2303
|
-
targetEl: children[i],
|
|
2304
|
-
originalEvent: evt
|
|
2305
|
-
});
|
|
2306
|
-
}
|
|
2307
|
-
}
|
|
2308
|
-
} else $64afbd09cd65a300$var$lastMultiDragSelect = $64afbd09cd65a300$var$dragEl$1;
|
|
2309
|
-
$64afbd09cd65a300$var$multiDragSortable = toSortable;
|
|
2310
|
-
} else {
|
|
2311
|
-
$64afbd09cd65a300$var$multiDragElements.splice($64afbd09cd65a300$var$multiDragElements.indexOf($64afbd09cd65a300$var$dragEl$1), 1);
|
|
2312
|
-
$64afbd09cd65a300$var$lastMultiDragSelect = null;
|
|
2313
|
-
$64afbd09cd65a300$var$dispatchEvent({
|
|
2314
|
-
sortable: sortable,
|
|
2315
|
-
rootEl: rootEl,
|
|
2316
|
-
name: 'deselect',
|
|
2317
|
-
targetEl: $64afbd09cd65a300$var$dragEl$1,
|
|
2318
|
-
originalEvent: evt
|
|
2319
|
-
});
|
|
2320
|
-
}
|
|
2321
|
-
} // Multi-drag drop
|
|
2322
|
-
if ($64afbd09cd65a300$var$dragStarted && this.isMultiDrag) {
|
|
2323
|
-
$64afbd09cd65a300$var$folding = false; // Do not "unfold" after around dragEl if reverted
|
|
2324
|
-
if ((parentEl[$64afbd09cd65a300$var$expando].options.sort || parentEl !== rootEl) && $64afbd09cd65a300$var$multiDragElements.length > 1) {
|
|
2325
|
-
var dragRect = $64afbd09cd65a300$var$getRect($64afbd09cd65a300$var$dragEl$1), multiDragIndex = $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl$1, ':not(.' + this.options.selectedClass + ')');
|
|
2326
|
-
if (!$64afbd09cd65a300$var$initialFolding && options.animation) $64afbd09cd65a300$var$dragEl$1.thisAnimationDuration = null;
|
|
2327
|
-
toSortable.captureAnimationState();
|
|
2328
|
-
if (!$64afbd09cd65a300$var$initialFolding) {
|
|
2329
|
-
if (options.animation) {
|
|
2330
|
-
$64afbd09cd65a300$var$dragEl$1.fromRect = dragRect;
|
|
2331
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2332
|
-
multiDragElement.thisAnimationDuration = null;
|
|
2333
|
-
if (multiDragElement !== $64afbd09cd65a300$var$dragEl$1) {
|
|
2334
|
-
var rect = $64afbd09cd65a300$var$folding ? $64afbd09cd65a300$var$getRect(multiDragElement) : dragRect;
|
|
2335
|
-
multiDragElement.fromRect = rect; // Prepare unfold animation
|
|
2336
|
-
toSortable.addAnimationState({
|
|
2337
|
-
target: multiDragElement,
|
|
2338
|
-
rect: rect
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
|
-
});
|
|
2342
|
-
} // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert
|
|
2343
|
-
// properly they must all be removed
|
|
2344
|
-
$64afbd09cd65a300$var$removeMultiDragElements();
|
|
2345
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2346
|
-
if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]);
|
|
2347
|
-
else parentEl.appendChild(multiDragElement);
|
|
2348
|
-
multiDragIndex++;
|
|
2349
|
-
}); // If initial folding is done, the elements may have changed position because they are now
|
|
2350
|
-
// unfolding around dragEl, even though dragEl may not have his index changed, so update event
|
|
2351
|
-
// must be fired here as Sortable will not.
|
|
2352
|
-
if (oldIndex === $64afbd09cd65a300$var$index($64afbd09cd65a300$var$dragEl$1)) {
|
|
2353
|
-
var update = false;
|
|
2354
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2355
|
-
if (multiDragElement.sortableIndex !== $64afbd09cd65a300$var$index(multiDragElement)) {
|
|
2356
|
-
update = true;
|
|
2357
|
-
return;
|
|
2358
|
-
}
|
|
2359
|
-
});
|
|
2360
|
-
if (update) dispatchSortableEvent('update');
|
|
2361
|
-
}
|
|
2362
|
-
} // Must be done after capturing individual rects (scroll bar)
|
|
2363
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2364
|
-
$64afbd09cd65a300$var$unsetRect(multiDragElement);
|
|
2365
|
-
});
|
|
2366
|
-
toSortable.animateAll();
|
|
2367
|
-
}
|
|
2368
|
-
$64afbd09cd65a300$var$multiDragSortable = toSortable;
|
|
2369
|
-
} // Remove clones if necessary
|
|
2370
|
-
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') $64afbd09cd65a300$var$multiDragClones.forEach(function(clone) {
|
|
2371
|
-
clone.parentNode && clone.parentNode.removeChild(clone);
|
|
2372
|
-
});
|
|
2373
|
-
},
|
|
2374
|
-
nullingGlobal: function nullingGlobal() {
|
|
2375
|
-
this.isMultiDrag = $64afbd09cd65a300$var$dragStarted = false;
|
|
2376
|
-
$64afbd09cd65a300$var$multiDragClones.length = 0;
|
|
2377
|
-
},
|
|
2378
|
-
destroyGlobal: function destroyGlobal() {
|
|
2379
|
-
this._deselectMultiDrag();
|
|
2380
|
-
$64afbd09cd65a300$var$off(document, 'pointerup', this._deselectMultiDrag);
|
|
2381
|
-
$64afbd09cd65a300$var$off(document, 'mouseup', this._deselectMultiDrag);
|
|
2382
|
-
$64afbd09cd65a300$var$off(document, 'touchend', this._deselectMultiDrag);
|
|
2383
|
-
$64afbd09cd65a300$var$off(document, 'keydown', this._checkKeyDown);
|
|
2384
|
-
$64afbd09cd65a300$var$off(document, 'keyup', this._checkKeyUp);
|
|
2385
|
-
},
|
|
2386
|
-
_deselectMultiDrag: function _deselectMultiDrag(evt) {
|
|
2387
|
-
if (typeof $64afbd09cd65a300$var$dragStarted !== "undefined" && $64afbd09cd65a300$var$dragStarted) return; // Only deselect if selection is in this sortable
|
|
2388
|
-
if ($64afbd09cd65a300$var$multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable
|
|
2389
|
-
if (evt && $64afbd09cd65a300$var$closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click
|
|
2390
|
-
if (evt && evt.button !== 0) return;
|
|
2391
|
-
while($64afbd09cd65a300$var$multiDragElements.length){
|
|
2392
|
-
var el = $64afbd09cd65a300$var$multiDragElements[0];
|
|
2393
|
-
$64afbd09cd65a300$var$toggleClass(el, this.options.selectedClass, false);
|
|
2394
|
-
$64afbd09cd65a300$var$multiDragElements.shift();
|
|
2395
|
-
$64afbd09cd65a300$var$dispatchEvent({
|
|
2396
|
-
sortable: this.sortable,
|
|
2397
|
-
rootEl: this.sortable.el,
|
|
2398
|
-
name: 'deselect',
|
|
2399
|
-
targetEl: el,
|
|
2400
|
-
originalEvent: evt
|
|
2401
|
-
});
|
|
2402
|
-
}
|
|
2403
|
-
},
|
|
2404
|
-
_checkKeyDown: function _checkKeyDown(evt) {
|
|
2405
|
-
if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = true;
|
|
2406
|
-
},
|
|
2407
|
-
_checkKeyUp: function _checkKeyUp(evt) {
|
|
2408
|
-
if (evt.key === this.options.multiDragKey) this.multiDragKeyDown = false;
|
|
2409
|
-
}
|
|
2410
|
-
};
|
|
2411
|
-
return $64afbd09cd65a300$var$_extends(MultiDrag, {
|
|
2412
|
-
// Static methods & properties
|
|
2413
|
-
pluginName: 'multiDrag',
|
|
2414
|
-
utils: {
|
|
2415
|
-
/**
|
|
2416
|
-
* Selects the provided multi-drag item
|
|
2417
|
-
* @param {HTMLElement} el The element to be selected
|
|
2418
|
-
*/ select: function select(el) {
|
|
2419
|
-
var sortable = el.parentNode[$64afbd09cd65a300$var$expando];
|
|
2420
|
-
if (!sortable || !sortable.options.multiDrag || ~$64afbd09cd65a300$var$multiDragElements.indexOf(el)) return;
|
|
2421
|
-
if ($64afbd09cd65a300$var$multiDragSortable && $64afbd09cd65a300$var$multiDragSortable !== sortable) {
|
|
2422
|
-
$64afbd09cd65a300$var$multiDragSortable.multiDrag._deselectMultiDrag();
|
|
2423
|
-
$64afbd09cd65a300$var$multiDragSortable = sortable;
|
|
2424
|
-
}
|
|
2425
|
-
$64afbd09cd65a300$var$toggleClass(el, sortable.options.selectedClass, true);
|
|
2426
|
-
$64afbd09cd65a300$var$multiDragElements.push(el);
|
|
2427
|
-
},
|
|
2428
|
-
/**
|
|
2429
|
-
* Deselects the provided multi-drag item
|
|
2430
|
-
* @param {HTMLElement} el The element to be deselected
|
|
2431
|
-
*/ deselect: function deselect(el) {
|
|
2432
|
-
var sortable = el.parentNode[$64afbd09cd65a300$var$expando], index = $64afbd09cd65a300$var$multiDragElements.indexOf(el);
|
|
2433
|
-
if (!sortable || !sortable.options.multiDrag || !~index) return;
|
|
2434
|
-
$64afbd09cd65a300$var$toggleClass(el, sortable.options.selectedClass, false);
|
|
2435
|
-
$64afbd09cd65a300$var$multiDragElements.splice(index, 1);
|
|
2436
|
-
}
|
|
2437
|
-
},
|
|
2438
|
-
eventProperties: function eventProperties() {
|
|
2439
|
-
var _this3 = this;
|
|
2440
|
-
var oldIndicies = [], newIndicies = [];
|
|
2441
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2442
|
-
oldIndicies.push({
|
|
2443
|
-
multiDragElement: multiDragElement,
|
|
2444
|
-
index: multiDragElement.sortableIndex
|
|
2445
|
-
}); // multiDragElements will already be sorted if folding
|
|
2446
|
-
var newIndex;
|
|
2447
|
-
if ($64afbd09cd65a300$var$folding && multiDragElement !== $64afbd09cd65a300$var$dragEl$1) newIndex = -1;
|
|
2448
|
-
else if ($64afbd09cd65a300$var$folding) newIndex = $64afbd09cd65a300$var$index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');
|
|
2449
|
-
else newIndex = $64afbd09cd65a300$var$index(multiDragElement);
|
|
2450
|
-
newIndicies.push({
|
|
2451
|
-
multiDragElement: multiDragElement,
|
|
2452
|
-
index: newIndex
|
|
2453
|
-
});
|
|
2454
|
-
});
|
|
2455
|
-
return {
|
|
2456
|
-
items: $64afbd09cd65a300$var$_toConsumableArray($64afbd09cd65a300$var$multiDragElements),
|
|
2457
|
-
clones: [].concat($64afbd09cd65a300$var$multiDragClones),
|
|
2458
|
-
oldIndicies: oldIndicies,
|
|
2459
|
-
newIndicies: newIndicies
|
|
2460
|
-
};
|
|
2461
|
-
},
|
|
2462
|
-
optionListeners: {
|
|
2463
|
-
multiDragKey: function multiDragKey(key) {
|
|
2464
|
-
key = key.toLowerCase();
|
|
2465
|
-
if (key === 'ctrl') key = 'Control';
|
|
2466
|
-
else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1);
|
|
2467
|
-
return key;
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
});
|
|
2471
|
-
}
|
|
2472
|
-
function $64afbd09cd65a300$var$insertMultiDragElements(clonesInserted, rootEl) {
|
|
2473
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement, i) {
|
|
2474
|
-
var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];
|
|
2475
|
-
if (target) rootEl.insertBefore(multiDragElement, target);
|
|
2476
|
-
else rootEl.appendChild(multiDragElement);
|
|
2477
|
-
});
|
|
2478
|
-
}
|
|
2479
|
-
/**
|
|
2480
|
-
* Insert multi-drag clones
|
|
2481
|
-
* @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
|
|
2482
|
-
* @param {HTMLElement} rootEl
|
|
2483
|
-
*/ function $64afbd09cd65a300$var$insertMultiDragClones(elementsInserted, rootEl) {
|
|
2484
|
-
$64afbd09cd65a300$var$multiDragClones.forEach(function(clone, i) {
|
|
2485
|
-
var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];
|
|
2486
|
-
if (target) rootEl.insertBefore(clone, target);
|
|
2487
|
-
else rootEl.appendChild(clone);
|
|
2488
|
-
});
|
|
2489
|
-
}
|
|
2490
|
-
function $64afbd09cd65a300$var$removeMultiDragElements() {
|
|
2491
|
-
$64afbd09cd65a300$var$multiDragElements.forEach(function(multiDragElement) {
|
|
2492
|
-
if (multiDragElement === $64afbd09cd65a300$var$dragEl$1) return;
|
|
2493
|
-
multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);
|
|
2494
|
-
});
|
|
2495
|
-
}
|
|
2496
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.mount(new $64afbd09cd65a300$var$AutoScrollPlugin());
|
|
2497
|
-
$64afbd09cd65a300$export$31b3ca70d8f57423.mount($64afbd09cd65a300$var$Remove, $64afbd09cd65a300$var$Revert);
|
|
2498
|
-
var $64afbd09cd65a300$export$2e2bcd8739ae039 = $64afbd09cd65a300$export$31b3ca70d8f57423;
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
var $0648b347057451f2$exports = {};
|
|
2502
|
-
$0648b347057451f2$exports = ":host {\n --tabgroup-background: #e7eaed;\n --tab-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n --tab-font-size: 13px;\n --tab-background: #e7eaed;\n --tab-color: #696a6c;\n --tab-border-color: #dadce0;\n --tab-transition: background-color 200ms ease-out, color 200ms ease-out;\n --tab-cursor: pointer;\n --tab-active-color: currentcolor;\n --tab-active-background: #fff;\n --tag-hover-color: currentcolor;\n --tag-hover-background: #f1f3f4;\n --button-font-size: 15px;\n --button-background: none;\n --button-color: #696a6c;\n --button-hover-background: #dadce0;\n --button-hover-color: #383a3e;\n --button-border-radius: 50%;\n --button-cursor: pointer;\n --badge-background: #383a3e;\n --badge-color: #fff;\n --close-button-visibility: visible;\n}\n\nwebview {\n visibility: hidden;\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\nwebview.visible {\n visibility: visible;\n}\n\n.etabs {\n font-family: var(--tab-font-family);\n text-rendering: optimizelegibility;\n font-feature-settings: \"liga\", \"clig\", \"kern\";\n}\n\n.nav {\n background: var(--tabgroup-background);\n box-shadow: inset 0 -1px var(--tab-border-color);\n border-top: 1px solid var(--tab-border-color);\n font-size: var(--tab-font-size);\n width: 100%;\n height: 32px;\n cursor: default;\n -webkit-user-select: none;\n user-select: none;\n display: none;\n}\n\n.nav.visible {\n display: flex;\n}\n\n.tabs {\n height: 100%;\n}\n\n.tab {\n background: var(--tab-background);\n box-shadow: inset 0 -1px var(--tab-border-color);\n color: var(--tab-color);\n cursor: var(--tab-cursor);\n font-size: var(--tab-font-size);\n transition: var(--tab-transition);\n box-sizing: border-box;\n height: 100%;\n align-items: center;\n padding: 5px 9px;\n display: none;\n position: relative;\n}\n\n.tab:first-child {\n border-left: none;\n}\n\n.tab.visible {\n display: inline-flex;\n}\n\n.tab.active {\n color: var(--tab-active-color);\n background: var(--tab-active-background);\n border-left: 1px solid var(--tab-border-color);\n border-right: 1px solid var(--tab-border-color);\n box-shadow: none;\n padding-left: 8px;\n padding-right: 8px;\n}\n\n.tab.active:last-child {\n border-right: none;\n}\n\n.tab.visible:not(.active) + .tab.visible:not(.active) {\n border-left: 1px solid var(--tab-border-color);\n padding-left: 8px;\n}\n\n.tab:not(.active):hover {\n background: var(--tab-hover-background);\n color: var(--tab-hover-color);\n}\n\n.tab-badge {\n background: var(--badge-background);\n color: var(--badge-color);\n text-align: center;\n border-radius: 5px;\n margin-left: 5px;\n padding: 1px 4px;\n font-size: 8px;\n font-weight: bold;\n line-height: 1.2;\n}\n\n.tab-badge.hidden {\n display: none;\n}\n\n.tab-icon {\n height: 16px;\n display: inline-block;\n}\n\n.tab-icon img {\n max-width: 16px;\n max-height: 16px;\n}\n\n.tab-title, .tab-close {\n margin-left: 10px;\n display: inline-block;\n}\n\n.tab-close button {\n background: var(--button-background);\n border-radius: var(--button-border-radius);\n color: var(--button-color);\n cursor: var(--button-cursor);\n font-size: var(--button-font-size);\n width: 20px;\n height: 20px;\n text-align: center;\n visibility: var(--close-button-visibility);\n border: none;\n padding: 1px 0 0;\n display: inline-block;\n}\n\n.tab.active .tab-close button {\n visibility: visible;\n}\n\n.tab-close button:hover {\n color: var(--button-hover-color);\n background: var(--button-hover-background);\n}\n\n.buttons {\n border-left: 1px solid var(--tab-border-color);\n padding: 5px;\n display: flex;\n}\n\n.buttons button {\n color: var(--button-color);\n background: var(--button-background);\n border-radius: var(--button-border-radius);\n cursor: var(--button-cursor);\n font-size: var(--button-font-size);\n width: 20px;\n height: 20px;\n text-align: center;\n border: none;\n margin: 0;\n padding: 1px 0 0;\n font-family: inherit;\n line-height: 1;\n display: block;\n}\n\n.buttons button:hover {\n color: var(--button-hover-color);\n background: var(--button-hover-background);\n}\n\n.views {\n height: calc(100vh - 33px);\n position: relative;\n}\n\n";
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
if (!document) throw Error("electron-tabs module must be called in renderer process");
|
|
2506
|
-
const $eda442ba39f881a8$var$CLASSNAMES = {
|
|
2507
|
-
ROOT: "etabs",
|
|
2508
|
-
NAV: "nav",
|
|
2509
|
-
TABS: "tabs",
|
|
2510
|
-
TAB: "tab",
|
|
2511
|
-
BUTTONS: "buttons",
|
|
2512
|
-
VIEWS: "views",
|
|
2513
|
-
VIEW: "view"
|
|
2514
|
-
};
|
|
2515
|
-
function $eda442ba39f881a8$var$emit(emitter, type, args) {
|
|
2516
|
-
if (type === "ready") emitter.isReady = true;
|
|
2517
|
-
emitter.dispatchEvent(new CustomEvent(type, {
|
|
2518
|
-
detail: args
|
|
2519
|
-
}));
|
|
2520
|
-
}
|
|
2521
|
-
function $eda442ba39f881a8$var$on(emitter, type, fn, options) {
|
|
2522
|
-
if (type === "ready" && emitter.isReady === true) fn.apply(emitter, [
|
|
2523
|
-
emitter
|
|
2524
|
-
]);
|
|
2525
|
-
emitter.addEventListener(type, (e)=>fn.apply(emitter, e.detail)
|
|
2526
|
-
, options);
|
|
2527
|
-
}
|
|
2528
|
-
class $eda442ba39f881a8$var$TabGroup extends HTMLElement {
|
|
2529
|
-
constructor(){
|
|
2530
|
-
super();
|
|
2531
|
-
this.isReady = false;
|
|
2532
|
-
// Options
|
|
2533
|
-
this.options = {
|
|
2534
|
-
closeButtonText: this.getAttribute("close-button-text") || "×",
|
|
2535
|
-
defaultTab: {
|
|
2536
|
-
title: "New Tab",
|
|
2537
|
-
active: true
|
|
2538
|
-
},
|
|
2539
|
-
newTabButton: !!this.getAttribute("new-tab-button") === true || false,
|
|
2540
|
-
newTabButtonText: this.getAttribute("new-tab-button-text") || "+",
|
|
2541
|
-
sortable: !!this.getAttribute("sortable") === true || false,
|
|
2542
|
-
visibilityThreshold: Number(this.getAttribute("visibility-threshold")) || 0
|
|
2543
|
-
};
|
|
2544
|
-
this.tabs = [];
|
|
2545
|
-
this.newTabId = 0;
|
|
2546
|
-
this.createComponent();
|
|
2547
|
-
this.initVisibility();
|
|
2548
|
-
if (this.options.sortable) this.initSortable();
|
|
2549
|
-
this.emit("ready", this);
|
|
2550
|
-
}
|
|
2551
|
-
emit(type, ...args) {
|
|
2552
|
-
return $eda442ba39f881a8$var$emit(this, type, args);
|
|
2553
|
-
}
|
|
2554
|
-
on(type, fn) {
|
|
2555
|
-
return $eda442ba39f881a8$var$on(this, type, fn);
|
|
2556
|
-
}
|
|
2557
|
-
once(type, fn) {
|
|
2558
|
-
return $eda442ba39f881a8$var$on(this, type, fn, {
|
|
2559
|
-
once: true
|
|
2560
|
-
});
|
|
2561
|
-
}
|
|
2562
|
-
connectedCallback() {
|
|
2563
|
-
// Support custom styles
|
|
2564
|
-
const style = this.querySelector("style");
|
|
2565
|
-
if (style) this.shadow.appendChild(style);
|
|
2566
|
-
}
|
|
2567
|
-
createComponent() {
|
|
2568
|
-
const shadow = this.attachShadow({
|
|
2569
|
-
mode: "open"
|
|
2570
|
-
});
|
|
2571
|
-
this.shadow = shadow;
|
|
2572
|
-
const wrapper = document.createElement("div");
|
|
2573
|
-
wrapper.setAttribute("class", $eda442ba39f881a8$var$CLASSNAMES.ROOT);
|
|
2574
|
-
const tabgroup = document.createElement("nav");
|
|
2575
|
-
tabgroup.setAttribute("class", $eda442ba39f881a8$var$CLASSNAMES.NAV);
|
|
2576
|
-
wrapper.appendChild(tabgroup);
|
|
2577
|
-
const tabContainer = document.createElement("div");
|
|
2578
|
-
tabContainer.setAttribute("class", $eda442ba39f881a8$var$CLASSNAMES.TABS);
|
|
2579
|
-
tabgroup.appendChild(tabContainer);
|
|
2580
|
-
this.tabContainer = tabContainer;
|
|
2581
|
-
const buttonContainer = document.createElement("div");
|
|
2582
|
-
buttonContainer.setAttribute("class", $eda442ba39f881a8$var$CLASSNAMES.BUTTONS);
|
|
2583
|
-
tabgroup.appendChild(buttonContainer);
|
|
2584
|
-
this.buttonContainer = buttonContainer;
|
|
2585
|
-
if (this.options.newTabButton) {
|
|
2586
|
-
const button = this.buttonContainer.appendChild(document.createElement("button"));
|
|
2587
|
-
button.innerHTML = this.options.newTabButtonText;
|
|
2588
|
-
button.addEventListener("click", this.addTab.bind(this, undefined), false);
|
|
2589
|
-
}
|
|
2590
|
-
const viewContainer = document.createElement("div");
|
|
2591
|
-
viewContainer.setAttribute("class", $eda442ba39f881a8$var$CLASSNAMES.VIEWS);
|
|
2592
|
-
wrapper.appendChild(viewContainer);
|
|
2593
|
-
this.viewContainer = viewContainer;
|
|
2594
|
-
const style = document.createElement("style");
|
|
2595
|
-
style.textContent = (/*@__PURE__*/$parcel$interopDefault($0648b347057451f2$exports));
|
|
2596
|
-
shadow.appendChild(style);
|
|
2597
|
-
shadow.appendChild(wrapper);
|
|
2598
|
-
}
|
|
2599
|
-
initVisibility() {
|
|
2600
|
-
function toggleTabsVisibility(tab, tabGroup) {
|
|
2601
|
-
const visibilityThreshold = tabGroup.options.visibilityThreshold;
|
|
2602
|
-
const el = tabGroup.tabContainer.parentElement;
|
|
2603
|
-
if (tabGroup.tabs.length >= visibilityThreshold) el.classList.add("visible");
|
|
2604
|
-
else el.classList.remove("visible");
|
|
2605
|
-
}
|
|
2606
|
-
this.on("tab-added", toggleTabsVisibility);
|
|
2607
|
-
this.on("tab-removed", toggleTabsVisibility);
|
|
2608
|
-
toggleTabsVisibility(null, this);
|
|
2609
|
-
}
|
|
2610
|
-
initSortable() {
|
|
2611
|
-
const createNewSortable = ()=>{
|
|
2612
|
-
const options = Object.assign({
|
|
2613
|
-
direction: "horizontal",
|
|
2614
|
-
animation: 150,
|
|
2615
|
-
swapThreshold: 0.20
|
|
2616
|
-
}, this.options.sortableOptions);
|
|
2617
|
-
new $64afbd09cd65a300$export$2e2bcd8739ae039(this.tabContainer, options);
|
|
2618
|
-
};
|
|
2619
|
-
if ($64afbd09cd65a300$export$2e2bcd8739ae039) createNewSortable();
|
|
2620
|
-
else document.addEventListener("DOMContentLoaded", createNewSortable);
|
|
2621
|
-
}
|
|
2622
|
-
setDefaultTab(tab) {
|
|
2623
|
-
this.options.defaultTab = tab;
|
|
2624
|
-
}
|
|
2625
|
-
addTab(args = this.options.defaultTab) {
|
|
2626
|
-
if (typeof args === "function") args = args(this);
|
|
2627
|
-
const id = this.newTabId;
|
|
2628
|
-
this.newTabId++;
|
|
2629
|
-
const tab = new $eda442ba39f881a8$var$Tab(this, id, args);
|
|
2630
|
-
this.tabs.push(tab);
|
|
2631
|
-
// Don't call tab.activate() before a tab is referenced in this.tabs
|
|
2632
|
-
if (args.active === true) tab.activate();
|
|
2633
|
-
this.emit("tab-added", tab, this);
|
|
2634
|
-
return tab;
|
|
2635
|
-
}
|
|
2636
|
-
getTab(id) {
|
|
2637
|
-
for(let i in this.tabs){
|
|
2638
|
-
if (this.tabs[i].id === id) return this.tabs[i];
|
|
2639
|
-
}
|
|
2640
|
-
return null;
|
|
2641
|
-
}
|
|
2642
|
-
getTabByPosition(position) {
|
|
2643
|
-
const fromRight = position < 0;
|
|
2644
|
-
for(let i in this.tabs){
|
|
2645
|
-
if (this.tabs[i].getPosition(fromRight) === position) return this.tabs[i];
|
|
2646
|
-
}
|
|
2647
|
-
return null;
|
|
2648
|
-
}
|
|
2649
|
-
getTabByRelPosition(position) {
|
|
2650
|
-
position = this.getActiveTab().getPosition() + position;
|
|
2651
|
-
if (position <= 0) return null;
|
|
2652
|
-
return this.getTabByPosition(position);
|
|
2653
|
-
}
|
|
2654
|
-
getNextTab() {
|
|
2655
|
-
return this.getTabByRelPosition(1);
|
|
2656
|
-
}
|
|
2657
|
-
getPreviousTab() {
|
|
2658
|
-
return this.getTabByRelPosition(-1);
|
|
2659
|
-
}
|
|
2660
|
-
getTabs() {
|
|
2661
|
-
return this.tabs.slice();
|
|
2662
|
-
}
|
|
2663
|
-
eachTab(fn) {
|
|
2664
|
-
this.getTabs().forEach(fn);
|
|
2665
|
-
}
|
|
2666
|
-
getActiveTab() {
|
|
2667
|
-
if (this.tabs.length === 0) return null;
|
|
2668
|
-
return this.tabs[0];
|
|
2669
|
-
}
|
|
2670
|
-
setActiveTab(tab) {
|
|
2671
|
-
this.removeTab(tab);
|
|
2672
|
-
this.tabs.unshift(tab);
|
|
2673
|
-
this.emit("tab-active", tab, this);
|
|
2674
|
-
}
|
|
2675
|
-
removeTab(tab, triggerEvent = false) {
|
|
2676
|
-
const id = tab.id;
|
|
2677
|
-
const index = this.tabs.findIndex((t)=>t.id === id
|
|
2678
|
-
);
|
|
2679
|
-
this.tabs.splice(index, 1);
|
|
2680
|
-
if (triggerEvent) this.emit("tab-removed", tab, this);
|
|
2681
|
-
}
|
|
2682
|
-
activateRecentTab() {
|
|
2683
|
-
if (this.tabs.length > 0) this.tabs[0].activate();
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
class $eda442ba39f881a8$var$Tab extends EventTarget {
|
|
2687
|
-
constructor(tabGroup, id, args){
|
|
2688
|
-
super();
|
|
2689
|
-
this.badge = args.badge;
|
|
2690
|
-
this.closable = args.closable === false ? false : true;
|
|
2691
|
-
this.icon = args.icon;
|
|
2692
|
-
this.iconURL = args.iconURL;
|
|
2693
|
-
this.id = id;
|
|
2694
|
-
this.isClosed = false;
|
|
2695
|
-
this.isReady = false;
|
|
2696
|
-
this.spans = {};
|
|
2697
|
-
this.tabGroup = tabGroup;
|
|
2698
|
-
this.title = args.title;
|
|
2699
|
-
this.webviewAttributes = args.webviewAttributes || {};
|
|
2700
|
-
this.webviewAttributes.src = args.src;
|
|
2701
|
-
this.initTab();
|
|
2702
|
-
this.initWebview();
|
|
2703
|
-
if (args.visible !== false) this.show();
|
|
2704
|
-
if (typeof args.ready === "function") args.ready(this);
|
|
2705
|
-
else this.emit("ready", this);
|
|
2706
|
-
}
|
|
2707
|
-
emit(type, ...args) {
|
|
2708
|
-
return $eda442ba39f881a8$var$emit(this, type, args);
|
|
2709
|
-
}
|
|
2710
|
-
on(type, fn) {
|
|
2711
|
-
return $eda442ba39f881a8$var$on(this, type, fn);
|
|
2712
|
-
}
|
|
2713
|
-
once(type, fn) {
|
|
2714
|
-
return $eda442ba39f881a8$var$on(this, type, fn, {
|
|
2715
|
-
once: true
|
|
2716
|
-
});
|
|
2717
|
-
}
|
|
2718
|
-
initTab() {
|
|
2719
|
-
const tab = this.element = document.createElement("div");
|
|
2720
|
-
tab.classList.add($eda442ba39f881a8$var$CLASSNAMES.TAB);
|
|
2721
|
-
for (let el of [
|
|
2722
|
-
"icon",
|
|
2723
|
-
"title",
|
|
2724
|
-
"badge",
|
|
2725
|
-
"close"
|
|
2726
|
-
]){
|
|
2727
|
-
const span = tab.appendChild(document.createElement("span"));
|
|
2728
|
-
span.classList.add(`${$eda442ba39f881a8$var$CLASSNAMES.TAB}-${el}`);
|
|
2729
|
-
this.spans[el] = span;
|
|
2730
|
-
}
|
|
2731
|
-
this.setTitle(this.title);
|
|
2732
|
-
this.setBadge(this.badge);
|
|
2733
|
-
this.setIcon(this.iconURL, this.icon);
|
|
2734
|
-
this.initTabCloseButton();
|
|
2735
|
-
this.initTabClickHandler();
|
|
2736
|
-
this.tabGroup.tabContainer.appendChild(this.element);
|
|
2737
|
-
}
|
|
2738
|
-
initTabCloseButton() {
|
|
2739
|
-
const container = this.spans.close;
|
|
2740
|
-
if (this.closable) {
|
|
2741
|
-
const button = container.appendChild(document.createElement("button"));
|
|
2742
|
-
button.innerHTML = this.tabGroup.options.closeButtonText;
|
|
2743
|
-
button.addEventListener("click", this.close.bind(this, false), false);
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
initTabClickHandler() {
|
|
2747
|
-
// Mouse up
|
|
2748
|
-
const tabClickHandler = function(e) {
|
|
2749
|
-
if (this.isClosed) return;
|
|
2750
|
-
if (e.which === 2) this.close();
|
|
2751
|
-
};
|
|
2752
|
-
this.element.addEventListener("mouseup", tabClickHandler.bind(this), false);
|
|
2753
|
-
// Mouse down
|
|
2754
|
-
const tabMouseDownHandler = function(e) {
|
|
2755
|
-
if (this.isClosed) return;
|
|
2756
|
-
if (e.which === 1) {
|
|
2757
|
-
if (e.target.matches("button")) return;
|
|
2758
|
-
this.activate();
|
|
2759
|
-
}
|
|
2760
|
-
};
|
|
2761
|
-
this.element.addEventListener("mousedown", tabMouseDownHandler.bind(this), false);
|
|
2762
|
-
}
|
|
2763
|
-
initWebview() {
|
|
2764
|
-
const webview = this.webview = document.createElement("webview");
|
|
2765
|
-
const tabWebviewDidFinishLoadHandler = function(e) {
|
|
2766
|
-
this.emit("webview-ready", this);
|
|
2767
|
-
};
|
|
2768
|
-
this.webview.addEventListener("did-finish-load", tabWebviewDidFinishLoadHandler.bind(this), false);
|
|
2769
|
-
const tabWebviewDomReadyHandler = function(e) {
|
|
2770
|
-
// Remove this once https://github.com/electron/electron/issues/14474 is fixed
|
|
2771
|
-
webview.blur();
|
|
2772
|
-
webview.focus();
|
|
2773
|
-
this.emit("webview-dom-ready", this);
|
|
2774
|
-
};
|
|
2775
|
-
this.webview.addEventListener("dom-ready", tabWebviewDomReadyHandler.bind(this), false);
|
|
2776
|
-
this.webview.classList.add($eda442ba39f881a8$var$CLASSNAMES.VIEW);
|
|
2777
|
-
if (this.webviewAttributes) {
|
|
2778
|
-
const attrs = this.webviewAttributes;
|
|
2779
|
-
for(let key in attrs){
|
|
2780
|
-
const attr = attrs[key];
|
|
2781
|
-
if (attr === false) continue;
|
|
2782
|
-
this.webview.setAttribute(key, attr);
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
this.tabGroup.viewContainer.appendChild(this.webview);
|
|
2786
|
-
}
|
|
2787
|
-
setTitle(title) {
|
|
2788
|
-
if (this.isClosed) return;
|
|
2789
|
-
const span = this.spans.title;
|
|
2790
|
-
span.innerHTML = title;
|
|
2791
|
-
span.title = title;
|
|
2792
|
-
this.title = title;
|
|
2793
|
-
this.emit("title-changed", title, this);
|
|
2794
|
-
return this;
|
|
2795
|
-
}
|
|
2796
|
-
getTitle() {
|
|
2797
|
-
if (this.isClosed) return;
|
|
2798
|
-
return this.title;
|
|
2799
|
-
}
|
|
2800
|
-
setBadge(badge) {
|
|
2801
|
-
if (this.isClosed) return;
|
|
2802
|
-
const span = this.spans.badge;
|
|
2803
|
-
this.badge = badge;
|
|
2804
|
-
if (badge) {
|
|
2805
|
-
span.innerHTML = badge.text;
|
|
2806
|
-
span.classList.add(badge.classname);
|
|
2807
|
-
span.classList.remove("hidden");
|
|
2808
|
-
} else span.classList.add("hidden");
|
|
2809
|
-
this.emit("badge-changed", badge, this);
|
|
2810
|
-
}
|
|
2811
|
-
getBadge() {
|
|
2812
|
-
if (this.isClosed) return;
|
|
2813
|
-
return this.badge;
|
|
2814
|
-
}
|
|
2815
|
-
setIcon(iconURL, icon) {
|
|
2816
|
-
if (this.isClosed) return;
|
|
2817
|
-
this.iconURL = iconURL;
|
|
2818
|
-
this.icon = icon;
|
|
2819
|
-
const span = this.spans.icon;
|
|
2820
|
-
if (iconURL) {
|
|
2821
|
-
span.innerHTML = `<img src="${iconURL}" />`;
|
|
2822
|
-
this.emit("icon-changed", iconURL, this);
|
|
2823
|
-
} else if (icon) {
|
|
2824
|
-
span.innerHTML = `<i class="${icon}"></i>`;
|
|
2825
|
-
this.emit("icon-changed", icon, this);
|
|
2826
|
-
}
|
|
2827
|
-
return this;
|
|
2828
|
-
}
|
|
2829
|
-
getIcon() {
|
|
2830
|
-
if (this.isClosed) return;
|
|
2831
|
-
if (this.iconURL) return this.iconURL;
|
|
2832
|
-
return this.icon;
|
|
2833
|
-
}
|
|
2834
|
-
setPosition(newPosition) {
|
|
2835
|
-
const tabContainer = this.tabGroup.tabContainer;
|
|
2836
|
-
const length = tabContainer.childElementCount;
|
|
2837
|
-
const thisPosition = this.getPosition();
|
|
2838
|
-
const tabs = Array.from(tabContainer.children);
|
|
2839
|
-
tabs.splice(thisPosition, 1);
|
|
2840
|
-
if (newPosition < 0) {
|
|
2841
|
-
newPosition += length;
|
|
2842
|
-
if (newPosition < 0) newPosition = 0;
|
|
2843
|
-
}
|
|
2844
|
-
if (newPosition < length) tabContainer.insertBefore(this.element, tabs[newPosition]);
|
|
2845
|
-
else tabContainer.appendChild(this.element);
|
|
2846
|
-
return this;
|
|
2847
|
-
}
|
|
2848
|
-
getPosition(fromRight = false) {
|
|
2849
|
-
let position = 0;
|
|
2850
|
-
let tab = this.element;
|
|
2851
|
-
while((tab = tab.previousSibling) != null)position++;
|
|
2852
|
-
if (fromRight === true) position -= this.tabGroup.tabContainer.childElementCount;
|
|
2853
|
-
return position;
|
|
2854
|
-
}
|
|
2855
|
-
activate() {
|
|
2856
|
-
if (this.isClosed) return;
|
|
2857
|
-
const activeTab = this.tabGroup.getActiveTab();
|
|
2858
|
-
if (activeTab) {
|
|
2859
|
-
activeTab.element.classList.remove("active");
|
|
2860
|
-
activeTab.webview.classList.remove("visible");
|
|
2861
|
-
activeTab.emit("inactive", activeTab);
|
|
2862
|
-
}
|
|
2863
|
-
this.tabGroup.setActiveTab(this);
|
|
2864
|
-
this.element.classList.add("active");
|
|
2865
|
-
this.webview.classList.add("visible");
|
|
2866
|
-
this.webview.focus();
|
|
2867
|
-
this.emit("active", this);
|
|
2868
|
-
return this;
|
|
2869
|
-
}
|
|
2870
|
-
show(flag = true) {
|
|
2871
|
-
if (this.isClosed) return;
|
|
2872
|
-
if (flag) {
|
|
2873
|
-
this.element.classList.add("visible");
|
|
2874
|
-
this.emit("visible", this);
|
|
2875
|
-
} else {
|
|
2876
|
-
this.element.classList.remove("visible");
|
|
2877
|
-
this.emit("hidden", this);
|
|
2878
|
-
}
|
|
2879
|
-
return this;
|
|
2880
|
-
}
|
|
2881
|
-
hide() {
|
|
2882
|
-
return this.show(false);
|
|
2883
|
-
}
|
|
2884
|
-
hasClass(classname) {
|
|
2885
|
-
return this.element.classList.contains(classname);
|
|
2886
|
-
}
|
|
2887
|
-
close(force) {
|
|
2888
|
-
const abortController = new AbortController();
|
|
2889
|
-
const abort = ()=>abortController.abort()
|
|
2890
|
-
;
|
|
2891
|
-
this.emit("closing", this, abort);
|
|
2892
|
-
const abortSignal = abortController.signal;
|
|
2893
|
-
if (this.isClosed || !this.closable && !force || abortSignal.aborted) return;
|
|
2894
|
-
this.isClosed = true;
|
|
2895
|
-
const tabGroup = this.tabGroup;
|
|
2896
|
-
tabGroup.tabContainer.removeChild(this.element);
|
|
2897
|
-
tabGroup.viewContainer.removeChild(this.webview);
|
|
2898
|
-
const activeTab = this.tabGroup.getActiveTab();
|
|
2899
|
-
tabGroup.removeTab(this, true);
|
|
2900
|
-
this.emit("close", this);
|
|
2901
|
-
if (activeTab.id === this.id) tabGroup.activateRecentTab();
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
customElements.define("tab-group", $eda442ba39f881a8$var$TabGroup);
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
//# sourceMappingURL=electron-tabs.js.map
|