@ldmjs/ui 1.0.20 → 1.0.22

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.js CHANGED
@@ -250,18 +250,27 @@ __webpack_require__.d(__webpack_exports__, {
250
250
  ModalType: () => (/* reexport */ ModalType),
251
251
  PromptDialog: () => (/* reexport */ PromptDialog),
252
252
  SelectDialog: () => (/* reexport */ SelectDialog),
253
+ Uint8ArrayToHex: () => (/* reexport */ Uint8ArrayToHex),
253
254
  ValidateMixin: () => (/* reexport */ ValidateMixin),
254
255
  ValidateMixinOptions: () => (/* reexport */ ValidateMixinOptions),
255
256
  awaiting: () => (/* reexport */ awaiting),
256
- datetime: () => (/* reexport */ datetime),
257
+ base64: () => (/* reexport */ base64),
258
+ base64ToUint8Array: () => (/* reexport */ base64ToUint8Array),
259
+ cookie: () => (/* reexport */ cookie),
257
260
  deepValueGetter: () => (/* reexport */ deepValueGetter),
258
261
  "default": () => (/* binding */ src),
259
262
  defaults: () => (/* reexport */ defaults),
260
263
  delay: () => (/* reexport */ delay),
264
+ fileToArrayBuffer: () => (/* reexport */ fileToArrayBuffer),
265
+ fileToBase64: () => (/* reexport */ fileToBase64),
261
266
  getAliases: () => (/* reexport */ getAliases),
267
+ hexToArrayBuffer: () => (/* reexport */ hexToArrayBuffer),
262
268
  isDefined: () => (/* reexport */ isDefined),
263
269
  isObjectEmpty: () => (/* reexport */ isObjectEmpty),
270
+ pluralizeNoun: () => (/* reexport */ pluralizeNoun),
271
+ strings: () => (/* reexport */ strings),
264
272
  uidGen: () => (/* reexport */ uidGen),
273
+ uint8ArrayToBase64: () => (/* reexport */ uint8ArrayToBase64),
265
274
  urlRegexp: () => (/* reexport */ urlRegexp)
266
275
  });
267
276
 
@@ -269,13 +278,22 @@ __webpack_require__.d(__webpack_exports__, {
269
278
  var src_utils_namespaceObject = {};
270
279
  __webpack_require__.r(src_utils_namespaceObject);
271
280
  __webpack_require__.d(src_utils_namespaceObject, {
281
+ Uint8ArrayToHex: () => (Uint8ArrayToHex),
272
282
  awaiting: () => (awaiting),
273
- datetime: () => (datetime),
283
+ base64: () => (base64),
284
+ base64ToUint8Array: () => (base64ToUint8Array),
285
+ cookie: () => (cookie),
274
286
  deepValueGetter: () => (deepValueGetter),
275
287
  delay: () => (delay),
288
+ fileToArrayBuffer: () => (fileToArrayBuffer),
289
+ fileToBase64: () => (fileToBase64),
290
+ hexToArrayBuffer: () => (hexToArrayBuffer),
276
291
  isDefined: () => (isDefined),
277
292
  isObjectEmpty: () => (isObjectEmpty),
293
+ pluralizeNoun: () => (pluralizeNoun),
294
+ strings: () => (strings),
278
295
  uidGen: () => (uidGen),
296
+ uint8ArrayToBase64: () => (uint8ArrayToBase64),
279
297
  urlRegexp: () => (urlRegexp)
280
298
  });
281
299
 
@@ -368,7 +386,7 @@ var ld_iconvue_type_script_lang_js_external_metadata = (undefined && undefined._
368
386
 
369
387
 
370
388
 
371
- let IconButtonComponent = class IconButtonComponent extends external_vue_class_component_.Vue {
389
+ let IconComponent = class IconComponent extends external_vue_class_component_.Vue {
372
390
  constructor() {
373
391
  super(...arguments);
374
392
  this.current = '';
@@ -412,41 +430,41 @@ let IconButtonComponent = class IconButtonComponent extends external_vue_class_c
412
430
  ld_iconvue_type_script_lang_js_external_decorate([
413
431
  (0,external_vue_property_decorator_.Prop)({ default: () => ({ icons: [] }) }),
414
432
  ld_iconvue_type_script_lang_js_external_metadata("design:type", Object)
415
- ], IconButtonComponent.prototype, "map", void 0);
433
+ ], IconComponent.prototype, "map", void 0);
416
434
  ld_iconvue_type_script_lang_js_external_decorate([
417
435
  (0,external_vue_property_decorator_.Prop)({ default: 'icons' }),
418
436
  ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
419
- ], IconButtonComponent.prototype, "path", void 0);
437
+ ], IconComponent.prototype, "path", void 0);
420
438
  ld_iconvue_type_script_lang_js_external_decorate([
421
439
  (0,external_vue_property_decorator_.Prop)(),
422
440
  ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
423
- ], IconButtonComponent.prototype, "icon", void 0);
441
+ ], IconComponent.prototype, "icon", void 0);
424
442
  ld_iconvue_type_script_lang_js_external_decorate([
425
443
  (0,external_vue_property_decorator_.Prop)(),
426
444
  ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
427
- ], IconButtonComponent.prototype, "color", void 0);
445
+ ], IconComponent.prototype, "color", void 0);
428
446
  ld_iconvue_type_script_lang_js_external_decorate([
429
447
  (0,external_vue_property_decorator_.Prop)({ default: '24' }),
430
448
  ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
431
- ], IconButtonComponent.prototype, "width", void 0);
449
+ ], IconComponent.prototype, "width", void 0);
432
450
  ld_iconvue_type_script_lang_js_external_decorate([
433
451
  (0,external_vue_property_decorator_.Prop)({ default: '24' }),
434
452
  ld_iconvue_type_script_lang_js_external_metadata("design:type", String)
435
- ], IconButtonComponent.prototype, "height", void 0);
453
+ ], IconComponent.prototype, "height", void 0);
436
454
  ld_iconvue_type_script_lang_js_external_decorate([
437
455
  (0,external_vue_property_decorator_.Watch)('icon'),
438
456
  ld_iconvue_type_script_lang_js_external_metadata("design:type", Function),
439
457
  ld_iconvue_type_script_lang_js_external_metadata("design:paramtypes", []),
440
458
  ld_iconvue_type_script_lang_js_external_metadata("design:returntype", void 0)
441
- ], IconButtonComponent.prototype, "onIconChange", null);
442
- IconButtonComponent = ld_iconvue_type_script_lang_js_external_decorate([
459
+ ], IconComponent.prototype, "onIconChange", null);
460
+ IconComponent = ld_iconvue_type_script_lang_js_external_decorate([
443
461
  (0,external_vue_class_component_.Options)({
444
462
  components: {
445
463
  'svg-icon': svg_icon,
446
464
  },
447
465
  })
448
- ], IconButtonComponent);
449
- /* harmony default export */ const ld_iconvue_type_script_lang_js_external = (IconButtonComponent);
466
+ ], IconComponent);
467
+ /* harmony default export */ const ld_iconvue_type_script_lang_js_external = (IconComponent);
450
468
 
451
469
  ;// CONCATENATED MODULE: ./src/ld-icon/ld-icon.ts?vue&type=script&lang=js&external
