|
1 | 1 | /*! |
2 | | - * angularjs-color-picker v2.3.0 |
| 2 | + * angularjs-color-picker v2.4.0 |
3 | 3 | * https://github.com/ruhley/angular-color-picker/ |
4 | 4 | * |
5 | 5 | * Copyright 2016 ruhley |
6 | 6 | * |
7 | | - * 2016-07-29 09:30:27 |
| 7 | + * 2016-08-05 08:32:24 |
8 | 8 | * |
9 | 9 | */ |
10 | 10 |
|
11 | 11 | (function (global, factory) { |
12 | | - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : |
13 | | - typeof define === 'function' && define.amd ? define(factory) : |
14 | | - (global.AngularjsColorPicker = factory()); |
15 | | -}(this, function () { 'use strict'; |
| 12 | + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tinycolor2')) : |
| 13 | + typeof define === 'function' && define.amd ? define(['tinycolor2'], factory) : |
| 14 | + (global.AngularjsColorPicker = factory(global.tinycolor)); |
| 15 | +}(this, function (tinycolor) { 'use strict'; |
| 16 | + |
| 17 | + tinycolor = 'default' in tinycolor ? tinycolor['default'] : tinycolor; |
16 | 18 |
|
17 | 19 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { |
18 | 20 | return typeof obj; |
|
45 | 47 | }(); |
46 | 48 |
|
47 | 49 | var AngularColorPickerController = function () { |
48 | | - function AngularColorPickerController(_$scope, _$element, _$document, _$timeout) { |
| 50 | + function AngularColorPickerController(_$scope, _$element, _$document, _$timeout, _ColorPickerOptions) { |
49 | 51 | classCallCheck(this, AngularColorPickerController); |
50 | 52 |
|
51 | 53 | // set angular injected variables |
52 | 54 | this.$scope = _$scope; |
53 | 55 | this.$element = _$element; |
54 | 56 | this.$document = _$document; |
55 | 57 | this.$timeout = _$timeout; |
| 58 | + this.ColorPickerOptions = _ColorPickerOptions; |
56 | 59 |
|
57 | 60 | this.$scope.init = this.init.bind(this); |
58 | 61 |
|
|
415 | 418 | }, { |
416 | 419 | key: 'initConfig', |
417 | 420 | value: function initConfig() { |
418 | | - this.options = this.merge(this.options, { |
419 | | - disabled: false, |
420 | | - hue: true, |
421 | | - alpha: true, |
422 | | - round: false, |
423 | | - case: 'upper', |
424 | | - format: 'hsl', |
425 | | - pos: 'bottom left', |
426 | | - swatch: true, |
427 | | - swatchOnly: false, |
428 | | - swatchPos: 'left', |
429 | | - swatchBootstrap: true, |
430 | | - inline: false, |
431 | | - placeholder: '', |
432 | | - close: { |
433 | | - show: false, |
434 | | - label: 'Close', |
435 | | - class: '' |
436 | | - }, |
437 | | - clear: { |
438 | | - show: false, |
439 | | - label: 'Clear', |
440 | | - class: '' |
441 | | - }, |
442 | | - reset: { |
443 | | - show: false, |
444 | | - label: 'Reset', |
445 | | - class: '' |
446 | | - } |
447 | | - }); |
| 421 | + this.options = this.merge(this.options, this.ColorPickerOptions); |
448 | 422 |
|
449 | 423 | this.visible = this.options.inline; |
450 | 424 |
|
|
944 | 918 | return AngularColorPickerController; |
945 | 919 | }(); |
946 | 920 |
|
947 | | - AngularColorPickerController.$inject = ['$scope', '$element', '$document', '$timeout']; |
| 921 | + AngularColorPickerController.$inject = ['$scope', '$element', '$document', '$timeout', 'ColorPickerOptions']; |
948 | 922 |
|
949 | 923 | function colorPickerDirective() { |
950 | 924 | return { |
|
973 | 947 |
|
974 | 948 | template.$inject = ['$templateCache']; |
975 | 949 |
|
976 | | - var colorPicker = angular.module('color.picker', []).directive('colorPicker', colorPickerDirective).run(template); |
| 950 | + var AngularColorPickerOptions = function AngularColorPickerOptions() { |
| 951 | + classCallCheck(this, AngularColorPickerOptions); |
| 952 | + |
| 953 | + return { |
| 954 | + disabled: false, |
| 955 | + hue: true, |
| 956 | + alpha: true, |
| 957 | + round: false, |
| 958 | + case: 'upper', |
| 959 | + format: 'hsl', |
| 960 | + pos: 'bottom left', |
| 961 | + swatch: true, |
| 962 | + swatchOnly: false, |
| 963 | + swatchPos: 'left', |
| 964 | + swatchBootstrap: true, |
| 965 | + inline: false, |
| 966 | + placeholder: '', |
| 967 | + close: { |
| 968 | + show: false, |
| 969 | + label: 'Close', |
| 970 | + class: '' |
| 971 | + }, |
| 972 | + clear: { |
| 973 | + show: false, |
| 974 | + label: 'Clear', |
| 975 | + class: '' |
| 976 | + }, |
| 977 | + reset: { |
| 978 | + show: false, |
| 979 | + label: 'Reset', |
| 980 | + class: '' |
| 981 | + } |
| 982 | + }; |
| 983 | + }; |
| 984 | + |
| 985 | + var colorPicker = angular.module('color.picker', []).service('ColorPickerOptions', AngularColorPickerOptions).directive('colorPicker', colorPickerDirective).run(template); |
977 | 986 |
|
978 | 987 | return colorPicker; |
979 | 988 |
|
|
0 commit comments