nxt-color-picker 14.0.3 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@ This is a responsive color picker based on [angular2-color-picker](https://githu
16
16
 
17
17
  ### Quick links
18
18
 
19
- [Example application](https://liquid-js.github.io/nxt-color-picker/en-US/)
19
+ [Example application](https://liquid-js.github.io/nxt-components/color-picker)
20
20
 
21
21
  ### Building the library
22
22
 
@@ -44,88 +44,89 @@ yarn add nxt-color-picker
44
44
  import { ColorPickerModule } from 'nxt-color-picker';
45
45
 
46
46
  @NgModule({
47
- ...
48
- imports: [
49
47
  ...
50
- ColorPickerModule
51
- ]
48
+ imports: [
49
+ ...
50
+ ColorPickerModule
51
+ ]
52
52
  })
53
53
  ```
54
54
 
55
55
  ##### Use it in your HTML template:
56
56
 
57
57
  ```html
58
- <input [(cpColor)]="color" [style.background]="color"/>
58
+ <input [(nxtColor)]="color"
59
+ [style.background]="color"/>
59
60
  ```
60
61
 
61
62
  ```javascript
62
- [cpColor] // The color to show in the color picker dialog.
63
+ [nxtColor] // The color to show in the color picker dialog.
63
64
 
64
- [cpWidth] // Use this option to set color picker dialog width ('230px').
65
- [cpHeight] // Use this option to force color picker dialog height ('auto').
65
+ [width] // Use this option to set color picker dialog width ('230px').
66
+ [height] // Use this option to force color picker dialog height ('auto').
66
67
 
67
- [cpToggle] // Sets the default open / close state of the color picker (false).
68
- [cpDisabled] // Disables opening of the color picker dialog via toggle / events.
68
+ [toggle] // Sets the default open / close state of the color picker (false).
69
+ [disabled] // Disables opening of the color picker dialog via toggle / events.
69
70
 
70
- [cpMode] // Dialog color mode: 'color', 'grayscale', 'presets' ('color').
71
+ [mode] // Dialog color mode: 'color', 'grayscale', 'presets' ('color').
71
72
 
72
- [cpCmykEnabled] // Enables CMYK input format and color change event (false).
73
+ [cmykEnabled] // Enables CMYK input format and color change event (false).
73
74
 
74
- [cpOutputFormat] // Output color format: OutputFormat (OutputFormat.auto).
75
- [cpAlphaChannel] // Alpha mode: AlphaChannel (AlphaChannel.enabled).
76
- [cpFallbackColor] // Used when the color is not well-formed or is undefined ('#000').
75
+ [outputFormat] // Output color format: OutputFormat (OutputFormatEnum.auto).
76
+ [alphaChannel] // Alpha mode: AlphaChannel (AlphaChannelEnum.enabled).
77
+ [fallbackColor] // Used when the color is not well-formed or is undefined ('#000').
77
78
 
78
- [cpPosition] // Dialog position: DialogPosition (DialogPosition.right).
79
- [cpPositionOffset] // Dialog offset percentage relative to the directive element (0).
79
+ [position] // Dialog position: DialogPosition (DialogPositionEnum.right).
80
+ [positionOffset] // Dialog offset percentage relative to the directive element (0).
80
81
 
81
- [cpPresetLabel] // Show label for preset colors (true). If string is given, it overrides the default label.
82
- [cpPresetColors] // Array of preset colors to show in the color picker dialog ([]).
82
+ [presetLabel] // Show label for preset colors (true). If string is given, it overrides the default label.
83
+ [presetColors] // Array of preset colors to show in the color picker dialog ([]).
83
84
 
84
- [cpDisableInput] // Disables / hides the color input field from the dialog (false).
85
+ [disableInput] // Disables / hides the color input field from the dialog (false).
85
86
 
86
- [cpDialogDisplay] // Dialog positioning mode: DialogDisplay (DialogDisplay.popup).
87
- // DialogDisplay.popup: dialog is shown as popup (fixed positioning).
88
- // DialogDisplay.inline: dialog is shown permanently (static positioning).
87
+ [dialogDisplay] // Dialog positioning mode: DialogDisplay (DialogDisplayEnum.popup).
88
+ // DialogDisplayEnum.popup: dialog is shown as popup (fixed positioning).
89
+ // DialogDisplayEnum.inline: dialog is shown permanently (static positioning).
89
90
 
90
- [cpIgnoredElements] // Array of HTML elements that will be ignored when clicked ([]).
91
+ [ignoredElements] // Array of HTML elements that will be ignored when clicked ([]).
91
92
 
92
- [cpSaveClickOutside] // Save currently selected color when user clicks outside (true).
93
- [cpCloseClickOutside] // Close the color picker dialog when user clicks outside (true).
93
+ [saveClickOutside] // Save currently selected color when user clicks outside (true).
94
+ [closeClickOutside] // Close the color picker dialog when user clicks outside (true).
94
95
 
95
- [cpOKButton] // Show an OK / Apply button which saves the color (false).
96
+ [okButton] // Show an OK / Apply button which saves the color (false).
96
97
 
97
- [cpCancelButton] // Show a Cancel / Reset button which resets the color (false).
98
+ [cancelButton] // Show a Cancel / Reset button which resets the color (false).
98
99
 
99
- [cpAddColorButton] // Show an Add Color button which add the color into preset (false).
100
+ [addColorButton] // Show an Add Color button which add the color into preset (false).
100
101
 
101
- [cpMaxPresetColors] // Use this option to set the max colors allowed in presets (6).
102
+ [maxPresetColors] // Use this option to set the max colors allowed in presets (6).
102
103
 
103
- [cpUseRootViewContainer] // Create dialog component in the root view container (false).
104
- // Note: The root component needs to have public viewContainerRef.
104
+ [useRootViewContainer] // Create dialog component in the root view container (false).
105
+ // Note: The root component needs to have public viewContainerRef.
105
106
 
106
- (cpOpen) // Current color value, send when dialog is opened (value: string).
107
- (cpClose) // Current color value, send when dialog is closed (value: string).
107
+ (open) // Current color value, send when dialog is opened (value: string).
108
+ (close) // Current color value, send when dialog is closed (value: string).
108
109
 
109
- (cpInputChange) // Input name and its value, send when user changes color through inputs (value: InputChangeEvent).
110
+ (inputChange) // Input name and its value, send when user changes color through inputs (value: InputChangeEvent).
110
111
 
111
- (cpToggleChange) // Status of the dialog, send when dialog is opened / closed (open: boolean).
112
+ (toggleChange) // Status of the dialog, send when dialog is opened / closed (open: boolean).
112
113
 
113
- (cpSliderDragStart) // Slider name and current color, send when slider dragging starts (value: SliderChangeEvent).
114
- (cpSliderChange) // Slider name and its value, send when user changes color through slider (value: SliderChangeEvent).
115
- (cpSliderDragEnd) // Slider name and current color, send when slider dragging ends (value: SliderChangeEvent).
114
+ (sliderDragStart) // Slider name and current color, send when slider dragging starts (value: SliderChangeEvent).
115
+ (sliderChange) // Slider name and its value, send when user changes color through slider (value: SliderChangeEvent).
116
+ (sliderDragEnd) // Slider name and current color, send when slider dragging ends (value: SliderChangeEvent).
116
117
 
117
- (cpColorSelectCancel) // Color select canceled, send when Cancel button is pressed (void).
118
- (cpColorSelect) // Selected color value, send when OK button pressed or user clicks outside (if cpSaveClickOutside is true). (value: string).
119
- (cpColorChange) // Changed color value, send when color is changed (value: string).
118
+ (colorSelectCancel) // Color select canceled, send when Cancel button is pressed (void).
119
+ (colorSelect) // Selected color value, send when OK button pressed or user clicks outside (if saveClickOutside is true). (value: string).
120
+ (nxtColorChange) // Changed color value, send when color is changed (value: string).
120
121
 
121
- (cpCmykColorChange) // Outputs the color as CMYK string if CMYK is enabled (value: string).
122
+ (cmykColorChange) // Outputs the color as CMYK string if CMYK is enabled (value: string).
122
123
 
123
- (cpPresetColorsChange) // Preset colors, send when 'Add Color' button is pressed (value: array).
124
+ (presetColorsChange) // Preset colors, send when 'Add Color' button is pressed (value: array).
124
125
  ```
125
126
 
126
127
  ##### Available control / helper functions (provided by the directive):
127
128
 
128
129
  ```javascript
129
- openDialog() // Opens the color picker dialog if not already open.
130
- closeDialog() // Closes the color picker dialog if not already closed.
130
+ openDialog() // Opens the color picker dialog if not already open.
131
+ closeDialog() // Closes the color picker dialog if not already closed.
131
132
  ```