|
|
@@ -396,20 +396,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
396
|
396
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
397
|
397
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
398
|
398
|
/* harmony export */ });
|
|
399
|
|
-/* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
|
|
400
|
|
-/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
|
|
|
399
|
+/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
|
|
|
400
|
+/* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
|
|
401
|
401
|
/* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
|
|
402
|
402
|
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
|
|
403
|
403
|
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
|
|
404
|
|
-/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/throttle */ "./node_modules/lodash/throttle.js");
|
|
405
|
|
-/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_4__);
|
|
406
|
|
-/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/pickBy */ "./node_modules/lodash/pickBy.js");
|
|
407
|
|
-/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
408
|
|
-/* harmony import */ var _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/AppLayout.vue */ "./resources/js/layouts/AppLayout.vue");
|
|
409
|
|
-/* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
|
|
410
|
|
-/* harmony import */ var _components_AppButton_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButton.vue */ "./resources/js/components/AppButton.vue");
|
|
411
|
|
-/* harmony import */ var _TableHeader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./TableHeader */ "./resources/js/pages/transaction/TableHeader.js");
|
|
412
|
|
-
|
|
|
404
|
+/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/pickBy */ "./node_modules/lodash/pickBy.js");
|
|
|
405
|
+/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
406
|
+/* harmony import */ var _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/layouts/AppLayout.vue */ "./resources/js/layouts/AppLayout.vue");
|
|
|
407
|
+/* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
|
|
|
408
|
+/* harmony import */ var _components_AppButton_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButton.vue */ "./resources/js/components/AppButton.vue");
|
|
|
409
|
+/* harmony import */ var _TableHeader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TableHeader */ "./resources/js/pages/transaction/TableHeader.js");
|
|
413
|
410
|
|
|
414
|
411
|
|
|
415
|
412
|
|
|
|
@@ -421,7 +418,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
421
|
418
|
|
|
422
|
419
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
423
|
420
|
props: {
|
|
424
|
|
- transactions: Object,
|
|
|
421
|
+ transactions: {
|
|
|
422
|
+ type: Object,
|
|
|
423
|
+ "default": {
|
|
|
424
|
+ data: [],
|
|
|
425
|
+ links: [],
|
|
|
426
|
+ total: 0
|
|
|
427
|
+ }
|
|
|
428
|
+ },
|
|
425
|
429
|
filters: Object,
|
|
426
|
430
|
outlets: Array
|
|
427
|
431
|
},
|
|
|
@@ -435,7 +439,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
435
|
439
|
endDate: props.filters.endDate,
|
|
436
|
440
|
outlet: props.filters.outlet
|
|
437
|
441
|
});
|
|
438
|
|
- (0,vue__WEBPACK_IMPORTED_MODULE_1__.onMounted)(function () {
|
|
|
442
|
+ (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
|
|
439
|
443
|
if (props.filters.startDate || props.filters.endDate) {
|
|
440
|
444
|
if (props.filters.endDate) {
|
|
441
|
445
|
filterForm.dates = [new Date(props.filters.startDate), new Date(props.filters.endDate)];
|
|
|
@@ -444,7 +448,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
444
|
448
|
}
|
|
445
|
449
|
}
|
|
446
|
450
|
});
|
|
447
|
|
- (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)(filterForm, lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default()(function () {
|
|
|
451
|
+ (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(filterForm, function () {
|
|
448
|
452
|
if (filterForm.dates) {
|
|
449
|
453
|
if (filterForm.dates[1]) {
|
|
450
|
454
|
filterForm.startDate = dayjs__WEBPACK_IMPORTED_MODULE_3___default()(filterForm.dates[0]).format('YYYY-MM-DD');
|
|
|
@@ -458,40 +462,46 @@ __webpack_require__.r(__webpack_exports__);
|
|
458
|
462
|
filterForm.startDate = null;
|
|
459
|
463
|
}
|
|
460
|
464
|
|
|
461
|
|
- _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/reports/transactions', lodash_pickBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
462
|
|
- startDate: filterForm.startDate,
|
|
463
|
|
- endDate: filterForm.endDate,
|
|
464
|
|
- outlet: filterForm.outlet
|
|
465
|
|
- }), {
|
|
466
|
|
- preserveState: true
|
|
|
465
|
+ _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
|
|
|
466
|
+ data: lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()({
|
|
|
467
|
+ startDate: filterForm.startDate,
|
|
|
468
|
+ endDate: filterForm.endDate,
|
|
|
469
|
+ outlet: filterForm.outlet
|
|
|
470
|
+ }),
|
|
|
471
|
+ only: ['transactions']
|
|
467
|
472
|
});
|
|
468
|
473
|
var params = window.location.search;
|
|
469
|
474
|
exportExcelLink.value = "/reports/transactions/export/excel".concat(params);
|
|
470
|
|
- }, 300));
|
|
471
|
|
- var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_1__.ref)('/reports/transactions/export/excel');
|
|
472
|
|
- var isAdmin = (0,vue__WEBPACK_IMPORTED_MODULE_1__.computed)(function () {
|
|
|
475
|
+ });
|
|
|
476
|
+
|
|
|
477
|
+ var filterReset = function filterReset() {
|
|
|
478
|
+ _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/reports/transactions');
|
|
|
479
|
+ };
|
|
|
480
|
+
|
|
|
481
|
+ var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)('/reports/transactions/export/excel');
|
|
|
482
|
+ var isAdmin = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
473
|
483
|
return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.isAdmin;
|
|
474
|
484
|
});
|
|
475
|
485
|
var __returned__ = {
|
|
476
|
486
|
props: props,
|
|
477
|
487
|
filterForm: filterForm,
|
|
|
488
|
+ filterReset: filterReset,
|
|
478
|
489
|
exportExcelLink: exportExcelLink,
|
|
479
|
490
|
isAdmin: isAdmin,
|
|
480
|
|
- Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
|
|
481
|
|
- watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
|
|
482
|
|
- computed: vue__WEBPACK_IMPORTED_MODULE_1__.computed,
|
|
483
|
|
- onMounted: vue__WEBPACK_IMPORTED_MODULE_1__.onMounted,
|
|
484
|
|
- ref: vue__WEBPACK_IMPORTED_MODULE_1__.ref,
|
|
|
491
|
+ watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
|
|
|
492
|
+ computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
|
|
|
493
|
+ onMounted: vue__WEBPACK_IMPORTED_MODULE_0__.onMounted,
|
|
|
494
|
+ ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
|
|
|
495
|
+ Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
|
|
485
|
496
|
Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
|
|
486
|
497
|
useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
|
|
487
|
498
|
usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage,
|
|
488
|
499
|
dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_3___default()),
|
|
489
|
|
- throttle: (lodash_throttle__WEBPACK_IMPORTED_MODULE_4___default()),
|
|
490
|
|
- pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_5___default()),
|
|
491
|
|
- AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
|
|
492
|
|
- AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
493
|
|
- AppButton: _components_AppButton_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
|
|
494
|
|
- TransactionReportTable: _TableHeader__WEBPACK_IMPORTED_MODULE_9__.TransactionReportTable
|
|
|
500
|
+ pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()),
|
|
|
501
|
+ AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
|
502
|
+ AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
|
|
|
503
|
+ AppButton: _components_AppButton_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
|
504
|
+ TransactionReportTable: _TableHeader__WEBPACK_IMPORTED_MODULE_8__.TransactionReportTable
|
|
495
|
505
|
};
|
|
496
|
506
|
Object.defineProperty(__returned__, '__isScriptSetup', {
|
|
497
|
507
|
enumerable: false,
|
|
|
@@ -1143,6 +1153,9 @@ var _hoisted_6 = {
|
|
1143
|
1153
|
"class": "col-12 md:col-4"
|
|
1144
|
1154
|
};
|
|
1145
|
1155
|
var _hoisted_7 = {
|
|
|
1156
|
+ "class": "col-auto mt-2 ml-2"
|
|
|
1157
|
+};
|
|
|
1158
|
+var _hoisted_8 = {
|
|
1146
|
1159
|
"class": "col-12 md:col-4 flex justify-content-end"
|
|
1147
|
1160
|
};
|
|
1148
|
1161
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
@@ -1150,6 +1163,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1150
|
1163
|
|
|
1151
|
1164
|
var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
|
|
1152
|
1165
|
|
|
|
1166
|
+ var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
|
|
|
1167
|
+
|
|
1153
|
1168
|
var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
|
|
1154
|
1169
|
|
|
1155
|
1170
|
var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
|
|
|
@@ -1175,7 +1190,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1175
|
1190
|
"selection-mode": "range",
|
|
1176
|
1191
|
placeholder: "filter waktu...",
|
|
1177
|
1192
|
"date-format": "dd/mm/yy",
|
|
1178
|
|
- "show-button-bar": true,
|
|
1179
|
1193
|
"manual-input": false
|
|
1180
|
1194
|
}, null, 8
|
|
1181
|
1195
|
/* PROPS */
|
|
|
@@ -1192,7 +1206,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1192
|
1206
|
options: $props.outlets
|
|
1193
|
1207
|
}, null, 8
|
|
1194
|
1208
|
/* PROPS */
|
|
1195
|
|
- , ["modelValue", "options"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [$props.transactions.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
|
|
|
1209
|
+ , ["modelValue", "options"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
|
|
|
1210
|
+ label: "reset",
|
|
|
1211
|
+ "class": "p-button-link",
|
|
|
1212
|
+ onClick: $setup.filterReset
|
|
|
1213
|
+ })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [$props.transactions.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
|
|
1196
|
1214
|
key: 0,
|
|
1197
|
1215
|
label: "Export excel",
|
|
1198
|
1216
|
"class-button": "p-button-outlined md:w-16rem",
|
|
|
@@ -2975,35 +2993,6 @@ function baseToString(value) {
|
|
2975
|
2993
|
module.exports = baseToString;
|
|
2976
|
2994
|
|
|
2977
|
2995
|
|
|
2978
|
|
-/***/ }),
|
|
2979
|
|
-
|
|
2980
|
|
-/***/ "./node_modules/lodash/_baseTrim.js":
|
|
2981
|
|
-/*!******************************************!*\
|
|
2982
|
|
- !*** ./node_modules/lodash/_baseTrim.js ***!
|
|
2983
|
|
- \******************************************/
|
|
2984
|
|
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2985
|
|
-
|
|
2986
|
|
-var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
|
|
2987
|
|
-
|
|
2988
|
|
-/** Used to match leading whitespace. */
|
|
2989
|
|
-var reTrimStart = /^\s+/;
|
|
2990
|
|
-
|
|
2991
|
|
-/**
|
|
2992
|
|
- * The base implementation of `_.trim`.
|
|
2993
|
|
- *
|
|
2994
|
|
- * @private
|
|
2995
|
|
- * @param {string} string The string to trim.
|
|
2996
|
|
- * @returns {string} Returns the trimmed string.
|
|
2997
|
|
- */
|
|
2998
|
|
-function baseTrim(string) {
|
|
2999
|
|
- return string
|
|
3000
|
|
- ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
3001
|
|
- : string;
|
|
3002
|
|
-}
|
|
3003
|
|
-
|
|
3004
|
|
-module.exports = baseTrim;
|
|
3005
|
|
-
|
|
3006
|
|
-
|
|
3007
|
2996
|
/***/ }),
|
|
3008
|
2997
|
|
|
3009
|
2998
|
/***/ "./node_modules/lodash/_baseUnary.js":
|
|
|
@@ -5123,236 +5112,6 @@ function toSource(func) {
|
|
5123
|
5112
|
module.exports = toSource;
|
|
5124
|
5113
|
|
|
5125
|
5114
|
|
|
5126
|
|
-/***/ }),
|
|
5127
|
|
-
|
|
5128
|
|
-/***/ "./node_modules/lodash/_trimmedEndIndex.js":
|
|
5129
|
|
-/*!*************************************************!*\
|
|
5130
|
|
- !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
|
|
5131
|
|
- \*************************************************/
|
|
5132
|
|
-/***/ ((module) => {
|
|
5133
|
|
-
|
|
5134
|
|
-/** Used to match a single whitespace character. */
|
|
5135
|
|
-var reWhitespace = /\s/;
|
|
5136
|
|
-
|
|
5137
|
|
-/**
|
|
5138
|
|
- * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
5139
|
|
- * character of `string`.
|
|
5140
|
|
- *
|
|
5141
|
|
- * @private
|
|
5142
|
|
- * @param {string} string The string to inspect.
|
|
5143
|
|
- * @returns {number} Returns the index of the last non-whitespace character.
|
|
5144
|
|
- */
|
|
5145
|
|
-function trimmedEndIndex(string) {
|
|
5146
|
|
- var index = string.length;
|
|
5147
|
|
-
|
|
5148
|
|
- while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
5149
|
|
- return index;
|
|
5150
|
|
-}
|
|
5151
|
|
-
|
|
5152
|
|
-module.exports = trimmedEndIndex;
|
|
5153
|
|
-
|
|
5154
|
|
-
|
|
5155
|
|
-/***/ }),
|
|
5156
|
|
-
|
|
5157
|
|
-/***/ "./node_modules/lodash/debounce.js":
|
|
5158
|
|
-/*!*****************************************!*\
|
|
5159
|
|
- !*** ./node_modules/lodash/debounce.js ***!
|
|
5160
|
|
- \*****************************************/
|
|
5161
|
|
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5162
|
|
-
|
|
5163
|
|
-var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
|
|
5164
|
|
- now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
|
|
5165
|
|
- toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
|
|
5166
|
|
-
|
|
5167
|
|
-/** Error message constants. */
|
|
5168
|
|
-var FUNC_ERROR_TEXT = 'Expected a function';
|
|
5169
|
|
-
|
|
5170
|
|
-/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
5171
|
|
-var nativeMax = Math.max,
|
|
5172
|
|
- nativeMin = Math.min;
|
|
5173
|
|
-
|
|
5174
|
|
-/**
|
|
5175
|
|
- * Creates a debounced function that delays invoking `func` until after `wait`
|
|
5176
|
|
- * milliseconds have elapsed since the last time the debounced function was
|
|
5177
|
|
- * invoked. The debounced function comes with a `cancel` method to cancel
|
|
5178
|
|
- * delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
5179
|
|
- * Provide `options` to indicate whether `func` should be invoked on the
|
|
5180
|
|
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
5181
|
|
- * with the last arguments provided to the debounced function. Subsequent
|
|
5182
|
|
- * calls to the debounced function return the result of the last `func`
|
|
5183
|
|
- * invocation.
|
|
5184
|
|
- *
|
|
5185
|
|
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
5186
|
|
- * invoked on the trailing edge of the timeout only if the debounced function
|
|
5187
|
|
- * is invoked more than once during the `wait` timeout.
|
|
5188
|
|
- *
|
|
5189
|
|
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
5190
|
|
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
5191
|
|
- *
|
|
5192
|
|
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
5193
|
|
- * for details over the differences between `_.debounce` and `_.throttle`.
|
|
5194
|
|
- *
|
|
5195
|
|
- * @static
|
|
5196
|
|
- * @memberOf _
|
|
5197
|
|
- * @since 0.1.0
|
|
5198
|
|
- * @category Function
|
|
5199
|
|
- * @param {Function} func The function to debounce.
|
|
5200
|
|
- * @param {number} [wait=0] The number of milliseconds to delay.
|
|
5201
|
|
- * @param {Object} [options={}] The options object.
|
|
5202
|
|
- * @param {boolean} [options.leading=false]
|
|
5203
|
|
- * Specify invoking on the leading edge of the timeout.
|
|
5204
|
|
- * @param {number} [options.maxWait]
|
|
5205
|
|
- * The maximum time `func` is allowed to be delayed before it's invoked.
|
|
5206
|
|
- * @param {boolean} [options.trailing=true]
|
|
5207
|
|
- * Specify invoking on the trailing edge of the timeout.
|
|
5208
|
|
- * @returns {Function} Returns the new debounced function.
|
|
5209
|
|
- * @example
|
|
5210
|
|
- *
|
|
5211
|
|
- * // Avoid costly calculations while the window size is in flux.
|
|
5212
|
|
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
5213
|
|
- *
|
|
5214
|
|
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
5215
|
|
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
5216
|
|
- * 'leading': true,
|
|
5217
|
|
- * 'trailing': false
|
|
5218
|
|
- * }));
|
|
5219
|
|
- *
|
|
5220
|
|
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
5221
|
|
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
5222
|
|
- * var source = new EventSource('/stream');
|
|
5223
|
|
- * jQuery(source).on('message', debounced);
|
|
5224
|
|
- *
|
|
5225
|
|
- * // Cancel the trailing debounced invocation.
|
|
5226
|
|
- * jQuery(window).on('popstate', debounced.cancel);
|
|
5227
|
|
- */
|
|
5228
|
|
-function debounce(func, wait, options) {
|
|
5229
|
|
- var lastArgs,
|
|
5230
|
|
- lastThis,
|
|
5231
|
|
- maxWait,
|
|
5232
|
|
- result,
|
|
5233
|
|
- timerId,
|
|
5234
|
|
- lastCallTime,
|
|
5235
|
|
- lastInvokeTime = 0,
|
|
5236
|
|
- leading = false,
|
|
5237
|
|
- maxing = false,
|
|
5238
|
|
- trailing = true;
|
|
5239
|
|
-
|
|
5240
|
|
- if (typeof func != 'function') {
|
|
5241
|
|
- throw new TypeError(FUNC_ERROR_TEXT);
|
|
5242
|
|
- }
|
|
5243
|
|
- wait = toNumber(wait) || 0;
|
|
5244
|
|
- if (isObject(options)) {
|
|
5245
|
|
- leading = !!options.leading;
|
|
5246
|
|
- maxing = 'maxWait' in options;
|
|
5247
|
|
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
5248
|
|
- trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
5249
|
|
- }
|
|
5250
|
|
-
|
|
5251
|
|
- function invokeFunc(time) {
|
|
5252
|
|
- var args = lastArgs,
|
|
5253
|
|
- thisArg = lastThis;
|
|
5254
|
|
-
|
|
5255
|
|
- lastArgs = lastThis = undefined;
|
|
5256
|
|
- lastInvokeTime = time;
|
|
5257
|
|
- result = func.apply(thisArg, args);
|
|
5258
|
|
- return result;
|
|
5259
|
|
- }
|
|
5260
|
|
-
|
|
5261
|
|
- function leadingEdge(time) {
|
|
5262
|
|
- // Reset any `maxWait` timer.
|
|
5263
|
|
- lastInvokeTime = time;
|
|
5264
|
|
- // Start the timer for the trailing edge.
|
|
5265
|
|
- timerId = setTimeout(timerExpired, wait);
|
|
5266
|
|
- // Invoke the leading edge.
|
|
5267
|
|
- return leading ? invokeFunc(time) : result;
|
|
5268
|
|
- }
|
|
5269
|
|
-
|
|
5270
|
|
- function remainingWait(time) {
|
|
5271
|
|
- var timeSinceLastCall = time - lastCallTime,
|
|
5272
|
|
- timeSinceLastInvoke = time - lastInvokeTime,
|
|
5273
|
|
- timeWaiting = wait - timeSinceLastCall;
|
|
5274
|
|
-
|
|
5275
|
|
- return maxing
|
|
5276
|
|
- ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
5277
|
|
- : timeWaiting;
|
|
5278
|
|
- }
|
|
5279
|
|
-
|
|
5280
|
|
- function shouldInvoke(time) {
|
|
5281
|
|
- var timeSinceLastCall = time - lastCallTime,
|
|
5282
|
|
- timeSinceLastInvoke = time - lastInvokeTime;
|
|
5283
|
|
-
|
|
5284
|
|
- // Either this is the first call, activity has stopped and we're at the
|
|
5285
|
|
- // trailing edge, the system time has gone backwards and we're treating
|
|
5286
|
|
- // it as the trailing edge, or we've hit the `maxWait` limit.
|
|
5287
|
|
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
5288
|
|
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
5289
|
|
- }
|
|
5290
|
|
-
|
|
5291
|
|
- function timerExpired() {
|
|
5292
|
|
- var time = now();
|
|
5293
|
|
- if (shouldInvoke(time)) {
|
|
5294
|
|
- return trailingEdge(time);
|
|
5295
|
|
- }
|
|
5296
|
|
- // Restart the timer.
|
|
5297
|
|
- timerId = setTimeout(timerExpired, remainingWait(time));
|
|
5298
|
|
- }
|
|
5299
|
|
-
|
|
5300
|
|
- function trailingEdge(time) {
|
|
5301
|
|
- timerId = undefined;
|
|
5302
|
|
-
|
|
5303
|
|
- // Only invoke if we have `lastArgs` which means `func` has been
|
|
5304
|
|
- // debounced at least once.
|
|
5305
|
|
- if (trailing && lastArgs) {
|
|
5306
|
|
- return invokeFunc(time);
|
|
5307
|
|
- }
|
|
5308
|
|
- lastArgs = lastThis = undefined;
|
|
5309
|
|
- return result;
|
|
5310
|
|
- }
|
|
5311
|
|
-
|
|
5312
|
|
- function cancel() {
|
|
5313
|
|
- if (timerId !== undefined) {
|
|
5314
|
|
- clearTimeout(timerId);
|
|
5315
|
|
- }
|
|
5316
|
|
- lastInvokeTime = 0;
|
|
5317
|
|
- lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
5318
|
|
- }
|
|
5319
|
|
-
|
|
5320
|
|
- function flush() {
|
|
5321
|
|
- return timerId === undefined ? result : trailingEdge(now());
|
|
5322
|
|
- }
|
|
5323
|
|
-
|
|
5324
|
|
- function debounced() {
|
|
5325
|
|
- var time = now(),
|
|
5326
|
|
- isInvoking = shouldInvoke(time);
|
|
5327
|
|
-
|
|
5328
|
|
- lastArgs = arguments;
|
|
5329
|
|
- lastThis = this;
|
|
5330
|
|
- lastCallTime = time;
|
|
5331
|
|
-
|
|
5332
|
|
- if (isInvoking) {
|
|
5333
|
|
- if (timerId === undefined) {
|
|
5334
|
|
- return leadingEdge(lastCallTime);
|
|
5335
|
|
- }
|
|
5336
|
|
- if (maxing) {
|
|
5337
|
|
- // Handle invocations in a tight loop.
|
|
5338
|
|
- clearTimeout(timerId);
|
|
5339
|
|
- timerId = setTimeout(timerExpired, wait);
|
|
5340
|
|
- return invokeFunc(lastCallTime);
|
|
5341
|
|
- }
|
|
5342
|
|
- }
|
|
5343
|
|
- if (timerId === undefined) {
|
|
5344
|
|
- timerId = setTimeout(timerExpired, wait);
|
|
5345
|
|
- }
|
|
5346
|
|
- return result;
|
|
5347
|
|
- }
|
|
5348
|
|
- debounced.cancel = cancel;
|
|
5349
|
|
- debounced.flush = flush;
|
|
5350
|
|
- return debounced;
|
|
5351
|
|
-}
|
|
5352
|
|
-
|
|
5353
|
|
-module.exports = debounce;
|
|
5354
|
|
-
|
|
5355
|
|
-
|
|
5356
|
5115
|
/***/ }),
|
|
5357
|
5116
|
|
|
5358
|
5117
|
/***/ "./node_modules/lodash/eq.js":
|
|
|
@@ -6112,39 +5871,6 @@ memoize.Cache = MapCache;
|
|
6112
|
5871
|
module.exports = memoize;
|
|
6113
|
5872
|
|
|
6114
|
5873
|
|
|
6115
|
|
-/***/ }),
|
|
6116
|
|
-
|
|
6117
|
|
-/***/ "./node_modules/lodash/now.js":
|
|
6118
|
|
-/*!************************************!*\
|
|
6119
|
|
- !*** ./node_modules/lodash/now.js ***!
|
|
6120
|
|
- \************************************/
|
|
6121
|
|
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6122
|
|
-
|
|
6123
|
|
-var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
|
|
6124
|
|
-
|
|
6125
|
|
-/**
|
|
6126
|
|
- * Gets the timestamp of the number of milliseconds that have elapsed since
|
|
6127
|
|
- * the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
6128
|
|
- *
|
|
6129
|
|
- * @static
|
|
6130
|
|
- * @memberOf _
|
|
6131
|
|
- * @since 2.4.0
|
|
6132
|
|
- * @category Date
|
|
6133
|
|
- * @returns {number} Returns the timestamp.
|
|
6134
|
|
- * @example
|
|
6135
|
|
- *
|
|
6136
|
|
- * _.defer(function(stamp) {
|
|
6137
|
|
- * console.log(_.now() - stamp);
|
|
6138
|
|
- * }, _.now());
|
|
6139
|
|
- * // => Logs the number of milliseconds it took for the deferred invocation.
|
|
6140
|
|
- */
|
|
6141
|
|
-var now = function() {
|
|
6142
|
|
- return root.Date.now();
|
|
6143
|
|
-};
|
|
6144
|
|
-
|
|
6145
|
|
-module.exports = now;
|
|
6146
|
|
-
|
|
6147
|
|
-
|
|
6148
|
5874
|
/***/ }),
|
|
6149
|
5875
|
|
|
6150
|
5876
|
/***/ "./node_modules/lodash/pickBy.js":
|
|
|
@@ -6295,159 +6021,6 @@ function stubFalse() {
|
|
6295
|
6021
|
module.exports = stubFalse;
|
|
6296
|
6022
|
|
|
6297
|
6023
|
|
|
6298
|
|
-/***/ }),
|
|
6299
|
|
-
|
|
6300
|
|
-/***/ "./node_modules/lodash/throttle.js":
|
|
6301
|
|
-/*!*****************************************!*\
|
|
6302
|
|
- !*** ./node_modules/lodash/throttle.js ***!
|
|
6303
|
|
- \*****************************************/
|
|
6304
|
|
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6305
|
|
-
|
|
6306
|
|
-var debounce = __webpack_require__(/*! ./debounce */ "./node_modules/lodash/debounce.js"),
|
|
6307
|
|
- isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");
|
|
6308
|
|
-
|
|
6309
|
|
-/** Error message constants. */
|
|
6310
|
|
-var FUNC_ERROR_TEXT = 'Expected a function';
|
|
6311
|
|
-
|
|
6312
|
|
-/**
|
|
6313
|
|
- * Creates a throttled function that only invokes `func` at most once per
|
|
6314
|
|
- * every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
6315
|
|
- * method to cancel delayed `func` invocations and a `flush` method to
|
|
6316
|
|
- * immediately invoke them. Provide `options` to indicate whether `func`
|
|
6317
|
|
- * should be invoked on the leading and/or trailing edge of the `wait`
|
|
6318
|
|
- * timeout. The `func` is invoked with the last arguments provided to the
|
|
6319
|
|
- * throttled function. Subsequent calls to the throttled function return the
|
|
6320
|
|
- * result of the last `func` invocation.
|
|
6321
|
|
- *
|
|
6322
|
|
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
6323
|
|
- * invoked on the trailing edge of the timeout only if the throttled function
|
|
6324
|
|
- * is invoked more than once during the `wait` timeout.
|
|
6325
|
|
- *
|
|
6326
|
|
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
6327
|
|
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
6328
|
|
- *
|
|
6329
|
|
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
6330
|
|
- * for details over the differences between `_.throttle` and `_.debounce`.
|
|
6331
|
|
- *
|
|
6332
|
|
- * @static
|
|
6333
|
|
- * @memberOf _
|
|
6334
|
|
- * @since 0.1.0
|
|
6335
|
|
- * @category Function
|
|
6336
|
|
- * @param {Function} func The function to throttle.
|
|
6337
|
|
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
6338
|
|
- * @param {Object} [options={}] The options object.
|
|
6339
|
|
- * @param {boolean} [options.leading=true]
|
|
6340
|
|
- * Specify invoking on the leading edge of the timeout.
|
|
6341
|
|
- * @param {boolean} [options.trailing=true]
|
|
6342
|
|
- * Specify invoking on the trailing edge of the timeout.
|
|
6343
|
|
- * @returns {Function} Returns the new throttled function.
|
|
6344
|
|
- * @example
|
|
6345
|
|
- *
|
|
6346
|
|
- * // Avoid excessively updating the position while scrolling.
|
|
6347
|
|
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
6348
|
|
- *
|
|
6349
|
|
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
6350
|
|
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
6351
|
|
- * jQuery(element).on('click', throttled);
|
|
6352
|
|
- *
|
|
6353
|
|
- * // Cancel the trailing throttled invocation.
|
|
6354
|
|
- * jQuery(window).on('popstate', throttled.cancel);
|
|
6355
|
|
- */
|
|
6356
|
|
-function throttle(func, wait, options) {
|
|
6357
|
|
- var leading = true,
|
|
6358
|
|
- trailing = true;
|
|
6359
|
|
-
|
|
6360
|
|
- if (typeof func != 'function') {
|
|
6361
|
|
- throw new TypeError(FUNC_ERROR_TEXT);
|
|
6362
|
|
- }
|
|
6363
|
|
- if (isObject(options)) {
|
|
6364
|
|
- leading = 'leading' in options ? !!options.leading : leading;
|
|
6365
|
|
- trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
6366
|
|
- }
|
|
6367
|
|
- return debounce(func, wait, {
|
|
6368
|
|
- 'leading': leading,
|
|
6369
|
|
- 'maxWait': wait,
|
|
6370
|
|
- 'trailing': trailing
|
|
6371
|
|
- });
|
|
6372
|
|
-}
|
|
6373
|
|
-
|
|
6374
|
|
-module.exports = throttle;
|
|
6375
|
|
-
|
|
6376
|
|
-
|
|
6377
|
|
-/***/ }),
|
|
6378
|
|
-
|
|
6379
|
|
-/***/ "./node_modules/lodash/toNumber.js":
|
|
6380
|
|
-/*!*****************************************!*\
|
|
6381
|
|
- !*** ./node_modules/lodash/toNumber.js ***!
|
|
6382
|
|
- \*****************************************/
|
|
6383
|
|
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6384
|
|
-
|
|
6385
|
|
-var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
|
|
6386
|
|
- isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
|
|
6387
|
|
- isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
|
|
6388
|
|
-
|
|
6389
|
|
-/** Used as references for various `Number` constants. */
|
|
6390
|
|
-var NAN = 0 / 0;
|
|
6391
|
|
-
|
|
6392
|
|
-/** Used to detect bad signed hexadecimal string values. */
|
|
6393
|
|
-var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
6394
|
|
-
|
|
6395
|
|
-/** Used to detect binary string values. */
|
|
6396
|
|
-var reIsBinary = /^0b[01]+$/i;
|
|
6397
|
|
-
|
|
6398
|
|
-/** Used to detect octal string values. */
|
|
6399
|
|
-var reIsOctal = /^0o[0-7]+$/i;
|
|
6400
|
|
-
|
|
6401
|
|
-/** Built-in method references without a dependency on `root`. */
|
|
6402
|
|
-var freeParseInt = parseInt;
|
|
6403
|
|
-
|
|
6404
|
|
-/**
|
|
6405
|
|
- * Converts `value` to a number.
|
|
6406
|
|
- *
|
|
6407
|
|
- * @static
|
|
6408
|
|
- * @memberOf _
|
|
6409
|
|
- * @since 4.0.0
|
|
6410
|
|
- * @category Lang
|
|
6411
|
|
- * @param {*} value The value to process.
|
|
6412
|
|
- * @returns {number} Returns the number.
|
|
6413
|
|
- * @example
|
|
6414
|
|
- *
|
|
6415
|
|
- * _.toNumber(3.2);
|
|
6416
|
|
- * // => 3.2
|
|
6417
|
|
- *
|
|
6418
|
|
- * _.toNumber(Number.MIN_VALUE);
|
|
6419
|
|
- * // => 5e-324
|
|
6420
|
|
- *
|
|
6421
|
|
- * _.toNumber(Infinity);
|
|
6422
|
|
- * // => Infinity
|
|
6423
|
|
- *
|
|
6424
|
|
- * _.toNumber('3.2');
|
|
6425
|
|
- * // => 3.2
|
|
6426
|
|
- */
|
|
6427
|
|
-function toNumber(value) {
|
|
6428
|
|
- if (typeof value == 'number') {
|
|
6429
|
|
- return value;
|
|
6430
|
|
- }
|
|
6431
|
|
- if (isSymbol(value)) {
|
|
6432
|
|
- return NAN;
|
|
6433
|
|
- }
|
|
6434
|
|
- if (isObject(value)) {
|
|
6435
|
|
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
6436
|
|
- value = isObject(other) ? (other + '') : other;
|
|
6437
|
|
- }
|
|
6438
|
|
- if (typeof value != 'string') {
|
|
6439
|
|
- return value === 0 ? value : +value;
|
|
6440
|
|
- }
|
|
6441
|
|
- value = baseTrim(value);
|
|
6442
|
|
- var isBinary = reIsBinary.test(value);
|
|
6443
|
|
- return (isBinary || reIsOctal.test(value))
|
|
6444
|
|
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
6445
|
|
- : (reIsBadHex.test(value) ? NAN : +value);
|
|
6446
|
|
-}
|
|
6447
|
|
-
|
|
6448
|
|
-module.exports = toNumber;
|
|
6449
|
|
-
|
|
6450
|
|
-
|
|
6451
|
6024
|
/***/ }),
|
|
6452
|
6025
|
|
|
6453
|
6026
|
/***/ "./node_modules/lodash/toString.js":
|