@nativescript/core 8.7.3-next-05-07-2024-8977885291 → 8.7.3-next-05-23-2024-9210745709

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.
@@ -91,37 +91,52 @@ export declare class Observable {
91
91
  */
92
92
  setProperty(name: string, value: any): void;
93
93
  /**
94
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
95
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
96
- * @param callback - Callback function which will be executed when event is raised.
97
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
94
+ * Adds a listener for the specified event name.
95
+ *
96
+ * @param eventName The name of the event.
97
+ * @param callback The event listener to add. Will be called when an event of
98
+ * the given name is raised.
99
+ * @param thisArg An optional parameter which, when set, will be bound as the
100
+ * `this` context when the callback is called. Falsy values will be not be
101
+ * bound.
98
102
  */
99
- on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
103
+ on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
100
104
  /**
101
- * Adds one-time listener function for the event named `event`.
102
- * @param event Name of the event to attach to.
103
- * @param callback A function to be called when the specified event is raised.
104
- * @param thisArg An optional parameter which when set will be used as "this" in callback method call.
105
+ * Adds a listener for the specified event name, which, once fired, will
106
+ * remove itself.
107
+ *
108
+ * @param eventName The name of the event.
109
+ * @param callback The event listener to add. Will be called when an event of
110
+ * the given name is raised.
111
+ * @param thisArg An optional parameter which, when set, will be bound as the
112
+ * `this` context when the callback is called. Falsy values will be not be
113
+ * bound.
105
114
  */
106
- once(event: string, callback: (data: EventData) => void, thisArg?: any): void;
115
+ once(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
107
116
  /**
108
- * Shortcut alias to the removeEventListener method.
117
+ * Removes the listener(s) for the specified event name.
118
+ *
119
+ * @param eventName The name of the event.
120
+ * @param callback An optional specific event listener to remove (if omitted,
121
+ * all event listeners by this name will be removed).
122
+ * @param thisArg An optional parameter which, when set, will be used to
123
+ * refine search of the correct event listener to be removed.
109
124
  */
110
- off(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void;
125
+ off(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void;
111
126
  /**
112
127
  * Adds a listener for the specified event name.
113
- * @param eventNames Comma delimited names of the events to attach the listener to.
128
+ * @param eventName Name of the event to attach to.
114
129
  * @param callback A function to be called when some of the specified event(s) is raised.
115
130
  * @param thisArg An optional parameter which when set will be used as "this" in callback method call.
116
131
  */
117
- addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean): void;
132
+ addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean): void;
118
133
  /**
119
134
  * Removes listener(s) for the specified event name.
120
- * @param eventNames Comma delimited names of the events the specified listener is associated with.
135
+ * @param eventName Name of the event to attach to.
121
136
  * @param callback An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.
122
137
  * @param thisArg An optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener.
123
138
  */
124
- removeEventListener(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void;
139
+ removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void;
125
140
  /**
126
141
  * Please avoid using the static event-handling APIs as they will be removed
127
142
  * in future.
@@ -146,13 +161,13 @@ export declare class Observable {
146
161
  * in future.
147
162
  * @deprecated
148
163
  */
149
- static removeEventListener(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void;
164
+ static removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void;
150
165
  /**
151
166
  * Please avoid using the static event-handling APIs as they will be removed
152
167
  * in future.
153
168
  * @deprecated
154
169
  */
155
- static addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean): void;
170
+ static addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean): void;
156
171
  private _globalNotify;
157
172
  /**
158
173
  * Notify this Observable instance with some data. This causes all event
@@ -178,7 +193,7 @@ export declare class Observable {
178
193
  * This method is intended to be overriden by inheritors to provide additional implementation.
179
194
  */
180
195
  _createPropertyChangeData(propertyName: string, value: any, oldValue?: any): PropertyChangeData;
181
- _emit(eventNames: string): void;
196
+ _emit(eventName: string): void;
182
197
  private _getEventList;
183
198
  private static _indexOfListener;
184
199
  }
@@ -35,7 +35,6 @@ export class WrappedValue {
35
35
  }
36
36
  const _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)];
37
37
  const _globalEventHandlers = {};