452
470
 
@@ -499,18 +517,6 @@ function isDefined(value) {
499
517
  return value !== null && value !== undefined && !isNaNValue;
500
518
  }
501
519
 
502
- ;// CONCATENATED MODULE: ./src/utils/zIndex.ts
503
- function getZIndex(el) {
504
- if (!el || el.nodeType !== Node.ELEMENT_NODE) {
505
- return 0;
506
- }
507
- const index = Number(window.getComputedStyle(el).getPropertyValue('z-index'));
508
- if (isNaN(index)) {
509
- return getZIndex(el.parentNode);
510
- }
511
- return index;
512
- }
513
-
514
520
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-loader/ld-loader.ts?vue&type=script&lang=ts&external
515
521
  var ld_loadervue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
516
522
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -523,7 +529,6 @@ var ld_loadervue_type_script_lang_ts_external_metadata = (undefined && undefined
523
529
  };
524
530
 
525
531
 
526
-
527
532
  class LoaderComponent extends external_vue_property_decorator_.Vue {
528
533
  created() {
529
534
  if (!this.options.size) {
@@ -541,7 +546,7 @@ class LoaderComponent extends external_vue_property_decorator_.Vue {
541
546
  }
542
547
  get styles() {
543
548
  return {
544
- 'z-index': getZIndex(this.$parent.$el) + 2,
549
+ 'z-index': this.zIndex(this.$parent.$el) + 2,
545
550
  };
546
551
  }
547
552
  get size() {
@@ -573,6 +578,16 @@ class LoaderComponent extends external_vue_property_decorator_.Vue {
573
578
  classes.push(`loader__color-${this.color}`);
574
579
  return classes;
575
580
  }
581
+ zIndex(el) {
582
+ if (!el || el.nodeType !== Node.ELEMENT_NODE) {
583
+ return 0;
584
+ }
585
+ const index = Number(window.getComputedStyle(el).getPropertyValue('z-index'));
586
+ if (isNaN(index)) {
587
+ return this.zIndex(el.parentNode);
588
+ }
589
+ return index;
590
+ }
576
591
  }
577
592
  ld_loadervue_type_script_lang_ts_external_decorate([
578
593
  (0,external_vue_property_decorator_.Prop)({ type: Object, default: { size: 'big', bg: true } }),
@@ -7366,6 +7381,85 @@ try {
7366
7381
  // EXTERNAL MODULE: external "./calendar.js"
7367
7382
  var external_calendar_js_ = __webpack_require__(4634);
7368
7383
  var external_calendar_js_default = /*#__PURE__*/__webpack_require__.n(external_calendar_js_);
7384
+ ;// CONCATENATED MODULE: ./src/utils/datetime.ts
7385
+ function dateLocalToISO(value) {
7386
+ const parsed = /^(\d\d?).(\d\d?).(\d\d\d?\d?)$/.exec(value);
7387
+ let year = '';
7388
+ let month = '';
7389
+ let day = '';
7390
+ if (parsed[1]) {
7391
+ day = parsed[1].length === 1 ? '0' + parsed[1] : parsed[1];
7392
+ }
7393
+ if (parsed[2]) {
7394
+ month = parsed[2].length === 1 ? '0' + parsed[2] : parsed[2];
7395
+ }
7396
+ if (parsed[3]) {
7397
+ year = parsed[3];
7398
+ }
7399
+ if (day && month && year) {
7400
+ return `${year}-${month}-${day}`;
7401
+ }
7402
+ return '';
7403
+ }
7404
+ /**
7405
+ * Преобразует дату к формату yyyy-MM-ddThh:mm:ss+hh:mm (например, 2020-11-24T12:47:45+03:00)
7406
+ * @param dt Date
7407
+ */
7408
+ function toServerString(dt) {
7409
+ if (!dt) {
7410
+ return null;
7411
+ }
7412
+ const tzo = -dt.getTimezoneOffset();
7413
+ const dif = tzo >= 0 ? '+' : '-';
7414
+ const pad = function (num) {
7415
+ const norm = Math.abs(Math.floor(num));
7416
+ return (norm < 10 ? '0' : '') + norm;
7417
+ };
7418
+ 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)}`;
7419
+ }
7420
+ function convert(d) {
7421
+ // Converts the date in d to a date-object. The input can be:
7422
+ // a date object : returned without modification
7423
+ // an array : Interpreted as [year,month,day]. NOTE: month is 0-11.
7424
+ // a number : Interpreted as number of milliseconds
7425
+ // since 1 Jan 1970 (a timestamp)
7426
+ // a string : Any format supported by the javascript engine, like
7427
+ // "YYYY/MM/DD", "MM/DD/YYYY", "Jan 31 2009" etc.
7428
+ // an object : Interpreted as an object with year, month and date
7429
+ // attributes. **NOTE** month is 0-11.
7430
+ if (d instanceof Date) {
7431
+ return d;
7432
+ }
7433
+ if (Array.isArray(d)) {
7434
+ return new Date(d[0], d[1], d[2]);
7435
+ }
7436
+ if (typeof d === 'number' || typeof d === 'string') {
7437
+ return new Date(d);
7438
+ }
7439
+ if (typeof d === 'object' && 'year' in d && 'month' in d && 'date' in d) {
7440
+ return new Date(d.year, d.month, d.date, d.hours, d.minutes, d.seconds, d.ms);
7441
+ }
7442
+ return d;
7443
+ }
7444
+ function compare(a, b) {
7445
+ // Compare two dates (could be of any type supported by the convert
7446
+ // function above) and returns:
7447
+ // -1 : if a < b
7448
+ // 0 : if a = b
7449
+ // 1 : if a > b
7450
+ // NaN : if a or b is an illegal date
7451
+ // NOTE: The code inside isFinite does an assignment (=).
7452
+ const a1 = a ? convert(a).valueOf() : 0;
7453
+ const b1 = b ? convert(b).valueOf() : 0;
7454
+ return isFinite(a1) && isFinite(b1) ? Number(a1 > b1) - Number(a1 < b1) : NaN;
7455
+ }
7456
+ const datetime = {
7457
+ dateLocalToISO,
7458
+ toServerString,
7459
+ compare
7460
+ };
7461
+
7462
+
7369
7463
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-datepicker/ld-datepicker.ts?vue&type=script&lang=js&external
7370
7464
  var ld_datepickervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
7371
7465
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -7386,6 +7480,7 @@ var ld_datepickervue_type_script_lang_js_external_a, ld_datepickervue_type_scrip
7386
7480
 
7387
7481
 
7388
7482
 
7483
+
7389
7484
  /**
7390
7485
  * @displayName ld-datepicker
7391
7486
  */
@@ -7429,7 +7524,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
7429
7524
  }
7430
7525
  else {
7431
7526
  this.date = new Date(newVal);
7432
- this.dateString = this.$utils.datetime.dateLocalToISO(this.date.toLocaleDateString(this.locale));
7527
+ this.dateString = datetime.dateLocalToISO(this.date.toLocaleDateString(this.locale));
7433
7528
  }
7434
7529
  if (this.date) {
7435
7530
  const inputEl = this.$refs.inputDate;
@@ -7663,7 +7758,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
7663
7758
  if (this.timeString) {
7664
7759
  d = this.addTimeToDate(d);
7665
7760
  }
7666
- const dt = this.$utils.datetime.dateLocalToISO(d.toLocaleDateString(this.locale));
7761
+ const dt = datetime.dateLocalToISO(d.toLocaleDateString(this.locale));
7667
7762
  this.onSelectDate(dt);
7668
7763
  }
7669
7764
  }
@@ -7740,7 +7835,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
7740
7835
  * dateString сбросим к текущей дате, чтобы календарь переключился на нее
7741
7836
  * date ставим null, чтобы обнулить модель
7742
7837
  */
7743
- this.dateString = this.$utils.datetime.dateLocalToISO(new Date().toLocaleDateString(this.locale));
7838
+ this.dateString = datetime.dateLocalToISO(new Date().toLocaleDateString(this.locale));
7744
7839
  this.date = null;
7745
7840
  this.emitUpdateModelValue(null);
7746
7841
  this.validate();
@@ -7841,7 +7936,7 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
7841
7936
  this.emitUpdateModelValue(value);
7842
7937
  }
7843
7938
  else {
7844
- this.emitUpdateModelValue(this.$utils.datetime.toServerString(value));
7939
+ this.emitUpdateModelValue(datetime.toServerString(value));
7845
7940
  }
7846
7941
  }
7847
7942
  }
@@ -9947,9 +10042,9 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
9947
10042
 
9948
10043
 
9949
10044
  /** Built-in value references. */
9950
- var Uint8Array = _root.Uint8Array;
10045
+ var _Uint8Array_Uint8Array = _root.Uint8Array;
9951
10046
 
9952
- /* harmony default export */ const _Uint8Array = (Uint8Array);
10047
+ /* harmony default export */ const _Uint8Array = (_Uint8Array_Uint8Array);
9953
10048
 
9954
10049
  ;// CONCATENATED MODULE: ./node_modules/lodash-es/_mapToArray.js
9955
10050
  /**
@@ -11575,11 +11670,14 @@ function ld_select_list_box_reg(vue, options) {
11575
11670
  }
11576
11671
  /* harmony default export */ const src_ld_select_list_box = (ld_select_list_box_reg);
11577
11672
 
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=3c187dcd&ts=true
11673
+ ;// 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
11674
 
11580
- const ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_1 = { class: "d-flex align-center" };
11581
- const ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_2 = ["checked", "data-testid", "tabindex", "disabled"];
11582
- const ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_3 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("i", { class: "v-icon" }, [
11675
+ const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_1 = {
11676
+ class: "d-flex align-center",
11677
+ style: { "position": "relative" }
11678
+ };
11679
+ const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_2 = ["checked", "data-testid", "tabindex", "disabled"];
11680
+ const ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_3 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("i", { class: "v-icon" }, [
11583
11681
  /*#__PURE__*/ (0,external_vue_.createElementVNode)("svg", {
11584
11682
  width: "14",
11585
11683
  height: "15",
@@ -11596,7 +11694,7 @@ const ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_3 = /*#__PURE__*/
11596
11694
  })
11597
11695
  ])
11598
11696
  ], -1);
11599
- function ld_checkboxvue_type_template_id_3c187dcd_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
11697
+ function ld_checkboxvue_type_template_id_068cc5f6_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
11600
11698
  const _component_v_tooltip = (0,external_vue_.resolveComponent)("v-tooltip");
11601
11699
  return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
11602
11700
  class: (0,external_vue_.normalizeClass)(["ld-checkbox", { 'ld-checkbox--focused': _ctx.isFocused }])
@@ -11631,7 +11729,7 @@ function ld_checkboxvue_type_template_id_3c187dcd_ts_true_render(_ctx, _cache, $
11631
11729
  ]))
11632
11730
  : (0,external_vue_.createCommentVNode)("", true),
11633
11731
  (0,external_vue_.createTextVNode)(),
11634
- (0,external_vue_.createElementVNode)("label", ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_1, [
11732
+ (0,external_vue_.createElementVNode)("label", ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_1, [
11635
11733
  (0,external_vue_.createElementVNode)("input", {
11636
11734
  ref: "checkbox",
11637
11735
  type: "checkbox",
@@ -11648,9 +11746,9 @@ function ld_checkboxvue_type_template_id_3c187dcd_ts_true_render(_ctx, _cache, $
11648
11746
  onInput: _cache[3] || (_cache[3] =
11649
11747
  //@ts-ignore
11650
11748
  (...args) => (_ctx.onChange && _ctx.onChange(...args)))
11651
- }, null, 40, ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_2),
11749
+ }, null, 40, ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_2),
11652
11750
  (0,external_vue_.createTextVNode)(),
11653
- ld_checkboxvue_type_template_id_3c187dcd_ts_true_hoisted_3
11751
+ ld_checkboxvue_type_template_id_068cc5f6_ts_true_hoisted_3
11654
11752
  ]),
11655
11753
  (0,external_vue_.createTextVNode)(),
11656
11754
  (_ctx.label && !_ctx.labelOnLeft)
@@ -11686,7 +11784,7 @@ function ld_checkboxvue_type_template_id_3c187dcd_ts_true_render(_ctx, _cache, $
11686
11784
  ], 2));
11687
11785
  }
11688
11786
 
11689
- ;// CONCATENATED MODULE: ./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=3c187dcd&ts=true
11787
+ ;// CONCATENATED MODULE: ./src/ld-checkbox/ld-checkbox.vue?vue&type=template&id=068cc5f6&ts=true
11690
11788
 
11691
11789
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-checkbox/ld-checkbox.ts?vue&type=script&lang=ts&external
11692
11790
  var ld_checkboxvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -11859,7 +11957,7 @@ ld_checkboxvue_type_script_lang_ts_external_decorate([
11859
11957
  ;
11860
11958
 
11861
11959
 
11862
- const ld_checkbox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(CheckboxComponent, [['render',ld_checkboxvue_type_template_id_3c187dcd_ts_true_render]])
11960
+ const ld_checkbox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(CheckboxComponent, [['render',ld_checkboxvue_type_template_id_068cc5f6_ts_true_render]])
11863
11961
 
11864
11962
  /* harmony default export */ const ld_checkbox = (ld_checkbox_exports_);
11865
11963
  ;// CONCATENATED MODULE: ./src/ld-checkbox/index.ts
@@ -15279,83 +15377,225 @@ async function awaiting(callback) {
15279
15377
  await promise;
15280
15378
  }
15281
15379
 
15282
- ;// CONCATENATED MODULE: ./src/utils/datetime.ts
15283
- function dateLocalToISO(value) {
15284
- const parsed = /^(\d\d?).(\d\d?).(\d\d\d?\d?)$/.exec(value);
15285
- let year = '';
15286
- let month = '';
15287
- let day = '';
15288
- if (parsed[1]) {
15289
- day = parsed[1].length === 1 ? '0' + parsed[1] : parsed[1];
15290
- }
15291
- if (parsed[2]) {
15292
- month = parsed[2].length === 1 ? '0' + parsed[2] : parsed[2];
15380
+ ;// CONCATENATED MODULE: ./src/utils/base64.ts
15381
+ /* eslint-disable no-bitwise */
15382
+ class Base64Util {
15383
+ constructor() {
15384
+ this._keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
15385
+ }
15386
+ encode(input) {
15387
+ let output = '';
15388
+ let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
15389
+ let i = 0;
15390
+ input = Base64Util._utf8_encode(input);
15391
+ while (i < input.length) {
15392
+ chr1 = input.charCodeAt(i++);
15393
+ chr2 = input.charCodeAt(i++);
15394
+ chr3 = input.charCodeAt(i++);
15395
+ enc1 = chr1 >> 2;
15396
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
15397
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
15398
+ enc4 = chr3 & 63;
15399
+ if (isNaN(chr2)) {
15400
+ enc3 = enc4 = 64;
15401
+ }
15402
+ else if (isNaN(chr3)) {
15403
+ enc4 = 64;
15404
+ }
15405
+ output =
15406
+ output +
15407
+ this._keyStr.charAt(enc1) +
15408
+ this._keyStr.charAt(enc2) +
15409
+ this._keyStr.charAt(enc3) +
15410
+ this._keyStr.charAt(enc4);
15411
+ }
15412
+ return output;
15413
+ }
15414
+ decode(input) {
15415
+ let output = '';
15416
+ let chr1, chr2, chr3;
15417
+ let enc1, enc2, enc3, enc4;
15418
+ let i = 0;
15419
+ input = input.replace(/[^\d+/=A-Za-z]/g, '');
15420
+ while (i < input.length) {
15421
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
15422
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
15423
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
15424
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
15425
+ chr1 = (enc1 << 2) | (enc2 >> 4);
15426
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
15427
+ chr3 = ((enc3 & 3) << 6) | enc4;
15428
+ output = output + String.fromCharCode(chr1);
15429
+ if (enc3 !== 64) {
15430
+ output = output + String.fromCharCode(chr2);
15431
+ }
15432
+ if (enc4 !== 64) {
15433
+ output = output + String.fromCharCode(chr3);
15434
+ }
15435
+ }
15436
+ output = Base64Util._utf8_decode(output);
15437
+ return output;
15293
15438
  }
15294
- if (parsed[3]) {
15295
- year = parsed[3];
15439
+ static _utf8_encode(str) {
15440
+ str = str.replace(/\r\n/g, '\n');
15441
+ let utftext = '';
15442
+ for (let n = 0; n < str.length; n++) {
15443
+ const c = str.charCodeAt(n);
15444
+ if (c < 128) {
15445
+ utftext += String.fromCharCode(c);
15446
+ }
15447
+ else if (c > 127 && c < 2048) {
15448
+ utftext += String.fromCharCode((c >> 6) | 192);
15449
+ utftext += String.fromCharCode((c & 63) | 128);
15450
+ }
15451
+ else {
15452
+ utftext += String.fromCharCode((c >> 12) | 224);
15453
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
15454
+ utftext += String.fromCharCode((c & 63) | 128);
15455
+ }
15456
+ }
15457
+ return utftext;
15458
+ }
15459
+ static _utf8_decode(utftext) {
15460
+ let string = '';
15461
+ let i = 0;
15462
+ let c = 0;
15463
+ let c2 = 0;
15464
+ let c3 = 0;
15465
+ while (i < utftext.length) {
15466
+ c = utftext.charCodeAt(i);
15467
+ if (c < 128) {
15468
+ string += String.fromCharCode(c);
15469
+ i++;
15470
+ }
15471
+ else if (c > 191 && c < 224) {
15472
+ c2 = utftext.charCodeAt(i + 1);
15473
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
15474
+ i += 2;
15475
+ }
15476
+ else {
15477
+ c2 = utftext.charCodeAt(i + 1);
15478
+ c3 = utftext.charCodeAt(i + 2);
15479
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
15480
+ i += 3;
15481
+ }
15482
+ }
15483
+ return string;
15296
15484
  }
15297
- if (day && month && year) {
15298
- return `${year}-${month}-${day}`;
15485
+ isValid(value) {
15486
+ // eslint-disable-next-line optimize-regex/optimize-regex
15487
+ const base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/gim;
15488
+ return base64Regex.test(value);
15299
15489
  }
15300
- return '';
15301
15490
  }
15302
- /**
15303
- * Преобразует дату к формату yyyy-MM-ddThh:mm:ss+hh:mm (например, 2020-11-24T12:47:45+03:00)
15304
- * @param dt Date
15305
- */
15306
- function toServerString(dt) {
15307
- if (!dt) {
15491
+ const base64 = new Base64Util();
15492
+
15493
+
15494
+ ;// CONCATENATED MODULE: ./src/utils/cookie.ts
15495
+ class Cookie {
15496
+ get(key) {
15497
+ const _key = key.replace(/([$()*+./?[\\\]^{|}])/g, '\\$1');
15498
+ const matches = document.cookie.match(new RegExp('(?:^|; )' + _key + '=([^;]*)'));
15499
+ if (matches && matches[1] && matches[1].length) {
15500
+ return matches[1];
15501
+ }
15308
15502
  return null;
15309
15503
  }
15310
- const tzo = -dt.getTimezoneOffset();
15311
- const dif = tzo >= 0 ? '+' : '-';
15312
- const pad = function (num) {
15313
- const norm = Math.abs(Math.floor(num));
15314
- return (norm < 10 ? '0' : '') + norm;
15315
- };
15316
- 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)}`;
15504
+ set(key, value, expires) {
15505
+ let time = 0;
15506
+ switch (expires) {
15507
+ case 'day':
15508
+ time = 1000 * 60 * 60 * 24;
15509
+ break;
15510
+ case 'month':
15511
+ time = 1000 * 60 * 60 * 24 * 30;
15512
+ break;
15513
+ }
15514
+ let exp = '';
15515
+ if (time) {
15516
+ time = Date.now() + time;
15517
+ exp = new Date(time).toUTCString();
15518
+ }
15519
+ document.cookie = key + '=' + value + '; path=/; expires=' + exp;
15520
+ }
15521
+ delete(key) {
15522
+ document.cookie = key + '=; path=/; expires=-1';
15523
+ }
15317
15524
  }
15318
- function convert(d) {
15319
- // Converts the date in d to a date-object. The input can be:
15320
- // a date object : returned without modification
15321
- // an array : Interpreted as [year,month,day]. NOTE: month is 0-11.
15322
- // a number : Interpreted as number of milliseconds
15323
- // since 1 Jan 1970 (a timestamp)
15324
- // a string : Any format supported by the javascript engine, like
15325
- // "YYYY/MM/DD", "MM/DD/YYYY", "Jan 31 2009" etc.
15326
- // an object : Interpreted as an object with year, month and date
15327
- // attributes. **NOTE** month is 0-11.
15328
- if (d instanceof Date) {
15329
- return d;
15525
+ const cookie = new Cookie();
15526
+
15527
+
15528
+ ;// CONCATENATED MODULE: ./src/utils/converting.ts
15529
+ function fileToArrayBuffer(src) {
15530
+ return new Promise(resolve => {
15531
+ const reader = new FileReader();
15532
+ reader.onloadend = function () {
15533
+ resolve(reader.result);
15534
+ };
15535
+ reader.readAsArrayBuffer(src);
15536
+ });
15537
+ }
15538
+ function fileToBase64(file) {
15539
+ return new Promise((resolve, reject) => {
15540
+ const reader = new FileReader();
15541
+ reader.readAsDataURL(file);
15542
+ reader.onload = () => {
15543
+ let fileStr = reader.result.toString();
15544
+ if (fileStr.includes(',')) {
15545
+ fileStr = fileStr.split(',')[1];
15546
+ }
15547
+ resolve(fileStr);
15548
+ };
15549
+ reader.onerror = error => reject(error);
15550
+ });
15551
+ }
15552
+ function base64ToUint8Array(base64) {
15553
+ if (!base64.trim()) {
15554
+ return null;
15330
15555
  }
15331
- if (Array.isArray(d)) {
15332
- return new Date(d[0], d[1], d[2]);
15556
+ const decrypted = window.atob(base64);
15557
+ let n = decrypted.length;
15558
+ const arr = new Uint8Array(n);
15559
+ while (n--) {
15560
+ arr[n] = decrypted.charCodeAt(n);
15333
15561
  }
15334
- if (typeof d === 'number' || typeof d === 'string') {
15335
- return new Date(d);
15562
+ return arr;
15563
+ }
15564
+ function Uint8ArrayToHex(bytes) {
15565
+ const hex = [];
15566
+ /* eslint-disable-next-line @typescript-eslint/prefer-for-of */
15567
+ for (let i = 0; i < bytes.length; i++) {
15568
+ const current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];
15569
+ /* eslint-disable-next-line no-bitwise */
15570
+ hex.push((current >>> 4).toString(16));
15571
+ /* eslint-disable-next-line no-bitwise */
15572
+ hex.push((current & 0xf).toString(16));
15573
+ }
15574
+ return hex.join('');
15575
+ }
15576
+ function hexToArrayBuffer(hex) {
15577
+ hex = hex.replace(/^0x/, '');
15578
+ if (hex.length % 2 != 0) {
15579
+ // console.log('WARNING: expecting an even number of characters in the hexString');
15336
15580
  }
15337
- if (typeof d === 'object' && 'year' in d && 'month' in d && 'date' in d) {
15338
- return new Date(d.year, d.month, d.date, d.hours, d.minutes, d.seconds, d.ms);
15581
+ const bad = hex.match(/[\sg-z]/i);
15582
+ if (bad) {
15583
+ // console.log('WARNING: found non-hex characters', bad);
15339
15584
  }
15340
- return d;
15585
+ const pairs = hex.match(/[\da-f]{2}/gi);
15586
+ const result = [];
15587
+ for (const s of pairs) {
15588
+ result.push(parseInt(s, 16));
15589
+ }
15590
+ return result;
15341
15591
  }
15342
- function compare(a, b) {
15343
- // Compare two dates (could be of any type supported by the convert
15344
- // function above) and returns:
15345
- // -1 : if a < b
15346
- // 0 : if a = b
15347
- // 1 : if a > b
15348
- // NaN : if a or b is an illegal date
15349
- // NOTE: The code inside isFinite does an assignment (=).
15350
- const a1 = a ? convert(a).valueOf() : 0;
15351
- const b1 = b ? convert(b).valueOf() : 0;
15352
- return isFinite(a1) && isFinite(b1) ? Number(a1 > b1) - Number(a1 < b1) : NaN;
15592
+ function uint8ArrayToBase64(value) {
15593
+ const bin = value.reduce((acc, i) => (acc += String.fromCharCode.apply(null, [i])), '');
15594
+ return window.btoa(bin);
15595
+ }
15596
+ function arrayBufferToUint8Array(value) {
15597
+ return new Uint8Array(value);
15353
15598
  }
15354
- const datetime = {
15355
- dateLocalToISO,
15356
- toServerString,
15357
- compare
15358
- };
15359
15599
 
15360
15600
 
15361
15601
  ;// CONCATENATED MODULE: ./src/utils/deepValueGetter.ts
@@ -15371,8 +15611,6 @@ function deepValueGetter(obj, path) {
15371
15611
  if (!obj || !path) {
15372
15612
  return obj;
15373
15613
  }
15374
- // check if path matches a root-level field
15375
- // { "a.b.c": 123 }
15376
15614
  const value = obj[path];
15377
15615
  // eslint-disable-next-line no-undefined
15378
15616
  if (value !== undefined) {
@@ -15406,6 +15644,60 @@ function isObjectEmpty(obj) {
15406
15644
  return true;
15407
15645
  }
15408
15646
 
15647
+ ;// CONCATENATED MODULE: ./src/utils/pluralizeNoun.ts
15648
+ function pluralizeNoun(num, one, two, five, printNum = true) {
15649
+ if (!num) {
15650
+ return '';
15651
+ }
15652
+ let n;
15653
+ if (typeof num === 'string') {
15654
+ n = Number(num.match(/\d+\.?\d*/g));
15655
+ }
15656
+ else {
15657
+ n = Math.abs(num);
15658
+ }
15659
+ n %= 100;
15660
+ if (n >= 5 && n <= 20) {
15661
+ return printNum ? `${num} ${five}` : `${five}`;
15662
+ }
15663
+ n %= 10;
15664
+ if (n === 1) {
15665
+ return printNum ? `${num} ${one}` : `${one}`;
15666
+ }
15667
+ if (n >= 2 && n <= 4) {
15668
+ return printNum ? `${num} ${two}` : `${two}`;
15669
+ }
15670
+ return printNum ? `${num} ${five}` : `${five}`;
15671
+ }
15672
+
15673
+ ;// CONCATENATED MODULE: ./src/utils/strings.ts
15674
+ class Strings {
15675
+ camelCase(str) {
15676
+ // Replace special characters with a space
15677
+ str = str.replace(/[^\d A-Za-z]/g, ' ');
15678
+ // put a space before an uppercase letter
15679
+ str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
15680
+ // Lower case first character and some other stuff
15681
+ str = str
15682
+ .replace(/([^\d A-Za-z])|^\d+/g, '')
15683
+ .trim()
15684
+ .toLowerCase();
15685
+ // uppercase characters preceded by a space or number
15686
+ str = str.replace(/([\d ]+)([A-Za-z])/g, (a, b, c) => b.trim() + c.toUpperCase());
15687
+ return str;
15688
+ }
15689
+ capitalize(str) {
15690
+ if (!str) {
15691
+ return str;
15692
+ }
15693
+ const first = str[0];
15694
+ const other = str.substring(1);
15695
+ return `${first.toUpperCase()}${other}`;
15696
+ }
15697
+ }
15698
+ const strings = new Strings();
15699
+
15700
+
15409
15701
  ;// CONCATENATED MODULE: ./src/utils/urlRegexp.ts
15410
15702
  const urlRegexp =
15411
15703
  // eslint-disable-next-line optimize-regex/optimize-regex
@@ -15420,6 +15712,10 @@ const urlRegexp =
15420
15712
 
15421
15713
 
15422
15714
 
15715
+
15716
+
15717
+
15718
+
15423
15719
 
15424
15720
  ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.manager.ts
15425
15721
 
@@ -16916,26 +17212,6 @@ IteratorItemComponent = IteratorItemComponent_1 = iteratorItem_decorate([
16916
17212
  ], IteratorItemComponent);
16917
17213
  /* harmony default export */ const iteratorItem = (IteratorItemComponent);
16918
17214
 
16919
- ;// CONCATENATED MODULE: ./src/utils/strings.ts
16920
- function camelCase(str) {
16921
- // Replace special characters with a space
16922
- str = str.replace(/[^\d A-Za-z]/g, ' ');
16923
- // put a space before an uppercase letter
16924
- str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
16925
- // Lower case first character and some other stuff
16926
- str = str
16927
- .replace(/([^\d A-Za-z])|^\d+/g, '')
16928
- .trim()
16929
- .toLowerCase();
16930
- // uppercase characters preceded by a space or number
16931
- str = str.replace(/([\d ]+)([A-Za-z])/g, (a, b, c) => b.trim() + c.toUpperCase());
16932
- return str;
16933
- }
16934
- const strings = {
16935
- camelCase
16936
- };
16937
-
16938
-
16939
17215
  ;// CONCATENATED MODULE: ./src/ld-data-iterator/prefixes.ts
16940
17216
  /* eslint-disable no-undefined */
16941
17217
 
@@ -18114,6 +18390,412 @@ function ld_data_iterator_reg(vue, options) {
18114
18390
  }
18115
18391
  /* harmony default export */ const src_ld_data_iterator = (ld_data_iterator_reg);
18116
18392
 
18393
+ ;// 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
18394
+
18395
+
18396
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_1 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
18397
+ width: "24",
18398
+ height: "24",
18399
+ viewBox: "0 0 24 24",
18400
+ fill: "none",
18401
+ xmlns: "http://www.w3.org/2000/svg"
18402
+ }, [
18403
+ /*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
18404
+ "fill-rule": "evenodd",
18405
+ "clip-rule": "evenodd",
18406
+ 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",
18407
+ fill: "currentColor"
18408
+ })
18409
+ ], -1)
18410
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_2 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
18411
+ width: "24",
18412
+ height: "24",
18413
+ viewBox: "0 0 24 24",
18414
+ fill: "none",
18415
+ xmlns: "http://www.w3.org/2000/svg"
18416
+ }, [
18417
+ /*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
18418
+ "fill-rule": "evenodd",
18419
+ "clip-rule": "evenodd",
18420
+ 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",
18421
+ fill: "currentColor"
18422
+ })
18423
+ ], -1)
18424
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_3 = /*#__PURE__*/(0,external_vue_.createElementVNode)("div", null, null, -1)
18425
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_4 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
18426
+ width: "24",
18427
+ height: "24",
18428
+ viewBox: "0 0 24 24",
18429
+ fill: "none",
18430
+ xmlns: "http://www.w3.org/2000/svg"
18431
+ }, [
18432
+ /*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
18433
+ "fill-rule": "evenodd",
18434
+ "clip-rule": "evenodd",
18435
+ 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",
18436
+ fill: "currentColor"
18437
+ })
18438
+ ], -1)
18439
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_5 = /*#__PURE__*/(0,external_vue_.createElementVNode)("svg", {
18440
+ width: "24",
18441
+ height: "24",
18442
+ viewBox: "0 0 24 24",
18443
+ fill: "none",
18444
+ xmlns: "http://www.w3.org/2000/svg"
18445
+ }, [
18446
+ /*#__PURE__*/(0,external_vue_.createElementVNode)("path", {
18447
+ "fill-rule": "evenodd",
18448
+ "clip-rule": "evenodd",
18449
+ 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",
18450
+ fill: "currentColor"
18451
+ })
18452
+ ], -1)
18453
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_6 = {
18454
+ key: 2,
18455
+ id: "pager-total-count"
18456
+ }
18457
+ const ld_pagervue_type_template_id_03c82e7a_hoisted_7 = { class: "grey--text" }
18458
+
18459
+ function ld_pagervue_type_template_id_03c82e7a_render(_ctx, _cache, $props, $setup, $data, $options) {
18460
+ const _component_square_button = (0,external_vue_.resolveComponent)("square-button")
18461
+ const _component_v_spacer = (0,external_vue_.resolveComponent)("v-spacer")
18462
+ const _directive_active = (0,external_vue_.resolveDirective)("active")
18463
+
18464
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
18465
+ class: (0,external_vue_.normalizeClass)(["pager", { 'flex-column': _ctx.isMobileGlobal, 'pager--border-top': _ctx.bordered }])
18466
+ }, [
18467
+ (_ctx.toFirst)
18468
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
18469
+ key: 0,
18470
+ icon: "",
18471
+ disabled: !_ctx.canPrevious,
18472
+ onClick: _cache[0] || (_cache[0] = $event => (_ctx.selectPage(1)))
18473
+ }, {
18474
+ default: (0,external_vue_.withCtx)(() => [
18475
+ ld_pagervue_type_template_id_03c82e7a_hoisted_1
18476
+ ]),
18477
+ _: 1
18478
+ }, 8, ["disabled"]))
18479
+ : (0,external_vue_.createCommentVNode)("", true),
18480
+ (0,external_vue_.createTextVNode)(),
18481
+ (0,external_vue_.createVNode)(_component_square_button, {
18482
+ icon: "",
18483
+ disabled: !_ctx.canPrevious,
18484
+ class: (0,external_vue_.normalizeClass)({ 'ml-1': _ctx.toFirst }),
18485
+ onClick: _ctx.prevPage
18486
+ }, {
18487
+ default: (0,external_vue_.withCtx)(() => [
18488
+ ld_pagervue_type_template_id_03c82e7a_hoisted_2
18489
+ ]),
18490
+ _: 1
18491
+ }, 8, ["disabled", "class", "onClick"]),
18492
+ (0,external_vue_.createTextVNode)(),
18493
+ ((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.pages, (p) => {
18494
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, [
18495
+ (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
18496
+ disabled: _ctx.pageDisabled(p.number),
18497
+ class: "ml-1",
18498
+ onClick: $event => (_ctx.selectPage(p.number))
18499
+ }, {
18500
+ default: (0,external_vue_.withCtx)(() => [
18501
+ (0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(p.text), 1)
18502
+ ]),
18503
+ _: 2
18504
+ }, 1032, ["disabled", "onClick"])), [
18505
+ [_directive_active, p.number === _ctx.page]
18506
+ ]),
18507
+ (0,external_vue_.createTextVNode)(),
18508
+ ld_pagervue_type_template_id_03c82e7a_hoisted_3
18509
+ ], 64))
18510
+ }), 256)),
18511
+ (0,external_vue_.createTextVNode)(),
18512
+ (0,external_vue_.createVNode)(_component_square_button, {
18513
+ icon: "",
18514
+ disabled: !_ctx.canNext,
18515
+ class: "ml-1",
18516
+ style: {"transform":"rotate(180deg)"},
18517
+ onClick: _ctx.nextPage
18518
+ }, {
18519
+ default: (0,external_vue_.withCtx)(() => [
18520
+ ld_pagervue_type_template_id_03c82e7a_hoisted_4
18521
+ ]),
18522
+ _: 1
18523
+ }, 8, ["disabled", "onClick"]),
18524
+ (0,external_vue_.createTextVNode)(),
18525
+ (_ctx.toLast)
18526
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
18527
+ key: 1,
18528
+ icon: "",
18529
+ disabled: !_ctx.canLast,
18530
+ class: "ml-1",
18531
+ style: {"transform":"rotate(180deg)"},
18532
+ onClick: _cache[1] || (_cache[1] = $event => (_ctx.selectPage(_ctx.totalPages, true)))
18533
+ }, {
18534
+ default: (0,external_vue_.withCtx)(() => [
18535
+ ld_pagervue_type_template_id_03c82e7a_hoisted_5
18536
+ ]),
18537
+ _: 1
18538
+ }, 8, ["disabled"]))
18539
+ : (0,external_vue_.createCommentVNode)("", true),
18540
+ (0,external_vue_.createTextVNode)(),
18541
+ (0,external_vue_.createVNode)(_component_v_spacer),
18542
+ (0,external_vue_.createTextVNode)(),
18543
+ (_ctx.showOnlyTotal)
18544
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_pagervue_type_template_id_03c82e7a_hoisted_6, [
18545
+ (0,external_vue_.createElementVNode)("span", ld_pagervue_type_template_id_03c82e7a_hoisted_7, (0,external_vue_.toDisplayString)(`Всего ${_ctx._entityName}`), 1)
18546
+ ]))
18547
+ : (0,external_vue_.createCommentVNode)("", true)
18548
+ ], 2))
18549
+ }
18550
+ ;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.vue?vue&type=template&id=03c82e7a
18551
+
18552
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-pager/ld-pager.ts?vue&type=script&lang=js&external
18553
+ var ld_pagervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
18554
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18555
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18556
+ 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;
18557
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18558
+ };
18559
+ var ld_pagervue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
18560
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18561
+ };
18562
+ var ld_pagervue_type_script_lang_js_external_a, ld_pagervue_type_script_lang_js_external_b;
18563
+
18564
+
18565
+
18566
+
18567
+ class PagerComponent extends (0,external_vue_property_decorator_.mixins)(ViewportMixin) {
18568
+ constructor() {
18569
+ super(...arguments);
18570
+ this.pages = [];
18571
+ this.page = 0;
18572
+ this.count = 0;
18573
+ this.size = 10;
18574
+ this.from = 1;
18575
+ this.to = 10;
18576
+ }
18577
+ emitChange(value) {
18578
+ return value;
18579
+ }
18580
+ onLastPageUnknownChanged() {
18581
+ this.pages = this.calcPages();
18582
+ }
18583
+ onOptionsChanged() {
18584
+ let calc = false;
18585
+ if (this.count !== this.options.total) {
18586
+ this.count = this.options.total;
18587
+ calc = true;
18588
+ }
18589
+ if (this.size !== this.options.pageSize) {
18590
+ this.size = this.options.pageSize ? this.options.pageSize : 10;
18591
+ calc = true;
18592
+ }
18593
+ if (this.page !== this.options.page) {
18594
+ if (this.options.page >= this.totalPages + 1) {
18595
+ this.page = this.totalPages;
18596
+ }
18597
+ else {
18598
+ this.page = this.options.page ? this.options.page : 1;
18599
+ calc = true;
18600
+ }
18601
+ }
18602
+ if (calc) {
18603
+ this.pages = this.calcPages();
18604
+ }
18605
+ }
18606
+ updateToFrom(page) {
18607
+ const current = this.pages.find(p => p.number === page);
18608
+ if (!current) {
18609
+ this.from = 0;
18610
+ this.to = 0;
18611
+ return;
18612
+ }
18613
+ this.from = (current.number - 1) * this.size;
18614
+ this.from = this.from ? this.from + 1 : 1;
18615
+ this.to = this.from + this.size - 1;
18616
+ this.to = this.to < this.count ? this.to : this.count;
18617
+ if (!this.to) {
18618
+ this.from = 0;
18619
+ }
18620
+ }
18621
+ prevPage() {
18622
+ this.selectPage(this.page - 1);
18623
+ }
18624
+ nextPage() {
18625
+ this.selectPage(this.page + 1);
18626
+ }
18627
+ onPageSizeChange(size) {
18628
+ setTimeout(() => this.emitChange({ page: this.page, size }), 100);
18629
+ }
18630
+ selectPage(page, toLast = false) {
18631
+ if (this.pageDisabled(page)) {
18632
+ return;
18633
+ }
18634
+ if (page > 0 && page <= this.totalPages && page !== this.page) {
18635
+ this.page = page;
18636
+ this.pages = this.calcPages(page);
18637
+ this.updateToFrom(page);
18638
+ this.emitChange({ page, size: this.size, toLast });
18639
+ }
18640
+ }
18641
+ calcPages(page) {
18642
+ const pages = [];
18643
+ let startPage = 1;
18644
+ const pagesCount = this.totalPages;
18645
+ let endPage = pagesCount;
18646
+ const maxSize = 5;
18647
+ const isMaxSized = maxSize < this.totalPages;
18648
+ page = page || this.page;
18649
+ if (isMaxSized) {
18650
+ startPage = page - Math.floor(maxSize / 2);
18651
+ endPage = page + Math.floor(maxSize / 2);
18652
+ if (startPage < 1) {
18653
+ startPage = 1;
18654
+ endPage = Math.min(startPage + maxSize - 1, pagesCount);
18655
+ }
18656
+ else if (endPage > pagesCount) {
18657
+ startPage = Math.max(pagesCount - maxSize + 1, 1);
18658
+ endPage = pagesCount;
18659
+ }
18660
+ }
18661
+ for (let num = startPage; num <= endPage; num++) {
18662
+ pages.push({
18663
+ number: num,
18664
+ text: num.toString(),
18665
+ });
18666
+ }
18667
+ if (this.lastPageUnknown) {
18668
+ pages.push({
18669
+ number: endPage + 1,
18670
+ text: '...',
18671
+ });
18672
+ }
18673
+ return pages;
18674
+ }
18675
+ pageDisabled(page) {
18676
+ if (Array.isArray(this.enabledPages) && this.enabledPages.length) {
18677
+ return !this.enabledPages[page - 1];
18678
+ }
18679
+ }
18680
+ get totalPages() {
18681
+ const count = this.size < 1 || this.size === 0 ? 1 : Math.ceil(this.count / this.size);
18682
+ return Math.max(count || 0, 1);
18683
+ }
18684
+ get canPrevious() {
18685
+ return this.page > 1;
18686
+ }
18687
+ get canNext() {
18688
+ return this.page < this.totalPages;
18689
+ }
18690
+ get canLast() {
18691
+ if (Array.isArray(this.enabledPages) && this.enabledPages.length >= this.totalPages) {
18692
+ return this.enabledPages[this.totalPages] && this.page < this.totalPages;
18693
+ }
18694
+ return this.page < this.totalPages;
18695
+ }
18696
+ get showFromTo() {
18697
+ return !this.isMobileGlobal && this.firstVisible && this.lastVisible;
18698
+ }
18699
+ get showOnlyTotal() {
18700
+ return !this.isMobileGlobal && this.count;
18701
+ }
18702
+ get first() {
18703
+ return this.firstVisible ?? this.from;
18704
+ }
18705
+ get last() {
18706
+ return this.lastVisible ?? this.to;
18707
+ }
18708
+ get _entityName() {
18709
+ if (this.entityName instanceof Function) {
18710
+ return this.entityName(this.contentType, this.options.total);
18711
+ }
18712
+ if (this.ldPagerOptions && this.ldPagerOptions.entityName instanceof Function) {
18713
+ return Function.prototype.apply.call(this.ldPagerOptions.entityName, this, [this.contentType, this.options.total]);
18714
+ }
18715
+ return pluralizeNoun(this.options.total, 'элемент', 'элемента', 'элементов', true);
18716
+ }
18717
+ }
18718
+ ld_pagervue_type_script_lang_js_external_decorate([
18719
+ (0,external_vue_property_decorator_.Prop)(),
18720
+ 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)
18721
+ ], PagerComponent.prototype, "options", void 0);
18722
+ ld_pagervue_type_script_lang_js_external_decorate([
18723
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
18724
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
18725
+ ], PagerComponent.prototype, "toFirst", void 0);
18726
+ ld_pagervue_type_script_lang_js_external_decorate([
18727
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
18728
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
18729
+ ], PagerComponent.prototype, "toLast", void 0);
18730
+ ld_pagervue_type_script_lang_js_external_decorate([
18731
+ (0,external_vue_property_decorator_.Prop)({ default: false }),
18732
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
18733
+ ], PagerComponent.prototype, "lastPageUnknown", void 0);
18734
+ ld_pagervue_type_script_lang_js_external_decorate([
18735
+ (0,external_vue_property_decorator_.Prop)(),
18736
+ 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)
18737
+ ], PagerComponent.prototype, "enabledPages", void 0);
18738
+ ld_pagervue_type_script_lang_js_external_decorate([
18739
+ (0,external_vue_property_decorator_.Prop)(),
18740
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Number)
18741
+ ], PagerComponent.prototype, "firstVisible", void 0);
18742
+ ld_pagervue_type_script_lang_js_external_decorate([
18743
+ (0,external_vue_property_decorator_.Prop)(),
18744
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Number)
18745
+ ], PagerComponent.prototype, "lastVisible", void 0);
18746
+ ld_pagervue_type_script_lang_js_external_decorate([
18747
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: true }),
18748
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Boolean)
18749
+ ], PagerComponent.prototype, "bordered", void 0);
18750
+ ld_pagervue_type_script_lang_js_external_decorate([
18751
+ (0,external_vue_property_decorator_.Prop)(),
18752
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Object)
18753
+ ], PagerComponent.prototype, "contentType", void 0);
18754
+ ld_pagervue_type_script_lang_js_external_decorate([
18755
+ (0,external_vue_property_decorator_.Prop)(),
18756
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Function)
18757
+ ], PagerComponent.prototype, "entityName", void 0);
18758
+ ld_pagervue_type_script_lang_js_external_decorate([
18759
+ (0,external_vue_property_decorator_.Inject)(),
18760
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Object)
18761
+ ], PagerComponent.prototype, "ldPagerOptions", void 0);
18762
+ ld_pagervue_type_script_lang_js_external_decorate([
18763
+ Emit('change'),
18764
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
18765
+ ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", [Object]),
18766
+ ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
18767
+ ], PagerComponent.prototype, "emitChange", null);
18768
+ ld_pagervue_type_script_lang_js_external_decorate([
18769
+ (0,external_vue_property_decorator_.Watch)('lastPageUnknown'),
18770
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
18771
+ ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", []),
18772
+ ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
18773
+ ], PagerComponent.prototype, "onLastPageUnknownChanged", null);
18774
+ ld_pagervue_type_script_lang_js_external_decorate([
18775
+ (0,external_vue_property_decorator_.Watch)('options', { immediate: true, deep: true }),
18776
+ ld_pagervue_type_script_lang_js_external_metadata("design:type", Function),
18777
+ ld_pagervue_type_script_lang_js_external_metadata("design:paramtypes", []),
18778
+ ld_pagervue_type_script_lang_js_external_metadata("design:returntype", void 0)
18779
+ ], PagerComponent.prototype, "onOptionsChanged", null);
18780
+
18781
+ ;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.ts?vue&type=script&lang=js&external
18782
+
18783
+ ;// CONCATENATED MODULE: ./src/ld-pager/ld-pager.vue
18784
+
18785
+
18786
+
18787
+
18788
+ ;
18789
+ const ld_pager_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(PagerComponent, [['render',ld_pagervue_type_template_id_03c82e7a_render]])
18790
+
18791
+ /* harmony default export */ const ld_pager = (ld_pager_exports_);
18792
+ ;// CONCATENATED MODULE: ./src/ld-pager/index.ts
18793
+
18794
+ function ld_pager_reg(vue, options) {
18795
+ vue.component(options.aliases['ld-pager'], ld_pager);
18796
+ }
18797
+ /* harmony default export */ const src_ld_pager = (ld_pager_reg);
18798
+
18117
18799
  // EXTERNAL MODULE: external "vue-toastification"
