@acorex/components 7.0.33 → 7.0.35
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/alert/src/alert.component.d.ts +2 -2
- package/badge/src/badge.component.d.ts +2 -2
- package/breadcrumbs/src/breadcrumbs-item.component.d.ts +10 -7
- package/button/src/button-group.component.d.ts +6 -6
- package/button/src/button-item.component.d.ts +6 -6
- package/chips/src/chips.component.d.ts +6 -6
- package/color-palette/src/color-palette-input.component.d.ts +5 -0
- package/color-palette/src/color-palette-picker.component.d.ts +13 -4
- package/color-palette/src/color-palette-swatches.component.d.ts +1 -0
- package/color-palette/src/color-palette.class.d.ts +5 -6
- package/color-palette/src/color-palette.component.d.ts +3 -11
- package/color-palette/src/color-palette.module.d.ts +2 -1
- package/color-picker/src/color-picker.component.d.ts +22 -20
- package/common/public-api.d.ts +1 -0
- package/common/src/constant/positions.d.ts +75 -0
- package/date-picker/src/datepicker.component.d.ts +17 -16
- package/esm2020/breadcrumbs/src/breadcrumbs-item.component.mjs +6 -4
- package/esm2020/breadcrumbs/src/breadcrumbs.component.mjs +2 -2
- package/esm2020/button/src/button.component.mjs +2 -2
- package/esm2020/color-palette/src/color-palette-input.component.mjs +41 -18
- package/esm2020/color-palette/src/color-palette-picker.component.mjs +72 -11
- package/esm2020/color-palette/src/color-palette-preview.component.mjs +2 -4
- package/esm2020/color-palette/src/color-palette-swatches.component.mjs +6 -4
- package/esm2020/color-palette/src/color-palette.class.mjs +1 -1
- package/esm2020/color-palette/src/color-palette.component.mjs +11 -27
- package/esm2020/color-palette/src/color-palette.module.mjs +6 -3
- package/esm2020/color-picker/src/color-picker.component.mjs +9 -19
- package/esm2020/common/public-api.mjs +2 -1
- package/esm2020/common/src/constant/positions.mjs +75 -0
- package/esm2020/data-pager/src/data-pager-input-selector.component.mjs +1 -1
- package/esm2020/mixin/src/base-components.class.mjs +1 -1
- package/esm2020/mixin/src/selection-component.class.mjs +3 -2
- package/esm2020/mixin/src/value-mixin.class.mjs +9 -11
- package/esm2020/number-box/src/number-box.component.mjs +4 -2
- package/esm2020/popover/src/popover.component.mjs +10 -18
- package/esm2020/radio/src/radio.component.mjs +1 -1
- package/esm2020/search-box/src/search-box.component.mjs +1 -1
- package/esm2020/textbox/src/mask-options.directive.mjs +2 -7
- package/esm2020/textbox/src/textbox.component.mjs +20 -16
- package/esm2020/time-box/src/time-box.component.mjs +4 -1
- package/esm2020/tooltip/src/tooltip.component.mjs +5 -23
- package/esm2020/tooltip/src/tooltip.directive.mjs +113 -42
- package/esm2020/tooltip/src/tooltip.module.mjs +1 -2
- package/fesm2015/acorex-components-breadcrumbs.mjs +6 -4
- package/fesm2015/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2015/acorex-components-button.mjs +2 -2
- package/fesm2015/acorex-components-button.mjs.map +1 -1
- package/fesm2015/acorex-components-color-palette.mjs +131 -59
- package/fesm2015/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2015/acorex-components-color-picker.mjs +8 -18
- package/fesm2015/acorex-components-color-picker.mjs.map +1 -1
- package/fesm2015/acorex-components-common.mjs +76 -1
- package/fesm2015/acorex-components-common.mjs.map +1 -1
- package/fesm2015/acorex-components-data-pager.mjs +1 -1
- package/fesm2015/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2015/acorex-components-mixin.mjs +11 -13
- package/fesm2015/acorex-components-mixin.mjs.map +1 -1
- package/fesm2015/acorex-components-number-box.mjs +3 -1
- package/fesm2015/acorex-components-number-box.mjs.map +1 -1
- package/fesm2015/acorex-components-popover.mjs +10 -17
- package/fesm2015/acorex-components-popover.mjs.map +1 -1
- package/fesm2015/acorex-components-radio.mjs.map +1 -1
- package/fesm2015/acorex-components-search-box.mjs +1 -1
- package/fesm2015/acorex-components-search-box.mjs.map +1 -1
- package/fesm2015/acorex-components-selection-list.mjs +1 -0
- package/fesm2015/acorex-components-tabs.mjs +1 -0
- package/fesm2015/acorex-components-textbox.mjs +22 -22
- package/fesm2015/acorex-components-textbox.mjs.map +1 -1
- package/fesm2015/acorex-components-time-box.mjs +3 -0
- package/fesm2015/acorex-components-time-box.mjs.map +1 -1
- package/fesm2015/acorex-components-tooltip.mjs +80 -64
- package/fesm2015/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2020/acorex-components-breadcrumbs.mjs +6 -4
- package/fesm2020/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2020/acorex-components-button.mjs +2 -2
- package/fesm2020/acorex-components-button.mjs.map +1 -1
- package/fesm2020/acorex-components-color-palette.mjs +130 -59
- package/fesm2020/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2020/acorex-components-color-picker.mjs +8 -18
- package/fesm2020/acorex-components-color-picker.mjs.map +1 -1
- package/fesm2020/acorex-components-common.mjs +76 -1
- package/fesm2020/acorex-components-common.mjs.map +1 -1
- package/fesm2020/acorex-components-data-pager.mjs +1 -1
- package/fesm2020/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2020/acorex-components-mixin.mjs +11 -13
- package/fesm2020/acorex-components-mixin.mjs.map +1 -1
- package/fesm2020/acorex-components-number-box.mjs +3 -1
- package/fesm2020/acorex-components-number-box.mjs.map +1 -1
- package/fesm2020/acorex-components-popover.mjs +9 -17
- package/fesm2020/acorex-components-popover.mjs.map +1 -1
- package/fesm2020/acorex-components-radio.mjs.map +1 -1
- package/fesm2020/acorex-components-search-box.mjs +1 -1
- package/fesm2020/acorex-components-search-box.mjs.map +1 -1
- package/fesm2020/acorex-components-selection-list.mjs +1 -0
- package/fesm2020/acorex-components-tabs.mjs +1 -0
- package/fesm2020/acorex-components-textbox.mjs +20 -21
- package/fesm2020/acorex-components-textbox.mjs.map +1 -1
- package/fesm2020/acorex-components-time-box.mjs +3 -0
- package/fesm2020/acorex-components-time-box.mjs.map +1 -1
- package/fesm2020/acorex-components-tooltip.mjs +116 -64
- package/fesm2020/acorex-components-tooltip.mjs.map +1 -1
- package/mixin/src/base-components.class.d.ts +3 -2
- package/mixin/src/base-menu-mixin.class.d.ts +5 -5
- package/mixin/src/button-mixin.class.d.ts +2 -2
- package/mixin/src/clickable-mixin.class.d.ts +3 -5
- package/mixin/src/color-look-mixing.class.d.ts +2 -2
- package/mixin/src/datalist-component.class.d.ts +10 -10
- package/mixin/src/dropdown-mixin.class.d.ts +2 -2
- package/mixin/src/interactive-mixin.class.d.ts +8 -5
- package/mixin/src/loading-mixin.class.d.ts +2 -2
- package/mixin/src/mixin.class.d.ts +64 -63
- package/mixin/src/page-component.class.d.ts +2 -2
- package/mixin/src/selection-component.class.d.ts +3 -5
- package/mixin/src/sizable-mixin.class.d.ts +2 -2
- package/mixin/src/textbox-mixin.class.d.ts +7 -5
- package/mixin/src/value-mixin.class.d.ts +12 -13
- package/number-box/src/number-box.component.d.ts +1 -1
- package/package.json +1 -1
- package/tabs/src/tab-item.component.d.ts +2 -2
- package/textbox/src/mask-options.directive.d.ts +7 -7
- package/textbox/src/textbox.component.d.ts +3 -3
- package/tooltip/src/tooltip.component.d.ts +2 -1
- package/tooltip/src/tooltip.directive.d.ts +9 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AXColorUtil } from '@acorex/core/utils';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, Input,
|
3
|
+
import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, Input, ContentChildren, HostBinding, NgModule } from '@angular/core';
|
4
4
|
import { distinctUntilChanged } from 'rxjs/operators';
|
5
5
|
import { AXBaseComponent, AXBaseValueComponentMixin } from '@acorex/components/mixin';
|
6
6
|
import * as i1 from '@angular/common';
|
@@ -11,6 +11,8 @@ import * as i3 from '@acorex/components/number-box';
|
|
11
11
|
import { AXNumberBoxModule } from '@acorex/components/number-box';
|
12
12
|
import * as i1$1 from '@acorex/components/range-slider';
|
13
13
|
import { AXRangeSliderModule } from '@acorex/components/range-slider';
|
14
|
+
import * as i2$1 from '@angular/cdk/drag-drop';
|
15
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
14
16
|
import { Subject } from 'rxjs';
|
15
17
|
import { AXLabelModule } from '@acorex/components/label';
|
16
18
|
import { AXButtonModule } from '@acorex/components/button';
|
@@ -36,6 +38,7 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
36
38
|
super(_elementRef, _cdr);
|
37
39
|
this._parent = _parent;
|
38
40
|
this._isTouched = false;
|
41
|
+
this.isValid = true;
|
39
42
|
this._rgba = {
|
40
43
|
r: 0,
|
41
44
|
g: 0,
|
@@ -43,9 +46,17 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
43
46
|
a: 0,
|
44
47
|
};
|
45
48
|
this._hex = '';
|
49
|
+
this._colorMode = "hex";
|
50
|
+
this._hexMaskOptions = {
|
51
|
+
mask: /^#[0-9a-f]{0,6}[0-9a-f]{0,2}$/i,
|
52
|
+
prepare: (str, m, a) => {
|
53
|
+
var _a;
|
54
|
+
return ((_a = m.typedValue) === null || _a === void 0 ? void 0 : _a.startsWith('#')) || str == '#' ? str.trim() : '#' + str.trim();
|
55
|
+
},
|
56
|
+
};
|
46
57
|
_parent._onInternalColorChanged$
|
47
58
|
.pipe(distinctUntilChanged())
|
48
|
-
.subscribe(e => {
|
59
|
+
.subscribe((e) => {
|
49
60
|
if (!e.color) {
|
50
61
|
this._hex = '';
|
51
62
|
this._rgba = {
|
@@ -56,25 +67,27 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
56
67
|
};
|
57
68
|
}
|
58
69
|
else {
|
59
|
-
|
60
|
-
|
70
|
+
Object.assign(this._rgba, AXColorUtil.to(e.color, 'rgba'));
|
71
|
+
if (this._colorMode != 'hex' || !this._hex)
|
61
72
|
this._hex = AXColorUtil.toString(e.color, 'hex');
|
62
|
-
|
63
|
-
|
64
|
-
|
73
|
+
if (this._colorMode == 'hex')
|
74
|
+
this._hex = e.color;
|
75
|
+
if (this._rgba.a != 1 && !this._isTouched) {
|
76
|
+
this._colorMode = 'rgba';
|
65
77
|
}
|
66
78
|
}
|
79
|
+
this.checkValid();
|
67
80
|
_cdr.detectChanges();
|
68
81
|
});
|
69
82
|
}
|
70
83
|
_handleChangeInputMode() {
|
71
84
|
this._isTouched = true;
|
72
|
-
switch (this.
|
85
|
+
switch (this._colorMode) {
|
73
86
|
case 'rgba':
|
74
|
-
this.
|
87
|
+
this._colorMode = 'hex';
|
75
88
|
break;
|
76
89
|
default:
|
77
|
-
this.
|
90
|
+
this._colorMode = 'rgba';
|
78
91
|
break;
|
79
92
|
}
|
80
93
|
}
|
@@ -89,20 +102,33 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
89
102
|
}
|
90
103
|
this._parent._onInternalColorChanged$.next({
|
91
104
|
color: AXColorUtil.toString(_color, 'rgba'),
|
92
|
-
|
105
|
+
sender: this,
|
93
106
|
});
|
94
107
|
}
|
95
108
|
_handleHEXAValueChanged(e) {
|
96
|
-
if (e.value
|
109
|
+
if (!e.value && !e.oldValue)
|
97
110
|
return;
|
111
|
+
//
|
98
112
|
if (e.isUserInteraction) {
|
99
113
|
this._parent._setUserInteraction();
|
100
114
|
this._isTouched = true;
|
101
115
|
}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
116
|
+
//
|
117
|
+
if (!e.value && e.oldValue) {
|
118
|
+
this._parent._onInternalColorChanged$.next({
|
119
|
+
color: null,
|
120
|
+
sender: this
|
121
|
+
});
|
122
|
+
}
|
123
|
+
else {
|
124
|
+
this._parent._onInternalColorChanged$.next({
|
125
|
+
color: e.value,
|
126
|
+
sender: this
|
127
|
+
});
|
128
|
+
}
|
129
|
+
}
|
130
|
+
checkValid() {
|
131
|
+
this.isValid = AXColorUtil.isValid(this._hex);
|
106
132
|
}
|
107
133
|
}
|
108
134
|
AXColorPaletteInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPaletteInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: AXColorComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
@@ -111,7 +137,7 @@ AXColorPaletteInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
|
|
111
137
|
provide: AXColorPaletteChildComponent,
|
112
138
|
useExisting: AXColorPaletteInputComponent,
|
113
139
|
},
|
114
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"
|
140
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"this._colorMode\">\r\n <div class=\"palette-inputs\">\r\n <ng-container *ngSwitchCase=\"'hex'\">\r\n <div>\r\n <ax-text-box\r\n class=\"ax-sm\"\r\n [value]=\"_hex\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n [state]=\"isValid?'clear':'error'\"\r\n (onValueChanged)=\"_handleHEXAValueChanged($event)\" [mask-options]=\"_hexMaskOptions\">\r\n </ax-text-box>\r\n <label>HEX</label>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rgba'\">\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.r\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>R</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.g\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>G</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.b\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>B</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"1\"\r\n [(value)]=\"_rgba.a\"\r\n [decimals]=\"2\"\r\n [step]=\"0.1\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n [showSpinButtons]=\"false\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>A</label>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <button\r\n class=\"ax-general-button ax-button-icon ax-sm\"\r\n (click)=\"_handleChangeInputMode()\"\r\n [disabled]=\"_parent.disabled\">\r\n <span class=\"ax-icon ax-icon-unfold-more\"></span>\r\n </button>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "mask-options"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged"] }, { kind: "component", type: i3.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "size", "value", "state", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "name", "checked", "thousandsSeparator", "padDecimalZeros", "step", "decimals", "decimalStep", "showSpinButtons", "minValue", "maxValue"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
115
141
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPaletteInputComponent, decorators: [{
|
116
142
|
type: Component,
|
117
143
|
args: [{ selector: 'ax-color-palette-input', host: { class: 'ax-color-palette-input' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
@@ -119,7 +145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
119
145
|
provide: AXColorPaletteChildComponent,
|
120
146
|
useExisting: AXColorPaletteInputComponent,
|
121
147
|
},
|
122
|
-
], template: "<ng-container [ngSwitch]=\"
|
148
|
+
], template: "<ng-container [ngSwitch]=\"this._colorMode\">\r\n <div class=\"palette-inputs\">\r\n <ng-container *ngSwitchCase=\"'hex'\">\r\n <div>\r\n <ax-text-box\r\n class=\"ax-sm\"\r\n [value]=\"_hex\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n [state]=\"isValid?'clear':'error'\"\r\n (onValueChanged)=\"_handleHEXAValueChanged($event)\" [mask-options]=\"_hexMaskOptions\">\r\n </ax-text-box>\r\n <label>HEX</label>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'rgba'\">\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.r\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>R</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.g\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>G</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [(value)]=\"_rgba.b\"\r\n [showSpinButtons]=\"false\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>B</label>\r\n </div>\r\n <div>\r\n <ax-number-box\r\n class=\"ax-sm\"\r\n [minValue]=\"0\"\r\n [maxValue]=\"1\"\r\n [(value)]=\"_rgba.a\"\r\n [decimals]=\"2\"\r\n [step]=\"0.1\"\r\n [disabled]=\"_parent.disabled\"\r\n [readonly]=\"_parent.readonly\"\r\n [showSpinButtons]=\"false\"\r\n (onValueChanged)=\"_handleRGBAValueChanged($event)\">\r\n </ax-number-box>\r\n <label>A</label>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <button\r\n class=\"ax-general-button ax-button-icon ax-sm\"\r\n (click)=\"_handleChangeInputMode()\"\r\n [disabled]=\"_parent.disabled\">\r\n <span class=\"ax-icon ax-icon-unfold-more\"></span>\r\n </button>\r\n</ng-container>\r\n" }]
|
123
149
|
}], ctorParameters: function () {
|
124
150
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXColorComponent, decorators: [{
|
125
151
|
type: Optional
|
@@ -150,6 +176,7 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
150
176
|
{ color: 'rgb(255, 0, 255)', pos: 0.83 },
|
151
177
|
{ color: 'rgb(255, 0, 0)', pos: 1 },
|
152
178
|
];
|
179
|
+
this.dragPosition = { x: 0, y: 0 };
|
153
180
|
_parent._onInternalColorChanged$
|
154
181
|
.pipe(distinctUntilChanged())
|
155
182
|
.subscribe((e) => {
|
@@ -166,19 +193,23 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
166
193
|
Object.assign(this._rgba, AXColorUtil.to(e.color, 'rgba'));
|
167
194
|
}
|
168
195
|
}
|
169
|
-
this.
|
196
|
+
this.setHSV();
|
170
197
|
_cdr.detectChanges();
|
171
198
|
});
|
172
199
|
}
|
200
|
+
setHSV() {
|
201
|
+
const hsv = AXColorUtil.to(this._rgba, 'hsva');
|
202
|
+
this._bgColor = AXColorUtil.toString({ h: hsv.h, s: 1, v: 1, a: this._rgba.a }, 'rgba');
|
203
|
+
this.setPointerByPercent(hsv.s * 100, hsv.v * 100);
|
204
|
+
}
|
173
205
|
_handleAlphaChanged(e) {
|
174
206
|
if (e.value != null && e.value != this._rgba.a) {
|
175
207
|
const { r, g, b } = this._rgba;
|
176
208
|
const _color = `rgba(${r},${g},${b},${e.value})`;
|
177
|
-
this._parent.colorMode = 'rgba';
|
178
209
|
this._parent._setUserInteraction();
|
179
210
|
this._parent._onInternalColorChanged$.next({
|
180
211
|
color: AXColorUtil.toString(_color, 'rgba'),
|
181
|
-
|
212
|
+
sender: this,
|
182
213
|
});
|
183
214
|
}
|
184
215
|
}
|
@@ -186,14 +217,69 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
186
217
|
if (e.value != null && e.value != this._gradient) {
|
187
218
|
const gradient = AXColorUtil.gradient(this._gradientColors);
|
188
219
|
const colors = gradient.rgb(100);
|
189
|
-
|
220
|
+
const { s, v } = AXColorUtil.to(this._rgba, "hsva");
|
221
|
+
const { h } = colors[e.value].toHsv();
|
190
222
|
this._parent._setUserInteraction();
|
191
223
|
this._parent._onInternalColorChanged$.next({
|
192
|
-
color: AXColorUtil.toString(
|
193
|
-
|
224
|
+
color: AXColorUtil.toString({ h, s, v, a: this._rgba.a }, 'rgba'),
|
225
|
+
sender: this,
|
194
226
|
});
|
195
227
|
}
|
196
228
|
}
|
229
|
+
_handleSurfaceClick(e) {
|
230
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
231
|
+
const sb = surface.getBoundingClientRect();
|
232
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
233
|
+
const pb = pointer.getBoundingClientRect();
|
234
|
+
let x = e.offsetX;
|
235
|
+
let y = e.offsetY;
|
236
|
+
this.setColorByXY(x, y);
|
237
|
+
}
|
238
|
+
_handleDrag() {
|
239
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
240
|
+
const sb = surface.getBoundingClientRect();
|
241
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
242
|
+
const pb = pointer.getBoundingClientRect();
|
243
|
+
const w = (pb.width / 2);
|
244
|
+
let x = (pb.left - sb.left) + w;
|
245
|
+
let y = (pb.top - sb.top) + w;
|
246
|
+
//
|
247
|
+
x = x < 0 ? 0 : x;
|
248
|
+
x = x > sb.width ? sb.width : x;
|
249
|
+
//
|
250
|
+
y = y < 0 ? 0 : y;
|
251
|
+
y = y > sb.height ? sb.height : y;
|
252
|
+
//
|
253
|
+
this.setColorByXY(x, y);
|
254
|
+
}
|
255
|
+
setColorByXY(x, y) {
|
256
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
257
|
+
const sb = surface.getBoundingClientRect();
|
258
|
+
//
|
259
|
+
const { h } = AXColorUtil.to(this._bgColor, "hsva");
|
260
|
+
const hsv = {
|
261
|
+
h,
|
262
|
+
s: (x / sb.width),
|
263
|
+
v: ((sb.height - y) / sb.height)
|
264
|
+
};
|
265
|
+
this._parent._onInternalColorChanged$.next({
|
266
|
+
color: AXColorUtil.toString(hsv, 'rgba'),
|
267
|
+
sender: this,
|
268
|
+
});
|
269
|
+
}
|
270
|
+
setPointerByPercent(x, y) {
|
271
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
272
|
+
const sb = surface.getBoundingClientRect();
|
273
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
274
|
+
const pb = pointer.getBoundingClientRect();
|
275
|
+
const w = (pb.width / 2);
|
276
|
+
const width = sb.width; //+ pb.width
|
277
|
+
const height = sb.height; // + pb.width
|
278
|
+
this.dragPosition = {
|
279
|
+
x: ((x * width) / 100) - w,
|
280
|
+
y: (height - (((y * height)) / 100)) - w
|
281
|
+
};
|
282
|
+
}
|
197
283
|
}
|
198
284
|
AXColorPalettePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalettePickerComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: AXColorComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
199
285
|
AXColorPalettePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: AXColorPalettePickerComponent, selector: "ax-color-palette-picker", host: { classAttribute: "ax-color-palette-picker" }, providers: [
|
@@ -201,7 +287,7 @@ AXColorPalettePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
|
|
201
287
|
provide: AXColorPaletteChildComponent,
|
202
288
|
useExisting: AXColorPalettePickerComponent,
|
203
289
|
},
|
204
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n
|
290
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-color-picker-overlay-trans\">\r\n <div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n <div class=\"ax-color-picker-overlay-g1\"></div>\r\n <div class=\"ax-color-picker-overlay-g2\" (click)=\"_handleSurfaceClick($event)\"></div>\r\n <div class=\"ax-color-picker-pointer\" cdkDrag cdkDragBoundary=\".ax-color-picker-overlay\" [cdkDragFreeDragPosition]=\"dragPosition\" (cdkDragEnded)=\"_handleDrag()\"></div>\r\n </div>\r\n</div>\r\n<ax-range-slider class=\"ax-color-picker-gradient\" [minValue]=\"0\" [maxValue]=\"99\" [step]=\"1\" [value]=\"_gradient\" \r\n (onValueChanged)=\"_handleGradientChanged($event)\">\r\n</ax-range-slider>\r\n<ax-range-slider class=\"ax-color-picker-transparent\" [minValue]=\"0\" [maxValue]=\"1\" [step]=\"0.01\" [value]=\"_rgba.a\"\r\n (onValueChanged)=\"_handleAlphaChanged($event)\">\r\n</ax-range-slider>", dependencies: [{ kind: "component", type: i1$1.AXRangeSliderComponent, selector: "ax-range-slider", inputs: ["readonly", "allowNull", "value", "name", "checked", "minValue", "maxValue", "step", "color", "oriantaion"], outputs: ["valueChange", "onValueChanged", "colorChange"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
205
291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalettePickerComponent, decorators: [{
|
206
292
|
type: Component,
|
207
293
|
args: [{ selector: 'ax-color-palette-picker', host: { class: 'ax-color-palette-picker' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
@@ -209,7 +295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
209
295
|
provide: AXColorPaletteChildComponent,
|
210
296
|
useExisting: AXColorPalettePickerComponent,
|
211
297
|
},
|
212
|
-
], template: "<div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n
|
298
|
+
], template: "<div class=\"ax-color-picker-overlay-trans\">\r\n <div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n <div class=\"ax-color-picker-overlay-g1\"></div>\r\n <div class=\"ax-color-picker-overlay-g2\" (click)=\"_handleSurfaceClick($event)\"></div>\r\n <div class=\"ax-color-picker-pointer\" cdkDrag cdkDragBoundary=\".ax-color-picker-overlay\" [cdkDragFreeDragPosition]=\"dragPosition\" (cdkDragEnded)=\"_handleDrag()\"></div>\r\n </div>\r\n</div>\r\n<ax-range-slider class=\"ax-color-picker-gradient\" [minValue]=\"0\" [maxValue]=\"99\" [step]=\"1\" [value]=\"_gradient\" \r\n (onValueChanged)=\"_handleGradientChanged($event)\">\r\n</ax-range-slider>\r\n<ax-range-slider class=\"ax-color-picker-transparent\" [minValue]=\"0\" [maxValue]=\"1\" [step]=\"0.01\" [value]=\"_rgba.a\"\r\n (onValueChanged)=\"_handleAlphaChanged($event)\">\r\n</ax-range-slider>" }]
|
213
299
|
}], ctorParameters: function () {
|
214
300
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXColorComponent, decorators: [{
|
215
301
|
type: Optional
|
@@ -229,9 +315,7 @@ class AXColorPalettePreviewComponent extends AXBaseComponent {
|
|
229
315
|
.subscribe((e) => {
|
230
316
|
_zone.runOutsideAngular(() => {
|
231
317
|
this._getInnerElement().style.backgroundColor = e.color;
|
232
|
-
this._getInnerElement().innerText = e.color
|
233
|
-
? AXColorUtil.toString(e.color, e.mode)
|
234
|
-
: '';
|
318
|
+
this._getInnerElement().innerText = AXColorUtil.toString(e.color);
|
235
319
|
const color = AXColorUtil.toString(e.color, 'hex');
|
236
320
|
const ratio = AXColorUtil.contrastToWhite(color);
|
237
321
|
this._getHostElement().style.color = !(ratio > 2.0) ? '#000' : '#fff';
|
@@ -506,8 +590,10 @@ class AXColorPaletteSwatchesComponent extends AXBaseComponent {
|
|
506
590
|
this._selected = AXColorUtil.toString(e.color, 'hex').toLowerCase();
|
507
591
|
this._cdr.detectChanges();
|
508
592
|
});
|
509
|
-
|
510
|
-
|
593
|
+
}
|
594
|
+
onInit() {
|
595
|
+
const isFav = this._getHostElement().tagName.toLowerCase() == 'ax-color-palette-favorite';
|
596
|
+
if (!isFav && this.colors.length == 0) {
|
511
597
|
this.colors = this._defaultPalette.map(c => this._format(c));
|
512
598
|
}
|
513
599
|
}
|
@@ -517,7 +603,7 @@ class AXColorPaletteSwatchesComponent extends AXBaseComponent {
|
|
517
603
|
this._parent._setUserInteraction();
|
518
604
|
this._parent._onInternalColorChanged$.next({
|
519
605
|
color: color.code,
|
520
|
-
|
606
|
+
sender: this
|
521
607
|
});
|
522
608
|
}
|
523
609
|
_format(color) {
|
@@ -572,8 +658,6 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
572
658
|
constructor(elementRef, cdr) {
|
573
659
|
super(elementRef, cdr);
|
574
660
|
this._onInternalColorChanged$ = new Subject();
|
575
|
-
this.colorModeChange = new EventEmitter();
|
576
|
-
this._colorMode = 'hex';
|
577
661
|
//
|
578
662
|
this._onInternalColorChanged$.pipe(distinctUntilChanged()).subscribe(e => {
|
579
663
|
if (this.disabled || this.readonly)
|
@@ -582,37 +666,26 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
582
666
|
cdr.markForCheck();
|
583
667
|
});
|
584
668
|
}
|
585
|
-
/**
|
586
|
-
* A character value that specifies the separator character.
|
587
|
-
*/
|
588
|
-
get colorMode() {
|
589
|
-
return this._colorMode;
|
590
|
-
}
|
591
|
-
set colorMode(v) {
|
592
|
-
this._setOption({
|
593
|
-
name: 'colorMode',
|
594
|
-
value: v,
|
595
|
-
});
|
596
|
-
}
|
597
669
|
_onValueChanged(oldValue, newValue) {
|
598
670
|
super._onValueChanged(oldValue, newValue);
|
599
671
|
this._onInternalColorChanged$.next({
|
600
672
|
color: this.value,
|
601
|
-
mode:
|
673
|
+
mode: (newValue === null || newValue === void 0 ? void 0 : newValue.startsWith('#')) ? "hex" : "rgba",
|
674
|
+
sender: this
|
602
675
|
});
|
603
676
|
}
|
604
677
|
ngAfterContentInit() {
|
605
678
|
this._children.changes.subscribe(() => {
|
606
679
|
this._onInternalColorChanged$.next({
|
607
680
|
color: this.value,
|
608
|
-
|
681
|
+
sender: this
|
609
682
|
});
|
610
683
|
});
|
611
684
|
}
|
612
685
|
onViewInit() {
|
613
686
|
this._onInternalColorChanged$.next({
|
614
687
|
color: this.value,
|
615
|
-
|
688
|
+
sender: this
|
616
689
|
});
|
617
690
|
}
|
618
691
|
get __hostDisabled() {
|
@@ -620,9 +693,9 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
620
693
|
}
|
621
694
|
}
|
622
695
|
AXColorPalleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalleteComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
623
|
-
AXColorPalleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: AXColorPalleteComponent, selector: "ax-color-palette", inputs: { disabled: "disabled", tabIndex: "tabIndex", readonly: "readonly", allowNull: "allowNull", value: "value",
|
696
|
+
AXColorPalleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: AXColorPalleteComponent, selector: "ax-color-palette", inputs: { disabled: "disabled", tabIndex: "tabIndex", readonly: "readonly", allowNull: "allowNull", value: "value", state: "state", name: "name", checked: "checked" }, outputs: { onBlur: "onBlur", onFocus: "onFocus", valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged" }, host: { properties: { "class.ax-state-disabled": "this.__hostDisabled" } }, providers: [
|
624
697
|
{ provide: AXColorComponent, useExisting: AXColorPalleteComponent },
|
625
|
-
], queries: [{ propertyName: "_children", predicate: AXColorPaletteChildComponent }], usesInheritance: true, ngImport: i0, template: "<ng-content select='ax-header'></ng-content>\r\n\r\n<ng-container [ngTemplateOutlet]=\"default\" *ngIf=\"!_children.length\"></ng-container>\r\n<ng-container [ngTemplateOutlet]=\"custom\" *ngIf=\"_children.length\"></ng-container>\r\n\r\n<ng-template #custom>\r\n <ng-content select='ax-color-palette-preview'></ng-content>\r\n <ng-content select='ax-color-palette-picker'></ng-content>\r\n <ng-content select='ax-color-palette-swatches'></ng-content>\r\n <ng-content select='ax-color-palette-favorite'></ng-content>\r\n <ng-content select='ax-color-palette-input'></ng-content>\r\n</ng-template>\r\n<ng-template #default>\r\n <ax-color-palette-preview></ax-color-palette-preview>\r\n <ax-color-palette-swatches></ax-color-palette-swatches>\r\n <ax-color-palette-input></ax-color-palette-input>\r\n</ng-template>\r\n\r\n<ng-content select='ax-footer'></ng-content>\r\n\r\n\r\n", styles: ["ax-color-palette{display:flex;flex-direction:column;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgb(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default);width:18rem}@media (min-width: 600px){ax-color-palette{width:20rem!important}}@media (min-width: 1200px){ax-color-palette{width:18rem!important}}@media (max-width: 599px){ax-color-palette{width:100%!important}}ax-color-palette.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-color-palette.ax-state-disabled ax-color-palette-swatches div:hover,ax-color-palette.ax-state-disabled ax-color-palette-swatches div.ax-state-selected,ax-color-palette.ax-state-disabled ax-color-palette-favorite div:hover,ax-color-palette.ax-state-disabled ax-color-palette-favorite div.ax-state-selected{opacity:.5;cursor:not-allowed}ax-color-palette ax-header,ax-color-palette ax-footer{padding:.75rem;border-top-width:1px;display:flex}ax-color-palette ax-color-palette-preview{position:relative;width:100%;height:6rem;gap:.5;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=) left center}ax-color-palette ax-color-palette-preview .palette-preview-overlay{position:absolute;left:0;width:100%;height:100%;display:flex;align-items:center;text-transform:uppercase;justify-content:center;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default));box-shadow:0 1px 8px #00000029;text-shadow:0px 0px 14px rgba(0,0,0,.5)}ax-color-palette ax-color-palette-favorite{display:block;border-top:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches,ax-color-palette ax-color-palette-favorite{display:grid;padding:.5rem;grid-template-columns:repeat(10,minmax(0,1fr));max-height:9rem;overflow-x:hidden;gap:.5rem}ax-color-palette ax-color-palette-swatches div,ax-color-palette ax-color-palette-favorite div{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:99rem;border:1px solid rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches div:before,ax-color-palette ax-color-palette-favorite div:before{content:\"\";padding-top:100%;float:left}ax-color-palette ax-color-palette-swatches div:after,ax-color-palette ax-color-palette-favorite div:after{content:\"\";display:block;clear:both}ax-color-palette ax-color-palette-swatches div:hover,ax-color-palette ax-color-palette-swatches div.ax-state-selected,ax-color-palette ax-color-palette-favorite div:hover,ax-color-palette ax-color-palette-favorite div.ax-state-selected{outline-offset:2px;outline-width:1px;outline-style:solid;outline-color:rgba(var(--ax-color-ghost),.86)}ax-color-palette ax-color-palette-input{display:flex;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-input .palette-inputs{display:flex;flex:1 1 0%;gap:.5rem}ax-color-palette ax-color-palette-input .palette-inputs div{width:100%;text-align:center}ax-color-palette ax-color-palette-input .palette-inputs div label{margin-top:.75rem;font-size:.75rem;line-height:1.25rem}ax-color-palette ax-color-palette-picker{display:flex;flex-direction:column;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay{display:block;width:100%;height:8rem;position:relative}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-pointer{width:.75rem;height:.75rem;border-radius:99rem;background-color:transparent;border:1px solid rgb(var(--ax-color-background-default))}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-
|
698
|
+
], queries: [{ propertyName: "_children", predicate: AXColorPaletteChildComponent }], usesInheritance: true, ngImport: i0, template: "<ng-content select='ax-header'></ng-content>\r\n\r\n<ng-container [ngTemplateOutlet]=\"default\" *ngIf=\"!_children.length\"></ng-container>\r\n<ng-container [ngTemplateOutlet]=\"custom\" *ngIf=\"_children.length\"></ng-container>\r\n\r\n<ng-template #custom>\r\n <ng-content select='ax-color-palette-preview'></ng-content>\r\n <ng-content select='ax-color-palette-picker'></ng-content>\r\n <ng-content select='ax-color-palette-swatches'></ng-content>\r\n <ng-content select='ax-color-palette-favorite'></ng-content>\r\n <ng-content select='ax-color-palette-input'></ng-content>\r\n</ng-template>\r\n<ng-template #default>\r\n <ax-color-palette-preview></ax-color-palette-preview>\r\n <ax-color-palette-swatches></ax-color-palette-swatches>\r\n <ax-color-palette-input></ax-color-palette-input>\r\n</ng-template>\r\n\r\n<ng-content select='ax-footer'></ng-content>\r\n\r\n\r\n", styles: ["ax-color-palette{display:flex;flex-direction:column;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgb(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default);width:18rem}@media (min-width: 600px){ax-color-palette{width:20rem!important}}@media (min-width: 1200px){ax-color-palette{width:18rem!important}}@media (max-width: 599px){ax-color-palette{width:100%!important}}ax-color-palette.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-color-palette.ax-state-disabled ax-color-palette-swatches div:hover,ax-color-palette.ax-state-disabled ax-color-palette-swatches div.ax-state-selected,ax-color-palette.ax-state-disabled ax-color-palette-favorite div:hover,ax-color-palette.ax-state-disabled ax-color-palette-favorite div.ax-state-selected{opacity:.5;cursor:not-allowed}ax-color-palette ax-header,ax-color-palette ax-footer{padding:.75rem;border-top-width:1px;display:flex}ax-color-palette ax-color-palette-preview{position:relative;width:100%;height:6rem;gap:.5;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=) left center}ax-color-palette ax-color-palette-preview .palette-preview-overlay{position:absolute;left:0;width:100%;height:100%;display:flex;align-items:center;text-transform:uppercase;justify-content:center;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default));box-shadow:0 1px 8px #00000029;text-shadow:0px 0px 14px rgba(0,0,0,.5)}ax-color-palette ax-color-palette-favorite{display:block;border-top:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches,ax-color-palette ax-color-palette-favorite{display:grid;padding:.5rem;grid-template-columns:repeat(10,minmax(0,1fr));max-height:9rem;overflow-x:hidden;gap:.5rem}ax-color-palette ax-color-palette-swatches div,ax-color-palette ax-color-palette-favorite div{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:99rem;border:1px solid rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches div:before,ax-color-palette ax-color-palette-favorite div:before{content:\"\";padding-top:100%;float:left}ax-color-palette ax-color-palette-swatches div:after,ax-color-palette ax-color-palette-favorite div:after{content:\"\";display:block;clear:both}ax-color-palette ax-color-palette-swatches div:hover,ax-color-palette ax-color-palette-swatches div.ax-state-selected,ax-color-palette ax-color-palette-favorite div:hover,ax-color-palette ax-color-palette-favorite div.ax-state-selected{outline-offset:2px;outline-width:1px;outline-style:solid;outline-color:rgba(var(--ax-color-ghost),.86)}ax-color-palette ax-color-palette-input{display:flex;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-input .palette-inputs{display:flex;flex:1 1 0%;gap:.5rem}ax-color-palette ax-color-palette-input .palette-inputs div{width:100%;text-align:center}ax-color-palette ax-color-palette-input .palette-inputs div label{margin-top:.75rem;font-size:.75rem;line-height:1.25rem}ax-color-palette ax-color-palette-picker{display:flex;flex-direction:column;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay-trans{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=)}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay{display:block;width:100%;height:8rem;position:relative}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-pointer{width:.75rem;height:.75rem;border-radius:99rem;background-color:transparent;border:1px solid rgb(var(--ax-color-background-default));position:relative;z-index:1}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g1,ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g2{height:100%;width:100%;position:absolute;inset:0}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g1{z-index:0;background:linear-gradient(to right,#fff 0%,rgba(255,255,255,0) 100%)}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g2{z-index:1;background:linear-gradient(to bottom,transparent 0%,#000 100%)}ax-color-palette ax-color-palette-picker .ax-range-slider.ax-color-picker-gradient input{background:linear-gradient(to right,rgb(255,0,0) 0%,rgb(255,255,0) 17%,rgb(0,255,0) 33%,rgb(0,255,255) 50%,rgb(0,0,255) 67%,rgb(255,0,255) 83%,rgb(255,0,0) 100%)}ax-color-palette ax-color-palette-picker .ax-range-slider.ax-color-picker-transparent input{background-image:linear-gradient(to right,rgba(245,246,252,0),rgb(0,0,0)),url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXColorPalettePreviewComponent, selector: "ax-color-palette-preview" }, { kind: "component", type: AXColorPaletteSwatchesComponent, selector: "ax-color-palette-swatches, ax-color-palette-favorite", inputs: ["colors"] }, { kind: "component", type: AXColorPaletteInputComponent, selector: "ax-color-palette-input" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
626
699
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalleteComponent, decorators: [{
|
627
700
|
type: Component,
|
628
701
|
args: [{ selector: 'ax-color-palette', inputs: [
|
@@ -631,18 +704,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
631
704
|
'readonly',
|
632
705
|
'allowNull',
|
633
706
|
'value',
|
707
|
+
'state',
|
634
708
|
'name',
|
635
709
|
'checked',
|
636
|
-
], outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
710
|
+
], outputs: ['onBlur', 'onFocus', 'valueChange', 'stateChange', 'onValueChanged'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
637
711
|
{ provide: AXColorComponent, useExisting: AXColorPalleteComponent },
|
638
|
-
], template: "<ng-content select='ax-header'></ng-content>\r\n\r\n<ng-container [ngTemplateOutlet]=\"default\" *ngIf=\"!_children.length\"></ng-container>\r\n<ng-container [ngTemplateOutlet]=\"custom\" *ngIf=\"_children.length\"></ng-container>\r\n\r\n<ng-template #custom>\r\n <ng-content select='ax-color-palette-preview'></ng-content>\r\n <ng-content select='ax-color-palette-picker'></ng-content>\r\n <ng-content select='ax-color-palette-swatches'></ng-content>\r\n <ng-content select='ax-color-palette-favorite'></ng-content>\r\n <ng-content select='ax-color-palette-input'></ng-content>\r\n</ng-template>\r\n<ng-template #default>\r\n <ax-color-palette-preview></ax-color-palette-preview>\r\n <ax-color-palette-swatches></ax-color-palette-swatches>\r\n <ax-color-palette-input></ax-color-palette-input>\r\n</ng-template>\r\n\r\n<ng-content select='ax-footer'></ng-content>\r\n\r\n\r\n", styles: ["ax-color-palette{display:flex;flex-direction:column;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgb(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default);width:18rem}@media (min-width: 600px){ax-color-palette{width:20rem!important}}@media (min-width: 1200px){ax-color-palette{width:18rem!important}}@media (max-width: 599px){ax-color-palette{width:100%!important}}ax-color-palette.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-color-palette.ax-state-disabled ax-color-palette-swatches div:hover,ax-color-palette.ax-state-disabled ax-color-palette-swatches div.ax-state-selected,ax-color-palette.ax-state-disabled ax-color-palette-favorite div:hover,ax-color-palette.ax-state-disabled ax-color-palette-favorite div.ax-state-selected{opacity:.5;cursor:not-allowed}ax-color-palette ax-header,ax-color-palette ax-footer{padding:.75rem;border-top-width:1px;display:flex}ax-color-palette ax-color-palette-preview{position:relative;width:100%;height:6rem;gap:.5;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=) left center}ax-color-palette ax-color-palette-preview .palette-preview-overlay{position:absolute;left:0;width:100%;height:100%;display:flex;align-items:center;text-transform:uppercase;justify-content:center;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default));box-shadow:0 1px 8px #00000029;text-shadow:0px 0px 14px rgba(0,0,0,.5)}ax-color-palette ax-color-palette-favorite{display:block;border-top:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches,ax-color-palette ax-color-palette-favorite{display:grid;padding:.5rem;grid-template-columns:repeat(10,minmax(0,1fr));max-height:9rem;overflow-x:hidden;gap:.5rem}ax-color-palette ax-color-palette-swatches div,ax-color-palette ax-color-palette-favorite div{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:99rem;border:1px solid rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches div:before,ax-color-palette ax-color-palette-favorite div:before{content:\"\";padding-top:100%;float:left}ax-color-palette ax-color-palette-swatches div:after,ax-color-palette ax-color-palette-favorite div:after{content:\"\";display:block;clear:both}ax-color-palette ax-color-palette-swatches div:hover,ax-color-palette ax-color-palette-swatches div.ax-state-selected,ax-color-palette ax-color-palette-favorite div:hover,ax-color-palette ax-color-palette-favorite div.ax-state-selected{outline-offset:2px;outline-width:1px;outline-style:solid;outline-color:rgba(var(--ax-color-ghost),.86)}ax-color-palette ax-color-palette-input{display:flex;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-input .palette-inputs{display:flex;flex:1 1 0%;gap:.5rem}ax-color-palette ax-color-palette-input .palette-inputs div{width:100%;text-align:center}ax-color-palette ax-color-palette-input .palette-inputs div label{margin-top:.75rem;font-size:.75rem;line-height:1.25rem}ax-color-palette ax-color-palette-picker{display:flex;flex-direction:column;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay{display:block;width:100%;height:8rem;position:relative}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-pointer{width:.75rem;height:.75rem;border-radius:99rem;background-color:transparent;border:1px solid rgb(var(--ax-color-background-default))}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-
|
712
|
+
], template: "<ng-content select='ax-header'></ng-content>\r\n\r\n<ng-container [ngTemplateOutlet]=\"default\" *ngIf=\"!_children.length\"></ng-container>\r\n<ng-container [ngTemplateOutlet]=\"custom\" *ngIf=\"_children.length\"></ng-container>\r\n\r\n<ng-template #custom>\r\n <ng-content select='ax-color-palette-preview'></ng-content>\r\n <ng-content select='ax-color-palette-picker'></ng-content>\r\n <ng-content select='ax-color-palette-swatches'></ng-content>\r\n <ng-content select='ax-color-palette-favorite'></ng-content>\r\n <ng-content select='ax-color-palette-input'></ng-content>\r\n</ng-template>\r\n<ng-template #default>\r\n <ax-color-palette-preview></ax-color-palette-preview>\r\n <ax-color-palette-swatches></ax-color-palette-swatches>\r\n <ax-color-palette-input></ax-color-palette-input>\r\n</ng-template>\r\n\r\n<ng-content select='ax-footer'></ng-content>\r\n\r\n\r\n", styles: ["ax-color-palette{display:flex;flex-direction:column;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgb(var(--ax-color-border-default));border-radius:var(--ax-rounded-border-default);width:18rem}@media (min-width: 600px){ax-color-palette{width:20rem!important}}@media (min-width: 1200px){ax-color-palette{width:18rem!important}}@media (max-width: 599px){ax-color-palette{width:100%!important}}ax-color-palette.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-color-palette.ax-state-disabled ax-color-palette-swatches div:hover,ax-color-palette.ax-state-disabled ax-color-palette-swatches div.ax-state-selected,ax-color-palette.ax-state-disabled ax-color-palette-favorite div:hover,ax-color-palette.ax-state-disabled ax-color-palette-favorite div.ax-state-selected{opacity:.5;cursor:not-allowed}ax-color-palette ax-header,ax-color-palette ax-footer{padding:.75rem;border-top-width:1px;display:flex}ax-color-palette ax-color-palette-preview{position:relative;width:100%;height:6rem;gap:.5;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=) left center}ax-color-palette ax-color-palette-preview .palette-preview-overlay{position:absolute;left:0;width:100%;height:100%;display:flex;align-items:center;text-transform:uppercase;justify-content:center;border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default));box-shadow:0 1px 8px #00000029;text-shadow:0px 0px 14px rgba(0,0,0,.5)}ax-color-palette ax-color-palette-favorite{display:block;border-top:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches,ax-color-palette ax-color-palette-favorite{display:grid;padding:.5rem;grid-template-columns:repeat(10,minmax(0,1fr));max-height:9rem;overflow-x:hidden;gap:.5rem}ax-color-palette ax-color-palette-swatches div,ax-color-palette ax-color-palette-favorite div{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:99rem;border:1px solid rgb(var(--ax-color-border-default))}ax-color-palette ax-color-palette-swatches div:before,ax-color-palette ax-color-palette-favorite div:before{content:\"\";padding-top:100%;float:left}ax-color-palette ax-color-palette-swatches div:after,ax-color-palette ax-color-palette-favorite div:after{content:\"\";display:block;clear:both}ax-color-palette ax-color-palette-swatches div:hover,ax-color-palette ax-color-palette-swatches div.ax-state-selected,ax-color-palette ax-color-palette-favorite div:hover,ax-color-palette ax-color-palette-favorite div.ax-state-selected{outline-offset:2px;outline-width:1px;outline-style:solid;outline-color:rgba(var(--ax-color-ghost),.86)}ax-color-palette ax-color-palette-input{display:flex;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-input .palette-inputs{display:flex;flex:1 1 0%;gap:.5rem}ax-color-palette ax-color-palette-input .palette-inputs div{width:100%;text-align:center}ax-color-palette ax-color-palette-input .palette-inputs div label{margin-top:.75rem;font-size:.75rem;line-height:1.25rem}ax-color-palette ax-color-palette-picker{display:flex;flex-direction:column;gap:.5rem;padding:.5rem}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay-trans{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=)}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay{display:block;width:100%;height:8rem;position:relative}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-pointer{width:.75rem;height:.75rem;border-radius:99rem;background-color:transparent;border:1px solid rgb(var(--ax-color-background-default));position:relative;z-index:1}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g1,ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g2{height:100%;width:100%;position:absolute;inset:0}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g1{z-index:0;background:linear-gradient(to right,#fff 0%,rgba(255,255,255,0) 100%)}ax-color-palette ax-color-palette-picker .ax-color-picker-overlay .ax-color-picker-overlay-g2{z-index:1;background:linear-gradient(to bottom,transparent 0%,#000 100%)}ax-color-palette ax-color-palette-picker .ax-range-slider.ax-color-picker-gradient input{background:linear-gradient(to right,rgb(255,0,0) 0%,rgb(255,255,0) 17%,rgb(0,255,0) 33%,rgb(0,255,255) 50%,rgb(0,0,255) 67%,rgb(255,0,255) 83%,rgb(255,0,0) 100%)}ax-color-palette ax-color-palette-picker .ax-range-slider.ax-color-picker-transparent input{background-image:linear-gradient(to right,rgba(245,246,252,0),rgb(0,0,0)),url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=)}\n"] }]
|
639
713
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _children: [{
|
640
714
|
type: ContentChildren,
|
641
715
|
args: [AXColorPaletteChildComponent]
|
642
|
-
}], colorModeChange: [{
|
643
|
-
type: Output
|
644
|
-
}], colorMode: [{
|
645
|
-
type: Input
|
646
716
|
}], __hostDisabled: [{
|
647
717
|
type: HostBinding,
|
648
718
|
args: ['class.ax-state-disabled']
|
@@ -654,7 +724,8 @@ const MODULES = [
|
|
654
724
|
AXButtonModule,
|
655
725
|
AXDecoratorModule,
|
656
726
|
AXNumberBoxModule,
|
657
|
-
AXRangeSliderModule
|
727
|
+
AXRangeSliderModule,
|
728
|
+
DragDropModule
|
658
729
|
];
|
659
730
|
const CONPONENTS = [
|
660
731
|
AXColorPalleteComponent,
|
@@ -675,7 +746,8 @@ AXColorPaletteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
675
746
|
AXButtonModule,
|
676
747
|
AXDecoratorModule,
|
677
748
|
AXNumberBoxModule,
|
678
|
-
AXRangeSliderModule
|
749
|
+
AXRangeSliderModule,
|
750
|
+
DragDropModule], exports: [AXColorPalleteComponent,
|
679
751
|
AXColorPalettePreviewComponent,
|
680
752
|
AXColorPaletteSwatchesComponent,
|
681
753
|
AXColorPaletteInputComponent,
|