2.0.0 • Published 2 years ago

ember-picker v2.0.0

Weekly downloads
179
License
MIT
Repository
github
Last release
2 years ago

ember-picker

Ember addon for vanilla-picker color picker library.

SS

Compatibility

  • Ember.js v3.28 or above
  • Ember CLI v3.28 or above
  • Node.js v14 or above

Installation

ember install ember-picker

Usage

You can change all global configuration settings via config/environment.js file.

Please check vanilla-picker site for more configuration details.

ENV['ember-picker'] = {
  parent: undefined,
  popup: 'right',
  template: undefined,
  layout: 'default',
  alpha: true,
  editor: true,
  editorFormat: 'hex',
  cancelButton: false,
  color: undefined,
  onChange: undefined,
  onDone: undefined,
  onOpen: undefined,
  onClose: undefined,
};

Example as a component

<Picker @color={{this.color}} @onDone={{this.onDone}} />
<Picker
  @color={{this.color}}
  @onDone={{this.onDone}}
  style='{{if
    this.color
    (concat "width: 32px;height: 32px;background:" this.color ";")
    "width: 32px;height: 32px;"
  }}'
>
  Block
</Picker>

Example as a modifer

<div
  class='ember-picker'
  style='{{if
    this.color
    (concat "width: 32px;height: 32px;background:" this.color ";")
    "width: 32px;height: 32px;"
  }}'
  {{picker color=this.color onDone=this.onDone}}
>
  Modifier
</div>

If you would like access to the picker instance in order to call some methods directly, for example to hide or show programmatically, pass an action to registerAPI

<Input
  {{picker registerAPI=this.saveApi color=this.color onDone=this.onDone}}
/>
// save the picker instance to use later
@action
saveApi(picker) {
  this.picker = picker;
}

// programmatically open the picker
@action
openPicker() {
  this.picker.show();
}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

2.0.0

2 years ago

1.6.2

2 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.30

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago