Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
31 changes: 0 additions & 31 deletions .npmignore

This file was deleted.

25 changes: 25 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
2 changes: 1 addition & 1 deletion index.js → .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
name: require('./package').name,
singleQuote: true,
};
1 change: 0 additions & 1 deletion app/components/select-light.js

This file was deleted.

1 change: 0 additions & 1 deletion app/helpers/is-equal.js

This file was deleted.

18 changes: 0 additions & 18 deletions ember-cli-build.js

This file was deleted.

8 changes: 8 additions & 0 deletions ember-select-light/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
File renamed without changes.
26 changes: 26 additions & 0 deletions ember-select-light/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
File renamed without changes.
13 changes: 13 additions & 0 deletions ember-select-light/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The MIT License (MIT)

Copyright (c) 2020

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.

---

Originally published under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) (Copyright 2016 Q2 Holdings Inc.)
99 changes: 99 additions & 0 deletions ember-select-light/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Ember-Select-Light

![CI](https://github.com/ember-a11y/ember-select-light/workflows/CI/badge.svg?branch=main) ![PRs Welcome](https://camo.githubusercontent.com/d4e0f63e9613ee474a7dfdc23c240b9795712c96/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667) ![License: MIT](https://camo.githubusercontent.com/890acbdcb87868b382af9a4b1fac507b9659d9bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![npm package](https://d25lcipzij17d.cloudfront.net/badge.svg?id=js&type=6&v=2.0.0&x2=0)](https://badge.fury.io/js/ember-select-light) [![Ember Observer](https://emberobserver.com/badges/ember-select-light.svg)](https://emberobserver.com/addons/ember-select-light)

Ember-Select-Light is an Ember Addon focused on simplicity. Just powerful enough to offer expected baseline functionality while being easy to implement, style, and make accessible.

This addon is [Octane ready](https://emberjs.com/editions/octane/) and follows [ember-component-pattern's for how to best write a Select Element](https://emberjs-1.gitbook.io/ember-component-patterns/form-components/select-element).

## Getting Started

```bash
ember install ember-select-light
```

### Example Usage

```handlebars
<SelectLight
@value="turtle"
@options={{array "turtle" "tortoise"}}
@onChange={{this.handleChange}} />
```

#### With an array of objects...

```handlebars
<SelectLight
@options={{array
(hash value="shortfin" label="Shortfin Shark")
(hash value="mako" label="Mako Shark")
}} />
```

`value` and `label` will be the default object keys used unless `@valueKey="...` and/or `@displayKey="...` are used respectively, like so...

```handlebars
<SelectLight
@options={{array
(hash myValue="shortfin" myLabel="Shortfin Shark")
(hash myValue="mako" myLabel="Mako Shark")
}}
@valueKey="myValue"
@displayKey="myLabel" />
```

#### As a Yield

```handlebars
<SelectLight>
<option value="clown">Clown Fish</option>
<option value="cat">Cat Fish</option>
</SelectLight>
```

### Other arguments

Other arguments are spread onto the `<select ...attributes` as you'd expect, allowing you to use common attributes such as `disabled`, `tabindex` and of course `class`.

```handlebars
<SelectLight class="my-select" disabled="true" />
```

#### Styled

As shown above we can pass in other arguments like `class="` which allows us to style our Select dropdowns. Below is an example with the Select dropdown styled using [Tailwind CSS](https://tailwindcss.com/).

[![Following the Tailwind Custom Select guides this component can be easily styled](./tailwind-styled.gif)](https://tailwindcss.com/components/forms#custom-select)

---

## Upgrading

See [the upgrading guide for how to upgrade from previous versions](./UPGRADE.md).

---

## Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).

### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

## Contributing

We love pull requests from everyone. By participating in this project, you agree to abide by the [code of conduct](./code-of-conduct.md) and is subject to the [project license](./LICENSE.md).

Clone this repo, make your changes with test coverage, push up a fork and [submit a pull request](https://github.com/sharpshark28/ember-select-light/compare).

Soon after some primary contributors will review your code and submit feedback and hopefully click the fancy green approve button. Any test and linting failures should be caught during the pull request continuous integration environment and human eyes here after.

## Running Tests

* `npm run test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* or `ember test`
5 changes: 5 additions & 0 deletions ember-select-light/addon-main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const { addonV1Shim } = require('@embroider/addon-shim');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good as far as avoiding a major SemVer bump goes, provided no other major code changes were required to accommodate the migration.


module.exports = addonV1Shim(__dirname);
7 changes: 7 additions & 0 deletions ember-select-light/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
]
}
64 changes: 64 additions & 0 deletions ember-select-light/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@kb/ember-select-light",
"version": "2.0.8",
"description": "The simple DDAU component built for Ember",
"keywords": [
"ember-addon"
],
"repository": "https://github.com/ember-a11y/ember-select-light",
"license": "MIT",
"author": "Ava Wroten <[email protected]> (https://www.wroten.me/)",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "rollup --config",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"prepack": "rollup --config",
"start": "rollup --config --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"@embroider/addon-shim": "^1.8.5"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.22.5",
"@embroider/addon-dev": "^3.1.1",
"@rollup/plugin-babel": "^6.0.3",
"rollup": "^3.25.1",
"rollup-plugin-copy": "^3.4.0"
},
"engines": {
"node": "16.* || >= 18"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"app-js": {
"./components/select-light.js": "./dist/_app_/components/select-light.js",
"./helpers/is-equal.js": "./dist/_app_/helpers/is-equal.js"
},
"main": "addon-main.cjs",
"type": "addon",
"version": 2
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js",
"./addon-main.js": "./addon-main.cjs"
},
"files": [
"addon-main.cjs",
"dist"
]
}
Loading