38
- const eventNamesRegex = /\s*,\s*/;
39
38
  /**
40
39
  * Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener.
41
40
  * Please note that should you be using the `new Observable({})` constructor, it is **obsolete** since v3.0,
@@ -82,81 +81,92 @@ export class Observable {
82
81
  }
83
82
  }
84
83
  /**
85
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
86
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
87
- * @param callback - Callback function which will be executed when event is raised.
88
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
84
+ * Adds a listener for the specified event name.
85
+ *
86
+ * @param eventName The name of the event.
87
+ * @param callback The event listener to add. Will be called when an event of
88
+ * the given name is raised.
89
+ * @param thisArg An optional parameter which, when set, will be bound as the
90
+ * `this` context when the callback is called. Falsy values will be not be
91
+ * bound.
89
92
  */
90
- on(eventNames, callback, thisArg) {
91
- this.addEventListener(eventNames, callback, thisArg);
93
+ on(eventName, callback, thisArg) {
94
+ this.addEventListener(eventName, callback, thisArg);
92
95
  }
93
96
  /**
94
- * Adds one-time listener function for the event named `event`.
95
- * @param event Name of the event to attach to.
96
- * @param callback A function to be called when the specified event is raised.
97
- * @param thisArg An optional parameter which when set will be used as "this" in callback method call.
97
+ * Adds a listener for the specified event name, which, once fired, will
98
+ * remove itself.
99
+ *
100
+ * @param eventName The name of the event.
101
+ * @param callback The event listener to add. Will be called when an event of
102
+ * the given name is raised.
103
+ * @param thisArg An optional parameter which, when set, will be bound as the
104
+ * `this` context when the callback is called. Falsy values will be not be
105
+ * bound.
98
106
  */
99
- once(event, callback, thisArg) {
100
- this.addEventListener(event, callback, thisArg, true);
107
+ once(eventName, callback, thisArg) {
108
+ this.addEventListener(eventName, callback, thisArg, true);
101
109
  }
102
110
  /**
103
- * Shortcut alias to the removeEventListener method.
111
+ * Removes the listener(s) for the specified event name.
112
+ *
113
+ * @param eventName The name of the event.
114
+ * @param callback An optional specific event listener to remove (if omitted,
115
+ * all event listeners by this name will be removed).
116
+ * @param thisArg An optional parameter which, when set, will be used to
117
+ * refine search of the correct event listener to be removed.
104
118
  */
105
- off(eventNames, callback, thisArg) {
106
- this.removeEventListener(eventNames, callback, thisArg);
119
+ off(eventName, callback, thisArg) {
120
+ this.removeEventListener(eventName, callback, thisArg);
107
121
  }
108
122
  /**
109
123
  * Adds a listener for the specified event name.
110
- * @param eventNames Comma delimited names of the events to attach the listener to.
124
+ * @param eventName Name of the event to attach to.
111
125
  * @param callback A function to be called when some of the specified event(s) is raised.
112
126
  * @param thisArg An optional parameter which when set will be used as "this" in callback method call.
113
127
  */
114
- addEventListener(eventNames, callback, thisArg, once) {
128
+ addEventListener(eventName, callback, thisArg, once) {
115
129
  once = once || undefined;
116
130
  thisArg = thisArg || undefined;
117
- if (typeof eventNames !== 'string') {
118
- throw new TypeError('Event name(s) must be a string.');
131
+ if (typeof eventName !== 'string') {
132
+ throw new TypeError('Event name must be a string.');
119
133
  }
120
134
  if (typeof callback !== 'function') {
121
135
  throw new TypeError('Callback, if provided, must be a function.');
122
136
  }
123
- for (const eventName of eventNames.trim().split(eventNamesRegex)) {
124
- const list = this._getEventList(eventName, true);
125
- if (Observable._indexOfListener(list, callback, thisArg) !== -1) {
126
- // Already added.
127
- continue;
128
- }
129
- list.push({
130
- callback,
131
- thisArg,
132
- once,
133
- });
137
+ const list = this._getEventList(eventName, true);
138
+ if (Observable._indexOfListener(list, callback, thisArg) !== -1) {
139
+ // Already added.
140
+ return;
134
141
  }
142
+ list.push({
143
+ callback,
144
+ thisArg,
145
+ once,
146
+ });
135
147
  }
136
148
  /**
137
149
  * Removes listener(s) for the specified event name.
138
- * @param eventNames Comma delimited names of the events the specified listener is associated with.
150
+ * @param eventName Name of the event to attach to.
139
151
  * @param callback An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.
140
152
  * @param thisArg An optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener.
141
153
  */
142
- removeEventListener(eventNames, callback, thisArg) {
154
+ removeEventListener(eventName, callback, thisArg) {
143
155
  thisArg = thisArg || undefined;
144
- if (typeof eventNames !== 'string') {
156
+ if (typeof eventName !== 'string') {
145
157
  throw new TypeError('Events name(s) must be string.');
146
158
  }
147
159
  if (callback && typeof callback !== 'function') {
148
160
  throw new TypeError('callback must be function.');
149
161
  }
150
- for (const eventName of eventNames.trim().split(eventNamesRegex)) {
151
- const entries = this._observers[eventName];
152
- if (!entries) {
153
- continue;
154
- }
155
- Observable.innerRemoveEventListener(entries, callback, thisArg);
156
- if (!entries.length) {
157
- // Clear all entries of this type
158
- delete this._observers[eventName];
159
- }
162
+ const entries = this._observers[eventName];
163
+ if (!entries) {
164
+ return;
165
+ }
166
+ Observable.innerRemoveEventListener(entries, callback, thisArg);
167
+ if (!entries.length) {
168
+ // Clear all entries of this type
169
+ delete this._observers[eventName];
160
170
  }
161
171
  }
162
172
  /**
@@ -205,30 +215,28 @@ export class Observable {
205
215
  * in future.
206
216
  * @deprecated
207
217
  */
208
- static removeEventListener(eventNames, callback, thisArg) {
218
+ static removeEventListener(eventName, callback, thisArg) {
209
219
  thisArg = thisArg || undefined;
210
- if (typeof eventNames !== 'string') {
211
- throw new TypeError('Event name(s) must be a string.');
220
+ if (typeof eventName !== 'string') {
221
+ throw new TypeError('Event name must be a string.');
212
222
  }
213
223
  if (callback && typeof callback !== 'function') {
214
224
  throw new TypeError('Callback, if provided, must be function.');
215
225
  }
216
226
  const eventClass = this.name === 'Observable' ? '*' : this.name;
217
- for (const eventName of eventNames.trim().split(eventNamesRegex)) {
218
- const entries = _globalEventHandlers?.[eventClass]?.[eventName];
219
- if (!entries) {
220
- continue;
221
- }
222
- Observable.innerRemoveEventListener(entries, callback, thisArg);
223
- if (!entries.length) {
224
- // Clear all entries of this type
225
- delete _globalEventHandlers[eventClass][eventName];
226
- }
227
- // Clear the primary class grouping if no list are left
228
- const keys = Object.keys(_globalEventHandlers[eventClass]);
229
- if (keys.length === 0) {
230
- delete _globalEventHandlers[eventClass];
231
- }
227
+ const entries = _globalEventHandlers?.[eventClass]?.[eventName];
228
+ if (!entries) {
229
+ return;
230
+ }
231
+ Observable.innerRemoveEventListener(entries, callback, thisArg);
232
+ if (!entries.length) {
233
+ // Clear all entries of this type
234
+ delete _globalEventHandlers[eventClass][eventName];
235
+ }
236
+ // Clear the primary class grouping if no list are left
237
+ const keys = Object.keys(_globalEventHandlers[eventClass]);
238
+ if (keys.length === 0) {
239
+ delete _globalEventHandlers[eventClass];
232
240
  }
233
241
  }
234
242
  /**
@@ -236,11 +244,11 @@ export class Observable {
236
244
  * in future.
237
245
  * @deprecated
238
246
  */
239
- static addEventListener(eventNames, callback, thisArg, once) {
247
+ static addEventListener(eventName, callback, thisArg, once) {
240
248
  once = once || undefined;
241
249
  thisArg = thisArg || undefined;
242
- if (typeof eventNames !== 'string') {
243
- throw new TypeError('Event name(s) must be a string.');
250
+ if (typeof eventName !== 'string') {
251
+ throw new TypeError('Event name must be a string.');
244
252
  }
245
253
  if (typeof callback !== 'function') {
246
254
  throw new TypeError('Callback must be a function.');
@@ -249,16 +257,14 @@ export class Observable {
249
257
  if (!_globalEventHandlers[eventClass]) {
250
258
  _globalEventHandlers[eventClass] = {};
251
259
  }
252
- for (const eventName of eventNames.trim().split(eventNamesRegex)) {
253
- if (!_globalEventHandlers[eventClass][eventName]) {
254
- _globalEventHandlers[eventClass][eventName] = [];
255
- }
256
- if (Observable._indexOfListener(_globalEventHandlers[eventClass][eventName], callback, thisArg) !== -1) {
257
- // Already added.
258
- return;
259
- }
260
- _globalEventHandlers[eventClass][eventName].push({ callback, thisArg, once });
260
+ if (!_globalEventHandlers[eventClass][eventName]) {
261
+ _globalEventHandlers[eventClass][eventName] = [];
261
262
  }
263
+ if (Observable._indexOfListener(_globalEventHandlers[eventClass][eventName], callback, thisArg) !== -1) {
264
+ // Already added.
265
+ return;
266
+ }
267
+ _globalEventHandlers[eventClass][eventName].push({ callback, thisArg, once });
262
268
  }
263
269
  _globalNotify(eventClass, eventType, data) {
264
270
  // Check for the Global handlers for JUST this class
@@ -344,10 +350,8 @@ export class Observable {
344
350
  oldValue,
345
351
  };
346
352
  }
347
- _emit(eventNames) {
348
- for (const eventName of eventNames.trim().split(eventNamesRegex)) {
349
- this.notify({ eventName, object: this });
350
- }
353
+ _emit(eventName) {
354
+ this.notify({ eventName, object: this });
351
355
  }
352
356
  _getEventList(eventName, createIfNeeded) {
353
357
  if (!eventName) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/data/observable/index.ts"],"names":[],"mappings":"AA4CA,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACxB;;;OAGG;IACH;IACC;;OAEG;IACI,OAAY;QAAZ,YAAO,GAAP,OAAO,CAAK;IACjB,CAAC;IAEJ;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,KAAU;QAC9B,OAAO,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAI,CAAC,KAAU;QAC5B,MAAM,CAAC,GAAG,cAAc,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC;QAElB,OAAO,CAA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AAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;YAChH,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACpC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAW;IACrC,MAAM,UAAU,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC9C,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEnD,OAAO,UAAU,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAW;IAC9C,MAAM,UAAU,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC9C,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAElD,OAAO,UAAU,CAAC;AACnB,CAAC"}
@@ -201,11 +201,15 @@ export declare class ObservableArray<T> extends Observable {
201
201
  }
202
202
  export interface ObservableArray<T> {
203
203
  /**
204
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
205
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
206
- * @param callback - Callback function which will be executed when event is raised.
207
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
208
- */
209
- on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
204
+ * Adds a listener for the specified event name.
205
+ *
206
+ * @param eventName The name of the event.
207
+ * @param callback The event listener to add. Will be called when an event of
208
+ * the given name is raised.
209
+ * @param thisArg An optional parameter which, when set, will be bound as the
210
+ * `this` context when the callback is called. Falsy values will be not be
211
+ * bound.
212
+ */
213
+ on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
210
214
  on(event: 'change', callback: (args: ChangedData<T>) => void, thisArg?: any): void;
211
215
  }
@@ -51,12 +51,16 @@ export declare class VirtualArray<T> extends Observable {
51
51
  }
52
52
  export interface VirtualArray<T> {
53
53
  /**
54
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
55
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
56
- * @param callback - Callback function which will be executed when event is raised.
57
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
54
+ * Adds a listener for the specified event name.
55
+ *
56
+ * @param eventName The name of the event.
57
+ * @param callback The event listener to add. Will be called when an event of
58
+ * the given name is raised.
59
+ * @param thisArg An optional parameter which, when set, will be bound as the
60
+ * `this` context when the callback is called. Falsy values will be not be
61
+ * bound.
58
62
  */
59
- on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
63
+ on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
60
64
  /**
61
65
  * Raised when still not loaded items are requested.
62
66
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/core",
3
- "version": "8.7.3-next-05-07-2024-8977885291",
3
+ "version": "8.7.3-next-05-23-2024-9210745709",
4
4
  "description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
5
5
  "main": "index",
6
6
  "types": "index.d.ts",
@@ -129,12 +129,16 @@ export class ActionItem extends ViewBase {
129
129
  actionBar: ActionBar;
130
130
 
131
131
  /**
132
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
133
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
134
- * @param callback - Callback function which will be executed when event is raised.
135
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
136
- */
137
- on(eventNames: string, callback: (data: EventData) => void): void;
132
+ * Adds a listener for the specified event name.
133
+ *
134
+ * @param eventName The name of the event.
135
+ * @param callback The event listener to add. Will be called when an event of
136
+ * the given name is raised.
137
+ * @param thisArg An optional parameter which, when set, will be bound as the
138
+ * `this` context when the callback is called. Falsy values will be not be
139
+ * bound.
140
+ */
141
+ on(eventName: string, callback: (data: EventData) => void): void;
138
142
 
139
143
  /**
140
144
  * Raised when a tap event occurs.
@@ -26,12 +26,16 @@ export class Button extends TextBase {
26
26
  textWrap: boolean;
27
27
 
28
28
  /**
29
- * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
30
- * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
31
- * @param callback - Callback function which will be executed when event is raised.
32
- * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
29
+ * Adds a listener for the specified event name.
30
+ *
31
+ * @param eventName The name of the event.
32
+ * @param callback The event listener to add. Will be called when an event of
33
+ * the given name is raised.
34
+ * @param thisArg An optional parameter which, when set, will be bound as the
35
+ * `this` context when the callback is called. Falsy values will be not be
36
+ * bound.
33
37
  */
34
- on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
38
+ on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void;
35
39
 
36
40
  /**
37
41
  * Raised when a tap event occurs.
@@ -37,6 +37,19 @@ export interface ValueConverter {
37
37
  */
38
38
  toView: (...params: any[]) => any;
39
39
  }
40
+ /**
41
+ * Normalizes "ontap" to "tap", and "ondoubletap" to "ondoubletap".
42
+ *
43
+ * Removes the leading "on" from an event gesture name, for example:
44
+ * - "ontap" -> "tap"
45
+ * - "ondoubletap" -> "doubletap"
46
+ * - "onTap" -> "Tap"
47
+ *
48
+ * Be warned that, as event/gesture names in NativeScript are case-sensitive,
49
+ * this may produce an invalid event/gesture name (i.e. "doubletap" would fail
50
+ * to match the "doubleTap" gesture name), and so it is up to the consumer to
51
+ * handle the output properly.
52
+ */
40
53
  export declare function getEventOrGestureName(name: string): string;
41
54
  export declare function isGesture(eventOrGestureName: string): boolean;
42
55
  export declare function isEventOrGesture(name: string, view: ViewBase): boolean;
@@ -38,21 +38,41 @@ function getProperties(property) {
38
38
  propertiesCache[property] = result;
39
39
  return result;
40
40
  }
41
+ /**
42
+ * Normalizes "ontap" to "tap", and "ondoubletap" to "ondoubletap".
43
+ *
44
+ * Removes the leading "on" from an event gesture name, for example:
45
+ * - "ontap" -> "tap"
46
+ * - "ondoubletap" -> "doubletap"
47
+ * - "onTap" -> "Tap"
48
+ *
49
+ * Be warned that, as event/gesture names in NativeScript are case-sensitive,
50
+ * this may produce an invalid event/gesture name (i.e. "doubletap" would fail
51
+ * to match the "doubleTap" gesture name), and so it is up to the consumer to
52
+ * handle the output properly.
53
+ */
41
54
  export function getEventOrGestureName(name) {
42
- return name.indexOf('on') === 0 ? name.substr(2, name.length - 2) : name;
55
+ return name.indexOf('on') === 0 ? name.slice(2) : name;
43
56
  }
44
- // NOTE: method fromString from "ui/gestures";
45
57
  export function isGesture(eventOrGestureName) {
58
+ // Not sure whether this trimming and lowercasing is still needed in practice
59
+ // (all Core tests pass without it), so worth revisiting in future. I think
60
+ // this is used exclusively by the XML flavour, and my best guess is that
61
+ // maybe it's to handle how getEventOrGestureName("onTap") might pass "Tap"
62
+ // into this.
46
63
  const t = eventOrGestureName.trim().toLowerCase();
64
+ // Would be nice to have a convenience function for getting all GestureState
65
+ // names in `gestures-common.ts`, but when I tried introducing it, it created
66
+ // a circular dependency that crashed the automated tests app.
47
67
  return t === 'tap' || t === 'doubletap' || t === 'pinch' || t === 'pan' || t === 'swipe' || t === 'rotation' || t === 'longpress' || t === 'touch';
48
68
  }
49
- // TODO: Make this instance function so that we dont need public statc tapEvent = "tap"
69
+ // TODO: Make this instance function so that we dont need public static tapEvent = "tap"
50
70
  // in controls. They will just override this one and provide their own event support.
51
71
  export function isEventOrGesture(name, view) {
52
72
  if (typeof name === 'string') {
53
73
  const eventOrGestureName = getEventOrGestureName(name);
54
74
  const evt = `${eventOrGestureName}Event`;
55
- return (view.constructor && evt in view.constructor) || isGesture(eventOrGestureName.toLowerCase());
75
+ return (view.constructor && evt in view.constructor) || isGesture(eventOrGestureName);
56
76
  }
57
77
  return false;
58
78
  }