@acorex/components 7.0.32 → 7.0.34
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/selection-list/src/selection-list.component.mjs +2 -2
- package/esm2020/tabs/src/tabs.component.mjs +2 -2
- 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 +2 -2
- package/fesm2015/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2015/acorex-components-tabs.mjs +2 -2
- package/fesm2015/acorex-components-tabs.mjs.map +1 -1
- 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 +2 -2
- package/fesm2020/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2020/acorex-components-tabs.mjs +2 -2
- package/fesm2020/acorex-components-tabs.mjs.map +1 -1
- 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,16 @@ 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
|
+
return m.typedValue?.startsWith('#') || str == '#' ? str.trim() : '#' + str.trim();
|
54
|
+
},
|
55
|
+
};
|
46
56
|
_parent._onInternalColorChanged$
|
47
57
|
.pipe(distinctUntilChanged())
|
48
|
-
.subscribe(e => {
|
58
|
+
.subscribe((e) => {
|
49
59
|
if (!e.color) {
|
50
60
|
this._hex = '';
|
51
61
|
this._rgba = {
|
@@ -56,25 +66,27 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
56
66
|
};
|
57
67
|
}
|
58
68
|
else {
|
59
|
-
|
60
|
-
|
69
|
+
Object.assign(this._rgba, AXColorUtil.to(e.color, 'rgba'));
|
70
|
+
if (this._colorMode != 'hex' || !this._hex)
|
61
71
|
this._hex = AXColorUtil.toString(e.color, 'hex');
|
62
|
-
|
63
|
-
|
64
|
-
|
72
|
+
if (this._colorMode == 'hex')
|
73
|
+
this._hex = e.color;
|
74
|
+
if (this._rgba.a != 1 && !this._isTouched) {
|
75
|
+
this._colorMode = 'rgba';
|
65
76
|
}
|
66
77
|
}
|
78
|
+
this.checkValid();
|
67
79
|
_cdr.detectChanges();
|
68
80
|
});
|
69
81
|
}
|
70
82
|
_handleChangeInputMode() {
|
71
83
|
this._isTouched = true;
|
72
|
-
switch (this.
|
84
|
+
switch (this._colorMode) {
|
73
85
|
case 'rgba':
|
74
|
-
this.
|
86
|
+
this._colorMode = 'hex';
|
75
87
|
break;
|
76
88
|
default:
|
77
|
-
this.
|
89
|
+
this._colorMode = 'rgba';
|
78
90
|
break;
|
79
91
|
}
|
80
92
|
}
|
@@ -89,20 +101,33 @@ class AXColorPaletteInputComponent extends AXBaseComponent {
|
|
89
101
|
}
|
90
102
|
this._parent._onInternalColorChanged$.next({
|
91
103
|
color: AXColorUtil.toString(_color, 'rgba'),
|
92
|
-
|
104
|
+
sender: this,
|
93
105
|
});
|
94
106
|
}
|
95
107
|
_handleHEXAValueChanged(e) {
|
96
|
-
if (e.value
|
108
|
+
if (!e.value && !e.oldValue)
|
97
109
|
return;
|
110
|
+
//
|
98
111
|
if (e.isUserInteraction) {
|
99
112
|
this._parent._setUserInteraction();
|
100
113
|
this._isTouched = true;
|
101
114
|
}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
115
|
+
//
|
116
|
+
if (!e.value && e.oldValue) {
|
117
|
+
this._parent._onInternalColorChanged$.next({
|
118
|
+
color: null,
|
119
|
+
sender: this
|
120
|
+
});
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
this._parent._onInternalColorChanged$.next({
|
124
|
+
color: e.value,
|
125
|
+
sender: this
|
126
|
+
});
|
127
|
+
}
|
128
|
+
}
|
129
|
+
checkValid() {
|
130
|
+
this.isValid = AXColorUtil.isValid(this._hex);
|
106
131
|
}
|
107
132
|
}
|
108
133
|
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 +136,7 @@ AXColorPaletteInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
|
|
111
136
|
provide: AXColorPaletteChildComponent,
|
112
137
|
useExisting: AXColorPaletteInputComponent,
|
113
138
|
},
|
114
|
-
], usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"
|
139
|
+
], 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
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPaletteInputComponent, decorators: [{
|
116
141
|
type: Component,
|
117
142
|
args: [{ selector: 'ax-color-palette-input', host: { class: 'ax-color-palette-input' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
@@ -119,7 +144,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
119
144
|
provide: AXColorPaletteChildComponent,
|
120
145
|
useExisting: AXColorPaletteInputComponent,
|
121
146
|
},
|
122
|
-
], template: "<ng-container [ngSwitch]=\"
|
147
|
+
], 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
148
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXColorComponent, decorators: [{
|
124
149
|
type: Optional
|
125
150
|
}, {
|
@@ -148,6 +173,7 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
148
173
|
{ color: 'rgb(255, 0, 255)', pos: 0.83 },
|
149
174
|
{ color: 'rgb(255, 0, 0)', pos: 1 },
|
150
175
|
];
|
176
|
+
this.dragPosition = { x: 0, y: 0 };
|
151
177
|
_parent._onInternalColorChanged$
|
152
178
|
.pipe(distinctUntilChanged())
|
153
179
|
.subscribe((e) => {
|
@@ -164,19 +190,23 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
164
190
|
Object.assign(this._rgba, AXColorUtil.to(e.color, 'rgba'));
|
165
191
|
}
|
166
192
|
}
|
167
|
-
this.
|
193
|
+
this.setHSV();
|
168
194
|
_cdr.detectChanges();
|
169
195
|
});
|
170
196
|
}
|
197
|
+
setHSV() {
|
198
|
+
const hsv = AXColorUtil.to(this._rgba, 'hsva');
|
199
|
+
this._bgColor = AXColorUtil.toString({ h: hsv.h, s: 1, v: 1, a: this._rgba.a }, 'rgba');
|
200
|
+
this.setPointerByPercent(hsv.s * 100, hsv.v * 100);
|
201
|
+
}
|
171
202
|
_handleAlphaChanged(e) {
|
172
203
|
if (e.value != null && e.value != this._rgba.a) {
|
173
204
|
const { r, g, b } = this._rgba;
|
174
205
|
const _color = `rgba(${r},${g},${b},${e.value})`;
|
175
|
-
this._parent.colorMode = 'rgba';
|
176
206
|
this._parent._setUserInteraction();
|
177
207
|
this._parent._onInternalColorChanged$.next({
|
178
208
|
color: AXColorUtil.toString(_color, 'rgba'),
|
179
|
-
|
209
|
+
sender: this,
|
180
210
|
});
|
181
211
|
}
|
182
212
|
}
|
@@ -184,14 +214,69 @@ class AXColorPalettePickerComponent extends AXBaseComponent {
|
|
184
214
|
if (e.value != null && e.value != this._gradient) {
|
185
215
|
const gradient = AXColorUtil.gradient(this._gradientColors);
|
186
216
|
const colors = gradient.rgb(100);
|
187
|
-
|
217
|
+
const { s, v } = AXColorUtil.to(this._rgba, "hsva");
|
218
|
+
const { h } = colors[e.value].toHsv();
|
188
219
|
this._parent._setUserInteraction();
|
189
220
|
this._parent._onInternalColorChanged$.next({
|
190
|
-
color: AXColorUtil.toString(
|
191
|
-
|
221
|
+
color: AXColorUtil.toString({ h, s, v, a: this._rgba.a }, 'rgba'),
|
222
|
+
sender: this,
|
192
223
|
});
|
193
224
|
}
|
194
225
|
}
|
226
|
+
_handleSurfaceClick(e) {
|
227
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
228
|
+
const sb = surface.getBoundingClientRect();
|
229
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
230
|
+
const pb = pointer.getBoundingClientRect();
|
231
|
+
let x = e.offsetX;
|
232
|
+
let y = e.offsetY;
|
233
|
+
this.setColorByXY(x, y);
|
234
|
+
}
|
235
|
+
_handleDrag() {
|
236
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
237
|
+
const sb = surface.getBoundingClientRect();
|
238
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
239
|
+
const pb = pointer.getBoundingClientRect();
|
240
|
+
const w = (pb.width / 2);
|
241
|
+
let x = (pb.left - sb.left) + w;
|
242
|
+
let y = (pb.top - sb.top) + w;
|
243
|
+
//
|
244
|
+
x = x < 0 ? 0 : x;
|
245
|
+
x = x > sb.width ? sb.width : x;
|
246
|
+
//
|
247
|
+
y = y < 0 ? 0 : y;
|
248
|
+
y = y > sb.height ? sb.height : y;
|
249
|
+
//
|
250
|
+
this.setColorByXY(x, y);
|
251
|
+
}
|
252
|
+
setColorByXY(x, y) {
|
253
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
254
|
+
const sb = surface.getBoundingClientRect();
|
255
|
+
//
|
256
|
+
const { h } = AXColorUtil.to(this._bgColor, "hsva");
|
257
|
+
const hsv = {
|
258
|
+
h,
|
259
|
+
s: (x / sb.width),
|
260
|
+
v: ((sb.height - y) / sb.height)
|
261
|
+
};
|
262
|
+
this._parent._onInternalColorChanged$.next({
|
263
|
+
color: AXColorUtil.toString(hsv, 'rgba'),
|
264
|
+
sender: this,
|
265
|
+
});
|
266
|
+
}
|
267
|
+
setPointerByPercent(x, y) {
|
268
|
+
const surface = this._getHostElement().querySelector(".ax-color-picker-overlay");
|
269
|
+
const sb = surface.getBoundingClientRect();
|
270
|
+
const pointer = this._getHostElement().querySelector(".ax-color-picker-pointer");
|
271
|
+
const pb = pointer.getBoundingClientRect();
|
272
|
+
const w = (pb.width / 2);
|
273
|
+
const width = sb.width; //+ pb.width
|
274
|
+
const height = sb.height; // + pb.width
|
275
|
+
this.dragPosition = {
|
276
|
+
x: ((x * width) / 100) - w,
|
277
|
+
y: (height - (((y * height)) / 100)) - w
|
278
|
+
};
|
279
|
+
}
|
195
280
|
}
|
196
281
|
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 });
|
197
282
|
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: [
|
@@ -199,7 +284,7 @@ AXColorPalettePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
|
|
199
284
|
provide: AXColorPaletteChildComponent,
|
200
285
|
useExisting: AXColorPalettePickerComponent,
|
201
286
|
},
|
202
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n
|
287
|
+
], 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 });
|
203
288
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalettePickerComponent, decorators: [{
|
204
289
|
type: Component,
|
205
290
|
args: [{ selector: 'ax-color-palette-picker', host: { class: 'ax-color-palette-picker' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
@@ -207,7 +292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
207
292
|
provide: AXColorPaletteChildComponent,
|
208
293
|
useExisting: AXColorPalettePickerComponent,
|
209
294
|
},
|
210
|
-
], template: "<div class=\"ax-color-picker-overlay\" [style.background-color]=\"_bgColor\">\r\n
|
295
|
+
], 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>" }]
|
211
296
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXColorComponent, decorators: [{
|
212
297
|
type: Optional
|
213
298
|
}, {
|
@@ -225,9 +310,7 @@ class AXColorPalettePreviewComponent extends AXBaseComponent {
|
|
225
310
|
.subscribe((e) => {
|
226
311
|
_zone.runOutsideAngular(() => {
|
227
312
|
this._getInnerElement().style.backgroundColor = e.color;
|
228
|
-
this._getInnerElement().innerText = e.color
|
229
|
-
? AXColorUtil.toString(e.color, e.mode)
|
230
|
-
: '';
|
313
|
+
this._getInnerElement().innerText = AXColorUtil.toString(e.color);
|
231
314
|
const color = AXColorUtil.toString(e.color, 'hex');
|
232
315
|
const ratio = AXColorUtil.contrastToWhite(color);
|
233
316
|
this._getHostElement().style.color = !(ratio > 2.0) ? '#000' : '#fff';
|
@@ -502,8 +585,10 @@ class AXColorPaletteSwatchesComponent extends AXBaseComponent {
|
|
502
585
|
this._selected = AXColorUtil.toString(e.color, 'hex').toLowerCase();
|
503
586
|
this._cdr.detectChanges();
|
504
587
|
});
|
505
|
-
|
506
|
-
|
588
|
+
}
|
589
|
+
onInit() {
|
590
|
+
const isFav = this._getHostElement().tagName.toLowerCase() == 'ax-color-palette-favorite';
|
591
|
+
if (!isFav && this.colors.length == 0) {
|
507
592
|
this.colors = this._defaultPalette.map(c => this._format(c));
|
508
593
|
}
|
509
594
|
}
|
@@ -513,7 +598,7 @@ class AXColorPaletteSwatchesComponent extends AXBaseComponent {
|
|
513
598
|
this._parent._setUserInteraction();
|
514
599
|
this._parent._onInternalColorChanged$.next({
|
515
600
|
color: color.code,
|
516
|
-
|
601
|
+
sender: this
|
517
602
|
});
|
518
603
|
}
|
519
604
|
_format(color) {
|
@@ -566,8 +651,6 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
566
651
|
constructor(elementRef, cdr) {
|
567
652
|
super(elementRef, cdr);
|
568
653
|
this._onInternalColorChanged$ = new Subject();
|
569
|
-
this.colorModeChange = new EventEmitter();
|
570
|
-
this._colorMode = 'hex';
|
571
654
|
//
|
572
655
|
this._onInternalColorChanged$.pipe(distinctUntilChanged()).subscribe(e => {
|
573
656
|
if (this.disabled || this.readonly)
|
@@ -576,37 +659,26 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
576
659
|
cdr.markForCheck();
|
577
660
|
});
|
578
661
|
}
|
579
|
-
/**
|
580
|
-
* A character value that specifies the separator character.
|
581
|
-
*/
|
582
|
-
get colorMode() {
|
583
|
-
return this._colorMode;
|
584
|
-
}
|
585
|
-
set colorMode(v) {
|
586
|
-
this._setOption({
|
587
|
-
name: 'colorMode',
|
588
|
-
value: v,
|
589
|
-
});
|
590
|
-
}
|
591
662
|
_onValueChanged(oldValue, newValue) {
|
592
663
|
super._onValueChanged(oldValue, newValue);
|
593
664
|
this._onInternalColorChanged$.next({
|
594
665
|
color: this.value,
|
595
|
-
mode:
|
666
|
+
mode: newValue?.startsWith('#') ? "hex" : "rgba",
|
667
|
+
sender: this
|
596
668
|
});
|
597
669
|
}
|
598
670
|
ngAfterContentInit() {
|
599
671
|
this._children.changes.subscribe(() => {
|
600
672
|
this._onInternalColorChanged$.next({
|
601
673
|
color: this.value,
|
602
|
-
|
674
|
+
sender: this
|
603
675
|
});
|
604
676
|
});
|
605
677
|
}
|
606
678
|
onViewInit() {
|
607
679
|
this._onInternalColorChanged$.next({
|
608
680
|
color: this.value,
|
609
|
-
|
681
|
+
sender: this
|
610
682
|
});
|
611
683
|
}
|
612
684
|
get __hostDisabled() {
|
@@ -614,9 +686,9 @@ class AXColorPalleteComponent extends AXBaseValueComponentMixin {
|
|
614
686
|
}
|
615
687
|
}
|
616
688
|
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 });
|
617
|
-
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",
|
689
|
+
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: [
|
618
690
|
{ provide: AXColorComponent, useExisting: AXColorPalleteComponent },
|
619
|
-
], 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-
|
691
|
+
], 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 });
|
620
692
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AXColorPalleteComponent, decorators: [{
|
621
693
|
type: Component,
|
622
694
|
args: [{ selector: 'ax-color-palette', inputs: [
|
@@ -625,18 +697,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
625
697
|
'readonly',
|
626
698
|
'allowNull',
|
627
699
|
'value',
|
700
|
+
'state',
|
628
701
|
'name',
|
629
702
|
'checked',
|
630
|
-
], outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
703
|
+
], outputs: ['onBlur', 'onFocus', 'valueChange', 'stateChange', 'onValueChanged'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
631
704
|
{ provide: AXColorComponent, useExisting: AXColorPalleteComponent },
|
632
|
-
], 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-
|
705
|
+
], 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"] }]
|
633
706
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _children: [{
|
634
707
|
type: ContentChildren,
|
635
708
|
args: [AXColorPaletteChildComponent]
|
636
|
-
}], colorModeChange: [{
|
637
|
-
type: Output
|
638
|
-
}], colorMode: [{
|
639
|
-
type: Input
|
640
709
|
}], __hostDisabled: [{
|
641
710
|
type: HostBinding,
|
642
711
|
args: ['class.ax-state-disabled']
|
@@ -648,7 +717,8 @@ const MODULES = [
|
|
648
717
|
AXButtonModule,
|
649
718
|
AXDecoratorModule,
|
650
719
|
AXNumberBoxModule,
|
651
|
-
AXRangeSliderModule
|
720
|
+
AXRangeSliderModule,
|
721
|
+
DragDropModule
|
652
722
|
];
|
653
723
|
const CONPONENTS = [
|
654
724
|
AXColorPalleteComponent,
|
@@ -669,7 +739,8 @@ AXColorPaletteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
669
739
|
AXButtonModule,
|
670
740
|
AXDecoratorModule,
|
671
741
|
AXNumberBoxModule,
|
672
|
-
AXRangeSliderModule
|
742
|
+
AXRangeSliderModule,
|
743
|
+
DragDropModule], exports: [AXColorPalleteComponent,
|
673
744
|
AXColorPalettePreviewComponent,
|
674
745
|
AXColorPaletteSwatchesComponent,
|
675
746
|
AXColorPaletteInputComponent,
|