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.
@@ -12,7 +12,7 @@ div
12
12
  a-modal(
13
13
  v-if="isModalOpen"
14
14
  size="xxl"
15
- selector-close="#btn_modal"
15
+ selector-close-ids="btn_modal"
16
16
  :close="closeModal"
17
17
  )
18
18
  //template(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.237",
4
+ "version": "1.0.238",
5
5
  "author": "Ilia Brykin",
6
6
  "scripts": {
7
7
  "build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
@@ -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.selectorClose) {
401
+ if (!this.selectorsCloseAll.length) {
374
402
  return;
375
403
  }
376
- const SELECTOR_CLOSE = this.selectorClose;
404
+
405
+
377
406
  setTimeout(() => {
378
- if (isString(SELECTOR_CLOSE)) {
379
- this.onFocusByDestroyForSelector({ selector: SELECTOR_CLOSE });
380
- } else {
381
- forEach(SELECTOR_CLOSE, selector => {
382
- const STATUS_SUCCESS = this.onFocusByDestroyForSelector({ selector });
383
- if (STATUS_SUCCESS) {
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
 
@@ -17,6 +17,7 @@ export const modalPluginOptions = ref({
17
17
  saveButtonClass: "a_btn a_btn_primary",
18
18
  saveButtonText: "Speichern",
19
19
  selectorClose: undefined,
20
+ selectorCloseIds: undefined,
20
21
  size: undefined,
21
22
  textRequired: undefined,
22
23
  withoutEscape: false,