eservices-core 1.0.313 → 1.0.317

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 CHANGED
@@ -1,4 +1,4 @@
1
- import * as utils from "./utils";
1
+ import * as _utils from "./utils";
2
2
  import * as mixins from "./mixins";
3
3
  import config from "./config";
4
4
  import * as types from "./types";
@@ -88,6 +88,11 @@ import WidgetBreadcrumbs from "./widgets/breadcrumbs/widget-breadcrumbs.vue";
88
88
  import WidgetCommunication from "./widgets/communication/widget-communication.vue";
89
89
  import WidgetList from "./widgets/tables/WidgetList.vue";
90
90
  export { WidgetBreadcrumbs, WidgetCommunication, WidgetList };
91
+ import valuesToUpperCase from "./utils/values-to-upper-case";
92
+ declare const utils: {
93
+ valuesToUpperCase: typeof valuesToUpperCase;
94
+ };
95
+ export { utils };
91
96
  declare const _default: {
92
97
  services: {
93
98
  authService: typeof authService;
@@ -148,7 +153,7 @@ declare const _default: {
148
153
  usage: {
149
154
  inputs: typeof import("./useMethods/useInput");
150
155
  };
151
- utils: typeof utils;
156
+ utils: typeof _utils;
152
157
  classes: {
153
158
  StepWorker: typeof import("./classes/StepWorker").default;
154
159
  Errors: typeof CoreError;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.313
2
+ * eservices-core v1.0.317
3
3
  * (c) 2022 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -417,7 +417,7 @@ const _hoisted_3$o = {
417
417
  };
418
418
  const _hoisted_4$g = ["disabled", "error"];
419
419
  const _hoisted_5$c = ["type", "placeholder", "disabled", "error", "value"];
420
- const _hoisted_6$8 = {
420
+ const _hoisted_6$7 = {
421
421
  key: 1,
422
422
  class: "input-text__error text_sm"
423
423
  };
@@ -462,7 +462,7 @@ function render$p(_ctx, _cache, $props, $setup, $data, $options) {
462
462
  ]))
463
463
  : vue.createCommentVNode("v-if", true),
464
464
  (_ctx.errorMessage)
465
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$8, vue.toDisplayString(_ctx.errorMessage), 1 /* TEXT */))
465
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$7, vue.toDisplayString(_ctx.errorMessage), 1 /* TEXT */))
466
466
  : vue.createCommentVNode("v-if", true)
467
467
  ], 8 /* PROPS */, _hoisted_4$g)
468
468
  ]))
@@ -581,7 +581,7 @@ const _hoisted_5$b = {
581
581
  key: 0,
582
582
  class: "input-select-value"
583
583
  };
584
- const _hoisted_6$7 = {
584
+ const _hoisted_6$6 = {
585
585
  key: 1,
586
586
  class: "current-placeholder text_md"
587
587
  };
@@ -612,7 +612,7 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
612
612
  vue.createElementVNode("div", _hoisted_4$f, [
613
613
  (!(_ctx.value === undefined || _ctx.value === null))
614
614
  ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$b, vue.toDisplayString($options.titleValue), 1 /* TEXT */))
615
- : (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$7, vue.toDisplayString(_ctx.placeholder), 1 /* TEXT */)),
615
+ : (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$6, vue.toDisplayString(_ctx.placeholder), 1 /* TEXT */)),
616
616
  (!(_ctx.disabled || _ctx.isInsideDisabled))
