Created
March 21, 2020 12:25
-
-
Save 3cp/d239d878d3cf6d0d18abb99322a3ccfb to your computer and use it in GitHub Desktop.
bcx-aurelia-reorderable-repeat example: multi-lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dumber Gist</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> | |
<base href="/"> | |
</head> | |
<!-- | |
Dumber gist uses dumber bundler, the default bundle file | |
is /dist/entry-bundle.js. | |
The starting module is pointed to aurelia-bootstrapper | |
(data-main attribute on script) for Aurelia, | |
The aurelia bootstrapper then loads up user module "main" | |
(aurelia-app attribute on <body>) which is your src/main.js. | |
--> | |
<body aurelia-app="main"> | |
<script src="/dist/entry-bundle.js" data-main="aurelia-bootstrapper"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"aurelia-bootstrapper": "^2.3.3" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./container"></require> | |
<container></container> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class App { | |
message = 'Hello Aurelia!'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
display: flex; | |
align-items: start; | |
width: 250px; | |
margin: 5px; | |
} | |
.list { | |
flex: 1 1 0; | |
margin: 10px; | |
padding: 10px; | |
background-color: #eee; | |
} | |
.item { | |
display: block; | |
box-sizing: border-box; | |
border: 1px solid #888; | |
height: 40px; | |
text-align: center; | |
line-height: 40px; | |
overflow: hidden; | |
background: white; | |
} | |
.item:not(:first-child) { | |
margin-top: -1px; | |
} | |
.item.reorderable-repeat-dragging-me { | |
visibility: visible; /* unset visibility: hidden */ | |
color: transparent; /* hide text */ | |
background-color: #ddd; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./container.css"></require> | |
<div class="container"> | |
<div class="list"> | |
Numbers | |
<div | |
class="item" | |
reorderable-repeat.for="item of numbers" | |
reorderable-group="alphanumeric"> | |
${item} | |
</div> | |
</div> | |
<div class="list"> | |
Letters | |
<div | |
class="item" | |
reorderable-repeat.for="item of letters" | |
reorderable-group="alphanumeric"> | |
${item} | |
</div> | |
</div> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Container { | |
numbers = [0, 1, 2]; | |
letters = ['a', 'b']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging('info') | |
.plugin('bcx-aurelia-reorderable-repeat'); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment