@bpmn-io/form-js-editor 1.8.0 → 1.8.1
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/dist/index.es.js
CHANGED
|
@@ -127,6 +127,8 @@ var slice = Array.prototype.slice;
|
|
|
127
127
|
* var sum = eventBus.fire('sum', 1, 2);
|
|
128
128
|
* console.log(sum); // 3
|
|
129
129
|
* ```
|
|
130
|
+
*
|
|
131
|
+
* @template [EventMap=null]
|
|
130
132
|
*/
|
|
131
133
|
function EventBus() {
|
|
132
134
|
/**
|
|
@@ -140,6 +142,8 @@ function EventBus() {
|
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
/**
|
|
145
|
+
* @overlord
|
|
146
|
+
*
|
|
143
147
|
* Register an event listener for events with the given name.
|
|
144
148
|
*
|
|
145
149
|
* The callback will be invoked with `event, ...additionalArguments`
|
|
@@ -158,6 +162,25 @@ function EventBus() {
|
|
|
158
162
|
* @param {EventBusEventCallback<T>} callback
|
|
159
163
|
* @param {any} [that] callback context
|
|
160
164
|
*/
|
|
165
|
+
/**
|
|
166
|
+
* Register an event listener for events with the given name.
|
|
167
|
+
*
|
|
168
|
+
* The callback will be invoked with `event, ...additionalArguments`
|
|
169
|
+
* that have been passed to {@link EventBus#fire}.
|
|
170
|
+
*
|
|
171
|
+
* Returning false from a listener will prevent the events default action
|
|
172
|
+
* (if any is specified). To stop an event from being processed further in
|
|
173
|
+
* other listeners execute {@link Event#stopPropagation}.
|
|
174
|
+
*
|
|
175
|
+
* Returning anything but `undefined` from a listener will stop the listener propagation.
|
|
176
|
+
*
|
|
177
|
+
* @template {keyof EventMap} EventName
|
|
178
|
+
*
|
|
179
|
+
* @param {EventName} events to subscribe to
|
|
180
|
+
* @param {number} [priority=1000] listen priority
|
|
181
|
+
* @param {EventBusEventCallback<EventMap[EventName]>} callback
|
|
182
|
+
* @param {any} [that] callback context
|
|
183
|
+
*/
|
|
161
184
|
EventBus.prototype.on = function (events, priority, callback, that) {
|
|
162
185
|
events = isArray(events) ? events : [events];
|
|
163
186
|
if (isFunction(priority)) {
|
|
@@ -188,6 +211,8 @@ EventBus.prototype.on = function (events, priority, callback, that) {
|
|
|
188
211
|
};
|
|
189
212
|
|
|
190
213
|
/**
|
|
214
|
+
* @overlord
|
|
215
|
+
*
|
|
191
216
|
* Register an event listener that is called only once.
|
|
192
217
|
*
|
|
193
218
|
* @template T
|
|
@@ -197,6 +222,16 @@ EventBus.prototype.on = function (events, priority, callback, that) {
|
|
|
197
222
|
* @param {EventBusEventCallback<T>} callback
|
|
198
223
|
* @param {any} [that] callback context
|
|
199
224
|
*/
|
|
225
|
+
/**
|
|
226
|
+
* Register an event listener that is called only once.
|
|
227
|
+
*
|
|
228
|
+
* @template {keyof EventMap} EventName
|
|
229
|
+
*
|
|
230
|
+
* @param {EventName} events to subscribe to
|
|
231
|
+
* @param {number} [priority=1000] listen priority
|
|
232
|
+
* @param {EventBusEventCallback<EventMap[EventName]>} callback
|
|
233
|
+
* @param {any} [that] callback context
|
|
234
|
+
*/
|
|
200
235
|
EventBus.prototype.once = function (events, priority, callback, that) {
|
|
201
236
|
var self = this;
|
|
202
237
|
if (isFunction(priority)) {
|
|
@@ -2868,9 +2903,9 @@ EditorActions.prototype.unregister = function (action) {
|
|
|
2868
2903
|
};
|
|
2869
2904
|
|
|
2870
2905
|
/**
|
|
2871
|
-
* Returns the
|
|
2906
|
+
* Returns the identifiers of all currently registered editor actions
|
|
2872
2907
|
*
|
|
2873
|
-
* @return {
|
|
2908
|
+
* @return {string[]}
|
|
2874
2909
|
*/
|
|
2875
2910
|
EditorActions.prototype.getActions = function () {
|
|
2876
2911
|
return Object.keys(this._actions);
|
|
@@ -3123,7 +3158,7 @@ Keyboard.prototype._isEventIgnored = function (event) {
|
|
|
3123
3158
|
if (event.defaultPrevented) {
|
|
3124
3159
|
return true;
|
|
3125
3160
|
}
|
|
3126
|
-
return isInput(event.target) && this._isModifiedKeyIgnored(event);
|
|
3161
|
+
return (isInput(event.target) || isButton(event.target) && isKey([' ', 'Enter'], event)) && this._isModifiedKeyIgnored(event);
|
|
3127
3162
|
};
|
|
3128
3163
|
Keyboard.prototype._isModifiedKeyIgnored = function (event) {
|
|
3129
3164
|
if (!isCmd(event)) {
|
|
@@ -3220,6 +3255,9 @@ Keyboard.prototype.isKey = isKey;
|
|
|
3220
3255
|
function isInput(target) {
|
|
3221
3256
|
return target && (matches(target, 'input, textarea') || target.contentEditable === 'true');
|
|
3222
3257
|
}
|
|
3258
|
+
function isButton(target) {
|
|
3259
|
+
return target && matches(target, 'button, input[type=submit], input[type=button], a[href], [aria-role=button]');
|
|
3260
|
+
}
|
|
3223
3261
|
|
|
3224
3262
|
var LOW_PRIORITY$1 = 500;
|
|
3225
3263
|
|