617
617
  ? (vue.openBlock(), vue.createBlock(_component_icon, {
618
618
  key: 2,
@@ -1347,7 +1347,7 @@ const _hoisted_5$9 = {
1347
1347
  key: 0,
1348
1348
  class: "form-container-label"
1349
1349
  };
1350
- const _hoisted_6$6 = { class: "form-label__title text_size_sm" };
1350
+ const _hoisted_6$5 = { class: "form-label__title text_size_sm" };
1351
1351
  var script$D = /*#__PURE__*/ vue.defineComponent({
1352
1352
  props: {
1353
1353
  title: { type: String, required: true },
@@ -1370,7 +1370,7 @@ var script$D = /*#__PURE__*/ vue.defineComponent({
1370
1370
  class: "form-label__icon",
1371
1371
  name: __props.label.icon
1372
1372
  }, null, 8 /* PROPS */, ["name"]),
1373
- vue.createElementVNode("p", _hoisted_6$6, vue.toDisplayString(__props.label.title), 1 /* TEXT */)
1373
+ vue.createElementVNode("p", _hoisted_6$5, vue.toDisplayString(__props.label.title), 1 /* TEXT */)
1374
1374
  ], 2 /* CLASS */)
1375
1375
  ]))
1376
1376
  : vue.createCommentVNode("v-if", true)
@@ -1410,7 +1410,7 @@ const _hoisted_2$m = { class: "multi-button" };
1410
1410
  const _hoisted_3$h = { class: "widget-button-list" };
1411
1411
  const _hoisted_4$b = ["onClick"];
1412
1412
  const _hoisted_5$8 = { class: "button__side" };
1413
- const _hoisted_6$5 = {
1413
+ const _hoisted_6$4 = {
1414
1414
  key: 0,
1415
1415
  class: "button__size-progress"
1416
1416
  };
@@ -1456,7 +1456,7 @@ var script$B = /*#__PURE__*/ vue.defineComponent({
1456
1456
  ], 2 /* CLASS */),
1457
1457
  vue.createElementVNode("div", _hoisted_5$8, [
1458
1458
  (vue.unref(pw).wait)
1459
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$5, [
1459
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$4, [
1460
1460
  vue.createVNode(script$C, { class: "button-spinner" })
1461
1461
  ]))
1462
1462
  : (__props.array && __props.array.length > 1)
@@ -2086,7 +2086,7 @@ function requestHandler(callback, options = {}) {
2086
2086
  });
2087
2087
  }
2088
2088
 
2089
- var utils = /*#__PURE__*/Object.freeze({
2089
+ var _utils = /*#__PURE__*/Object.freeze({
2090
2090
  __proto__: null,
2091
2091
  Request: Request,
2092
2092
  clickOutside: clickOutside,
@@ -3270,8 +3270,22 @@ class dataService {
3270
3270
  return result.data;
3271
3271
  });
3272
3272
  }
3273
- static readById(entity, id) {
3274
- return Request(`/close-api/data/entities/${entity}/id/${id}`, {
3273
+ /**
3274
+ * @description Reading entity's data by id.
3275
+ * @param {String} entity Entity name in the singular.
3276
+ * @param {Number} id Entity id.
3277
+ * @param {Object} options
3278
+ * @param {String | String[]} options.fields String or Array of String. Contains input names.
3279
+ */
3280
+ static readById(entity, id, options = {}) {
3281
+ const query = new URLSearchParams();
3282
+ if (options.fields) {
3283
+ let fields = options.fields;
3284
+ if (typeof fields === 'string')
3285
+ fields = [fields];
3286
+ query.append('fields', fields.join(' '));
3287
+ }
3288
+ return Request(`/close-api/data/entities/${entity}/id/${id}?${query.toString()}`, {
3275
3289
  method: 'GET',
3276
3290
  headers: {
3277
3291
  'Content-Type': 'application/json'
@@ -4821,7 +4835,7 @@ const _hoisted_2$7 = { class: "popup-current-context popup-section" };
4821
4835
  const _hoisted_3$5 = ["src"];
4822
4836
  const _hoisted_4$4 = { class: "popup-current-context__info" };
4823
4837
  const _hoisted_5$4 = { class: "info-title text_bold text_md info-paragraph" };
4824
- const _hoisted_6$4 = { class: "info-id info-paragraph" };
4838
+ const _hoisted_6$3 = { class: "info-id info-paragraph" };
4825
4839
  const _hoisted_7 = { class: "flex_column popup-section" };
4826
4840
  var script$b = /*#__PURE__*/ vue.defineComponent({
4827
4841
  props: {
@@ -4843,7 +4857,7 @@ var script$b = /*#__PURE__*/ vue.defineComponent({
4843
4857
  }, null, 8 /* PROPS */, _hoisted_3$5),
4844
4858
  vue.createElementVNode("div", _hoisted_4$4, [
4845
4859
  vue.createElementVNode("p", _hoisted_5$4, vue.toDisplayString(__props.email), 1 /* TEXT */),
4846
- vue.createElementVNode("p", _hoisted_6$4, "ID: " + vue.toDisplayString(__props.id), 1 /* TEXT */)
4860
+ vue.createElementVNode("p", _hoisted_6$3, "ID: " + vue.toDisplayString(__props.id), 1 /* TEXT */)
4847
4861
  ])
4848
4862
  ]),
4849
4863
  vue.createElementVNode("div", _hoisted_7, [
@@ -4929,7 +4943,7 @@ var script$a = /*#__PURE__*/ vue.defineComponent({
4929
4943
  }
4930
4944
  });
4931
4945
 
4932
- var css_248z$a = "\n.user-card[data-v-610b1eb4]{\r\n display: flex;\r\n align-items: center;\r\n\r\n gap: 15px;\r\n padding: 0 35px 0 0;\r\n height: 100%;\r\n user-select: none;\r\n cursor: pointer;\n}\n.user-card-name[data-v-610b1eb4]{\r\n color: white;\n}\n.user-card-image[data-v-610b1eb4]{\r\n height: 40px;\r\n width: 40px;\r\n object-fit: cover;\r\n\r\n border-radius: 50%;\n}\n.user-card__popup[data-v-610b1eb4]{\r\n position: absolute;\r\n right: 0;\r\n min-width: 250px;\n}\r\n";
4946
+ var css_248z$a = "\n.user-card[data-v-610b1eb4]{\r\n display: flex;\r\n align-items: center;\r\n\r\n gap: 15px;\r\n padding: 0 35px 0 0;\r\n height: 100%;\r\n user-select: none;\r\n cursor: pointer;\n}\n.user-card-name[data-v-610b1eb4]{\r\n color: white;\n}\n.user-card-image[data-v-610b1eb4]{\r\n height: 40px;\r\n width: 40px;\r\n object-fit: cover;\r\n\r\n border-radius: 50%;\n}\n.user-card__popup[data-v-610b1eb4]{\r\n position: absolute;\r\n right: 0;\r\n min-width: 250px;\r\n z-index: 5;\n}\r\n";
4933
4947
  styleInject(css_248z$a);
4934
4948
 
4935
4949
  script$a.__scopeId = "data-v-610b1eb4";
@@ -4970,11 +4984,10 @@ script$9.__file = "core/widgets/interface/interface-header.vue";
4970
4984
 
4971
4985
  const _withScopeId$3 = n => (vue.pushScopeId("data-v-378f75d5"), n = n(), vue.popScopeId(), n);
4972
4986
  const _hoisted_1$8 = { class: "interface-container" };
4973
- const _hoisted_2$4 = { class: "interface-container__logotype" };
4974
- const _hoisted_3$3 = ["src"];
4975
- const _hoisted_4$3 = { class: "interface-local-nav" };
4976
- const _hoisted_5$3 = /*#__PURE__*/ _withScopeId$3(() => /*#__PURE__*/ vue.createElementVNode("span", null, "Menu", -1 /* HOISTED */));
4977
- const _hoisted_6$3 = { class: "interface-container-content" };
4987
+ const _hoisted_2$4 = ["src"];
4988
+ const _hoisted_3$3 = { class: "interface-local-nav" };
4989
+ const _hoisted_4$3 = /*#__PURE__*/ _withScopeId$3(() => /*#__PURE__*/ vue.createElementVNode("span", null, "Menu", -1 /* HOISTED */));
4990
+ const _hoisted_5$3 = { class: "interface-container-content" };
4978
4991
  var script$8 = /*#__PURE__*/ vue.defineComponent({
4979
4992
  props: {
4980
4993
  nav: { type: Array, required: true },
@@ -4989,13 +5002,21 @@ var script$8 = /*#__PURE__*/ vue.defineComponent({
4989
5002
  // If true on mobile devices navigation will be showed
4990
5003
  const mobileNavigationActive = vue.ref(false);
4991
5004
  return (_ctx, _cache) => {
5005
+ const _component_router_link = vue.resolveComponent("router-link");
4992
5006
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
4993
- vue.createElementVNode("div", _hoisted_2$4, [
4994
- vue.createElementVNode("img", {
4995
- src: __props.logotype,
4996
- alt: "logotype"
4997
- }, null, 8 /* PROPS */, _hoisted_3$3)
4998
- ]),
5007
+ vue.createVNode(_component_router_link, {
5008
+ to: "/",
5009
+ tag: "div",
5010
+ class: "interface-container__logotype"
5011
+ }, {
5012
+ default: vue.withCtx(() => [
5013
+ vue.createElementVNode("img", {
5014
+ src: __props.logotype,
5015
+ alt: "logotype"
5016
+ }, null, 8 /* PROPS */, _hoisted_2$4)
5017
+ ]),
5018
+ _: 1 /* STABLE */
5019
+ }),
4999
5020
  vue.createVNode(script$9, {
5000
5021
  userId: __props.userId,
5001
5022
  userName: __props.userName,
@@ -5004,7 +5025,7 @@ var script$8 = /*#__PURE__*/ vue.defineComponent({
5004
5025
  popup: __props.popup
5005
5026
  }, null, 8 /* PROPS */, ["userId", "userName", "userEmail", "user-photo", "popup"]),
5006
5027
  vue.createCommentVNode("Mobile navigation toggle"),
5007
- vue.createElementVNode("div", _hoisted_4$3, [
5028
+ vue.createElementVNode("div", _hoisted_3$3, [
5008
5029
  vue.createElementVNode("button", {
5009
5030
  class: "menu",
5010
5031
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => (mobileNavigationActive.value = !mobileNavigationActive.value), ["stop"]))
@@ -5013,7 +5034,7 @@ var script$8 = /*#__PURE__*/ vue.defineComponent({
5013
5034
  class: "menu-icon",
5014
5035
  name: "menu-burger"
5015
5036
  }),
5016
- _hoisted_5$3
5037
+ _hoisted_4$3
5017
5038
  ])
5018
5039
  ]),
5019
5040
  vue.createVNode(vue.Transition, { name: "opacity" }, {
@@ -5034,7 +5055,7 @@ var script$8 = /*#__PURE__*/ vue.defineComponent({
5034
5055
  'interface-navigation-mobile_active': mobileNavigationActive.value
5035
5056
  }])
5036
5057
  }, null, 8 /* PROPS */, ["config", "class"]),
5037
- vue.createElementVNode("div", _hoisted_6$3, [
5058
+ vue.createElementVNode("div", _hoisted_5$3, [
5038
5059
  vue.renderSlot(_ctx.$slots, "default")
5039
5060
  ])
5040
5061
  ]));
@@ -5042,7 +5063,7 @@ var script$8 = /*#__PURE__*/ vue.defineComponent({
5042
5063
  }
5043
5064
  });
5044
5065
 
5045
- var css_248z$8 = "\n.interface-container[data-v-378f75d5]{\r\n height: 100%;\r\n\r\n display: grid;\r\n grid-template-rows: 60px 1fr;\r\n grid-template-columns: 250px 1fr;\n}\n.interface-container__logotype[data-v-378f75d5]{\r\n display: grid;\r\n place-content: center;\r\n background-color: var(--primary);\n}\n.interface-local-nav[data-v-378f75d5]{\r\n display: none;\n}\n.interface-navigation[data-v-378f75d5]{\r\n background-color: white;\n}\n@media screen and (max-width: 768px){\n.interface-container[data-v-378f75d5]{\r\n height: 100%;\r\n\r\n display: grid;\r\n grid-template-rows: 60px 60px 1fr;\r\n grid-template-columns: 140px 1fr;\n}\n.interface-navigation[data-v-378f75d5]{\r\n position: fixed;\r\n height: 100%;\r\n min-width: 250px;\r\n z-index: 2;\r\n opacity: 0;\r\n transform: translate(-100%);\r\n\r\n transition: opacity var(--fast), transform var(--fast);\n}\n.interface-navigation-mobile_active[data-v-378f75d5]{\r\n opacity: 1;\r\n transform: translate(0);\n}\n.interface-backdrop[data-v-378f75d5]{\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 1;\r\n background: rgba(0,0,0,.6);\r\n transition: opacity .5s;\n}\n.interface-local-nav[data-v-378f75d5]{\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 10px 0;\r\n grid-column: 1/3;\n}\n.interface-container-content[data-v-378f75d5]{\r\n grid-column: 1/3;\n}\n.menu[data-v-378f75d5] {\r\n border: 0;\r\n background-color: transparent;\n}\n.menu-icon[data-v-378f75d5]{\r\n margin-right: 10px;\n}\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
5066
+ var css_248z$8 = "\n.interface-container[data-v-378f75d5]{\r\n height: 100%;\r\n\r\n display: grid;\r\n grid-template-rows: 60px 1fr;\r\n grid-template-columns: 250px 1fr;\n}\n.interface-container__logotype[data-v-378f75d5]{\r\n display: grid;\r\n place-content: center;\r\n background-color: var(--primary);\n}\n.interface-local-nav[data-v-378f75d5]{\r\n display: none;\n}\n.interface-navigation[data-v-378f75d5]{\r\n background-color: white;\n}\n.interface-container-content[data-v-378f75d5] {\r\n overflow: auto;\n}\n@media screen and (max-width: 768px){\n.interface-container[data-v-378f75d5]{\r\n height: 100%;\r\n\r\n display: grid;\r\n grid-template-rows: 60px 60px 1fr;\r\n grid-template-columns: 140px 1fr;\n}\n.interface-navigation[data-v-378f75d5]{\r\n position: fixed;\r\n height: 100%;\r\n min-width: 250px;\r\n z-index: 2;\r\n opacity: 0;\r\n transform: translate(-100%);\r\n\r\n transition: opacity var(--fast), transform var(--fast);\n}\n.interface-navigation-mobile_active[data-v-378f75d5]{\r\n opacity: 1;\r\n transform: translate(0);\n}\n.interface-backdrop[data-v-378f75d5]{\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 1;\r\n background: rgba(0,0,0,.6);\r\n transition: opacity .5s;\n}\n.interface-local-nav[data-v-378f75d5]{\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 10px 0;\r\n grid-column: 1/3;\n}\n.interface-container-content[data-v-378f75d5]{\r\n grid-column: 1/3;\n}\n.menu[data-v-378f75d5] {\r\n border: 0;\r\n background-color: transparent;\n}\n.menu-icon[data-v-378f75d5]{\r\n margin-right: 10px;\n}\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
5046
5067
  styleInject(css_248z$8);
5047
5068
 
5048
5069
  script$8.__scopeId = "data-v-378f75d5";
@@ -5579,6 +5600,24 @@ styleInject(css_248z);
5579
5600
  script.__scopeId = "data-v-4b4d3458";
5580
5601
  script.__file = "core/widgets/communication/widget-communication.vue";
5581
5602
 
5603
+ /**
5604
+ * @description Recursive changing object, uppercase first chapter of each key.
5605
+ * */
5606
+ function valuesToUpperCase(values) {
5607
+ return Object.keys(values).reduce((acc, key) => {
5608
+ let value = values[key];
5609
+ const newKey = key.charAt(0).toUpperCase() + key.slice(1); // upper
5610
+ // If current value is not primitive value, continue recursive parse
5611
+ if (typeof value === 'object' && !(value === undefined || value === null))
5612
+ value = valuesToUpperCase(value);
5613
+ acc[newKey] = value;
5614
+ return acc;
5615
+ }, {});
5616
+ }
5617
+
5618
+ const utils = {
5619
+ valuesToUpperCase
5620
+ };
5582
5621
  var index = {
5583
5622
  /*
5584
5623
  StepRecordRow,
@@ -5591,7 +5630,7 @@ var index = {
5591
5630
  services,
5592
5631
  widgets: a,
5593
5632
  usage,
5594
- utils,
5633
+ utils: _utils,
5595
5634
  classes,
5596
5635
  mixins,
5597
5636
  config,
@@ -5615,4 +5654,5 @@ exports["default"] = index;
5615
5654
  exports.metadataService = metadataService;
5616
5655
  exports.processWizardService = processWizardService;
5617
5656
  exports.requestHandler = requestHandler;
5657
+ exports.utils = utils;
5618
5658
  exports.viewService = viewService;
@@ -48,7 +48,16 @@ export default class dataService {
48
48
  static delete(entity: string, id: number): Promise<void>;
49
49
  static test(): Promise<Response>;
50
50
  static read(entity: string, keys: string, options: ReadOptions): Promise<ReadResponse>;
51
- static readById(entity: string, id: number): Promise<any>;
51
+ /**
52
+ * @description Reading entity's data by id.
53
+ * @param {String} entity Entity name in the singular.
54
+ * @param {Number} id Entity id.
55
+ * @param {Object} options
56
+ * @param {String | String[]} options.fields String or Array of String. Contains input names.
57
+ */
58
+ static readById(entity: string, id: number, options?: {
59
+ fields?: string | string[];
60
+ }): Promise<any>;
52
61
  static updateById(entity: string, id: number, values: ValuesInterface, options?: UpdateOptions): Promise<any>;
53
62
  static getEnum(name: string): void;
54
63
  }
@@ -22,7 +22,7 @@ interface ListRowValues extends ValuesInterface {
22
22
  interface SortConfig {
23
23
  [name: string]: boolean;
24
24
  }
25
- declare type Values = string | number | null | ValuesInterface | boolean;
25
+ declare type Values = string | number | null | ValuesInterface | boolean | undefined;
26
26
  interface FormControllerInterface {
27
27
  name?: string;
28
28
  disable: () => void;
@@ -0,0 +1,5 @@
1
+ import { ValuesInterface } from "../types";
2
+ /**
3
+ * @description Recursive changing object, uppercase first chapter of each key.
4
+ * */
5
+ export default function valuesToUpperCase(values: ValuesInterface): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.313",
3
+ "version": "1.0.317",
4
4
  "description": "----",
5
5
  "author": "",
6
6
  "scripts": {