@ng-matero/extensions 12.5.3 → 12.6.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/_all-theme.scss +2 -0
- package/_index.scss +2 -0
- package/_theming.scss +2 -0
- package/bundles/extensions.umd.js +7 -7
- package/bundles/extensions.umd.js.map +1 -1
- package/bundles/mtxColorpicker.umd.js +1106 -0
- package/bundles/mtxColorpicker.umd.js.map +1 -0
- package/bundles/mtxDatetimepicker.umd.js +603 -148
- package/bundles/mtxDatetimepicker.umd.js.map +1 -1
- package/bundles/mtxDialog.umd.js +0 -2
- package/bundles/mtxDialog.umd.js.map +1 -1
- package/bundles/mtxFormGroup.umd.js +2 -9
- package/bundles/mtxFormGroup.umd.js.map +1 -1
- package/bundles/mtxSplit.umd.js +0 -13
- package/bundles/mtxSplit.umd.js.map +1 -1
- package/bundles/mtxText3d.umd.js +0 -8
- package/bundles/mtxText3d.umd.js.map +1 -1
- package/bundles/mtxTooltip.umd.js +2 -0
- package/bundles/mtxTooltip.umd.js.map +1 -1
- package/colorpicker/_colorpicker-theme.import.scss +2 -0
- package/colorpicker/_colorpicker-theme.scss +43 -0
- package/colorpicker/colorpicker-animations.d.ts +8 -0
- package/colorpicker/colorpicker-content.scss +4 -0
- package/colorpicker/colorpicker-input.d.ts +86 -0
- package/colorpicker/colorpicker-module.d.ts +2 -0
- package/colorpicker/colorpicker-toggle.d.ts +34 -0
- package/colorpicker/colorpicker-toggle.scss +23 -0
- package/colorpicker/colorpicker.d.ts +122 -0
- package/{color-picker/mtxColorPicker.d.ts → colorpicker/mtxColorpicker.d.ts} +0 -0
- package/colorpicker/mtxColorpicker.metadata.json +1 -0
- package/colorpicker/package.json +11 -0
- package/colorpicker/public-api.d.ts +5 -0
- package/datetimepicker/_datetimepicker-theme.scss +12 -0
- package/datetimepicker/calendar.d.ts +2 -10
- package/datetimepicker/clock.d.ts +10 -9
- package/datetimepicker/datetimepicker-animations.d.ts +7 -5
- package/datetimepicker/datetimepicker-input.d.ts +4 -2
- package/datetimepicker/{datetimepicker.module.d.ts → datetimepicker-module.d.ts} +0 -0
- package/datetimepicker/datetimepicker-toggle.d.ts +15 -2
- package/datetimepicker/datetimepicker-toggle.scss +23 -0
- package/datetimepicker/datetimepicker.d.ts +67 -24
- package/datetimepicker/month-view.d.ts +3 -3
- package/datetimepicker/mtxDatetimepicker.d.ts +0 -2
- package/datetimepicker/mtxDatetimepicker.metadata.json +1 -1
- package/datetimepicker/multi-year-view.d.ts +3 -3
- package/datetimepicker/public-api.d.ts +3 -1
- package/datetimepicker/year-view.d.ts +3 -3
- package/dialog/{dialog.config.d.ts → dialog-config.d.ts} +0 -0
- package/dialog/dialog.component.d.ts +1 -1
- package/dialog/dialog.d.ts +1 -1
- package/dialog/mtxDialog.metadata.json +1 -1
- package/dialog/public-api.d.ts +2 -2
- package/esm2015/colorpicker/colorpicker-animations.js +16 -0
- package/esm2015/colorpicker/colorpicker-input.js +225 -0
- package/esm2015/colorpicker/colorpicker-module.js +41 -0
- package/esm2015/colorpicker/colorpicker-toggle.js +98 -0
- package/esm2015/colorpicker/colorpicker.js +361 -0
- package/esm2015/colorpicker/mtxColorpicker.js +5 -0
- package/esm2015/colorpicker/public-api.js +6 -0
- package/esm2015/datetimepicker/calendar-body.js +2 -1
- package/esm2015/datetimepicker/calendar.js +14 -29
- package/esm2015/datetimepicker/clock.js +7 -7
- package/esm2015/datetimepicker/datetimepicker-animations.js +38 -24
- package/esm2015/datetimepicker/datetimepicker-input.js +6 -3
- package/esm2015/datetimepicker/datetimepicker-module.js +52 -0
- package/esm2015/datetimepicker/datetimepicker-toggle.js +30 -8
- package/esm2015/datetimepicker/datetimepicker.js +150 -71
- package/esm2015/datetimepicker/month-view.js +8 -7
- package/esm2015/datetimepicker/mtxDatetimepicker.js +1 -3
- package/esm2015/datetimepicker/multi-year-view.js +8 -7
- package/esm2015/datetimepicker/public-api.js +4 -2
- package/esm2015/datetimepicker/year-view.js +8 -7
- package/esm2015/dialog/{dialog.config.js → dialog-config.js} +1 -1
- package/esm2015/dialog/dialog.component.js +1 -1
- package/esm2015/dialog/dialog.js +1 -1
- package/esm2015/dialog/public-api.js +3 -3
- package/esm2015/extensions.module.js +3 -3
- package/esm2015/form-group/form-group.component.js +4 -11
- package/esm2015/public-api.js +2 -2
- package/esm2015/split/split.component.js +1 -9
- package/esm2015/split/utils.js +1 -6
- package/esm2015/text3d/text3d.component.js +1 -9
- package/esm2015/tooltip/tooltip.js +3 -1
- package/extensions.metadata.json +1 -1
- package/fesm2015/extensions.js +3 -3
- package/fesm2015/extensions.js.map +1 -1
- package/fesm2015/mtxColorpicker.js +730 -0
- package/fesm2015/mtxColorpicker.js.map +1 -0
- package/fesm2015/mtxDatetimepicker.js +259 -146
- package/fesm2015/mtxDatetimepicker.js.map +1 -1
- package/fesm2015/mtxDialog.js +1 -1
- package/fesm2015/mtxDialog.js.map +1 -1
- package/fesm2015/mtxFormGroup.js +3 -10
- package/fesm2015/mtxFormGroup.js.map +1 -1
- package/fesm2015/mtxSplit.js +0 -13
- package/fesm2015/mtxSplit.js.map +1 -1
- package/fesm2015/mtxText3d.js +0 -8
- package/fesm2015/mtxText3d.js.map +1 -1
- package/fesm2015/mtxTooltip.js +2 -0
- package/fesm2015/mtxTooltip.js.map +1 -1
- package/form-group/form-group.component.d.ts +2 -4
- package/form-group/mtxFormGroup.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/split/mtxSplit.metadata.json +1 -1
- package/text3d/mtxText3d.metadata.json +1 -1
- package/text3d/text3d.component.d.ts +0 -1
- package/tooltip/mtxTooltip.metadata.json +1 -1
- package/bundles/mtxColorPicker.umd.js +0 -337
- package/bundles/mtxColorPicker.umd.js.map +0 -1
- package/color-picker/color-picker.component.d.ts +0 -120
- package/color-picker/color-picker.module.d.ts +0 -2
- package/color-picker/mtxColorPicker.metadata.json +0 -1
- package/color-picker/package.json +0 -11
- package/color-picker/public-api.d.ts +0 -2
- package/esm2015/color-picker/color-picker.component.js +0 -268
- package/esm2015/color-picker/color-picker.module.js +0 -26
- package/esm2015/color-picker/mtxColorPicker.js +0 -5
- package/esm2015/color-picker/public-api.js +0 -3
- package/esm2015/datetimepicker/datetimepicker.module.js +0 -49
- package/fesm2015/mtxColorPicker.js +0 -295
- package/fesm2015/mtxColorPicker.js.map +0 -1
|
@@ -0,0 +1,1106 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/cdk/overlay'), require('@angular/cdk/a11y'), require('@angular/cdk/portal'), require('@angular/material/button'), require('@angular/cdk/coercion'), require('@angular/cdk/keycodes'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/input'), require('rxjs'), require('@angular/cdk/bidi'), require('@angular/material/core'), require('rxjs/operators'), require('@angular/animations'), require('@ctrl/tinycolor'), require('ngx-color/chrome')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@ng-matero/extensions/colorpicker', ['exports', '@angular/common', '@angular/core', '@angular/cdk/overlay', '@angular/cdk/a11y', '@angular/cdk/portal', '@angular/material/button', '@angular/cdk/coercion', '@angular/cdk/keycodes', '@angular/forms', '@angular/material/form-field', '@angular/material/input', 'rxjs', '@angular/cdk/bidi', '@angular/material/core', 'rxjs/operators', '@angular/animations', '@ctrl/tinycolor', 'ngx-color/chrome'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-matero"] = global["ng-matero"] || {}, global["ng-matero"].extensions = global["ng-matero"].extensions || {}, global["ng-matero"].extensions.colorpicker = {}), global.ng.common, global.ng.core, global.ng.cdk.overlay, global.ng.cdk.a11y, global.ng.cdk.portal, global.ng.material.button, global.ng.cdk.coercion, global.ng.cdk.keycodes, global.ng.forms, global.ng.material.formField, global.ng.material.input, global.rxjs, global.ng.cdk.bidi, global.ng.material.core, global.rxjs.operators, global.ng.animations, global.tinycolor, global["ngx-color-chrome"]));
|
|
5
|
+
})(this, (function (exports, common, core, overlay, a11y, portal, button, coercion, keycodes, forms, formField, input, rxjs, bidi, core$1, operators, animations, tinycolor, chrome) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var MtxColorPickerInputEvent = /** @class */ (function () {
|
|
8
|
+
function MtxColorPickerInputEvent(
|
|
9
|
+
/** Reference to the colorpicker input component that emitted the event. */
|
|
10
|
+
target,
|
|
11
|
+
/** Reference to the native input element associated with the colorpicker input. */
|
|
12
|
+
targetElement) {
|
|
13
|
+
this.target = target;
|
|
14
|
+
this.targetElement = targetElement;
|
|
15
|
+
this.value = this.target.value;
|
|
16
|
+
}
|
|
17
|
+
return MtxColorPickerInputEvent;
|
|
18
|
+
}());
|
|
19
|
+
var MTX_COLORPICKER_VALUE_ACCESSOR = {
|
|
20
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
21
|
+
useExisting: core.forwardRef(function () { return MtxColorpickerInput; }),
|
|
22
|
+
multi: true,
|
|
23
|
+
};
|
|
24
|
+
var MTX_COLORPICKER_VALIDATORS = {
|
|
25
|
+
provide: forms.NG_VALIDATORS,
|
|
26
|
+
useExisting: core.forwardRef(function () { return MtxColorpickerInput; }),
|
|
27
|
+
multi: true,
|
|
28
|
+
};
|
|
29
|
+
var MtxColorpickerInput = /** @class */ (function () {
|
|
30
|
+
function MtxColorpickerInput(_elementRef, _formField) {
|
|
31
|
+
this._elementRef = _elementRef;
|
|
32
|
+
this._formField = _formField;
|
|
33
|
+
/** Emits when a `change` event is fired on this `<input>`. */
|
|
34
|
+
this.colorChange = new core.EventEmitter();
|
|
35
|
+
/** Emits when an `input` event is fired on this `<input>`. */
|
|
36
|
+
this.colorInput = new core.EventEmitter();
|
|
37
|
+
/** Emits when the disabled state has changed */
|
|
38
|
+
this._disabledChange = new core.EventEmitter();
|
|
39
|
+
/** Emits when the value changes (either due to user input or programmatic change). */
|
|
40
|
+
this._valueChange = new core.EventEmitter();
|
|
41
|
+
this._onTouched = function () { };
|
|
42
|
+
this._validatorOnChange = function () { };
|
|
43
|
+
this._cvaOnChange = function () { };
|
|
44
|
+
this._pickerSubscription = rxjs.Subscription.EMPTY;
|
|
45
|
+
/** The combined form control validator for this input. */
|
|
46
|
+
this._validator = forms.Validators.compose([]);
|
|
47
|
+
/** Whether the last value set on the input was valid. */
|
|
48
|
+
this._lastValueValid = false;
|
|
49
|
+
}
|
|
50
|
+
Object.defineProperty(MtxColorpickerInput.prototype, "mtxColorpicker", {
|
|
51
|
+
set: function (value) {
|
|
52
|
+
var _this = this;
|
|
53
|
+
if (!value) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this._picker = value;
|
|
57
|
+
this._picker.registerInput(this);
|
|
58
|
+
this._pickerSubscription.unsubscribe();
|
|
59
|
+
this._pickerSubscription = this._picker._selectedChanged.subscribe(function (selected) {
|
|
60
|
+
_this.value = selected;
|
|
61
|
+
_this._cvaOnChange(selected);
|
|
62
|
+
_this._onTouched();
|
|
63
|
+
_this.colorInput.emit(new MtxColorPickerInputEvent(_this, _this._elementRef.nativeElement));
|
|
64
|
+
_this.colorChange.emit(new MtxColorPickerInputEvent(_this, _this._elementRef.nativeElement));
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
enumerable: false,
|
|
68
|
+
configurable: true
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(MtxColorpickerInput.prototype, "disabled", {
|
|
71
|
+
/** Whether the colorpicker-input is disabled. */
|
|
72
|
+
get: function () {
|
|
73
|
+
return !!this._disabled;
|
|
74
|
+
},
|
|
75
|
+
set: function (value) {
|
|
76
|
+
var newValue = coercion.coerceBooleanProperty(value);
|
|
77
|
+
var element = this._elementRef.nativeElement;
|
|
78
|
+
if (this._disabled !== newValue) {
|
|
79
|
+
this._disabled = newValue;
|
|
80
|
+
this._disabledChange.emit(newValue);
|
|
81
|
+
}
|
|
82
|
+
// We need to null check the `blur` method, because it's undefined during SSR.
|
|
83
|
+
// In Ivy static bindings are invoked earlier, before the element is attached to the DOM.
|
|
84
|
+
// This can cause an error to be thrown in some browsers (IE/Edge) which assert that the
|
|
85
|
+
// element has been inserted.
|
|
86
|
+
if (newValue && this._isInitialized && element.blur) {
|
|
87
|
+
// Normally, native input elements automatically blur if they turn disabled. This behavior
|
|
88
|
+
// is problematic, because it would mean that it triggers another change detection cycle,
|
|
89
|
+
// which then causes a changed after checked error if the input element was focused before.
|
|
90
|
+
element.blur();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
enumerable: false,
|
|
94
|
+
configurable: true
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(MtxColorpickerInput.prototype, "value", {
|
|
97
|
+
/** The value of the input. */
|
|
98
|
+
get: function () {
|
|
99
|
+
return this._value;
|
|
100
|
+
},
|
|
101
|
+
set: function (value) {
|
|
102
|
+
var oldValue = this.value;
|
|
103
|
+
this._value = value;
|
|
104
|
+
this._formatValue(value);
|
|
105
|
+
this._valueChange.emit(value);
|
|
106
|
+
},
|
|
107
|
+
enumerable: false,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
MtxColorpickerInput.prototype.ngAfterViewInit = function () {
|
|
111
|
+
this._isInitialized = true;
|
|
112
|
+
};
|
|
113
|
+
MtxColorpickerInput.prototype.ngOnDestroy = function () {
|
|
114
|
+
this._pickerSubscription.unsubscribe();
|
|
115
|
+
this._valueChange.complete();
|
|
116
|
+
this._disabledChange.complete();
|
|
117
|
+
};
|
|
118
|
+
MtxColorpickerInput.prototype.registerOnValidatorChange = function (fn) {
|
|
119
|
+
this._validatorOnChange = fn;
|
|
120
|
+
};
|
|
121
|
+
/** @docs-private */
|
|
122
|
+
MtxColorpickerInput.prototype.validate = function (c) {
|
|
123
|
+
return this._validator ? this._validator(c) : null;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated
|
|
127
|
+
* @breaking-change 8.0.0 Use `getConnectedOverlayOrigin` instead
|
|
128
|
+
*/
|
|
129
|
+
MtxColorpickerInput.prototype.getPopupConnectionElementRef = function () {
|
|
130
|
+
return this.getConnectedOverlayOrigin();
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Gets the element that the colorpicker popup should be connected to.
|
|
134
|
+
* @return The element to connect the popup to.
|
|
135
|
+
*/
|
|
136
|
+
MtxColorpickerInput.prototype.getConnectedOverlayOrigin = function () {
|
|
137
|
+
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
|
|
138
|
+
};
|
|
139
|
+
/** Gets the ID of an element that should be used a description for the overlay. */
|
|
140
|
+
MtxColorpickerInput.prototype.getOverlayLabelId = function () {
|
|
141
|
+
if (this._formField) {
|
|
142
|
+
return this._formField.getLabelId();
|
|
143
|
+
}
|
|
144
|
+
return this._elementRef.nativeElement.getAttribute('aria-labelledby');
|
|
145
|
+
};
|
|
146
|
+
// Implemented as part of ControlValueAccessor.
|
|
147
|
+
MtxColorpickerInput.prototype.writeValue = function (value) {
|
|
148
|
+
this.value = value;
|
|
149
|
+
};
|
|
150
|
+
// Implemented as part of ControlValueAccessor.
|
|
151
|
+
MtxColorpickerInput.prototype.registerOnChange = function (fn) {
|
|
152
|
+
this._cvaOnChange = fn;
|
|
153
|
+
};
|
|
154
|
+
// Implemented as part of ControlValueAccessor.
|
|
155
|
+
MtxColorpickerInput.prototype.registerOnTouched = function (fn) {
|
|
156
|
+
this._onTouched = fn;
|
|
157
|
+
};
|
|
158
|
+
// Implemented as part of ControlValueAccessor.
|
|
159
|
+
MtxColorpickerInput.prototype.setDisabledState = function (isDisabled) {
|
|
160
|
+
this.disabled = isDisabled;
|
|
161
|
+
};
|
|
162
|
+
MtxColorpickerInput.prototype._onKeydown = function (event) {
|
|
163
|
+
var isAltDownArrow = event.altKey && event.keyCode === keycodes.DOWN_ARROW;
|
|
164
|
+
if (this._picker && isAltDownArrow && !this._elementRef.nativeElement.readOnly) {
|
|
165
|
+
this._picker.open();
|
|
166
|
+
event.preventDefault();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
/** Handles blur events on the input. */
|
|
170
|
+
MtxColorpickerInput.prototype._onBlur = function () {
|
|
171
|
+
// Reformat the input only if we have a valid value.
|
|
172
|
+
if (this.value) {
|
|
173
|
+
this._formatValue(this.value);
|
|
174
|
+
}
|
|
175
|
+
this._onTouched();
|
|
176
|
+
};
|
|
177
|
+
MtxColorpickerInput.prototype._onInput = function (value) {
|
|
178
|
+
var nextValue = value;
|
|
179
|
+
this._value = nextValue;
|
|
180
|
+
this._cvaOnChange(nextValue);
|
|
181
|
+
this._valueChange.emit(nextValue);
|
|
182
|
+
this.colorInput.emit(new MtxColorPickerInputEvent(this, this._elementRef.nativeElement));
|
|
183
|
+
};
|
|
184
|
+
MtxColorpickerInput.prototype._onChange = function () {
|
|
185
|
+
this.colorChange.emit(new MtxColorPickerInputEvent(this, this._elementRef.nativeElement));
|
|
186
|
+
};
|
|
187
|
+
/** Returns the palette used by the input's form field, if any. */
|
|
188
|
+
MtxColorpickerInput.prototype.getThemePalette = function () {
|
|
189
|
+
return this._formField ? this._formField.color : undefined;
|
|
190
|
+
};
|
|
191
|
+
/** TODO: Formats a value and sets it on the input element. */
|
|
192
|
+
MtxColorpickerInput.prototype._formatValue = function (value) {
|
|
193
|
+
this._elementRef.nativeElement.value = value ? value : '';
|
|
194
|
+
};
|
|
195
|
+
return MtxColorpickerInput;
|
|
196
|
+
}());
|
|
197
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
198
|
+
MtxColorpickerInput.decorators = [
|
|
199
|
+
{ type: core.Directive, args: [{
|
|
200
|
+
selector: 'input[mtxColorpicker]',
|
|
201
|
+
providers: [
|
|
202
|
+
MTX_COLORPICKER_VALUE_ACCESSOR,
|
|
203
|
+
MTX_COLORPICKER_VALIDATORS,
|
|
204
|
+
{ provide: input.MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxColorpickerInput },
|
|
205
|
+
],
|
|
206
|
+
host: {
|
|
207
|
+
'class': 'mtx-colorpicker-input',
|
|
208
|
+
'[attr.aria-haspopup]': '_picker ? "dialog" : null',
|
|
209
|
+
'[attr.aria-owns]': '(_picker?.opened && _picker.id) || null',
|
|
210
|
+
'[disabled]': 'disabled',
|
|
211
|
+
'(input)': '_onInput($event.target.value)',
|
|
212
|
+
'(change)': '_onChange()',
|
|
213
|
+
'(blur)': '_onBlur()',
|
|
214
|
+
'(keydown)': '_onKeydown($event)',
|
|
215
|
+
},
|
|
216
|
+
exportAs: 'mtxColorpickerInput',
|
|
217
|
+
},] }
|
|
218
|
+
];
|
|
219
|
+
/**
|
|
220
|
+
* @type {function(): !Array<(null|{
|
|
221
|
+
* type: ?,
|
|
222
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
223
|
+
* })>}
|
|
224
|
+
* @nocollapse
|
|
225
|
+
*/
|
|
226
|
+
MtxColorpickerInput.ctorParameters = function () { return [
|
|
227
|
+
{ type: core.ElementRef },
|
|
228
|
+
{ type: formField.MatFormField, decorators: [{ type: core.Optional }] }
|
|
229
|
+
]; };
|
|
230
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
231
|
+
MtxColorpickerInput.propDecorators = {
|
|
232
|
+
mtxColorpicker: [{ type: core.Input }],
|
|
233
|
+
disabled: [{ type: core.Input }],
|
|
234
|
+
value: [{ type: core.Input }],
|
|
235
|
+
colorChange: [{ type: core.Output }],
|
|
236
|
+
colorInput: [{ type: core.Output }]
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/** Can be used to override the icon of a `mtxColorpickerToggle`. */
|
|
240
|
+
var MtxColorpickerToggleIcon = /** @class */ (function () {
|
|
241
|
+
function MtxColorpickerToggleIcon() {
|
|
242
|
+
}
|
|
243
|
+
return MtxColorpickerToggleIcon;
|
|
244
|
+
}());
|
|
245
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
246
|
+
MtxColorpickerToggleIcon.decorators = [
|
|
247
|
+
{ type: core.Directive, args: [{
|
|
248
|
+
selector: '[mtxColorpickerToggleIcon]',
|
|
249
|
+
},] }
|
|
250
|
+
];
|
|
251
|
+
var MtxColorpickerToggle = /** @class */ (function () {
|
|
252
|
+
function MtxColorpickerToggle(_changeDetectorRef) {
|
|
253
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
254
|
+
this._stateChanges = rxjs.Subscription.EMPTY;
|
|
255
|
+
}
|
|
256
|
+
Object.defineProperty(MtxColorpickerToggle.prototype, "disabled", {
|
|
257
|
+
/** Whether the toggle button is disabled. */
|
|
258
|
+
get: function () {
|
|
259
|
+
if (this._disabled == null && this.picker) {
|
|
260
|
+
return this.picker.disabled;
|
|
261
|
+
}
|
|
262
|
+
return !!this._disabled;
|
|
263
|
+
},
|
|
264
|
+
set: function (value) {
|
|
265
|
+
this._disabled = coercion.coerceBooleanProperty(value);
|
|
266
|
+
},
|
|
267
|
+
enumerable: false,
|
|
268
|
+
configurable: true
|
|
269
|
+
});
|
|
270
|
+
MtxColorpickerToggle.prototype.ngOnInit = function () { };
|
|
271
|
+
MtxColorpickerToggle.prototype.ngOnChanges = function (changes) {
|
|
272
|
+
if (changes.picker) {
|
|
273
|
+
this._watchStateChanges();
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
MtxColorpickerToggle.prototype.ngOnDestroy = function () {
|
|
277
|
+
this._stateChanges.unsubscribe();
|
|
278
|
+
};
|
|
279
|
+
MtxColorpickerToggle.prototype.ngAfterContentInit = function () {
|
|
280
|
+
this._watchStateChanges();
|
|
281
|
+
};
|
|
282
|
+
MtxColorpickerToggle.prototype.open = function (event) {
|
|
283
|
+
if (this.picker && !this.disabled) {
|
|
284
|
+
this.picker.open();
|
|
285
|
+
event.stopPropagation();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
MtxColorpickerToggle.prototype._watchStateChanges = function () {
|
|
289
|
+
var _this = this;
|
|
290
|
+
var pickerDisabled = this.picker ? this.picker._disabledChange : rxjs.of();
|
|
291
|
+
var inputDisabled = this.picker && this.picker.pickerInput ? this.picker.pickerInput._disabledChange : rxjs.of();
|
|
292
|
+
var datepickerToggled = this.picker
|
|
293
|
+
? rxjs.merge(this.picker.openedStream, this.picker.closedStream)
|
|
294
|
+
: rxjs.of();
|
|
295
|
+
this._stateChanges.unsubscribe();
|
|
296
|
+
this._stateChanges = rxjs.merge(pickerDisabled, inputDisabled, datepickerToggled).subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
|
|
297
|
+
};
|
|
298
|
+
return MtxColorpickerToggle;
|
|
299
|
+
}());
|
|
300
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
301
|
+
MtxColorpickerToggle.decorators = [
|
|
302
|
+
{ type: core.Component, args: [{
|
|
303
|
+
selector: 'mtx-colorpicker-toggle',
|
|
304
|
+
template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"picker ? 'dialog' : null\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"open($event)\">\n\n <svg *ngIf=\"!_customIcon\"\n class=\"mtx-colorpicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z\" />\n </svg>\n\n <ng-content select=\"[mtxColorpickerToggleIcon]\"></ng-content>\n</button>\n",
|
|
305
|
+
host: {
|
|
306
|
+
'class': 'mtx-colorpicker-toggle',
|
|
307
|
+
// Always set the tabindex to -1 so that it doesn't overlap with any custom tabindex the
|
|
308
|
+
// consumer may have provided, while still being able to receive focus.
|
|
309
|
+
'[attr.tabindex]': 'disabled ? null : -1',
|
|
310
|
+
'[class.mtx-colorpicker-toggle-active]': 'picker && picker.opened',
|
|
311
|
+
'[class.mat-accent]': 'picker && picker.color === "accent"',
|
|
312
|
+
'[class.mat-warn]': 'picker && picker.color === "warn"',
|
|
313
|
+
'(focus)': '_button.focus()',
|
|
314
|
+
},
|
|
315
|
+
exportAs: 'mtxColorpickerToggle',
|
|
316
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
317
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
318
|
+
styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-colorpicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-colorpicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-colorpicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-colorpicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-colorpicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-colorpicker-toggle-default-icon{margin:auto}\n"]
|
|
319
|
+
},] }
|
|
320
|
+
];
|
|
321
|
+
/**
|
|
322
|
+
* @type {function(): !Array<(null|{
|
|
323
|
+
* type: ?,
|
|
324
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
325
|
+
* })>}
|
|
326
|
+
* @nocollapse
|
|
327
|
+
*/
|
|
328
|
+
MtxColorpickerToggle.ctorParameters = function () { return [
|
|
329
|
+
{ type: core.ChangeDetectorRef }
|
|
330
|
+
]; };
|
|
331
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
332
|
+
MtxColorpickerToggle.propDecorators = {
|
|
333
|
+
picker: [{ type: core.Input, args: ['for',] }],
|
|
334
|
+
tabIndex: [{ type: core.Input }],
|
|
335
|
+
disabled: [{ type: core.Input }],
|
|
336
|
+
disableRipple: [{ type: core.Input }],
|
|
337
|
+
_customIcon: [{ type: core.ContentChild, args: [MtxColorpickerToggleIcon,] }],
|
|
338
|
+
_button: [{ type: core.ViewChild, args: ['button',] }]
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/*! *****************************************************************************
|
|
342
|
+
Copyright (c) Microsoft Corporation.
|
|
343
|
+
|
|
344
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
345
|
+
purpose with or without fee is hereby granted.
|
|
346
|
+
|
|
347
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
348
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
349
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
350
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
351
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
352
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
353
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
354
|
+
***************************************************************************** */
|
|
355
|
+
/* global Reflect, Promise */
|
|
356
|
+
var extendStatics = function (d, b) {
|
|
357
|
+
extendStatics = Object.setPrototypeOf ||
|
|
358
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
359
|
+
function (d, b) { for (var p in b)
|
|
360
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
361
|
+
d[p] = b[p]; };
|
|
362
|
+
return extendStatics(d, b);
|
|
363
|
+
};
|
|
364
|
+
function __extends(d, b) {
|
|
365
|
+
if (typeof b !== "function" && b !== null)
|
|
366
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
367
|
+
extendStatics(d, b);
|
|
368
|
+
function __() { this.constructor = d; }
|
|
369
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
370
|
+
}
|
|
371
|
+
var __assign = function () {
|
|
372
|
+
__assign = Object.assign || function __assign(t) {
|
|
373
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
374
|
+
s = arguments[i];
|
|
375
|
+
for (var p in s)
|
|
376
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
377
|
+
t[p] = s[p];
|
|
378
|
+
}
|
|
379
|
+
return t;
|
|
380
|
+
};
|
|
381
|
+
return __assign.apply(this, arguments);
|
|
382
|
+
};
|
|
383
|
+
function __rest(s, e) {
|
|
384
|
+
var t = {};
|
|
385
|
+
for (var p in s)
|
|
386
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
387
|
+
t[p] = s[p];
|
|
388
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
389
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
390
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
391
|
+
t[p[i]] = s[p[i]];
|
|
392
|
+
}
|
|
393
|
+
return t;
|
|
394
|
+
}
|
|
395
|
+
function __decorate(decorators, target, key, desc) {
|
|
396
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
397
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
398
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
399
|
+
else
|
|
400
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
401
|
+
if (d = decorators[i])
|
|
402
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
403
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
404
|
+
}
|
|
405
|
+
function __param(paramIndex, decorator) {
|
|
406
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
407
|
+
}
|
|
408
|
+
function __metadata(metadataKey, metadataValue) {
|
|
409
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
410
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
411
|
+
}
|
|
412
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
413
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
414
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
415
|
+
function fulfilled(value) { try {
|
|
416
|
+
step(generator.next(value));
|
|
417
|
+
}
|
|
418
|
+
catch (e) {
|
|
419
|
+
reject(e);
|
|
420
|
+
} }
|
|
421
|
+
function rejected(value) { try {
|
|
422
|
+
step(generator["throw"](value));
|
|
423
|
+
}
|
|
424
|
+
catch (e) {
|
|
425
|
+
reject(e);
|
|
426
|
+
} }
|
|
427
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
428
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function __generator(thisArg, body) {
|
|
432
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
433
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
434
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
435
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
436
|
+
function step(op) {
|
|
437
|
+
if (f)
|
|
438
|
+
throw new TypeError("Generator is already executing.");
|
|
439
|
+
while (_)
|
|
440
|
+
try {
|
|
441
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
442
|
+
return t;
|
|
443
|
+
if (y = 0, t)
|
|
444
|
+
op = [op[0] & 2, t.value];
|
|
445
|
+
switch (op[0]) {
|
|
446
|
+
case 0:
|
|
447
|
+
case 1:
|
|
448
|
+
t = op;
|
|
449
|
+
break;
|
|
450
|
+
case 4:
|
|
451
|
+
_.label++;
|
|
452
|
+
return { value: op[1], done: false };
|
|
453
|
+
case 5:
|
|
454
|
+
_.label++;
|
|
455
|
+
y = op[1];
|
|
456
|
+
op = [0];
|
|
457
|
+
continue;
|
|
458
|
+
case 7:
|
|
459
|
+
op = _.ops.pop();
|
|
460
|
+
_.trys.pop();
|
|
461
|
+
continue;
|
|
462
|
+
default:
|
|
463
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
464
|
+
_ = 0;
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
468
|
+
_.label = op[1];
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
472
|
+
_.label = t[1];
|
|
473
|
+
t = op;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
if (t && _.label < t[2]) {
|
|
477
|
+
_.label = t[2];
|
|
478
|
+
_.ops.push(op);
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
if (t[2])
|
|
482
|
+
_.ops.pop();
|
|
483
|
+
_.trys.pop();
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
op = body.call(thisArg, _);
|
|
487
|
+
}
|
|
488
|
+
catch (e) {
|
|
489
|
+
op = [6, e];
|
|
490
|
+
y = 0;
|
|
491
|
+
}
|
|
492
|
+
finally {
|
|
493
|
+
f = t = 0;
|
|
494
|
+
}
|
|
495
|
+
if (op[0] & 5)
|
|
496
|
+
throw op[1];
|
|
497
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
501
|
+
if (k2 === undefined)
|
|
502
|
+
k2 = k;
|
|
503
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
504
|
+
}) : (function (o, m, k, k2) {
|
|
505
|
+
if (k2 === undefined)
|
|
506
|
+
k2 = k;
|
|
507
|
+
o[k2] = m[k];
|
|
508
|
+
});
|
|
509
|
+
function __exportStar(m, o) {
|
|
510
|
+
for (var p in m)
|
|
511
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
512
|
+
__createBinding(o, m, p);
|
|
513
|
+
}
|
|
514
|
+
function __values(o) {
|
|
515
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
516
|
+
if (m)
|
|
517
|
+
return m.call(o);
|
|
518
|
+
if (o && typeof o.length === "number")
|
|
519
|
+
return {
|
|
520
|
+
next: function () {
|
|
521
|
+
if (o && i >= o.length)
|
|
522
|
+
o = void 0;
|
|
523
|
+
return { value: o && o[i++], done: !o };
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
527
|
+
}
|
|
528
|
+
function __read(o, n) {
|
|
529
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
530
|
+
if (!m)
|
|
531
|
+
return o;
|
|
532
|
+
var i = m.call(o), r, ar = [], e;
|
|
533
|
+
try {
|
|
534
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
535
|
+
ar.push(r.value);
|
|
536
|
+
}
|
|
537
|
+
catch (error) {
|
|
538
|
+
e = { error: error };
|
|
539
|
+
}
|
|
540
|
+
finally {
|
|
541
|
+
try {
|
|
542
|
+
if (r && !r.done && (m = i["return"]))
|
|
543
|
+
m.call(i);
|
|
544
|
+
}
|
|
545
|
+
finally {
|
|
546
|
+
if (e)
|
|
547
|
+
throw e.error;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return ar;
|
|
551
|
+
}
|
|
552
|
+
/** @deprecated */
|
|
553
|
+
function __spread() {
|
|
554
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
555
|
+
ar = ar.concat(__read(arguments[i]));
|
|
556
|
+
return ar;
|
|
557
|
+
}
|
|
558
|
+
/** @deprecated */
|
|
559
|
+
function __spreadArrays() {
|
|
560
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
561
|
+
s += arguments[i].length;
|
|
562
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
563
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
564
|
+
r[k] = a[j];
|
|
565
|
+
return r;
|
|
566
|
+
}
|
|
567
|
+
function __spreadArray(to, from, pack) {
|
|
568
|
+
if (pack || arguments.length === 2)
|
|
569
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
570
|
+
if (ar || !(i in from)) {
|
|
571
|
+
if (!ar)
|
|
572
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
573
|
+
ar[i] = from[i];
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return to.concat(ar || from);
|
|
577
|
+
}
|
|
578
|
+
function __await(v) {
|
|
579
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
580
|
+
}
|
|
581
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
582
|
+
if (!Symbol.asyncIterator)
|
|
583
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
584
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
585
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
586
|
+
function verb(n) { if (g[n])
|
|
587
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
588
|
+
function resume(n, v) { try {
|
|
589
|
+
step(g[n](v));
|
|
590
|
+
}
|
|
591
|
+
catch (e) {
|
|
592
|
+
settle(q[0][3], e);
|
|
593
|
+
} }
|
|
594
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
595
|
+
function fulfill(value) { resume("next", value); }
|
|
596
|
+
function reject(value) { resume("throw", value); }
|
|
597
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
598
|
+
resume(q[0][0], q[0][1]); }
|
|
599
|
+
}
|
|
600
|
+
function __asyncDelegator(o) {
|
|
601
|
+
var i, p;
|
|
602
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
603
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
604
|
+
}
|
|
605
|
+
function __asyncValues(o) {
|
|
606
|
+
if (!Symbol.asyncIterator)
|
|
607
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
608
|
+
var m = o[Symbol.asyncIterator], i;
|
|
609
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
610
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
611
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
612
|
+
}
|
|
613
|
+
function __makeTemplateObject(cooked, raw) {
|
|
614
|
+
if (Object.defineProperty) {
|
|
615
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
cooked.raw = raw;
|
|
619
|
+
}
|
|
620
|
+
return cooked;
|
|
621
|
+
}
|
|
622
|
+
;
|
|
623
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
624
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
625
|
+
}) : function (o, v) {
|
|
626
|
+
o["default"] = v;
|
|
627
|
+
};
|
|
628
|
+
function __importStar(mod) {
|
|
629
|
+
if (mod && mod.__esModule)
|
|
630
|
+
return mod;
|
|
631
|
+
var result = {};
|
|
632
|
+
if (mod != null)
|
|
633
|
+
for (var k in mod)
|
|
634
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
635
|
+
__createBinding(result, mod, k);
|
|
636
|
+
__setModuleDefault(result, mod);
|
|
637
|
+
return result;
|
|
638
|
+
}
|
|
639
|
+
function __importDefault(mod) {
|
|
640
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
641
|
+
}
|
|
642
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
643
|
+
if (kind === "a" && !f)
|
|
644
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
645
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
646
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
647
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
648
|
+
}
|
|
649
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
650
|
+
if (kind === "m")
|
|
651
|
+
throw new TypeError("Private method is not writable");
|
|
652
|
+
if (kind === "a" && !f)
|
|
653
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
654
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
655
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
656
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Animations used by the colorpicker.
|
|
661
|
+
* @docs-private
|
|
662
|
+
*/
|
|
663
|
+
var mtxColorpickerAnimations = {
|
|
664
|
+
/** Transforms the height of the colorpicker's panel. */
|
|
665
|
+
transformPanel: animations.trigger('transformPanel', [
|
|
666
|
+
animations.transition('void => enter-dropdown', animations.animate('120ms cubic-bezier(0, 0, 0.2, 1)', animations.keyframes([
|
|
667
|
+
animations.style({ opacity: 0, transform: 'scale(1, 0.8)' }),
|
|
668
|
+
animations.style({ opacity: 1, transform: 'scale(1, 1)' }),
|
|
669
|
+
]))),
|
|
670
|
+
animations.transition('* => void', animations.animate('100ms linear', animations.style({ opacity: 0 }))),
|
|
671
|
+
]),
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
/** Used to generate a unique ID for each colorpicker instance. */
|
|
675
|
+
var colorpickerUid = 0;
|
|
676
|
+
/** Injection token that determines the scroll handling while the panel is open. */
|
|
677
|
+
var MTX_COLORPICKER_SCROLL_STRATEGY = new core.InjectionToken('mtx-colorpicker-scroll-strategy');
|
|
678
|
+
function MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
679
|
+
return function () { return overlay.scrollStrategies.reposition(); };
|
|
680
|
+
}
|
|
681
|
+
var MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
682
|
+
provide: MTX_COLORPICKER_SCROLL_STRATEGY,
|
|
683
|
+
deps: [overlay.Overlay],
|
|
684
|
+
useFactory: MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY,
|
|
685
|
+
};
|
|
686
|
+
// Boilerplate for applying mixins to MtxColorpickerContent.
|
|
687
|
+
/** @docs-private */
|
|
688
|
+
var _MtxColorpickerContentBase = core$1.mixinColor(/** @class */ (function () {
|
|
689
|
+
function class_1(_elementRef) {
|
|
690
|
+
this._elementRef = _elementRef;
|
|
691
|
+
}
|
|
692
|
+
return class_1;
|
|
693
|
+
}()));
|
|
694
|
+
var MtxColorpickerContent = /** @class */ (function (_super) {
|
|
695
|
+
__extends(MtxColorpickerContent, _super);
|
|
696
|
+
function MtxColorpickerContent(elementRef, _changeDetectorRef) {
|
|
697
|
+
var _this = _super.call(this, elementRef) || this;
|
|
698
|
+
_this._changeDetectorRef = _changeDetectorRef;
|
|
699
|
+
/** Current state of the animation. */
|
|
700
|
+
_this._animationState = 'enter-dropdown';
|
|
701
|
+
/** Emits when an animation has finished. */
|
|
702
|
+
_this._animationDone = new rxjs.Subject();
|
|
703
|
+
return _this;
|
|
704
|
+
}
|
|
705
|
+
MtxColorpickerContent.prototype._startExitAnimation = function () {
|
|
706
|
+
this._animationState = 'void';
|
|
707
|
+
this._changeDetectorRef.markForCheck();
|
|
708
|
+
};
|
|
709
|
+
MtxColorpickerContent.prototype.ngOnDestroy = function () {
|
|
710
|
+
this._animationDone.complete();
|
|
711
|
+
};
|
|
712
|
+
// https://github.com/scttcper/ngx-color/issues/292
|
|
713
|
+
MtxColorpickerContent.prototype.getHex8 = function (e) {
|
|
714
|
+
var alpha = e.color.rgb.a;
|
|
715
|
+
return alpha === 1 ? e.color.hex : new tinycolor.TinyColor(e.color.rgb).toHex8String();
|
|
716
|
+
};
|
|
717
|
+
return MtxColorpickerContent;
|
|
718
|
+
}(_MtxColorpickerContentBase));
|
|
719
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
720
|
+
MtxColorpickerContent.decorators = [
|
|
721
|
+
{ type: core.Component, args: [{
|
|
722
|
+
selector: 'mtx-colorpicker-content',
|
|
723
|
+
template: "<ng-template [ngIf]=\"picker.content\" [ngIfElse]=\"default\"\n [ngTemplateOutlet]=\"picker.content\">\n</ng-template>\n<ng-template #default>\n <color-chrome [color]=\"picker.selected\"\n (onChangeComplete)=\"picker.select(getHex8($event))\">\n </color-chrome>\n</ng-template>\n",
|
|
724
|
+
host: {
|
|
725
|
+
'class': 'mtx-colorpicker-content',
|
|
726
|
+
'[@transformPanel]': '_animationState',
|
|
727
|
+
'(@transformPanel.done)': '_animationDone.next()',
|
|
728
|
+
},
|
|
729
|
+
animations: [mtxColorpickerAnimations.transformPanel],
|
|
730
|
+
exportAs: 'mtxColorpickerContent',
|
|
731
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
732
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
733
|
+
inputs: ['color'],
|
|
734
|
+
styles: [".mtx-colorpicker-content{display:block;border-radius:4px}\n"]
|
|
735
|
+
},] }
|
|
736
|
+
];
|
|
737
|
+
/**
|
|
738
|
+
* @type {function(): !Array<(null|{
|
|
739
|
+
* type: ?,
|
|
740
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
741
|
+
* })>}
|
|
742
|
+
* @nocollapse
|
|
743
|
+
*/
|
|
744
|
+
MtxColorpickerContent.ctorParameters = function () { return [
|
|
745
|
+
{ type: core.ElementRef },
|
|
746
|
+
{ type: core.ChangeDetectorRef }
|
|
747
|
+
]; };
|
|
748
|
+
var MtxColorpicker = /** @class */ (function () {
|
|
749
|
+
function MtxColorpicker(_overlay, _ngZone, _viewContainerRef, scrollStrategy, _dir, _document) {
|
|
750
|
+
this._overlay = _overlay;
|
|
751
|
+
this._ngZone = _ngZone;
|
|
752
|
+
this._viewContainerRef = _viewContainerRef;
|
|
753
|
+
this._dir = _dir;
|
|
754
|
+
this._document = _document;
|
|
755
|
+
this._inputStateChanges = rxjs.Subscription.EMPTY;
|
|
756
|
+
/** Emits when the colorpicker has been opened. */
|
|
757
|
+
this.openedStream = new core.EventEmitter();
|
|
758
|
+
/** Emits when the colorpicker has been closed. */
|
|
759
|
+
this.closedStream = new core.EventEmitter();
|
|
760
|
+
/** Preferred position of the colorpicker in the X axis. */
|
|
761
|
+
this.xPosition = 'start';
|
|
762
|
+
/** Preferred position of the colorpicker in the Y axis. */
|
|
763
|
+
this.yPosition = 'below';
|
|
764
|
+
this._restoreFocus = true;
|
|
765
|
+
this._opened = false;
|
|
766
|
+
/** The id for the colorpicker panel. */
|
|
767
|
+
this.id = "mtx-colorpicker-" + colorpickerUid++;
|
|
768
|
+
this._validSelected = '';
|
|
769
|
+
/** The element that was focused before the colorpicker was opened. */
|
|
770
|
+
this._focusedElementBeforeOpen = null;
|
|
771
|
+
/** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
|
|
772
|
+
this._backdropHarnessClass = this.id + "-backdrop";
|
|
773
|
+
/** Emits when the datepicker is disabled. */
|
|
774
|
+
this._disabledChange = new rxjs.Subject();
|
|
775
|
+
/** Emits new selected color when selected color changes. */
|
|
776
|
+
this._selectedChanged = new rxjs.Subject();
|
|
777
|
+
this._scrollStrategy = scrollStrategy;
|
|
778
|
+
}
|
|
779
|
+
Object.defineProperty(MtxColorpicker.prototype, "disabled", {
|
|
780
|
+
get: function () {
|
|
781
|
+
return this._disabled === undefined && this.pickerInput
|
|
782
|
+
? this.pickerInput.disabled
|
|
783
|
+
: !!this._disabled;
|
|
784
|
+
},
|
|
785
|
+
set: function (value) {
|
|
786
|
+
var newValue = coercion.coerceBooleanProperty(value);
|
|
787
|
+
if (newValue !== this._disabled) {
|
|
788
|
+
this._disabled = newValue;
|
|
789
|
+
this._disabledChange.next(newValue);
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
enumerable: false,
|
|
793
|
+
configurable: true
|
|
794
|
+
});
|
|
795
|
+
Object.defineProperty(MtxColorpicker.prototype, "restoreFocus", {
|
|
796
|
+
/**
|
|
797
|
+
* Whether to restore focus to the previously-focused element when the panel is closed.
|
|
798
|
+
* Note that automatic focus restoration is an accessibility feature and it is recommended that
|
|
799
|
+
* you provide your own equivalent, if you decide to turn it off.
|
|
800
|
+
*/
|
|
801
|
+
get: function () {
|
|
802
|
+
return this._restoreFocus;
|
|
803
|
+
},
|
|
804
|
+
set: function (value) {
|
|
805
|
+
this._restoreFocus = coercion.coerceBooleanProperty(value);
|
|
806
|
+
},
|
|
807
|
+
enumerable: false,
|
|
808
|
+
configurable: true
|
|
809
|
+
});
|
|
810
|
+
Object.defineProperty(MtxColorpicker.prototype, "opened", {
|
|
811
|
+
/** Whether the panel is open. */
|
|
812
|
+
get: function () {
|
|
813
|
+
return this._opened;
|
|
814
|
+
},
|
|
815
|
+
set: function (value) {
|
|
816
|
+
coercion.coerceBooleanProperty(value) ? this.open() : this.close();
|
|
817
|
+
},
|
|
818
|
+
enumerable: false,
|
|
819
|
+
configurable: true
|
|
820
|
+
});
|
|
821
|
+
Object.defineProperty(MtxColorpicker.prototype, "color", {
|
|
822
|
+
/** Color palette to use on the colorpicker's panel. */
|
|
823
|
+
get: function () {
|
|
824
|
+
return this._color || (this.pickerInput ? this.pickerInput.getThemePalette() : undefined);
|
|
825
|
+
},
|
|
826
|
+
set: function (value) {
|
|
827
|
+
this._color = value;
|
|
828
|
+
},
|
|
829
|
+
enumerable: false,
|
|
830
|
+
configurable: true
|
|
831
|
+
});
|
|
832
|
+
Object.defineProperty(MtxColorpicker.prototype, "selected", {
|
|
833
|
+
/** The currently selected color. */
|
|
834
|
+
get: function () {
|
|
835
|
+
return this._validSelected;
|
|
836
|
+
},
|
|
837
|
+
set: function (value) {
|
|
838
|
+
this._validSelected = value;
|
|
839
|
+
},
|
|
840
|
+
enumerable: false,
|
|
841
|
+
configurable: true
|
|
842
|
+
});
|
|
843
|
+
MtxColorpicker.prototype.ngOnChanges = function () { };
|
|
844
|
+
MtxColorpicker.prototype.ngOnDestroy = function () {
|
|
845
|
+
this._destroyOverlay();
|
|
846
|
+
this.close();
|
|
847
|
+
this._inputStateChanges.unsubscribe();
|
|
848
|
+
this._disabledChange.complete();
|
|
849
|
+
};
|
|
850
|
+
/** Selects the given color */
|
|
851
|
+
MtxColorpicker.prototype.select = function (nextVal) {
|
|
852
|
+
var oldValue = this.selected;
|
|
853
|
+
this.selected = nextVal;
|
|
854
|
+
// TODO: `nextVal` should compare with `oldValue`
|
|
855
|
+
this._selectedChanged.next(nextVal);
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Register an input with this colorpicker.
|
|
859
|
+
* @param input The colorpicker input to register with this colorpicker.
|
|
860
|
+
*/
|
|
861
|
+
MtxColorpicker.prototype.registerInput = function (input) {
|
|
862
|
+
var _this = this;
|
|
863
|
+
if (this.pickerInput) {
|
|
864
|
+
throw Error('A Colorpicker can only be associated with a single input.');
|
|
865
|
+
}
|
|
866
|
+
this.pickerInput = input;
|
|
867
|
+
this._inputStateChanges = input._valueChange.subscribe(function (value) { return (_this.selected = value); });
|
|
868
|
+
};
|
|
869
|
+
MtxColorpicker.prototype.open = function () {
|
|
870
|
+
if (this._opened || this.disabled) {
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
if (!this.pickerInput) {
|
|
874
|
+
throw Error('Attempted to open an Colorpicker with no associated input.');
|
|
875
|
+
}
|
|
876
|
+
if (this._document) {
|
|
877
|
+
this._focusedElementBeforeOpen = this._document.activeElement;
|
|
878
|
+
}
|
|
879
|
+
this._openOverlay();
|
|
880
|
+
this._opened = true;
|
|
881
|
+
this.openedStream.emit();
|
|
882
|
+
};
|
|
883
|
+
/** Close the panel. */
|
|
884
|
+
MtxColorpicker.prototype.close = function () {
|
|
885
|
+
var _this = this;
|
|
886
|
+
if (!this._opened) {
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
if (this._componentRef) {
|
|
890
|
+
var instance = this._componentRef.instance;
|
|
891
|
+
instance._startExitAnimation();
|
|
892
|
+
instance._animationDone.pipe(operators.take(1)).subscribe(function () { return _this._destroyOverlay(); });
|
|
893
|
+
}
|
|
894
|
+
var completeClose = function () {
|
|
895
|
+
// The `_opened` could've been reset already if
|
|
896
|
+
// we got two events in quick succession.
|
|
897
|
+
if (_this._opened) {
|
|
898
|
+
_this._opened = false;
|
|
899
|
+
_this.closedStream.emit();
|
|
900
|
+
_this._focusedElementBeforeOpen = null;
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
if (this._restoreFocus &&
|
|
904
|
+
this._focusedElementBeforeOpen &&
|
|
905
|
+
typeof this._focusedElementBeforeOpen.focus === 'function') {
|
|
906
|
+
// Because IE moves focus asynchronously, we can't count on it being restored before we've
|
|
907
|
+
// marked the colorpicker as closed. If the event fires out of sequence and the element that
|
|
908
|
+
// we're refocusing opens the colorpicker on focus, the user could be stuck with not being
|
|
909
|
+
// able to close the panel at all. We work around it by making the logic, that marks
|
|
910
|
+
// the colorpicker as closed, async as well.
|
|
911
|
+
this._focusedElementBeforeOpen.focus();
|
|
912
|
+
setTimeout(completeClose);
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
completeClose();
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
/** Forwards relevant values from the colorpicker to the colorpicker content inside the overlay. */
|
|
919
|
+
MtxColorpicker.prototype._forwardContentValues = function (instance) {
|
|
920
|
+
instance.picker = this;
|
|
921
|
+
instance.color = this.color;
|
|
922
|
+
};
|
|
923
|
+
/** Open the colopicker as a popup. */
|
|
924
|
+
MtxColorpicker.prototype._openOverlay = function () {
|
|
925
|
+
var _this = this;
|
|
926
|
+
this._destroyOverlay();
|
|
927
|
+
var labelId = this.pickerInput.getOverlayLabelId();
|
|
928
|
+
var portal$1 = new portal.ComponentPortal(MtxColorpickerContent, this._viewContainerRef);
|
|
929
|
+
var overlayRef = (this._overlayRef = this._overlay.create(new overlay.OverlayConfig({
|
|
930
|
+
positionStrategy: this._getDropdownStrategy(),
|
|
931
|
+
hasBackdrop: true,
|
|
932
|
+
backdropClass: ['mat-overlay-transparent-backdrop', this._backdropHarnessClass],
|
|
933
|
+
direction: this._dir,
|
|
934
|
+
scrollStrategy: this._scrollStrategy(),
|
|
935
|
+
panelClass: "mtx-colorpicker-popup",
|
|
936
|
+
})));
|
|
937
|
+
var overlayElement = overlayRef.overlayElement;
|
|
938
|
+
overlayElement.setAttribute('role', 'dialog');
|
|
939
|
+
if (labelId) {
|
|
940
|
+
overlayElement.setAttribute('aria-labelledby', labelId);
|
|
941
|
+
}
|
|
942
|
+
this._getCloseStream(overlayRef).subscribe(function (event) {
|
|
943
|
+
if (event) {
|
|
944
|
+
event.preventDefault();
|
|
945
|
+
}
|
|
946
|
+
_this.close();
|
|
947
|
+
});
|
|
948
|
+
this._componentRef = overlayRef.attach(portal$1);
|
|
949
|
+
this._forwardContentValues(this._componentRef.instance);
|
|
950
|
+
// Update the position once the panel has rendered. Only relevant in dropdown mode.
|
|
951
|
+
this._ngZone.onStable.pipe(operators.take(1)).subscribe(function () { return overlayRef.updatePosition(); });
|
|
952
|
+
};
|
|
953
|
+
MtxColorpicker.prototype._destroyOverlay = function () {
|
|
954
|
+
if (this._overlayRef) {
|
|
955
|
+
this._overlayRef.dispose();
|
|
956
|
+
this._overlayRef = this._componentRef = null;
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
/** Gets a position strategy that will open the panel as a dropdown. */
|
|
960
|
+
MtxColorpicker.prototype._getDropdownStrategy = function () {
|
|
961
|
+
var strategy = this._overlay
|
|
962
|
+
.position()
|
|
963
|
+
.flexibleConnectedTo(this.pickerInput.getConnectedOverlayOrigin())
|
|
964
|
+
.withTransformOriginOn('.mtx-colorpicker-content')
|
|
965
|
+
.withFlexibleDimensions(false)
|
|
966
|
+
.withViewportMargin(8)
|
|
967
|
+
.withLockedPosition();
|
|
968
|
+
return this._setConnectedPositions(strategy);
|
|
969
|
+
};
|
|
970
|
+
/** Sets the positions of the colorpicker in dropdown mode based on the current configuration. */
|
|
971
|
+
MtxColorpicker.prototype._setConnectedPositions = function (strategy) {
|
|
972
|
+
var primaryX = this.xPosition === 'end' ? 'end' : 'start';
|
|
973
|
+
var secondaryX = primaryX === 'start' ? 'end' : 'start';
|
|
974
|
+
var primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
|
|
975
|
+
var secondaryY = primaryY === 'top' ? 'bottom' : 'top';
|
|
976
|
+
return strategy.withPositions([
|
|
977
|
+
{
|
|
978
|
+
originX: primaryX,
|
|
979
|
+
originY: secondaryY,
|
|
980
|
+
overlayX: primaryX,
|
|
981
|
+
overlayY: primaryY,
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
originX: primaryX,
|
|
985
|
+
originY: primaryY,
|
|
986
|
+
overlayX: primaryX,
|
|
987
|
+
overlayY: secondaryY,
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
originX: secondaryX,
|
|
991
|
+
originY: secondaryY,
|
|
992
|
+
overlayX: secondaryX,
|
|
993
|
+
overlayY: primaryY,
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
originX: secondaryX,
|
|
997
|
+
originY: primaryY,
|
|
998
|
+
overlayX: secondaryX,
|
|
999
|
+
overlayY: secondaryY,
|
|
1000
|
+
},
|
|
1001
|
+
]);
|
|
1002
|
+
};
|
|
1003
|
+
/** Gets an observable that will emit when the overlay is supposed to be closed. */
|
|
1004
|
+
MtxColorpicker.prototype._getCloseStream = function (overlayRef) {
|
|
1005
|
+
var _this = this;
|
|
1006
|
+
return rxjs.merge(overlayRef.backdropClick(), overlayRef.detachments(), overlayRef.keydownEvents().pipe(operators.filter(function (event) {
|
|
1007
|
+
// Closing on alt + up is only valid when there's an input associated with the colorpicker.
|
|
1008
|
+
return ((event.keyCode === keycodes.ESCAPE && !keycodes.hasModifierKey(event)) ||
|
|
1009
|
+
(_this.pickerInput && keycodes.hasModifierKey(event, 'altKey') && event.keyCode === keycodes.UP_ARROW));
|
|
1010
|
+
})));
|
|
1011
|
+
};
|
|
1012
|
+
return MtxColorpicker;
|
|
1013
|
+
}());
|
|
1014
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1015
|
+
MtxColorpicker.decorators = [
|
|
1016
|
+
{ type: core.Component, args: [{
|
|
1017
|
+
selector: 'mtx-colorpicker',
|
|
1018
|
+
template: '',
|
|
1019
|
+
exportAs: 'mtxColorpicker',
|
|
1020
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1021
|
+
encapsulation: core.ViewEncapsulation.None
|
|
1022
|
+
},] }
|
|
1023
|
+
];
|
|
1024
|
+
/**
|
|
1025
|
+
* @type {function(): !Array<(null|{
|
|
1026
|
+
* type: ?,
|
|
1027
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1028
|
+
* })>}
|
|
1029
|
+
* @nocollapse
|
|
1030
|
+
*/
|
|
1031
|
+
MtxColorpicker.ctorParameters = function () { return [
|
|
1032
|
+
{ type: overlay.Overlay },
|
|
1033
|
+
{ type: core.NgZone },
|
|
1034
|
+
{ type: core.ViewContainerRef },
|
|
1035
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [MTX_COLORPICKER_SCROLL_STRATEGY,] }] },
|
|
1036
|
+
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] },
|
|
1037
|
+
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [common.DOCUMENT,] }] }
|
|
1038
|
+
]; };
|
|
1039
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1040
|
+
MtxColorpicker.propDecorators = {
|
|
1041
|
+
content: [{ type: core.Input }],
|
|
1042
|
+
openedStream: [{ type: core.Output, args: ['opened',] }],
|
|
1043
|
+
closedStream: [{ type: core.Output, args: ['closed',] }],
|
|
1044
|
+
disabled: [{ type: core.Input }],
|
|
1045
|
+
xPosition: [{ type: core.Input }],
|
|
1046
|
+
yPosition: [{ type: core.Input }],
|
|
1047
|
+
restoreFocus: [{ type: core.Input }],
|
|
1048
|
+
opened: [{ type: core.Input }],
|
|
1049
|
+
color: [{ type: core.Input }]
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
var MtxColorpickerModule = /** @class */ (function () {
|
|
1053
|
+
function MtxColorpickerModule() {
|
|
1054
|
+
}
|
|
1055
|
+
return MtxColorpickerModule;
|
|
1056
|
+
}());
|
|
1057
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1058
|
+
MtxColorpickerModule.decorators = [
|
|
1059
|
+
{ type: core.NgModule, args: [{
|
|
1060
|
+
imports: [
|
|
1061
|
+
common.CommonModule,
|
|
1062
|
+
overlay.OverlayModule,
|
|
1063
|
+
a11y.A11yModule,
|
|
1064
|
+
portal.PortalModule,
|
|
1065
|
+
button.MatButtonModule,
|
|
1066
|
+
chrome.ColorChromeModule,
|
|
1067
|
+
],
|
|
1068
|
+
exports: [
|
|
1069
|
+
MtxColorpicker,
|
|
1070
|
+
MtxColorpickerContent,
|
|
1071
|
+
MtxColorpickerInput,
|
|
1072
|
+
MtxColorpickerToggle,
|
|
1073
|
+
MtxColorpickerToggleIcon,
|
|
1074
|
+
],
|
|
1075
|
+
declarations: [
|
|
1076
|
+
MtxColorpicker,
|
|
1077
|
+
MtxColorpickerContent,
|
|
1078
|
+
MtxColorpickerInput,
|
|
1079
|
+
MtxColorpickerToggle,
|
|
1080
|
+
MtxColorpickerToggleIcon,
|
|
1081
|
+
],
|
|
1082
|
+
providers: [MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER],
|
|
1083
|
+
},] }
|
|
1084
|
+
];
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Generated bundle index. Do not edit.
|
|
1088
|
+
*/
|
|
1089
|
+
|
|
1090
|
+
exports.MTX_COLORPICKER_SCROLL_STRATEGY = MTX_COLORPICKER_SCROLL_STRATEGY;
|
|
1091
|
+
exports.MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY = MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY;
|
|
1092
|
+
exports.MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = MTX_COLORPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER;
|
|
1093
|
+
exports.MTX_COLORPICKER_VALIDATORS = MTX_COLORPICKER_VALIDATORS;
|
|
1094
|
+
exports.MTX_COLORPICKER_VALUE_ACCESSOR = MTX_COLORPICKER_VALUE_ACCESSOR;
|
|
1095
|
+
exports.MtxColorpicker = MtxColorpicker;
|
|
1096
|
+
exports.MtxColorpickerContent = MtxColorpickerContent;
|
|
1097
|
+
exports.MtxColorpickerInput = MtxColorpickerInput;
|
|
1098
|
+
exports.MtxColorpickerModule = MtxColorpickerModule;
|
|
1099
|
+
exports.MtxColorpickerToggle = MtxColorpickerToggle;
|
|
1100
|
+
exports.MtxColorpickerToggleIcon = MtxColorpickerToggleIcon;
|
|
1101
|
+
exports.mtxColorpickerAnimations = mtxColorpickerAnimations;
|
|
1102
|
+
|
|
1103
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1104
|
+
|
|
1105
|
+
}));
|
|
1106
|
+
//# sourceMappingURL=mtxColorpicker.umd.js.map
|