├── .editorconfig ├── .gitignore ├── .npmignore ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── build ├── args.js ├── paths.js └── tasks │ ├── build.js │ ├── clean.js │ ├── dev.js │ ├── doc.js │ ├── lint.js │ ├── prepare-release.js │ └── test.js ├── config.js ├── dist ├── amd │ ├── draggable.js │ ├── draggable.js.map │ ├── dropzone.js │ ├── dropzone.js.map │ ├── index.js │ ├── index.js.map │ ├── interact-base.js │ ├── interact-base.js.map │ ├── interact-draggable.js │ ├── interact-draggable.js.map │ ├── interact-dropzone.js │ ├── interact-dropzone.js.map │ ├── interact-gesturable.js │ ├── interact-gesturable.js.map │ ├── interact-resizable.js │ ├── interact-resizable.js.map │ ├── resizable.js │ └── resizable.js.map ├── commonjs │ ├── draggable.js │ ├── draggable.js.map │ ├── dropzone.js │ ├── dropzone.js.map │ ├── index.js │ ├── index.js.map │ ├── interact-base.js │ ├── interact-base.js.map │ ├── interact-draggable.js │ ├── interact-draggable.js.map │ ├── interact-dropzone.js │ ├── interact-dropzone.js.map │ ├── interact-gesturable.js │ ├── interact-gesturable.js.map │ ├── interact-resizable.js │ ├── interact-resizable.js.map │ ├── resizable.js │ └── resizable.js.map ├── es6 │ ├── draggable.js │ ├── draggable.js.map │ ├── dropzone.js │ ├── dropzone.js.map │ ├── index.js │ ├── index.js.map │ ├── interact-base.js │ ├── interact-base.js.map │ ├── interact-draggable.js │ ├── interact-draggable.js.map │ ├── interact-dropzone.js │ ├── interact-dropzone.js.map │ ├── interact-gesturable.js │ ├── interact-gesturable.js.map │ ├── interact-resizable.js │ ├── interact-resizable.js.map │ ├── resizable.js │ └── resizable.js.map └── system │ ├── draggable.js │ ├── draggable.js.map │ ├── dropzone.js │ ├── dropzone.js.map │ ├── index.js │ ├── index.js.map │ ├── interact-base.js │ ├── interact-base.js.map │ ├── interact-draggable.js │ ├── interact-draggable.js.map │ ├── interact-dropzone.js │ ├── interact-dropzone.js.map │ ├── interact-gesturable.js │ ├── interact-gesturable.js.map │ ├── interact-resizable.js │ ├── interact-resizable.js.map │ ├── resizable.js │ └── resizable.js.map ├── doc ├── CHANGELOG.md └── api.json ├── gulpfile.js ├── install ├── dependencies.json ├── interact.js ├── interact.json └── post-install.js ├── karma.conf.js ├── package.json ├── src ├── draggable.ts ├── dropzone.ts ├── index.ts ├── interact-base.ts ├── interact-draggable.ts ├── interact-dropzone.ts ├── interact-gesturable.ts ├── interact-resizable.ts └── resizable.ts ├── test ├── setup.ts └── unit │ ├── configure.spec.ts │ └── options.spec.ts.ts ├── tsconfig.json ├── tslint.json └── typings.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | [**.*] 13 | indent_style = space 14 | indent_size = 2 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | jspm_packages 3 | bower_components 4 | .idea 5 | .DS_STORE 6 | build/reports 7 | typings/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | jspm_packages 2 | bower_components 3 | .idea -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We'd love for you to contribute and to make this project even better than it is today! If this interests you, please begin by reading [our contributing guidelines](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). The contributing document will provide you with all the information you need to get started. Once you have read that, you will need to also [sign our CLA](http://goo.gl/forms/dI8QDDSyKR) before we can accept a Pull Request from you. More information on the process is included in the [contributor's guide](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). 4 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 19 | **I'm submitting a bug report** 20 | **I'm submitting a feature request** 21 | 22 | * **Framework Version:** 23 | major.minor.patch-pre 24 | 25 | **Please tell us about your environment:** 26 | * **Operating System:** 27 | OSX 10.x|Linux (distro)|Windows [7|8|8.1|10] 28 | 29 | * **Node Version:** 30 | 6.2.0 31 | 35 | 36 | * **NPM Version:** 37 | 3.8.9 38 | 42 | 43 | * **JSPM OR Webpack AND Version** 44 | JSPM 0.16.32 | webpack 2.1.0-beta.17 45 | 51 | 52 | * **Browser:** 53 | all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView 54 | 55 | * **Language:** 56 | all | TypeScript X.X | ESNext 57 | 58 | 59 | **Current behavior:** 60 | 61 | 62 | **Expected/desired behavior:** 63 | 70 | 71 | 72 | * **What is the expected behavior?** 73 | 74 | 75 | * **What is the motivation / use case for changing the behavior?** 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Durandal Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aurelia-interactjs 2 | 3 | Aurelia plugin to use the [interact.js](http://interactjs.io/) library. 4 | 5 | Inspired by a blog post from Matthew James Davis [Drag-and-drop in Aurelia](http://davismj.me/blog/aurelia-drag-and-drop/). 6 | 7 | # Installation 8 | 9 | ## JSPM 10 | Install the package: 11 | ``` 12 | jspm i aurelia-interactjs 13 | ``` 14 | 15 | Add the following line to ```src/main.js``` or ```src/main.ts```: 16 | ```diff 17 | export function configure(aurelia) { 18 | aurelia.use 19 | .standardConfiguration() 20 | .developmentLogging() 21 | + .plugin("aurelia-interactjs"); 22 | ``` 23 | ## Aurelia-CLI 24 | Install the package: 25 | ``` 26 | npm i aurelia-interactjs --save 27 | ``` 28 | And perform the following command to add the configuration for aurelia-interactjs to the aurelia.json config: 29 | ``` 30 | au interact 31 | ``` 32 | Add the following line to ```src/main.js``` or ```src/main.ts```: 33 | ```diff 34 | export function configure(aurelia: Aurelia) { 35 | aurelia.use 36 | .standardConfiguration() 37 | .feature('resources') 38 | + .plugin('aurelia-interactjs'); 39 | 40 | if (environment.debug) { 41 | aurelia.use.developmentLogging(); 42 | } 43 | ``` 44 | 45 | # Generic attributes 46 | Each attribute can be supplied with custom options that will be pased to interactjs, and are split into 2 types. 47 | These are Interactable options and Action options. 48 | 49 | See the [interactjs documentation]( http://interactjs.io/docs/#action-options) for the Action options. 50 | 51 | Interactable options are described in the code. See the default values [here](https://github.com/taye/interact.js/blob/master/src/defaultOptions.js). 52 | 53 | Prior to v2.0.7 only, action options were supported by the wrapper, for example: 54 | 55 | ## Usage: 56 | 57 | ### Action options only (pre and post 2.0.7) 58 | ```html 59 |
60 | ``` 61 | ```js 62 | let actionOptions = { 63 | overlap: 0.1 64 | } 65 | ``` 66 | 67 | ### Action and Intreactable options usage: 68 | In v2.0.7 and above both types are supported, for example: 69 | 70 | ```html 71 |
72 | ``` 73 | 74 | ```js 75 | let options = { 76 | action: { overlap: 0.1 }, 77 | interactable: { preventDefault: 'never' } 78 | } 79 | ``` 80 | NOTE: If you use more than one custom attribute on a HTML element (e.g. draggable and dropzone on the same DIV) you should 81 | duplicate the interactable options on both as the fist one that is evaluated creates the interactable which is subsequently cached. 82 | 83 | Each event can be used in the following way: 84 | 85 | ```html 86 |
87 | ``` 88 | 89 | ```javascript 90 | export class Home { 91 | public func(customEvent: CustomEvent) { 92 | let event = customEvent.detail; 93 | console.log("event", event); 94 | } 95 | } 96 | ``` 97 | 98 | ## interact-draggable 99 | The following attributes can be set to catch events 100 | 101 | | Attribute | Interact.js event | 102 | | --------------------------|-------------------| 103 | | interact-dragstart | dragstart | 104 | | interact-dragmove | dragmove | 105 | | interact-draginertiastart | draginertiastart | 106 | | interact-dragend | dragend | 107 | 108 | ## interact-dropzone 109 | 110 | | Attribute | Interact.js event | 111 | |---------------------------|-------------------| 112 | | interact-dropactivate | dropactivate | 113 | | interact-dragenter | dragenter | 114 | | interact-dragleave | dragleave | 115 | | interact-drop | drop | 116 | | interact-dropdeactivate | dropdeactivate | 117 | 118 | ## interact-gesturable 119 | 120 | | Attribute | Interact.js event | 121 | |---------------------------|-------------------| 122 | | interact-gesturestart | gesturestart | 123 | | interact-gesturemove | gesturemove | 124 | | interact-gestureend | gestureend | 125 | 126 | ## interact-resizable 127 | 128 | | Attribute | Interact.js event | 129 | |-----------------------------|--------------------| 130 | | interact-resizestart | resizestart | 131 | | interact-resizemove | resizemove | 132 | | interact-resizeinertiastart | resizeinertiastart | 133 | | interact-resizeend | resizeend | 134 | 135 | 136 | # Custom attributes draggable and dropzone 137 | 138 | By default the attributes ```draggable``` and ```dropzone``` are not loaded (because the use global names). 139 | 140 | You can load them by providing the option ```enableDragDropAttributes``` in ```src\main.js``` or ```src\main.ts``` : 141 | ```diff 142 | export function configure(aurelia) { 143 | aurelia.use 144 | .standardConfiguration() 145 | .developmentLogging() 146 | + .plugin("aurelia-interactjs", { enableDragDropAttributes: true }); 147 | ``` 148 | 149 | ```html 150 |
drag me
151 | 152 |
153 |
154 | ``` 155 | 156 | ```javascript 157 | export class App { 158 | item = { name: "some", color: "yellow"}; 159 | 160 | updateColor(item, color) { 161 | item.color = color; 162 | } 163 | 164 | } 165 | ``` 166 | 167 | By default it will add the following css classes to the element in the following states: 168 | 169 | # draggable 170 | 171 | | class | state | 172 | |-------------------|------------------------------------------------------| 173 | | getting--dragged | draggable is getting dragged | 174 | | drop--me | draggable entered a dropzone and can be dropped here | 175 | 176 | # dropzone 177 | 178 | | class | state | 179 | |--------------|-----------------------------------------------------| 180 | | can--drop | draggable target can be dropped in the dropzone | 181 | | can-catch | draggable entered this zone and can be dropped here | 182 | | caught--it | draggable element is dropped in this zone | 183 | 184 | -------------------------------------------------------------------------------- /build/args.js: -------------------------------------------------------------------------------- 1 | var yargs = require('yargs'); 2 | 3 | var argv = yargs.argv; 4 | var validBumpTypes = 'major|minor|patch|prerelease'.split('|'); 5 | var bump = (argv.bump || 'patch').toLowerCase(); 6 | 7 | if (validBumpTypes.indexOf(bump) === -1) { 8 | throw new Error('Unrecognized bump "' + bump + '".'); 9 | } 10 | 11 | module.exports = { 12 | bump: bump, 13 | depth: parseInt(argv.depth || '0') 14 | }; 15 | -------------------------------------------------------------------------------- /build/paths.js: -------------------------------------------------------------------------------- 1 | var appRoot = 'src/'; 2 | var outputRoot = 'dist/'; 3 | 4 | module.exports = { 5 | root: appRoot, 6 | source: appRoot + '**/*.ts', 7 | html: appRoot + '**/*.html', 8 | style: 'styles/**/*.css', 9 | output: outputRoot, 10 | doc:'./doc', 11 | e2eSpecsSrc: 'test/e2e/src/*.js', 12 | e2eSpecsDist: 'test/e2e/dist/', 13 | dtsSrc: [ 14 | 'typings/**/*.ts', 15 | 'custom_typings/**/*.ts', 16 | './jspm_packages/**/*.d.ts' 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /build/tasks/build.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var runSequence = require('run-sequence'); 3 | var paths = require('../paths'); 4 | var assign = Object.assign || require('object.assign'); 5 | var typescript = require('gulp-typescript'); 6 | var plumber = require('gulp-plumber'); 7 | var sourcemaps = require('gulp-sourcemaps'); 8 | var changed = require('gulp-changed'); 9 | 10 | gulp.task('build-html', function () { 11 | return gulp.src(paths.html) 12 | .pipe(gulp.dest(paths.output + 'es6')) 13 | .pipe(gulp.dest(paths.output + 'commonjs')) 14 | .pipe(gulp.dest(paths.output + 'amd')) 15 | .pipe(gulp.dest(paths.output + 'system')); 16 | }); 17 | 18 | var tsProjectES6 = typescript.createProject('./tsconfig.json', { typescript: require('typescript') }); 19 | var tsProjectAMD = typescript.createProject('./tsconfig.json', { typescript: require('typescript'), target: 'es5', module: 'amd' }); 20 | var tsProjectCJS = typescript.createProject('./tsconfig.json', { typescript: require('typescript'), target: 'es5', module: 'commonjs' }); 21 | var tsProjectSystem = typescript.createProject('./tsconfig.json', { typescript: require('typescript'), target: 'es5', module: 'system' }); 22 | function build(tsProject, outputPath) { 23 | return gulp.src(paths.dtsSrc.concat(paths.source)) 24 | .pipe(plumber()) 25 | .pipe(changed(outputPath, {extension: '.ts'})) 26 | .pipe(sourcemaps.init({loadMaps: true})) 27 | .pipe(typescript(tsProject)) 28 | .pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: '/src'})) 29 | .pipe(gulp.dest(outputPath)); 30 | } 31 | 32 | gulp.task('build-es6', function () { 33 | return build(tsProjectES6, paths.output + 'es6'); 34 | }); 35 | 36 | gulp.task('build-ts', function() { 37 | return gulp.src(paths.source) 38 | .pipe(gulp.dest(paths.output + 'ts')); 39 | }); 40 | 41 | gulp.task('build-commonjs', function () { 42 | return build(tsProjectCJS, paths.output + 'commonjs'); 43 | }); 44 | 45 | gulp.task('build-amd', function () { 46 | return build(tsProjectAMD, paths.output + 'amd'); 47 | }); 48 | 49 | gulp.task('build-system', function () { 50 | return build(tsProjectSystem, paths.output + 'system'); 51 | }); 52 | 53 | gulp.task('build-html-system', function () { 54 | return gulp.src(paths.html) 55 | .pipe(gulp.dest(paths.output + 'system')); 56 | }); 57 | 58 | gulp.task('build', function(callback) { 59 | return runSequence( 60 | 'clean', 61 | ['build-html', 'build-es6', 'build-commonjs', 'build-amd', 'build-system'], 62 | callback 63 | ); 64 | }); 65 | -------------------------------------------------------------------------------- /build/tasks/clean.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var del = require('del'); 4 | var vinylPaths = require('vinyl-paths'); 5 | 6 | // deletes all files in the output path 7 | gulp.task('clean', function() { 8 | return gulp.src([paths.output]) 9 | .pipe(vinylPaths(del)); 10 | }); 11 | -------------------------------------------------------------------------------- /build/tasks/dev.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var tools = require('aurelia-tools'); 3 | var args = require('../args'); 4 | 5 | // source code for the tasks called in this file 6 | // is located at: https://github.com/aurelia/tools/blob/master/src/dev.js 7 | 8 | // updates dependencies in this folder 9 | // from folders in the parent directory 10 | gulp.task('update-own-deps', function() { 11 | tools.updateOwnDependenciesFromLocalRepositories(args.depth); 12 | }); 13 | 14 | // quickly pulls in all of the aurelia 15 | // github repos, placing them up one directory 16 | // from where the command is executed, 17 | // then runs `npm install` 18 | // and `gulp build` for each repo 19 | gulp.task('build-dev-env', function() { 20 | tools.buildDevEnv(); 21 | }); 22 | -------------------------------------------------------------------------------- /build/tasks/doc.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var tools = require('aurelia-tools'); 3 | var paths = require('../paths'); 4 | var yuidoc = require('gulp-yuidoc'); 5 | 6 | gulp.task('doc-generate', function(){ 7 | return gulp.src(paths.source) 8 | .pipe(yuidoc.parser(null, 'api.json')) 9 | .pipe(gulp.dest(paths.doc)); 10 | }); 11 | 12 | gulp.task('doc', ['doc-generate'], function(){ 13 | tools.transformAPIModel(paths.doc); 14 | }); 15 | -------------------------------------------------------------------------------- /build/tasks/lint.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var tslint = require('gulp-tslint'); 4 | 5 | gulp.task('lint', function() { 6 | return gulp.src(paths.source) 7 | .pipe(tslint()) 8 | .pipe(tslint.report()); 9 | }); -------------------------------------------------------------------------------- /build/tasks/prepare-release.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var runSequence = require('run-sequence'); 3 | var paths = require('../paths'); 4 | var fs = require('fs'); 5 | var bump = require('gulp-bump'); 6 | var args = require('../args'); 7 | var conventionalChangelog = require('gulp-conventional-changelog'); 8 | 9 | // utilizes the bump plugin to bump the 10 | // semver for the repo 11 | gulp.task('bump-version', function() { 12 | return gulp.src(['./package.json']) 13 | .pipe(bump({type: args.bump})) //major|minor|patch|prerelease 14 | .pipe(gulp.dest('./')); 15 | }); 16 | 17 | // generates the CHANGELOG.md file based on commit 18 | // from git commit messages 19 | gulp.task('changelog', function () { 20 | return gulp.src(paths.doc + '/CHANGELOG.md', { 21 | buffer: false 22 | }).pipe(conventionalChangelog({ 23 | preset: 'angular' 24 | })) 25 | .pipe(gulp.dest(paths.doc)); 26 | }); 27 | 28 | // calls the listed sequence of tasks in order 29 | gulp.task('prepare-release', function(callback) { 30 | return runSequence( 31 | 'lint', 32 | 'build', 33 | 'bump-version', 34 | 'changelog', 35 | callback 36 | ); 37 | }); 38 | -------------------------------------------------------------------------------- /build/tasks/test.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var Karma = require('karma').Server; 3 | 4 | /** 5 | * Run test once and exit 6 | */ 7 | gulp.task('test', function(done) { 8 | new Karma({ 9 | configFile: __dirname + '/../../karma.conf.js', 10 | singleRun: true 11 | }, done).start(); 12 | }); 13 | 14 | /** 15 | * Watch for file changes and re-run tests on each change 16 | */ 17 | gulp.task('tdd', function(done) { 18 | new Karma({ 19 | configFile: __dirname + '/../../karma.conf.js' 20 | }, done).start(); 21 | }); 22 | 23 | /** 24 | * Run test once with code coverage and exit 25 | */ 26 | gulp.task('cover', function(done) { 27 | new Karma({ 28 | configFile: __dirname + '/../../karma.conf.js', 29 | singleRun: true, 30 | reporters: ['coverage'], 31 | preprocessors: { 32 | 'test/**/*.js': ['babel'], 33 | 'src/**/*.js': ['babel', 'coverage'] 34 | }, 35 | coverageReporter: { 36 | includeAllSources: true, 37 | instrumenters: { 38 | isparta: require('isparta') 39 | }, 40 | instrumenter: { 41 | 'src/**/*.js': 'isparta' 42 | }, 43 | reporters: [ 44 | { type: 'html', dir: 'coverage' }, 45 | { type: 'text' } 46 | ] 47 | } 48 | }, done).start(); 49 | }); 50 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | System.config({ 2 | defaultJSExtensions: true, 3 | transpiler: false, 4 | paths: { 5 | "github:*": "jspm_packages/github/*", 6 | "npm:*": "jspm_packages/npm/*" 7 | }, 8 | 9 | map: { 10 | "aurelia-framework": "npm:aurelia-framework@1.0.7", 11 | "aurelia-polyfills": "npm:aurelia-polyfills@1.1.1", 12 | "interact": "npm:interact.js@1.2.6", 13 | "npm:aurelia-binding@1.0.9": { 14 | "aurelia-logging": "npm:aurelia-logging@1.2.0", 15 | "aurelia-metadata": "npm:aurelia-metadata@1.0.2", 16 | "aurelia-pal": "npm:aurelia-pal@1.1.1", 17 | "aurelia-task-queue": "npm:aurelia-task-queue@1.1.0" 18 | }, 19 | "npm:aurelia-dependency-injection@1.2.0": { 20 | "aurelia-metadata": "npm:aurelia-metadata@1.0.2", 21 | "aurelia-pal": "npm:aurelia-pal@1.1.1" 22 | }, 23 | "npm:aurelia-framework@1.0.7": { 24 | "aurelia-binding": "npm:aurelia-binding@1.0.9", 25 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.0", 26 | "aurelia-loader": "npm:aurelia-loader@1.0.0", 27 | "aurelia-logging": "npm:aurelia-logging@1.2.0", 28 | "aurelia-metadata": "npm:aurelia-metadata@1.0.2", 29 | "aurelia-pal": "npm:aurelia-pal@1.1.1", 30 | "aurelia-path": "npm:aurelia-path@1.1.1", 31 | "aurelia-task-queue": "npm:aurelia-task-queue@1.1.0", 32 | "aurelia-templating": "npm:aurelia-templating@1.1.4" 33 | }, 34 | "npm:aurelia-loader@1.0.0": { 35 | "aurelia-metadata": "npm:aurelia-metadata@1.0.2", 36 | "aurelia-path": "npm:aurelia-path@1.1.1" 37 | }, 38 | "npm:aurelia-metadata@1.0.2": { 39 | "aurelia-pal": "npm:aurelia-pal@1.1.1" 40 | }, 41 | "npm:aurelia-polyfills@1.1.1": { 42 | "aurelia-pal": "npm:aurelia-pal@1.1.1" 43 | }, 44 | "npm:aurelia-task-queue@1.1.0": { 45 | "aurelia-pal": "npm:aurelia-pal@1.1.1" 46 | }, 47 | "npm:aurelia-templating@1.1.4": { 48 | "aurelia-binding": "npm:aurelia-binding@1.0.9", 49 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.2.0", 50 | "aurelia-loader": "npm:aurelia-loader@1.0.0", 51 | "aurelia-logging": "npm:aurelia-logging@1.2.0", 52 | "aurelia-metadata": "npm:aurelia-metadata@1.0.2", 53 | "aurelia-pal": "npm:aurelia-pal@1.1.1", 54 | "aurelia-path": "npm:aurelia-path@1.1.1", 55 | "aurelia-task-queue": "npm:aurelia-task-queue@1.1.0" 56 | } 57 | } 58 | }); 59 | -------------------------------------------------------------------------------- /dist/amd/draggable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var DraggableCustomAttribute = (function (_super) { 18 | __extends(DraggableCustomAttribute, _super); 19 | function DraggableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | DraggableCustomAttribute.prototype.bind = function () { 23 | this.unsetInteractJs(); 24 | this.element.classList.add('draggable'); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .draggable(this.getActionOptions()) 27 | .on('dragmove', function (event) { 28 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; 29 | target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; 30 | target.setAttribute('data-x', x); 31 | target.setAttribute('data-y', y); 32 | target.classList.add('getting--dragged'); 33 | }) 34 | .on('dragend', function (event) { 35 | event.target.style.transform = 'none'; 36 | event.target.removeAttribute('data-x'); 37 | event.target.removeAttribute('data-y'); 38 | event.target.classList.remove('getting--dragged'); 39 | }); 40 | }; 41 | DraggableCustomAttribute = __decorate([ 42 | aurelia_framework_1.inject(Element, Interact), 43 | __metadata('design:paramtypes', []) 44 | ], DraggableCustomAttribute); 45 | return DraggableCustomAttribute; 46 | }(interact_base_1.default)); 47 | exports.DraggableCustomAttribute = DraggableCustomAttribute; 48 | }); 49 | 50 | //# sourceMappingURL=draggable.js.map 51 | -------------------------------------------------------------------------------- /dist/amd/draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA8C,4CAAY;QAA1D;YAA8C,8BAAY;QAwB1D,CAAC;QAvBQ,uCAAI,GAAX;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAChC,EAAE,CAAC,UAAU,EAAE,UAAA,KAAK;gBACnB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAC/D,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;gBAEhE,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;gBAC/D,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC7C,CAAC,CAAC;iBACD,EAAE,CAAC,SAAS,EAAE,UAAA,KAAK;gBAClB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;gBACtC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;gBACvC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;gBACvC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACT,CAAC;QAxBH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oCAAA;QAyB1B,+BAAC;IAAD,CAxBA,AAwBC,CAxB6C,uBAAY,GAwBzD;IAxBY,gCAAwB,2BAwBpC,CAAA","file":"draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/dropzone.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var DropzoneCustomAttribute = (function (_super) { 18 | __extends(DropzoneCustomAttribute, _super); 19 | function DropzoneCustomAttribute() { 20 | _super.apply(this, arguments); 21 | this.defaults = { 22 | accept: '.draggable', 23 | overlap: .5, 24 | }; 25 | } 26 | DropzoneCustomAttribute.prototype.bind = function () { 27 | var _this = this; 28 | this.unsetInteractJs(); 29 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 30 | .dropzone(this.getActionOptions(this.defaults)) 31 | .on('dropactivate', function (event) { return event.target.classList.add('can--drop'); }) 32 | .on('dragenter', function (event) { 33 | var draggableElement = event.relatedTarget, dropzoneElement = event.target; 34 | dropzoneElement.classList.add('can--catch'); 35 | draggableElement.classList.add('drop--me'); 36 | }) 37 | .on('dragleave', function (event) { 38 | event.target.classList.remove('can--catch', 'caught--it'); 39 | event.relatedTarget.classList.remove('drop--me'); 40 | }) 41 | .on('drop', function (event) { 42 | if (typeof (event.relatedTarget.au.draggable.viewModel) === 'object' && 43 | typeof (event.relatedTarget.au.draggable.viewModel.value) === 'object') { 44 | _this.element.dispatchEvent(new CustomEvent('drop', { 45 | bubbles: true, 46 | detail: event.relatedTarget.au.draggable.viewModel.value, 47 | })); 48 | } 49 | event.target.classList.add('caught--it'); 50 | }) 51 | .on('dropdeactivate', function (event) { 52 | event.target.classList.remove('can--drop'); 53 | event.target.classList.remove('can--catch'); 54 | }); 55 | }; 56 | DropzoneCustomAttribute = __decorate([ 57 | aurelia_framework_1.inject(Element, Interact), 58 | __metadata('design:paramtypes', []) 59 | ], DropzoneCustomAttribute); 60 | return DropzoneCustomAttribute; 61 | }(interact_base_1.default)); 62 | exports.DropzoneCustomAttribute = DropzoneCustomAttribute; 63 | }); 64 | 65 | //# sourceMappingURL=dropzone.js.map 66 | -------------------------------------------------------------------------------- /dist/amd/dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA6C,2CAAY;QAAzD;YAA6C,8BAAY;YAK/C,aAAQ,GAAG;gBACjB,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,EAAE;aACZ,CAAC;QAsCJ,CAAC;QApCQ,sCAAI,GAAX;YAAA,iBAmCC;YAlCC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC9C,EAAE,CAAC,cAAc,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,EAAvC,CAAuC,CAAC;iBACpE,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBAEpB,IAAI,gBAAgB,GAAG,KAAK,CAAC,aAAa,EACtC,eAAe,GAAI,KAAK,CAAC,MAAM,CAAC;gBAEpC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAC5C,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE7C,CAAC,CAAC;iBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;gBAC1D,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACnD,CAAC,CAAC;iBACD,EAAE,CAAC,MAAM,EAAE,UAAA,KAAK;gBACb,EAAE,CAAC,CAAC,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,QAAQ;oBACnE,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;oBAEtE,KAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,MAAM,EAAE;wBACtB,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK;qBACzD,CAAC,CACH,CAAC;gBACJ,CAAC;gBACH,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC3C,CAAC,CAAC;iBACD,EAAE,CAAC,gBAAgB,EAAE,UAAA,KAAK;gBACzB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBAC3C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACP,CAAC;QA9CH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;mCAAA;QA+C1B,8BAAC;IAAD,CA9CA,AA8CC,CA9C4C,uBAAY,GA8CxD;IA9CY,+BAAuB,0BA8CnC,CAAA","file":"dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/index.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", './draggable', './dropzone', './interact-draggable', './interact-dropzone', './interact-gesturable', './interact-resizable', './resizable', 'interact'], function (require, exports, draggable_1, dropzone_1, interact_draggable_1, interact_dropzone_1, interact_gesturable_1, interact_resizable_1, resizable_1, Interact) { 2 | "use strict"; 3 | function __export(m) { 4 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 5 | } 6 | __export(draggable_1); 7 | __export(dropzone_1); 8 | __export(interact_draggable_1); 9 | __export(interact_dropzone_1); 10 | __export(interact_gesturable_1); 11 | __export(interact_resizable_1); 12 | __export(resizable_1); 13 | function configure(aurelia, options) { 14 | aurelia.container.registerInstance(Interact, Interact); 15 | var attributes = [ 16 | './interact-draggable', 17 | './interact-dropzone', 18 | './interact-gesturable', 19 | './interact-resizable', 20 | './resizable', 21 | ]; 22 | if (options && options.enableDragDropAttributes === true) { 23 | attributes.push('./draggable'); 24 | attributes.push('./dropzone'); 25 | } 26 | aurelia.globalResources(attributes); 27 | } 28 | exports.configure = configure; 29 | }); 30 | 31 | //# sourceMappingURL=index.js.map 32 | -------------------------------------------------------------------------------- /dist/amd/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;IAAA,sBAA4B;IAC5B,qBAA2B;IAC3B,+BAAqC;IACrC,8BAAoC;IACpC,gCAAsC;IACtC,+BAAqC;IACrC,sBAA4B;IAG5B,mBAA0B,OAAO,EAAE,OAAO;QACxC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,UAAU,GAAG;YACf,sBAAsB;YACtB,qBAAqB;YACrB,uBAAuB;YACvB,sBAAsB;YACtB,aAAa;SACd,CAAC;QAEF,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC;YACzD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/B,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAhBe,iBAAS,YAgBxB,CAAA","file":"index.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/interact-base.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports"], function (require, exports) { 2 | "use strict"; 3 | var InteractBase = (function () { 4 | function InteractBase(element, interact) { 5 | this.element = element; 6 | this.interact = interact; 7 | } 8 | InteractBase.prototype.unbind = function () { 9 | this.unsetInteractJs(); 10 | }; 11 | InteractBase.prototype.unsetInteractJs = function () { 12 | if (this.interactable) { 13 | this.interactable.unset(); 14 | } 15 | }; 16 | InteractBase.prototype.dispatch = function (name, data) { 17 | this.element.dispatchEvent(new CustomEvent(name, { 18 | bubbles: true, 19 | detail: data, 20 | })); 21 | }; 22 | InteractBase.prototype.getInteractableOptions = function () { 23 | return this.hasInteractableOptionsKey() ? this.value.interactable : undefined; 24 | }; 25 | InteractBase.prototype.getActionOptions = function (defaults) { 26 | var valueIfNoInteractable = (!this.hasInteractableOptionsKey() ? this.value : undefined); 27 | var actionOptions = (this.value && this.hasActionOptionsKey()) ? this.value.action : valueIfNoInteractable; 28 | return Object.assign({}, actionOptions || (defaults || {})); 29 | }; 30 | InteractBase.prototype.hasInteractableOptionsKey = function () { 31 | return this.value && !!this.value.interactable; 32 | }; 33 | InteractBase.prototype.hasActionOptionsKey = function () { 34 | return this.value && !!this.value.action; 35 | }; 36 | return InteractBase; 37 | }()); 38 | Object.defineProperty(exports, "__esModule", { value: true }); 39 | exports.default = InteractBase; 40 | }); 41 | 42 | //# sourceMappingURL=interact-base.js.map 43 | -------------------------------------------------------------------------------- /dist/amd/interact-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-base.ts"],"names":[],"mappings":";;IAAA;QAYE,sBAAsB,OAAoB,EAAY,QAAa;YAA7C,YAAO,GAAP,OAAO,CAAa;YAAY,aAAQ,GAAR,QAAQ,CAAK;QAAI,CAAC;QAEjE,6BAAM,GAAb;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;QAES,sCAAe,GAAzB;YACE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACtB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAES,+BAAQ,GAAlB,UAAmB,IAAI,EAAE,IAAI;YAC3B,IAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,IAAI,EAAE;gBACpB,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,IAAI;aACb,CAAC,CACH,CAAC;QACJ,CAAC;QAES,6CAAsB,GAAhC;YACE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;QAChF,CAAC;QAES,uCAAgB,GAA1B,UAA2B,QAAc;YAEvC,IAAI,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;YACzF,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC;YAC3G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;QAEO,gDAAyB,GAAjC;YACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACjD,CAAC;QAEO,0CAAmB,GAA3B;YACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3C,CAAC;QACH,mBAAC;IAAD,CAnDA,AAmDC,IAAA;IAnDD;kCAmDC,CAAA","file":"interact-base.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/interact-draggable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractDraggableCustomAttribute = (function (_super) { 18 | __extends(InteractDraggableCustomAttribute, _super); 19 | function InteractDraggableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractDraggableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .draggable(this.getActionOptions()) 27 | .on('dragstart', function (event) { return _this.dispatch('interact-dragstart', event); }) 28 | .on('dragmove', function (event) { return _this.dispatch('interact-dragmove', event); }) 29 | .on('draginertiastart', function (event) { return _this.dispatch('interact-draginertiastart', event); }) 30 | .on('dragend', function (event) { return _this.dispatch('interact-dragend', event); }); 31 | }; 32 | InteractDraggableCustomAttribute = __decorate([ 33 | aurelia_framework_1.inject(Element, Interact), 34 | __metadata('design:paramtypes', []) 35 | ], InteractDraggableCustomAttribute); 36 | return InteractDraggableCustomAttribute; 37 | }(interact_base_1.default)); 38 | exports.InteractDraggableCustomAttribute = InteractDraggableCustomAttribute; 39 | }); 40 | 41 | //# sourceMappingURL=interact-draggable.js.map 42 | -------------------------------------------------------------------------------- /dist/amd/interact-draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAsD,oDAAY;QAAlE;YAAsD,8BAAY;QAWlE,CAAC;QATQ,+CAAI,GAAX;YAAA,iBAQC;YAPC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAClC,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,UAAU,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAzC,CAAyC,CAAC;iBACpE,EAAE,CAAC,kBAAkB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,2BAA2B,EAAE,KAAK,CAAC,EAAjD,CAAiD,CAAC;iBACpF,EAAE,CAAC,SAAS,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAxC,CAAwC,CAAC,CAAC;QACxE,CAAC;QAXH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;QAY1B,uCAAC;IAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;IAXY,wCAAgC,mCAW5C,CAAA","file":"interact-draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/interact-dropzone.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractDropzoneCustomAttribute = (function (_super) { 18 | __extends(InteractDropzoneCustomAttribute, _super); 19 | function InteractDropzoneCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractDropzoneCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .dropzone(this.getActionOptions()) 27 | .on('dropactivate', function (event) { return _this.dispatch('interact-dropactivate', event); }) 28 | .on('dragenter', function (event) { return _this.dispatch('interact-dragenter', event); }) 29 | .on('dragleave', function (event) { return _this.dispatch('interact-dragleave', event); }) 30 | .on('drop', function (event) { return _this.dispatch('interact-drop', event); }) 31 | .on('dropdeactivate', function (event) { return _this.dispatch('interact-dropdeactivate', event); }); 32 | }; 33 | InteractDropzoneCustomAttribute = __decorate([ 34 | aurelia_framework_1.inject(Element, Interact), 35 | __metadata('design:paramtypes', []) 36 | ], InteractDropzoneCustomAttribute); 37 | return InteractDropzoneCustomAttribute; 38 | }(interact_base_1.default)); 39 | exports.InteractDropzoneCustomAttribute = InteractDropzoneCustomAttribute; 40 | }); 41 | 42 | //# sourceMappingURL=interact-dropzone.js.map 43 | -------------------------------------------------------------------------------- /dist/amd/interact-dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAqD,mDAAY;QAAjE;YAAqD,8BAAY;QAYjE,CAAC;QAVQ,8CAAI,GAAX;YAAA,iBASC;YARC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;iBAC5E,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,EAArC,CAAqC,CAAC;iBAC5D,EAAE,CAAC,gBAAgB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,EAA/C,CAA+C,CAAC,CAAC;QACtF,CAAC;QAZH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;2CAAA;QAa1B,sCAAC;IAAD,CAZA,AAYC,CAZoD,uBAAY,GAYhE;IAZY,uCAA+B,kCAY3C,CAAA","file":"interact-dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/interact-gesturable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractGesturableCustomAttribute = (function (_super) { 18 | __extends(InteractGesturableCustomAttribute, _super); 19 | function InteractGesturableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractGesturableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .dropzone(this.getActionOptions()) 27 | .on('gesturestart', function (event) { return _this.dispatch('interact-gesturestart', event); }) 28 | .on('gesturemove', function (event) { return _this.dispatch('interact-gesturemove', event); }) 29 | .on('gestureend', function (event) { return _this.dispatch('interact-gestureend', event); }); 30 | }; 31 | InteractGesturableCustomAttribute = __decorate([ 32 | aurelia_framework_1.inject(Element, Interact), 33 | __metadata('design:paramtypes', []) 34 | ], InteractGesturableCustomAttribute); 35 | return InteractGesturableCustomAttribute; 36 | }(interact_base_1.default)); 37 | exports.InteractGesturableCustomAttribute = InteractGesturableCustomAttribute; 38 | }); 39 | 40 | //# sourceMappingURL=interact-gesturable.js.map 41 | -------------------------------------------------------------------------------- /dist/amd/interact-gesturable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-gesturable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAuD,qDAAY;QAAnE;YAAuD,8BAAY;QAUnE,CAAC;QARQ,gDAAI,GAAX;YAAA,iBAOC;YANC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;iBAC5E,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;iBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAAC;QAC9E,CAAC;QAVH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;6CAAA;QAW1B,wCAAC;IAAD,CAVA,AAUC,CAVsD,uBAAY,GAUlE;IAVY,yCAAiC,oCAU7C,CAAA","file":"interact-gesturable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/interact-resizable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractResizableCustomAttribute = (function (_super) { 18 | __extends(InteractResizableCustomAttribute, _super); 19 | function InteractResizableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractResizableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .resizable(this.getActionOptions()) 27 | .on('resizestart', function (event) { return _this.dispatch('interact-resizestart', event); }) 28 | .on('resizemove', function (event) { return _this.dispatch('interact-resizemove', event); }) 29 | .on('resizeinertiastart', function (event) { return _this.dispatch('interact-resizeinertiastart', event); }) 30 | .on('resizeend', function (event) { return _this.dispatch('interact-resizeend', event); }); 31 | }; 32 | InteractResizableCustomAttribute = __decorate([ 33 | aurelia_framework_1.inject(Element, Interact), 34 | __metadata('design:paramtypes', []) 35 | ], InteractResizableCustomAttribute); 36 | return InteractResizableCustomAttribute; 37 | }(interact_base_1.default)); 38 | exports.InteractResizableCustomAttribute = InteractResizableCustomAttribute; 39 | }); 40 | 41 | //# sourceMappingURL=interact-resizable.js.map 42 | -------------------------------------------------------------------------------- /dist/amd/interact-resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAsD,oDAAY;QAAlE;YAAsD,8BAAY;QAWlE,CAAC;QATQ,+CAAI,GAAX;YAAA,iBAQC;YAPC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAClC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;iBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC;iBACxE,EAAE,CAAC,oBAAoB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE,KAAK,CAAC,EAAnD,CAAmD,CAAC;iBACxF,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC,CAAC;QAC5E,CAAC;QAXH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;QAY1B,uCAAC;IAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;IAXY,wCAAgC,mCAW5C,CAAA","file":"interact-resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/amd/resizable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var ResizableCustomAttribute = (function (_super) { 18 | __extends(ResizableCustomAttribute, _super); 19 | function ResizableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | this.defaults = { 22 | edges: { 23 | bottom: true, 24 | left: true, 25 | right: true, 26 | top: true, 27 | }, 28 | }; 29 | } 30 | ResizableCustomAttribute.prototype.bind = function () { 31 | this.unsetInteractJs(); 32 | this.element.classList.add('resizable'); 33 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 34 | .resizable(this.getActionOptions(this.defaults)) 35 | .on('resizemove', function (event) { 36 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0), y = (parseFloat(target.getAttribute('data-y')) || 0); 37 | target.style.width = event.rect.width + 'px'; 38 | target.style.height = event.rect.height + 'px'; 39 | x += event.deltaRect.left; 40 | y += event.deltaRect.top; 41 | target.style.webkitTransform = target.style.transform = 42 | 'translate(' + x + 'px,' + y + 'px)'; 43 | target.setAttribute('data-x', x); 44 | target.setAttribute('data-y', y); 45 | target.classList.add('getting--resized'); 46 | }) 47 | .on('resizeend', function (event) { 48 | event.target.classList.remove('getting--resized'); 49 | }); 50 | }; 51 | ResizableCustomAttribute = __decorate([ 52 | aurelia_framework_1.inject(Element, Interact), 53 | __metadata('design:paramtypes', []) 54 | ], ResizableCustomAttribute); 55 | return ResizableCustomAttribute; 56 | }(interact_base_1.default)); 57 | exports.ResizableCustomAttribute = ResizableCustomAttribute; 58 | }); 59 | 60 | //# sourceMappingURL=resizable.js.map 61 | -------------------------------------------------------------------------------- /dist/amd/resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA8C,4CAAY;QAA1D;YAA8C,8BAAY;YAKhD,aAAQ,GAAyB;gBACvC,KAAK,EAAE;oBACL,MAAM,EAAE,IAAI;oBACZ,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,GAAG,EAAE,IAAI;iBACV;aACF,CAAC;QAgCJ,CAAC;QA9BQ,uCAAI,GAAX;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC7C,EAAE,CAAC,YAAY,EAAE,UAAA,KAAK;gBACrB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EACpD,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBAGvD,MAAM,CAAC,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAC9C,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBAG/C,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC1B,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;gBAEzB,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS;oBACnD,YAAY,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;gBAEvC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC3C,CAAC,CAAC;iBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACT,CAAC;QA5CH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oCAAA;QA6C1B,+BAAC;IAAD,CA5CA,AA4CC,CA5C6C,uBAAY,GA4CzD;IA5CY,gCAAwB,2BA4CpC,CAAA","file":"resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/draggable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var DraggableCustomAttribute = (function (_super) { 20 | __extends(DraggableCustomAttribute, _super); 21 | function DraggableCustomAttribute() { 22 | _super.apply(this, arguments); 23 | } 24 | DraggableCustomAttribute.prototype.bind = function () { 25 | this.unsetInteractJs(); 26 | this.element.classList.add('draggable'); 27 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 28 | .draggable(this.getActionOptions()) 29 | .on('dragmove', function (event) { 30 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; 31 | target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; 32 | target.setAttribute('data-x', x); 33 | target.setAttribute('data-y', y); 34 | target.classList.add('getting--dragged'); 35 | }) 36 | .on('dragend', function (event) { 37 | event.target.style.transform = 'none'; 38 | event.target.removeAttribute('data-x'); 39 | event.target.removeAttribute('data-y'); 40 | event.target.classList.remove('getting--dragged'); 41 | }); 42 | }; 43 | DraggableCustomAttribute = __decorate([ 44 | aurelia_framework_1.inject(Element, Interact), 45 | __metadata('design:paramtypes', []) 46 | ], DraggableCustomAttribute); 47 | return DraggableCustomAttribute; 48 | }(interact_base_1.default)); 49 | exports.DraggableCustomAttribute = DraggableCustomAttribute; 50 | 51 | //# sourceMappingURL=draggable.js.map 52 | -------------------------------------------------------------------------------- /dist/commonjs/draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAA8C,4CAAY;IAA1D;QAA8C,8BAAY;IAwB1D,CAAC;IAvBQ,uCAAI,GAAX;QACE,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aAChC,EAAE,CAAC,UAAU,EAAE,UAAA,KAAK;YACnB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAC/D,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;YAEhE,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;YAC/D,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC7C,CAAC,CAAC;aACD,EAAE,CAAC,SAAS,EAAE,UAAA,KAAK;YAClB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;YACtC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACvC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACvC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACT,CAAC;IAxBH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;gCAAA;IAyB1B,+BAAC;AAAD,CAxBA,AAwBC,CAxB6C,uBAAY,GAwBzD;AAxBY,gCAAwB,2BAwBpC,CAAA","file":"draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/dropzone.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var DropzoneCustomAttribute = (function (_super) { 20 | __extends(DropzoneCustomAttribute, _super); 21 | function DropzoneCustomAttribute() { 22 | _super.apply(this, arguments); 23 | this.defaults = { 24 | accept: '.draggable', 25 | overlap: .5, 26 | }; 27 | } 28 | DropzoneCustomAttribute.prototype.bind = function () { 29 | var _this = this; 30 | this.unsetInteractJs(); 31 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 32 | .dropzone(this.getActionOptions(this.defaults)) 33 | .on('dropactivate', function (event) { return event.target.classList.add('can--drop'); }) 34 | .on('dragenter', function (event) { 35 | var draggableElement = event.relatedTarget, dropzoneElement = event.target; 36 | dropzoneElement.classList.add('can--catch'); 37 | draggableElement.classList.add('drop--me'); 38 | }) 39 | .on('dragleave', function (event) { 40 | event.target.classList.remove('can--catch', 'caught--it'); 41 | event.relatedTarget.classList.remove('drop--me'); 42 | }) 43 | .on('drop', function (event) { 44 | if (typeof (event.relatedTarget.au.draggable.viewModel) === 'object' && 45 | typeof (event.relatedTarget.au.draggable.viewModel.value) === 'object') { 46 | _this.element.dispatchEvent(new CustomEvent('drop', { 47 | bubbles: true, 48 | detail: event.relatedTarget.au.draggable.viewModel.value, 49 | })); 50 | } 51 | event.target.classList.add('caught--it'); 52 | }) 53 | .on('dropdeactivate', function (event) { 54 | event.target.classList.remove('can--drop'); 55 | event.target.classList.remove('can--catch'); 56 | }); 57 | }; 58 | DropzoneCustomAttribute = __decorate([ 59 | aurelia_framework_1.inject(Element, Interact), 60 | __metadata('design:paramtypes', []) 61 | ], DropzoneCustomAttribute); 62 | return DropzoneCustomAttribute; 63 | }(interact_base_1.default)); 64 | exports.DropzoneCustomAttribute = DropzoneCustomAttribute; 65 | 66 | //# sourceMappingURL=dropzone.js.map 67 | -------------------------------------------------------------------------------- /dist/commonjs/dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAA6C,2CAAY;IAAzD;QAA6C,8BAAY;QAK/C,aAAQ,GAAG;YACjB,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,EAAE;SACZ,CAAC;IAsCJ,CAAC;IApCQ,sCAAI,GAAX;QAAA,iBAmCC;QAlCC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC9C,EAAE,CAAC,cAAc,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,EAAvC,CAAuC,CAAC;aACpE,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;YAEpB,IAAI,gBAAgB,GAAG,KAAK,CAAC,aAAa,EACtC,eAAe,GAAI,KAAK,CAAC,MAAM,CAAC;YAEpC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC5C,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE7C,CAAC,CAAC;aACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;YACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAC1D,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACnD,CAAC,CAAC;aACD,EAAE,CAAC,MAAM,EAAE,UAAA,KAAK;YACb,EAAE,CAAC,CAAC,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,QAAQ;gBACnE,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAEtE,KAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,MAAM,EAAE;oBACtB,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK;iBACzD,CAAC,CACH,CAAC;YACJ,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,EAAE,CAAC,gBAAgB,EAAE,UAAA,KAAK;YACzB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC3C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACP,CAAC;IA9CH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;+BAAA;IA+C1B,8BAAC;AAAD,CA9CA,AA8CC,CA9C4C,uBAAY,GA8CxD;AA9CY,+BAAuB,0BA8CnC,CAAA","file":"dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | __export(require('./draggable')); 6 | __export(require('./dropzone')); 7 | __export(require('./interact-draggable')); 8 | __export(require('./interact-dropzone')); 9 | __export(require('./interact-gesturable')); 10 | __export(require('./interact-resizable')); 11 | __export(require('./resizable')); 12 | var Interact = require('interact'); 13 | function configure(aurelia, options) { 14 | aurelia.container.registerInstance(Interact, Interact); 15 | var attributes = [ 16 | './interact-draggable', 17 | './interact-dropzone', 18 | './interact-gesturable', 19 | './interact-resizable', 20 | './resizable', 21 | ]; 22 | if (options && options.enableDragDropAttributes === true) { 23 | attributes.push('./draggable'); 24 | attributes.push('./dropzone'); 25 | } 26 | aurelia.globalResources(attributes); 27 | } 28 | exports.configure = configure; 29 | 30 | //# sourceMappingURL=index.js.map 31 | -------------------------------------------------------------------------------- /dist/commonjs/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;AAAA,iBAAc,aAAa,CAAC,EAAA;AAC5B,iBAAc,YAAY,CAAC,EAAA;AAC3B,iBAAc,sBAAsB,CAAC,EAAA;AACrC,iBAAc,qBAAqB,CAAC,EAAA;AACpC,iBAAc,uBAAuB,CAAC,EAAA;AACtC,iBAAc,sBAAsB,CAAC,EAAA;AACrC,iBAAc,aAAa,CAAC,EAAA;AAC5B,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AAErC,mBAA0B,OAAO,EAAE,OAAO;IACxC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvD,IAAI,UAAU,GAAG;QACf,sBAAsB;QACtB,qBAAqB;QACrB,uBAAuB;QACvB,sBAAsB;QACtB,aAAa;KACd,CAAC;IAEF,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC;QACzD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC/B,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAhBe,iBAAS,YAgBxB,CAAA","file":"index.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/interact-base.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var InteractBase = (function () { 3 | function InteractBase(element, interact) { 4 | this.element = element; 5 | this.interact = interact; 6 | } 7 | InteractBase.prototype.unbind = function () { 8 | this.unsetInteractJs(); 9 | }; 10 | InteractBase.prototype.unsetInteractJs = function () { 11 | if (this.interactable) { 12 | this.interactable.unset(); 13 | } 14 | }; 15 | InteractBase.prototype.dispatch = function (name, data) { 16 | this.element.dispatchEvent(new CustomEvent(name, { 17 | bubbles: true, 18 | detail: data, 19 | })); 20 | }; 21 | InteractBase.prototype.getInteractableOptions = function () { 22 | return this.hasInteractableOptionsKey() ? this.value.interactable : undefined; 23 | }; 24 | InteractBase.prototype.getActionOptions = function (defaults) { 25 | var valueIfNoInteractable = (!this.hasInteractableOptionsKey() ? this.value : undefined); 26 | var actionOptions = (this.value && this.hasActionOptionsKey()) ? this.value.action : valueIfNoInteractable; 27 | return Object.assign({}, actionOptions || (defaults || {})); 28 | }; 29 | InteractBase.prototype.hasInteractableOptionsKey = function () { 30 | return this.value && !!this.value.interactable; 31 | }; 32 | InteractBase.prototype.hasActionOptionsKey = function () { 33 | return this.value && !!this.value.action; 34 | }; 35 | return InteractBase; 36 | }()); 37 | Object.defineProperty(exports, "__esModule", { value: true }); 38 | exports.default = InteractBase; 39 | 40 | //# sourceMappingURL=interact-base.js.map 41 | -------------------------------------------------------------------------------- /dist/commonjs/interact-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-base.ts"],"names":[],"mappings":";AAAA;IAYE,sBAAsB,OAAoB,EAAY,QAAa;QAA7C,YAAO,GAAP,OAAO,CAAa;QAAY,aAAQ,GAAR,QAAQ,CAAK;IAAI,CAAC;IAEjE,6BAAM,GAAb;QACE,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAES,sCAAe,GAAzB;QACE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAES,+BAAQ,GAAlB,UAAmB,IAAI,EAAE,IAAI;QAC3B,IAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,IAAI,EAAE;YACpB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI;SACb,CAAC,CACH,CAAC;IACJ,CAAC;IAES,6CAAsB,GAAhC;QACE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;IAChF,CAAC;IAES,uCAAgB,GAA1B,UAA2B,QAAc;QAEvC,IAAI,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;QACzF,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC;QAC3G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IAEO,gDAAyB,GAAjC;QACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;IACjD,CAAC;IAEO,0CAAmB,GAA3B;QACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3C,CAAC;IACH,mBAAC;AAAD,CAnDA,AAmDC,IAAA;AAnDD;8BAmDC,CAAA","file":"interact-base.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/interact-draggable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var InteractDraggableCustomAttribute = (function (_super) { 20 | __extends(InteractDraggableCustomAttribute, _super); 21 | function InteractDraggableCustomAttribute() { 22 | _super.apply(this, arguments); 23 | } 24 | InteractDraggableCustomAttribute.prototype.bind = function () { 25 | var _this = this; 26 | this.unsetInteractJs(); 27 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 28 | .draggable(this.getActionOptions()) 29 | .on('dragstart', function (event) { return _this.dispatch('interact-dragstart', event); }) 30 | .on('dragmove', function (event) { return _this.dispatch('interact-dragmove', event); }) 31 | .on('draginertiastart', function (event) { return _this.dispatch('interact-draginertiastart', event); }) 32 | .on('dragend', function (event) { return _this.dispatch('interact-dragend', event); }); 33 | }; 34 | InteractDraggableCustomAttribute = __decorate([ 35 | aurelia_framework_1.inject(Element, Interact), 36 | __metadata('design:paramtypes', []) 37 | ], InteractDraggableCustomAttribute); 38 | return InteractDraggableCustomAttribute; 39 | }(interact_base_1.default)); 40 | exports.InteractDraggableCustomAttribute = InteractDraggableCustomAttribute; 41 | 42 | //# sourceMappingURL=interact-draggable.js.map 43 | -------------------------------------------------------------------------------- /dist/commonjs/interact-draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAAsD,oDAAY;IAAlE;QAAsD,8BAAY;IAWlE,CAAC;IATQ,+CAAI,GAAX;QAAA,iBAQC;QAPC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aAClC,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;aACtE,EAAE,CAAC,UAAU,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAzC,CAAyC,CAAC;aACpE,EAAE,CAAC,kBAAkB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,2BAA2B,EAAE,KAAK,CAAC,EAAjD,CAAiD,CAAC;aACpF,EAAE,CAAC,SAAS,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAxC,CAAwC,CAAC,CAAC;IACxE,CAAC;IAXH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;wCAAA;IAY1B,uCAAC;AAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;AAXY,wCAAgC,mCAW5C,CAAA","file":"interact-draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/interact-dropzone.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var InteractDropzoneCustomAttribute = (function (_super) { 20 | __extends(InteractDropzoneCustomAttribute, _super); 21 | function InteractDropzoneCustomAttribute() { 22 | _super.apply(this, arguments); 23 | } 24 | InteractDropzoneCustomAttribute.prototype.bind = function () { 25 | var _this = this; 26 | this.unsetInteractJs(); 27 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 28 | .dropzone(this.getActionOptions()) 29 | .on('dropactivate', function (event) { return _this.dispatch('interact-dropactivate', event); }) 30 | .on('dragenter', function (event) { return _this.dispatch('interact-dragenter', event); }) 31 | .on('dragleave', function (event) { return _this.dispatch('interact-dragleave', event); }) 32 | .on('drop', function (event) { return _this.dispatch('interact-drop', event); }) 33 | .on('dropdeactivate', function (event) { return _this.dispatch('interact-dropdeactivate', event); }); 34 | }; 35 | InteractDropzoneCustomAttribute = __decorate([ 36 | aurelia_framework_1.inject(Element, Interact), 37 | __metadata('design:paramtypes', []) 38 | ], InteractDropzoneCustomAttribute); 39 | return InteractDropzoneCustomAttribute; 40 | }(interact_base_1.default)); 41 | exports.InteractDropzoneCustomAttribute = InteractDropzoneCustomAttribute; 42 | 43 | //# sourceMappingURL=interact-dropzone.js.map 44 | -------------------------------------------------------------------------------- /dist/commonjs/interact-dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAAqD,mDAAY;IAAjE;QAAqD,8BAAY;IAYjE,CAAC;IAVQ,8CAAI,GAAX;QAAA,iBASC;QARC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;aAC5E,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;aACtE,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;aACtE,EAAE,CAAC,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,EAArC,CAAqC,CAAC;aAC5D,EAAE,CAAC,gBAAgB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,EAA/C,CAA+C,CAAC,CAAC;IACtF,CAAC;IAZH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;uCAAA;IAa1B,sCAAC;AAAD,CAZA,AAYC,CAZoD,uBAAY,GAYhE;AAZY,uCAA+B,kCAY3C,CAAA","file":"interact-dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/interact-gesturable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var InteractGesturableCustomAttribute = (function (_super) { 20 | __extends(InteractGesturableCustomAttribute, _super); 21 | function InteractGesturableCustomAttribute() { 22 | _super.apply(this, arguments); 23 | } 24 | InteractGesturableCustomAttribute.prototype.bind = function () { 25 | var _this = this; 26 | this.unsetInteractJs(); 27 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 28 | .dropzone(this.getActionOptions()) 29 | .on('gesturestart', function (event) { return _this.dispatch('interact-gesturestart', event); }) 30 | .on('gesturemove', function (event) { return _this.dispatch('interact-gesturemove', event); }) 31 | .on('gestureend', function (event) { return _this.dispatch('interact-gestureend', event); }); 32 | }; 33 | InteractGesturableCustomAttribute = __decorate([ 34 | aurelia_framework_1.inject(Element, Interact), 35 | __metadata('design:paramtypes', []) 36 | ], InteractGesturableCustomAttribute); 37 | return InteractGesturableCustomAttribute; 38 | }(interact_base_1.default)); 39 | exports.InteractGesturableCustomAttribute = InteractGesturableCustomAttribute; 40 | 41 | //# sourceMappingURL=interact-gesturable.js.map 42 | -------------------------------------------------------------------------------- /dist/commonjs/interact-gesturable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-gesturable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAAuD,qDAAY;IAAnE;QAAuD,8BAAY;IAUnE,CAAC;IARQ,gDAAI,GAAX;QAAA,iBAOC;QANC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;aAC5E,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;aAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAAC;IAC9E,CAAC;IAVH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;yCAAA;IAW1B,wCAAC;AAAD,CAVA,AAUC,CAVsD,uBAAY,GAUlE;AAVY,yCAAiC,oCAU7C,CAAA","file":"interact-gesturable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/interact-resizable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var InteractResizableCustomAttribute = (function (_super) { 20 | __extends(InteractResizableCustomAttribute, _super); 21 | function InteractResizableCustomAttribute() { 22 | _super.apply(this, arguments); 23 | } 24 | InteractResizableCustomAttribute.prototype.bind = function () { 25 | var _this = this; 26 | this.unsetInteractJs(); 27 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 28 | .resizable(this.getActionOptions()) 29 | .on('resizestart', function (event) { return _this.dispatch('interact-resizestart', event); }) 30 | .on('resizemove', function (event) { return _this.dispatch('interact-resizemove', event); }) 31 | .on('resizeinertiastart', function (event) { return _this.dispatch('interact-resizeinertiastart', event); }) 32 | .on('resizeend', function (event) { return _this.dispatch('interact-resizeend', event); }); 33 | }; 34 | InteractResizableCustomAttribute = __decorate([ 35 | aurelia_framework_1.inject(Element, Interact), 36 | __metadata('design:paramtypes', []) 37 | ], InteractResizableCustomAttribute); 38 | return InteractResizableCustomAttribute; 39 | }(interact_base_1.default)); 40 | exports.InteractResizableCustomAttribute = InteractResizableCustomAttribute; 41 | 42 | //# sourceMappingURL=interact-resizable.js.map 43 | -------------------------------------------------------------------------------- /dist/commonjs/interact-resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAAsD,oDAAY;IAAlE;QAAsD,8BAAY;IAWlE,CAAC;IATQ,+CAAI,GAAX;QAAA,iBAQC;QAPC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aAClC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;aAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC;aACxE,EAAE,CAAC,oBAAoB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE,KAAK,CAAC,EAAnD,CAAmD,CAAC;aACxF,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC,CAAC;IAC5E,CAAC;IAXH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;wCAAA;IAY1B,uCAAC;AAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;AAXY,wCAAgC,mCAW5C,CAAA","file":"interact-resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/commonjs/resizable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __extends = (this && this.__extends) || function (d, b) { 3 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 4 | function __() { this.constructor = d; } 5 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6 | }; 7 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 8 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 9 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 10 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 11 | return c > 3 && r && Object.defineProperty(target, key, r), r; 12 | }; 13 | var __metadata = (this && this.__metadata) || function (k, v) { 14 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 15 | }; 16 | var aurelia_framework_1 = require('aurelia-framework'); 17 | var Interact = require('interact'); 18 | var interact_base_1 = require('./interact-base'); 19 | var ResizableCustomAttribute = (function (_super) { 20 | __extends(ResizableCustomAttribute, _super); 21 | function ResizableCustomAttribute() { 22 | _super.apply(this, arguments); 23 | this.defaults = { 24 | edges: { 25 | bottom: true, 26 | left: true, 27 | right: true, 28 | top: true, 29 | }, 30 | }; 31 | } 32 | ResizableCustomAttribute.prototype.bind = function () { 33 | this.unsetInteractJs(); 34 | this.element.classList.add('resizable'); 35 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 36 | .resizable(this.getActionOptions(this.defaults)) 37 | .on('resizemove', function (event) { 38 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0), y = (parseFloat(target.getAttribute('data-y')) || 0); 39 | target.style.width = event.rect.width + 'px'; 40 | target.style.height = event.rect.height + 'px'; 41 | x += event.deltaRect.left; 42 | y += event.deltaRect.top; 43 | target.style.webkitTransform = target.style.transform = 44 | 'translate(' + x + 'px,' + y + 'px)'; 45 | target.setAttribute('data-x', x); 46 | target.setAttribute('data-y', y); 47 | target.classList.add('getting--resized'); 48 | }) 49 | .on('resizeend', function (event) { 50 | event.target.classList.remove('getting--resized'); 51 | }); 52 | }; 53 | ResizableCustomAttribute = __decorate([ 54 | aurelia_framework_1.inject(Element, Interact), 55 | __metadata('design:paramtypes', []) 56 | ], ResizableCustomAttribute); 57 | return ResizableCustomAttribute; 58 | }(interact_base_1.default)); 59 | exports.ResizableCustomAttribute = ResizableCustomAttribute; 60 | 61 | //# sourceMappingURL=resizable.js.map 62 | -------------------------------------------------------------------------------- /dist/commonjs/resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kCAAuB,mBAAmB,CAAC,CAAA;AAC3C,IAAY,QAAQ,WAAM,UAAU,CAAC,CAAA;AACrC,8BAAyB,iBAAiB,CAAC,CAAA;AAG3C;IAA8C,4CAAY;IAA1D;QAA8C,8BAAY;QAKhD,aAAQ,GAAyB;YACvC,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI;gBACX,GAAG,EAAE,IAAI;aACV;SACF,CAAC;IAgCJ,CAAC;IA9BQ,uCAAI,GAAX;QACE,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;aAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC7C,EAAE,CAAC,YAAY,EAAE,UAAA,KAAK;YACrB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EACpD,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAGvD,MAAM,CAAC,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAC9C,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YAG/C,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;YAEzB,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS;gBACnD,YAAY,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;YAEvC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;YACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACT,CAAC;IA5CH;QAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;gCAAA;IA6C1B,+BAAC;AAAD,CA5CA,AA4CC,CA5C6C,uBAAY,GA4CzD;AA5CY,gCAAwB,2BA4CpC,CAAA","file":"resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/draggable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var DraggableCustomAttribute = (function (_super) { 18 | __extends(DraggableCustomAttribute, _super); 19 | function DraggableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | DraggableCustomAttribute.prototype.bind = function () { 23 | this.unsetInteractJs(); 24 | this.element.classList.add('draggable'); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .draggable(this.getActionOptions()) 27 | .on('dragmove', function (event) { 28 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; 29 | target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; 30 | target.setAttribute('data-x', x); 31 | target.setAttribute('data-y', y); 32 | target.classList.add('getting--dragged'); 33 | }) 34 | .on('dragend', function (event) { 35 | event.target.style.transform = 'none'; 36 | event.target.removeAttribute('data-x'); 37 | event.target.removeAttribute('data-y'); 38 | event.target.classList.remove('getting--dragged'); 39 | }); 40 | }; 41 | DraggableCustomAttribute = __decorate([ 42 | aurelia_framework_1.inject(Element, Interact), 43 | __metadata('design:paramtypes', []) 44 | ], DraggableCustomAttribute); 45 | return DraggableCustomAttribute; 46 | }(interact_base_1.default)); 47 | exports.DraggableCustomAttribute = DraggableCustomAttribute; 48 | }); 49 | 50 | //# sourceMappingURL=draggable.js.map 51 | -------------------------------------------------------------------------------- /dist/es6/draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA8C,4CAAY;QAA1D;YAA8C,8BAAY;QAwB1D,CAAC;QAvBQ,uCAAI,GAAX;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAChC,EAAE,CAAC,UAAU,EAAE,UAAA,KAAK;gBACnB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAC/D,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;gBAEhE,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;gBAC/D,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC7C,CAAC,CAAC;iBACD,EAAE,CAAC,SAAS,EAAE,UAAA,KAAK;gBAClB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;gBACtC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;gBACvC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;gBACvC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACT,CAAC;QAxBH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oCAAA;QAyB1B,+BAAC;IAAD,CAxBA,AAwBC,CAxB6C,uBAAY,GAwBzD;IAxBY,gCAAwB,2BAwBpC,CAAA","file":"draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/dropzone.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var DropzoneCustomAttribute = (function (_super) { 18 | __extends(DropzoneCustomAttribute, _super); 19 | function DropzoneCustomAttribute() { 20 | _super.apply(this, arguments); 21 | this.defaults = { 22 | accept: '.draggable', 23 | overlap: .5, 24 | }; 25 | } 26 | DropzoneCustomAttribute.prototype.bind = function () { 27 | var _this = this; 28 | this.unsetInteractJs(); 29 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 30 | .dropzone(this.getActionOptions(this.defaults)) 31 | .on('dropactivate', function (event) { return event.target.classList.add('can--drop'); }) 32 | .on('dragenter', function (event) { 33 | var draggableElement = event.relatedTarget, dropzoneElement = event.target; 34 | dropzoneElement.classList.add('can--catch'); 35 | draggableElement.classList.add('drop--me'); 36 | }) 37 | .on('dragleave', function (event) { 38 | event.target.classList.remove('can--catch', 'caught--it'); 39 | event.relatedTarget.classList.remove('drop--me'); 40 | }) 41 | .on('drop', function (event) { 42 | if (typeof (event.relatedTarget.au.draggable.viewModel) === 'object' && 43 | typeof (event.relatedTarget.au.draggable.viewModel.value) === 'object') { 44 | _this.element.dispatchEvent(new CustomEvent('drop', { 45 | bubbles: true, 46 | detail: event.relatedTarget.au.draggable.viewModel.value, 47 | })); 48 | } 49 | event.target.classList.add('caught--it'); 50 | }) 51 | .on('dropdeactivate', function (event) { 52 | event.target.classList.remove('can--drop'); 53 | event.target.classList.remove('can--catch'); 54 | }); 55 | }; 56 | DropzoneCustomAttribute = __decorate([ 57 | aurelia_framework_1.inject(Element, Interact), 58 | __metadata('design:paramtypes', []) 59 | ], DropzoneCustomAttribute); 60 | return DropzoneCustomAttribute; 61 | }(interact_base_1.default)); 62 | exports.DropzoneCustomAttribute = DropzoneCustomAttribute; 63 | }); 64 | 65 | //# sourceMappingURL=dropzone.js.map 66 | -------------------------------------------------------------------------------- /dist/es6/dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA6C,2CAAY;QAAzD;YAA6C,8BAAY;YAK/C,aAAQ,GAAG;gBACjB,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,EAAE;aACZ,CAAC;QAsCJ,CAAC;QApCQ,sCAAI,GAAX;YAAA,iBAmCC;YAlCC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC9C,EAAE,CAAC,cAAc,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,EAAvC,CAAuC,CAAC;iBACpE,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBAEpB,IAAI,gBAAgB,GAAG,KAAK,CAAC,aAAa,EACtC,eAAe,GAAI,KAAK,CAAC,MAAM,CAAC;gBAEpC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAC5C,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE7C,CAAC,CAAC;iBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;gBAC1D,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACnD,CAAC,CAAC;iBACD,EAAE,CAAC,MAAM,EAAE,UAAA,KAAK;gBACb,EAAE,CAAC,CAAC,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,QAAQ;oBACnE,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;oBAEtE,KAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,MAAM,EAAE;wBACtB,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK;qBACzD,CAAC,CACH,CAAC;gBACJ,CAAC;gBACH,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC3C,CAAC,CAAC;iBACD,EAAE,CAAC,gBAAgB,EAAE,UAAA,KAAK;gBACzB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBAC3C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACP,CAAC;QA9CH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;mCAAA;QA+C1B,8BAAC;IAAD,CA9CA,AA8CC,CA9C4C,uBAAY,GA8CxD;IA9CY,+BAAuB,0BA8CnC,CAAA","file":"dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/index.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", './draggable', './dropzone', './interact-draggable', './interact-dropzone', './interact-gesturable', './interact-resizable', './resizable', 'interact'], function (require, exports, draggable_1, dropzone_1, interact_draggable_1, interact_dropzone_1, interact_gesturable_1, interact_resizable_1, resizable_1, Interact) { 2 | "use strict"; 3 | function __export(m) { 4 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 5 | } 6 | __export(draggable_1); 7 | __export(dropzone_1); 8 | __export(interact_draggable_1); 9 | __export(interact_dropzone_1); 10 | __export(interact_gesturable_1); 11 | __export(interact_resizable_1); 12 | __export(resizable_1); 13 | function configure(aurelia, options) { 14 | aurelia.container.registerInstance(Interact, Interact); 15 | var attributes = [ 16 | './interact-draggable', 17 | './interact-dropzone', 18 | './interact-gesturable', 19 | './interact-resizable', 20 | './resizable', 21 | ]; 22 | if (options && options.enableDragDropAttributes === true) { 23 | attributes.push('./draggable'); 24 | attributes.push('./dropzone'); 25 | } 26 | aurelia.globalResources(attributes); 27 | } 28 | exports.configure = configure; 29 | }); 30 | 31 | //# sourceMappingURL=index.js.map 32 | -------------------------------------------------------------------------------- /dist/es6/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;IAAA,sBAA4B;IAC5B,qBAA2B;IAC3B,+BAAqC;IACrC,8BAAoC;IACpC,gCAAsC;IACtC,+BAAqC;IACrC,sBAA4B;IAG5B,mBAA0B,OAAO,EAAE,OAAO;QACxC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,UAAU,GAAG;YACf,sBAAsB;YACtB,qBAAqB;YACrB,uBAAuB;YACvB,sBAAsB;YACtB,aAAa;SACd,CAAC;QAEF,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC;YACzD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/B,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAhBe,iBAAS,YAgBxB,CAAA","file":"index.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/interact-base.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports"], function (require, exports) { 2 | "use strict"; 3 | var InteractBase = (function () { 4 | function InteractBase(element, interact) { 5 | this.element = element; 6 | this.interact = interact; 7 | } 8 | InteractBase.prototype.unbind = function () { 9 | this.unsetInteractJs(); 10 | }; 11 | InteractBase.prototype.unsetInteractJs = function () { 12 | if (this.interactable) { 13 | this.interactable.unset(); 14 | } 15 | }; 16 | InteractBase.prototype.dispatch = function (name, data) { 17 | this.element.dispatchEvent(new CustomEvent(name, { 18 | bubbles: true, 19 | detail: data, 20 | })); 21 | }; 22 | InteractBase.prototype.getInteractableOptions = function () { 23 | return this.hasInteractableOptionsKey() ? this.value.interactable : undefined; 24 | }; 25 | InteractBase.prototype.getActionOptions = function (defaults) { 26 | var valueIfNoInteractable = (!this.hasInteractableOptionsKey() ? this.value : undefined); 27 | var actionOptions = (this.value && this.hasActionOptionsKey()) ? this.value.action : valueIfNoInteractable; 28 | return Object.assign({}, actionOptions || (defaults || {})); 29 | }; 30 | InteractBase.prototype.hasInteractableOptionsKey = function () { 31 | return this.value && !!this.value.interactable; 32 | }; 33 | InteractBase.prototype.hasActionOptionsKey = function () { 34 | return this.value && !!this.value.action; 35 | }; 36 | return InteractBase; 37 | }()); 38 | Object.defineProperty(exports, "__esModule", { value: true }); 39 | exports.default = InteractBase; 40 | }); 41 | 42 | //# sourceMappingURL=interact-base.js.map 43 | -------------------------------------------------------------------------------- /dist/es6/interact-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-base.ts"],"names":[],"mappings":";;IAAA;QAYE,sBAAsB,OAAoB,EAAY,QAAa;YAA7C,YAAO,GAAP,OAAO,CAAa;YAAY,aAAQ,GAAR,QAAQ,CAAK;QAAI,CAAC;QAEjE,6BAAM,GAAb;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;QAES,sCAAe,GAAzB;YACE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACtB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAES,+BAAQ,GAAlB,UAAmB,IAAI,EAAE,IAAI;YAC3B,IAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,IAAI,EAAE;gBACpB,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,IAAI;aACb,CAAC,CACH,CAAC;QACJ,CAAC;QAES,6CAAsB,GAAhC;YACE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;QAChF,CAAC;QAES,uCAAgB,GAA1B,UAA2B,QAAc;YAEvC,IAAI,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;YACzF,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC;YAC3G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;QAEO,gDAAyB,GAAjC;YACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACjD,CAAC;QAEO,0CAAmB,GAA3B;YACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3C,CAAC;QACH,mBAAC;IAAD,CAnDA,AAmDC,IAAA;IAnDD;kCAmDC,CAAA","file":"interact-base.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/interact-draggable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractDraggableCustomAttribute = (function (_super) { 18 | __extends(InteractDraggableCustomAttribute, _super); 19 | function InteractDraggableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractDraggableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .draggable(this.getActionOptions()) 27 | .on('dragstart', function (event) { return _this.dispatch('interact-dragstart', event); }) 28 | .on('dragmove', function (event) { return _this.dispatch('interact-dragmove', event); }) 29 | .on('draginertiastart', function (event) { return _this.dispatch('interact-draginertiastart', event); }) 30 | .on('dragend', function (event) { return _this.dispatch('interact-dragend', event); }); 31 | }; 32 | InteractDraggableCustomAttribute = __decorate([ 33 | aurelia_framework_1.inject(Element, Interact), 34 | __metadata('design:paramtypes', []) 35 | ], InteractDraggableCustomAttribute); 36 | return InteractDraggableCustomAttribute; 37 | }(interact_base_1.default)); 38 | exports.InteractDraggableCustomAttribute = InteractDraggableCustomAttribute; 39 | }); 40 | 41 | //# sourceMappingURL=interact-draggable.js.map 42 | -------------------------------------------------------------------------------- /dist/es6/interact-draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAsD,oDAAY;QAAlE;YAAsD,8BAAY;QAWlE,CAAC;QATQ,+CAAI,GAAX;YAAA,iBAQC;YAPC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAClC,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,UAAU,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAzC,CAAyC,CAAC;iBACpE,EAAE,CAAC,kBAAkB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,2BAA2B,EAAE,KAAK,CAAC,EAAjD,CAAiD,CAAC;iBACpF,EAAE,CAAC,SAAS,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAxC,CAAwC,CAAC,CAAC;QACxE,CAAC;QAXH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;QAY1B,uCAAC;IAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;IAXY,wCAAgC,mCAW5C,CAAA","file":"interact-draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/interact-dropzone.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractDropzoneCustomAttribute = (function (_super) { 18 | __extends(InteractDropzoneCustomAttribute, _super); 19 | function InteractDropzoneCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractDropzoneCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .dropzone(this.getActionOptions()) 27 | .on('dropactivate', function (event) { return _this.dispatch('interact-dropactivate', event); }) 28 | .on('dragenter', function (event) { return _this.dispatch('interact-dragenter', event); }) 29 | .on('dragleave', function (event) { return _this.dispatch('interact-dragleave', event); }) 30 | .on('drop', function (event) { return _this.dispatch('interact-drop', event); }) 31 | .on('dropdeactivate', function (event) { return _this.dispatch('interact-dropdeactivate', event); }); 32 | }; 33 | InteractDropzoneCustomAttribute = __decorate([ 34 | aurelia_framework_1.inject(Element, Interact), 35 | __metadata('design:paramtypes', []) 36 | ], InteractDropzoneCustomAttribute); 37 | return InteractDropzoneCustomAttribute; 38 | }(interact_base_1.default)); 39 | exports.InteractDropzoneCustomAttribute = InteractDropzoneCustomAttribute; 40 | }); 41 | 42 | //# sourceMappingURL=interact-dropzone.js.map 43 | -------------------------------------------------------------------------------- /dist/es6/interact-dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAqD,mDAAY;QAAjE;YAAqD,8BAAY;QAYjE,CAAC;QAVQ,8CAAI,GAAX;YAAA,iBASC;YARC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;iBAC5E,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;iBACtE,EAAE,CAAC,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,EAArC,CAAqC,CAAC;iBAC5D,EAAE,CAAC,gBAAgB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,EAA/C,CAA+C,CAAC,CAAC;QACtF,CAAC;QAZH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;2CAAA;QAa1B,sCAAC;IAAD,CAZA,AAYC,CAZoD,uBAAY,GAYhE;IAZY,uCAA+B,kCAY3C,CAAA","file":"interact-dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/interact-gesturable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractGesturableCustomAttribute = (function (_super) { 18 | __extends(InteractGesturableCustomAttribute, _super); 19 | function InteractGesturableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractGesturableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .dropzone(this.getActionOptions()) 27 | .on('gesturestart', function (event) { return _this.dispatch('interact-gesturestart', event); }) 28 | .on('gesturemove', function (event) { return _this.dispatch('interact-gesturemove', event); }) 29 | .on('gestureend', function (event) { return _this.dispatch('interact-gestureend', event); }); 30 | }; 31 | InteractGesturableCustomAttribute = __decorate([ 32 | aurelia_framework_1.inject(Element, Interact), 33 | __metadata('design:paramtypes', []) 34 | ], InteractGesturableCustomAttribute); 35 | return InteractGesturableCustomAttribute; 36 | }(interact_base_1.default)); 37 | exports.InteractGesturableCustomAttribute = InteractGesturableCustomAttribute; 38 | }); 39 | 40 | //# sourceMappingURL=interact-gesturable.js.map 41 | -------------------------------------------------------------------------------- /dist/es6/interact-gesturable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-gesturable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAuD,qDAAY;QAAnE;YAAuD,8BAAY;QAUnE,CAAC;QARQ,gDAAI,GAAX;YAAA,iBAOC;YANC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;iBAC5E,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;iBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAAC;QAC9E,CAAC;QAVH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;6CAAA;QAW1B,wCAAC;IAAD,CAVA,AAUC,CAVsD,uBAAY,GAUlE;IAVY,yCAAiC,oCAU7C,CAAA","file":"interact-gesturable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/interact-resizable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var InteractResizableCustomAttribute = (function (_super) { 18 | __extends(InteractResizableCustomAttribute, _super); 19 | function InteractResizableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | } 22 | InteractResizableCustomAttribute.prototype.bind = function () { 23 | var _this = this; 24 | this.unsetInteractJs(); 25 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 26 | .resizable(this.getActionOptions()) 27 | .on('resizestart', function (event) { return _this.dispatch('interact-resizestart', event); }) 28 | .on('resizemove', function (event) { return _this.dispatch('interact-resizemove', event); }) 29 | .on('resizeinertiastart', function (event) { return _this.dispatch('interact-resizeinertiastart', event); }) 30 | .on('resizeend', function (event) { return _this.dispatch('interact-resizeend', event); }); 31 | }; 32 | InteractResizableCustomAttribute = __decorate([ 33 | aurelia_framework_1.inject(Element, Interact), 34 | __metadata('design:paramtypes', []) 35 | ], InteractResizableCustomAttribute); 36 | return InteractResizableCustomAttribute; 37 | }(interact_base_1.default)); 38 | exports.InteractResizableCustomAttribute = InteractResizableCustomAttribute; 39 | }); 40 | 41 | //# sourceMappingURL=interact-resizable.js.map 42 | -------------------------------------------------------------------------------- /dist/es6/interact-resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAAsD,oDAAY;QAAlE;YAAsD,8BAAY;QAWlE,CAAC;QATQ,+CAAI,GAAX;YAAA,iBAQC;YAPC,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAClC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;iBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC;iBACxE,EAAE,CAAC,oBAAoB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE,KAAK,CAAC,EAAnD,CAAmD,CAAC;iBACxF,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC,CAAC;QAC5E,CAAC;QAXH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;QAY1B,uCAAC;IAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;IAXY,wCAAgC,mCAW5C,CAAA","file":"interact-resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/es6/resizable.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || function (d, b) { 2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 3 | function __() { this.constructor = d; } 4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 5 | }; 6 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 7 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 9 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 10 | return c > 3 && r && Object.defineProperty(target, key, r), r; 11 | }; 12 | var __metadata = (this && this.__metadata) || function (k, v) { 13 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 14 | }; 15 | define(["require", "exports", 'aurelia-framework', 'interact', './interact-base'], function (require, exports, aurelia_framework_1, Interact, interact_base_1) { 16 | "use strict"; 17 | var ResizableCustomAttribute = (function (_super) { 18 | __extends(ResizableCustomAttribute, _super); 19 | function ResizableCustomAttribute() { 20 | _super.apply(this, arguments); 21 | this.defaults = { 22 | edges: { 23 | bottom: true, 24 | left: true, 25 | right: true, 26 | top: true, 27 | }, 28 | }; 29 | } 30 | ResizableCustomAttribute.prototype.bind = function () { 31 | this.unsetInteractJs(); 32 | this.element.classList.add('resizable'); 33 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 34 | .resizable(this.getActionOptions(this.defaults)) 35 | .on('resizemove', function (event) { 36 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0), y = (parseFloat(target.getAttribute('data-y')) || 0); 37 | target.style.width = event.rect.width + 'px'; 38 | target.style.height = event.rect.height + 'px'; 39 | x += event.deltaRect.left; 40 | y += event.deltaRect.top; 41 | target.style.webkitTransform = target.style.transform = 42 | 'translate(' + x + 'px,' + y + 'px)'; 43 | target.setAttribute('data-x', x); 44 | target.setAttribute('data-y', y); 45 | target.classList.add('getting--resized'); 46 | }) 47 | .on('resizeend', function (event) { 48 | event.target.classList.remove('getting--resized'); 49 | }); 50 | }; 51 | ResizableCustomAttribute = __decorate([ 52 | aurelia_framework_1.inject(Element, Interact), 53 | __metadata('design:paramtypes', []) 54 | ], ResizableCustomAttribute); 55 | return ResizableCustomAttribute; 56 | }(interact_base_1.default)); 57 | exports.ResizableCustomAttribute = ResizableCustomAttribute; 58 | }); 59 | 60 | //# sourceMappingURL=resizable.js.map 61 | -------------------------------------------------------------------------------- /dist/es6/resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAKA;QAA8C,4CAAY;QAA1D;YAA8C,8BAAY;YAKhD,aAAQ,GAAyB;gBACvC,KAAK,EAAE;oBACL,MAAM,EAAE,IAAI;oBACZ,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,GAAG,EAAE,IAAI;iBACV;aACF,CAAC;QAgCJ,CAAC;QA9BQ,uCAAI,GAAX;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;iBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC7C,EAAE,CAAC,YAAY,EAAE,UAAA,KAAK;gBACrB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EACpD,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBAGvD,MAAM,CAAC,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAC9C,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBAG/C,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC1B,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;gBAEzB,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS;oBACnD,YAAY,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;gBAEvC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC3C,CAAC,CAAC;iBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;gBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACT,CAAC;QA5CH;YAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oCAAA;QA6C1B,+BAAC;IAAD,CA5CA,AA4CC,CA5C6C,uBAAY,GA4CzD;IA5CY,gCAAwB,2BA4CpC,CAAA","file":"resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/draggable.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var DraggableCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | DraggableCustomAttribute = (function (_super) { 33 | __extends(DraggableCustomAttribute, _super); 34 | function DraggableCustomAttribute() { 35 | _super.apply(this, arguments); 36 | } 37 | DraggableCustomAttribute.prototype.bind = function () { 38 | this.unsetInteractJs(); 39 | this.element.classList.add('draggable'); 40 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 41 | .draggable(this.getActionOptions()) 42 | .on('dragmove', function (event) { 43 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; 44 | target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; 45 | target.setAttribute('data-x', x); 46 | target.setAttribute('data-y', y); 47 | target.classList.add('getting--dragged'); 48 | }) 49 | .on('dragend', function (event) { 50 | event.target.style.transform = 'none'; 51 | event.target.removeAttribute('data-x'); 52 | event.target.removeAttribute('data-y'); 53 | event.target.classList.remove('getting--dragged'); 54 | }); 55 | }; 56 | DraggableCustomAttribute = __decorate([ 57 | aurelia_framework_1.inject(Element, Interact), 58 | __metadata('design:paramtypes', []) 59 | ], DraggableCustomAttribute); 60 | return DraggableCustomAttribute; 61 | }(interact_base_1.default)); 62 | exports_1("DraggableCustomAttribute", DraggableCustomAttribute); 63 | } 64 | } 65 | }); 66 | 67 | //# sourceMappingURL=draggable.js.map 68 | -------------------------------------------------------------------------------- /dist/system/draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAA8C,4CAAY;gBAA1D;oBAA8C,8BAAY;gBAwB1D,CAAC;gBAvBQ,uCAAI,GAAX;oBACE,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;oBACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;yBAChC,EAAE,CAAC,UAAU,EAAE,UAAA,KAAK;wBACnB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAC/D,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;wBAEhE,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;wBAC/D,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;oBAC7C,CAAC,CAAC;yBACD,EAAE,CAAC,SAAS,EAAE,UAAA,KAAK;wBAClB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;wBACtC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;wBACvC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;wBACvC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;oBACpD,CAAC,CAAC,CAAC;gBACT,CAAC;gBAxBH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;gBAyB1B,+BAAC;YAAD,CAxBA,AAwBC,CAxB6C,uBAAY,GAwBzD;YAxBD,+DAwBC,CAAA","file":"draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/dropzone.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var DropzoneCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | DropzoneCustomAttribute = (function (_super) { 33 | __extends(DropzoneCustomAttribute, _super); 34 | function DropzoneCustomAttribute() { 35 | _super.apply(this, arguments); 36 | this.defaults = { 37 | accept: '.draggable', 38 | overlap: .5, 39 | }; 40 | } 41 | DropzoneCustomAttribute.prototype.bind = function () { 42 | var _this = this; 43 | this.unsetInteractJs(); 44 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 45 | .dropzone(this.getActionOptions(this.defaults)) 46 | .on('dropactivate', function (event) { return event.target.classList.add('can--drop'); }) 47 | .on('dragenter', function (event) { 48 | var draggableElement = event.relatedTarget, dropzoneElement = event.target; 49 | dropzoneElement.classList.add('can--catch'); 50 | draggableElement.classList.add('drop--me'); 51 | }) 52 | .on('dragleave', function (event) { 53 | event.target.classList.remove('can--catch', 'caught--it'); 54 | event.relatedTarget.classList.remove('drop--me'); 55 | }) 56 | .on('drop', function (event) { 57 | if (typeof (event.relatedTarget.au.draggable.viewModel) === 'object' && 58 | typeof (event.relatedTarget.au.draggable.viewModel.value) === 'object') { 59 | _this.element.dispatchEvent(new CustomEvent('drop', { 60 | bubbles: true, 61 | detail: event.relatedTarget.au.draggable.viewModel.value, 62 | })); 63 | } 64 | event.target.classList.add('caught--it'); 65 | }) 66 | .on('dropdeactivate', function (event) { 67 | event.target.classList.remove('can--drop'); 68 | event.target.classList.remove('can--catch'); 69 | }); 70 | }; 71 | DropzoneCustomAttribute = __decorate([ 72 | aurelia_framework_1.inject(Element, Interact), 73 | __metadata('design:paramtypes', []) 74 | ], DropzoneCustomAttribute); 75 | return DropzoneCustomAttribute; 76 | }(interact_base_1.default)); 77 | exports_1("DropzoneCustomAttribute", DropzoneCustomAttribute); 78 | } 79 | } 80 | }); 81 | 82 | //# sourceMappingURL=dropzone.js.map 83 | -------------------------------------------------------------------------------- /dist/system/dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAA6C,2CAAY;gBAAzD;oBAA6C,8BAAY;oBAK/C,aAAQ,GAAG;wBACjB,MAAM,EAAE,YAAY;wBACpB,OAAO,EAAE,EAAE;qBACZ,CAAC;gBAsCJ,CAAC;gBApCQ,sCAAI,GAAX;oBAAA,iBAmCC;oBAlCC,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;yBAC9C,EAAE,CAAC,cAAc,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,EAAvC,CAAuC,CAAC;yBACpE,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;wBAEpB,IAAI,gBAAgB,GAAG,KAAK,CAAC,aAAa,EACtC,eAAe,GAAI,KAAK,CAAC,MAAM,CAAC;wBAEpC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;wBAC5C,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;oBAE7C,CAAC,CAAC;yBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;wBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;wBAC1D,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;oBACnD,CAAC,CAAC;yBACD,EAAE,CAAC,MAAM,EAAE,UAAA,KAAK;wBACb,EAAE,CAAC,CAAC,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,QAAQ;4BACnE,OAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;4BAEtE,KAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,MAAM,EAAE;gCACtB,OAAO,EAAE,IAAI;gCACb,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK;6BACzD,CAAC,CACH,CAAC;wBACJ,CAAC;wBACH,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;oBAC3C,CAAC,CAAC;yBACD,EAAE,CAAC,gBAAgB,EAAE,UAAA,KAAK;wBACzB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;wBAC3C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;oBAC9C,CAAC,CAAC,CAAC;gBACP,CAAC;gBA9CH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;2CAAA;gBA+C1B,8BAAC;YAAD,CA9CA,AA8CC,CA9C4C,uBAAY,GA8CxD;YA9CD,6DA8CC,CAAA","file":"dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/index.js: -------------------------------------------------------------------------------- 1 | System.register(['./draggable', './dropzone', './interact-draggable', './interact-dropzone', './interact-gesturable', './interact-resizable', './resizable', 'interact'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var Interact; 5 | function configure(aurelia, options) { 6 | aurelia.container.registerInstance(Interact, Interact); 7 | var attributes = [ 8 | './interact-draggable', 9 | './interact-dropzone', 10 | './interact-gesturable', 11 | './interact-resizable', 12 | './resizable', 13 | ]; 14 | if (options && options.enableDragDropAttributes === true) { 15 | attributes.push('./draggable'); 16 | attributes.push('./dropzone'); 17 | } 18 | aurelia.globalResources(attributes); 19 | } 20 | exports_1("configure", configure); 21 | var exportedNames_1 = { 22 | 'configure': true 23 | }; 24 | function exportStar_1(m) { 25 | var exports = {}; 26 | for(var n in m) { 27 | if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; 28 | } 29 | exports_1(exports); 30 | } 31 | return { 32 | setters:[ 33 | function (draggable_1_1) { 34 | exportStar_1(draggable_1_1); 35 | }, 36 | function (dropzone_1_1) { 37 | exportStar_1(dropzone_1_1); 38 | }, 39 | function (interact_draggable_1_1) { 40 | exportStar_1(interact_draggable_1_1); 41 | }, 42 | function (interact_dropzone_1_1) { 43 | exportStar_1(interact_dropzone_1_1); 44 | }, 45 | function (interact_gesturable_1_1) { 46 | exportStar_1(interact_gesturable_1_1); 47 | }, 48 | function (interact_resizable_1_1) { 49 | exportStar_1(interact_resizable_1_1); 50 | }, 51 | function (resizable_1_1) { 52 | exportStar_1(resizable_1_1); 53 | }, 54 | function (Interact_1) { 55 | Interact = Interact_1; 56 | }], 57 | execute: function() { 58 | } 59 | } 60 | }); 61 | 62 | //# sourceMappingURL=index.js.map 63 | -------------------------------------------------------------------------------- /dist/system/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;IASA,mBAA0B,OAAO,EAAE,OAAO;QACxC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,UAAU,GAAG;YACf,sBAAsB;YACtB,qBAAqB;YACrB,uBAAuB;YACvB,sBAAsB;YACtB,aAAa;SACd,CAAC;QAEF,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC;YACzD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/B,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAhBD,iCAgBC,CAAA","file":"index.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/interact-base.js: -------------------------------------------------------------------------------- 1 | System.register([], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var InteractBase; 5 | return { 6 | setters:[], 7 | execute: function() { 8 | InteractBase = (function () { 9 | function InteractBase(element, interact) { 10 | this.element = element; 11 | this.interact = interact; 12 | } 13 | InteractBase.prototype.unbind = function () { 14 | this.unsetInteractJs(); 15 | }; 16 | InteractBase.prototype.unsetInteractJs = function () { 17 | if (this.interactable) { 18 | this.interactable.unset(); 19 | } 20 | }; 21 | InteractBase.prototype.dispatch = function (name, data) { 22 | this.element.dispatchEvent(new CustomEvent(name, { 23 | bubbles: true, 24 | detail: data, 25 | })); 26 | }; 27 | InteractBase.prototype.getInteractableOptions = function () { 28 | return this.hasInteractableOptionsKey() ? this.value.interactable : undefined; 29 | }; 30 | InteractBase.prototype.getActionOptions = function (defaults) { 31 | var valueIfNoInteractable = (!this.hasInteractableOptionsKey() ? this.value : undefined); 32 | var actionOptions = (this.value && this.hasActionOptionsKey()) ? this.value.action : valueIfNoInteractable; 33 | return Object.assign({}, actionOptions || (defaults || {})); 34 | }; 35 | InteractBase.prototype.hasInteractableOptionsKey = function () { 36 | return this.value && !!this.value.interactable; 37 | }; 38 | InteractBase.prototype.hasActionOptionsKey = function () { 39 | return this.value && !!this.value.action; 40 | }; 41 | return InteractBase; 42 | }()); 43 | exports_1("default", InteractBase); 44 | } 45 | } 46 | }); 47 | 48 | //# sourceMappingURL=interact-base.js.map 49 | -------------------------------------------------------------------------------- /dist/system/interact-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-base.ts"],"names":[],"mappings":";;;;;;;YAAA;gBAYE,sBAAsB,OAAoB,EAAY,QAAa;oBAA7C,YAAO,GAAP,OAAO,CAAa;oBAAY,aAAQ,GAAR,QAAQ,CAAK;gBAAI,CAAC;gBAEjE,6BAAM,GAAb;oBACE,IAAI,CAAC,eAAe,EAAE,CAAC;gBACzB,CAAC;gBAES,sCAAe,GAAzB;oBACE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;wBACtB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;oBAC5B,CAAC;gBACH,CAAC;gBAES,+BAAQ,GAAlB,UAAmB,IAAI,EAAE,IAAI;oBAC3B,IAAI,CAAC,OAAO,CAAC,aAAa,CACxB,IAAI,WAAW,CAAC,IAAI,EAAE;wBACpB,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,IAAI;qBACb,CAAC,CACH,CAAC;gBACJ,CAAC;gBAES,6CAAsB,GAAhC;oBACE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;gBAChF,CAAC;gBAES,uCAAgB,GAA1B,UAA2B,QAAc;oBAEvC,IAAI,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;oBACzF,IAAI,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC;oBAC3G,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC9D,CAAC;gBAEO,gDAAyB,GAAjC;oBACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;gBACjD,CAAC;gBAEO,0CAAmB,GAA3B;oBACE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;gBAC3C,CAAC;gBACH,mBAAC;YAAD,CAnDA,AAmDC,IAAA;YAnDD,kCAmDC,CAAA","file":"interact-base.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/interact-draggable.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var InteractDraggableCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | InteractDraggableCustomAttribute = (function (_super) { 33 | __extends(InteractDraggableCustomAttribute, _super); 34 | function InteractDraggableCustomAttribute() { 35 | _super.apply(this, arguments); 36 | } 37 | InteractDraggableCustomAttribute.prototype.bind = function () { 38 | var _this = this; 39 | this.unsetInteractJs(); 40 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 41 | .draggable(this.getActionOptions()) 42 | .on('dragstart', function (event) { return _this.dispatch('interact-dragstart', event); }) 43 | .on('dragmove', function (event) { return _this.dispatch('interact-dragmove', event); }) 44 | .on('draginertiastart', function (event) { return _this.dispatch('interact-draginertiastart', event); }) 45 | .on('dragend', function (event) { return _this.dispatch('interact-dragend', event); }); 46 | }; 47 | InteractDraggableCustomAttribute = __decorate([ 48 | aurelia_framework_1.inject(Element, Interact), 49 | __metadata('design:paramtypes', []) 50 | ], InteractDraggableCustomAttribute); 51 | return InteractDraggableCustomAttribute; 52 | }(interact_base_1.default)); 53 | exports_1("InteractDraggableCustomAttribute", InteractDraggableCustomAttribute); 54 | } 55 | } 56 | }); 57 | 58 | //# sourceMappingURL=interact-draggable.js.map 59 | -------------------------------------------------------------------------------- /dist/system/interact-draggable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-draggable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAsD,oDAAY;gBAAlE;oBAAsD,8BAAY;gBAWlE,CAAC;gBATQ,+CAAI,GAAX;oBAAA,iBAQC;oBAPC,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;yBAClC,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;yBACtE,EAAE,CAAC,UAAU,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAzC,CAAyC,CAAC;yBACpE,EAAE,CAAC,kBAAkB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,2BAA2B,EAAE,KAAK,CAAC,EAAjD,CAAiD,CAAC;yBACpF,EAAE,CAAC,SAAS,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAxC,CAAwC,CAAC,CAAC;gBACxE,CAAC;gBAXH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oDAAA;gBAY1B,uCAAC;YAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;YAXD,+EAWC,CAAA","file":"interact-draggable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/interact-dropzone.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var InteractDropzoneCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | InteractDropzoneCustomAttribute = (function (_super) { 33 | __extends(InteractDropzoneCustomAttribute, _super); 34 | function InteractDropzoneCustomAttribute() { 35 | _super.apply(this, arguments); 36 | } 37 | InteractDropzoneCustomAttribute.prototype.bind = function () { 38 | var _this = this; 39 | this.unsetInteractJs(); 40 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 41 | .dropzone(this.getActionOptions()) 42 | .on('dropactivate', function (event) { return _this.dispatch('interact-dropactivate', event); }) 43 | .on('dragenter', function (event) { return _this.dispatch('interact-dragenter', event); }) 44 | .on('dragleave', function (event) { return _this.dispatch('interact-dragleave', event); }) 45 | .on('drop', function (event) { return _this.dispatch('interact-drop', event); }) 46 | .on('dropdeactivate', function (event) { return _this.dispatch('interact-dropdeactivate', event); }); 47 | }; 48 | InteractDropzoneCustomAttribute = __decorate([ 49 | aurelia_framework_1.inject(Element, Interact), 50 | __metadata('design:paramtypes', []) 51 | ], InteractDropzoneCustomAttribute); 52 | return InteractDropzoneCustomAttribute; 53 | }(interact_base_1.default)); 54 | exports_1("InteractDropzoneCustomAttribute", InteractDropzoneCustomAttribute); 55 | } 56 | } 57 | }); 58 | 59 | //# sourceMappingURL=interact-dropzone.js.map 60 | -------------------------------------------------------------------------------- /dist/system/interact-dropzone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-dropzone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAqD,mDAAY;gBAAjE;oBAAqD,8BAAY;gBAYjE,CAAC;gBAVQ,8CAAI,GAAX;oBAAA,iBASC;oBARC,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;yBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;yBAC5E,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;yBACtE,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC;yBACtE,EAAE,CAAC,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,EAArC,CAAqC,CAAC;yBAC5D,EAAE,CAAC,gBAAgB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,EAA/C,CAA+C,CAAC,CAAC;gBACtF,CAAC;gBAZH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;mDAAA;gBAa1B,sCAAC;YAAD,CAZA,AAYC,CAZoD,uBAAY,GAYhE;YAZD,6EAYC,CAAA","file":"interact-dropzone.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/interact-gesturable.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var InteractGesturableCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | InteractGesturableCustomAttribute = (function (_super) { 33 | __extends(InteractGesturableCustomAttribute, _super); 34 | function InteractGesturableCustomAttribute() { 35 | _super.apply(this, arguments); 36 | } 37 | InteractGesturableCustomAttribute.prototype.bind = function () { 38 | var _this = this; 39 | this.unsetInteractJs(); 40 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 41 | .dropzone(this.getActionOptions()) 42 | .on('gesturestart', function (event) { return _this.dispatch('interact-gesturestart', event); }) 43 | .on('gesturemove', function (event) { return _this.dispatch('interact-gesturemove', event); }) 44 | .on('gestureend', function (event) { return _this.dispatch('interact-gestureend', event); }); 45 | }; 46 | InteractGesturableCustomAttribute = __decorate([ 47 | aurelia_framework_1.inject(Element, Interact), 48 | __metadata('design:paramtypes', []) 49 | ], InteractGesturableCustomAttribute); 50 | return InteractGesturableCustomAttribute; 51 | }(interact_base_1.default)); 52 | exports_1("InteractGesturableCustomAttribute", InteractGesturableCustomAttribute); 53 | } 54 | } 55 | }); 56 | 57 | //# sourceMappingURL=interact-gesturable.js.map 58 | -------------------------------------------------------------------------------- /dist/system/interact-gesturable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-gesturable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAuD,qDAAY;gBAAnE;oBAAuD,8BAAY;gBAUnE,CAAC;gBARQ,gDAAI,GAAX;oBAAA,iBAOC;oBANC,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;yBACjC,EAAE,CAAC,cAAc,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAA7C,CAA6C,CAAC;yBAC5E,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;yBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAAC;gBAC9E,CAAC;gBAVH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;qDAAA;gBAW1B,wCAAC;YAAD,CAVA,AAUC,CAVsD,uBAAY,GAUlE;YAVD,iFAUC,CAAA","file":"interact-gesturable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/interact-resizable.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var InteractResizableCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | InteractResizableCustomAttribute = (function (_super) { 33 | __extends(InteractResizableCustomAttribute, _super); 34 | function InteractResizableCustomAttribute() { 35 | _super.apply(this, arguments); 36 | } 37 | InteractResizableCustomAttribute.prototype.bind = function () { 38 | var _this = this; 39 | this.unsetInteractJs(); 40 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 41 | .resizable(this.getActionOptions()) 42 | .on('resizestart', function (event) { return _this.dispatch('interact-resizestart', event); }) 43 | .on('resizemove', function (event) { return _this.dispatch('interact-resizemove', event); }) 44 | .on('resizeinertiastart', function (event) { return _this.dispatch('interact-resizeinertiastart', event); }) 45 | .on('resizeend', function (event) { return _this.dispatch('interact-resizeend', event); }); 46 | }; 47 | InteractResizableCustomAttribute = __decorate([ 48 | aurelia_framework_1.inject(Element, Interact), 49 | __metadata('design:paramtypes', []) 50 | ], InteractResizableCustomAttribute); 51 | return InteractResizableCustomAttribute; 52 | }(interact_base_1.default)); 53 | exports_1("InteractResizableCustomAttribute", InteractResizableCustomAttribute); 54 | } 55 | } 56 | }); 57 | 58 | //# sourceMappingURL=interact-resizable.js.map 59 | -------------------------------------------------------------------------------- /dist/system/interact-resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["interact-resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAsD,oDAAY;gBAAlE;oBAAsD,8BAAY;gBAWlE,CAAC;gBATQ,+CAAI,GAAX;oBAAA,iBAQC;oBAPC,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;yBAClC,EAAE,CAAC,aAAa,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC;yBAC1E,EAAE,CAAC,YAAY,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC;yBACxE,EAAE,CAAC,oBAAoB,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE,KAAK,CAAC,EAAnD,CAAmD,CAAC;yBACxF,EAAE,CAAC,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAA1C,CAA0C,CAAC,CAAC;gBAC5E,CAAC;gBAXH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;oDAAA;gBAY1B,uCAAC;YAAD,CAXA,AAWC,CAXqD,uBAAY,GAWjE;YAXD,+EAWC,CAAA","file":"interact-resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /dist/system/resizable.js: -------------------------------------------------------------------------------- 1 | System.register(['aurelia-framework', 'interact', './interact-base'], function(exports_1, context_1) { 2 | "use strict"; 3 | var __moduleName = context_1 && context_1.id; 4 | var __extends = (this && this.__extends) || function (d, b) { 5 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 6 | function __() { this.constructor = d; } 7 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8 | }; 9 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 10 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 11 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 12 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 13 | return c > 3 && r && Object.defineProperty(target, key, r), r; 14 | }; 15 | var __metadata = (this && this.__metadata) || function (k, v) { 16 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 17 | }; 18 | var aurelia_framework_1, Interact, interact_base_1; 19 | var ResizableCustomAttribute; 20 | return { 21 | setters:[ 22 | function (aurelia_framework_1_1) { 23 | aurelia_framework_1 = aurelia_framework_1_1; 24 | }, 25 | function (Interact_1) { 26 | Interact = Interact_1; 27 | }, 28 | function (interact_base_1_1) { 29 | interact_base_1 = interact_base_1_1; 30 | }], 31 | execute: function() { 32 | ResizableCustomAttribute = (function (_super) { 33 | __extends(ResizableCustomAttribute, _super); 34 | function ResizableCustomAttribute() { 35 | _super.apply(this, arguments); 36 | this.defaults = { 37 | edges: { 38 | bottom: true, 39 | left: true, 40 | right: true, 41 | top: true, 42 | }, 43 | }; 44 | } 45 | ResizableCustomAttribute.prototype.bind = function () { 46 | this.unsetInteractJs(); 47 | this.element.classList.add('resizable'); 48 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 49 | .resizable(this.getActionOptions(this.defaults)) 50 | .on('resizemove', function (event) { 51 | var target = event.target, x = (parseFloat(target.getAttribute('data-x')) || 0), y = (parseFloat(target.getAttribute('data-y')) || 0); 52 | target.style.width = event.rect.width + 'px'; 53 | target.style.height = event.rect.height + 'px'; 54 | x += event.deltaRect.left; 55 | y += event.deltaRect.top; 56 | target.style.webkitTransform = target.style.transform = 57 | 'translate(' + x + 'px,' + y + 'px)'; 58 | target.setAttribute('data-x', x); 59 | target.setAttribute('data-y', y); 60 | target.classList.add('getting--resized'); 61 | }) 62 | .on('resizeend', function (event) { 63 | event.target.classList.remove('getting--resized'); 64 | }); 65 | }; 66 | ResizableCustomAttribute = __decorate([ 67 | aurelia_framework_1.inject(Element, Interact), 68 | __metadata('design:paramtypes', []) 69 | ], ResizableCustomAttribute); 70 | return ResizableCustomAttribute; 71 | }(interact_base_1.default)); 72 | exports_1("ResizableCustomAttribute", ResizableCustomAttribute); 73 | } 74 | } 75 | }); 76 | 77 | //# sourceMappingURL=resizable.js.map 78 | -------------------------------------------------------------------------------- /dist/system/resizable.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["resizable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAA8C,4CAAY;gBAA1D;oBAA8C,8BAAY;oBAKhD,aAAQ,GAAyB;wBACvC,KAAK,EAAE;4BACL,MAAM,EAAE,IAAI;4BACZ,IAAI,EAAE,IAAI;4BACV,KAAK,EAAE,IAAI;4BACX,GAAG,EAAE,IAAI;yBACV;qBACF,CAAC;gBAgCJ,CAAC;gBA9BQ,uCAAI,GAAX;oBACE,IAAI,CAAC,eAAe,EAAE,CAAC;oBACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;oBACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;yBAC3E,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;yBAC7C,EAAE,CAAC,YAAY,EAAE,UAAA,KAAK;wBACrB,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,EACvB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EACpD,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;wBAGvD,MAAM,CAAC,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;wBAC9C,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;wBAG/C,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;wBAC1B,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;wBAEzB,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS;4BACnD,YAAY,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;wBAEvC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBAEjC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;oBAC3C,CAAC,CAAC;yBACD,EAAE,CAAC,WAAW,EAAE,UAAA,KAAK;wBACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;oBACpD,CAAC,CAAC,CAAC;gBACT,CAAC;gBA5CH;oBAAC,0BAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;;4CAAA;gBA6C1B,+BAAC;YAAD,CA5CA,AA4CC,CA5C6C,uBAAY,GA4CzD;YA5CD,+DA4CC,CAAA","file":"resizable.js","sourceRoot":"/src"} -------------------------------------------------------------------------------- /doc/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## [2.0.7](https://github.com/eriklieben/aurelia-interactjs/compare/v2.0.6...v2.0.7) (2016-12-08) 3 | 4 | 5 | 6 | 7 | ## [2.0.6](https://github.com/eriklieben/aurelia-interactjs/compare/v2.0.5...v2.0.6) (2016-12-08) 8 | 9 | 10 | 11 | 12 | ## [2.0.5](https://github.com/eriklieben/aurelia-interactjs/compare/v2.0.4...v2.0.5) (2016-12-08) 13 | 14 | 15 | 16 | 17 | ## [2.0.4](https://github.com/eriklieben/aurelia-interactjs/compare/v2.0.3...v2.0.4) (2016-12-08) 18 | 19 | 20 | 21 | 22 | ## [2.0.3](https://github.com/eriklieben/aurelia-interactjs/compare/v2.0.2...v2.0.3) (2016-12-08) 23 | 24 | 25 | 26 | 27 | ## [2.0.2](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v2.0.2) (2016-12-08) 28 | 29 | 30 | ### Bug Fixes 31 | 32 | * **interact:** import 'interact' instead of 'interact.js' and bump version ([0ad0795](https://github.com/eriklieben/aurelia-interactjs/commit/0ad0795)) 33 | * **jspm:** add interact.js with interact alias ([e4045cb](https://github.com/eriklieben/aurelia-interactjs/commit/e4045cb)) 34 | * **jspm:** disable jspm node convention ([72b66d7](https://github.com/eriklieben/aurelia-interactjs/commit/72b66d7)) 35 | * **lifecycle:** Moved from 'attached' to 'bind' for setting up the custom attribute ([#5](https://github.com/eriklieben/aurelia-interactjs/issues/5)), resolves [#4](https://github.com/eriklieben/aurelia-interactjs/issues/4) ([2d48f08](https://github.com/eriklieben/aurelia-interactjs/commit/2d48f08)) 36 | 37 | 38 | 39 | 40 | ## [2.0.1](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v2.0.1) (2016-12-05) 41 | 42 | ### Features 43 | 44 | * **BREAKING CHANGE** now using bind/unbind instead of attached to manage lifecycle of the custom attributes to support the use of templatingEngine.enhance on existing DOM elements. This will not cause the majority of people an issue but the public interface of the classes has changed. 45 | 46 | ### Bug Fixes 47 | 48 | * Unset interactJs when unbinding 49 | 50 | 51 | ## [1.0.11](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v1.0.11) (2016-10-20) 52 | 53 | 54 | ### Bug Fixes 55 | 56 | * **interact:** import 'interact' instead of 'interact.js' and bump version ([0ad0795](https://github.com/eriklieben/aurelia-interactjs/commit/0ad0795)) 57 | * **jspm:** add interact.js with interact alias ([e4045cb](https://github.com/eriklieben/aurelia-interactjs/commit/e4045cb)) 58 | * **jspm:** disable jspm node convention ([72b66d7](https://github.com/eriklieben/aurelia-interactjs/commit/72b66d7)) 59 | 60 | 61 | 62 | 63 | ## [1.0.10](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v1.0.10) (2016-10-20) 64 | 65 | 66 | ### Bug Fixes 67 | 68 | * **interact:** import 'interact' instead of 'interact.js' and bump version ([0ad0795](https://github.com/eriklieben/aurelia-interactjs/commit/0ad0795)) 69 | * **jspm:** add interact.js with interact alias ([e4045cb](https://github.com/eriklieben/aurelia-interactjs/commit/e4045cb)) 70 | * **jspm:** disable jspm node convention ([72b66d7](https://github.com/eriklieben/aurelia-interactjs/commit/72b66d7)) 71 | 72 | 73 | 74 | 75 | ## [1.0.9](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v1.0.9) (2016-10-17) 76 | 77 | 78 | ### Bug Fixes 79 | 80 | * **interact:** import 'interact' instead of 'interact.js' and bump version ([0ad0795](https://github.com/eriklieben/aurelia-interactjs/commit/0ad0795)) 81 | * **jspm:** add interact.js with interact alias ([e4045cb](https://github.com/eriklieben/aurelia-interactjs/commit/e4045cb)) 82 | * **jspm:** disable jspm node convention ([72b66d7](https://github.com/eriklieben/aurelia-interactjs/commit/72b66d7)) 83 | 84 | 85 | 86 | 87 | ## [1.0.8](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v1.0.8) (2016-10-17) 88 | 89 | 90 | ### Bug Fixes 91 | 92 | * **interact:** import 'interact' instead of 'interact.js' and bump version ([0ad0795](https://github.com/eriklieben/aurelia-interactjs/commit/0ad0795)) 93 | * **jspm:** add interact.js with interact alias ([e4045cb](https://github.com/eriklieben/aurelia-interactjs/commit/e4045cb)) 94 | 95 | 96 | 97 | 98 | ## [1.0.7](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.6...v1.0.7) (2016-10-17) 99 | 100 | 101 | 102 | 103 | ## [1.0.6](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.4...v1.0.6) (2016-09-22) 104 | 105 | 106 | ### Bug Fixes 107 | 108 | * allow dropping draggables on regular elements, not only on custom elements ([ee54e8b](https://github.com/eriklieben/aurelia-interactjs/commit/ee54e8b)) 109 | * use npm:interact.js without alias and replace custom ts typings with default DT registry ([ebc762d](https://github.com/eriklieben/aurelia-interactjs/commit/ebc762d)) 110 | 111 | 112 | 113 | 114 | ## [1.0.5](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.4...v1.0.5) (2016-09-15) 115 | 116 | 117 | ### Bug Fixes 118 | 119 | * use npm:interact.js without alias and replace custom ts typings with default DT registry ([ebc762d](https://github.com/eriklieben/aurelia-interactjs/commit/ebc762d)) 120 | 121 | 122 | 123 | 124 | ## [1.0.4](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.3...v1.0.4) (2016-09-12) 125 | 126 | 127 | ### Features 128 | 129 | * optional attribute draggable and dropzone ([dadb0c1](https://github.com/eriklieben/aurelia-interactjs/commit/dadb0c1)) 130 | 131 | 132 | 133 | 134 | ## [1.0.3](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.2...v1.0.3) (2016-09-10) 135 | 136 | 137 | 138 | 139 | ## [1.0.2](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.1...v1.0.2) (2016-09-10) 140 | 141 | 142 | 143 | 144 | ## [1.0.1](https://github.com/eriklieben/aurelia-interactjs/compare/v1.0.0...v1.0.1) (2016-09-10) 145 | 146 | 147 | ### Bug Fixes 148 | 149 | * move typescript to dev-dependencies ([5bc2399](https://github.com/eriklieben/aurelia-interactjs/commit/5bc2399)) 150 | 151 | 152 | 153 | 154 | ## 1.0.0 (2016-09-09) 155 | 156 | 157 | ### Bug Fixes 158 | 159 | * usage with jspm ([d737ac1](https://github.com/eriklieben/aurelia-interactjs/commit/d737ac1)) 160 | 161 | 162 | ### Features 163 | 164 | * enable usage with Aurelia-CLI and JSPM ([afc9fc6](https://github.com/eriklieben/aurelia-interactjs/commit/afc9fc6)) 165 | 166 | 167 | 168 | 169 | ## 0.1.1 (2016-09-09) 170 | 171 | 172 | ### Features 173 | 174 | * interact-draggable attribute ([a564dde](https://github.com/eriklieben/aurelia-interactjs/commit/a564dde)) 175 | * interact-dropzone attribute ([cf8162a](https://github.com/eriklieben/aurelia-interactjs/commit/cf8162a)) 176 | * interact-gesturable attribute ([f33889a](https://github.com/eriklieben/aurelia-interactjs/commit/f33889a)) 177 | * interact-resizable attribute ([d99fb1a](https://github.com/eriklieben/aurelia-interactjs/commit/d99fb1a)) 178 | -------------------------------------------------------------------------------- /doc/api.json: -------------------------------------------------------------------------------- 1 | {"classes":[],"methods":[],"properties":[],"events":[]} -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | // all gulp tasks are located in the ./build/tasks directory 2 | // gulp configuration is in files in ./build directory 3 | require('require-dir')('build/tasks'); 4 | -------------------------------------------------------------------------------- /install/dependencies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "interact", 4 | "path": "../node_modules/interact.js/dist", 5 | "main": "interact" 6 | }, 7 | { 8 | "name": "aurelia-interactjs", 9 | "path": "../node_modules/aurelia-interactjs/dist/amd", 10 | "main": "index" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /install/interact.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Mini cli helper for aurelia-interactjs plugin 3 | * - Configures bundle correctly 4 | * 5 | * It's pure ES6 to support Babel/Typescript projects as well 6 | * 7 | * Usage: 8 | * au interact [--bundle ] [--force] 9 | */ 10 | 11 | import * as fs from 'fs-extra'; 12 | import * as project from '../aurelia.json'; 13 | import {CLIOptions} from 'aurelia-cli'; 14 | 15 | /** 16 | * Simple wrapper for built-in CLIOptions 17 | * 18 | * @param name 19 | * @param shortcut 20 | * @returns {any|null} 21 | */ 22 | let getParam = (name, shortcut) => { 23 | if (CLIOptions.hasFlag(name, shortcut)) { 24 | return CLIOptions.getFlagValue(name, shortcut) || null; 25 | } 26 | }; 27 | 28 | /** 29 | * Gets all given options in a single array 30 | * 31 | * @return object 32 | */ 33 | let getOptions = () => { 34 | let options = {}; 35 | options.plugin = getParam('plugin', 'p') || 'aurelia-interactjs'; 36 | options.bundle = getParam('bundle', 'b'); 37 | options.force = CLIOptions.hasFlag('force', 'f'); 38 | 39 | return options; 40 | }; 41 | 42 | // collect given parameters 43 | let cliParams = getOptions(); 44 | 45 | /** 46 | * Gets pre-configured array of dependencies 47 | * 48 | * @return {Promise|Promise>} 49 | */ 50 | let getDependencies = (pluginName) => { 51 | return new Promise((resolve, reject) => { 52 | let path = `./node_modules/${pluginName}/install/dependencies.json`; 53 | fs.exists(path, exists => { 54 | if (exists !== true) { 55 | reject(`Could not open file: ${path}`); 56 | } else { 57 | fs.readJson(path, (err, contents) => { 58 | if (err) { 59 | reject(err); 60 | } else { 61 | resolve(contents); 62 | } 63 | }); 64 | } 65 | }); 66 | }); 67 | }; 68 | 69 | /** 70 | * Configures plugin dependencies 71 | * Edits aurelia.json to add pre-configured dependencies for aurelia-interactjs package 72 | * 73 | * @void 74 | */ 75 | let configure = (deps) => { 76 | let bundle = null, 77 | bundles = project.build.bundles; 78 | 79 | if (bundles.length === 0) { 80 | throw new Error("aurelia.json: bundles section is missing."); 81 | } 82 | 83 | let bundleName = cliParams.bundle || 'vendor-bundle.js'; 84 | 85 | bundle = bundles.find(item => item.name === bundleName); 86 | 87 | if (!bundle) { 88 | console.log(`[INFO] Bundle '${bundleName}' could not be found. Looking for default bundles...`); 89 | 90 | // There are 2 sections by default, second is usually the vendor-bundle.js 91 | // Although, some developers prefer to merge everything into a single bundle 92 | let index = bundles.length > 1 ? 1 : 0; 93 | bundle = bundles[index]; 94 | 95 | // this should not be reached ever, but never say never :) 96 | if (!bundle) { 97 | throw new Error('Default bundle could not be found either. Check aurelia.json configuration.'); 98 | } 99 | 100 | bundleName = bundle.name; 101 | } 102 | 103 | if (!bundle.dependencies) { 104 | bundle.dependencies = []; 105 | } 106 | 107 | console.log(`[INFO] Bundle found: ${bundle.name}. Configuring new dependencies in aurelia.json for ${bundleName}...`); 108 | for (let dep of deps) { 109 | let name = dep.name || dep, 110 | check = bundle.dependencies.find(item => (item.name || item) === name); 111 | 112 | if (!check) { 113 | console.log(`[NEW] Package '${name}' has been configured.`); 114 | bundle.dependencies.push(dep); 115 | } else { 116 | if (cliParams.force) { 117 | let i = bundle.dependencies.indexOf(check); 118 | bundle.dependencies[i] = dep; 119 | console.log(`[MOD] Package '${name}' has been configured.`); 120 | } else { 121 | console.log(`[SKIP] Package '${name}' has already been configured.`); 122 | } 123 | } 124 | } 125 | 126 | console.log('[INFO] Saving changes to aurelia.json file...'); 127 | let aureliaProjectFile = 'aurelia_project/aurelia.json'; 128 | 129 | fs.copy(aureliaProjectFile, aureliaProjectFile + '.bak', function (err) { 130 | if (err) { 131 | console.log('[ERROR] An error occurred while duplicating aurelia.json.', err); 132 | } else { 133 | console.log('[INFO] Backup of aurelia.json has been created.'); 134 | fs.writeJson(aureliaProjectFile, project, (err) => { 135 | if (err) { 136 | console.log('[ERROR] An error occurred while updating aurelia.json.', err); 137 | } else { 138 | console.log('[OK] aurelia.json has been updated.'); 139 | console.log(`\n\n[OK] aurelia-interactjs has been configured successfully.`); 140 | } 141 | }); 142 | } 143 | }); 144 | }; 145 | 146 | /** 147 | * Execute 148 | */ 149 | export default () => { 150 | return getDependencies(cliParams.plugin) 151 | .then(deps => { 152 | configure(deps); 153 | }) 154 | .catch(err => { throw new Error(err); }); 155 | }; 156 | -------------------------------------------------------------------------------- /install/interact.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "interact", 3 | "description": "Configurator for aurelia-interactjs plugin. It helps you to configure bundle dependencies.", 4 | "flags": [ 5 | { 6 | "name": "bundle", 7 | "description": "Sets bundle section to be modified", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "force", 12 | "description": "Overwrite previously set dependencies. This applies to dependencies of aurelia-interactjs only!", 13 | "type": "boolean" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /install/post-install.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let fs = require('fs-extra'), 4 | path = require('path'), 5 | projectFolder = '../../aurelia_project/', 6 | projectFile = 'aurelia.json', 7 | installName = 'interact'; 8 | 9 | // fs-extra is installed as devDependency for CLI projects 10 | // if it isn't there, it's probably not CLI 11 | if (fs) { 12 | // check again if it's an aurelia-cli project for sure 13 | fs.exists(projectFolder, function (exists) { 14 | if (exists === true) { 15 | fs.readJson(projectFolder + projectFile, function (err, project) { 16 | if (err) { 17 | return console.log('Could not install ' + projectFile, err); 18 | } else { 19 | // determinate transpiler to set correct file extension 20 | let filename = installName + project.transpiler.fileExtension, 21 | source = './install/' + installName, 22 | dest = projectFolder + 'tasks/'; 23 | 24 | fs.copy(source + '.js', dest + filename, function (err) { 25 | if (err) { 26 | return console.log('Could not install ' + filename, err); 27 | } else { 28 | fs.copy(source + '.json', dest + installName + '.json', function (err) { 29 | if (err) { 30 | return console.log('Could not install ' + dest + installName + '.json', err); 31 | } else { 32 | return console.log(dest + filename + ' has been installed.'); 33 | } 34 | }); 35 | } 36 | }); 37 | } 38 | }); 39 | } 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | basePath: './', 4 | frameworks: ['systemjs', 'jasmine'], 5 | systemjs: { 6 | configFile: './config.js', 7 | config: { 8 | paths: { 9 | "typescript": "node_modules/typescript/lib/typescript.js", 10 | "systemjs": "node_modules/systemjs/dist/system.js", 11 | 'system-polyfills': 'node_modules/systemjs/dist/system-polyfills.js', 12 | 'es-module-loader': 'node_modules/es6-module-loader/dist/es6-module-loader.js' 13 | }, 14 | packages: { 15 | 'test': { 16 | defaultExtension: 'ts' 17 | }, 18 | 'src': { 19 | defaultExtension: 'ts' 20 | } 21 | }, 22 | transpiler: 'typescript' 23 | }, 24 | serveFiles: [ 25 | 'src/**/*.ts', 26 | 'jspm_packages/**/*.js', 27 | 'jspm_packages/**/*.css' 28 | ] 29 | }, 30 | files: [ 31 | 'test/setup.ts', 32 | 'test/unit/*.ts', 33 | 'test/unit/**/*.ts' 34 | ], 35 | exclude: [], 36 | preprocessors: { }, 37 | reporters: ['progress'], 38 | port: 9876, 39 | colors: true, 40 | logLevel: config.LOG_INFO, 41 | autoWatch: true, 42 | browsers: ['PhantomJS'], 43 | singleRun: false 44 | }); 45 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-interactjs", 3 | "version": "2.0.7", 4 | "description": "Plugin to use interact.js with Aurelia.", 5 | "keywords": [ 6 | "aurelia", 7 | "interact", 8 | "interactjs", 9 | "interact.js" 10 | ], 11 | "homepage": "https://github.com/eriklieben/aurelia-interactjs", 12 | "bugs": { 13 | "url": "https://github.com/eriklieben/aurelia-interactjs/issues" 14 | }, 15 | "license": "MIT", 16 | "author": "Erik Lieben (https://www.eriklieben.com/)", 17 | "main": "dist/amd/index.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/eriklieben/aurelia-interactjs" 21 | }, 22 | "scripts": { 23 | "postinstall": "node ./install/post-install.js" 24 | }, 25 | "devDependencies": { 26 | "aurelia-tools": "^0.2.4", 27 | "babel": "^6.5.2", 28 | "babel-eslint": "^6.1.2", 29 | "babel-plugin-syntax-flow": "^6.8.0", 30 | "babel-plugin-transform-decorators-legacy": "^1.3.4", 31 | "babel-plugin-transform-es2015-modules-amd": "^6.8.0", 32 | "babel-plugin-transform-es2015-modules-commonjs": "^6.11.5", 33 | "babel-plugin-transform-es2015-modules-systemjs": "^6.11.6", 34 | "babel-plugin-transform-flow-strip-types": "^6.8.0", 35 | "babel-preset-es2015": "^6.9.0", 36 | "babel-preset-es2015-loose": "^7.0.0", 37 | "babel-preset-stage-1": "^6.5.0", 38 | "conventional-changelog": "1.1.0", 39 | "del": "^2.2.1", 40 | "es-module-loader": "^1.2.0", 41 | "gulp": "^3.9.1", 42 | "gulp-bump": "^2.2.0", 43 | "gulp-changed": "^1.3.1", 44 | "gulp-conventional-changelog": "^1.1.0", 45 | "gulp-eslint": "^3.0.1", 46 | "gulp-plumber": "^1.1.0", 47 | "gulp-sourcemaps": "^1.6.0", 48 | "gulp-tslint": "^6.1.1", 49 | "gulp-typescript": "^2.13.6", 50 | "gulp-yuidoc": "^0.1.2", 51 | "isparta": "^4.0.0", 52 | "istanbul": "^1.0.0-alpha.2", 53 | "jasmine-core": "^2.4.1", 54 | "karma": "^1.1.2", 55 | "karma-babel-preprocessor": "^6.0.1", 56 | "karma-chrome-launcher": "^2.0.0", 57 | "karma-coverage": "^1.1.1", 58 | "karma-jasmine": "^1.0.2", 59 | "karma-jspm": "2.2.0", 60 | "karma-phantomjs-launcher": "^1.0.1", 61 | "karma-systemjs": "^0.14.0", 62 | "object.assign": "^4.0.4", 63 | "phantomjs-prebuilt": "^2.1.10", 64 | "require-dir": "^0.3.0", 65 | "run-sequence": "^1.2.2", 66 | "systemjs": "^0.19.36", 67 | "tslint": "^3.15.1", 68 | "typescript": "^2.0.2", 69 | "vinyl-paths": "^2.1.0", 70 | "yargs": "^5.0.0" 71 | }, 72 | "jspm": { 73 | "registry": "npm", 74 | "main": "index", 75 | "format": "amd", 76 | "jspmNodeConversion": false, 77 | "directories": { 78 | "dist": "dist/amd" 79 | }, 80 | "dependencies": { 81 | "aurelia-framework": "^1.0.7", 82 | "interact": "npm:interact.js@^1.2.6" 83 | }, 84 | "devDependencies": { 85 | "aurelia-polyfills": "^1.0.0-beta.1.1.0" 86 | } 87 | }, 88 | "dependencies": { 89 | "aurelia-framework": "^1.0.2", 90 | "interact.js": "^1.2.6" 91 | }, 92 | "peerDependencies": { 93 | "interact.js": "^1.2.6" 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/draggable.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class DraggableCustomAttribute extends InteractBase { 7 | public bind() { 8 | this.unsetInteractJs(); 9 | this.element.classList.add('draggable'); 10 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 11 | .draggable(this.getActionOptions()) 12 | .on('dragmove', event => { 13 | let target = event.target, 14 | x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, 15 | y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; 16 | 17 | target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; 18 | target.setAttribute('data-x', x); 19 | target.setAttribute('data-y', y); 20 | 21 | target.classList.add('getting--dragged'); 22 | }) 23 | .on('dragend', event => { 24 | event.target.style.transform = 'none'; 25 | event.target.removeAttribute('data-x'); 26 | event.target.removeAttribute('data-y'); 27 | event.target.classList.remove('getting--dragged'); 28 | }); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/dropzone.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class DropzoneCustomAttribute extends InteractBase { 7 | 8 | /** 9 | * interact.js options 10 | */ 11 | private defaults = { 12 | accept: '.draggable', 13 | overlap: .5, 14 | }; 15 | 16 | public bind() { 17 | this.unsetInteractJs(); 18 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 19 | .dropzone(this.getActionOptions(this.defaults)) 20 | .on('dropactivate', event => event.target.classList.add('can--drop')) 21 | .on('dragenter', event => { 22 | 23 | let draggableElement = event.relatedTarget, 24 | dropzoneElement = event.target; 25 | 26 | dropzoneElement.classList.add('can--catch'); 27 | draggableElement.classList.add('drop--me'); 28 | 29 | }) 30 | .on('dragleave', event => { 31 | event.target.classList.remove('can--catch', 'caught--it'); 32 | event.relatedTarget.classList.remove('drop--me'); 33 | }) 34 | .on('drop', event => { 35 | if (typeof(event.relatedTarget.au.draggable.viewModel) === 'object' && 36 | typeof(event.relatedTarget.au.draggable.viewModel.value) === 'object') { 37 | 38 | this.element.dispatchEvent( 39 | new CustomEvent('drop', { 40 | bubbles: true, 41 | detail: event.relatedTarget.au.draggable.viewModel.value, 42 | }) 43 | ); 44 | } 45 | event.target.classList.add('caught--it'); 46 | }) 47 | .on('dropdeactivate', event => { 48 | event.target.classList.remove('can--drop'); 49 | event.target.classList.remove('can--catch'); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './draggable'; 2 | export * from './dropzone'; 3 | export * from './interact-draggable'; 4 | export * from './interact-dropzone'; 5 | export * from './interact-gesturable'; 6 | export * from './interact-resizable'; 7 | export * from './resizable'; 8 | import * as Interact from 'interact'; 9 | 10 | export function configure(aurelia, options) { 11 | aurelia.container.registerInstance(Interact, Interact); 12 | let attributes = [ 13 | './interact-draggable', 14 | './interact-dropzone', 15 | './interact-gesturable', 16 | './interact-resizable', 17 | './resizable', 18 | ]; 19 | 20 | if (options && options.enableDragDropAttributes === true) { 21 | attributes.push('./draggable'); 22 | attributes.push('./dropzone'); 23 | } 24 | 25 | aurelia.globalResources(attributes); 26 | } 27 | -------------------------------------------------------------------------------- /src/interact-base.ts: -------------------------------------------------------------------------------- 1 | export default class InteractBase { 2 | 3 | /** 4 | * interact.js options 5 | */ 6 | public value: { 7 | [key: string]: any, 8 | action: {[key: string]: any}, 9 | interactable: {[key: string]: any} 10 | }; 11 | public interactable; 12 | 13 | constructor(protected element: HTMLElement, protected interact: any) { } 14 | 15 | public unbind() { 16 | this.unsetInteractJs(); 17 | } 18 | 19 | protected unsetInteractJs() { 20 | if (this.interactable) { 21 | this.interactable.unset(); 22 | } 23 | } 24 | 25 | protected dispatch(name, data) { 26 | this.element.dispatchEvent( 27 | new CustomEvent(name, { 28 | bubbles: true, 29 | detail: data, 30 | }) 31 | ); 32 | } 33 | 34 | protected getInteractableOptions() { 35 | return this.hasInteractableOptionsKey() ? this.value.interactable : undefined; 36 | } 37 | 38 | protected getActionOptions(defaults?: any) { 39 | // If the interactable options are defined but the action ones aren't don't use them by mistake! :-) 40 | let valueIfNoInteractable = (!this.hasInteractableOptionsKey() ? this.value : undefined); 41 | let actionOptions = (this.value && this.hasActionOptionsKey()) ? this.value.action : valueIfNoInteractable; 42 | return Object.assign({}, actionOptions || (defaults || {})); 43 | } 44 | 45 | private hasInteractableOptionsKey() { 46 | return this.value && !!this.value.interactable; 47 | } 48 | 49 | private hasActionOptionsKey() { 50 | return this.value && !!this.value.action; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/interact-draggable.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class InteractDraggableCustomAttribute extends InteractBase { 7 | 8 | public bind() { 9 | this.unsetInteractJs(); 10 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 11 | .draggable(this.getActionOptions()) 12 | .on('dragstart', (event) => this.dispatch('interact-dragstart', event)) 13 | .on('dragmove', (event) => this.dispatch('interact-dragmove', event)) 14 | .on('draginertiastart', (event) => this.dispatch('interact-draginertiastart', event)) 15 | .on('dragend', (event) => this.dispatch('interact-dragend', event)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/interact-dropzone.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class InteractDropzoneCustomAttribute extends InteractBase { 7 | 8 | public bind() { 9 | this.unsetInteractJs(); 10 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 11 | .dropzone(this.getActionOptions()) 12 | .on('dropactivate', (event) => this.dispatch('interact-dropactivate', event)) 13 | .on('dragenter', (event) => this.dispatch('interact-dragenter', event)) 14 | .on('dragleave', (event) => this.dispatch('interact-dragleave', event)) 15 | .on('drop', (event) => this.dispatch('interact-drop', event)) 16 | .on('dropdeactivate', (event) => this.dispatch('interact-dropdeactivate', event)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/interact-gesturable.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class InteractGesturableCustomAttribute extends InteractBase { 7 | 8 | public bind() { 9 | this.unsetInteractJs(); 10 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 11 | .dropzone(this.getActionOptions()) 12 | .on('gesturestart', (event) => this.dispatch('interact-gesturestart', event)) 13 | .on('gesturemove', (event) => this.dispatch('interact-gesturemove', event)) 14 | .on('gestureend', (event) => this.dispatch('interact-gestureend', event)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/interact-resizable.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class InteractResizableCustomAttribute extends InteractBase { 7 | 8 | public bind() { 9 | this.unsetInteractJs(); 10 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 11 | .resizable(this.getActionOptions()) 12 | .on('resizestart', (event) => this.dispatch('interact-resizestart', event)) 13 | .on('resizemove', (event) => this.dispatch('interact-resizemove', event)) 14 | .on('resizeinertiastart', (event) => this.dispatch('interact-resizeinertiastart', event)) 15 | .on('resizeend', (event) => this.dispatch('interact-resizeend', event)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/resizable.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-framework'; 2 | import * as Interact from 'interact'; 3 | import InteractBase from './interact-base'; 4 | 5 | @inject(Element, Interact) 6 | export class ResizableCustomAttribute extends InteractBase { 7 | 8 | /** 9 | * interact.js options 10 | */ 11 | private defaults: {[key: string]: any} = { 12 | edges: { 13 | bottom: true, 14 | left: true, 15 | right: true, 16 | top: true, 17 | }, 18 | }; 19 | 20 | public bind() { 21 | this.unsetInteractJs(); 22 | this.element.classList.add('resizable'); 23 | this.interactable = this.interact(this.element, this.getInteractableOptions()) 24 | .resizable(this.getActionOptions(this.defaults)) 25 | .on('resizemove', event => { 26 | let target = event.target, 27 | x = (parseFloat(target.getAttribute('data-x')) || 0), 28 | y = (parseFloat(target.getAttribute('data-y')) || 0); 29 | 30 | // update the element's style 31 | target.style.width = event.rect.width + 'px'; 32 | target.style.height = event.rect.height + 'px'; 33 | 34 | // translate when resizing from top or left edges 35 | x += event.deltaRect.left; 36 | y += event.deltaRect.top; 37 | 38 | target.style.webkitTransform = target.style.transform = 39 | 'translate(' + x + 'px,' + y + 'px)'; 40 | 41 | target.setAttribute('data-x', x); 42 | target.setAttribute('data-y', y); 43 | 44 | target.classList.add('getting--resized'); 45 | }) 46 | .on('resizeend', event => { 47 | event.target.classList.remove('getting--resized'); 48 | }); 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /test/setup.ts: -------------------------------------------------------------------------------- 1 | import "aurelia-polyfills"; 2 | -------------------------------------------------------------------------------- /test/unit/configure.spec.ts: -------------------------------------------------------------------------------- 1 | import {configure} from "../../src/index"; 2 | import { Container } from 'aurelia-framework'; 3 | 4 | class ConfigStub { 5 | 6 | public resources: any[]; 7 | public container = new Container(); 8 | 9 | globalResources(resources) { 10 | this.resources = resources; 11 | } 12 | } 13 | 14 | describe("the Aurelia configuration", () => { 15 | var mockedConfiguration; 16 | 17 | beforeEach(() => { 18 | mockedConfiguration = new ConfigStub(); 19 | configure(mockedConfiguration, undefined); 20 | }); 21 | 22 | it("should register interact draggable as global resource", () => { 23 | expect(mockedConfiguration.resources).toContain("./interact-draggable"); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /test/unit/options.spec.ts.ts: -------------------------------------------------------------------------------- 1 | import * as InteractWrapper from '../../src/index'; 2 | 3 | let dropZoneDefaults = { 4 | accept: '.draggable', 5 | overlap: .5, 6 | }; 7 | 8 | let resizableDefaults = { 9 | edges: { 10 | bottom: true, 11 | left: true, 12 | right: true, 13 | top: true, 14 | } 15 | }; 16 | 17 | let actionOptionsOnly = { 18 | test: 123 19 | }; 20 | 21 | let actionOptionsOnlyInNewStructure = { 22 | action : { 23 | test: 123 24 | } 25 | }; 26 | 27 | let actionAndInteractableOptions = { 28 | action : { 29 | test: 123 30 | }, 31 | interactable : { 32 | test: 456 33 | } 34 | }; 35 | 36 | let interactableOptionsOnly = { 37 | interactable : { 38 | test: 456 39 | } 40 | }; 41 | 42 | let dataDriveTests = [ 43 | { action: 'draggable', element: 'InteractDraggableCustomAttribute', options: undefined, expected: { actionOptions: {}, interactOptions: undefined }}, 44 | { action: 'draggable', element: 'DraggableCustomAttribute', options: undefined, expected: { actionOptions: {}, interactOptions: undefined }}, 45 | { action: 'dropzone', element: 'InteractDropzoneCustomAttribute', options: undefined, expected: { actionOptions: {}, interactOptions: undefined }}, 46 | { action: 'dropzone', element: 'DropzoneCustomAttribute', options: undefined, expected: { actionOptions: dropZoneDefaults, interactOptions: undefined }}, 47 | { action: 'dropzone', element: 'InteractGesturableCustomAttribute', options: undefined, expected: { actionOptions: {}, interactOptions: undefined }}, 48 | { action: 'resizable', element: 'InteractResizableCustomAttribute', options: undefined, expected: { actionOptions: {}, interactOptions: undefined }}, 49 | { action: 'resizable', element: 'ResizableCustomAttribute', options: undefined, expected: { actionOptions: resizableDefaults, interactOptions: undefined }},, 50 | 51 | { action: 'draggable', element: 'InteractDraggableCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 52 | { action: 'draggable', element: 'DraggableCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 53 | { action: 'dropzone', element: 'InteractDropzoneCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 54 | { action: 'dropzone', element: 'DropzoneCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 55 | { action: 'dropzone', element: 'InteractGesturableCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 56 | { action: 'resizable', element: 'InteractResizableCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 57 | { action: 'resizable', element: 'ResizableCustomAttribute', options: actionOptionsOnly, expected: { actionOptions: actionOptionsOnly, interactOptions: undefined }}, 58 | 59 | { action: 'draggable', element: 'InteractDraggableCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 60 | { action: 'draggable', element: 'DraggableCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 61 | { action: 'dropzone', element: 'InteractDropzoneCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 62 | { action: 'dropzone', element: 'DropzoneCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 63 | { action: 'dropzone', element: 'InteractGesturableCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 64 | { action: 'resizable', element: 'InteractResizableCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 65 | { action: 'resizable', element: 'ResizableCustomAttribute', options: actionOptionsOnlyInNewStructure, expected: { actionOptions: actionOptionsOnlyInNewStructure.action, interactOptions: undefined }}, 66 | 67 | 68 | { action: 'draggable', element: 'InteractDraggableCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 69 | { action: 'draggable', element: 'DraggableCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 70 | { action: 'dropzone', element: 'InteractDropzoneCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 71 | { action: 'dropzone', element: 'DropzoneCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 72 | { action: 'dropzone', element: 'InteractGesturableCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 73 | { action: 'resizable', element: 'InteractResizableCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 74 | { action: 'resizable', element: 'ResizableCustomAttribute', options: actionAndInteractableOptions, expected: { actionOptions: actionAndInteractableOptions.action, interactOptions: actionAndInteractableOptions.interactable }}, 75 | 76 | { action: 'draggable', element: 'InteractDraggableCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: {}, interactOptions: interactableOptionsOnly.interactable }}, 77 | { action: 'draggable', element: 'DraggableCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: {}, interactOptions: interactableOptionsOnly.interactable }}, 78 | { action: 'dropzone', element: 'InteractDropzoneCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: {}, interactOptions: interactableOptionsOnly.interactable }}, 79 | { action: 'dropzone', element: 'DropzoneCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: dropZoneDefaults, interactOptions: interactableOptionsOnly.interactable }}, 80 | { action: 'dropzone', element: 'InteractGesturableCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: {}, interactOptions: interactableOptionsOnly.interactable }}, 81 | { action: 'resizable', element: 'InteractResizableCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: {}, interactOptions: interactableOptionsOnly.interactable }}, 82 | { action: 'resizable', element: 'ResizableCustomAttribute', options: interactableOptionsOnly, expected: { actionOptions: resizableDefaults, interactOptions: interactableOptionsOnly.interactable }} 83 | 84 | 85 | ]; 86 | 87 | dataDriveTests.forEach(dataDriveTest => { 88 | describe('Given an interactable action ', () => { 89 | let interactableWrapper; 90 | let element; 91 | let mockInteractFunc; 92 | let mockInteractable; 93 | beforeEach(() => { 94 | element = document.createElement('div'); 95 | mockInteractable = jasmine.createSpyObj('interactable'+ dataDriveTest.element, [dataDriveTest.action, 'on', 'unset']); 96 | mockInteractFunc = jasmine.createSpy('interactFunc'); 97 | mockInteractFunc.and.returnValue(mockInteractable); 98 | mockInteractable[dataDriveTest.action].and.returnValue(mockInteractable); 99 | mockInteractable.on.and.returnValue(mockInteractable); 100 | interactableWrapper = new InteractWrapper[dataDriveTest.element](element, mockInteractFunc); 101 | }); 102 | 103 | afterEach(() => { 104 | element.remove(); 105 | }); 106 | 107 | describe('When it is bound with options', () => { 108 | beforeEach(() => { 109 | interactableWrapper.value = dataDriveTest.options; 110 | interactableWrapper.bind() 111 | }); 112 | 113 | afterEach(() => { 114 | interactableWrapper.unbind(); 115 | }); 116 | 117 | it("Then the interactable factory function was called with the correct options", () => { 118 | expect(mockInteractFunc).toHaveBeenCalledWith(jasmine.any(Object), dataDriveTest.expected.interactOptions); 119 | }); 120 | 121 | it("Then the interactable action method was called with the correct options", () => { 122 | expect(interactableWrapper.interactable[dataDriveTest.action]).toHaveBeenCalledWith(dataDriveTest.expected.actionOptions); 123 | }); 124 | }); 125 | }); 126 | }); 127 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": "src/", 5 | "outDir": "wwwroot/dist", 6 | "sourceMap": true, 7 | "target": "es5", 8 | "module": "amd", 9 | "declaration": false, 10 | "noImplicitAny": false, 11 | "removeComments": true, 12 | "emitDecoratorMetadata": true, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "lib": ["es2015", "dom"] 16 | }, 17 | "filesGlob": [ 18 | "./src/**/*.ts", 19 | "./test/**/*.ts", 20 | "./typings/index.d.ts" 21 | ], 22 | "exclude": [ 23 | "node_modules", 24 | "wwwroot/jspm_packages" 25 | ], 26 | "atom": { 27 | "rewriteTsconfig": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [true, "check-space"], 5 | "curly": true, 6 | "eofline": true, 7 | "forin": true, 8 | "indent": [true, "spaces"], 9 | "label-position": true, 10 | "label-undefined": true, 11 | "max-line-length": [true, 140], 12 | "member-access": true, 13 | "member-ordering": [true, 14 | "public-before-private", 15 | "static-before-instance", 16 | "variables-before-functions" 17 | ], 18 | "no-arg": true, 19 | "no-bitwise": true, 20 | "no-console": [true, 21 | "debug", 22 | "info", 23 | "time", 24 | "timeEnd", 25 | "trace" 26 | ], 27 | "no-construct": true, 28 | "no-debugger": true, 29 | "no-duplicate-key": true, 30 | "no-duplicate-variable": true, 31 | "no-empty": true, 32 | "no-eval": true, 33 | "no-inferrable-types": true, 34 | "no-shadowed-variable": true, 35 | "no-string-literal": true, 36 | "no-switch-case-fall-through": true, 37 | "no-trailing-whitespace": true, 38 | "no-unused-expression": true, 39 | "no-unused-variable": true, 40 | "no-unreachable": true, 41 | "no-use-before-declare": true, 42 | "no-var-keyword": true, 43 | "object-literal-sort-keys": true, 44 | "one-line": [true, 45 | "check-open-brace", 46 | "check-catch", 47 | "check-else", 48 | "check-finally", 49 | "check-whitespace" 50 | ], 51 | "quotemark": [true, "single", "avoid-escape"], 52 | "radix": true, 53 | "semicolon": true, 54 | "trailing-comma": [true, { 55 | "singleline": "never", 56 | "multiline": "always" 57 | }], 58 | "triple-equals": [true, "allow-null-check"], 59 | "typedef-whitespace": [true, { 60 | "call-signature": "nospace", 61 | "index-signature": "nospace", 62 | "parameter": "nospace", 63 | "property-declaration": "nospace", 64 | "variable-declaration": "nospace" 65 | }], 66 | "variable-name": false, 67 | "whitespace": [true, 68 | "check-branch", 69 | "check-decl", 70 | "check-operator", 71 | "check-separator", 72 | "check-type" 73 | ] 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "interact": "registry:dt/interact#1.0.25+20160613160313", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255" 5 | }, 6 | "dependencies": { 7 | "aurelia-framework": "npm:aurelia-framework" 8 | } 9 | } 10 | --------------------------------------------------------------------------------