@ldmjs/ui 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +31 -34
- package/dist/index.js +2084 -221
- package/dist/scss/_iterator.scss +89 -0
- package/dist/scss/_pager.scss +20 -0
- package/dist/scss/_variables.scss +2 -0
- package/dist/scss/index.scss +2 -0
- package/dist/types/iterator.d.ts +11 -0
- package/dist/types/options.d.ts +5 -0
- package/dist/types/pager.d.ts +10 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -253,7 +253,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
253
253
|
ValidateMixin: () => (/* reexport */ ValidateMixin),
|
|
254
254
|
ValidateMixinOptions: () => (/* reexport */ ValidateMixinOptions),
|
|
255
255
|
awaiting: () => (/* reexport */ awaiting),
|
|
256
|
-
datetime: () => (/* reexport */ datetime),
|
|
257
256
|
deepValueGetter: () => (/* reexport */ deepValueGetter),
|
|
258
257
|
"default": () => (/* binding */ src),
|
|
259
258
|
defaults: () => (/* reexport */ defaults),
|
|
@@ -261,6 +260,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
261
260
|
getAliases: () => (/* reexport */ getAliases),
|
|
262
261
|
isDefined: () => (/* reexport */ isDefined),
|
|
263
262
|
isObjectEmpty: () => (/* reexport */ isObjectEmpty),
|
|
263
|
+
pluralizeNoun: () => (/* reexport */ pluralizeNoun),
|
|
264
264
|
uidGen: () => (/* reexport */ uidGen),
|
|
265
265
|
urlRegexp: () => (/* reexport */ urlRegexp)
|
|
266
266
|
});
|
|
@@ -270,11 +270,11 @@ var src_utils_namespaceObject = {};
|
|
|
270
270
|
__webpack_require__.r(src_utils_namespaceObject);
|
|
271
271
|
__webpack_require__.d(src_utils_namespaceObject, {
|
|
272
272
|
awaiting: () => (awaiting),
|
|
273
|
-
datetime: () => (datetime),
|
|
274
273
|
deepValueGetter: () => (deepValueGetter),
|
|
275
274
|
delay: () => (delay),
|
|
276
275
|
isDefined: () => (isDefined),
|
|
277
276
|
isObjectEmpty: () => (isObjectEmpty),
|
|
277
|
+
pluralizeNoun: () => (pluralizeNoun),
|
|
278
278
|
uidGen: () => (uidGen),
|
|
279
279
|
urlRegexp: () => (urlRegexp)
|
|
280
280
|
});
|
|
@@ -368,7 +368,7 @@ var ld_iconvue_type_script_lang_js_external_metadata = (undefined && undefined._
|
|
|
368
368
|
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
let
|
|
371
|
+
let IconComponent = class IconComponent extends external_vue_class_component_.Vue {
|
|
372
372
|
constructor() {
|
|
373
373
|
super(...arguments);
|
|
374
374
|
this.current = '';
|
|
@@ -412,41 +412,41 @@ let IconButtonComponent = class IconButtonComponent extends external_vue_class_c
|
|
|
412
412
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
413
413
|
(0,external_vue_property_decorator_.Prop)({ default: () => ({ icons: [] }) }),
|
|
414
414
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", Object)
|
|
415
|
-
],
|
|
415
|
+
], IconComponent.prototype, "map", void 0);
|
|
416
416
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
417
417
|
(0,external_vue_property_decorator_.Prop)({ default: 'icons' }),
|
|
418
418
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
|
|
419
|
-
],
|
|
419
|
+
], IconComponent.prototype, "path", void 0);
|
|
420
420
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
421
421
|
(0,external_vue_property_decorator_.Prop)(),
|
|
422
422
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
|
|
423
|
-
],
|
|
423
|
+
], IconComponent.prototype, "icon", void 0);
|
|
424
424
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
425
425
|
(0,external_vue_property_decorator_.Prop)(),
|
|
426
426
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
|
|
427
|
-
],
|
|
427
|
+
], IconComponent.prototype, "color", void 0);
|
|
428
428
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
429
429
|
(0,external_vue_property_decorator_.Prop)({ default: '24' }),
|
|
430
430
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
|
|
431
|
-
],
|
|
431
|
+
], IconComponent.prototype, "width", void 0);
|
|
432
432
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
433
433
|
(0,external_vue_property_decorator_.Prop)({ default: '24' }),
|
|
434
434
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
|
|
435
|
-
],
|
|
435
|
+
], IconComponent.prototype, "height", void 0);
|
|
436
436
|
ld_iconvue_type_script_lang_js_external_decorate([
|
|
437
437
|
(0,external_vue_property_decorator_.Watch)('icon'),
|
|
438
438
|
ld_iconvue_type_script_lang_js_external_metadata("design:type", Function),
|
|
439
439
|
ld_iconvue_type_script_lang_js_external_metadata("design:paramtypes", []),
|
|
440
440
|
ld_iconvue_type_script_lang_js_external_metadata("design:returntype", void 0)
|
|
441
|
-
],
|
|
442
|
-
|
|
441
|
+
], IconComponent.prototype, "onIconChange", null);
|
|
442
|
+
IconComponent = ld_iconvue_type_script_lang_js_external_decorate([
|
|
443
443
|
(0,external_vue_class_component_.Options)({
|
|
444
444
|
components: {
|
|
445
445
|
'svg-icon': svg_icon,
|
|
446
446
|
},
|
|
447
447
|
})
|
|
448
|
-
],
|
|
449
|
-
/* harmony default export */ const ld_iconvue_type_script_lang_js_external = (
|
|
448
|
+
], IconComponent);
|
|
449
|
+
/* harmony default export */ const ld_iconvue_type_script_lang_js_external = (IconComponent);
|
|
450
450
|
|
|
451
451
|
;// CONCATENATED MODULE: ./src/ld-icon/ld-icon.ts?vue&type=script&lang=js&external
|
|
452
452
|
|
|
@@ -7366,6 +7366,85 @@ try {
|
|
|
7366
7366
|
// EXTERNAL MODULE: external "./calendar.js"
|
|
7367
7367
|
var external_calendar_js_ = __webpack_require__(4634);
|
|
7368
7368
|
var external_calendar_js_default = /*#__PURE__*/__webpack_require__.n(external_calendar_js_);
|
|
7369
|
+
;// CONCATENATED MODULE: ./src/utils/datetime.ts
|
|
7370
|
+
function dateLocalToISO(value) {
|
|
7371
|
+
const parsed = /^(\d\d?).(\d\d?).(\d\d\d?\d?)$/.exec(value);
|
|
7372
|
+
let year = '';
|
|
7373
|
+
let month = '';
|
|
7374
|
+
let day = '';
|
|
7375
|
+
if (parsed[1]) {
|
|
7376
|
+
day = parsed[1].length === 1 ? '0' + parsed[1] : parsed[1];
|
|
7377
|
+
}
|
|
7378
|
+
if (parsed[2]) {
|
|
7379
|
+
month = parsed[2].length === 1 ? '0' + parsed[2] : parsed[2];
|
|
7380
|
+
}
|
|
7381
|
+
if (parsed[3]) {
|
|
7382
|
+
year = parsed[3];
|
|
7383
|
+
}
|
|
7384
|
+
if (day && month && year) {
|
|
7385
|
+
return `${year}-${month}-${day}`;
|
|
7386
|
+
}
|
|
7387
|
+
return '';
|
|
7388
|
+
}
|
|
7389
|
+
/**
|
|
7390
|
+
* Преобразует дату к формату yyyy-MM-ddThh:mm:ss+hh:mm (например, 2020-11-24T12:47:45+03:00)
|
|
7391
|
+
* @param dt Date
|
|
7392
|
+
*/
|
|
7393
|
+
function toServerString(dt) {
|
|
7394
|
+
if (!dt) {
|
|
7395
|
+
return null;
|
|
7396
|
+
}
|
|
7397
|
+
const tzo = -dt.getTimezoneOffset();
|
|
7398
|
+
const dif = tzo >= 0 ? '+' : '-';
|
|
7399
|
+
const pad = function (num) {
|
|
7400
|
+
const norm = Math.abs(Math.floor(num));
|
|
7401
|
+
return (norm < 10 ? '0' : '') + norm;
|
|
7402
|
+
};
|
|
7403
|
+
return `${dt.getFullYear()}-${pad(dt.getMonth() + 1)}-${pad(dt.getDate())}T${pad(dt.getHours())}:${pad(dt.getMinutes())}:${pad(dt.getSeconds())}${dif}${pad(tzo / 60)}:${pad(tzo % 60)}`;
|
|
7404
|
+
}
|
|
7405
|
+
function convert(d) {
|
|
7406
|
+
// Converts the date in d to a date-object. The input can be:
|
|
7407
|
+
// a date object : returned without modification
|
|
7408
|
+
// an array : Interpreted as [year,month,day]. NOTE: month is 0-11.
|
|
7409
|
+
// a number : Interpreted as number of milliseconds
|
|
7410
|
+
// since 1 Jan 1970 (a timestamp)
|
|
7411
|
+
// a string : Any format supported by the javascript engine, like
|
|
7412
|
+
// "YYYY/MM/DD", "MM/DD/YYYY", "Jan 31 2009" etc.
|
|
7413
|
+
// an object : Interpreted as an object with year, month and date
|
|
7414
|
+
// attributes. **NOTE** month is 0-11.
|
|
7415
|
+
if (d instanceof Date) {
|
|
7416
|
+
return d;
|
|
7417
|
+
}
|
|
7418
|
+
if (Array.isArray(d)) {
|
|
7419
|
+
return new Date(d[0], d[1], d[2]);
|
|
7420
|
+
}
|
|
7421
|
+
if (typeof d === 'number' || typeof d === 'string') {
|
|
7422
|
+
return new Date(d);
|
|
7423
|
+
}
|
|
7424
|
+
if (typeof d === 'object' && 'year' in d && 'month' in d && 'date' in d) {
|
|
7425
|
+
return new Date(d.year, d.month, d.date, d.hours, d.minutes, d.seconds, d.ms);
|
|
7426
|
+
}
|
|
7427
|
+
return d;
|
|
7428
|
+
}
|
|
7429
|
+
function compare(a, b) {
|
|
7430
|
+
// Compare two dates (could be of any type supported by the convert
|
|
7431
|
+
// function above) and returns:
|
|
7432
|
+
// -1 : if a < b
|
|
7433
|
+
// 0 : if a = b
|
|
7434
|
+
// 1 : if a > b
|
|
7435
|
+
// NaN : if a or b is an illegal date
|
|
7436
|
+
// NOTE: The code inside isFinite does an assignment (=).
|
|
7437
|
+
const a1 = a ? convert(a).valueOf() : 0;
|
|
7438
|
+
const b1 = b ? convert(b).valueOf() : 0;
|
|
7439
|
+
return isFinite(a1) && isFinite(b1) ? Number(a1 > b1) - Number(a1 < b1) : NaN;
|
|
7440
|
+
}
|
|
7441
|
+
const datetime = {
|
|
7442
|
+
dateLocalToISO,
|
|
7443
|
+
toServerString,
|
|
7444
|
+
compare
|
|
7445
|
+
};
|
|
7446
|
+
|
|
7447
|
+
|
|
7369
7448
|
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-datepicker/ld-datepicker.ts?vue&type=script&lang=js&external
|
|
7370
7449
|
var ld_datepickervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7371
7450
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -7386,6 +7465,7 @@ var ld_datepickervue_type_script_lang_js_external_a, ld_datepickervue_type_scrip
|
|
|
7386
7465
|
|
|
7387
7466
|
|
|
7388
7467
|
|
|
7468
|
+
|
|
7389
7469
|
/**
|
|
7390
7470
|
* @displayName ld-datepicker
|
|
7391
7471
|
*/
|
|
@@ -7429,7 +7509,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
7429
7509
|
}
|
|
7430
7510
|
else {
|
|
7431
7511
|
this.date = new Date(newVal);
|
|
7432
|
-
this.dateString =
|
|
7512
|
+
this.dateString = datetime.dateLocalToISO(this.date.toLocaleDateString(this.locale));
|
|
7433
7513
|
}
|
|
7434
7514
|
if (this.date) {
|
|
7435
7515
|
const inputEl = this.$refs.inputDate;
|
|
@@ -7663,7 +7743,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
7663
7743
|
if (this.timeString) {
|
|
7664
7744
|
d = this.addTimeToDate(d);
|
|
7665
7745
|
}
|
|
7666
|
-
const dt =
|
|
7746
|
+
const dt = datetime.dateLocalToISO(d.toLocaleDateString(this.locale));
|
|
7667
7747
|
this.onSelectDate(dt);
|
|
7668
7748
|
}
|
|
7669
7749
|
}
|
|
@@ -7740,7 +7820,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
7740
7820
|
* dateString сбросим к текущей дате, чтобы календарь переключился на нее
|
|
7741
7821
|
* date ставим null, чтобы обнулить модель
|
|
7742
7822
|
*/
|
|
7743
|
-
this.dateString =
|
|
7823
|
+
this.dateString = datetime.dateLocalToISO(new Date().toLocaleDateString(this.locale));
|
|
7744
7824
|
this.date = null;
|
|
7745
7825
|
this.emitUpdateModelValue(null);
|
|
7746
7826
|
this.validate();
|
|
@@ -7841,7 +7921,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
7841
7921
|
this.emitUpdateModelValue(value);
|
|
7842
7922
|
}
|
|
7843
7923
|
else {
|
|
7844
|
-
this.emitUpdateModelValue(
|
|
7924
|
+
this.emitUpdateModelValue(datetime.toServerString(value));
|
|
7845
7925
|
}
|
|
7846
7926
|
}
|
|
7847
7927
|
}
|
|
@@ -11575,13 +11655,32 @@ function ld_select_list_box_reg(vue, options) {
|
|
|
11575
11655
|
}
|
|
11576
11656
|
/* harmony default export */ const src_ld_select_list_box = (ld_select_list_box_reg);
|
|
11577
11657
|
|
|
11578
|
-
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=
|
|
11658
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=068cc5f6&ts=true
|
|
11579
11659
|
|
|
11580
|
-
const
|
|
11581
|
-
|
|
11582
|
-
|
|
11660
|
+
const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_1 = {
|
|
11661
|
+
class: "d-flex align-center",
|
|
11662
|
+
style: { "position": "relative" }
|
|
11663
|
+
};
|
|
11664
|
+
const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_2 = ["checked", "data-testid", "tabindex", "disabled"];
|
|
11665
|
+
const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_3 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("i", { class: "v-icon" }, [
|
|
11666
|
+
/*#__PURE__*/ (0,external_vue_.createElementVNode)("svg", {
|
|
11667
|
+
width: "14",
|
|
11668
|
+
height: "15",
|
|
11669
|
+
viewBox: "0 0 14 15",
|
|
11670
|
+
fill: "none",
|
|
11671
|
+
id: "done_outline_24",
|
|
11672
|
+
version: "1.1",
|
|
11673
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11674
|
+
}, [
|
|
11675
|
+
/*#__PURE__*/ (0,external_vue_.createElementVNode)("path", {
|
|
11676
|
+
d: "M 5.2991701,9.7649048 2.4198478,6.8856204 c -0.1480901,-0.1481205 -0.3881923,-0.1481205 -0.5362898,0 L 1.6235017,7.1456842 c -0.1480902,0.1480445 -0.1480902,0.3881619 0,0.5362822 l 3.4075197,3.4075266 c 0.1480976,0.148046 0.3881999,0.148046 0.5362596,0 l 7.047968,-7.047989 c 0.14812,-0.1480976 0.14812,-0.3881999 0,-0.5362899 L 12.355185,3.245158 c -0.148045,-0.1480978 -0.388162,-0.1480978 -0.536283,0 z",
|
|
11677
|
+
fill: "#fff",
|
|
11678
|
+
style: { "stroke": "#fff", "stroke-width": "1", "stroke-opacity": "1" }
|
|
11679
|
+
})
|
|
11680
|
+
])
|
|
11681
|
+
], -1);
|
|
11682
|
+
function ld_checkboxvue_type_template_id_068cc5f6_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11583
11683
|
const _component_v_tooltip = (0,external_vue_.resolveComponent)("v-tooltip");
|
|
11584
|
-
const _component_v_icon = (0,external_vue_.resolveComponent)("v-icon");
|
|
11585
11684
|
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
|
|
11586
11685
|
class: (0,external_vue_.normalizeClass)(["ld-checkbox", { 'ld-checkbox--focused': _ctx.isFocused }])
|
|
11587
11686
|
}, [
|
|
@@ -11615,7 +11714,7 @@ function ld_checkboxvue_type_template_id_26c765c2_ts_true_render(_ctx, _cache, $
|
|
|
11615
11714
|
]))
|
|
11616
11715
|
: (0,external_vue_.createCommentVNode)("", true),
|
|
11617
11716
|
(0,external_vue_.createTextVNode)(),
|
|
11618
|
-
(0,external_vue_.createElementVNode)("label",
|
|
11717
|
+
(0,external_vue_.createElementVNode)("label", ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_1, [
|
|
11619
11718
|
(0,external_vue_.createElementVNode)("input", {
|
|
11620
11719
|
ref: "checkbox",
|
|
11621
11720
|
type: "checkbox",
|
|
@@ -11632,9 +11731,9 @@ function ld_checkboxvue_type_template_id_26c765c2_ts_true_render(_ctx, _cache, $
|
|
|
11632
11731
|
onInput: _cache[3] || (_cache[3] =
|
|
11633
11732
|
//@ts-ignore
|
|
11634
11733
|
(...args) => (_ctx.onChange && _ctx.onChange(...args)))
|
|
11635
|
-
}, null, 40,
|
|
11734
|
+
}, null, 40, ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_2),
|
|
11636
11735
|
(0,external_vue_.createTextVNode)(),
|
|
11637
|
-
|
|
11736
|
+
ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_3
|
|
11638
11737
|
]),
|
|
11639
11738
|
(0,external_vue_.createTextVNode)(),
|
|
11640
11739
|
(_ctx.label && !_ctx.labelOnLeft)
|
|
@@ -11670,7 +11769,7 @@ function ld_checkboxvue_type_template_id_26c765c2_ts_true_render(_ctx, _cache, $
|
|
|
11670
11769
|
], 2));
|
|
11671
11770
|
}
|
|
11672
11771
|
|
|
11673
|
-
;// CONCATENATED MODULE: ./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=
|
|
11772
|
+
;// CONCATENATED MODULE: ./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=068cc5f6&ts=true
|
|
11674
11773
|
|
|
11675
11774
|
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-checkbox/ld-checkbox.ts?vue&type=script&lang=ts&external
|
|
11676
11775
|
var ld_checkboxvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -11827,7 +11926,7 @@ ld_checkboxvue_type_script_lang_ts_external_decorate([
|
|
|
11827
11926
|
ld_checkboxvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
11828
11927
|
], CheckboxComponent.prototype, "emitUpdateModelValue", null);
|
|
11829
11928
|
ld_checkboxvue_type_script_lang_ts_external_decorate([
|
|
11830
|
-
(0,external_vue_property_decorator_.Watch)('modelValue'),
|
|
11929
|
+
(0,external_vue_property_decorator_.Watch)('modelValue', { deep: true }),
|
|
11831
11930
|
ld_checkboxvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
11832
11931
|
ld_checkboxvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
11833
11932
|
ld_checkboxvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
@@ -11843,7 +11942,7 @@ ld_checkboxvue_type_script_lang_ts_external_decorate([
|
|
|
11843
11942
|
;
|
|
11844
11943
|
|
|
11845
11944
|
|
|
11846
|
-
const ld_checkbox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(CheckboxComponent, [['render',
|
|
11945
|
+
const ld_checkbox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(CheckboxComponent, [['render',ld_checkboxvue_type_template_id_068cc5f6_ts_true_render]])
|
|
11847
11946
|
|
|
11848
11947
|
/* harmony default export */ const ld_checkbox = (ld_checkbox_exports_);
|
|
11849
11948
|
;// CONCATENATED MODULE: ./src/ld-checkbox/index.ts
|
|
@@ -15245,129 +15344,6 @@ function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $pr
|
|
|
15245
15344
|
|
|
15246
15345
|
// EXTERNAL MODULE: ./node_modules/@ldmjs/core/dist/index.js
|
|
15247
15346
|
var dist = __webpack_require__(634);
|
|
15248
|
-
;// CONCATENATED MODULE: ./src/utils/awaiting.ts
|
|
15249
|
-
async function awaiting(callback) {
|
|
15250
|
-
let resolveFunc = null;
|
|
15251
|
-
const counter = 0;
|
|
15252
|
-
let timer = null;
|
|
15253
|
-
const promise = new Promise(resolve => {
|
|
15254
|
-
resolveFunc = resolve;
|
|
15255
|
-
});
|
|
15256
|
-
timer = setInterval(() => {
|
|
15257
|
-
const a = callback();
|
|
15258
|
-
if (counter > 100 || Boolean(a)) {
|
|
15259
|
-
clearInterval(timer);
|
|
15260
|
-
resolveFunc(a ?? true);
|
|
15261
|
-
}
|
|
15262
|
-
}, 100);
|
|
15263
|
-
await promise;
|
|
15264
|
-
}
|
|
15265
|
-
|
|
15266
|
-
;// CONCATENATED MODULE: ./src/utils/datetime.ts
|
|
15267
|
-
function dateLocalToISO(value) {
|
|
15268
|
-
const parsed = /^(\d\d?).(\d\d?).(\d\d\d?\d?)$/.exec(value);
|
|
15269
|
-
let year = '';
|
|
15270
|
-
let month = '';
|
|
15271
|
-
let day = '';
|
|
15272
|
-
if (parsed[1]) {
|
|
15273
|
-
day = parsed[1].length === 1 ? '0' + parsed[1] : parsed[1];
|
|
15274
|
-
}
|
|
15275
|
-
if (parsed[2]) {
|
|
15276
|
-
month = parsed[2].length === 1 ? '0' + parsed[2] : parsed[2];
|
|
15277
|
-
}
|
|
15278
|
-
if (parsed[3]) {
|
|
15279
|
-
year = parsed[3];
|
|
15280
|
-
}
|
|
15281
|
-
if (day && month && year) {
|
|
15282
|
-
return `${year}-${month}-${day}`;
|
|
15283
|
-
}
|
|
15284
|
-
return '';
|
|
15285
|
-
}
|
|
15286
|
-
/**
|
|
15287
|
-
* Преобразует дату к формату yyyy-MM-ddThh:mm:ss+hh:mm (например, 2020-11-24T12:47:45+03:00)
|
|
15288
|
-
* @param dt Date
|
|
15289
|
-
*/
|
|
15290
|
-
function toServerString(dt) {
|
|
15291
|
-
if (!dt) {
|
|
15292
|
-
return null;
|
|
15293
|
-
}
|
|
15294
|
-
const tzo = -dt.getTimezoneOffset();
|
|
15295
|
-
const dif = tzo >= 0 ? '+' : '-';
|
|
15296
|
-
const pad = function (num) {
|
|
15297
|
-
const norm = Math.abs(Math.floor(num));
|
|
15298
|
-
return (norm < 10 ? '0' : '') + norm;
|
|
15299
|
-
};
|
|
15300
|
-
return `${dt.getFullYear()}-${pad(dt.getMonth() + 1)}-${pad(dt.getDate())}T${pad(dt.getHours())}:${pad(dt.getMinutes())}:${pad(dt.getSeconds())}${dif}${pad(tzo / 60)}:${pad(tzo % 60)}`;
|
|
15301
|
-
}
|
|
15302
|
-
const datetime = {
|
|
15303
|
-
dateLocalToISO,
|
|
15304
|
-
toServerString
|
|
15305
|
-
};
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
;// CONCATENATED MODULE: ./src/utils/deepValueGetter.ts
|
|
15309
|
-
/**
|
|
15310
|
-
* Returns a deep object given a string. zoo['animal.type']
|
|
15311
|
-
* @param {object} obj
|
|
15312
|
-
* @param {string} path
|
|
15313
|
-
*/
|
|
15314
|
-
function deepValueGetter(obj, path) {
|
|
15315
|
-
if (obj === null) {
|
|
15316
|
-
return '';
|
|
15317
|
-
}
|
|
15318
|
-
if (!obj || !path) {
|
|
15319
|
-
return obj;
|
|
15320
|
-
}
|
|
15321
|
-
// check if path matches a root-level field
|
|
15322
|
-
// { "a.b.c": 123 }
|
|
15323
|
-
const value = obj[path];
|
|
15324
|
-
// eslint-disable-next-line no-undefined
|
|
15325
|
-
if (value !== undefined) {
|
|
15326
|
-
return value;
|
|
15327
|
-
}
|
|
15328
|
-
let current = obj;
|
|
15329
|
-
const split = path.split('.');
|
|
15330
|
-
if (split.length) {
|
|
15331
|
-
for (const key of split) {
|
|
15332
|
-
current = current[key];
|
|
15333
|
-
// if found undefined, return empty string
|
|
15334
|
-
// eslint-disable-next-line no-undefined
|
|
15335
|
-
if (current === undefined || current === null) {
|
|
15336
|
-
return '';
|
|
15337
|
-
}
|
|
15338
|
-
}
|
|
15339
|
-
}
|
|
15340
|
-
return current;
|
|
15341
|
-
}
|
|
15342
|
-
|
|
15343
|
-
;// CONCATENATED MODULE: ./src/utils/delay.ts
|
|
15344
|
-
async function delay(timeout) {
|
|
15345
|
-
return new Promise(resolve => setTimeout(() => resolve(), timeout));
|
|
15346
|
-
}
|
|
15347
|
-
|
|
15348
|
-
;// CONCATENATED MODULE: ./src/utils/isObjectEmpty.ts
|
|
15349
|
-
function isObjectEmpty(obj) {
|
|
15350
|
-
for (const _i in obj) {
|
|
15351
|
-
return false;
|
|
15352
|
-
}
|
|
15353
|
-
return true;
|
|
15354
|
-
}
|
|
15355
|
-
|
|
15356
|
-
;// CONCATENATED MODULE: ./src/utils/urlRegexp.ts
|
|
15357
|
-
const urlRegexp =
|
|
15358
|
-
// eslint-disable-next-line optimize-regex/optimize-regex
|
|
15359
|
-
/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;
|
|
15360
|
-
|
|
15361
|
-
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
15347
|
;// CONCATENATED MODULE: ./src/ld-dialog/dialog.manager.ts
|
|
15372
15348
|
|
|
15373
15349
|
|
|
@@ -16698,82 +16674,1958 @@ function ld_dialog_reg(vue, options) {
|
|
|
16698
16674
|
}
|
|
16699
16675
|
/* harmony default export */ const src_ld_dialog = (ld_dialog_reg);
|
|
16700
16676
|
|
|
16701
|
-
|
|
16702
|
-
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
16706
|
-
|
|
16707
|
-
SquareButton: 'VBtn',
|
|
16708
|
-
SmallBadge: 'VChip',
|
|
16709
|
-
};
|
|
16710
|
-
const defaults = {
|
|
16711
|
-
global: {
|
|
16712
|
-
ripple: false,
|
|
16713
|
-
density: 'compact',
|
|
16714
|
-
},
|
|
16715
|
-
SmallButton: {
|
|
16716
|
-
variant: 'flat',
|
|
16717
|
-
color: 'primary',
|
|
16718
|
-
class: 'small-button',
|
|
16719
|
-
},
|
|
16720
|
-
SquareButton: {
|
|
16721
|
-
variant: 'text',
|
|
16722
|
-
color: 'grey',
|
|
16723
|
-
class: 'square-sm-button',
|
|
16724
|
-
},
|
|
16725
|
-
SmallBadge: {
|
|
16726
|
-
class: 'v-chip--badge',
|
|
16727
|
-
variant: 'outlined',
|
|
16728
|
-
},
|
|
16729
|
-
VToolbar: {
|
|
16730
|
-
height: 60,
|
|
16731
|
-
density: 'default',
|
|
16732
|
-
},
|
|
16677
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-data-iterator/ld-data-iterator.vue?vue&type=template&id=7f1ec2b2&ts=true
|
|
16678
|
+
|
|
16679
|
+
const ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_hoisted_1 = { class: "ld-data-iterator" };
|
|
16680
|
+
const ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_hoisted_2 = {
|
|
16681
|
+
key: 0,
|
|
16682
|
+
class: "top-fixed-item-wrapper"
|
|
16733
16683
|
};
|
|
16734
|
-
function
|
|
16735
|
-
const
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16684
|
+
function ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
16685
|
+
const _component_iterator_item = (0,external_vue_.resolveComponent)("iterator-item");
|
|
16686
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_hoisted_1, [
|
|
16687
|
+
(_ctx.fixedTopContext)
|
|
16688
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_hoisted_2, [
|
|
16689
|
+
(0,external_vue_.createVNode)(_component_iterator_item, {
|
|
16690
|
+
id: 'idx' + _ctx.fixedTopContext.rowIndex,
|
|
16691
|
+
class: "top-fixed-item",
|
|
16692
|
+
"data-uid": _ctx.id(_ctx.fixedTopContext.row),
|
|
16693
|
+
"data-test-id": "topFixedIeratorItem",
|
|
16694
|
+
onClick: _cache[0] || (_cache[0] = ($event) => (_ctx.onClick(_ctx.fixedTopContext))),
|
|
16695
|
+
onDblclick: _cache[1] || (_cache[1] = ($event) => (_ctx.onClick(_ctx.fixedTopContext))),
|
|
16696
|
+
onUpdateHeight: _ctx.onUpdateFixedTopHeight
|
|
16697
|
+
}, {
|
|
16698
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
16699
|
+
(0,external_vue_.renderSlot)(_ctx.$slots, "default", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: _ctx.fixedTopContext.row })), () => [
|
|
16700
|
+
(0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.entityFromItem(_ctx.fixedTopContext.row)[_ctx.keyProp]), 1)
|
|
16701
|
+
])
|
|
16702
|
+
]),
|
|
16703
|
+
_: 3
|
|
16704
|
+
}, 8, ["id", "data-uid", "onUpdateHeight"])
|
|
16705
|
+
]))
|
|
16706
|
+
: (0,external_vue_.createCommentVNode)("", true),
|
|
16707
|
+
(0,external_vue_.createTextVNode)(),
|
|
16708
|
+
(0,external_vue_.createElementVNode)("div", {
|
|
16709
|
+
ref: "list",
|
|
16710
|
+
id: "iterator-list",
|
|
16711
|
+
class: "iterator-list",
|
|
16712
|
+
style: (0,external_vue_.normalizeStyle)(_ctx.listStyles)
|
|
16713
|
+
}, [
|
|
16714
|
+
(0,external_vue_.createElementVNode)("div", {
|
|
16715
|
+
ref: "scroller",
|
|
16716
|
+
class: (0,external_vue_.normalizeClass)(["scroller", { mobile: _ctx.isMobileGlobal }]),
|
|
16717
|
+
style: (0,external_vue_.normalizeStyle)(_ctx.scrollerStyles)
|
|
16718
|
+
}, [
|
|
16719
|
+
((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.visibleItems, (item) => {
|
|
16720
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_iterator_item, {
|
|
16721
|
+
id: 'idx' + item.rowIndex,
|
|
16722
|
+
class: (0,external_vue_.normalizeClass)(["item", { 'active-list-item': _ctx.isItemActive(item), mobile: _ctx.isMobileGlobal, blink: _ctx.isItemRemoving(item) }]),
|
|
16723
|
+
key: _ctx.id(item.row),
|
|
16724
|
+
"data-uid": _ctx.id(item.row),
|
|
16725
|
+
style: (0,external_vue_.normalizeStyle)(_ctx.itemStyles(item)),
|
|
16726
|
+
"refresh-counter": _ctx.refreshCounter,
|
|
16727
|
+
"data-test-id": "iteratorItem",
|
|
16728
|
+
onClick: ($event) => (_ctx.onClick(item)),
|
|
16729
|
+
onDblclick: ($event) => (_ctx.onClick(item)),
|
|
16730
|
+
onUpdateHeight: ($event) => (_ctx.onUpdateItemHeight(item, $event))
|
|
16731
|
+
}, {
|
|
16732
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
16733
|
+
(0,external_vue_.renderSlot)(_ctx.$slots, "default", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: item.row, itemContext: { index: item.rowIndex } })), () => [
|
|
16734
|
+
(0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.entityFromItem(item.row) ? _ctx.entityFromItem(item.row)[_ctx.keyProp] : 'empty item'), 1)
|
|
16735
|
+
])
|
|
16736
|
+
]),
|
|
16737
|
+
_: 2
|
|
16738
|
+
}, 1032, ["id", "class", "data-uid", "style", "refresh-counter", "onClick", "onDblclick", "onUpdateHeight"]));
|
|
16739
|
+
}), 128))
|
|
16740
|
+
], 6)
|
|
16741
|
+
], 4)
|
|
16742
|
+
]));
|
|
16740
16743
|
}
|
|
16741
|
-
|
|
16742
16744
|
|
|
16743
|
-
;// CONCATENATED MODULE: ./src/
|
|
16744
|
-
const ActiveDirectiveOptions = {
|
|
16745
|
-
beforeMount(el, binding) {
|
|
16746
|
-
const className = '--active';
|
|
16747
|
-
const value = binding.value;
|
|
16748
|
-
el.classList[value ? 'add' : 'remove'](className);
|
|
16749
|
-
},
|
|
16750
|
-
updated(el, binding) {
|
|
16751
|
-
const className = '--active';
|
|
16752
|
-
const value = binding.value;
|
|
16753
|
-
el.classList[value ? 'add' : 'remove'](className);
|
|
16754
|
-
},
|
|
16755
|
-
};
|
|
16745
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/ld-data-iterator.vue?vue&type=template&id=7f1ec2b2&ts=true
|
|
16756
16746
|
|
|
16757
|
-
;// CONCATENATED MODULE: ./src/
|
|
16758
|
-
var
|
|
16747
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/iteratorItem.ts
|
|
16748
|
+
var iteratorItem_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16759
16749
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16760
16750
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16761
16751
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16762
16752
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16763
16753
|
};
|
|
16764
|
-
var
|
|
16754
|
+
var iteratorItem_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
16765
16755
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16766
16756
|
};
|
|
16757
|
+
var IteratorItemComponent_1;
|
|
16767
16758
|
|
|
16768
16759
|
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
this.
|
|
16760
|
+
let IteratorItemComponent = IteratorItemComponent_1 = class IteratorItemComponent extends external_vue_property_decorator_.Vue {
|
|
16761
|
+
constructor() {
|
|
16762
|
+
super(...arguments);
|
|
16763
|
+
this.height = 0;
|
|
16764
|
+
this.width = 0;
|
|
16765
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16766
|
+
this.resizeObserver = null;
|
|
16767
|
+
this.elem = null;
|
|
16768
|
+
}
|
|
16769
|
+
emitUpdateHeight(value) {
|
|
16770
|
+
return value;
|
|
16771
|
+
}
|
|
16772
|
+
emitRefreshCounterChanged() {
|
|
16773
|
+
this.emitUpdateHeight(this.$el.clientHeight);
|
|
16774
|
+
}
|
|
16775
|
+
mounted() {
|
|
16776
|
+
this.setupResizeObserver();
|
|
16777
|
+
this.elem = this.$el;
|
|
16778
|
+
this.resizeObserver.observe(this.$el);
|
|
16779
|
+
}
|
|
16780
|
+
beforeUpdate() {
|
|
16781
|
+
if (this.elem !== this.$el) {
|
|
16782
|
+
if (this.resizeObserver) {
|
|
16783
|
+
this.resizeObserver.unobserve(this.elem);
|
|
16784
|
+
}
|
|
16785
|
+
this.setupResizeObserver();
|
|
16786
|
+
this.resizeObserver.observe(this.$el);
|
|
16787
|
+
}
|
|
16788
|
+
}
|
|
16789
|
+
beforeUnmount() {
|
|
16790
|
+
this.resizeObserver.unobserve(this.$el);
|
|
16791
|
+
}
|
|
16792
|
+
setupResizeObserver() {
|
|
16793
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
16794
|
+
const vm = this;
|
|
16795
|
+
this.resizeObserver = new window.ResizeObserver(entries => {
|
|
16796
|
+
let height = 0;
|
|
16797
|
+
if (entries.length && entries[0].contentRect) {
|
|
16798
|
+
height = entries[0].contentRect.height;
|
|
16799
|
+
vm.width = entries[0].contentRect.width;
|
|
16800
|
+
}
|
|
16801
|
+
else {
|
|
16802
|
+
height = vm.$el.clientHeight;
|
|
16803
|
+
vm.width = vm.$el.clientWidth;
|
|
16804
|
+
}
|
|
16805
|
+
if (height > IteratorItemComponent_1.MIN_HEIGHT_EMTPY_ITEM && height !== vm.height) {
|
|
16806
|
+
vm.height = height;
|
|
16807
|
+
vm.emitUpdateHeight(vm.height);
|
|
16808
|
+
}
|
|
16809
|
+
});
|
|
16810
|
+
}
|
|
16811
|
+
};
|
|
16812
|
+
IteratorItemComponent.MIN_HEIGHT_EMTPY_ITEM = 20;
|
|
16813
|
+
iteratorItem_decorate([
|
|
16814
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
16815
|
+
iteratorItem_metadata("design:type", Number)
|
|
16816
|
+
], IteratorItemComponent.prototype, "refreshCounter", void 0);
|
|
16817
|
+
iteratorItem_decorate([
|
|
16818
|
+
Emit('update-height'),
|
|
16819
|
+
iteratorItem_metadata("design:type", Function),
|
|
16820
|
+
iteratorItem_metadata("design:paramtypes", [Number]),
|
|
16821
|
+
iteratorItem_metadata("design:returntype", void 0)
|
|
16822
|
+
], IteratorItemComponent.prototype, "emitUpdateHeight", null);
|
|
16823
|
+
iteratorItem_decorate([
|
|
16824
|
+
(0,external_vue_property_decorator_.Watch)('refreshCounter'),
|
|
16825
|
+
iteratorItem_metadata("design:type", Function),
|
|
16826
|
+
iteratorItem_metadata("design:paramtypes", []),
|
|
16827
|
+
iteratorItem_metadata("design:returntype", void 0)
|
|
16828
|
+
], IteratorItemComponent.prototype, "emitRefreshCounterChanged", null);
|
|
16829
|
+
IteratorItemComponent = IteratorItemComponent_1 = iteratorItem_decorate([
|
|
16830
|
+
(0,external_vue_property_decorator_.Options)({
|
|
16831
|
+
name: 'IteratorItem',
|
|
16832
|
+
template: `
|
|
16833
|
+
<div @click="$emit('click', $event)" @dblclick="$emit('dblclick', $event)">
|
|
16834
|
+
<slot></slot>
|
|
16835
|
+
</div>
|
|
16836
|
+
`,
|
|
16837
|
+
emits: ['click', 'dblclick'],
|
|
16838
|
+
})
|
|
16839
|
+
], IteratorItemComponent);
|
|
16840
|
+
/* harmony default export */ const iteratorItem = (IteratorItemComponent);
|
|
16841
|
+
|
|
16842
|
+
;// CONCATENATED MODULE: ./src/utils/strings.ts
|
|
16843
|
+
function camelCase(str) {
|
|
16844
|
+
// Replace special characters with a space
|
|
16845
|
+
str = str.replace(/[^\d A-Za-z]/g, ' ');
|
|
16846
|
+
// put a space before an uppercase letter
|
|
16847
|
+
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
|
|
16848
|
+
// Lower case first character and some other stuff
|
|
16849
|
+
str = str
|
|
16850
|
+
.replace(/([^\d A-Za-z])|^\d+/g, '')
|
|
16851
|
+
.trim()
|
|
16852
|
+
.toLowerCase();
|
|
16853
|
+
// uppercase characters preceded by a space or number
|
|
16854
|
+
str = str.replace(/([\d ]+)([A-Za-z])/g, (a, b, c) => b.trim() + c.toUpperCase());
|
|
16855
|
+
return str;
|
|
16856
|
+
}
|
|
16857
|
+
const strings = {
|
|
16858
|
+
camelCase
|
|
16859
|
+
};
|
|
16860
|
+
|
|
16861
|
+
|
|
16862
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/prefixes.ts
|
|
16863
|
+
/* eslint-disable no-undefined */
|
|
16864
|
+
|
|
16865
|
+
const cache = {};
|
|
16866
|
+
const testStyle = typeof document !== 'undefined' ? document.createElement('div').style : undefined;
|
|
16867
|
+
// Get Prefix
|
|
16868
|
+
// http://davidwalsh.name/vendor-prefix
|
|
16869
|
+
const prefix = (function () {
|
|
16870
|
+
const styles = typeof window !== 'undefined' ? window.getComputedStyle(document.documentElement, '') : undefined;
|
|
16871
|
+
const match = typeof styles !== 'undefined'
|
|
16872
|
+
? Array.prototype.slice
|
|
16873
|
+
.call(styles)
|
|
16874
|
+
.join('')
|
|
16875
|
+
.match(/-(moz|webkit|ms)-/)
|
|
16876
|
+
: null;
|
|
16877
|
+
const pre = match !== null ? match[1] : undefined;
|
|
16878
|
+
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
|
|
16879
|
+
const dom = typeof pre !== 'undefined' ? 'WebKit|Moz|MS|O'.match(new RegExp('(' + pre + ')', 'i'))[1] : undefined;
|
|
16880
|
+
return dom
|
|
16881
|
+
? {
|
|
16882
|
+
dom,
|
|
16883
|
+
lowercase: pre,
|
|
16884
|
+
css: `-${pre}-`,
|
|
16885
|
+
js: pre[0].toUpperCase() + pre.substr(1),
|
|
16886
|
+
}
|
|
16887
|
+
: undefined;
|
|
16888
|
+
})();
|
|
16889
|
+
function getVendorPrefixedName(property) {
|
|
16890
|
+
const name = strings.camelCase(property);
|
|
16891
|
+
if (!cache[name]) {
|
|
16892
|
+
if (prefix !== undefined && testStyle[(prefix.css + property)] !== undefined) {
|
|
16893
|
+
cache[name] = prefix.css + property;
|
|
16894
|
+
}
|
|
16895
|
+
else if (testStyle[property] !== undefined) {
|
|
16896
|
+
cache[name] = property;
|
|
16897
|
+
}
|
|
16898
|
+
}
|
|
16899
|
+
return cache[name];
|
|
16900
|
+
}
|
|
16901
|
+
|
|
16902
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/translate.ts
|
|
16903
|
+
|
|
16904
|
+
|
|
16905
|
+
// browser detection and prefixing tools
|
|
16906
|
+
const transform = typeof window !== 'undefined' ? getVendorPrefixedName('transform') : undefined;
|
|
16907
|
+
const backfaceVisibility = typeof window !== 'undefined' ? getVendorPrefixedName('backfaceVisibility') : undefined;
|
|
16908
|
+
const hasCSSTransforms = typeof window !== 'undefined' ? Boolean(getVendorPrefixedName('transform')) : undefined;
|
|
16909
|
+
const hasCSS3DTransforms = typeof window !== 'undefined' ? Boolean(getVendorPrefixedName('perspective')) : undefined;
|
|
16910
|
+
const ua = typeof window !== 'undefined' ? window.navigator.userAgent : 'Chrome';
|
|
16911
|
+
const isSafari = ua.includes('Safari/') && !ua.includes('Chrome/');
|
|
16912
|
+
function translateXY(styles, x, y) {
|
|
16913
|
+
if (typeof transform !== 'undefined' && hasCSSTransforms) {
|
|
16914
|
+
if (!isSafari && hasCSS3DTransforms) {
|
|
16915
|
+
styles[transform] = `translate3d(${x}px, ${y}px, 0)`;
|
|
16916
|
+
styles[backfaceVisibility] = 'hidden';
|
|
16917
|
+
}
|
|
16918
|
+
else {
|
|
16919
|
+
styles[strings.camelCase(transform)] = `translate(${x}px, ${y}px)`;
|
|
16920
|
+
}
|
|
16921
|
+
}
|
|
16922
|
+
else {
|
|
16923
|
+
styles.top = `${y}px`;
|
|
16924
|
+
styles.left = `${x}px`;
|
|
16925
|
+
}
|
|
16926
|
+
}
|
|
16927
|
+
|
|
16928
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-data-iterator/ld-data-iterator.ts?vue&type=script&lang=ts&external
|
|
16929
|
+
var ld_data_iteratorvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16930
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16931
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16932
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16933
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16934
|
+
};
|
|
16935
|
+
var ld_data_iteratorvue_type_script_lang_ts_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
16936
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16937
|
+
};
|
|
16938
|
+
var DataIteratorComponent_1;
|
|
16939
|
+
var ld_data_iteratorvue_type_script_lang_ts_external_a, ld_data_iteratorvue_type_script_lang_ts_external_b, ld_data_iteratorvue_type_script_lang_ts_external_c, ld_data_iteratorvue_type_script_lang_ts_external_d, ld_data_iteratorvue_type_script_lang_ts_external_e, ld_data_iteratorvue_type_script_lang_ts_external_f, ld_data_iteratorvue_type_script_lang_ts_external_g, ld_data_iteratorvue_type_script_lang_ts_external_h, ld_data_iteratorvue_type_script_lang_ts_external_j, _k, _l, _m;
|
|
16940
|
+
|
|
16941
|
+
|
|
16942
|
+
|
|
16943
|
+
|
|
16944
|
+
|
|
16945
|
+
|
|
16946
|
+
var ScrollTo;
|
|
16947
|
+
(function (ScrollTo) {
|
|
16948
|
+
ScrollTo[ScrollTo["None"] = 0] = "None";
|
|
16949
|
+
ScrollTo[ScrollTo["Page"] = 1] = "Page";
|
|
16950
|
+
ScrollTo[ScrollTo["ActiveRow"] = 2] = "ActiveRow";
|
|
16951
|
+
ScrollTo[ScrollTo["DoubleCheck"] = 3] = "DoubleCheck";
|
|
16952
|
+
})(ScrollTo || (ScrollTo = {}));
|
|
16953
|
+
let DataIteratorComponent = DataIteratorComponent_1 = class DataIteratorComponent extends (0,external_vue_property_decorator_.mixins)(ViewportMixin) {
|
|
16954
|
+
constructor() {
|
|
16955
|
+
super(...arguments);
|
|
16956
|
+
this.clicks = 0;
|
|
16957
|
+
this.scrollbarV = true;
|
|
16958
|
+
this.innerWidth = 0;
|
|
16959
|
+
this.bodyHeight = 0;
|
|
16960
|
+
this.offsetY = 0;
|
|
16961
|
+
this.currentPage = 0;
|
|
16962
|
+
this.activeRowIndex = -1;
|
|
16963
|
+
this.oldRowCount = 0;
|
|
16964
|
+
this.rowContexts = [];
|
|
16965
|
+
this.visibleItems = [];
|
|
16966
|
+
this.afterEmptyItems = [];
|
|
16967
|
+
this.beforeEmptyItems = [];
|
|
16968
|
+
this.rowHeightsUpdate = [];
|
|
16969
|
+
this.lastRowOffsetY = 0;
|
|
16970
|
+
this.enabledPages = null;
|
|
16971
|
+
this.itemsWaitingHeight = new Set();
|
|
16972
|
+
this.refreshCounter = 0;
|
|
16973
|
+
this.fixedTopContext = null;
|
|
16974
|
+
this.firstVisible = 0;
|
|
16975
|
+
this.lastVisible = 0;
|
|
16976
|
+
this.loading = false;
|
|
16977
|
+
this.scrollTo = ScrollTo.None;
|
|
16978
|
+
this.removingIndex = -1;
|
|
16979
|
+
this.changedItemsPromise = Promise.resolve();
|
|
16980
|
+
}
|
|
16981
|
+
emitUpdateLoading(value) {
|
|
16982
|
+
return value;
|
|
16983
|
+
}
|
|
16984
|
+
emitUpdateTotalPages(value) {
|
|
16985
|
+
return value;
|
|
16986
|
+
}
|
|
16987
|
+
emitUpdatePage(value) {
|
|
16988
|
+
return value;
|
|
16989
|
+
}
|
|
16990
|
+
emitUpdateSelect(row, index) {
|
|
16991
|
+
//
|
|
16992
|
+
}
|
|
16993
|
+
emitClick(row, index) {
|
|
16994
|
+
//
|
|
16995
|
+
}
|
|
16996
|
+
emitDblclick(row, index) {
|
|
16997
|
+
//
|
|
16998
|
+
}
|
|
16999
|
+
emitLoadingChanged() {
|
|
17000
|
+
this.emitUpdateLoading(this.loading);
|
|
17001
|
+
}
|
|
17002
|
+
async onItemsChanged(newVal, oldVal) {
|
|
17003
|
+
if (newVal === oldVal) {
|
|
17004
|
+
// дождемся обработки предыдущего изменения (т.к. удаление работает с задержкой на анимацию)
|
|
17005
|
+
await this.changedItemsPromise;
|
|
17006
|
+
let changeReason = 'updated';
|
|
17007
|
+
if (newVal.length < this.oldRowCount) {
|
|
17008
|
+
changeReason = 'removed';
|
|
17009
|
+
}
|
|
17010
|
+
else if (newVal.length > this.oldRowCount) {
|
|
17011
|
+
changeReason = 'added';
|
|
17012
|
+
}
|
|
17013
|
+
if (changeReason === 'removed' && this.removedItem) {
|
|
17014
|
+
this.changedItemsPromise = this.removeItem();
|
|
17015
|
+
await this.changedItemsPromise;
|
|
17016
|
+
this.removingIndex = -1;
|
|
17017
|
+
}
|
|
17018
|
+
this.rowContexts.forEach((rc, i) => {
|
|
17019
|
+
if (newVal[rc.index]) {
|
|
17020
|
+
rc.row = newVal[rc.index];
|
|
17021
|
+
}
|
|
17022
|
+
});
|
|
17023
|
+
if (changeReason === 'added') {
|
|
17024
|
+
const diff = newVal.length - this.oldRowCount;
|
|
17025
|
+
for (let i = 0; i < diff; i++) {
|
|
17026
|
+
const rc = this.rowContexts[this.oldRowCount - 1 + i];
|
|
17027
|
+
this.rowContexts.push({
|
|
17028
|
+
index: this.oldRowCount + i,
|
|
17029
|
+
rowIndex: this.oldRowCount + i,
|
|
17030
|
+
offsetY: rc ? rc.offsetY + this.approximateRowHeight : 0,
|
|
17031
|
+
row: newVal[this.oldRowCount + i],
|
|
17032
|
+
rowHeight: this.approximateRowHeight,
|
|
17033
|
+
});
|
|
17034
|
+
}
|
|
17035
|
+
this.sort();
|
|
17036
|
+
this.updateRows(true);
|
|
17037
|
+
}
|
|
17038
|
+
this.oldRowCount = this.rowContexts.length;
|
|
17039
|
+
return;
|
|
17040
|
+
}
|
|
17041
|
+
this.visibleItems = [];
|
|
17042
|
+
this.rowContexts = [];
|
|
17043
|
+
if (newVal !== oldVal) {
|
|
17044
|
+
await this.$nextTick();
|
|
17045
|
+
}
|
|
17046
|
+
this.rowsChanged = true;
|
|
17047
|
+
this.init();
|
|
17048
|
+
this.sort();
|
|
17049
|
+
this.oldRowCount = this.rowContexts.length;
|
|
17050
|
+
this.offsetY = -1;
|
|
17051
|
+
this.currentPage = -1;
|
|
17052
|
+
this.totalPages = this.rowCount && this.page >= 0 ? this.page + 1 : 1;
|
|
17053
|
+
this.emitUpdateTotalPages(this.totalPages);
|
|
17054
|
+
this.listEl.scrollTop = 0;
|
|
17055
|
+
if (newVal !== oldVal) {
|
|
17056
|
+
this.listEl.style['visibility'] = 'hidden';
|
|
17057
|
+
}
|
|
17058
|
+
this.waitingForFirstPageRendered = true;
|
|
17059
|
+
DataIteratorComponent_1.CNT = 0;
|
|
17060
|
+
DataIteratorComponent_1.COUNTER = 0;
|
|
17061
|
+
if (!this.rowContexts.length) {
|
|
17062
|
+
this.renderPromise = Promise.resolve();
|
|
17063
|
+
}
|
|
17064
|
+
else {
|
|
17065
|
+
this.renderPromise = new Promise(resolve => {
|
|
17066
|
+
this.renderResolve = resolve;
|
|
17067
|
+
});
|
|
17068
|
+
}
|
|
17069
|
+
try {
|
|
17070
|
+
await this.renderPromise;
|
|
17071
|
+
if (!this.selectedIndices.length) {
|
|
17072
|
+
this.setSelected(0);
|
|
17073
|
+
}
|
|
17074
|
+
}
|
|
17075
|
+
finally {
|
|
17076
|
+
if (this.listEl) {
|
|
17077
|
+
this.listEl.style['visibility'] = 'unset';
|
|
17078
|
+
}
|
|
17079
|
+
this.waitingForFirstPageRendered = false;
|
|
17080
|
+
if (this.rowContexts.length) {
|
|
17081
|
+
this.onPageChanged();
|
|
17082
|
+
}
|
|
17083
|
+
}
|
|
17084
|
+
}
|
|
17085
|
+
onScrollHeightChanged() {
|
|
17086
|
+
this.calcTotalPages();
|
|
17087
|
+
}
|
|
17088
|
+
async onFixTopActiveItemChanged() {
|
|
17089
|
+
if (!this.activeItem && !this.fixTopActiveItem) {
|
|
17090
|
+
return;
|
|
17091
|
+
}
|
|
17092
|
+
if (this.fixTopActiveItem) {
|
|
17093
|
+
this.fixedTopContext = this.excludeItem(this.activeItem);
|
|
17094
|
+
}
|
|
17095
|
+
else {
|
|
17096
|
+
this.includeItem(this.fixedTopContext);
|
|
17097
|
+
this.fixedTopContext = null;
|
|
17098
|
+
}
|
|
17099
|
+
await this.$nextTick();
|
|
17100
|
+
if (this.listEl) {
|
|
17101
|
+
const dims = this.listEl.getBoundingClientRect();
|
|
17102
|
+
this.innerWidth = Math.floor(dims.width);
|
|
17103
|
+
this.bodyHeight = dims.height;
|
|
17104
|
+
}
|
|
17105
|
+
this.updateRows(true);
|
|
17106
|
+
this.updatePage();
|
|
17107
|
+
await this.$nextTick();
|
|
17108
|
+
this.calcTotalPages();
|
|
17109
|
+
}
|
|
17110
|
+
onMinRowHeightChanged() {
|
|
17111
|
+
this.onItemsChanged(this.items, null);
|
|
17112
|
+
}
|
|
17113
|
+
onPageChanged() {
|
|
17114
|
+
if (this.page === this.currentPage ||
|
|
17115
|
+
this.waitingForFirstPageRendered ||
|
|
17116
|
+
// eslint-disable-next-line no-undefined
|
|
17117
|
+
this.waitingForFirstPageRendered === undefined) {
|
|
17118
|
+
return;
|
|
17119
|
+
}
|
|
17120
|
+
DataIteratorComponent_1.COUNTER = 0;
|
|
17121
|
+
if ((this.rowCount && !this.visibleItems.length) || !this.listEl) {
|
|
17122
|
+
this.callOnPageChanged = true;
|
|
17123
|
+
this.startCheckAllRowsIsRendered();
|
|
17124
|
+
return;
|
|
17125
|
+
}
|
|
17126
|
+
// установить offsetY начала страницы
|
|
17127
|
+
let offsetY = (this.page - 1) * this.bodyHeight;
|
|
17128
|
+
offsetY += 1;
|
|
17129
|
+
const pageDiff = Math.abs(this.currentPage - this.page);
|
|
17130
|
+
let first = this.getRowIndex(offsetY);
|
|
17131
|
+
this.firstRowForPage = first;
|
|
17132
|
+
this.scrollTo = ScrollTo.Page;
|
|
17133
|
+
const last = Math.min(first + this.visibleItems.length - 1, this.rowHeightsUpdate.length - 1);
|
|
17134
|
+
if ((pageDiff > 1 || (this.toLastPage && !this.scrollToActiveItem)) &&
|
|
17135
|
+
(!this.rowHeightsUpdate[first] || !this.rowHeightsUpdate[last])) {
|
|
17136
|
+
this.loading = true;
|
|
17137
|
+
// найдем 1-й элемент по средней высоте элемента
|
|
17138
|
+
first = this.getRowIndexByAverage(offsetY);
|
|
17139
|
+
if (first >= this.items.length - 1) {
|
|
17140
|
+
first = this.items.length - 10;
|
|
17141
|
+
}
|
|
17142
|
+
this.firstRowForPage = first;
|
|
17143
|
+
}
|
|
17144
|
+
const rowContext = this.rowContexts[first];
|
|
17145
|
+
this.fromPager = true;
|
|
17146
|
+
if (this.scrollToActiveItem && this.currentPage < 0) {
|
|
17147
|
+
// для режима превью и первой загрузки списка перейдем к активному элементу (т.е., возможно, изменим страницу)
|
|
17148
|
+
this.scrollTo = ScrollTo.ActiveRow;
|
|
17149
|
+
this.firstRowForPage = null;
|
|
17150
|
+
}
|
|
17151
|
+
this.currentPage = this.page;
|
|
17152
|
+
if (rowContext) {
|
|
17153
|
+
this.listEl.scrollTop = rowContext.offsetY;
|
|
17154
|
+
if (this.shouldSetActiveRow) {
|
|
17155
|
+
this.shouldSetActiveRow = false;
|
|
17156
|
+
this.setSelected(first);
|
|
17157
|
+
}
|
|
17158
|
+
}
|
|
17159
|
+
this.startCheckAllRowsIsRendered();
|
|
17160
|
+
}
|
|
17161
|
+
onSortFieldChanged(newVal, oldVal) {
|
|
17162
|
+
if (newVal?.prop !== oldVal?.prop || newVal?.direction !== oldVal?.direction) {
|
|
17163
|
+
this.sort();
|
|
17164
|
+
this.updateRows(true);
|
|
17165
|
+
}
|
|
17166
|
+
}
|
|
17167
|
+
onSelectedIndicesChanged() {
|
|
17168
|
+
if (Array.isArray(this.selectedIndices) && this.selectedIndices.length) {
|
|
17169
|
+
const index = this.selectedIndices[0];
|
|
17170
|
+
const i = this.rowContexts.findIndex(r => r.index === index);
|
|
17171
|
+
if (i >= 0) {
|
|
17172
|
+
this.activeRowIndex = i;
|
|
17173
|
+
}
|
|
17174
|
+
}
|
|
17175
|
+
else {
|
|
17176
|
+
this.activeRowIndex = -1;
|
|
17177
|
+
}
|
|
17178
|
+
}
|
|
17179
|
+
async onFirstItemSelectCounterChanged() {
|
|
17180
|
+
await this.renderPromise;
|
|
17181
|
+
this.setSelected(0);
|
|
17182
|
+
}
|
|
17183
|
+
onNextItemSelectCounterChanged() {
|
|
17184
|
+
if (this.activeRowIndex + 1 < this.rowContexts.length) {
|
|
17185
|
+
this.setSelected(this.activeRowIndex + 1);
|
|
17186
|
+
}
|
|
17187
|
+
}
|
|
17188
|
+
async onInnerWidthChanged(newVal, oldVal) {
|
|
17189
|
+
if (!oldVal) {
|
|
17190
|
+
return;
|
|
17191
|
+
}
|
|
17192
|
+
this.updateRowOffsetsCache(0, true);
|
|
17193
|
+
this.updateRows(true);
|
|
17194
|
+
this.updatePage();
|
|
17195
|
+
await this.$nextTick();
|
|
17196
|
+
this.calcTotalPages();
|
|
17197
|
+
}
|
|
17198
|
+
created() {
|
|
17199
|
+
this.onItemsChanged(this.items, null);
|
|
17200
|
+
}
|
|
17201
|
+
mounted() {
|
|
17202
|
+
if (window.ResizeObserver) {
|
|
17203
|
+
this.resizeObserver = new window.ResizeObserver(entries => {
|
|
17204
|
+
if (entries.length && entries[0].contentRect) {
|
|
17205
|
+
this.bodyHeight = entries[0].contentRect.height;
|
|
17206
|
+
this.innerWidth = entries[0].contentRect.width;
|
|
17207
|
+
}
|
|
17208
|
+
else {
|
|
17209
|
+
this.bodyHeight = this.$el.clientHeight;
|
|
17210
|
+
this.innerWidth = this.$el.clientWidth;
|
|
17211
|
+
}
|
|
17212
|
+
});
|
|
17213
|
+
this.resizeObserver.observe(this.$el);
|
|
17214
|
+
}
|
|
17215
|
+
this.listEl = this.$el.querySelector('#iterator-list');
|
|
17216
|
+
const dims = this.listEl.getBoundingClientRect();
|
|
17217
|
+
this.innerWidth = Math.floor(dims.width);
|
|
17218
|
+
this.bodyHeight = dims.height;
|
|
17219
|
+
this.init();
|
|
17220
|
+
this.offsetY = 0;
|
|
17221
|
+
this.currentPage = -1;
|
|
17222
|
+
this.totalPages = 1;
|
|
17223
|
+
this.onKeyDownHandler = this.onKeyDown.bind(this);
|
|
17224
|
+
document.addEventListener('keydown', this.onKeyDownHandler);
|
|
17225
|
+
this.tick();
|
|
17226
|
+
}
|
|
17227
|
+
beforeUnmount() {
|
|
17228
|
+
this.stopTick = true;
|
|
17229
|
+
document.removeEventListener('keydown', this.onKeyDownHandler);
|
|
17230
|
+
if (this.resizeObserver) {
|
|
17231
|
+
this.resizeObserver.unobserve(this.$el);
|
|
17232
|
+
}
|
|
17233
|
+
}
|
|
17234
|
+
tick(force = false) {
|
|
17235
|
+
if (this.stopTick) {
|
|
17236
|
+
return;
|
|
17237
|
+
}
|
|
17238
|
+
requestAnimationFrame(() => this.tick());
|
|
17239
|
+
this.loading = this.waitingForFirstPageRendered || Boolean(this.scrollTo !== ScrollTo.None);
|
|
17240
|
+
if (this.scrollbarV) {
|
|
17241
|
+
if (!this.listEl) {
|
|
17242
|
+
return;
|
|
17243
|
+
}
|
|
17244
|
+
const scrollTop = this.listEl.scrollTop;
|
|
17245
|
+
if (!force && this.offsetY === scrollTop) {
|
|
17246
|
+
return;
|
|
17247
|
+
}
|
|
17248
|
+
this.offsetY = scrollTop;
|
|
17249
|
+
clearTimeout(this.updatePageTimeoutId);
|
|
17250
|
+
if (this.scrollTo === ScrollTo.Page) {
|
|
17251
|
+
// чтобы был виден лоадер нужно вызвать через setTimeout
|
|
17252
|
+
setTimeout(() => this.updateRows(), 10);
|
|
17253
|
+
}
|
|
17254
|
+
else {
|
|
17255
|
+
this.updateRows();
|
|
17256
|
+
}
|
|
17257
|
+
this.updatePageTimeoutId = setTimeout(() => this.updatePage(), 100);
|
|
17258
|
+
}
|
|
17259
|
+
}
|
|
17260
|
+
isItemActive(item) {
|
|
17261
|
+
return item.row === this.activeItem;
|
|
17262
|
+
}
|
|
17263
|
+
isItemRemoving(rc) {
|
|
17264
|
+
return rc.rowIndex === this.removingIndex;
|
|
17265
|
+
}
|
|
17266
|
+
onClick(rc) {
|
|
17267
|
+
this.clicks++;
|
|
17268
|
+
if (this.clicks === 1) {
|
|
17269
|
+
this.timerId = setTimeout(() => {
|
|
17270
|
+
this.emitClick(rc.row, rc.index);
|
|
17271
|
+
this.clicks = 0;
|
|
17272
|
+
}, 200);
|
|
17273
|
+
}
|
|
17274
|
+
else {
|
|
17275
|
+
clearTimeout(this.timerId);
|
|
17276
|
+
this.emitDblclick(rc.row, rc.index);
|
|
17277
|
+
this.clicks = 0;
|
|
17278
|
+
}
|
|
17279
|
+
this.setSelected(rc.rowIndex);
|
|
17280
|
+
}
|
|
17281
|
+
onFocus() {
|
|
17282
|
+
this.isFocused = true;
|
|
17283
|
+
}
|
|
17284
|
+
onBlur() {
|
|
17285
|
+
this.isFocused = false;
|
|
17286
|
+
}
|
|
17287
|
+
onUpdateFixedTopHeight(height) {
|
|
17288
|
+
if (!this.fixedTopContext) {
|
|
17289
|
+
return;
|
|
17290
|
+
}
|
|
17291
|
+
this.fixedTopContext.rowHeight = height;
|
|
17292
|
+
}
|
|
17293
|
+
onUpdateItemHeight(rowContext, height) {
|
|
17294
|
+
try {
|
|
17295
|
+
height += this.itemGap;
|
|
17296
|
+
if (this.rowHeightsUpdate[rowContext.rowIndex] && rowContext.rowHeight === height) {
|
|
17297
|
+
return;
|
|
17298
|
+
}
|
|
17299
|
+
rowContext.rowHeight = height;
|
|
17300
|
+
this.itemsWaitingHeight.delete(rowContext.rowIndex);
|
|
17301
|
+
if (rowContext.rowIndex === 0) {
|
|
17302
|
+
rowContext.offsetY = 0;
|
|
17303
|
+
}
|
|
17304
|
+
clearTimeout(this.waitForAllRowsUpdatedTimer);
|
|
17305
|
+
this.waitForAllRowsUpdatedTimer = setTimeout(() => {
|
|
17306
|
+
if (this.itemsWaitingHeight.size && DataIteratorComponent_1.CNT < 50) {
|
|
17307
|
+
DataIteratorComponent_1.CNT++;
|
|
17308
|
+
return;
|
|
17309
|
+
}
|
|
17310
|
+
if (this.waitingForFirstPageRendered) {
|
|
17311
|
+
this.renderResolve();
|
|
17312
|
+
}
|
|
17313
|
+
else {
|
|
17314
|
+
this.startCheckAllRowsIsRendered();
|
|
17315
|
+
}
|
|
17316
|
+
}, 50);
|
|
17317
|
+
}
|
|
17318
|
+
finally {
|
|
17319
|
+
this.rowHeightsUpdate[rowContext.rowIndex] = true;
|
|
17320
|
+
if (!this.itemsWaitingHeight.size) {
|
|
17321
|
+
this.updateRowOffsetsCache(this.firstVisible, true);
|
|
17322
|
+
}
|
|
17323
|
+
}
|
|
17324
|
+
}
|
|
17325
|
+
startCheckAllRowsIsRendered(timeout) {
|
|
17326
|
+
this.stopCheckAllRowsIsRendered();
|
|
17327
|
+
this.checkRowsUpdatedTimer = setTimeout(() => this.checkRowsUpdated(), timeout ?? 50);
|
|
17328
|
+
}
|
|
17329
|
+
stopCheckAllRowsIsRendered() {
|
|
17330
|
+
clearTimeout(this.checkRowsUpdatedTimer);
|
|
17331
|
+
}
|
|
17332
|
+
checkRowsUpdated() {
|
|
17333
|
+
if (this.itemsWaitingHeight.size || !this.listEl) {
|
|
17334
|
+
DataIteratorComponent_1.COUNTER++;
|
|
17335
|
+
if (DataIteratorComponent_1.COUNTER > 50) {
|
|
17336
|
+
this.itemsWaitingHeight.clear();
|
|
17337
|
+
this.updateRowOffsetsCache(0, true);
|
|
17338
|
+
}
|
|
17339
|
+
this.startCheckAllRowsIsRendered();
|
|
17340
|
+
return;
|
|
17341
|
+
}
|
|
17342
|
+
this.stopCheckAllRowsIsRendered();
|
|
17343
|
+
this.fromPager = false;
|
|
17344
|
+
if (this.callOnPageChanged) {
|
|
17345
|
+
// нужно дополнительно вызвать onPageChanged
|
|
17346
|
+
this.callOnPageChanged = false;
|
|
17347
|
+
this.$nextTick(() => this.onPageChanged());
|
|
17348
|
+
return;
|
|
17349
|
+
}
|
|
17350
|
+
if (this.scrollTo === ScrollTo.DoubleCheck) {
|
|
17351
|
+
let first = this.firstRowForPage ?? this.activeRowIndex;
|
|
17352
|
+
// eslint-disable-next-line no-undefined
|
|
17353
|
+
if (first === null || first === undefined || first < 0) {
|
|
17354
|
+
this.onSelectedIndicesChanged();
|
|
17355
|
+
first = this.activeRowIndex;
|
|
17356
|
+
this.setSelected(first);
|
|
17357
|
+
}
|
|
17358
|
+
if (first >= 0 && this.rowHeightsUpdate[first]) {
|
|
17359
|
+
const rc = this.rowContexts[first];
|
|
17360
|
+
const el = this.listEl;
|
|
17361
|
+
const bottom = el.scrollTop + this.bodyHeight;
|
|
17362
|
+
if (rc.offsetY >= el.scrollTop && (rc.offsetY + rc.rowHeight <= bottom || rc.rowHeight >= bottom)) {
|
|
17363
|
+
this.scrollTo = ScrollTo.None;
|
|
17364
|
+
this.firstRowForPage = null;
|
|
17365
|
+
this.updatePage();
|
|
17366
|
+
if (this.toLastPage && this.currentPage < this.totalPages && DataIteratorComponent_1.COUNTER < 10) {
|
|
17367
|
+
DataIteratorComponent_1.COUNTER++;
|
|
17368
|
+
this.scrollTo = ScrollTo.Page;
|
|
17369
|
+
this.firstRowForPage = this.rowCount - 5;
|
|
17370
|
+
}
|
|
17371
|
+
}
|
|
17372
|
+
else {
|
|
17373
|
+
el.scrollTop = rc.offsetY;
|
|
17374
|
+
}
|
|
17375
|
+
}
|
|
17376
|
+
else {
|
|
17377
|
+
this.scrollTo = ScrollTo.None;
|
|
17378
|
+
}
|
|
17379
|
+
}
|
|
17380
|
+
if (this.scrollTo === ScrollTo.Page || this.scrollTo === ScrollTo.ActiveRow) {
|
|
17381
|
+
// переход на страницу, которая еще не рендерилась
|
|
17382
|
+
let first = this.firstRowForPage;
|
|
17383
|
+
if (this.scrollTo === ScrollTo.ActiveRow) {
|
|
17384
|
+
if (this.activeRowIndex < 0) {
|
|
17385
|
+
this.onSelectedIndicesChanged();
|
|
17386
|
+
this.setSelected(this.activeRowIndex);
|
|
17387
|
+
}
|
|
17388
|
+
first = this.activeRowIndex;
|
|
17389
|
+
}
|
|
17390
|
+
this.scrollTo = ScrollTo.DoubleCheck;
|
|
17391
|
+
if (first >= 0) {
|
|
17392
|
+
const rc = this.rowContexts[first];
|
|
17393
|
+
const el = this.listEl;
|
|
17394
|
+
el.scrollTop = rc?.offsetY ?? 0;
|
|
17395
|
+
}
|
|
17396
|
+
}
|
|
17397
|
+
if (this.scrollTo !== ScrollTo.None) {
|
|
17398
|
+
this.startCheckAllRowsIsRendered(100);
|
|
17399
|
+
}
|
|
17400
|
+
}
|
|
17401
|
+
updateRowOffsetsCache(rowIndex, all) {
|
|
17402
|
+
let context = this.rowContexts[rowIndex];
|
|
17403
|
+
if (!context) {
|
|
17404
|
+
return;
|
|
17405
|
+
}
|
|
17406
|
+
let offsetY = context.offsetY;
|
|
17407
|
+
let height = 0;
|
|
17408
|
+
const last = all ? this.rowContexts.length : this.lastVisible + 1;
|
|
17409
|
+
while (context && rowIndex < last) {
|
|
17410
|
+
context.offsetY = offsetY;
|
|
17411
|
+
this.rowContexts[rowIndex] = context;
|
|
17412
|
+
height = context.rowHeight;
|
|
17413
|
+
offsetY += height;
|
|
17414
|
+
rowIndex++;
|
|
17415
|
+
context = this.rowContexts[rowIndex];
|
|
17416
|
+
}
|
|
17417
|
+
this.lastRowOffsetY = offsetY;
|
|
17418
|
+
}
|
|
17419
|
+
itemStyles(rowContext) {
|
|
17420
|
+
const styles = {};
|
|
17421
|
+
if (rowContext.rowIndex === 0) {
|
|
17422
|
+
translateXY(styles, 0, 0);
|
|
17423
|
+
return styles;
|
|
17424
|
+
}
|
|
17425
|
+
if (rowContext.offsetY) {
|
|
17426
|
+
translateXY(styles, 0, rowContext.offsetY);
|
|
17427
|
+
return styles;
|
|
17428
|
+
}
|
|
17429
|
+
const posY = this.rowContexts[rowContext.rowIndex].offsetY;
|
|
17430
|
+
translateXY(styles, 0, posY);
|
|
17431
|
+
return styles;
|
|
17432
|
+
}
|
|
17433
|
+
topFixedStyles() {
|
|
17434
|
+
return {
|
|
17435
|
+
height: this.fixedTopContext?.rowHeight + 'px',
|
|
17436
|
+
};
|
|
17437
|
+
}
|
|
17438
|
+
emptyItemStyles(rowContext) {
|
|
17439
|
+
const styles = {
|
|
17440
|
+
height: rowContext.rowHeight + 'px',
|
|
17441
|
+
};
|
|
17442
|
+
if (rowContext.offsetY) {
|
|
17443
|
+
translateXY(styles, 0, rowContext.offsetY);
|
|
17444
|
+
}
|
|
17445
|
+
return styles;
|
|
17446
|
+
}
|
|
17447
|
+
onKeyDown(event) {
|
|
17448
|
+
const target = event.target;
|
|
17449
|
+
if (target.tagName !== 'BODY') {
|
|
17450
|
+
return;
|
|
17451
|
+
}
|
|
17452
|
+
if (['ArrowUp', 'PageUp', 'ArrowDown', 'PageDown'].includes(event.code)) {
|
|
17453
|
+
event.preventDefault();
|
|
17454
|
+
event.stopPropagation();
|
|
17455
|
+
}
|
|
17456
|
+
if (['PageUp', 'PageDown'].includes(event.code)) {
|
|
17457
|
+
if (event.code === 'PageUp' && this.currentPage > 0) {
|
|
17458
|
+
this.shouldSetActiveRow = true;
|
|
17459
|
+
this.emitUpdatePage(this.currentPage - 1);
|
|
17460
|
+
return;
|
|
17461
|
+
}
|
|
17462
|
+
if (event.code === 'PageDown' && this.currentPage < this.totalPages) {
|
|
17463
|
+
this.shouldSetActiveRow = true;
|
|
17464
|
+
this.emitUpdatePage(this.currentPage + 1);
|
|
17465
|
+
return;
|
|
17466
|
+
}
|
|
17467
|
+
}
|
|
17468
|
+
let nextRowIndex = -1;
|
|
17469
|
+
const maxRowIndex = this.rowContexts[this.rowContexts.length - 1]?.rowIndex;
|
|
17470
|
+
switch (event.code) {
|
|
17471
|
+
case 'ArrowUp':
|
|
17472
|
+
if (this.activeRowIndex > 0) {
|
|
17473
|
+
nextRowIndex = this.activeRowIndex - 1;
|
|
17474
|
+
}
|
|
17475
|
+
break;
|
|
17476
|
+
case 'ArrowDown':
|
|
17477
|
+
if (this.activeRowIndex < this.rowContexts.length - 1) {
|
|
17478
|
+
nextRowIndex = this.activeRowIndex + 1;
|
|
17479
|
+
}
|
|
17480
|
+
break;
|
|
17481
|
+
}
|
|
17482
|
+
if (nextRowIndex < 0 || nextRowIndex > maxRowIndex) {
|
|
17483
|
+
return;
|
|
17484
|
+
}
|
|
17485
|
+
const { offsetY, rowHeight } = this.rowContexts[nextRowIndex];
|
|
17486
|
+
if (!rowHeight) {
|
|
17487
|
+
return;
|
|
17488
|
+
}
|
|
17489
|
+
let h = 0;
|
|
17490
|
+
let scrollTop = this.listEl.scrollTop;
|
|
17491
|
+
if (event.code === 'ArrowDown') {
|
|
17492
|
+
h = offsetY + rowHeight - (scrollTop + this.bodyHeight);
|
|
17493
|
+
}
|
|
17494
|
+
else if (event.code === 'ArrowUp') {
|
|
17495
|
+
h = offsetY - rowHeight - scrollTop;
|
|
17496
|
+
}
|
|
17497
|
+
if (h > 0 && event.code === 'ArrowDown') {
|
|
17498
|
+
scrollTop += h;
|
|
17499
|
+
}
|
|
17500
|
+
else if (h < 0 && event.code === 'ArrowUp') {
|
|
17501
|
+
scrollTop += h;
|
|
17502
|
+
}
|
|
17503
|
+
else if (h === 0 && event.code === 'ArrowUp' && [0, 1, 2].includes(this.activeRowIndex)) {
|
|
17504
|
+
scrollTop = h;
|
|
17505
|
+
}
|
|
17506
|
+
this.listEl.scrollTop = scrollTop;
|
|
17507
|
+
this.setSelected(nextRowIndex);
|
|
17508
|
+
}
|
|
17509
|
+
calcTotalPages() {
|
|
17510
|
+
let totalPages = this.bodyHeight ? this.scrollHeight / this.bodyHeight : 1;
|
|
17511
|
+
const rounded = Math.floor(totalPages);
|
|
17512
|
+
const rest = totalPages - rounded;
|
|
17513
|
+
const averageHeight = this.getAverageItemHeight();
|
|
17514
|
+
if (rest >= averageHeight / this.scrollHeight) {
|
|
17515
|
+
totalPages = Math.ceil(totalPages);
|
|
17516
|
+
}
|
|
17517
|
+
else {
|
|
17518
|
+
totalPages = rounded;
|
|
17519
|
+
}
|
|
17520
|
+
if (this.totalPages !== totalPages) {
|
|
17521
|
+
this.totalPages = totalPages;
|
|
17522
|
+
this.emitUpdateTotalPages(totalPages);
|
|
17523
|
+
}
|
|
17524
|
+
if (!this.scrollToActiveItem && this.toLastPage && this.currentPage < this.totalPages) {
|
|
17525
|
+
// для перехода на последнюю страницу (для НЕ превью) изменим страницу
|
|
17526
|
+
this.emitUpdatePage(this.totalPages);
|
|
17527
|
+
}
|
|
17528
|
+
return totalPages;
|
|
17529
|
+
}
|
|
17530
|
+
updatePage() {
|
|
17531
|
+
if (this.fromPager || this.currentPage < 0 || this.firstRowForPage || this.callOnPageChanged) {
|
|
17532
|
+
return;
|
|
17533
|
+
}
|
|
17534
|
+
let offset;
|
|
17535
|
+
let realLastVisible = this.lastVisible;
|
|
17536
|
+
for (let i = this.lastVisible; i >= 0; i--) {
|
|
17537
|
+
const rowContext = this.rowContexts[i];
|
|
17538
|
+
if (!rowContext) {
|
|
17539
|
+
throw new Error('null rowContext');
|
|
17540
|
+
}
|
|
17541
|
+
if (this.offsetY + this.bodyHeight >= rowContext.offsetY) {
|
|
17542
|
+
realLastVisible = i;
|
|
17543
|
+
break;
|
|
17544
|
+
}
|
|
17545
|
+
}
|
|
17546
|
+
if (realLastVisible >= this.rowCount - 1 || this.scrollHeight - this.bodyHeight === this.offsetY) {
|
|
17547
|
+
offset = this.totalPages;
|
|
17548
|
+
this.emitUpdateTotalPages(this.totalPages);
|
|
17549
|
+
}
|
|
17550
|
+
else {
|
|
17551
|
+
const index = this.getRowIndex(this.offsetY);
|
|
17552
|
+
const height = this.rowContexts && this.rowContexts.length > index
|
|
17553
|
+
? this.rowContexts[index]?.rowHeight
|
|
17554
|
+
: this.approximateRowHeight;
|
|
17555
|
+
offset = !index || height >= this.bodyHeight ? 1 : (this.offsetY + height * 2) / this.bodyHeight;
|
|
17556
|
+
if (offset < 1) {
|
|
17557
|
+
offset = 1;
|
|
17558
|
+
}
|
|
17559
|
+
else {
|
|
17560
|
+
offset = Math.ceil(offset);
|
|
17561
|
+
}
|
|
17562
|
+
}
|
|
17563
|
+
if (this.currentPage !== offset) {
|
|
17564
|
+
this.currentPage = offset;
|
|
17565
|
+
this.emitUpdatePage(offset);
|
|
17566
|
+
}
|
|
17567
|
+
}
|
|
17568
|
+
init() {
|
|
17569
|
+
if (this.items?.length) {
|
|
17570
|
+
this.rowContexts = new Array(this.items.length).fill(null);
|
|
17571
|
+
this.rowContexts.forEach((row, i) => {
|
|
17572
|
+
const offsetY = i === 0 ? 0 : this.rowContexts[i - 1].offsetY + this.approximateRowHeight;
|
|
17573
|
+
this.rowContexts[i] = {
|
|
17574
|
+
offsetY,
|
|
17575
|
+
row: this.items[i],
|
|
17576
|
+
rowIndex: i,
|
|
17577
|
+
index: i,
|
|
17578
|
+
rowHeight: this.approximateRowHeight,
|
|
17579
|
+
};
|
|
17580
|
+
});
|
|
17581
|
+
this.rowHeightsUpdate = new Array(this.rowCount);
|
|
17582
|
+
}
|
|
17583
|
+
else {
|
|
17584
|
+
this.rowContexts = [];
|
|
17585
|
+
this.rowHeightsUpdate = [];
|
|
17586
|
+
}
|
|
17587
|
+
this.itemsWaitingHeight.clear();
|
|
17588
|
+
}
|
|
17589
|
+
async updateRows(force = false, afterRowsHeight = false) {
|
|
17590
|
+
const { first, last } = this.getIndexes();
|
|
17591
|
+
if (last < first) {
|
|
17592
|
+
return;
|
|
17593
|
+
}
|
|
17594
|
+
if (!force && !this.rowsChanged && this.firstVisible === first && this.lastVisible === last) {
|
|
17595
|
+
return;
|
|
17596
|
+
}
|
|
17597
|
+
this.rowsChanged = false;
|
|
17598
|
+
this.firstVisible = first;
|
|
17599
|
+
this.lastVisible = last;
|
|
17600
|
+
let rowIndex = first;
|
|
17601
|
+
let idx = 0;
|
|
17602
|
+
const temp = new Array(last - first);
|
|
17603
|
+
while (rowIndex <= last && rowIndex < this.rowCount) {
|
|
17604
|
+
const rc = this.rowContexts[rowIndex];
|
|
17605
|
+
if (rc) {
|
|
17606
|
+
temp[idx] = rc;
|
|
17607
|
+
idx++;
|
|
17608
|
+
if (!this.fixedRowHeight && !this.rowHeightsUpdate[rowIndex]) {
|
|
17609
|
+
this.itemsWaitingHeight.add(rowIndex);
|
|
17610
|
+
}
|
|
17611
|
+
}
|
|
17612
|
+
rowIndex++;
|
|
17613
|
+
if (rowIndex % 50 === 0) {
|
|
17614
|
+
await this.$nextTick();
|
|
17615
|
+
}
|
|
17616
|
+
}
|
|
17617
|
+
this.pageSize = temp.length - 1;
|
|
17618
|
+
this.visibleItems = temp;
|
|
17619
|
+
}
|
|
17620
|
+
getIndexes() {
|
|
17621
|
+
let first = -1;
|
|
17622
|
+
let last = -1;
|
|
17623
|
+
if (!this.rowContexts.length) {
|
|
17624
|
+
return { first, last };
|
|
17625
|
+
}
|
|
17626
|
+
if (this.scrollbarV) {
|
|
17627
|
+
first = this.getRowIndex(this.offsetY);
|
|
17628
|
+
first = Math.max(first - 1, 0);
|
|
17629
|
+
while (first > 0) {
|
|
17630
|
+
if (!this.rowHeightsUpdate[first - 1]) {
|
|
17631
|
+
first--;
|
|
17632
|
+
}
|
|
17633
|
+
else {
|
|
17634
|
+
break;
|
|
17635
|
+
}
|
|
17636
|
+
}
|
|
17637
|
+
for (let i = first; i < this.rowContexts.length; i++) {
|
|
17638
|
+
const rowContext = this.rowContexts[i];
|
|
17639
|
+
if (!rowContext) {
|
|
17640
|
+
throw new Error('null');
|
|
17641
|
+
}
|
|
17642
|
+
if (last === -1 && this.offsetY + this.bodyHeight <= rowContext.offsetY) {
|
|
17643
|
+
last = i;
|
|
17644
|
+
break;
|
|
17645
|
+
}
|
|
17646
|
+
}
|
|
17647
|
+
}
|
|
17648
|
+
last = last > 0 ? last : this.rowContexts.length - 1;
|
|
17649
|
+
return { first, last };
|
|
17650
|
+
}
|
|
17651
|
+
getRowIndexByAverage(offsetY) {
|
|
17652
|
+
if (offsetY === 0 || !this.visibleItems.length) {
|
|
17653
|
+
return 0;
|
|
17654
|
+
}
|
|
17655
|
+
const averageHeight = this.getAverageItemHeight();
|
|
17656
|
+
return Math.floor(offsetY / averageHeight);
|
|
17657
|
+
}
|
|
17658
|
+
getAverageItemHeight() {
|
|
17659
|
+
let h = 0;
|
|
17660
|
+
for (const rowContext of this.visibleItems) {
|
|
17661
|
+
h += rowContext.rowHeight;
|
|
17662
|
+
}
|
|
17663
|
+
return this.visibleItems.length ? h / this.visibleItems.length : 0;
|
|
17664
|
+
}
|
|
17665
|
+
getRowIndex(offsetY) {
|
|
17666
|
+
if (offsetY === 0) {
|
|
17667
|
+
return 0;
|
|
17668
|
+
}
|
|
17669
|
+
let n = Math.floor(offsetY / this.approximateRowHeight);
|
|
17670
|
+
n = n >= this.rowCount ? this.rowCount - 1 : n;
|
|
17671
|
+
let result = 0;
|
|
17672
|
+
const diff = 10;
|
|
17673
|
+
for (let i = n; i > 0; i--) {
|
|
17674
|
+
result = i;
|
|
17675
|
+
if (this.rowHeightsUpdate[i] && this.rowContexts[i].offsetY - diff <= offsetY) {
|
|
17676
|
+
return result;
|
|
17677
|
+
}
|
|
17678
|
+
}
|
|
17679
|
+
return 0;
|
|
17680
|
+
}
|
|
17681
|
+
setSelected(rowIndex) {
|
|
17682
|
+
if (rowIndex >= 0) {
|
|
17683
|
+
const rc = this.rowContexts[rowIndex];
|
|
17684
|
+
if (rc) {
|
|
17685
|
+
this.emitUpdateSelect(rc.row, rc.index);
|
|
17686
|
+
}
|
|
17687
|
+
}
|
|
17688
|
+
}
|
|
17689
|
+
sort() {
|
|
17690
|
+
if (!this.rowContexts?.length || !this.sortField || !this.entityFromItem) {
|
|
17691
|
+
return;
|
|
17692
|
+
}
|
|
17693
|
+
this.rowContexts.sort((a, b) => {
|
|
17694
|
+
try {
|
|
17695
|
+
const first = this.entityFromItem(a.row);
|
|
17696
|
+
const second = this.entityFromItem(b.row);
|
|
17697
|
+
if (first && second) {
|
|
17698
|
+
let result = 0;
|
|
17699
|
+
switch (this.sortField.type) {
|
|
17700
|
+
case 'date':
|
|
17701
|
+
if (!this.$utils.isDefined(first[this.sortField.prop]) || !this.$utils.isDefined(second[this.sortField.prop])) {
|
|
17702
|
+
result = -1;
|
|
17703
|
+
}
|
|
17704
|
+
else {
|
|
17705
|
+
result = datetime.compare(first[this.sortField.prop], second[this.sortField.prop]);
|
|
17706
|
+
}
|
|
17707
|
+
break;
|
|
17708
|
+
case 'string':
|
|
17709
|
+
if (!this.$utils.isDefined(first[this.sortField.prop]) || !this.$utils.isDefined(second[this.sortField.prop])) {
|
|
17710
|
+
result = -1;
|
|
17711
|
+
}
|
|
17712
|
+
else {
|
|
17713
|
+
result = first[this.sortField.prop].localeCompare(second[this.sortField.prop]);
|
|
17714
|
+
}
|
|
17715
|
+
break;
|
|
17716
|
+
case 'number':
|
|
17717
|
+
if (!this.$utils.isDefined(first[this.sortField.prop]) || !this.$utils.isDefined(second[this.sortField.prop])) {
|
|
17718
|
+
result = -1;
|
|
17719
|
+
}
|
|
17720
|
+
else {
|
|
17721
|
+
result = first[this.sortField.prop] < second[this.sortField.prop] ? -1 : 1;
|
|
17722
|
+
}
|
|
17723
|
+
break;
|
|
17724
|
+
}
|
|
17725
|
+
return this.sortField.direction === 'asc' ? result : result * -1;
|
|
17726
|
+
}
|
|
17727
|
+
return 0;
|
|
17728
|
+
}
|
|
17729
|
+
catch (e) {
|
|
17730
|
+
/* eslint-disable no-console */
|
|
17731
|
+
console.error(e);
|
|
17732
|
+
}
|
|
17733
|
+
});
|
|
17734
|
+
this.rowContexts.forEach((rc, i) => {
|
|
17735
|
+
rc.rowIndex = i;
|
|
17736
|
+
});
|
|
17737
|
+
this.rowContexts[0].offsetY = 0;
|
|
17738
|
+
this.updateRowOffsetsCache(0, true);
|
|
17739
|
+
}
|
|
17740
|
+
id(item) {
|
|
17741
|
+
const entity = this.entityFromItem(item);
|
|
17742
|
+
return entity ? entity[this.keyProp] : null;
|
|
17743
|
+
}
|
|
17744
|
+
removeItem() {
|
|
17745
|
+
if (!this.removedItem) {
|
|
17746
|
+
return Promise.resolve();
|
|
17747
|
+
}
|
|
17748
|
+
const rc = this.rowContexts.find(r => r.index === this.removedItem.index);
|
|
17749
|
+
if (!rc) {
|
|
17750
|
+
return;
|
|
17751
|
+
}
|
|
17752
|
+
this.removingIndex = rc.rowIndex;
|
|
17753
|
+
return new Promise(resolve => {
|
|
17754
|
+
// setTimeout позволяет анимировать удаление элемента
|
|
17755
|
+
setTimeout(() => {
|
|
17756
|
+
if (rc) {
|
|
17757
|
+
this.rowContexts.splice(rc.rowIndex, 1);
|
|
17758
|
+
}
|
|
17759
|
+
for (const rc1 of this.rowContexts) {
|
|
17760
|
+
if (rc1.rowIndex >= rc.rowIndex) {
|
|
17761
|
+
rc1.rowIndex--;
|
|
17762
|
+
}
|
|
17763
|
+
if (rc1.index > this.removedItem.index) {
|
|
17764
|
+
rc1.index--;
|
|
17765
|
+
}
|
|
17766
|
+
}
|
|
17767
|
+
const start = rc.rowIndex - 1 >= 0 ? rc.rowIndex - 1 : 0;
|
|
17768
|
+
if (start === 0 && this.rowContexts.length) {
|
|
17769
|
+
this.rowContexts[0].offsetY = 0;
|
|
17770
|
+
}
|
|
17771
|
+
this.updateRowOffsetsCache(start, true);
|
|
17772
|
+
this.updateRows(true);
|
|
17773
|
+
resolve();
|
|
17774
|
+
}, 500);
|
|
17775
|
+
});
|
|
17776
|
+
}
|
|
17777
|
+
excludeItem(item) {
|
|
17778
|
+
const index = this.rowContexts.findIndex(c => c.row === item);
|
|
17779
|
+
if (index) {
|
|
17780
|
+
const rowContext = this.rowContexts[index];
|
|
17781
|
+
this.rowContexts.splice(index, 1);
|
|
17782
|
+
return rowContext;
|
|
17783
|
+
}
|
|
17784
|
+
return null;
|
|
17785
|
+
}
|
|
17786
|
+
includeItem(rowContext) {
|
|
17787
|
+
if (!rowContext) {
|
|
17788
|
+
return;
|
|
17789
|
+
}
|
|
17790
|
+
this.rowContexts.splice(rowContext.rowIndex, 0, rowContext);
|
|
17791
|
+
}
|
|
17792
|
+
get listStyles() {
|
|
17793
|
+
return {
|
|
17794
|
+
'padding-left': this.padding + 'px',
|
|
17795
|
+
'padding-right': this.padding + 'px',
|
|
17796
|
+
};
|
|
17797
|
+
}
|
|
17798
|
+
get rowCount() {
|
|
17799
|
+
return this.rowContexts?.length ?? 0;
|
|
17800
|
+
}
|
|
17801
|
+
get approximateRowHeight() {
|
|
17802
|
+
if (this.fixedRowHeight) {
|
|
17803
|
+
return this.rowHeight + this.itemGap;
|
|
17804
|
+
}
|
|
17805
|
+
return this.minRowHeight ?? 50;
|
|
17806
|
+
}
|
|
17807
|
+
get fixedRowHeight() {
|
|
17808
|
+
return typeof this.rowHeight === 'number';
|
|
17809
|
+
}
|
|
17810
|
+
get scrollHeight() {
|
|
17811
|
+
if (!this.bodyHeight) {
|
|
17812
|
+
// вызов нужен для того, чтобы при изменении bodyHeight пересчитался scrollHeight
|
|
17813
|
+
return 0;
|
|
17814
|
+
}
|
|
17815
|
+
let result = 0;
|
|
17816
|
+
if (this.scrollbarV && this.rowCount) {
|
|
17817
|
+
if (this.fixedRowHeight && typeof this.rowHeight === 'number') {
|
|
17818
|
+
const height = this.rowHeight;
|
|
17819
|
+
result = height * this.rowCount;
|
|
17820
|
+
}
|
|
17821
|
+
else if (Array.isArray(this.rowContexts) && this.rowContexts.length) {
|
|
17822
|
+
const rowContext = this.rowContexts[this.rowCount - 1];
|
|
17823
|
+
result = rowContext?.offsetY + rowContext?.rowHeight;
|
|
17824
|
+
result = Math.max(result, this.lastRowOffsetY - this.itemGap);
|
|
17825
|
+
}
|
|
17826
|
+
}
|
|
17827
|
+
if (!result) {
|
|
17828
|
+
result = this.approximateRowHeight * this.rowCount;
|
|
17829
|
+
}
|
|
17830
|
+
return result;
|
|
17831
|
+
}
|
|
17832
|
+
get scrollerStyles() {
|
|
17833
|
+
return {
|
|
17834
|
+
height: (this.scrollHeight || this.approximateRowHeight * this.rowCount) + 'px',
|
|
17835
|
+
width: '100%',
|
|
17836
|
+
};
|
|
17837
|
+
}
|
|
17838
|
+
};
|
|
17839
|
+
DataIteratorComponent.COUNTER = 0;
|
|
17840
|
+
DataIteratorComponent.CNT = 0;
|
|
17841
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17842
|
+
(0,external_vue_property_decorator_.Prop)({ type: Array, default: () => [] }),
|
|
17843
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", typeof (ld_data_iteratorvue_type_script_lang_ts_external_a = typeof Array !== "undefined" && Array) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_a : Object)
|
|
17844
|
+
], DataIteratorComponent.prototype, "items", void 0);
|
|
17845
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17846
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17847
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17848
|
+
], DataIteratorComponent.prototype, "page", void 0);
|
|
17849
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17850
|
+
(0,external_vue_property_decorator_.Prop)({ required: true }),
|
|
17851
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", String)
|
|
17852
|
+
], DataIteratorComponent.prototype, "keyProp", void 0);
|
|
17853
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17854
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17855
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", typeof (ld_data_iteratorvue_type_script_lang_ts_external_b = typeof TSortField !== "undefined" && TSortField) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_b : Object)
|
|
17856
|
+
], DataIteratorComponent.prototype, "sortField", void 0);
|
|
17857
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17858
|
+
(0,external_vue_property_decorator_.Prop)({ type: Function, default: (item) => item }),
|
|
17859
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function)
|
|
17860
|
+
], DataIteratorComponent.prototype, "entityFromItem", void 0);
|
|
17861
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17862
|
+
(0,external_vue_property_decorator_.Prop)({ type: Array, default: () => [] }),
|
|
17863
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", typeof (ld_data_iteratorvue_type_script_lang_ts_external_c = typeof Array !== "undefined" && Array) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_c : Object)
|
|
17864
|
+
], DataIteratorComponent.prototype, "selectedIndices", void 0);
|
|
17865
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17866
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17867
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17868
|
+
], DataIteratorComponent.prototype, "firstItemSelectCounter", void 0);
|
|
17869
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17870
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17871
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17872
|
+
], DataIteratorComponent.prototype, "nextItemSelectCounter", void 0);
|
|
17873
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17874
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17875
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17876
|
+
], DataIteratorComponent.prototype, "minRowHeight", void 0);
|
|
17877
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17878
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17879
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Object)
|
|
17880
|
+
], DataIteratorComponent.prototype, "rowHeight", void 0);
|
|
17881
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17882
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17883
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", typeof (ld_data_iteratorvue_type_script_lang_ts_external_d = typeof TListItem !== "undefined" && TListItem) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_d : Object)
|
|
17884
|
+
], DataIteratorComponent.prototype, "activeItem", void 0);
|
|
17885
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17886
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17887
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Boolean)
|
|
17888
|
+
], DataIteratorComponent.prototype, "fixTopActiveItem", void 0);
|
|
17889
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17890
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17891
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17892
|
+
], DataIteratorComponent.prototype, "padding", void 0);
|
|
17893
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17894
|
+
(0,external_vue_property_decorator_.Prop)({ default: 5 }),
|
|
17895
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Number)
|
|
17896
|
+
], DataIteratorComponent.prototype, "itemGap", void 0);
|
|
17897
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17898
|
+
(0,external_vue_property_decorator_.Prop)({ default: false }),
|
|
17899
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Boolean)
|
|
17900
|
+
], DataIteratorComponent.prototype, "toLastPage", void 0);
|
|
17901
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17902
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17903
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Boolean)
|
|
17904
|
+
], DataIteratorComponent.prototype, "scrollToActiveItem", void 0);
|
|
17905
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17906
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
17907
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", typeof (ld_data_iteratorvue_type_script_lang_ts_external_e = typeof TRemovedItem !== "undefined" && TRemovedItem) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_e : Object)
|
|
17908
|
+
], DataIteratorComponent.prototype, "removedItem", void 0);
|
|
17909
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17910
|
+
Emit('loading-update'),
|
|
17911
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17912
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [Boolean]),
|
|
17913
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17914
|
+
], DataIteratorComponent.prototype, "emitUpdateLoading", null);
|
|
17915
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17916
|
+
Emit('total-pages'),
|
|
17917
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17918
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [Number]),
|
|
17919
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17920
|
+
], DataIteratorComponent.prototype, "emitUpdateTotalPages", null);
|
|
17921
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17922
|
+
Emit('page'),
|
|
17923
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17924
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [Number]),
|
|
17925
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17926
|
+
], DataIteratorComponent.prototype, "emitUpdatePage", null);
|
|
17927
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17928
|
+
Emit('select'),
|
|
17929
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17930
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [typeof (ld_data_iteratorvue_type_script_lang_ts_external_f = typeof TListItem !== "undefined" && TListItem) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_f : Object, Number]),
|
|
17931
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17932
|
+
], DataIteratorComponent.prototype, "emitUpdateSelect", null);
|
|
17933
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17934
|
+
Emit('click'),
|
|
17935
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17936
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [typeof (ld_data_iteratorvue_type_script_lang_ts_external_g = typeof TListItem !== "undefined" && TListItem) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_g : Object, Number]),
|
|
17937
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17938
|
+
], DataIteratorComponent.prototype, "emitClick", null);
|
|
17939
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17940
|
+
Emit('dblclick'),
|
|
17941
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17942
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [typeof (ld_data_iteratorvue_type_script_lang_ts_external_h = typeof TListItem !== "undefined" && TListItem) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_h : Object, Number]),
|
|
17943
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17944
|
+
], DataIteratorComponent.prototype, "emitDblclick", null);
|
|
17945
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17946
|
+
(0,external_vue_property_decorator_.Watch)('loading'),
|
|
17947
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17948
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17949
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17950
|
+
], DataIteratorComponent.prototype, "emitLoadingChanged", null);
|
|
17951
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17952
|
+
(0,external_vue_property_decorator_.Watch)('items', { deep: true }),
|
|
17953
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17954
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [typeof (ld_data_iteratorvue_type_script_lang_ts_external_j = typeof Array !== "undefined" && Array) === "function" ? ld_data_iteratorvue_type_script_lang_ts_external_j : Object, typeof (_k = typeof Array !== "undefined" && Array) === "function" ? _k : Object]),
|
|
17955
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", Promise)
|
|
17956
|
+
], DataIteratorComponent.prototype, "onItemsChanged", null);
|
|
17957
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17958
|
+
(0,external_vue_property_decorator_.Watch)('scrollHeight'),
|
|
17959
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17960
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17961
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17962
|
+
], DataIteratorComponent.prototype, "onScrollHeightChanged", null);
|
|
17963
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17964
|
+
(0,external_vue_property_decorator_.Watch)('fixTopActiveItem'),
|
|
17965
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17966
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17967
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", Promise)
|
|
17968
|
+
], DataIteratorComponent.prototype, "onFixTopActiveItemChanged", null);
|
|
17969
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17970
|
+
(0,external_vue_property_decorator_.Watch)('minRowHeight'),
|
|
17971
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17972
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17973
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17974
|
+
], DataIteratorComponent.prototype, "onMinRowHeightChanged", null);
|
|
17975
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17976
|
+
(0,external_vue_property_decorator_.Watch)('page'),
|
|
17977
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17978
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17979
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17980
|
+
], DataIteratorComponent.prototype, "onPageChanged", null);
|
|
17981
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17982
|
+
(0,external_vue_property_decorator_.Watch)('sortField'),
|
|
17983
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17984
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [typeof (_l = typeof TSortField !== "undefined" && TSortField) === "function" ? _l : Object, typeof (_m = typeof TSortField !== "undefined" && TSortField) === "function" ? _m : Object]),
|
|
17985
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17986
|
+
], DataIteratorComponent.prototype, "onSortFieldChanged", null);
|
|
17987
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17988
|
+
(0,external_vue_property_decorator_.Watch)('selectedIndices', { immediate: true }),
|
|
17989
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17990
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17991
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
17992
|
+
], DataIteratorComponent.prototype, "onSelectedIndicesChanged", null);
|
|
17993
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
17994
|
+
(0,external_vue_property_decorator_.Watch)('firstItemSelectCounter'),
|
|
17995
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
17996
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
17997
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", Promise)
|
|
17998
|
+
], DataIteratorComponent.prototype, "onFirstItemSelectCounterChanged", null);
|
|
17999
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
18000
|
+
(0,external_vue_property_decorator_.Watch)('nextItemSelectCounter'),
|
|
18001
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
18002
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
|
|
18003
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
|
|
18004
|
+
], DataIteratorComponent.prototype, "onNextItemSelectCounterChanged", null);
|
|
18005
|
+
ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
18006
|
+
(0,external_vue_property_decorator_.Watch)('innerWidth'),
|
|
18007
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:type", Function),
|
|
18008
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:paramtypes", [Number, Number]),
|
|
18009
|
+
ld_data_iteratorvue_type_script_lang_ts_external_metadata("design:returntype", Promise)
|
|
18010
|
+
], DataIteratorComponent.prototype, "onInnerWidthChanged", null);
|
|
18011
|
+
DataIteratorComponent = DataIteratorComponent_1 = ld_data_iteratorvue_type_script_lang_ts_external_decorate([
|
|
18012
|
+
(0,external_vue_property_decorator_.Options)({
|
|
18013
|
+
name: 'IteratorVirtual',
|
|
18014
|
+
components: {
|
|
18015
|
+
IteratorItem: iteratorItem
|
|
18016
|
+
},
|
|
18017
|
+
emits: ['click', 'dblclick'],
|
|
18018
|
+
})
|
|
18019
|
+
], DataIteratorComponent);
|
|
18020
|
+
/* harmony default export */ const ld_data_iteratorvue_type_script_lang_ts_external = (DataIteratorComponent);
|
|
18021
|
+
|
|
18022
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/ld-data-iterator.ts?vue&type=script&lang=ts&external
|
|
18023
|
+
|
|
18024
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/ld-data-iterator.vue
|
|
18025
|
+
|
|
18026
|
+
|
|
18027
|
+
|
|
18028
|
+
|
|
18029
|
+
;
|
|
18030
|
+
const ld_data_iterator_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_data_iteratorvue_type_script_lang_ts_external, [['render',ld_data_iteratorvue_type_template_id_7f1ec2b2_ts_true_render]])
|
|
18031
|
+
|
|
18032
|
+
/* harmony default export */ const ld_data_iterator = (ld_data_iterator_exports_);
|
|
18033
|
+
;// CONCATENATED MODULE: ./src/ld-data-iterator/index.ts
|
|
18034
|
+
|
|
18035
|
+
function ld_data_iterator_reg(vue, options) {
|
|
18036
|
+
vue.component(options.aliases['ld-data-iterator'], ld_data_iterator);
|
|
18037
|
+
}
|
|
18038
|
+
/* harmony default export */ const src_ld_data_iterator = (ld_data_iterator_reg);
|
|
18039
|
+
|
|
18040
|
+
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-pager/ld-pager.vue?vue&type=template&id=03c82e7a
|
|
18041
|
+
|
|
18042
|
+
|
|
18043
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_1 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
|
|
18044
|
+
width: "24",
|
|
18045
|
+
height: "24",
|
|
18046
|
+
viewBox: "0 0 24 24",
|
|
18047
|
+
fill: "none",
|
|
18048
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
18049
|
+
}, [
|
|
18050
|
+
/*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
|
|
18051
|
+
"fill-rule": "evenodd",
|
|
18052
|
+
"clip-rule": "evenodd",
|
|
18053
|
+
d: "M8 6C7.44771 6 7 6.44772 7 7V17C7 17.5523 7.44771 18 8 18C8.55228 18 9 17.5523 9 17V7C9 6.44772 8.55228 6 8 6ZM17.7071 16.2929C18.0976 16.6834 18.0976 17.3166 17.7071 17.7071C17.3166 18.0976 16.6834 18.0976 16.2929 17.7071L11.3431 12.7574C10.9526 12.3668 10.9526 11.7337 11.3431 11.3431L16.2929 6.3934C16.6834 6.00287 17.3166 6.00287 17.7071 6.3934C18.0976 6.78392 18.0976 7.41709 17.7071 7.80761L13.4645 12.0503L17.7071 16.2929Z",
|
|
18054
|
+
fill: "currentColor"
|
|
18055
|
+
})
|
|
18056
|
+
], -1)
|
|
18057
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_2 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
|
|
18058
|
+
width: "24",
|
|
18059
|
+
height: "24",
|
|
18060
|
+
viewBox: "0 0 24 24",
|
|
18061
|
+
fill: "none",
|
|
18062
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
18063
|
+
}, [
|
|
18064
|
+
/*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
|
|
18065
|
+
"fill-rule": "evenodd",
|
|
18066
|
+
"clip-rule": "evenodd",
|
|
18067
|
+
d: "M18.4246 13C18.9769 13 19.4246 12.5523 19.4246 12C19.4246 11.4477 18.9769 11 18.4246 11L7.83886 11L11.1317 7.70711C11.5223 7.31658 11.5223 6.68342 11.1317 6.29289C10.7412 5.90237 10.108 5.90237 9.71752 6.29289L4.76777 11.2426C4.37725 11.6332 4.37725 12.2663 4.76777 12.6569L9.71752 17.6066C10.108 17.9971 10.7412 17.9971 11.1317 17.6066C11.5223 17.2161 11.5223 16.5829 11.1317 16.1924L7.93933 13L18.4246 13Z",
|
|
18068
|
+
fill: "currentColor"
|
|
18069
|
+
})
|
|
18070
|
+
], -1)
|
|
18071
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_3 = /*#__PURE__*/(0,external_vue_.createElementVNode)("div", null, null, -1)
|
|
18072
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_4 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
|
|
18073
|
+
width: "24",
|
|
18074
|
+
height: "24",
|
|
18075
|
+
viewBox: "0 0 24 24",
|
|
18076
|
+
fill: "none",
|
|
18077
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
18078
|
+
}, [
|
|
18079
|
+
/*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
|
|
18080
|
+
"fill-rule": "evenodd",
|
|
18081
|
+
"clip-rule": "evenodd",
|
|
18082
|
+
d: "M18.4246 13C18.9769 13 19.4246 12.5523 19.4246 12C19.4246 11.4477 18.9769 11 18.4246 11L7.83886 11L11.1317 7.70711C11.5223 7.31658 11.5223 6.68342 11.1317 6.29289C10.7412 5.90237 10.108 5.90237 9.71752 6.29289L4.76777 11.2426C4.37725 11.6332 4.37725 12.2663 4.76777 12.6569L9.71752 17.6066C10.108 17.9971 10.7412 17.9971 11.1317 17.6066C11.5223 17.2161 11.5223 16.5829 11.1317 16.1924L7.93933 13L18.4246 13Z",
|
|
18083
|
+
fill: "currentColor"
|
|
18084
|
+
})
|
|
18085
|
+
], -1)
|
|
18086
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_5 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
|
|
18087
|
+
width: "24",
|
|
18088
|
+
height: "24",
|
|
18089
|
+
viewBox: "0 0 24 24",
|
|
18090
|
+
fill: "none",
|
|
18091
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
18092
|
+
}, [
|
|
18093
|
+
/*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
|
|
18094
|
+
"fill-rule": "evenodd",
|
|
18095
|
+
"clip-rule": "evenodd",
|
|
18096
|
+
d: "M8 6C7.44771 6 7 6.44772 7 7V17C7 17.5523 7.44771 18 8 18C8.55228 18 9 17.5523 9 17V7C9 6.44772 8.55228 6 8 6ZM17.7071 16.2929C18.0976 16.6834 18.0976 17.3166 17.7071 17.7071C17.3166 18.0976 16.6834 18.0976 16.2929 17.7071L11.3431 12.7574C10.9526 12.3668 10.9526 11.7337 11.3431 11.3431L16.2929 6.3934C16.6834 6.00287 17.3166 6.00287 17.7071 6.3934C18.0976 6.78392 18.0976 7.41709 17.7071 7.80761L13.4645 12.0503L17.7071 16.2929Z",
|
|
18097
|
+
fill: "currentColor"
|
|
18098
|
+
})
|
|
18099
|
+
], -1)
|
|
18100
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_6 = {
|
|
18101
|
+
key: 2,
|
|
18102
|
+
id: "pager-total-count"
|
|
18103
|
+
}
|
|
18104
|
+
const ld_pagervue_type_template_id_03c82e7a_hoisted_7 = { class: "grey--text" }
|
|
18105
|
+
|
|
18106
|
+
function ld_pagervue_type_template_id_03c82e7a_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18107
|
+
const _component_square_button = (0,external_vue_.resolveComponent)("square-button")
|
|
18108
|
+
const _component_v_spacer = (0,external_vue_.resolveComponent)("v-spacer")
|
|
18109
|
+
const _directive_active = (0,external_vue_.resolveDirective)("active")
|
|
18110
|
+
|
|
18111
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
|
|
18112
|
+
class: (0,external_vue_.normalizeClass)(["pager", { 'flex-column': _ctx.isMobileGlobal, 'pager--border-top': _ctx.bordered }])
|
|
18113
|
+
}, [
|
|
18114
|
+
(_ctx.toFirst)
|
|
18115
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
|
|
18116
|
+
key: 0,
|
|
18117
|
+
icon: "",
|
|
18118
|
+
disabled: !_ctx.canPrevious,
|
|
18119
|
+
onClick: _cache[0] || (_cache[0] = $event => (_ctx.selectPage(1)))
|
|
18120
|
+
}, {
|
|
18121
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
18122
|
+
ld_pagervue_type_template_id_03c82e7a_hoisted_1
|
|
18123
|
+
]),
|
|
18124
|
+
_: 1
|
|
18125
|
+
}, 8, ["disabled"]))
|
|
18126
|
+
: (0,external_vue_.createCommentVNode)("", true),
|
|
18127
|
+
(0,external_vue_.createTextVNode)(),
|
|
18128
|
+
(0,external_vue_.createVNode)(_component_square_button, {
|
|
18129
|
+
icon: "",
|
|
18130
|
+
disabled: !_ctx.canPrevious,
|
|
18131
|
+
class: (0,external_vue_.normalizeClass)({ 'ml-1': _ctx.toFirst }),
|
|
18132
|
+
onClick: _ctx.prevPage
|
|
18133
|
+
}, {
|
|
18134
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
18135
|
+
ld_pagervue_type_template_id_03c82e7a_hoisted_2
|
|
18136
|
+
]),
|
|
18137
|
+
_: 1
|
|
18138
|
+
}, 8, ["disabled", "class", "onClick"]),
|
|
18139
|
+
(0,external_vue_.createTextVNode)(),
|
|
18140
|
+
((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.pages, (p) => {
|
|
18141
|
+
return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, [
|
|
18142
|
+
(0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
|
|
18143
|
+
disabled: _ctx.pageDisabled(p.number),
|
|
18144
|
+
class: "ml-1",
|
|
18145
|
+
onClick: $event => (_ctx.selectPage(p.number))
|
|
18146
|
+
}, {
|
|
18147
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
18148
|
+
(0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(p.text), 1)
|
|
18149
|
+
]),
|
|
18150
|
+
_: 2
|
|
18151
|
+
}, 1032, ["disabled", "onClick"])), [
|
|
18152
|
+
[_directive_active, p.number === _ctx.page]
|
|
18153
|
+
]),
|
|
18154
|
+
(0,external_vue_.createTextVNode)(),
|
|
18155
|
+
ld_pagervue_type_template_id_03c82e7a_hoisted_3
|
|
18156
|
+
], 64))
|
|
18157
|
+
}), 256)),
|
|
18158
|
+
(0,external_vue_.createTextVNode)(),
|
|
18159
|
+
(0,external_vue_.createVNode)(_component_square_button, {
|
|
18160
|
+
icon: "",
|
|
18161
|
+
disabled: !_ctx.canNext,
|
|
18162
|
+
class: "ml-1",
|
|
18163
|
+
style: {"transform":"rotate(180deg)"},
|
|
18164
|
+
onClick: _ctx.nextPage
|
|
18165
|
+
}, {
|
|
18166
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
18167
|
+
ld_pagervue_type_template_id_03c82e7a_hoisted_4
|
|
18168
|
+
]),
|
|
18169
|
+
_: 1
|
|
18170
|
+
}, 8, ["disabled", "onClick"]),
|
|
18171
|
+
(0,external_vue_.createTextVNode)(),
|
|
18172
|
+
(_ctx.toLast)
|
|
18173
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
|
|
18174
|
+
key: 1,
|
|
18175
|
+
icon: "",
|
|
18176
|
+
disabled: !_ctx.canLast,
|
|
18177
|
+
class: "ml-1",
|
|
18178
|
+
style: {"transform":"rotate(180deg)"},
|
|
18179
|
+
onClick: _cache[1] || (_cache[1] = $event => (_ctx.selectPage(_ctx.totalPages, true)))
|
|
18180
|
+
}, {
|
|
18181
|
+
default: (0,external_vue_.withCtx)(() => [
|
|
18182
|
+
ld_pagervue_type_template_id_03c82e7a_hoisted_5
|
|
18183
|
+
]),
|
|
18184
|
+
_: 1
|
|
18185
|
+
}, 8, ["disabled"]))
|
|
18186
|
+
: (0,external_vue_.createCommentVNode)("", true),
|
|
18187
|
+
(0,external_vue_.createTextVNode)(),
|
|
18188
|
+
(0,external_vue_.createVNode)(_component_v_spacer),
|
|
18189
|
+
(0,external_vue_.createTextVNode)(),
|
|
18190
|
+
(_ctx.showOnlyTotal)
|
|
18191
|
+
? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_pagervue_type_template_id_03c82e7a_hoisted_6, [
|
|
18192
|
+
(0,external_vue_.createElementVNode)("span", ld_pagervue_type_template_id_03c82e7a_hoisted_7, (0,external_vue_.toDisplayString)(`Всего ${_ctx._entityName}`), 1)
|
|
18193
|
+
]))
|
|
18194
|
+
: (0,external_vue_.createCommentVNode)("", true)
|
|
18195
|
+
], 2))
|
|
18196
|
+
}
|
|
18197
|
+
;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.vue?vue&type=template&id=03c82e7a
|
|
18198
|
+
|
|
18199
|
+
;// CONCATENATED MODULE: ./src/utils/pluralizeNoun.ts
|
|
18200
|
+
function pluralizeNoun(num, one, two, five, printNum = true) {
|
|
18201
|
+
if (!num) {
|
|
18202
|
+
return '';
|
|
18203
|
+
}
|
|
18204
|
+
let n;
|
|
18205
|
+
if (typeof num === 'string') {
|
|
18206
|
+
n = Number(num.match(/\d+\.?\d*/g));
|
|
18207
|
+
}
|
|
18208
|
+
else {
|
|
18209
|
+
n = Math.abs(num);
|
|
18210
|
+
}
|
|
18211
|
+
n %= 100;
|
|
18212
|
+
if (n >= 5 && n <= 20) {
|
|
18213
|
+
return printNum ? `${num} ${five}` : `${five}`;
|
|
18214
|
+
}
|
|
18215
|
+
n %= 10;
|
|
18216
|
+
if (n === 1) {
|
|
18217
|
+
return printNum ? `${num} ${one}` : `${one}`;
|
|
18218
|
+
}
|
|
18219
|
+
if (n >= 2 && n <= 4) {
|
|
18220
|
+
return printNum ? `${num} ${two}` : `${two}`;
|
|
18221
|
+
}
|
|
18222
|
+
return printNum ? `${num} ${five}` : `${five}`;
|
|
18223
|
+
}
|
|
18224
|
+
|
|
18225
|
+
;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-pager/ld-pager.ts?vue&type=script&lang=js&external
|
|
18226
|
+
var ld_pagervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
18227
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18228
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18229
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18230
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18231
|
+
};
|
|
18232
|
+
var ld_pagervue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
18233
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18234
|
+
};
|
|
18235
|
+
var ld_pagervue_type_script_lang_js_external_a, ld_pagervue_type_script_lang_js_external_b;
|
|
18236
|
+
|
|
18237
|
+
|
|
18238
|
+
|
|
18239
|
+
|
|
18240
|
+
class PagerComponent extends (0,external_vue_property_decorator_.mixins)(ViewportMixin) {
|
|
18241
|
+
constructor() {
|
|
18242
|
+
super(...arguments);
|
|
18243
|
+
this.pages = [];
|
|
18244
|
+
this.page = 0;
|
|
18245
|
+
this.count = 0;
|
|
18246
|
+
this.size = 10;
|
|
18247
|
+
this.from = 1;
|
|
18248
|
+
this.to = 10;
|
|
18249
|
+
}
|
|
18250
|
+
emitChange(value) {
|
|
18251
|
+
return value;
|
|
18252
|
+
}
|
|
18253
|
+
onLastPageUnknownChanged() {
|
|
18254
|
+
this.pages = this.calcPages();
|
|
18255
|
+
}
|
|
18256
|
+
onOptionsChanged() {
|
|
18257
|
+
let calc = false;
|
|
18258
|
+
if (this.count !== this.options.total) {
|
|
18259
|
+
this.count = this.options.total;
|
|
18260
|
+
calc = true;
|
|
18261
|
+
}
|
|
18262
|
+
if (this.size !== this.options.pageSize) {
|
|
18263
|
+
this.size = this.options.pageSize ? this.options.pageSize : 10;
|
|
18264
|
+
calc = true;
|
|
18265
|
+
}
|
|
18266
|
+
if (this.page !== this.options.page) {
|
|
18267
|
+
if (this.options.page >= this.totalPages + 1) {
|
|
18268
|
+
this.page = this.totalPages;
|
|
18269
|
+
}
|
|
18270
|
+
else {
|
|
18271
|
+
this.page = this.options.page ? this.options.page : 1;
|
|
18272
|
+
calc = true;
|
|
18273
|
+
}
|
|
18274
|
+
}
|
|
18275
|
+
if (calc) {
|
|
18276
|
+
this.pages = this.calcPages();
|
|
18277
|
+
}
|
|
18278
|
+
}
|
|
18279
|
+
updateToFrom(page) {
|
|
18280
|
+
const current = this.pages.find(p => p.number === page);
|
|
18281
|
+
if (!current) {
|
|
18282
|
+
this.from = 0;
|
|
18283
|
+
this.to = 0;
|
|
18284
|
+
return;
|
|
18285
|
+
}
|
|
18286
|
+
this.from = (current.number - 1) * this.size;
|
|
18287
|
+
this.from = this.from ? this.from + 1 : 1;
|
|
18288
|
+
this.to = this.from + this.size - 1;
|
|
18289
|
+
this.to = this.to < this.count ? this.to : this.count;
|
|
18290
|
+
if (!this.to) {
|
|
18291
|
+
this.from = 0;
|
|
18292
|
+
}
|
|
18293
|
+
}
|
|
18294
|
+
prevPage() {
|
|
18295
|
+
this.selectPage(this.page - 1);
|
|
18296
|
+
}
|
|
18297
|
+
nextPage() {
|
|
18298
|
+
this.selectPage(this.page + 1);
|
|
18299
|
+
}
|
|
18300
|
+
onPageSizeChange(size) {
|
|
18301
|
+
setTimeout(() => this.emitChange({ page: this.page, size }), 100);
|
|
18302
|
+
}
|
|
18303
|
+
selectPage(page, toLast = false) {
|
|
18304
|
+
if (this.pageDisabled(page)) {
|
|
18305
|
+
return;
|
|
18306
|
+
}
|
|
18307
|
+
if (page > 0 && page <= this.totalPages && page !== this.page) {
|
|
18308
|
+
this.page = page;
|
|
18309
|
+
this.pages = this.calcPages(page);
|
|
18310
|
+
this.updateToFrom(page);
|
|
18311
|
+
this.emitChange({ page, size: this.size, toLast });
|
|
18312
|
+
}
|
|
18313
|
+
}
|
|
18314
|
+
calcPages(page) {
|
|
18315
|
+
const pages = [];
|
|
18316
|
+
let startPage = 1;
|
|
18317
|
+
const pagesCount = this.totalPages;
|
|
18318
|
+
let endPage = pagesCount;
|
|
18319
|
+
const maxSize = 5;
|
|
18320
|
+
const isMaxSized = maxSize < this.totalPages;
|
|
18321
|
+
page = page || this.page;
|
|
18322
|
+
if (isMaxSized) {
|
|
18323
|
+
startPage = page - Math.floor(maxSize / 2);
|
|
18324
|
+
endPage = page + Math.floor(maxSize / 2);
|
|
18325
|
+
if (startPage < 1) {
|
|
18326
|
+
startPage = 1;
|
|
18327
|
+
endPage = Math.min(startPage + maxSize - 1, pagesCount);
|
|
18328
|
+
}
|
|
18329
|
+
else if (endPage > pagesCount) {
|
|
18330
|
+
startPage = Math.max(pagesCount - maxSize + 1, 1);
|
|
18331
|
+
endPage = pagesCount;
|
|
18332
|
+
}
|
|
18333
|
+
}
|
|
18334
|
+
for (let num = startPage; num <= endPage; num++) {
|
|
18335
|
+
pages.push({
|
|
18336
|
+
number: num,
|
|
18337
|
+
text: num.toString(),
|
|
18338
|
+
});
|
|
18339
|
+
}
|
|
18340
|
+
if (this.lastPageUnknown) {
|
|
18341
|
+
pages.push({
|
|
18342
|
+
number: endPage + 1,
|
|
18343
|
+
text: '...',
|
|
18344
|
+
});
|
|
18345
|
+
}
|
|
18346
|
+
return pages;
|
|
18347
|
+
}
|
|
18348
|
+
pageDisabled(page) {
|
|
18349
|
+
if (Array.isArray(this.enabledPages) && this.enabledPages.length) {
|
|
18350
|
+
return !this.enabledPages[page - 1];
|
|
18351
|
+
}
|
|
18352
|
+
}
|
|
18353
|
+
get totalPages() {
|
|
18354
|
+
const count = this.size < 1 || this.size === 0 ? 1 : Math.ceil(this.count / this.size);
|
|
18355
|
+
return Math.max(count || 0, 1);
|
|
18356
|
+
}
|
|
18357
|
+
get canPrevious() {
|
|
18358
|
+
return this.page > 1;
|
|
18359
|
+
}
|
|
18360
|
+
get canNext() {
|
|
18361
|
+
return this.page < this.totalPages;
|
|
18362
|
+
}
|
|
18363
|
+
get canLast() {
|
|
18364
|
+
if (Array.isArray(this.enabledPages) && this.enabledPages.length >= this.totalPages) {
|
|
18365
|
+
return this.enabledPages[this.totalPages] && this.page < this.totalPages;
|
|
18366
|
+
}
|
|
18367
|
+
return this.page < this.totalPages;
|
|
18368
|
+
}
|
|
18369
|
+
get showFromTo() {
|
|
18370
|
+
return !this.isMobileGlobal && this.firstVisible && this.lastVisible;
|
|
18371
|
+
}
|
|
18372
|
+
get showOnlyTotal() {
|
|
18373
|
+
return !this.isMobileGlobal && this.count;
|
|
18374
|
+
}
|
|
18375
|
+
get first() {
|
|
18376
|
+
return this.firstVisible ?? this.from;
|
|
18377
|
+
}
|
|
18378
|
+
get last() {
|
|
18379
|
+
return this.lastVisible ?? this.to;
|
|
18380
|
+
}
|
|
18381
|
+
get _entityName() {
|
|
18382
|
+
if (this.entityName instanceof Function) {
|
|
18383
|
+
return this.entityName(this.contentType, this.options.total);
|
|
18384
|
+
}
|
|
18385
|
+
if (this.ldPagerOptions && this.ldPagerOptions.entityName instanceof Function) {
|
|
18386
|
+
return Function.prototype.apply.call(this.ldPagerOptions.entityName, this, [this.contentType, this.options.total]);
|
|
18387
|
+
}
|
|
18388
|
+
return pluralizeNoun(this.options.total, 'элемент', 'элемента', 'элементов', true);
|
|
18389
|
+
}
|
|
18390
|
+
}
|
|
18391
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18392
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18393
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", typeof (ld_pagervue_type_script_lang_js_external_a = typeof TOptions !== "undefined" && TOptions) === "function" ? ld_pagervue_type_script_lang_js_external_a : Object)
|
|
18394
|
+
], PagerComponent.prototype, "options", void 0);
|
|
18395
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18396
|
+
(0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
|
|
18397
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
|
|
18398
|
+
], PagerComponent.prototype, "toFirst", void 0);
|
|
18399
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18400
|
+
(0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
|
|
18401
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
|
|
18402
|
+
], PagerComponent.prototype, "toLast", void 0);
|
|
18403
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18404
|
+
(0,external_vue_property_decorator_.Prop)({ default: false }),
|
|
18405
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
|
|
18406
|
+
], PagerComponent.prototype, "lastPageUnknown", void 0);
|
|
18407
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18408
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18409
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", typeof (ld_pagervue_type_script_lang_js_external_b = typeof Array !== "undefined" && Array) === "function" ? ld_pagervue_type_script_lang_js_external_b : Object)
|
|
18410
|
+
], PagerComponent.prototype, "enabledPages", void 0);
|
|
18411
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18412
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18413
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Number)
|
|
18414
|
+
], PagerComponent.prototype, "firstVisible", void 0);
|
|
18415
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18416
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18417
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Number)
|
|
18418
|
+
], PagerComponent.prototype, "lastVisible", void 0);
|
|
18419
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18420
|
+
(0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
|
|
18421
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
|
|
18422
|
+
], PagerComponent.prototype, "bordered", void 0);
|
|
18423
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18424
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18425
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Object)
|
|
18426
|
+
], PagerComponent.prototype, "contentType", void 0);
|
|
18427
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18428
|
+
(0,external_vue_property_decorator_.Prop)(),
|
|
18429
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Function)
|
|
18430
|
+
], PagerComponent.prototype, "entityName", void 0);
|
|
18431
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18432
|
+
(0,external_vue_property_decorator_.Inject)(),
|
|
18433
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Object)
|
|
18434
|
+
], PagerComponent.prototype, "ldPagerOptions", void 0);
|
|
18435
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18436
|
+
Emit('change'),
|
|
18437
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
|
|
18438
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", [Object]),
|
|
18439
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
|
|
18440
|
+
], PagerComponent.prototype, "emitChange", null);
|
|
18441
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18442
|
+
(0,external_vue_property_decorator_.Watch)('lastPageUnknown'),
|
|
18443
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
|
|
18444
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", []),
|
|
18445
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
|
|
18446
|
+
], PagerComponent.prototype, "onLastPageUnknownChanged", null);
|
|
18447
|
+
ld_pagervue_type_script_lang_js_external_decorate([
|
|
18448
|
+
(0,external_vue_property_decorator_.Watch)('options', { immediate: true, deep: true }),
|
|
18449
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
|
|
18450
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", []),
|
|
18451
|
+
ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
|
|
18452
|
+
], PagerComponent.prototype, "onOptionsChanged", null);
|
|
18453
|
+
|
|
18454
|
+
;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.ts?vue&type=script&lang=js&external
|
|
18455
|
+
|
|
18456
|
+
;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.vue
|
|
18457
|
+
|
|
18458
|
+
|
|
18459
|
+
|
|
18460
|
+
|
|
18461
|
+
;
|
|
18462
|
+
const ld_pager_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(PagerComponent, [['render',ld_pagervue_type_template_id_03c82e7a_render]])
|
|
18463
|
+
|
|
18464
|
+
/* harmony default export */ const ld_pager = (ld_pager_exports_);
|
|
18465
|
+
;// CONCATENATED MODULE: ./src/ld-pager/index.ts
|
|
18466
|
+
|
|
18467
|
+
function ld_pager_reg(vue, options) {
|
|
18468
|
+
vue.component(options.aliases['ld-pager'], ld_pager);
|
|
18469
|
+
}
|
|
18470
|
+
/* harmony default export */ const src_ld_pager = (ld_pager_reg);
|
|
18471
|
+
|
|
18472
|
+
// EXTERNAL MODULE: external "vue-toastification"
|
|
18473
|
+
var external_vue_toastification_ = __webpack_require__(7982);
|
|
18474
|
+
var external_vue_toastification_default = /*#__PURE__*/__webpack_require__.n(external_vue_toastification_);
|
|
18475
|
+
;// CONCATENATED MODULE: ./src/utils/awaiting.ts
|
|
18476
|
+
async function awaiting(callback) {
|
|
18477
|
+
let resolveFunc = null;
|
|
18478
|
+
const counter = 0;
|
|
18479
|
+
let timer = null;
|
|
18480
|
+
const promise = new Promise(resolve => {
|
|
18481
|
+
resolveFunc = resolve;
|
|
18482
|
+
});
|
|
18483
|
+
timer = setInterval(() => {
|
|
18484
|
+
const a = callback();
|
|
18485
|
+
if (counter > 100 || Boolean(a)) {
|
|
18486
|
+
clearInterval(timer);
|
|
18487
|
+
resolveFunc(a ?? true);
|
|
18488
|
+
}
|
|
18489
|
+
}, 100);
|
|
18490
|
+
await promise;
|
|
18491
|
+
}
|
|
18492
|
+
|
|
18493
|
+
;// CONCATENATED MODULE: ./src/utils/deepValueGetter.ts
|
|
18494
|
+
/**
|
|
18495
|
+
* Returns a deep object given a string. zoo['animal.type']
|
|
18496
|
+
* @param {object} obj
|
|
18497
|
+
* @param {string} path
|
|
18498
|
+
*/
|
|
18499
|
+
function deepValueGetter(obj, path) {
|
|
18500
|
+
if (obj === null) {
|
|
18501
|
+
return '';
|
|
18502
|
+
}
|
|
18503
|
+
if (!obj || !path) {
|
|
18504
|
+
return obj;
|
|
18505
|
+
}
|
|
18506
|
+
// check if path matches a root-level field
|
|
18507
|
+
// { "a.b.c": 123 }
|
|
18508
|
+
const value = obj[path];
|
|
18509
|
+
// eslint-disable-next-line no-undefined
|
|
18510
|
+
if (value !== undefined) {
|
|
18511
|
+
return value;
|
|
18512
|
+
}
|
|
18513
|
+
let current = obj;
|
|
18514
|
+
const split = path.split('.');
|
|
18515
|
+
if (split.length) {
|
|
18516
|
+
for (const key of split) {
|
|
18517
|
+
current = current[key];
|
|
18518
|
+
// if found undefined, return empty string
|
|
18519
|
+
// eslint-disable-next-line no-undefined
|
|
18520
|
+
if (current === undefined || current === null) {
|
|
18521
|
+
return '';
|
|
18522
|
+
}
|
|
18523
|
+
}
|
|
18524
|
+
}
|
|
18525
|
+
return current;
|
|
18526
|
+
}
|
|
18527
|
+
|
|
18528
|
+
;// CONCATENATED MODULE: ./src/utils/delay.ts
|
|
18529
|
+
async function delay(timeout) {
|
|
18530
|
+
return new Promise(resolve => setTimeout(() => resolve(), timeout));
|
|
18531
|
+
}
|
|
18532
|
+
|
|
18533
|
+
;// CONCATENATED MODULE: ./src/utils/isObjectEmpty.ts
|
|
18534
|
+
function isObjectEmpty(obj) {
|
|
18535
|
+
for (const _i in obj) {
|
|
18536
|
+
return false;
|
|
18537
|
+
}
|
|
18538
|
+
return true;
|
|
18539
|
+
}
|
|
18540
|
+
|
|
18541
|
+
;// CONCATENATED MODULE: ./src/utils/urlRegexp.ts
|
|
18542
|
+
const urlRegexp =
|
|
18543
|
+
// eslint-disable-next-line optimize-regex/optimize-regex
|
|
18544
|
+
/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;
|
|
18545
|
+
|
|
18546
|
+
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
18547
|
+
|
|
18548
|
+
|
|
18549
|
+
|
|
18550
|
+
|
|
18551
|
+
|
|
18552
|
+
|
|
18553
|
+
|
|
18554
|
+
|
|
18555
|
+
|
|
18556
|
+
;// CONCATENATED MODULE: ./src/vuetify.ts
|
|
18557
|
+
const aliases = {
|
|
18558
|
+
SmallButton: 'VBtn',
|
|
18559
|
+
SquareButton: 'VBtn',
|
|
18560
|
+
SmallBadge: 'VChip',
|
|
18561
|
+
};
|
|
18562
|
+
const defaults = {
|
|
18563
|
+
global: {
|
|
18564
|
+
ripple: false,
|
|
18565
|
+
density: 'compact',
|
|
18566
|
+
},
|
|
18567
|
+
SmallButton: {
|
|
18568
|
+
variant: 'flat',
|
|
18569
|
+
color: 'primary',
|
|
18570
|
+
class: 'small-button',
|
|
18571
|
+
},
|
|
18572
|
+
SquareButton: {
|
|
18573
|
+
variant: 'text',
|
|
18574
|
+
color: 'grey',
|
|
18575
|
+
class: 'square-sm-button',
|
|
18576
|
+
},
|
|
18577
|
+
SmallBadge: {
|
|
18578
|
+
class: 'v-chip--badge',
|
|
18579
|
+
variant: 'outlined',
|
|
18580
|
+
},
|
|
18581
|
+
VToolbar: {
|
|
18582
|
+
height: 60,
|
|
18583
|
+
density: 'default',
|
|
18584
|
+
},
|
|
18585
|
+
};
|
|
18586
|
+
function getAliases(components) {
|
|
18587
|
+
const result = {};
|
|
18588
|
+
for (const key in aliases) {
|
|
18589
|
+
result[key] = components[aliases[key]];
|
|
18590
|
+
}
|
|
18591
|
+
return result;
|
|
18592
|
+
}
|
|
18593
|
+
|
|
18594
|
+
|
|
18595
|
+
;// CONCATENATED MODULE: ./src/directives/active.directive.ts
|
|
18596
|
+
const ActiveDirectiveOptions = {
|
|
18597
|
+
beforeMount(el, binding) {
|
|
18598
|
+
const className = '--active';
|
|
18599
|
+
const value = binding.value;
|
|
18600
|
+
el.classList[value ? 'add' : 'remove'](className);
|
|
18601
|
+
},
|
|
18602
|
+
updated(el, binding) {
|
|
18603
|
+
const className = '--active';
|
|
18604
|
+
const value = binding.value;
|
|
18605
|
+
el.classList[value ? 'add' : 'remove'](className);
|
|
18606
|
+
},
|
|
18607
|
+
};
|
|
18608
|
+
|
|
18609
|
+
;// CONCATENATED MODULE: ./src/mixins/validate.mixin.ts
|
|
18610
|
+
var validate_mixin_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
18611
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18612
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18613
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18614
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18615
|
+
};
|
|
18616
|
+
var validate_mixin_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
18617
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18618
|
+
};
|
|
18619
|
+
|
|
18620
|
+
|
|
18621
|
+
function validate() {
|
|
18622
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
18623
|
+
const errors = this.inputs.filter((input) => input.validate && !input.validate(true)).length;
|
|
18624
|
+
return !errors;
|
|
18625
|
+
}
|
|
18626
|
+
function register(input, section) {
|
|
18627
|
+
if (section) {
|
|
18628
|
+
this.section = section;
|
|
16777
18629
|
}
|
|
16778
18630
|
if (this.section && input.validate) {
|
|
16779
18631
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -17016,6 +18868,8 @@ const ValidateMixinOptions = mixin;
|
|
|
17016
18868
|
|
|
17017
18869
|
|
|
17018
18870
|
|
|
18871
|
+
|
|
18872
|
+
|
|
17019
18873
|
|
|
17020
18874
|
|
|
17021
18875
|
|
|
@@ -17050,19 +18904,26 @@ const ldmuiPlugin = {
|
|
|
17050
18904
|
'ld-text-markup': options.aliases?.['ld-text-markup'] ?? 'ld-text-markup',
|
|
17051
18905
|
'ld-switch': options.aliases?.['ld-switch'] ?? 'ld-switch',
|
|
17052
18906
|
'ld-dialog': options.aliases?.['ld-dialog'] ?? 'ld-dialog',
|
|
18907
|
+
'ld-data-iterator': options.aliases?.['ld-data-iterator'] ?? 'ld-data-iterator',
|
|
18908
|
+
'ld-pager': options.aliases?.['ld-pager'] ?? 'ld-pager',
|
|
17053
18909
|
};
|
|
17054
18910
|
vue.config.globalProperties.$utils = {
|
|
17055
18911
|
...src_utils_namespaceObject,
|
|
17056
18912
|
};
|
|
18913
|
+
if (options.LdPager?.entityName instanceof Function) {
|
|
18914
|
+
vue.provide('ldPagerOptions', {
|
|
18915
|
+
entityName: options.LdPager?.entityName
|
|
18916
|
+
});
|
|
18917
|
+
}
|
|
17057
18918
|
vue.config.globalProperties.$ldmui = {
|
|
17058
18919
|
options: (0,external_vue_.reactive)(options),
|
|
17059
|
-
setup: async function () {
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
}
|
|
18920
|
+
// setup: async function () {
|
|
18921
|
+
// const options = await this.$ldmui.options.callback();
|
|
18922
|
+
// this.$ldmui.options = {
|
|
18923
|
+
// ...this.$ldmui.options,
|
|
18924
|
+
// ...options
|
|
18925
|
+
// }
|
|
18926
|
+
// }
|
|
17066
18927
|
};
|
|
17067
18928
|
vue.directive('active', ActiveDirectiveOptions);
|
|
17068
18929
|
const toastedOptions = {
|
|
@@ -17101,6 +18962,8 @@ const ldmuiPlugin = {
|
|
|
17101
18962
|
src_ld_text_markup(vue, options);
|
|
17102
18963
|
src_ld_switch(vue, options);
|
|
17103
18964
|
src_ld_dialog(vue, options);
|
|
18965
|
+
src_ld_data_iterator(vue, options);
|
|
18966
|
+
src_ld_pager(vue, options);
|
|
17104
18967
|
},
|
|
17105
18968
|
};
|
|
17106
18969
|
/* harmony default export */ const src = (ldmuiPlugin);
|