neo.mjs 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODING_GUIDELINES.md +436 -0
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/website/data/blog.json +13 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +3 -3
- package/resources/scss/src/apps/website/HeaderContainer.scss +5 -4
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +25 -27
- package/src/button/Base.mjs +21 -26
- package/src/calendar/view/week/Component.mjs +1 -2
- package/src/collection/Base.mjs +1 -1
- package/src/component/wrapper/GoogleMaps.mjs +35 -35
- package/src/core/Base.mjs +66 -0
- package/src/data/connection/Fetch.mjs +5 -5
- package/src/data/connection/WebSocket.mjs +25 -24
- package/src/dialog/header/Toolbar.mjs +12 -12
- package/src/form/field/Search.mjs +1 -1
- package/src/form/field/Select.mjs +10 -10
- package/src/form/field/Text.mjs +25 -24
- package/src/form/field/trigger/Date.mjs +3 -3
- package/src/form/field/trigger/Search.mjs +28 -0
- package/src/grid/Container.mjs +20 -20
- package/src/grid/header/Button.mjs +10 -10
- package/src/list/Color.mjs +7 -7
- package/src/main/addon/CesiumJS.mjs +6 -6
- package/src/main/addon/GoogleMaps.mjs +13 -13
- package/src/manager/Component.mjs +5 -5
- package/src/manager/Task.mjs +2 -2
- package/src/manager/Toast.mjs +13 -13
- package/src/manager/rpc/Message.mjs +20 -20
- package/src/vdom/Helper.mjs +24 -24
- package/src/worker/App.mjs +18 -18
- package/src/worker/Base.mjs +17 -17
- package/src/worker/Data.mjs +11 -11
- package/src/worker/Manager.mjs +9 -9
- package/src/worker/ServiceBase.mjs +25 -25
package/src/button/Base.mjs
CHANGED
@@ -6,19 +6,6 @@ import NeoArray from '../util/Array.mjs';
|
|
6
6
|
* @extends Neo.component.Base
|
7
7
|
*/
|
8
8
|
class Base extends Component {
|
9
|
-
/**
|
10
|
-
* Time in ms for the ripple effect when clicking on the button.
|
11
|
-
* Only active if useRippleEffect is set to true.
|
12
|
-
* @member {Number} rippleEffectDuration=400
|
13
|
-
*/
|
14
|
-
rippleEffectDuration = 400
|
15
|
-
/**
|
16
|
-
* Internal flag to store the last setTimeout() id for ripple effect remove node callbacks
|
17
|
-
* @member {Number} #rippleTimeoutId=null
|
18
|
-
* @private
|
19
|
-
*/
|
20
|
-
#rippleTimeoutId = null
|
21
|
-
|
22
9
|
/**
|
23
10
|
* Valid values for badgePosition
|
24
11
|
* @member {String[]} badgePositions=['bottom-left','bottom-right','top-left','top-right']
|
@@ -135,6 +122,19 @@ class Base extends Component {
|
|
135
122
|
]}
|
136
123
|
}
|
137
124
|
|
125
|
+
/**
|
126
|
+
* Time in ms for the ripple effect when clicking on the button.
|
127
|
+
* Only active if useRippleEffect is set to true.
|
128
|
+
* @member {Number} rippleEffectDuration=400
|
129
|
+
*/
|
130
|
+
rippleEffectDuration = 400
|
131
|
+
/**
|
132
|
+
* Internal flag to store the last setTimeout() id for ripple effect remove node callbacks
|
133
|
+
* @member {Number} #rippleTimeoutId=null
|
134
|
+
* @private
|
135
|
+
*/
|
136
|
+
#rippleTimeoutId = null
|
137
|
+
|
138
138
|
/**
|
139
139
|
* Triggered after the badgePosition config got changed
|
140
140
|
* @param {String} value
|
@@ -161,13 +161,12 @@ class Base extends Component {
|
|
161
161
|
* @protected
|
162
162
|
*/
|
163
163
|
afterSetBadgeText(value, oldValue) {
|
164
|
-
let
|
165
|
-
badgeNode = me.getBadgeNode();
|
164
|
+
let badgeNode = this.getBadgeNode();
|
166
165
|
|
167
166
|
badgeNode.html = value;
|
168
167
|
badgeNode.removeDom = !Boolean(value);
|
169
168
|
|
170
|
-
|
169
|
+
this.update();
|
171
170
|
}
|
172
171
|
|
173
172
|
/**
|
@@ -192,15 +191,13 @@ class Base extends Component {
|
|
192
191
|
* @protected
|
193
192
|
*/
|
194
193
|
afterSetIconCls(value, oldValue) {
|
195
|
-
let
|
196
|
-
iconNode = me.getIconNode();
|
194
|
+
let iconNode = this.getIconNode();
|
197
195
|
|
198
196
|
NeoArray.remove(iconNode.cls, oldValue);
|
199
197
|
NeoArray.add( iconNode.cls, value);
|
200
198
|
|
201
199
|
iconNode.removeDom = !value || value === '';
|
202
|
-
|
203
|
-
me.update();
|
200
|
+
this.update();
|
204
201
|
}
|
205
202
|
|
206
203
|
/**
|
@@ -210,8 +207,7 @@ class Base extends Component {
|
|
210
207
|
* @protected
|
211
208
|
*/
|
212
209
|
afterSetIconColor(value, oldValue) {
|
213
|
-
let
|
214
|
-
iconNode = me.getIconNode();
|
210
|
+
let iconNode = this.getIconNode();
|
215
211
|
|
216
212
|
if (!iconNode.style) {
|
217
213
|
iconNode.style = {};
|
@@ -222,7 +218,7 @@ class Base extends Component {
|
|
222
218
|
}
|
223
219
|
|
224
220
|
iconNode.style.color = value;
|
225
|
-
|
221
|
+
this.update();
|
226
222
|
}
|
227
223
|
|
228
224
|
/**
|
@@ -300,8 +296,7 @@ class Base extends Component {
|
|
300
296
|
* @protected
|
301
297
|
*/
|
302
298
|
afterSetUrl(value, oldValue) {
|
303
|
-
let
|
304
|
-
vdomRoot = me.getVdomRoot();
|
299
|
+
let vdomRoot = this.getVdomRoot();
|
305
300
|
|
306
301
|
if (value) {
|
307
302
|
vdomRoot.href = value;
|
@@ -311,7 +306,7 @@ class Base extends Component {
|
|
311
306
|
vdomRoot.tag = 'button';
|
312
307
|
}
|
313
308
|
|
314
|
-
|
309
|
+
this.update();
|
315
310
|
}
|
316
311
|
|
317
312
|
/**
|
@@ -260,7 +260,6 @@ class Component extends BaseComponent {
|
|
260
260
|
rowHeight = data.rowHeight,
|
261
261
|
rowsPerItem = data.rowsPerItem,
|
262
262
|
height = data.totalHeight - rowHeight,
|
263
|
-
vdom = me.vdom,
|
264
263
|
i = 0,
|
265
264
|
gradient = [];
|
266
265
|
|
@@ -279,7 +278,7 @@ class Component extends BaseComponent {
|
|
279
278
|
maxHeight : `${height}px`
|
280
279
|
});
|
281
280
|
|
282
|
-
|
281
|
+
!silent && me.update();
|
283
282
|
}
|
284
283
|
|
285
284
|
/**
|
package/src/collection/Base.mjs
CHANGED
@@ -7,41 +7,6 @@ import Store from '../../data/Store.mjs';
|
|
7
7
|
* @extends Neo.component.Base
|
8
8
|
*/
|
9
9
|
class GoogleMaps extends Base {
|
10
|
-
/**
|
11
|
-
* false hides the default fullscreen control
|
12
|
-
* @member {Boolean} fullscreenControl=true
|
13
|
-
*/
|
14
|
-
fullscreenControl = true
|
15
|
-
/**
|
16
|
-
* @member {Object} markerStoreConfig=null
|
17
|
-
*/
|
18
|
-
markerStoreConfig = null
|
19
|
-
/**
|
20
|
-
* Internal flag. Gets set to true once Neo.main.addon.GoogleMaps.create() is finished.
|
21
|
-
* @member {Boolean} mapCreated=false
|
22
|
-
*/
|
23
|
-
mapCreated = false
|
24
|
-
/**
|
25
|
-
* Pass any options to the map instance which are not explicitly defined here
|
26
|
-
* @member {Object} mapOptions={}
|
27
|
-
*/
|
28
|
-
mapOptions = {}
|
29
|
-
/**
|
30
|
-
* null => the maximum zoom from the current map type is used instead
|
31
|
-
* @member {Number|null} maxZoom=null
|
32
|
-
*/
|
33
|
-
maxZoom = null
|
34
|
-
/**
|
35
|
-
null => the minimum zoom from the current map type is used instead
|
36
|
-
* @member {Number|null} minZoom=null
|
37
|
-
*/
|
38
|
-
minZoom = null
|
39
|
-
/**
|
40
|
-
* false hides the default zoom control
|
41
|
-
* @member {Boolean} zoomControl=true
|
42
|
-
*/
|
43
|
-
zoomControl = true
|
44
|
-
|
45
10
|
static config = {
|
46
11
|
/**
|
47
12
|
* @member {String} className='Neo.component.wrapper.GoogleMaps'
|
@@ -86,6 +51,41 @@ class GoogleMaps extends Base {
|
|
86
51
|
zoom_: 8
|
87
52
|
}
|
88
53
|
|
54
|
+
/**
|
55
|
+
* false hides the default fullscreen control
|
56
|
+
* @member {Boolean} fullscreenControl=true
|
57
|
+
*/
|
58
|
+
fullscreenControl = true
|
59
|
+
/**
|
60
|
+
* @member {Object} markerStoreConfig=null
|
61
|
+
*/
|
62
|
+
markerStoreConfig = null
|
63
|
+
/**
|
64
|
+
* Internal flag. Gets set to true once Neo.main.addon.GoogleMaps.create() is finished.
|
65
|
+
* @member {Boolean} mapCreated=false
|
66
|
+
*/
|
67
|
+
mapCreated = false
|
68
|
+
/**
|
69
|
+
* Pass any options to the map instance which are not explicitly defined here
|
70
|
+
* @member {Object} mapOptions={}
|
71
|
+
*/
|
72
|
+
mapOptions = {}
|
73
|
+
/**
|
74
|
+
* null => the maximum zoom from the current map type is used instead
|
75
|
+
* @member {Number|null} maxZoom=null
|
76
|
+
*/
|
77
|
+
maxZoom = null
|
78
|
+
/**
|
79
|
+
null => the minimum zoom from the current map type is used instead
|
80
|
+
* @member {Number|null} minZoom=null
|
81
|
+
*/
|
82
|
+
minZoom = null
|
83
|
+
/**
|
84
|
+
* false hides the default zoom control
|
85
|
+
* @member {Boolean} zoomControl=true
|
86
|
+
*/
|
87
|
+
zoomControl = true
|
88
|
+
|
89
89
|
/**
|
90
90
|
* @param {Object} config
|
91
91
|
*/
|
package/src/core/Base.mjs
CHANGED
@@ -10,12 +10,24 @@ const configSymbol = Symbol.for('configSymbol'),
|
|
10
10
|
* @class Neo.core.Base
|
11
11
|
*/
|
12
12
|
class Base {
|
13
|
+
/**
|
14
|
+
* Regex to grab the MethodName from an error
|
15
|
+
* which is a second generation function
|
16
|
+
* @type {*}
|
17
|
+
*/
|
18
|
+
static methodNameRegex = /\n.*\n\s+at\s+.*\.(\w+)\s+.*/
|
13
19
|
/**
|
14
20
|
* True automatically applies the core.Observable mixin
|
15
21
|
* @member {Boolean} observable=false
|
16
22
|
* @static
|
17
23
|
*/
|
18
24
|
static observable = false
|
25
|
+
/**
|
26
|
+
* Keep the overriden methods
|
27
|
+
* @type {Object}
|
28
|
+
*/
|
29
|
+
static overriddenMethods = {}
|
30
|
+
|
19
31
|
/**
|
20
32
|
* Set this one to false in case you don't want to stick
|
21
33
|
* to the "anti-pattern" to apply classes to the global Neo or App namespace
|
@@ -137,6 +149,33 @@ class Base {
|
|
137
149
|
}
|
138
150
|
}
|
139
151
|
|
152
|
+
/**
|
153
|
+
* Applying overrides and adding overriddenMethods to the class constructors
|
154
|
+
* @param {Object} cfg
|
155
|
+
* @protected
|
156
|
+
*/
|
157
|
+
static applyOverrides(cfg) {
|
158
|
+
let overrides = Neo.ns(cfg.className, false, Neo.overrides),
|
159
|
+
cls, item;
|
160
|
+
|
161
|
+
if (overrides) {
|
162
|
+
// Apply all methods
|
163
|
+
for (item in overrides) {
|
164
|
+
if (Neo.isFunction(overrides[item])) {
|
165
|
+
// Already existing ones
|
166
|
+
cls = this.prototype;
|
167
|
+
|
168
|
+
if (cls[item]) {
|
169
|
+
// add to overriddenMethods
|
170
|
+
cls.constructor.overriddenMethods[item] = cls[item];
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
// Apply configs to prototype
|
175
|
+
overrides && Object.assign(cfg, overrides);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
140
179
|
/**
|
141
180
|
* Convenience method for beforeSet functions which test if a given value is inside a static array
|
142
181
|
* @param {String|Number} value
|
@@ -156,6 +195,33 @@ class Base {
|
|
156
195
|
return value;
|
157
196
|
}
|
158
197
|
|
198
|
+
/**
|
199
|
+
* From within an override, a method can call a parent method, by using callOVerridden.
|
200
|
+
*
|
201
|
+
* @example
|
202
|
+
* afterSetHeight(value, oldValue) {
|
203
|
+
* // do the standard
|
204
|
+
* this.callOverridden(...arguments);
|
205
|
+
* // do you own stuff
|
206
|
+
* }
|
207
|
+
*
|
208
|
+
* We create an error to get the caller.name and then run that method on the constructor.
|
209
|
+
* This is based on the following error structure, e.g. afterSetHeight.
|
210
|
+
*
|
211
|
+
* Error
|
212
|
+
* at Base.callOverridden (Base.mjs:176:21)
|
213
|
+
* at Base.afterSetHeight (Overrides.mjs:19:26)
|
214
|
+
*
|
215
|
+
* @param args
|
216
|
+
*/
|
217
|
+
callOverridden(...args) {
|
218
|
+
let stack = new Error().stack,
|
219
|
+
regex = Base.methodNameRegex,
|
220
|
+
methodName = stack.match(regex)[1];
|
221
|
+
|
222
|
+
this.__proto__.constructor.overriddenMethods[methodName].call(this, ...args);
|
223
|
+
}
|
224
|
+
|
159
225
|
/**
|
160
226
|
* Uses the IdGenerator to create an id if a static one is not explicitly set.
|
161
227
|
* Registers the instance to manager.Instance if this one is already created,
|
@@ -5,11 +5,6 @@ import Base from '../../core/Base.mjs';
|
|
5
5
|
* @extends Neo.core.Base
|
6
6
|
*/
|
7
7
|
class Fetch extends Base {
|
8
|
-
/**
|
9
|
-
* @member {Object} defaultHeaders=null
|
10
|
-
*/
|
11
|
-
defaultHeaders = null
|
12
|
-
|
13
8
|
static config = {
|
14
9
|
/**
|
15
10
|
* @member {String} className='Neo.data.connection.Fetch'
|
@@ -18,6 +13,11 @@ class Fetch extends Base {
|
|
18
13
|
className: 'Neo.data.connection.Fetch'
|
19
14
|
}
|
20
15
|
|
16
|
+
/**
|
17
|
+
* @member {Object} defaultHeaders=null
|
18
|
+
*/
|
19
|
+
defaultHeaders = null
|
20
|
+
|
21
21
|
/**
|
22
22
|
* @param {Object|String} url
|
23
23
|
* @param {Object} config
|
@@ -7,6 +7,31 @@ import Observable from '../../core/Observable.mjs';
|
|
7
7
|
* @extends Neo.core.Base
|
8
8
|
*/
|
9
9
|
class Socket extends Base {
|
10
|
+
/**
|
11
|
+
* True automatically applies the core.Observable mixin
|
12
|
+
* @member {Boolean} observable=true
|
13
|
+
* @static
|
14
|
+
*/
|
15
|
+
static observable = true
|
16
|
+
|
17
|
+
static config = {
|
18
|
+
/**
|
19
|
+
* @member {String} className='Neo.data.connection.WebSocket'
|
20
|
+
* @protected
|
21
|
+
*/
|
22
|
+
className: 'Neo.data.connection.WebSocket',
|
23
|
+
/**
|
24
|
+
* @member {String} ntype='socket-connection'
|
25
|
+
* @protected
|
26
|
+
*/
|
27
|
+
ntype: 'socket-connection',
|
28
|
+
/**
|
29
|
+
* @member {WebSocket|null} socket_=null
|
30
|
+
* @protected
|
31
|
+
*/
|
32
|
+
socket_: null
|
33
|
+
}
|
34
|
+
|
10
35
|
/**
|
11
36
|
* @member {String|null} channel=null
|
12
37
|
*/
|
@@ -34,30 +59,6 @@ class Socket extends Base {
|
|
34
59
|
* @member {String|null} serverAddress=null
|
35
60
|
*/
|
36
61
|
serverAddress = null
|
37
|
-
/**
|
38
|
-
* True automatically applies the core.Observable mixin
|
39
|
-
* @member {Boolean} observable=true
|
40
|
-
* @static
|
41
|
-
*/
|
42
|
-
static observable = true
|
43
|
-
|
44
|
-
static config = {
|
45
|
-
/**
|
46
|
-
* @member {String} className='Neo.data.connection.WebSocket'
|
47
|
-
* @protected
|
48
|
-
*/
|
49
|
-
className: 'Neo.data.connection.WebSocket',
|
50
|
-
/**
|
51
|
-
* @member {String} ntype='socket-connection'
|
52
|
-
* @protected
|
53
|
-
*/
|
54
|
-
ntype: 'socket-connection',
|
55
|
-
/**
|
56
|
-
* @member {WebSocket|null} socket_=null
|
57
|
-
* @protected
|
58
|
-
*/
|
59
|
-
socket_: null
|
60
|
-
}
|
61
62
|
|
62
63
|
/**
|
63
64
|
* @param {Object} config
|
@@ -5,6 +5,18 @@ import Base from '../../toolbar/Base.mjs';
|
|
5
5
|
* @extends Neo.toolbar.Base
|
6
6
|
*/
|
7
7
|
class Toolbar extends Base {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.dialog.header.Toolbar'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.dialog.header.Toolbar',
|
14
|
+
/**
|
15
|
+
* @member {String|null} title=null
|
16
|
+
*/
|
17
|
+
title_: null
|
18
|
+
}
|
19
|
+
|
8
20
|
/**
|
9
21
|
* @member {Object} actionMap
|
10
22
|
*/
|
@@ -28,18 +40,6 @@ class Toolbar extends Base {
|
|
28
40
|
*/
|
29
41
|
actions = ['maximize', 'close']
|
30
42
|
|
31
|
-
static config = {
|
32
|
-
/**
|
33
|
-
* @member {String} className='Neo.dialog.header.Toolbar'
|
34
|
-
* @protected
|
35
|
-
*/
|
36
|
-
className: 'Neo.dialog.header.Toolbar',
|
37
|
-
/**
|
38
|
-
* @member {String|null} title=null
|
39
|
-
*/
|
40
|
-
title_: null
|
41
|
-
}
|
42
|
-
|
43
43
|
/**
|
44
44
|
* Triggered after the title config got changed
|
45
45
|
* @param {String} value
|
@@ -10,16 +10,6 @@ import VDomUtil from '../../util/VDom.mjs';
|
|
10
10
|
* @extends Neo.form.field.Picker
|
11
11
|
*/
|
12
12
|
class Select extends Picker {
|
13
|
-
/**
|
14
|
-
* @member {String} filterOperator='like'
|
15
|
-
*/
|
16
|
-
filterOperator = 'like'
|
17
|
-
/**
|
18
|
-
* Set this config to false, in case typing into the input field should not filter list items
|
19
|
-
* @member {Boolean} useFilter=true
|
20
|
-
*/
|
21
|
-
useFilter = true
|
22
|
-
|
23
13
|
/**
|
24
14
|
* Valid values for triggerAction
|
25
15
|
* @member {String[]} triggerActions=['all','filtered']
|
@@ -116,6 +106,16 @@ class Select extends Picker {
|
|
116
106
|
valueField: 'id'
|
117
107
|
}
|
118
108
|
|
109
|
+
/**
|
110
|
+
* @member {String} filterOperator='like'
|
111
|
+
*/
|
112
|
+
filterOperator = 'like'
|
113
|
+
/**
|
114
|
+
* Set this config to false, in case typing into the input field should not filter list items
|
115
|
+
* @member {Boolean} useFilter=true
|
116
|
+
*/
|
117
|
+
useFilter = true
|
118
|
+
|
119
119
|
/**
|
120
120
|
* @param {Object} config
|
121
121
|
*/
|
package/src/form/field/Text.mjs
CHANGED
@@ -10,26 +10,6 @@ import VNodeUtil from '../../util/VNode.mjs';
|
|
10
10
|
* @extends Neo.form.field.Base
|
11
11
|
*/
|
12
12
|
class Text extends Base {
|
13
|
-
/**
|
14
|
-
* data passes maxLength, minLength & valueLength properties
|
15
|
-
* @member {Function} errorTextMaxLength=data=>`Max length violation: ${valueLength} / ${maxLength}`
|
16
|
-
*/
|
17
|
-
errorTextMaxLength = data => `Max length violation: ${data.valueLength} / ${data.maxLength}`
|
18
|
-
/**
|
19
|
-
* data passes maxLength, minLength & valueLength properties
|
20
|
-
* @member {Function} errorTextMinLength=data=>`Min length violation: ${data.valueLength} / ${data.minLength}`
|
21
|
-
*/
|
22
|
-
errorTextMinLength = data => `Min length violation: ${data.valueLength} / ${data.minLength}`
|
23
|
-
/**
|
24
|
-
* @member {String} errorTextRequired='Required'
|
25
|
-
*/
|
26
|
-
errorTextRequired = 'Required'
|
27
|
-
/**
|
28
|
-
* Set this value to false, in case a field should display errors up front
|
29
|
-
* @member {Boolean} validBeforeMount=true
|
30
|
-
*/
|
31
|
-
validBeforeMount = true
|
32
|
-
|
33
13
|
/**
|
34
14
|
* Valid values for autoCapitalize
|
35
15
|
* @member {String[]} autoCapitalizeValues=['characters','none','on','off','sentences','words']
|
@@ -190,6 +170,26 @@ class Text extends Base {
|
|
190
170
|
]}
|
191
171
|
}
|
192
172
|
|
173
|
+
/**
|
174
|
+
* data passes maxLength, minLength & valueLength properties
|
175
|
+
* @member {Function} errorTextMaxLength=data=>`Max length violation: ${valueLength} / ${maxLength}`
|
176
|
+
*/
|
177
|
+
errorTextMaxLength = data => `Max length violation: ${data.valueLength} / ${data.maxLength}`
|
178
|
+
/**
|
179
|
+
* data passes maxLength, minLength & valueLength properties
|
180
|
+
* @member {Function} errorTextMinLength=data=>`Min length violation: ${data.valueLength} / ${data.minLength}`
|
181
|
+
*/
|
182
|
+
errorTextMinLength = data => `Min length violation: ${data.valueLength} / ${data.minLength}`
|
183
|
+
/**
|
184
|
+
* @member {String} errorTextRequired='Required'
|
185
|
+
*/
|
186
|
+
errorTextRequired = 'Required'
|
187
|
+
/**
|
188
|
+
* Set this value to false, in case a field should display errors up front
|
189
|
+
* @member {Boolean} validBeforeMount=true
|
190
|
+
*/
|
191
|
+
validBeforeMount = true
|
192
|
+
|
193
193
|
/**
|
194
194
|
* @param {Object} config
|
195
195
|
*/
|
@@ -772,11 +772,12 @@ class Text extends Base {
|
|
772
772
|
*/
|
773
773
|
beforeSetLabelText(value, oldValue) {
|
774
774
|
let me = this,
|
775
|
-
labelOptionalText = me.labelOptionalText
|
775
|
+
labelOptionalText = me.labelOptionalText,
|
776
|
+
hasOptionalText = value.endsWith(labelOptionalText);
|
776
777
|
|
777
|
-
if (me.showOptionalText && !me.required) {
|
778
|
-
|
779
|
-
} else if (value &&
|
778
|
+
if (me.showOptionalText && !me.required && !hasOptionalText) {
|
779
|
+
value += labelOptionalText;
|
780
|
+
} else if (value && hasOptionalText) {
|
780
781
|
value = value.replace(labelOptionalText, '');
|
781
782
|
}
|
782
783
|
|
@@ -5,7 +5,7 @@ import Picker from './Picker.mjs';
|
|
5
5
|
* @class Neo.form.field.trigger.Date
|
6
6
|
* @extends Neo.form.field.trigger.Picker
|
7
7
|
*/
|
8
|
-
class
|
8
|
+
class DateTrigger extends Picker {
|
9
9
|
static config = {
|
10
10
|
/**
|
11
11
|
* @member {String} className='Neo.form.field.trigger.Date'
|
@@ -24,6 +24,6 @@ class Date extends Picker {
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
|
-
Neo.applyClassConfig(
|
27
|
+
Neo.applyClassConfig(DateTrigger);
|
28
28
|
|
29
|
-
export default
|
29
|
+
export default DateTrigger;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Picker from './Picker.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.form.field.trigger.Search
|
5
|
+
* @extends Neo.form.field.trigger.Picker
|
6
|
+
*/
|
7
|
+
class Search extends Picker {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.form.field.trigger.Search'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.form.field.trigger.Search',
|
14
|
+
/**
|
15
|
+
* @member {String} ntype='trigger-search'
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
ntype: 'trigger-search',
|
19
|
+
/**
|
20
|
+
* @member {String|null} iconCls='fas fa-magnifying-glass'
|
21
|
+
*/
|
22
|
+
iconCls: 'fas fa-magnifying-glass'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
Neo.applyClassConfig(Search);
|
27
|
+
|
28
|
+
export default Search;
|
package/src/grid/Container.mjs
CHANGED
@@ -10,26 +10,6 @@ import * as header from './header/_export.mjs';
|
|
10
10
|
* @extends Neo.container.Base
|
11
11
|
*/
|
12
12
|
class Container extends BaseContainer {
|
13
|
-
/**
|
14
|
-
* Configs for Neo.grid.header.Toolbar
|
15
|
-
* @member {Object|null} [headerToolbarConfig=null]
|
16
|
-
*/
|
17
|
-
headerToolbarConfig = null
|
18
|
-
/**
|
19
|
-
* @member {String|null} headerToolbarId_=null
|
20
|
-
*/
|
21
|
-
headerToolbarId = null
|
22
|
-
/**
|
23
|
-
* Configs for Neo.grid.View
|
24
|
-
* @member {Object|null} [viewConfig=null]
|
25
|
-
*/
|
26
|
-
viewConfig = null
|
27
|
-
/**
|
28
|
-
* @member {String|null} viewId_=null
|
29
|
-
* @protected
|
30
|
-
*/
|
31
|
-
viewId = null
|
32
|
-
|
33
13
|
static config = {
|
34
14
|
/**
|
35
15
|
* @member {String} className='Neo.grid.Container'
|
@@ -75,6 +55,26 @@ class Container extends BaseContainer {
|
|
75
55
|
]}
|
76
56
|
}
|
77
57
|
|
58
|
+
/**
|
59
|
+
* Configs for Neo.grid.header.Toolbar
|
60
|
+
* @member {Object|null} [headerToolbarConfig=null]
|
61
|
+
*/
|
62
|
+
headerToolbarConfig = null
|
63
|
+
/**
|
64
|
+
* @member {String|null} headerToolbarId_=null
|
65
|
+
*/
|
66
|
+
headerToolbarId = null
|
67
|
+
/**
|
68
|
+
* Configs for Neo.grid.View
|
69
|
+
* @member {Object|null} [viewConfig=null]
|
70
|
+
*/
|
71
|
+
viewConfig = null
|
72
|
+
/**
|
73
|
+
* @member {String|null} viewId_=null
|
74
|
+
* @protected
|
75
|
+
*/
|
76
|
+
viewId = null
|
77
|
+
|
78
78
|
/**
|
79
79
|
* @param {Object} config
|
80
80
|
*/
|
@@ -6,16 +6,6 @@ import NeoArray from '../../util/Array.mjs';
|
|
6
6
|
* @extends Neo.button.Base
|
7
7
|
*/
|
8
8
|
class Button extends BaseButton {
|
9
|
-
/**
|
10
|
-
* Sort direction when clicking on an unsorted button
|
11
|
-
* @member {String} defaultSortDirection='ASC'
|
12
|
-
*/
|
13
|
-
defaultSortDirection = 'ASC'
|
14
|
-
/**
|
15
|
-
* @member {String|null} field=null
|
16
|
-
*/
|
17
|
-
field = null
|
18
|
-
|
19
9
|
/**
|
20
10
|
* Valid values for align
|
21
11
|
* @member {String[]} alignValues: ['left', 'center', 'right']
|
@@ -60,6 +50,16 @@ class Button extends BaseButton {
|
|
60
50
|
isSorted_: null
|
61
51
|
}
|
62
52
|
|
53
|
+
/**
|
54
|
+
* Sort direction when clicking on an unsorted button
|
55
|
+
* @member {String} defaultSortDirection='ASC'
|
56
|
+
*/
|
57
|
+
defaultSortDirection = 'ASC'
|
58
|
+
/**
|
59
|
+
* @member {String|null} field=null
|
60
|
+
*/
|
61
|
+
field = null
|
62
|
+
|
63
63
|
/**
|
64
64
|
* @param {Object} config
|
65
65
|
*/
|