neo.mjs 4.7.3 → 4.7.5
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/examples/form/field/select/MainContainer.mjs +6 -0
- package/package.json +1 -1
- package/resources/scss/src/button/Split.scss +3 -3
- package/resources/scss/src/form/field/Picker.scss +8 -0
- package/resources/scss/theme-dark/form/field/CheckBox.scss +1 -1
- package/src/button/Split.mjs +7 -5
- package/src/form/field/Picker.mjs +18 -0
- package/src/main/DomEvents.mjs +8 -1
- package/src/main/addon/GoogleMaps.mjs +23 -0
@@ -32,6 +32,12 @@ class MainContainer extends ConfigurationViewport {
|
|
32
32
|
labelText: 'clearToOriginalValue',
|
33
33
|
listeners: {change: me.onConfigChange.bind(me, 'clearToOriginalValue')},
|
34
34
|
style : {marginTop: '10px'}
|
35
|
+
}, {
|
36
|
+
module : CheckBox,
|
37
|
+
checked : me.exampleComponent.editable,
|
38
|
+
labelText: 'editable',
|
39
|
+
listeners: {change: me.onConfigChange.bind(me, 'editable')},
|
40
|
+
style : {marginTop: '10px'}
|
35
41
|
}, {
|
36
42
|
module : CheckBox,
|
37
43
|
checked : me.exampleComponent.hideLabel,
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
.neo-split-button {
|
2
|
-
border : v(button-border);
|
2
|
+
border : v(button-border-width) solid v(button-border-color);
|
3
3
|
border-radius: v(button-border-radius);
|
4
4
|
display : flex;
|
5
5
|
width : fit-content;
|
@@ -10,7 +10,7 @@
|
|
10
10
|
padding: .5em;
|
11
11
|
|
12
12
|
&:last-child {
|
13
|
-
border-left: v(button-border);
|
13
|
+
border-left: v(button-border-width) solid v(button-border-color);
|
14
14
|
}
|
15
15
|
}
|
16
|
-
}
|
16
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
$neoMap: map-merge($neoMap, (
|
2
2
|
'checkboxfield-color' : #eee,
|
3
3
|
'checkboxfield-color-checked' : #64B5F6,
|
4
|
-
'checkboxfield-icon-font-family': "Font Awesome 5 Free",
|
4
|
+
'checkboxfield-icon-font-family': '"Font Awesome 5 Free"',
|
5
5
|
'checkboxfield-icon-font-size' : 14px,
|
6
6
|
'checkboxfield-label-top-margin': 0 0 3px
|
7
7
|
));
|
package/src/button/Split.mjs
CHANGED
@@ -43,7 +43,11 @@ class Split extends Button {
|
|
43
43
|
{cls: ['neo-split-button'], cn: [
|
44
44
|
{tag: 'button', cn: [
|
45
45
|
{tag: 'span', cls: ['neo-button-glyph']},
|
46
|
-
{tag: 'span', cls: ['neo-button-text']}
|
46
|
+
{tag: 'span', cls: ['neo-button-text']},
|
47
|
+
{cls: ['neo-button-badge']},
|
48
|
+
{cls: ['neo-button-ripple-wrapper'], cn: [
|
49
|
+
{cls: ['neo-button-ripple']}
|
50
|
+
]}
|
47
51
|
]}
|
48
52
|
]}
|
49
53
|
}}
|
@@ -110,10 +114,8 @@ class Split extends Button {
|
|
110
114
|
* @protected
|
111
115
|
*/
|
112
116
|
afterSetTriggerButtonIconCls(value, oldValue) {
|
113
|
-
|
114
|
-
|
115
|
-
if (me.triggerButton) {
|
116
|
-
me.triggerButton.iconCls = value;
|
117
|
+
if (this.triggerButton) {
|
118
|
+
this.triggerButton.iconCls = value;
|
117
119
|
}
|
118
120
|
}
|
119
121
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Container from '../../container/Base.mjs';
|
2
|
+
import NeoArray from '../../util/Array.mjs';
|
2
3
|
import PickerTrigger from './trigger/Picker.mjs';
|
3
4
|
import Text from './Text.mjs';
|
4
5
|
import VDomUtil from '../../util/VDom.mjs';
|
@@ -32,6 +33,10 @@ class Picker extends Text {
|
|
32
33
|
* @protected
|
33
34
|
*/
|
34
35
|
clientRects: null,
|
36
|
+
/**
|
37
|
+
* @member {Boolean} editable_=true
|
38
|
+
*/
|
39
|
+
editable_: true,
|
35
40
|
/**
|
36
41
|
* Additional used keys for the selection model
|
37
42
|
* @member {Object} keys
|
@@ -83,6 +88,19 @@ class Picker extends Text {
|
|
83
88
|
}]
|
84
89
|
}}
|
85
90
|
|
91
|
+
/**
|
92
|
+
* Triggered after the editable config got changed
|
93
|
+
* @param {Boolean} value
|
94
|
+
* @param {Boolean} oldValue
|
95
|
+
* @protected
|
96
|
+
*/
|
97
|
+
afterSetEditable(value, oldValue) {
|
98
|
+
let cls = this.cls;
|
99
|
+
|
100
|
+
NeoArray.toggle(cls, 'neo-not-editable', !value);
|
101
|
+
this.cls = cls;
|
102
|
+
}
|
103
|
+
|
86
104
|
/**
|
87
105
|
* @param {Boolean} silent
|
88
106
|
*/
|
package/src/main/DomEvents.mjs
CHANGED
@@ -251,8 +251,15 @@ class DomEvents extends Base {
|
|
251
251
|
* @returns {Object}
|
252
252
|
*/
|
253
253
|
getEventData(event) {
|
254
|
+
let path = event.composedPath();
|
255
|
+
|
256
|
+
if (path.length < 1) {
|
257
|
+
// our draggable implementation will generate paths, so we do need to check for them
|
258
|
+
path = event.path;
|
259
|
+
}
|
260
|
+
|
254
261
|
return {
|
255
|
-
path :
|
262
|
+
path : path.map(e => this.getTargetData(e)),
|
256
263
|
target : this.getTargetData(event.target),
|
257
264
|
timeStamp: event.timeStamp,
|
258
265
|
type : event.type
|
@@ -9,6 +9,10 @@ import Observable from '../../core/Observable.mjs';
|
|
9
9
|
* @singleton
|
10
10
|
*/
|
11
11
|
class GoogleMaps extends Base {
|
12
|
+
/**
|
13
|
+
* @member {google.maps.Geocoder|null} maps=null
|
14
|
+
*/
|
15
|
+
geoCoder = null
|
12
16
|
/**
|
13
17
|
* @member {Object} maps={}
|
14
18
|
*/
|
@@ -36,6 +40,7 @@ class GoogleMaps extends Base {
|
|
36
40
|
app: [
|
37
41
|
'addMarker',
|
38
42
|
'create',
|
43
|
+
'geocode',
|
39
44
|
'hideMarker',
|
40
45
|
'panTo',
|
41
46
|
'removeMap',
|
@@ -125,6 +130,24 @@ class GoogleMaps extends Base {
|
|
125
130
|
me.fire('mapCreated', id);
|
126
131
|
}
|
127
132
|
|
133
|
+
/**
|
134
|
+
* Use either address, location or placeId
|
135
|
+
* @param {Object} data
|
136
|
+
* @param {String} data.address
|
137
|
+
* @param {Object} data.location
|
138
|
+
* @param {String} data.placeId
|
139
|
+
* @returns {Object}
|
140
|
+
*/
|
141
|
+
async geocode(data) {
|
142
|
+
let me = this;
|
143
|
+
|
144
|
+
if (!me.geoCoder) {
|
145
|
+
me.geoCoder = new google.maps.Geocoder();
|
146
|
+
}
|
147
|
+
|
148
|
+
return await me.geoCoder.geocode(data);
|
149
|
+
}
|
150
|
+
|
128
151
|
/**
|
129
152
|
* @param {Object} data
|
130
153
|
* @param {String} data.id
|