@@ -138,7 +138,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
138
138
@property ( { type : Boolean , reflect : true } ) inline = false ;
139
139
140
140
/**
141
- * Disables the color picker.
141
+ * Sets the color picker to disabled .
142
142
* @attr
143
143
* @type {boolean }
144
144
* @default false
@@ -153,6 +153,14 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
153
153
**/
154
154
@property ( { type : Boolean } ) opacity = false ;
155
155
156
+ /**
157
+ * Sets the color picker to readonly mode.
158
+ * @type {boolean }
159
+ * @attr
160
+ * @default false
161
+ */
162
+ @property ( { type : Boolean , reflect : true } ) readonly = false ;
163
+
156
164
/**
157
165
* By default, the value will be set in lowercase. Set this to true to set it in uppercase instead.
158
166
* @attr
@@ -433,6 +441,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
433
441
.value = "${ this . value } "
434
442
.hue = "${ Math . round ( this . hue ) } "
435
443
?dis abled= ${ this . disabled }
444
+ ?readonly = ${ this . readonly }
436
445
@change = ${ this . handleGridChange } >
437
446
</ uui- color - area>
438
447
<div class= "color-picker__controls" >
@@ -442,6 +451,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
442
451
class = "hue-slider"
443
452
.value = ${ Math . round ( this . hue ) }
444
453
?dis abled= ${ this . disabled }
454
+ ?readonly = ${ this . readonly }
445
455
@change = ${ this . handleHueChange } >
446
456
</ uui- color - slider>
447
457
${ this . opacity
@@ -457,6 +467,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
457
467
this . lightness ,
458
468
) }
459
469
?dis abled= ${ this . disabled }
470
+ ?readonly = ${ this . readonly }
460
471
@change = ${ this . handleAlphaChange } >
461
472
</ uui- color - slider>
462
473
`
@@ -486,6 +497,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
486
497
spellcheck = "false"
487
498
.value = ${ live ( this . inputValue ) }
488
499
?dis abled= ${ this . disabled }
500
+ ?readonly = ${ this . readonly }
489
501
@keydown = ${ this . handleInputKeyDown }
490
502
@change = ${ this . handleInputChange } >
491
503
</ uui- input>
@@ -503,7 +515,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
503
515
${ hasEyeDropper
504
516
? html `<uui- butto n
505
517
label= "Select a color"
506
- ?dis abled= ${ this . disabled }
518
+ ?dis abled= ${ this . disabled || this . readonly }
507
519
@click = ${ this . handleEyeDropper }
508
520
compact>
509
521
<uui- icon- regis try- essential>
@@ -525,6 +537,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
525
537
class = "color - picker__swatches"
526
538
label= "Swatches"
527
539
?dis abled= ${ this . disabled }
540
+ ?readonly = ${ this . readonly }
528
541
@change = ${ this . handleColorSwatchChange } >
529
542
${ this . swatches . map (
530
543
swatch =>
0 commit comments