@sankhyalabs/sankhyablocks 1.0.3 → 1.0.6
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/README.md +6 -1
- package/{build → dist}/index.js +519 -6
- package/dist/index.js.map +1 -0
- package/dist/types/application/AppParameterProvider.d.ts +10 -0
- package/{build → dist}/types/application/SankhyaAppProvider.d.ts +4 -1
- package/{build → dist}/types/http/fetchers/application-config-fetcher.d.ts +0 -0
- package/{build → dist}/types/http/fetchers/dataunit-fetcher.d.ts +2 -0
- package/{build → dist}/types/http/fetchers/form-config-fetcher.d.ts +0 -0
- package/{build → dist}/types/http/fetchers/grid-config-fetcher.d.ts +0 -0
- package/dist/types/http/fetchers/parameters-fecher.d.ts +13 -0
- package/{build → dist}/types/index.d.ts +0 -0
- package/{build → dist}/types/utils/urlutils.d.ts +0 -0
- package/{build → dist}/types/workspace/workspace.d.ts +1 -0
- package/package.json +4 -3
- package/tsconfig.json +1 -1
- package/build/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
# sankhya-blocks
|
|
2
2
|
|
|
3
|
-
Projeto para integração do design system ez-ui com as regras de negocio/framework do ERP Sankhya
|
|
3
|
+
Projeto para integração do design system ez-ui com as regras de negocio/framework do ERP Sankhya
|
|
4
|
+
|
|
5
|
+
## Comandos NPM
|
|
6
|
+
- `npm run dev`: Esse comando foi criado com o intuito de facilitar facilitar o build do projeto em ambiente de desenvolvimento, ele faz o build do projeto em modo `development` e inicia o watch do webpack para monitorar alterações nos arquivos.
|
|
7
|
+
|
|
8
|
+
- `npm run build`: Esse comando foi criado para fazer o build do projeto para produção, ele faz o build do projeto em modo `production`
|
package/{build → dist}/index.js
RENAMED
|
@@ -6886,6 +6886,50 @@ MaskFormatter.CharCharacter = class extends MaskFormatter.MaskCharacter {
|
|
|
6886
6886
|
}
|
|
6887
6887
|
};
|
|
6888
6888
|
//# sourceMappingURL=MaskFormatter.js.map
|
|
6889
|
+
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/utils/DateUtils.js
|
|
6890
|
+
class DateUtils {
|
|
6891
|
+
static clearTime(date, adjustDayLightSavingTime = true) {
|
|
6892
|
+
const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
6893
|
+
return adjustDayLightSavingTime ? DateUtils.adjustDLST(newDate) : newDate;
|
|
6894
|
+
}
|
|
6895
|
+
static strToDate(strValue, adjustDayLightSavingTime = true, monthYearMode = false) {
|
|
6896
|
+
/** monthYearMode é um booleano para usar o formato MM/YYYY.
|
|
6897
|
+
* Quando ativado, é retornado o primeiro dia do mês apenas para construir a data.
|
|
6898
|
+
* Não há necessidade de verificar o horário de verão quando utilizado esse modo. */
|
|
6899
|
+
let parts;
|
|
6900
|
+
if (monthYearMode) {
|
|
6901
|
+
parts = /^(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
|
|
6902
|
+
}
|
|
6903
|
+
else {
|
|
6904
|
+
parts = /^(3[01]|[1-2]\d|0[1-9]|[1-9])[^\d]?(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
|
|
6905
|
+
}
|
|
6906
|
+
if (!parts) {
|
|
6907
|
+
return undefined;
|
|
6908
|
+
}
|
|
6909
|
+
var day = monthYearMode ? 1 : Number(parts[1]);
|
|
6910
|
+
var month = Number(parts[(monthYearMode ? 1 : 2)]);
|
|
6911
|
+
var year = Number(parts[(monthYearMode ? 2 : 3)]);
|
|
6912
|
+
var hour = Number(parts[(monthYearMode ? 3 : 4)] || 0);
|
|
6913
|
+
var min = Number(parts[(monthYearMode ? 4 : 5)] || 0);
|
|
6914
|
+
var sec = Number(parts[(monthYearMode ? 5 : 6)] || 0);
|
|
6915
|
+
if (year < 100) {
|
|
6916
|
+
year += year < 30 ? 2000 : 1900;
|
|
6917
|
+
}
|
|
6918
|
+
let date = new Date(year, month - 1, day, hour, min, sec, 0);
|
|
6919
|
+
if (adjustDayLightSavingTime === true && !monthYearMode && hour == 0) {
|
|
6920
|
+
date = DateUtils.adjustDLST(date);
|
|
6921
|
+
}
|
|
6922
|
+
return date;
|
|
6923
|
+
}
|
|
6924
|
+
static adjustDLST(date) {
|
|
6925
|
+
//Work around para corrigir o Bug do horário de verão.
|
|
6926
|
+
if (date.getHours() == 23) {
|
|
6927
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1, 1, 0, 0, 0);
|
|
6928
|
+
}
|
|
6929
|
+
return date;
|
|
6930
|
+
}
|
|
6931
|
+
}
|
|
6932
|
+
//# sourceMappingURL=DateUtils.js.map
|
|
6889
6933
|
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/utils/TimeFormatter.js
|
|
6890
6934
|
|
|
6891
6935
|
/**
|
|
@@ -8288,6 +8332,10 @@ class ApplicationUtils {
|
|
|
8288
8332
|
;// CONCATENATED MODULE: ./src/lib/http/fetchers/dataunit-fetcher.ts
|
|
8289
8333
|
var _templateObject;
|
|
8290
8334
|
|
|
8335
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8336
|
+
|
|
8337
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8338
|
+
|
|
8291
8339
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8292
8340
|
|
|
8293
8341
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -8329,7 +8377,7 @@ var DataUnitFetcher = /*#__PURE__*/function () {
|
|
|
8329
8377
|
_createClass(DataUnitFetcher, [{
|
|
8330
8378
|
key: "buldTemplates",
|
|
8331
8379
|
value: function buldTemplates() {
|
|
8332
|
-
this.templateByQuery.set("
|
|
8380
|
+
this.templateByQuery.set("fetchDataUnit", (0,dist.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["query($name: String!) {\n $queryAlias$: fetchDataUnit(name: $name){\n name,\n fields{\n name,\n defaultValue,\n label,\n readOnly,\n required,\n dataType,\n userInterface,\n properties{\n name,\n value\n },\n dependencies{\n masterFields,\n type,\n expression\n }\n }\n }\n }"]))));
|
|
8333
8381
|
}
|
|
8334
8382
|
}, {
|
|
8335
8383
|
key: "getDataUnit",
|
|
@@ -8348,13 +8396,13 @@ var DataUnitFetcher = /*#__PURE__*/function () {
|
|
|
8348
8396
|
while (1) {
|
|
8349
8397
|
switch (_context.prev = _context.next) {
|
|
8350
8398
|
case 0:
|
|
8351
|
-
completPath = "dd://".concat(
|
|
8399
|
+
completPath = "dd://".concat(name, "/").concat(resourceID);
|
|
8352
8400
|
_context.next = 3;
|
|
8353
8401
|
return HttpFetcher.get().callGraphQL({
|
|
8354
8402
|
values: {
|
|
8355
8403
|
name: completPath
|
|
8356
8404
|
},
|
|
8357
|
-
query: _this.templateByQuery.get("
|
|
8405
|
+
query: _this.templateByQuery.get("fetchDataUnit")
|
|
8358
8406
|
});
|
|
8359
8407
|
|
|
8360
8408
|
case 3:
|
|
@@ -8366,10 +8414,10 @@ var DataUnitFetcher = /*#__PURE__*/function () {
|
|
|
8366
8414
|
key = _ref3[0],
|
|
8367
8415
|
val = _ref3[1];
|
|
8368
8416
|
|
|
8369
|
-
resolve(val);
|
|
8417
|
+
resolve(_this.normalizeMetadata(val));
|
|
8370
8418
|
});
|
|
8371
8419
|
} else {
|
|
8372
|
-
resolve(res);
|
|
8420
|
+
resolve(_this.normalizeMetadata(res));
|
|
8373
8421
|
}
|
|
8374
8422
|
|
|
8375
8423
|
case 5:
|
|
@@ -8399,6 +8447,34 @@ var DataUnitFetcher = /*#__PURE__*/function () {
|
|
|
8399
8447
|
|
|
8400
8448
|
return getDataUnit;
|
|
8401
8449
|
}()
|
|
8450
|
+
}, {
|
|
8451
|
+
key: "normalizeMetadata",
|
|
8452
|
+
value: function normalizeMetadata(md) {
|
|
8453
|
+
var _this2 = this;
|
|
8454
|
+
|
|
8455
|
+
var newProps = {};
|
|
8456
|
+
|
|
8457
|
+
var newMetadata = _objectSpread({}, md);
|
|
8458
|
+
|
|
8459
|
+
newMetadata.fields.forEach(function (field) {
|
|
8460
|
+
var _field$properties;
|
|
8461
|
+
|
|
8462
|
+
(_field$properties = field.properties) === null || _field$properties === void 0 ? void 0 : _field$properties.forEach(function (prop) {
|
|
8463
|
+
newProps[prop.name] = _this2.tryParseJson(prop.value);
|
|
8464
|
+
});
|
|
8465
|
+
field.properties = newProps;
|
|
8466
|
+
});
|
|
8467
|
+
return newMetadata;
|
|
8468
|
+
}
|
|
8469
|
+
}, {
|
|
8470
|
+
key: "tryParseJson",
|
|
8471
|
+
value: function tryParseJson(value) {
|
|
8472
|
+
try {
|
|
8473
|
+
return JSON.parse(value);
|
|
8474
|
+
} catch (_unused) {
|
|
8475
|
+
return value;
|
|
8476
|
+
}
|
|
8477
|
+
}
|
|
8402
8478
|
}], [{
|
|
8403
8479
|
key: "bindTo",
|
|
8404
8480
|
value: function bindTo(dataUnit, resourceID) {
|
|
@@ -8424,6 +8500,8 @@ function workspace_defineProperties(target, props) { for (var i = 0; i < props.l
|
|
|
8424
8500
|
|
|
8425
8501
|
function workspace_createClass(Constructor, protoProps, staticProps) { if (protoProps) workspace_defineProperties(Constructor.prototype, protoProps); if (staticProps) workspace_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8426
8502
|
|
|
8503
|
+
function workspace_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8504
|
+
|
|
8427
8505
|
var Workspace = /*#__PURE__*/function () {
|
|
8428
8506
|
function Workspace() {
|
|
8429
8507
|
workspace_classCallCheck(this, Workspace);
|
|
@@ -8441,6 +8519,8 @@ var Workspace = /*#__PURE__*/function () {
|
|
|
8441
8519
|
return Workspace;
|
|
8442
8520
|
}();
|
|
8443
8521
|
|
|
8522
|
+
workspace_defineProperty(Workspace, "resourceID", window["workspace"].resourceID);
|
|
8523
|
+
|
|
8444
8524
|
|
|
8445
8525
|
;// CONCATENATED MODULE: ./src/lib/utils/urlutils.ts
|
|
8446
8526
|
function urlutils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -8489,6 +8569,427 @@ var UrlUtils = /*#__PURE__*/function () {
|
|
|
8489
8569
|
}();
|
|
8490
8570
|
|
|
8491
8571
|
|
|
8572
|
+
;// CONCATENATED MODULE: ./src/lib/http/fetchers/parameters-fecher.ts
|
|
8573
|
+
var parameters_fecher_templateObject;
|
|
8574
|
+
|
|
8575
|
+
function parameters_fecher_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8576
|
+
|
|
8577
|
+
function parameters_fecher_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { parameters_fecher_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { parameters_fecher_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8578
|
+
|
|
8579
|
+
function parameters_fecher_taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
8580
|
+
|
|
8581
|
+
function parameters_fecher_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8582
|
+
|
|
8583
|
+
function parameters_fecher_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
8584
|
+
|
|
8585
|
+
function parameters_fecher_createClass(Constructor, protoProps, staticProps) { if (protoProps) parameters_fecher_defineProperties(Constructor.prototype, protoProps); if (staticProps) parameters_fecher_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8586
|
+
|
|
8587
|
+
function parameters_fecher_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8588
|
+
|
|
8589
|
+
|
|
8590
|
+
|
|
8591
|
+
|
|
8592
|
+
var ParametersFetcher = /*#__PURE__*/function () {
|
|
8593
|
+
function ParametersFetcher() {
|
|
8594
|
+
parameters_fecher_classCallCheck(this, ParametersFetcher);
|
|
8595
|
+
|
|
8596
|
+
parameters_fecher_defineProperty(this, "templateByQuery", new Map());
|
|
8597
|
+
|
|
8598
|
+
this.buldTemplates();
|
|
8599
|
+
}
|
|
8600
|
+
|
|
8601
|
+
parameters_fecher_createClass(ParametersFetcher, [{
|
|
8602
|
+
key: "buldTemplates",
|
|
8603
|
+
value: function buldTemplates() {
|
|
8604
|
+
this.templateByQuery.set("fetchParam", (0,dist.gql)(parameters_fecher_templateObject || (parameters_fecher_templateObject = parameters_fecher_taggedTemplateLiteral(["query($name: String!) {\n $queryAlias$: fetchParameter(name: $name){\n name\n value\n }\n }"]))));
|
|
8605
|
+
}
|
|
8606
|
+
}, {
|
|
8607
|
+
key: "getParam",
|
|
8608
|
+
value: function () {
|
|
8609
|
+
var _getParam = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name, resourceID) {
|
|
8610
|
+
var completPath;
|
|
8611
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8612
|
+
while (1) {
|
|
8613
|
+
switch (_context.prev = _context.next) {
|
|
8614
|
+
case 0:
|
|
8615
|
+
completPath = "param://".concat(resourceID, "?params=").concat(window.btoa(name));
|
|
8616
|
+
return _context.abrupt("return", HttpFetcher.get().callGraphQL({
|
|
8617
|
+
values: {
|
|
8618
|
+
name: completPath
|
|
8619
|
+
},
|
|
8620
|
+
query: this.templateByQuery.get("fetchParam")
|
|
8621
|
+
}));
|
|
8622
|
+
|
|
8623
|
+
case 2:
|
|
8624
|
+
case "end":
|
|
8625
|
+
return _context.stop();
|
|
8626
|
+
}
|
|
8627
|
+
}
|
|
8628
|
+
}, _callee, this);
|
|
8629
|
+
}));
|
|
8630
|
+
|
|
8631
|
+
function getParam(_x, _x2) {
|
|
8632
|
+
return _getParam.apply(this, arguments);
|
|
8633
|
+
}
|
|
8634
|
+
|
|
8635
|
+
return getParam;
|
|
8636
|
+
}()
|
|
8637
|
+
}, {
|
|
8638
|
+
key: "asString",
|
|
8639
|
+
value: function () {
|
|
8640
|
+
var _asString = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(name, resourceID) {
|
|
8641
|
+
var paramArr;
|
|
8642
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
8643
|
+
while (1) {
|
|
8644
|
+
switch (_context2.prev = _context2.next) {
|
|
8645
|
+
case 0:
|
|
8646
|
+
_context2.next = 2;
|
|
8647
|
+
return this.getParam(name, resourceID);
|
|
8648
|
+
|
|
8649
|
+
case 2:
|
|
8650
|
+
paramArr = _context2.sent;
|
|
8651
|
+
return _context2.abrupt("return", this.getValue(paramArr));
|
|
8652
|
+
|
|
8653
|
+
case 4:
|
|
8654
|
+
case "end":
|
|
8655
|
+
return _context2.stop();
|
|
8656
|
+
}
|
|
8657
|
+
}
|
|
8658
|
+
}, _callee2, this);
|
|
8659
|
+
}));
|
|
8660
|
+
|
|
8661
|
+
function asString(_x3, _x4) {
|
|
8662
|
+
return _asString.apply(this, arguments);
|
|
8663
|
+
}
|
|
8664
|
+
|
|
8665
|
+
return asString;
|
|
8666
|
+
}()
|
|
8667
|
+
}, {
|
|
8668
|
+
key: "asInteger",
|
|
8669
|
+
value: function () {
|
|
8670
|
+
var _asInteger = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(name, resourceID) {
|
|
8671
|
+
var paramArr;
|
|
8672
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
8673
|
+
while (1) {
|
|
8674
|
+
switch (_context3.prev = _context3.next) {
|
|
8675
|
+
case 0:
|
|
8676
|
+
_context3.next = 2;
|
|
8677
|
+
return this.getParam(name, resourceID);
|
|
8678
|
+
|
|
8679
|
+
case 2:
|
|
8680
|
+
paramArr = _context3.sent;
|
|
8681
|
+
return _context3.abrupt("return", parseInt(this.getValue(paramArr)));
|
|
8682
|
+
|
|
8683
|
+
case 4:
|
|
8684
|
+
case "end":
|
|
8685
|
+
return _context3.stop();
|
|
8686
|
+
}
|
|
8687
|
+
}
|
|
8688
|
+
}, _callee3, this);
|
|
8689
|
+
}));
|
|
8690
|
+
|
|
8691
|
+
function asInteger(_x5, _x6) {
|
|
8692
|
+
return _asInteger.apply(this, arguments);
|
|
8693
|
+
}
|
|
8694
|
+
|
|
8695
|
+
return asInteger;
|
|
8696
|
+
}()
|
|
8697
|
+
}, {
|
|
8698
|
+
key: "asFloat",
|
|
8699
|
+
value: function () {
|
|
8700
|
+
var _asFloat = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(name, resourceID) {
|
|
8701
|
+
var paramArr;
|
|
8702
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
8703
|
+
while (1) {
|
|
8704
|
+
switch (_context4.prev = _context4.next) {
|
|
8705
|
+
case 0:
|
|
8706
|
+
_context4.next = 2;
|
|
8707
|
+
return this.getParam(name, resourceID);
|
|
8708
|
+
|
|
8709
|
+
case 2:
|
|
8710
|
+
paramArr = _context4.sent;
|
|
8711
|
+
return _context4.abrupt("return", parseFloat(this.getValue(paramArr)));
|
|
8712
|
+
|
|
8713
|
+
case 4:
|
|
8714
|
+
case "end":
|
|
8715
|
+
return _context4.stop();
|
|
8716
|
+
}
|
|
8717
|
+
}
|
|
8718
|
+
}, _callee4, this);
|
|
8719
|
+
}));
|
|
8720
|
+
|
|
8721
|
+
function asFloat(_x7, _x8) {
|
|
8722
|
+
return _asFloat.apply(this, arguments);
|
|
8723
|
+
}
|
|
8724
|
+
|
|
8725
|
+
return asFloat;
|
|
8726
|
+
}()
|
|
8727
|
+
}, {
|
|
8728
|
+
key: "asBoolean",
|
|
8729
|
+
value: function () {
|
|
8730
|
+
var _asBoolean = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(name, resourceID) {
|
|
8731
|
+
var paramArr;
|
|
8732
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
8733
|
+
while (1) {
|
|
8734
|
+
switch (_context5.prev = _context5.next) {
|
|
8735
|
+
case 0:
|
|
8736
|
+
_context5.next = 2;
|
|
8737
|
+
return this.getParam(name, resourceID);
|
|
8738
|
+
|
|
8739
|
+
case 2:
|
|
8740
|
+
paramArr = _context5.sent;
|
|
8741
|
+
return _context5.abrupt("return", this.getValue(paramArr) == "S");
|
|
8742
|
+
|
|
8743
|
+
case 4:
|
|
8744
|
+
case "end":
|
|
8745
|
+
return _context5.stop();
|
|
8746
|
+
}
|
|
8747
|
+
}
|
|
8748
|
+
}, _callee5, this);
|
|
8749
|
+
}));
|
|
8750
|
+
|
|
8751
|
+
function asBoolean(_x9, _x10) {
|
|
8752
|
+
return _asBoolean.apply(this, arguments);
|
|
8753
|
+
}
|
|
8754
|
+
|
|
8755
|
+
return asBoolean;
|
|
8756
|
+
}()
|
|
8757
|
+
}, {
|
|
8758
|
+
key: "asDate",
|
|
8759
|
+
value: function () {
|
|
8760
|
+
var _asDate = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(name, resourceID) {
|
|
8761
|
+
var paramArr;
|
|
8762
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
8763
|
+
while (1) {
|
|
8764
|
+
switch (_context6.prev = _context6.next) {
|
|
8765
|
+
case 0:
|
|
8766
|
+
_context6.next = 2;
|
|
8767
|
+
return this.getParam(name, resourceID);
|
|
8768
|
+
|
|
8769
|
+
case 2:
|
|
8770
|
+
paramArr = _context6.sent;
|
|
8771
|
+
return _context6.abrupt("return", DateUtils.strToDate(this.getValue(paramArr)));
|
|
8772
|
+
|
|
8773
|
+
case 4:
|
|
8774
|
+
case "end":
|
|
8775
|
+
return _context6.stop();
|
|
8776
|
+
}
|
|
8777
|
+
}
|
|
8778
|
+
}, _callee6, this);
|
|
8779
|
+
}));
|
|
8780
|
+
|
|
8781
|
+
function asDate(_x11, _x12) {
|
|
8782
|
+
return _asDate.apply(this, arguments);
|
|
8783
|
+
}
|
|
8784
|
+
|
|
8785
|
+
return asDate;
|
|
8786
|
+
}()
|
|
8787
|
+
}, {
|
|
8788
|
+
key: "getBatchParams",
|
|
8789
|
+
value: function () {
|
|
8790
|
+
var _getBatchParams = parameters_fecher_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(names, resourceID) {
|
|
8791
|
+
var paramArr, response;
|
|
8792
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
8793
|
+
while (1) {
|
|
8794
|
+
switch (_context7.prev = _context7.next) {
|
|
8795
|
+
case 0:
|
|
8796
|
+
_context7.next = 2;
|
|
8797
|
+
return this.getParam(names.join(","), resourceID);
|
|
8798
|
+
|
|
8799
|
+
case 2:
|
|
8800
|
+
paramArr = _context7.sent;
|
|
8801
|
+
//TODO: try to typed params val?
|
|
8802
|
+
response = {};
|
|
8803
|
+
paramArr.forEach(function (param) {
|
|
8804
|
+
return response[param.name] = param.value;
|
|
8805
|
+
});
|
|
8806
|
+
return _context7.abrupt("return", response);
|
|
8807
|
+
|
|
8808
|
+
case 6:
|
|
8809
|
+
case "end":
|
|
8810
|
+
return _context7.stop();
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
}, _callee7, this);
|
|
8814
|
+
}));
|
|
8815
|
+
|
|
8816
|
+
function getBatchParams(_x13, _x14) {
|
|
8817
|
+
return _getBatchParams.apply(this, arguments);
|
|
8818
|
+
}
|
|
8819
|
+
|
|
8820
|
+
return getBatchParams;
|
|
8821
|
+
}()
|
|
8822
|
+
}, {
|
|
8823
|
+
key: "getValue",
|
|
8824
|
+
value: function getValue() {
|
|
8825
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8826
|
+
|
|
8827
|
+
if (Array.isArray(obj) && obj.length > 0) {
|
|
8828
|
+
obj = obj[0];
|
|
8829
|
+
}
|
|
8830
|
+
|
|
8831
|
+
if (StringUtils.isEmpty(obj.value)) return "";
|
|
8832
|
+
return obj.value;
|
|
8833
|
+
}
|
|
8834
|
+
}]);
|
|
8835
|
+
|
|
8836
|
+
return ParametersFetcher;
|
|
8837
|
+
}();
|
|
8838
|
+
|
|
8839
|
+
|
|
8840
|
+
;// CONCATENATED MODULE: ./src/lib/application/AppParameterProvider.ts
|
|
8841
|
+
function AppParameterProvider_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8842
|
+
|
|
8843
|
+
function AppParameterProvider_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { AppParameterProvider_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { AppParameterProvider_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8844
|
+
|
|
8845
|
+
function AppParameterProvider_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8846
|
+
|
|
8847
|
+
function AppParameterProvider_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
8848
|
+
|
|
8849
|
+
function AppParameterProvider_createClass(Constructor, protoProps, staticProps) { if (protoProps) AppParameterProvider_defineProperties(Constructor.prototype, protoProps); if (staticProps) AppParameterProvider_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8850
|
+
|
|
8851
|
+
function AppParameterProvider_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8852
|
+
|
|
8853
|
+
|
|
8854
|
+
|
|
8855
|
+
var AppParameterProvider = /*#__PURE__*/function () {
|
|
8856
|
+
function AppParameterProvider(resourceID) {
|
|
8857
|
+
AppParameterProvider_classCallCheck(this, AppParameterProvider);
|
|
8858
|
+
|
|
8859
|
+
AppParameterProvider_defineProperty(this, "resourceID", void 0);
|
|
8860
|
+
|
|
8861
|
+
AppParameterProvider_defineProperty(this, "paramFetcher", void 0);
|
|
8862
|
+
|
|
8863
|
+
this.resourceID = resourceID;
|
|
8864
|
+
this.paramFetcher = new ParametersFetcher();
|
|
8865
|
+
}
|
|
8866
|
+
|
|
8867
|
+
AppParameterProvider_createClass(AppParameterProvider, [{
|
|
8868
|
+
key: "asString",
|
|
8869
|
+
value: function () {
|
|
8870
|
+
var _asString = AppParameterProvider_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name) {
|
|
8871
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8872
|
+
while (1) {
|
|
8873
|
+
switch (_context.prev = _context.next) {
|
|
8874
|
+
case 0:
|
|
8875
|
+
return _context.abrupt("return", this.paramFetcher.asString(name, this.resourceID));
|
|
8876
|
+
|
|
8877
|
+
case 1:
|
|
8878
|
+
case "end":
|
|
8879
|
+
return _context.stop();
|
|
8880
|
+
}
|
|
8881
|
+
}
|
|
8882
|
+
}, _callee, this);
|
|
8883
|
+
}));
|
|
8884
|
+
|
|
8885
|
+
function asString(_x) {
|
|
8886
|
+
return _asString.apply(this, arguments);
|
|
8887
|
+
}
|
|
8888
|
+
|
|
8889
|
+
return asString;
|
|
8890
|
+
}()
|
|
8891
|
+
}, {
|
|
8892
|
+
key: "asInteger",
|
|
8893
|
+
value: function () {
|
|
8894
|
+
var _asInteger = AppParameterProvider_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(name) {
|
|
8895
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
8896
|
+
while (1) {
|
|
8897
|
+
switch (_context2.prev = _context2.next) {
|
|
8898
|
+
case 0:
|
|
8899
|
+
return _context2.abrupt("return", this.paramFetcher.asInteger(name, this.resourceID));
|
|
8900
|
+
|
|
8901
|
+
case 1:
|
|
8902
|
+
case "end":
|
|
8903
|
+
return _context2.stop();
|
|
8904
|
+
}
|
|
8905
|
+
}
|
|
8906
|
+
}, _callee2, this);
|
|
8907
|
+
}));
|
|
8908
|
+
|
|
8909
|
+
function asInteger(_x2) {
|
|
8910
|
+
return _asInteger.apply(this, arguments);
|
|
8911
|
+
}
|
|
8912
|
+
|
|
8913
|
+
return asInteger;
|
|
8914
|
+
}()
|
|
8915
|
+
}, {
|
|
8916
|
+
key: "asFloat",
|
|
8917
|
+
value: function () {
|
|
8918
|
+
var _asFloat = AppParameterProvider_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(name) {
|
|
8919
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
8920
|
+
while (1) {
|
|
8921
|
+
switch (_context3.prev = _context3.next) {
|
|
8922
|
+
case 0:
|
|
8923
|
+
return _context3.abrupt("return", this.paramFetcher.asFloat(name, this.resourceID));
|
|
8924
|
+
|
|
8925
|
+
case 1:
|
|
8926
|
+
case "end":
|
|
8927
|
+
return _context3.stop();
|
|
8928
|
+
}
|
|
8929
|
+
}
|
|
8930
|
+
}, _callee3, this);
|
|
8931
|
+
}));
|
|
8932
|
+
|
|
8933
|
+
function asFloat(_x3) {
|
|
8934
|
+
return _asFloat.apply(this, arguments);
|
|
8935
|
+
}
|
|
8936
|
+
|
|
8937
|
+
return asFloat;
|
|
8938
|
+
}()
|
|
8939
|
+
}, {
|
|
8940
|
+
key: "asBoolean",
|
|
8941
|
+
value: function () {
|
|
8942
|
+
var _asBoolean = AppParameterProvider_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(name) {
|
|
8943
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
8944
|
+
while (1) {
|
|
8945
|
+
switch (_context4.prev = _context4.next) {
|
|
8946
|
+
case 0:
|
|
8947
|
+
return _context4.abrupt("return", this.paramFetcher.asBoolean(name, this.resourceID));
|
|
8948
|
+
|
|
8949
|
+
case 1:
|
|
8950
|
+
case "end":
|
|
8951
|
+
return _context4.stop();
|
|
8952
|
+
}
|
|
8953
|
+
}
|
|
8954
|
+
}, _callee4, this);
|
|
8955
|
+
}));
|
|
8956
|
+
|
|
8957
|
+
function asBoolean(_x4) {
|
|
8958
|
+
return _asBoolean.apply(this, arguments);
|
|
8959
|
+
}
|
|
8960
|
+
|
|
8961
|
+
return asBoolean;
|
|
8962
|
+
}()
|
|
8963
|
+
}, {
|
|
8964
|
+
key: "asDate",
|
|
8965
|
+
value: function () {
|
|
8966
|
+
var _asDate = AppParameterProvider_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(name) {
|
|
8967
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
8968
|
+
while (1) {
|
|
8969
|
+
switch (_context5.prev = _context5.next) {
|
|
8970
|
+
case 0:
|
|
8971
|
+
return _context5.abrupt("return", this.paramFetcher.asDate(name, this.resourceID));
|
|
8972
|
+
|
|
8973
|
+
case 1:
|
|
8974
|
+
case "end":
|
|
8975
|
+
return _context5.stop();
|
|
8976
|
+
}
|
|
8977
|
+
}
|
|
8978
|
+
}, _callee5, this);
|
|
8979
|
+
}));
|
|
8980
|
+
|
|
8981
|
+
function asDate(_x5) {
|
|
8982
|
+
return _asDate.apply(this, arguments);
|
|
8983
|
+
}
|
|
8984
|
+
|
|
8985
|
+
return asDate;
|
|
8986
|
+
}()
|
|
8987
|
+
}]);
|
|
8988
|
+
|
|
8989
|
+
return AppParameterProvider;
|
|
8990
|
+
}();
|
|
8991
|
+
|
|
8992
|
+
|
|
8492
8993
|
;// CONCATENATED MODULE: ./src/lib/application/SankhyaAppProvider.ts
|
|
8493
8994
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8494
8995
|
|
|
@@ -8520,6 +9021,7 @@ function SankhyaAppProvider_defineProperty(obj, key, value) { if (key in obj) {
|
|
|
8520
9021
|
|
|
8521
9022
|
|
|
8522
9023
|
|
|
9024
|
+
|
|
8523
9025
|
var SankhyaAppProvider = /*#__PURE__*/function (_ApplicationUtils) {
|
|
8524
9026
|
_inherits(SankhyaAppProvider, _ApplicationUtils);
|
|
8525
9027
|
|
|
@@ -8532,14 +9034,22 @@ var SankhyaAppProvider = /*#__PURE__*/function (_ApplicationUtils) {
|
|
|
8532
9034
|
}
|
|
8533
9035
|
|
|
8534
9036
|
SankhyaAppProvider_createClass(SankhyaAppProvider, null, [{
|
|
9037
|
+
key: "parameters",
|
|
9038
|
+
get: function get() {
|
|
9039
|
+
return SankhyaAppProvider._parameters;
|
|
9040
|
+
}
|
|
9041
|
+
}, {
|
|
8535
9042
|
key: "getResourceID",
|
|
8536
9043
|
value: function getResourceID() {
|
|
8537
9044
|
var defaultValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
|
|
8538
|
-
return SankhyaAppProvider.urlParams.get("workspaceResourceID") || SankhyaAppProvider.urlParams.get("resourceI") || defaultValue || "unknown.resource.id";
|
|
9045
|
+
return SankhyaAppProvider.urlParams.get("workspaceResourceID") || SankhyaAppProvider.urlParams.get("resourceI") || defaultValue || Workspace.resourceID || "unknown.resource.id";
|
|
8539
9046
|
}
|
|
8540
9047
|
}, {
|
|
8541
9048
|
key: "temOpcional",
|
|
8542
9049
|
value: function temOpcional(opcional) {
|
|
9050
|
+
var abs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
9051
|
+
|
|
9052
|
+
//window.alert("Teste");
|
|
8543
9053
|
if (SankhyaAppProvider.getAttributeFromHTMLWrapper("opc0009") === "1") {
|
|
8544
9054
|
return true;
|
|
8545
9055
|
}
|
|
@@ -8576,6 +9086,7 @@ var SankhyaAppProvider = /*#__PURE__*/function (_ApplicationUtils) {
|
|
|
8576
9086
|
SankhyaAppProvider.dataUnitByEntity.set(entityName, dataUnit);
|
|
8577
9087
|
}
|
|
8578
9088
|
|
|
9089
|
+
dataUnit.loadMetadata();
|
|
8579
9090
|
return dataUnit;
|
|
8580
9091
|
}
|
|
8581
9092
|
/*public static getForm(entityName:string):any{
|
|
@@ -8604,6 +9115,8 @@ SankhyaAppProvider_defineProperty(SankhyaAppProvider, "urlParams", UrlUtils.getQ
|
|
|
8604
9115
|
|
|
8605
9116
|
SankhyaAppProvider_defineProperty(SankhyaAppProvider, "dataUnitByEntity", new Map());
|
|
8606
9117
|
|
|
9118
|
+
SankhyaAppProvider_defineProperty(SankhyaAppProvider, "_parameters", new AppParameterProvider(SankhyaAppProvider.getResourceID()));
|
|
9119
|
+
|
|
8607
9120
|
|
|
8608
9121
|
;// CONCATENATED MODULE: ./src/lib/http/fetchers/application-config-fetcher.ts
|
|
8609
9122
|
var application_config_fetcher_templateObject;
|