@ldmjs/ui 1.0.0-dev-16 → 1.0.0-dev-17

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (C) 2024 by LANIT <nevezhin@lanit.ru>
3
+ Copyright (C) 2024 by ldmjs
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -12,7 +12,7 @@
12
12
 
13
13
  .v-toolbar[data-v-79e04ede]{position:relative;background-color:var(--white);box-shadow:var(--shadow-1);z-index:1}.toolbar-wrapper[data-v-79e04ede]{display:grid;width:100%;height:100%;padding:0 12px}.toolbar-wrapper[data-v-79e04ede]:not(.--preview){grid-template-columns:100%;grid-template-rows:var(--input-height);row-gap:4px}.toolbar-wrapper.--preview[data-v-79e04ede]{grid-template-columns:1fr}.toolbar-inner[data-v-79e04ede]{display:grid;grid-template-rows:100%;grid-template-columns:1fr max-content;column-gap:8px}.toolbar-caption[data-v-79e04ede]{--left: calc(var(--input-height) + 8px);display:flex;align-items:center;position:absolute;height:100%;width:calc(100% - var(--left));top:0;left:var(--left)}
14
14
 
15
- .ld-select-list-box[data-v-9fce65ba]{display:flex;min-width:100%;max-width:100%;width:100%}.ld-select-list-box .select-list-textbox-validate[data-v-9fce65ba]{overflow:hidden;height:20px}.ld-select-list-box .select-list-textbox-single[data-v-9fce65ba]{max-width:400px;border-radius:var(--border-radius)}.ld-select-list-box .select-list-textbox-loading[data-v-9fce65ba]{position:absolute;left:0;bottom:0;width:calc(100% - var(--input-height));height:3px;overflow:hidden;background-color:var(--grey-l-5)}.ld-select-list-box .select-list-textbox-loading[data-v-9fce65ba]:before{content:'';display:block;position:absolute;top:0;left:0;width:25%;height:100%;background-color:var(--primary);animation:loading-9fce65ba 1.4s linear;animation-iteration-count:infinite}@keyframes loading-9fce65ba{from{transform:translateX(-300%)}to{transform:translateX(500%)}}[data-v-9fce65ba] .ld-select-list-box.column{flex-flow:column}[data-v-9fce65ba] .ld-select-list-box.column .multiselect__tags-wrap{flex-flow:wrap;align-items:normal}
15
+ .ld-select-list-box[data-v-5a9ca916]{display:flex;min-width:100%;max-width:100%;width:100%}.ld-select-list-box .select-list-textbox-validate[data-v-5a9ca916]{overflow:hidden;height:20px}.ld-select-list-box .select-list-textbox-single[data-v-5a9ca916]{max-width:400px;border-radius:var(--border-radius)}.ld-select-list-box .select-list-textbox-loading[data-v-5a9ca916]{position:absolute;left:0;bottom:0;width:calc(100% - var(--input-height));height:3px;overflow:hidden;background-color:var(--grey-l-5)}.ld-select-list-box .select-list-textbox-loading[data-v-5a9ca916]:before{content:'';display:block;position:absolute;top:0;left:0;width:25%;height:100%;background-color:var(--primary);animation:loading-5a9ca916 1.4s linear;animation-iteration-count:infinite}@keyframes loading-5a9ca916{from{transform:translateX(-300%)}to{transform:translateX(500%)}}[data-v-5a9ca916] .ld-select-list-box.column{flex-flow:column}[data-v-5a9ca916] .ld-select-list-box.column .multiselect__tags-wrap{flex-flow:wrap;align-items:normal}
16
16
 
17
17
  .ld-checkbox{display:flex;align-items:center;height:var(--input-height);font-size:var(--font-size);cursor:pointer}.ld-checkbox input[type='checkbox']+.v-icon{display:block;width:12px !important;height:12px !important;font-size:10px !important;background-color:var(--white);color:transparent;border:1px solid var(--grey-l-5)}.ld-checkbox input[type='checkbox']:checked+.v-icon{background-color:var(--primary-l-2);color:var(--white);font-size:10px;font-weight:bold}.ld-checkbox input[type='checkbox']:disabled+.v-icon{background-color:var(--grey-l-3)}.checkbox-label{word-wrap:break-word;max-width:100%;color:var(--label) !important}.checkbox-label--disabled{color:var(--grey-l-3) !important}
18
18
 
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ declare function deepValueGetter(obj: Record<string, unknown>, path: string): un
11
11
  declare function isObjectEmpty(obj: Record<string, unknown>): boolean;
12
12
  declare const datetime: {
13
13
  dateLocalToISO: (value: string) => string;
14
+ toServerString: (value: Date) => string;
14
15
  }
