Skip to content

Commit 8372e23

Browse files
author
Timofey Dergachev
committed
Initial commit
0 parents  commit 8372e23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+972
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.hbs]
17+
insert_final_newline = false
18+
19+
[*.{diff,md}]
20+
trim_trailing_whitespace = false

.ember-cli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false
9+
}

.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
sourceType: 'module'
6+
},
7+
extends: 'eslint:recommended',
8+
env: {
9+
browser: true
10+
},
11+
rules: {
12+
}
13+
};

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# misc
12+
/.sass-cache
13+
/connect.lock
14+
/coverage/*
15+
/libpeerconnection.log
16+
npm-debug.log*
17+
testem.log
18+
yarn.lock

.npmignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/bower_components
2+
/config/ember-try.js
3+
/dist
4+
/tests
5+
/tmp
6+
**/.gitkeep
7+
.bowerrc
8+
.editorconfig
9+
.ember-cli
10+
.gitignore
11+
.eslintrc.js
12+
.watchmanconfig
13+
.travis.yml
14+
bower.json
15+
ember-cli-build.js
16+
testem.js

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "6"
5+
6+
sudo: false
7+
8+
cache:
9+
yarn: true
10+
11+
env:
12+
- EMBER_TRY_SCENARIO=ember-lts-2.4
13+
- EMBER_TRY_SCENARIO=ember-lts-2.8
14+
- EMBER_TRY_SCENARIO=ember-release
15+
16+
matrix:
17+
fast_finish: true
18+
19+
before_install:
20+
- curl -o- -L https://yarnpkg.com/install.sh | bash
21+
- export PATH=$HOME/.yarn/bin:$PATH
22+
- yarn global add phantomjs-prebuilt
23+
- phantomjs --version
24+
25+
install:
26+
- yarn install --no-lockfile
27+
28+
script:
29+
# Usually, it's ok to finish the test scenario without reverting
30+
# to the addon's original dependency state, skipping "cleanup".
31+
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup

.watchmanconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore_dirs": ["tmp", "dist"]
3+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
0.1.0 / 2017-06-25
2+
==================
3+
- Initial commit

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License
2+
3+
Copyright © 2017 [Timofey Dergachev](https://exeto.me/en)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10+
11+
---
12+
13+
# Лицензия MIT
14+
15+
Copyright © 2017 [Тимофей Дергачёв](https://exeto.me/)
16+
17+
Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации (в дальнейшем именуемыми «Программное Обеспечение»), безвозмездно использовать Программное Обеспечение без ограничений, включая неограниченное право на использование, копирование, изменение, добавление, публикацию, распространение, сублицензирование и/или продажу копий Программного Обеспечения, также как и лицам, которым предоставляется данное Программное Обеспечение, при соблюдении следующих условий:
18+
19+
Указанное выше уведомление об авторском праве и данные условия должны быть включены во все копии или значимые части данного Программного Обеспечения.
20+
21+
ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ГАРАНТИЯМИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ ПРАВ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО ИСКАМ О ВОЗМЕЩЕНИИ УЩЕРБА, УБЫТКОВ ИЛИ ДРУГИХ ТРЕБОВАНИЙ ПО ДЕЙСТВУЮЩИМ КОНТРАКТАМ, ДЕЛИКТАМ ИЛИ ИНОМУ, ВОЗНИКШИМ ИЗ, ИМЕЮЩИМ ПРИЧИНОЙ ИЛИ СВЯЗАННЫМ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# ember-cli-jss [![Build Status][buildstat-image]][buildstat-url]
2+
3+
> JSS integration for Ember
4+
5+
## Install
6+
7+
```bash
8+
$ npm install --save-dev ember-browserify
9+
$ npm install --save ember-cli-jss jss jss-preset-default
10+
```
11+
12+
## Usage
13+
14+
The property `stylesheet` must be an instance of the `StyleSheet`.
15+
16+
Properties `jssNames` and `jssNameBindings` work like `classNames` and `classNameBindings`, respectively.
17+
18+
When you update properties listed in the `jssObservedProps`, dynamic styles will be updated.
19+
20+
```js
21+
// ...awesome-component/component.js
22+
23+
import Ember from 'ember';
24+
import JSS from 'ember-cli-jss';
25+
import stylesheet from './stylesheet';
26+
27+
export default Ember.Component.extend(JSS, {
28+
stylesheet,
29+
jssNames: ['wrapper'],
30+
jssNameBindings: ['isShow:show'],
31+
jssObservedProps: ['color'],
32+
33+
color: 'blue',
34+
isShow: true,
35+
36+
actions: {
37+
changeColor(color) {
38+
this.set('color', color);
39+
},
40+
},
41+
});
42+
```
43+
44+
Constructor `StyleSheet` accepts the same arguments as [`jss.createStyleSheet`](http://cssinjs.org/js-api?v=v8.0.0#create-style-sheet).
45+
46+
```js
47+
// ...awesome-component/stylesheet.js
48+
49+
import { StyleSheet } from 'ember-cli-jss';
50+
51+
export default new StyleSheet({
52+
wrapper: {
53+
width: 600,
54+
display: 'none',
55+
},
56+
57+
show: {
58+
display: 'block',
59+
},
60+
61+
content: {
62+
color: data => data.color;
63+
},
64+
});
65+
```
66+
67+
```hbs
68+
{{!-- ...awesome-component/template.hbs --}}
69+
70+
<button type="button" {{action "changeColor" "green"}}>
71+
Green
72+
</button>
73+
74+
<div class="{{jss 'content'}}">
75+
Lorem ipsum...
76+
</div>
77+
```
78+
79+
## Helper
80+
81+
```hbs
82+
<button class="{{jss 'large' 'primary' disabled=true}}">
83+
Submit
84+
</button>
85+
```
86+
87+
## Configuration
88+
89+
Plugin [`jss-preset-default`](https://github.com/cssinjs/jss-preset-default) applied by default. Please note that the work of the dynamic properties depends on [`jss-compose`](https://github.com/cssinjs/jss-compose) plugin.
90+
91+
You can override the `app/initializers/ember-cli-jss.js`. Use `setup`, it takes the same arguments as [`jss.setup`](http://cssinjs.org/js-api?v=v8.0.0#setup-jss-instance).
92+
93+
```js
94+
// ...app/initializers/ember-cli-jss.js
95+
96+
import { setup } from 'ember-cli-jss';
97+
import compose from 'npm:jss-compose';
98+
99+
export function initialize() {
100+
setup(compose.default());
101+
}
102+
103+
export default {
104+
name: 'ember-cli-jss',
105+
initialize,
106+
};
107+
```
108+
109+
## License
110+
111+
[MIT](LICENSE.md) © [Timofey Dergachev](https://exeto.me/)
112+
113+
[buildstat-url]: https://travis-ci.org/exeto/ember-cli-jss?branch=master
114+
[buildstat-image]: https://img.shields.io/travis/exeto/ember-cli-jss/master.svg?style=flat-square

0 commit comments

Comments
 (0)