ru.coon 2.7.3 → 2.7.4
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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/common/component/ChooseColorField.js +142 -0
- package/src/common/component/ColorPalette.js +151 -0
- package/src/common/component/ColorPalette.scss +102 -0
- package/src/common/component/ColorPaletteController.js +189 -0
- package/src/common/field/withDefault.js +3 -2
- package/src/report/plugin/configPanel/GridEditorPluginConfig.js +3 -1
- package/src/report/plugin/configPanel/GridRowStylePluginConfig.js +130 -94
- package/src/report/plugin/configPanel/GridRowStylePluginConfigPropertyGrid.js +10 -15
- package/src/report/plugin/grid/GridEditorsPlugin.js +27 -21
- package/src/report/plugin/grid/GridRowStylePlugin.js +90 -0
- package/src/uielement/component/formchips/Chip.js +2 -2
- package/src/uielement/component/formchips/FilterConditionToolbar.js +2 -1
- package/src/uielement/component/formchips/FilterConditionToolbarController.js +37 -60
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Version 2.7.4, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7becde7cc7cfb8254525c8beca11cbd4604b8181)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: HT-7823: refactor</span> ([07e9f0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/07e9f00376ea39fe7888e7d264d291222667ce0f))
|
|
4
|
+
* <span style='color:green'>feat: HT-7823: change line colors</span> ([f70a74], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f70a748a7f77cc984eae2e762e86e291a0b25230))
|
|
5
|
+
* <span style='color:green'>feat: HT-7823: remove gradient check</span> ([76e538], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/76e5389eb644d45df7deabffeb24de1767d67c7b))
|
|
6
|
+
* <span style='color:green'>feat: HT-7823: lighting tree grid items</span> ([a56e4d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a56e4dcab0b10494721d809c2fb4d2f10ce5d257))
|
|
7
|
+
|
|
8
|
+
* HT-7850 fix: Исправление поведения чипа в FilterConditionToolbar при изменениях значения поля панели фильтрации. ([3fbf41], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3fbf417948d24be8a576739e0e41fe170221788e))
|
|
9
|
+
* ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update src/report/plugin/grid/GridEditorsPlugin.jsa0bc93ea280291eae1d401ceeb056bb250f5ed09))
|
|
10
|
+
* update: CHANGELOG.md ([78c174], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/78c1741b921889b7c20f96a342aa91a262a21fc5))
|
|
11
|
+
|
|
1
12
|
# Version 2.7.3, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e9a311b868bd00ad5e46a868e7f0b829122ffa06)
|
|
2
13
|
* refactoring ([1385c2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1385c2bf065c0e57f6d8484cf360a1201cdbb656))
|
|
3
14
|
* update: CHANGELOG.md ([10bd16], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/10bd16df0b8d6d43c2a41f2651b8610c35dcd899))
|
|
@@ -5,6 +16,7 @@
|
|
|
5
16
|
# Version 2.7.2, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3b94df2c23f76552c5c626a4bfda4a317e33abff)
|
|
6
17
|
* ## Features
|
|
7
18
|
* <span style='color:green'>feat: HT-8199: trim string values in request</span> ([cfc709], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cfc709daacaad1522f4dff858e04966a758bcb6a))
|
|
19
|
+
* <span style='color:green'>feat: HT-7823: create color choose component (Palettes)</span> ([157c14], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/157c14384904b60004a34ce67ce70a6923216799))
|
|
8
20
|
|
|
9
21
|
* ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update src/common/component/editor/CharacteristicLoaderPlugin.js929fc3b32d028554706e1d64c6ca40fedc615f39))
|
|
10
22
|
* update: CHANGELOG.md ([44e78b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/44e78b830a9a374db90e2fc1554188c9154ce462))
|
|
@@ -18,8 +30,12 @@
|
|
|
18
30
|
|
|
19
31
|
# Version 2.7.0, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c03c093df3594cbec9b0b6a2e3e4ca8d24b07e76)
|
|
20
32
|
* ## Features
|
|
33
|
+
* <span style='color:green'>feat: HT-7823: create color choose component (Palettes)</span> ([5d31ff], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5d31ffbbe224fa48f9631adc23b109cf5d25236f))
|
|
21
34
|
* <span style='color:green'>feat: HT-7850 Включение FilterConditionToolbar в ReportPanel</span> ([02015f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/02015fd6518dec2fbbf4a16e8e29ff958fe4f1b3))
|
|
22
35
|
|
|
36
|
+
* ## Fixes
|
|
37
|
+
* <span style='color:red'> HT-7281 GridEditorsPlugin combo editor</span> ([8b140d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8b140d19abc9e5dd3816ce4cb00e0ec8ee1cbc03))
|
|
38
|
+
|
|
23
39
|
* refactoring ([1c317f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1c317fadf1591a82907cdff905e69d4978dae061))
|
|
24
40
|
* upd ([e79155], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e791556cf00505255593cd1bf6ad022d75c19d79))
|
|
25
41
|
* HT-7444 Исправление ([043abe], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/043abea7c90d62b17a3c4819845a1e20dda36790))
|
package/package.json
CHANGED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Ext.define('Coon.common.component.ChooseColorField', {
|
|
2
|
+
extend: 'Ext.form.field.Picker',
|
|
3
|
+
xtype: 'ChooseColorField',
|
|
4
|
+
cls: 'ColorPalette',
|
|
5
|
+
format: 'rgba',
|
|
6
|
+
config: {
|
|
7
|
+
gradient: false,
|
|
8
|
+
hideClearTrigger: false,
|
|
9
|
+
value: null,
|
|
10
|
+
popup: {
|
|
11
|
+
lazy: true,
|
|
12
|
+
$value: {
|
|
13
|
+
xtype: 'window',
|
|
14
|
+
referenceHolder: true,
|
|
15
|
+
width: 600,
|
|
16
|
+
minWidth: 600,
|
|
17
|
+
minHeight: 400,
|
|
18
|
+
layout: 'fit',
|
|
19
|
+
height: 400,
|
|
20
|
+
header: false,
|
|
21
|
+
resizable: true,
|
|
22
|
+
items: {
|
|
23
|
+
xtype: 'ColorPalette',
|
|
24
|
+
relayedEvents: ['colorChoose'],
|
|
25
|
+
reference: 'selector',
|
|
26
|
+
showPreviousColor: true,
|
|
27
|
+
showOkCancelButtons: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
controller: {
|
|
33
|
+
init() {
|
|
34
|
+
const view = this.getView();
|
|
35
|
+
this.getView().on('change', view.hideClear, view);
|
|
36
|
+
this.getView().on('render', view.hideClear, view);
|
|
37
|
+
this.getView().on('render', view.setColorMarker, view);
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
setValue: function(value) {
|
|
41
|
+
this.callParent(arguments);
|
|
42
|
+
this.setColorMarker();
|
|
43
|
+
},
|
|
44
|
+
getGradient() {
|
|
45
|
+
return this.gradient;
|
|
46
|
+
},
|
|
47
|
+
setGradient(gradient) {
|
|
48
|
+
this.gradient = gradient;
|
|
49
|
+
},
|
|
50
|
+
createPicker: function() {
|
|
51
|
+
const me = this;
|
|
52
|
+
let popup = me.getPopup();
|
|
53
|
+
let picker;
|
|
54
|
+
// the window will actually be shown and will house the picker
|
|
55
|
+
popup.items.gradient= this.getGradient();
|
|
56
|
+
me.colorPickerWindow = popup = Ext.create(popup);
|
|
57
|
+
me.colorPicker = picker = popup.lookupReference('selector');
|
|
58
|
+
picker.setValue(me.getValue());
|
|
59
|
+
|
|
60
|
+
picker.on({
|
|
61
|
+
colorChoose: 'onColorChoose',
|
|
62
|
+
scope: me,
|
|
63
|
+
});
|
|
64
|
+
return me.colorPickerWindow;
|
|
65
|
+
},
|
|
66
|
+
onColorChoose(colorPicker, colors) {
|
|
67
|
+
if (colors && colors.length) {
|
|
68
|
+
this.setValue(colors.length === 1 ? colors[0] : JSON.stringify(colors));
|
|
69
|
+
} else {
|
|
70
|
+
this.setValue(null);
|
|
71
|
+
}
|
|
72
|
+
this.collapse();
|
|
73
|
+
},
|
|
74
|
+
setColorMarker() {
|
|
75
|
+
if (!this.inputWrap) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this.inputWrap.maskElem) {
|
|
79
|
+
this.inputWrap.dom.removeChild(this.inputWrap.maskElem);
|
|
80
|
+
this.inputWrap.maskElem = null;
|
|
81
|
+
}
|
|
82
|
+
const value = this.getValue();
|
|
83
|
+
let color = null;
|
|
84
|
+
if (Ext.isArray(value)) {
|
|
85
|
+
color = value[0];
|
|
86
|
+
} else if (value.search(/\[/) >= 0) {
|
|
87
|
+
try {
|
|
88
|
+
const arr = eval(value);
|
|
89
|
+
color = arr[0];
|
|
90
|
+
const div = document.createElement('div');
|
|
91
|
+
const p = document.createElement('div');
|
|
92
|
+
div.appendChild(p);
|
|
93
|
+
div.setAttribute('class', 'gradient-mask');
|
|
94
|
+
p.innerHTML = 'Набор цветов';
|
|
95
|
+
this.inputWrap.dom.appendChild(div);
|
|
96
|
+
this.inputWrap.maskElem = div;
|
|
97
|
+
} catch (e) {
|
|
98
|
+
Coon.log.error(e);
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
color = value;
|
|
102
|
+
}
|
|
103
|
+
this.swatchEl.setStyle({
|
|
104
|
+
backgroundColor: color || null,
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
hideClear() {
|
|
108
|
+
if (this.getHideClearTrigger() === true || !this.triggers) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const value = this.getValue();
|
|
112
|
+
if (!this.triggers.clear.hideOnReadOnly || !this.readOnly) {
|
|
113
|
+
this.triggers.clear.setHidden(!value);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
beforeBodyEl: [
|
|
117
|
+
'<div class="' + Ext.baseCSSPrefix + 'colorpicker-field-swatch">' +
|
|
118
|
+
'<div id="{id}-swatchEl" data-ref="swatchEl" class="' + Ext.baseCSSPrefix +
|
|
119
|
+
'colorpicker-field-swatch-inner"></div>' +
|
|
120
|
+
'</div>'
|
|
121
|
+
],
|
|
122
|
+
childEls: [
|
|
123
|
+
'swatchEl'
|
|
124
|
+
],
|
|
125
|
+
editable: false,
|
|
126
|
+
triggers: {
|
|
127
|
+
clear: {
|
|
128
|
+
cls: 'svg-icon svg-icon-cancel-small',
|
|
129
|
+
tooltip: 'Очистить поле',
|
|
130
|
+
hidden: true,
|
|
131
|
+
hideOnReadOnly: true,
|
|
132
|
+
handler: function() {
|
|
133
|
+
this.setValue(null);
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
picker: {
|
|
137
|
+
handler: 'onTriggerClick',
|
|
138
|
+
scope: 'this',
|
|
139
|
+
focusOnMousedown: true,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Ext.define('Coon.common.component.ColorPalette', {
|
|
2
|
+
extend: 'Ext.tab.Panel',
|
|
3
|
+
xtype: 'ColorPalette',
|
|
4
|
+
cls: 'ColorPalette',
|
|
5
|
+
hideHeaders: true,
|
|
6
|
+
config: {
|
|
7
|
+
value: null,
|
|
8
|
+
gradient: false,
|
|
9
|
+
},
|
|
10
|
+
setValue(value) {
|
|
11
|
+
this.value = value;
|
|
12
|
+
},
|
|
13
|
+
getValue() {
|
|
14
|
+
return this.value;
|
|
15
|
+
},
|
|
16
|
+
getGradient() {
|
|
17
|
+
return this.gradient;
|
|
18
|
+
},
|
|
19
|
+
setGradient(gradient) {
|
|
20
|
+
this.gradient = gradient;
|
|
21
|
+
this.getViewModel().set('gradient', gradient);
|
|
22
|
+
},
|
|
23
|
+
controller: 'ColorPaletteController',
|
|
24
|
+
initComponent() {
|
|
25
|
+
this.getViewModel().set('gradient', !!this.gradient);
|
|
26
|
+
if (this.gradient === true) {
|
|
27
|
+
this.items[0].selModel = 'rowmodel';
|
|
28
|
+
} else {
|
|
29
|
+
this.items[0].selModel = 'cellmodel';
|
|
30
|
+
}
|
|
31
|
+
this.callParent(arguments);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
viewModel: {
|
|
35
|
+
data: {
|
|
36
|
+
selected: null,
|
|
37
|
+
opacity: true,
|
|
38
|
+
gradient: false,
|
|
39
|
+
color: null,
|
|
40
|
+
selectorColor: null,
|
|
41
|
+
},
|
|
42
|
+
stores: {
|
|
43
|
+
ColorPalettetore: {
|
|
44
|
+
type: 'json',
|
|
45
|
+
},
|
|
46
|
+
data: [],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
items: [
|
|
50
|
+
{
|
|
51
|
+
xtype: 'grid',
|
|
52
|
+
title: 'Палитра цветов',
|
|
53
|
+
reference: 'palletGrid',
|
|
54
|
+
bind: {
|
|
55
|
+
store: '{ColorPalettetore}',
|
|
56
|
+
selection: '{selected}',
|
|
57
|
+
},
|
|
58
|
+
selModel: 'cellmodel',
|
|
59
|
+
columns: [],
|
|
60
|
+
listeners: {
|
|
61
|
+
selectionchange: 'onSelectionChange',
|
|
62
|
+
},
|
|
63
|
+
buttons: [
|
|
64
|
+
{
|
|
65
|
+
reference: 'selectedButton',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
xtype: 'displayfield',
|
|
69
|
+
reference: 'displayColor',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
xtype: 'checkbox',
|
|
73
|
+
boxLabel: 'Градиент',
|
|
74
|
+
bind: {
|
|
75
|
+
value: '{gradient}',
|
|
76
|
+
},
|
|
77
|
+
margin: '0 20px 0 0',
|
|
78
|
+
disabled: true,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
xtype: 'checkbox',
|
|
82
|
+
boxLabel: 'Не прозрачный',
|
|
83
|
+
checked: true,
|
|
84
|
+
value: true,
|
|
85
|
+
bind: {
|
|
86
|
+
value: '{opacity}',
|
|
87
|
+
},
|
|
88
|
+
margin: '0 20px 0 0',
|
|
89
|
+
},
|
|
90
|
+
{xtype: 'tbfill'},
|
|
91
|
+
{
|
|
92
|
+
ui: 'orange-button',
|
|
93
|
+
text: 'Выбрать',
|
|
94
|
+
handler: 'choose',
|
|
95
|
+
bind: {
|
|
96
|
+
disabled: '{!selected}',
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: 'Свой цвет',
|
|
103
|
+
reference: 'customColorTab',
|
|
104
|
+
bind: {
|
|
105
|
+
hidden: '{gradient}',
|
|
106
|
+
},
|
|
107
|
+
layout: 'fit',
|
|
108
|
+
items: {
|
|
109
|
+
xtype: 'colorselector',
|
|
110
|
+
format: 'rgba',
|
|
111
|
+
alphaDecimalFormat: '#.#',
|
|
112
|
+
listeners: {
|
|
113
|
+
change: 'onSelectorChange',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
buttons: [
|
|
117
|
+
{
|
|
118
|
+
reference: 'selectedCustomButton',
|
|
119
|
+
listeners: {
|
|
120
|
+
render: 'onRenderDisplayColor',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
xtype: 'displayfield',
|
|
125
|
+
bind: {
|
|
126
|
+
value: '{selectorColor}',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
xtype: 'checkbox',
|
|
131
|
+
boxLabel: 'Gradient',
|
|
132
|
+
bind: {
|
|
133
|
+
value: '{gradient}',
|
|
134
|
+
},
|
|
135
|
+
margin: '0 20px 0 0',
|
|
136
|
+
hidden: true,
|
|
137
|
+
},
|
|
138
|
+
{xtype: 'tbfill'},
|
|
139
|
+
{
|
|
140
|
+
ui: 'orange-button',
|
|
141
|
+
text: 'Выбрать',
|
|
142
|
+
handler: 'chooseCustom',
|
|
143
|
+
bind: {
|
|
144
|
+
disabled: '{!selectorColor}',
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
|
|
151
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--ColorPalette-pallet-1-color-1: rgba(238, 64, 53, 1);
|
|
3
|
+
--ColorPalette-pallet-1-color-2: rgba(241, 102, 93, 1);
|
|
4
|
+
--ColorPalette-pallet-1-color-3: rgba(247, 159, 154, 1);
|
|
5
|
+
--ColorPalette-pallet-1-color-4: rgba(248, 179, 174, 1);
|
|
6
|
+
--ColorPalette-pallet-1-color-5: rgba(250, 198, 194, 1);
|
|
7
|
+
--ColorPalette-pallet-1-color-6: rgba(252, 217, 215, 1);
|
|
8
|
+
--ColorPalette-pallet-1-color-7: rgba(253, 236, 235, 1);
|
|
9
|
+
|
|
10
|
+
--ColorPalette-pallet-2-color-1: rgba(250, 127, 46, 1);
|
|
11
|
+
--ColorPalette-pallet-2-color-2: rgba(251, 153, 88, 1);
|
|
12
|
+
--ColorPalette-pallet-2-color-3: rgba(252, 191, 150, 1);
|
|
13
|
+
--ColorPalette-pallet-2-color-4: rgba(253, 204, 171, 1);
|
|
14
|
+
--ColorPalette-pallet-2-color-5: rgba(253, 217, 192, 1);
|
|
15
|
+
--ColorPalette-pallet-2-color-6: rgba(254, 229, 213, 1);
|
|
16
|
+
--ColorPalette-pallet-2-color-7: rgba(255, 242, 234, 1);
|
|
17
|
+
|
|
18
|
+
--ColorPalette-pallet-3-color-1: rgba(246, 200, 33, 1);
|
|
19
|
+
--ColorPalette-pallet-3-color-2: rgba(248, 211, 77, 1);
|
|
20
|
+
--ColorPalette-pallet-3-color-3: rgba(251, 227, 144, 1);
|
|
21
|
+
--ColorPalette-pallet-3-color-4: rgba(251, 233, 166, 1);
|
|
22
|
+
--ColorPalette-pallet-3-color-5: rgba(252, 239, 188, 1);
|
|
23
|
+
--ColorPalette-pallet-3-color-6: rgba(253, 244, 211, 1);
|
|
24
|
+
--ColorPalette-pallet-3-color-7: rgba(254, 249, 233, 1);
|
|
25
|
+
|
|
26
|
+
--ColorPalette-pallet-4-color-1: rgba(104, 180, 102, 1);
|
|
27
|
+
--ColorPalette-pallet-4-color-2: rgba(134, 195, 133, 1);
|
|
28
|
+
--ColorPalette-pallet-4-color-3: rgba(179, 217, 179, 1);
|
|
29
|
+
--ColorPalette-pallet-4-color-4: rgba(195, 225, 194, 1);
|
|
30
|
+
--ColorPalette-pallet-4-color-5: rgba(210, 233, 209, 1);
|
|
31
|
+
--ColorPalette-pallet-4-color-6: rgba(225, 240, 225, 1);
|
|
32
|
+
--ColorPalette-pallet-4-color-7: rgba(240, 247, 240, 1);
|
|
33
|
+
|
|
34
|
+
--ColorPalette-pallet-5-color-1: rgba(69, 160, 185, 1);
|
|
35
|
+
--ColorPalette-pallet-5-color-2: rgba(106, 179, 199, 1);
|
|
36
|
+
--ColorPalette-pallet-5-color-3: rgba(162, 207, 220, 1);
|
|
37
|
+
--ColorPalette-pallet-5-color-4: rgba(181, 217, 227, 1);
|
|
38
|
+
--ColorPalette-pallet-5-color-5: rgba(199, 227, 234, 1);
|
|
39
|
+
--ColorPalette-pallet-5-color-6: rgba(218, 236, 241, 1);
|
|
40
|
+
--ColorPalette-pallet-5-color-7: rgba(236, 245, 248, 1);
|
|
41
|
+
|
|
42
|
+
--ColorPalette-pallet-6-color-1: rgba(61, 120, 191, 1);
|
|
43
|
+
--ColorPalette-pallet-6-color-2: rgba(100, 147, 204, 1);
|
|
44
|
+
--ColorPalette-pallet-6-color-3: rgba(158, 187, 223, 1);
|
|
45
|
+
--ColorPalette-pallet-6-color-4: rgba(177, 201, 229, 1);
|
|
46
|
+
--ColorPalette-pallet-6-color-5: rgba(197, 215, 236, 1);
|
|
47
|
+
--ColorPalette-pallet-6-color-6: rgba(216, 228, 242, 1);
|
|
48
|
+
--ColorPalette-pallet-6-color-7: rgba(236, 241, 249, 1);
|
|
49
|
+
|
|
50
|
+
--ColorPalette-pallet-7-color-1: rgba(138, 97, 187, 1);
|
|
51
|
+
--ColorPalette-pallet-7-color-2: rgba(161, 129, 201, 1);
|
|
52
|
+
--ColorPalette-pallet-7-color-3: rgba(196, 176, 221, 1);
|
|
53
|
+
--ColorPalette-pallet-7-color-4: rgba(208, 192, 228, 1);
|
|
54
|
+
--ColorPalette-pallet-7-color-5: rgba(220, 208, 235, 1);
|
|
55
|
+
--ColorPalette-pallet-7-color-6: rgba(232, 223, 241, 1);
|
|
56
|
+
--ColorPalette-pallet-7-color-7: rgba(243, 239, 248, 1);
|
|
57
|
+
}
|
|
58
|
+
.ColorPalette {
|
|
59
|
+
.x-grid-cell, .x-grid-item{
|
|
60
|
+
border: 1px solid transparent;
|
|
61
|
+
}
|
|
62
|
+
.x-grid-item-selected, .x-grid-cell-selected{
|
|
63
|
+
border: 1px solid red !important;
|
|
64
|
+
}
|
|
65
|
+
.x-colorpicker-field-swatch{
|
|
66
|
+
position: absolute;
|
|
67
|
+
width: 20px;
|
|
68
|
+
height: 20px;
|
|
69
|
+
top: auto;
|
|
70
|
+
bottom: auto;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
margin-top: 4px;
|
|
73
|
+
left: 4px;
|
|
74
|
+
}
|
|
75
|
+
.x-form-field.x-form-text.x-form-text-default{
|
|
76
|
+
padding-left: 30px;
|
|
77
|
+
}
|
|
78
|
+
.x-form-text-wrap{
|
|
79
|
+
margin-left: 5px;
|
|
80
|
+
}
|
|
81
|
+
.x-colorpicker-field-swatch-inner{
|
|
82
|
+
border-radius: 4px;
|
|
83
|
+
}
|
|
84
|
+
.x-form-item-label{
|
|
85
|
+
left: 20px;
|
|
86
|
+
}
|
|
87
|
+
.gradient-mask{
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 75%;
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 20px;
|
|
93
|
+
background-color: white;
|
|
94
|
+
padding-right: 17px;
|
|
95
|
+
display: flex;
|
|
96
|
+
margin-top: 4px;
|
|
97
|
+
div{
|
|
98
|
+
align-self: center;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Ext.define('Coon.common.component.ColorPaletteController', {
|
|
2
|
+
extend: 'Ext.app.ViewController',
|
|
3
|
+
alias: 'controller.ColorPaletteController',
|
|
4
|
+
hasMatch: false,
|
|
5
|
+
value: null,
|
|
6
|
+
|
|
7
|
+
getColorsAndNormalizeFormat(color) {
|
|
8
|
+
const colorArr = color.replace('rgba(', '').replace(')', '').split(',');
|
|
9
|
+
if (colorArr.length === 5) {
|
|
10
|
+
colorArr[3] = colorArr[3].trim() + '.' + colorArr[4].trim();
|
|
11
|
+
colorArr.pop();
|
|
12
|
+
}
|
|
13
|
+
return colorArr;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
init: function(view) {
|
|
17
|
+
if (this.getView().getValue()) {
|
|
18
|
+
const colorArr = this.getColorsAndNormalizeFormat(this.getView().getValue());
|
|
19
|
+
if ((colorArr[3] + '').search(/0\./gi) >= 0) {
|
|
20
|
+
this.getViewModel().set('opacity', false);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.getViewModel().bind('{opacity}', this.getRecords, this);
|
|
25
|
+
view.on('tabchange', this.onTabChange.bind(this));
|
|
26
|
+
this.lookup('palletGrid').getView().on('refresh', this.setSelectionByValue, this);
|
|
27
|
+
},
|
|
28
|
+
setSelectionByValue() {
|
|
29
|
+
const vm = this.getViewModel();
|
|
30
|
+
const store = vm.getStore('ColorPalettetore');
|
|
31
|
+
if (store.getRange().length && this.hasMatch !== false) {
|
|
32
|
+
this.lookup('palletGrid').getSelectionModel().select(vm.get('gradient') === false ? this.hasMatch : this.hasMatch[1]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
getRecords(opacity) {
|
|
36
|
+
this.lookup('selectedButton').setStyle({
|
|
37
|
+
backgroundColor: null,
|
|
38
|
+
});
|
|
39
|
+
this.lookup('displayColor').setValue(null);
|
|
40
|
+
this.getViewModel().set('selected', null);
|
|
41
|
+
const pallet = this.getColorsMatrix(opacity);
|
|
42
|
+
if (!Ext.isArray(pallet)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let colsLength = 0;
|
|
46
|
+
pallet.forEach((arr) => {
|
|
47
|
+
const l = Object.keys(arr);
|
|
48
|
+
if (colsLength < l.length) {
|
|
49
|
+
colsLength = l.length;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
if (colsLength > 0) {
|
|
53
|
+
const cols = [];
|
|
54
|
+
for (let i = 0; i < colsLength; i++) {
|
|
55
|
+
cols.push({
|
|
56
|
+
dataIndex: 'data' + (i + 1),
|
|
57
|
+
flex: 1,
|
|
58
|
+
renderer: (v, mt) => {
|
|
59
|
+
mt.style = 'height: 50px; background-color: ' + v + ';';
|
|
60
|
+
// return v;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
this.lookup('palletGrid').reconfigure(cols);
|
|
65
|
+
this.getViewModel().getStore('ColorPalettetore').loadData(pallet);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
getColorsMatrix(opacity) {
|
|
69
|
+
this.hasMatch = false;
|
|
70
|
+
const initValue = this.getView().getValue();
|
|
71
|
+
const styles = getComputedStyle(document.documentElement);
|
|
72
|
+
let i = 0;
|
|
73
|
+
let j = 0;
|
|
74
|
+
let propVal = null;
|
|
75
|
+
let tmp = [];
|
|
76
|
+
const matrix = [];
|
|
77
|
+
let hasMatch = false;
|
|
78
|
+
do {
|
|
79
|
+
i++;
|
|
80
|
+
j = 0;
|
|
81
|
+
tmp = {};
|
|
82
|
+
if (opacity === true) {
|
|
83
|
+
do {
|
|
84
|
+
j++;
|
|
85
|
+
propVal = styles.getPropertyValue('--ColorPalette-pallet-' + i + '-color-' + j);
|
|
86
|
+
if (propVal) {
|
|
87
|
+
if (initValue && initValue === propVal) {
|
|
88
|
+
hasMatch = [j-1, i-1];
|
|
89
|
+
}
|
|
90
|
+
tmp['data' + j] = propVal;
|
|
91
|
+
}
|
|
92
|
+
} while (propVal !== '');
|
|
93
|
+
if (Object.keys(tmp).length) {
|
|
94
|
+
matrix.push(tmp);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
propVal = styles.getPropertyValue('--ColorPalette-pallet-' + i + '-color-1');
|
|
98
|
+
if (propVal) {
|
|
99
|
+
const mRecs = {
|
|
100
|
+
data1: propVal,
|
|
101
|
+
data2: propVal.replace('1)', '0.8)'),
|
|
102
|
+
data3: propVal.replace('1)', '0.5)'),
|
|
103
|
+
data4: propVal.replace('1)', '0.4)'),
|
|
104
|
+
data5: propVal.replace('1)', '0.3)'),
|
|
105
|
+
data6: propVal.replace('1)', '0.2)'),
|
|
106
|
+
data7: propVal.replace('1)', '0.1)'),
|
|
107
|
+
};
|
|
108
|
+
if (initValue) {
|
|
109
|
+
const colorArr = this.getColorsAndNormalizeFormat(initValue);
|
|
110
|
+
const tmpColor = 'rgba(' + colorArr.join(',') + ')';
|
|
111
|
+
Object.keys(mRecs).forEach((key, index) => {
|
|
112
|
+
if (mRecs[key] === tmpColor) {
|
|
113
|
+
hasMatch = [index, i-1];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
matrix.push(mRecs);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (styles.getPropertyValue('--ColorPalette-pallet-' + (i + 1) + '-color-1') !== '') {
|
|
122
|
+
propVal = 'check next';
|
|
123
|
+
}
|
|
124
|
+
} while (propVal !== '');
|
|
125
|
+
this.hasMatch = hasMatch;
|
|
126
|
+
return matrix;
|
|
127
|
+
},
|
|
128
|
+
choose() {
|
|
129
|
+
const color = [];
|
|
130
|
+
const vm = this.getViewModel();
|
|
131
|
+
if (vm.get('gradient')) {
|
|
132
|
+
const data = vm.get('selected').getData();
|
|
133
|
+
Object.keys(data).map((key) => {
|
|
134
|
+
if (key.search(/data/gi) >= 0) {
|
|
135
|
+
color.push(data[key]);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
} else {
|
|
139
|
+
const pos = this.lookup('palletGrid').getSelectionModel().getCurrentPosition();
|
|
140
|
+
const dataIndex = pos.columnHeader.dataIndex;
|
|
141
|
+
color.push(vm.get('selected').get(dataIndex));
|
|
142
|
+
}
|
|
143
|
+
this.fireViewEvent('colorChoose', color);
|
|
144
|
+
},
|
|
145
|
+
onSelectionChange() {
|
|
146
|
+
const vm = this.getViewModel();
|
|
147
|
+
const recs = this.lookup('palletGrid').getSelectionModel().getSelection();
|
|
148
|
+
if (!recs.length) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
let color = null;
|
|
152
|
+
if (vm.get('gradient')) {
|
|
153
|
+
color = recs[0].get('data1');
|
|
154
|
+
} else {
|
|
155
|
+
const pos = this.lookup('palletGrid').getSelectionModel().getCurrentPosition();
|
|
156
|
+
const dataIndex = pos.columnHeader.dataIndex;
|
|
157
|
+
color = recs[0].get(dataIndex);
|
|
158
|
+
}
|
|
159
|
+
this.lookup('selectedButton').setStyle({
|
|
160
|
+
backgroundColor: color,
|
|
161
|
+
});
|
|
162
|
+
this.lookup('displayColor').setValue(color);
|
|
163
|
+
},
|
|
164
|
+
chooseCustom() {
|
|
165
|
+
this.fireViewEvent('colorChoose', [this.getViewModel().get('selectorColor')]);
|
|
166
|
+
},
|
|
167
|
+
onSelectorChange(cmp, color) {
|
|
168
|
+
const colorArr = this.getColorsAndNormalizeFormat(color);
|
|
169
|
+
color = 'rgba(' + colorArr.join(',') + ')';
|
|
170
|
+
this.getViewModel().set('selectorColor', color);
|
|
171
|
+
if (this.lookup('selectedCustomButton')) {
|
|
172
|
+
this.lookup('selectedCustomButton').setStyle({
|
|
173
|
+
backgroundColor: color,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
onRenderDisplayColor(cmp) {
|
|
178
|
+
cmp.setStyle({
|
|
179
|
+
backgroundColor: this.getViewModel().get('selectorColor'),
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
onTabChange(cmp, tab) {
|
|
183
|
+
if (tab.referenceKey === 'customColorTab' && this.getViewModel().get('selected')) {
|
|
184
|
+
this.lookup('customColorTab').down('colorselector').setValue(
|
|
185
|
+
this.getViewModel().get('selected').get('data1')
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
});
|
|
@@ -16,7 +16,8 @@ Ext.define('Coon.common.field.withDefault', {
|
|
|
16
16
|
{
|
|
17
17
|
xtype: 'button',
|
|
18
18
|
itemId: 'clear',
|
|
19
|
-
|
|
19
|
+
cls: 'svg-icon svg-icon-cancel-small',
|
|
20
|
+
scale: 'small',
|
|
20
21
|
tooltip: 'вернуть значение по умолчанию',
|
|
21
22
|
}
|
|
22
23
|
];
|
|
@@ -29,7 +30,7 @@ Ext.define('Coon.common.field.withDefault', {
|
|
|
29
30
|
if (field) {
|
|
30
31
|
this.down('button#clear').on('click', () => {
|
|
31
32
|
if (typeof field.setValue) {
|
|
32
|
-
this.defaultValue !== undefined ? field.setValue() : field.reset();
|
|
33
|
+
this.defaultValue !== undefined ? field.setValue(this.defaultValue) : field.reset();
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
}
|
|
@@ -140,11 +140,13 @@ Ext.define('Coon.report.plugin.configPanel.GridEditorPluginConfig', {
|
|
|
140
140
|
xtype: 'fieldset',
|
|
141
141
|
title: 'Конфиг',
|
|
142
142
|
height: 200,
|
|
143
|
+
flex: 1,
|
|
144
|
+
layout: 'fit',
|
|
145
|
+
scrollable: true,
|
|
143
146
|
items: [
|
|
144
147
|
{
|
|
145
148
|
xtype: 'UiAceEditor',
|
|
146
149
|
useLinter: true,
|
|
147
|
-
scrollable: 'y',
|
|
148
150
|
name: ns.$mask,
|
|
149
151
|
value: {},
|
|
150
152
|
}
|