18118
18800
  var external_vue_toastification_ = __webpack_require__(7982);
18119
18801
  var external_vue_toastification_default = /*#__PURE__*/__webpack_require__.n(external_vue_toastification_);
@@ -18434,6 +19116,7 @@ const ValidateMixinOptions = mixin;
18434
19116
 
18435
19117
 
18436
19118
 
19119
+
18437
19120
 
18438
19121
 
18439
19122
  const ldmuiPlugin = {
@@ -18468,19 +19151,25 @@ const ldmuiPlugin = {
18468
19151
  'ld-switch': options.aliases?.['ld-switch'] ?? 'ld-switch',
18469
19152
  'ld-dialog': options.aliases?.['ld-dialog'] ?? 'ld-dialog',
18470
19153
  'ld-data-iterator': options.aliases?.['ld-data-iterator'] ?? 'ld-data-iterator',
19154
+ 'ld-pager': options.aliases?.['ld-pager'] ?? 'ld-pager',
18471
19155
  };
18472
19156
  vue.config.globalProperties.$utils = {
18473
19157
  ...src_utils_namespaceObject,
18474
19158
  };
19159
+ if (options.LdPager?.entityName instanceof Function) {
19160
+ vue.provide('ldPagerOptions', {
19161
+ entityName: options.LdPager?.entityName
19162
+ });
19163
+ }
18475
19164
  vue.config.globalProperties.$ldmui = {
18476
19165
  options: (0,external_vue_.reactive)(options),
18477
- setup: async function () {
18478
- const options = await this.$ldmui.options.callback();
18479
- this.$ldmui.options = {
18480
- ...this.$ldmui.options,
18481
- ...options
18482
- };
18483
- }
19166
+ // setup: async function () {
19167
+ // const options = await this.$ldmui.options.callback();
19168
+ // this.$ldmui.options = {
19169
+ // ...this.$ldmui.options,
19170
+ // ...options
19171
+ // }
19172
+ // }
18484
19173
  };
18485
19174
  vue.directive('active', ActiveDirectiveOptions);
18486
19175
  const toastedOptions = {
@@ -18520,6 +19209,7 @@ const ldmuiPlugin = {
18520
19209
  src_ld_switch(vue, options);
18521
19210
  src_ld_dialog(vue, options);
18522
19211
  src_ld_data_iterator(vue, options);
19212
+ src_ld_pager(vue, options);
18523
19213
  },
18524
19214
  };
18525
19215
  /* harmony default export */ const src = (ldmuiPlugin);