15
16
  declare class ValidateMixin extends Vue {
16
17
  inputs: Array<IInput>;
package/dist/index.js CHANGED
@@ -3790,7 +3790,12 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
3790
3790
  this.emitUpdateModelValue(value instanceof Date ? value : new Date(value));
3791
3791
  }
3792
3792
  if (typeof this.modelValue === 'string') {
3793
- this.emitUpdateModelValue(typeof value === 'string' ? value : value.toISOString());
3793
+ if (typeof value === 'string') {
3794
+ this.emitUpdateModelValue(value);
3795
+ }
3796
+ else {
3797
+ this.emitUpdateModelValue(this.$utils.datetime.toServerString(value));
3798
+ }
3794
3799
  }
3795
3800
  }
3796
3801
  }
@@ -4512,25 +4517,25 @@ function ld_page_toolbar_reg(vue, options) {
4512
4517
  }
4513
4518
  /* harmony default export */ const src_ld_page_toolbar = (ld_page_toolbar_reg);
4514
4519
 
4515
- ;// 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[0]!./src/ld-select-list-box/ld-select-list-box.vue?vue&type=template&id=9fce65ba&scoped=true&ts=true
4520
+ ;// 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[0]!./src/ld-select-list-box/ld-select-list-box.vue?vue&type=template&id=5a9ca916&scoped=true&ts=true
4516
4521
 
4517
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_withScopeId = n => (_pushScopeId("data-v-9fce65ba"), n = n(), _popScopeId(), n);
4518
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_1 = { class: "text-crop" };
4519
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_2 = {
4522
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_withScopeId = n => (_pushScopeId("data-v-5a9ca916"), n = n(), _popScopeId(), n);
4523
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_1 = { class: "text-crop" };
4524
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_2 = {
4520
4525
  key: 0,
4521
4526
  class: "d-flex align-center"
4522
4527
  };
4523
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_3 = { class: "d-flex flex-column ml-2 justify-center" };
4524
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_4 = {
4528
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_3 = { class: "d-flex flex-column ml-2 justify-center" };
4529
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_4 = {
4525
4530
  key: 0,
4526
4531
  class: "grey--text",
4527
4532
  style: { "font-size": "var(--font-size--1)" }
4528
4533
  };
4529
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_5 = {
4534
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_5 = {
4530
4535
  key: 0,
4531
4536
  class: "select-list-textbox-loading"
4532
4537
  };
4533
- const ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_6 = {
4538
+ const ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_6 = {
4534
4539
  key: 0,
4535
4540
  class: "select-list-textbox-validate"
4536
4541
  };
@@ -4538,7 +4543,7 @@ const _hoisted_7 = {
4538
4543
  key: 0,
4539
4544
  class: "select-list-textbox-validate"
4540
4545
  };
4541
- function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
4546
+ function ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
4542
4547
  const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label");
4543
4548
  const _component_small_chip = (0,external_vue_.resolveComponent)("small-chip");
4544
4549
  const _component_v_col = (0,external_vue_.resolveComponent)("v-col");
@@ -4612,7 +4617,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4612
4617
  "onClick:close": ($event) => (_ctx.onRemoveItem(option))
4613
4618
  }, {
4614
4619
  default: (0,external_vue_.withCtx)(() => [
4615
- (0,external_vue_.createElementVNode)("span", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_1, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, this.itemText)), 1)
4620
+ (0,external_vue_.createElementVNode)("span", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_1, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, this.itemTitle)), 1)
4616
4621
  ]),
4617
4622
  _: 2
4618
4623
  }, 1032, ["color", "closable", "onClick:close"]))
@@ -4627,7 +4632,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4627
4632
  (0,external_vue_.createVNode)(_component_v_col, { class: "d-flex align-center" }, {
4628
4633
  default: (0,external_vue_.withCtx)(() => [
4629
4634
  (_ctx.multiselect)
4630
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_2, [
4635
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_2, [
4631
4636
  ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-checkbox']), {
4632
4637
  key: JSON.stringify(option),
4633
4638
  "model-value": _ctx.checkedItems,
@@ -4637,13 +4642,13 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4637
4642
  ]))
4638
4643
  : (0,external_vue_.createCommentVNode)("", true),
4639
4644
  (0,external_vue_.createTextVNode)(),
4640
- (0,external_vue_.createElementVNode)("div", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_3, [
4645
+ (0,external_vue_.createElementVNode)("div", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_3, [
4641
4646
  (0,external_vue_.renderSlot)(_ctx.$slots, "option", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: option, isSelected: _ctx.checkedItems.includes(_ctx.itemIdentity(option)) })), () => [
4642
4647
  (0,external_vue_.createElementVNode)("div", null, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, _ctx.itemTitle)), 1)
4643
4648
  ], true),
4644
4649
  (0,external_vue_.createTextVNode)(),
4645
4650
  (_ctx.optionHint)
4646
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_4, [
4651
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_4, [
4647
4652
  (0,external_vue_.renderSlot)(_ctx.$slots, "option-hint", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: option })), () => [
4648
4653
  (0,external_vue_.createTextVNode)("\r\n no slot \"option-hint\" found\r\n ")
4649
4654
  ], true)
@@ -4684,7 +4689,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4684
4689
  }, 8, ["disabled", "loading", "onClick"]),
