aloha-vue 1.0.237 → 1.0.238
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/package.json
CHANGED
package/src/AModal/AModal.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from "../const/AFocusableElements";
|
|
18
18
|
import {
|
|
19
19
|
filter,
|
|
20
|
+
isArray,
|
|
20
21
|
isString,
|
|
21
22
|
forEach,
|
|
22
23
|
isFunction,
|
|
@@ -159,6 +160,11 @@ export default {
|
|
|
159
160
|
required: false,
|
|
160
161
|
default: () => modalPluginOptions.value.propsDefault.selectorClose,
|
|
161
162
|
},
|
|
163
|
+
selectorCloseIds: {
|
|
164
|
+
type: [String, Array],
|
|
165
|
+
required: false,
|
|
166
|
+
default: () => modalPluginOptions.value.propsDefault.selectorCloseIds,
|
|
167
|
+
},
|
|
162
168
|
size: {
|
|
163
169
|
type: String,
|
|
164
170
|
validator: value => ["small", "large", "xl", "xxl", "fullscreen"].indexOf(value) !== -1,
|
|
@@ -240,6 +246,28 @@ export default {
|
|
|
240
246
|
isDataForm() {
|
|
241
247
|
return this.dataForm.length > 0;
|
|
242
248
|
},
|
|
249
|
+
|
|
250
|
+
selectorsCloseAll() {
|
|
251
|
+
const ALL_SELECTORS = [];
|
|
252
|
+
if (this.selectorCloseIds) {
|
|
253
|
+
if (isString(this.selectorCloseIds)) {
|
|
254
|
+
ALL_SELECTORS.push(`#${ this.selectorCloseIds }`);
|
|
255
|
+
} else if (isArray(this.selectorCloseIds)) {
|
|
256
|
+
forEach(this.selectorCloseIds, selectorCloseId => {
|
|
257
|
+
ALL_SELECTORS.push(`#${ selectorCloseId }`);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (this.selectorClose) {
|
|
262
|
+
if (isString(this.selectorClose)) {
|
|
263
|
+
ALL_SELECTORS.push(this.selectorClose);
|
|
264
|
+
} else if (isArray(this.selectorClose)) {
|
|
265
|
+
ALL_SELECTORS.push(...this.selectorClose);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return ALL_SELECTORS;
|
|
270
|
+
}
|
|
243
271
|
},
|
|
244
272
|
watch: {
|
|
245
273
|
isModalHidden() {
|
|
@@ -370,21 +398,18 @@ export default {
|
|
|
370
398
|
},
|
|
371
399
|
|
|
372
400
|
onFocusByDestroy() {
|
|
373
|
-
if (!this.
|
|
401
|
+
if (!this.selectorsCloseAll.length) {
|
|
374
402
|
return;
|
|
375
403
|
}
|
|
376
|
-
|
|
404
|
+
|
|
405
|
+
|
|
377
406
|
setTimeout(() => {
|
|
378
|
-
|
|
379
|
-
this.onFocusByDestroyForSelector({ selector
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
return false;
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
}
|
|
407
|
+
forEach(this.selectorsCloseAll, selector => {
|
|
408
|
+
const STATUS_SUCCESS = this.onFocusByDestroyForSelector({ selector });
|
|
409
|
+
if (STATUS_SUCCESS) {
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
388
413
|
}, 300);
|
|
389
414
|
},
|
|
390
415
|
|