eoss 0.1.0-alpha.39 → 0.1.0-alpha.40
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/lib/0.js +1 -1
- package/lib/1.js +1 -1
- package/lib/10.js +1 -1
- package/lib/11.js +1 -1
- package/lib/12.js +1 -1
- package/lib/13.js +1 -1
- package/lib/14.js +1 -1
- package/lib/15.js +1 -1
- package/lib/16.js +1 -1
- package/lib/17.js +1 -1
- package/lib/18.js +1 -1
- package/lib/19.js +1 -1
- package/lib/20.js +1 -1
- package/lib/21.js +1 -1
- package/lib/22.js +1 -1
- package/lib/23.js +1 -1
- package/lib/24.js +1 -1
- package/lib/25.js +1 -1
- package/lib/26.js +1 -1
- package/lib/27.js +1 -1
- package/lib/28.js +1 -1
- package/lib/29.js +1 -1
- package/lib/3.js +1 -1
- package/lib/30.js +1 -1
- package/lib/31.js +1 -1
- package/lib/32.js +1 -1
- package/lib/33.js +1 -1
- package/lib/34.js +1 -1
- package/lib/35.js +1 -1
- package/lib/36.js +1 -1
- package/lib/37.js +1 -1
- package/lib/38.js +1 -1
- package/lib/39.js +1 -1
- package/lib/4.js +1 -1
- package/lib/40.js +1 -1
- package/lib/41.js +1 -1
- package/lib/42.js +1 -1
- package/lib/43.js +1 -1
- package/lib/44.js +1 -1
- package/lib/45.js +1 -1
- package/lib/46.js +1 -1
- package/lib/47.js +1 -1
- package/lib/48.js +1 -1
- package/lib/49.js +1 -1
- package/lib/5.js +1 -1
- package/lib/50.js +1 -1
- package/lib/51.js +1 -1
- package/lib/52.js +1 -1
- package/lib/53.js +1 -1
- package/lib/54.js +1 -1
- package/lib/55.js +1 -1
- package/lib/56.js +1 -1
- package/lib/57.js +1 -1
- package/lib/58.js +1 -1
- package/lib/59.js +1 -1
- package/lib/6.js +1 -1
- package/lib/60.js +1 -1
- package/lib/61.js +1 -1
- package/lib/62.js +1 -1
- package/lib/63.js +1 -1
- package/lib/64.js +1 -1
- package/lib/65.js +1 -1
- package/lib/66.js +1 -1
- package/lib/67.js +1 -1
- package/lib/68.js +1 -1
- package/lib/69.js +1 -1
- package/lib/7.js +1 -1
- package/lib/70.js +1 -1
- package/lib/71.js +1 -1
- package/lib/72.js +1 -1
- package/lib/73.js +1 -1
- package/lib/74.js +1 -1
- package/lib/75.js +1 -1
- package/lib/76.js +1 -1
- package/lib/77.js +1 -1
- package/lib/78.js +1 -1
- package/lib/79.js +1 -1
- package/lib/8.js +1 -1
- package/lib/80.js +1 -1
- package/lib/81.js +1 -1
- package/lib/9.js +1 -1
- package/lib/account-login.js +837 -862
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +4 -4
- package/lib/autocomplete.js +1813 -1988
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +2 -2
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +4 -4
- package/lib/button.js +2 -2
- package/lib/ca-login.js +837 -862
- package/lib/calendar.js +839 -864
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +846 -871
- package/lib/carousel.js +839 -864
- package/lib/cascader-panel.js +852 -877
- package/lib/cascader.js +2048 -2223
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +859 -884
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +1040 -1065
- package/lib/collapse.js +1040 -1065
- package/lib/color-picker.js +972 -1122
- package/lib/container.js +2 -2
- package/lib/cron.js +12 -12
- package/lib/data-table.js +843 -868
- package/lib/date-picker.js +10520 -10695
- package/lib/descriptions-item.js +4 -4
- package/lib/descriptions.js +4 -4
- package/lib/dialog.js +837 -862
- package/lib/divider.js +2 -2
- package/lib/drawer.js +2 -2
- package/lib/dropdown-item.js +4 -4
- package/lib/dropdown-menu.js +974 -1124
- package/lib/dropdown.js +841 -866
- package/lib/email-login.js +837 -862
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +4023 -2668
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +853 -878
- package/lib/flow.js +868 -893
- package/lib/flows.js +854 -879
- package/lib/footer.js +2 -2
- package/lib/form-item.js +860 -885
- package/lib/form.js +933 -950
- package/lib/guide.js +2 -2
- package/lib/header.js +2 -2
- package/lib/icon.js +837 -862
- package/lib/icons.js +2 -2
- package/lib/image-viewer.js +837 -862
- package/lib/image.js +4 -4
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +2 -2
- package/lib/input-number.js +6 -6
- package/lib/input.js +839 -864
- package/lib/link.js +2 -2
- package/lib/loading.js +2 -2
- package/lib/login.js +867 -891
- package/lib/lowcode-view.js +1843 -1185
- package/lib/lowcode.js +3050 -1569
- package/lib/main.js +970 -988
- package/lib/marquee.js +837 -862
- package/lib/menu-item-group.js +15 -15
- package/lib/menu-item.js +6 -6
- package/lib/menu.js +2227 -2368
- package/lib/message-box.js +843 -868
- package/lib/message.js +839 -864
- package/lib/notification.js +861 -886
- package/lib/option-group.js +4 -4
- package/lib/option.js +839 -864
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +839 -864
- package/lib/phone-login.js +847 -866
- package/lib/popconfirm.js +4 -4
- package/lib/popover.js +1831 -2006
- package/lib/process-config.js +839 -864
- package/lib/process-module.js +846 -871
- package/lib/process-rule.js +905 -930
- package/lib/progress.js +2 -2
- package/lib/qr-code.js +4 -4
- package/lib/qrcode-login.js +839 -864
- package/lib/radio-button.js +4 -4
- package/lib/radio-group.js +850 -875
- package/lib/radio.js +4 -4
- package/lib/rate.js +837 -862
- package/lib/retrial-auth.js +837 -862
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +839 -864
- package/lib/select.js +2139 -2314
- package/lib/selector-panel.js +940 -965
- package/lib/selector.js +852 -877
- package/lib/slider.js +4 -4
- package/lib/step.js +32 -32
- package/lib/steps.js +874 -899
- package/lib/submenu.js +1269 -1385
- package/lib/switch.js +839 -864
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +840 -865
- package/lib/table.js +1825 -2000
- package/lib/tabs.js +846 -871
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -1
- package/lib/time-picker.js +6471 -6646
- package/lib/time-select.js +5039 -5214
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +837 -862
- package/lib/toolbar.js +4 -4
- package/lib/tooltip.js +1813 -1988
- package/lib/transfer.js +837 -862
- package/lib/tree-group.js +853 -878
- package/lib/tree.js +1026 -1051
- package/lib/update-history.js +4 -4
- package/lib/upload.js +859 -884
- package/lib/wujie.js +841 -866
- package/package.json +1 -1
- package/packages/flow-group/src/main.vue +2 -2
- package/packages/form/src/form-item-render.vue +1 -0
- package/packages/form/src/form-item.vue +12 -6
- package/packages/form/src/form.vue +5 -5
- package/packages/login/src/login.vue +1 -0
- package/packages/lowcode/src/attribute/function.vue +28 -9
- package/packages/lowcode/src/attribute/props.vue +202 -0
- package/packages/lowcode/src/attribute/styles.vue +79 -5
- package/packages/lowcode/src/attribute.vue +61 -4
- package/packages/lowcode/src/canvas.vue +159 -2
- package/packages/lowcode/src/form-render.vue +305 -0
- package/packages/lowcode/src/lowcode.vue +33 -13
- package/packages/lowcode/src/modules.vue +53 -37
- package/packages/lowcode/src/render.vue +80 -25
- package/packages/lowcode/src/util/components.js +100 -0
- package/packages/lowcode/src/util/props-util.js +67 -0
- package/packages/lowcode/src/util/source-generator.js +69 -9
- package/packages/lowcode/src/util/source-parser.js +64 -10
- package/packages/lowcode-view/src/render.vue +48 -18
- package/packages/main/src/components/userinfo.vue +0 -1
- package/packages/menu/src/menu-item-group.vue +1 -1
- package/packages/menu/src/mixins.js +8 -4
- package/packages/menu/src/submenu.vue +35 -5
- package/packages/phone-login/src/phone-login.vue +5 -2
- package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/lowcode.scss +21 -2
- package/src/index.js +336 -336
package/lib/menu.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 213);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -3285,12 +3285,232 @@ var warning = function warning(content, _callback3) {
|
|
|
3285
3285
|
|
|
3286
3286
|
/***/ }),
|
|
3287
3287
|
|
|
3288
|
-
/***/
|
|
3288
|
+
/***/ 11:
|
|
3289
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3290
|
+
|
|
3291
|
+
"use strict";
|
|
3292
|
+
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
3293
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
3294
|
+
/* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
3295
|
+
|
|
3296
|
+
|
|
3297
|
+
|
|
3298
|
+
var hasModal = false;
|
|
3299
|
+
var hasInitZIndex = false;
|
|
3300
|
+
// 跨模块副本共享的 z-index 计数器宿主。
|
|
3301
|
+
// 低代码等场景会用 eoss / eoss/src / eoss/packages 多种身份加载本文件,
|
|
3302
|
+
// 导致出现多份 PopupManager、各自从 2000 起算,出现“后弹出的层级反而比先弹出的小”。
|
|
3303
|
+
// 把计数器挂到全局,所有副本共用同一条单调递增序列。
|
|
3304
|
+
var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
|
3305
|
+
|
|
3306
|
+
var getModal = function getModal() {
|
|
3307
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
3308
|
+
var modalDom = PopupManager.modalDom;
|
|
3309
|
+
if (modalDom) {
|
|
3310
|
+
hasModal = true;
|
|
3311
|
+
} else {
|
|
3312
|
+
hasModal = false;
|
|
3313
|
+
modalDom = document.createElement('div');
|
|
3314
|
+
PopupManager.modalDom = modalDom;
|
|
3315
|
+
|
|
3316
|
+
modalDom.addEventListener('touchmove', function (event) {
|
|
3317
|
+
event.preventDefault();
|
|
3318
|
+
event.stopPropagation();
|
|
3319
|
+
});
|
|
3320
|
+
|
|
3321
|
+
modalDom.addEventListener('click', function () {
|
|
3322
|
+
PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
|
3323
|
+
});
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
return modalDom;
|
|
3327
|
+
};
|
|
3328
|
+
|
|
3329
|
+
var instances = {};
|
|
3330
|
+
|
|
3331
|
+
var PopupManager = {
|
|
3332
|
+
modalFade: true,
|
|
3333
|
+
|
|
3334
|
+
getInstance: function getInstance(id) {
|
|
3335
|
+
return instances[id];
|
|
3336
|
+
},
|
|
3337
|
+
|
|
3338
|
+
register: function register(id, instance) {
|
|
3339
|
+
if (id && instance) {
|
|
3340
|
+
instances[id] = instance;
|
|
3341
|
+
}
|
|
3342
|
+
},
|
|
3343
|
+
|
|
3344
|
+
deregister: function deregister(id) {
|
|
3345
|
+
if (id) {
|
|
3346
|
+
instances[id] = null;
|
|
3347
|
+
delete instances[id];
|
|
3348
|
+
}
|
|
3349
|
+
},
|
|
3350
|
+
|
|
3351
|
+
nextZIndex: function nextZIndex() {
|
|
3352
|
+
return PopupManager.zIndex++;
|
|
3353
|
+
},
|
|
3354
|
+
|
|
3355
|
+
modalStack: [],
|
|
3356
|
+
|
|
3357
|
+
doOnModalClick: function doOnModalClick() {
|
|
3358
|
+
var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
3359
|
+
if (!topItem) return;
|
|
3360
|
+
|
|
3361
|
+
var instance = PopupManager.getInstance(topItem.id);
|
|
3362
|
+
if (instance && instance.closeOnClickModal) {
|
|
3363
|
+
instance.close();
|
|
3364
|
+
}
|
|
3365
|
+
},
|
|
3366
|
+
|
|
3367
|
+
openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
3368
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
3369
|
+
if (!id || zIndex === undefined) return;
|
|
3370
|
+
this.modalFade = modalFade;
|
|
3371
|
+
|
|
3372
|
+
var modalStack = this.modalStack;
|
|
3373
|
+
|
|
3374
|
+
for (var i = 0, j = modalStack.length; i < j; i++) {
|
|
3375
|
+
var item = modalStack[i];
|
|
3376
|
+
if (item.id === id) {
|
|
3377
|
+
return;
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
var modalDom = getModal();
|
|
3382
|
+
|
|
3383
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal');
|
|
3384
|
+
if (this.modalFade && !hasModal) {
|
|
3385
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-enter');
|
|
3386
|
+
}
|
|
3387
|
+
if (modalClass) {
|
|
3388
|
+
var classArr = modalClass.trim().split(/\s+/);
|
|
3389
|
+
classArr.forEach(function (item) {
|
|
3390
|
+
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, item);
|
|
3391
|
+
});
|
|
3392
|
+
}
|
|
3393
|
+
setTimeout(function () {
|
|
3394
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, 'v-modal-enter');
|
|
3395
|
+
}, 200);
|
|
3396
|
+
|
|
3397
|
+
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
|
3398
|
+
dom.parentNode.appendChild(modalDom);
|
|
3399
|
+
} else {
|
|
3400
|
+
document.body.appendChild(modalDom);
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
if (zIndex) {
|
|
3404
|
+
modalDom.style.zIndex = zIndex;
|
|
3405
|
+
}
|
|
3406
|
+
modalDom.tabIndex = 0;
|
|
3407
|
+
modalDom.style.display = '';
|
|
3408
|
+
|
|
3409
|
+
this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
|
|
3410
|
+
},
|
|
3411
|
+
|
|
3412
|
+
closeModal: function closeModal(id) {
|
|
3413
|
+
var modalStack = this.modalStack;
|
|
3414
|
+
var modalDom = getModal();
|
|
3415
|
+
var topItem = null;
|
|
3416
|
+
|
|
3417
|
+
if (modalStack.length > 0) {
|
|
3418
|
+
topItem = modalStack[modalStack.length - 1];
|
|
3419
|
+
if (topItem.id === id) {
|
|
3420
|
+
modalStack.pop();
|
|
3421
|
+
if (modalStack.length > 0) {
|
|
3422
|
+
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
|
|
3423
|
+
}
|
|
3424
|
+
} else {
|
|
3425
|
+
for (var i = modalStack.length - 1; i >= 0; i--) {
|
|
3426
|
+
if (modalStack[i].id === id) {
|
|
3427
|
+
modalStack.splice(i, 1);
|
|
3428
|
+
break;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
if (modalStack.length === 0) {
|
|
3435
|
+
if (this.modalFade) {
|
|
3436
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-leave');
|
|
3437
|
+
}
|
|
3438
|
+
setTimeout(function () {
|
|
3439
|
+
if (modalStack.length === 0) {
|
|
3440
|
+
if (topItem && topItem.modalClass) {
|
|
3441
|
+
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
3442
|
+
classArr.forEach(function (item) {
|
|
3443
|
+
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, item);
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
|
|
3447
|
+
modalDom.style.display = 'none';
|
|
3448
|
+
PopupManager.modalDom = undefined;
|
|
3449
|
+
}
|
|
3450
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, 'v-modal-leave');
|
|
3451
|
+
}, 200);
|
|
3452
|
+
} else {
|
|
3453
|
+
if (topItem && topItem.modalClass) {
|
|
3454
|
+
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
3455
|
+
classArr.forEach(function (item) {
|
|
3456
|
+
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, item);
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
};
|
|
3462
|
+
|
|
3463
|
+
Object.defineProperty(PopupManager, 'zIndex', {
|
|
3464
|
+
configurable: true,
|
|
3465
|
+
get: function get() {
|
|
3466
|
+
if (!hasInitZIndex) {
|
|
3467
|
+
if (globalScope.__EOSS_ZINDEX__ === undefined) {
|
|
3468
|
+
globalScope.__EOSS_ZINDEX__ = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$EOSS || {}).zIndex || 2000;
|
|
3469
|
+
}
|
|
3470
|
+
hasInitZIndex = true;
|
|
3471
|
+
}
|
|
3472
|
+
return globalScope.__EOSS_ZINDEX__;
|
|
3473
|
+
},
|
|
3474
|
+
set: function set(value) {
|
|
3475
|
+
globalScope.__EOSS_ZINDEX__ = value;
|
|
3476
|
+
}
|
|
3477
|
+
});
|
|
3478
|
+
|
|
3479
|
+
var getTopPopup = function getTopPopup() {
|
|
3480
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
3481
|
+
if (PopupManager.modalStack.length > 0) {
|
|
3482
|
+
var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
3483
|
+
if (!topPopup) return;
|
|
3484
|
+
var instance = PopupManager.getInstance(topPopup.id);
|
|
3485
|
+
|
|
3486
|
+
return instance;
|
|
3487
|
+
}
|
|
3488
|
+
};
|
|
3489
|
+
|
|
3490
|
+
if (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) {
|
|
3491
|
+
// handle `esc` key when the popup is shown
|
|
3492
|
+
window.addEventListener('keydown', function (event) {
|
|
3493
|
+
if (event.keyCode === 27) {
|
|
3494
|
+
var topPopup = getTopPopup();
|
|
3495
|
+
|
|
3496
|
+
if (topPopup && topPopup.closeOnPressEscape) {
|
|
3497
|
+
topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
});
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
/* harmony default export */ __webpack_exports__["a"] = (PopupManager);
|
|
3504
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(45)))
|
|
3505
|
+
|
|
3506
|
+
/***/ }),
|
|
3507
|
+
|
|
3508
|
+
/***/ 110:
|
|
3289
3509
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3290
3510
|
|
|
3291
3511
|
"use strict";
|
|
3292
3512
|
|
|
3293
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=template&id=
|
|
3513
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=template&id=09f0751a&
|
|
3294
3514
|
var render = function () {
|
|
3295
3515
|
var _vm = this
|
|
3296
3516
|
var _h = _vm.$createElement
|
|
@@ -3574,7 +3794,7 @@ var render = function () {
|
|
|
3574
3794
|
"close-icon": _vm.closeIcon,
|
|
3575
3795
|
isFourthTabs: _vm.isFourthTabs,
|
|
3576
3796
|
iconColors: _vm.iconColors,
|
|
3577
|
-
iconColor: _vm.getColor(index),
|
|
3797
|
+
iconColor: _vm.getColor(index, item),
|
|
3578
3798
|
},
|
|
3579
3799
|
},
|
|
3580
3800
|
"component",
|
|
@@ -3597,16 +3817,16 @@ var staticRenderFns = []
|
|
|
3597
3817
|
render._withStripped = true
|
|
3598
3818
|
|
|
3599
3819
|
|
|
3600
|
-
// CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=template&id=
|
|
3820
|
+
// CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=template&id=09f0751a&
|
|
3601
3821
|
|
|
3602
3822
|
// EXTERNAL MODULE: ./src/utils/scrollbar.js
|
|
3603
3823
|
var scrollbar = __webpack_require__(23);
|
|
3604
3824
|
|
|
3605
3825
|
// EXTERNAL MODULE: ./packages/menu/src/mixins.js
|
|
3606
|
-
var mixins = __webpack_require__(
|
|
3826
|
+
var mixins = __webpack_require__(81);
|
|
3607
3827
|
|
|
3608
3828
|
// EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
|
|
3609
|
-
var menu_mixin = __webpack_require__(
|
|
3829
|
+
var menu_mixin = __webpack_require__(68);
|
|
3610
3830
|
|
|
3611
3831
|
// EXTERNAL MODULE: ./src/mixins/emitter.js
|
|
3612
3832
|
var emitter = __webpack_require__(15);
|
|
@@ -3615,13 +3835,13 @@ var emitter = __webpack_require__(15);
|
|
|
3615
3835
|
var vue_popper = __webpack_require__(27);
|
|
3616
3836
|
|
|
3617
3837
|
// EXTERNAL MODULE: ./packages/menu/src/menu-item.vue + 4 modules
|
|
3618
|
-
var menu_item = __webpack_require__(
|
|
3838
|
+
var menu_item = __webpack_require__(61);
|
|
3619
3839
|
|
|
3620
3840
|
// EXTERNAL MODULE: ./packages/menu/src/menu-item-group.vue + 4 modules
|
|
3621
|
-
var menu_item_group = __webpack_require__(
|
|
3841
|
+
var menu_item_group = __webpack_require__(84);
|
|
3622
3842
|
|
|
3623
3843
|
// EXTERNAL MODULE: ./src/transitions/collapse-transition.js
|
|
3624
|
-
var collapse_transition = __webpack_require__(
|
|
3844
|
+
var collapse_transition = __webpack_require__(70);
|
|
3625
3845
|
|
|
3626
3846
|
// EXTERNAL MODULE: external "eoss/lib/icon"
|
|
3627
3847
|
var icon_ = __webpack_require__(26);
|
|
@@ -3947,8 +4167,10 @@ var poperMixins = {
|
|
|
3947
4167
|
return this.collapse ? 'es-zoom-in-left' : 'es-zoom-in-top';
|
|
3948
4168
|
},
|
|
3949
4169
|
opened: function opened() {
|
|
3950
|
-
|
|
3951
|
-
|
|
4170
|
+
// 展开状态统一由 rootMenu.openedMenus 驱动,
|
|
4171
|
+
// open 属性仅作为默认展开的初始值(见 syncOpenProp),不参与计算,
|
|
4172
|
+
// 否则 open 为 true 时会短路导致点击无法折叠
|
|
4173
|
+
return !!this.index && this.rootMenu.openedMenus.indexOf(this.index) > -1;
|
|
3952
4174
|
},
|
|
3953
4175
|
active: function active() {
|
|
3954
4176
|
var isActive = false;
|
|
@@ -4047,6 +4269,15 @@ var poperMixins = {
|
|
|
4047
4269
|
});
|
|
4048
4270
|
}
|
|
4049
4271
|
},
|
|
4272
|
+
open: function open() {
|
|
4273
|
+
this.syncOpenProp();
|
|
4274
|
+
},
|
|
4275
|
+
collapse: function collapse(val) {
|
|
4276
|
+
// 整菜单收起会清空 openedMenus,取消收起后按 open 属性恢复默认展开
|
|
4277
|
+
if (!val) {
|
|
4278
|
+
this.syncOpenProp();
|
|
4279
|
+
}
|
|
4280
|
+
},
|
|
4050
4281
|
iconColors: function iconColors() {
|
|
4051
4282
|
// 当iconColors变化时,清除缓存
|
|
4052
4283
|
this._colorCache = null;
|
|
@@ -4087,6 +4318,28 @@ var poperMixins = {
|
|
|
4087
4318
|
},
|
|
4088
4319
|
|
|
4089
4320
|
methods: {
|
|
4321
|
+
/**
|
|
4322
|
+
* 同步 open 属性到 rootMenu.openedMenus:
|
|
4323
|
+
* open 语义为“默认展开”,写入 openedMenus 后仍可被点击正常折叠/展开
|
|
4324
|
+
*/
|
|
4325
|
+
syncOpenProp: function syncOpenProp() {
|
|
4326
|
+
if (!this.index || this.collapse) {
|
|
4327
|
+
return;
|
|
4328
|
+
}
|
|
4329
|
+
var rootMenu = this.rootMenu;
|
|
4330
|
+
var isOpened = rootMenu.openedMenus.indexOf(this.index) > -1;
|
|
4331
|
+
if (this.open && !isOpened) {
|
|
4332
|
+
// 默认展开直接写入 openedMenus,不走 openMenu 的 uniqueOpened 过滤:
|
|
4333
|
+
// 嵌套子菜单内层先于外层 mounted,若走 openMenu,
|
|
4334
|
+
// 外层展开时会把不在其 indexPath 上的内层默认展开过滤收起
|
|
4335
|
+
rootMenu.openedMenus.push(this.index);
|
|
4336
|
+
rootMenu.$nextTick(function () {
|
|
4337
|
+
return rootMenu.updated();
|
|
4338
|
+
});
|
|
4339
|
+
} else if (!this.open && isOpened) {
|
|
4340
|
+
rootMenu.closeMenu(this.index);
|
|
4341
|
+
}
|
|
4342
|
+
},
|
|
4090
4343
|
handleCollapseToggle: function handleCollapseToggle(value) {
|
|
4091
4344
|
if (value) {
|
|
4092
4345
|
this.initPopper();
|
|
@@ -4194,6 +4447,7 @@ var poperMixins = {
|
|
|
4194
4447
|
this.parentMenu.addSubmenu(this);
|
|
4195
4448
|
this.rootMenu.addSubmenu(this);
|
|
4196
4449
|
this.initPopper();
|
|
4450
|
+
this.syncOpenProp();
|
|
4197
4451
|
},
|
|
4198
4452
|
updated: function updated() {
|
|
4199
4453
|
var _this5 = this;
|
|
@@ -4245,239 +4499,19 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
4245
4499
|
|
|
4246
4500
|
/***/ }),
|
|
4247
4501
|
|
|
4248
|
-
/***/
|
|
4502
|
+
/***/ 12:
|
|
4249
4503
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4250
4504
|
|
|
4251
4505
|
"use strict";
|
|
4252
|
-
/*
|
|
4253
|
-
/* harmony
|
|
4254
|
-
/* harmony
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
// 低代码等场景会用 eoss / eoss/src / eoss/packages 多种身份加载本文件,
|
|
4262
|
-
// 导致出现多份 PopupManager、各自从 2000 起算,出现“后弹出的层级反而比先弹出的小”。
|
|
4263
|
-
// 把计数器挂到全局,所有副本共用同一条单调递增序列。
|
|
4264
|
-
var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
|
4265
|
-
|
|
4266
|
-
var getModal = function getModal() {
|
|
4267
|
-
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
4268
|
-
var modalDom = PopupManager.modalDom;
|
|
4269
|
-
if (modalDom) {
|
|
4270
|
-
hasModal = true;
|
|
4271
|
-
} else {
|
|
4272
|
-
hasModal = false;
|
|
4273
|
-
modalDom = document.createElement('div');
|
|
4274
|
-
PopupManager.modalDom = modalDom;
|
|
4275
|
-
|
|
4276
|
-
modalDom.addEventListener('touchmove', function (event) {
|
|
4277
|
-
event.preventDefault();
|
|
4278
|
-
event.stopPropagation();
|
|
4279
|
-
});
|
|
4280
|
-
|
|
4281
|
-
modalDom.addEventListener('click', function () {
|
|
4282
|
-
PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
|
4283
|
-
});
|
|
4284
|
-
}
|
|
4285
|
-
|
|
4286
|
-
return modalDom;
|
|
4287
|
-
};
|
|
4288
|
-
|
|
4289
|
-
var instances = {};
|
|
4290
|
-
|
|
4291
|
-
var PopupManager = {
|
|
4292
|
-
modalFade: true,
|
|
4293
|
-
|
|
4294
|
-
getInstance: function getInstance(id) {
|
|
4295
|
-
return instances[id];
|
|
4296
|
-
},
|
|
4297
|
-
|
|
4298
|
-
register: function register(id, instance) {
|
|
4299
|
-
if (id && instance) {
|
|
4300
|
-
instances[id] = instance;
|
|
4301
|
-
}
|
|
4302
|
-
},
|
|
4303
|
-
|
|
4304
|
-
deregister: function deregister(id) {
|
|
4305
|
-
if (id) {
|
|
4306
|
-
instances[id] = null;
|
|
4307
|
-
delete instances[id];
|
|
4308
|
-
}
|
|
4309
|
-
},
|
|
4310
|
-
|
|
4311
|
-
nextZIndex: function nextZIndex() {
|
|
4312
|
-
return PopupManager.zIndex++;
|
|
4313
|
-
},
|
|
4314
|
-
|
|
4315
|
-
modalStack: [],
|
|
4316
|
-
|
|
4317
|
-
doOnModalClick: function doOnModalClick() {
|
|
4318
|
-
var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
4319
|
-
if (!topItem) return;
|
|
4320
|
-
|
|
4321
|
-
var instance = PopupManager.getInstance(topItem.id);
|
|
4322
|
-
if (instance && instance.closeOnClickModal) {
|
|
4323
|
-
instance.close();
|
|
4324
|
-
}
|
|
4325
|
-
},
|
|
4326
|
-
|
|
4327
|
-
openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
4328
|
-
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
4329
|
-
if (!id || zIndex === undefined) return;
|
|
4330
|
-
this.modalFade = modalFade;
|
|
4331
|
-
|
|
4332
|
-
var modalStack = this.modalStack;
|
|
4333
|
-
|
|
4334
|
-
for (var i = 0, j = modalStack.length; i < j; i++) {
|
|
4335
|
-
var item = modalStack[i];
|
|
4336
|
-
if (item.id === id) {
|
|
4337
|
-
return;
|
|
4338
|
-
}
|
|
4339
|
-
}
|
|
4340
|
-
|
|
4341
|
-
var modalDom = getModal();
|
|
4342
|
-
|
|
4343
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal');
|
|
4344
|
-
if (this.modalFade && !hasModal) {
|
|
4345
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-enter');
|
|
4346
|
-
}
|
|
4347
|
-
if (modalClass) {
|
|
4348
|
-
var classArr = modalClass.trim().split(/\s+/);
|
|
4349
|
-
classArr.forEach(function (item) {
|
|
4350
|
-
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, item);
|
|
4351
|
-
});
|
|
4352
|
-
}
|
|
4353
|
-
setTimeout(function () {
|
|
4354
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, 'v-modal-enter');
|
|
4355
|
-
}, 200);
|
|
4356
|
-
|
|
4357
|
-
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
|
4358
|
-
dom.parentNode.appendChild(modalDom);
|
|
4359
|
-
} else {
|
|
4360
|
-
document.body.appendChild(modalDom);
|
|
4361
|
-
}
|
|
4362
|
-
|
|
4363
|
-
if (zIndex) {
|
|
4364
|
-
modalDom.style.zIndex = zIndex;
|
|
4365
|
-
}
|
|
4366
|
-
modalDom.tabIndex = 0;
|
|
4367
|
-
modalDom.style.display = '';
|
|
4368
|
-
|
|
4369
|
-
this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
|
|
4370
|
-
},
|
|
4371
|
-
|
|
4372
|
-
closeModal: function closeModal(id) {
|
|
4373
|
-
var modalStack = this.modalStack;
|
|
4374
|
-
var modalDom = getModal();
|
|
4375
|
-
var topItem = null;
|
|
4376
|
-
|
|
4377
|
-
if (modalStack.length > 0) {
|
|
4378
|
-
topItem = modalStack[modalStack.length - 1];
|
|
4379
|
-
if (topItem.id === id) {
|
|
4380
|
-
modalStack.pop();
|
|
4381
|
-
if (modalStack.length > 0) {
|
|
4382
|
-
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
|
|
4383
|
-
}
|
|
4384
|
-
} else {
|
|
4385
|
-
for (var i = modalStack.length - 1; i >= 0; i--) {
|
|
4386
|
-
if (modalStack[i].id === id) {
|
|
4387
|
-
modalStack.splice(i, 1);
|
|
4388
|
-
break;
|
|
4389
|
-
}
|
|
4390
|
-
}
|
|
4391
|
-
}
|
|
4392
|
-
}
|
|
4393
|
-
|
|
4394
|
-
if (modalStack.length === 0) {
|
|
4395
|
-
if (this.modalFade) {
|
|
4396
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-leave');
|
|
4397
|
-
}
|
|
4398
|
-
setTimeout(function () {
|
|
4399
|
-
if (modalStack.length === 0) {
|
|
4400
|
-
if (topItem && topItem.modalClass) {
|
|
4401
|
-
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
4402
|
-
classArr.forEach(function (item) {
|
|
4403
|
-
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, item);
|
|
4404
|
-
});
|
|
4405
|
-
}
|
|
4406
|
-
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
|
|
4407
|
-
modalDom.style.display = 'none';
|
|
4408
|
-
PopupManager.modalDom = undefined;
|
|
4409
|
-
}
|
|
4410
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, 'v-modal-leave');
|
|
4411
|
-
}, 200);
|
|
4412
|
-
} else {
|
|
4413
|
-
if (topItem && topItem.modalClass) {
|
|
4414
|
-
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
4415
|
-
classArr.forEach(function (item) {
|
|
4416
|
-
return Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "i"])(modalDom, item);
|
|
4417
|
-
});
|
|
4418
|
-
}
|
|
4419
|
-
}
|
|
4420
|
-
}
|
|
4421
|
-
};
|
|
4422
|
-
|
|
4423
|
-
Object.defineProperty(PopupManager, 'zIndex', {
|
|
4424
|
-
configurable: true,
|
|
4425
|
-
get: function get() {
|
|
4426
|
-
if (!hasInitZIndex) {
|
|
4427
|
-
if (globalScope.__EOSS_ZINDEX__ === undefined) {
|
|
4428
|
-
globalScope.__EOSS_ZINDEX__ = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$EOSS || {}).zIndex || 2000;
|
|
4429
|
-
}
|
|
4430
|
-
hasInitZIndex = true;
|
|
4431
|
-
}
|
|
4432
|
-
return globalScope.__EOSS_ZINDEX__;
|
|
4433
|
-
},
|
|
4434
|
-
set: function set(value) {
|
|
4435
|
-
globalScope.__EOSS_ZINDEX__ = value;
|
|
4436
|
-
}
|
|
4437
|
-
});
|
|
4438
|
-
|
|
4439
|
-
var getTopPopup = function getTopPopup() {
|
|
4440
|
-
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
4441
|
-
if (PopupManager.modalStack.length > 0) {
|
|
4442
|
-
var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
4443
|
-
if (!topPopup) return;
|
|
4444
|
-
var instance = PopupManager.getInstance(topPopup.id);
|
|
4445
|
-
|
|
4446
|
-
return instance;
|
|
4447
|
-
}
|
|
4448
|
-
};
|
|
4449
|
-
|
|
4450
|
-
if (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) {
|
|
4451
|
-
// handle `esc` key when the popup is shown
|
|
4452
|
-
window.addEventListener('keydown', function (event) {
|
|
4453
|
-
if (event.keyCode === 27) {
|
|
4454
|
-
var topPopup = getTopPopup();
|
|
4455
|
-
|
|
4456
|
-
if (topPopup && topPopup.closeOnPressEscape) {
|
|
4457
|
-
topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
|
|
4458
|
-
}
|
|
4459
|
-
}
|
|
4460
|
-
});
|
|
4461
|
-
}
|
|
4462
|
-
|
|
4463
|
-
/* harmony default export */ __webpack_exports__["a"] = (PopupManager);
|
|
4464
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(45)))
|
|
4465
|
-
|
|
4466
|
-
/***/ }),
|
|
4467
|
-
|
|
4468
|
-
/***/ 12:
|
|
4469
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4470
|
-
|
|
4471
|
-
"use strict";
|
|
4472
|
-
/* unused harmony export getHue */
|
|
4473
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
4474
|
-
/* unused harmony export getLightness */
|
|
4475
|
-
/* unused harmony export getSaturation */
|
|
4476
|
-
/* unused harmony export rgbToHsv */
|
|
4477
|
-
/* unused harmony export hsvTorgb */
|
|
4478
|
-
/* unused harmony export mixColor */
|
|
4479
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
4480
|
-
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
4506
|
+
/* unused harmony export getHue */
|
|
4507
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
4508
|
+
/* unused harmony export getLightness */
|
|
4509
|
+
/* unused harmony export getSaturation */
|
|
4510
|
+
/* unused harmony export rgbToHsv */
|
|
4511
|
+
/* unused harmony export hsvTorgb */
|
|
4512
|
+
/* unused harmony export mixColor */
|
|
4513
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
4514
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
4481
4515
|
|
|
4482
4516
|
var $hueStep = 2;
|
|
4483
4517
|
var $saturationStep1 = 0.16;
|
|
@@ -4741,7 +4775,7 @@ module.exports = require("vue");
|
|
|
4741
4775
|
|
|
4742
4776
|
/***/ }),
|
|
4743
4777
|
|
|
4744
|
-
/***/
|
|
4778
|
+
/***/ 213:
|
|
4745
4779
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4746
4780
|
|
|
4747
4781
|
"use strict";
|
|
@@ -4850,19 +4884,19 @@ menuvue_type_template_id_31887554_render._withStripped = true
|
|
|
4850
4884
|
// CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=template&id=31887554&
|
|
4851
4885
|
|
|
4852
4886
|
// EXTERNAL MODULE: ./packages/menu/src/mixins.js
|
|
4853
|
-
var mixins = __webpack_require__(
|
|
4887
|
+
var mixins = __webpack_require__(81);
|
|
4854
4888
|
|
|
4855
4889
|
// EXTERNAL MODULE: ./packages/menu/src/submenu.vue + 4 modules
|
|
4856
|
-
var submenu = __webpack_require__(
|
|
4890
|
+
var submenu = __webpack_require__(110);
|
|
4857
4891
|
|
|
4858
4892
|
// EXTERNAL MODULE: ./packages/menu/src/menu-item.vue + 4 modules
|
|
4859
|
-
var menu_item = __webpack_require__(
|
|
4893
|
+
var menu_item = __webpack_require__(61);
|
|
4860
4894
|
|
|
4861
4895
|
// EXTERNAL MODULE: ./src/components/bar.js
|
|
4862
|
-
var bar = __webpack_require__(
|
|
4896
|
+
var bar = __webpack_require__(59);
|
|
4863
4897
|
|
|
4864
4898
|
// EXTERNAL MODULE: ./packages/menu/src/menu-item-group.vue + 4 modules
|
|
4865
|
-
var menu_item_group = __webpack_require__(
|
|
4899
|
+
var menu_item_group = __webpack_require__(84);
|
|
4866
4900
|
|
|
4867
4901
|
// EXTERNAL MODULE: ./src/mixins/emitter.js
|
|
4868
4902
|
var emitter = __webpack_require__(15);
|
|
@@ -4871,7 +4905,7 @@ var emitter = __webpack_require__(15);
|
|
|
4871
4905
|
var migrating = __webpack_require__(46);
|
|
4872
4906
|
|
|
4873
4907
|
// EXTERNAL MODULE: ./src/utils/aria-utils.js
|
|
4874
|
-
var aria_utils = __webpack_require__(
|
|
4908
|
+
var aria_utils = __webpack_require__(62);
|
|
4875
4909
|
|
|
4876
4910
|
// CONCATENATED MODULE: ./src/utils/menu/aria-submenu.js
|
|
4877
4911
|
|
|
@@ -5909,7 +5943,7 @@ module.exports = require("eoss/lib/icon");
|
|
|
5909
5943
|
|
|
5910
5944
|
|
|
5911
5945
|
|
|
5912
|
-
var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(
|
|
5946
|
+
var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(53);
|
|
5913
5947
|
var stopPropagation = function stopPropagation(e) {
|
|
5914
5948
|
return e.stopPropagation();
|
|
5915
5949
|
};
|
|
@@ -6955,10 +6989,12 @@ function insertAfter(newEl, targetEl) {
|
|
|
6955
6989
|
|
|
6956
6990
|
/***/ }),
|
|
6957
6991
|
|
|
6958
|
-
/***/
|
|
6992
|
+
/***/ 53:
|
|
6959
6993
|
/***/ (function(module, exports, __webpack_require__) {
|
|
6960
6994
|
|
|
6961
|
-
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__
|
|
6995
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
6996
|
+
|
|
6997
|
+
/**
|
|
6962
6998
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
6963
6999
|
* @version {{version}}
|
|
6964
7000
|
* @license
|
|
@@ -6981,68 +7017,60 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
6981
7017
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
6982
7018
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
6983
7019
|
* SOFTWARE.
|
|
6984
|
-
*/
|
|
6985
|
-
|
|
6986
|
-
//
|
|
6987
|
-
// Cross module loader
|
|
6988
|
-
// Supported: Node, AMD, Browser globals
|
|
6989
|
-
//
|
|
6990
|
-
(function (root, factory) {
|
|
6991
|
-
if (true) {
|
|
6992
|
-
// AMD. Register as an anonymous module.
|
|
7020
|
+
*/
|
|
7021
|
+
|
|
7022
|
+
//
|
|
7023
|
+
// Cross module loader
|
|
7024
|
+
// Supported: Node, AMD, Browser globals
|
|
7025
|
+
//
|
|
7026
|
+
(function (root, factory) {
|
|
7027
|
+
if (true) {
|
|
7028
|
+
// AMD. Register as an anonymous module.
|
|
6993
7029
|
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
6994
7030
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
6995
7031
|
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
|
|
6996
7032
|
__WEBPACK_AMD_DEFINE_FACTORY__),
|
|
6997
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
6998
|
-
} else {}
|
|
6999
|
-
})(this, function () {
|
|
7000
|
-
'use strict';
|
|
7001
|
-
|
|
7002
|
-
var root =
|
|
7003
|
-
// default options
|
|
7004
|
-
var DEFAULTS = {
|
|
7005
|
-
// placement of the popper
|
|
7006
|
-
placement: 'bottom',
|
|
7007
|
-
|
|
7008
|
-
gpuAcceleration: true,
|
|
7009
|
-
|
|
7010
|
-
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
7011
|
-
offset: 0,
|
|
7012
|
-
|
|
7013
|
-
// the element which will act as boundary of the popper
|
|
7014
|
-
boundariesElement: 'viewport',
|
|
7015
|
-
|
|
7016
|
-
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
7017
|
-
boundariesPadding: 5,
|
|
7018
|
-
|
|
7019
|
-
// popper will try to prevent overflow following this order,
|
|
7020
|
-
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
7021
|
-
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
7022
|
-
|
|
7023
|
-
// the behavior used by flip to change the placement of the popper
|
|
7024
|
-
flipBehavior: 'flip',
|
|
7025
|
-
|
|
7026
|
-
arrowElement: '[x-arrow]',
|
|
7027
|
-
|
|
7028
|
-
arrowOffset: 0,
|
|
7029
|
-
|
|
7030
|
-
// list of functions used to modify the offsets before they are applied to the popper
|
|
7031
|
-
modifiers: [
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
'applyStyle'
|
|
7039
|
-
],
|
|
7040
|
-
|
|
7041
|
-
modifiersIgnored: [],
|
|
7042
|
-
|
|
7043
|
-
forceAbsolute: false
|
|
7044
|
-
};
|
|
7045
|
-
|
|
7033
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
7034
|
+
} else {}
|
|
7035
|
+
})(this, function () {
|
|
7036
|
+
'use strict';
|
|
7037
|
+
|
|
7038
|
+
var root = window;
|
|
7039
|
+
// default options
|
|
7040
|
+
var DEFAULTS = {
|
|
7041
|
+
// placement of the popper
|
|
7042
|
+
placement: 'bottom',
|
|
7043
|
+
|
|
7044
|
+
gpuAcceleration: true,
|
|
7045
|
+
|
|
7046
|
+
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
7047
|
+
offset: 0,
|
|
7048
|
+
|
|
7049
|
+
// the element which will act as boundary of the popper
|
|
7050
|
+
boundariesElement: 'viewport',
|
|
7051
|
+
|
|
7052
|
+
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
7053
|
+
boundariesPadding: 5,
|
|
7054
|
+
|
|
7055
|
+
// popper will try to prevent overflow following this order,
|
|
7056
|
+
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
7057
|
+
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
7058
|
+
|
|
7059
|
+
// the behavior used by flip to change the placement of the popper
|
|
7060
|
+
flipBehavior: 'flip',
|
|
7061
|
+
|
|
7062
|
+
arrowElement: '[x-arrow]',
|
|
7063
|
+
|
|
7064
|
+
arrowOffset: 0,
|
|
7065
|
+
|
|
7066
|
+
// list of functions used to modify the offsets before they are applied to the popper
|
|
7067
|
+
modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
|
|
7068
|
+
|
|
7069
|
+
modifiersIgnored: [],
|
|
7070
|
+
|
|
7071
|
+
forceAbsolute: false
|
|
7072
|
+
};
|
|
7073
|
+
|
|
7046
7074
|
/**
|
|
7047
7075
|
* Create a new Popper.js instance
|
|
7048
7076
|
* @constructor Popper
|
|
@@ -7107,125 +7135,114 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7107
7135
|
*
|
|
7108
7136
|
* @param {Boolean} [options.removeOnDestroy=false]
|
|
7109
7137
|
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
|
|
7110
|
-
*/
|
|
7111
|
-
function Popper(reference, popper, options) {
|
|
7112
|
-
this._reference = reference.jquery ? reference[0] : reference;
|
|
7113
|
-
this.state = {};
|
|
7114
|
-
|
|
7115
|
-
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
7116
|
-
// generate a default popper if is not defined
|
|
7117
|
-
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
7118
|
-
var isConfig =
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
);
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
//
|
|
7153
|
-
this.
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
//
|
|
7161
|
-
// Methods
|
|
7162
|
-
//
|
|
7138
|
+
*/
|
|
7139
|
+
function Popper(reference, popper, options) {
|
|
7140
|
+
this._reference = reference.jquery ? reference[0] : reference;
|
|
7141
|
+
this.state = {};
|
|
7142
|
+
|
|
7143
|
+
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
7144
|
+
// generate a default popper if is not defined
|
|
7145
|
+
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
7146
|
+
var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
|
|
7147
|
+
if (isNotDefined || isConfig) {
|
|
7148
|
+
this._popper = this.parse(isConfig ? popper : {});
|
|
7149
|
+
}
|
|
7150
|
+
// otherwise, use the given HTMLElement as popper
|
|
7151
|
+
else {
|
|
7152
|
+
this._popper = popper.jquery ? popper[0] : popper;
|
|
7153
|
+
}
|
|
7154
|
+
|
|
7155
|
+
// with {} we create a new object with the options inside it
|
|
7156
|
+
this._options = Object.assign({}, DEFAULTS, options);
|
|
7157
|
+
|
|
7158
|
+
// refactoring modifiers' list
|
|
7159
|
+
this._options.modifiers = this._options.modifiers.map(function (modifier) {
|
|
7160
|
+
// remove ignored modifiers
|
|
7161
|
+
if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
|
7162
|
+
|
|
7163
|
+
// set the x-placement attribute before everything else because it could be used to add margins to the popper
|
|
7164
|
+
// margins needs to be calculated to get the correct popper offsets
|
|
7165
|
+
if (modifier === 'applyStyle') {
|
|
7166
|
+
this._popper.setAttribute('x-placement', this._options.placement);
|
|
7167
|
+
}
|
|
7168
|
+
|
|
7169
|
+
// return predefined modifier identified by string or keep the custom one
|
|
7170
|
+
return this.modifiers[modifier] || modifier;
|
|
7171
|
+
}.bind(this));
|
|
7172
|
+
|
|
7173
|
+
// make sure to apply the popper position before any computation
|
|
7174
|
+
this.state.position = this._getPosition(this._popper, this._reference);
|
|
7175
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
7176
|
+
|
|
7177
|
+
// fire the first update to position the popper in the right place
|
|
7178
|
+
this.update();
|
|
7179
|
+
|
|
7180
|
+
// setup event listeners, they will take care of update the position in specific situations
|
|
7181
|
+
this._setupEventListeners();
|
|
7182
|
+
return this;
|
|
7183
|
+
}
|
|
7184
|
+
|
|
7185
|
+
//
|
|
7186
|
+
// Methods
|
|
7187
|
+
//
|
|
7163
7188
|
/**
|
|
7164
7189
|
* Destroy the popper
|
|
7165
7190
|
* @method
|
|
7166
7191
|
* @memberof Popper
|
|
7167
|
-
*/
|
|
7168
|
-
Popper.prototype.destroy = function () {
|
|
7169
|
-
this._popper.removeAttribute('x-placement');
|
|
7170
|
-
this._popper.style.left = '';
|
|
7171
|
-
this._popper.style.position = '';
|
|
7172
|
-
this._popper.style.top = '';
|
|
7173
|
-
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
7174
|
-
this._removeEventListeners();
|
|
7175
|
-
|
|
7176
|
-
// remove the popper if user explicity asked for the deletion on destroy
|
|
7177
|
-
if (this._options.removeOnDestroy) {
|
|
7178
|
-
this._popper.remove();
|
|
7179
|
-
}
|
|
7180
|
-
return this;
|
|
7181
|
-
};
|
|
7182
|
-
|
|
7192
|
+
*/
|
|
7193
|
+
Popper.prototype.destroy = function () {
|
|
7194
|
+
this._popper.removeAttribute('x-placement');
|
|
7195
|
+
this._popper.style.left = '';
|
|
7196
|
+
this._popper.style.position = '';
|
|
7197
|
+
this._popper.style.top = '';
|
|
7198
|
+
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
7199
|
+
this._removeEventListeners();
|
|
7200
|
+
|
|
7201
|
+
// remove the popper if user explicity asked for the deletion on destroy
|
|
7202
|
+
if (this._options.removeOnDestroy) {
|
|
7203
|
+
this._popper.remove();
|
|
7204
|
+
}
|
|
7205
|
+
return this;
|
|
7206
|
+
};
|
|
7207
|
+
|
|
7183
7208
|
/**
|
|
7184
7209
|
* Updates the position of the popper, computing the new offsets and applying the new style
|
|
7185
7210
|
* @method
|
|
7186
7211
|
* @memberof Popper
|
|
7187
|
-
*/
|
|
7188
|
-
Popper.prototype.update = function () {
|
|
7189
|
-
var data = { instance: this, styles: {} };
|
|
7190
|
-
|
|
7191
|
-
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
7192
|
-
// and refer to _originalPlacement to know the original value
|
|
7193
|
-
data.placement = this._options.placement;
|
|
7194
|
-
data._originalPlacement = this._options.placement;
|
|
7195
|
-
|
|
7196
|
-
// compute the popper and reference offsets and put them inside data.offsets
|
|
7197
|
-
data.offsets = this._getOffsets(
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
data
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
this.state.updateCallback(data);
|
|
7214
|
-
}
|
|
7215
|
-
};
|
|
7216
|
-
|
|
7217
|
-
/**
|
|
7218
|
-
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
7219
|
-
* @method
|
|
7220
|
-
* @memberof Popper
|
|
7212
|
+
*/
|
|
7213
|
+
Popper.prototype.update = function () {
|
|
7214
|
+
var data = { instance: this, styles: {} };
|
|
7215
|
+
|
|
7216
|
+
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
7217
|
+
// and refer to _originalPlacement to know the original value
|
|
7218
|
+
data.placement = this._options.placement;
|
|
7219
|
+
data._originalPlacement = this._options.placement;
|
|
7220
|
+
|
|
7221
|
+
// compute the popper and reference offsets and put them inside data.offsets
|
|
7222
|
+
data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
|
7223
|
+
|
|
7224
|
+
// get boundaries
|
|
7225
|
+
data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
|
|
7226
|
+
|
|
7227
|
+
data = this.runModifiers(data, this._options.modifiers);
|
|
7228
|
+
|
|
7229
|
+
if (typeof this.state.updateCallback === 'function') {
|
|
7230
|
+
this.state.updateCallback(data);
|
|
7231
|
+
}
|
|
7232
|
+
};
|
|
7233
|
+
|
|
7234
|
+
/**
|
|
7235
|
+
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
7236
|
+
* @method
|
|
7237
|
+
* @memberof Popper
|
|
7221
7238
|
* @param {Function} callback
|
|
7222
|
-
*/
|
|
7223
|
-
Popper.prototype.onCreate = function (callback) {
|
|
7224
|
-
// the createCallbacks return as first argument the popper instance
|
|
7225
|
-
callback(this);
|
|
7226
|
-
return this;
|
|
7227
|
-
};
|
|
7228
|
-
|
|
7239
|
+
*/
|
|
7240
|
+
Popper.prototype.onCreate = function (callback) {
|
|
7241
|
+
// the createCallbacks return as first argument the popper instance
|
|
7242
|
+
callback(this);
|
|
7243
|
+
return this;
|
|
7244
|
+
};
|
|
7245
|
+
|
|
7229
7246
|
/**
|
|
7230
7247
|
* If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
|
|
7231
7248
|
* used to style popper and its arrow.
|
|
@@ -7233,101 +7250,93 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7233
7250
|
* @method
|
|
7234
7251
|
* @memberof Popper
|
|
7235
7252
|
* @param {Function} callback
|
|
7236
|
-
*/
|
|
7237
|
-
Popper.prototype.onUpdate = function (callback) {
|
|
7238
|
-
this.state.updateCallback = callback;
|
|
7239
|
-
return this;
|
|
7240
|
-
};
|
|
7241
|
-
|
|
7253
|
+
*/
|
|
7254
|
+
Popper.prototype.onUpdate = function (callback) {
|
|
7255
|
+
this.state.updateCallback = callback;
|
|
7256
|
+
return this;
|
|
7257
|
+
};
|
|
7258
|
+
|
|
7242
7259
|
/**
|
|
7243
7260
|
* Helper used to generate poppers from a configuration file
|
|
7244
7261
|
* @method
|
|
7245
7262
|
* @memberof Popper
|
|
7246
7263
|
* @param config {Object} configuration
|
|
7247
7264
|
* @returns {HTMLElement} popper
|
|
7248
|
-
*/
|
|
7249
|
-
Popper.prototype.parse = function (config) {
|
|
7250
|
-
var defaultConfig = {
|
|
7251
|
-
tagName: 'div',
|
|
7252
|
-
classNames: ['popper'],
|
|
7253
|
-
attributes: [],
|
|
7254
|
-
parent: root.document.body,
|
|
7255
|
-
content: '',
|
|
7256
|
-
contentType: 'text',
|
|
7257
|
-
arrowTagName: 'div',
|
|
7258
|
-
arrowClassNames: ['popper__arrow'],
|
|
7259
|
-
arrowAttributes: ['x-arrow']
|
|
7260
|
-
};
|
|
7261
|
-
config = Object.assign({}, defaultConfig, config);
|
|
7262
|
-
|
|
7263
|
-
var d = root.document;
|
|
7264
|
-
|
|
7265
|
-
var popper = d.createElement(config.tagName);
|
|
7266
|
-
addClassNames(popper, config.classNames);
|
|
7267
|
-
addAttributes(popper, config.attributes);
|
|
7268
|
-
if (config.contentType === 'node') {
|
|
7269
|
-
popper.appendChild(
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
} else
|
|
7273
|
-
popper.
|
|
7274
|
-
}
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
// if
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
parent = parent[0];
|
|
7303
|
-
}
|
|
7304
|
-
|
|
7305
|
-
// the
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
parent = parent[0];
|
|
7311
|
-
}
|
|
7312
|
-
|
|
7313
|
-
// append the generated popper to its parent
|
|
7314
|
-
parent.appendChild(popper);
|
|
7315
|
-
|
|
7316
|
-
return popper;
|
|
7317
|
-
|
|
7265
|
+
*/
|
|
7266
|
+
Popper.prototype.parse = function (config) {
|
|
7267
|
+
var defaultConfig = {
|
|
7268
|
+
tagName: 'div',
|
|
7269
|
+
classNames: ['popper'],
|
|
7270
|
+
attributes: [],
|
|
7271
|
+
parent: root.document.body,
|
|
7272
|
+
content: '',
|
|
7273
|
+
contentType: 'text',
|
|
7274
|
+
arrowTagName: 'div',
|
|
7275
|
+
arrowClassNames: ['popper__arrow'],
|
|
7276
|
+
arrowAttributes: ['x-arrow']
|
|
7277
|
+
};
|
|
7278
|
+
config = Object.assign({}, defaultConfig, config);
|
|
7279
|
+
|
|
7280
|
+
var d = root.document;
|
|
7281
|
+
|
|
7282
|
+
var popper = d.createElement(config.tagName);
|
|
7283
|
+
addClassNames(popper, config.classNames);
|
|
7284
|
+
addAttributes(popper, config.attributes);
|
|
7285
|
+
if (config.contentType === 'node') {
|
|
7286
|
+
popper.appendChild(config.content.jquery ? config.content[0] : config.content);
|
|
7287
|
+
} else if (config.contentType === 'html') {
|
|
7288
|
+
popper.innerHTML = config.content;
|
|
7289
|
+
} else {
|
|
7290
|
+
popper.textContent = config.content;
|
|
7291
|
+
}
|
|
7292
|
+
|
|
7293
|
+
if (config.arrowTagName) {
|
|
7294
|
+
var arrow = d.createElement(config.arrowTagName);
|
|
7295
|
+
addClassNames(arrow, config.arrowClassNames);
|
|
7296
|
+
addAttributes(arrow, config.arrowAttributes);
|
|
7297
|
+
popper.appendChild(arrow);
|
|
7298
|
+
}
|
|
7299
|
+
|
|
7300
|
+
var parent = config.parent.jquery ? config.parent[0] : config.parent;
|
|
7301
|
+
|
|
7302
|
+
// if the given parent is a string, use it to match an element
|
|
7303
|
+
// if more than one element is matched, the first one will be used as parent
|
|
7304
|
+
// if no elements are matched, the script will throw an error
|
|
7305
|
+
if (typeof parent === 'string') {
|
|
7306
|
+
parent = d.querySelectorAll(config.parent);
|
|
7307
|
+
if (parent.length > 1) {
|
|
7308
|
+
console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
|
|
7309
|
+
}
|
|
7310
|
+
if (parent.length === 0) {
|
|
7311
|
+
throw "ERROR: the given `parent` doesn't exists!";
|
|
7312
|
+
}
|
|
7313
|
+
parent = parent[0];
|
|
7314
|
+
}
|
|
7315
|
+
// if the given parent is a DOM nodes list or an array of nodes with more than one element,
|
|
7316
|
+
// the first one will be used as parent
|
|
7317
|
+
if (parent.length > 1 && parent instanceof Element === false) {
|
|
7318
|
+
console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
|
|
7319
|
+
parent = parent[0];
|
|
7320
|
+
}
|
|
7321
|
+
|
|
7322
|
+
// append the generated popper to its parent
|
|
7323
|
+
parent.appendChild(popper);
|
|
7324
|
+
|
|
7325
|
+
return popper;
|
|
7326
|
+
|
|
7318
7327
|
/**
|
|
7319
7328
|
* Adds class names to the given element
|
|
7320
7329
|
* @function
|
|
7321
7330
|
* @ignore
|
|
7322
7331
|
* @param {HTMLElement} target
|
|
7323
7332
|
* @param {Array} classes
|
|
7324
|
-
*/
|
|
7325
|
-
function addClassNames(element, classNames) {
|
|
7326
|
-
classNames.forEach(function (className) {
|
|
7327
|
-
element.classList.add(className);
|
|
7328
|
-
});
|
|
7329
|
-
}
|
|
7330
|
-
|
|
7333
|
+
*/
|
|
7334
|
+
function addClassNames(element, classNames) {
|
|
7335
|
+
classNames.forEach(function (className) {
|
|
7336
|
+
element.classList.add(className);
|
|
7337
|
+
});
|
|
7338
|
+
}
|
|
7339
|
+
|
|
7331
7340
|
/**
|
|
7332
7341
|
* Adds attributes to the given element
|
|
7333
7342
|
* @function
|
|
@@ -7336,17 +7345,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7336
7345
|
* @param {Array} attributes
|
|
7337
7346
|
* @example
|
|
7338
7347
|
* addAttributes(element, [ 'data-info:foobar' ]);
|
|
7339
|
-
*/
|
|
7340
|
-
function addAttributes(element, attributes) {
|
|
7341
|
-
attributes.forEach(function (attribute) {
|
|
7342
|
-
element.setAttribute(
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
}
|
|
7348
|
-
};
|
|
7349
|
-
|
|
7348
|
+
*/
|
|
7349
|
+
function addAttributes(element, attributes) {
|
|
7350
|
+
attributes.forEach(function (attribute) {
|
|
7351
|
+
element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
|
|
7352
|
+
});
|
|
7353
|
+
}
|
|
7354
|
+
};
|
|
7355
|
+
|
|
7350
7356
|
/**
|
|
7351
7357
|
* Helper used to get the position which will be applied to the popper
|
|
7352
7358
|
* @method
|
|
@@ -7354,20 +7360,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7354
7360
|
* @param config {HTMLElement} popper element
|
|
7355
7361
|
* @param reference {HTMLElement} reference element
|
|
7356
7362
|
* @returns {String} position
|
|
7357
|
-
*/
|
|
7358
|
-
Popper.prototype._getPosition = function (popper, reference) {
|
|
7359
|
-
var container = getOffsetParent(reference);
|
|
7360
|
-
|
|
7361
|
-
if (this._options.forceAbsolute) {
|
|
7362
|
-
return 'absolute';
|
|
7363
|
-
}
|
|
7364
|
-
|
|
7365
|
-
// Decide if the popper will be fixed
|
|
7366
|
-
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
7367
|
-
var isParentFixed = isFixed(reference, container);
|
|
7368
|
-
return isParentFixed ? 'fixed' : 'absolute';
|
|
7369
|
-
};
|
|
7370
|
-
|
|
7363
|
+
*/
|
|
7364
|
+
Popper.prototype._getPosition = function (popper, reference) {
|
|
7365
|
+
var container = getOffsetParent(reference);
|
|
7366
|
+
|
|
7367
|
+
if (this._options.forceAbsolute) {
|
|
7368
|
+
return 'absolute';
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7371
|
+
// Decide if the popper will be fixed
|
|
7372
|
+
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
7373
|
+
var isParentFixed = isFixed(reference, container);
|
|
7374
|
+
return isParentFixed ? 'fixed' : 'absolute';
|
|
7375
|
+
};
|
|
7376
|
+
|
|
7371
7377
|
/**
|
|
7372
7378
|
* Get offsets to the popper
|
|
7373
7379
|
* @method
|
|
@@ -7376,110 +7382,91 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7376
7382
|
* @param {Element} popper - the popper element
|
|
7377
7383
|
* @param {Element} reference - the reference element (the popper will be relative to this)
|
|
7378
7384
|
* @returns {Object} An object containing the offsets which will be applied to the popper
|
|
7379
|
-
*/
|
|
7380
|
-
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
7381
|
-
placement = placement.split('-')[0];
|
|
7382
|
-
var popperOffsets = {};
|
|
7383
|
-
|
|
7384
|
-
popperOffsets.position = this.state.position;
|
|
7385
|
-
var isParentFixed = popperOffsets.position === 'fixed';
|
|
7386
|
-
|
|
7387
|
-
//
|
|
7388
|
-
// Get reference element position
|
|
7389
|
-
//
|
|
7390
|
-
var referenceOffsets = getOffsetRectRelativeToCustomParent(
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
//
|
|
7398
|
-
//
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
//
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
if (placement === '
|
|
7412
|
-
popperOffsets.
|
|
7413
|
-
} else {
|
|
7414
|
-
popperOffsets.
|
|
7415
|
-
}
|
|
7416
|
-
}
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
// Add width and height to our offsets object
|
|
7429
|
-
popperOffsets.width = popperRect.width;
|
|
7430
|
-
popperOffsets.height = popperRect.height;
|
|
7431
|
-
|
|
7432
|
-
return {
|
|
7433
|
-
popper: popperOffsets,
|
|
7434
|
-
reference: referenceOffsets
|
|
7435
|
-
};
|
|
7436
|
-
};
|
|
7437
|
-
|
|
7385
|
+
*/
|
|
7386
|
+
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
7387
|
+
placement = placement.split('-')[0];
|
|
7388
|
+
var popperOffsets = {};
|
|
7389
|
+
|
|
7390
|
+
popperOffsets.position = this.state.position;
|
|
7391
|
+
var isParentFixed = popperOffsets.position === 'fixed';
|
|
7392
|
+
|
|
7393
|
+
//
|
|
7394
|
+
// Get reference element position
|
|
7395
|
+
//
|
|
7396
|
+
var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, popper, isParentFixed);
|
|
7397
|
+
|
|
7398
|
+
//
|
|
7399
|
+
// Get popper sizes
|
|
7400
|
+
//
|
|
7401
|
+
var popperRect = getOuterSizes(popper);
|
|
7402
|
+
|
|
7403
|
+
//
|
|
7404
|
+
// Compute offsets of popper
|
|
7405
|
+
//
|
|
7406
|
+
|
|
7407
|
+
// depending by the popper placement we have to compute its offsets slightly differently
|
|
7408
|
+
if (['right', 'left'].indexOf(placement) !== -1) {
|
|
7409
|
+
popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
|
|
7410
|
+
if (placement === 'left') {
|
|
7411
|
+
popperOffsets.left = referenceOffsets.left - popperRect.width;
|
|
7412
|
+
} else {
|
|
7413
|
+
popperOffsets.left = referenceOffsets.right;
|
|
7414
|
+
}
|
|
7415
|
+
} else {
|
|
7416
|
+
popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
|
|
7417
|
+
if (placement === 'top') {
|
|
7418
|
+
popperOffsets.top = referenceOffsets.top - popperRect.height;
|
|
7419
|
+
} else {
|
|
7420
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
7421
|
+
}
|
|
7422
|
+
}
|
|
7423
|
+
|
|
7424
|
+
// Add width and height to our offsets object
|
|
7425
|
+
popperOffsets.width = popperRect.width;
|
|
7426
|
+
popperOffsets.height = popperRect.height;
|
|
7427
|
+
|
|
7428
|
+
return {
|
|
7429
|
+
popper: popperOffsets,
|
|
7430
|
+
reference: referenceOffsets
|
|
7431
|
+
};
|
|
7432
|
+
};
|
|
7433
|
+
|
|
7438
7434
|
/**
|
|
7439
7435
|
* Setup needed event listeners used to update the popper position
|
|
7440
7436
|
* @method
|
|
7441
7437
|
* @memberof Popper
|
|
7442
7438
|
* @access private
|
|
7443
|
-
*/
|
|
7444
|
-
Popper.prototype._setupEventListeners = function () {
|
|
7445
|
-
// NOTE: 1 DOM access here
|
|
7446
|
-
this.state.updateBound = this.update.bind(this);
|
|
7447
|
-
// 无界等微前端场景下沙箱 window 不会触发 resize,需监听真实 window
|
|
7448
|
-
this.state.realWindow = getRealWindow(this._popper);
|
|
7449
|
-
this.state.realWindow.addEventListener('resize', this.state.updateBound);
|
|
7450
|
-
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
7451
|
-
if (this._options.boundariesElement !== 'window') {
|
|
7452
|
-
var target = getScrollParent(this._reference);
|
|
7453
|
-
target.addEventListener('scroll', this.state.updateBound);
|
|
7454
|
-
this.state.scrollTarget = target;
|
|
7455
|
-
}
|
|
7456
|
-
};
|
|
7457
|
-
|
|
7439
|
+
*/
|
|
7440
|
+
Popper.prototype._setupEventListeners = function () {
|
|
7441
|
+
// NOTE: 1 DOM access here
|
|
7442
|
+
this.state.updateBound = this.update.bind(this);
|
|
7443
|
+
// 无界等微前端场景下沙箱 window 不会触发 resize,需监听真实 window
|
|
7444
|
+
this.state.realWindow = getRealWindow(this._popper);
|
|
7445
|
+
this.state.realWindow.addEventListener('resize', this.state.updateBound);
|
|
7446
|
+
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
7447
|
+
if (this._options.boundariesElement !== 'window') {
|
|
7448
|
+
var target = getScrollParent(this._reference);
|
|
7449
|
+
target.addEventListener('scroll', this.state.updateBound);
|
|
7450
|
+
this.state.scrollTarget = target;
|
|
7451
|
+
}
|
|
7452
|
+
};
|
|
7453
|
+
|
|
7458
7454
|
/**
|
|
7459
7455
|
* Remove event listeners used to update the popper position
|
|
7460
7456
|
* @method
|
|
7461
7457
|
* @memberof Popper
|
|
7462
7458
|
* @access private
|
|
7463
|
-
*/
|
|
7464
|
-
Popper.prototype._removeEventListeners = function () {
|
|
7465
|
-
// NOTE: 1 DOM access here
|
|
7466
|
-
(this.state.realWindow || root).removeEventListener(
|
|
7467
|
-
|
|
7468
|
-
this.state.updateBound
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
this.state.scrollTarget.removeEventListener(
|
|
7475
|
-
'scroll',
|
|
7476
|
-
this.state.updateBound
|
|
7477
|
-
);
|
|
7478
|
-
this.state.scrollTarget = null;
|
|
7479
|
-
}
|
|
7480
|
-
this.state.updateBound = null;
|
|
7481
|
-
};
|
|
7482
|
-
|
|
7459
|
+
*/
|
|
7460
|
+
Popper.prototype._removeEventListeners = function () {
|
|
7461
|
+
// NOTE: 1 DOM access here
|
|
7462
|
+
(this.state.realWindow || root).removeEventListener('resize', this.state.updateBound);
|
|
7463
|
+
if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
|
|
7464
|
+
this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
|
|
7465
|
+
this.state.scrollTarget = null;
|
|
7466
|
+
}
|
|
7467
|
+
this.state.updateBound = null;
|
|
7468
|
+
};
|
|
7469
|
+
|
|
7483
7470
|
/**
|
|
7484
7471
|
* Computed the boundaries limits and return them
|
|
7485
7472
|
* @method
|
|
@@ -7489,75 +7476,56 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7489
7476
|
* @param {Number} padding - Boundaries padding
|
|
7490
7477
|
* @param {Element} boundariesElement - Element used to define the boundaries
|
|
7491
7478
|
* @returns {Object} Coordinates of the boundaries
|
|
7492
|
-
*/
|
|
7493
|
-
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
7494
|
-
// NOTE: 1 DOM access here
|
|
7495
|
-
var boundaries = {};
|
|
7496
|
-
var width, height;
|
|
7497
|
-
if (boundariesElement === 'window') {
|
|
7498
|
-
var body = root.document.body,
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
height = Math.max(
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
);
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
} else {
|
|
7543
|
-
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
7544
|
-
boundaries = {
|
|
7545
|
-
top: 0,
|
|
7546
|
-
left: 0,
|
|
7547
|
-
right: boundariesElement.clientWidth,
|
|
7548
|
-
bottom: boundariesElement.clientHeight
|
|
7549
|
-
};
|
|
7550
|
-
} else {
|
|
7551
|
-
boundaries = getOffsetRect(boundariesElement);
|
|
7552
|
-
}
|
|
7553
|
-
}
|
|
7554
|
-
boundaries.left += padding;
|
|
7555
|
-
boundaries.right -= padding;
|
|
7556
|
-
boundaries.top = boundaries.top + padding;
|
|
7557
|
-
boundaries.bottom = boundaries.bottom - padding;
|
|
7558
|
-
return boundaries;
|
|
7559
|
-
};
|
|
7560
|
-
|
|
7479
|
+
*/
|
|
7480
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
7481
|
+
// NOTE: 1 DOM access here
|
|
7482
|
+
var boundaries = {};
|
|
7483
|
+
var width, height;
|
|
7484
|
+
if (boundariesElement === 'window') {
|
|
7485
|
+
var body = root.document.body,
|
|
7486
|
+
html = root.document.documentElement;
|
|
7487
|
+
|
|
7488
|
+
height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
7489
|
+
width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
|
|
7490
|
+
|
|
7491
|
+
boundaries = {
|
|
7492
|
+
top: 0,
|
|
7493
|
+
right: width,
|
|
7494
|
+
bottom: height,
|
|
7495
|
+
left: 0
|
|
7496
|
+
};
|
|
7497
|
+
} else if (boundariesElement === 'viewport') {
|
|
7498
|
+
// 将真实 window 的视口换算到 popper 所在包含块的坐标系。
|
|
7499
|
+
// 无界等场景下沙箱 window 的尺寸、shadowRoot 内元素的 scrollTop 均不可靠,
|
|
7500
|
+
// 统一从元素自身的 view 与真实包含块获取
|
|
7501
|
+
var realWindow = getRealWindow(this._popper);
|
|
7502
|
+
var containingBlockRect = getContainingBlockRect(this._popper, data.offsets.popper.position === 'fixed');
|
|
7503
|
+
|
|
7504
|
+
boundaries = {
|
|
7505
|
+
top: 0 - containingBlockRect.top,
|
|
7506
|
+
right: realWindow.document.documentElement.clientWidth - containingBlockRect.left,
|
|
7507
|
+
bottom: realWindow.document.documentElement.clientHeight - containingBlockRect.top,
|
|
7508
|
+
left: 0 - containingBlockRect.left
|
|
7509
|
+
};
|
|
7510
|
+
} else {
|
|
7511
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
7512
|
+
boundaries = {
|
|
7513
|
+
top: 0,
|
|
7514
|
+
left: 0,
|
|
7515
|
+
right: boundariesElement.clientWidth,
|
|
7516
|
+
bottom: boundariesElement.clientHeight
|
|
7517
|
+
};
|
|
7518
|
+
} else {
|
|
7519
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
boundaries.left += padding;
|
|
7523
|
+
boundaries.right -= padding;
|
|
7524
|
+
boundaries.top = boundaries.top + padding;
|
|
7525
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
7526
|
+
return boundaries;
|
|
7527
|
+
};
|
|
7528
|
+
|
|
7561
7529
|
/**
|
|
7562
7530
|
* Loop trough the list of modifiers and run them in order, each of them will then edit the data object
|
|
7563
7531
|
* @method
|
|
@@ -7566,27 +7534,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7566
7534
|
* @param {Object} data
|
|
7567
7535
|
* @param {Array} modifiers
|
|
7568
7536
|
* @param {Function} ends
|
|
7569
|
-
*/
|
|
7570
|
-
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
7571
|
-
var modifiersToRun = modifiers.slice();
|
|
7572
|
-
if (ends !== undefined) {
|
|
7573
|
-
modifiersToRun = this._options.modifiers.slice(
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
);
|
|
7586
|
-
|
|
7587
|
-
return data;
|
|
7588
|
-
};
|
|
7589
|
-
|
|
7537
|
+
*/
|
|
7538
|
+
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
7539
|
+
var modifiersToRun = modifiers.slice();
|
|
7540
|
+
if (ends !== undefined) {
|
|
7541
|
+
modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
|
|
7542
|
+
}
|
|
7543
|
+
|
|
7544
|
+
modifiersToRun.forEach(function (modifier) {
|
|
7545
|
+
if (isFunction(modifier)) {
|
|
7546
|
+
data = modifier.call(this, data);
|
|
7547
|
+
}
|
|
7548
|
+
}.bind(this));
|
|
7549
|
+
|
|
7550
|
+
return data;
|
|
7551
|
+
};
|
|
7552
|
+
|
|
7590
7553
|
/**
|
|
7591
7554
|
* Helper used to know if the given modifier depends from another one.
|
|
7592
7555
|
* @method
|
|
@@ -7594,204 +7557,191 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7594
7557
|
* @param {String} requesting - name of requesting modifier
|
|
7595
7558
|
* @param {String} requested - name of requested modifier
|
|
7596
7559
|
* @returns {Boolean}
|
|
7597
|
-
*/
|
|
7598
|
-
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
7599
|
-
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
7600
|
-
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
7601
|
-
return modifier === requested;
|
|
7602
|
-
}).length;
|
|
7603
|
-
};
|
|
7604
|
-
|
|
7605
|
-
//
|
|
7606
|
-
// Modifiers
|
|
7607
|
-
//
|
|
7608
|
-
|
|
7560
|
+
*/
|
|
7561
|
+
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
7562
|
+
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
7563
|
+
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
7564
|
+
return modifier === requested;
|
|
7565
|
+
}).length;
|
|
7566
|
+
};
|
|
7567
|
+
|
|
7568
|
+
//
|
|
7569
|
+
// Modifiers
|
|
7570
|
+
//
|
|
7571
|
+
|
|
7609
7572
|
/**
|
|
7610
7573
|
* Modifiers list
|
|
7611
7574
|
* @namespace Popper.modifiers
|
|
7612
7575
|
* @memberof Popper
|
|
7613
7576
|
* @type {Object}
|
|
7614
|
-
*/
|
|
7615
|
-
Popper.prototype.modifiers = {};
|
|
7616
|
-
|
|
7577
|
+
*/
|
|
7578
|
+
Popper.prototype.modifiers = {};
|
|
7579
|
+
|
|
7617
7580
|
/**
|
|
7618
7581
|
* Apply the computed styles to the popper element
|
|
7619
7582
|
* @method
|
|
7620
7583
|
* @memberof Popper.modifiers
|
|
7621
7584
|
* @argument {Object} data - The data object generated by `update` method
|
|
7622
7585
|
* @returns {Object} The same data object
|
|
7623
|
-
*/
|
|
7624
|
-
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
7625
|
-
// apply the final offsets to the popper
|
|
7626
|
-
// NOTE: 1 DOM access here
|
|
7627
|
-
var styles = {
|
|
7628
|
-
position: data.offsets.popper.position
|
|
7629
|
-
};
|
|
7630
|
-
|
|
7631
|
-
// round top and left to avoid blurry text
|
|
7632
|
-
var left = Math.round(data.offsets.popper.left);
|
|
7633
|
-
var top = Math.round(data.offsets.popper.top);
|
|
7634
|
-
|
|
7635
|
-
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
7636
|
-
// we automatically use the supported prefixed version if needed
|
|
7637
|
-
var prefixedProperty;
|
|
7638
|
-
if (
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
//
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
this.modifiers.arrow
|
|
7670
|
-
) &&
|
|
7671
|
-
data.offsets.arrow
|
|
7672
|
-
) {
|
|
7673
|
-
setStyle(data.arrowElement, data.offsets.arrow);
|
|
7674
|
-
}
|
|
7675
|
-
|
|
7676
|
-
return data;
|
|
7677
|
-
};
|
|
7678
|
-
|
|
7586
|
+
*/
|
|
7587
|
+
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
7588
|
+
// apply the final offsets to the popper
|
|
7589
|
+
// NOTE: 1 DOM access here
|
|
7590
|
+
var styles = {
|
|
7591
|
+
position: data.offsets.popper.position
|
|
7592
|
+
};
|
|
7593
|
+
|
|
7594
|
+
// round top and left to avoid blurry text
|
|
7595
|
+
var left = Math.round(data.offsets.popper.left);
|
|
7596
|
+
var top = Math.round(data.offsets.popper.top);
|
|
7597
|
+
|
|
7598
|
+
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
7599
|
+
// we automatically use the supported prefixed version if needed
|
|
7600
|
+
var prefixedProperty;
|
|
7601
|
+
if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
|
|
7602
|
+
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
7603
|
+
styles.top = 0;
|
|
7604
|
+
styles.left = 0;
|
|
7605
|
+
}
|
|
7606
|
+
// othwerise, we use the standard `left` and `top` properties
|
|
7607
|
+
else {
|
|
7608
|
+
styles.left = left;
|
|
7609
|
+
styles.top = top;
|
|
7610
|
+
}
|
|
7611
|
+
|
|
7612
|
+
// any property present in `data.styles` will be applied to the popper,
|
|
7613
|
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
|
7614
|
+
// Be aware, modifiers could override the properties defined in the previous
|
|
7615
|
+
// lines of this modifier!
|
|
7616
|
+
Object.assign(styles, data.styles);
|
|
7617
|
+
|
|
7618
|
+
setStyle(this._popper, styles);
|
|
7619
|
+
|
|
7620
|
+
// set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
|
|
7621
|
+
// NOTE: 1 DOM access here
|
|
7622
|
+
this._popper.setAttribute('x-placement', data.placement);
|
|
7623
|
+
|
|
7624
|
+
// if the arrow modifier is required and the arrow style has been computed, apply the arrow style
|
|
7625
|
+
if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
|
|
7626
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
7627
|
+
}
|
|
7628
|
+
|
|
7629
|
+
return data;
|
|
7630
|
+
};
|
|
7631
|
+
|
|
7679
7632
|
/**
|
|
7680
7633
|
* Modifier used to shift the popper on the start or end of its reference element side
|
|
7681
7634
|
* @method
|
|
7682
7635
|
* @memberof Popper.modifiers
|
|
7683
7636
|
* @argument {Object} data - The data object generated by `update` method
|
|
7684
7637
|
* @returns {Object} The data object, properly modified
|
|
7685
|
-
*/
|
|
7686
|
-
Popper.prototype.modifiers.shift = function (data) {
|
|
7687
|
-
var placement = data.placement;
|
|
7688
|
-
var basePlacement = placement.split('-')[0];
|
|
7689
|
-
var shiftVariation = placement.split('-')[1];
|
|
7690
|
-
|
|
7691
|
-
// if shift shiftVariation is specified, run the modifier
|
|
7692
|
-
if (shiftVariation) {
|
|
7693
|
-
var reference = data.offsets.reference;
|
|
7694
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
7695
|
-
|
|
7696
|
-
var shiftOffsets = {
|
|
7697
|
-
y: {
|
|
7698
|
-
start: { top: reference.top },
|
|
7699
|
-
end: { top: reference.top + reference.height - popper.height }
|
|
7700
|
-
},
|
|
7701
|
-
x: {
|
|
7702
|
-
start: { left: reference.left },
|
|
7703
|
-
end: { left: reference.left + reference.width - popper.width }
|
|
7704
|
-
}
|
|
7705
|
-
};
|
|
7706
|
-
|
|
7707
|
-
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
7708
|
-
|
|
7709
|
-
data.offsets.popper = Object.assign(
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
return data;
|
|
7716
|
-
};
|
|
7717
|
-
|
|
7638
|
+
*/
|
|
7639
|
+
Popper.prototype.modifiers.shift = function (data) {
|
|
7640
|
+
var placement = data.placement;
|
|
7641
|
+
var basePlacement = placement.split('-')[0];
|
|
7642
|
+
var shiftVariation = placement.split('-')[1];
|
|
7643
|
+
|
|
7644
|
+
// if shift shiftVariation is specified, run the modifier
|
|
7645
|
+
if (shiftVariation) {
|
|
7646
|
+
var reference = data.offsets.reference;
|
|
7647
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
7648
|
+
|
|
7649
|
+
var shiftOffsets = {
|
|
7650
|
+
y: {
|
|
7651
|
+
start: { top: reference.top },
|
|
7652
|
+
end: { top: reference.top + reference.height - popper.height }
|
|
7653
|
+
},
|
|
7654
|
+
x: {
|
|
7655
|
+
start: { left: reference.left },
|
|
7656
|
+
end: { left: reference.left + reference.width - popper.width }
|
|
7657
|
+
}
|
|
7658
|
+
};
|
|
7659
|
+
|
|
7660
|
+
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
7661
|
+
|
|
7662
|
+
data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
|
|
7663
|
+
}
|
|
7664
|
+
|
|
7665
|
+
return data;
|
|
7666
|
+
};
|
|
7667
|
+
|
|
7718
7668
|
/**
|
|
7719
7669
|
* Modifier used to make sure the popper does not overflows from it's boundaries
|
|
7720
7670
|
* @method
|
|
7721
7671
|
* @memberof Popper.modifiers
|
|
7722
7672
|
* @argument {Object} data - The data object generated by `update` method
|
|
7723
7673
|
* @returns {Object} The data object, properly modified
|
|
7724
|
-
*/
|
|
7725
|
-
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
7726
|
-
var order = this._options.preventOverflowOrder;
|
|
7727
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
7728
|
-
|
|
7729
|
-
var check = {
|
|
7730
|
-
left: function () {
|
|
7731
|
-
var left = popper.left;
|
|
7732
|
-
if (popper.left < data.boundaries.left) {
|
|
7733
|
-
left = Math.max(popper.left, data.boundaries.left);
|
|
7734
|
-
}
|
|
7735
|
-
return { left: left };
|
|
7736
|
-
},
|
|
7737
|
-
right: function () {
|
|
7738
|
-
var left = popper.left;
|
|
7739
|
-
if (popper.right > data.boundaries.right) {
|
|
7740
|
-
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
7741
|
-
}
|
|
7742
|
-
return { left: left };
|
|
7743
|
-
},
|
|
7744
|
-
top: function () {
|
|
7745
|
-
var top = popper.top;
|
|
7746
|
-
if (popper.top < data.boundaries.top) {
|
|
7747
|
-
top = Math.max(popper.top, data.boundaries.top);
|
|
7748
|
-
}
|
|
7749
|
-
return { top: top };
|
|
7750
|
-
},
|
|
7751
|
-
bottom: function () {
|
|
7752
|
-
var top = popper.top;
|
|
7753
|
-
if (popper.bottom > data.boundaries.bottom) {
|
|
7754
|
-
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
7755
|
-
}
|
|
7756
|
-
return { top: top };
|
|
7757
|
-
}
|
|
7758
|
-
};
|
|
7759
|
-
|
|
7760
|
-
order.forEach(function (direction) {
|
|
7761
|
-
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
7762
|
-
});
|
|
7763
|
-
|
|
7764
|
-
return data;
|
|
7765
|
-
};
|
|
7766
|
-
|
|
7674
|
+
*/
|
|
7675
|
+
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
7676
|
+
var order = this._options.preventOverflowOrder;
|
|
7677
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
7678
|
+
|
|
7679
|
+
var check = {
|
|
7680
|
+
left: function left() {
|
|
7681
|
+
var left = popper.left;
|
|
7682
|
+
if (popper.left < data.boundaries.left) {
|
|
7683
|
+
left = Math.max(popper.left, data.boundaries.left);
|
|
7684
|
+
}
|
|
7685
|
+
return { left: left };
|
|
7686
|
+
},
|
|
7687
|
+
right: function right() {
|
|
7688
|
+
var left = popper.left;
|
|
7689
|
+
if (popper.right > data.boundaries.right) {
|
|
7690
|
+
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
7691
|
+
}
|
|
7692
|
+
return { left: left };
|
|
7693
|
+
},
|
|
7694
|
+
top: function top() {
|
|
7695
|
+
var top = popper.top;
|
|
7696
|
+
if (popper.top < data.boundaries.top) {
|
|
7697
|
+
top = Math.max(popper.top, data.boundaries.top);
|
|
7698
|
+
}
|
|
7699
|
+
return { top: top };
|
|
7700
|
+
},
|
|
7701
|
+
bottom: function bottom() {
|
|
7702
|
+
var top = popper.top;
|
|
7703
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
7704
|
+
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
7705
|
+
}
|
|
7706
|
+
return { top: top };
|
|
7707
|
+
}
|
|
7708
|
+
};
|
|
7709
|
+
|
|
7710
|
+
order.forEach(function (direction) {
|
|
7711
|
+
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
7712
|
+
});
|
|
7713
|
+
|
|
7714
|
+
return data;
|
|
7715
|
+
};
|
|
7716
|
+
|
|
7767
7717
|
/**
|
|
7768
7718
|
* Modifier used to make sure the popper is always near its reference
|
|
7769
7719
|
* @method
|
|
7770
7720
|
* @memberof Popper.modifiers
|
|
7771
7721
|
* @argument {Object} data - The data object generated by _update method
|
|
7772
7722
|
* @returns {Object} The data object, properly modified
|
|
7773
|
-
*/
|
|
7774
|
-
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
7775
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
7776
|
-
var reference = data.offsets.reference;
|
|
7777
|
-
var f = Math.floor;
|
|
7778
|
-
|
|
7779
|
-
if (popper.right < f(reference.left)) {
|
|
7780
|
-
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
7781
|
-
}
|
|
7782
|
-
if (popper.left > f(reference.right)) {
|
|
7783
|
-
data.offsets.popper.left = f(reference.right);
|
|
7784
|
-
}
|
|
7785
|
-
if (popper.bottom < f(reference.top)) {
|
|
7786
|
-
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
7787
|
-
}
|
|
7788
|
-
if (popper.top > f(reference.bottom)) {
|
|
7789
|
-
data.offsets.popper.top = f(reference.bottom);
|
|
7790
|
-
}
|
|
7791
|
-
|
|
7792
|
-
return data;
|
|
7793
|
-
};
|
|
7794
|
-
|
|
7723
|
+
*/
|
|
7724
|
+
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
7725
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
7726
|
+
var reference = data.offsets.reference;
|
|
7727
|
+
var f = Math.floor;
|
|
7728
|
+
|
|
7729
|
+
if (popper.right < f(reference.left)) {
|
|
7730
|
+
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
7731
|
+
}
|
|
7732
|
+
if (popper.left > f(reference.right)) {
|
|
7733
|
+
data.offsets.popper.left = f(reference.right);
|
|
7734
|
+
}
|
|
7735
|
+
if (popper.bottom < f(reference.top)) {
|
|
7736
|
+
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
7737
|
+
}
|
|
7738
|
+
if (popper.top > f(reference.bottom)) {
|
|
7739
|
+
data.offsets.popper.top = f(reference.bottom);
|
|
7740
|
+
}
|
|
7741
|
+
|
|
7742
|
+
return data;
|
|
7743
|
+
};
|
|
7744
|
+
|
|
7795
7745
|
/**
|
|
7796
7746
|
* Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
|
|
7797
7747
|
* Requires the `preventOverflow` modifier before it in order to work.
|
|
@@ -7800,81 +7750,61 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7800
7750
|
* @memberof Popper.modifiers
|
|
7801
7751
|
* @argument {Object} data - The data object generated by _update method
|
|
7802
7752
|
* @returns {Object} The data object, properly modified
|
|
7803
|
-
*/
|
|
7804
|
-
Popper.prototype.modifiers.flip = function (data) {
|
|
7805
|
-
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
7806
|
-
// otherwise flip would not work as expected.
|
|
7807
|
-
if (
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
) {
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
) {
|
|
7859
|
-
// we'll use this boolean to detect any flip loop
|
|
7860
|
-
data.flipped = true;
|
|
7861
|
-
data.placement = flipOrder[index + 1];
|
|
7862
|
-
if (variation) {
|
|
7863
|
-
data.placement += '-' + variation;
|
|
7864
|
-
}
|
|
7865
|
-
data.offsets.popper = this._getOffsets(
|
|
7866
|
-
this._popper,
|
|
7867
|
-
this._reference,
|
|
7868
|
-
data.placement
|
|
7869
|
-
).popper;
|
|
7870
|
-
|
|
7871
|
-
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
7872
|
-
}
|
|
7873
|
-
}.bind(this)
|
|
7874
|
-
);
|
|
7875
|
-
return data;
|
|
7876
|
-
};
|
|
7877
|
-
|
|
7753
|
+
*/
|
|
7754
|
+
Popper.prototype.modifiers.flip = function (data) {
|
|
7755
|
+
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
7756
|
+
// otherwise flip would not work as expected.
|
|
7757
|
+
if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
|
|
7758
|
+
console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
|
|
7759
|
+
return data;
|
|
7760
|
+
}
|
|
7761
|
+
|
|
7762
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
7763
|
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
|
7764
|
+
return data;
|
|
7765
|
+
}
|
|
7766
|
+
|
|
7767
|
+
var placement = data.placement.split('-')[0];
|
|
7768
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
7769
|
+
var variation = data.placement.split('-')[1] || '';
|
|
7770
|
+
|
|
7771
|
+
var flipOrder = [];
|
|
7772
|
+
if (this._options.flipBehavior === 'flip') {
|
|
7773
|
+
flipOrder = [placement, placementOpposite];
|
|
7774
|
+
} else {
|
|
7775
|
+
flipOrder = this._options.flipBehavior;
|
|
7776
|
+
}
|
|
7777
|
+
|
|
7778
|
+
flipOrder.forEach(function (step, index) {
|
|
7779
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
7780
|
+
return;
|
|
7781
|
+
}
|
|
7782
|
+
|
|
7783
|
+
placement = data.placement.split('-')[0];
|
|
7784
|
+
placementOpposite = getOppositePlacement(placement);
|
|
7785
|
+
|
|
7786
|
+
var popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
7787
|
+
|
|
7788
|
+
// this boolean is used to distinguish right and bottom from top and left
|
|
7789
|
+
// they need different computations to get flipped
|
|
7790
|
+
var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
|
7791
|
+
|
|
7792
|
+
// using Math.floor because the reference offsets may contain decimals we are not going to consider here
|
|
7793
|
+
if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
|
|
7794
|
+
// we'll use this boolean to detect any flip loop
|
|
7795
|
+
data.flipped = true;
|
|
7796
|
+
data.placement = flipOrder[index + 1];
|
|
7797
|
+
if (variation) {
|
|
7798
|
+
data.placement += '-' + variation;
|
|
7799
|
+
}
|
|
7800
|
+
data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
|
|
7801
|
+
|
|
7802
|
+
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
7803
|
+
}
|
|
7804
|
+
}.bind(this));
|
|
7805
|
+
return data;
|
|
7806
|
+
};
|
|
7807
|
+
|
|
7878
7808
|
/**
|
|
7879
7809
|
* Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
|
|
7880
7810
|
* The offsets will shift the popper on the side of its reference element.
|
|
@@ -7882,23 +7812,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7882
7812
|
* @memberof Popper.modifiers
|
|
7883
7813
|
* @argument {Object} data - The data object generated by _update method
|
|
7884
7814
|
* @returns {Object} The data object, properly modified
|
|
7885
|
-
*/
|
|
7886
|
-
Popper.prototype.modifiers.offset = function (data) {
|
|
7887
|
-
var offset = this._options.offset;
|
|
7888
|
-
var popper = data.offsets.popper;
|
|
7889
|
-
|
|
7890
|
-
if (data.placement.indexOf('left') !== -1) {
|
|
7891
|
-
popper.top -= offset;
|
|
7892
|
-
} else if (data.placement.indexOf('right') !== -1) {
|
|
7893
|
-
popper.top += offset;
|
|
7894
|
-
} else if (data.placement.indexOf('top') !== -1) {
|
|
7895
|
-
popper.left -= offset;
|
|
7896
|
-
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
7897
|
-
popper.left += offset;
|
|
7898
|
-
}
|
|
7899
|
-
return data;
|
|
7900
|
-
};
|
|
7901
|
-
|
|
7815
|
+
*/
|
|
7816
|
+
Popper.prototype.modifiers.offset = function (data) {
|
|
7817
|
+
var offset = this._options.offset;
|
|
7818
|
+
var popper = data.offsets.popper;
|
|
7819
|
+
|
|
7820
|
+
if (data.placement.indexOf('left') !== -1) {
|
|
7821
|
+
popper.top -= offset;
|
|
7822
|
+
} else if (data.placement.indexOf('right') !== -1) {
|
|
7823
|
+
popper.top += offset;
|
|
7824
|
+
} else if (data.placement.indexOf('top') !== -1) {
|
|
7825
|
+
popper.left -= offset;
|
|
7826
|
+
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
7827
|
+
popper.left += offset;
|
|
7828
|
+
}
|
|
7829
|
+
return data;
|
|
7830
|
+
};
|
|
7831
|
+
|
|
7902
7832
|
/**
|
|
7903
7833
|
* Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
|
|
7904
7834
|
* It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
|
|
@@ -7906,147 +7836,136 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
7906
7836
|
* @memberof Popper.modifiers
|
|
7907
7837
|
* @argument {Object} data - The data object generated by _update method
|
|
7908
7838
|
* @returns {Object} The data object, properly modified
|
|
7909
|
-
*/
|
|
7910
|
-
Popper.prototype.modifiers.arrow = function (data) {
|
|
7911
|
-
var arrow = this._options.arrowElement;
|
|
7912
|
-
var arrowOffset = this._options.arrowOffset;
|
|
7913
|
-
|
|
7914
|
-
// if the arrowElement is a string, suppose it's a CSS selector
|
|
7915
|
-
if (typeof arrow === 'string') {
|
|
7916
|
-
arrow = this._popper.querySelector(arrow);
|
|
7917
|
-
}
|
|
7918
|
-
|
|
7919
|
-
// if arrow element is not found, don't run the modifier
|
|
7920
|
-
if (!arrow) {
|
|
7921
|
-
return data;
|
|
7922
|
-
}
|
|
7923
|
-
|
|
7924
|
-
// the arrow element must be child of its popper
|
|
7925
|
-
if (!this._popper.contains(arrow)) {
|
|
7926
|
-
console.warn(
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
)
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
var
|
|
7946
|
-
var
|
|
7947
|
-
var
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
//
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
//
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
data.offsets.arrow = arrowStyle;
|
|
7984
|
-
data.arrowElement = arrow;
|
|
7985
|
-
|
|
7986
|
-
return data;
|
|
7987
|
-
};
|
|
7988
|
-
|
|
7989
|
-
//
|
|
7990
|
-
// Helpers
|
|
7991
|
-
//
|
|
7992
|
-
|
|
7839
|
+
*/
|
|
7840
|
+
Popper.prototype.modifiers.arrow = function (data) {
|
|
7841
|
+
var arrow = this._options.arrowElement;
|
|
7842
|
+
var arrowOffset = this._options.arrowOffset;
|
|
7843
|
+
|
|
7844
|
+
// if the arrowElement is a string, suppose it's a CSS selector
|
|
7845
|
+
if (typeof arrow === 'string') {
|
|
7846
|
+
arrow = this._popper.querySelector(arrow);
|
|
7847
|
+
}
|
|
7848
|
+
|
|
7849
|
+
// if arrow element is not found, don't run the modifier
|
|
7850
|
+
if (!arrow) {
|
|
7851
|
+
return data;
|
|
7852
|
+
}
|
|
7853
|
+
|
|
7854
|
+
// the arrow element must be child of its popper
|
|
7855
|
+
if (!this._popper.contains(arrow)) {
|
|
7856
|
+
console.warn('WARNING: `arrowElement` must be child of its popper element!');
|
|
7857
|
+
return data;
|
|
7858
|
+
}
|
|
7859
|
+
|
|
7860
|
+
// arrow depends on keepTogether in order to work
|
|
7861
|
+
if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
|
|
7862
|
+
console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
|
|
7863
|
+
return data;
|
|
7864
|
+
}
|
|
7865
|
+
|
|
7866
|
+
var arrowStyle = {};
|
|
7867
|
+
var placement = data.placement.split('-')[0];
|
|
7868
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
7869
|
+
var reference = data.offsets.reference;
|
|
7870
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
7871
|
+
|
|
7872
|
+
var len = isVertical ? 'height' : 'width';
|
|
7873
|
+
var side = isVertical ? 'top' : 'left';
|
|
7874
|
+
var translate = isVertical ? 'translateY' : 'translateX';
|
|
7875
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
7876
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
7877
|
+
var arrowSize = getOuterSizes(arrow)[len];
|
|
7878
|
+
|
|
7879
|
+
//
|
|
7880
|
+
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
|
|
7881
|
+
//
|
|
7882
|
+
|
|
7883
|
+
// top/left side
|
|
7884
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
7885
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
7886
|
+
}
|
|
7887
|
+
// bottom/right side
|
|
7888
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
7889
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
7890
|
+
}
|
|
7891
|
+
|
|
7892
|
+
// compute center of the popper
|
|
7893
|
+
var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
|
7894
|
+
|
|
7895
|
+
var sideValue = center - popper[side];
|
|
7896
|
+
|
|
7897
|
+
// prevent arrow from being placed not contiguously to its popper
|
|
7898
|
+
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
|
7899
|
+
arrowStyle[side] = sideValue;
|
|
7900
|
+
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
|
|
7901
|
+
|
|
7902
|
+
data.offsets.arrow = arrowStyle;
|
|
7903
|
+
data.arrowElement = arrow;
|
|
7904
|
+
|
|
7905
|
+
return data;
|
|
7906
|
+
};
|
|
7907
|
+
|
|
7908
|
+
//
|
|
7909
|
+
// Helpers
|
|
7910
|
+
//
|
|
7911
|
+
|
|
7993
7912
|
/**
|
|
7994
7913
|
* Get the outer sizes of the given element (offset size + margins)
|
|
7995
7914
|
* @function
|
|
7996
7915
|
* @ignore
|
|
7997
7916
|
* @argument {Element} element
|
|
7998
7917
|
* @returns {Object} object containing width and height properties
|
|
7999
|
-
*/
|
|
8000
|
-
function getOuterSizes(element) {
|
|
8001
|
-
// NOTE: 1 DOM access here
|
|
8002
|
-
var _display = element.style.display,
|
|
8003
|
-
|
|
8004
|
-
element.style.display = 'block';
|
|
8005
|
-
element.style.visibility = 'hidden';
|
|
8006
|
-
var calcWidthToForceRepaint = element.offsetWidth;
|
|
8007
|
-
// original method
|
|
8008
|
-
var styles = getRealWindow(element).getComputedStyle(element);
|
|
8009
|
-
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
8010
|
-
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
8011
|
-
var result = {
|
|
8012
|
-
width: element.offsetWidth + y,
|
|
8013
|
-
height: element.offsetHeight + x
|
|
8014
|
-
};
|
|
8015
|
-
|
|
8016
|
-
// reset element styles
|
|
8017
|
-
element.style.display = _display;
|
|
8018
|
-
element.style.visibility = _visibility;
|
|
8019
|
-
return result;
|
|
8020
|
-
}
|
|
8021
|
-
|
|
7918
|
+
*/
|
|
7919
|
+
function getOuterSizes(element) {
|
|
7920
|
+
// NOTE: 1 DOM access here
|
|
7921
|
+
var _display = element.style.display,
|
|
7922
|
+
_visibility = element.style.visibility;
|
|
7923
|
+
element.style.display = 'block';
|
|
7924
|
+
element.style.visibility = 'hidden';
|
|
7925
|
+
var calcWidthToForceRepaint = element.offsetWidth;
|
|
7926
|
+
// original method
|
|
7927
|
+
var styles = getRealWindow(element).getComputedStyle(element);
|
|
7928
|
+
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
7929
|
+
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
7930
|
+
var result = {
|
|
7931
|
+
width: element.offsetWidth + y,
|
|
7932
|
+
height: element.offsetHeight + x
|
|
7933
|
+
};
|
|
7934
|
+
|
|
7935
|
+
// reset element styles
|
|
7936
|
+
element.style.display = _display;
|
|
7937
|
+
element.style.visibility = _visibility;
|
|
7938
|
+
return result;
|
|
7939
|
+
}
|
|
7940
|
+
|
|
8022
7941
|
/**
|
|
8023
7942
|
* Get the opposite placement of the given one/
|
|
8024
7943
|
* @function
|
|
8025
7944
|
* @ignore
|
|
8026
7945
|
* @argument {String} placement
|
|
8027
7946
|
* @returns {String} flipped placement
|
|
8028
|
-
*/
|
|
8029
|
-
function getOppositePlacement(placement) {
|
|
8030
|
-
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
8031
|
-
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
8032
|
-
return hash[matched];
|
|
8033
|
-
});
|
|
8034
|
-
}
|
|
8035
|
-
|
|
7947
|
+
*/
|
|
7948
|
+
function getOppositePlacement(placement) {
|
|
7949
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
7950
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
7951
|
+
return hash[matched];
|
|
7952
|
+
});
|
|
7953
|
+
}
|
|
7954
|
+
|
|
8036
7955
|
/**
|
|
8037
7956
|
* Given the popper offsets, generate an output similar to getBoundingClientRect
|
|
8038
7957
|
* @function
|
|
8039
7958
|
* @ignore
|
|
8040
7959
|
* @argument {Object} popperOffsets
|
|
8041
7960
|
* @returns {Object} ClientRect like output
|
|
8042
|
-
*/
|
|
8043
|
-
function getPopperClientRect(popperOffsets) {
|
|
8044
|
-
var offsets = Object.assign({}, popperOffsets);
|
|
8045
|
-
offsets.right = offsets.left + offsets.width;
|
|
8046
|
-
offsets.bottom = offsets.top + offsets.height;
|
|
8047
|
-
return offsets;
|
|
8048
|
-
}
|
|
8049
|
-
|
|
7961
|
+
*/
|
|
7962
|
+
function getPopperClientRect(popperOffsets) {
|
|
7963
|
+
var offsets = Object.assign({}, popperOffsets);
|
|
7964
|
+
offsets.right = offsets.left + offsets.width;
|
|
7965
|
+
offsets.bottom = offsets.top + offsets.height;
|
|
7966
|
+
return offsets;
|
|
7967
|
+
}
|
|
7968
|
+
|
|
8050
7969
|
/**
|
|
8051
7970
|
* Given an array and the key to find, returns its index
|
|
8052
7971
|
* @function
|
|
@@ -8054,48 +7973,46 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8054
7973
|
* @argument {Array} arr
|
|
8055
7974
|
* @argument keyToFind
|
|
8056
7975
|
* @returns index or null
|
|
8057
|
-
*/
|
|
8058
|
-
function getArrayKeyIndex(arr, keyToFind) {
|
|
8059
|
-
var i = 0,
|
|
8060
|
-
|
|
8061
|
-
for (key in arr) {
|
|
8062
|
-
if (arr[key] === keyToFind) {
|
|
8063
|
-
return i;
|
|
8064
|
-
}
|
|
8065
|
-
i++;
|
|
8066
|
-
}
|
|
8067
|
-
return null;
|
|
8068
|
-
}
|
|
8069
|
-
|
|
7976
|
+
*/
|
|
7977
|
+
function getArrayKeyIndex(arr, keyToFind) {
|
|
7978
|
+
var i = 0,
|
|
7979
|
+
key;
|
|
7980
|
+
for (key in arr) {
|
|
7981
|
+
if (arr[key] === keyToFind) {
|
|
7982
|
+
return i;
|
|
7983
|
+
}
|
|
7984
|
+
i++;
|
|
7985
|
+
}
|
|
7986
|
+
return null;
|
|
7987
|
+
}
|
|
7988
|
+
|
|
8070
7989
|
/**
|
|
8071
7990
|
* Get CSS computed property of the given element
|
|
8072
7991
|
* @function
|
|
8073
7992
|
* @ignore
|
|
8074
7993
|
* @argument {Eement} element
|
|
8075
7994
|
* @argument {String} property
|
|
8076
|
-
*/
|
|
8077
|
-
function getStyleComputedProperty(element, property) {
|
|
8078
|
-
// NOTE: 1 DOM access here
|
|
8079
|
-
// 无界等微前端场景下沙箱 window 与元素实际渲染所在 window 可能不一致,
|
|
8080
|
-
// 需使用元素自身的 view 读取计算样式,避免跨 document 读取到空值
|
|
8081
|
-
var css = getRealWindow(element).getComputedStyle(element, null);
|
|
8082
|
-
return css[property];
|
|
8083
|
-
}
|
|
8084
|
-
|
|
7995
|
+
*/
|
|
7996
|
+
function getStyleComputedProperty(element, property) {
|
|
7997
|
+
// NOTE: 1 DOM access here
|
|
7998
|
+
// 无界等微前端场景下沙箱 window 与元素实际渲染所在 window 可能不一致,
|
|
7999
|
+
// 需使用元素自身的 view 读取计算样式,避免跨 document 读取到空值
|
|
8000
|
+
var css = getRealWindow(element).getComputedStyle(element, null);
|
|
8001
|
+
return css[property];
|
|
8002
|
+
}
|
|
8003
|
+
|
|
8085
8004
|
/**
|
|
8086
8005
|
* Returns the offset parent of the given element
|
|
8087
8006
|
* @function
|
|
8088
8007
|
* @ignore
|
|
8089
8008
|
* @argument {Element} element
|
|
8090
8009
|
* @returns {Element} offset parent
|
|
8091
|
-
*/
|
|
8092
|
-
function getOffsetParent(element) {
|
|
8093
|
-
var offsetParent = element.offsetParent;
|
|
8094
|
-
return offsetParent === root.document.body || !offsetParent
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
}
|
|
8098
|
-
|
|
8010
|
+
*/
|
|
8011
|
+
function getOffsetParent(element) {
|
|
8012
|
+
var offsetParent = element.offsetParent;
|
|
8013
|
+
return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
|
|
8014
|
+
}
|
|
8015
|
+
|
|
8099
8016
|
/**
|
|
8100
8017
|
* Returns the window the given element actually renders in.
|
|
8101
8018
|
* 无界等微前端场景下组件代码运行在沙箱 window 中,而 DOM 实际渲染在
|
|
@@ -8104,16 +8021,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8104
8021
|
* @ignore
|
|
8105
8022
|
* @argument {Element} element
|
|
8106
8023
|
* @returns {Window} window
|
|
8107
|
-
*/
|
|
8108
|
-
function getRealWindow(element) {
|
|
8109
|
-
return
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
element.ownerDocument.defaultView) ||
|
|
8113
|
-
root
|
|
8114
|
-
);
|
|
8115
|
-
}
|
|
8116
|
-
|
|
8024
|
+
*/
|
|
8025
|
+
function getRealWindow(element) {
|
|
8026
|
+
return element && element.ownerDocument && element.ownerDocument.defaultView || root;
|
|
8027
|
+
}
|
|
8028
|
+
|
|
8117
8029
|
/**
|
|
8118
8030
|
* Returns the viewport rect of the containing block actually used to position the popper.
|
|
8119
8031
|
* 无界微前端等场景下 popper 被挂载进子应用的 shadowRoot,offsetParent 的兜底值
|
|
@@ -8127,82 +8039,72 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8127
8039
|
* @argument {Element} element - popper element
|
|
8128
8040
|
* @argument {Boolean} fixed - whether the popper is fixed positioned
|
|
8129
8041
|
* @returns {Object} rect
|
|
8130
|
-
*/
|
|
8131
|
-
function getContainingBlockRect(element, fixed) {
|
|
8132
|
-
if (fixed) {
|
|
8133
|
-
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
8134
|
-
}
|
|
8135
|
-
|
|
8136
|
-
var node = element.parentNode;
|
|
8137
|
-
while (node) {
|
|
8138
|
-
if (node.nodeType === 1) {
|
|
8139
|
-
if (getStyleComputedProperty(node, 'position') !== 'static') {
|
|
8140
|
-
return getBoundingClientRect(node);
|
|
8141
|
-
}
|
|
8142
|
-
} else if (node.nodeType === 11) {
|
|
8143
|
-
// 遇到 shadowRoot,跨边界从宿主元素继续向上查找
|
|
8144
|
-
node = node.host;
|
|
8145
|
-
continue;
|
|
8146
|
-
} else {
|
|
8147
|
-
break;
|
|
8148
|
-
}
|
|
8149
|
-
node = node.parentNode;
|
|
8150
|
-
}
|
|
8151
|
-
|
|
8152
|
-
var win = getRealWindow(element);
|
|
8153
|
-
return {
|
|
8154
|
-
top: -(win.pageYOffset || 0),
|
|
8155
|
-
left: -(win.pageXOffset || 0),
|
|
8156
|
-
right: 0,
|
|
8157
|
-
bottom: 0
|
|
8158
|
-
};
|
|
8159
|
-
}
|
|
8160
|
-
|
|
8042
|
+
*/
|
|
8043
|
+
function getContainingBlockRect(element, fixed) {
|
|
8044
|
+
if (fixed) {
|
|
8045
|
+
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
8046
|
+
}
|
|
8047
|
+
|
|
8048
|
+
var node = element.parentNode;
|
|
8049
|
+
while (node) {
|
|
8050
|
+
if (node.nodeType === 1) {
|
|
8051
|
+
if (getStyleComputedProperty(node, 'position') !== 'static') {
|
|
8052
|
+
return getBoundingClientRect(node);
|
|
8053
|
+
}
|
|
8054
|
+
} else if (node.nodeType === 11) {
|
|
8055
|
+
// 遇到 shadowRoot,跨边界从宿主元素继续向上查找
|
|
8056
|
+
node = node.host;
|
|
8057
|
+
continue;
|
|
8058
|
+
} else {
|
|
8059
|
+
break;
|
|
8060
|
+
}
|
|
8061
|
+
node = node.parentNode;
|
|
8062
|
+
}
|
|
8063
|
+
|
|
8064
|
+
var win = getRealWindow(element);
|
|
8065
|
+
return {
|
|
8066
|
+
top: -(win.pageYOffset || 0),
|
|
8067
|
+
left: -(win.pageXOffset || 0),
|
|
8068
|
+
right: 0,
|
|
8069
|
+
bottom: 0
|
|
8070
|
+
};
|
|
8071
|
+
}
|
|
8072
|
+
|
|
8161
8073
|
/**
|
|
8162
8074
|
* Returns the scrolling parent of the given element
|
|
8163
8075
|
* @function
|
|
8164
8076
|
* @ignore
|
|
8165
8077
|
* @argument {Element} element
|
|
8166
8078
|
* @returns {Element} offset parent
|
|
8167
|
-
*/
|
|
8168
|
-
function getScrollParent(element) {
|
|
8169
|
-
var parent = element.parentNode;
|
|
8170
|
-
if (!parent) {
|
|
8171
|
-
return element;
|
|
8172
|
-
}
|
|
8173
|
-
|
|
8174
|
-
if (parent.nodeType === 11) {
|
|
8175
|
-
// 无界等微前端场景 DOM 位于 shadowRoot 内,需跨边界从宿主元素继续向上查找,
|
|
8176
|
-
// 否则查找到 shadowRoot 即终止,滚动事件无法被监听
|
|
8177
|
-
return getScrollParent(parent.host);
|
|
8178
|
-
}
|
|
8179
|
-
|
|
8180
|
-
if (parent.nodeType !== 1) {
|
|
8181
|
-
// 到达 document,返回元素实际渲染所在的真实 window,
|
|
8182
|
-
// 保证 window 滚动时能触发位置更新
|
|
8183
|
-
return getRealWindow(element);
|
|
8184
|
-
}
|
|
8185
|
-
|
|
8186
|
-
// Firefox want us to check `-x` and `-y` variations as well
|
|
8187
|
-
if (
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
) !== -1
|
|
8197
|
-
) {
|
|
8198
|
-
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
8199
|
-
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
8200
|
-
// fixes issue #65
|
|
8201
|
-
return parent;
|
|
8202
|
-
}
|
|
8203
|
-
return getScrollParent(parent);
|
|
8204
|
-
}
|
|
8205
|
-
|
|
8079
|
+
*/
|
|
8080
|
+
function getScrollParent(element) {
|
|
8081
|
+
var parent = element.parentNode;
|
|
8082
|
+
if (!parent) {
|
|
8083
|
+
return element;
|
|
8084
|
+
}
|
|
8085
|
+
|
|
8086
|
+
if (parent.nodeType === 11) {
|
|
8087
|
+
// 无界等微前端场景 DOM 位于 shadowRoot 内,需跨边界从宿主元素继续向上查找,
|
|
8088
|
+
// 否则查找到 shadowRoot 即终止,滚动事件无法被监听
|
|
8089
|
+
return getScrollParent(parent.host);
|
|
8090
|
+
}
|
|
8091
|
+
|
|
8092
|
+
if (parent.nodeType !== 1) {
|
|
8093
|
+
// 到达 document,返回元素实际渲染所在的真实 window,
|
|
8094
|
+
// 保证 window 滚动时能触发位置更新
|
|
8095
|
+
return getRealWindow(element);
|
|
8096
|
+
}
|
|
8097
|
+
|
|
8098
|
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
8099
|
+
if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
|
|
8100
|
+
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
8101
|
+
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
8102
|
+
// fixes issue #65
|
|
8103
|
+
return parent;
|
|
8104
|
+
}
|
|
8105
|
+
return getScrollParent(parent);
|
|
8106
|
+
}
|
|
8107
|
+
|
|
8206
8108
|
/**
|
|
8207
8109
|
* Check if the given element is fixed or is inside a fixed parent
|
|
8208
8110
|
* @function
|
|
@@ -8210,125 +8112,114 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8210
8112
|
* @argument {Element} element
|
|
8211
8113
|
* @argument {Element} customContainer
|
|
8212
8114
|
* @returns {Boolean} answer to "isFixed?"
|
|
8213
|
-
*/
|
|
8214
|
-
function isFixed(element) {
|
|
8215
|
-
if (element === root.document.body) {
|
|
8216
|
-
return false;
|
|
8217
|
-
}
|
|
8218
|
-
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
8219
|
-
return true;
|
|
8220
|
-
}
|
|
8221
|
-
var parent = element.parentNode;
|
|
8222
|
-
if (parent && parent.nodeType === 11) {
|
|
8223
|
-
// 跨 shadowRoot 边界,从宿主元素继续向上判断
|
|
8224
|
-
parent = parent.host;
|
|
8225
|
-
}
|
|
8226
|
-
return parent && parent.nodeType === 1 ? isFixed(parent) : false;
|
|
8227
|
-
}
|
|
8228
|
-
|
|
8229
|
-
/**
|
|
8230
|
-
* Set the style to the given popper
|
|
8231
|
-
* @function
|
|
8232
|
-
* @ignore
|
|
8233
|
-
* @argument {Element} element - Element to apply the style to
|
|
8234
|
-
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
8235
|
-
*/
|
|
8236
|
-
function setStyle(element, styles) {
|
|
8237
|
-
function is_numeric(n) {
|
|
8238
|
-
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
8239
|
-
}
|
|
8240
|
-
Object.keys(styles).forEach(function (prop) {
|
|
8241
|
-
var unit = '';
|
|
8242
|
-
// add unit if the value is numeric and is one of the following
|
|
8243
|
-
if (
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
});
|
|
8252
|
-
}
|
|
8253
|
-
|
|
8254
|
-
/**
|
|
8115
|
+
*/
|
|
8116
|
+
function isFixed(element) {
|
|
8117
|
+
if (element === root.document.body) {
|
|
8118
|
+
return false;
|
|
8119
|
+
}
|
|
8120
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
8121
|
+
return true;
|
|
8122
|
+
}
|
|
8123
|
+
var parent = element.parentNode;
|
|
8124
|
+
if (parent && parent.nodeType === 11) {
|
|
8125
|
+
// 跨 shadowRoot 边界,从宿主元素继续向上判断
|
|
8126
|
+
parent = parent.host;
|
|
8127
|
+
}
|
|
8128
|
+
return parent && parent.nodeType === 1 ? isFixed(parent) : false;
|
|
8129
|
+
}
|
|
8130
|
+
|
|
8131
|
+
/**
|
|
8132
|
+
* Set the style to the given popper
|
|
8133
|
+
* @function
|
|
8134
|
+
* @ignore
|
|
8135
|
+
* @argument {Element} element - Element to apply the style to
|
|
8136
|
+
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
8137
|
+
*/
|
|
8138
|
+
function setStyle(element, styles) {
|
|
8139
|
+
function is_numeric(n) {
|
|
8140
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
8141
|
+
}
|
|
8142
|
+
Object.keys(styles).forEach(function (prop) {
|
|
8143
|
+
var unit = '';
|
|
8144
|
+
// add unit if the value is numeric and is one of the following
|
|
8145
|
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
|
|
8146
|
+
unit = 'px';
|
|
8147
|
+
}
|
|
8148
|
+
element.style[prop] = styles[prop] + unit;
|
|
8149
|
+
});
|
|
8150
|
+
}
|
|
8151
|
+
|
|
8152
|
+
/**
|
|
8255
8153
|
* Check if the given variable is a function
|
|
8256
8154
|
* @function
|
|
8257
8155
|
* @ignore
|
|
8258
8156
|
* @argument {*} functionToCheck - variable to check
|
|
8259
8157
|
* @returns {Boolean} answer to: is a function?
|
|
8260
|
-
*/
|
|
8261
|
-
function isFunction(functionToCheck) {
|
|
8262
|
-
var getType = {};
|
|
8263
|
-
return (
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
);
|
|
8267
|
-
}
|
|
8268
|
-
|
|
8158
|
+
*/
|
|
8159
|
+
function isFunction(functionToCheck) {
|
|
8160
|
+
var getType = {};
|
|
8161
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
8162
|
+
}
|
|
8163
|
+
|
|
8269
8164
|
/**
|
|
8270
8165
|
* Get the position of the given element, relative to its offset parent
|
|
8271
8166
|
* @function
|
|
8272
8167
|
* @ignore
|
|
8273
8168
|
* @param {Element} element
|
|
8274
8169
|
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
8275
|
-
*/
|
|
8276
|
-
function getOffsetRect(element) {
|
|
8277
|
-
var transform = getStyle(element, 'transform')
|
|
8278
|
-
|
|
8279
|
-
.
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
return elementRect;
|
|
8293
|
-
}
|
|
8294
|
-
|
|
8170
|
+
*/
|
|
8171
|
+
function getOffsetRect(element) {
|
|
8172
|
+
var transform = getStyle(element, 'transform').replace(/[^0-9\-,]/g, '').split(',');
|
|
8173
|
+
var elementRect = {
|
|
8174
|
+
width: element.offsetWidth,
|
|
8175
|
+
height: element.offsetHeight,
|
|
8176
|
+
left: element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
|
|
8177
|
+
top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
|
|
8178
|
+
};
|
|
8179
|
+
|
|
8180
|
+
elementRect.right = elementRect.left + elementRect.width;
|
|
8181
|
+
elementRect.bottom = elementRect.top + elementRect.height;
|
|
8182
|
+
|
|
8183
|
+
// position
|
|
8184
|
+
return elementRect;
|
|
8185
|
+
}
|
|
8186
|
+
|
|
8295
8187
|
/**
|
|
8296
8188
|
* Get bounding client rect of given element
|
|
8297
8189
|
* @function
|
|
8298
8190
|
* @ignore
|
|
8299
8191
|
* @param {HTMLElement} element
|
|
8300
8192
|
* @return {Object} client rect
|
|
8301
|
-
*/
|
|
8302
|
-
function getBoundingClientRect(element) {
|
|
8303
|
-
var rect = element.getBoundingClientRect();
|
|
8304
|
-
|
|
8305
|
-
// whether the IE version is lower than 11
|
|
8306
|
-
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
8307
|
-
|
|
8308
|
-
// fix ie document bounding top always 0 bug
|
|
8309
|
-
var rectTop =
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8193
|
+
*/
|
|
8194
|
+
function getBoundingClientRect(element) {
|
|
8195
|
+
var rect = element.getBoundingClientRect();
|
|
8196
|
+
|
|
8197
|
+
// whether the IE version is lower than 11
|
|
8198
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
8199
|
+
|
|
8200
|
+
// fix ie document bounding top always 0 bug
|
|
8201
|
+
var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
|
|
8202
|
+
|
|
8203
|
+
return {
|
|
8204
|
+
left: rect.left,
|
|
8205
|
+
top: rectTop,
|
|
8206
|
+
right: rect.right,
|
|
8207
|
+
bottom: rect.bottom,
|
|
8208
|
+
width: rect.right - rect.left,
|
|
8209
|
+
height: rect.bottom - rectTop
|
|
8210
|
+
};
|
|
8211
|
+
}
|
|
8212
|
+
|
|
8213
|
+
function getStyle(dom, attr) {
|
|
8214
|
+
if (dom.style[attr]) {
|
|
8215
|
+
return dom.style[attr];
|
|
8216
|
+
}
|
|
8217
|
+
if (window.getComputedStyle) {
|
|
8218
|
+
return getComputedStyle(dom, null)[attr];
|
|
8219
|
+
}
|
|
8220
|
+
return dom.currentStyle[attr];
|
|
8221
|
+
}
|
|
8222
|
+
|
|
8332
8223
|
/**
|
|
8333
8224
|
* Given an element and one of its parents, return the offset
|
|
8334
8225
|
* @function
|
|
@@ -8336,45 +8227,43 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8336
8227
|
* @param {HTMLElement} element
|
|
8337
8228
|
* @param {HTMLElement} parent
|
|
8338
8229
|
* @return {Object} rect
|
|
8339
|
-
*/
|
|
8340
|
-
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
8341
|
-
var elementRect = getBoundingClientRect(element);
|
|
8342
|
-
// parent 为 popper 元素:取其真实包含块的视口 rect,
|
|
8343
|
-
// 避免无界 shadowRoot 等场景下包含块假设错误导致的整体偏移
|
|
8344
|
-
var parentRect = getContainingBlockRect(parent, fixed);
|
|
8345
|
-
|
|
8346
|
-
var rect = {
|
|
8347
|
-
top: elementRect.top - parentRect.top,
|
|
8348
|
-
left: elementRect.left - parentRect.left,
|
|
8349
|
-
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
8350
|
-
right: elementRect.left - parentRect.left + elementRect.width,
|
|
8351
|
-
width: elementRect.width,
|
|
8352
|
-
height: elementRect.height
|
|
8353
|
-
};
|
|
8354
|
-
return rect;
|
|
8355
|
-
}
|
|
8356
|
-
|
|
8230
|
+
*/
|
|
8231
|
+
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
8232
|
+
var elementRect = getBoundingClientRect(element);
|
|
8233
|
+
// parent 为 popper 元素:取其真实包含块的视口 rect,
|
|
8234
|
+
// 避免无界 shadowRoot 等场景下包含块假设错误导致的整体偏移
|
|
8235
|
+
var parentRect = getContainingBlockRect(parent, fixed);
|
|
8236
|
+
|
|
8237
|
+
var rect = {
|
|
8238
|
+
top: elementRect.top - parentRect.top,
|
|
8239
|
+
left: elementRect.left - parentRect.left,
|
|
8240
|
+
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
8241
|
+
right: elementRect.left - parentRect.left + elementRect.width,
|
|
8242
|
+
width: elementRect.width,
|
|
8243
|
+
height: elementRect.height
|
|
8244
|
+
};
|
|
8245
|
+
return rect;
|
|
8246
|
+
}
|
|
8247
|
+
|
|
8357
8248
|
/**
|
|
8358
8249
|
* Get the prefixed supported property name
|
|
8359
8250
|
* @function
|
|
8360
8251
|
* @ignore
|
|
8361
8252
|
* @argument {String} property (camelCase)
|
|
8362
8253
|
* @returns {String} prefixed property (camelCase)
|
|
8363
|
-
*/
|
|
8364
|
-
function getSupportedPropertyName(property) {
|
|
8365
|
-
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
8366
|
-
|
|
8367
|
-
for (var i = 0; i < prefixes.length; i++) {
|
|
8368
|
-
var toCheck = prefixes[i]
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
}
|
|
8377
|
-
|
|
8254
|
+
*/
|
|
8255
|
+
function getSupportedPropertyName(property) {
|
|
8256
|
+
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
8257
|
+
|
|
8258
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
8259
|
+
var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
8260
|
+
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
8261
|
+
return toCheck;
|
|
8262
|
+
}
|
|
8263
|
+
}
|
|
8264
|
+
return null;
|
|
8265
|
+
}
|
|
8266
|
+
|
|
8378
8267
|
/**
|
|
8379
8268
|
* The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
|
|
8380
8269
|
* objects to a target object. It will return the target object.
|
|
@@ -8382,50 +8271,45 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
8382
8271
|
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
8383
8272
|
* @function
|
|
8384
8273
|
* @ignore
|
|
8385
|
-
*/
|
|
8386
|
-
if (!Object.assign) {
|
|
8387
|
-
Object.defineProperty(Object, 'assign', {
|
|
8388
|
-
enumerable: false,
|
|
8389
|
-
configurable: true,
|
|
8390
|
-
writable: true,
|
|
8391
|
-
value: function (target) {
|
|
8392
|
-
if (target === undefined || target === null) {
|
|
8393
|
-
throw new TypeError('Cannot convert first argument to object');
|
|
8394
|
-
}
|
|
8395
|
-
|
|
8396
|
-
var to = Object(target);
|
|
8397
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
8398
|
-
var nextSource = arguments[i];
|
|
8399
|
-
if (nextSource === undefined || nextSource === null) {
|
|
8400
|
-
continue;
|
|
8401
|
-
}
|
|
8402
|
-
nextSource = Object(nextSource);
|
|
8403
|
-
|
|
8404
|
-
var keysArray = Object.keys(nextSource);
|
|
8405
|
-
for (
|
|
8406
|
-
var
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
return to;
|
|
8418
|
-
}
|
|
8419
|
-
});
|
|
8420
|
-
}
|
|
8421
|
-
|
|
8422
|
-
return Popper;
|
|
8423
|
-
});
|
|
8274
|
+
*/
|
|
8275
|
+
if (!Object.assign) {
|
|
8276
|
+
Object.defineProperty(Object, 'assign', {
|
|
8277
|
+
enumerable: false,
|
|
8278
|
+
configurable: true,
|
|
8279
|
+
writable: true,
|
|
8280
|
+
value: function value(target) {
|
|
8281
|
+
if (target === undefined || target === null) {
|
|
8282
|
+
throw new TypeError('Cannot convert first argument to object');
|
|
8283
|
+
}
|
|
8284
|
+
|
|
8285
|
+
var to = Object(target);
|
|
8286
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8287
|
+
var nextSource = arguments[i];
|
|
8288
|
+
if (nextSource === undefined || nextSource === null) {
|
|
8289
|
+
continue;
|
|
8290
|
+
}
|
|
8291
|
+
nextSource = Object(nextSource);
|
|
8292
|
+
|
|
8293
|
+
var keysArray = Object.keys(nextSource);
|
|
8294
|
+
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
|
8295
|
+
var nextKey = keysArray[nextIndex];
|
|
8296
|
+
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
8297
|
+
if (desc !== undefined && desc.enumerable) {
|
|
8298
|
+
to[nextKey] = nextSource[nextKey];
|
|
8299
|
+
}
|
|
8300
|
+
}
|
|
8301
|
+
}
|
|
8302
|
+
return to;
|
|
8303
|
+
}
|
|
8304
|
+
});
|
|
8305
|
+
}
|
|
8424
8306
|
|
|
8307
|
+
return Popper;
|
|
8308
|
+
});
|
|
8425
8309
|
|
|
8426
8310
|
/***/ }),
|
|
8427
8311
|
|
|
8428
|
-
/***/
|
|
8312
|
+
/***/ 59:
|
|
8429
8313
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8430
8314
|
|
|
8431
8315
|
"use strict";
|
|
@@ -8783,7 +8667,7 @@ function renderThumbStyle(_ref3) {
|
|
|
8783
8667
|
|
|
8784
8668
|
/***/ }),
|
|
8785
8669
|
|
|
8786
|
-
/***/
|
|
8670
|
+
/***/ 61:
|
|
8787
8671
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8788
8672
|
|
|
8789
8673
|
"use strict";
|
|
@@ -8921,7 +8805,7 @@ render._withStripped = true
|
|
|
8921
8805
|
// CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=4175d146&
|
|
8922
8806
|
|
|
8923
8807
|
// EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
|
|
8924
|
-
var menu_mixin = __webpack_require__(
|
|
8808
|
+
var menu_mixin = __webpack_require__(68);
|
|
8925
8809
|
|
|
8926
8810
|
// EXTERNAL MODULE: external "eoss/lib/tooltip"
|
|
8927
8811
|
var tooltip_ = __webpack_require__(36);
|
|
@@ -9146,7 +9030,7 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
9146
9030
|
|
|
9147
9031
|
/***/ }),
|
|
9148
9032
|
|
|
9149
|
-
/***/
|
|
9033
|
+
/***/ 62:
|
|
9150
9034
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9151
9035
|
|
|
9152
9036
|
"use strict";
|
|
@@ -9276,7 +9160,7 @@ aria.Utils.keys = {
|
|
|
9276
9160
|
|
|
9277
9161
|
/***/ }),
|
|
9278
9162
|
|
|
9279
|
-
/***/
|
|
9163
|
+
/***/ 68:
|
|
9280
9164
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9281
9165
|
|
|
9282
9166
|
"use strict";
|
|
@@ -9325,108 +9209,6 @@ aria.Utils.keys = {
|
|
|
9325
9209
|
|
|
9326
9210
|
/***/ }),
|
|
9327
9211
|
|
|
9328
|
-
/***/ 69:
|
|
9329
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9330
|
-
|
|
9331
|
-
"use strict";
|
|
9332
|
-
/* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
|
9333
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
var Transition = function () {
|
|
9338
|
-
function Transition() {
|
|
9339
|
-
_classCallCheck(this, Transition);
|
|
9340
|
-
}
|
|
9341
|
-
|
|
9342
|
-
Transition.prototype.beforeEnter = function beforeEnter(el) {
|
|
9343
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
|
|
9344
|
-
if (!el.dataset) el.dataset = {};
|
|
9345
|
-
if (el.dataset.state === 6 || !el.dataset.state) {
|
|
9346
|
-
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
9347
|
-
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
9348
|
-
}
|
|
9349
|
-
el.dataset.state = 1;
|
|
9350
|
-
|
|
9351
|
-
el.style.height = '0';
|
|
9352
|
-
el.style.paddingTop = 0;
|
|
9353
|
-
el.style.paddingBottom = 0;
|
|
9354
|
-
};
|
|
9355
|
-
|
|
9356
|
-
Transition.prototype.enter = function enter(el) {
|
|
9357
|
-
el.dataset.oldOverflow = el.style.overflow;
|
|
9358
|
-
if (el.scrollHeight !== 0) {
|
|
9359
|
-
el.style.height = el.scrollHeight + 'px';
|
|
9360
|
-
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
9361
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
9362
|
-
} else {
|
|
9363
|
-
el.style.height = '';
|
|
9364
|
-
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
9365
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
9366
|
-
}
|
|
9367
|
-
|
|
9368
|
-
el.dataset.state = 2;
|
|
9369
|
-
el.style.overflow = 'hidden';
|
|
9370
|
-
};
|
|
9371
|
-
|
|
9372
|
-
Transition.prototype.afterEnter = function afterEnter(el) {
|
|
9373
|
-
// for safari: remove class then reset height is necessary
|
|
9374
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
|
|
9375
|
-
el.style.height = '';
|
|
9376
|
-
el.style.overflow = el.dataset.oldOverflow;
|
|
9377
|
-
el.dataset.state = 3;
|
|
9378
|
-
};
|
|
9379
|
-
|
|
9380
|
-
Transition.prototype.beforeLeave = function beforeLeave(el) {
|
|
9381
|
-
if (!el.dataset) el.dataset = {};
|
|
9382
|
-
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
9383
|
-
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
9384
|
-
el.dataset.oldOverflow = el.style.overflow;
|
|
9385
|
-
el.dataset.state = 4;
|
|
9386
|
-
|
|
9387
|
-
el.style.height = el.scrollHeight + 'px';
|
|
9388
|
-
el.style.overflow = 'hidden';
|
|
9389
|
-
};
|
|
9390
|
-
|
|
9391
|
-
Transition.prototype.leave = function leave(el) {
|
|
9392
|
-
if (el.scrollHeight !== 0) {
|
|
9393
|
-
// for safari: add class after set height, or it will jump to zero height suddenly, weired
|
|
9394
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
|
|
9395
|
-
el.style.height = 0;
|
|
9396
|
-
el.style.paddingTop = 0;
|
|
9397
|
-
el.style.paddingBottom = 0;
|
|
9398
|
-
el.dataset.state = 5;
|
|
9399
|
-
}
|
|
9400
|
-
};
|
|
9401
|
-
|
|
9402
|
-
Transition.prototype.afterLeave = function afterLeave(el) {
|
|
9403
|
-
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
|
|
9404
|
-
el.style.height = '';
|
|
9405
|
-
el.style.overflow = el.dataset.oldOverflow;
|
|
9406
|
-
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
9407
|
-
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
9408
|
-
el.dataset.state = 6;
|
|
9409
|
-
};
|
|
9410
|
-
|
|
9411
|
-
return Transition;
|
|
9412
|
-
}();
|
|
9413
|
-
|
|
9414
|
-
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
9415
|
-
name: 'EsCollapseTransition',
|
|
9416
|
-
functional: true,
|
|
9417
|
-
render: function render(h, _ref) {
|
|
9418
|
-
var children = _ref.children;
|
|
9419
|
-
|
|
9420
|
-
var data = {
|
|
9421
|
-
on: new Transition()
|
|
9422
|
-
};
|
|
9423
|
-
|
|
9424
|
-
return h('transition', data, children);
|
|
9425
|
-
}
|
|
9426
|
-
});
|
|
9427
|
-
|
|
9428
|
-
/***/ }),
|
|
9429
|
-
|
|
9430
9212
|
/***/ 7:
|
|
9431
9213
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9432
9214
|
|
|
@@ -9477,946 +9259,1023 @@ var Transition = function () {
|
|
|
9477
9259
|
/* unused harmony export getSecond */
|
|
9478
9260
|
/* unused harmony export getWeekday */
|
|
9479
9261
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return timeCycle; });
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
* The MIT License (MIT)
|
|
9483
|
-
*
|
|
9484
|
-
* Copyright (c) 2015 Taylor Hakes
|
|
9485
|
-
*
|
|
9486
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9487
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9488
|
-
* in the Software without restriction, including without limitation the rights
|
|
9489
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9490
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
9491
|
-
* furnished to do so, subject to the following conditions:
|
|
9492
|
-
*
|
|
9493
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
9494
|
-
* copies or substantial portions of the Software.
|
|
9495
|
-
*
|
|
9496
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
9497
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
9498
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
9499
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
9500
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
9501
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
9502
|
-
* SOFTWARE.
|
|
9503
|
-
*/
|
|
9504
|
-
|
|
9505
|
-
/*eslint-disable*/
|
|
9506
|
-
// 把 YYYY-MM-DD 改成了 yyyy-MM-dd
|
|
9507
|
-
|
|
9508
|
-
|
|
9262
|
+
|
|
9263
|
+
|
|
9509
9264
|
/**
|
|
9510
9265
|
* Parse or format dates
|
|
9511
9266
|
* @class fecha
|
|
9512
|
-
*/
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
function regexEscape(str) {
|
|
9523
|
-
return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
|
|
9524
|
-
}
|
|
9525
|
-
|
|
9526
|
-
function shorten(arr, sLen) {
|
|
9527
|
-
|
|
9528
|
-
for (
|
|
9529
|
-
newArr.push(arr[i].substr(0, sLen));
|
|
9530
|
-
}
|
|
9531
|
-
return newArr;
|
|
9532
|
-
}
|
|
9533
|
-
|
|
9534
|
-
function monthUpdate() {
|
|
9535
|
-
return function (d, v) {
|
|
9536
|
-
|
|
9537
|
-
if (~index) {
|
|
9538
|
-
d.month = index;
|
|
9539
|
-
}
|
|
9540
|
-
};
|
|
9541
|
-
}
|
|
9542
|
-
|
|
9543
|
-
function pad(val, len) {
|
|
9544
|
-
val = String(val);
|
|
9545
|
-
len = len || 2;
|
|
9546
|
-
while (val.length < len) {
|
|
9547
|
-
val = '0' + val;
|
|
9548
|
-
}
|
|
9549
|
-
return val;
|
|
9550
|
-
}
|
|
9551
|
-
|
|
9552
|
-
// 直接使用中文日期名称常量
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
return D + '日';
|
|
9560
|
-
};
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
D: function(dateObj) {
|
|
9564
|
-
return dateObj.getDay();
|
|
9565
|
-
},
|
|
9566
|
-
DD: function(dateObj) {
|
|
9567
|
-
return pad(dateObj.getDay());
|
|
9568
|
-
},
|
|
9569
|
-
Do: function(dateObj) {
|
|
9570
|
-
return DoFn(dateObj.getDate());
|
|
9571
|
-
},
|
|
9572
|
-
d: function(dateObj) {
|
|
9573
|
-
return dateObj.getDate();
|
|
9574
|
-
},
|
|
9575
|
-
dd: function(dateObj) {
|
|
9576
|
-
return pad(dateObj.getDate());
|
|
9577
|
-
},
|
|
9578
|
-
ddd: function(dateObj) {
|
|
9579
|
-
return dayNamesShort[dateObj.getDay()];
|
|
9580
|
-
},
|
|
9581
|
-
dddd: function(dateObj) {
|
|
9582
|
-
return dayNames[dateObj.getDay()];
|
|
9583
|
-
},
|
|
9584
|
-
M: function(dateObj) {
|
|
9585
|
-
return dateObj.getMonth() + 1;
|
|
9586
|
-
},
|
|
9587
|
-
MM: function(dateObj) {
|
|
9588
|
-
return pad(dateObj.getMonth() + 1);
|
|
9589
|
-
},
|
|
9590
|
-
MMM: function(dateObj) {
|
|
9591
|
-
return monthNamesShort[dateObj.getMonth()];
|
|
9592
|
-
},
|
|
9593
|
-
MMMM: function(dateObj) {
|
|
9594
|
-
return monthNames[dateObj.getMonth()];
|
|
9595
|
-
},
|
|
9596
|
-
yy: function(dateObj) {
|
|
9597
|
-
return pad(String(dateObj.getFullYear()), 4).substr(2);
|
|
9598
|
-
},
|
|
9599
|
-
yyyy: function(dateObj) {
|
|
9600
|
-
return pad(dateObj.getFullYear(), 4);
|
|
9601
|
-
},
|
|
9602
|
-
h: function(dateObj) {
|
|
9603
|
-
return dateObj.getHours() % 12 || 12;
|
|
9604
|
-
},
|
|
9605
|
-
hh: function(dateObj) {
|
|
9606
|
-
return pad(dateObj.getHours() % 12 || 12);
|
|
9607
|
-
},
|
|
9608
|
-
H: function(dateObj) {
|
|
9609
|
-
return dateObj.getHours();
|
|
9610
|
-
},
|
|
9611
|
-
HH: function(dateObj) {
|
|
9612
|
-
return pad(dateObj.getHours());
|
|
9613
|
-
},
|
|
9614
|
-
m: function(dateObj) {
|
|
9615
|
-
return dateObj.getMinutes();
|
|
9616
|
-
},
|
|
9617
|
-
mm: function(dateObj) {
|
|
9618
|
-
return pad(dateObj.getMinutes());
|
|
9619
|
-
},
|
|
9620
|
-
s: function(dateObj) {
|
|
9621
|
-
return dateObj.getSeconds();
|
|
9622
|
-
},
|
|
9623
|
-
ss: function(dateObj) {
|
|
9624
|
-
return pad(dateObj.getSeconds());
|
|
9625
|
-
},
|
|
9626
|
-
S: function(dateObj) {
|
|
9627
|
-
return Math.round(dateObj.getMilliseconds() / 100);
|
|
9628
|
-
},
|
|
9629
|
-
SS: function(dateObj) {
|
|
9630
|
-
return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
|
|
9631
|
-
},
|
|
9632
|
-
SSS: function(dateObj) {
|
|
9633
|
-
return pad(dateObj.getMilliseconds(), 3);
|
|
9634
|
-
},
|
|
9635
|
-
a: function(dateObj) {
|
|
9636
|
-
return dateObj.getHours() < 12 ? '上午' : '下午';
|
|
9637
|
-
},
|
|
9638
|
-
A: function(dateObj) {
|
|
9639
|
-
return dateObj.getHours() < 12 ? '上午' : '下午';
|
|
9640
|
-
},
|
|
9641
|
-
ZZ: function(dateObj) {
|
|
9642
|
-
|
|
9643
|
-
return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
|
|
9644
|
-
}
|
|
9645
|
-
};
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
d: [twoDigits, function (d, v) {
|
|
9649
|
-
d.day = v;
|
|
9650
|
-
}],
|
|
9651
|
-
Do: [twoDigits + word, function (d, v) {
|
|
9652
|
-
d.day = parseInt(v, 10);
|
|
9653
|
-
}],
|
|
9654
|
-
M: [twoDigits, function (d, v) {
|
|
9655
|
-
d.month = v - 1;
|
|
9656
|
-
}],
|
|
9657
|
-
yy: [twoDigits, function (d, v) {
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
}
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
parseFlags.
|
|
9706
|
-
parseFlags.
|
|
9707
|
-
parseFlags.
|
|
9708
|
-
parseFlags.
|
|
9709
|
-
parseFlags.
|
|
9710
|
-
parseFlags.
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9267
|
+
*/
|
|
9268
|
+
var fecha = {};
|
|
9269
|
+
var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
|
|
9270
|
+
var twoDigits = '\\d\\d?';
|
|
9271
|
+
var threeDigits = '\\d{3}';
|
|
9272
|
+
var fourDigits = '\\d{4}';
|
|
9273
|
+
var word = '[^\\s]+';
|
|
9274
|
+
var literal = /\[([^]*?)\]/gm;
|
|
9275
|
+
var noop = function noop() {};
|
|
9276
|
+
|
|
9277
|
+
function regexEscape(str) {
|
|
9278
|
+
return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
|
|
9279
|
+
}
|
|
9280
|
+
|
|
9281
|
+
function shorten(arr, sLen) {
|
|
9282
|
+
var newArr = [];
|
|
9283
|
+
for (var i = 0, len = arr.length; i < len; i++) {
|
|
9284
|
+
newArr.push(arr[i].substr(0, sLen));
|
|
9285
|
+
}
|
|
9286
|
+
return newArr;
|
|
9287
|
+
}
|
|
9288
|
+
|
|
9289
|
+
function monthUpdate() {
|
|
9290
|
+
return function (d, v) {
|
|
9291
|
+
var index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
|
|
9292
|
+
if (~index) {
|
|
9293
|
+
d.month = index;
|
|
9294
|
+
}
|
|
9295
|
+
};
|
|
9296
|
+
}
|
|
9297
|
+
|
|
9298
|
+
function pad(val, len) {
|
|
9299
|
+
val = String(val);
|
|
9300
|
+
len = len || 2;
|
|
9301
|
+
while (val.length < len) {
|
|
9302
|
+
val = '0' + val;
|
|
9303
|
+
}
|
|
9304
|
+
return val;
|
|
9305
|
+
}
|
|
9306
|
+
|
|
9307
|
+
// 直接使用中文日期名称常量
|
|
9308
|
+
var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
|
9309
|
+
var monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
|
9310
|
+
var monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
|
|
9311
|
+
var dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
|
|
9312
|
+
var amPm = ['上午', '下午'];
|
|
9313
|
+
var DoFn = function DoFn(D) {
|
|
9314
|
+
return D + '日';
|
|
9315
|
+
};
|
|
9316
|
+
|
|
9317
|
+
var formatFlags = {
|
|
9318
|
+
D: function D(dateObj) {
|
|
9319
|
+
return dateObj.getDay();
|
|
9320
|
+
},
|
|
9321
|
+
DD: function DD(dateObj) {
|
|
9322
|
+
return pad(dateObj.getDay());
|
|
9323
|
+
},
|
|
9324
|
+
Do: function Do(dateObj) {
|
|
9325
|
+
return DoFn(dateObj.getDate());
|
|
9326
|
+
},
|
|
9327
|
+
d: function d(dateObj) {
|
|
9328
|
+
return dateObj.getDate();
|
|
9329
|
+
},
|
|
9330
|
+
dd: function dd(dateObj) {
|
|
9331
|
+
return pad(dateObj.getDate());
|
|
9332
|
+
},
|
|
9333
|
+
ddd: function ddd(dateObj) {
|
|
9334
|
+
return dayNamesShort[dateObj.getDay()];
|
|
9335
|
+
},
|
|
9336
|
+
dddd: function dddd(dateObj) {
|
|
9337
|
+
return dayNames[dateObj.getDay()];
|
|
9338
|
+
},
|
|
9339
|
+
M: function M(dateObj) {
|
|
9340
|
+
return dateObj.getMonth() + 1;
|
|
9341
|
+
},
|
|
9342
|
+
MM: function MM(dateObj) {
|
|
9343
|
+
return pad(dateObj.getMonth() + 1);
|
|
9344
|
+
},
|
|
9345
|
+
MMM: function MMM(dateObj) {
|
|
9346
|
+
return monthNamesShort[dateObj.getMonth()];
|
|
9347
|
+
},
|
|
9348
|
+
MMMM: function MMMM(dateObj) {
|
|
9349
|
+
return monthNames[dateObj.getMonth()];
|
|
9350
|
+
},
|
|
9351
|
+
yy: function yy(dateObj) {
|
|
9352
|
+
return pad(String(dateObj.getFullYear()), 4).substr(2);
|
|
9353
|
+
},
|
|
9354
|
+
yyyy: function yyyy(dateObj) {
|
|
9355
|
+
return pad(dateObj.getFullYear(), 4);
|
|
9356
|
+
},
|
|
9357
|
+
h: function h(dateObj) {
|
|
9358
|
+
return dateObj.getHours() % 12 || 12;
|
|
9359
|
+
},
|
|
9360
|
+
hh: function hh(dateObj) {
|
|
9361
|
+
return pad(dateObj.getHours() % 12 || 12);
|
|
9362
|
+
},
|
|
9363
|
+
H: function H(dateObj) {
|
|
9364
|
+
return dateObj.getHours();
|
|
9365
|
+
},
|
|
9366
|
+
HH: function HH(dateObj) {
|
|
9367
|
+
return pad(dateObj.getHours());
|
|
9368
|
+
},
|
|
9369
|
+
m: function m(dateObj) {
|
|
9370
|
+
return dateObj.getMinutes();
|
|
9371
|
+
},
|
|
9372
|
+
mm: function mm(dateObj) {
|
|
9373
|
+
return pad(dateObj.getMinutes());
|
|
9374
|
+
},
|
|
9375
|
+
s: function s(dateObj) {
|
|
9376
|
+
return dateObj.getSeconds();
|
|
9377
|
+
},
|
|
9378
|
+
ss: function ss(dateObj) {
|
|
9379
|
+
return pad(dateObj.getSeconds());
|
|
9380
|
+
},
|
|
9381
|
+
S: function S(dateObj) {
|
|
9382
|
+
return Math.round(dateObj.getMilliseconds() / 100);
|
|
9383
|
+
},
|
|
9384
|
+
SS: function SS(dateObj) {
|
|
9385
|
+
return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
|
|
9386
|
+
},
|
|
9387
|
+
SSS: function SSS(dateObj) {
|
|
9388
|
+
return pad(dateObj.getMilliseconds(), 3);
|
|
9389
|
+
},
|
|
9390
|
+
a: function a(dateObj) {
|
|
9391
|
+
return dateObj.getHours() < 12 ? '上午' : '下午';
|
|
9392
|
+
},
|
|
9393
|
+
A: function A(dateObj) {
|
|
9394
|
+
return dateObj.getHours() < 12 ? '上午' : '下午';
|
|
9395
|
+
},
|
|
9396
|
+
ZZ: function ZZ(dateObj) {
|
|
9397
|
+
var o = dateObj.getTimezoneOffset();
|
|
9398
|
+
return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
|
|
9399
|
+
}
|
|
9400
|
+
};
|
|
9401
|
+
|
|
9402
|
+
var parseFlags = {
|
|
9403
|
+
d: [twoDigits, function (d, v) {
|
|
9404
|
+
d.day = v;
|
|
9405
|
+
}],
|
|
9406
|
+
Do: [twoDigits + word, function (d, v) {
|
|
9407
|
+
d.day = parseInt(v, 10);
|
|
9408
|
+
}],
|
|
9409
|
+
M: [twoDigits, function (d, v) {
|
|
9410
|
+
d.month = v - 1;
|
|
9411
|
+
}],
|
|
9412
|
+
yy: [twoDigits, function (d, v) {
|
|
9413
|
+
var da = new Date(),
|
|
9414
|
+
cent = +('' + da.getFullYear()).substr(0, 2);
|
|
9415
|
+
d.year = '' + (v > 68 ? cent - 1 : cent) + v;
|
|
9416
|
+
}],
|
|
9417
|
+
h: [twoDigits, function (d, v) {
|
|
9418
|
+
d.hour = v;
|
|
9419
|
+
}],
|
|
9420
|
+
m: [twoDigits, function (d, v) {
|
|
9421
|
+
d.minute = v;
|
|
9422
|
+
}],
|
|
9423
|
+
s: [twoDigits, function (d, v) {
|
|
9424
|
+
d.second = v;
|
|
9425
|
+
}],
|
|
9426
|
+
yyyy: [fourDigits, function (d, v) {
|
|
9427
|
+
d.year = v;
|
|
9428
|
+
}],
|
|
9429
|
+
S: ['\\d', function (d, v) {
|
|
9430
|
+
d.millisecond = v * 100;
|
|
9431
|
+
}],
|
|
9432
|
+
SS: ['\\d{2}', function (d, v) {
|
|
9433
|
+
d.millisecond = v * 10;
|
|
9434
|
+
}],
|
|
9435
|
+
SSS: [threeDigits, function (d, v) {
|
|
9436
|
+
d.millisecond = v;
|
|
9437
|
+
}],
|
|
9438
|
+
D: [twoDigits, noop],
|
|
9439
|
+
ddd: [word, noop],
|
|
9440
|
+
MMM: [word, monthUpdate('monthNamesShort')],
|
|
9441
|
+
MMMM: [word, monthUpdate('monthNames')],
|
|
9442
|
+
a: [word, function (d, v) {
|
|
9443
|
+
var val = v.toLowerCase();
|
|
9444
|
+
if (val === '上午') {
|
|
9445
|
+
d.isPm = false;
|
|
9446
|
+
} else if (val === '下午') {
|
|
9447
|
+
d.isPm = true;
|
|
9448
|
+
}
|
|
9449
|
+
}],
|
|
9450
|
+
ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
|
|
9451
|
+
var parts = (v + '').match(/([+-]|\d\d)/gi),
|
|
9452
|
+
minutes = void 0;
|
|
9453
|
+
|
|
9454
|
+
if (parts) {
|
|
9455
|
+
minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
|
|
9456
|
+
d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
|
|
9457
|
+
}
|
|
9458
|
+
}]
|
|
9459
|
+
};
|
|
9460
|
+
parseFlags.dd = parseFlags.d;
|
|
9461
|
+
parseFlags.dddd = parseFlags.ddd;
|
|
9462
|
+
parseFlags.DD = parseFlags.D;
|
|
9463
|
+
parseFlags.mm = parseFlags.m;
|
|
9464
|
+
parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
|
|
9465
|
+
parseFlags.MM = parseFlags.M;
|
|
9466
|
+
parseFlags.ss = parseFlags.s;
|
|
9467
|
+
parseFlags.A = parseFlags.a;
|
|
9468
|
+
|
|
9469
|
+
// Some common format strings
|
|
9470
|
+
fecha.masks = {
|
|
9471
|
+
default: 'ddd MMM dd yyyy HH:mm:ss',
|
|
9472
|
+
shortDate: 'M/D/yy',
|
|
9473
|
+
mediumDate: 'MMM d, yyyy',
|
|
9474
|
+
longDate: 'MMMM d, yyyy',
|
|
9475
|
+
fullDate: 'dddd, MMMM d, yyyy',
|
|
9476
|
+
shortTime: 'HH:mm',
|
|
9477
|
+
mediumTime: 'HH:mm:ss',
|
|
9478
|
+
longTime: 'HH:mm:ss.SSS'
|
|
9479
|
+
};
|
|
9480
|
+
|
|
9725
9481
|
/***
|
|
9726
9482
|
* Format a date
|
|
9727
9483
|
* @method format
|
|
9728
9484
|
* @param {Date|number} dateObj
|
|
9729
9485
|
* @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
|
|
9730
|
-
*/
|
|
9731
|
-
fecha.format = function (dateObj, mask) {
|
|
9732
|
-
if (typeof dateObj === 'number') {
|
|
9733
|
-
dateObj = new Date(dateObj);
|
|
9734
|
-
}
|
|
9735
|
-
|
|
9736
|
-
if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
|
|
9737
|
-
throw new Error('Invalid Date in fecha.format');
|
|
9738
|
-
}
|
|
9739
|
-
|
|
9740
|
-
mask = fecha.masks[mask] || mask || fecha.masks['default'];
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
// Make literals inactive by replacing them with ??
|
|
9745
|
-
mask = mask.replace(literal, function($0, $1) {
|
|
9746
|
-
literals.push($1);
|
|
9747
|
-
return '@@@';
|
|
9748
|
-
});
|
|
9749
|
-
// Apply formatting rules
|
|
9750
|
-
mask = mask.replace(token, function ($0) {
|
|
9751
|
-
return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
|
|
9752
|
-
});
|
|
9753
|
-
// Inline literal values back into the formatted value
|
|
9754
|
-
return mask.replace(/@@@/g, function() {
|
|
9755
|
-
return literals.shift();
|
|
9756
|
-
});
|
|
9757
|
-
};
|
|
9758
|
-
|
|
9486
|
+
*/
|
|
9487
|
+
fecha.format = function (dateObj, mask) {
|
|
9488
|
+
if (typeof dateObj === 'number') {
|
|
9489
|
+
dateObj = new Date(dateObj);
|
|
9490
|
+
}
|
|
9491
|
+
|
|
9492
|
+
if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
|
|
9493
|
+
throw new Error('Invalid Date in fecha.format');
|
|
9494
|
+
}
|
|
9495
|
+
|
|
9496
|
+
mask = fecha.masks[mask] || mask || fecha.masks['default'];
|
|
9497
|
+
|
|
9498
|
+
var literals = [];
|
|
9499
|
+
|
|
9500
|
+
// Make literals inactive by replacing them with ??
|
|
9501
|
+
mask = mask.replace(literal, function ($0, $1) {
|
|
9502
|
+
literals.push($1);
|
|
9503
|
+
return '@@@';
|
|
9504
|
+
});
|
|
9505
|
+
// Apply formatting rules
|
|
9506
|
+
mask = mask.replace(token, function ($0) {
|
|
9507
|
+
return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
|
|
9508
|
+
});
|
|
9509
|
+
// Inline literal values back into the formatted value
|
|
9510
|
+
return mask.replace(/@@@/g, function () {
|
|
9511
|
+
return literals.shift();
|
|
9512
|
+
});
|
|
9513
|
+
};
|
|
9514
|
+
|
|
9759
9515
|
/**
|
|
9760
9516
|
* Parse a date string into an object, changes - into /
|
|
9761
9517
|
* @method parse
|
|
9762
9518
|
* @param {string} dateStr Date string
|
|
9763
9519
|
* @param {string} format Date parse format
|
|
9764
9520
|
* @returns {Date|boolean}
|
|
9765
|
-
*/
|
|
9766
|
-
fecha.parse = function (dateStr, format) {
|
|
9767
|
-
if (typeof format !== 'string') {
|
|
9768
|
-
throw new Error('Invalid format in fecha.parse');
|
|
9769
|
-
}
|
|
9770
|
-
|
|
9771
|
-
format = fecha.masks[format] || format;
|
|
9772
|
-
|
|
9773
|
-
// Avoid regular expression denial of service, fail early for really long strings
|
|
9774
|
-
// https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
|
|
9775
|
-
if (dateStr.length > 1000) {
|
|
9776
|
-
return null;
|
|
9777
|
-
}
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
format = format.replace(literal, function($0, $1) {
|
|
9783
|
-
literals.push($1);
|
|
9784
|
-
return '@@@';
|
|
9785
|
-
});
|
|
9786
|
-
|
|
9787
|
-
if (parseFlags[$0]) {
|
|
9788
|
-
|
|
9789
|
-
parseInfo.push(info[1]);
|
|
9790
|
-
return '(' + info[0] + ')';
|
|
9791
|
-
}
|
|
9792
|
-
|
|
9793
|
-
return $0;
|
|
9794
|
-
});
|
|
9795
|
-
newFormat = newFormat.replace(/@@@/g, function() {
|
|
9796
|
-
return literals.shift();
|
|
9797
|
-
});
|
|
9798
|
-
|
|
9799
|
-
if (!matches) {
|
|
9800
|
-
return null;
|
|
9801
|
-
}
|
|
9802
|
-
|
|
9803
|
-
for (
|
|
9804
|
-
parseInfo[i - 1](dateInfo, matches[i]);
|
|
9805
|
-
}
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
|
|
9809
|
-
dateInfo.hour = +dateInfo.hour + 12;
|
|
9810
|
-
} else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
|
|
9811
|
-
dateInfo.hour = 0;
|
|
9812
|
-
}
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
if (dateInfo.timezoneOffset != null) {
|
|
9816
|
-
dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
|
|
9817
|
-
date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
if (date
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
// 处理多种输入类型
|
|
9865
|
-
if (!date) return '';
|
|
9866
|
-
|
|
9867
|
-
// 如果是时间戳,转成日期对象
|
|
9868
|
-
if (typeof date === 'number') {
|
|
9869
|
-
date = new Date(date);
|
|
9870
|
-
}
|
|
9871
|
-
// 如果是字符串,转成日期对象
|
|
9872
|
-
if (typeof date === 'string') {
|
|
9873
|
-
date = new Date(date);
|
|
9874
|
-
}
|
|
9875
|
-
|
|
9876
|
-
// 调用toDate进一步验证和转换
|
|
9877
|
-
date = toDate(date);
|
|
9878
|
-
if (!date) return '';
|
|
9879
|
-
|
|
9880
|
-
// 兼容大写和小写的格式标记
|
|
9881
|
-
// 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
return
|
|
9903
|
-
}
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
//
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
|
|
9927
|
-
};
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
return prevDate(result,
|
|
9941
|
-
}
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
//
|
|
9961
|
-
|
|
9962
|
-
//
|
|
9963
|
-
|
|
9964
|
-
//
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
for (
|
|
9984
|
-
hours[i] =
|
|
9985
|
-
}
|
|
9986
|
-
}
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
}
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
};
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
}
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
return
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
};
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
return
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
};
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
return
|
|
10148
|
-
};
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
// Check if the current day is a
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
};
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
if (
|
|
10218
|
-
throw new Error(
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
9521
|
+
*/
|
|
9522
|
+
fecha.parse = function (dateStr, format) {
|
|
9523
|
+
if (typeof format !== 'string') {
|
|
9524
|
+
throw new Error('Invalid format in fecha.parse');
|
|
9525
|
+
}
|
|
9526
|
+
|
|
9527
|
+
format = fecha.masks[format] || format;
|
|
9528
|
+
|
|
9529
|
+
// Avoid regular expression denial of service, fail early for really long strings
|
|
9530
|
+
// https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
|
|
9531
|
+
if (dateStr.length > 1000) {
|
|
9532
|
+
return null;
|
|
9533
|
+
}
|
|
9534
|
+
|
|
9535
|
+
var dateInfo = {};
|
|
9536
|
+
var parseInfo = [];
|
|
9537
|
+
var literals = [];
|
|
9538
|
+
format = format.replace(literal, function ($0, $1) {
|
|
9539
|
+
literals.push($1);
|
|
9540
|
+
return '@@@';
|
|
9541
|
+
});
|
|
9542
|
+
var newFormat = regexEscape(format).replace(token, function ($0) {
|
|
9543
|
+
if (parseFlags[$0]) {
|
|
9544
|
+
var info = parseFlags[$0];
|
|
9545
|
+
parseInfo.push(info[1]);
|
|
9546
|
+
return '(' + info[0] + ')';
|
|
9547
|
+
}
|
|
9548
|
+
|
|
9549
|
+
return $0;
|
|
9550
|
+
});
|
|
9551
|
+
newFormat = newFormat.replace(/@@@/g, function () {
|
|
9552
|
+
return literals.shift();
|
|
9553
|
+
});
|
|
9554
|
+
var matches = dateStr.match(new RegExp(newFormat, 'i'));
|
|
9555
|
+
if (!matches) {
|
|
9556
|
+
return null;
|
|
9557
|
+
}
|
|
9558
|
+
|
|
9559
|
+
for (var i = 1; i < matches.length; i++) {
|
|
9560
|
+
parseInfo[i - 1](dateInfo, matches[i]);
|
|
9561
|
+
}
|
|
9562
|
+
|
|
9563
|
+
var today = new Date();
|
|
9564
|
+
if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
|
|
9565
|
+
dateInfo.hour = +dateInfo.hour + 12;
|
|
9566
|
+
} else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
|
|
9567
|
+
dateInfo.hour = 0;
|
|
9568
|
+
}
|
|
9569
|
+
|
|
9570
|
+
var date = void 0;
|
|
9571
|
+
if (dateInfo.timezoneOffset != null) {
|
|
9572
|
+
dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
|
|
9573
|
+
date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
|
|
9574
|
+
} else {
|
|
9575
|
+
date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
|
|
9576
|
+
}
|
|
9577
|
+
return date;
|
|
9578
|
+
};
|
|
9579
|
+
|
|
9580
|
+
// 导出fecha对象
|
|
9581
|
+
|
|
9582
|
+
|
|
9583
|
+
// 以下是从date-util.js合并的函数
|
|
9584
|
+
var newArray = function newArray(start, end) {
|
|
9585
|
+
var result = [];
|
|
9586
|
+
for (var i = start; i <= end; i++) {
|
|
9587
|
+
result.push(i);
|
|
9588
|
+
}
|
|
9589
|
+
return result;
|
|
9590
|
+
};
|
|
9591
|
+
|
|
9592
|
+
var getSettings = function getSettings() {
|
|
9593
|
+
return {
|
|
9594
|
+
dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
|
|
9595
|
+
dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
|
9596
|
+
monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
9597
|
+
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
9598
|
+
amPm: ['上午', '下午']
|
|
9599
|
+
};
|
|
9600
|
+
};
|
|
9601
|
+
|
|
9602
|
+
var toDate = function toDate(date) {
|
|
9603
|
+
return isDate(date) ? new Date(date) : null;
|
|
9604
|
+
};
|
|
9605
|
+
|
|
9606
|
+
var isDate = function isDate(date) {
|
|
9607
|
+
if (date === null || date === undefined) return false;
|
|
9608
|
+
if (isNaN(new Date(date).getTime())) return false;
|
|
9609
|
+
if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
|
|
9610
|
+
return true;
|
|
9611
|
+
};
|
|
9612
|
+
|
|
9613
|
+
var isDateObject = function isDateObject(val) {
|
|
9614
|
+
return val instanceof Date;
|
|
9615
|
+
};
|
|
9616
|
+
|
|
9617
|
+
var formatDate = function formatDate(date) {
|
|
9618
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
|
|
9619
|
+
|
|
9620
|
+
// 处理多种输入类型
|
|
9621
|
+
if (!date) return '';
|
|
9622
|
+
|
|
9623
|
+
// 如果是时间戳,转成日期对象
|
|
9624
|
+
if (typeof date === 'number') {
|
|
9625
|
+
date = new Date(date);
|
|
9626
|
+
}
|
|
9627
|
+
// 如果是字符串,转成日期对象
|
|
9628
|
+
if (typeof date === 'string') {
|
|
9629
|
+
date = new Date(date);
|
|
9630
|
+
}
|
|
9631
|
+
|
|
9632
|
+
// 调用toDate进一步验证和转换
|
|
9633
|
+
date = toDate(date);
|
|
9634
|
+
if (!date) return '';
|
|
9635
|
+
|
|
9636
|
+
// 兼容大写和小写的格式标记
|
|
9637
|
+
// 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
|
|
9638
|
+
var lowercaseFormat = format.replace(/YYYY/g, 'yyyy').replace(/D/g, 'd');
|
|
9639
|
+
|
|
9640
|
+
// 使用fecha库进行格式化,支持中文配置
|
|
9641
|
+
var str = fecha.format(date, lowercaseFormat, getSettings());
|
|
9642
|
+
return str;
|
|
9643
|
+
};
|
|
9644
|
+
|
|
9645
|
+
var parseDate = function parseDate(string, format) {
|
|
9646
|
+
return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
|
|
9647
|
+
};
|
|
9648
|
+
|
|
9649
|
+
var getDayCountOfMonth = function getDayCountOfMonth(year, month) {
|
|
9650
|
+
if (month === 3 || month === 5 || month === 8 || month === 10) {
|
|
9651
|
+
return 30;
|
|
9652
|
+
}
|
|
9653
|
+
|
|
9654
|
+
if (month === 1) {
|
|
9655
|
+
if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
|
|
9656
|
+
return 29;
|
|
9657
|
+
} else {
|
|
9658
|
+
return 28;
|
|
9659
|
+
}
|
|
9660
|
+
}
|
|
9661
|
+
|
|
9662
|
+
return 31;
|
|
9663
|
+
};
|
|
9664
|
+
|
|
9665
|
+
var getDayCountOfYear = function getDayCountOfYear(year) {
|
|
9666
|
+
var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
|
|
9667
|
+
return isLeapYear ? 366 : 365;
|
|
9668
|
+
};
|
|
9669
|
+
|
|
9670
|
+
var getFirstDayOfMonth = function getFirstDayOfMonth(date) {
|
|
9671
|
+
var temp = new Date(date.getTime());
|
|
9672
|
+
temp.setDate(1);
|
|
9673
|
+
return temp.getDay();
|
|
9674
|
+
};
|
|
9675
|
+
|
|
9676
|
+
// see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
|
|
9677
|
+
// {prev, next} Date should work for Daylight Saving Time
|
|
9678
|
+
// Adding 24 * 60 * 60 * 1000 does not work in the above scenario
|
|
9679
|
+
var prevDate = function prevDate(date) {
|
|
9680
|
+
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9681
|
+
|
|
9682
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
|
|
9683
|
+
};
|
|
9684
|
+
|
|
9685
|
+
var nextDate = function nextDate(date) {
|
|
9686
|
+
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9687
|
+
|
|
9688
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
9689
|
+
};
|
|
9690
|
+
|
|
9691
|
+
var getStartDateOfMonth = function getStartDateOfMonth(year, month) {
|
|
9692
|
+
var result = new Date(year, month, 1);
|
|
9693
|
+
var day = result.getDay();
|
|
9694
|
+
|
|
9695
|
+
if (day === 0) {
|
|
9696
|
+
return prevDate(result, 7);
|
|
9697
|
+
} else {
|
|
9698
|
+
return prevDate(result, day);
|
|
9699
|
+
}
|
|
9700
|
+
};
|
|
9701
|
+
|
|
9702
|
+
var getWeekNumber = function getWeekNumber(date) {
|
|
9703
|
+
// 支持多种输入类型
|
|
9704
|
+
if (!date || !isDate(date)) {
|
|
9705
|
+
date = new Date();
|
|
9706
|
+
}
|
|
9707
|
+
if (typeof date === 'string') {
|
|
9708
|
+
date = new Date(date);
|
|
9709
|
+
}
|
|
9710
|
+
|
|
9711
|
+
// 验证日期有效性
|
|
9712
|
+
if (!isDate(date)) return null;
|
|
9713
|
+
|
|
9714
|
+
var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
9715
|
+
// 设置为最近的星期四:当前日期 + 4 - 当前星期数
|
|
9716
|
+
// 将星期日的星期数设为7
|
|
9717
|
+
d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
|
|
9718
|
+
// 获取当年的第一天
|
|
9719
|
+
var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
|
|
9720
|
+
// 计算到最近的星期四的完整周数
|
|
9721
|
+
var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
|
|
9722
|
+
// 返回周数
|
|
9723
|
+
return weekNo;
|
|
9724
|
+
};
|
|
9725
|
+
|
|
9726
|
+
var getRangeHours = function getRangeHours(ranges) {
|
|
9727
|
+
var hours = [];
|
|
9728
|
+
var disabledHours = [];
|
|
9729
|
+
|
|
9730
|
+
(ranges || []).forEach(function (range) {
|
|
9731
|
+
var value = range.map(function (date) {
|
|
9732
|
+
return date.getHours();
|
|
9733
|
+
});
|
|
9734
|
+
|
|
9735
|
+
disabledHours = disabledHours.concat(newArray(value[0], value[1]));
|
|
9736
|
+
});
|
|
9737
|
+
|
|
9738
|
+
if (disabledHours.length) {
|
|
9739
|
+
for (var i = 0; i < 24; i++) {
|
|
9740
|
+
hours[i] = disabledHours.indexOf(i) === -1;
|
|
9741
|
+
}
|
|
9742
|
+
} else {
|
|
9743
|
+
for (var _i = 0; _i < 24; _i++) {
|
|
9744
|
+
hours[_i] = false;
|
|
9745
|
+
}
|
|
9746
|
+
}
|
|
9747
|
+
|
|
9748
|
+
return hours;
|
|
9749
|
+
};
|
|
9750
|
+
|
|
9751
|
+
var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
|
|
9752
|
+
if (amount <= 0) return [];
|
|
9753
|
+
var temp = new Date(date.getTime());
|
|
9754
|
+
temp.setDate(0);
|
|
9755
|
+
var lastDay = temp.getDate();
|
|
9756
|
+
return range(amount).map(function (_, index) {
|
|
9757
|
+
return lastDay - (amount - index - 1);
|
|
9758
|
+
});
|
|
9759
|
+
};
|
|
9760
|
+
|
|
9761
|
+
var getMonthDays = function getMonthDays(date) {
|
|
9762
|
+
var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
9763
|
+
var days = temp.getDate();
|
|
9764
|
+
return range(days).map(function (_, index) {
|
|
9765
|
+
return index + 1;
|
|
9766
|
+
});
|
|
9767
|
+
};
|
|
9768
|
+
|
|
9769
|
+
function setRangeData(arr, start, end, value) {
|
|
9770
|
+
for (var i = start; i < end; i++) {
|
|
9771
|
+
arr[i] = value;
|
|
9772
|
+
}
|
|
9773
|
+
}
|
|
9774
|
+
|
|
9775
|
+
var getRangeMinutes = function getRangeMinutes(ranges, hour) {
|
|
9776
|
+
var minutes = new Array(60);
|
|
9777
|
+
|
|
9778
|
+
if (ranges.length > 0) {
|
|
9779
|
+
ranges.forEach(function (range) {
|
|
9780
|
+
var start = range[0];
|
|
9781
|
+
var end = range[1];
|
|
9782
|
+
var startHour = start.getHours();
|
|
9783
|
+
var startMinute = start.getMinutes();
|
|
9784
|
+
var endHour = end.getHours();
|
|
9785
|
+
var endMinute = end.getMinutes();
|
|
9786
|
+
if (startHour === hour && endHour !== hour) {
|
|
9787
|
+
setRangeData(minutes, startMinute, 60, true);
|
|
9788
|
+
} else if (startHour === hour && endHour === hour) {
|
|
9789
|
+
setRangeData(minutes, startMinute, endMinute + 1, true);
|
|
9790
|
+
} else if (startHour !== hour && endHour === hour) {
|
|
9791
|
+
setRangeData(minutes, 0, endMinute + 1, true);
|
|
9792
|
+
} else if (startHour < hour && endHour > hour) {
|
|
9793
|
+
setRangeData(minutes, 0, 60, true);
|
|
9794
|
+
}
|
|
9795
|
+
});
|
|
9796
|
+
} else {
|
|
9797
|
+
setRangeData(minutes, 0, 60, true);
|
|
9798
|
+
}
|
|
9799
|
+
return minutes;
|
|
9800
|
+
};
|
|
9801
|
+
|
|
9802
|
+
var range = function range(n) {
|
|
9803
|
+
// see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
|
|
9804
|
+
return Array.apply(null, { length: n }).map(function (_, n) {
|
|
9805
|
+
return n;
|
|
9806
|
+
});
|
|
9807
|
+
};
|
|
9808
|
+
|
|
9809
|
+
var modifyDate = function modifyDate(date, y, m, d) {
|
|
9810
|
+
return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
9811
|
+
};
|
|
9812
|
+
|
|
9813
|
+
var modifyTime = function modifyTime(date, h, m, s) {
|
|
9814
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
|
|
9815
|
+
};
|
|
9816
|
+
|
|
9817
|
+
var modifyWithTimeString = function modifyWithTimeString(date, time) {
|
|
9818
|
+
if (date == null || !time) {
|
|
9819
|
+
return date;
|
|
9820
|
+
}
|
|
9821
|
+
time = parseDate(time, 'HH:mm:ss');
|
|
9822
|
+
return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
|
|
9823
|
+
};
|
|
9824
|
+
|
|
9825
|
+
var clearTime = function clearTime(date) {
|
|
9826
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
9827
|
+
};
|
|
9828
|
+
|
|
9829
|
+
var clearMilliseconds = function clearMilliseconds(date) {
|
|
9830
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
|
|
9831
|
+
};
|
|
9832
|
+
|
|
9833
|
+
var limitTimeRange = function limitTimeRange(date, ranges) {
|
|
9834
|
+
var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
|
|
9835
|
+
|
|
9836
|
+
// TODO: refactory a more elegant solution
|
|
9837
|
+
if (ranges.length === 0) return date;
|
|
9838
|
+
var normalizeDate = function normalizeDate(date) {
|
|
9839
|
+
return fecha.parse(fecha.format(date, format), format);
|
|
9840
|
+
};
|
|
9841
|
+
var ndate = normalizeDate(date);
|
|
9842
|
+
var nranges = ranges.map(function (range) {
|
|
9843
|
+
return range.map(normalizeDate);
|
|
9844
|
+
});
|
|
9845
|
+
if (nranges.some(function (nrange) {
|
|
9846
|
+
return ndate >= nrange[0] && ndate <= nrange[1];
|
|
9847
|
+
})) return date;
|
|
9848
|
+
|
|
9849
|
+
var minDate = nranges[0][0];
|
|
9850
|
+
var maxDate = nranges[0][0];
|
|
9851
|
+
|
|
9852
|
+
nranges.forEach(function (nrange) {
|
|
9853
|
+
minDate = new Date(Math.min(nrange[0], minDate));
|
|
9854
|
+
maxDate = new Date(Math.max(nrange[1], minDate));
|
|
9855
|
+
});
|
|
9856
|
+
|
|
9857
|
+
var ret = ndate < minDate ? minDate : maxDate;
|
|
9858
|
+
// preserve Year/Month/Date
|
|
9859
|
+
return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
|
|
9860
|
+
};
|
|
9861
|
+
|
|
9862
|
+
var timeWithinRange = function timeWithinRange(date, selectableRange, format) {
|
|
9863
|
+
var limitedDate = limitTimeRange(date, selectableRange, format);
|
|
9864
|
+
return limitedDate.getTime() === date.getTime();
|
|
9865
|
+
};
|
|
9866
|
+
|
|
9867
|
+
var changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
|
|
9868
|
+
// clamp date to the number of days in `year`, `month`
|
|
9869
|
+
// eg: (2010-1-31, 2010, 2) => 2010-2-28
|
|
9870
|
+
var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
|
|
9871
|
+
return modifyDate(date, year, month, monthDate);
|
|
9872
|
+
};
|
|
9873
|
+
|
|
9874
|
+
var prevMonth = function prevMonth(date) {
|
|
9875
|
+
var year = date.getFullYear();
|
|
9876
|
+
var month = date.getMonth();
|
|
9877
|
+
return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
|
|
9878
|
+
};
|
|
9879
|
+
|
|
9880
|
+
var nextMonth = function nextMonth(date) {
|
|
9881
|
+
var year = date.getFullYear();
|
|
9882
|
+
var month = date.getMonth();
|
|
9883
|
+
return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
|
|
9884
|
+
};
|
|
9885
|
+
|
|
9886
|
+
var prevYear = function prevYear(date) {
|
|
9887
|
+
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9888
|
+
|
|
9889
|
+
var year = date.getFullYear();
|
|
9890
|
+
var month = date.getMonth();
|
|
9891
|
+
return changeYearMonthAndClampDate(date, year - amount, month);
|
|
9892
|
+
};
|
|
9893
|
+
|
|
9894
|
+
var nextYear = function nextYear(date) {
|
|
9895
|
+
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9896
|
+
|
|
9897
|
+
var year = date.getFullYear();
|
|
9898
|
+
var month = date.getMonth();
|
|
9899
|
+
return changeYearMonthAndClampDate(date, year + amount, month);
|
|
9900
|
+
};
|
|
9901
|
+
|
|
9902
|
+
var extractDateFormat = function extractDateFormat(format) {
|
|
9903
|
+
return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
|
|
9904
|
+
};
|
|
9905
|
+
|
|
9906
|
+
var extractTimeFormat = function extractTimeFormat(format) {
|
|
9907
|
+
return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
|
|
9908
|
+
};
|
|
9909
|
+
|
|
9910
|
+
var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
|
|
9911
|
+
return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
|
|
9912
|
+
};
|
|
9913
|
+
|
|
9914
|
+
/**
|
|
9915
|
+
* 计算两个日期之间的工作日数量(不包括周末和节假日)
|
|
9916
|
+
* @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
|
|
9917
|
+
* @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
|
|
9918
|
+
* @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
|
|
9919
|
+
* @returns {number} 工作日数量
|
|
9920
|
+
*/
|
|
9921
|
+
var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
|
|
9922
|
+
var holidays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
9923
|
+
|
|
9924
|
+
if (typeof start_date !== 'string' || typeof end_date !== 'string') {
|
|
9925
|
+
throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
|
|
9926
|
+
}
|
|
9927
|
+
|
|
9928
|
+
var startDateObj = new Date(start_date);
|
|
9929
|
+
var endDateObj = new Date(end_date);
|
|
9930
|
+
|
|
9931
|
+
if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
|
|
9932
|
+
throw new Error("Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'.");
|
|
9933
|
+
}
|
|
9934
|
+
|
|
9935
|
+
if (startDateObj > endDateObj) {
|
|
9936
|
+
throw new Error('Start date should be earlier than or equal to end date.');
|
|
9937
|
+
}
|
|
9938
|
+
|
|
9939
|
+
var workdays = 0;
|
|
9940
|
+
|
|
9941
|
+
// Iterate through each day in the date range
|
|
9942
|
+
|
|
9943
|
+
var _loop = function _loop(currentDate) {
|
|
9944
|
+
// Check if the current day is a weekend (Saturday or Sunday)
|
|
9945
|
+
var isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
|
|
9946
|
+
|
|
9947
|
+
// Check if the current day is a holiday
|
|
9948
|
+
var isHoliday = holidays.some(function (holiday) {
|
|
9949
|
+
var holidayDate = new Date(holiday);
|
|
9950
|
+
return currentDate.toDateString() === holidayDate.toDateString();
|
|
9951
|
+
});
|
|
9952
|
+
|
|
9953
|
+
// If it's a workday (not a weekend or holiday), increment the workdays count
|
|
9954
|
+
if (!isWeekend && !isHoliday) {
|
|
9955
|
+
workdays++;
|
|
9956
|
+
}
|
|
9957
|
+
};
|
|
9958
|
+
|
|
9959
|
+
for (var currentDate = new Date(startDateObj); currentDate <= endDateObj; currentDate.setDate(currentDate.getDate() + 1)) {
|
|
9960
|
+
_loop(currentDate);
|
|
9961
|
+
}
|
|
9962
|
+
|
|
9963
|
+
return workdays;
|
|
9964
|
+
};
|
|
9965
|
+
|
|
9966
|
+
/**
|
|
9967
|
+
* 日期加减天数
|
|
9968
|
+
* @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
|
|
9969
|
+
* @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
|
|
9970
|
+
* @returns {string} 结果日期,格式为 "YYYY-MM-DD"
|
|
9971
|
+
*/
|
|
9972
|
+
var dateAddDays = function dateAddDays(start_date, days) {
|
|
9973
|
+
if (typeof start_date !== 'string' || !Number.isInteger(days)) {
|
|
9974
|
+
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days.");
|
|
9975
|
+
}
|
|
9976
|
+
|
|
9977
|
+
var startDateObj = new Date(start_date);
|
|
9978
|
+
if (isNaN(startDateObj.getTime())) {
|
|
9979
|
+
throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
9980
|
+
}
|
|
9981
|
+
|
|
9982
|
+
var resultDateObj = new Date(startDateObj);
|
|
9983
|
+
resultDateObj.setDate(resultDateObj.getDate() + days);
|
|
9984
|
+
|
|
9985
|
+
var resultYear = resultDateObj.getFullYear();
|
|
9986
|
+
var resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
|
|
9987
|
+
var resultDay = String(resultDateObj.getDate()).padStart(2, '0');
|
|
9988
|
+
|
|
9989
|
+
return resultYear + '-' + resultMonth + '-' + resultDay;
|
|
9990
|
+
};
|
|
9991
|
+
|
|
9992
|
+
/**
|
|
10234
9993
|
* 计算两个日期之间的差值
|
|
10235
9994
|
* @date 2023年12月14日
|
|
10236
9995
|
* @param {String} start_date - 起始日期字符串
|
|
10237
9996
|
* @param {String} end_date - 结束日期字符串
|
|
10238
9997
|
* @param {String} unit - 单位:year/month/day
|
|
10239
9998
|
* @returns {Number} 差值
|
|
10240
|
-
*/
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
return (
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
9999
|
+
*/
|
|
10000
|
+
var dateDiff = function dateDiff(start_date, end_date) {
|
|
10001
|
+
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
|
|
10002
|
+
|
|
10003
|
+
// Assuming date strings are in "YYYY-MM-DD" format
|
|
10004
|
+
var startDate = new Date(start_date);
|
|
10005
|
+
var endDate = new Date(end_date);
|
|
10006
|
+
|
|
10007
|
+
// If the date is invalid, return 0
|
|
10008
|
+
if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
|
|
10009
|
+
return 0;
|
|
10010
|
+
}
|
|
10011
|
+
|
|
10012
|
+
if (unit === 'year') {
|
|
10013
|
+
return endDate.getFullYear() - startDate.getFullYear();
|
|
10014
|
+
} else if (unit === 'month') {
|
|
10015
|
+
return (endDate.getFullYear() - startDate.getFullYear()) * 12 + (endDate.getMonth() - startDate.getMonth());
|
|
10016
|
+
} else {
|
|
10017
|
+
// Default to day
|
|
10018
|
+
var timeDifference = endDate - startDate;
|
|
10019
|
+
// Calculate days (86400000 milliseconds per day)
|
|
10020
|
+
return Math.floor(timeDifference / 86400000);
|
|
10021
|
+
}
|
|
10022
|
+
};
|
|
10023
|
+
|
|
10266
10024
|
/**
|
|
10267
10025
|
* 获取月份中的日期
|
|
10268
10026
|
* @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
|
|
10269
10027
|
* @returns {number} 月份中的日期(1-31)
|
|
10270
|
-
*/
|
|
10271
|
-
|
|
10272
|
-
if (typeof date !== 'string') {
|
|
10273
|
-
throw new Error(
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
return dateObj.getDate();
|
|
10286
|
-
};
|
|
10287
|
-
|
|
10028
|
+
*/
|
|
10029
|
+
var dayOfMonth = function dayOfMonth(date) {
|
|
10030
|
+
if (typeof date !== 'string') {
|
|
10031
|
+
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
10032
|
+
}
|
|
10033
|
+
|
|
10034
|
+
var dateObj = new Date(date);
|
|
10035
|
+
if (isNaN(dateObj.getTime())) {
|
|
10036
|
+
throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
10037
|
+
}
|
|
10038
|
+
|
|
10039
|
+
return dateObj.getDate();
|
|
10040
|
+
};
|
|
10041
|
+
|
|
10288
10042
|
/**
|
|
10289
10043
|
* 获取当前日期
|
|
10290
10044
|
* @date 2022年5月7日
|
|
10291
10045
|
* @param {string} format - 日期格式,默认为'YYYY-MM-DD'
|
|
10292
10046
|
* @returns {string} 当前日期的格式化字符串
|
|
10293
|
-
*/
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10047
|
+
*/
|
|
10048
|
+
var getCurrentDate = function getCurrentDate() {
|
|
10049
|
+
var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD';
|
|
10050
|
+
|
|
10051
|
+
return formatDate(new Date(), format);
|
|
10052
|
+
};
|
|
10053
|
+
|
|
10298
10054
|
/**
|
|
10299
10055
|
* 获取当前日期时间
|
|
10300
10056
|
* @date 2022年5月7日
|
|
10301
10057
|
* @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
|
|
10302
10058
|
* @returns {string} 当前日期时间的格式化字符串
|
|
10303
|
-
*/
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10059
|
+
*/
|
|
10060
|
+
var getCurrentDateTime = function getCurrentDateTime() {
|
|
10061
|
+
var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD HH:mm:ss';
|
|
10062
|
+
|
|
10063
|
+
return formatDate(new Date(), format);
|
|
10064
|
+
};
|
|
10065
|
+
|
|
10308
10066
|
/**
|
|
10309
10067
|
* 获取小时
|
|
10310
10068
|
* @date 2022年5月7日
|
|
10311
10069
|
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
10312
10070
|
* @returns {number} 小时数(0-23)
|
|
10313
|
-
*/
|
|
10314
|
-
|
|
10315
|
-
if (!date) {
|
|
10316
|
-
return new Date().getHours();
|
|
10317
|
-
}
|
|
10318
|
-
if (typeof date === 'string') {
|
|
10319
|
-
date = new Date(date);
|
|
10320
|
-
}
|
|
10321
|
-
return date.getHours();
|
|
10322
|
-
};
|
|
10323
|
-
|
|
10071
|
+
*/
|
|
10072
|
+
var getHour = function getHour(date) {
|
|
10073
|
+
if (!date) {
|
|
10074
|
+
return new Date().getHours();
|
|
10075
|
+
}
|
|
10076
|
+
if (typeof date === 'string') {
|
|
10077
|
+
date = new Date(date);
|
|
10078
|
+
}
|
|
10079
|
+
return date.getHours();
|
|
10080
|
+
};
|
|
10081
|
+
|
|
10324
10082
|
/**
|
|
10325
10083
|
* 获取分钟
|
|
10326
10084
|
* @date 2022年5月7日
|
|
10327
10085
|
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
10328
10086
|
* @returns {number} 分钟数(0-59)
|
|
10329
|
-
*/
|
|
10330
|
-
|
|
10331
|
-
if (!date) {
|
|
10332
|
-
return new Date().getMinutes();
|
|
10333
|
-
}
|
|
10334
|
-
if (typeof date === 'string') {
|
|
10335
|
-
date = new Date(date);
|
|
10336
|
-
}
|
|
10337
|
-
return date.getMinutes();
|
|
10338
|
-
};
|
|
10339
|
-
|
|
10087
|
+
*/
|
|
10088
|
+
var getMinute = function getMinute(date) {
|
|
10089
|
+
if (!date) {
|
|
10090
|
+
return new Date().getMinutes();
|
|
10091
|
+
}
|
|
10092
|
+
if (typeof date === 'string') {
|
|
10093
|
+
date = new Date(date);
|
|
10094
|
+
}
|
|
10095
|
+
return date.getMinutes();
|
|
10096
|
+
};
|
|
10097
|
+
|
|
10340
10098
|
/**
|
|
10341
10099
|
* 获取月份
|
|
10342
10100
|
* @date 2022年5月7日
|
|
10343
10101
|
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
10344
10102
|
* @returns {number} 月份数(1-12)
|
|
10345
|
-
*/
|
|
10346
|
-
|
|
10347
|
-
if (!date) {
|
|
10348
|
-
return new Date().getMonth() + 1;
|
|
10349
|
-
}
|
|
10350
|
-
if (typeof date === 'string') {
|
|
10351
|
-
date = new Date(date);
|
|
10352
|
-
}
|
|
10353
|
-
return date.getMonth() + 1;
|
|
10354
|
-
};
|
|
10355
|
-
|
|
10103
|
+
*/
|
|
10104
|
+
var getMonth = function getMonth(date) {
|
|
10105
|
+
if (!date) {
|
|
10106
|
+
return new Date().getMonth() + 1;
|
|
10107
|
+
}
|
|
10108
|
+
if (typeof date === 'string') {
|
|
10109
|
+
date = new Date(date);
|
|
10110
|
+
}
|
|
10111
|
+
return date.getMonth() + 1;
|
|
10112
|
+
};
|
|
10113
|
+
|
|
10356
10114
|
/**
|
|
10357
10115
|
* 获取秒
|
|
10358
10116
|
* @date 2022年5月7日
|
|
10359
10117
|
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
10360
10118
|
* @returns {number} 秒数(0-59)
|
|
10361
|
-
*/
|
|
10362
|
-
|
|
10363
|
-
if (!date) {
|
|
10364
|
-
return new Date().getSeconds();
|
|
10365
|
-
}
|
|
10366
|
-
if (typeof date === 'string') {
|
|
10367
|
-
date = new Date(date);
|
|
10368
|
-
}
|
|
10369
|
-
return date.getSeconds();
|
|
10370
|
-
};
|
|
10371
|
-
|
|
10119
|
+
*/
|
|
10120
|
+
var getSecond = function getSecond(date) {
|
|
10121
|
+
if (!date) {
|
|
10122
|
+
return new Date().getSeconds();
|
|
10123
|
+
}
|
|
10124
|
+
if (typeof date === 'string') {
|
|
10125
|
+
date = new Date(date);
|
|
10126
|
+
}
|
|
10127
|
+
return date.getSeconds();
|
|
10128
|
+
};
|
|
10129
|
+
|
|
10372
10130
|
/**
|
|
10373
10131
|
* 获取星期几
|
|
10374
10132
|
* @date 2022年5月7日
|
|
10375
10133
|
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
10376
10134
|
* @returns {number} 星期几(0-6,0表示星期日)
|
|
10377
|
-
*/
|
|
10378
|
-
|
|
10379
|
-
if (!date) {
|
|
10380
|
-
return new Date().getDay();
|
|
10381
|
-
}
|
|
10382
|
-
if (typeof date === 'string') {
|
|
10383
|
-
date = new Date(date);
|
|
10384
|
-
}
|
|
10385
|
-
return date.getDay();
|
|
10386
|
-
};
|
|
10387
|
-
|
|
10388
|
-
|
|
10135
|
+
*/
|
|
10136
|
+
var getWeekday = function getWeekday(date) {
|
|
10137
|
+
if (!date) {
|
|
10138
|
+
return new Date().getDay();
|
|
10139
|
+
}
|
|
10140
|
+
if (typeof date === 'string') {
|
|
10141
|
+
date = new Date(date);
|
|
10142
|
+
}
|
|
10143
|
+
return date.getDay();
|
|
10144
|
+
};
|
|
10145
|
+
|
|
10389
10146
|
/**
|
|
10390
10147
|
* @desc 获取上午/下午/晚上
|
|
10391
10148
|
* @author huangbo
|
|
10392
10149
|
* @date 2022年5月7日
|
|
10393
10150
|
* @param {String} [time] - 时间
|
|
10394
|
-
**/
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
if (!time) {
|
|
10398
|
-
hour = new Date().getHours();
|
|
10399
|
-
} else if (typeof time === 'string') {
|
|
10400
|
-
// 从时间字符串中提取小时
|
|
10401
|
-
|
|
10402
|
-
if (match) {
|
|
10403
|
-
hour = parseInt(match[1], 10);
|
|
10404
|
-
}
|
|
10405
|
-
} else if (typeof time === 'number') {
|
|
10406
|
-
hour = time;
|
|
10407
|
-
}
|
|
10408
|
-
// 判断时间段
|
|
10409
|
-
if (hour >= 5 && hour < 12) {
|
|
10410
|
-
return '上午';
|
|
10411
|
-
} else if (hour >= 12 && hour < 18) {
|
|
10412
|
-
return '下午';
|
|
10413
|
-
} else {
|
|
10414
|
-
return '晚上';
|
|
10415
|
-
}
|
|
10151
|
+
**/
|
|
10152
|
+
var timeCycle = function timeCycle(time) {
|
|
10153
|
+
var hour = 0;
|
|
10154
|
+
if (!time) {
|
|
10155
|
+
hour = new Date().getHours();
|
|
10156
|
+
} else if (typeof time === 'string') {
|
|
10157
|
+
// 从时间字符串中提取小时
|
|
10158
|
+
var match = time.match(/^(\d{1,2})/);
|
|
10159
|
+
if (match) {
|
|
10160
|
+
hour = parseInt(match[1], 10);
|
|
10161
|
+
}
|
|
10162
|
+
} else if (typeof time === 'number') {
|
|
10163
|
+
hour = time;
|
|
10164
|
+
}
|
|
10165
|
+
// 判断时间段
|
|
10166
|
+
if (hour >= 5 && hour < 12) {
|
|
10167
|
+
return '上午';
|
|
10168
|
+
} else if (hour >= 12 && hour < 18) {
|
|
10169
|
+
return '下午';
|
|
10170
|
+
} else {
|
|
10171
|
+
return '晚上';
|
|
10172
|
+
}
|
|
10416
10173
|
};
|
|
10417
10174
|
|
|
10418
10175
|
/***/ }),
|
|
10419
10176
|
|
|
10177
|
+
/***/ 70:
|
|
10178
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10179
|
+
|
|
10180
|
+
"use strict";
|
|
10181
|
+
/* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
|
10182
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10183
|
+
|
|
10184
|
+
|
|
10185
|
+
|
|
10186
|
+
var Transition = function () {
|
|
10187
|
+
function Transition() {
|
|
10188
|
+
_classCallCheck(this, Transition);
|
|
10189
|
+
}
|
|
10190
|
+
|
|
10191
|
+
Transition.prototype.beforeEnter = function beforeEnter(el) {
|
|
10192
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
|
|
10193
|
+
if (!el.dataset) el.dataset = {};
|
|
10194
|
+
if (el.dataset.state === 6 || !el.dataset.state) {
|
|
10195
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
10196
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
10197
|
+
}
|
|
10198
|
+
el.dataset.state = 1;
|
|
10199
|
+
|
|
10200
|
+
el.style.height = '0';
|
|
10201
|
+
el.style.paddingTop = 0;
|
|
10202
|
+
el.style.paddingBottom = 0;
|
|
10203
|
+
};
|
|
10204
|
+
|
|
10205
|
+
Transition.prototype.enter = function enter(el) {
|
|
10206
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
10207
|
+
if (el.scrollHeight !== 0) {
|
|
10208
|
+
el.style.height = el.scrollHeight + 'px';
|
|
10209
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
10210
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
10211
|
+
} else {
|
|
10212
|
+
el.style.height = '';
|
|
10213
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
10214
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
10215
|
+
}
|
|
10216
|
+
|
|
10217
|
+
el.dataset.state = 2;
|
|
10218
|
+
el.style.overflow = 'hidden';
|
|
10219
|
+
};
|
|
10220
|
+
|
|
10221
|
+
Transition.prototype.afterEnter = function afterEnter(el) {
|
|
10222
|
+
// for safari: remove class then reset height is necessary
|
|
10223
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
|
|
10224
|
+
el.style.height = '';
|
|
10225
|
+
el.style.overflow = el.dataset.oldOverflow;
|
|
10226
|
+
el.dataset.state = 3;
|
|
10227
|
+
};
|
|
10228
|
+
|
|
10229
|
+
Transition.prototype.beforeLeave = function beforeLeave(el) {
|
|
10230
|
+
if (!el.dataset) el.dataset = {};
|
|
10231
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
10232
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
10233
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
10234
|
+
el.dataset.state = 4;
|
|
10235
|
+
|
|
10236
|
+
el.style.height = el.scrollHeight + 'px';
|
|
10237
|
+
el.style.overflow = 'hidden';
|
|
10238
|
+
};
|
|
10239
|
+
|
|
10240
|
+
Transition.prototype.leave = function leave(el) {
|
|
10241
|
+
if (el.scrollHeight !== 0) {
|
|
10242
|
+
// for safari: add class after set height, or it will jump to zero height suddenly, weired
|
|
10243
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
|
|
10244
|
+
el.style.height = 0;
|
|
10245
|
+
el.style.paddingTop = 0;
|
|
10246
|
+
el.style.paddingBottom = 0;
|
|
10247
|
+
el.dataset.state = 5;
|
|
10248
|
+
}
|
|
10249
|
+
};
|
|
10250
|
+
|
|
10251
|
+
Transition.prototype.afterLeave = function afterLeave(el) {
|
|
10252
|
+
Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
|
|
10253
|
+
el.style.height = '';
|
|
10254
|
+
el.style.overflow = el.dataset.oldOverflow;
|
|
10255
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
10256
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
10257
|
+
el.dataset.state = 6;
|
|
10258
|
+
};
|
|
10259
|
+
|
|
10260
|
+
return Transition;
|
|
10261
|
+
}();
|
|
10262
|
+
|
|
10263
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
10264
|
+
name: 'EsCollapseTransition',
|
|
10265
|
+
functional: true,
|
|
10266
|
+
render: function render(h, _ref) {
|
|
10267
|
+
var children = _ref.children;
|
|
10268
|
+
|
|
10269
|
+
var data = {
|
|
10270
|
+
on: new Transition()
|
|
10271
|
+
};
|
|
10272
|
+
|
|
10273
|
+
return h('transition', data, children);
|
|
10274
|
+
}
|
|
10275
|
+
});
|
|
10276
|
+
|
|
10277
|
+
/***/ }),
|
|
10278
|
+
|
|
10420
10279
|
/***/ 8:
|
|
10421
10280
|
/***/ (function(module, exports) {
|
|
10422
10281
|
|
|
@@ -10424,7 +10283,7 @@ module.exports = require("eoss/lib/message-box");
|
|
|
10424
10283
|
|
|
10425
10284
|
/***/ }),
|
|
10426
10285
|
|
|
10427
|
-
/***/
|
|
10286
|
+
/***/ 81:
|
|
10428
10287
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10429
10288
|
|
|
10430
10289
|
"use strict";
|
|
@@ -10508,7 +10367,7 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
|
|
|
10508
10367
|
if (!this._colorCache) {
|
|
10509
10368
|
this._colorCache = {};
|
|
10510
10369
|
}
|
|
10511
|
-
|
|
10370
|
+
// 缓存键为颜色槽位;缓存值仅依赖 iconColors 与槽位(iconColors 变化由 watcher 清缓存)
|
|
10512
10371
|
var key = Array.isArray(this.iconColors) ? 'index_' + index % this.iconColors.length : 'single_color';
|
|
10513
10372
|
|
|
10514
10373
|
if (!this._colorCache[key]) {
|
|
@@ -10516,7 +10375,7 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
|
|
|
10516
10375
|
this._colorCache[key] = {
|
|
10517
10376
|
'--icon-bg-color': bgColor,
|
|
10518
10377
|
'--icon-color': '#fff',
|
|
10519
|
-
'--icon-font-size':
|
|
10378
|
+
'--icon-font-size': '12px'
|
|
10520
10379
|
};
|
|
10521
10380
|
}
|
|
10522
10381
|
|
|
@@ -10587,12 +10446,12 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
|
|
|
10587
10446
|
|
|
10588
10447
|
/***/ }),
|
|
10589
10448
|
|
|
10590
|
-
/***/
|
|
10449
|
+
/***/ 84:
|
|
10591
10450
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10592
10451
|
|
|
10593
10452
|
"use strict";
|
|
10594
10453
|
|
|
10595
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=template&id=
|
|
10454
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=template&id=ec02cbb0&
|
|
10596
10455
|
var render = function () {
|
|
10597
10456
|
var _vm = this
|
|
10598
10457
|
var _h = _vm.$createElement
|
|
@@ -10628,7 +10487,7 @@ var render = function () {
|
|
|
10628
10487
|
"open-icon": _vm.openIcon,
|
|
10629
10488
|
"close-icon": _vm.closeIcon,
|
|
10630
10489
|
isFourthTabs: _vm.isFourthTabs,
|
|
10631
|
-
iconColor: _vm.getColor(index),
|
|
10490
|
+
iconColor: _vm.getColor(index, item),
|
|
10632
10491
|
iconColors: _vm.iconColors,
|
|
10633
10492
|
},
|
|
10634
10493
|
},
|
|
@@ -10648,13 +10507,13 @@ var staticRenderFns = []
|
|
|
10648
10507
|
render._withStripped = true
|
|
10649
10508
|
|
|
10650
10509
|
|
|
10651
|
-
// CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=
|
|
10510
|
+
// CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=ec02cbb0&
|
|
10652
10511
|
|
|
10653
10512
|
// EXTERNAL MODULE: ./packages/menu/src/mixins.js
|
|
10654
|
-
var mixins = __webpack_require__(
|
|
10513
|
+
var mixins = __webpack_require__(81);
|
|
10655
10514
|
|
|
10656
10515
|
// EXTERNAL MODULE: ./packages/menu/src/menu-item.vue + 4 modules
|
|
10657
|
-
var menu_item = __webpack_require__(
|
|
10516
|
+
var menu_item = __webpack_require__(61);
|
|
10658
10517
|
|
|
10659
10518
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
|
|
10660
10519
|
//
|