4685
4690
  (0,external_vue_.createTextVNode)(),
4686
4691
  (_ctx.loading)
4687
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_5))
4692
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_5))
4688
4693
  : (0,external_vue_.createCommentVNode)("", true)
4689
4694
  ]),
4690
4695
  _: 3
@@ -4694,7 +4699,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4694
4699
  }),
4695
4700
  (0,external_vue_.createTextVNode)(),
4696
4701
  (!_ctx.hideDetails)
4697
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_hoisted_6, [
4702
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_hoisted_6, [
4698
4703
  (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
4699
4704
  default: (0,external_vue_.withCtx)(() => [
4700
4705
  (_ctx.showHint)
@@ -4728,7 +4733,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4728
4733
  "onClick:close": _cache[1] || (_cache[1] = ($event) => (_ctx.onRemoveItem(_ctx.singeItem)))
4729
4734
  }, {
4730
4735
  default: (0,external_vue_.withCtx)(() => [
4731
- (0,external_vue_.createElementVNode)("span", null, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(_ctx.singeItem, this.itemText)), 1)
4736
+ (0,external_vue_.createElementVNode)("span", null, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(_ctx.singeItem, this.itemTitle)), 1)
4732
4737
  ]),
4733
4738
  _: 1
4734
4739
  }, 8, ["closable", "color"]))
@@ -4746,7 +4751,7 @@ function ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_ren
4746
4751
  }));
4747
4752
  }
4748
4753
 
4749
- ;// CONCATENATED MODULE: ./src/ld-select-list-box/ld-select-list-box.vue?vue&type=template&id=9fce65ba&scoped=true&ts=true
4754
+ ;// CONCATENATED MODULE: ./src/ld-select-list-box/ld-select-list-box.vue?vue&type=template&id=5a9ca916&scoped=true&ts=true
4750
4755
 
4751
4756
  // EXTERNAL MODULE: external "./multiselect.js"
4752
4757
  var external_multiselect_js_ = __webpack_require__(9225);
@@ -7470,7 +7475,7 @@ SelectListBoxComponent = ld_select_list_boxvue_type_script_lang_ts_external_deco
7470
7475
  ;
7471
7476
 
7472
7477
 
7473
- const ld_select_list_box_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_select_list_boxvue_type_script_lang_ts_external, [['render',ld_select_list_boxvue_type_template_id_9fce65ba_scoped_true_ts_true_render],['__scopeId',"data-v-9fce65ba"]])
7478
+ const ld_select_list_box_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_select_list_boxvue_type_script_lang_ts_external, [['render',ld_select_list_boxvue_type_template_id_5a9ca916_scoped_true_ts_true_render],['__scopeId',"data-v-5a9ca916"]])
7474
7479
 
7475
7480
  /* harmony default export */ const ld_select_list_box = (ld_select_list_box_exports_);
7476
7481
  ;// CONCATENATED MODULE: ./src/ld-select-list-box/index.ts
@@ -8831,8 +8836,25 @@ function dateLocalToISO(value) {
8831
8836
  }
8832
8837
  return '';
8833
8838
  }
8839
+ /**
8840
+ * Преобразует дату к формату yyyy-MM-ddThh:mm:ss+hh:mm (например, 2020-11-24T12:47:45+03:00)
8841
+ * @param dt Date
8842
+ */
8843
+ function toServerString(dt) {
8844
+ if (!dt) {
8845
+ return null;
8846
+ }
8847
+ const tzo = -dt.getTimezoneOffset();
8848
+ const dif = tzo >= 0 ? '+' : '-';
8849
+ const pad = function (num) {
8850
+ const norm = Math.abs(Math.floor(num));
8851
+ return (norm < 10 ? '0' : '') + norm;
8852
+ };
8853
+ 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)}`;
8854
+ }
8834
8855
  const datetime = {
8835
- dateLocalToISO
8856
+ dateLocalToISO,
8857
+ toServerString
8836
8858
  };
8837
8859
 
8838
8860
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.0-dev-16",
3
+ "version": "1.0.0-dev-17",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {